Skip to content

Commit

Permalink
fixed #266 fixed #243 relates #231
Browse files Browse the repository at this point in the history
  • Loading branch information
Viktor Kirilov committed Aug 11, 2019
1 parent 999f665 commit 10101a1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
8 changes: 5 additions & 3 deletions CMakeLists.txt
Expand Up @@ -14,6 +14,10 @@ option(DOCTEST_NO_INSTALL "Skip the installation process" OFF)
add_library(${PROJECT_NAME} INTERFACE)
add_library(${PROJECT_NAME}::${PROJECT_NAME} ALIAS ${PROJECT_NAME})

if(NOT CMAKE_VERSION VERSION_LESS 3.8)
target_compile_features(${PROJECT_NAME} INTERFACE cxx_std_11)
endif()

set(doctest_parts_folder "${CMAKE_CURRENT_SOURCE_DIR}/doctest/parts")

if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
Expand Down Expand Up @@ -50,9 +54,7 @@ if(${DOCTEST_WITH_MAIN_IN_STATIC_LIB})
add_library(${PROJECT_NAME}_with_main STATIC EXCLUDE_FROM_ALL ${doctest_parts_folder}/doctest.cpp)
target_compile_definitions(${PROJECT_NAME}_with_main PRIVATE
DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN)
set_target_properties(${PROJECT_NAME}_with_main PROPERTIES
CXX_STANDARD 11
CXX_STANDARD_REQUIRED ON)
set_target_properties(${PROJECT_NAME}_with_main PROPERTIES CXX_STANDARD 11 CXX_STANDARD_REQUIRED ON)
target_link_libraries(${PROJECT_NAME}_with_main PUBLIC ${PROJECT_NAME})
endif()

Expand Down
8 changes: 2 additions & 6 deletions scripts/cmake/common.cmake
Expand Up @@ -158,13 +158,9 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
endif()
endif()

if(CMAKE_CXX_COMPILER_ID MATCHES "AppleClang")
if(CMAKE_VERSION VERSION_LESS 3.8)
# necessary for some older compilers which don't default to C++11
add_compiler_flags(-std=c++11)
# add_compiler_flags(-Wno-c++11-inline-namespace)
# add_compiler_flags(-Wno-c++11-extensions)
# add_compiler_flags(-Wno-variadic-macros)
# add_compiler_flags(-Wno-c++11-compat)
# add_compiler_flags(-Wno-c++11-long-long)
endif()

if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
Expand Down
2 changes: 1 addition & 1 deletion scripts/cmake/doctest.cmake
Expand Up @@ -147,7 +147,7 @@ function(doctest_discover_tests TARGET)
"endif()\n"
)

if(NOT ${CMAKE_VERSION} VERSION_LESS "3.10.0")
if(NOT CMAKE_VERSION VERSION_LESS 3.10)
# Add discovered tests to directory TEST_INCLUDE_FILES
set_property(DIRECTORY
APPEND PROPERTY TEST_INCLUDE_FILES "${ctest_include_file}"
Expand Down

0 comments on commit 10101a1

Please sign in to comment.