Skip to content

Commit

Permalink
Remove static link dependencies of dynamic runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
rfranke committed Mar 15, 2016
1 parent 05ca4d2 commit b0a5479
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 10 deletions.
6 changes: 3 additions & 3 deletions SimulationRuntime/cpp/Core/SimController/CMakeLists.txt
Expand Up @@ -9,11 +9,11 @@ if(NOT BUILD_SHARED_LIBS)
endif(NOT BUILD_SHARED_LIBS)

include_directories(${SUNDIALS_INCLUDE_DIR}/cvodes ${SUNDIALS_INCLUDE_DIR}/nvector ${SUNDIALS_INCLUDE_DIR}/sundials ${SUNDIALS_INCLUDE_DIR}/kinsol ${SUNDIALS_INCLUDE_DIR})
target_link_libraries(${SimControllerName} ${OMCFactoryName}_static ${ExtensionUtilitiesName} ${ModelicaUtilitiesName} ${Boost_LIBRARIES} ${CMAKE_DL_LIBS})
target_link_libraries(${SimControllerName} ${OMCFactoryName} ${ExtensionUtilitiesName} ${ModelicaUtilitiesName} ${Boost_LIBRARIES} ${CMAKE_DL_LIBS})
add_precompiled_header(${SimControllerName} Include/Core/Modelica.h)

install (TARGETS ${SimControllerName} DESTINATION ${LIBINSTALLEXT})
install (FILES
install(TARGETS ${SimControllerName} DESTINATION ${LIBINSTALLEXT})
install(FILES
${CMAKE_SOURCE_DIR}/Include/Core/SimController/ISimData.h
${CMAKE_SOURCE_DIR}/Include/Core/SimController/ISimObjects.h
${CMAKE_SOURCE_DIR}/Include/Core/SimController/ISimController.h
Expand Down
Expand Up @@ -9,7 +9,7 @@ if(NOT BUILD_SHARED_LIBS)
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( ${SimulationSettings} ${OMCFactoryName}_static ${Boost_LIBRARIES})
target_link_libraries(${SimulationSettings} ${OMCFactoryName} ${Boost_LIBRARIES})
add_precompiled_header(${SimulationSettings} Include/Core/Modelica.h)

install(TARGETS ${SimulationSettings} DESTINATION ${LIBINSTALLEXT})
Expand Down
2 changes: 1 addition & 1 deletion SimulationRuntime/cpp/Core/System/CMakeLists.txt
Expand Up @@ -17,7 +17,7 @@ if(NOT BUILD_SHARED_LIBS)
endif(NOT BUILD_SHARED_LIBS)

include_directories(${SUNDIALS_INCLUDE_DIR}/cvodes ${SUNDIALS_INCLUDE_DIR}/nvector ${SUNDIALS_INCLUDE_DIR}/sundials ${SUNDIALS_INCLUDE_DIR}/kinsol ${SUNDIALS_INCLUDE_DIR})
target_link_libraries (${SystemName} ${Boost_LIBRARIES} ${LAPACK_LIBRARIES} ${OMCFactoryName}_static ${SimulationSettings} ${ExtensionUtilitiesName})
target_link_libraries(${SystemName} ${Boost_LIBRARIES} ${LAPACK_LIBRARIES} ${OMCFactoryName} ${SimulationSettings} ${ExtensionUtilitiesName})
add_precompiled_header(${SystemName} Include/Core/Modelica.h)

install(TARGETS ${SystemName} DESTINATION ${LIBINSTALLEXT})
Expand Down
Expand Up @@ -6,11 +6,6 @@ add_library(${OMCFactoryName} OMCFactory.cpp)

if(NOT BUILD_SHARED_LIBS)
set_target_properties(${OMCFactoryName} PROPERTIES COMPILE_DEFINITIONS "RUNTIME_STATIC_LINKING;ENABLE_SUNDIALS_STATIC")
else(NOT BUILD_SHARED_LIBS)
# this is needed for link dependencies of some shared libs:
# SimController, SimulationSettings, System
add_library(${OMCFactoryName}_static STATIC OMCFactory.cpp)
set_target_properties(${OMCFactoryName}_static PROPERTIES COMPILE_DEFINITIONS "RUNTIME_STATIC_LINKING;ENABLE_SUNDIALS_STATIC")
endif(NOT BUILD_SHARED_LIBS)

include_directories(${SUNDIALS_INCLUDE_DIR}/cvodes ${SUNDIALS_INCLUDE_DIR}/nvector ${SUNDIALS_INCLUDE_DIR}/sundials ${SUNDIALS_INCLUDE_DIR}/kinsol ${SUNDIALS_INCLUDE_DIR})
Expand Down

0 comments on commit b0a5479

Please sign in to comment.