From 8a7bdfd356140ddff9e4d812399a4d9495e92993 Mon Sep 17 00:00:00 2001 From: yFeii <1486662452@qq.com> Date: Tue, 25 Jun 2024 17:02:11 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=20mac=20=E9=9D=99?= =?UTF-8?q?=E6=80=81=E5=BA=93=E7=BC=96=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BUILD.gn | 2 +- BUILDCONFIG.gn | 5 ++++- toolchain/BUILD.gn | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/BUILD.gn b/BUILD.gn index 73034e5..4064b28 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -660,7 +660,7 @@ source_set("hermes_inspector") { source_set("napi_hermes_source_set") { cflags_cc = ["-std=c++14", "-fvisibility=hidden", "-Wno-unused-parameter", "-Wno-extra-semi", "-Wno-gnu-zero-variadic-macro-arguments", "-Wno-gnu-anonymous-struct", "-Wno-c99-extensions", "-Wno-nested-anon-types"] if(build_ios){ - cflags_cc += ["-Wno-deprecated-copy"] + cflags_cc += ["-Wno-deprecated-copy", "-Wno-unused-but-set-variable"] } configs = [":llvm_build", ":hermes_build", ":strict_build", ":napi_build", ":react_native_common_build", ":jsi_hermes_build", ":rtti_build"] sources = [ diff --git a/BUILDCONFIG.gn b/BUILDCONFIG.gn index 6e06bb2..46d80f4 100644 --- a/BUILDCONFIG.gn +++ b/BUILDCONFIG.gn @@ -21,10 +21,13 @@ declare_args() { asan = false ubsan = false - # iOS 交叉编译,否则编译 macOS 版本 + # iOS 交叉编译,否则编译 macOS 版本(不会产生静态库) build_ios = false # 和 -apple-ios9.0 拼接,作为 -target 参数 + # build_mac 和 build_ios 配合,编译 mac 版本静态库 + build_mac = false + # QuickJS 专属 big_number = false } diff --git a/toolchain/BUILD.gn b/toolchain/BUILD.gn index b8c6bea..cd036c6 100644 --- a/toolchain/BUILD.gn +++ b/toolchain/BUILD.gn @@ -98,7 +98,7 @@ toolchain("clang") { if (code_coverage) { compiler_command = string_join(" ", ["-fprofile-instr-generate -fcoverage-mapping", compiler_command]) } - if (build_ios) { + if (build_ios && !build_mac) { target_option = "-target $cross_compile_target-apple-ios9.0" if (cross_compile_target == "i386" || cross_compile_target == "x86_64") { target_option = string_join("-", [target_option, "simulator"])