mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-22 08:08:31 +00:00
win: remove redundant TARGET_ARCH variable
`TARGET_ARCH` has exactly the same values as `VS_PLATFORM` - "x64", "ARM", "ARM64") except it has `x86` instead of `Win32`, but this value is never actually used, so both variables end up using interchangeably, making code harder to reason about - you needed to remember that they're exactly the same except the case when the variable is passed directly to VS (either through `cmake -A` or some `msbuild` command), then user must use `VS_PLATFORM`. So we might just use one variable always.
This commit is contained in:
+10
-12
@@ -130,10 +130,8 @@ set BOOST_VER=%BOOST_VERSION:.=_%
|
|||||||
call cecho.cmd 0 10 "Script configuration:"
|
call cecho.cmd 0 10 "Script configuration:"
|
||||||
call cecho.cmd 0 13 "* CMake Generator`t= '`"%GENERATOR%`'`t
|
call cecho.cmd 0 13 "* CMake Generator`t= '`"%GENERATOR%`'`t
|
||||||
echo - Passed to CMake -G option.
|
echo - Passed to CMake -G option.
|
||||||
call cecho.cmd 0 13 "* Target Architecture`t= %TARGET_ARCH%"
|
|
||||||
echo - Whether were doing 32-bit (x86) or 64-bit (x64, arm64) build.
|
|
||||||
call cecho.cmd 0 13 "* Target Platform`t= %VS_PLATFORM%"
|
call cecho.cmd 0 13 "* Target Platform`t= %VS_PLATFORM%"
|
||||||
echo - Passed to CMake -A option.
|
echo - Whether were doing 32-bit (Win32) or 64-bit (x64, ARM64) build. Passed to CMake -A option.
|
||||||
call cecho.cmd 0 13 "* Target Toolset`t= %VS_TOOLSET%"
|
call cecho.cmd 0 13 "* Target Toolset`t= %VS_TOOLSET%"
|
||||||
echo - Passed to CMake -T option.
|
echo - Passed to CMake -T option.
|
||||||
call cecho.cmd 0 13 "* Dependency Directory`t= %DEPS_DIR%"
|
call cecho.cmd 0 13 "* Dependency Directory`t= %DEPS_DIR%"
|
||||||
@@ -197,7 +195,7 @@ for /f "tokens=1,2,3 delims=." %%a in ("%PYTHON_VERSION%") do (
|
|||||||
set PY_VER_MAJOR_MINOR=%%a%%b
|
set PY_VER_MAJOR_MINOR=%%a%%b
|
||||||
)
|
)
|
||||||
IF "%IFCOS_INSTALL_PYTHON%"=="TRUE" (
|
IF "%IFCOS_INSTALL_PYTHON%"=="TRUE" (
|
||||||
IF /I "%TARGET_ARCH%"=="arm64" (
|
IF /I "%VS_PLATFORM%"=="arm64" (
|
||||||
set PYTHONHOME=%DEPS_DIR%\pythonarm64.%PYTHON_VERSION%\tools
|
set PYTHONHOME=%DEPS_DIR%\pythonarm64.%PYTHON_VERSION%\tools
|
||||||
) ELSE (
|
) ELSE (
|
||||||
set PYTHONHOME=%DEPS_DIR%\python.%PYTHON_VERSION%\tools
|
set PYTHONHOME=%DEPS_DIR%\python.%PYTHON_VERSION%\tools
|
||||||
@@ -418,9 +416,9 @@ if not exist "%DEPENDENCY_DIR%\project-config.jam". (
|
|||||||
IF NOT %ERRORLEVEL%==0 GOTO :Error
|
IF NOT %ERRORLEVEL%==0 GOTO :Error
|
||||||
)
|
)
|
||||||
|
|
||||||
if /I "%TARGET_ARCH%"=="x64" (
|
if /I "%VS_PLATFORM%"=="x64" (
|
||||||
set B2_ARCH_FEATURE=x86
|
set B2_ARCH_FEATURE=x86
|
||||||
) else if /I "%TARGET_ARCH%"=="arm64" (
|
) else if /I "%VS_PLATFORM%"=="arm64" (
|
||||||
set B2_ARCH_FEATURE=arm
|
set B2_ARCH_FEATURE=arm
|
||||||
) else (
|
) else (
|
||||||
echo "Failed to identify architecture"
|
echo "Failed to identify architecture"
|
||||||
@@ -564,8 +562,8 @@ SET COMPILE_WITH_WPO=FALSE
|
|||||||
set DEPENDENCY_NAME=Python %PYTHON_VERSION%
|
set DEPENDENCY_NAME=Python %PYTHON_VERSION%
|
||||||
set DEPENDENCY_DIR=N/A
|
set DEPENDENCY_DIR=N/A
|
||||||
set PYTHON_AMD64_POSTFIX=
|
set PYTHON_AMD64_POSTFIX=
|
||||||
IF /I "%TARGET_ARCH%"=="x64" set "PYTHON_AMD64_POSTFIX=-amd64"
|
IF /I "%VS_PLATFORM%"=="x64" set "PYTHON_AMD64_POSTFIX=-amd64"
|
||||||
IF /I "%TARGET_ARCH%"=="arm64" set "PYTHON_AMD64_POSTFIX=-arm64"
|
IF /I "%VS_PLATFORM%"=="arm64" set "PYTHON_AMD64_POSTFIX=-arm64"
|
||||||
set "PYTHON_INSTALLER=python-%PYTHON_VERSION%%PYTHON_AMD64_POSTFIX%.exe"
|
set "PYTHON_INSTALLER=python-%PYTHON_VERSION%%PYTHON_AMD64_POSTFIX%.exe"
|
||||||
|
|
||||||
IF NOT "%IFCOS_INSTALL_PYTHON%"=="TRUE" (
|
IF NOT "%IFCOS_INSTALL_PYTHON%"=="TRUE" (
|
||||||
@@ -574,7 +572,7 @@ IF NOT "%IFCOS_INSTALL_PYTHON%"=="TRUE" (
|
|||||||
)
|
)
|
||||||
|
|
||||||
:: nuget doesn't support providing architecture for packages.
|
:: nuget doesn't support providing architecture for packages.
|
||||||
IF /I NOT "%TARGET_ARCH%"=="x64" IF /I NOT "%TARGET_ARCH%"=="arm64" (
|
IF /I NOT "%VS_PLATFORM%"=="x64" IF /I NOT "%VS_PLATFORM%"=="arm64" (
|
||||||
call cecho.cmd 0 12 "Automatic installation of Python for x86 builds is not supported,"
|
call cecho.cmd 0 12 "Automatic installation of Python for x86 builds is not supported,"
|
||||||
call cecho.cmd 0 12 "please install Python %PYTHON_VERSION% manually and ensure that it is available in PATH."
|
call cecho.cmd 0 12 "please install Python %PYTHON_VERSION% manually and ensure that it is available in PATH."
|
||||||
call cecho.cmd 0 12 "https://www.python.org/ftp/python/%PYTHON_VERSION%/%PYTHON_INSTALLER%"
|
call cecho.cmd 0 12 "https://www.python.org/ftp/python/%PYTHON_VERSION%/%PYTHON_INSTALLER%"
|
||||||
@@ -586,7 +584,7 @@ if EXIST "%PYTHONHOME%" (
|
|||||||
goto :SWIG
|
goto :SWIG
|
||||||
)
|
)
|
||||||
|
|
||||||
IF /I "%TARGET_ARCH%"=="x64" (
|
IF /I "%VS_PLATFORM%"=="x64" (
|
||||||
"%NUGET_EXE%" install Python -Version %PYTHON_VERSION% -OutputDirectory "%DEPS_DIR%"
|
"%NUGET_EXE%" install Python -Version %PYTHON_VERSION% -OutputDirectory "%DEPS_DIR%"
|
||||||
IF NOT %ERRORLEVEL%==0 GOTO :Error
|
IF NOT %ERRORLEVEL%==0 GOTO :Error
|
||||||
) ELSE (
|
) ELSE (
|
||||||
@@ -761,11 +759,11 @@ set QT6_ARCH=
|
|||||||
set QT6_INSTALL_SUFFIX=
|
set QT6_INSTALL_SUFFIX=
|
||||||
set QT6_HOST_ARCH=
|
set QT6_HOST_ARCH=
|
||||||
set QT6_HOST_INSTALL_SUFFIX=
|
set QT6_HOST_INSTALL_SUFFIX=
|
||||||
IF /I "%TARGET_ARCH%"=="x64" (
|
IF /I "%VS_PLATFORM%"=="x64" (
|
||||||
set QT6_ARCH=win64_msvc%QT6_MSVC_YEAR%_64
|
set QT6_ARCH=win64_msvc%QT6_MSVC_YEAR%_64
|
||||||
set QT6_INSTALL_SUFFIX=msvc%QT6_MSVC_YEAR%_64
|
set QT6_INSTALL_SUFFIX=msvc%QT6_MSVC_YEAR%_64
|
||||||
)
|
)
|
||||||
IF /I "%TARGET_ARCH%"=="arm64" (
|
IF /I "%VS_PLATFORM%"=="arm64" (
|
||||||
set QT6_ARCH=win64_msvc%QT6_MSVC_YEAR%_arm64_cross_compiled
|
set QT6_ARCH=win64_msvc%QT6_MSVC_YEAR%_arm64_cross_compiled
|
||||||
set QT6_INSTALL_SUFFIX=msvc%QT6_MSVC_YEAR%_arm64
|
set QT6_INSTALL_SUFFIX=msvc%QT6_MSVC_YEAR%_arm64
|
||||||
REM Qt publishes Windows ARM64 packages as cross-compiled Qt. Even on the
|
REM Qt publishes Windows ARM64 packages as cross-compiled Qt. Even on the
|
||||||
|
|||||||
+3
-8
@@ -166,22 +166,18 @@ IF DEFINED VS_TOOLSET (
|
|||||||
|
|
||||||
IF %VS_PLATFORM%==Win32 (
|
IF %VS_PLATFORM%==Win32 (
|
||||||
set ARCH_BITS=32
|
set ARCH_BITS=32
|
||||||
set TARGET_ARCH=x86
|
|
||||||
)
|
)
|
||||||
|
|
||||||
IF %VS_PLATFORM%==x64 (
|
IF %VS_PLATFORM%==x64 (
|
||||||
set ARCH_BITS=64
|
set ARCH_BITS=64
|
||||||
set TARGET_ARCH=x64
|
|
||||||
)
|
)
|
||||||
|
|
||||||
IF %VS_PLATFORM%==ARM (
|
IF %VS_PLATFORM%==ARM (
|
||||||
set ARCH_BITS=32
|
set ARCH_BITS=32
|
||||||
set TARGET_ARCH=ARM
|
|
||||||
)
|
)
|
||||||
|
|
||||||
IF %VS_PLATFORM%==ARM64 (
|
IF %VS_PLATFORM%==ARM64 (
|
||||||
set ARCH_BITS=64
|
set ARCH_BITS=64
|
||||||
set TARGET_ARCH=ARM64
|
|
||||||
)
|
)
|
||||||
|
|
||||||
:: Check CMake version and convert possible new format (>= 3.0) generator names to the old versions if using older CMake for VS <= 2013,
|
:: Check CMake version and convert possible new format (>= 3.0) generator names to the old versions if using older CMake for VS <= 2013,
|
||||||
@@ -208,7 +204,6 @@ exit /b 1
|
|||||||
::VC_VER - e.g. "14.5"
|
::VC_VER - e.g. "14.5"
|
||||||
echo VC_VER: [!VC_VER!]
|
echo VC_VER: [!VC_VER!]
|
||||||
echo ARCH_BITS: [!ARCH_BITS!]
|
echo ARCH_BITS: [!ARCH_BITS!]
|
||||||
echo TARGET_ARCH: [!TARGET_ARCH!]
|
|
||||||
::BOOST_BOOTSTRAP_VER - e.g. "vc145"
|
::BOOST_BOOTSTRAP_VER - e.g. "vc145"
|
||||||
echo BOOST_BOOTSTRAP_VER: [!BOOST_BOOTSTRAP_VER!]
|
echo BOOST_BOOTSTRAP_VER: [!BOOST_BOOTSTRAP_VER!]
|
||||||
echo BOOST_TOOLSET: [!BOOST_TOOLSET!]
|
echo BOOST_TOOLSET: [!BOOST_TOOLSET!]
|
||||||
@@ -225,12 +220,12 @@ set PATH=%~dp0utils;%PATH%
|
|||||||
|
|
||||||
:: Fetch and build the dependencies to a dedicated directory depending on the used VS version and target architecture.
|
:: Fetch and build the dependencies to a dedicated directory depending on the used VS version and target architecture.
|
||||||
:: NOTE For IfcOpenShell we can build all of our deps both x86 and x64 using different VS versions in the same directories
|
:: NOTE For IfcOpenShell we can build all of our deps both x86 and x64 using different VS versions in the same directories
|
||||||
:: so no need for -%VS_VER%-%TARGET_ARCH% postfix.
|
:: so no need for -%VS_VER%-%VS_PLATFORM% postfix.
|
||||||
:: set DEPS_DIR=%CD%\deps-%VS_VER%-%TARGET_ARCH%
|
:: set DEPS_DIR=%CD%\deps-%VS_VER%-%VS_PLATFORM%
|
||||||
pushd ..
|
pushd ..
|
||||||
set DEPS_DIR=%CD%\_deps
|
set DEPS_DIR=%CD%\_deps
|
||||||
set INSTALL_DIR=%CD%\_deps-%GEN_SHORTHAND%-installed
|
set INSTALL_DIR=%CD%\_deps-%GEN_SHORTHAND%-installed
|
||||||
:: set INSTALL_DIR=%CD%\deps-vs%VS_VER%-%TARGET_ARCH%-%DEBUG_OR_RELEASE_LOWERCASE%-installed
|
:: set INSTALL_DIR=%CD%\deps-vs%VS_VER%-%VS_PLATFORM%-%DEBUG_OR_RELEASE_LOWERCASE%-installed
|
||||||
:: BUILD_DIR is a relative build directory used for CMake-based projects
|
:: BUILD_DIR is a relative build directory used for CMake-based projects
|
||||||
set BUILD_DIR=_build-%GEN_SHORTHAND%
|
set BUILD_DIR=_build-%GEN_SHORTHAND%
|
||||||
popd
|
popd
|
||||||
|
|||||||
Reference in New Issue
Block a user