diff options
author | Niall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) <spamtrap@nedprod.com> | 2017-08-16 05:14:39 +0300 |
---|---|---|
committer | Niall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) <spamtrap@nedprod.com> | 2017-08-16 05:14:39 +0300 |
commit | 17983cd690ba9ff222926af5849abb665d13ac23 (patch) | |
tree | 492fa5434974761bcbeab8c4afdb533326b4bb42 /CMakeLists.txt | |
parent | dfc571c48eb92720b5c45a3662a655093839e5aa (diff) |
KernelTest now requires C++ 17 for its aggregate tuple, so made only the tests link to it not the rest of AFIO. That means AFIO's tests now compile under C++17 instead of C++ 14.
directory_handle, apart from enumeration, now has a test suite and is working on Windows and POSIX.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 6d683889..3f125adf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -53,7 +53,7 @@ if(NOT MSVC OR CMAKE_VERSION VERSION_GREATER 3.59) ) endif() # Set the library dependencies this library has -all_link_libraries(PUBLIC quickcpplib::hl outcome::hl kerneltest::hl) +all_link_libraries(PUBLIC quickcpplib::hl outcome::hl) # Set the system dependencies this library has if(CMAKE_SYSTEM_NAME MATCHES "Linux") all_link_libraries(PUBLIC stdc++fs rt) @@ -70,13 +70,18 @@ foreach(lib afio_sl afio_dl) target_compile_definitions(${lib} PRIVATE AFIO_SOURCE=1) endforeach() -# For all possible configurations of this library, add each test -include(QuickCppLibMakeStandardTests) -# For each test target, set compile options -if(MSVC) +if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/test" AND NOT PROJECT_IS_DEPENDENCY) + # For all possible configurations of this library, add each test + include(QuickCppLibMakeStandardTests) + # For each test target, link to kerneltest foreach(test_target ${afio_TEST_TARGETS}) - target_compile_options(${test_target} PRIVATE /wd4503) ## decorated name length exceeded + target_link_libraries(${test_target} PRIVATE kerneltest::hl) endforeach() + if(MSVC) + foreach(test_target ${afio_TEST_TARGETS}) + target_compile_options(${test_target} PRIVATE /wd4503) ## decorated name length exceeded + endforeach() + endif() endif() # Cache this library's auto scanned sources for later reuse |