forked from vor0nwe/nppHTMLTag
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathbuild.cmd
More file actions
65 lines (55 loc) · 1.93 KB
/
build.cmd
File metadata and controls
65 lines (55 loc) · 1.93 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
@echo off
::
:: Copyright (c) 2023,2024 Robert Di Pardo <dipardo.r@gmail.com>
::
:: This Source Code Form is subject to the terms of the Mozilla Public
:: License, v. 2.0. If a copy of the MPL was not distributed with this file,
:: You can obtain one at https://mozilla.org/MPL/2.0/.
::
SETLOCAL EnableDelayedExpansion
set "CMAKE_BUILD_TYPE=Debug"
set "CMAKE_GENERATOR_PLATFORM=x64"
if "%1" NEQ "" ( set "CMAKE_BUILD_TYPE=%1" )
if "%2" NEQ "" ( set "CMAKE_GENERATOR_PLATFORM=%2" )
goto :%CMAKE_BUILD_TYPE%
:Release
:MinSizeRel
del /S /Q /F out\*.zip 2>NUL:
:Debug
:RelWithDebInfo
if /I "%4"=="nmake" (
set "NMAKE_BUILD=true"
)
if /I "%4"=="clang" (
set "CMAKE_TOOL_CHAIN=-DCMAKE_CXX_COMPILER=clang++"
set "NMAKE_BUILD=true"
)
if "%NMAKE_BUILD%" NEQ "" (
set "CMAKE_GENERATOR=NMake Makefiles"
set "CMAKE_GENERATOR_PLATFORM=%VSCMD_ARG_TGT_ARCH%"
set "CONFIG_PARAMS=-DCMAKE_EXPORT_COMPILE_COMMANDS=1"
echo :: ===================================================
echo :: NOTE: This environment only supports %VSCMD_ARG_TGT_ARCH% targets
echo :: ===================================================
) else (
if "%CMAKE_GENERATOR_PLATFORM%"=="x86" ( set "CMAKE_GENERATOR_PLATFORM=Win32" )
set "CMAKE_GENERATOR=Visual Studio %VisualStudioVersion:.0=%"
set "CONFIG_PARAMS=-A !CMAKE_GENERATOR_PLATFORM!"
set "BUILD_PARAMS=--config %CMAKE_BUILD_TYPE%"
)
set "BUILD_DIR=build\!CMAKE_GENERATOR_PLATFORM!\%CMAKE_BUILD_TYPE%"
if /I "%3"=="clean" (
del /S /Q "%BUILD_DIR%\CMakeCache.txt" 2>NUL:
set "CLEAN_FIRST=--clean-first"
)
cmake -Hsrc\prj -B%BUILD_DIR% -G"!CMAKE_GENERATOR!" %CONFIG_PARAMS% %CMAKE_TOOL_CHAIN% ^
-DCMAKE_BUILD_TYPE=%CMAKE_BUILD_TYPE% -DTARGET_PLATFORM=!CMAKE_GENERATOR_PLATFORM!
if %errorlevel% NEQ 0 ( goto :END )
cmake --build %BUILD_DIR% %BUILD_PARAMS% %CLEAN_FIRST%
goto :END
:-?
:help
echo Usage: ".\%~n0 [Debug,Release,MinSizeRel,RelWithDebInfo] [x86,x64,ARM64] [clean] [nmake,clang]"
:END
exit /B %errorlevel%
ENDLOCAL