mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +00:00
Meta: Guard everything that installs headers with an option
This commit is contained in:
committed by
Andrew Kaster
parent
ffc03eb25a
commit
cf6929fef3
@@ -78,10 +78,12 @@ if (APPLE)
|
||||
target_link_libraries(ladybird PRIVATE LibThreading)
|
||||
endif()
|
||||
|
||||
if (ENABLE_INSTALL_HEADERS)
|
||||
target_sources(ladybird PUBLIC FILE_SET ladybird TYPE HEADERS
|
||||
BASE_DIRS ${LADYBIRD_SOURCE_DIR}
|
||||
FILES ${LADYBIRD_HEADERS}
|
||||
)
|
||||
endif()
|
||||
|
||||
if (TARGET ladybird_impl)
|
||||
set(LADYBIRD_TARGET ladybird_impl PUBLIC)
|
||||
|
||||
@@ -41,6 +41,8 @@ function(compile_ipc source output)
|
||||
add_dependencies(all_generated generate_${output_name})
|
||||
|
||||
cmake_path(RELATIVE_PATH CMAKE_CURRENT_SOURCE_DIR BASE_DIRECTORY ${SerenityOS_SOURCE_DIR} OUTPUT_VARIABLE current_source_dir_relative)
|
||||
if (ENABLE_INSTALL_HEADERS)
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${output} DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/${current_source_dir_relative}" OPTIONAL)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
|
||||
@@ -35,3 +35,5 @@ serenity_option(ENABLE_CLANG_PLUGINS_INVALID_FUNCTION_MEMBERS OFF CACHE BOOL "En
|
||||
|
||||
serenity_option(ENABLE_GUI_TARGETS ON CACHE BOOL "Enable building GUI targets")
|
||||
serenity_option(ENABLE_SWIFT OFF CACHE BOOL "Enable building Swift files")
|
||||
|
||||
serenity_option(ENABLE_INSTALL_HEADERS ON CACHE BOOL "Enable installing headers")
|
||||
|
||||
@@ -11,5 +11,7 @@ function (generate_encoding_indexes)
|
||||
arguments -j "${LIBTEXTCODEC_INPUT_FOLDER}/indexes.json"
|
||||
)
|
||||
|
||||
if (ENABLE_INSTALL_HEADERS)
|
||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/LookupTables.h" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/LibTextCodec/")
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
@@ -96,6 +96,7 @@ function (generate_css_implementation)
|
||||
NAMESPACE "Web::CSS"
|
||||
)
|
||||
|
||||
if (ENABLE_INSTALL_HEADERS)
|
||||
set(CSS_GENERATED_TO_INSTALL
|
||||
"CSS/Enums.h"
|
||||
"CSS/MathFunctions.h"
|
||||
@@ -107,6 +108,7 @@ function (generate_css_implementation)
|
||||
)
|
||||
list(TRANSFORM CSS_GENERATED_TO_INSTALL PREPEND "${CMAKE_CURRENT_BINARY_DIR}/")
|
||||
install(FILES ${CSS_GENERATED_TO_INSTALL} DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/LibWeb/CSS")
|
||||
endif()
|
||||
|
||||
endfunction()
|
||||
|
||||
@@ -173,9 +175,11 @@ function (generate_js_bindings target)
|
||||
add_dependencies(all_generated generate_${basename})
|
||||
add_dependencies(${target} generate_${basename})
|
||||
|
||||
if (ENABLE_INSTALL_HEADERS)
|
||||
# install generated sources
|
||||
list(FILTER BINDINGS_SOURCES INCLUDE REGEX "\.h$")
|
||||
install(FILES ${BINDINGS_SOURCES} DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/LibWeb/Bindings")
|
||||
endif()
|
||||
|
||||
list(APPEND LIBWEB_ALL_IDL_FILES "${LIBWEB_INPUT_FOLDER}/${class}.idl")
|
||||
set(LIBWEB_ALL_IDL_FILES ${LIBWEB_ALL_IDL_FILES} PARENT_SCOPE)
|
||||
@@ -208,9 +212,11 @@ function (generate_js_bindings target)
|
||||
add_dependencies(all_generated generate_exposed_interfaces)
|
||||
add_dependencies(${target} generate_exposed_interfaces)
|
||||
|
||||
if (ENABLE_INSTALL_HEADERS)
|
||||
list(FILTER exposed_interface_sources INCLUDE REGEX "\.h$")
|
||||
list(TRANSFORM exposed_interface_sources PREPEND "${CMAKE_CURRENT_BINARY_DIR}/")
|
||||
install(FILES ${exposed_interface_sources} DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/LibWeb/Bindings")
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
include("idl_files.cmake")
|
||||
|
||||
@@ -228,12 +228,15 @@ function(lagom_lib target_name fs_name)
|
||||
endif()
|
||||
|
||||
# FIXME: Clean these up so that we don't need so many include dirs
|
||||
if (ENABLE_INSTALL_HEADERS)
|
||||
target_include_directories(${target_name} INTERFACE
|
||||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/Services>
|
||||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/Userland/Libraries>
|
||||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/Userland/Services>
|
||||
)
|
||||
endif()
|
||||
add_lagom_library_install_rules(${target_name} ALIAS_NAME ${library})
|
||||
if (ENABLE_INSTALL_HEADERS)
|
||||
# FIXME: Move this to serenity_install_headers
|
||||
install(
|
||||
DIRECTORY "${SERENITY_PROJECT_ROOT}/Userland/Libraries/Lib${library}"
|
||||
@@ -241,6 +244,7 @@ function(lagom_lib target_name fs_name)
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
||||
FILES_MATCHING PATTERN "*.h"
|
||||
)
|
||||
endif()
|
||||
serenity_generated_sources(${target_name})
|
||||
endfunction()
|
||||
|
||||
@@ -347,6 +351,7 @@ add_serenity_subdirectory(Userland/Libraries/LibFileSystem)
|
||||
add_serenity_subdirectory(Userland/Libraries/LibIDL)
|
||||
|
||||
# Manually install AK headers
|
||||
if (ENABLE_INSTALL_HEADERS)
|
||||
install(
|
||||
DIRECTORY "${SERENITY_PROJECT_ROOT}/AK"
|
||||
COMPONENT Lagom_Development
|
||||
@@ -359,6 +364,7 @@ install(FILES
|
||||
COMPONENT Lagom_Development
|
||||
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/AK"
|
||||
)
|
||||
endif()
|
||||
|
||||
# Code Generators and other host tools
|
||||
if (BUILD_LAGOM_TOOLS)
|
||||
|
||||
@@ -83,8 +83,10 @@ add_custom_target(generate_tiff_files_handler DEPENDS ${generated_sources})
|
||||
add_dependencies(all_generated generate_tiff_files_handler)
|
||||
add_dependencies(LibGfx generate_tiff_files_handler)
|
||||
|
||||
if (ENABLE_INSTALL_HEADERS)
|
||||
list(TRANSFORM generated_sources PREPEND "${CMAKE_CURRENT_BINARY_DIR}/")
|
||||
install(FILES ${generated_sources} DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/LibGfx/ImageFormats")
|
||||
endif()
|
||||
|
||||
# Third-party
|
||||
find_package(PkgConfig)
|
||||
|
||||
@@ -55,6 +55,7 @@ target_compile_definitions(LibWebView PRIVATE ENABLE_PUBLIC_SUFFIX=$<BOOL:${ENAB
|
||||
find_package(SQLite3 REQUIRED)
|
||||
target_link_libraries(LibWebView PRIVATE SQLite::SQLite3)
|
||||
|
||||
if (ENABLE_INSTALL_HEADERS)
|
||||
foreach(header ${GENERATED_SOURCES})
|
||||
get_filename_component(extension ${header} EXT)
|
||||
if (NOT "${extension}" STREQUAL ".h")
|
||||
@@ -68,3 +69,4 @@ foreach(header ${GENERATED_SOURCES})
|
||||
endforeach()
|
||||
|
||||
install(FILES "${SERENITY_PROJECT_ROOT}/Userland/Services/RequestServer/ConnectionCache.h" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/RequestServer")
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user