2025-03-16 01:58:54 -04:00
|
|
|
@REM OrcaSlicer build script for Windows
|
2023-10-09 00:19:26 +08:00
|
|
|
@echo off
|
2023-07-14 23:56:55 +08:00
|
|
|
set WP=%CD%
|
2023-10-09 00:19:26 +08:00
|
|
|
|
|
|
|
|
@REM Pack deps
|
|
|
|
|
if "%1"=="pack" (
|
|
|
|
|
setlocal ENABLEDELAYEDEXPANSION
|
|
|
|
|
cd %WP%/deps/build
|
|
|
|
|
for /f "tokens=2-4 delims=/ " %%a in ('date /t') do set build_date=%%c%%b%%a
|
|
|
|
|
echo packing deps: OrcaSlicer_dep_win64_!build_date!_vs2022.zip
|
|
|
|
|
|
|
|
|
|
%WP%/tools/7z.exe a OrcaSlicer_dep_win64_!build_date!_vs2022.zip OrcaSlicer_dep
|
|
|
|
|
exit /b 0
|
|
|
|
|
)
|
|
|
|
|
|
2024-01-24 06:48:14 -05:00
|
|
|
set debug=OFF
|
|
|
|
|
set debuginfo=OFF
|
|
|
|
|
if "%1"=="debug" set debug=ON
|
|
|
|
|
if "%2"=="debug" set debug=ON
|
|
|
|
|
if "%1"=="debuginfo" set debuginfo=ON
|
|
|
|
|
if "%2"=="debuginfo" set debuginfo=ON
|
|
|
|
|
if "%debug%"=="ON" (
|
|
|
|
|
set build_type=Debug
|
|
|
|
|
set build_dir=build-dbg
|
|
|
|
|
) else (
|
|
|
|
|
if "%debuginfo%"=="ON" (
|
|
|
|
|
set build_type=RelWithDebInfo
|
|
|
|
|
set build_dir=build-dbginfo
|
|
|
|
|
) else (
|
|
|
|
|
set build_type=Release
|
|
|
|
|
set build_dir=build
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
echo build type set to %build_type%
|
|
|
|
|
|
2023-10-09 00:19:26 +08:00
|
|
|
setlocal DISABLEDELAYEDEXPANSION
|
2023-07-14 23:56:55 +08:00
|
|
|
cd deps
|
2024-01-24 06:48:14 -05:00
|
|
|
mkdir %build_dir%
|
|
|
|
|
cd %build_dir%
|
2025-09-28 10:33:33 +08:00
|
|
|
set "SIG_FLAG="
|
|
|
|
|
if defined ORCA_UPDATER_SIG_KEY set "SIG_FLAG=-DORCA_UPDATER_SIG_KEY=%ORCA_UPDATER_SIG_KEY%"
|
2023-10-09 00:19:26 +08:00
|
|
|
|
2023-08-10 10:51:44 +08:00
|
|
|
if "%1"=="slicer" (
|
|
|
|
|
GOTO :slicer
|
2023-07-14 23:56:55 +08:00
|
|
|
)
|
|
|
|
|
echo "building deps.."
|
2023-10-09 00:19:26 +08:00
|
|
|
|
2024-06-29 17:21:57 +03:00
|
|
|
echo on
|
2025-11-11 23:40:49 -03:00
|
|
|
REM Set minimum CMake policy to avoid <3.5 errors
|
|
|
|
|
set CMAKE_POLICY_VERSION_MINIMUM=3.5
|
2025-10-25 10:05:09 -04:00
|
|
|
cmake ../ -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=%build_type%
|
2024-01-24 06:48:14 -05:00
|
|
|
cmake --build . --config %build_type% --target deps -- -m
|
2024-06-29 17:21:57 +03:00
|
|
|
@echo off
|
2023-07-14 23:56:55 +08:00
|
|
|
|
|
|
|
|
if "%1"=="deps" exit /b 0
|
|
|
|
|
|
2023-08-10 10:51:44 +08:00
|
|
|
:slicer
|
|
|
|
|
echo "building Orca Slicer..."
|
2023-07-14 23:56:55 +08:00
|
|
|
cd %WP%
|
2024-01-24 06:48:14 -05:00
|
|
|
mkdir %build_dir%
|
|
|
|
|
cd %build_dir%
|
2023-07-14 23:56:55 +08:00
|
|
|
|
2024-06-29 17:21:57 +03:00
|
|
|
echo on
|
2025-11-13 23:11:56 +08:00
|
|
|
set CMAKE_POLICY_VERSION_MINIMUM=3.5
|
2025-10-25 10:05:09 -04:00
|
|
|
cmake .. -G "Visual Studio 17 2022" -A x64 -DORCA_TOOLS=ON %SIG_FLAG% -DCMAKE_BUILD_TYPE=%build_type%
|
2024-01-24 06:48:14 -05:00
|
|
|
cmake --build . --config %build_type% --target ALL_BUILD -- -m
|
2024-06-29 17:21:57 +03:00
|
|
|
@echo off
|
2023-09-05 22:36:29 +08:00
|
|
|
cd ..
|
2025-08-22 20:02:26 +08:00
|
|
|
call scripts/run_gettext.bat
|
2024-01-24 06:48:14 -05:00
|
|
|
cd %build_dir%
|
|
|
|
|
cmake --build . --target install --config %build_type%
|