mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Link grpc libraries statically on UNIX/Linux
This commit is contained in:
@@ -347,7 +347,7 @@ if (RESINSIGHT_ENABLE_GRPC)
|
|||||||
)
|
)
|
||||||
if (DEFINED GRPC_LIBRARY_DIRS)
|
if (DEFINED GRPC_LIBRARY_DIRS)
|
||||||
message(STATUS "Using GRPC Library Dir: ${GRPC_LIBRARY_DIRS}")
|
message(STATUS "Using GRPC Library Dir: ${GRPC_LIBRARY_DIRS}")
|
||||||
link_directories("${GRPC_LIBRARY_DIRS}")
|
link_directories(${GRPC_LIBRARY_DIRS})
|
||||||
endif(DEFINED GRPC_LIBRARY_DIRS)
|
endif(DEFINED GRPC_LIBRARY_DIRS)
|
||||||
endif(RESINSIGHT_ENABLE_GRPC)
|
endif(RESINSIGHT_ENABLE_GRPC)
|
||||||
|
|
||||||
@@ -405,7 +405,13 @@ set( LINK_LIBRARIES
|
|||||||
)
|
)
|
||||||
|
|
||||||
if (RESINSIGHT_ENABLE_GRPC)
|
if (RESINSIGHT_ENABLE_GRPC)
|
||||||
list(APPEND LINK_LIBRARIES ${GRPC_LIBRARIES})
|
if (UNIX)
|
||||||
|
foreach(GRPC_LIBRARY ${GRPC_LIBRARIES})
|
||||||
|
list(APPEND LINK_LIBRARIES "${GRPC_LIBRARY_DIRS}/lib${GRPC_LIBRARY}.a")
|
||||||
|
endforeach()
|
||||||
|
else()
|
||||||
|
list(APPEND LINK_LIBRARIES ${GRPC_LIBRARIES})
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# According to ivarun this is needed on OpenSuse, and Fedora. See: https://github.com/OPM/ResInsight/pull/7
|
# According to ivarun this is needed on OpenSuse, and Fedora. See: https://github.com/OPM/ResInsight/pull/7
|
||||||
@@ -536,16 +542,6 @@ endforeach()
|
|||||||
|
|
||||||
# Copy all grpc libraries and python files
|
# Copy all grpc libraries and python files
|
||||||
if (RESINSIGHT_ENABLE_GRPC)
|
if (RESINSIGHT_ENABLE_GRPC)
|
||||||
if(UNIX)
|
|
||||||
foreach (GRPC_LIBRARY ${GRPC_LIBRARIES})
|
|
||||||
add_custom_command(TARGET ResInsight POST_BUILD
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
|
||||||
"${GRPC_INSTALL_PREFIX}/lib/lib${GRPC_LIBRARY}.so"
|
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/$<CONFIGURATION>"
|
|
||||||
)
|
|
||||||
endforeach(GRPC_LIBRARY ${GRPC_LIBRARIES})
|
|
||||||
endif(UNIX)
|
|
||||||
|
|
||||||
if (PYTHON_EXECUTABLE AND EXISTS ${PYTHON_EXECUTABLE})
|
if (PYTHON_EXECUTABLE AND EXISTS ${PYTHON_EXECUTABLE})
|
||||||
add_custom_target(GeneratedPythonSources DEPENDS ${GRPC_GENERATED_PYTHON_SOURCES})
|
add_custom_target(GeneratedPythonSources DEPENDS ${GRPC_GENERATED_PYTHON_SOURCES})
|
||||||
add_dependencies(ResInsight GeneratedPythonSources)
|
add_dependencies(ResInsight GeneratedPythonSources)
|
||||||
|
Reference in New Issue
Block a user