File tree 12 files changed +49
-9
lines changed
12 files changed +49
-9
lines changed Original file line number Diff line number Diff line change 1
- cmake_minimum_required (VERSION 3.0 )
1
+ cmake_minimum_required (VERSION 3.19 )
2
2
3
3
project (whisper.cpp VERSION 1.0.4)
4
4
5
- set (CMAKE_EXPORT_COMPILE_COMMANDS "on" )
6
- set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR} /bin)
7
- set (CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX} /lib" )
5
+ # Add path to modules
6
+ list ( APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR} /cmake/" )
8
7
9
8
if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR )
10
9
set (WHISPER_STANDALONE ON )
11
- include (cmake/ GitVars.cmake )
12
- include (cmake/ BuildTypes.cmake )
10
+ include (GitVars)
11
+ include (BuildTypes)
13
12
14
13
# configure project version
15
14
if (EXISTS "${CMAKE_SOURCE_DIR} /bindings/ios/Makefile-tmpl" )
@@ -82,9 +81,6 @@ endif()
82
81
83
82
# dependencies
84
83
85
- set (CMAKE_C_STANDARD 11)
86
- set (CMAKE_CXX_STANDARD 11)
87
-
88
84
find_package (Threads REQUIRED)
89
85
90
86
# on APPLE - include Accelerate framework
@@ -190,6 +186,8 @@ add_library(${TARGET}
190
186
whisper.cpp
191
187
)
192
188
189
+ include (DefaultTargetOptions)
190
+
193
191
target_include_directories (${TARGET} PUBLIC
194
192
.
195
193
)
Original file line number Diff line number Diff line change
1
+ # Set the default compile features and properties for a target.
2
+
3
+ if (NOT TARGET )
4
+ message (FATAL_ERROR "TARGET not set before including DefaultTargetOptions" )
5
+ endif ()
6
+
7
+ target_compile_features (${TARGET}
8
+ PRIVATE
9
+ cxx_std_11
10
+ )
11
+
12
+ set_target_properties (${TARGET}
13
+ PROPERTIES
14
+ EXPORT_COMPILE_COMMANDS ON
15
+ RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR} /bin"
16
+ INSTALL_RPATH "${CMAKE_INSTALL_PREFIX} /lib"
17
+ )
Original file line number Diff line number Diff line change @@ -8,6 +8,8 @@ add_executable(${TARGET}
8
8
emscripten.cpp
9
9
)
10
10
11
+ include (DefaultTargetOptions)
12
+
11
13
target_link_libraries (${TARGET} PRIVATE
12
14
whisper
13
15
)
Original file line number Diff line number Diff line change 1
1
set (TARGET bench)
2
2
add_executable (${TARGET} bench.cpp)
3
+
4
+ include (DefaultTargetOptions)
5
+
3
6
target_link_libraries (${TARGET} PRIVATE whisper ${CMAKE_THREAD_LIBS_INIT} )
Original file line number Diff line number Diff line change @@ -8,6 +8,8 @@ add_executable(${TARGET}
8
8
emscripten.cpp
9
9
)
10
10
11
+ include (DefaultTargetOptions)
12
+
11
13
target_link_libraries (${TARGET} PRIVATE
12
14
whisper
13
15
)
Original file line number Diff line number Diff line change @@ -2,6 +2,9 @@ if (WHISPER_SUPPORT_SDL2)
2
2
# command
3
3
set (TARGET command )
4
4
add_executable (${TARGET} command .cpp)
5
+
6
+ include (DefaultTargetOptions)
7
+
5
8
target_include_directories (${TARGET} PRIVATE ${SDL2_INCLUDE_DIRS} )
6
9
target_link_libraries (${TARGET} PRIVATE whisper ${SDL2_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} )
7
10
endif ()
Original file line number Diff line number Diff line change 1
1
set (TARGET main)
2
2
add_executable (${TARGET} main.cpp)
3
+
4
+ include (DefaultTargetOptions)
5
+
3
6
target_link_libraries (${TARGET} PRIVATE whisper ${CMAKE_THREAD_LIBS_INIT} )
Original file line number Diff line number Diff line change @@ -8,6 +8,8 @@ add_executable(${TARGET}
8
8
emscripten.cpp
9
9
)
10
10
11
+ include (DefaultTargetOptions)
12
+
11
13
target_link_libraries (${TARGET} PRIVATE
12
14
whisper
13
15
)
Original file line number Diff line number Diff line change @@ -2,6 +2,9 @@ if (WHISPER_SUPPORT_SDL2)
2
2
# stream
3
3
set (TARGET stream)
4
4
add_executable (${TARGET} stream.cpp)
5
+
6
+ include (DefaultTargetOptions)
7
+
5
8
target_include_directories (${TARGET} PRIVATE ${SDL2_INCLUDE_DIRS} )
6
9
target_link_libraries (${TARGET} PRIVATE whisper ${SDL2_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} )
7
10
endif ()
Original file line number Diff line number Diff line change @@ -9,6 +9,8 @@ add_executable(${TARGET}
9
9
gpt-2.cpp
10
10
)
11
11
12
+ include (DefaultTargetOptions)
13
+
12
14
target_link_libraries (${TARGET} PRIVATE
13
15
whisper
14
16
)
Original file line number Diff line number Diff line change @@ -8,6 +8,9 @@ if (WHISPER_SUPPORT_SDL2)
8
8
# TODO: this is temporary
9
9
# need to export ggml symbols for MSVC, but too lazy ..
10
10
add_executable (${TARGET} talk.cpp gpt-2.cpp ../../ggml.c ../../whisper.cpp)
11
+
12
+ include (DefaultTargetOptions)
13
+
11
14
target_include_directories (${TARGET} PRIVATE ${SDL2_INCLUDE_DIRS} ../../)
12
15
target_link_libraries (${TARGET} PRIVATE ${SDL2_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} )
13
16
endif ()
Original file line number Diff line number Diff line change @@ -8,6 +8,8 @@ add_executable(${TARGET}
8
8
emscripten.cpp
9
9
)
10
10
11
+ include (DefaultTargetOptions)
12
+
11
13
target_link_libraries (${TARGET} PRIVATE
12
14
whisper
13
15
)
You can’t perform that action at this time.
0 commit comments