Meta: Add CodeGenerators and library dependencies for them to gn build

This commit is contained in:
Andrew Kaster 2023-05-05 12:25:53 -06:00 committed by Andrew Kaster
parent cbda1a6c73
commit 05f56e09b5
Notes: sideshowbarker 2024-07-18 05:37:06 +09:00
12 changed files with 218 additions and 1 deletions

View file

@ -1,7 +1,10 @@
import("//Meta/gn/build/toolchain/compiler.gni")
group("default") {
deps = [ "//Tests" ]
deps = [
"//Meta/Lagom/Tools/CodeGenerators/IPCCompiler",
"//Tests",
]
testonly = true
}

View file

@ -0,0 +1,6 @@
import("//Meta/Lagom/Tools/lagom_tool.gni")
lagom_tool("IPCCompiler") {
sources = [ "main.cpp" ]
deps = [ "//Userland/Libraries/LibMain" ]
}

View file

@ -0,0 +1,29 @@
import("//Meta/Lagom/Tools/lagom_tool.gni")
lagom_tool("GenerateDateTimeFormatData") {
sources = [ "GenerateDateTimeFormatData.cpp" ]
deps = [
"//Userland/Libraries/LibMain",
"//Userland/Libraries/LibTimeZone",
]
}
lagom_tool("GenerateLocaleData") {
sources = [ "GenerateLocaleData.cpp" ]
deps = [ "//Userland/Libraries/LibMain" ]
}
lagom_tool("GenerateNumberFormatData") {
sources = [ "GenerateNumberFormatData.cpp" ]
deps = [ "//Userland/Libraries/LibMain" ]
}
lagom_tool("GeneratePluralRulesData") {
sources = [ "GeneratePluralRulesData.cpp" ]
deps = [ "//Userland/Libraries/LibMain" ]
}
lagom_tool("GenerateRelativeTimeFormatData") {
sources = [ "GenerateRelativeTimeFormatData.cpp" ]
deps = [ "//Userland/Libraries/LibMain" ]
}

View file

@ -0,0 +1,6 @@
import("//Meta/Lagom/Tools/lagom_tool.gni")
lagom_tool("GenerateTimeZoneData") {
sources = [ "GenerateTimeZoneData.cpp" ]
deps = [ "//Userland/Libraries/LibMain" ]
}

View file

@ -0,0 +1,11 @@
import("//Meta/Lagom/Tools/lagom_tool.gni")
lagom_tool("GenerateUnicodeData") {
sources = [ "GenerateUnicodeData.cpp" ]
deps = [ "//Userland/Libraries/LibMain" ]
}
lagom_tool("GenerateEmojiData") {
sources = [ "GenerateEmojiData.cpp" ]
deps = [ "//Userland/Libraries/LibMain" ]
}

View file

@ -0,0 +1,62 @@
import("//Meta/Lagom/Tools/lagom_tool.gni")
source_set("headers") {
sources = [ "GeneratorUtil.h" ]
}
lagom_tool("GenerateAriaRoles") {
sources = [ "GenerateAriaRoles.cpp" ]
deps = [
":headers",
"//Userland/Libraries/LibMain",
]
}
lagom_tool("GenerateCSSEnums") {
sources = [ "GenerateCSSEnums.cpp" ]
deps = [
":headers",
"//Userland/Libraries/LibMain",
]
}
lagom_tool("GenerateCSSMediaFeatureID") {
sources = [ "GenerateCSSMediaFeatureID.cpp" ]
deps = [
":headers",
"//Userland/Libraries/LibMain",
]
}
lagom_tool("GenerateCSSPropertyID") {
sources = [ "GenerateCSSPropertyID.cpp" ]
deps = [
":headers",
"//Userland/Libraries/LibMain",
]
}
lagom_tool("GenerateCSSTransformFunctions") {
sources = [ "GenerateCSSTransformFunctions.cpp" ]
deps = [
":headers",
"//Userland/Libraries/LibMain",
]
}
lagom_tool("GenerateCSSValueID") {
sources = [ "GenerateCSSValueID.cpp" ]
deps = [
":headers",
"//Userland/Libraries/LibMain",
]
}
lagom_tool("GenerateWindowOrWorkerInterfaces") {
sources = [ "GenerateWindowOrWorkerInterfaces.cpp" ]
deps = [
":headers",
"//Userland/Libraries/LibIDL",
"//Userland/Libraries/LibMain",
]
}

View file

@ -0,0 +1,13 @@
import("//Meta/Lagom/Tools/lagom_tool.gni")
lagom_tool("BindingsGenerator") {
sources = [
"IDLGenerators.cpp",
"Namespaces.h",
"main.cpp",
]
deps = [
"//Userland/Libraries/LibIDL",
"//Userland/Libraries/LibMain",
]
}

View file

@ -0,0 +1,16 @@
template("lagom_tool") {
assert(current_toolchain == host_toolchain,
"Must only depend on Lagom tools from the host_toolchain")
executable(target_name) {
forward_variables_from(invoker, "*")
include_dirs = [
"//",
"$root_gen_dir",
"//Userland/Libraries",
]
deps += [
"//Userland/Libraries/LibCore",
"//Userland/Libraries/LibFileSystem",
]
}
}

View file

@ -0,0 +1,14 @@
shared_library("LibFileSystem") {
include_dirs = [ "//Userland/Libraries" ]
sources = [
"FileSystem.cpp",
"FileSystem.h",
"TempFile.cpp",
"TempFile.h",
]
deps = [
"//AK",
"//Userland/Libraries/LibCore",
]
output_name = "filesystem"
}

View file

@ -0,0 +1,26 @@
shared_library("LibIPC") {
output_name = "ipc"
include_dirs = [ "//Userland/Libraries" ]
sources = [
"Concepts.h",
"Connection.cpp",
"Connection.h",
"ConnectionFromClient.h",
"ConnectionToServer.h",
"Decoder.cpp",
"Decoder.h",
"Dictionary.h",
"Encoder.cpp",
"Encoder.h",
"File.h",
"Forward.h",
"Message.h",
"MultiServer.h",
"SingleServer.h",
"Stub.h",
]
deps = [
"//AK",
"//Userland/Libraries/LibCore",
]
}

View file

@ -0,0 +1,9 @@
static_library("LibMain") {
include_dirs = [ "//Userland/Libraries" ]
sources = [
"Main.cpp",
"Main.h",
]
deps = [ "//AK" ]
output_name = "main"
}

View file

@ -0,0 +1,22 @@
declare_args() {
# If true, Download tzdata from data.iana.org and use it in LibTimeZone
# Data will be downloaded to $cache_path/TZDB
enable_timezone_database_download = false
}
source_set("LibTimeZone") {
output_name = "timezone"
include_dirs = [ "//Userland/Libraries" ]
sources = [
"Forward.h",
"TimeZone.cpp",
"TimeZone.h",
]
deps = [
"//AK",
"//Userland/Libraries/LibCore",
]
if (enable_timezone_database_download) {
deps += [ ":timezone_data" ]
}
}