diff --git a/CMakeLists.txt b/CMakeLists.txt index c6874da7..1ed99284 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,10 +12,10 @@ if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR}) endif() set(TARGET_NAME execution26) -set(TARGET_NAMESPACE beman) # FIXME: not used in install(EXPORT ...) CK? +set(TARGET_NAMESPACE beman) set(TARGET_PREFIX ${TARGET_NAMESPACE}.${TARGET_NAME}) set(TARGET_LIBRARY ${PROJECT_NAME}) -set(TARGET_ALIAS ${TARGET_LIBRARY}::${TARGET_LIBRARY}) +set(TARGET_ALIAS ${TARGET_NAMESPACE}::${TARGET_NAME}) set(TARGET_PACKAGE_NAME ${PROJECT_NAME}-config) set(TARGETS_EXPORT_NAME ${PROJECT_NAME}-targets) @@ -40,7 +40,7 @@ if(CMAKE_BUILD_TYPE STREQUAL Debug) # uncomment to enable the options. Some of them accept one or more inputs: project_options( PREFIX - ${PROJECT_NAME} + ${TARGET_NAME} ENABLE_CACHE # NO! # ENABLE_CLANG_TIDY # NO! ENABLE_VS_ANALYSIS diff --git a/bin/update-cmake-headers.py b/bin/update-cmake-headers.py index 69e0095a..7c53b0ce 100755 --- a/bin/update-cmake-headers.py +++ b/bin/update-cmake-headers.py @@ -29,7 +29,7 @@ def get_headers(dir): } file_set_re = re.compile(" *FILE_SET.*") -section_re = re.compile(" *\${TARGET_LIBRARY}_(?P<section>.*)_headers$") +section_re = re.compile(" *\${TARGET_NAME}_(?P<section>.*)_headers$") header_re = re.compile(" *\${PROJECT_SOURCE_DIR}/include/beman/.*/.*\.hpp") if len(sys.argv) != 2: diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 3a64e258..a5a991f2 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -21,5 +21,5 @@ foreach(EXAMPLE ${EXAMPLES}) set(EXAMPLE_TARGET ${TARGET_PREFIX}.examples.${EXAMPLE}) add_executable(${EXAMPLE_TARGET}) target_sources(${EXAMPLE_TARGET} PRIVATE ${EXAMPLE}.cpp) - target_link_libraries(${EXAMPLE_TARGET} PRIVATE ${TARGET_LIBRARY}) + target_link_libraries(${EXAMPLE_TARGET} PRIVATE ${TARGET_NAMESPACE}::${TARGET_NAME}) endforeach() diff --git a/src/beman/execution26/CMakeLists.txt b/src/beman/execution26/CMakeLists.txt index 6edb36a2..a7463994 100644 --- a/src/beman/execution26/CMakeLists.txt +++ b/src/beman/execution26/CMakeLists.txt @@ -3,22 +3,22 @@ # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception # cmake-format: on -add_library(${TARGET_LIBRARY} STATIC) -add_library(${TARGET_ALIAS} ALIAS ${TARGET_LIBRARY}) +add_library(${TARGET_NAME} STATIC) +add_library(${TARGET_ALIAS} ALIAS ${TARGET_NAME}) if(CMAKE_BUILD_TYPE STREQUAL Debug) - target_link_libraries(${TARGET_LIBRARY} PUBLIC $<BUILD_INTERFACE:${TARGET_LIBRARY}_project_options>) - target_link_libraries(${TARGET_LIBRARY} PUBLIC $<BUILD_INTERFACE:${TARGET_LIBRARY}_project_warnings>) + target_link_libraries(${TARGET_NAME} PUBLIC $<BUILD_INTERFACE:${TARGET_NAME}_project_options>) + target_link_libraries(${TARGET_NAME} PUBLIC $<BUILD_INTERFACE:${TARGET_NAME}_project_warnings>) endif() include(CMakePrintHelpers) -cmake_print_variables(TARGET_ALIAS TARGET_LIBRARY TARGET_PREFIX PROJECT_SOURCE_DIR) +cmake_print_variables(TARGET_ALIAS TARGET_NAME TARGET_PREFIX PROJECT_SOURCE_DIR) target_sources( - ${TARGET_LIBRARY} + ${TARGET_NAME} PRIVATE execution.cpp PUBLIC FILE_SET - ${TARGET_LIBRARY}_public_headers + ${TARGET_NAME}_public_headers TYPE HEADERS BASE_DIRS @@ -28,7 +28,7 @@ target_sources( ${PROJECT_SOURCE_DIR}/include/beman/execution26/functional.hpp ${PROJECT_SOURCE_DIR}/include/beman/execution26/stop_token.hpp PUBLIC FILE_SET - ${TARGET_LIBRARY}_detail_headers + ${TARGET_NAME}_detail_headers TYPE HEADERS BASE_DIRS @@ -39,8 +39,10 @@ target_sources( ${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/apply_sender.hpp ${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/as_awaitable.hpp ${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/as_except_ptr.hpp + ${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/atomic_intrusive_stack.hpp ${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/await_result_type.hpp ${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/await_suspend_result.hpp + ${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/awaitable_sender.hpp ${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/basic_operation.hpp ${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/basic_receiver.hpp ${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/basic_sender.hpp @@ -49,6 +51,7 @@ target_sources( ${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/callable.hpp ${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/check_type_alias_exist.hpp ${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/child_type.hpp + ${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/class_type.hpp ${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/common.hpp ${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/completion_domain.hpp ${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/completion_signature.hpp @@ -64,6 +67,7 @@ target_sources( ${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/continues_on.hpp ${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/decayed_same_as.hpp ${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/decayed_tuple.hpp + ${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/decayed_type_list.hpp ${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/decayed_typeof.hpp ${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/decays_to.hpp ${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/default_domain.hpp @@ -97,6 +101,7 @@ target_sources( ${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/indirect_meta_apply.hpp ${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/inplace_stop_source.hpp ${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/into_variant.hpp + ${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/intrusive_stack.hpp ${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/is_awaitable.hpp ${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/is_awaiter.hpp ${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/join_env.hpp @@ -138,6 +143,7 @@ target_sources( ${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/sender.hpp ${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/sender_adaptor.hpp ${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/sender_adaptor_closure.hpp + ${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/sender_awaitable.hpp ${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/sender_decompose.hpp ${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/sender_for.hpp ${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/sender_in.hpp @@ -149,6 +155,7 @@ target_sources( ${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/simple_counting_scope.hpp ${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/single_sender.hpp ${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/single_sender_value_type.hpp + ${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/split.hpp ${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/start.hpp ${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/starts_on.hpp ${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/state_type.hpp @@ -165,6 +172,7 @@ target_sources( ${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/then.hpp ${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/transform_sender.hpp ${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/type_list.hpp + ${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/unspecified_promise.hpp ${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/unstoppable_token.hpp ${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/valid_completion_for.hpp ${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/valid_completion_signatures.hpp @@ -174,26 +182,27 @@ target_sources( ${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/when_all.hpp ${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/when_all_with_variant.hpp ${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/with_await_transform.hpp + ${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/with_awaitable_senders.hpp ${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/write_env.hpp ) # cmake-format: off -get_property(DETAIL_HEADER_FILES TARGET ${TARGET_LIBRARY} PROPERTY HEADER_SET_${TARGET_LIBRARY}_detail_headers) +get_property(DETAIL_HEADER_FILES TARGET ${TARGET_NAME} PROPERTY HEADER_SET_${TARGET_NAME}_detail_headers) source_group("Header Files\\detail" FILES ${DETAIL_HEADER_FILES}) -set_target_properties(${TARGET_LIBRARY} PROPERTIES VERIFY_INTERFACE_HEADER_SETS ON) +set_target_properties(${TARGET_NAME} PROPERTIES VERIFY_INTERFACE_HEADER_SETS ON) -target_compile_features(${TARGET_LIBRARY} PUBLIC +target_compile_features(${TARGET_NAME} PUBLIC "$<$<COMPILE_FEATURES:cxx_std_26>:cxx_std_26>" "$<$<NOT:$<COMPILE_FEATURES:cxx_std_26>>:cxx_std_23>" ) install( - TARGETS ${TARGET_LIBRARY} + TARGETS ${TARGET_NAME} EXPORT ${TARGETS_EXPORT_NAME}1 ARCHIVE DESTINATION lib/$<CONFIG> - FILE_SET ${TARGET_LIBRARY}_public_headers - FILE_SET ${TARGET_LIBRARY}_detail_headers + FILE_SET ${TARGET_NAME}_public_headers + FILE_SET ${TARGET_NAME}_detail_headers ) # cmake-format: on @@ -201,5 +210,5 @@ install( EXPORT ${TARGETS_EXPORT_NAME}1 FILE ${TARGETS_EXPORT_NAME}.cmake DESTINATION "${INSTALL_CONFIGDIR}" - NAMESPACE ${TARGET_LIBRARY}:: + NAMESPACE ${TARGET_NAMESPACE}:: ) diff --git a/tests/beman/execution26/CMakeLists.txt b/tests/beman/execution26/CMakeLists.txt index e1d41a7c..068148df 100644 --- a/tests/beman/execution26/CMakeLists.txt +++ b/tests/beman/execution26/CMakeLists.txt @@ -124,7 +124,7 @@ remove_definitions(-DNDEBUG) # NOTE: we want ASSERT statements in Release too! C foreach(test ${execution_tests}) set(TEST_EXE ${TARGET_PREFIX}.${test}) add_executable(${TEST_EXE} ${test}.cpp) - target_link_libraries(${TEST_EXE} PRIVATE beman_execution26::beman_execution26) + target_link_libraries(${TEST_EXE} PRIVATE beman::execution26) add_test(NAME ${TEST_EXE} COMMAND $<TARGET_FILE:${TEST_EXE}>) endforeach()