Skip to content

Commit

Permalink
Improve build
Browse files Browse the repository at this point in the history
  • Loading branch information
danielaparker committed Jan 15, 2021
1 parent 3117e91 commit e27faef
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.1)

project(jsoncons)
project(jsoncons CXX)

set(JSONCONS_PROJECT_DIR ${PROJECT_SOURCE_DIR})
set(JSONCONS_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include)
Expand Down
9 changes: 8 additions & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,16 @@ target_compile_features(unit_tests INTERFACE cxx_std_11)

target_compile_options(unit_tests PRIVATE
$<$<CXX_COMPILER_ID:MSVC>: /EHsc /MP /bigobj /W4>
$<$<CXX_COMPILER_ID:GNU>:-Werror -Wall -Wextra -Wimplicit-fallthrough -pedantic -Wcast-align -Wcast-qual>
$<$<CXX_COMPILER_ID:GNU>:-Werror -Wall -Wextra -pedantic -Wcast-align -Wcast-qual>
)

check_cxx_compiler_flag("${implicit-fallthrough}" ${implicit-fallthrough-name})
if(${implicit-fallthrough-name})
message(STATUS "implicit-fallthrough")
target_compile_options(unit_tests PRIVATE
$<$<CXX_COMPILER_ID:GNU>:-Wimplicit-fallthrough>
endif()

if (NOT CMAKE_SYSTEM_NAME STREQUAL Windows)
target_compile_options(unit_tests PRIVATE
$<$<CXX_COMPILER_ID:Clang>:-Werror -Wall -Wextra -Wimplicit-fallthrough -Wcast-align -Wcast-qual>
Expand Down

0 comments on commit e27faef

Please sign in to comment.