summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Kaster <akaster@serenityos.org>2021-08-08 01:31:23 -0600
committerLinus Groh <mail@linusgroh.de>2021-08-28 08:44:17 +0100
commit63956b36d06866b1d4660c2768a9c7eab0e182fb (patch)
treec5bd525d54d4b7e5476cbd4e194e2e130ecd7b69
parentfb15cdcc107adb13cb3c1cea831d36075d6b427b (diff)
downloadserenity-63956b36d06866b1d4660c2768a9c7eab0e182fb.zip
Everywhere: Move all host tools into the Lagom/Tools subdirectory
This allows us to remove all the add_subdirectory calls from the top level CMakeLists.txt that referred to targets linking LagomCore. Segregating the host tools and Serenity targets helps us get to a place where the main Serenity build can simply use a CMake toolchain file rather than swapping all the compiler/sysroot variables after building host libraries and tools.
-rw-r--r--CMakeLists.txt21
-rw-r--r--Meta/Lagom/CMakeLists.txt13
-rw-r--r--Meta/Lagom/Tools/CMakeLists.txt2
-rw-r--r--Meta/Lagom/Tools/CodeGenerators/CMakeLists.txt4
-rw-r--r--Meta/Lagom/Tools/CodeGenerators/IPCCompiler/CMakeLists.txt (renamed from Userland/DevTools/IPCCompiler/CMakeLists.txt)0
-rw-r--r--Meta/Lagom/Tools/CodeGenerators/IPCCompiler/main.cpp (renamed from Userland/DevTools/IPCCompiler/main.cpp)0
-rw-r--r--Meta/Lagom/Tools/CodeGenerators/LibUnicode/CMakeLists.txt (renamed from Userland/Libraries/LibUnicode/CodeGenerators/CMakeLists.txt)0
-rw-r--r--Meta/Lagom/Tools/CodeGenerators/LibUnicode/GenerateUnicodeData.cpp (renamed from Userland/Libraries/LibUnicode/CodeGenerators/GenerateUnicodeData.cpp)0
-rw-r--r--Meta/Lagom/Tools/CodeGenerators/LibUnicode/GenerateUnicodeLocale.cpp (renamed from Userland/Libraries/LibUnicode/CodeGenerators/GenerateUnicodeLocale.cpp)0
-rw-r--r--Meta/Lagom/Tools/CodeGenerators/LibWeb/CMakeLists.txt (renamed from Userland/Libraries/LibWeb/CodeGenerators/CMakeLists.txt)0
-rw-r--r--Meta/Lagom/Tools/CodeGenerators/LibWeb/Generate_CSS_PropertyID_cpp.cpp (renamed from Userland/Libraries/LibWeb/CodeGenerators/Generate_CSS_PropertyID_cpp.cpp)0
-rw-r--r--Meta/Lagom/Tools/CodeGenerators/LibWeb/Generate_CSS_PropertyID_h.cpp (renamed from Userland/Libraries/LibWeb/CodeGenerators/Generate_CSS_PropertyID_h.cpp)0
-rw-r--r--Meta/Lagom/Tools/CodeGenerators/LibWeb/Generate_CSS_ValueID_cpp.cpp (renamed from Userland/Libraries/LibWeb/CodeGenerators/Generate_CSS_ValueID_cpp.cpp)0
-rw-r--r--Meta/Lagom/Tools/CodeGenerators/LibWeb/Generate_CSS_ValueID_h.cpp (renamed from Userland/Libraries/LibWeb/CodeGenerators/Generate_CSS_ValueID_h.cpp)0
-rw-r--r--Meta/Lagom/Tools/CodeGenerators/LibWeb/WrapperGenerator.cpp (renamed from Userland/Libraries/LibWeb/CodeGenerators/WrapperGenerator.cpp)0
-rw-r--r--Meta/Lagom/Tools/CodeGenerators/StateMachineGenerator/CMakeLists.txt (renamed from Userland/DevTools/StateMachineGenerator/CMakeLists.txt)0
-rw-r--r--Meta/Lagom/Tools/CodeGenerators/StateMachineGenerator/main.cpp (renamed from Userland/DevTools/StateMachineGenerator/main.cpp)0
-rw-r--r--Meta/Lagom/Tools/ConfigureComponents/CMakeLists.txt (renamed from Meta/CMake/ConfigureComponents/CMakeLists.txt)0
-rw-r--r--Meta/Lagom/Tools/ConfigureComponents/main.cpp (renamed from Meta/CMake/ConfigureComponents/main.cpp)0
19 files changed, 18 insertions, 22 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index be81f3b081..06ff0cd525 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -45,8 +45,6 @@ option(BUILD_LAGOM "Build parts of the system targeting the host OS for fuzzing/
option(ENABLE_KERNEL_LTO "Build the kernel with link-time optimization" OFF)
option(USE_CLANG_TOOLCHAIN "Build the kernel with the experimental Clang toolchain" OFF)
-include(Meta/CMake/wasm_spec_tests.cmake)
-
add_custom_target(run
COMMAND "${CMAKE_COMMAND}" -E env "SERENITY_ARCH=${SERENITY_ARCH}" "${SerenityOS_SOURCE_DIR}/Meta/run.sh"
USES_TERMINAL
@@ -151,16 +149,6 @@ set(write_if_different ${CMAKE_SOURCE_DIR}/Meta/write-only-on-difference.sh)
add_subdirectory(Meta/Lagom)
-if (ENABLE_UNDEFINED_SANITIZER)
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=undefined")
-endif()
-
-add_subdirectory(Userland/DevTools/IPCCompiler)
-add_subdirectory(Userland/DevTools/StateMachineGenerator)
-add_subdirectory(Userland/Libraries/LibUnicode/CodeGenerators)
-add_subdirectory(Userland/Libraries/LibWeb/CodeGenerators)
-add_subdirectory(Meta/CMake/ConfigureComponents)
-
find_program(CCACHE_PROGRAM ccache)
if(CCACHE_PROGRAM)
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}")
@@ -318,6 +306,8 @@ endif()
add_link_options(--sysroot ${CMAKE_BINARY_DIR}/Root)
add_link_options(-Wno-unused-command-line-argument)
+include_directories(.)
+include_directories(Userland/Libraries)
include_directories(Userland/Libraries/LibC)
include_directories(Userland/Libraries/LibCrypt)
include_directories(Userland/Libraries/LibM)
@@ -332,13 +322,12 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR}/Userland)
# FIXME: vptr sanitizing requires.. intense ABI wrangling of std::type_info
# And would be better served by porting ubsan_type_hash_itanium.cpp from compiler-rt
-# We don't set this along with the original fsanitize=undefined because for host tools, we can rely on
-# the host's libubsan to provide the ABI-specific vptr type cache.
-# This is not a problem for the Kernel, because it does not have RTTI enabled :^)
if (ENABLE_UNDEFINED_SANITIZER)
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-sanitize=vptr")
+ 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)
diff --git a/Meta/Lagom/CMakeLists.txt b/Meta/Lagom/CMakeLists.txt
index 5797ce98d4..331e8928e4 100644
--- a/Meta/Lagom/CMakeLists.txt
+++ b/Meta/Lagom/CMakeLists.txt
@@ -220,6 +220,12 @@ if (NOT APPLE)
target_link_libraries(LagomCore crypt) # Core::Account uses crypt() but it's not in libcrypt on macOS
endif()
+# Code Generators and other host tools
+# We need to make sure not to build code generators for Fuzzer builds, as they already have their own main.cpp
+if (NOT ENABLE_OSS_FUZZ AND NOT ENABLE_FUZZER_SANITIZER)
+ add_subdirectory(Tools)
+endif()
+
if (BUILD_LAGOM)
# Lagom Libraries
@@ -364,13 +370,8 @@ if (BUILD_LAGOM)
)
# Unicode
- # We need to make sure not to build code generators for Fuzzer builds, as they already have their own main.cpp
+ # Don't include UnicodeData for Fuzzer builds, we didn't build the CodeGenerators
if (NOT ENABLE_OSS_FUZZ AND NOT ENABLE_FUZZER_SANITIZER)
- # FIXME: Make this logic smarter in 4594
- if (NOT CMAKE_SOURCE_DIR STREQUAL SERENITY_PROJECT_ROOT)
- set(write_if_different ${CMAKE_CURRENT_SOURCE_DIR}/../write-only-on-difference.sh)
- add_subdirectory(../../Userland/Libraries/LibUnicode/CodeGenerators ${CMAKE_CURRENT_BINARY_DIR}/LibUnicode/CodeGenerators)
- endif()
include(${SERENITY_PROJECT_ROOT}/Meta/CMake/unicode_data.cmake)
else()
set(ENABLE_UNICODE_DATABASE_DOWNLOAD OFF)
diff --git a/Meta/Lagom/Tools/CMakeLists.txt b/Meta/Lagom/Tools/CMakeLists.txt
new file mode 100644
index 0000000000..821c9baaa6
--- /dev/null
+++ b/Meta/Lagom/Tools/CMakeLists.txt
@@ -0,0 +1,2 @@
+add_subdirectory(ConfigureComponents)
+add_subdirectory(CodeGenerators)
diff --git a/Meta/Lagom/Tools/CodeGenerators/CMakeLists.txt b/Meta/Lagom/Tools/CodeGenerators/CMakeLists.txt
new file mode 100644
index 0000000000..f5b0b36493
--- /dev/null
+++ b/Meta/Lagom/Tools/CodeGenerators/CMakeLists.txt
@@ -0,0 +1,4 @@
+add_subdirectory(IPCCompiler)
+add_subdirectory(LibUnicode)
+add_subdirectory(LibWeb)
+add_subdirectory(StateMachineGenerator)
diff --git a/Userland/DevTools/IPCCompiler/CMakeLists.txt b/Meta/Lagom/Tools/CodeGenerators/IPCCompiler/CMakeLists.txt
index 6969cef777..6969cef777 100644
--- a/Userland/DevTools/IPCCompiler/CMakeLists.txt
+++ b/Meta/Lagom/Tools/CodeGenerators/IPCCompiler/CMakeLists.txt
diff --git a/Userland/DevTools/IPCCompiler/main.cpp b/Meta/Lagom/Tools/CodeGenerators/IPCCompiler/main.cpp
index 90f451e863..90f451e863 100644
--- a/Userland/DevTools/IPCCompiler/main.cpp
+++ b/Meta/Lagom/Tools/CodeGenerators/IPCCompiler/main.cpp
diff --git a/Userland/Libraries/LibUnicode/CodeGenerators/CMakeLists.txt b/Meta/Lagom/Tools/CodeGenerators/LibUnicode/CMakeLists.txt
index 5fa68e5674..5fa68e5674 100644
--- a/Userland/Libraries/LibUnicode/CodeGenerators/CMakeLists.txt
+++ b/Meta/Lagom/Tools/CodeGenerators/LibUnicode/CMakeLists.txt
diff --git a/Userland/Libraries/LibUnicode/CodeGenerators/GenerateUnicodeData.cpp b/Meta/Lagom/Tools/CodeGenerators/LibUnicode/GenerateUnicodeData.cpp
index 48b71862da..48b71862da 100644
--- a/Userland/Libraries/LibUnicode/CodeGenerators/GenerateUnicodeData.cpp
+++ b/Meta/Lagom/Tools/CodeGenerators/LibUnicode/GenerateUnicodeData.cpp
diff --git a/Userland/Libraries/LibUnicode/CodeGenerators/GenerateUnicodeLocale.cpp b/Meta/Lagom/Tools/CodeGenerators/LibUnicode/GenerateUnicodeLocale.cpp
index bfc53df940..bfc53df940 100644
--- a/Userland/Libraries/LibUnicode/CodeGenerators/GenerateUnicodeLocale.cpp
+++ b/Meta/Lagom/Tools/CodeGenerators/LibUnicode/GenerateUnicodeLocale.cpp
diff --git a/Userland/Libraries/LibWeb/CodeGenerators/CMakeLists.txt b/Meta/Lagom/Tools/CodeGenerators/LibWeb/CMakeLists.txt
index b3c4073df9..b3c4073df9 100644
--- a/Userland/Libraries/LibWeb/CodeGenerators/CMakeLists.txt
+++ b/Meta/Lagom/Tools/CodeGenerators/LibWeb/CMakeLists.txt
diff --git a/Userland/Libraries/LibWeb/CodeGenerators/Generate_CSS_PropertyID_cpp.cpp b/Meta/Lagom/Tools/CodeGenerators/LibWeb/Generate_CSS_PropertyID_cpp.cpp
index 9852fd57d9..9852fd57d9 100644
--- a/Userland/Libraries/LibWeb/CodeGenerators/Generate_CSS_PropertyID_cpp.cpp
+++ b/Meta/Lagom/Tools/CodeGenerators/LibWeb/Generate_CSS_PropertyID_cpp.cpp
diff --git a/Userland/Libraries/LibWeb/CodeGenerators/Generate_CSS_PropertyID_h.cpp b/Meta/Lagom/Tools/CodeGenerators/LibWeb/Generate_CSS_PropertyID_h.cpp
index 355d77b28f..355d77b28f 100644
--- a/Userland/Libraries/LibWeb/CodeGenerators/Generate_CSS_PropertyID_h.cpp
+++ b/Meta/Lagom/Tools/CodeGenerators/LibWeb/Generate_CSS_PropertyID_h.cpp
diff --git a/Userland/Libraries/LibWeb/CodeGenerators/Generate_CSS_ValueID_cpp.cpp b/Meta/Lagom/Tools/CodeGenerators/LibWeb/Generate_CSS_ValueID_cpp.cpp
index 15c81224df..15c81224df 100644
--- a/Userland/Libraries/LibWeb/CodeGenerators/Generate_CSS_ValueID_cpp.cpp
+++ b/Meta/Lagom/Tools/CodeGenerators/LibWeb/Generate_CSS_ValueID_cpp.cpp
diff --git a/Userland/Libraries/LibWeb/CodeGenerators/Generate_CSS_ValueID_h.cpp b/Meta/Lagom/Tools/CodeGenerators/LibWeb/Generate_CSS_ValueID_h.cpp
index 3c2488728e..3c2488728e 100644
--- a/Userland/Libraries/LibWeb/CodeGenerators/Generate_CSS_ValueID_h.cpp
+++ b/Meta/Lagom/Tools/CodeGenerators/LibWeb/Generate_CSS_ValueID_h.cpp
diff --git a/Userland/Libraries/LibWeb/CodeGenerators/WrapperGenerator.cpp b/Meta/Lagom/Tools/CodeGenerators/LibWeb/WrapperGenerator.cpp
index 436bf956be..436bf956be 100644
--- a/Userland/Libraries/LibWeb/CodeGenerators/WrapperGenerator.cpp
+++ b/Meta/Lagom/Tools/CodeGenerators/LibWeb/WrapperGenerator.cpp
diff --git a/Userland/DevTools/StateMachineGenerator/CMakeLists.txt b/Meta/Lagom/Tools/CodeGenerators/StateMachineGenerator/CMakeLists.txt
index b5e5da6c8d..b5e5da6c8d 100644
--- a/Userland/DevTools/StateMachineGenerator/CMakeLists.txt
+++ b/Meta/Lagom/Tools/CodeGenerators/StateMachineGenerator/CMakeLists.txt
diff --git a/Userland/DevTools/StateMachineGenerator/main.cpp b/Meta/Lagom/Tools/CodeGenerators/StateMachineGenerator/main.cpp
index 4e3a903990..4e3a903990 100644
--- a/Userland/DevTools/StateMachineGenerator/main.cpp
+++ b/Meta/Lagom/Tools/CodeGenerators/StateMachineGenerator/main.cpp
diff --git a/Meta/CMake/ConfigureComponents/CMakeLists.txt b/Meta/Lagom/Tools/ConfigureComponents/CMakeLists.txt
index acc15f9dde..acc15f9dde 100644
--- a/Meta/CMake/ConfigureComponents/CMakeLists.txt
+++ b/Meta/Lagom/Tools/ConfigureComponents/CMakeLists.txt
diff --git a/Meta/CMake/ConfigureComponents/main.cpp b/Meta/Lagom/Tools/ConfigureComponents/main.cpp
index 7f6949416d..7f6949416d 100644
--- a/Meta/CMake/ConfigureComponents/main.cpp
+++ b/Meta/Lagom/Tools/ConfigureComponents/main.cpp