mirror of
https://github.com/SerenityOS/serenity
synced 2024-09-06 17:06:31 +00:00
Meta: Allow specifying the library type when invoking serenity_lib()
This will allow creating object libraries with this function.
This commit is contained in:
parent
c8febe5169
commit
d1e2d2a4df
|
@ -53,9 +53,15 @@ endfunction()
|
|||
|
||||
if (NOT COMMAND serenity_lib)
|
||||
function(serenity_lib target_name fs_name)
|
||||
cmake_parse_arguments(PARSE_ARGV 2 SERENITY_LIB "" "TYPE" "")
|
||||
|
||||
if ("${SERENITY_LIB_TYPE}" STREQUAL "")
|
||||
set(SERENITY_LIB_TYPE SHARED)
|
||||
endif()
|
||||
|
||||
serenity_install_headers(${target_name})
|
||||
serenity_install_sources()
|
||||
add_library(${target_name} SHARED ${SOURCES} ${GENERATED_SOURCES})
|
||||
add_library(${target_name} ${SERENITY_LIB_TYPE} ${SOURCES} ${GENERATED_SOURCES})
|
||||
set_target_properties(${target_name} PROPERTIES EXCLUDE_FROM_ALL TRUE)
|
||||
set_target_properties(${target_name} PROPERTIES VERSION "serenity")
|
||||
install(TARGETS ${target_name} DESTINATION ${CMAKE_INSTALL_LIBDIR} OPTIONAL)
|
||||
|
|
|
@ -306,7 +306,13 @@ function(serenity_bin name)
|
|||
endfunction()
|
||||
|
||||
function(serenity_lib name fs_name)
|
||||
lagom_lib(${name} ${fs_name} SOURCES ${SOURCES} ${GENERATED_SOURCES})
|
||||
cmake_parse_arguments(PARSE_ARGV 2 SERENITY_LIB "" "TYPE" "")
|
||||
|
||||
if ("${SERENITY_LIB_TYPE}" STREQUAL "")
|
||||
set(SERENITY_LIB_TYPE SHARED)
|
||||
endif()
|
||||
|
||||
lagom_lib(${name} ${fs_name} LIBRARY_TYPE ${SERENITY_LIB_TYPE} SOURCES ${SOURCES} ${GENERATED_SOURCES})
|
||||
endfunction()
|
||||
|
||||
function(serenity_lib_static name fs_name)
|
||||
|
|
Loading…
Reference in a new issue