mirror of
https://git.mirrors.martin98.com/https://github.com/SoftFever/OrcaSlicer.git
synced 2025-08-13 01:49:00 +08:00
Fix building with cmake 4.x on Arch (#9644)
* Fix CMAKE version check to only apply to Windows * Treat arch-based distros as arch when building * Fix cmake policy version issue on Arch * Remove duplicate cmake minimum version check * Move cmake 4.x compatibility fix to BuildLinux.sh
This commit is contained in:
parent
778deab033
commit
c6b8664c8e
@ -84,6 +84,10 @@ then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
|
||||
# cmake 4.x compatibility workaround
|
||||
export CMAKE_POLICY_VERSION_MINIMUM=3.5
|
||||
|
||||
DISTRIBUTION=$(awk -F= '/^ID=/ {print $2}' /etc/os-release | tr -d '"')
|
||||
DISTRIBUTION_LIKE=$(awk -F= '/^ID_LIKE=/ {print $2}' /etc/os-release | tr -d '"')
|
||||
# Check for direct distribution match to Ubuntu/Debian
|
||||
@ -92,6 +96,8 @@ if [ "${DISTRIBUTION}" == "ubuntu" ] || [ "${DISTRIBUTION}" == "linuxmint" ]; th
|
||||
# Check if distribution is Debian/Ubuntu-like based on ID_LIKE
|
||||
elif [[ "${DISTRIBUTION_LIKE}" == *"debian"* ]] || [[ "${DISTRIBUTION_LIKE}" == *"ubuntu"* ]]; then
|
||||
DISTRIBUTION="debian"
|
||||
elif [[ "${DISTRIBUTION_LIKE}" == *"arch"* ]]; then
|
||||
DISTRIBUTION="arch"
|
||||
fi
|
||||
if [ ! -f ./linux.d/${DISTRIBUTION} ]
|
||||
then
|
||||
|
@ -1,8 +1,8 @@
|
||||
cmake_minimum_required(VERSION 3.13)
|
||||
|
||||
# Verify that your CMake version is exactly 3.31.x series or lower on windows
|
||||
if(${CMAKE_VERSION} VERSION_LESS "3.13" OR ${CMAKE_VERSION} VERSION_GREATER_EQUAL "4.0")
|
||||
message(FATAL_ERROR "Only CMake versions between 3.13.x and 3.31.x is supported. Detected version: ${CMAKE_VERSION}")
|
||||
if ( ((MSVC) OR (WIN32)) AND (${CMAKE_VERSION} VERSION_GREATER_EQUAL "4.0") )
|
||||
message(FATAL_ERROR "Only cmake versions between 3.13.x and 3.31.x is supported on windows. Detected version: ${CMAKE_VERSION}")
|
||||
endif()
|
||||
|
||||
if (WIN32)
|
||||
|
Loading…
x
Reference in New Issue
Block a user