Skip to content

Commit

Permalink
Export OMCFactory for dll linkage (#3760)
Browse files Browse the repository at this point in the history
  • Loading branch information
rfranke committed Mar 19, 2016
1 parent 65c3669 commit dc190dc
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 1 deletion.
4 changes: 4 additions & 0 deletions SimulationRuntime/cpp/Core/Modelica/CMakeLists.txt
Expand Up @@ -5,6 +5,10 @@ project(${ModelicaName})
# this library is only for the precompiled header
add_library(${ModelicaName} Modelica.cpp)

if(NOT BUILD_SHARED_LIBS)
set_target_properties(${ModelicaName} PROPERTIES COMPILE_DEFINITIONS "RUNTIME_STATIC_LINKING")
endif(NOT BUILD_SHARED_LIBS)

include_directories(${SUNDIALS_INCLUDE_DIR}/cvodes ${SUNDIALS_INCLUDE_DIR}/nvector ${SUNDIALS_INCLUDE_DIR}/sundials ${SUNDIALS_INCLUDE_DIR})
target_link_libraries(${ModelicaName} ${Boost_LIBRARIES})

Expand Down
@@ -0,0 +1,15 @@
#pragma once
/** @addtogroup simcorefactoryOMCFactory
*
* @{
*/

#if defined(__vxworks) || defined(__TRICORE__) || defined(RUNTIME_STATIC_LINKING)
#define BOOST_EXTENSION_OMCFACTORY_DECL
#elif defined(OMC_BUILD) || defined(SIMSTER_BUILD)
#define BOOST_EXTENSION_OMCFACTORY_DECL BOOST_EXTENSION_EXPORT_DECL
#else
error "operating system not supported"
#endif

/** @} */ // end of simcorefactoryOMCFactory
Expand Up @@ -21,10 +21,18 @@ typedef int LOADERRESULT;
class ISimController;
struct SimSettings;

#if !defined(BOOST_EXTENSION_OMCFACTORY_DECL)
#if defined(RUNTIME_STATIC_LINKING)
#define BOOST_EXTENSION_OMCFACTORY_DECL
#else
#define BOOST_EXTENSION_OMCFACTORY_DECL BOOST_EXTENSION_IMPORT_DECL
#endif
#endif

/**
* Create a dynamically linked simulator and serve for solver factories
*/
class OMCFactory
class BOOST_EXTENSION_OMCFACTORY_DECL OMCFactory
{
public:
OMCFactory();
Expand Down
Expand Up @@ -3,6 +3,8 @@
* @{
*/

#include <SimCoreFactory/OMCFactory/FactoryExport.h>

#include <Core/ModelicaDefine.h>
#include <Core/Modelica.h>

Expand Down

0 comments on commit dc190dc

Please sign in to comment.