mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-29 00:03:17 +00:00
MPIR and MPFR in win build script
This commit is contained in:
+51
-8
@@ -73,7 +73,7 @@ IF NOT DEFINED IFCOS_USE_PYTHON2 set IFCOS_USE_PYTHON2=FALSE
|
|||||||
IF NOT DEFINED IFCOS_NUM_BUILD_PROCS set IFCOS_NUM_BUILD_PROCS=%NUMBER_OF_PROCESSORS%
|
IF NOT DEFINED IFCOS_NUM_BUILD_PROCS set IFCOS_NUM_BUILD_PROCS=%NUMBER_OF_PROCESSORS%
|
||||||
|
|
||||||
:: For subroutines
|
:: For subroutines
|
||||||
set MSBUILD_CMD=MSBuild.exe /nologo /m:%IFCOS_NUM_BUILD_PROCS% /t:%BUILD_TYPE%
|
set MSBUILD_CMD=MSBuild.exe /nologo /m:%IFCOS_NUM_BUILD_PROCS%
|
||||||
REM /clp:ErrorsOnly;WarningsOnly
|
REM /clp:ErrorsOnly;WarningsOnly
|
||||||
:: Note BUILD_TYPE not passed, Clean e.g. wouldn't delete the installed files.
|
:: Note BUILD_TYPE not passed, Clean e.g. wouldn't delete the installed files.
|
||||||
set INSTALL_CMD=MSBuild.exe /nologo /m:%IFCOS_NUM_BUILD_PROCS%
|
set INSTALL_CMD=MSBuild.exe /nologo /m:%IFCOS_NUM_BUILD_PROCS%
|
||||||
@@ -406,10 +406,8 @@ IF EXIST "%DEPS_DIR%\swigwin-%SWIG_VERSION%". (
|
|||||||
IF EXIST "%DEPS_DIR%\swigwin\". robocopy "%DEPS_DIR%\swigwin" "%INSTALL_DIR%\swigwin" /E /IS /MOVE /njh /njs
|
IF EXIST "%DEPS_DIR%\swigwin\". robocopy "%DEPS_DIR%\swigwin" "%INSTALL_DIR%\swigwin" /E /IS /MOVE /njh /njs
|
||||||
|
|
||||||
:voxel
|
:voxel
|
||||||
:: Note OpenCOLLADA has only Release and Debug builds.
|
|
||||||
set DEPENDENCY_NAME=voxel
|
set DEPENDENCY_NAME=voxel
|
||||||
set DEPENDENCY_DIR=%DEPS_DIR%\voxel
|
set DEPENDENCY_DIR=%DEPS_DIR%\voxel
|
||||||
:: Use a fixed revision in order to prevent introducing breaking changes
|
|
||||||
call :GitCloneAndCheckoutRevision https://github.com/opensourceBIM/voxelization_toolkit.git "%DEPENDENCY_DIR%"
|
call :GitCloneAndCheckoutRevision https://github.com/opensourceBIM/voxelization_toolkit.git "%DEPENDENCY_DIR%"
|
||||||
IF NOT %ERRORLEVEL%==0 GOTO :Error
|
IF NOT %ERRORLEVEL%==0 GOTO :Error
|
||||||
cd "%DEPENDENCY_DIR%"
|
cd "%DEPENDENCY_DIR%"
|
||||||
@@ -425,6 +423,47 @@ IF NOT %ERRORLEVEL%==0 GOTO :Error
|
|||||||
call :InstallCMakeProject "%DEPENDENCY_DIR%\%BUILD_DIR%" %BUILD_CFG%
|
call :InstallCMakeProject "%DEPENDENCY_DIR%\%BUILD_DIR%" %BUILD_CFG%
|
||||||
IF NOT %ERRORLEVEL%==0 GOTO :Error
|
IF NOT %ERRORLEVEL%==0 GOTO :Error
|
||||||
|
|
||||||
|
:mpir
|
||||||
|
set DEPENDENCY_NAME=mpir
|
||||||
|
set DEPENDENCY_DIR=%DEPS_DIR%\mpir
|
||||||
|
call :GitCloneAndCheckoutRevision https://github.com/BrianGladman/mpir.git "%DEPENDENCY_DIR%"
|
||||||
|
IF NOT %ERRORLEVEL%==0 GOTO :Error
|
||||||
|
cd "%DEPENDENCY_DIR%"
|
||||||
|
git reset --hard
|
||||||
|
REM There probably need to be quotes here around the filename
|
||||||
|
powershell -c "get-content %~dp0patches\mpir.patch | %%{$_ -replace \"sdk\",\"%UCRTVersion%\"} | %%{$_ -replace \"fn\",\"lib_mpir_cxx\"}" | git apply --unidiff-zero
|
||||||
|
powershell -c "get-content %~dp0patches\mpir.patch | %%{$_ -replace \"sdk\",\"%UCRTVersion%\"} | %%{$_ -replace \"fn\",\"lib_mpir_gc\"}" | git apply --unidiff-zero
|
||||||
|
cd msvc
|
||||||
|
cd vs%VS_VER:~2,2%
|
||||||
|
call .\msbuild.bat gc LIB %VS_PLATFORM% Release
|
||||||
|
IF NOT %ERRORLEVEL%==0 GOTO :Error
|
||||||
|
IF NOT EXIST "%INSTALL_DIR%\mpir". mkdir "%INSTALL_DIR%\mpir"
|
||||||
|
copy ..\..\lib\%VS_PLATFORM%\Release\* "%INSTALL_DIR%\mpir"
|
||||||
|
IF NOT %ERRORLEVEL%==0 GOTO :Error
|
||||||
|
|
||||||
|
:mpfr
|
||||||
|
set DEPENDENCY_NAME=mpfr
|
||||||
|
set DEPENDENCY_DIR=%DEPS_DIR%\mpfr
|
||||||
|
call :GitCloneAndCheckoutRevision https://github.com/BrianGladman/mpfr.git "%DEPENDENCY_DIR%"
|
||||||
|
IF NOT %ERRORLEVEL%==0 GOTO :Error
|
||||||
|
cd "%DEPENDENCY_DIR%"
|
||||||
|
git reset --hard
|
||||||
|
for /f "delims=|" %%f in ('dir /s/b build.vc15\*.vcxproj') do (
|
||||||
|
set "full=%%f"
|
||||||
|
set rel=!full:*%DEPENDENCY_DIR%=!
|
||||||
|
set relnix=!rel:\=/!
|
||||||
|
powershell -c "get-content %~dp0patches\mpfr.patch | %%{$_ -replace \"sdk\",\"%UCRTVersion%\"} | %%{$_ -replace \"fn\",\"!relnix!\"}" | git apply --unidiff-zero
|
||||||
|
git diff --exit-code -- %%f
|
||||||
|
IF !ERRORLEVEL!==0 (
|
||||||
|
powershell -c "get-content %~dp0patches\mpfr2.patch | %%{$_ -replace \"sdk\",\"%UCRTVersion%\"} | %%{$_ -replace \"fn\",\"!relnix!\"}" | git apply --unidiff-zero
|
||||||
|
)
|
||||||
|
)
|
||||||
|
call :BuildSolution "%DEPENDENCY_DIR%\build.vc15\lib_mpfr.sln" %DEBUG_OR_RELEASE% lib_mpfr
|
||||||
|
IF NOT %ERRORLEVEL%==0 GOTO :Error
|
||||||
|
IF NOT EXIST "%INSTALL_DIR%\mpfr". mkdir "%INSTALL_DIR%\mpfr"
|
||||||
|
copy lib\%VS_PLATFORM%\Release\* "%INSTALL_DIR%\mpfr"
|
||||||
|
IF NOT %ERRORLEVEL%==0 GOTO :Error
|
||||||
|
|
||||||
:Successful
|
:Successful
|
||||||
echo.
|
echo.
|
||||||
call "%~dp0\utils\cecho.cmd" 0 10 "%PROJECT_NAME% dependencies built."
|
call "%~dp0\utils\cecho.cmd" 0 10 "%PROJECT_NAME% dependencies built."
|
||||||
@@ -516,12 +555,11 @@ if not exist "%~2". (
|
|||||||
call cecho.cmd 0 13 "Cloning %DEPENDENCY_NAME% into %~2."
|
call cecho.cmd 0 13 "Cloning %DEPENDENCY_NAME% into %~2."
|
||||||
pushd "%DEPS_DIR%"
|
pushd "%DEPS_DIR%"
|
||||||
call git clone %1 %2
|
call git clone %1 %2
|
||||||
set RET=%ERRORLEVEL%
|
set RET=!ERRORLEVEL!
|
||||||
if not %RET%==0 exit /b %RET%
|
if not !RET!==0 exit /b !RET!
|
||||||
popd
|
popd
|
||||||
) else (
|
) else (
|
||||||
call cecho.cmd 0 13 "%DEPENDENCY_NAME% already cloned."
|
call cecho.cmd 0 13 "%DEPENDENCY_NAME% already cloned."
|
||||||
set RET=0
|
|
||||||
)
|
)
|
||||||
pushd "%2"
|
pushd "%2"
|
||||||
call git fetch
|
call git fetch
|
||||||
@@ -550,10 +588,15 @@ exit /b %RET%
|
|||||||
:: TODO add BuildCMakeProject which utilizes cmake --build
|
:: TODO add BuildCMakeProject which utilizes cmake --build
|
||||||
|
|
||||||
:: BuildSolution - Builds/Rebuilds/Cleans a solution using MSBuild
|
:: BuildSolution - Builds/Rebuilds/Cleans a solution using MSBuild
|
||||||
:: Params: %1 solutioName, %2 configuration
|
:: Params: %1 solutioName, %2 configuration, %3 individual project name
|
||||||
|
:: NOTE: %3 does not account for BUILD_TYPE and probably assumes Build
|
||||||
:BuildSolution
|
:BuildSolution
|
||||||
call cecho.cmd 0 13 "Building %2 %DEPENDENCY_NAME%. Please be patient, this will take a while."
|
call cecho.cmd 0 13 "Building %2 %DEPENDENCY_NAME%. Please be patient, this will take a while."
|
||||||
%MSBUILD_CMD% %1 /p:configuration=%2;platform=%VS_PLATFORM%
|
set TARGET=/t:%BUILD_TYPE%
|
||||||
|
IF NOT "%3"=="" (
|
||||||
|
set TARGET=/t:%3
|
||||||
|
)
|
||||||
|
%MSBUILD_CMD% %1 %TARGET% /p:configuration=%2;platform=%VS_PLATFORM%
|
||||||
exit /b %ERRORLEVEL%
|
exit /b %ERRORLEVEL%
|
||||||
|
|
||||||
:: InstallCMakeProject - Builds the INSTALL project of CMake-based project
|
:: InstallCMakeProject - Builds the INSTALL project of CMake-based project
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
--- afn
|
||||||
|
+++ bfn
|
||||||
|
@@ -26 +26 @@
|
||||||
|
- <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
|
||||||
|
+ <WindowsTargetPlatformVersion>sdk</WindowsTargetPlatformVersion>
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
--- afn
|
||||||
|
+++ bfn
|
||||||
|
@@ -26 +26 @@
|
||||||
|
- <WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>
|
||||||
|
+ <WindowsTargetPlatformVersion>sdk</WindowsTargetPlatformVersion>
|
||||||
Reference in New Issue
Block a user