From a2c074fd4d96b2c61d0c5d35d1e5fbee7b8b2a77 Mon Sep 17 00:00:00 2001
From: onqtam <vik.kirilov@gmail.com>
Date: Tue, 15 Jan 2019 22:58:12 +0200
Subject: [PATCH] this should really fix the XCode 6/7 builds

---
 test/CMakeLists.txt                             | 9 ++++-----
 test/thirdparty/doctest/doctest_compatibility.h | 1 +
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 63b3dd58..5886d7f3 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -61,13 +61,9 @@ add_library(doctest_main OBJECT
     "src/unit.cpp"
 )
 set_target_properties(doctest_main PROPERTIES
+    COMPILE_DEFINITIONS "$<$<CXX_COMPILER_ID:MSVC>:_SCL_SECURE_NO_WARNINGS>"
     COMPILE_OPTIONS "$<$<CXX_COMPILER_ID:MSVC>:/EHsc;$<$<CONFIG:Release>:/Od>>"
 )
-target_compile_definitions(doctest_main PUBLIC
-    "$<$<CXX_COMPILER_ID:MSVC>:_SCL_SECURE_NO_WARNINGS>"
-    "DOCTEST_THREAD_LOCAL"
-    "DOCTEST_CONFIG_SUPER_FAST_ASSERTS"
-)
 target_compile_features(doctest_main PUBLIC cxx_std_11)
 target_include_directories(doctest_main PRIVATE "thirdparty/doctest")
 
@@ -100,6 +96,9 @@ foreach(file ${files})
     string(REGEX REPLACE "unit-([^$]+)" "test-\\1" testcase ${file_basename})
 
     add_executable(${testcase} $<TARGET_OBJECTS:doctest_main> ${file})
+    target_compile_definitions(${testcase} PRIVATE
+      DOCTEST_CONFIG_SUPER_FAST_ASSERTS
+    )
     target_compile_options(${testcase} PRIVATE
         $<$<CXX_COMPILER_ID:MSVC>:/EHsc;$<$<CONFIG:Release>:/Od>>
         $<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wno-deprecated;-Wno-float-equal>
diff --git a/test/thirdparty/doctest/doctest_compatibility.h b/test/thirdparty/doctest/doctest_compatibility.h
index e9d035ce..cfbe6a46 100644
--- a/test/thirdparty/doctest/doctest_compatibility.h
+++ b/test/thirdparty/doctest/doctest_compatibility.h
@@ -1,6 +1,7 @@
 #ifndef DOCTEST_COMPATIBILITY
 #define DOCTEST_COMPATIBILITY
 
+#define DOCTEST_THREAD_LOCAL // enable single-threaded builds on XCode 6/7 - https://github.com/onqtam/doctest/issues/172
 #include "doctest.h"
 
 // Catch doesn't require a semicolon after CAPTURE but doctest does