From eecb991e2fed4a055ce57e599d9e8980d01730f3 Mon Sep 17 00:00:00 2001 From: Jules BOURDAIS Date: Tue, 3 Dec 2024 13:07:49 +0100 Subject: [PATCH] tmp: get rid of pthread link --- CMakeLists.txt | 11 +++++++---- src/CMakeLists.txt | 6 +++++- src/DriverMED/CMakeLists.txt | 2 +- src/SMESH/CMakeLists.txt | 4 ++-- src/SMESH/SMESH_Mesh.cxx | 14 ++++++++++++-- src/SMESHClient/CMakeLists.txt | 2 +- 6 files changed, 28 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c08124dfe..f923307d2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,8 +31,10 @@ if (DEFINED EMSCRIPTEN) add_link_options("-sWARN_ON_UNDEFINED_SYMBOLS=1" "-sWASM_BIGINT=1") list(APPEND CMAKE_FIND_ROOT_PATH "/") message("Using Emscripten") - add_compile_options(-sUSE_BOOST_HEADERS=1 -pthread) - add_link_options(-sUSE_BOOST_HEADERS=1 -pthread) + add_compile_options(-sUSE_BOOST_HEADERS=1) + add_link_options(-sUSE_BOOST_HEADERS=1) + # add_compile_options(-sUSE_BOOST_HEADERS=1 -pthread) + # add_link_options(-sUSE_BOOST_HEADERS=1 -pthread) add_compile_definitions(__EMSCRIPTEN__) else() message("Not using Emscripten") @@ -127,7 +129,7 @@ ELSE() ENDIF() # PThread -FIND_PACKAGE(SalomePThread REQUIRED) +# FIND_PACKAGE(SalomePThread REQUIRED) # SWIG FIND_PACKAGE(SalomeSWIG REQUIRED) # Boost @@ -352,7 +354,8 @@ INCLUDE(CMakePackageConfigHelpers) # They all have to be INSTALL'd with the option "EXPORT ${PROJECT_NAME}TargetGroup" SET(_${PROJECT_NAME}_exposed_targets SMESHControls MeshDriver MeshDriverDAT MeshDriverGMF MeshDriverMED - MeshDriverSTL MeshDriverUNV MEDWrapper + # MeshDriverSTL MeshDriverUNV MEDWrapper + MeshDriverSTL MeshDriverUNV SMDS SMESHimpl SMESHEngine SMESHClient SMESHDS SMESHUtils StdMeshers StdMeshersEngine SalomeIDLSMESH SalomeIDLSPADDER diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e44c25c2f..eb8001a7d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -26,7 +26,7 @@ SET(SUBDIRS_COMMON SMESHUtils Controls Driver - MEDWrapper + # MEDWrapper DriverMED DriverDAT DriverUNV @@ -42,6 +42,10 @@ SET(SUBDIRS_COMMON Tools ) +IF (NOT DEFINED EMSCRIPTEN) + LIST(APPEND SUBDIRS_COMMON MEDWrapper) +endif() + ## # CGNS ## diff --git a/src/DriverMED/CMakeLists.txt b/src/DriverMED/CMakeLists.txt index f964f25b1..04e18db04 100644 --- a/src/DriverMED/CMakeLists.txt +++ b/src/DriverMED/CMakeLists.txt @@ -44,7 +44,7 @@ ADD_DEFINITIONS( SET(_link_LIBRARIES ${Boost_LIBRARIES} MeshDriver - MEDWrapper + # MEDWrapper ) SET(_link_LIBRARIES_bin diff --git a/src/SMESH/CMakeLists.txt b/src/SMESH/CMakeLists.txt index 086a48b92..8f31adbb6 100644 --- a/src/SMESH/CMakeLists.txt +++ b/src/SMESH/CMakeLists.txt @@ -82,7 +82,7 @@ SET(SMESHimpl_HEADERS SMESH_Gen.hxx SMESH_Mesh.hxx SMESH_SequentialMesh.hxx - SMESH_ParallelMesh.hxx + # SMESH_ParallelMesh.hxx SMESH_subMesh.hxx SMESH_subMeshEventListener.hxx SMESH_Hypothesis.hxx @@ -109,7 +109,7 @@ SET(SMESHimpl_SOURCES SMESH_Gen.cxx SMESH_Mesh.cxx SMESH_SequentialMesh.cxx - SMESH_ParallelMesh.cxx + # SMESH_ParallelMesh.cxx SMESH_subMesh.cxx SMESH_Hypothesis.cxx SMESH_Algo.cxx diff --git a/src/SMESH/SMESH_Mesh.cxx b/src/SMESH/SMESH_Mesh.cxx index 49f83e0c6..8bf3fa3ec 100644 --- a/src/SMESH/SMESH_Mesh.cxx +++ b/src/SMESH/SMESH_Mesh.cxx @@ -73,13 +73,18 @@ #include "Utils_ExceptHandlers.hxx" -#if (!defined WIN32 && !defined __EMSCRIPTEN__) +#if (!defined __EMSCRIPTEN) + +#if (!defined WIN32) + #include #include #else #include #endif +#endif + #if (!defined WIN32 && !defined __EMSCRIPTEN__) #include namespace fs=boost::filesystem; @@ -225,11 +230,16 @@ SMESH_Mesh::~SMESH_Mesh() if ( _meshDS ) { // delete _meshDS, in a thread in order not to block closing a study with large meshes -#if (!defined WIN32 && !defined __EMSCRIPTEN__) +#if (!defined __EMSCRIPTEN) +#if (!defined WIN32) boost::thread aThread(boost::bind( & deleteMeshDS, _meshDS )); #else pthread_t thread; int result=pthread_create(&thread, NULL, deleteMeshDS, (void*)_meshDS); +#endif +#else + deleteMeshDS(&_meshDS); + #endif } } diff --git a/src/SMESHClient/CMakeLists.txt b/src/SMESHClient/CMakeLists.txt index 65a77f236..ea5eaf073 100644 --- a/src/SMESHClient/CMakeLists.txt +++ b/src/SMESHClient/CMakeLists.txt @@ -72,7 +72,7 @@ SET(_link_LIBRARIES SMESHDS SMESHControls SMESHEngine - MEDWrapper + # MEDWrapper ) # --- headers ---