build_libc_as_static_library.patch 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
  2. From: VerteDinde <[email protected]>
  3. Date: Wed, 12 May 2021 13:19:19 -0700
  4. Subject: build_libc++_as_static_library
  5. Build libc++ as static library to compile and pass
  6. nan tests
  7. diff --git a/buildtools/third_party/libc++/BUILD.gn b/buildtools/third_party/libc++/BUILD.gn
  8. index 3ae561bd6627329ece5e29eda845c5dc61fcb77e..aa1ae438f9742808f775a13ff1bb37c33738e0bc 100644
  9. --- a/buildtools/third_party/libc++/BUILD.gn
  10. +++ b/buildtools/third_party/libc++/BUILD.gn
  11. @@ -192,7 +192,11 @@ libcxx_modules("std_wctype_h") {
  12. if (libcxx_is_shared) {
  13. _libcxx_target_type = "shared_library"
  14. } else {
  15. - _libcxx_target_type = "source_set"
  16. + if (is_win) {
  17. + _libcxx_target_type = "source_set"
  18. + } else {
  19. + _libcxx_target_type = "static_library"
  20. + }
  21. }
  22. target(_libcxx_target_type, "libc++") {
  23. @@ -201,6 +205,7 @@ target(_libcxx_target_type, "libc++") {
  24. # need to explicitly depend on libc++.
  25. visibility = [
  26. "//build/config:common_deps",
  27. + "//electron:libcxx_objects_zip",
  28. "//third_party/catapult/devil:devil",
  29. ]
  30. if (is_linux) {
  31. diff --git a/buildtools/third_party/libc++abi/BUILD.gn b/buildtools/third_party/libc++abi/BUILD.gn
  32. index 331ea447ea15e9f439396d4c7d41832de60adf4a..b96a994c43ac2ed0b0d5ec599f907ea0b501156e 100644
  33. --- a/buildtools/third_party/libc++abi/BUILD.gn
  34. +++ b/buildtools/third_party/libc++abi/BUILD.gn
  35. @@ -6,7 +6,7 @@ import("//build/config/android/config.gni")
  36. import("//build/config/c++/c++.gni")
  37. import("//build/config/unwind.gni")
  38. -source_set("libc++abi") {
  39. +static_library("libc++abi") {
  40. if (export_libcxxabi_from_executables) {
  41. visibility = [ "//build/config:executable_deps" ]
  42. } else {