Skip to content

Commit babdf4b

Browse files
AntoinePrvclaude
andcommitted
Fix emulated arch CI: use CMAKE_PROJECT_INCLUDE to pass arch define
Use a temporary .cmake file with add_compile_definitions to pass XSIMD_DEFAULT_ARCH=emulated<N> without shell angle-bracket redirection. Revert CMakeLists.txt to its original state (no XSIMD_EMULATED_SIZE option). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent ca05c22 commit babdf4b

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

.github/workflows/emulated.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ jobs:
2727
if: ${{ matrix.sys.compiler == 'g++' }}
2828
run: |
2929
echo "CXXFLAGS=-Wno-noexcept-type -Wno-stringop-overflow -Wno-maybe-uninitialized" >> $GITHUB_ENV
30+
- name: Set emulated arch
31+
run: |
32+
SIZE="${{ matrix.sys.size }}"
33+
echo "add_compile_definitions(\"XSIMD_DEFAULT_ARCH=emulated<${SIZE}>\")" > /tmp/emulated.cmake
34+
echo "add_compile_definitions(XSIMD_WITH_EMULATED=1)" >> /tmp/emulated.cmake
3035
- name: Configure build
3136
run: |
3237
cmake -B_build \
@@ -36,7 +41,7 @@ jobs:
3641
-DCMAKE_BUILD_TYPE=Release \
3742
-DCMAKE_CXX_COMPILER=${{ matrix.sys.compiler }} \
3843
-DXSIMD_ENABLE_WERROR=ON \
39-
-DXSIMD_EMULATED_SIZE=${{ matrix.sys.size }} \
44+
-DCMAKE_PROJECT_INCLUDE=/tmp/emulated.cmake \
4045
-DCMAKE_CXX_FLAGS="$CXXFLAGS" \
4146
-GNinja
4247
- name: Build

CMakeLists.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,6 @@ target_include_directories(xsimd INTERFACE
9393
OPTION(ENABLE_XTL_COMPLEX "enables support for xcomplex defined in xtl" OFF)
9494
OPTION(BUILD_TESTS "xsimd test suite" OFF)
9595

96-
set(XSIMD_EMULATED_SIZE "" CACHE STRING "If set, compile with emulated<N> as the default arch (N = register size in bits)")
97-
if(XSIMD_EMULATED_SIZE)
98-
add_compile_definitions("XSIMD_DEFAULT_ARCH=emulated<${XSIMD_EMULATED_SIZE}>")
99-
add_compile_definitions(XSIMD_WITH_EMULATED=1)
100-
endif()
101-
10296
if(ENABLE_XTL_COMPLEX)
10397
find_package(xtl 0.8.0 REQUIRED)
10498
target_compile_features(xsimd INTERFACE cxx_std_14)

0 commit comments

Comments
 (0)