ggerganov commited on
Commit
d2b4741
·
unverified ·
1 Parent(s): e81e3e4

ref #5 : update CMake for Windows build

Browse files

- __AVX2__ should already be defined due to /arch:AVX2
- _CRT_SECURE_NO_WARNINGS should be defined both for shared and static lib

Files changed (1) hide show
  1. CMakeLists.txt +4 -6
CMakeLists.txt CHANGED
@@ -167,9 +167,11 @@ target_include_directories(${TARGET} PUBLIC
167
  )
168
 
169
  if (MSVC)
170
- target_link_libraries(${TARGET} PRIVATE ${WHISPER_EXTRA_LIBS} ${CMAKE_THREAD_LIBS_INIT})
 
 
171
  else()
172
- target_link_libraries(${TARGET} PRIVATE m ${WHISPER_EXTRA_LIBS} ${CMAKE_THREAD_LIBS_INIT})
173
  endif()
174
 
175
  if (BUILD_SHARED_LIBS)
@@ -180,10 +182,6 @@ if (BUILD_SHARED_LIBS)
180
  target_compile_definitions(${TARGET} PUBLIC
181
  WHISPER_SHARED
182
  )
183
-
184
- if (MSVC)
185
- target_compile_definitions(${TARGET} PUBLIC __AVX2__ _CRT_SECURE_NO_WARNINGS)
186
- endif()
187
  endif()
188
 
189
  target_compile_definitions(${TARGET} PUBLIC
 
167
  )
168
 
169
  if (MSVC)
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)
173
  else()
174
+ target_link_libraries(${TARGET} PRIVATE m ${WHISPER_EXTRA_LIBS} ${CMAKE_THREAD_LIBS_INIT})
175
  endif()
176
 
177
  if (BUILD_SHARED_LIBS)
 
182
  target_compile_definitions(${TARGET} PUBLIC
183
  WHISPER_SHARED
184
  )
 
 
 
 
185
  endif()
186
 
187
  target_compile_definitions(${TARGET} PUBLIC