Skip to content

Commit

Permalink
Fix linking issues
Browse files Browse the repository at this point in the history
  • Loading branch information
kraxarn committed Jan 30, 2022
1 parent d629f67 commit 5aac388
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 1 addition & 4 deletions lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ target_include_directories(spotify-qt-lib PUBLIC

# Third-party libraries
add_subdirectory(thirdparty)
target_link_libraries(spotify-qt-lib PRIVATE spotify-qt-lib-third-party)

# Version macros
target_compile_definitions(spotify-qt-lib PUBLIC LIB_VERSION="v${PROJECT_VERSION}")
Expand All @@ -43,10 +44,6 @@ if (MSVC)
target_compile_definitions(spotify-qt PRIVATE _CRT_SECURE_NO_WARNINGS)
endif ()

# External projects
add_subdirectory(thirdparty)
target_link_libraries(spotify-qt-lib PRIVATE spotify-qt-lib-third-party)

# Link optional libraries
if (LIB_QT_LIBRARIES)
target_link_libraries(spotify-qt-lib PRIVATE ${LIB_QT_LIBRARIES})
Expand Down
5 changes: 5 additions & 0 deletions lib/thirdparty/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
target_include_directories(${PROJECT_NAME} PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/include)

# CMake doesn't allow linking of libraries outside of main CMake file
# Create a new project to link against later
project(spotify-qt-lib-third-party)
add_library(${PROJECT_NAME} STATIC)

# SQLite cache support
if (NOT DEFINED USE_DB_CACHE)
set(USE_DB_CACHE ON)
Expand Down

0 comments on commit 5aac388

Please sign in to comment.