]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
SketchSolver: porting to Linux (loading of shared libraries)
authorazv <artem.zhidkov@opencascade.com>
Wed, 21 May 2014 10:53:10 +0000 (14:53 +0400)
committerazv <artem.zhidkov@opencascade.com>
Wed, 21 May 2014 10:53:10 +0000 (14:53 +0400)
CMakeLists.txt
src/Config/Config_ModuleReader.cpp
src/SketchPlugin/CMakeLists.txt
src/SketchPlugin/SketchPlugin_Constraint.h
src/SketchPlugin/SketchPlugin_ConstraintCoincidence.h
src/SketchSolver/CMakeLists.txt
src/XGUI/XGUI_Workshop.cpp

index 18fbdfc7ca1c0001200b8802ed1aec2b4e92c936..05f077144bf622b2307d970cc48560bde3ab18dd 100644 (file)
@@ -4,6 +4,8 @@ PROJECT (NewGEOM)
 
 SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMakeCommon" ${CMAKE_MODULE_PATH})
 
+SET(CMAKE_SHARED_LINKER_FLAGS "${SMAKE_SHARED_LINKER_FLAGS} -Wl,-E")
+
 INCLUDE(Common)
 INCLUDE(FindQt)
 INCLUDE(FindBoost)
index 0291b83b4db3039eb1fe97a22d37c8153e66bb6f..e6fdeffdeb9414aa9b37c72e6b8191c7b611fd45 100644 (file)
@@ -99,7 +99,7 @@ void Config_ModuleReader::loadLibrary(const std::string theLibName)
     Events_Error::send(errorMsg);
   }
 #else
-  void* aModLib = dlopen( aFileName.c_str(), RTLD_LAZY );
+  void* aModLib = dlopen( aFileName.c_str(), RTLD_LAZY | RTLD_GLOBAL );
   if ( !aModLib ) {
     std::cerr << "Failed to load " << aFileName.c_str() << std::endl;
   }
index eb5956ec2a58ba921311c12eb593b55d1c8ecd84..8c2796b0d1ae77023523575e6ab81df11c5141e5 100644 (file)
@@ -26,7 +26,7 @@ SET(PROJECT_LIBRARIES
 )
 
 ADD_DEFINITIONS(-DSKETCHPLUGIN_EXPORTS ${BOOST_DEFINITIONS})
-ADD_LIBRARY(SketchPlugin SHARED ${PROJECT_SOURCES} ${PROJECT_HEADERS})
+ADD_LIBRARY(SketchPlugin MODULE ${PROJECT_SOURCES} ${PROJECT_HEADERS})
 TARGET_LINK_LIBRARIES(SketchPlugin ${PROJECT_LIBRARIES} ModelAPI GeomAPI GeomAlgoAPI)
 
 INCLUDE_DIRECTORIES(
index 61cd2bf0554bc18567dbc87e17c4d48e078be365..98680830ae87b92b2152e7d2cb45b0ad72d4fd29 100644 (file)
@@ -49,11 +49,11 @@ class SketchPlugin_Constraint: public SketchPlugin_Feature
 {
 public:
   /// \brief Returns the kind of a feature
-  SKETCHPLUGIN_EXPORT virtual const std::string& getKind() 
+  SKETCHPLUGIN_EXPORT virtual const std::string& getKind()
   {static std::string MY_KIND = "SketchConstraint"; return MY_KIND;}
 
   /// \brief Returns to which group in the document must be added feature
-  SKETCHPLUGIN_EXPORT virtual const std::string& getGroup() 
+  SKETCHPLUGIN_EXPORT virtual const std::string& getGroup()
   {static std::string MY_GROUP = "Sketch"; return MY_GROUP;}
 
   /** \brief Adds sub-feature of the higher level feature (sub-element of the sketch)
@@ -62,6 +62,7 @@ public:
   SKETCHPLUGIN_EXPORT virtual const void addSub(
     const boost::shared_ptr<ModelAPI_Feature>& theFeature) {}
 
+protected:
   /// \brief Use plugin manager for features creation
   SketchPlugin_Constraint() {}
 };
index fe75115e9ca5a80e56067757a979b67cc3f8cc16..57e95f5ba0260ea0e4b68fb0ec9368552f40a4dc 100644 (file)
@@ -12,7 +12,7 @@
 
 /** \class SketchPlugin_ConstraintCoincidence
  *  \ingroup DataModel
- *  \brief Feature for creation of a new constraint which defines equvalence of two points
+ *  \brief Feature for creation of a new constraint which defines equivalence of two points
  *
  *  These constraint has two attributes: CONSTRAINT_ATTR_POINT_A and CONSTRAINT_ATTR_POINT_B
  */
index 70b9fecbbc4b97fcc43737dfc9d4febd20c76781..20cd14b872f42d7f21fc3b0558616427018e3405 100644 (file)
@@ -14,7 +14,6 @@ SET(PROJECT_SOURCES
 
 SET(PROJECT_LIBRARIES
     ${SLVS_LIBRARIES}
-    SketchPlugin
     Events
 )
 
@@ -29,7 +28,7 @@ INCLUDE_DIRECTORIES(
 
 ADD_DEFINITIONS(-DSKETCHSOLVER_EXPORTS ${BOOST_DEFINITIONS})
 
-ADD_LIBRARY(SketchSolver SHARED 
+ADD_LIBRARY(SketchSolver MODULE 
     ${PROJECT_SOURCES} 
     ${PROJECT_HEADERS}
 )
index 40c545b2c2567000db3f10b3f75d8d6357be071b..a417021195f3fe1cb73f514dc413c536ecef6d42 100644 (file)
@@ -525,7 +525,7 @@ XGUI_Module* XGUI_Workshop::loadModule(const QString& theModule)
     }
   }
 #else
-  void* modLib = dlopen( libName.toLatin1(), RTLD_LAZY );
+  void* modLib = dlopen( libName.toLatin1(), RTLD_LAZY | RTLD_GLOBAL );
   if ( !modLib ) {
     err = QString( "Can not load library %1. %2" ).arg( libName ).arg( dlerror() );
   } else {