diff options
author | Jo-Philipp Wich <jo@mein.io> | 2020-09-02 22:22:45 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2020-09-02 22:28:56 +0200 |
commit | 26f152e73eb02c6afdb98e6f7228d0a30ee973f3 (patch) | |
tree | e4737757d02f16d02355ab1b5b690bc737c2b17a /CMakeLists.txt | |
parent | 2bce10151bace89d6ed38475da816f469b73418d (diff) |
eval, lib: add loadable module infrastructure
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 1a79f04..01ed810 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,6 +4,11 @@ include(CheckFunctionExists) PROJECT(utpl C) ADD_DEFINITIONS(-Os -Wall -Werror --std=gnu99 -Wmissing-declarations -Wno-error=unused-variable -ffunction-sections -D_GNU_SOURCE) +OPTION(FS_SUPPORT "Filesystem plugin support" ON) + +SET(LIB_SEARCH_PATH "/usr/lib/utpl/*.so:/usr/share/utpl/*.utpl:./*.so:./*.utpl" CACHE STRING "Default library search path") +ADD_DEFINITIONS(-DLIB_SEARCH_PATH="${LIB_SEARCH_PATH}") + IF(NOT APPLE) SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "-Wl,--gc-sections") ENDIF() @@ -47,4 +52,11 @@ IF (NOT CEIL_FUNCTION_EXISTS) TARGET_LINK_LIBRARIES(utpl m) ENDIF() +CHECK_FUNCTION_EXISTS(dlopen DLOPEN_FUNCTION_EXISTS) +IF (NOT DLOPEN_FUNCTION_EXISTS) + TARGET_LINK_LIBRARIES(utpl dl) +ENDIF() + +SET(LIBRARIES "") + INSTALL(TARGETS utpl RUNTIME DESTINATION bin) |