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
#BUILD_DIR=build
INSTALL_DIR="$SrcRoot/../3rdparty/occt77"
+BUILD_CPP_STANDARD=C++14
+
#BUILD_DOC_Overview=OFF
#BUILD_Inspector=OFF
#BUILD_LIBRARY_TYPE=Shared
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
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% ^
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
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" \
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"
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"] (
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%"
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"] (
# 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
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
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
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" \
-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" \
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"
# 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