Meta: Port recent changes to gn BUILD

5c7e5cc738
a8f0fa5dd4
0d417cd604
5b87d26027
 (and other friends from the JIT PR)
f915aa70cd
This commit is contained in:
Andrew Kaster 2023-10-27 14:26:41 -06:00 committed by Andrew Kaster
parent d8ab9ed87c
commit faa8ef98c9
Notes: sideshowbarker 2024-07-17 23:00:03 +09:00
12 changed files with 146 additions and 63 deletions

View file

@ -4,7 +4,7 @@ import("//Ladybird/moc_qt_objects.gni")
group("Ladybird") { group("Ladybird") {
if (current_os == "mac") { if (current_os == "mac") {
deps = [ ":ladybird.app" ] deps = [ ":Ladybird.app" ]
} else { } else {
deps = [ ":ladybird_executable" ] deps = [ ":ladybird_executable" ]
} }
@ -54,6 +54,7 @@ executable("ladybird_executable") {
] ]
data_deps = [ data_deps = [
":headless-browser", ":headless-browser",
"ImageDecoder",
"RequestServer", "RequestServer",
"SQLServer", "SQLServer",
"WebContent", "WebContent",
@ -69,10 +70,10 @@ executable("ladybird_executable") {
"//Userland/Libraries/LibGUI", "//Userland/Libraries/LibGUI",
"//Userland/Libraries/LibGfx", "//Userland/Libraries/LibGfx",
"//Userland/Libraries/LibIPC", "//Userland/Libraries/LibIPC",
"//Userland/Libraries/LibImageDecoderClient",
"//Userland/Libraries/LibJS", "//Userland/Libraries/LibJS",
"//Userland/Libraries/LibMain", "//Userland/Libraries/LibMain",
"//Userland/Libraries/LibProtocol", "//Userland/Libraries/LibProtocol",
"//Userland/Libraries/LibPublicSuffix",
"//Userland/Libraries/LibSQL", "//Userland/Libraries/LibSQL",
"//Userland/Libraries/LibWeb", "//Userland/Libraries/LibWeb",
"//Userland/Libraries/LibWebView", "//Userland/Libraries/LibWebView",
@ -113,6 +114,7 @@ executable("headless-browser") {
"//Userland/Libraries/LibGfx", "//Userland/Libraries/LibGfx",
"//Userland/Libraries/LibHTTP", "//Userland/Libraries/LibHTTP",
"//Userland/Libraries/LibIPC", "//Userland/Libraries/LibIPC",
"//Userland/Libraries/LibImageDecoderClient",
"//Userland/Libraries/LibJS", "//Userland/Libraries/LibJS",
"//Userland/Libraries/LibMain", "//Userland/Libraries/LibMain",
"//Userland/Libraries/LibProtocol", "//Userland/Libraries/LibProtocol",
@ -139,6 +141,7 @@ if (current_os == "mac") {
public_deps = [ public_deps = [
":headless-browser", ":headless-browser",
":ladybird_executable", ":ladybird_executable",
"ImageDecoder",
"RequestServer", "RequestServer",
"SQLServer", "SQLServer",
"WebContent", "WebContent",
@ -146,6 +149,7 @@ if (current_os == "mac") {
"WebSocket", "WebSocket",
] ]
sources = [ sources = [
"$root_out_dir/bin/ImageDecoder",
"$root_out_dir/bin/Ladybird", "$root_out_dir/bin/Ladybird",
"$root_out_dir/bin/RequestServer", "$root_out_dir/bin/RequestServer",
"$root_out_dir/bin/SQLServer", "$root_out_dir/bin/SQLServer",
@ -174,11 +178,12 @@ if (current_os == "mac") {
"//Userland/Libraries/LibHTTP", "//Userland/Libraries/LibHTTP",
"//Userland/Libraries/LibIDL", "//Userland/Libraries/LibIDL",
"//Userland/Libraries/LibIPC", "//Userland/Libraries/LibIPC",
"//Userland/Libraries/LibImageDecoderClient",
"//Userland/Libraries/LibJIT",
"//Userland/Libraries/LibJS", "//Userland/Libraries/LibJS",
"//Userland/Libraries/LibLine", "//Userland/Libraries/LibLine",
"//Userland/Libraries/LibMarkdown", "//Userland/Libraries/LibMarkdown",
"//Userland/Libraries/LibProtocol", "//Userland/Libraries/LibProtocol",
"//Userland/Libraries/LibPublicSuffix",
"//Userland/Libraries/LibRegex", "//Userland/Libraries/LibRegex",
"//Userland/Libraries/LibSQL", "//Userland/Libraries/LibSQL",
"//Userland/Libraries/LibSoftGPU", "//Userland/Libraries/LibSoftGPU",
@ -208,12 +213,13 @@ if (current_os == "mac") {
"$root_out_dir/lib/liblagom-gui.dylib", "$root_out_dir/lib/liblagom-gui.dylib",
"$root_out_dir/lib/liblagom-http.dylib", "$root_out_dir/lib/liblagom-http.dylib",
"$root_out_dir/lib/liblagom-idl.dylib", "$root_out_dir/lib/liblagom-idl.dylib",
"$root_out_dir/lib/liblagom-imagedecoderclient.dylib",
"$root_out_dir/lib/liblagom-ipc.dylib", "$root_out_dir/lib/liblagom-ipc.dylib",
"$root_out_dir/lib/liblagom-jit.dylib",
"$root_out_dir/lib/liblagom-js.dylib", "$root_out_dir/lib/liblagom-js.dylib",
"$root_out_dir/lib/liblagom-line.dylib", "$root_out_dir/lib/liblagom-line.dylib",
"$root_out_dir/lib/liblagom-markdown.dylib", "$root_out_dir/lib/liblagom-markdown.dylib",
"$root_out_dir/lib/liblagom-protocol.dylib", "$root_out_dir/lib/liblagom-protocol.dylib",
"$root_out_dir/lib/liblagom-publicsuffix.dylib",
"$root_out_dir/lib/liblagom-regex.dylib", "$root_out_dir/lib/liblagom-regex.dylib",
"$root_out_dir/lib/liblagom-softgpu.dylib", "$root_out_dir/lib/liblagom-softgpu.dylib",
"$root_out_dir/lib/liblagom-sql.dylib", "$root_out_dir/lib/liblagom-sql.dylib",

View file

@ -0,0 +1,19 @@
executable("ImageDecoder") {
configs += [ "//Ladybird:ladybird_config" ]
include_dirs = [
"//Userland/Libraries",
"//Userland/Services",
]
deps = [
"//AK",
"//Userland/Libraries/LibCore",
"//Userland/Libraries/LibGfx",
"//Userland/Libraries/LibIPC",
"//Userland/Libraries/LibImageDecoderClient",
"//Userland/Libraries/LibMain",
]
sources = [
"//Userland/Services/ImageDecoder/ConnectionFromClient.cpp",
"main.cpp",
]
}

View file

@ -36,6 +36,7 @@ executable("WebContent") {
"//Userland/Libraries/LibFileSystem", "//Userland/Libraries/LibFileSystem",
"//Userland/Libraries/LibGfx", "//Userland/Libraries/LibGfx",
"//Userland/Libraries/LibIPC", "//Userland/Libraries/LibIPC",
"//Userland/Libraries/LibImageDecoderClient",
"//Userland/Libraries/LibJS", "//Userland/Libraries/LibJS",
"//Userland/Libraries/LibMain", "//Userland/Libraries/LibMain",
"//Userland/Libraries/LibProtocol", "//Userland/Libraries/LibProtocol",

View file

@ -52,6 +52,9 @@ source_set("sources") {
"ProcessStatisticsReader.h", "ProcessStatisticsReader.h",
"Promise.h", "Promise.h",
"Proxy.h", "Proxy.h",
"Resource.cpp",
"ResourceImplementation.cpp",
"ResourceImplementationFile.cpp",
"SOCKSProxyClient.cpp", "SOCKSProxyClient.cpp",
"SOCKSProxyClient.h", "SOCKSProxyClient.h",
"SecretString.cpp", "SecretString.cpp",

View file

@ -0,0 +1,43 @@
import("//Meta/gn/build/compiled_action.gni")
compiled_action("ImageDecoderClientEndpoint") {
tool = "//Meta/Lagom/Tools/CodeGenerators/IPCCompiler"
inputs = [ "//Userland/Services/ImageDecoder/ImageDecoderClient.ipc" ]
outputs = [ "$root_gen_dir/ImageDecoder/ImageDecoderClientEndpoint.h" ]
args = [
rebase_path(inputs[0], root_build_dir),
"-o",
rebase_path(outputs[0], root_build_dir),
]
}
compiled_action("ImageDecoderServerEndpoint") {
tool = "//Meta/Lagom/Tools/CodeGenerators/IPCCompiler"
inputs = [ "//Userland/Services/ImageDecoder/ImageDecoderServer.ipc" ]
outputs = [ "$root_gen_dir/ImageDecoder/ImageDecoderServerEndpoint.h" ]
args = [
rebase_path(inputs[0], root_build_dir),
"-o",
rebase_path(outputs[0], root_build_dir),
]
}
shared_library("LibImageDecoderClient") {
output_name = "imagedecoderclient"
include_dirs = [
"//Userland/Libraries",
"//Userland/Services",
"//Userland/",
]
deps = [
":ImageDecoderClientEndpoint",
":ImageDecoderServerEndpoint",
"//AK",
"//Userland/Libraries/LibCore",
"//Userland/Libraries/LibGfx",
"//Userland/Libraries/LibIPC",
]
sources = [ "Client.cpp" ]
sources += get_target_outputs(":ImageDecoderClientEndpoint") +
get_target_outputs(":ImageDecoderServerEndpoint")
}

View file

@ -0,0 +1,12 @@
shared_library("LibJIT") {
output_name = "jit"
include_dirs = [ "//Userland/Libraries" ]
sources = [
"Assembler.cpp",
"Assembler.h",
]
deps = [
"//AK",
"//Userland/Libraries/LibCore",
]
}

View file

@ -11,6 +11,7 @@ shared_library("LibJS") {
"//Userland/Libraries/LibCore", "//Userland/Libraries/LibCore",
"//Userland/Libraries/LibCrypto", "//Userland/Libraries/LibCrypto",
"//Userland/Libraries/LibFileSystem", "//Userland/Libraries/LibFileSystem",
"//Userland/Libraries/LibJIT",
"//Userland/Libraries/LibLocale", "//Userland/Libraries/LibLocale",
"//Userland/Libraries/LibRegex", "//Userland/Libraries/LibRegex",
"//Userland/Libraries/LibSyntax", "//Userland/Libraries/LibSyntax",
@ -21,6 +22,7 @@ shared_library("LibJS") {
"Bytecode/ASTCodegen.cpp", "Bytecode/ASTCodegen.cpp",
"Bytecode/BasicBlock.cpp", "Bytecode/BasicBlock.cpp",
"Bytecode/CodeGenerationError.cpp", "Bytecode/CodeGenerationError.cpp",
"Bytecode/CommonImplementations.cpp",
"Bytecode/Executable.cpp", "Bytecode/Executable.cpp",
"Bytecode/Generator.cpp", "Bytecode/Generator.cpp",
"Bytecode/IdentifierTable.cpp", "Bytecode/IdentifierTable.cpp",
@ -41,6 +43,8 @@ shared_library("LibJS") {
"Heap/Heap.cpp", "Heap/Heap.cpp",
"Heap/HeapBlock.cpp", "Heap/HeapBlock.cpp",
"Heap/MarkedVector.cpp", "Heap/MarkedVector.cpp",
"JIT/Compiler.cpp",
"JIT/NativeExecutable.cpp",
"Lexer.cpp", "Lexer.cpp",
"MarkupGenerator.cpp", "MarkupGenerator.cpp",
"Module.cpp", "Module.cpp",

View file

@ -1,59 +0,0 @@
import("//Meta/gn/build/compiled_action.gni")
import("//Meta/gn/build/download_cache.gni")
import("//Meta/gn/build/download_file.gni")
declare_args() {
# If true, Download public suffix list from GitHub.
# Data will be downloaded to $cache_path/PublicSuffix and used by LibPublicSuffix
enable_public_suffix_list_download = true
}
public_suffix_cache = cache_path + "PublicSuffix/"
if (enable_public_suffix_list_download) {
download_file("public_suffix_list_download") {
version = "master"
url = "https://raw.githubusercontent.com/publicsuffix/list/" + version +
"/public_suffix_list.dat"
output = "$public_suffix_cache/public_suffix_list.dat"
version_file = public_suffix_cache + "version.txt"
}
compiled_action("generate_public_suffix_list_sources") {
tool = "//Meta/Lagom/Tools/CodeGenerators/LibPublicSuffix:GeneratePublicSuffixData"
deps = [ ":public_suffix_list_download" ]
outputs = [
"$target_gen_dir/PublicSuffixData.h",
"$target_gen_dir/PublicSuffixData.cpp",
]
args = [
"-h",
rebase_path(outputs[0], root_build_dir),
"-c",
rebase_path(outputs[1], root_build_dir),
"-p",
rebase_path("$public_suffix_cache/public_suffix_list.dat",
root_build_dir),
]
}
}
shared_library("LibPublicSuffix") {
output_name = "publicsuffix"
include_dirs = [
"//Userland/Libraries",
"$target_gen_dir/..",
]
sources = [ "URL.cpp" ]
deps = [
"//AK",
"//Userland/Libraries/LibCore",
]
if (enable_public_suffix_list_download) {
deps += [ ":generate_public_suffix_list_sources" ]
sources += get_target_outputs(":generate_public_suffix_list_sources")
defines = [ "ENABLE_PUBLIC_SUFFIX_DOWNLOAD=1" ]
} else {
defines = [ "ENABLE_PUBLIC_SUFFIX_DOWNLOAD=0" ]
}
}

View file

@ -59,6 +59,7 @@ source_set("CSS") {
"Supports.cpp", "Supports.cpp",
"SystemColor.cpp", "SystemColor.cpp",
"Time.cpp", "Time.cpp",
"Transformation.cpp",
"VisualViewport.cpp", "VisualViewport.cpp",
] ]
} }

View file

@ -8,6 +8,7 @@ source_set("Painting") {
"AudioPaintable.cpp", "AudioPaintable.cpp",
"BackgroundPainting.cpp", "BackgroundPainting.cpp",
"BorderPainting.cpp", "BorderPainting.cpp",
"BorderRadiiData.cpp",
"BorderRadiusCornerClipper.cpp", "BorderRadiusCornerClipper.cpp",
"ButtonPaintable.cpp", "ButtonPaintable.cpp",
"CanvasPaintable.cpp", "CanvasPaintable.cpp",
@ -23,8 +24,10 @@ source_set("Painting") {
"PaintContext.cpp", "PaintContext.cpp",
"Paintable.cpp", "Paintable.cpp",
"PaintableBox.cpp", "PaintableBox.cpp",
"PaintingCommandExecutorCPU.cpp",
"ProgressPaintable.cpp", "ProgressPaintable.cpp",
"RadioButtonPaintable.cpp", "RadioButtonPaintable.cpp",
"RecordingPainter.cpp",
"SVGGeometryPaintable.cpp", "SVGGeometryPaintable.cpp",
"SVGGraphicsPaintable.cpp", "SVGGraphicsPaintable.cpp",
"SVGPaintable.cpp", "SVGPaintable.cpp",

View file

@ -1,6 +1,45 @@
import("//Meta/gn/build/compiled_action.gni") import("//Meta/gn/build/compiled_action.gni")
import("//Meta/gn/build/download_cache.gni")
import("//Meta/gn/build/download_file.gni")
import("//Meta/gn/build/embed_as_string_view.gni") import("//Meta/gn/build/embed_as_string_view.gni")
declare_args() {
# If true, Download public suffix list from GitHub.
# Data will be downloaded to $cache_path/PublicSuffix and used by LibPublicSuffix
enable_public_suffix_list_download = true
}
public_suffix_cache = cache_path + "PublicSuffix/"
if (enable_public_suffix_list_download) {
download_file("public_suffix_list_download") {
version = "master"
url = "https://raw.githubusercontent.com/publicsuffix/list/" + version +
"/public_suffix_list.dat"
output = "$public_suffix_cache/public_suffix_list.dat"
version_file = public_suffix_cache + "version.txt"
}
compiled_action("generate_public_suffix_list_sources") {
tool =
"//Meta/Lagom/Tools/CodeGenerators/LibWebView:GeneratePublicSuffixData"
deps = [ ":public_suffix_list_download" ]
outputs = [
"$target_gen_dir/PublicSuffixData.h",
"$target_gen_dir/PublicSuffixData.cpp",
]
args = [
"-h",
rebase_path(outputs[0], root_build_dir),
"-c",
rebase_path(outputs[1], root_build_dir),
"-p",
rebase_path("$public_suffix_cache/public_suffix_list.dat",
root_build_dir),
]
}
}
compiled_action("WebContentClientEndpoint") { compiled_action("WebContentClientEndpoint") {
tool = "//Meta/Lagom/Tools/CodeGenerators/IPCCompiler" tool = "//Meta/Lagom/Tools/CodeGenerators/IPCCompiler"
inputs = [ "//Userland/Services/WebContent/WebContentClient.ipc" ] inputs = [ "//Userland/Services/WebContent/WebContentClient.ipc" ]
@ -58,6 +97,7 @@ shared_library("LibWebView") {
"//Userland/Libraries", "//Userland/Libraries",
"//Userland/Services", "//Userland/Services",
"//Userland/", "//Userland/",
"$target_gen_dir/..",
] ]
deps = [ deps = [
":WebContentClientEndpoint", ":WebContentClientEndpoint",
@ -67,6 +107,7 @@ shared_library("LibWebView") {
":generate_native_stylesheet_source", ":generate_native_stylesheet_source",
"//AK", "//AK",
"//Userland/Libraries/LibCore", "//Userland/Libraries/LibCore",
"//Userland/Libraries/LibFileSystem",
"//Userland/Libraries/LibGUI", "//Userland/Libraries/LibGUI",
"//Userland/Libraries/LibGfx", "//Userland/Libraries/LibGfx",
"//Userland/Libraries/LibIPC", "//Userland/Libraries/LibIPC",
@ -83,8 +124,10 @@ shared_library("LibWebView") {
"Database.cpp", "Database.cpp",
"History.cpp", "History.cpp",
"RequestServerAdapter.cpp", "RequestServerAdapter.cpp",
"SearchEngine.cpp",
"SourceHighlighter.cpp", "SourceHighlighter.cpp",
"StylePropertiesModel.cpp", "StylePropertiesModel.cpp",
"URL.cpp",
"UserAgent.cpp", "UserAgent.cpp",
"ViewImplementation.cpp", "ViewImplementation.cpp",
"WebContentClient.cpp", "WebContentClient.cpp",
@ -95,4 +138,11 @@ shared_library("LibWebView") {
get_target_outputs(":WebDriverClientEndpoint") + get_target_outputs(":WebDriverClientEndpoint") +
get_target_outputs(":WebDriverServerEndpoint") + get_target_outputs(":WebDriverServerEndpoint") +
get_target_outputs(":generate_native_stylesheet_source") get_target_outputs(":generate_native_stylesheet_source")
if (enable_public_suffix_list_download) {
deps += [ ":generate_public_suffix_list_sources" ]
sources += get_target_outputs(":generate_public_suffix_list_sources")
defines = [ "ENABLE_PUBLIC_SUFFIX=1" ]
} else {
defines = [ "ENABLE_PUBLIC_SUFFIX=0" ]
}
} }