Enable /sdl warnings on Windows

This commit is contained in:
John Keiser 2020-04-23 15:12:21 -07:00
parent 9e9e3373e0
commit 66acab4130
2 changed files with 3 additions and 3 deletions

View File

@ -1,5 +1,4 @@
cmake_minimum_required(VERSION 3.9) # CMP0069 NEW
include(GNUInstallDirs)
message(STATUS "cmake version ${CMAKE_VERSION}")
if (NOT CMAKE_BUILD_TYPE)
@ -40,6 +39,7 @@ set(CMAKE_MACOSX_RPATH OFF)
set(CMAKE_THREAD_PREFER_PTHREAD ON)
set(THREADS_PREFER_PTHREAD_FLAG ON)
include(GNUInstallDirs)
# LTO seems to create all sorts of fun problems. Let us
# disable temporarily.
@ -55,7 +55,7 @@ set(THREADS_PREFER_PTHREAD_FLAG ON)
add_library(simdjson-flags INTERFACE)
if(MSVC)
target_compile_options(simdjson-flags INTERFACE /nologo /D_CRT_SECURE_NO_WARNINGS)
target_compile_options(simdjson-flags INTERFACE /WX /W3)
target_compile_options(simdjson-flags INTERFACE /WX /W3 /sdl)
else()
target_compile_options(simdjson-flags INTERFACE -fPIC)
if(NOT SIMDJSON_GOOGLE_BENCHMARKS) # Google Benchmark can't be compiled without warnings with -Weffc++

View File

@ -63,7 +63,7 @@ const detect_best_supported_implementation_on_first_use detect_best_supported_im
internal::atomic_ptr<const implementation> active_implementation{&internal::detect_best_supported_implementation_on_first_use_singleton};
constexpr const std::initializer_list<const implementation *> available_implementation_pointers {
const std::initializer_list<const implementation *> available_implementation_pointers {
#if SIMDJSON_IMPLEMENTATION_HASWELL
&haswell_singleton,
#endif