mirror of
https://github.com/FWGS/hlsdk-xash3d
synced 2024-11-22 01:47:45 +01:00
cmake: add more release optimization flags.
This commit is contained in:
parent
86c00428f5
commit
554dc51472
@ -36,6 +36,17 @@ if(NOT MSVC)
|
||||
if(NOT MINGW)
|
||||
add_definitions(-D_snprintf=snprintf -D_vsnprintf=vsnprintf)
|
||||
endif()
|
||||
if(CMAKE_BUILD_TYPE MATCHES "Release"
|
||||
OR (CMAKE_BUILD_TYPE MATCHES "RelWithDebInfo"
|
||||
AND CMAKE_SYSTEM_NAME STREQUAL "Android"))
|
||||
add_compile_options(-fno-unwind-tables -fno-asynchronous-unwind-tables) # GCC/Clang flag
|
||||
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.
|
||||
endif()
|
||||
endif()
|
||||
else()
|
||||
add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE)
|
||||
endif()
|
||||
|
@ -32,6 +32,17 @@ if(NOT MSVC)
|
||||
add_compile_options(-fvisibility=hidden) # GCC/Clang flag
|
||||
add_definitions(-D_LINUX) # It seems enough for all non-Win32 systems
|
||||
add_definitions(-Dstricmp=strcasecmp -Dstrnicmp=strncasecmp -D_snprintf=snprintf -D_vsnprintf=vsnprintf )
|
||||
if(CMAKE_BUILD_TYPE MATCHES "Release"
|
||||
OR (CMAKE_BUILD_TYPE MATCHES "RelWithDebInfo"
|
||||
AND CMAKE_SYSTEM_NAME STREQUAL "Android"))
|
||||
add_compile_options(-fno-unwind-tables -fno-asynchronous-unwind-tables) # GCC/Clang flag
|
||||
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.
|
||||
endif()
|
||||
endif()
|
||||
else()
|
||||
add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE)
|
||||
endif()
|
||||
|
Loading…
Reference in New Issue
Block a user