Add ability to pass fuchsia api level to clang (#527)
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
index 37565ed..9b5899e 100644
--- a/build/config/compiler/BUILD.gn
+++ b/build/config/compiler/BUILD.gn
@@ -16,6 +16,7 @@
import("//build/config/c++/c++.gni")
import("//build/config/profiler.gni")
import("//build/config/sanitizers/sanitizers.gni")
+import("//build/fuchsia/config.gni")
import("//build/toolchain/ccache.gni")
import("//build/toolchain/clang.gni")
import("//build/toolchain/wasm.gni")
@@ -418,6 +419,14 @@
}
}
+ # Fuchsia-specific flags setup.
+ # -----------------------------
+ if (is_fuchsia) {
+ if (fuchsia_target_api_level != -1) {
+ cflags +=[ "-ffuchsia-api-level=${fuchsia_target_api_level}" ]
+ }
+ }
+
asmflags = cflags
}
diff --git a/build/fuchsia/config.gni b/build/fuchsia/config.gni
new file mode 100644
index 0000000..69c6aa3
--- /dev/null
+++ b/build/fuchsia/config.gni
@@ -0,0 +1,9 @@
+# Copyright 2013 The Flutter Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+declare_args() {
+ # The target API level for this repository. A value of -1
+ # means that no API level will be passed to the tools that consume it.
+ fuchsia_target_api_level = -1
+}