Skip to content

Commit cc24251

Browse files
committed
Adapting HPX modules from level 12 to C++ modules
- flyby: fixing propagation of SCAN_FOR_MODULES to HPX targets Signed-off-by: Hartmut Kaiser <hartmut.kaiser@gmail.com>
1 parent 2094c4c commit cc24251

150 files changed

Lines changed: 448 additions & 454 deletions

File tree

Some content is hidden

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

CMakeLists.txt

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -331,16 +331,7 @@ if(HPX_WITH_CXX_MODULES)
331331
)
332332
hpx_add_config_define(HPX_HAVE_CXX_MODULES)
333333

334-
hpx_option(
335-
HPX_WITH_BUILD_USING_CXX_MODULES
336-
BOOL
337-
"Enable building HPX itself using C++20 modules (experimental, default: OFF)."
338-
OFF
339-
ADVANCED
340-
)
341-
if(HPX_WITH_BUILD_USING_CXX_MODULES)
342-
hpx_add_config_define(HPX_HAVE_BUILD_USING_CXX_MODULES)
343-
endif()
334+
set(HPX_WITH_CXX_MODULES_OPTION SCAN_FOR_MODULES ON)
344335
else()
345336
hpx_info("HPX will be built and used with traditional headers only.")
346337
endif()

cmake/HPX_AddComponent.cmake

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,8 +314,10 @@ function(add_hpx_component name)
314314
# module interface unit exposed from the HPX libraries
315315
if(HPX_WITH_CXX_MODULES)
316316
if((NOT CMAKE_CXX_SCAN_FOR_MODULES) AND (NOT ${name}_SCAN_FOR_MODULES))
317+
hpx_debug("add_component.${name} SCAN_FOR_MODULES: OFF")
317318
set(${name}_SCAN_FOR_MODULES OFF)
318319
else()
320+
hpx_debug("add_component.${name} SCAN_FOR_MODULES: ON")
319321
set(${name}_SCAN_FOR_MODULES ON)
320322
endif()
321323
endif()
@@ -328,8 +330,8 @@ function(add_hpx_component name)
328330
COMPILE_FLAGS ${${name}_COMPILE_FLAGS}
329331
LINK_FLAGS ${${name}_LINK_FLAGS}
330332
DEPENDENCIES ${${name}_DEPENDENCIES}
331-
COMPONENT_DEPENDENCIES ${${name}_COMPONENT_DEPENDENCIES} ${_target_flags}
332-
SCAN_FOR_MODULES ${${name}_SCAN_FOR_MODULES}
333+
COMPONENT_DEPENDENCIES ${${name}_COMPONENT_DEPENDENCIES}
334+
SCAN_FOR_MODULES ${${name}_SCAN_FOR_MODULES} ${_target_flags}
333335
)
334336

335337
endfunction()

cmake/HPX_AddExecutable.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,8 +259,10 @@ function(add_hpx_executable name)
259259
# module interface unit exposed from the HPX libraries
260260
if(HPX_WITH_CXX_MODULES)
261261
if(NOT (CMAKE_CXX_SCAN_FOR_MODULES OR ${name}_SCAN_FOR_MODULES))
262+
hpx_debug("add_executable.${name} SCAN_FOR_MODULES: OFF")
262263
set(${name}_SCAN_FOR_MODULES OFF)
263264
else()
265+
hpx_debug("add_executable.${name} SCAN_FOR_MODULES: ON")
264266
set(${name}_SCAN_FOR_MODULES ON)
265267
endif()
266268
endif()

cmake/HPX_AddLibrary.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,8 +314,10 @@ function(add_hpx_library name)
314314
# module interface unit exposed from the HPX libraries
315315
if(HPX_WITH_CXX_MODULES)
316316
if(NOT (CMAKE_CXX_SCAN_FOR_MODULES OR ${name}_SCAN_FOR_MODULES))
317+
hpx_debug("add_library.${name} SCAN_FOR_MODULES: OFF")
317318
set(${name}_SCAN_FOR_MODULES OFF)
318319
else()
320+
hpx_debug("add_library.${name} SCAN_FOR_MODULES: ON")
319321
set(${name}_SCAN_FOR_MODULES ON)
320322
endif()
321323
endif()

