Skip to content
Snippets Groups Projects
Commit eb914a23 authored by Gerardo Tauriello's avatar Gerardo Tauriello
Browse files

SCHWED-4355: Fixes for static compile

Tested with Ubuntu 18.04 (in a vagrant box) following instructions in doc and
adding cmake flags "-DENABLE_STATIC=ON -DENABLE_INFO=OFF". Tested resulting
binaries "chemdict_tool" and "lddt" in Ubuntu-box and host-system (CentOS 7).
parent b86a52dd
No related branches found
No related tags found
No related merge requests found
......@@ -321,15 +321,15 @@ macro(executable)
if (ENABLE_STATIC AND _ARG_STATIC)
target_link_libraries(${_ARG_NAME} ${STATIC_LIBRARIES})
if (UNIX AND NOT APPLE)
set_target_properties(${_ARG_NAME} PROPERTIES LINK_SEARCH_START_STATIC TRUE)
set_target_properties(${_ARG_NAME} PROPERTIES LINK_SEARCH_END_STATIC TRUE)
if (OST_GCC_LESS_45)
set_target_properties(${_ARG_NAME}
PROPERTIES LINK_SEARCH_END_STATIC TRUE
LINK_FLAGS "-static-libgcc -static -pthread")
set_target_properties(${_ARG_NAME} PROPERTIES LINK_FLAGS
"-static-libgcc -static -pthread")
else()
set_target_properties(${_ARG_NAME}
PROPERTIES LINK_SEARCH_END_STATIC TRUE
LINK_FLAGS "-static-libgcc -static-libstdc++ -static -pthread")
endif()
set_target_properties(${_ARG_NAME} PROPERTIES LINK_FLAGS
"-static-libgcc -static-libstdc++ -static -pthread")
endif()
endif()
endif()
install(TARGETS ${_ARG_NAME} DESTINATION bin)
......
......@@ -23,4 +23,6 @@ if(WIN32)
else(WIN32)
add_definitions(-DSQLITE_OMIT_LOAD_EXTENSION)
endif(WIN32)
if (ENABLE_STATIC AND UNIX AND NOT APPLE)
target_link_libraries(ost_db ${CMAKE_DL_LIBS})
endif()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment