[cmake] unify -fno-omit-frame-pointer
This commit is contained in:
parent
c43242fdde
commit
bc70bbd30e
@ -239,10 +239,6 @@ if(CMAKE_COMPILER_IS_GNUCC)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(CMAKE_COMPILER_IS_CLANG)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-c11-extensions -Wno-gnu")
|
||||
endif()
|
||||
|
||||
set(THREAD_PREFER_PTHREAD_FLAG TRUE)
|
||||
|
||||
if(NOT IOS)
|
||||
@ -251,12 +247,6 @@ endif()
|
||||
|
||||
# Enable address sanitizer, where supported and when required
|
||||
if(CMAKE_COMPILER_IS_CLANG OR CMAKE_COMPILER_IS_GNUCC)
|
||||
CHECK_C_COMPILER_FLAG ("-fno-omit-frame-pointer" fno-omit-frame-pointer)
|
||||
|
||||
if (fno-omit-frame-pointer)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-omit-frame-pointer")
|
||||
endif()
|
||||
|
||||
set(CMAKE_REQUIRED_LINK_OPTIONS_SAVED ${CMAKE_REQUIRED_LINK_OPTIONS})
|
||||
file(WRITE ${PROJECT_BINARY_DIR}/foo.txt "")
|
||||
if(WITH_SANITIZE_ADDRESS)
|
||||
|
@ -48,6 +48,7 @@ if (ENABLE_WARNING_VERBOSE)
|
||||
-Wno-c++98-compat-pedantic
|
||||
-Wno-pre-c++17-compat
|
||||
-Wno-exit-time-destructors
|
||||
-Wno-gnu-zero-variadic-macro-arguments
|
||||
)
|
||||
endif()
|
||||
|
||||
@ -61,6 +62,8 @@ if (ENABLE_WARNING_ERROR)
|
||||
CheckCXXFlag(-Werror)
|
||||
endif()
|
||||
|
||||
CheckCXXFlag(-fno-omit-frame-pointer)
|
||||
|
||||
CheckCXXFlag(-fmacro-prefix-map="${CMAKE_SOURCE_DIR}"="./")
|
||||
CheckCXXFlag(-fmacro-prefix-map="${CMAKE_BINARY_DIR}"="./build/")
|
||||
CheckCXXFlag(-ffile-prefix-map="${CMAKE_SOURCE_DIR}"="./")
|
||||
|
@ -44,6 +44,7 @@ if (ENABLE_WARNING_VERBOSE)
|
||||
-Wno-covered-switch-default
|
||||
-Wno-disabled-macro-expansion
|
||||
-Wno-pre-c11-compat
|
||||
-Wno-gnu-zero-variadic-macro-arguments
|
||||
)
|
||||
endif()
|
||||
|
||||
@ -56,6 +57,8 @@ if (ENABLE_WARNING_ERROR)
|
||||
CheckCFlag(-Werror)
|
||||
endif()
|
||||
|
||||
CheckCFlag(-fno-omit-frame-pointer)
|
||||
|
||||
CheckCFlag(-fmacro-prefix-map="${CMAKE_SOURCE_DIR}"="./")
|
||||
CheckCFlag(-fmacro-prefix-map="${CMAKE_BINARY_DIR}"="./build/")
|
||||
CheckCFlag(-ffile-prefix-map="${CMAKE_SOURCE_DIR}"="./")
|
||||
|
Loading…
Reference in New Issue
Block a user