mirror of
https://github.com/dhewm/dhewm3-sdk.git
synced 2024-11-28 07:12:26 +00:00
Port CMake changes from dhewm3 (up to "Fix runtime assert on PPC OS X")
- (Hopefully) better workaround for miscompiled cross products, #147 (-ffp-contract=off) - GCC/Clang: Remove -fno-unsafe-math-optimizations (redundant as long as -ffast-math isn't used) - Fix runtime assert on PPC OS X (-mone-byte-bool)
This commit is contained in:
parent
2e2ca7c5d5
commit
14e6d366bf
1 changed files with 8 additions and 5 deletions
|
@ -138,14 +138,17 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
|
||||||
set(CMAKE_C_FLAGS_DEBUG "-g -D_DEBUG -O0")
|
set(CMAKE_C_FLAGS_DEBUG "-g -D_DEBUG -O0")
|
||||||
set(CMAKE_C_FLAGS_DEBUGALL "-g -ggdb -D_DEBUG")
|
set(CMAKE_C_FLAGS_DEBUGALL "-g -ggdb -D_DEBUG")
|
||||||
set(CMAKE_C_FLAGS_PROFILE "-g -ggdb -D_DEBUG -O1 -fno-omit-frame-pointer")
|
set(CMAKE_C_FLAGS_PROFILE "-g -ggdb -D_DEBUG -O1 -fno-omit-frame-pointer")
|
||||||
set(CMAKE_C_FLAGS_RELEASE "-O2 -fno-unsafe-math-optimizations -fno-math-errno -fno-trapping-math -fomit-frame-pointer")
|
set(CMAKE_C_FLAGS_RELEASE "-O2 -fno-math-errno -fno-trapping-math -fomit-frame-pointer")
|
||||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -g -ggdb -fno-unsafe-math-optimizations -fno-math-errno -fno-trapping-math -fno-omit-frame-pointer")
|
set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -g -ggdb -fno-math-errno -fno-trapping-math -fno-omit-frame-pointer")
|
||||||
set(CMAKE_C_FLAGS_MINSIZEREL "-Os -fno-unsafe-math-optimizations -fno-math-errno -fno-trapping-math -fomit-frame-pointer")
|
set(CMAKE_C_FLAGS_MINSIZEREL "-Os -fno-math-errno -fno-trapping-math -fomit-frame-pointer")
|
||||||
|
|
||||||
set(CMAKE_CXX_FLAGS_DEBUGALL ${CMAKE_C_FLAGS_DEBUGALL})
|
set(CMAKE_CXX_FLAGS_DEBUGALL ${CMAKE_C_FLAGS_DEBUGALL})
|
||||||
set(CMAKE_CXX_FLAGS_PROFILE ${CMAKE_C_FLAGS_PROFILE})
|
set(CMAKE_CXX_FLAGS_PROFILE ${CMAKE_C_FLAGS_PROFILE})
|
||||||
|
|
||||||
add_compile_options(-fno-strict-aliasing)
|
add_compile_options(-fno-strict-aliasing)
|
||||||
|
# dear idiot compilers, don't fuck up math code with useless FMA "optimizations"
|
||||||
|
# (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100839)
|
||||||
|
add_compile_options(-ffp-contract=off)
|
||||||
|
|
||||||
if(NOT AROS)
|
if(NOT AROS)
|
||||||
CHECK_CXX_COMPILER_FLAG("-fvisibility=hidden" cxx_has_fvisibility)
|
CHECK_CXX_COMPILER_FLAG("-fvisibility=hidden" cxx_has_fvisibility)
|
||||||
|
@ -198,8 +201,8 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
|
||||||
elseif(cpu STREQUAL "ppc")
|
elseif(cpu STREQUAL "ppc")
|
||||||
CHECK_CXX_COMPILER_FLAG("-arch ppc" cxx_has_arch_ppc)
|
CHECK_CXX_COMPILER_FLAG("-arch ppc" cxx_has_arch_ppc)
|
||||||
if(cxx_has_arch_ppc)
|
if(cxx_has_arch_ppc)
|
||||||
add_compile_options(-arch ppc)
|
add_compile_options(-arch ppc -mone-byte-bool)
|
||||||
set(ldflags "${ldflags} -arch ppc")
|
set(ldflags "${ldflags} -arch ppc -mone-byte-bool")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_compile_options(-mmacosx-version-min=10.4)
|
add_compile_options(-mmacosx-version-min=10.4)
|
||||||
|
|
Loading…
Reference in a new issue