From 3e6d3adbe26998767bc85e8ffa839021216df321 Mon Sep 17 00:00:00 2001 From: rocky98 Date: Fri, 12 Jun 2026 13:12:00 +0200 Subject: [PATCH] Dateien nach "/" hochladen https://github.com/OrcaSlicer/OrcaSlicer/pull/13996 --- CMakeLists.txt | 42 ++++++++++++++++++++++++++++++++++-------- 1 file changed, 34 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e24e296ad41..b0ae585e787 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -220,9 +220,7 @@ if (MSVC) # /bigobj (Increase Number of Sections in .Obj file) # error C3859: virtual memory range for PCH exceeded; please recompile with a command line option of '-Zm90' or greater # Generate symbols at every build target, even for the release. - # -Zm520 fixes error C3859 but forces the compiler to pre-allocate that memory for every translation unit regardless - # combining /Zi with /FS frees up a significant amount of memory pressure across all parallel compile jobs and makes /MP faster overall. - add_compile_options(-bigobj /Zi /FS) + add_compile_options(-bigobj -Zm520 /Zi) # Disable STL4007: Many result_type typedefs and all argument_type, first_argument_type, and second_argument_type typedefs are deprecated in C++17. #FIXME Remove this line after eigen library adapts to the new C++17 adaptor rules. add_compile_options(-D_SILENCE_CXX17_ADAPTOR_TYPEDEFS_DEPRECATION_WARNING) @@ -233,11 +231,6 @@ if (MSVC) # Disable warnings on comparison of unsigned and signed # C4018: signed/unsigned mismatch add_compile_options(/wd4018) - # Prevent linker restart when TBB (or other deps) built with /GL are linked - # Make your full (clean) build slower because it enables link-time code generation across all translation units. - # helps incremental builds by preventing the double-link restart from TBB - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LTCG") - set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /LTCG") endif () if (${CMAKE_CXX_COMPILER_ID} STREQUAL "AppleClang" AND ${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER 15) @@ -371,6 +364,28 @@ set(CMAKE_POSITION_INDEPENDENT_CODE ON) if (APPLE) message("OS X SDK Path: ${CMAKE_OSX_SYSROOT}") + # On the Xcode 26 SDK (newer libc++), several Find modules for system libraries + # (ZLIB, EXPAT, BZip2, Iconv) resolve their *_INCLUDE_DIR to "/usr/include". + # When that C-header directory is passed as an explicit -isystem path it shadows + # libc++'s own / wrappers, so the C signbit()/isnan() macros leak + # into and break __math/traits.h ("expected unqualified-id"). Register the + # SDK's usr/include as an implicit include dir so CMake never emits it explicitly; + # the compiler still searches it via -isysroot, so nothing is lost. + set(_orca_sdk_path "${CMAKE_OSX_SYSROOT}") + if (NOT IS_ABSOLUTE "${_orca_sdk_path}") + if (_orca_sdk_path STREQUAL "") + set(_orca_sdk_path "macosx") + endif () + execute_process(COMMAND xcrun --sdk "${_orca_sdk_path}" --show-sdk-path + OUTPUT_VARIABLE _orca_sdk_path + OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_QUIET) + endif () + if (_orca_sdk_path AND EXISTS "${_orca_sdk_path}/usr/include") + list(APPEND CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES "${_orca_sdk_path}/usr/include") + list(APPEND CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES "${_orca_sdk_path}/usr/include") + message(STATUS "Marked ${_orca_sdk_path}/usr/include as implicit include dir (libc++ header-order fix)") + endif () if (CMAKE_OSX_DEPLOYMENT_TARGET) message("OS X Deployment Target: ${CMAKE_OSX_DEPLOYMENT_TARGET}") else () @@ -434,7 +449,15 @@ if (NOT MSVC AND ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMP if((${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang" OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "AppleClang") AND ${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER 15) include(CheckCXXCompilerFlag) + # Probe with -Werror so an "unknown warning option" diagnostic fails the check. + # Xcode 26+ clang dropped the enum-constexpr-conversion warning name; without + # -Werror the probe only warns and yields a false positive, and the leftover + # -Wno-error=enum-constexpr-conversion then becomes fatal in sub-projects built + # with -Werror (e.g. bundled Clipper2). + set(_orca_saved_required_flags "${CMAKE_REQUIRED_FLAGS}") + string(APPEND CMAKE_REQUIRED_FLAGS " -Werror") check_cxx_compiler_flag(-Wno-error=enum-constexpr-conversion HAS_WNO_ERROR_ENUM_CONSTEXPR_CONV) + set(CMAKE_REQUIRED_FLAGS "${_orca_saved_required_flags}") if(HAS_WNO_ERROR_ENUM_CONSTEXPR_CONV) add_compile_options(-Wno-error=enum-constexpr-conversion) endif() @@ -941,6 +964,9 @@ set (CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}/resources/images\\\\OrcaSlicer.ico" set (CPACK_NSIS_MUI_ICON "${CPACK_PACKAGE_ICON}") set (CPACK_NSIS_MUI_UNIICON "${CPACK_PACKAGE_ICON}") set (CPACK_NSIS_INSTALLED_ICON_NAME "$INSTDIR\\\\orca-slicer.exe") +set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS " + CreateShortCut \\\"$DESKTOP\\\\OrcaSlicer.lnk\\\" \\\"$INSTDIR\\\\orca-slicer.exe\\\" +") set (CPACK_PACKAGE_CHECKSUM SHA256) set (CPACK_PACKAGE_INSTALL_REGISTRY_KEY "OrcaSlicer") set (CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL ON)