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 448459ee94773786c9742eb16272b7c7c2078d7d..822a7e4e8cc7fd0d59c8c813c2108b369db6adac 100644
  9. --- a/buildtools/third_party/libc++/BUILD.gn
  10. +++ b/buildtools/third_party/libc++/BUILD.gn
  11. @@ -44,7 +44,11 @@ config("winver") {
  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. # Most things that need to depend on libc++ should do so via the implicit
  24. @@ -52,6 +56,7 @@ target(_libcxx_target_type, "libc++") {
  25. # need to explicitly depend on libc++.
  26. visibility = [
  27. "//build/config:common_deps",
  28. + "//electron:libcxx_objects_zip",
  29. "//third_party/catapult/devil:devil",
  30. ]
  31. if (is_linux) {
  32. diff --git a/buildtools/third_party/libc++abi/BUILD.gn b/buildtools/third_party/libc++abi/BUILD.gn
  33. index b5c15a0ead70604150a14820d8a829a5aa55f981..f1f984285e39192f5e1a8c5418c13915f5aa110a 100644
  34. --- a/buildtools/third_party/libc++abi/BUILD.gn
  35. +++ b/buildtools/third_party/libc++abi/BUILD.gn
  36. @@ -6,7 +6,7 @@ import("//build/config/android/config.gni")
  37. import("//build/config/c++/c++.gni")
  38. import("//build/config/unwind.gni")
  39. -source_set("libc++abi") {
  40. +static_library("libc++abi") {
  41. if (export_libcxxabi_from_executables) {
  42. visibility = [ "//build/config:executable_deps" ]
  43. } else {