summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorJosepMaJAZ <josepma@gmail.com>2020-04-13 00:37:12 +0200
committerJosepMaJAZ <josepma@gmail.com>2020-04-13 00:37:12 +0200
commit63a98fb4ec2dd870b14cf28cd35dae1478fffff3 (patch)
tree67cc8ec584500a7d1268346bb96a11697a424bc0 /CMakeLists.txt
parent35a6a1316fbf2fd9e577f3e75166307974047500 (diff)
This fixes some bugs building in debug:
- do not use link time code generation since that slows down the build. - fixes if built with dynamically linked libraries. Note: Currently it needs manual copying of such dlls into the compiled directory (including the qt plugins). - Fixed detection of opus. I don't know why it didn't work as it was. Version included in CMake tools for visual studio is 3.16.19112601-MSVC_2 - Fixed a database driver initialization error. This should only happen if SQLITE_OMIT_AUTOINIT was set. I didn't saw where this could happen, so I simply call sqlite3_initialize() explicitly in dbconnection. It is a no-op operation if it is already initialized.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt21
1 files changed, 17 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5053489dca..8c4e89c029 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1208,8 +1208,11 @@ option(STATIC_DEPS "Link dependencies statically" OFF)
# Chromaprint
find_package(Chromaprint REQUIRED)
target_link_libraries(mixxx-lib PUBLIC Chromaprint::Chromaprint)
-if(WIN32 AND STATIC_DEPS)
- target_compile_definitions(mixxx-lib PUBLIC CHROMAPRINT_NODLL)
+if(WIN32)
+ if(STATIC_DEPS)
+ target_compile_definitions(mixxx-lib PUBLIC CHROMAPRINT_NODLL)
+ endif()
+ # Rubberband is always built statically and needs fftw.
find_package(FFTW REQUIRED)
target_link_libraries(mixxx-lib PUBLIC FFTW::FFTW)
endif()
@@ -1469,6 +1472,12 @@ elseif(WIN32)
target_link_libraries(mixxx-lib PUBLIC "${QTLIBPNG_LIBRARY}")
find_library(QTPCRE2_LIBRARY qtpcre2)
target_link_libraries(mixxx-lib PUBLIC "${QTPCRE2_LIBRARY}")
+ else()
+ #libshout is always built statically
+ target_link_libraries(mixxx-lib PUBLIC
+ ws2_32 # libshout
+ gdi32 # libshout
+ )
endif()
endif()
@@ -1562,7 +1571,8 @@ if(SndFile_SUPPORTS_SET_COMPRESSION_LEVEL)
target_compile_definitions(mixxx-lib PUBLIC SFC_SUPPORTS_SET_COMPRESSION_LEVEL)
endif()
-if(WIN32 AND STATIC_DEPS)
+#libsndfile is always build statically, so we don't check for STATIC_DEPS
+if(WIN32)
find_package(G72X REQUIRED)
target_link_libraries(mixxx-lib PUBLIC G72X::G72X)
endif()
@@ -1859,7 +1869,8 @@ if(OPUS)
target_compile_definitions(mixxx-lib PUBLIC __OPUS__)
target_include_directories(mixxx-lib SYSTEM PUBLIC ${Opus_INCLUDE_DIRS})
target_link_libraries(mixxx-lib PUBLIC ${Opus_LIBRARIES})
- if(WIN32 AND STATIC_DEPS)
+ # Opus is always built statically so we don't check STATIC_DEPS
+ if(WIN32)
find_package(Celt)
if(NOT Celt_FOUND)
message(FATAL_ERROR "Opus support with static dependencies requires the celt library.")
@@ -2093,6 +2104,8 @@ if(NOT OPTIMIZE STREQUAL "off")
# Jenkins logs) Should we turn on PGO ?
# http://msdn.microsoft.com/en-us/library/xbf3tbeh.aspx
target_link_options(mixxx-lib PUBLIC "/LTCG:OFF")
+ elseif(CMAKE_BUILD_TYPE STREQUAL "Debug")
+ target_compile_options(mixxx-lib PUBLIC "/GL-")
else()
target_compile_options(mixxx-lib PUBLIC "/GL")
target_link_options(mixxx-lib PUBLIC "/LTCG:NOSTATUS")