Spaces:
Running
Running
cmake : fixes
Browse files- CMakeLists.txt +20 -52
CMakeLists.txt
CHANGED
|
@@ -101,39 +101,12 @@ else()
|
|
| 101 |
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mavx -mavx2 -mfma -mf16c")
|
| 102 |
endif()
|
| 103 |
|
| 104 |
-
# ggml
|
| 105 |
-
|
| 106 |
-
set(TARGET ggml)
|
| 107 |
-
|
| 108 |
-
add_library(${TARGET} STATIC
|
| 109 |
-
ggml.c
|
| 110 |
-
)
|
| 111 |
-
|
| 112 |
-
target_include_directories(${TARGET} PUBLIC
|
| 113 |
-
.
|
| 114 |
-
)
|
| 115 |
-
|
| 116 |
-
target_link_libraries(${TARGET} PRIVATE m ${CMAKE_THREAD_LIBS_INIT})
|
| 117 |
-
|
| 118 |
-
if (BUILD_SHARED_LIBS)
|
| 119 |
-
target_link_libraries(${TARGET} PUBLIC
|
| 120 |
-
${CMAKE_DL_LIBS}
|
| 121 |
-
)
|
| 122 |
-
|
| 123 |
-
target_compile_definitions(${TARGET} PUBLIC
|
| 124 |
-
WHISPER_SHARED
|
| 125 |
-
)
|
| 126 |
-
endif()
|
| 127 |
-
|
| 128 |
-
target_compile_definitions(${TARGET} PUBLIC
|
| 129 |
-
${WHISPER_EXTRA_FLAGS}
|
| 130 |
-
)
|
| 131 |
-
|
| 132 |
# whisper
|
| 133 |
|
| 134 |
set(TARGET whisper)
|
| 135 |
|
| 136 |
add_library(${TARGET} SHARED
|
|
|
|
| 137 |
whisper.cpp
|
| 138 |
)
|
| 139 |
|
|
@@ -141,7 +114,7 @@ target_include_directories(${TARGET} PUBLIC
|
|
| 141 |
.
|
| 142 |
)
|
| 143 |
|
| 144 |
-
target_link_libraries(${TARGET} PRIVATE
|
| 145 |
|
| 146 |
if (BUILD_SHARED_LIBS)
|
| 147 |
target_link_libraries(${TARGET} PUBLIC
|
|
@@ -162,27 +135,22 @@ install(TARGETS ${TARGET}
|
|
| 162 |
ARCHIVE DESTINATION lib/static
|
| 163 |
)
|
| 164 |
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
set(TARGET main)
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
|
| 182 |
-
|
| 183 |
-
# tests
|
| 184 |
-
|
| 185 |
-
if (WHISPER_BUILD_TESTS)
|
| 186 |
-
enable_testing()
|
| 187 |
-
add_subdirectory(tests)
|
| 188 |
endif ()
|
|
|
|
| 101 |
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mavx -mavx2 -mfma -mf16c")
|
| 102 |
endif()
|
| 103 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 104 |
# whisper
|
| 105 |
|
| 106 |
set(TARGET whisper)
|
| 107 |
|
| 108 |
add_library(${TARGET} SHARED
|
| 109 |
+
ggml.c
|
| 110 |
whisper.cpp
|
| 111 |
)
|
| 112 |
|
|
|
|
| 114 |
.
|
| 115 |
)
|
| 116 |
|
| 117 |
+
target_link_libraries(${TARGET} PRIVATE ${CMAKE_THREAD_LIBS_INIT})
|
| 118 |
|
| 119 |
if (BUILD_SHARED_LIBS)
|
| 120 |
target_link_libraries(${TARGET} PUBLIC
|
|
|
|
| 135 |
ARCHIVE DESTINATION lib/static
|
| 136 |
)
|
| 137 |
|
| 138 |
+
if (WHISPER_STANDALONE)
|
| 139 |
+
# main
|
| 140 |
+
set(TARGET main)
|
| 141 |
+
add_executable(${TARGET} main.cpp)
|
| 142 |
+
target_link_libraries(${TARGET} PRIVATE whisper ${CMAKE_THREAD_LIBS_INIT})
|
| 143 |
+
|
| 144 |
+
if (WHISPER_SUPPORT_SDL2)
|
| 145 |
+
# stream
|
| 146 |
+
set(TARGET stream)
|
| 147 |
+
add_executable(${TARGET} stream.cpp)
|
| 148 |
+
target_include_directories(${TARGET} PRIVATE ${SDL2_INCLUDE_DIRS})
|
| 149 |
+
target_link_libraries(${TARGET} PRIVATE whisper ${SDL2_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
|
| 150 |
+
endif ()
|
| 151 |
+
|
| 152 |
+
if (WHISPER_BUILD_TESTS)
|
| 153 |
+
enable_testing()
|
| 154 |
+
add_subdirectory(tests)
|
| 155 |
+
endif ()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 156 |
endif ()
|