-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create intermediate cobalt toolchain for native linker modular builds (…
…#1516) b/294450490 Make an intermediate cobalt toolchain template which can be used for native linker modular builds. (cherry picked from commit e8a8ca6)
- Loading branch information
1 parent
188d1a0
commit c84d12d
Showing
5 changed files
with
67 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# Copyright 2023 The Cobalt Authors. 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. | ||
|
||
import("//build/config/win/visual_studio_version.gni") | ||
import("//build/toolchain/gcc_toolchain.gni") | ||
|
||
template("cobalt_clang_toolchain") { | ||
gcc_toolchain(target_name) { | ||
forward_variables_from(invoker.variables, | ||
[ | ||
"native_linker_path", | ||
"executable_extension", | ||
"shlib_extension", | ||
]) | ||
assert(defined(native_linker_path), | ||
"native_linker_path has to be defined by the platform") | ||
if (!is_host_win) { | ||
prefix = rebase_path("$clang_base_path/bin", root_build_dir) | ||
cc = "$prefix/clang" | ||
cxx = "$prefix/clang++" | ||
ld = native_linker_path | ||
readelf = "readelf" | ||
ar = "${prefix}/llvm-ar" | ||
nm = "nm" | ||
} else { | ||
prefix = llvm_clang_path | ||
cc = "$prefix/clang.exe" | ||
cxx = "$prefix/clang++.exe" | ||
ld = native_linker_path | ||
readelf = "$prefix/llvm-readobj.exe" | ||
ar = "${prefix}/llvm-ar.exe" | ||
nm = "${prefix}/llvm-nm.exe" | ||
} | ||
toolchain_args = { | ||
if (defined(invoker.toolchain_args)) { | ||
forward_variables_from(invoker.toolchain_args, "*") | ||
} | ||
is_clang = true | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.