aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/km/build/wdk7.1/setenv.bat
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2017-04-28 05:03:57 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2017-04-28 05:03:57 +0300
commitbc3fcd57386d0202f9551c21a23b141d6dee1dea (patch)
tree5be98dabfefcce6e65ca10fdadbbdc8a5aba59a4 /km/build/wdk7.1/setenv.bat
parentbuild/wdk7.1: refactoring (diff)
downloadwindows7-drivers-bc3fcd57386d0202f9551c21a23b141d6dee1dea.tar.gz
windows7-drivers-bc3fcd57386d0202f9551c21a23b141d6dee1dea.zip
build/wdk7.1: detect debug/release builds
Diffstat (limited to 'km/build/wdk7.1/setenv.bat')
-rw-r--r--km/build/wdk7.1/setenv.bat37
1 files changed, 25 insertions, 12 deletions
diff --git a/km/build/wdk7.1/setenv.bat b/km/build/wdk7.1/setenv.bat
index 4d490b3..dc01a0b 100644
--- a/km/build/wdk7.1/setenv.bat
+++ b/km/build/wdk7.1/setenv.bat
@@ -5,6 +5,8 @@
@echo off
+call check_ddk.bat || goto :ddk_not_set
+
set "proj_build_dir=%~dp0%"
set "proj_dir=%proj_build_dir%\..\..\.."
@@ -14,22 +16,33 @@ set "proj_src_dir=%proj_dir%\km\src"
set "proj_bin_dir=%proj_build_dir%\bin"
set "proj_lib_dir=%proj_build_dir%\lib"
-set target_configuration=Release
-
-if not defined _BUILDARCH (
- echo Error: %%_BUILDARCH%% is not defined ^(have you set up the WinDDK environment?^) >&2
- exit /b 1
-)
-
if "%_BUILDARCH%" == "AMD64" (
- set target_platform=x64
- exit /b 0
+ set target_arch=x64
)
-
if "%_BUILDARCH%" == "x86" (
- set target_platform=x86
- exit /b 0
+ set target_arch=x86
+)
+
+if not defined target_arch goto :invalid_buildarch
+
+if "%DDKBUILDENV%" == "fre" (
+ set target_config=release
+)
+if "%DDKBUILDENV%" == "chk" (
+ set target_config=debug
)
+if not defined target_config goto :invalid_ddkbuildenv
+
+exit /b 0
+
+:ddk_not_set
+exit /b %errorlevel%
+
+:invalid_buildarch
echo Error: invalid %%_BUILDARCH%% value "%_BUILDARCH%" ^(the only supported architecture is x86^(-64^)^) >&2
exit /b 1
+
+:invalid_ddkbuildenv
+echo Error: invalid %%DDKBUILDENV%% value "%DDKBUILDENV%" >&2
+exit /b 1