]> OCCT Git - occt.git/commitdiff
Add option -d to enable Debug mode instead of custom script variable
authoroan <oan@opencascade.com>
Tue, 13 Jun 2023 23:17:10 +0000 (00:17 +0100)
committeroan <oan@opencascade.com>
Tue, 13 Jun 2023 23:57:02 +0000 (00:57 +0100)
adm/scripts/wasm_build.bat
adm/scripts/wasm_custom.bat

index d7ed334be33318bc5b64c472c8c1e6a4bb7c39d5..b5cacf9f259110371e809ed7e27ef4f4537259ca 100644 (file)
@@ -26,6 +26,12 @@ set "toDebug=0"
 set "toBuildSample=0"
 set "sourceMapBase="
 
+set "aBuildType=Release"
+if /I ["%1"] == ["-d"] (
+  set "toDebug=1"
+  set "aBuildType=Debug"
+)
+
 rem OCCT Modules to build
 set "BUILD_ModelingData=ON"
 set "BUILD_ModelingAlgorithms=ON"
@@ -44,7 +50,19 @@ rem Archive tool
 set "THE_7Z_PARAMS=-t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on"
 set "THE_7Z_PATH=%ProgramW6432%\7-Zip\7z.exe"
 
-set "aBuildType=Release"
+set "aPlatformAndCompiler="
+set "aWorkDir="
+set "aDestDir="
+set "aLogFile="
+
+set "aSrcRootSmpl=%aCasSrc%\samples\webgl"
+set "aWorkDirSmpl="
+set "aDestDirSmpl="
+set "aLogFileSmpl="
+
+rem Configuration file
+if exist "%~dp0wasm_custom.bat" call "%~dp0wasm_custom.bat"
+
 set "aBuildTypePrefix="
 set "anExtraCxxFlags="
 if /I ["%USE_PTHREADS%"] == ["ON"] (
@@ -52,22 +70,17 @@ if /I ["%USE_PTHREADS%"] == ["ON"] (
   set "aBuildTypePrefix=%aBuildTypePrefix%-pthread"
 )
 if ["%toDebug%"] == ["1"] (
-  set "aBuildType=Debug"
   set "aBuildTypePrefix=%aBuildTypePrefix%-debug"
 )
 
-set "aPlatformAndCompiler=wasm32%aBuildTypePrefix%"
-set "aWorkDir=%aBuildRoot%\occt-%aPlatformAndCompiler%-make"
-set "aDestDir=%aBuildRoot%\occt-%aPlatformAndCompiler%"
-set "aLogFile=%aBuildRoot%\occt-%aPlatformAndCompiler%-build.log"
+if ["%aPlatformAndCompiler%"] == [""] ( set "aPlatformAndCompiler=wasm32%aBuildTypePrefix%" )
+if ["%aWorkDir%"] == [""] ( set "aWorkDir=%aBuildRoot%\occt-%aPlatformAndCompiler%-make" )
+if ["%aDestDir%"] == [""] ( set "aDestDir=%aBuildRoot%\occt-%aPlatformAndCompiler%" )
+if ["%aLogFile%"] == [""] ( set "aLogFile=%aBuildRoot%\occt-%aPlatformAndCompiler%-build.log" )
 
-set "aSrcRootSmpl=%aCasSrc%\samples\webgl"
-set "aWorkDirSmpl=%aBuildRoot%\sample-%aPlatformAndCompiler%-make"
-set "aDestDirSmpl=%aBuildRoot%\sample-%aPlatformAndCompiler%"
-set "aLogFileSmpl=%aBuildRoot%\sample-%aPlatformAndCompiler%-build.log"
-
-rem Configuration file
-if exist "%~dp0wasm_custom.bat" call "%~dp0wasm_custom.bat"
+if ["%aWorkDirSmpl%"] == [""] ( set "aWorkDirSmpl=%aBuildRoot%\sample-%aPlatformAndCompiler%-make" )
+if ["%aDestDirSmpl%"] == [""] ( set "aDestDirSmpl=%aBuildRoot%\sample-%aPlatformAndCompiler%" )
+if ["%aLogFileSmpl%"] == [""] ( set "aLogFileSmpl=%aBuildRoot%\sample-%aPlatformAndCompiler%-build.log" )
 
 call "%EMSDK_ROOT%\emsdk_env.bat"
 set "aToolchain=%EMSDK%/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake"
@@ -82,9 +95,6 @@ for /f %%i in ('git symbolic-ref --short HEAD') do ( set "aGitBranch=%%i" )
 
 call :cmakeGenerate
 if errorlevel 1 (
-  if not ["%1"] == ["-nopause"] (
-    pause
-  )
   exit /B 1
   goto :eof
 )
index 973d481b759d39dbffbdd2179b5d3cdedbbea298..af0d7e204ad8727cee84fa2f24d2b888543e9b6b 100644 (file)
@@ -14,7 +14,6 @@ rem set "toClean=0"
 rem set "toMake=1"
 rem set "toInstall=1"
 set "toPack=0"
-set "toDebug=0"
 set "toBuildSample=0"
 rem Source map base (should point to server where C++ sources will be copied)
 rem enables -g4 debug building option for WebGL sample and allows navigating C++ source code within JavaScript debugger.