From: Nabil Ghodbane Date: Tue, 12 Mar 2024 14:16:25 +0000 (+0100) Subject: bos #41337 [CEA][Windows] YACS compilation broken X-Git-Tag: emc2p_2.0.0-b2^2~5 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=refs%2Ftlpr%2F7%2Fhead;p=modules%2Fyacs.git bos #41337 [CEA][Windows] YACS compilation broken --- diff --git a/src/runtime_swig/CMakeLists.txt b/src/runtime_swig/CMakeLists.txt index 1b0316b2b..90efb777f 100644 --- a/src/runtime_swig/CMakeLists.txt +++ b/src/runtime_swig/CMakeLists.txt @@ -57,6 +57,7 @@ ADD_DEFINITIONS( ) ADD_LIBRARY(YACSRuntimePython ThreadLauncher.cxx) +TARGET_LINK_LIBRARIES(YACSRuntimePython YACSRuntimeSALOME ${PYTHON_LIBRARIES} ) INSTALL(TARGETS YACSRuntimePython EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) # libraries to link to diff --git a/src/runtime_swig/SALOMERuntime.i b/src/runtime_swig/SALOMERuntime.i index 7e99d4827..e8a5df23e 100644 --- a/src/runtime_swig/SALOMERuntime.i +++ b/src/runtime_swig/SALOMERuntime.i @@ -104,6 +104,23 @@ static PyObject *convertContainer2(YACS::ENGINE::Container *cont, int owner=0) } %} +%{ +#include "Proc.hxx" + +#include +#include +#include +using namespace YACS::ENGINE; +class ThreadDumpState +{ + public: + ThreadDumpState(Proc *proc, int nbSeconds, const std::string& dumpFile, const std::string& lockFile); + ~ThreadDumpState(); + void start(); + void join(); +}; +%} + // ---------------------------------------------------------------------------- #ifdef SWIGPYTHON @@ -252,17 +269,3 @@ namespace YACS } } -namespace YACS -{ - namespace ENGINE - { - class YACSLIBENGINE_EXPORT ThreadDumpState - { - public: - ThreadDumpState(Proc *proc, int nbSeconds, const std::string& dumpFile, const std::string& lockFile); - ~ThreadDumpState(); - void start(); - void join(); - }; - } -} diff --git a/src/runtime_swig/ThreadLauncher.cxx b/src/runtime_swig/ThreadLauncher.cxx index ff5b83c2e..5e3de2bfe 100644 --- a/src/runtime_swig/ThreadLauncher.cxx +++ b/src/runtime_swig/ThreadLauncher.cxx @@ -42,13 +42,18 @@ void ThreadDumpState::run() { #ifdef WIN32 Sleep(_nb_seconds); + std::string cmd = "COPY /b " + _lock_file + " +,,"; #else sleep(_nb_seconds); -#endif std::string cmd = "touch " + _lock_file; +#endif system(cmd.c_str()); schemaSaveStateUnsafe(_proc,_dump_file); +#ifdef WIN32 + cmd = "DEL /Q /F " + _lock_file; +#else cmd = "rm -f " + _lock_file; +#endif system(cmd.c_str()); state = _proc->getEffectiveState(); }