From a8ba4f7ca9aa76741206edbfce8d11680ba5f3aa Mon Sep 17 00:00:00 2001 From: tamasmeszaros Date: Fri, 11 Aug 2023 15:42:07 +0200 Subject: [PATCH] Fix build on windows Remove DEP_DEBUG feature on non MSVC platforms, it does not work nicely (due to Qhull) --- CMakeLists.txt | 4 ++-- deps/+Qhull/Qhull.cmake | 3 +++ deps/CMakeLists.txt | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7cc8cb577e..c77c077eee 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -592,12 +592,12 @@ function(prusaslicer_copy_dlls target) # This has to be a separate target due to the windows command line lenght limits add_custom_command(TARGET ${target} POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy ${TOP_LEVEL_PROJECT_DIR}/deps/GMP/gmp/lib/win${_bits}/libgmp-10.dll ${_out_dir} + COMMAND ${CMAKE_COMMAND} -E copy ${TOP_LEVEL_PROJECT_DIR}/deps/+GMP/gmp/lib/win${_bits}/libgmp-10.dll ${_out_dir} COMMENT "Copy gmp runtime to build tree" VERBATIM) add_custom_command(TARGET ${target} POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy ${TOP_LEVEL_PROJECT_DIR}/deps/MPFR/mpfr/lib/win${_bits}/libmpfr-4.dll ${_out_dir} + COMMAND ${CMAKE_COMMAND} -E copy ${TOP_LEVEL_PROJECT_DIR}/deps/+MPFR/mpfr/lib/win${_bits}/libmpfr-4.dll ${_out_dir} COMMENT "Copy mpfr runtime to build tree" VERBATIM) diff --git a/deps/+Qhull/Qhull.cmake b/deps/+Qhull/Qhull.cmake index 730d22acff..b30c1af4fb 100644 --- a/deps/+Qhull/Qhull.cmake +++ b/deps/+Qhull/Qhull.cmake @@ -1,4 +1,7 @@ include(GNUInstallDirs) +# WARNING: Qhull does this nice thing to remove previous configs when installing. +# It does that only on Unix. If you build release, then install, then build +# debug, then install, it will delete the previous release config.... add_cmake_project(Qhull URL "https://github.com/qhull/qhull/archive/v8.0.1.zip" URL_HASH SHA256=5287f5edd6a0372588f5d6640799086a4033d89d19711023ef8229dd9301d69b diff --git a/deps/CMakeLists.txt b/deps/CMakeLists.txt index 8cc28d465c..f5bfb36004 100644 --- a/deps/CMakeLists.txt +++ b/deps/CMakeLists.txt @@ -208,7 +208,7 @@ dep_message(STATUS "Building dep targets (${CMAKE_BUILD_TYPE}): ${_build_list}") add_custom_target(deps ALL DEPENDS ${_build_list_toplevel}) # Support legacy option DEP_DEBUG on MSVC to build debug libraries in the same cmake run as for CMAKE_BUILD_TYPE: -if (DEP_DEBUG AND NOT CMAKE_BUILD_TYPE STREQUAL "Debug") +if (MSVC AND DEP_DEBUG AND NOT CMAKE_BUILD_TYPE STREQUAL "Debug") # MSVC has this nice feature to not be able to link release mode libs to Debug mode # projects @@ -243,7 +243,7 @@ if (DEP_DEBUG AND NOT CMAKE_BUILD_TYPE STREQUAL "Debug") # Each lib will have a dep__debug target to build only the debug counterpart # Not part of ALL (problem with parallelization) - foreach(pkgtgt ${_build_list_dbg}) + foreach(pkgtgt ${_build_list_filt}) add_custom_target(${pkgtgt}_debug COMMAND ${CMAKE_COMMAND} --build . --target ${pkgtgt} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/DebugBuild