From 90a50540082b07b3c56904334bc86a665cbabfa3 Mon Sep 17 00:00:00 2001 From: arpittkhandelwal Date: Wed, 29 Apr 2026 09:06:57 +0530 Subject: [PATCH 1/5] ci: switch to lukka/get-cmake to resolve GitHub API rate limits --- .github/workflows/codeql.yml | 2 +- .github/workflows/windows_clang_debug.yml | 4 +--- .github/workflows/windows_clang_release.yml | 4 +--- .github/workflows/windows_debug_vs2022.yml | 4 +--- .github/workflows/windows_debug_vs2022_fetch_boost.yml | 4 +--- .github/workflows/windows_debug_vs2022_fetch_hwloc.yml | 4 +--- .github/workflows/windows_debug_vs2022_local_runtime.yml | 4 +--- .github/workflows/windows_debug_vs2022_modules.yml | 4 +--- .github/workflows/windows_debug_vs2022_tracy.yml | 4 +--- .github/workflows/windows_release_2022.yml | 4 +--- .github/workflows/windows_release_gcc_mingw.yml | 4 +--- .github/workflows/windows_release_static.yml | 4 +--- 12 files changed, 12 insertions(+), 34 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index c79fb791737..0663c88df50 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -54,7 +54,7 @@ jobs: queries: security-and-quality - name: Install CMake - uses: jwlawson/actions-setup-cmake@v2.2 + uses: lukka/get-cmake@latest - name: Install Ninja uses: seanmiddleditch/gha-setup-ninja@master diff --git a/.github/workflows/windows_clang_debug.yml b/.github/workflows/windows_clang_debug.yml index acd1e201a50..6e6fd185389 100644 --- a/.github/workflows/windows_clang_debug.yml +++ b/.github/workflows/windows_clang_debug.yml @@ -19,9 +19,7 @@ jobs: steps: - uses: actions/checkout@v6 - - uses: jwlawson/actions-setup-cmake@v2.2 - with: - github-api-token: ${{ secrets.GITHUB_TOKEN }} + - uses: lukka/get-cmake@latest - name: Install dependencies run: | diff --git a/.github/workflows/windows_clang_release.yml b/.github/workflows/windows_clang_release.yml index 720fe7628ab..023d6272de1 100644 --- a/.github/workflows/windows_clang_release.yml +++ b/.github/workflows/windows_clang_release.yml @@ -19,9 +19,7 @@ jobs: steps: - uses: actions/checkout@v6 - - uses: jwlawson/actions-setup-cmake@v2.2 - with: - github-api-token: ${{ secrets.GITHUB_TOKEN }} + - uses: lukka/get-cmake@latest - name: Install dependencies run: | diff --git a/.github/workflows/windows_debug_vs2022.yml b/.github/workflows/windows_debug_vs2022.yml index 2c311304c13..c3510fad4f5 100644 --- a/.github/workflows/windows_debug_vs2022.yml +++ b/.github/workflows/windows_debug_vs2022.yml @@ -19,9 +19,7 @@ jobs: steps: - uses: actions/checkout@v6 - - uses: jwlawson/actions-setup-cmake@v2.2 - with: - github-api-token: ${{ secrets.GITHUB_TOKEN }} + - uses: lukka/get-cmake@latest - name: Install dependencies run: | diff --git a/.github/workflows/windows_debug_vs2022_fetch_boost.yml b/.github/workflows/windows_debug_vs2022_fetch_boost.yml index eab50f1e7cc..5f49a29e481 100644 --- a/.github/workflows/windows_debug_vs2022_fetch_boost.yml +++ b/.github/workflows/windows_debug_vs2022_fetch_boost.yml @@ -18,9 +18,7 @@ jobs: steps: - uses: actions/checkout@v6 - - uses: jwlawson/actions-setup-cmake@v2.2 - with: - github-api-token: ${{ secrets.GITHUB_TOKEN }} + - uses: lukka/get-cmake@latest - name: Install dependencies run: | diff --git a/.github/workflows/windows_debug_vs2022_fetch_hwloc.yml b/.github/workflows/windows_debug_vs2022_fetch_hwloc.yml index 368929ff4f5..9acbafefb9d 100644 --- a/.github/workflows/windows_debug_vs2022_fetch_hwloc.yml +++ b/.github/workflows/windows_debug_vs2022_fetch_hwloc.yml @@ -19,9 +19,7 @@ jobs: steps: - uses: actions/checkout@v6 - - uses: jwlawson/actions-setup-cmake@v2.2 - with: - github-api-token: ${{ secrets.GITHUB_TOKEN }} + - uses: lukka/get-cmake@latest - name: Install dependencies run: | diff --git a/.github/workflows/windows_debug_vs2022_local_runtime.yml b/.github/workflows/windows_debug_vs2022_local_runtime.yml index c199b9ce2e6..befc251c3a0 100644 --- a/.github/workflows/windows_debug_vs2022_local_runtime.yml +++ b/.github/workflows/windows_debug_vs2022_local_runtime.yml @@ -14,9 +14,7 @@ jobs: steps: - uses: actions/checkout@v6 - - uses: jwlawson/actions-setup-cmake@v2.2 - with: - github-api-token: ${{ secrets.GITHUB_TOKEN }} + - uses: lukka/get-cmake@latest - name: Install dependencies run: | diff --git a/.github/workflows/windows_debug_vs2022_modules.yml b/.github/workflows/windows_debug_vs2022_modules.yml index 859c1cb0aeb..ec0fe89da12 100644 --- a/.github/workflows/windows_debug_vs2022_modules.yml +++ b/.github/workflows/windows_debug_vs2022_modules.yml @@ -19,9 +19,7 @@ jobs: steps: - uses: actions/checkout@v6 - - uses: jwlawson/actions-setup-cmake@v2.2 - with: - github-api-token: ${{ secrets.GITHUB_TOKEN }} + - uses: lukka/get-cmake@latest - name: Install dependencies run: | diff --git a/.github/workflows/windows_debug_vs2022_tracy.yml b/.github/workflows/windows_debug_vs2022_tracy.yml index 41999582e48..5daf61ee36b 100644 --- a/.github/workflows/windows_debug_vs2022_tracy.yml +++ b/.github/workflows/windows_debug_vs2022_tracy.yml @@ -19,9 +19,7 @@ jobs: steps: - uses: actions/checkout@v6 - - uses: jwlawson/actions-setup-cmake@v2.2 - with: - github-api-token: ${{ secrets.GITHUB_TOKEN }} + - uses: lukka/get-cmake@latest - name: Install dependencies run: | diff --git a/.github/workflows/windows_release_2022.yml b/.github/workflows/windows_release_2022.yml index 326cf4d1bc1..457d24f4e29 100644 --- a/.github/workflows/windows_release_2022.yml +++ b/.github/workflows/windows_release_2022.yml @@ -18,9 +18,7 @@ jobs: steps: - uses: actions/checkout@v6 - - uses: jwlawson/actions-setup-cmake@v2.2 - with: - github-api-token: ${{ secrets.GITHUB_TOKEN }} + - uses: lukka/get-cmake@latest - name: Install dependencies run: | diff --git a/.github/workflows/windows_release_gcc_mingw.yml b/.github/workflows/windows_release_gcc_mingw.yml index 0dc996cc7d0..085137eec4e 100644 --- a/.github/workflows/windows_release_gcc_mingw.yml +++ b/.github/workflows/windows_release_gcc_mingw.yml @@ -18,9 +18,7 @@ jobs: steps: - uses: actions/checkout@v6 - - uses: jwlawson/actions-setup-cmake@v2.2 - with: - github-api-token: ${{ secrets.GITHUB_TOKEN }} + - uses: lukka/get-cmake@latest - name: Install dependencies run: | diff --git a/.github/workflows/windows_release_static.yml b/.github/workflows/windows_release_static.yml index b7936581db3..82b1886a9a8 100644 --- a/.github/workflows/windows_release_static.yml +++ b/.github/workflows/windows_release_static.yml @@ -19,9 +19,7 @@ jobs: steps: - uses: actions/checkout@v6 - - uses: jwlawson/actions-setup-cmake@v2.2 - with: - github-api-token: ${{ secrets.GITHUB_TOKEN }} + - uses: lukka/get-cmake@latest - name: Install dependencies run: | From 1a378e0f80f77b34de4f469694dcd1952fd6dd81 Mon Sep 17 00:00:00 2001 From: arpittkhandelwal Date: Wed, 29 Apr 2026 20:49:14 +0530 Subject: [PATCH 2/5] cmake: Remove conflicting manual BMI flags; rely on CMake native module tracking The C++20 modules CI build was failing with: fatal error: module 'HPX.Core' not found 41 | import HPX.Core; Root cause ---------- HPX_CXXModules.cmake had two conflicting systems active simultaneously: 1. libs/CMakeLists.txt uses FILE_SET CXX_MODULES (CMake 3.28+ native module support). CMake/Ninja automatically manage the BMI, writing it to CMakeFiles/.dir/ and encoding the dependency in a .ninja_dyndep file. 2. hpx_configure_module_producer() was ALSO adding a manual -fmodule-output=$ flag, telling Clang to write the BMI to a second, different location. 3. hpx_configure_module_consumer() was then adding -fprebuilt-module-path pointing to that second location. Because the two systems wrote and looked for the BMI in different directories, consumers could not find HPX.Core. Fix --- Remove all manual -fmodule-output and -fprebuilt-module-path flags from hpx_configure_module_producer() and hpx_configure_module_consumer(). CMake 3.29+ with FILE_SET CXX_MODULES and the Ninja generator handles the full dependency chain automatically: - scans consumers (CXX_SCAN_FOR_MODULES ON) for 'import HPX.Core;' - resolves that to the hpx_core_module target's FILE_SET - ensures the BMI is built before any consumer that needs it - passes the correct -fmodule-output / -fmodule-file flags itself For installed/external builds the CXX_MODULES_BMI DESTINATION in the install() call (libs/CMakeLists.txt) exports the BMI location into HPXInternalTargets.cmake, so downstream find_package(HPX) consumers also get the correct paths automatically. The INTERFACE_CXX_SCAN_FOR_MODULES ON property on the _if interface targets is retained so the scanning requirement propagates to all consumers. The -fuse-ld=lld / -Wl,--error-limit=0 flags for Clang shared libraries and executables are also retained as Clang emits DWARF-5 when compiling with C++20 modules. Also removed the unused include(HPX_AddCompileFlag) since no hpx_add_target_compile_option_if_available calls remain in this file. --- cmake/HPX_CXXModules.cmake | 115 +++++++++---------------------------- 1 file changed, 27 insertions(+), 88 deletions(-) diff --git a/cmake/HPX_CXXModules.cmake b/cmake/HPX_CXXModules.cmake index f01bf4c3e0a..541f949e752 100644 --- a/cmake/HPX_CXXModules.cmake +++ b/cmake/HPX_CXXModules.cmake @@ -4,7 +4,6 @@ # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -include(HPX_AddCompileFlag) include(HPX_Message) macro(hpx_check_cxx_modules_support) @@ -65,79 +64,39 @@ if(NOT HPX_WITH_CXX_MODULES) return() endif() -# hpx_configure_module_producer( [MODULE_OUT_DIR ]) +# hpx_configure_module_producer() # -# * Ensures a stable module output dir for producer target -# * Adds compiler flags to write module cache there (Clang/GCC) -# * Creates an interface target '_if' for consumers to link to +# * Creates an interface target '_if' for consumers to link to. +# * Sets INTERFACE_CXX_SCAN_FOR_MODULES ON so that CMake's native module +# dependency tracking propagates to all consumers. +# +# CMake 3.29+ with FILE_SET CXX_MODULES handles BMI generation and +# -fmodule-output/-fprebuilt-module-path flags automatically. No manual compiler +# flags are needed here. function(hpx_configure_module_producer producer) if(NOT TARGET ${producer}) hpx_error("hpx_configure_module_producer: target '${producer}' not found") endif() - # parse optional args - set(options) - set(one_value_args MODULE_OUT_DIR) - set(multi_value_args) - cmake_parse_arguments( - _args "${options}" "${one_value_args}" "${multi_value_args}" ${ARGN} - ) - - if(_args_MODULE_OUT_DIR) - set(_moddir "${_args_MODULE_OUT_DIR}") - else() - set(_moddir "$") - endif() - set(_iface "${producer}_if") if(NOT TARGET ${_iface}) add_library(${_iface} INTERFACE) target_link_libraries(${_iface} INTERFACE ${producer}) endif() - # Set a property so consumers can query the BMI directory via - # get_target_property. - set_target_properties( - ${_iface} PROPERTIES INTERFACE_EXPORT_MODULE_DIR "${_moddir}" - ) - - # Make sure consumers scan for the BMI - set_target_properties(${_iface} PROPERTIES INTERFACE_CXX_SCAN_FOR_MODULES On) - - if(MSVC) - # MSVC: CMake/MSVC handle IFCs automatically; create a target for - # convenience, consumers can link to this to get ordering and include info - return() - endif() - - # Compiler-specific flags to instruct where to write module cache - if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES - "AppleClang" - ) - # Clang common flags - target_compile_options(${producer} PRIVATE "-fmodule-output=${_moddir}") - elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - # GCC: modern flags - hpx_add_target_compile_option_if_available( - ${producer} PRIVATE "-fmodule-output=${_moddir}" RESULT ok - ) - if(NOT ok) - hpx_error( - "hpx_configure_module_producer: the used version of gcc does not support '-fmodule-output'" - ) - endif() - else() - hpx_warn( - "hpx_configure_module_producer: unknown compiler '${CMAKE_CXX_COMPILER_ID}'; " - "exposing EXPORT_MODULE_DIR='${_moddir}' for manual handling" - ) - endif() + # Propagate scanning requirement to consumers via the interface target. CMake + # uses this to enable its native module dependency scanning for any target + # that links to this interface. + set_target_properties(${_iface} PROPERTIES INTERFACE_CXX_SCAN_FOR_MODULES ON) endfunction() -# hpx_configure_module_consumer( ]) +# hpx_configure_module_consumer( ) +# +# * Links the consumer to the producer interface target. +# * Enables CMake's native module scanning on the consumer. # -# * propagates module-related properties from producer interface target -# * sets necessary consumer compiler flags for clang and gcc +# CMake 3.29+ automatically resolves the BMI location from the FILE_SET +# CXX_MODULES declared on the producer. No -fprebuilt-module-path needed. function(hpx_configure_module_consumer consumer producer) if(NOT TARGET ${consumer}) hpx_error("hpx_configure_module_consumer: target '${consumer}' not found") @@ -147,40 +106,20 @@ function(hpx_configure_module_consumer consumer producer) endif() target_link_libraries(${consumer} PRIVATE ${producer}) + get_target_property(_scan ${producer} INTERFACE_CXX_SCAN_FOR_MODULES) if(_scan) set_target_properties(${consumer} PROPERTIES CXX_SCAN_FOR_MODULES ${_scan}) endif() - get_target_property(_module_dir ${producer} INTERFACE_EXPORT_MODULE_DIR) - if(_module_dir) - if(MSVC) - return() - elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID - MATCHES "AppleClang" - ) - target_compile_options( - ${consumer} PRIVATE "-fprebuilt-module-path=${_module_dir}" - ) - get_target_property(_type ${consumer} TYPE) - if((_type STREQUAL "SHARED_LIBRARY") OR (_type STREQUAL "EXECUTABLE")) - target_link_options(${consumer} PRIVATE "-fuse-ld=lld") - target_link_options(${consumer} PRIVATE "-Wl,--error-limit=0") - endif() - elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - hpx_add_target_compile_option_if_available( - ${consumer} PRIVATE "-fprebuilt-module-path=${_module_dir}" RESULT ok - ) - if(NOT ok) - hpx_error( - "hpx_configure_module_consumer: the used version of gcc does not " - "support '-fprebuilt-module-path='" - ) - endif() - else() - hpx_warn( - "hpx_configure_module_consumer: unknown compiler '${CMAKE_CXX_COMPILER_ID}'" - ) + # Clang emits DWARF-5 when compiling with C++20 modules, which requires lld. + if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES + "AppleClang" + ) + get_target_property(_type ${consumer} TYPE) + if((_type STREQUAL "SHARED_LIBRARY") OR (_type STREQUAL "EXECUTABLE")) + target_link_options(${consumer} PRIVATE "-fuse-ld=lld") + target_link_options(${consumer} PRIVATE "-Wl,--error-limit=0") endif() endif() endfunction() From 48dbcb9ec788656f6df712169a198921d2a5f9be Mon Sep 17 00:00:00 2001 From: arpittkhandelwal Date: Thu, 30 Apr 2026 00:22:27 +0530 Subject: [PATCH 3/5] ci: pin lukka/get-cmake to v4 for deterministic builds --- .github/workflows/codeql.yml | 2 +- .github/workflows/windows_clang_debug.yml | 2 +- .github/workflows/windows_clang_release.yml | 2 +- .github/workflows/windows_debug_vs2022.yml | 2 +- .github/workflows/windows_debug_vs2022_fetch_boost.yml | 2 +- .github/workflows/windows_debug_vs2022_fetch_hwloc.yml | 2 +- .github/workflows/windows_debug_vs2022_local_runtime.yml | 2 +- .github/workflows/windows_debug_vs2022_modules.yml | 2 +- .github/workflows/windows_debug_vs2022_tracy.yml | 2 +- .github/workflows/windows_release_2022.yml | 2 +- .github/workflows/windows_release_gcc_mingw.yml | 2 +- .github/workflows/windows_release_static.yml | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 0663c88df50..7f6e9a28847 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -54,7 +54,7 @@ jobs: queries: security-and-quality - name: Install CMake - uses: lukka/get-cmake@latest + uses: lukka/get-cmake@v4 - name: Install Ninja uses: seanmiddleditch/gha-setup-ninja@master diff --git a/.github/workflows/windows_clang_debug.yml b/.github/workflows/windows_clang_debug.yml index 6e6fd185389..23b895d0752 100644 --- a/.github/workflows/windows_clang_debug.yml +++ b/.github/workflows/windows_clang_debug.yml @@ -19,7 +19,7 @@ jobs: steps: - uses: actions/checkout@v6 - - uses: lukka/get-cmake@latest + - uses: lukka/get-cmake@v4 - name: Install dependencies run: | diff --git a/.github/workflows/windows_clang_release.yml b/.github/workflows/windows_clang_release.yml index 023d6272de1..62ae2584b03 100644 --- a/.github/workflows/windows_clang_release.yml +++ b/.github/workflows/windows_clang_release.yml @@ -19,7 +19,7 @@ jobs: steps: - uses: actions/checkout@v6 - - uses: lukka/get-cmake@latest + - uses: lukka/get-cmake@v4 - name: Install dependencies run: | diff --git a/.github/workflows/windows_debug_vs2022.yml b/.github/workflows/windows_debug_vs2022.yml index c3510fad4f5..9371bffe34e 100644 --- a/.github/workflows/windows_debug_vs2022.yml +++ b/.github/workflows/windows_debug_vs2022.yml @@ -19,7 +19,7 @@ jobs: steps: - uses: actions/checkout@v6 - - uses: lukka/get-cmake@latest + - uses: lukka/get-cmake@v4 - name: Install dependencies run: | diff --git a/.github/workflows/windows_debug_vs2022_fetch_boost.yml b/.github/workflows/windows_debug_vs2022_fetch_boost.yml index 5f49a29e481..d225f996a81 100644 --- a/.github/workflows/windows_debug_vs2022_fetch_boost.yml +++ b/.github/workflows/windows_debug_vs2022_fetch_boost.yml @@ -18,7 +18,7 @@ jobs: steps: - uses: actions/checkout@v6 - - uses: lukka/get-cmake@latest + - uses: lukka/get-cmake@v4 - name: Install dependencies run: | diff --git a/.github/workflows/windows_debug_vs2022_fetch_hwloc.yml b/.github/workflows/windows_debug_vs2022_fetch_hwloc.yml index 9acbafefb9d..13e0ee9eb88 100644 --- a/.github/workflows/windows_debug_vs2022_fetch_hwloc.yml +++ b/.github/workflows/windows_debug_vs2022_fetch_hwloc.yml @@ -19,7 +19,7 @@ jobs: steps: - uses: actions/checkout@v6 - - uses: lukka/get-cmake@latest + - uses: lukka/get-cmake@v4 - name: Install dependencies run: | diff --git a/.github/workflows/windows_debug_vs2022_local_runtime.yml b/.github/workflows/windows_debug_vs2022_local_runtime.yml index befc251c3a0..430f2651ada 100644 --- a/.github/workflows/windows_debug_vs2022_local_runtime.yml +++ b/.github/workflows/windows_debug_vs2022_local_runtime.yml @@ -14,7 +14,7 @@ jobs: steps: - uses: actions/checkout@v6 - - uses: lukka/get-cmake@latest + - uses: lukka/get-cmake@v4 - name: Install dependencies run: | diff --git a/.github/workflows/windows_debug_vs2022_modules.yml b/.github/workflows/windows_debug_vs2022_modules.yml index ec0fe89da12..76fa0803114 100644 --- a/.github/workflows/windows_debug_vs2022_modules.yml +++ b/.github/workflows/windows_debug_vs2022_modules.yml @@ -19,7 +19,7 @@ jobs: steps: - uses: actions/checkout@v6 - - uses: lukka/get-cmake@latest + - uses: lukka/get-cmake@v4 - name: Install dependencies run: | diff --git a/.github/workflows/windows_debug_vs2022_tracy.yml b/.github/workflows/windows_debug_vs2022_tracy.yml index 5daf61ee36b..e821c991992 100644 --- a/.github/workflows/windows_debug_vs2022_tracy.yml +++ b/.github/workflows/windows_debug_vs2022_tracy.yml @@ -19,7 +19,7 @@ jobs: steps: - uses: actions/checkout@v6 - - uses: lukka/get-cmake@latest + - uses: lukka/get-cmake@v4 - name: Install dependencies run: | diff --git a/.github/workflows/windows_release_2022.yml b/.github/workflows/windows_release_2022.yml index 457d24f4e29..88aff23fcb5 100644 --- a/.github/workflows/windows_release_2022.yml +++ b/.github/workflows/windows_release_2022.yml @@ -18,7 +18,7 @@ jobs: steps: - uses: actions/checkout@v6 - - uses: lukka/get-cmake@latest + - uses: lukka/get-cmake@v4 - name: Install dependencies run: | diff --git a/.github/workflows/windows_release_gcc_mingw.yml b/.github/workflows/windows_release_gcc_mingw.yml index 085137eec4e..9b06acf8692 100644 --- a/.github/workflows/windows_release_gcc_mingw.yml +++ b/.github/workflows/windows_release_gcc_mingw.yml @@ -18,7 +18,7 @@ jobs: steps: - uses: actions/checkout@v6 - - uses: lukka/get-cmake@latest + - uses: lukka/get-cmake@v4 - name: Install dependencies run: | diff --git a/.github/workflows/windows_release_static.yml b/.github/workflows/windows_release_static.yml index 82b1886a9a8..ac0077a8080 100644 --- a/.github/workflows/windows_release_static.yml +++ b/.github/workflows/windows_release_static.yml @@ -19,7 +19,7 @@ jobs: steps: - uses: actions/checkout@v6 - - uses: lukka/get-cmake@latest + - uses: lukka/get-cmake@v4 - name: Install dependencies run: | From e9442a98323ed4e7aae9ac2fbd16619a514f0848 Mon Sep 17 00:00:00 2001 From: arpittkhandelwal Date: Thu, 30 Apr 2026 00:24:01 +0530 Subject: [PATCH 4/5] ci: pin lukka/get-cmake to v4.3.0 to resolve version resolution error --- .github/workflows/codeql.yml | 2 +- .github/workflows/windows_clang_debug.yml | 2 +- .github/workflows/windows_clang_release.yml | 2 +- .github/workflows/windows_debug_vs2022.yml | 2 +- .github/workflows/windows_debug_vs2022_fetch_boost.yml | 2 +- .github/workflows/windows_debug_vs2022_fetch_hwloc.yml | 2 +- .github/workflows/windows_debug_vs2022_local_runtime.yml | 2 +- .github/workflows/windows_debug_vs2022_modules.yml | 2 +- .github/workflows/windows_debug_vs2022_tracy.yml | 2 +- .github/workflows/windows_release_2022.yml | 2 +- .github/workflows/windows_release_gcc_mingw.yml | 2 +- .github/workflows/windows_release_static.yml | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 7f6e9a28847..7f44d109bd6 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -54,7 +54,7 @@ jobs: queries: security-and-quality - name: Install CMake - uses: lukka/get-cmake@v4 + uses: lukka/get-cmake@v4.3.0 - name: Install Ninja uses: seanmiddleditch/gha-setup-ninja@master diff --git a/.github/workflows/windows_clang_debug.yml b/.github/workflows/windows_clang_debug.yml index 23b895d0752..52410263b00 100644 --- a/.github/workflows/windows_clang_debug.yml +++ b/.github/workflows/windows_clang_debug.yml @@ -19,7 +19,7 @@ jobs: steps: - uses: actions/checkout@v6 - - uses: lukka/get-cmake@v4 + - uses: lukka/get-cmake@v4.3.0 - name: Install dependencies run: | diff --git a/.github/workflows/windows_clang_release.yml b/.github/workflows/windows_clang_release.yml index 62ae2584b03..4a3292e4f55 100644 --- a/.github/workflows/windows_clang_release.yml +++ b/.github/workflows/windows_clang_release.yml @@ -19,7 +19,7 @@ jobs: steps: - uses: actions/checkout@v6 - - uses: lukka/get-cmake@v4 + - uses: lukka/get-cmake@v4.3.0 - name: Install dependencies run: | diff --git a/.github/workflows/windows_debug_vs2022.yml b/.github/workflows/windows_debug_vs2022.yml index 9371bffe34e..2077ee2c811 100644 --- a/.github/workflows/windows_debug_vs2022.yml +++ b/.github/workflows/windows_debug_vs2022.yml @@ -19,7 +19,7 @@ jobs: steps: - uses: actions/checkout@v6 - - uses: lukka/get-cmake@v4 + - uses: lukka/get-cmake@v4.3.0 - name: Install dependencies run: | diff --git a/.github/workflows/windows_debug_vs2022_fetch_boost.yml b/.github/workflows/windows_debug_vs2022_fetch_boost.yml index d225f996a81..eec77112919 100644 --- a/.github/workflows/windows_debug_vs2022_fetch_boost.yml +++ b/.github/workflows/windows_debug_vs2022_fetch_boost.yml @@ -18,7 +18,7 @@ jobs: steps: - uses: actions/checkout@v6 - - uses: lukka/get-cmake@v4 + - uses: lukka/get-cmake@v4.3.0 - name: Install dependencies run: | diff --git a/.github/workflows/windows_debug_vs2022_fetch_hwloc.yml b/.github/workflows/windows_debug_vs2022_fetch_hwloc.yml index 13e0ee9eb88..30118473113 100644 --- a/.github/workflows/windows_debug_vs2022_fetch_hwloc.yml +++ b/.github/workflows/windows_debug_vs2022_fetch_hwloc.yml @@ -19,7 +19,7 @@ jobs: steps: - uses: actions/checkout@v6 - - uses: lukka/get-cmake@v4 + - uses: lukka/get-cmake@v4.3.0 - name: Install dependencies run: | diff --git a/.github/workflows/windows_debug_vs2022_local_runtime.yml b/.github/workflows/windows_debug_vs2022_local_runtime.yml index 430f2651ada..ee3d1381ae6 100644 --- a/.github/workflows/windows_debug_vs2022_local_runtime.yml +++ b/.github/workflows/windows_debug_vs2022_local_runtime.yml @@ -14,7 +14,7 @@ jobs: steps: - uses: actions/checkout@v6 - - uses: lukka/get-cmake@v4 + - uses: lukka/get-cmake@v4.3.0 - name: Install dependencies run: | diff --git a/.github/workflows/windows_debug_vs2022_modules.yml b/.github/workflows/windows_debug_vs2022_modules.yml index 76fa0803114..b039989e716 100644 --- a/.github/workflows/windows_debug_vs2022_modules.yml +++ b/.github/workflows/windows_debug_vs2022_modules.yml @@ -19,7 +19,7 @@ jobs: steps: - uses: actions/checkout@v6 - - uses: lukka/get-cmake@v4 + - uses: lukka/get-cmake@v4.3.0 - name: Install dependencies run: | diff --git a/.github/workflows/windows_debug_vs2022_tracy.yml b/.github/workflows/windows_debug_vs2022_tracy.yml index e821c991992..b25f16489e2 100644 --- a/.github/workflows/windows_debug_vs2022_tracy.yml +++ b/.github/workflows/windows_debug_vs2022_tracy.yml @@ -19,7 +19,7 @@ jobs: steps: - uses: actions/checkout@v6 - - uses: lukka/get-cmake@v4 + - uses: lukka/get-cmake@v4.3.0 - name: Install dependencies run: | diff --git a/.github/workflows/windows_release_2022.yml b/.github/workflows/windows_release_2022.yml index 88aff23fcb5..f1b0327312b 100644 --- a/.github/workflows/windows_release_2022.yml +++ b/.github/workflows/windows_release_2022.yml @@ -18,7 +18,7 @@ jobs: steps: - uses: actions/checkout@v6 - - uses: lukka/get-cmake@v4 + - uses: lukka/get-cmake@v4.3.0 - name: Install dependencies run: | diff --git a/.github/workflows/windows_release_gcc_mingw.yml b/.github/workflows/windows_release_gcc_mingw.yml index 9b06acf8692..1048cfc2054 100644 --- a/.github/workflows/windows_release_gcc_mingw.yml +++ b/.github/workflows/windows_release_gcc_mingw.yml @@ -18,7 +18,7 @@ jobs: steps: - uses: actions/checkout@v6 - - uses: lukka/get-cmake@v4 + - uses: lukka/get-cmake@v4.3.0 - name: Install dependencies run: | diff --git a/.github/workflows/windows_release_static.yml b/.github/workflows/windows_release_static.yml index ac0077a8080..aa81dd1f5f3 100644 --- a/.github/workflows/windows_release_static.yml +++ b/.github/workflows/windows_release_static.yml @@ -19,7 +19,7 @@ jobs: steps: - uses: actions/checkout@v6 - - uses: lukka/get-cmake@v4 + - uses: lukka/get-cmake@v4.3.0 - name: Install dependencies run: | From d8dc8bfbe9fec49e1ae2a22d4d9fe4f4bd6e0742 Mon Sep 17 00:00:00 2001 From: arpittkhandelwal Date: Thu, 30 Apr 2026 00:58:35 +0530 Subject: [PATCH 5/5] chore: revert unrelated changes to HPX_CXXModules.cmake --- cmake/HPX_CXXModules.cmake | 115 ++++++++++++++++++++++++++++--------- 1 file changed, 88 insertions(+), 27 deletions(-) diff --git a/cmake/HPX_CXXModules.cmake b/cmake/HPX_CXXModules.cmake index 541f949e752..f01bf4c3e0a 100644 --- a/cmake/HPX_CXXModules.cmake +++ b/cmake/HPX_CXXModules.cmake @@ -4,6 +4,7 @@ # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +include(HPX_AddCompileFlag) include(HPX_Message) macro(hpx_check_cxx_modules_support) @@ -64,39 +65,79 @@ if(NOT HPX_WITH_CXX_MODULES) return() endif() -# hpx_configure_module_producer() +# hpx_configure_module_producer( [MODULE_OUT_DIR ]) # -# * Creates an interface target '_if' for consumers to link to. -# * Sets INTERFACE_CXX_SCAN_FOR_MODULES ON so that CMake's native module -# dependency tracking propagates to all consumers. -# -# CMake 3.29+ with FILE_SET CXX_MODULES handles BMI generation and -# -fmodule-output/-fprebuilt-module-path flags automatically. No manual compiler -# flags are needed here. +# * Ensures a stable module output dir for producer target +# * Adds compiler flags to write module cache there (Clang/GCC) +# * Creates an interface target '_if' for consumers to link to function(hpx_configure_module_producer producer) if(NOT TARGET ${producer}) hpx_error("hpx_configure_module_producer: target '${producer}' not found") endif() + # parse optional args + set(options) + set(one_value_args MODULE_OUT_DIR) + set(multi_value_args) + cmake_parse_arguments( + _args "${options}" "${one_value_args}" "${multi_value_args}" ${ARGN} + ) + + if(_args_MODULE_OUT_DIR) + set(_moddir "${_args_MODULE_OUT_DIR}") + else() + set(_moddir "$") + endif() + set(_iface "${producer}_if") if(NOT TARGET ${_iface}) add_library(${_iface} INTERFACE) target_link_libraries(${_iface} INTERFACE ${producer}) endif() - # Propagate scanning requirement to consumers via the interface target. CMake - # uses this to enable its native module dependency scanning for any target - # that links to this interface. - set_target_properties(${_iface} PROPERTIES INTERFACE_CXX_SCAN_FOR_MODULES ON) + # Set a property so consumers can query the BMI directory via + # get_target_property. + set_target_properties( + ${_iface} PROPERTIES INTERFACE_EXPORT_MODULE_DIR "${_moddir}" + ) + + # Make sure consumers scan for the BMI + set_target_properties(${_iface} PROPERTIES INTERFACE_CXX_SCAN_FOR_MODULES On) + + if(MSVC) + # MSVC: CMake/MSVC handle IFCs automatically; create a target for + # convenience, consumers can link to this to get ordering and include info + return() + endif() + + # Compiler-specific flags to instruct where to write module cache + if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES + "AppleClang" + ) + # Clang common flags + target_compile_options(${producer} PRIVATE "-fmodule-output=${_moddir}") + elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + # GCC: modern flags + hpx_add_target_compile_option_if_available( + ${producer} PRIVATE "-fmodule-output=${_moddir}" RESULT ok + ) + if(NOT ok) + hpx_error( + "hpx_configure_module_producer: the used version of gcc does not support '-fmodule-output'" + ) + endif() + else() + hpx_warn( + "hpx_configure_module_producer: unknown compiler '${CMAKE_CXX_COMPILER_ID}'; " + "exposing EXPORT_MODULE_DIR='${_moddir}' for manual handling" + ) + endif() endfunction() -# hpx_configure_module_consumer( ) -# -# * Links the consumer to the producer interface target. -# * Enables CMake's native module scanning on the consumer. +# hpx_configure_module_consumer( ]) # -# CMake 3.29+ automatically resolves the BMI location from the FILE_SET -# CXX_MODULES declared on the producer. No -fprebuilt-module-path needed. +# * propagates module-related properties from producer interface target +# * sets necessary consumer compiler flags for clang and gcc function(hpx_configure_module_consumer consumer producer) if(NOT TARGET ${consumer}) hpx_error("hpx_configure_module_consumer: target '${consumer}' not found") @@ -106,20 +147,40 @@ function(hpx_configure_module_consumer consumer producer) endif() target_link_libraries(${consumer} PRIVATE ${producer}) - get_target_property(_scan ${producer} INTERFACE_CXX_SCAN_FOR_MODULES) if(_scan) set_target_properties(${consumer} PROPERTIES CXX_SCAN_FOR_MODULES ${_scan}) endif() - # Clang emits DWARF-5 when compiling with C++20 modules, which requires lld. - if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES - "AppleClang" - ) - get_target_property(_type ${consumer} TYPE) - if((_type STREQUAL "SHARED_LIBRARY") OR (_type STREQUAL "EXECUTABLE")) - target_link_options(${consumer} PRIVATE "-fuse-ld=lld") - target_link_options(${consumer} PRIVATE "-Wl,--error-limit=0") + get_target_property(_module_dir ${producer} INTERFACE_EXPORT_MODULE_DIR) + if(_module_dir) + if(MSVC) + return() + elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID + MATCHES "AppleClang" + ) + target_compile_options( + ${consumer} PRIVATE "-fprebuilt-module-path=${_module_dir}" + ) + get_target_property(_type ${consumer} TYPE) + if((_type STREQUAL "SHARED_LIBRARY") OR (_type STREQUAL "EXECUTABLE")) + target_link_options(${consumer} PRIVATE "-fuse-ld=lld") + target_link_options(${consumer} PRIVATE "-Wl,--error-limit=0") + endif() + elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + hpx_add_target_compile_option_if_available( + ${consumer} PRIVATE "-fprebuilt-module-path=${_module_dir}" RESULT ok + ) + if(NOT ok) + hpx_error( + "hpx_configure_module_consumer: the used version of gcc does not " + "support '-fprebuilt-module-path='" + ) + endif() + else() + hpx_warn( + "hpx_configure_module_consumer: unknown compiler '${CMAKE_CXX_COMPILER_ID}'" + ) endif() endif() endfunction()