Procházet zdrojové kódy

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

Andrew Kaster před 2 roky
rodič
revize
05f56e09b5

+ 4 - 1
Meta/gn/secondary/BUILD.gn

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

+ 6 - 0
Meta/gn/secondary/Meta/Lagom/Tools/CodeGenerators/IPCCompiler/BUILD.gn

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

+ 29 - 0
Meta/gn/secondary/Meta/Lagom/Tools/CodeGenerators/LibLocale/BUILD.gn

@@ -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" ]
+}

+ 6 - 0
Meta/gn/secondary/Meta/Lagom/Tools/CodeGenerators/LibTimeZone/BUILD.gn

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

+ 11 - 0
Meta/gn/secondary/Meta/Lagom/Tools/CodeGenerators/LibUnicode/BUILD.gn

@@ -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" ]
+}

+ 62 - 0
Meta/gn/secondary/Meta/Lagom/Tools/CodeGenerators/LibWeb/BUILD.gn

@@ -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",
+  ]
+}

+ 13 - 0
Meta/gn/secondary/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/BUILD.gn

@@ -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",
+  ]
+}

+ 16 - 0
Meta/gn/secondary/Meta/Lagom/Tools/lagom_tool.gni

@@ -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",
+    ]
+  }
+}

+ 14 - 0
Meta/gn/secondary/Userland/Libraries/LibFileSystem/BUILD.gn

@@ -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"
+}

+ 26 - 0
Meta/gn/secondary/Userland/Libraries/LibIPC/BUILD.gn

@@ -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",
+  ]
+}

+ 9 - 0
Meta/gn/secondary/Userland/Libraries/LibMain/BUILD.gn

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

+ 22 - 0
Meta/gn/secondary/Userland/Libraries/LibTimeZone/BUILD.gn

@@ -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" ]
+  }
+}