Skip to content

Commit

Permalink
Add CMake option to toggle stack protection #286 from chrisdalke/master
Browse files Browse the repository at this point in the history
Add CMake option to toggle stack protection
  • Loading branch information
SRombauts authored Jul 12, 2020
2 parents f757b64 + 1aa8286 commit 9106e8d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,12 @@ else (MSVC)
set(CPPLINT_ARG_OUTPUT "--output=eclipse")
set(CPPCHECK_ARG_TEMPLATE "--template=gcc")
# Useful compile flags and extra warnings
add_compile_options(-fstack-protector)
# Stack protection is not supported on MinGW-W64 on Windows, allow this flag to be turned off.
option(SQLITECPP_USE_STACK_PROTECTION "USE Stack Protection hardening." ON)
if (SQLITECPP_USE_STACK_PROTECTION)
message (STATUS "Using Stack Protection hardening")
add_compile_options(-fstack-protector)
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic -Wswitch-enum -Wshadow -Wno-long-long") # C++ only, don't bother with sqlite3
if (CMAKE_COMPILER_IS_GNUCXX)
# GCC flags
Expand Down

0 comments on commit 9106e8d

Please sign in to comment.