-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to compile as static .a file? #220
Comments
Patch the following code to "kubernetes/CMakeLists.txt" diff --git a/kubernetes/CMakeLists.txt b/kubernetes/CMakeLists.txt
index 592c445..9f65ff8 100644
--- a/kubernetes/CMakeLists.txt
+++ b/kubernetes/CMakeLists.txt
@@ -1302,7 +1302,7 @@ include(PreTarget.cmake OPTIONAL)
set(PROJECT_VERSION_STRING "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")
# Add library with project file with project name as library name
-add_library(${pkgName} ${SRCS} ${HDRS})
+add_library(${pkgName} STATIC ${SRCS} ${HDRS})
# Link dependent libraries
if(NOT CMAKE_VERSION VERSION_LESS 3.4)
target_link_libraries(${pkgName} PRIVATE OpenSSL::SSL OpenSSL::Crypto) |
OK, that worked, I got a libkubernetes.a file now. Unfortunately, when I try to include it in a binary and build that one, I get:
I know, this is some special case because I try to include it in a Kotlin Native build. So far the native build works fine wit the shared object files, but I'd like to not rely on them because they are manually compiled. So, maybe I am just missing something. If this is something where you could point me to the right directions, I'd appreciate it. |
The error message shows that libkubernetes.a cannot obtain the dependency of libssl. |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues. This bot triages un-triaged issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
I am not too deep into C, but I would like to consume this API and integrate it as a static library (.a) instead of a shared object (.so). How to achieve this?
The text was updated successfully, but these errors were encountered: