# Copyright (c) Huawei Technologies Co., Ltd. 2023. All rights reserved. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. is_win = false is_linux = false is_mac = false is_protoc = false is_mingw = false with_libunwind = false is_sdkdemo = false is_sdkdemo_test = false is_spb = false target_cpu = "x64" declare_args() { ar = "ar" is_debug = true use_wasm = false wasm_use_thread = false is_test = false is_sdkdemo = false is_sdkdemo_test = false testonly = false is_fuzz = false is_mac = false is_spb = false target = "trace_streamer" } if (target_os == "linux") { is_linux = true } else if (target_os == "macx") { is_mac = true } else if (target_os == "windows") { is_win = true is_mingw = true } else { print("unknown platform " + target_os) exit(-1) } if (target == "wasm") { use_wasm = true } else if (target == "test") { is_test = true testonly = true } else if (target == "fuzz") { is_fuzz = true testonly = true } else if (target == "protoc") { is_protoc = true } else if (target == "sdkdemo") { is_sdkdemo = true use_wasm = true } else if (target == "sdkdemotest") { is_sdkdemo_test = true testonly = true } else if (target == "trace_streamer" || target == "streamer") { print("build " + target) } else if (target == "spb") { is_linux = true is_spb = true } else { print("unknown target " + target_os) exit(-1) } trace_cfg_path = "//gn:trace_cfg" print("platform " + target_os) default_configs = [ "//gn:symbols", "//gn:default", trace_cfg_path, ] hiperf_default_configs = [ "//gn:symbols", "//gn:default", "//gn:hiperf_trace_cfg", ] if (!is_debug) { default_configs -= [ "//gn:symbols" ] default_configs += [ "//gn:release" ] hiperf_default_configs -= [ "//gn:symbols" ] hiperf_default_configs += [ "//gn:release" ] } set_defaults("static_library") { configs = default_configs } set_defaults("ohos_source_set") { configs = default_configs } set_defaults("ohos_shared_library") { configs = default_configs } set_defaults("executable") { configs = default_configs configs += [ "//gn:executable" ] } if (use_wasm) { set_default_toolchain("//gn/toolchain:wasm") } else { set_default_toolchain("//gn/toolchain:gcc_like") }