Skip to content

Commit e7a9251

Browse files
committed
Enable compiling examples and tests using C++ modules
Signed-off-by: Hartmut Kaiser <hartmut.kaiser@gmail.com>
1 parent 454cb46 commit e7a9251

49 files changed

Lines changed: 77 additions & 53 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.

examples/1d_stencil/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,15 @@ foreach(example_program ${example_programs})
5858
add_hpx_executable(
5959
${example_program} INTERNAL_FLAGS
6060
SOURCES ${sources} ${${example_program}_FLAGS}
61-
FOLDER "Examples/1D Stencil"
61+
FOLDER "Examples/1D Stencil" ${HPX_WITH_CXX_MODULES_OPTION}
6262
)
6363

6464
add_hpx_example_target_dependencies("1d_stencil" ${example_program})
6565

6666
if(HPX_WITH_TESTS AND HPX_WITH_TESTS_EXAMPLES)
6767
add_hpx_example_test(
6868
"1d_stencil" ${example_program} ${${example_program}_PARAMETERS}
69+
${HPX_WITH_CXX_MODULES_OPTION}
6970
)
7071
endif()
7172

examples/accumulators/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ foreach(example_program ${example_programs})
3030
SOURCES ${component_sources}
3131
HEADERS ${component_headers}
3232
FOLDER "Examples/Quickstart/Accumulators/${example_program}"
33+
${HPX_WITH_CXX_MODULES_OPTION}
3334
)
3435

3536
# add example executable
@@ -38,6 +39,7 @@ foreach(example_program ${example_programs})
3839
SOURCES ${client_sources}
3940
DEPENDENCIES ${example_program}_component
4041
FOLDER "Examples/Quickstart/Accumulators/${example_program}"
42+
${HPX_WITH_CXX_MODULES_OPTION}
4143
)
4244

4345
add_hpx_example_target_dependencies("accumulators" ${example_program})

examples/apex/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,15 @@ foreach(example_program ${example_programs})
2121
add_hpx_executable(
2222
${example_program} INTERNAL_FLAGS
2323
SOURCES ${sources} ${${example_program}_FLAGS}
24-
FOLDER "Examples/Apex/${example_program}"
24+
FOLDER "Examples/Apex/${example_program}" ${HPX_WITH_CXX_MODULES_OPTION}
2525
)
2626

2727
add_hpx_example_target_dependencies("apex" ${example_program})
2828

2929
if(HPX_WITH_TESTS AND HPX_WITH_TESTS_EXAMPLES)
3030
add_hpx_example_test(
3131
"apex" ${example_program} ${${example_program}_PARAMETERS}
32+
${HPX_WITH_CXX_MODULES_OPTION}
3233
)
3334
endif()
3435

examples/async_io/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,15 @@ foreach(example_program ${example_programs})
2929
add_hpx_executable(
3030
${example_program} INTERNAL_FLAGS
3131
SOURCES ${sources} ${${example_program}_FLAGS}
32-
FOLDER "Examples/AsyncIO/${example_program}"
32+
FOLDER "Examples/AsyncIO/${example_program}" ${HPX_WITH_CXX_MODULES_OPTION}
3333
)
3434

3535
add_hpx_example_target_dependencies("async_io" ${example_program})
3636

3737
if(HPX_WITH_TESTS AND HPX_WITH_TESTS_EXAMPLES)
3838
add_hpx_example_test(
3939
"async_io" ${example_program} ${${example_program}_PARAMETERS}
40+
${HPX_WITH_CXX_MODULES_OPTION}
4041
)
4142
endif()
4243
endforeach()

examples/balancing/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,15 @@ foreach(example_program ${example_programs})
1818
add_hpx_executable(
1919
${example_program} INTERNAL_FLAGS
2020
SOURCES ${sources} ${${example_program}_FLAGS}
21-
FOLDER "Examples/Balancing"
21+
FOLDER "Examples/Balancing" ${HPX_WITH_CXX_MODULES_OPTION}
2222
)
2323

2424
add_hpx_example_target_dependencies("balancing" ${example_program})
2525

