Add compile flags and test for compiler options only if we use gcc.
Этот коммит содержится в:
родитель
1a6038baa5
Коммит
ef2c8d66f1
@ -3,6 +3,9 @@
|
||||
include(CheckCCompilerFlag)
|
||||
|
||||
if (UNIX AND NOT WIN32)
|
||||
if (CMAKE_COMPILER_IS_GNUCC)
|
||||
add_definitions(-Wall -Wextra -Wmissing-prototypes -Wdeclaration-after-statement -Wunused)
|
||||
|
||||
# with -fPIC
|
||||
check_c_compiler_flag("-fPIC" WITH_FPIC)
|
||||
if (WITH_FPIC)
|
||||
@ -34,10 +37,6 @@ if (UNIX AND NOT WIN32)
|
||||
add_definitions(${_lfs_CFLAGS})
|
||||
endif (CMAKE_SIZEOF_VOID_P MATCHES "8")
|
||||
|
||||
if (CMAKE_COMPILER_IS_GNUCC)
|
||||
add_definitions(-Wall -Wextra -Wmissing-prototypes -Wdeclaration-after-statement -Wunused)
|
||||
endif (CMAKE_COMPILER_IS_GNUCC)
|
||||
|
||||
check_c_compiler_flag("-fstack-protector" WITH_STACK_PROTECTOR)
|
||||
if (WITH_STACK_PROTECTOR)
|
||||
add_definitions(-fstack-protector)
|
||||
@ -47,5 +46,5 @@ if (UNIX AND NOT WIN32)
|
||||
if (WITH_FORTIFY_SOURCE)
|
||||
add_definitions(-D_FORTIFY_SOURCE=2)
|
||||
endif (WITH_FORTIFY_SOURCE)
|
||||
|
||||
endif (CMAKE_COMPILER_IS_GNUCC)
|
||||
endif (UNIX AND NOT WIN32)
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user