cmake/HPX_SetupTarget.cmake

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

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

228-
if(HPX_WITH_CXX_MODULES AND ${target}_SCAN_FOR_MODULES)
228+
if(HPX_WITH_CXX_MODULES AND target_SCAN_FOR_MODULES)
229+
hpx_debug("setup_target.${target} SCAN_FOR_MODULES: ON")
229230
hpx_configure_module_consumer(${target} hpx_core_module_if)
230231
else()
232+
hpx_debug("setup_target.${target} SCAN_FOR_MODULES: OFF")
233+
231234
# If modules are enabled, Clang emits DWARF v5, which requires using lld
232235
# instead of ld.
233236
if(HPX_WITH_CXX_MODULES AND (CMAKE_CXX_COMPILER_ID MATCHES "Clang"

components/component_storage/CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,11 @@ add_hpx_component(
3535
INSTALL_COMPONENT runtime
3636
HEADER_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/include
3737
HEADERS ${component_storage_headers}
38-
PREPEND_SOURCE_ROOT
38+
PREPEND_SOURCE_ROOT ${HPX_WITH_UNITY_BUILD_OPTION}
39+
${HPX_WITH_CXX_MODULES_OPTION}
3940
SOURCE_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/src
4041
SOURCES ${component_storage_sources}
41-
DEPENDENCIES unordered_component ${HPX_WITH_UNITY_BUILD_OPTION}
42+
DEPENDENCIES unordered_component
4243
)
4344

4445
target_compile_definitions(

components/component_storage/tests/unit/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ foreach(test ${tests})
2121
add_hpx_executable(
2222
${test}_test INTERNAL_FLAGS
2323
SOURCES ${sources} ${${test}_FLAGS}
24-
EXCLUDE_FROM_ALL
24+
EXCLUDE_FROM_ALL ${HPX_WITH_CXX_MODULES_OPTION}
2525
HPX_PREFIX ${HPX_BUILD_PREFIX}
2626
FOLDER ${folder_name}
2727
)

components/containers/partitioned_vector/CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,10 @@ add_hpx_component(
4949
INSTALL_COMPONENT runtime
5050
HEADER_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/include"
5151
HEADERS ${partitioned_vector_headers}
52-
PREPEND_SOURCE_ROOT
52+
PREPEND_SOURCE_ROOT ${HPX_WITH_UNITY_BUILD_OPTION}
53+
${HPX_WITH_CXX_MODULES_OPTION}
5354
SOURCE_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/src"
54-
SOURCES ${partitioned_vector_sources} ${HPX_WITH_UNITY_BUILD_OPTION}
55+
SOURCES ${partitioned_vector_sources}
5556
)
5657

5758
target_compile_definitions(

components/containers/partitioned_vector/tests/regressions/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ foreach(test ${tests})
2020
add_hpx_executable(
2121
${test}_test INTERNAL_FLAGS
2222
SOURCES ${sources} ${${test}_FLAGS}
23-
EXCLUDE_FROM_ALL
23+
EXCLUDE_FROM_ALL ${HPX_WITH_CXX_MODULES_OPTION}
2424
HPX_PREFIX ${HPX_BUILD_PREFIX}
2525
FOLDER "Tests/Regressions/Components/Containers/PartitionedVector"
2626
)

components/containers/partitioned_vector/tests/unit/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ foreach(test ${tests})
5353
add_hpx_executable(
5454
${test}_test INTERNAL_FLAGS
5555
SOURCES ${sources} ${${test}_FLAGS}
56-
EXCLUDE_FROM_ALL
56+
EXCLUDE_FROM_ALL ${HPX_WITH_CXX_MODULES_OPTION}
5757
HPX_PREFIX ${HPX_BUILD_PREFIX}
5858
FOLDER ${folder_name}
5959
)

0 commit comments

Comments
 (0)