2626
if(HPX_WITH_TESTS AND HPX_WITH_TESTS_EXAMPLES)
2727
add_hpx_example_test(
2828
"balancing" ${example_program} ${${example_program}_PARAMETERS}
29+
${HPX_WITH_CXX_MODULES_OPTION}
2930
)
3031
endif()
3132
endforeach()

examples/cancelable_action/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ add_hpx_executable(
2121
cancelable_action_client INTERNAL_FLAGS
2222
SOURCES ${sources}
2323
DEPENDENCIES cancelable_action_component
24-
FOLDER "Examples/CancelableAction"
24+
FOLDER "Examples/CancelableAction" ${HPX_WITH_CXX_MODULES_OPTION}
2525
)
2626

2727
add_hpx_example_target_dependencies(
@@ -31,5 +31,6 @@ add_hpx_example_target_dependencies(
3131
if(HPX_WITH_TESTS AND HPX_WITH_TESTS_EXAMPLES)
3232
add_hpx_example_test(
3333
"cancelable_action" cancelable_action_client THREADS_PER_LOCALITY 4
34+
${HPX_WITH_CXX_MODULES_OPTION}
3435
)
3536
endif()

examples/cancelable_action/cancelable_action/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ add_hpx_component(
99
INSTALL_COMPONENT examples
1010
HEADER_GLOB "cancelable_action.h*"
1111
SOURCE_GLOB "cancelable_action.c*"
12-
FOLDER "Examples/CancelableAction"
12+
FOLDER "Examples/CancelableAction" ${HPX_WITH_CXX_MODULES_OPTION}
1313
)

examples/future_reduce/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,15 @@ foreach(example_program ${example_programs})
1717
add_hpx_executable(
1818
${example_program} INTERNAL_FLAGS
1919
SOURCES ${sources} ${${example_program}_FLAGS}
20-
FOLDER "Examples/FutureReduce"
20+
FOLDER "Examples/FutureReduce" ${HPX_WITH_CXX_MODULES_OPTION}
2121
)
2222

2323
add_hpx_example_target_dependencies("future_reduce" ${example_program})
2424

2525
if(HPX_WITH_TESTS AND HPX_WITH_TESTS_EXAMPLES)
2626
add_hpx_example_test(
2727
"future_reduce" ${example_program} ${${example_program}_PARAMETERS}
28+
${HPX_WITH_CXX_MODULES_OPTION}
2829
)
2930
endif()
3031
endforeach()

examples/heartbeat/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ add_hpx_executable(
2828
SOURCES ${heartbeat_SOURCES}
2929
HEADERS ${heartbeat_HEADERS}
3030
FOLDER "Examples/HeartBeat"
31-
DEPENDENCIES iostreams_component
31+
DEPENDENCIES iostreams_component ${HPX_WITH_CXX_MODULES_OPTION}
3232
)
3333

3434
# add pseudo-target dependencies
@@ -39,7 +39,7 @@ add_hpx_executable(
3939
heartbeat_console INTERNAL_FLAGS
4040
SOURCES heartbeat_console.cpp
4141
FOLDER "Examples/HeartBeat"
42-
DEPENDENCIES iostreams_component
42+
DEPENDENCIES iostreams_component ${HPX_WITH_CXX_MODULES_OPTION}
4343
)
4444

4545
# add pseudo-target dependencies

examples/hello_world_component/CMakeLists.txt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,14 @@ if(EXISTS "${HPX_DIR}")
4848
hello_world_component
4949
COMPONENT_DEPENDENCIES iostreams
5050
DEPENDENCIES HPX::wrap_main
51-
TYPE COMPONENT
51+
TYPE COMPONENT ${HPX_WITH_CXX_MODULES_OPTION}
52+
)
53+
hpx_setup_target(
54+
hello_world_client DEPENDENCIES hello_world_component
55+
${HPX_WITH_CXX_MODULES_OPTION}
5256
)
53-
hpx_setup_target(hello_world_client DEPENDENCIES hello_world_component)
5457
else()
55-
hpx_setup_target(hello_world_client)
58+
hpx_setup_target(hello_world_client ${HPX_WITH_CXX_MODULES_OPTION})
5659
endif()
5760
else()
5861
message(FATAL_ERROR "Unknown SETUP_TYPE=\"${SETUP_TYPE}\"")

0 commit comments

Comments
 (0)