Skip to content

Commit

Permalink
Merge pull request #3155 from xsco/enh/djinterop-win-ci
Browse files Browse the repository at this point in the history
Enable djinterop on Windows CI builds
  • Loading branch information
uklotzde authored Oct 6, 2020
2 parents ef58c52 + e84d713 commit c90e38b
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 6 deletions.
32 changes: 26 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ endif()
#######################################################################

set(CMAKE_CXX_STANDARD 17)
if(MSVC)
# Ensure MSVC populates __cplusplus correctly.
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zc:__cplusplus")
endif()

# Speed up builds on HDDs
if(GNU_GCC OR LLVM_CLANG)
Expand Down Expand Up @@ -1489,25 +1493,41 @@ if(ENGINEPRIME)
target_link_libraries(mixxx-lib PUBLIC DjInterop::DjInterop)
else()
# Fetch djinterop sources from GitHub and build them statically.
message(STATUS "Linking statically to libdjinterop fetched from GitHub")

# On MacOS, Mixxx does not use system SQLite, so we will use libdjinterop's
# embedded SQLite in such a case.
if (APPLE)
message(STATUS "Building libdjinterop sources (with embedded SQLite) fetched from GitHub")
set(DJINTEROP_SYSTEM_SQLITE OFF)
else()
message(STATUS "Building libdjinterop sources (with system SQLite) fetched from GitHub")
set(DJINTEROP_SYSTEM_SQLITE ON)
endif()

set(DJINTEROP_INSTALL_DIR "${CMAKE_CURRENT_BINARY_DIR}/lib/libdjinterop-install")
set(DJINTEROP_LIBRARY "lib/${CMAKE_STATIC_LIBRARY_PREFIX}djinterop${CMAKE_STATIC_LIBRARY_SUFFIX}")
ExternalProject_Add(libdjinterop
GIT_REPOSITORY https://github.com/xsco/libdjinterop.git
GIT_TAG tags/0.13.0
GIT_TAG tags/0.14.3
GIT_SHALLOW TRUE
INSTALL_DIR ${DJINTEROP_INSTALL_DIR}
CMAKE_ARGS "-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}" -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
CMAKE_ARGS
-DBUILD_SHARED_LIBS=OFF
-DCMAKE_SKIP_INSTALL_ALL_DEPENDENCY=ON
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
-DCMAKE_PREFIX_PATH:PATH=${CMAKE_PREFIX_PATH}
-DSYSTEM_SQLITE=${DJINTEROP_SYSTEM_SQLITE}
BUILD_BYPRODUCTS <INSTALL_DIR>/${DJINTEROP_LIBRARY}
EXCLUDE_FROM_ALL TRUE
)

# Assemble a library based on the external project.
add_library(mixxx-libdjinterop STATIC IMPORTED)
add_dependencies(mixxx-libdjinterop libdjinterop)
set(DJINTEROP_INCLUDE_DIR "${DJINTEROP_INSTALL_DIR}/include")
set(DJINTEROP_LIBRARY "${CMAKE_INSTALL_LIBDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}djinterop${CMAKE_STATIC_LIBRARY_SUFFIX}")
set(DJINTEROP_LIBRARY_DIR "${DJINTEROP_INSTALL_DIR}/${DJINTEROP_LIBRARY}")
set_target_properties(mixxx-libdjinterop PROPERTIES IMPORTED_LOCATION "${DJINTEROP_LIBRARY_DIR}")
set(DJINTEROP_LIBRARY_PATH "${DJINTEROP_INSTALL_DIR}/${DJINTEROP_LIBRARY}")
set_target_properties(mixxx-libdjinterop PROPERTIES IMPORTED_LOCATION "${DJINTEROP_LIBRARY_PATH}")
target_include_directories(mixxx-lib PUBLIC ${DJINTEROP_INCLUDE_DIR})
target_link_libraries(mixxx-lib PUBLIC mixxx-libdjinterop)

Expand Down
1 change: 1 addition & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ for:
-DBATTERY=ON
-DBROADCAST=ON
-DBULK=ON
-DENGINEPRIME=ON
-DHID=ON
-DHSS1394=ON
-DKEYFINDER=OFF
Expand Down

0 comments on commit c90e38b

Please sign in to comment.