Skip to content

Commit 0e917a5

Browse files
AntoinePrvclaude
andcommitted
Fix emulated arch CI: avoid shell redirection of angle brackets
Pass the emulated register size as a plain integer CMake variable (XSIMD_EMULATED_SIZE) instead of constructing emulated<N> in the shell. CMakeLists.txt assembles the define via add_compile_definitions, which handles escaping for the compiler invocation. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 9cd5cfc commit 0e917a5

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

.github/workflows/emulated.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ 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: echo "XSIMD_ARCH=emulated<${{ matrix.sys.size }}>" >> $GITHUB_ENV
3230
- name: Configure build
3331
run: |
3432
cmake -B_build \
@@ -38,7 +36,8 @@ jobs:
3836
-DCMAKE_BUILD_TYPE=Release \
3937
-DCMAKE_CXX_COMPILER=${{ matrix.sys.compiler }} \
4038
-DXSIMD_ENABLE_WERROR=ON \
41-
-DCMAKE_CXX_FLAGS="-DXSIMD_DEFAULT_ARCH=$XSIMD_ARCH -DXSIMD_WITH_EMULATED=1 $CXXFLAGS" \
39+
-DXSIMD_EMULATED_SIZE=${{ matrix.sys.size }} \
40+
-DCMAKE_CXX_FLAGS="$CXXFLAGS" \
4241
-GNinja
4342
- name: Build
4443
run: ninja -C _build

CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,12 @@ 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+
96102
if(ENABLE_XTL_COMPLEX)
97103
find_package(xtl 0.8.0 REQUIRED)
98104
target_compile_features(xsimd INTERFACE cxx_std_14)

0 commit comments

Comments
 (0)