Skip to content

Commit

Permalink
Don't add static C / C++ lib to dynamic libs (#916)
Browse files Browse the repository at this point in the history
* Don't add static C / C++ lib to dynamic libs

* Removing staic libc from linking
  • Loading branch information
AnHeuermann committed Jan 27, 2021
1 parent 7de662d commit 94de8fc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ ELSEIF(APPLE)
set(PLATFORM_STRING "mac")
ELSE()
set(PLATFORM_STRING "linux")
set(STATIC_LIBGCC "-static-libgcc")
ENDIF()

# Don't allow in-source build
Expand Down
9 changes: 2 additions & 7 deletions src/OMSimulatorLib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -154,19 +154,14 @@ IF (WIN32 AND MSVC)
add_definitions(-DBOOST_ALL_DYN_LINK)
ENDIF ()

target_link_libraries(OMSimulatorLib fmilib sundials_kinsol sundials_cvode sundials_nvecserial minizip ${LIB_ATOMIC} ${Boost_LIBRARIES} ${OMTLM_LINKFLAGS} ${CMAKE_DL_LIBS} ${CMAKE_THREAD_LIBS_INIT} ${CPP_FS_LIBS} ${STATIC_LIBGCC})
target_link_libraries(OMSimulatorLib_static fmilib sundials_kinsol sundials_cvode sundials_nvecserial minizip lua ${CMAKE_DL_LIBS} ${LIB_ATOMIC} ${CMAKE_THREAD_LIBS_INIT} ${Boost_LIBRARIES} ${OMTLM_LINKFLAGS} ${CPP_FS_LIBS} ${STATIC_LIBGCC})
target_link_libraries(OMSimulatorLib fmilib sundials_kinsol sundials_cvode sundials_nvecserial minizip ${LIB_ATOMIC} ${Boost_LIBRARIES} ${OMTLM_LINKFLAGS} ${CMAKE_DL_LIBS} ${CMAKE_THREAD_LIBS_INIT} ${CPP_FS_LIBS})
target_link_libraries(OMSimulatorLib_static fmilib sundials_kinsol sundials_cvode sundials_nvecserial minizip lua ${CMAKE_DL_LIBS} ${LIB_ATOMIC} ${CMAKE_THREAD_LIBS_INIT} ${Boost_LIBRARIES} ${OMTLM_LINKFLAGS} ${CPP_FS_LIBS})

IF (WIN32 AND MINGW)
target_link_libraries(OMSimulatorLib shlwapi)
target_link_libraries(OMSimulatorLib_static shlwapi)
ENDIF ()

IF (NOT (WIN32 OR MSVC))
target_link_libraries(OMSimulatorLib "-static-libstdc++")
target_link_libraries(OMSimulatorLib_static "-static-libstdc++")
ENDIF ()

IF (WIN32)
install(TARGETS OMSimulatorLib DESTINATION bin)
ELSE ()
Expand Down

0 comments on commit 94de8fc

Please sign in to comment.