]> OCCT Git - occt.git/commitdiff
Unify build scripts for CI/CD without fips
authoroan <oan@opencascade.com>
Fri, 9 Jun 2023 22:01:49 +0000 (23:01 +0100)
committeroan <oan@opencascade.com>
Tue, 13 Jun 2023 16:48:49 +0000 (17:48 +0100)
adm/scripts/cmake_custom.bat
adm/scripts/cmake_custom.sh
adm/scripts/cmake_gen.bat
adm/scripts/cmake_gen.sh
adm/scripts/wasm_build.bat
adm/scripts/wasm_build.sh
adm/scripts/wasm_custom.bat
adm/scripts/wasm_custom.sh

index 47aaf44bfc7320c254fc4c3f503afaec83d89a65..4b9a9d843b72e1c7ab4ba6c1000c638540757122 100644 (file)
@@ -15,6 +15,8 @@ rem ------------------------------------
 rem set "BUILD_DIR=build-vs%VS%-%VSPLATFORM%"
 set "INSTALL_DIR=%SrcRoot%\..\3rdparty\occt77-vc14-64"
 
+set BUILD_CPP_STANDARD=C++14
+
 rem set BUILD_DOC_Overview=OFF
 rem set BUILD_Inspector=OFF
 rem set BUILD_LIBRARY_TYPE=Shared
index 31183848b0b9fb5fe8bbcc307ed6d81b1d65ed0d..49e4c6d330f4babe14572e0ef1d8cdb1a38f203d 100644 (file)
@@ -10,6 +10,8 @@ FREETYPE_DIR="$OCCT3RDPARTY/freetype-2.7.1"
 #BUILD_DIR=build
 INSTALL_DIR="$SrcRoot/../3rdparty/occt77"
 
+BUILD_CPP_STANDARD=C++14
+
 #BUILD_DOC_Overview=OFF
 #BUILD_Inspector=OFF
 #BUILD_LIBRARY_TYPE=Shared
index f60e47b12982f003e441c40f67144582827262f5..c901b4274be3f57b4fb74946c57c0713ca741599 100644 (file)
@@ -15,6 +15,8 @@ set "BUILD_DIR=build-vs%VS%-%VSPLATFORM%"
 set "OCCT3RDPARTY="
 set "INSTALL_DIR=%SrcRoot%\install"
 
+set BUILD_CPP_STANDARD=C++11
+
 set BUILD_ADDITIONAL_TOOLKITS=
 set BUILD_DOC_Overview=OFF
 set BUILD_Inspector=OFF
@@ -55,6 +57,7 @@ if not exist "%BUILD_DIR%" mkdir "%BUILD_DIR%"
 pushd "%BUILD_DIR%"
  
 cmake -G "%arch_compile%" ^
+  -D BUILD_CPP_STANDARD:STRING="%BUILD_CPP_STANDARD%" ^
   -D 3RDPARTY_DIR:STRING="%OCCT3RDPARTY%" ^
   -D BUILD_ADDITIONAL_TOOLKITS:STRING="%BUILD_ADDITIONAL_TOOLKITS%" ^
   -D BUILD_DOC_Overview:BOOL=%BUILD_DOC_Overview% ^
index 9c088715d2d6b26156f05d19dfb3577dfa95830f..32e3b815fbd23264f2f09a0d29463d53dabe73a6 100755 (executable)
@@ -14,12 +14,13 @@ DEB=
 CMAKE_BUILD_TYPE=Release
 if [ "$1" = "-d" ]; then
   DEB=d
-  BUILD_DIR=${BUILD_DIR}-deb
   CMAKE_BUILD_TYPE=Debug
 fi
 INSTALL_DIR_BIN=lin64/gcc/bin$DEB
 INSTALL_DIR_LIB=lin64/gcc/lib$DEB
 
+BUILD_CPP_STANDARD=C++11
+
 BUILD_ADDITIONAL_TOOLKITS=
 BUILD_DOC_Overview=OFF
 BUILD_Inspector=OFF
@@ -54,6 +55,7 @@ if [ ! -d "$BUILD_DIR" ]; then mkdir -p "$BUILD_DIR"; fi
 pushd "$BUILD_DIR"
  
 cmake -G "Unix Makefiles" \
