From 42ce09babfa916f8f6883c0948db877c96c483a3 Mon Sep 17 00:00:00 2001 From: Adam Carlucci Date: Sat, 13 Aug 2016 16:22:49 -0700 Subject: [PATCH] add cmake option for dr1467 canary tests --- CMakeLists.txt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index ebcaf90..131422e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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" ON) set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON) @@ -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()