diff options
Diffstat (limited to 'ports/llvm')
| -rw-r--r-- | ports/llvm/CONTROL | 9 | ||||
| -rw-r--r-- | ports/llvm/portfile.cmake | 78 |
2 files changed, 19 insertions, 68 deletions
diff --git a/ports/llvm/CONTROL b/ports/llvm/CONTROL index f461f1cb5..28de43699 100644 --- a/ports/llvm/CONTROL +++ b/ports/llvm/CONTROL @@ -1,10 +1,10 @@ Source: llvm Version: 10.0.0 -Port-Version: 5 +Port-Version: 6 Homepage: https://llvm.org/ Description: The LLVM Compiler Infrastructure Supports: !uwp -Default-Features: tools, enable-rtti, disable-assertions, disable-abi-breaking-checks, clang, disable-clang-static-analyzer, lld +Default-Features: tools, enable-rtti, disable-assertions, disable-abi-breaking-checks, clang, disable-clang-static-analyzer, lld, default-targets Feature: tools Description: Build LLVM tools. @@ -12,8 +12,13 @@ Description: Build LLVM tools. Feature: utils Description: Build LLVM utils. +Feature: default-targets +Description: Build with platform-specific default targets +Build-Depends: llvm[core,target-x86] (x86|x64), llvm[core,target-arm] (arm&!arm64), llvm[core,target-aarch64] (arm64), llvm[core,target-all] (!x86&!x64&!arm&!arm64) + Feature: target-all Description: Build with all backends. +Build-Depends: llvm[core,target-aarch64,target-amdgpu,target-arm,target-bpf,target-hexagon,target-lanai,target-mips,target-msp430,target-nvptx,target-powerpc,target-riscv,target-sparc,target-systemz,target-webassembly,target-x86,target-xcore] Feature: target-aarch64 Description: Build with AArch64 backend. diff --git a/ports/llvm/portfile.cmake b/ports/llvm/portfile.cmake index 305e6bf78..56209147a 100644 --- a/ports/llvm/portfile.cmake +++ b/ports/llvm/portfile.cmake @@ -92,72 +92,18 @@ if("polly" IN_LIST FEATURES) list(APPEND LLVM_ENABLE_PROJECTS "polly") endif() -set(LLVM_TARGETS_TO_BUILD) -if("target-all" IN_LIST FEATURES) - set(LLVM_TARGETS_TO_BUILD "all") -else() - if("target-aarch64" IN_LIST FEATURES) - list(APPEND LLVM_TARGETS_TO_BUILD "AArch64") - endif() - if("target-amdgpu" IN_LIST FEATURES) - list(APPEND LLVM_TARGETS_TO_BUILD "AMDGPU") - endif() - if("target-arm" IN_LIST FEATURES) - list(APPEND LLVM_TARGETS_TO_BUILD "ARM") - endif() - if("target-bpf" IN_LIST FEATURES) - list(APPEND LLVM_TARGETS_TO_BUILD "BPF") - endif() - if("target-hexagon" IN_LIST FEATURES) - list(APPEND LLVM_TARGETS_TO_BUILD "Hexagon") - endif() - if("target-lanai" IN_LIST FEATURES) - list(APPEND LLVM_TARGETS_TO_BUILD "Lanai") - endif() - if("target-mips" IN_LIST FEATURES) - list(APPEND LLVM_TARGETS_TO_BUILD "Mips") - endif() - if("target-msp430" IN_LIST FEATURES) - list(APPEND LLVM_TARGETS_TO_BUILD "MSP430") - endif() - if("target-nvptx" IN_LIST FEATURES) - list(APPEND LLVM_TARGETS_TO_BUILD "NVPTX") - endif() - if("target-powerpc" IN_LIST FEATURES) - list(APPEND LLVM_TARGETS_TO_BUILD "PowerPC") - endif() - if("target-riscv" IN_LIST FEATURES) - list(APPEND LLVM_TARGETS_TO_BUILD "RISCV") - endif() - if("target-sparc" IN_LIST FEATURES) - list(APPEND LLVM_TARGETS_TO_BUILD "Sparc") - endif() - if("target-systemz" IN_LIST FEATURES) - list(APPEND LLVM_TARGETS_TO_BUILD "SystemZ") - endif() - if("target-webassembly" IN_LIST FEATURES) - list(APPEND LLVM_TARGETS_TO_BUILD "WebAssembly") - endif() - if("target-x86" IN_LIST FEATURES) - list(APPEND LLVM_TARGETS_TO_BUILD "X86") - endif() - if("target-xcore" IN_LIST FEATURES) - list(APPEND LLVM_TARGETS_TO_BUILD "XCore") - endif() -endif() - -# Detect target to build if not specified -if("${LLVM_TARGETS_TO_BUILD}" STREQUAL "") - if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") - set(LLVM_TARGETS_TO_BUILD "X86") - elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm") - set(LLVM_TARGETS_TO_BUILD "ARM") - elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64") - set(LLVM_TARGETS_TO_BUILD "AArch64") - else() - set(LLVM_TARGETS_TO_BUILD "all") - endif() -endif() +set(known_llvm_targets + AArch64 AMDGPU ARM BPF Hexagon Lanai Mips + MSP430 NVPTX PowerPC RISCV Sparc SystemZ + WebAssembly X86 XCore) + +set(LLVM_TARGETS_TO_BUILD "") +foreach(llvm_target IN LISTS known_llvm_targets) + string(TOLOWER "target-${llvm_target}" feature_name) + if(feature_name IN_LIST FEATURES) + list(APPEND LLVM_TARGETS_TO_BUILD "${llvm_target}") + endif() +endforeach() # Use comma-separated string instead of semicolon-separated string. # See https://github.com/microsoft/vcpkg/issues/4320 |
