[PATCH 3/3] rtems/llvm: Add support to build llvm on Windows.

chrisj at rtems.org chrisj at rtems.org
Thu Oct 24 22:19:02 UTC 2019


From: Chris Johns <chrisj at rtems.org>

---
 source-builder/config/llvm-common-1.cfg | 36 +++++++++++++++++--------
 1 file changed, 25 insertions(+), 11 deletions(-)

diff --git a/source-builder/config/llvm-common-1.cfg b/source-builder/config/llvm-common-1.cfg
index c75769f..629d2bf 100644
--- a/source-builder/config/llvm-common-1.cfg
+++ b/source-builder/config/llvm-common-1.cfg
@@ -58,6 +58,18 @@ URL: 	   http://llvm.org/
  %define lldb_codesign_identity %{nil}
 %endif
 
+%if %{_build_os} == win32
+ %define llvm_build_tools CXX=clang++ CC=clang
+%else
+ %define llvm_build_tools %{nil}
+%endif
+
+%if %{defined with_llvm_verbose}
+ %define llvm_verbose VERBOSE=1
+%else
+ %define llvm_verbose %{nil}
+%endif
+
 #
 # Prepare the source code.
 #
@@ -74,36 +86,36 @@ URL: 	   http://llvm.org/
 
   source_dir_llvm=${llvm_source}
 
-  %source setup llvm -q
+  %source setup llvm -q -E
   %{__mv} llvm-%{llvm_version}.src ${source_dir_llvm}
 
-  %source setup cfe -q
+  %source setup cfe -q -E
   %{__mv} cfe-%{llvm_version}.src ${source_dir_llvm}/tools/clang
 
-  %source setup clang-tools-extra -q
+  %source setup clang-tools-extra -q -E
   %{__mv} clang-tools-extra-%{llvm_version}.src ${source_dir_llvm}/tools/clang/extra
 
-  %source setup compiler-rt -q
+  %source setup compiler-rt -q -E
   %{__mv} compiler-rt-%{llvm_version}.src ${source_dir_llvm}/projects/compiler-rt
 
-  %source setup libcxx -q
+  %source setup libcxx -q -E
   %{__mv} libcxx-%{llvm_version}.src ${source_dir_llvm}/projects/libcxx
 
-  %source setup libcxxabi -q
+  %source setup libcxxabi -q -E
   %{__mv} libcxxabi-%{llvm_version}.src ${source_dir_llvm}/projects/libcxxabi
 
-  %source setup libunwind -q
+  %source setup libunwind -q -E
   %{__mv} libunwind-%{llvm_version}.src ${source_dir_llvm}/projects/libunwind
 
-  %source setup lld -q
+  %source setup lld -q -E
   %{__mv} lld-%{llvm_version}.src ${source_dir_llvm}/tools/lld
 
   %if %{defined with_llvm_lldb}
-   %source setup lldb -q
+   %source setup lldb -q -E
    %{__mv} lldb-%{llvm_version}.src ${source_dir_llvm}/tools/lldb
   %endif
 
-  %source setup openmp -q
+  %source setup openmp -q -E
   %{__mv} openmp-%{llvm_version}.src ${source_dir_llvm}/tools/openmp
 
   %patch setup llvm -p1
@@ -124,8 +136,10 @@ URL: 	   http://llvm.org/
   mkdir -p ${build_dir}
   cd ${build_dir}
 
+  %{llvm_build_tools} \
   %{__cmake} -Wno-dev \
     -G "Unix Makefiles" \
+    -DCMAKE_COLOR_MAKEFILE=OFF \
     -DCMAKE_BUILD_TYPE=Release \
     -DCMAKE_INSTALL_PREFIX=%{_prefix} \
     -DPACKAGE_VERSION="%{llvm_version} (%{llvm_version_message})" \
@@ -138,7 +152,7 @@ URL: 	   http://llvm.org/
       > ${version_inc}.tmp
   %{__mv} ${version_inc}.tmp ${version_inc}
 
-  %{__make} %{?_smp_mflags}
+  %{__make} %{?_smp_mflags} %{llvm_verbose}
 
   cd ${build_top}
 
-- 
2.22.0



More information about the devel mailing list