-
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
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.
7414afc
to
692eac9
Compare
cmake/FindRadare.cmake
Outdated
|
||
if(PkgConfig_FOUND) | ||
# Breaking API changes in 5.8.0 | ||
pkg_check_modules(Radare IMPORTED_TARGET r_main>=5.8.0) |
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.
692eac9
to
ece1956
Compare
Some libraries were not correctly (or at all) checking for static variants if lo2s_USE_STATIC_LIBS was requested, so I fixed that.
ece1956
to
2e52d3f
Compare
Some libraries were not correctly (or at all) checking for static variants if lo2s_USE_STATIC_LIBS was requested, so I fixed that.