Skip to content

Commit bccb24c

Browse files
committed
Adapt HPX module iterator_support to C++ modules
Signed-off-by: Hartmut Kaiser <[email protected]>
1 parent 6a00059 commit bccb24c

File tree

255 files changed

+726
-731
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

255 files changed

+726
-731
lines changed

cmake/HPX_AddModule.cmake

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,6 @@ function(add_hpx_module libname modulename)
516516
# core.
517517
if(HPX_WITH_CXX_MODULES)
518518
hpx_configure_module_consumer(hpx_${modulename} hpx_core_module_if)
519-
target_link_libraries(hpx_${modulename} PRIVATE hpx_core_module_if)
520519
endif()
521520
endif()
522521

@@ -674,10 +673,18 @@ function(add_hpx_module libname modulename)
674673
target_link_libraries(hpx_${libname} PRIVATE ${${modulename}_OBJECTS})
675674
endif()
676675

676+
set(_hpx_prev_scan "${CMAKE_CXX_SCAN_FOR_MODULES}")
677+
if(HPX_WITH_CXX_MODULES AND ${modulename}_GLOBAL_HEADER_MODULE_GEN)
678+
set(CMAKE_CXX_SCAN_FOR_MODULES ON)
679+
endif()
680+
677681
foreach(dir ${${modulename}_CMAKE_SUBDIRS})
678682
add_subdirectory(${dir})
679683
endforeach(dir)
680684

685+
# Restore previous default so sibling modules are unaffected.
686+
set(CMAKE_CXX_SCAN_FOR_MODULES "${_hpx_prev_scan}")
687+
681688
create_configuration_summary(
682689
" Module configuration (${modulename}):" "${modulename}"
683690
)

cmake/HPX_SetupTarget.cmake

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,9 +225,20 @@ function(hpx_setup_target target)
225225

226226
set_target_properties(${target} PROPERTIES POSITION_INDEPENDENT_CODE ON)
227227

228-
if(HPX_WITH_CXX_MODULES OR ${target}_SCAN_FOR_MODULES)
228+
if(HPX_WITH_CXX_MODULES AND ${target}_SCAN_FOR_MODULES)
229229
hpx_configure_module_consumer(${target} hpx_core_module_if)
230230
else()
231+
# If modules are enabled, Clang emits DWARF v5, which requires using lld
232+
# instead of ld.
233+
if(HPX_WITH_CXX_MODULES AND (CMAKE_CXX_COMPILER_ID MATCHES "Clang"
234+
OR CMAKE_CXX_COMPILER_ID MATCHES "AppleClang")
235+
)
236+
get_target_property(_type ${target} TYPE)
237+
if((_type STREQUAL "SHARED_LIBRARY") OR (_type STREQUAL "EXECUTABLE"))
238+
target_link_options(${target} PRIVATE "-fuse-ld=lld")
239+
endif()
240+
endif()
241+
231242
set_target_properties(${target} PROPERTIES CXX_SCAN_FOR_MODULES OFF)
232243
target_compile_definitions(
233244
${target} PRIVATE HPX_BINARY_DOESNT_USE_CXX_MODULES

components/containers/partitioned_vector/include/hpx/components/containers/partitioned_vector/partitioned_vector_local_view_iterator.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
#include <hpx/assert.hpp>
1212
#include <hpx/components/containers/partitioned_vector/detail/view_element.hpp>
13-
#include <hpx/iterator_support/iterator_adaptor.hpp>
13+
#include <hpx/modules/iterator_support.hpp>
1414

1515
#include <utility>
1616

components/containers/partitioned_vector/include/hpx/components/containers/partitioned_vector/partitioned_vector_segmented_iterator.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818
#include <hpx/algorithms/traits/segmented_iterator_traits.hpp>
1919
#include <hpx/assert.hpp>
2020
#include <hpx/async_base/launch_policy.hpp>
21-
#include <hpx/iterator_support/iterator_adaptor.hpp>
22-
#include <hpx/iterator_support/iterator_facade.hpp>
21+
#include <hpx/modules/iterator_support.hpp>
2322
#include <hpx/naming_base/id_type.hpp>
2423

2524
#include <hpx/components/containers/partitioned_vector/partitioned_vector_component_decl.hpp>

components/containers/partitioned_vector/include/hpx/components/containers/partitioned_vector/partitioned_vector_view_iterator.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
#include <hpx/components/containers/partitioned_vector/detail/view_element.hpp>
1212
#include <hpx/components/containers/partitioned_vector/partitioned_vector_segmented_iterator.hpp>
13-
#include <hpx/iterator_support/iterator_facade.hpp>
13+
#include <hpx/modules/iterator_support.hpp>
1414
#include <hpx/modules/type_support.hpp>
1515

1616
#include <array>

components/containers/partitioned_vector/tests/unit/is_iterator_partitioned_vector.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
66

77
#include <hpx/config.hpp>
8-
#include <hpx/iterator_support/iterator_adaptor.hpp>
9-
#include <hpx/iterator_support/traits/is_iterator.hpp>
8+
#include <hpx/modules/iterator_support.hpp>
9+
#include <hpx/modules/iterator_support.hpp>
1010
#include <hpx/modules/testing.hpp>
1111

1212
#if !defined(HPX_COMPUTE_DEVICE_CODE)

components/containers/unordered/include/hpx/components/containers/unordered/unordered_map_segmented_iterator.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
#include <hpx/config.hpp>
1717
#include <hpx/assert.hpp>
18-
#include <hpx/iterator_support/iterator_adaptor.hpp>
18+
#include <hpx/modules/iterator_support.hpp>
1919

2020
#include <hpx/components/containers/unordered/partition_unordered_map_component.hpp>
2121

examples/1d_stencil/1d_stencil_channel.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#include <hpx/include/components.hpp>
2020
#include <hpx/include/lcos.hpp>
2121
#include <hpx/include/util.hpp>
22-
#include <hpx/iterator_support/counting_shape.hpp>
22+
#include <hpx/modules/iterator_support.hpp>
2323
#include <hpx/program_options.hpp>
2424

2525
#include <algorithm>

libs/core/algorithms/include/hpx/algorithms/traits/pointer_category.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
#pragma once
99

10-
#include <hpx/iterator_support/traits/is_iterator.hpp>
10+
#include <hpx/modules/iterator_support.hpp>
1111
#include <hpx/modules/type_support.hpp>
1212

1313
#include <type_traits>

libs/core/algorithms/include/hpx/algorithms/traits/projected.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#include <hpx/execution/traits/is_execution_policy.hpp>
1212
#include <hpx/execution/traits/vector_pack_load_store.hpp>
1313
#include <hpx/execution/traits/vector_pack_type.hpp>
14-
#include <hpx/iterator_support/traits/is_iterator.hpp>
14+
#include <hpx/modules/iterator_support.hpp>
1515
#include <hpx/modules/tag_invoke.hpp>
1616
#include <hpx/modules/type_support.hpp>
1717

0 commit comments

Comments
 (0)