Spaces:
Running
Running
cmake : minor fixes
Browse files- cmake/DefaultTargetOptions.cmake +1 -1
- cmake/FindFFmpeg.cmake +2 -2
- cmake/whisper-config.cmake.in +18 -18
- examples/CMakeLists.txt +1 -1
- examples/ffmpeg-transcode.cpp +1 -1
cmake/DefaultTargetOptions.cmake
CHANGED
|
@@ -13,5 +13,5 @@ set_target_properties(${TARGET}
|
|
| 13 |
PROPERTIES
|
| 14 |
EXPORT_COMPILE_COMMANDS ON
|
| 15 |
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
|
| 16 |
-
INSTALL_RPATH
|
| 17 |
)
|
|
|
|
| 13 |
PROPERTIES
|
| 14 |
EXPORT_COMPILE_COMMANDS ON
|
| 15 |
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
|
| 16 |
+
INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib"
|
| 17 |
)
|
cmake/FindFFmpeg.cmake
CHANGED
|
@@ -36,7 +36,7 @@ include(FindPackageHandleStandardArgs)
|
|
| 36 |
|
| 37 |
# The default components were taken from a survey over other FindFFMPEG.cmake files
|
| 38 |
if (NOT FFmpeg_FIND_COMPONENTS)
|
| 39 |
-
set(FFmpeg_FIND_COMPONENTS AVFORMAT AVCODEC AVUTIL SWRESAMPLE)
|
| 40 |
endif()
|
| 41 |
|
| 42 |
#
|
|
@@ -84,7 +84,7 @@ macro(find_component _component _pkgconfig _library _header)
|
|
| 84 |
|
| 85 |
# CMake's default is to search first for shared libraries and then for static libraries.
|
| 86 |
# Todo later: add option to prefer static libs over dynamic:
|
| 87 |
-
find_library(${_component}_LIBRARIES NAMES ${_library} lib${_library}.a
|
| 88 |
HINTS
|
| 89 |
${PC_${_component}_LIBDIR}
|
| 90 |
${PC_${_component}_LIBRARY_DIRS}
|
|
|
|
| 36 |
|
| 37 |
# The default components were taken from a survey over other FindFFMPEG.cmake files
|
| 38 |
if (NOT FFmpeg_FIND_COMPONENTS)
|
| 39 |
+
set(FFmpeg_FIND_COMPONENTS AVFORMAT AVCODEC AVUTIL SWRESAMPLE)
|
| 40 |
endif()
|
| 41 |
|
| 42 |
#
|
|
|
|
| 84 |
|
| 85 |
# CMake's default is to search first for shared libraries and then for static libraries.
|
| 86 |
# Todo later: add option to prefer static libs over dynamic:
|
| 87 |
+
find_library(${_component}_LIBRARIES NAMES ${_library} lib${_library}.a
|
| 88 |
HINTS
|
| 89 |
${PC_${_component}_LIBDIR}
|
| 90 |
${PC_${_component}_LIBRARY_DIRS}
|
cmake/whisper-config.cmake.in
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
-
set(
|
| 2 |
-
set(
|
| 3 |
-
set(
|
| 4 |
-
set(
|
| 5 |
|
| 6 |
set(GGML_BLAS @GGML_BLAS@)
|
| 7 |
set(GGML_CUDA @GGML_CUDA@)
|
|
@@ -11,9 +11,9 @@ set(GGML_ACCELERATE @GGML_ACCELERATE@)
|
|
| 11 |
|
| 12 |
@PACKAGE_INIT@
|
| 13 |
|
| 14 |
-
set_and_check(
|
| 15 |
-
set_and_check(
|
| 16 |
-
set_and_check(
|
| 17 |
|
| 18 |
# Ensure transient dependencies satisfied
|
| 19 |
|
|
@@ -43,23 +43,23 @@ if (GGML_HIPBLAS)
|
|
| 43 |
find_package(rocblas REQUIRED)
|
| 44 |
endif()
|
| 45 |
|
| 46 |
-
find_library(
|
| 47 |
REQUIRED
|
| 48 |
-
HINTS ${
|
| 49 |
|
| 50 |
-
set(
|
| 51 |
-
set(
|
| 52 |
|
| 53 |
-
add_library(
|
| 54 |
|
| 55 |
-
set_target_properties(
|
| 56 |
PROPERTIES
|
| 57 |
-
|
| 58 |
-
INTERFACE_LINK_LIBRARIES "${
|
| 59 |
-
INTERFACE_COMPILE_DEFINITIONS "${
|
| 60 |
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
|
| 61 |
-
IMPORTED_LOCATION "${
|
| 62 |
INTERFACE_COMPILE_FEATURES cxx_std_11
|
| 63 |
POSITION_INDEPENDENT_CODE ON )
|
| 64 |
|
| 65 |
-
check_required_components(
|
|
|
|
| 1 |
+
set(WHISPER_VERSION @WHISPER_INSTALL_VERSION@)
|
| 2 |
+
set(WHISPER_BUILD_COMMIT @WHISPER_BUILD_COMMIT@)
|
| 3 |
+
set(WHISPER_BUILD_NUMBER @WHISPER_BUILD_NUMBER@)
|
| 4 |
+
set(WHISPER_SHARED_LIB @BUILD_SHARED_LIBS@)
|
| 5 |
|
| 6 |
set(GGML_BLAS @GGML_BLAS@)
|
| 7 |
set(GGML_CUDA @GGML_CUDA@)
|
|
|
|
| 11 |
|
| 12 |
@PACKAGE_INIT@
|
| 13 |
|
| 14 |
+
set_and_check(WHISPER_INCLUDE_DIR "@PACKAGE_WHISPER_INCLUDE_INSTALL_DIR@")
|
| 15 |
+
set_and_check(WHISPER_LIB_DIR "@PACKAGE_WHISPER_LIB_INSTALL_DIR@")
|
| 16 |
+
set_and_check(WHISPER_BIN_DIR "@PACKAGE_WHISPER_BIN_INSTALL_DIR@")
|
| 17 |
|
| 18 |
# Ensure transient dependencies satisfied
|
| 19 |
|
|
|
|
| 43 |
find_package(rocblas REQUIRED)
|
| 44 |
endif()
|
| 45 |
|
| 46 |
+
find_library(whisper_LIBRARY whisper
|
| 47 |
REQUIRED
|
| 48 |
+
HINTS ${WHISPER_LIB_DIR})
|
| 49 |
|
| 50 |
+
set(_whisper_link_deps "Threads::Threads" "@WHISPER_EXTRA_LIBS@")
|
| 51 |
+
set(_whisper_transient_defines "@WHISPER_TRANSIENT_DEFINES@")
|
| 52 |
|
| 53 |
+
add_library(whisper UNKNOWN IMPORTED)
|
| 54 |
|
| 55 |
+
set_target_properties(whisper
|
| 56 |
PROPERTIES
|
| 57 |
+
INTERFACE_INCLUDE_DIRECTORIES "${WHISPER_INCLUDE_DIR}"
|
| 58 |
+
INTERFACE_LINK_LIBRARIES "${_whisper_link_deps}"
|
| 59 |
+
INTERFACE_COMPILE_DEFINITIONS "${_whisper_transient_defines}"
|
| 60 |
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
|
| 61 |
+
IMPORTED_LOCATION "${whisper_LIBRARY}"
|
| 62 |
INTERFACE_COMPILE_FEATURES cxx_std_11
|
| 63 |
POSITION_INDEPENDENT_CODE ON )
|
| 64 |
|
| 65 |
+
check_required_components(whisper)
|
examples/CMakeLists.txt
CHANGED
|
@@ -40,7 +40,7 @@ if (WHISPER_FFMPEG)
|
|
| 40 |
message(STATUS "Found ffmpeg libs: ${FFMPEG_LIBRARIES}")
|
| 41 |
message(STATUS "Found ffmpeg headers in: ${FFMPEG_INCLUDE_DIRS}")
|
| 42 |
message(STATUS "ffmpeg definitions: ${FFMPEG_DEFINITIONS}")
|
| 43 |
-
message(STATUS "Found avformat
|
| 44 |
|
| 45 |
include_directories(${FFMPEG_INCLUDE_DIRS})
|
| 46 |
add_compile_definitions(WHISPER_FFMPEG)
|
|
|
|
| 40 |
message(STATUS "Found ffmpeg libs: ${FFMPEG_LIBRARIES}")
|
| 41 |
message(STATUS "Found ffmpeg headers in: ${FFMPEG_INCLUDE_DIRS}")
|
| 42 |
message(STATUS "ffmpeg definitions: ${FFMPEG_DEFINITIONS}")
|
| 43 |
+
message(STATUS "Found avformat ${AVFORMAT_VERSION}")
|
| 44 |
|
| 45 |
include_directories(${FFMPEG_INCLUDE_DIRS})
|
| 46 |
add_compile_definitions(WHISPER_FFMPEG)
|
examples/ffmpeg-transcode.cpp
CHANGED
|
@@ -321,7 +321,7 @@ int ffmpeg_decode_audio(const std::string &ifname, std::vector<uint8_t>& owav_da
|
|
| 321 |
LOG("Couldn't map input file %s\n", ifname.c_str());
|
| 322 |
return err;
|
| 323 |
}
|
| 324 |
-
LOG("Mapped input file: %
|
| 325 |
struct audio_buffer inaudio_buf;
|
| 326 |
inaudio_buf.ptr = ibuf;
|
| 327 |
inaudio_buf.size = ibuf_size;
|
|
|
|
| 321 |
LOG("Couldn't map input file %s\n", ifname.c_str());
|
| 322 |
return err;
|
| 323 |
}
|
| 324 |
+
LOG("Mapped input file: %s size: %d\n", ibuf, (int) ibuf_size);
|
| 325 |
struct audio_buffer inaudio_buf;
|
| 326 |
inaudio_buf.ptr = ibuf;
|
| 327 |
inaudio_buf.size = ibuf_size;
|