forked from oerkki/voxelands
clean up the flags and remove unneeded stuff
This commit is contained in:
parent
0a473eb389
commit
79d7252bc4
|
@ -34,6 +34,7 @@ endif()
|
|||
set(REBUILD_ICNS 0 CACHE BOOL "Rebuild icns from voxelands.svg .")
|
||||
|
||||
set(CPU_OPTS 0 CACHE BOOL "Enable CPU optimizations")
|
||||
set(CPUTYPE native CACHE STRING "CPU to optimize for")
|
||||
set(ENABLE_SSP 1 CACHE BOOL "Enable stack smashing protection")
|
||||
set(ENABLE_SAFESTACK 1 CACHE BOOL "Enable SafeStack if supported (LLVM only)")
|
||||
set(ENABLE_PIE 0 CACHE BOOL "Produce a Position Independent Executable")
|
||||
|
|
|
@ -373,10 +373,10 @@ else()
|
|||
set(ARCH x86_64)
|
||||
endif()
|
||||
|
||||
set(SAFETY_FLAGS "-fno-strict-aliasing -fwrapv -fvisibility=hidden")
|
||||
set(SAFETY_LDFLAGS "")
|
||||
set(SAFETY_FLAGS "-fwrapv")
|
||||
set(SAFETY_LDFLAGS "-Wl,-z,relro,-z,now")
|
||||
set(OPT_FLAGS "-O2 -fomit-frame-pointer")
|
||||
set(OPT_LDFLAGS "-Wl,-O1,--as-needed,--discard-all,--no-undefined,-s,--sort-common,-z,relro,-z,now")
|
||||
set(OPT_LDFLAGS "-Wl,-O1,--sort-common,-s")
|
||||
|
||||
if(ENABLE_SSP)
|
||||
CHECK_CXX_COMPILER_FLAG("-fstack-protector-strong" HAS_FSTACK_STRONG)
|
||||
|
@ -390,15 +390,15 @@ else()
|
|||
CHECK_CXX_COMPILER_FLAG("-fsanitize=safe-stack" HAS_SAFESTACK)
|
||||
if(HAS_SAFESTACK)
|
||||
set(SAFETY_FLAGS "${SAFETY_FLAGS} -fsanitize=safe-stack")
|
||||
set(SAFETY_LDFLAGS "-fsanitize=safe-stack -lrt")
|
||||
set(SAFETY_LDFLAGS "${SAFETY_LDFLAGS} -fsanitize=safe-stack -lrt")
|
||||
endif()
|
||||
endif()
|
||||
if(ENABLE_PIE)
|
||||
set(SAFETY_FLAGS "${SAFETY_FLAGS} -fPIC -fPIE")
|
||||
set(SAFETY_LDFLAGS "${LINKER_FLAGS} -Wl,-pie")
|
||||
set(SAFETY_LDFLAGS "${SAFETY_LDFLAGS} -Wl,-pie")
|
||||
endif()
|
||||
if(CPU_OPTS)
|
||||
set(OPT_FLAGS "${OPT_FLAGS} -march=native -mtune=native")
|
||||
set(OPT_FLAGS "${OPT_FLAGS} -march=${CPUTYPE}")
|
||||
endif()
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue