forked from TillAlex/ImGui.NET-nativebuild
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathbuild-native.cmd
More file actions
35 lines (28 loc) · 893 Bytes
/
build-native.cmd
File metadata and controls
35 lines (28 loc) · 893 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
@setlocal
@echo off
set SCRIPT_PATH=%~dp0
set BUILD_CONFIG=Release
set BUILD_ARCH=x64
set BUILD_CMAKE_GENERATOR_PLATFORM=x64
goto :ArgLoop
:ArgLoop
if [%1] == [] goto Build
if /i [%1] == [Release] (set BUILD_CONFIG=Release&& shift & goto ArgLoop)
if /i [%1] == [Debug] (set BUILD_CONFIG=Debug&& shift & goto ArgLoop)
if /i [%1] == [x64] (set BUILD_ARCH=x64&& shift & goto ArgLoop)
if /i [%1] == [x86] (set BUILD_ARCH=x86&& set BUILD_CMAKE_GENERATOR_PLATFORM=Win32&&shift & goto ArgLoop)
shift
goto ArgLoop
:Build
pushd %SCRIPT_PATH%
If NOT exist ".\build\%BUILD_ARCH%" (
mkdir build\%BUILD_ARCH%
)
pushd build\%BUILD_ARCH%
cmake -DCMAKE_GENERATOR_PLATFORM=%BUILD_CMAKE_GENERATOR_PLATFORM% ..\.. "-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake"
echo Calling cmake --build . --config %BUILD_CONFIG%
cmake --build . --config %BUILD_CONFIG%
popd
popd
:Success
exit /b 0