Skip to content

Commit

Permalink
Merge pull request dropbox#72 from admsyn/feature-cmake-dr1467-canary
Browse files Browse the repository at this point in the history
Add cmake option for DR1467 canary tests
  • Loading branch information
artwyman authored Dec 28, 2016
2 parents 649b54a + 6de8cac commit a501d06
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ project(json11 VERSION 1.0.0 LANGUAGES CXX)
enable_testing()

option(JSON11_BUILD_TESTS "Build unit tests" ON)
option(JSON11_ENABLE_DR1467_CANARY "Enable canary test for DR 1467" OFF)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
Expand All @@ -16,6 +17,14 @@ target_compile_options(json11
configure_file("json11.pc.in" "json11.pc" @ONLY)

if (JSON11_BUILD_TESTS)

# enable test for DR1467, described here: https://llvm.org/bugs/show_bug.cgi?id=23812
if(JSON11_ENABLE_DR1467_CANARY)
add_definitions(-D JSON11_ENABLE_DR1467_CANARY=1)
else()
add_definitions(-D JSON11_ENABLE_DR1467_CANARY=0)
endif()

add_executable(json11_test test.cpp)
target_link_libraries(json11_test json11)
endif()
Expand Down

0 comments on commit a501d06

Please sign in to comment.