Skip to content

Commit 234f414

Browse files
committed
ref #5 : update CMake for Windows build
- __AVX2__ should already be defined due to /arch:AVX2 - _CRT_SECURE_NO_WARNINGS should be defined both for shared and static lib
1 parent 014a119 commit 234f414

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

CMakeLists.txt

+4-6
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,11 @@ target_include_directories(${TARGET} PUBLIC
167167
)
168168

169169
if (MSVC)
170-
target_link_libraries(${TARGET} PRIVATE ${WHISPER_EXTRA_LIBS} ${CMAKE_THREAD_LIBS_INIT})
170+
target_link_libraries(${TARGET} PRIVATE ${WHISPER_EXTRA_LIBS} ${CMAKE_THREAD_LIBS_INIT})
171+
172+
set(WHISPER_EXTRA_FLAGS ${WHISPER_EXTRA_FLAGS} -D_CRT_SECURE_NO_WARNINGS)
171173
else()
172-
target_link_libraries(${TARGET} PRIVATE m ${WHISPER_EXTRA_LIBS} ${CMAKE_THREAD_LIBS_INIT})
174+
target_link_libraries(${TARGET} PRIVATE m ${WHISPER_EXTRA_LIBS} ${CMAKE_THREAD_LIBS_INIT})
173175
endif()
174176

175177
if (BUILD_SHARED_LIBS)
@@ -180,10 +182,6 @@ if (BUILD_SHARED_LIBS)
180182
target_compile_definitions(${TARGET} PUBLIC
181183
WHISPER_SHARED
182184
)
183-
184-
if (MSVC)
185-
target_compile_definitions(${TARGET} PUBLIC __AVX2__ _CRT_SECURE_NO_WARNINGS)
186-
endif()
187185
endif()
188186

189187
target_compile_definitions(${TARGET} PUBLIC

0 commit comments

Comments
 (0)