diff --git a/pstl/CMakeLists.txt b/pstl/CMakeLists.txt --- a/pstl/CMakeLists.txt +++ b/pstl/CMakeLists.txt @@ -51,8 +51,9 @@ $) ############################################################################### -# Setup tests +# Setup tests and extras ############################################################################### +add_subdirectory(extra) enable_testing() add_subdirectory(test) diff --git a/pstl/extra/CMakeLists.txt b/pstl/extra/CMakeLists.txt new file mode 100644 --- /dev/null +++ b/pstl/extra/CMakeLists.txt @@ -0,0 +1,11 @@ +#===-- CMakeLists.txt ----------------------------------------------------===## +# +# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +# See https://llvm.org/LICENSE.txt for license information. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +# +#===----------------------------------------------------------------------===## + +add_library(test_stdlib INTERFACE) +target_include_directories(test_stdlib INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/include") +target_link_libraries(test_stdlib INTERFACE pstl::ParallelSTL) diff --git a/pstl/test/support/stdlib/algorithm b/pstl/extra/include/algorithm rename from pstl/test/support/stdlib/algorithm rename to pstl/extra/include/algorithm --- a/pstl/test/support/stdlib/algorithm +++ b/pstl/extra/include/algorithm @@ -7,8 +7,8 @@ // //===----------------------------------------------------------------------===// -#ifndef _TEST_SUPPORT_STDLIB_ALGORITHM -#define _TEST_SUPPORT_STDLIB_ALGORITHM +#ifndef _PSTL_EXTRA_INCLUDE_ALGORITHM +#define _PSTL_EXTRA_INCLUDE_ALGORITHM #include_next @@ -23,4 +23,4 @@ # define _PSTL_ALGORITHM_FORWARD_DECLARED 1 #endif -#endif /* _TEST_SUPPORT_STDLIB_ALGORITHM */ +#endif /* _PSTL_EXTRA_INCLUDE_ALGORITHM */ diff --git a/pstl/test/support/stdlib/execution b/pstl/extra/include/execution rename from pstl/test/support/stdlib/execution rename to pstl/extra/include/execution --- a/pstl/test/support/stdlib/execution +++ b/pstl/extra/include/execution @@ -7,8 +7,8 @@ // //===----------------------------------------------------------------------===// -#ifndef _TEST_SUPPORT_STDLIB_EXECUTION -#define _TEST_SUPPORT_STDLIB_EXECUTION +#ifndef _PSTL_EXTRA_INCLUDE_EXECUTION +#define _PSTL_EXTRA_INCLUDE_EXECUTION // #include_next // None of the standard libraries PSTL is built on top have the header yet. @@ -47,4 +47,4 @@ } } // namespace pstl -#endif /* _TEST_SUPPORT_STDLIB_EXECUTION */ +#endif /* _PSTL_EXTRA_INCLUDE_EXECUTION */ diff --git a/pstl/test/support/stdlib/memory b/pstl/extra/include/memory rename from pstl/test/support/stdlib/memory rename to pstl/extra/include/memory --- a/pstl/test/support/stdlib/memory +++ b/pstl/extra/include/memory @@ -7,8 +7,8 @@ // //===----------------------------------------------------------------------===// -#ifndef _TEST_SUPPORT_STDLIB_MEMORY -#define _TEST_SUPPORT_STDLIB_MEMORY +#ifndef _PSTL_EXTRA_INCLUDE_MEMORY +#define _PSTL_EXTRA_INCLUDE_MEMORY #include_next @@ -23,4 +23,4 @@ # define _PSTL_MEMORY_FORWARD_DECLARED 1 #endif -#endif /* _TEST_SUPPORT_STDLIB_MEMORY */ +#endif /* _PSTL_EXTRA_INCLUDE_MEMORY */ diff --git a/pstl/test/support/stdlib/numeric b/pstl/extra/include/numeric rename from pstl/test/support/stdlib/numeric rename to pstl/extra/include/numeric --- a/pstl/test/support/stdlib/numeric +++ b/pstl/extra/include/numeric @@ -7,8 +7,8 @@ // //===----------------------------------------------------------------------===// -#ifndef _TEST_SUPPORT_STDLIB_NUMERIC -#define _TEST_SUPPORT_STDLIB_NUMERIC +#ifndef _PSTL_EXTRA_INCLUDE_NUMERIC +#define _PSTL_EXTRA_INCLUDE_NUMERIC #include_next @@ -23,4 +23,4 @@ # define _PSTL_NUMERIC_FORWARD_DECLARED 1 #endif -#endif /* _TEST_SUPPORT_STDLIB_NUMERIC */ +#endif /* _PSTL_EXTRA_INCLUDE_NUMERIC */ diff --git a/pstl/test/CMakeLists.txt b/pstl/test/CMakeLists.txt --- a/pstl/test/CMakeLists.txt +++ b/pstl/test/CMakeLists.txt @@ -18,10 +18,6 @@ DEPENDS pstl-build-tests COMMENT "Build and run all the unit tests.") -add_library(test_stdlib INTERFACE) -target_include_directories(test_stdlib INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/support/stdlib") -target_link_libraries(test_stdlib INTERFACE pstl::ParallelSTL) - file(GLOB_RECURSE UNIT_TESTS "*.pass.cpp") foreach(_file IN LISTS UNIT_TESTS) file(RELATIVE_PATH _target "${CMAKE_CURRENT_SOURCE_DIR}" "${_file}")