Build with Ninja

This reduces RPM build time on a 6-core x86_64 builder from 82 min
to 52 min.
This commit is contained in:
Tom Stellard 2018-03-08 23:40:31 +00:00
parent 539d4ba445
commit acd922f57d

View File

@ -12,7 +12,7 @@
Name: llvm Name: llvm
Version: %{maj_ver}.%{min_ver}.%{patch_ver} Version: %{maj_ver}.%{min_ver}.%{patch_ver}
Release: 1%{?dist} Release: 2%{?dist}
Summary: The Low Level Virtual Machine Summary: The Low Level Virtual Machine
License: NCSA License: NCSA
@ -27,6 +27,7 @@ Patch3: 0001-CMake-Split-static-library-exports-into-their-own-ex.patch
Patch4: 0001-Revert-Add-a-linker-script-to-version-LLVM-symbols.patch Patch4: 0001-Revert-Add-a-linker-script-to-version-LLVM-symbols.patch
BuildRequires: cmake BuildRequires: cmake
BuildRequires: ninja-build
BuildRequires: zlib-devel BuildRequires: zlib-devel
BuildRequires: libffi-devel BuildRequires: libffi-devel
BuildRequires: ncurses-devel BuildRequires: ncurses-devel
@ -103,7 +104,7 @@ cd _build
%endif %endif
# force off shared libs as cmake macros turns it on. # force off shared libs as cmake macros turns it on.
%cmake .. \ %cmake .. -G Ninja \
-DBUILD_SHARED_LIBS:BOOL=OFF \ -DBUILD_SHARED_LIBS:BOOL=OFF \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_SHARED_LINKER_FLAGS="-Wl,-Bsymbolic -static-libstdc++" \ -DCMAKE_SHARED_LINKER_FLAGS="-Wl,-Bsymbolic -static-libstdc++" \
@ -139,7 +140,7 @@ cd _build
\ \
-DLLVM_INCLUDE_UTILS:BOOL=ON \ -DLLVM_INCLUDE_UTILS:BOOL=ON \
-DLLVM_INSTALL_UTILS:BOOL=ON \ -DLLVM_INSTALL_UTILS:BOOL=ON \
-DLLVM_UTILS_INSTALL_DIR:PATH=%{llvm_bindir} \ -DLLVM_UTILS_INSTALL_DIR:PATH=%{buildroot}%{llvm_bindir} \
\ \
-DLLVM_INCLUDE_DOCS:BOOL=ON \ -DLLVM_INCLUDE_DOCS:BOOL=ON \
-DLLVM_BUILD_DOCS:BOOL=ON \ -DLLVM_BUILD_DOCS:BOOL=ON \
@ -153,13 +154,14 @@ cd _build
-DLLVM_INSTALL_TOOLCHAIN_ONLY:BOOL=OFF \ -DLLVM_INSTALL_TOOLCHAIN_ONLY:BOOL=OFF \
\ \
-DSPHINX_WARNINGS_AS_ERRORS=OFF \ -DSPHINX_WARNINGS_AS_ERRORS=OFF \
-DCMAKE_INSTALL_PREFIX=%{buildroot}/usr \
-DSPHINX_EXECUTABLE=%{_bindir}/sphinx-build-3 -DSPHINX_EXECUTABLE=%{_bindir}/sphinx-build-3
make %{?_smp_mflags} ninja -v
%install %install
cd _build cd _build
make install DESTDIR=%{buildroot} ninja -v install
# fix multi-lib # fix multi-lib
mv -v %{buildroot}%{_bindir}/llvm-config{,-%{__isa_bits}} mv -v %{buildroot}%{_bindir}/llvm-config{,-%{__isa_bits}}
@ -215,6 +217,10 @@ fi
%{_libdir}/cmake/llvm/LLVMStaticExports.cmake %{_libdir}/cmake/llvm/LLVMStaticExports.cmake
%changelog %changelog
* Thu Mar 08 2018 Tom Stellard <tstellar@redhat.com> - 6.0.0-2
- Build with Ninja: This reduces RPM build time on a 6-core x86_64 builder
from 82 min to 52 min.
* Thu Mar 08 2018 Tom Stellard <tstellar@redhat.com> - 6.0.0-1 * Thu Mar 08 2018 Tom Stellard <tstellar@redhat.com> - 6.0.0-1
- 6.0.0 Release - 6.0.0 Release