Files
phs_v1.0.1.0/build/toolchain/mingw/BUILD.gn
2024-09-27 19:16:49 +08:00

58 lines
1.9 KiB
Plaintext
Executable File

# Copyright (c) 2021 Huawei Device Co., Ltd.
# 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.
import("//build/toolchain/gcc_toolchain.gni")
declare_args() {
# Whether unstripped binaries, i.e. compiled with debug symbols, should be
# considered runtime_deps rather than stripped ones.
mingw_unstripped_runtime_outputs = true
}
template("mingw_toolchain") {
gcc_toolchain(target_name) {
assert(defined(invoker.toolchain_root),
"toolchain_root must be defined for mingw_toolchain.")
assert(defined(invoker.toolchain_args),
"toolchain_args must be defined for mingw_toolchain.")
toolchain_args = invoker.toolchain_args
# Output linker map files for binary size analysis.
enable_linker_map = true
_mingw_tool_prefix =
rebase_path("${invoker.toolchain_root}/bin", root_build_dir)
cc = "${_mingw_tool_prefix}/clang"
cxx = "${_mingw_tool_prefix}/clang++"
ar = "${_mingw_tool_prefix}/llvm-ar"
ld = cxx
readelf = "${_mingw_tool_prefix}/llvm-readelf"
nm = "${_mingw_tool_prefix}/llvm-nm"
strip = "${_mingw_tool_prefix}/llvm-strip"
use_unstripped_as_runtime_outputs = mingw_unstripped_runtime_outputs
executable_extension = ".exe"
shlib_extension = ".dll"
}
}
mingw_toolchain("mingw_x86_64") {
toolchain_root = "//prebuilts/mingw-w64/ohos/linux-x86_64/clang-mingw"
toolchain_args = {
current_cpu = "x86_64"
current_os = "mingw"
use_custom_libcxx = false
is_clang = true
}
}