Changeset View
Changeset View
Standalone View
Standalone View
src/CMakeLists.txt
Show First 20 Lines • Show All 115 Lines • ▼ Show 20 Lines | if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Windows") | ||||
add_linker_flag(-pie) | add_linker_flag(-pie) | ||||
else() | else() | ||||
# MinGw provides its own libssp for stack smashing protection | # MinGw provides its own libssp for stack smashing protection | ||||
link_libraries(ssp) | link_libraries(ssp) | ||||
endif() | endif() | ||||
endif() | endif() | ||||
# Enable warning | # Enable warning | ||||
add_c_compiler_flag(-Wnested-externs -Wstrict-prototypes) | |||||
add_compiler_flag( | add_compiler_flag( | ||||
-Wall | -Wall | ||||
-Wextra | -Wextra | ||||
-Wformat | -Wformat | ||||
-Wvla | -Wvla | ||||
-Wformat-security | -Wformat-security | ||||
-Wcast-align | |||||
-Wunused-parameter | -Wunused-parameter | ||||
-Wmissing-braces | -Wmissing-braces | ||||
# FIXME: Activating this flag cause cmake to fail on leveldb. | -Wthread-safety-analysis | ||||
# -Wthread-safety-analysis | |||||
-Wshadow | -Wshadow | ||||
) | ) | ||||
option(EXTRA_WARNINGS "Enable extra warnings" OFF) | option(EXTRA_WARNINGS "Enable extra warnings" OFF) | ||||
if(EXTRA_WARNINGS) | if(EXTRA_WARNINGS) | ||||
add_cxx_compiler_flag(-Wsuggest-override) | add_cxx_compiler_flag(-Wsuggest-override) | ||||
else() | else() | ||||
add_compiler_flag(-Wno-unused-parameter) | add_compiler_flag(-Wno-unused-parameter) | ||||
▲ Show 20 Lines • Show All 318 Lines • Show Last 20 Lines |