mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-25 23:25:41 +00:00
dep/cubeb: Fix building without doxygen installed
This commit is contained in:
parent
2842167184
commit
4025350457
|
@ -5,9 +5,7 @@ cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
|
||||||
project(cubeb
|
project(cubeb
|
||||||
VERSION 0.0.0)
|
VERSION 0.0.0)
|
||||||
|
|
||||||
option(BUILD_SHARED_LIBS "Build shared libraries" OFF)
|
|
||||||
option(BUILD_RUST_LIBS "Build rust backends" OFF)
|
option(BUILD_RUST_LIBS "Build rust backends" OFF)
|
||||||
option(BUNDLE_SPEEX "Bundle the speex library" OFF)
|
|
||||||
option(LAZY_LOAD_LIBS "Lazily load shared libraries" ON)
|
option(LAZY_LOAD_LIBS "Lazily load shared libraries" ON)
|
||||||
|
|
||||||
if(NOT CMAKE_BUILD_TYPE)
|
if(NOT CMAKE_BUILD_TYPE)
|
||||||
|
@ -28,13 +26,6 @@ if (BUILD_RUST_LIBS)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# On OS/2, visibility attribute is not supported.
|
|
||||||
if(NOT OS2)
|
|
||||||
set(CMAKE_C_VISIBILITY_PRESET hidden)
|
|
||||||
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
|
|
||||||
set(CMAKE_VISIBILITY_INLINES_HIDDEN 1)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set(CMAKE_CXX_WARNING_LEVEL 4)
|
set(CMAKE_CXX_WARNING_LEVEL 4)
|
||||||
if(NOT MSVC)
|
if(NOT MSVC)
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wno-unused-parameter")
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wno-unused-parameter")
|
||||||
|
@ -60,17 +51,6 @@ set_target_properties(cubeb PROPERTIES
|
||||||
SOVERSION ${cubeb_VERSION_MAJOR}
|
SOVERSION ${cubeb_VERSION_MAJOR}
|
||||||
)
|
)
|
||||||
|
|
||||||
include(GenerateExportHeader)
|
|
||||||
generate_export_header(cubeb EXPORT_FILE_NAME ${CMAKE_BINARY_DIR}/exports/cubeb_export.h)
|
|
||||||
target_include_directories(cubeb
|
|
||||||
PUBLIC $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/exports>
|
|
||||||
)
|
|
||||||
|
|
||||||
include(GNUInstallDirs)
|
|
||||||
|
|
||||||
install(DIRECTORY ${CMAKE_SOURCE_DIR}/include/${PROJECT_NAME} TYPE INCLUDE)
|
|
||||||
install(DIRECTORY ${CMAKE_BINARY_DIR}/exports/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME})
|
|
||||||
|
|
||||||
include(CMakePackageConfigHelpers)
|
include(CMakePackageConfigHelpers)
|
||||||
write_basic_package_version_file(
|
write_basic_package_version_file(
|
||||||
"${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
|
"${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
|
||||||
|
@ -95,27 +75,15 @@ install(
|
||||||
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}"
|
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}"
|
||||||
)
|
)
|
||||||
|
|
||||||
if(NOT BUNDLE_SPEEX)
|
add_library(speex OBJECT subprojects/speex/resample.c)
|
||||||
find_package(PkgConfig)
|
set_target_properties(speex PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
|
||||||
if(PKG_CONFIG_FOUND)
|
target_include_directories(speex INTERFACE subprojects)
|
||||||
pkg_check_modules(speexdsp IMPORTED_TARGET speexdsp)
|
target_compile_definitions(speex PUBLIC
|
||||||
if(speexdsp_FOUND)
|
OUTSIDE_SPEEX
|
||||||
add_library(speex ALIAS PkgConfig::speexdsp)
|
FLOATING_POINT
|
||||||
endif()
|
EXPORT=
|
||||||
endif()
|
RANDOM_PREFIX=speex
|
||||||
endif()
|
)
|
||||||
|
|
||||||
if(NOT TARGET speex)
|
|
||||||
add_library(speex OBJECT subprojects/speex/resample.c)
|
|
||||||
set_target_properties(speex PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
|
|
||||||
target_include_directories(speex INTERFACE subprojects)
|
|
||||||
target_compile_definitions(speex PUBLIC
|
|
||||||
OUTSIDE_SPEEX
|
|
||||||
FLOATING_POINT
|
|
||||||
EXPORT=
|
|
||||||
RANDOM_PREFIX=speex
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# $<BUILD_INTERFACE:> required because of https://gitlab.kitware.com/cmake/cmake/-/issues/15415
|
# $<BUILD_INTERFACE:> required because of https://gitlab.kitware.com/cmake/cmake/-/issues/15415
|
||||||
target_link_libraries(cubeb PRIVATE $<BUILD_INTERFACE:speex>)
|
target_link_libraries(cubeb PRIVATE $<BUILD_INTERFACE:speex>)
|
||||||
|
@ -331,23 +299,3 @@ if(USE_AUDIOUNIT AND USE_AUDIOUNIT_RUST)
|
||||||
optimized "${PROJECT_SOURCE_DIR}/src/cubeb-coreaudio-rs/target/release/libcubeb_coreaudio.a")
|
optimized "${PROJECT_SOURCE_DIR}/src/cubeb-coreaudio-rs/target/release/libcubeb_coreaudio.a")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
find_package(Doxygen)
|
|
||||||
if(DOXYGEN_FOUND)
|
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/docs/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/docs/Doxyfile @ONLY)
|
|
||||||
add_custom_target(doc ALL
|
|
||||||
${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/docs/Doxyfile
|
|
||||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/docs
|
|
||||||
COMMENT "Generating API documentation with Doxygen" VERBATIM)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
add_custom_target(clang-format-check
|
|
||||||
find
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/include
|
|
||||||
-type f (-name "*.cpp" -o -name "*.c" -o -name "*.h")
|
|
||||||
-not -path "*/subprojects/speex/*"
|
|
||||||
-print0
|
|
||||||
| xargs -0 clang-format -Werror -n
|
|
||||||
COMMENT "Check formatting with clang-format"
|
|
||||||
VERBATIM)
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue