Meta: Add Meta/CMake to the CMAKE_MODULE_PATH for Serenity and Lagom

This makes it so we don't need to specify the full path to all the
helper scripts we include() from different places in the codebase and
feels a lot cleaner.
This commit is contained in:
Andrew Kaster 2021-09-07 01:50:09 -06:00 committed by Ali Mohammad Pur
parent a269a32a17
commit 6e7cc40b18
Notes: sideshowbarker 2024-07-18 04:38:32 +09:00
3 changed files with 12 additions and 8 deletions

View File

@ -1,4 +1,7 @@
cmake_minimum_required(VERSION 3.16)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/Meta/CMake")
project(SerenityOS C CXX ASM)
if(NOT "${CMAKE_BUILD_TYPE}" STREQUAL "")
@ -141,7 +144,7 @@ if (ENABLE_ALL_DEBUG_FACILITIES)
endif()
if (ENABLE_ALL_THE_DEBUG_MACROS)
include("${SerenityOS_SOURCE_DIR}/Meta/CMake/all_the_debug_macros.cmake")
include(all_the_debug_macros)
endif(ENABLE_ALL_THE_DEBUG_MACROS)
configure_file(AK/Debug.h.in AK/Debug.h @ONLY)
@ -335,12 +338,11 @@ if (ENABLE_UNDEFINED_SANITIZER)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=undefined -fno-sanitize=vptr")
endif()
include(Meta/CMake/wasm_spec_tests.cmake)
add_custom_target(components ALL)
option(BUILD_EVERYTHING "Build all optional components" ON)
include(Meta/CMake/utils.cmake)
include(utils)
include(wasm_spec_tests)
serenity_component(
Tests

View File

@ -24,6 +24,8 @@ get_filename_component(
ABSOLUTE CACHE
)
list(APPEND CMAKE_MODULE_PATH "${SERENITY_PROJECT_ROOT}/Meta/CMake")
find_package(Threads REQUIRED)
if (ENABLE_LAGOM_CCACHE)
@ -33,7 +35,7 @@ if (ENABLE_LAGOM_CCACHE)
endif()
endif()
include(${SERENITY_PROJECT_ROOT}/Meta/CMake/wasm_spec_tests.cmake)
include(wasm_spec_tests)
add_compile_options(-Wno-unknown-warning-option -Wno-literal-suffix -Wno-deprecated-copy)
add_compile_options(-O2)
@ -378,7 +380,7 @@ if (BUILD_LAGOM)
# Unicode
# Don't include UnicodeData for Fuzzer builds, we didn't build the CodeGenerators
if (NOT ENABLE_OSS_FUZZ AND NOT ENABLE_FUZZER_SANITIZER)
include(${SERENITY_PROJECT_ROOT}/Meta/CMake/unicode_data.cmake)
include(unicode_data)
else()
set(ENABLE_UNICODE_DATABASE_DOWNLOAD OFF)
endif()
@ -519,7 +521,7 @@ if (BUILD_LAGOM)
set_tests_properties(JS PROPERTIES ENVIRONMENT SERENITY_SOURCE_DIR=${SERENITY_PROJECT_ROOT})
# Markdown
include(${SERENITY_PROJECT_ROOT}/Meta/CMake/commonmark_spec.cmake)
include(commonmark_spec)
file(GLOB LIBMARKDOWN_TEST_SOURCES CONFIGURE_DEPENDS "../../Tests/LibMarkdown/*.cpp")
foreach(source ${LIBMARKDOWN_TEST_SOURCES})
lagom_test(${source} LIBS LagomMarkdown)

View File

@ -1,4 +1,4 @@
include(${SERENITY_PROJECT_ROOT}/Meta/CMake/commonmark_spec.cmake)
include(commonmark_spec)
set(TEST_SOURCES
TestCommonmark.cpp