refactor: resync with qbqt baseline and restore genre browser
Some checks failed
Build for Windows / build-windows (push) Has been cancelled
Some checks failed
Build for Windows / build-windows (push) Has been cancelled
This commit is contained in:
@@ -38,7 +38,11 @@ else()
|
||||
set(CARGO_PROFILE_FLAG "")
|
||||
endif()
|
||||
|
||||
set(RUST_LIB "${CMAKE_SOURCE_DIR}/target/${CARGO_PROFILE}/libqobuz_backend.a")
|
||||
if(WIN32 AND MSVC)
|
||||
set(RUST_LIB "${CMAKE_SOURCE_DIR}/target/${CARGO_PROFILE}/qobuz_backend.lib")
|
||||
else()
|
||||
set(RUST_LIB "${CMAKE_SOURCE_DIR}/target/${CARGO_PROFILE}/libqobuz_backend.a")
|
||||
endif()
|
||||
|
||||
add_custom_target(rust_backend ALL
|
||||
COMMAND ${CARGO_CMD} build ${CARGO_PROFILE_FLAG}
|
||||
@@ -83,23 +87,37 @@ target_link_libraries(qobuz-qt PRIVATE
|
||||
qobuz_backend_lib
|
||||
)
|
||||
|
||||
# Platform-specific system libs needed by the Rust audio stack (cpal/ALSA)
|
||||
# Platform-specific system libs needed by the Rust audio stack (cpal/backend internals)
|
||||
if (UNIX AND NOT APPLE)
|
||||
target_link_libraries(qobuz-qt PRIVATE asound)
|
||||
elseif (APPLE)
|
||||
find_library(COREAUDIO CoreAudio)
|
||||
find_library(AUDIOTOOLBOX AudioToolbox)
|
||||
find_library(SECURITY Security)
|
||||
find_library(COREFOUNDATION CoreFoundation)
|
||||
target_link_libraries(qobuz-qt PRIVATE ${COREAUDIO} ${AUDIOTOOLBOX} ${SECURITY} ${COREFOUNDATION})
|
||||
elseif (WIN32)
|
||||
target_link_libraries(qobuz-qt PRIVATE ws2_32 userenv bcrypt advapi32 ntdll ole32)
|
||||
endif ()
|
||||
|
||||
# Compiler warnings + hardening
|
||||
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||
target_compile_options(qobuz-qt PRIVATE
|
||||
-Wall -Wextra -Wno-unused-parameter
|
||||
-fstack-protector-strong
|
||||
-D_FORTIFY_SOURCE=2
|
||||
-fPIE
|
||||
)
|
||||
target_link_options(qobuz-qt PRIVATE
|
||||
-pie
|
||||
-Wl,-z,relro,-z,now
|
||||
)
|
||||
if (UNIX AND NOT APPLE)
|
||||
target_compile_options(qobuz-qt PRIVATE
|
||||
-fstack-protector-strong
|
||||
-D_FORTIFY_SOURCE=2
|
||||
-fPIE
|
||||
)
|
||||
target_link_options(qobuz-qt PRIVATE
|
||||
-pie
|
||||
-Wl,-z,relro,-z,now
|
||||
)
|
||||
endif ()
|
||||
elseif (MSVC)
|
||||
target_compile_options(qobuz-qt PRIVATE /W3 /Zc:__cplusplus /permissive-)
|
||||
endif ()
|
||||
|
||||
# D-Bus
|
||||
@@ -118,7 +136,7 @@ if (USE_LTO)
|
||||
endif ()
|
||||
|
||||
# Install
|
||||
if (UNIX)
|
||||
if (UNIX AND NOT APPLE)
|
||||
install(FILES res/logo/qobuz-qt.svg DESTINATION share/icons/hicolor/scalable/apps)
|
||||
install(FILES res/app/qobuz-qt.desktop DESTINATION share/applications)
|
||||
install(TARGETS qobuz-qt RUNTIME DESTINATION bin)
|
||||
|
||||
Reference in New Issue
Block a user