From 4de978719803587339f82978a5303dee1de7ba68 Mon Sep 17 00:00:00 2001 From: Eduardo Bart Date: Tue, 5 Jun 2012 09:39:45 -0300 Subject: [PATCH] new gcc compile optimizations --- src/framework/CMakeLists.txt | 12 +++++------- src/otclient/core/game.cpp | 1 + 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/framework/CMakeLists.txt b/src/framework/CMakeLists.txt index 67e9e3cc..9890c3ac 100644 --- a/src/framework/CMakeLists.txt +++ b/src/framework/CMakeLists.txt @@ -19,17 +19,15 @@ ENDIF() # setup compiler options SET(CXX_WARNS "-Wall -Wextra -Werror -Wno-unused-parameter -Wno-unused-but-set-variable") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX_WARNS} -std=gnu++0x -pipe") -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CXX_WARNS} -pipe") SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -ggdb") -SET(CMAKE_C_FLAGS_DEBUG "-O0 -ggdb") SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O1 -ggdb") -SET(CMAKE_C_FLAGS_RELWITHDEBINFO "-O1 -ggdb") -SET(CMAKE_CXX_FLAGS_RELEASE "-Os -ffast-math") -SET(CMAKE_C_FLAGS_RELEASE "-Os -ffast-math") -SET(CMAKE_CXX_FLAGS_RELFORPERFORMANCE "-Ofast -mmmx -msse -msse2") -SET(CMAKE_C_FLAGS_RELFORPERFORMANCE "-Ofast -mmmx -msse -msse2") +SET(CMAKE_CXX_FLAGS_RELEASE "-Ofast -fomit-frame-pointer -mmmx -msse -msse2 -mfpmath=sse") SET(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} -static-libgcc -static-libstdc++ -Wl,--as-needed") +IF(CMAKE_BUILD_TYPE STREQUAL "Release") + SET(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} -Wl,-O1,--sort-common,--relax,-s") +ENDIF() + MESSAGE(STATUS "Build type: " ${CMAKE_BUILD_TYPE}) ADD_DEFINITIONS(-D"BUILD_TYPE=\\\"${CMAKE_BUILD_TYPE}\\\"") diff --git a/src/otclient/core/game.cpp b/src/otclient/core/game.cpp index dcd10716..b12d0ad7 100644 --- a/src/otclient/core/game.cpp +++ b/src/otclient/core/game.cpp @@ -108,6 +108,7 @@ void Game::processGameStart(const LocalPlayerPtr& localPlayer, int serverBeat, b resetGameStates(); m_localPlayer = localPlayer; + m_localPlayer->setName(m_characterName); m_serverBeat = serverBeat; m_canReportBugs = canReportBugs;