From 4684e9a80fccdbc182174cc663463eb4fb5cd326 Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Sun, 21 Jun 2020 17:59:26 +0100 Subject: Build: Support GENERATED_SOURCES in serenity_{bin,libc}() as well --- CMakeLists.txt | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'CMakeLists.txt') 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) -- cgit v1.2.3