mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-10 21:47:04 +03:00
update cspot
This commit is contained in:
@@ -6,11 +6,21 @@ project(cspot)
|
||||
set(CSPOT_EXTERNAL_BELL "" CACHE STRING "External bell library target name, optional")
|
||||
|
||||
# CMake options
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
|
||||
if(MSVC)
|
||||
add_compile_definitions(NOMINMAX _WINSOCK_DEPRECATED_NO_WARNINGS _CRT_SECURE_NO_WARNINGS)
|
||||
add_definitions(/wd4068 /wd4244 /wd4018 /wd4101 /wd4102 /wd4142 /wd4996)
|
||||
endif()
|
||||
|
||||
# Main library sources
|
||||
file(GLOB SOURCES "src/*.cpp" "src/*.c")
|
||||
|
||||
if(WIN32)
|
||||
list(APPEND SOURCES "mdnssvc/mdns.c" "mdnssvc/mdnsd.c")
|
||||
list(APPEND EXTRA_INCLUDES "mdnssvc")
|
||||
endif()
|
||||
|
||||
# Use externally specified bell library or the submodule
|
||||
if(CSPOT_EXTERNAL_BELL)
|
||||
list(APPEND EXTRA_LIBS ${CSPOT_EXTERNAL_BELL})
|
||||
@@ -26,21 +36,15 @@ if(UNIX AND NOT APPLE)
|
||||
endif()
|
||||
|
||||
# Build protobuf code
|
||||
#set(NANOPB_OPTIONS "-I${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
#file(GLOB PROTOS protobuf/*.proto)
|
||||
#nanopb_generate_cpp(PROTO_SRCS PROTO_HDRS RELPATH ${CMAKE_CURRENT_SOURCE_DIR} ${PROTOS})
|
||||
#add_custom_target(generate_proto_sources DEPENDS ${PROTO_SRCS} ${PROTO_HDRS})
|
||||
#set_source_files_properties(${PROTO_SRCS} ${PROTO_HDRS}
|
||||
# PROPERTIES GENERATED TRUE)
|
||||
|
||||
file(GLOB SOURCES "src/*.cpp" "src/*.c" "protobuf/*.c")
|
||||
message("BEWARE => NOT GENERATING PROTOBUF")
|
||||
set(GENERATED_INCLUDES ".")
|
||||
set(NANOPB_OPTIONS "-I${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
file(GLOB PROTOS protobuf/*.proto)
|
||||
nanopb_generate_cpp(PROTO_SRCS PROTO_HDRS RELPATH ${CMAKE_CURRENT_SOURCE_DIR} ${PROTOS})
|
||||
add_custom_target(generate_proto_sources DEPENDS ${PROTO_SRCS} ${PROTO_HDRS})
|
||||
set_source_files_properties(${PROTO_SRCS} ${PROTO_HDRS} PROPERTIES GENERATED TRUE)
|
||||
|
||||
add_library(cspot STATIC ${SOURCES} ${PROTO_SRCS})
|
||||
# PUBLIC to propagate includes from bell to cspot dependents
|
||||
target_compile_definitions(bell PUBLIC PB_ENABLE_MALLOC)
|
||||
target_compile_definitions(bell PUBLIC PB_FIELD_32BIT)
|
||||
target_link_libraries(cspot PUBLIC ${EXTRA_LIBS})
|
||||
#target_include_directories(cspot PUBLIC "include" ${CMAKE_CURRENT_BINARY_DIR} ${NANOPB_INCLUDE_DIRS})
|
||||
target_include_directories(cspot PUBLIC "include" ${GENERATED_INCLUDES} ${NANOPB_INCLUDE_DIRS})
|
||||
target_include_directories(cspot PUBLIC "include" ${CMAKE_CURRENT_BINARY_DIR} ${NANOPB_INCLUDE_DIRS} ${EXTRA_INCLUDES})
|
||||
|
||||
Reference in New Issue
Block a user