mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-03 17:56:21 +03:00
0032629: Configuration, scripts - add USE_PTHREADS building option to wasm_build.bat
This commit is contained in:
parent
7e63845c9e
commit
2c8c4b8086
@ -38,6 +38,7 @@ rem Optional 3rd-party libraries to enable
|
|||||||
set "USE_FREETYPE=ON"
|
set "USE_FREETYPE=ON"
|
||||||
set "USE_RAPIDJSON=OFF"
|
set "USE_RAPIDJSON=OFF"
|
||||||
set "USE_DRACO=OFF"
|
set "USE_DRACO=OFF"
|
||||||
|
set "USE_PTHREADS=OFF"
|
||||||
|
|
||||||
rem Archive tool
|
rem Archive tool
|
||||||
set "THE_7Z_PARAMS=-t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on"
|
set "THE_7Z_PARAMS=-t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on"
|
||||||
@ -59,9 +60,14 @@ for /f %%i in ('git symbolic-ref --short HEAD') do ( set "aGitBranch=%%i" )
|
|||||||
|
|
||||||
set "aBuildType=Release"
|
set "aBuildType=Release"
|
||||||
set "aBuildTypePrefix="
|
set "aBuildTypePrefix="
|
||||||
|
set "anExtraCxxFlags="
|
||||||
|
if /I ["%USE_PTHREADS%"] == ["ON"] (
|
||||||
|
set "anExtraCxxFlags=-pthread"
|
||||||
|
set "aBuildTypePrefix=%aBuildTypePrefix%-pthread"
|
||||||
|
)
|
||||||
if ["%toDebug%"] == ["1"] (
|
if ["%toDebug%"] == ["1"] (
|
||||||
set "aBuildType=Debug"
|
set "aBuildType=Debug"
|
||||||
set "aBuildTypePrefix=-debug"
|
set "aBuildTypePrefix=%aBuildTypePrefix%-debug"
|
||||||
)
|
)
|
||||||
|
|
||||||
call :cmakeGenerate
|
call :cmakeGenerate
|
||||||
@ -159,6 +165,7 @@ if ["%toCMake%"] == ["1"] (
|
|||||||
-D CMAKE_TOOLCHAIN_FILE:FILEPATH="%aToolchain%" ^
|
-D CMAKE_TOOLCHAIN_FILE:FILEPATH="%aToolchain%" ^
|
||||||
-D CMAKE_BUILD_TYPE:STRING="%aBuildType%" ^
|
-D CMAKE_BUILD_TYPE:STRING="%aBuildType%" ^
|
||||||
-D BUILD_LIBRARY_TYPE:STRING="Static" ^
|
-D BUILD_LIBRARY_TYPE:STRING="Static" ^
|
||||||
|
-D CMAKE_CXX_FLAGS="%anExtraCxxFlags%" ^
|
||||||
-D INSTALL_DIR:PATH="%aDestDir%" ^
|
-D INSTALL_DIR:PATH="%aDestDir%" ^
|
||||||
-D INSTALL_DIR_INCLUDE:STRING="inc" ^
|
-D INSTALL_DIR_INCLUDE:STRING="inc" ^
|
||||||
-D INSTALL_DIR_RESOURCE:STRING="src" ^
|
-D INSTALL_DIR_RESOURCE:STRING="src" ^
|
||||||
@ -256,6 +263,7 @@ if ["%toCMake%"] == ["1"] (
|
|||||||
cmake -G "MinGW Makefiles" ^
|
cmake -G "MinGW Makefiles" ^
|
||||||
-D CMAKE_TOOLCHAIN_FILE:FILEPATH="%aToolchain%" ^
|
-D CMAKE_TOOLCHAIN_FILE:FILEPATH="%aToolchain%" ^
|
||||||
-D CMAKE_BUILD_TYPE:STRING="%aBuildType%" ^
|
-D CMAKE_BUILD_TYPE:STRING="%aBuildType%" ^
|
||||||
|
-D CMAKE_CXX_FLAGS="%anExtraCxxFlags%" ^
|
||||||
-D CMAKE_INSTALL_PREFIX:PATH="%aDestDirSmpl%" ^
|
-D CMAKE_INSTALL_PREFIX:PATH="%aDestDirSmpl%" ^
|
||||||
-D SOURCE_MAP_BASE:STRING="%sourceMapBase%" ^
|
-D SOURCE_MAP_BASE:STRING="%sourceMapBase%" ^
|
||||||
-D OpenCASCADE_DIR:PATH="%aDestDir%/lib/cmake/opencascade" ^
|
-D OpenCASCADE_DIR:PATH="%aDestDir%/lib/cmake/opencascade" ^
|
||||||
|
@ -24,5 +24,6 @@ rem set "BUILD_Visualization=ON"
|
|||||||
rem set "BUILD_ApplicationFramework=ON"
|
rem set "BUILD_ApplicationFramework=ON"
|
||||||
rem set "BUILD_DataExchange=ON"
|
rem set "BUILD_DataExchange=ON"
|
||||||
|
|
||||||
rem set "USE_RAPIDJSON=OFF"
|
rem set "USE_RAPIDJSON=ON"
|
||||||
rem set "USE_DRACO=ON"
|
rem set "USE_DRACO=ON"
|
||||||
|
rem set "USE_PTHREADS=ON"
|
||||||
|
@ -21,6 +21,8 @@ set "toInstall=1"
|
|||||||
set "toDebug=0"
|
set "toDebug=0"
|
||||||
set "sourceMapBase="
|
set "sourceMapBase="
|
||||||
|
|
||||||
|
set "USE_PTHREADS=OFF"
|
||||||
|
|
||||||
rem Configuration file
|
rem Configuration file
|
||||||
if exist "%~dp0wasm_custom.bat" call "%~dp0wasm_custom.bat"
|
if exist "%~dp0wasm_custom.bat" call "%~dp0wasm_custom.bat"
|
||||||
|
|
||||||
@ -30,9 +32,14 @@ if not ["%aCmakeBin%"] == [""] ( set "PATH=%aCmakeBin%;%PATH%" )
|
|||||||
|
|
||||||
set "aBuildType=Release"
|
set "aBuildType=Release"
|
||||||
set "aBuildTypePrefix="
|
set "aBuildTypePrefix="
|
||||||
|
set "anExtraCxxFlags="
|
||||||
|
if /I ["%USE_PTHREADS%"] == ["ON"] (
|
||||||
|
set "anExtraCxxFlags=-pthread"
|
||||||
|
set "aBuildTypePrefix=%aBuildTypePrefix%-pthread"
|
||||||
|
)
|
||||||
if ["%toDebug%"] == ["1"] (
|
if ["%toDebug%"] == ["1"] (
|
||||||
set "aBuildType=Debug"
|
set "aBuildType=Debug"
|
||||||
set "aBuildTypePrefix=-debug"
|
set "aBuildTypePrefix=%aBuildTypePrefix%-debug"
|
||||||
)
|
)
|
||||||
|
|
||||||
call :cmakeGenerate
|
call :cmakeGenerate
|
||||||
@ -64,6 +71,7 @@ if ["%toCMake%"] == ["1"] (
|
|||||||
cmake -G "MinGW Makefiles" ^
|
cmake -G "MinGW Makefiles" ^
|
||||||
-D CMAKE_TOOLCHAIN_FILE:FILEPATH="%aToolchain%" ^
|
-D CMAKE_TOOLCHAIN_FILE:FILEPATH="%aToolchain%" ^
|
||||||
-D CMAKE_BUILD_TYPE:STRING="%aBuildType%" ^
|
-D CMAKE_BUILD_TYPE:STRING="%aBuildType%" ^
|
||||||
|
-D CMAKE_CXX_FLAGS="%anExtraCxxFlags%" ^
|
||||||
-D CMAKE_INSTALL_PREFIX:PATH="%aDestDirSmpl%" ^
|
-D CMAKE_INSTALL_PREFIX:PATH="%aDestDirSmpl%" ^
|
||||||
-D SOURCE_MAP_BASE:STRING="%sourceMapBase%" ^
|
-D SOURCE_MAP_BASE:STRING="%sourceMapBase%" ^
|
||||||
-D OpenCASCADE_DIR:PATH="%aDestDirOcct%/lib/cmake/opencascade" ^
|
-D OpenCASCADE_DIR:PATH="%aDestDirOcct%/lib/cmake/opencascade" ^
|
||||||
|
@ -77,5 +77,8 @@ if (NOT "${SOURCE_MAP_BASE}" STREQUAL "")
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
install(FILES occt-webgl-sample.html DESTINATION ${CMAKE_INSTALL_PREFIX})
|
install(FILES occt-webgl-sample.html DESTINATION ${CMAKE_INSTALL_PREFIX})
|
||||||
install(FILES ${OpenCASCADE_RESOURCE_DIR}/DrawResources/OCC_logo.png DESTINATION ${CMAKE_INSTALL_PREFIX})
|
install(FILES ${OpenCASCADE_RESOURCE_DIR}/DrawResources/OCC_logo.png DESTINATION ${CMAKE_INSTALL_PREFIX})
|
||||||
install(FILES ${OpenCASCADE_RESOURCE_DIR}/DrawResources/lamp.ico DESTINATION ${CMAKE_INSTALL_PREFIX})
|
install(FILES ${OpenCASCADE_RESOURCE_DIR}/DrawResources/lamp.ico DESTINATION ${CMAKE_INSTALL_PREFIX})
|
||||||
|
if (CMAKE_CXX_FLAGS MATCHES "-pthread")
|
||||||
|
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.worker.js DESTINATION ${CMAKE_INSTALL_PREFIX})
|
||||||
|
endif()
|
||||||
|
@ -62,7 +62,14 @@ if (EMSCRIPTEN)
|
|||||||
# In case of WebAssembly build $tcl_library looks like "tcl8.6.11/library" by default.
|
# In case of WebAssembly build $tcl_library looks like "tcl8.6.11/library" by default.
|
||||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --preload-file ${3RDPARTY_TCL_LIBRARY_DIR}/tcl${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}@/tcl${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}.${TCL_RELEASE_SERIAL}/library")
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --preload-file ${3RDPARTY_TCL_LIBRARY_DIR}/tcl${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}@/tcl${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}.${TCL_RELEASE_SERIAL}/library")
|
||||||
|
|
||||||
install(FILES ${PROJECT_NAME}.html DESTINATION "${INSTALL_DIR_BIN}/${OCCT_INSTALL_BIN_LETTER}")
|
install(FILES ${PROJECT_NAME}.html
|
||||||
install(FILES ../DrawResources/lamp.ico DESTINATION "${INSTALL_DIR_BIN}/${OCCT_INSTALL_BIN_LETTER}")
|
DESTINATION "${INSTALL_DIR_BIN}/${OCCT_INSTALL_BIN_LETTER}")
|
||||||
install(FILES ${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bin\${OCCT_INSTALL_BIN_LETTER}/${PROJECT_NAME}.data DESTINATION "${INSTALL_DIR_BIN}/${OCCT_INSTALL_BIN_LETTER}")
|
install(FILES ../DrawResources/lamp.ico
|
||||||
|
DESTINATION "${INSTALL_DIR_BIN}/${OCCT_INSTALL_BIN_LETTER}")
|
||||||
|
install(FILES ${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bin\${OCCT_INSTALL_BIN_LETTER}/${PROJECT_NAME}.data
|
||||||
|
DESTINATION "${INSTALL_DIR_BIN}/${OCCT_INSTALL_BIN_LETTER}")
|
||||||
|
if (CMAKE_CXX_FLAGS MATCHES "-pthread")
|
||||||
|
install(FILES ${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bin\${OCCT_INSTALL_BIN_LETTER}/${PROJECT_NAME}.worker.js
|
||||||
|
DESTINATION "${INSTALL_DIR_BIN}/${OCCT_INSTALL_BIN_LETTER}")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
@ -41,7 +41,9 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
|
#if !defined(__EMSCRIPTEN__)
|
||||||
#include <pwd.h> // For command getpwuid
|
#include <pwd.h> // For command getpwuid
|
||||||
|
#endif
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -60,8 +60,8 @@
|
|||||||
#include <StepAP203_HArray1OfApprovedItem.hxx>
|
#include <StepAP203_HArray1OfApprovedItem.hxx>
|
||||||
#include <StepBasic_ProductCategory.hxx>
|
#include <StepBasic_ProductCategory.hxx>
|
||||||
|
|
||||||
#ifndef _WIN32
|
#if !defined(_WIN32) && !defined(__ANDROID__) && !defined(__EMSCRIPTEN__)
|
||||||
# include <pwd.h>
|
#include <pwd.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -180,12 +180,19 @@ Handle(StepBasic_PersonAndOrganization) STEPConstruct_AP203Context::DefaultPerso
|
|||||||
// construct person`s name
|
// construct person`s name
|
||||||
OSD_Process sys;
|
OSD_Process sys;
|
||||||
TCollection_AsciiString user (sys.UserName());
|
TCollection_AsciiString user (sys.UserName());
|
||||||
#if !defined(_WIN32) && !defined(__ANDROID__)
|
#if !defined(_WIN32) && !defined(__ANDROID__) && !defined(__EMSCRIPTEN__)
|
||||||
if ( !user.IsEmpty() ) {
|
if (!user.IsEmpty())
|
||||||
struct passwd *pwd = getpwnam ( user.ToCString() );
|
{
|
||||||
if ( pwd ) user = pwd->pw_gecos;
|
struct passwd* aPwd = getpwnam (user.ToCString());
|
||||||
|
if (aPwd != NULL)
|
||||||
|
{
|
||||||
|
user = aPwd->pw_gecos;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
user = "Unknown";
|
||||||
}
|
}
|
||||||
else user = "Unknown";
|
|
||||||
#endif
|
#endif
|
||||||
Handle(TCollection_HAsciiString) fname = new TCollection_HAsciiString ("");
|
Handle(TCollection_HAsciiString) fname = new TCollection_HAsciiString ("");
|
||||||
Handle(TCollection_HAsciiString) lname = new TCollection_HAsciiString ("");
|
Handle(TCollection_HAsciiString) lname = new TCollection_HAsciiString ("");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user