diff --git a/llvm.spec b/llvm.spec index 73dfde2c5fbed50e3121db8807f151f54887da05..5804b4d4b972698a30582933062b3f4162d02b26 100644 --- a/llvm.spec +++ b/llvm.spec @@ -1,6 +1,11 @@ %bcond_without sys_llvm %bcond_without check %bcond_with classic_flang +%bcond_without toolchain_clang + +%if %{with toolchain_clang} +%global toolchain clang +%endif %global maj_ver 17 %global min_ver 0 @@ -38,7 +43,7 @@ Name: %{pkg_name} Version: %{maj_ver}.%{min_ver}.%{patch_ver} -Release: 10 +Release: 11 Summary: The Low Level Virtual Machine License: NCSA @@ -85,6 +90,9 @@ BuildRequires: python3-recommonmark BuildRequires: python3-sphinx BuildRequires: python3-setuptools BuildRequires: zlib-devel +%if %{with toolchain_clang} +BuildRequires: clang +%endif Requires: %{name}-libs%{?_isa} = %{version}-%{release} @@ -230,6 +238,10 @@ cd _build %endif %if %{with classic_flang} -DLLVM_ENABLE_CLASSIC_FLANG=ON \ +%endif +%if "%{toolchain}" == "clang" + -DCMAKE_C_COMPILER=clang \ + -DCMAKE_CXX_COMPILER=clang++ \ %endif -DLLVM_INCLUDE_BENCHMARKS=OFF %ninja_build LLVM @@ -353,6 +365,9 @@ LD_LIBRARY_PATH=%{buildroot}/%{install_libdir} %{__ninja} check-all -C ./_build %{install_includedir}/llvm-gmock %changelog +* Fri Jul 5 2024 liyunfei - 17.0.6-11 +- Add toolchain_clang build support + * Mon Apr 29 2024 wangqiang - 17.0.6-10 - Update llvm-lit config to support macro `build_for_openeuler`