mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 14:29:03 +02:00
CMAKE changes to support AVX instructions. Source files in src/avx are compiled with AVX enabled (VEX encoding) and require runtime dispatch to avoid crashing a machine without AVX hardware.
This commit is contained in:
parent
96f1191a97
commit
08e299f724
1 changed files with 12 additions and 2 deletions
|
@ -11,10 +11,20 @@ macro(SETUP_HIFI_LIBRARY)
|
||||||
|
|
||||||
project(${TARGET_NAME})
|
project(${TARGET_NAME})
|
||||||
|
|
||||||
# grab the implemenation and header files
|
# grab the implementation and header files
|
||||||
file(GLOB_RECURSE LIB_SRCS "src/*.h" "src/*.cpp" "src/*.c")
|
file(GLOB_RECURSE LIB_SRCS "src/*.h" "src/*.cpp" "src/*.c" "src/avx/*.h" "src/avx/*.cpp" "src/avx/*.c")
|
||||||
list(APPEND ${TARGET_NAME}_SRCS ${LIB_SRCS})
|
list(APPEND ${TARGET_NAME}_SRCS ${LIB_SRCS})
|
||||||
|
|
||||||
|
# add compiler flags to AVX source files
|
||||||
|
file(GLOB_RECURSE AVX_SRCS "src/avx/*.cpp" "src/avx/*.c")
|
||||||
|
foreach(SRC ${AVX_SRCS})
|
||||||
|
if (WIN32)
|
||||||
|
set_source_files_properties(${SRC} PROPERTIES COMPILE_FLAGS /arch:AVX)
|
||||||
|
elseif (APPLE OR UNIX)
|
||||||
|
set_source_files_properties(${SRC} PROPERTIES COMPILE_FLAGS -mavx)
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
|
||||||
setup_memory_debugger()
|
setup_memory_debugger()
|
||||||
|
|
||||||
# create a library and set the property so it can be referenced later
|
# create a library and set the property so it can be referenced later
|
||||||
|
|
Loading…
Reference in a new issue