xref: /build/config/mingw/BUILD.gn (revision 5f9996aa)
15f9996aaSopenharmony_ci# Copyright (c) 2021 Huawei Device Co., Ltd.
25f9996aaSopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License");
35f9996aaSopenharmony_ci# you may not use this file except in compliance with the License.
45f9996aaSopenharmony_ci# You may obtain a copy of the License at
55f9996aaSopenharmony_ci#
65f9996aaSopenharmony_ci#     http://www.apache.org/licenses/LICENSE-2.0
75f9996aaSopenharmony_ci#
85f9996aaSopenharmony_ci# Unless required by applicable law or agreed to in writing, software
95f9996aaSopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS,
105f9996aaSopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
115f9996aaSopenharmony_ci# See the License for the specific language governing permissions and
125f9996aaSopenharmony_ci# limitations under the License.
135f9996aaSopenharmony_ci
145f9996aaSopenharmony_ciassert(is_mingw)
155f9996aaSopenharmony_ci
165f9996aaSopenharmony_ciconfig("compiler") {
175f9996aaSopenharmony_ci  _target = [
185f9996aaSopenharmony_ci    "-target",
195f9996aaSopenharmony_ci    "x86_64-pc-windows-gnu",
205f9996aaSopenharmony_ci  ]
215f9996aaSopenharmony_ci
225f9996aaSopenharmony_ci  _mingw_flags = [
235f9996aaSopenharmony_ci    "-static",
245f9996aaSopenharmony_ci    "-rtlib=compiler-rt",
255f9996aaSopenharmony_ci    "-stdlib=libc++",
265f9996aaSopenharmony_ci    "-lunwind",
275f9996aaSopenharmony_ci    "-lpthread",
285f9996aaSopenharmony_ci    "-Qunused-arguments",
295f9996aaSopenharmony_ci  ]
305f9996aaSopenharmony_ci
315f9996aaSopenharmony_ci  cflags = _target
325f9996aaSopenharmony_ci  asmflags = _target
335f9996aaSopenharmony_ci  ldflags = _target
345f9996aaSopenharmony_ci
355f9996aaSopenharmony_ci  cflags += _mingw_flags
365f9996aaSopenharmony_ci  asmflags += _mingw_flags
375f9996aaSopenharmony_ci  ldflags += _mingw_flags
385f9996aaSopenharmony_ci
395f9996aaSopenharmony_ci  cflags += [ "-fuse-ld=lld" ]
405f9996aaSopenharmony_ci
415f9996aaSopenharmony_ci  ldflags += [ "-fuse-ld=lld" ]
425f9996aaSopenharmony_ci
435f9996aaSopenharmony_ci  cflags += [ "-D__CUSTOM_SECURITY_LIBRARY" ]
445f9996aaSopenharmony_ci}
45