axmol/tools/win-ci/build.ps1

28 lines
958 B
PowerShell
Raw Normal View History

$BUILD_ARCH = $args[0]
$BUILD_DLL = $args[1]
# CONFIG_ALL_OPTIONS
$CONFIG_ALL_OPTIONS=@()
2023-01-03 14:34:10 +08:00
if ($BUILD_ARCH -eq "x86") {
$CONFIG_ALL_OPTIONS += '-A', 'Win32'
}
if ($BUILD_DLL -eq "true") {
$CONFIG_ALL_OPTIONS += '-DBUILD_SHARED_LIBS=TRUE'
}
2023-01-03 14:34:10 +08:00
# windows sdk version, require xxx, but 10.0.22621.0 recommanded
if ($env:WINSDK_VER -eq '') { # empty, cmake will choose same with runner windows OS build version
2023-01-03 14:34:10 +08:00
cmake -S . -B build_$BUILD_ARCH $CONFIG_ALL_OPTIONS -Thost=x64 -DAX_ENABLE_EXT_IMGUI=TRUE -DAX_ENABLE_EXT_LIVE2D=TRUE -DAX_ENABLE_EXT_EFFEKSEER=TRUE
} else {
cmake -S . -B build_$BUILD_ARCH $CONFIG_ALL_OPTIONS -Thost=x64 -DAX_ENABLE_EXT_IMGUI=TRUE -DAX_ENABLE_EXT_LIVE2D=TRUE -DAX_ENABLE_EXT_EFFEKSEER=TRUE "-DCMAKE_SYSTEM_VERSION=$env:WINSDK_VER"
2023-01-03 14:34:10 +08:00
}
cmake --build build_$BUILD_ARCH --config Release --target cpp_tests
if ( !($env:PULL_REQUEST -eq 'yes') ) {
cmake --build build_$BUILD_ARCH --config Release --target lua_tests
}