Skip to content
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

add_plugin: Add parameter for system libraries #2519

Open
mweisgut opened this issue Nov 21, 2022 · 0 comments
Open

add_plugin: Add parameter for system libraries #2519

mweisgut opened this issue Nov 21, 2022 · 0 comments
Labels

Comments

@mweisgut
Copy link
Collaborator

In src/plugins/CMakeLists.txt, we can pass source files and libraries as SRCS and DEPS, respectively, to the add_plugin function.

function(add_plugin)
cmake_parse_arguments(
PARSED_ARGS
""
"NAME"
"SRCS;DEPS"
${ARGN}
)
if(NOT PARSED_ARGS_NAME)
message(FATAL_ERROR "You must provide a name for the plugin")
endif(NOT PARSED_ARGS_NAME)
add_library(${PARSED_ARGS_NAME} SHARED ${PARSED_ARGS_SRCS})
target_link_libraries_system(
${PARSED_ARGS_NAME}
tbb
${BOOST_LIBS}
)
foreach(dep ${PARSED_ARGS_DEPS})
target_link_libraries(${PARSED_ARGS_NAME} PRIVATE ${dep})
endforeach(dep)
# Prevent the linker under macOS from complaining about undefined methods
if (APPLE)
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
target_link_libraries(${PARSED_ARGS_NAME} PRIVATE "-undefined dynamic_lookup")
endif()
endif()
endfunction(add_plugin)
add_plugin(NAME hyriseMvccDeletePlugin SRCS mvcc_delete_plugin.cpp mvcc_delete_plugin.hpp DEPS sqlparser magic_enum gtest)
add_plugin(NAME hyriseSecondTestPlugin SRCS second_test_plugin.cpp second_test_plugin.hpp DEPS sqlparser)
add_plugin(NAME hyriseTestPlugin SRCS test_plugin.cpp test_plugin.hpp DEPS sqlparser)
add_plugin(NAME hyriseTestNonInstantiablePlugin SRCS non_instantiable_plugin.cpp)
add_plugin(NAME hyriseUccDiscoveryPlugin SRCS ucc_discovery_plugin.cpp ucc_discovery_plugin.hpp DEPS sqlparser magic_enum compact_vector)

However, the function lacks a parameter to pass libraries that are to be linked as system libraries, i.e., via target_link_libraries_system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant