mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-25 09:11:10 +00:00
because we should have a frozeon toolchain built with fedora38, and f38
provides cmake v3.27.4, we can assume the availability of cmake v3.27.4
when building scylla with the toolchain.
in this change, the minimum required CMake version is changed to
3.27.
this also allows us to simplify the implementation of
`add_whole_archive()`, and remove the buggy branch for supporting
CMake < 3.24, as we should have used `${name}` in place of `auth` there.
Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>
Closes scylladb/scylladb#15446
11 lines
526 B
CMake
11 lines
526 B
CMake
# add the whole archive, otherwise linker would drop the unreferenced symbols.
|
|
# we cannot mark variables with `__attribute__(used)`, as it only applies to
|
|
# functions. another option is to `-Wl,--undefined=<symbol>` to the compiler,
|
|
# but we would be pass a mangled symbol name, that'd be convoluted without
|
|
# actually compiling a sample program.
|
|
function(add_whole_archive name library)
|
|
add_library(${name} INTERFACE)
|
|
target_link_libraries(${name} INTERFACE
|
|
"$<LINK_LIBRARY:WHOLE_ARCHIVE,${library}>")
|
|
endfunction()
|