Skip to content

Commit 6857c86

Browse files
WIP
1 parent 3d98504 commit 6857c86

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

test/CMakeLists.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ OPTION(CROSS_COMPILE_ARM "cross compile for ARM targets" OFF)
4343
# Note: to compile on ARM (or cross compile), you may need to add the following:
4444
# -DTARGET_ARCH="armv8-a -mfpu=neon -mfloat-abi=softfp -target arm-linux-gnueabi"
4545
set(TARGET_ARCH "native" CACHE STRING "Target architecture arguments")
46-
string(REGEX MATCH "emulated\\\\<[0-9]+\\\\>" TARGET_EMULATED ${TARGET_ARCH})
46+
string(REGEX MATCH "emulated\\<[0-9]+\\>" TARGET_EMULATED ${TARGET_ARCH})
4747

4848
if (TARGET_EMULATED)
4949
message(STATUS "Using emulated target: ${TARGET_EMULATED}")
50-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DXSIMD_DEFAULT_ARCH=${TARGET_ARCH} -DXSIMD_WITH_EMULATED=1")
50+
set(EMULATED_COMPILE_FLAGS -DXSIMD_DEFAULT_ARCH=${TARGET_ARCH};-DXSIMD_WITH_EMULATED=1)
5151
unset(TARGET_ARCH CACHE)
5252
endif()
5353

@@ -234,6 +234,11 @@ endif()
234234
add_subdirectory(doc)
235235
add_subdirectory(architectures)
236236

237+
if(EMULATED_COMPILE_FLAGS)
238+
message(STATUS ${EMULATED_COMPILE_FLAGS})
239+
target_compile_options(test_xsimd PRIVATE ${EMULATED_COMPILE_FLAGS})
240+
endif()
241+
237242
if(EMSCRIPTEN)
238243
set_target_properties(test_xsimd PROPERTIES LINK_FLAGS "-s MODULARIZE=1 -s EXPORT_NAME=test_xsimd_wasm -s WASM=1 -s ALLOW_MEMORY_GROWTH=1 -lembind")
239244
target_compile_options(test_xsimd

test/test_arch.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
****************************************************************************/
1111

1212
#include "xsimd/xsimd.hpp"
13-
#ifndef XSIMD_NO_SUPPORTED_ARCHITECTURE
13+
#if !defined(XSIMD_NO_SUPPORTED_ARCHITECTURE) && !defined(XSIMD_WITH_EMULATED)
1414

1515
#include <numeric>
1616
#include <type_traits>

0 commit comments

Comments
 (0)