From ac15c1cc01e362042498c51395f7007c04ff4ff0 Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Fri, 31 May 2024 10:44:00 -0400 Subject: [PATCH] Meta: Port recent changes to the GN build 2ce61fe6ea9edffae051c90e6d2563c9fe52fec3 --- .../CodeGenerators/LibTextCodec/BUILD.gn | 6 ++++ .../Userland/Libraries/LibTextCodec/BUILD.gn | 28 ++++++++++++++++++- 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 Meta/gn/secondary/Meta/Lagom/Tools/CodeGenerators/LibTextCodec/BUILD.gn diff --git a/Meta/gn/secondary/Meta/Lagom/Tools/CodeGenerators/LibTextCodec/BUILD.gn b/Meta/gn/secondary/Meta/Lagom/Tools/CodeGenerators/LibTextCodec/BUILD.gn new file mode 100644 index 0000000000..23a79e2666 --- /dev/null +++ b/Meta/gn/secondary/Meta/Lagom/Tools/CodeGenerators/LibTextCodec/BUILD.gn @@ -0,0 +1,6 @@ +import("//Meta/Lagom/Tools/lagom_tool.gni") + +lagom_tool("GenerateEncodingIndexes") { + sources = [ "GenerateEncodingIndexes.cpp" ] + deps = [ "//Userland/Libraries/LibMain" ] +} diff --git a/Meta/gn/secondary/Userland/Libraries/LibTextCodec/BUILD.gn b/Meta/gn/secondary/Userland/Libraries/LibTextCodec/BUILD.gn index 728a6fe993..b8a2d4dfe5 100644 --- a/Meta/gn/secondary/Userland/Libraries/LibTextCodec/BUILD.gn +++ b/Meta/gn/secondary/Userland/Libraries/LibTextCodec/BUILD.gn @@ -1,9 +1,35 @@ +import("//Meta/gn/build/compiled_action.gni") + +compiled_action("generate_encoding_indexes") { + tool = + "//Meta/Lagom/Tools/CodeGenerators/LibTextCodec:GenerateEncodingIndexes" + + outputs = [ + "$target_gen_dir/LookupTables.h", + "$target_gen_dir/LookupTables.cpp", + ] + + args = [ + "-h", + rebase_path(outputs[0], root_build_dir), + "-c", + rebase_path(outputs[1], root_build_dir), + "-j", + rebase_path("//Userland/Libraries/LibTextCodec/indexes.json"), + ] +} + shared_library("LibTextCodec") { output_name = "textcodec" - include_dirs = [ "//Userland/Libraries" ] + include_dirs = [ + "//Userland/Libraries", + "$target_gen_dir/..", + ] deps = [ + ":generate_encoding_indexes", "//AK", "//Userland/Libraries/LibUnicode", ] sources = [ "Decoder.cpp" ] + sources += get_target_outputs(":generate_encoding_indexes") }