File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -214,7 +214,19 @@ if(HS_BUILD_REQUIRED)
214214 endif ()
215215 else ()
216216 set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} " )
217- set (HS_CMAKE_COMMON_FLAGS "-march=core2 -fPIC" )
217+
218+ # Architecture-specific compiler flags
219+ if (CMAKE_SYSTEM_PROCESSOR MATCHES "^(arm|aarch64|arm64)" )
220+ # ARM architecture - use conservative flags with SIMDE_BACKEND
221+ set (HS_CMAKE_COMMON_FLAGS "-fPIC" )
222+ elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^(x86|X86|amd64|AMD64|x86_64|i[3-6]86)" )
223+ # x86/x86_64 architecture - use compatible x86-64 baseline
224+ set (HS_CMAKE_COMMON_FLAGS "-march=x86-64 -fPIC" )
225+ else ()
226+ # Other architectures - rely on SIMDE_BACKEND for portability
227+ set (HS_CMAKE_COMMON_FLAGS "-fPIC" )
228+ endif ()
229+
218230 set (HS_CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${HS_CMAKE_COMMON_FLAGS} " )
219231 set (HS_CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${HS_CMAKE_COMMON_FLAGS} -D_GLIBCXX_USE_CXX11_ABI=1" )
220232 set (HS_CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} " )
You can’t perform that action at this time.
0 commit comments