mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-26 06:55:59 +03:00
Fix warning with clang
/usr/include/features.h:330:4: error: _FORTIFY_SOURCE requires compiling with optimization (-O) [-Werror,-W#warnings] # warning _FORTIFY_SOURCE requires compiling with optimization (-O)
This commit is contained in:
parent
38403f3343
commit
3cc41db0bd
1 changed files with 5 additions and 3 deletions
|
@ -33,10 +33,12 @@ if (${CMAKE_C_COMPILER_ID} MATCHES "(GNU|Clang)")
|
|||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstack-protector")
|
||||
endif (WITH_STACK_PROTECTOR AND NOT WIN32)
|
||||
|
||||
if (WITH_OPTIMIZATION)
|
||||
check_c_compiler_flag("-D_FORTIFY_SOURCE=2" WITH_FORTIFY_SOURCE)
|
||||
if (WITH_FORTIFY_SOURCE)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_FORTIFY_SOURCE=2")
|
||||
endif (WITH_FORTIFY_SOURCE)
|
||||
if (WITH_FORTIFY_SOURCE)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O -D_FORTIFY_SOURCE=2")
|
||||
endif (WITH_FORTIFY_SOURCE)
|
||||
endif (WITH_OPTIMIZATION)
|
||||
endif (${CMAKE_C_COMPILER_ID} MATCHES "(GNU|Clang)")
|
||||
|
||||
if (UNIX AND NOT WIN32)
|
||||
|
|
Loading…
Reference in a new issue