From 1ca48a2aec0548f1aeb2392a03ebb10188a58ed8 Mon Sep 17 00:00:00 2001 From: Andrew Kaster Date: Thu, 13 Oct 2022 14:00:59 -0600 Subject: [PATCH] AK+Userland: Use a CMake variable for AK_SOURCES instead of GLOB This lets us remove a glob pattern from LibC, the DynamicLoader, and, later, Lagom. The Kernel already has its own separate list of AK files that it wants, which is only a subset of all AK files. --- AK/CMakeLists.txt | 32 ++++++++++++++++++++++++++ Userland/DynamicLoader/CMakeLists.txt | 1 - Userland/Libraries/LibC/CMakeLists.txt | 1 - 3 files changed, 32 insertions(+), 2 deletions(-) diff --git a/AK/CMakeLists.txt b/AK/CMakeLists.txt index 5fc9dcd20e..1561148626 100644 --- a/AK/CMakeLists.txt +++ b/AK/CMakeLists.txt @@ -1,2 +1,34 @@ +set(AK_SOURCES + Assertions.cpp + Base64.cpp + FlyString.cpp + Format.cpp + FuzzyMatch.cpp + GenericLexer.cpp + Hex.cpp + JsonParser.cpp + JsonPath.cpp + JsonValue.cpp + kmalloc.cpp + LexicalPath.cpp + Random.cpp + StackInfo.cpp + String.cpp + StringBuilder.cpp + StringImpl.cpp + StringUtils.cpp + StringView.cpp + Time.cpp + URL.cpp + URLParser.cpp + Utf16View.cpp + Utf8View.cpp + UUID.cpp +) +# AK sources are included from many different places, such as the Kernel, LibC, and Loader +list(TRANSFORM AK_SOURCES PREPEND "${CMAKE_CURRENT_SOURCE_DIR}/") + +set(AK_SOURCES ${AK_SOURCES} PARENT_SCOPE) + serenity_install_headers(AK) serenity_install_sources(AK) diff --git a/Userland/DynamicLoader/CMakeLists.txt b/Userland/DynamicLoader/CMakeLists.txt index 7505bf5148..7369f03541 100644 --- a/Userland/DynamicLoader/CMakeLists.txt +++ b/Userland/DynamicLoader/CMakeLists.txt @@ -3,7 +3,6 @@ set(LOADER_SOURCES misc.cpp ) -file(GLOB AK_SOURCES "../../AK/*.cpp") file(GLOB ELF_SOURCES "../Libraries/LibELF/*.cpp") file(GLOB LIBC_SOURCES1 "../Libraries/LibC/*.cpp") file(GLOB LIBC_SOURCES2 "../Libraries/LibC/*/*.cpp") diff --git a/Userland/Libraries/LibC/CMakeLists.txt b/Userland/Libraries/LibC/CMakeLists.txt index 201cc622ce..97d76aaee5 100644 --- a/Userland/Libraries/LibC/CMakeLists.txt +++ b/Userland/Libraries/LibC/CMakeLists.txt @@ -76,7 +76,6 @@ set(LIBC_SOURCES wstdio.cpp ) -file(GLOB AK_SOURCES CONFIGURE_DEPENDS "../../../AK/*.cpp") file(GLOB ELF_SOURCES CONFIGURE_DEPENDS "../LibELF/*.cpp") if ("${SERENITY_ARCH}" STREQUAL "aarch64")