@ -86,14 +86,23 @@ target_include_directories(build_version PRIVATE
if ( WIN32 )
if ( WIN32 )
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zi /nologo /EHsc /GS /Gd /GR /GF /fp:precise /Zc:wchar_t /Zc:forScope /errorReport:queue" )
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zi /nologo /EHsc /GS /Gd /GR /GF /fp:precise /Zc:wchar_t /Zc:forScope /errorReport:queue" )
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /FC /d2Zi+ /W3 /WX / wd4127 /wd4800 /wd4996 /wd4351" )
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /FC /d2Zi+ /W3 /wd4127 /wd4800 /wd4996 /wd4351" )
else ( )
else ( )
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -W -Wextra -Wall -Werror " )
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -W -Wextra -Wall" )
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wsign-compare -Wshadow -Wno-unused-parameter -Wno-unused-variable -Woverloaded-virtual -Wnon-virtual-dtor -Wno-missing-field-initializers" )
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wsign-compare -Wshadow -Wno-unused-parameter -Wno-unused-variable -Woverloaded-virtual -Wnon-virtual-dtor -Wno-missing-field-initializers" )
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11" )
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11" )
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-omit-frame-pointer -momit-leaf-frame-pointer" )
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-omit-frame-pointer -momit-leaf-frame-pointer" )
endif ( )
endif ( )
option ( FAIL_ON_WARNINGS "Treat compile warnings as errors" ON )
if ( FAIL_ON_WARNINGS )
if ( MSVC )
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /WX" )
else ( ) # a s s u m e G C C
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror" )
endif ( )
endif ( )
option ( WITH_ASAN "build with ASAN" OFF )
option ( WITH_ASAN "build with ASAN" OFF )
if ( WITH_ASAN )
if ( WITH_ASAN )
add_definitions ( -DROCKSDB_TSAN_RUN )
add_definitions ( -DROCKSDB_TSAN_RUN )