-
Notifications
You must be signed in to change notification settings - Fork 173
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
192 additions
and
5 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
diff --git a/config/BUILDCONFIG.gn b/config/BUILDCONFIG.gn | ||
index fcc7e1283..a6e65682d 100644 | ||
--- a/config/BUILDCONFIG.gn | ||
+++ b/config/BUILDCONFIG.gn | ||
@@ -262,6 +262,8 @@ if (target_os == "android") { | ||
_default_toolchain = "//build/toolchain/aix:$target_cpu" | ||
} else if (target_os == "zos") { | ||
_default_toolchain = "//build/toolchain/zos:$target_cpu" | ||
+} else if (target_cpu == "wasm") { | ||
+ _default_toolchain = "//build/toolchain/wasm:emscripten" | ||
} else { | ||
assert(false, "Unsupported target_os: $target_os") | ||
} | ||
@@ -300,9 +302,10 @@ is_linux = current_os == "linux" | ||
is_mac = current_os == "mac" | ||
is_nacl = current_os == "nacl" | ||
is_win = current_os == "win" || current_os == "winuwp" | ||
+is_wasm = current_os == "wasm" | ||
|
||
is_apple = is_ios || is_mac | ||
-is_posix = !is_win && !is_fuchsia | ||
+is_posix = !is_win && !is_fuchsia && !is_wasm | ||
|
||
# ============================================================================= | ||
# TARGET DEFAULTS | ||
@@ -377,7 +380,6 @@ if (is_android) { | ||
|
||
if (is_clang && !is_nacl) { | ||
default_compiler_configs += [ | ||
- "//build/config/clang:find_bad_constructs", | ||
"//build/config/clang:extra_warnings", | ||
] | ||
} | ||
diff --git a/config/compiler/BUILD.gn b/config/compiler/BUILD.gn | ||
index 10937225b..5fed442e4 100644 | ||
--- a/config/compiler/BUILD.gn | ||
+++ b/config/compiler/BUILD.gn | ||
@@ -287,6 +287,8 @@ config("compiler") { | ||
configs += [ "//build/config/aix:compiler" ] | ||
} else if (current_os == "zos") { | ||
configs += [ "//build/config/zos:compiler" ] | ||
+ } else if (current_os == "wasm") { | ||
+ configs += [ "//build/config/wasm:compiler" ] | ||
} | ||
|
||
configs += [ | ||
diff --git a/config/compiler/compiler.gni b/config/compiler/compiler.gni | ||
index 8e7bdd8f0..124dbd963 100644 | ||
--- a/config/compiler/compiler.gni | ||
+++ b/config/compiler/compiler.gni | ||
@@ -221,7 +221,7 @@ declare_args() { | ||
# (which lld doesn't support either). | ||
# The default linker everywhere else. | ||
use_lld = is_clang && !(is_mac && is_gpu_fyi_bot) && current_os != "zos" && | ||
- !(is_ios && (is_cronet_build || target_environment == "catalyst")) | ||
+ !(is_ios && (is_cronet_build || target_environment == "catalyst")) && !is_wasm | ||
} | ||
|
||
declare_args() { | ||
diff --git a/toolchain/toolchain.gni b/toolchain/toolchain.gni | ||
index 9874c7a12..59f84c36f 100644 | ||
--- a/toolchain/toolchain.gni | ||
+++ b/toolchain/toolchain.gni | ||
@@ -52,6 +52,8 @@ if (is_apple) { | ||
shlib_extension = ".so" | ||
} else if (is_win) { | ||
shlib_extension = ".dll" | ||
+} if (is_wasm) { | ||
+ shlib_extension = ".so" | ||
} else { | ||
assert(false, "Platform not supported") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
config("compiler") { | ||
defines = [ | ||
# Enable fseeko() and ftello() (required by libopenjpeg20) | ||
# https://github.com/emscripten-core/emscripten/issues/4932 | ||
"_POSIX_C_SOURCE=200112", | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
diff --git a/core/fxcrt/BUILD.gn b/core/fxcrt/BUILD.gn | ||
index ffa1b60..92224c5 100644 | ||
--- a/core/fxcrt/BUILD.gn | ||
+++ b/core/fxcrt/BUILD.gn | ||
@@ -125,7 +125,7 @@ source_set("fxcrt") { | ||
"//third_party/icu:icuuc", | ||
] | ||
|
||
- if (is_posix || is_fuchsia) { | ||
+ if (is_posix || is_fuchsia || is_wasm) { | ||
sources += [ | ||
"cfx_fileaccess_posix.cpp", | ||
"cfx_fileaccess_posix.h", | ||
diff --git a/core/fxge/BUILD.gn b/core/fxge/BUILD.gn | ||
index 7dafd7d..6d1fff9 100644 | ||
--- a/core/fxge/BUILD.gn | ||
+++ b/core/fxge/BUILD.gn | ||
@@ -162,7 +162,7 @@ source_set("fxge") { | ||
] | ||
} | ||
|
||
- if (is_linux || is_chromeos) { | ||
+ if (is_linux || is_chromeos || is_wasm) { | ||
sources += [ "linux/fx_linux_impl.cpp" ] | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import("//build/toolchain/gcc_toolchain.gni") | ||
|
||
gcc_toolchain("emscripten") { | ||
cc = "emcc" | ||
cxx = "em++" | ||
|
||
readelf = "llvm-readobj" | ||
ar = "emar" | ||
ld = cxx | ||
nm = "emnm" | ||
|
||
toolchain_args = { | ||
current_cpu = "wasm" | ||
current_os = "wasm" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters