diff --git a/CMakeLists.txt b/CMakeLists.txt index 4396dfec..19f76e64 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -47,6 +47,7 @@ option(USE_NOVGUI_SCOREBOARD "Prefer non-VGUI Scoreboard when USE_VGUI is enable option(USE_VOICEMGR "Enable VOICE MANAGER." OFF) option(BUILD_CLIENT "Build client dll" ON) option(BUILD_SERVER "Build server dll" ON) +option(LTO "Enable interprocedural optimization" OFF) option(POLLY "Enable pollyhedral optimization" OFF) if(CMAKE_SIZEOF_VOID_P EQUAL 4 OR @@ -153,11 +154,13 @@ if(VITA) add_compile_options(-fno-use-cxa-atexit) endif() -check_ipo_supported(RESULT HAVE_LTO OUTPUT LTO_ERROR) -if(HAVE_LTO) - message(STATUS "IPO / LTO enabled") -else() - message(STATUS "IPO / LTO not supported: ${LTO_ERROR}") +if(LTO) + check_ipo_supported(RESULT HAVE_LTO OUTPUT LTO_ERROR) + if(HAVE_LTO) + message(STATUS "IPO / LTO enabled") + else() + message(STATUS "IPO / LTO not supported: ${LTO_ERROR}") + endif() endif() check_include_file("tgmath.h" HAVE_TGMATH_H) diff --git a/cl_dll/CMakeLists.txt b/cl_dll/CMakeLists.txt index 9375de27..37c03d7c 100644 --- a/cl_dll/CMakeLists.txt +++ b/cl_dll/CMakeLists.txt @@ -43,10 +43,6 @@ if(NOT MSVC) add_compile_options(-fomit-frame-pointer) # GCC/Clang flag add_compile_options(-ftree-vectorize) # GCC/Clang flag add_compile_options(-funsafe-math-optimizations) # GCC/Clang flag - if(CMAKE_SYSTEM_NAME STREQUAL "Android") - add_compile_options(-O3 -DNDEBUG) # gradle compiles release builds with RelWithDebInfo(-O2 -g) and strips debug symbols. - target_link_options(${CLDLL_LIBRARY} PUBLIC "LINKER:-O3") - endif() endif() else() add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE) diff --git a/dlls/CMakeLists.txt b/dlls/CMakeLists.txt index 07d9f988..d7801f6c 100644 --- a/dlls/CMakeLists.txt +++ b/dlls/CMakeLists.txt @@ -39,10 +39,6 @@ if(NOT MSVC) add_compile_options(-fomit-frame-pointer) # GCC/Clang flag add_compile_options(-ftree-vectorize) # GCC/Clang flag add_compile_options(-funsafe-math-optimizations) # GCC/Clang flag - if(CMAKE_SYSTEM_NAME STREQUAL "Android") - add_compile_options(-O3 -DNDEBUG) # gradle compiles release builds with RelWithDebInfo(-O2 -g) and strips debug symbols. - target_link_options(${SVDLL_LIBRARY} PUBLIC "LINKER:-O3") - endif() endif() else() add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE)