diff --git a/CMakeLists.txt b/CMakeLists.txt index 3fca2f2e..1d148155 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,3 +1,5 @@ +cmake_policy(SET CMP0003 OLD) # or cmake_policy(VERSION 2.4) + cmake_minimum_required(VERSION 2.8) project(stellabellum C CXX) @@ -70,12 +72,12 @@ elseif (UNIX) # linker flags if (${CMAKE_BUILD_TYPE} STREQUAL "RELWITHDEBINFO" OR ${CMAKE_BUILD_TYPE} STREQUAL "MINSIZEREL") set(CMAKE_SHARED_LINKER_FLAGS "-Wl,-z,norelro,-O3,--sort-common,--as-needed,--relax,-z,combreloc,-z,global,--no-omagic") - set(CMAKE_EXE_LINKER_FLAGS "-Wl,-z,norelro,-O3,--sort-common,--as-needed,--relax,-z,combreloc,-z,global,--no-omagic") else () set(CMAKE_SHARED_LINKER_FLAGS "-Wl,-z,norelro,-O3,--sort-common,--as-needed,--relax,-z,combreloc,-z,global,--no-omagic,-x,-s") - set(CMAKE_EXE_LINKER_FLAGS "-Wl,-z,norelro,-O3,--sort-common,--as-needed,--relax,-z,combreloc,-z,global,--no-omagic,-x,-s") endif () + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}") + # don't put anything too crazy in debug...and any common flags go into CMAKE_CXX_FLAGS set(CMAKE_CXX_FLAGS_DEBUG "-D_DEBUG -DDEBUG_LEVEL=2 -DPRODUCTION=0 -O0 -g3") @@ -86,26 +88,28 @@ elseif (UNIX) set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELEASE}") set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_RELEASE}") - # Ofast doesn't work with gcc builds + # Currently use of clang compiler is breaking some bins, miff & templateCompiler. For dev we will use gcc compiler for now. if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Ofast \ - -fno-threadsafe-statics -fslp-vectorize \ - -fno-stack-protector -fstrict-enums -finline-hint-functions \ - -fno-coverage-mapping -fno-spell-checking \ - -mno-retpoline") + -fno-signed-zeros -freciprocal-math -ffp-contract=fast \ + -fno-threadsafe-statics -fslp-vectorize-aggressive -fslp-vectorize \ + -fno-stack-protector -fstrict-enums -fstrict-vtable-pointers \ + -fno-coverage-mapping -fno-spell-checking -fshort-enums -finline-functions \ + -finline-hint-functions -fno-unroll-loops") set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -ggdb") # RELWITHDEBINFO is used for building bins that produce profdata files # we only need the basics of our heavy optimizations here, i think - that and one of these flags # breaks JNI when we profile - set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-Ofast -finline-hint-functions -fprofile-instr-generate") + set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-Ofast -fno-unroll-loops -finline-functions \ + -finline-hint-functions -fprofile-instr-generate") # MINSIZEREL is used for profiled, flto builds set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_RELEASE} -flto -fwhole-program-vtables") elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") - # O3 and Ofast include one or more flags that cause java to crash when using gcc6 - set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O2 -fno-signed-zeros -freciprocal-math -fno-unroll-loops -fno-tree-loop-optimize") + # making changes for all bins to compile correctly with gcc5.4 or gcc6.4 we will test -O3 later + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O2 -fno-signed-zeros -freciprocal-math") set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Og") elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel") set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3") @@ -113,12 +117,17 @@ elseif (UNIX) # our "always on" flags - build by default for the system we're on but include all instruction sets set(CMAKE_CXX_FLAGS "-m32 -pipe -march=native -mtune=native \ + -msse -msse2 -msse3 -mmmx -m3dnow \ -Wformat -Wno-overloaded-virtual -Wno-missing-braces -Wno-format \ -Wno-write-strings -Wno-unknown-pragmas \ -Wno-uninitialized -Wno-reorder -Wno-tautological-constant-out-of-range-compare") - # if you'd like to opt in to our statistics, remove "-DSTELLA_INTERNAL" and your server will send us a heartbeat at startup - add_definitions(-DLINUX -D_REENTRANT -Dlinux -D_USING_STL -D_GNU_SOURCE -D_XOPEN_SOURCE=500 -U_FORTIFY_SOURCE -DSTELLA_INTERNAL) + add_definitions(-DLINUX -D_REENTRANT -Dlinux -D_USING_STL -D_GNU_SOURCE -D_XOPEN_SOURCE=500 -U_FORTIFY_SOURCE) + + # release and debug are internal use only + if (${CMAKE_BUILD_TYPE} STREQUAL "Debug" OR ${CMAKE_BUILD_TYPE} STREQUAL "Release") + add_definitions(-DSTELLA_INTERNAL) + endif () # this is so some profile specific stuff is turned on in the code if (${CMAKE_BUILD_TYPE} STREQUAL "RELWITHDEBINFO") @@ -129,3 +138,4 @@ endif () add_subdirectory(external) add_subdirectory(engine) add_subdirectory(game) + diff --git a/engine/server/application/CentralServer/src/linux/CentralServer.profdata b/engine/server/application/CentralServer/src/linux/CentralServer.profdata deleted file mode 100644 index 91647fb3..00000000 Binary files a/engine/server/application/CentralServer/src/linux/CentralServer.profdata and /dev/null differ diff --git a/engine/server/application/ChatServer/src/linux/ChatServer.profdata b/engine/server/application/ChatServer/src/linux/ChatServer.profdata deleted file mode 100644 index 26bbd877..00000000 Binary files a/engine/server/application/ChatServer/src/linux/ChatServer.profdata and /dev/null differ diff --git a/engine/server/application/CommoditiesServer/src/linux/CommoditiesServer.profdata b/engine/server/application/CommoditiesServer/src/linux/CommoditiesServer.profdata deleted file mode 100644 index 72c10de4..00000000 Binary files a/engine/server/application/CommoditiesServer/src/linux/CommoditiesServer.profdata and /dev/null differ diff --git a/engine/server/application/ConnectionServer/src/linux/ConnectionServer.profdata b/engine/server/application/ConnectionServer/src/linux/ConnectionServer.profdata deleted file mode 100644 index 29282771..00000000 Binary files a/engine/server/application/ConnectionServer/src/linux/ConnectionServer.profdata and /dev/null differ diff --git a/engine/server/application/LogServer/src/linux/LogServer.profdata b/engine/server/application/LogServer/src/linux/LogServer.profdata deleted file mode 100644 index 43f50088..00000000 Binary files a/engine/server/application/LogServer/src/linux/LogServer.profdata and /dev/null differ diff --git a/engine/server/application/LoginServer/src/linux/LoginServer.profdata b/engine/server/application/LoginServer/src/linux/LoginServer.profdata deleted file mode 100644 index 296b1ffe..00000000 Binary files a/engine/server/application/LoginServer/src/linux/LoginServer.profdata and /dev/null differ diff --git a/engine/server/application/PlanetServer/src/linux/PlanetServer.profdata b/engine/server/application/PlanetServer/src/linux/PlanetServer.profdata deleted file mode 100644 index 9ae349d2..00000000 Binary files a/engine/server/application/PlanetServer/src/linux/PlanetServer.profdata and /dev/null differ diff --git a/engine/server/application/TaskManager/src/linux/TaskManager.profdata b/engine/server/application/TaskManager/src/linux/TaskManager.profdata deleted file mode 100644 index aab8dc18..00000000 Binary files a/engine/server/application/TaskManager/src/linux/TaskManager.profdata and /dev/null differ diff --git a/game/server/application/SwgDatabaseServer/src/linux/SwgDatabaseServer.profdata b/game/server/application/SwgDatabaseServer/src/linux/SwgDatabaseServer.profdata deleted file mode 100644 index 14da98d1..00000000 Binary files a/game/server/application/SwgDatabaseServer/src/linux/SwgDatabaseServer.profdata and /dev/null differ diff --git a/game/server/application/SwgGameServer/src/linux/SwgGameServer.profdata b/game/server/application/SwgGameServer/src/linux/SwgGameServer.profdata deleted file mode 100644 index 362d29a9..00000000 Binary files a/game/server/application/SwgGameServer/src/linux/SwgGameServer.profdata and /dev/null differ