diff options
author | Linus Groh <mail@linusgroh.de> | 2020-06-21 17:59:26 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-06-21 20:24:28 +0200 |
commit | 4684e9a80fccdbc182174cc663463eb4fb5cd326 (patch) | |
tree | 9b761c6c9c7bec1b0a643c6f1b930fe673db6634 /CMakeLists.txt | |
parent | dd7cd92de4f5dbe94d1aaca36ea3cc0a3befd580 (diff) | |
download | serenity-4684e9a80fccdbc182174cc663463eb4fb5cd326.zip |
Build: Support GENERATED_SOURCES in serenity_{bin,libc}() as well
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 6ef9c16dc4..2238ca6e41 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -59,11 +59,7 @@ function(serenity_install_headers target_name) endforeach() endfunction() -function(serenity_lib target_name fs_name) - serenity_install_headers(${target_name}) - add_library(${target_name} ${SOURCES} ${GENERATED_SOURCES}) - install(TARGETS ${target_name} ARCHIVE DESTINATION usr/lib) - set_target_properties(${target_name} PROPERTIES OUTPUT_NAME ${fs_name}) +function(serenity_generated_sources target_name) if(DEFINED GENERATED_SOURCES) set_source_files_properties(${GENERATED_SOURCES} PROPERTIES GENERATED 1) foreach(generated ${GENERATED_SOURCES}) @@ -73,17 +69,27 @@ function(serenity_lib target_name fs_name) endif() endfunction() +function(serenity_lib target_name fs_name) + serenity_install_headers(${target_name}) + add_library(${target_name} ${SOURCES} ${GENERATED_SOURCES}) + install(TARGETS ${target_name} ARCHIVE DESTINATION usr/lib) + set_target_properties(${target_name} PROPERTIES OUTPUT_NAME ${fs_name}) + serenity_generated_sources(${target_name}) +endfunction() + function(serenity_libc target_name fs_name) serenity_install_headers("") add_library(${target_name} ${SOURCES}) install(TARGETS ${target_name} ARCHIVE DESTINATION usr/lib) set_target_properties(${target_name} PROPERTIES OUTPUT_NAME ${fs_name}) target_link_directories(LibC PUBLIC ${CMAKE_CURRENT_BINARY_DIR}) + serenity_generated_sources(${target_name}) endfunction() function(serenity_bin target_name) add_executable(${target_name} ${SOURCES}) install(TARGETS ${target_name} RUNTIME DESTINATION bin) + serenity_generated_sources(${target_name}) endfunction() function(compile_ipc source output) |