| 1 |
import("//llvm/lib/Target/targets.gni") |
| 2 |
import("//llvm/utils/gn/build/mac_sdk.gni") |
| 3 |
import("//llvm/utils/gn/build/toolchain/compiler.gni") |
| 4 |
|
| 5 |
# In the GN build, compiler-rt is always built by just-built clang and lld. |
| 6 |
# FIXME: For macOS and iOS builds, depend on lib in all needed target arch |
| 7 |
# toolchains and then lipo them together for the final output. |
| 8 |
supported_toolchains = [] |
| 9 |
if (current_os == "win" || win_sysroot != "") { |
| 10 |
supported_toolchains += [ "//llvm/utils/gn/build/toolchain:stage2_win_x64" ] |
| 11 |
supported_toolchains += [ "//llvm/utils/gn/build/toolchain:stage2_win_x86" ] |
| 12 |
} |
| 13 |
if (current_os != "win") { |
| 14 |
supported_toolchains += [ "//llvm/utils/gn/build/toolchain:stage2_unix" ] |
| 15 |
} |
| 16 |
supported_toolchains += supported_android_toolchains |
| 17 |
if (llvm_build_AArch64) { |
| 18 |
supported_toolchains += |
| 19 |
[ "//llvm/utils/gn/build/toolchain:stage2_baremetal_aarch64" ] |
| 20 |
} |
| 21 |
group("compiler-rt") { |
| 22 |
deps = [ "//compiler-rt/include($host_toolchain)" ] |
| 23 |
foreach(toolchain, supported_toolchains) { |
| 24 |
deps += [ "//compiler-rt/lib($toolchain)" ] |
| 25 |
} |
| 26 |
|
| 27 |
# FIXME: Do this only if a gn arg compiler_rt_enable_ios is set? |
| 28 |
# That would match the cmake build. |
| 29 |
if (host_os == "mac" && have_ios_sdks) { |
| 30 |
if (llvm_build_AArch64) { |
| 31 |
deps += [ "//compiler-rt/lib/builtins(//llvm/utils/gn/build/toolchain:stage2_ios_aarch64)" ] |
| 32 |
} |
| 33 |
if (llvm_build_X86) { |
| 34 |
deps += [ "//compiler-rt/lib/builtins(//llvm/utils/gn/build/toolchain:stage2_iossim_x64)" ] |
| 35 |
} |
| 36 |
} |
| 37 |
} |