-
Notifications
You must be signed in to change notification settings - Fork 13
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
fix(cmake): Fix static build #348
base: master
Are you sure you want to change the base?
Conversation
86dc06c
to
7414afc
Compare
cmake/FindAudit.cmake
Outdated
if(Audit_USE_STATIC_LIBS) | ||
try_compile(BUILD_AUDIT | ||
SOURCES "${CMAKE_CURRENT_LIST_DIR}/test_static_audit.c" | ||
LINK_LIBRARIES ${Audit_STATIC_LIBRARIES} | ||
COMPILE_DEFINITIONS "-static") | ||
if(NOT BUILD_AUDIT) | ||
set(Audit_FOUND OFF CACHE INTERNAL "") | ||
endif() | ||
endif() | ||
add_library(Audit::Audit ALIAS PkgConfig::Audit) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you have to define your own target if static should be used. I'd assume PkgConfig::Audit always links the shared lib?
cmake/FindRadare.cmake
Outdated
if(Radare_USE_STATIC_LIBS) | ||
try_compile(BUILD_RADARE | ||
SOURCES "${CMAKE_CURRENT_LIST_DIR}/test_static_radare.c" | ||
LINK_LIBRARIES ${Radare_STATIC_LIBRARIES} | ||
COMPILE_DEFINITIONS "-static") | ||
if(NOT BUILD_RADARE) | ||
set(Radare_FOUND OFF CACHE INTERNAL "") | ||
endif() | ||
endif() | ||
add_library(Radare::Radare ALIAS PkgConfig::Radare) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as with the audit target. you likely need your own target to link against the static libs.
Some libraries were not correctly (or at all) checking for static variants if lo2s_USE_STATIC_LIBS was requested, so I fixed that.
7414afc
to
692eac9
Compare
Some libraries were not correctly (or at all) checking for static variants if lo2s_USE_STATIC_LIBS was requested, so I fixed that.