mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-10 05:27:01 +03:00
update CMake file
This commit is contained in:
@@ -20,14 +20,10 @@ set(BELL_EXTERNAL_CJSON "" CACHE STRING "External cJSON library target name, opt
|
|||||||
|
|
||||||
if(BELL_EXTERNAL_MBEDTLS)
|
if(BELL_EXTERNAL_MBEDTLS)
|
||||||
set(MbedTLS_DIR ${BELL_EXTERNAL_MBEDTLS})
|
set(MbedTLS_DIR ${BELL_EXTERNAL_MBEDTLS})
|
||||||
message(STATUS "Setting local mbedtls ${MbedTLS_DIR}")
|
message(STATUS "Setting local mbedtls ${MbedTLS_DIR}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Backwards compatibility with deprecated options
|
# Backwards compatibility with deprecated options
|
||||||
if(BELL_EXTERNAL_TREMOR)
|
|
||||||
message(WARNING "Deprecated Bell options used, replace BELL_EXTERNAL_TREMOR with BELL_CODEC_VORBIS=OFF")
|
|
||||||
set(BELL_CODEC_VORBIS OFF)
|
|
||||||
endif()
|
|
||||||
if(BELL_USE_ALSA)
|
if(BELL_USE_ALSA)
|
||||||
message(WARNING "Deprecated Bell options used, replace BELL_USE_ALSA with BELL_SINK_ALSA")
|
message(WARNING "Deprecated Bell options used, replace BELL_USE_ALSA with BELL_SINK_ALSA")
|
||||||
set(BELL_SINK_ALSA ${BELL_USE_ALSA})
|
set(BELL_SINK_ALSA ${BELL_USE_ALSA})
|
||||||
@@ -89,8 +85,8 @@ if(UNIX AND NOT APPLE)
|
|||||||
endif()
|
endif()
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
file(GLOB WIN32_PLATFORM_SOURCES "src/platform/win32/*.cpp" "src/platform/win32/*.c")
|
file(GLOB WIN32_PLATFORM_SOURCES "src/platform/win32/*.cpp" "src/platform/win32/*.c")
|
||||||
list(APPEND SOURCES ${WIN32_PLATFORM_SOURCES})
|
list(APPEND SOURCES ${WIN32_PLATFORM_SOURCES})
|
||||||
list(APPEND EXTRA_INCLUDES "include/platform/win32")
|
list(APPEND EXTRA_INCLUDES "include/platform/win32")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# A hack to make Opus keep quiet
|
# A hack to make Opus keep quiet
|
||||||
@@ -104,22 +100,22 @@ if(ESP_PLATFORM)
|
|||||||
list(APPEND EXTRA_LIBS idf::mbedtls idf::pthread idf::mdns)
|
list(APPEND EXTRA_LIBS idf::mbedtls idf::pthread idf::mdns)
|
||||||
add_definitions(-Wunused-const-variable -Wchar-subscripts -Wunused-label -Wmaybe-uninitialized -Wmisleading-indentation)
|
add_definitions(-Wunused-const-variable -Wchar-subscripts -Wunused-label -Wmaybe-uninitialized -Wmisleading-indentation)
|
||||||
else()
|
else()
|
||||||
find_package(Threads REQUIRED)
|
find_package(Threads REQUIRED)
|
||||||
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
||||||
list(APPEND EXTRA_LIBS Threads::Threads)
|
list(APPEND EXTRA_LIBS Threads::Threads)
|
||||||
|
|
||||||
find_package(MbedTLS REQUIRED)
|
find_package(MbedTLS REQUIRED)
|
||||||
get_target_property(MBEDTLS_INFO MbedTLS::mbedtls INTERFACE_INCLUDE_DIRECTORIES)
|
get_target_property(MBEDTLS_INFO MbedTLS::mbedtls INTERFACE_INCLUDE_DIRECTORIES)
|
||||||
list(APPEND EXTRA_INCLUDES ${MBEDTLS_INFO})
|
list(APPEND EXTRA_INCLUDES ${MBEDTLS_INFO})
|
||||||
|
|
||||||
# try to handle mbedtls when not system-wide installed
|
# try to handle mbedtls when not system-wide installed
|
||||||
if(BELL_EXTERNAL_MBEDTLS)
|
if(BELL_EXTERNAL_MBEDTLS)
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
set(MBEDTLS_RELEASE "RELEASE" CACHE STRING "local mbedtls version")
|
set(MBEDTLS_RELEASE "RELEASE" CACHE STRING "local mbedtls version")
|
||||||
else()
|
else()
|
||||||
set(MBEDTLS_RELEASE "NOCONFIG" CACHE STRING "local mbedtls version")
|
set(MBEDTLS_RELEASE "NOCONFIG" CACHE STRING "local mbedtls version")
|
||||||
endif()
|
endif()
|
||||||
message(STATUS "using local mbedtls version ${MBEDTLS_RELEASE}")
|
message(STATUS "using local mbedtls version ${MBEDTLS_RELEASE}")
|
||||||
get_target_property(MBEDTLS_INFO MbedTLS::mbedtls IMPORTED_LOCATION_${MBEDTLS_RELEASE})
|
get_target_property(MBEDTLS_INFO MbedTLS::mbedtls IMPORTED_LOCATION_${MBEDTLS_RELEASE})
|
||||||
list(APPEND EXTRA_LIBS ${MBEDTLS_INFO})
|
list(APPEND EXTRA_LIBS ${MBEDTLS_INFO})
|
||||||
get_target_property(MBEDTLS_INFO MbedTLS::mbedx509 IMPORTED_LOCATION_${MBEDTLS_RELEASE})
|
get_target_property(MBEDTLS_INFO MbedTLS::mbedx509 IMPORTED_LOCATION_${MBEDTLS_RELEASE})
|
||||||
@@ -223,18 +219,18 @@ if(NOT BELL_DISABLE_SINKS)
|
|||||||
endif()
|
endif()
|
||||||
# Find PortAudio if required, else remove the sink
|
# Find PortAudio if required, else remove the sink
|
||||||
if(BELL_SINK_PORTAUDIO)
|
if(BELL_SINK_PORTAUDIO)
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
list(APPEND EXTRA_INCLUDES "portaudio/include")
|
list(APPEND EXTRA_INCLUDES "portaudio/include")
|
||||||
if(NOT "${CMAKE_GENERATOR}" MATCHES "(Win64|IA64)")
|
if(NOT "${CMAKE_GENERATOR}" MATCHES "(Win64|IA64)")
|
||||||
list(APPEND EXTRA_LIBS "${CMAKE_CURRENT_SOURCE_DIR}/portaudio/portaudio_win32.lib")
|
list(APPEND EXTRA_LIBS "${CMAKE_CURRENT_SOURCE_DIR}/portaudio/portaudio_win32.lib")
|
||||||
else()
|
else()
|
||||||
list(APPEND EXTRA_LIBS "${CMAKE_CURRENT_SOURCE_DIR}/portaudio/portaudio_x64.lib")
|
list(APPEND EXTRA_LIBS "${CMAKE_CURRENT_SOURCE_DIR}/portaudio/portaudio_x64.lib")
|
||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
find_package(portaudio REQUIRED)
|
find_package(portaudio REQUIRED)
|
||||||
list(APPEND EXTRA_INCLUDES ${PORTAUDIO_INCLUDE_DIRS})
|
list(APPEND EXTRA_INCLUDES ${PORTAUDIO_INCLUDE_DIRS})
|
||||||
list(APPEND EXTRA_LIBS ${PORTAUDIO_LIBRARIES})
|
list(APPEND EXTRA_LIBS ${PORTAUDIO_LIBRARIES})
|
||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
list(REMOVE_ITEM SINK_SOURCES "${AUDIO_DIR}/sinks/unix/PortAudioSink.cpp")
|
list(REMOVE_ITEM SINK_SOURCES "${AUDIO_DIR}/sinks/unix/PortAudioSink.cpp")
|
||||||
endif()
|
endif()
|
||||||
@@ -258,5 +254,5 @@ target_link_libraries(bell PUBLIC ${EXTRA_LIBS})
|
|||||||
target_include_directories(bell PUBLIC "include" ${EXTRA_INCLUDES} ${CMAKE_CURRENT_BINARY_DIR})
|
target_include_directories(bell PUBLIC "include" ${EXTRA_INCLUDES} ${CMAKE_CURRENT_BINARY_DIR})
|
||||||
target_compile_definitions(bell PUBLIC PB_ENABLE_MALLOC)
|
target_compile_definitions(bell PUBLIC PB_ENABLE_MALLOC)
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
target_compile_definitions(bell PUBLIC PB_NO_STATIC_ASSERT)
|
target_compile_definitions(bell PUBLIC PB_NO_STATIC_ASSERT)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
Reference in New Issue
Block a user