2018-01-26 03:10:10 +03:00
|
|
|
@echo off
|
2019-03-07 02:08:12 +03:00
|
|
|
SETLOCAL
|
2018-06-15 00:09:25 +03:00
|
|
|
|
|
|
|
if "%~1" == "" goto USAGE
|
|
|
|
if /I "%~1" == "--help" goto USAGE
|
|
|
|
if /I "%~1" == "-h" goto USAGE
|
|
|
|
if /I "%~1" == "/?" goto USAGE
|
|
|
|
|
|
|
|
:: Set up MSVC environment
|
|
|
|
:: Kudos to https://gist.github.com/AndrewPardoe/689a3b969670787d5dba538bb0a48a1e
|
2019-03-07 02:08:12 +03:00
|
|
|
|
2018-06-15 00:09:25 +03:00
|
|
|
pushd "%~dp0"
|
|
|
|
pushd %ProgramFiles(x86)%\"Microsoft Visual Studio"\Installer
|
|
|
|
for /f "usebackq tokens=*" %%i in (`vswhere -latest -prerelease -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath`) do (
|
|
|
|
set VCINSTALLDIR=%%i\VC
|
|
|
|
)
|
|
|
|
popd
|
2019-03-07 02:08:12 +03:00
|
|
|
|
2018-06-15 00:09:25 +03:00
|
|
|
if exist %VCINSTALLDIR%\Auxiliary\Build\vcvarsall.bat (
|
|
|
|
if /I "%~1" == "x86" (
|
|
|
|
call "%VCINSTALLDIR%\Auxiliary\Build\vcvarsall.bat" %1
|
|
|
|
) else (
|
|
|
|
if /I "%~1" == "x64" (
|
|
|
|
call "%VCINSTALLDIR%\Auxiliary\Build\vcvarsall.bat" %1
|
|
|
|
) else goto USAGE
|
|
|
|
)
|
|
|
|
)
|
|
|
|
popd
|
|
|
|
|
|
|
|
set build="MinSizeRel"
|
|
|
|
set validationParser="-DUSE_VALIDATION_PARSER=off"
|
2018-04-06 03:47:53 +03:00
|
|
|
set zlib="-DUSE_SHARED_ZLIB=off"
|
2018-06-15 00:09:25 +03:00
|
|
|
set parser="-DXML_PARSER=msxml6"
|
2019-04-09 01:38:31 +03:00
|
|
|
set crypto="-DCRYPTO_LIB=crypt32"
|
2018-07-17 02:19:00 +03:00
|
|
|
set msvc="-DUSE_STATIC_MSVC=off"
|
Merged PR 2308191: [MSIX SDK] add a c-make switch to exclude bundles from unpack
Enable the user to disable bundle support for the SDK by specifying -DSKIP_BUNDLES=on on CMake. If the user tries to unpack a bundle or create a bundle factory they will get 0x80070032 (E_NOTSUPPORTED). The binary size decreases ~60k.
Win x64
- bundle: 464 k
- no bundle: 413 k
Win x86
- bundle: 330 k
- no bundle: 293 k
Linux
- bundle: 5,424 k
- no bundle: 5,330 k
AOSP arm
- bundle: 4,381 k
- no bundle: 4,313 k
AOSP arm v7a
- bundle: 4,288 k
- no bundle: 4,220 k
MacOS
- bundle: 4,487 k
- no bundle: 4,413 k
iOS arm64
- bundle: 4,516 k
- no bundle: 4,458 k
Related work items: #18753331
2018-09-06 21:45:34 +03:00
|
|
|
set bundle="-DSKIP_BUNDLES=off"
|
2019-05-02 21:29:11 +03:00
|
|
|
set pack="-DMSIX_PACK=on"
|
2018-04-06 03:47:53 +03:00
|
|
|
|
2018-06-15 00:09:25 +03:00
|
|
|
:parseArgs
|
|
|
|
if /I "%~2" == "--debug" (
|
|
|
|
set build="Debug"
|
|
|
|
)
|
|
|
|
if /I "%~2" == "-d" (
|
|
|
|
set build="Debug"
|
|
|
|
)
|
|
|
|
if /I "%~2" == "--parser-xerces" (
|
|
|
|
set parser="-DXML_PARSER=xerces"
|
|
|
|
)
|
|
|
|
if /I "%~2" == "-px" (
|
|
|
|
set parser="-DXML_PARSER=xerces"
|
2018-03-20 02:07:36 +03:00
|
|
|
)
|
2018-06-15 00:09:25 +03:00
|
|
|
if /I "%~2" == "--validation-parser" (
|
|
|
|
set validationParser="-DUSE_VALIDATION_PARSER=on"
|
|
|
|
)
|
|
|
|
if /I "%~2" == "-vp" (
|
|
|
|
set validationParser="-DUSE_VALIDATION_PARSER=on"
|
|
|
|
)
|
|
|
|
if /I "%~2" == "--shared-zlib" (
|
|
|
|
set zlib="-DUSE_SHARED_ZLIB=on"
|
|
|
|
)
|
|
|
|
if /I "%~2" == "-sz" (
|
2018-04-06 03:47:53 +03:00
|
|
|
set zlib="-DUSE_SHARED_ZLIB=on"
|
|
|
|
)
|
2019-04-09 01:38:31 +03:00
|
|
|
if /I "%~2" == "--crypto-openssl" (
|
|
|
|
set crypto="-DCRYPTO_LIB=openssl"
|
|
|
|
)
|
|
|
|
if /I "%~2" == "-co" (
|
|
|
|
set crypto="-DCRYPTO_LIB=openssl"
|
|
|
|
)
|
2018-07-17 02:19:00 +03:00
|
|
|
if /I "%~2" == "-mt" (
|
|
|
|
set msvc="-DUSE_STATIC_MSVC=on"
|
|
|
|
)
|
Merged PR 2308191: [MSIX SDK] add a c-make switch to exclude bundles from unpack
Enable the user to disable bundle support for the SDK by specifying -DSKIP_BUNDLES=on on CMake. If the user tries to unpack a bundle or create a bundle factory they will get 0x80070032 (E_NOTSUPPORTED). The binary size decreases ~60k.
Win x64
- bundle: 464 k
- no bundle: 413 k
Win x86
- bundle: 330 k
- no bundle: 293 k
Linux
- bundle: 5,424 k
- no bundle: 5,330 k
AOSP arm
- bundle: 4,381 k
- no bundle: 4,313 k
AOSP arm v7a
- bundle: 4,288 k
- no bundle: 4,220 k
MacOS
- bundle: 4,487 k
- no bundle: 4,413 k
iOS arm64
- bundle: 4,516 k
- no bundle: 4,458 k
Related work items: #18753331
2018-09-06 21:45:34 +03:00
|
|
|
if /I "%~2" == "--skip-bundles" (
|
|
|
|
set bundle="-DSKIP_BUNDLES=on"
|
|
|
|
)
|
|
|
|
if /I "%~2" == "-sb" (
|
|
|
|
set bundle="-DSKIP_BUNDLES=on"
|
|
|
|
)
|
2019-05-02 21:29:11 +03:00
|
|
|
if /I "%~2" == "--no-pack" (
|
|
|
|
set pack="-DMSIX_PACK=off"
|
|
|
|
)
|
2018-04-06 03:47:53 +03:00
|
|
|
shift /2
|
2018-06-15 00:09:25 +03:00
|
|
|
if not "%~2"=="" goto parseArgs
|
2018-04-06 03:47:53 +03:00
|
|
|
|
2018-06-15 00:09:25 +03:00
|
|
|
if not exist .vs md .vs
|
|
|
|
cd .vs
|
|
|
|
if exist CMakeFiles rd /s /q CMakeFiles
|
|
|
|
if exist CMakeCache.txt del CMakeCache.txt
|
2018-03-20 02:07:36 +03:00
|
|
|
|
2019-05-02 21:29:11 +03:00
|
|
|
echo cmake -DWIN32=on -DCMAKE_BUILD_TYPE=%build% %validationParser% %zlib% %parser% %crypto% %msvc% %bundle% %pack% -G"NMake Makefiles" ..
|
|
|
|
cmake -DWIN32=on -DCMAKE_BUILD_TYPE=%build% %validationParser% %zlib% %parser% %crypto% %msvc% %bundle% %pack% -G"NMake Makefiles" ..
|
2019-03-06 01:14:11 +03:00
|
|
|
nmake /NOLOGO
|
2018-06-15 00:09:25 +03:00
|
|
|
|
|
|
|
goto Exit
|
|
|
|
:USAGE
|
|
|
|
echo Usage
|
|
|
|
echo:
|
|
|
|
echo makewin.cmd ^<x86^|x64^> [options]
|
|
|
|
echo:
|
2019-02-08 02:47:08 +03:00
|
|
|
echo Helper to build the MSIX SDK for Windows. Assumes the user has a version of Visual Studio installed.
|
2018-06-15 00:09:25 +03:00
|
|
|
echo:
|
|
|
|
echo Options
|
|
|
|
echo --debug, -d = Build chk binary.
|
|
|
|
echo --parser-xerces, -px = use Xerces-C parser. Default MSXML6.
|
|
|
|
echo --validation-parser, -vp = enable XML schema validation.
|
|
|
|
echo --shared-zlib, -sz = don't statically link zlib.
|
2019-04-09 01:38:31 +03:00
|
|
|
echo --crypto-openssl, -co = use OpenSSL crypto [currently for testing]. Default Crypt32.
|
2018-07-17 02:19:00 +03:00
|
|
|
echo -mt = use compiler flag /MT to use static version of the run-time library.
|
Merged PR 2308191: [MSIX SDK] add a c-make switch to exclude bundles from unpack
Enable the user to disable bundle support for the SDK by specifying -DSKIP_BUNDLES=on on CMake. If the user tries to unpack a bundle or create a bundle factory they will get 0x80070032 (E_NOTSUPPORTED). The binary size decreases ~60k.
Win x64
- bundle: 464 k
- no bundle: 413 k
Win x86
- bundle: 330 k
- no bundle: 293 k
Linux
- bundle: 5,424 k
- no bundle: 5,330 k
AOSP arm
- bundle: 4,381 k
- no bundle: 4,313 k
AOSP arm v7a
- bundle: 4,288 k
- no bundle: 4,220 k
MacOS
- bundle: 4,487 k
- no bundle: 4,413 k
iOS arm64
- bundle: 4,516 k
- no bundle: 4,458 k
Related work items: #18753331
2018-09-06 21:45:34 +03:00
|
|
|
echo --skip-bundles, -sb = turn off bundle support.
|
2019-05-02 21:29:11 +03:00
|
|
|
echo --no-pack = Don't include packaging features.
|
2018-06-15 00:09:25 +03:00
|
|
|
echo --help, -h, /? = print this usage information and exit.
|
2018-01-26 03:10:10 +03:00
|
|
|
:Exit
|
2018-06-15 00:09:25 +03:00
|
|
|
EXIT /B 0
|