package An official xmake package repository
https://xrepo.xmake.io/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
83 lines
3.4 KiB
83 lines
3.4 KiB
diff --git a/CMakeLists.txt b/CMakeLists.txt |
|
index a6cbcbc..aa7bf4a 100644 |
|
--- a/CMakeLists.txt |
|
+++ b/CMakeLists.txt |
|
@@ -217,38 +217,40 @@ endif() |
|
|
|
message(STATUS "CMAKE_SYSTEM_PROCESSOR: ${CMAKE_SYSTEM_PROCESSOR}") |
|
|
|
-if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm" OR ${CMAKE_SYSTEM_PROCESSOR} MATCHES "aarch64") |
|
- message(STATUS "ARM detected") |
|
-else() |
|
- message(STATUS "x86 detected") |
|
- if (MSVC) |
|
- if(NOT WHISPER_NO_AVX2) |
|
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /arch:AVX2") |
|
- set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /arch:AVX2") |
|
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /arch:AVX2") |
|
+if (NOT ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "") |
|
+ if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm" OR ${CMAKE_SYSTEM_PROCESSOR} MATCHES "aarch64") |
|
+ message(STATUS "ARM detected") |
|
+ else() |
|
+ message(STATUS "x86 detected") |
|
+ if (MSVC) |
|
+ if(NOT WHISPER_NO_AVX2) |
|
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /arch:AVX2") |
|
+ set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /arch:AVX2") |
|
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /arch:AVX2") |
|
+ else() |
|
+ if(NOT WHISPER_NO_AVX) |
|
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /arch:AVX") |
|
+ set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /arch:AVX") |
|
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /arch:AVX") |
|
+ endif() |
|
+ endif() |
|
+ else() |
|
+ if (EMSCRIPTEN) |
|
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pthread") |
|
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread") |
|
else() |
|
if(NOT WHISPER_NO_AVX) |
|
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /arch:AVX") |
|
- set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /arch:AVX") |
|
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /arch:AVX") |
|
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mavx") |
|
+ endif() |
|
+ if(NOT WHISPER_NO_AVX2) |
|
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mavx2") |
|
+ endif() |
|
+ if(NOT WHISPER_NO_FMA) |
|
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mfma") |
|
+ endif() |
|
+ if(NOT WHISPER_NO_F16C) |
|
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mf16c") |
|
endif() |
|
- endif() |
|
- else() |
|
- if (EMSCRIPTEN) |
|
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pthread") |
|
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread") |
|
- else() |
|
- if(NOT WHISPER_NO_AVX) |
|
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mavx") |
|
- endif() |
|
- if(NOT WHISPER_NO_AVX2) |
|
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mavx2") |
|
- endif() |
|
- if(NOT WHISPER_NO_FMA) |
|
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mfma") |
|
- endif() |
|
- if(NOT WHISPER_NO_F16C) |
|
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mf16c") |
|
endif() |
|
endif() |
|
endif() |
|
@@ -352,7 +354,7 @@ set_target_properties(${TARGET} PROPERTIES PUBLIC_HEADER "whisper.h") |
|
|
|
install(TARGETS ${TARGET} |
|
LIBRARY DESTINATION lib |
|
- ARCHIVE DESTINATION lib/static |
|
+ ARCHIVE DESTINATION lib |
|
RUNTIME DESTINATION bin |
|
PUBLIC_HEADER DESTINATION include |
|
)
|
|
|