+  -D BUILD_CPP_STANDARD:STRING="$BUILD_CPP_STANDARD" \
   -D CMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE \
   -D 3RDPARTY_DIR:PATH="$OCCT3RDPARTY" \
   -D 3RDPARTY_FREETYPE_DIR:PATH="$FREETYPE_DIR" \
index 4ef9a61f73b94ade4080370307b119df467b145b..d7ed334be33318bc5b64c472c8c1e6a4bb7c39d5 100644 (file)
@@ -44,6 +44,28 @@ 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 "aBuildTypePrefix="
+set "anExtraCxxFlags="
+if /I ["%USE_PTHREADS%"] == ["ON"] (
+  set "anExtraCxxFlags=-pthread"
+  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"
+
+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"
 
@@ -58,18 +80,6 @@ for /f tokens^=2^ delims^=^" %%i in ('findstr /b /c:"#define OCC_VERSION_DEVELOP
 for /f tokens^=2^ delims^=^" %%i in ('findstr /b /c:"#define OCC_VERSION_COMPLETE" "%aCasSrc%\src\Standard\Standard_Version.hxx"') do ( set "anOcctVersion=%%i" )
 for /f %%i in ('git symbolic-ref --short HEAD') do ( set "aGitBranch=%%i" )
 
-set "aBuildType=Release"
-set "aBuildTypePrefix="
-set "anExtraCxxFlags="
-if /I ["%USE_PTHREADS%"] == ["ON"] (
-  set "anExtraCxxFlags=-pthread"
-  set "aBuildTypePrefix=%aBuildTypePrefix%-pthread"
-)
-if ["%toDebug%"] == ["1"] (
-  set "aBuildType=Debug"
-  set "aBuildTypePrefix=%aBuildTypePrefix%-debug"
-)
-
 call :cmakeGenerate
 if errorlevel 1 (
   if not ["%1"] == ["-nopause"] (
@@ -115,10 +125,6 @@ if not ["%1"] == ["-nopause"] (
 goto :eof
 
 :cmakeGenerate
-set "aPlatformAndCompiler=wasm32%aBuildTypePrefix%"
-set "aWorkDir=%aBuildRoot%\occt-%aPlatformAndCompiler%-make"
-set "aDestDir=%aBuildRoot%\occt-%aPlatformAndCompiler%"
-set "aLogFile=%aBuildRoot%\occt-%aPlatformAndCompiler%-build.log"
 if ["%toCMake%"] == ["1"] (
   if ["%toClean%"] == ["1"] (
     rmdir /S /Q %aWorkDir%"
@@ -128,10 +134,6 @@ if ["%toCMake%"] == ["1"] (
 if not exist "%aWorkDir%" ( mkdir "%aWorkDir%" )
 if     exist "%aLogFile%" ( del   "%aLogFile%" )
 
-set "aSrcRootSmpl=%aCasSrc%\samples\webgl"
-set "aWorkDirSmpl=%aBuildRoot%\sample-%aPlatformAndCompiler%-make"
-set "aDestDirSmpl=%aBuildRoot%\sample-%aPlatformAndCompiler%"
-set "aLogFileSmpl=%aBuildRoot%\sample-%aPlatformAndCompiler%-build.log"
 if ["%toBuildSample%"] == ["1"] (
   if ["%toCMake%"] == ["1"] (
     if ["%toClean%"] == ["1"] (
index 3840e966f5ba37a2ba7b837b18edf06849e3503f..81a217931604c6dbc72a85f3694eaa18484fa0bf 100755 (executable)
@@ -4,6 +4,11 @@
 # wasm_custom.sh should be configured with paths to CMake, 3rd-parties and Emscripten SDK.
 # FreeType should be specified as mandatory dependency.
 
+CMAKE_BUILD_TYPE=Release
+if [ "$1" = "-d" ]; then
+  CMAKE_BUILD_TYPE=Debug
+fi
+
 export aScriptDir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
 export aSrcRoot="${aScriptDir}/../.."
 export aBuildRoot=work
@@ -21,6 +26,12 @@ export BUILD_Visualization=ON
 export BUILD_ApplicationFramework=ON
 export BUILD_DataExchange=ON
 
+export aPlatformAndCompiler=wasm
+
+export aWorkDir="${aSrcRoot}/${aBuildRoot}/${aPlatformAndCompiler}-make"
+export aDestDir="${aSrcRoot}/${aBuildRoot}/${aPlatformAndCompiler}"
+export aLogFile="${aSrcRoot}/${aBuildRoot}/build-${aPlatformAndCompiler}.log"
+
 if [ -f "${aScriptDir}/wasm_custom.sh" ] ; then
   . "${aScriptDir}/wasm_custom.sh"
 fi
@@ -33,19 +44,14 @@ export aGitBranch=`git symbolic-ref --short HEAD`
 
 echo "Compilation OCCT branch : $aGitBranch"
 
-export aPlatformAndCompiler=wasm
-
-export aWorkDir="${aSrcRoot}/${aBuildRoot}/${aPlatformAndCompiler}-make"
 if [ ! -d "${aWorkDir}" ]; then
   mkdir -p "${aWorkDir}"
 fi
 
-export aDestDir="${aSrcRoot}/${aBuildRoot}/${aPlatformAndCompiler}"
 if [ ! -d "${aDestDir}" ]; then
   mkdir -p "${aDestDir}"
 fi
 
-export aLogFile="${aSrcRoot}/${aBuildRoot}/build-${aPlatformAndCompiler}.log"
 if [ -f "${aLogFile}" ]; then
   rm "${aLogFile}"
 fi
@@ -60,7 +66,7 @@ if [ "${toCMake}" = "1" ]; then
 
 echo "Configuring OCCT for WASM..."
 echo cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE:FILEPATH="${aToolchain}" \
--DCMAKE_BUILD_TYPE:STRING="Release" \
+-DCMAKE_BUILD_TYPE:STRING="$CMAKE_BUILD_TYPE" \
 -DBUILD_LIBRARY_TYPE:STRING="Static" \
 -DINSTALL_DIR:PATH="${aDestDir}" \
 -DINSTALL_DIR_INCLUDE:STRING="inc" \
@@ -78,7 +84,7 @@ echo cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE:FILEPATH="${aToolchain}" \
 -DBUILD_DOC_Overview:BOOL="OFF" "${aSrcRoot}"
 
 cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE:FILEPATH="${aToolchain}" \
--DCMAKE_BUILD_TYPE:STRING="Release" \
+-DCMAKE_BUILD_TYPE:STRING="$CMAKE_BUILD_TYPE" \
 -DBUILD_LIBRARY_TYPE:STRING="Static" \
 -DINSTALL_DIR:PATH="${aDestDir}" \
 -DINSTALL_DIR_INCLUDE:STRING="inc" \
index b02fd4c69b62ee91fc811afcc24d798d882e633c..973d481b759d39dbffbdd2179b5d3cdedbbea298 100644 (file)
@@ -1,10 +1,12 @@
 rem Environment configuration template for wasm_build.bat (to be renamed as wasm_custom.bat)
-set "EMSDK_ROOT=%aCasSrc%\..\asrv-web3d\fips\fips-sdks\emsdk"
 set "aFreeType=%aCasSrc%\..\3rdparty\freetype-2.7.1-wasm"
+set "EMSDK_ROOT=%aCasSrc%\..\emsdk"
 rem set "aRapidJson=%aCasSrc%\..\3rdparty\rapidjson-1.1.0"
 rem set "aDraco=%aCasSrc%\..\3rdparty\draco-1.4.1-wasm32"
 rem set "aCmakeBin=%ProgramW6432%\CMake\bin"
 
+set "aDestDir=%aCasSrc%\..\3rdparty\occt77-wasm"
+
 rem Uncomment to customize building steps
 rem set "aBuildRoot=work"
 rem set "toCMake=1"
index aa3536a873ca1152826e27920dc5279e3e676e6c..98e1a56b435e0e6458dfbb18b1e1ee993bb5d41d 100644 (file)
@@ -1,6 +1,8 @@
 # environment configuration template for occ_build_wasm.sh (to be renamed as wasm_custom_env.sh)
 export aFreeType="$aSrcRoot/../3rdparty/freetype-2.7.1-wasm"
-export EMSDK_ROOT="$aSrcRoot/../asrv-web3d/fips/fips-sdks/emsdk"
+export EMSDK_ROOT="$aSrcRoot/../emsdk"
+
+export aDestDir="${aSrcRoot}/../3rdparty/occt77-wasm"
 
 # Uncomment to customize building steps
 #export aBuildRoot=work