test: run clang build too
This commit is contained in:
parent
42dfa0c11b
commit
9f2673bf3a
@ -6,3 +6,5 @@ dnf -y build-dep test.spec
|
|||||||
rpmbuild --define '_sourcedir .' --define '_builddir .' -bb test.spec
|
rpmbuild --define '_sourcedir .' --define '_builddir .' -bb test.spec
|
||||||
dnf -y build-dep test.spec -D "_with_ld_lld 1"
|
dnf -y build-dep test.spec -D "_with_ld_lld 1"
|
||||||
rpmbuild --with ld_lld --define '_sourcedir .' --define '_builddir .' -bb test.spec
|
rpmbuild --with ld_lld --define '_sourcedir .' --define '_builddir .' -bb test.spec
|
||||||
|
dnf -y build-dep test.spec -D "_with_clang 1"
|
||||||
|
rpmbuild --with clang --define '_sourcedir .' --define '_builddir .' -bb test.spec
|
||||||
|
@ -1,9 +1,13 @@
|
|||||||
%bcond_with ld_lld
|
%bcond_with ld_lld
|
||||||
|
%bcond_with clang
|
||||||
|
|
||||||
%if %{with ld_lld}
|
%if %{with ld_lld}
|
||||||
%global extra_ldflags -fuse-ld=lld
|
%global extra_ldflags -fuse-ld=lld
|
||||||
%global _package_note_linker lld
|
%global _package_note_linker lld
|
||||||
%endif
|
%endif
|
||||||
|
%if %{with clang}
|
||||||
|
%global toolchain clang
|
||||||
|
%endif
|
||||||
|
|
||||||
Name: test
|
Name: test
|
||||||
Version: 1
|
Version: 1
|
||||||
@ -11,7 +15,11 @@ Release: 1
|
|||||||
Summary: Test package for checking package notes
|
Summary: Test package for checking package notes
|
||||||
License: MIT
|
License: MIT
|
||||||
|
|
||||||
|
%if %{with clang}
|
||||||
|
BuildRequires: clang
|
||||||
|
%else
|
||||||
BuildRequires: gcc
|
BuildRequires: gcc
|
||||||
|
%endif
|
||||||
# For %check
|
# For %check
|
||||||
BuildRequires: binutils
|
BuildRequires: binutils
|
||||||
BuildRequires: jq
|
BuildRequires: jq
|
||||||
@ -24,10 +32,10 @@ Test package for checking package notes
|
|||||||
|
|
||||||
%build
|
%build
|
||||||
echo 'int main(int argc, char **argv) { return 0; }' | %{build_cc} ${CFLAGS} -x c -c - -o main.o
|
echo 'int main(int argc, char **argv) { return 0; }' | %{build_cc} ${CFLAGS} -x c -c - -o main.o
|
||||||
%{build_cc} ${LDFLAGS} %{?extra_ldflags} main.o -o main
|
%{build_cc} -Werror ${LDFLAGS} %{?extra_ldflags} main.o -o main
|
||||||
|
|
||||||
# Package notes not supported with lld, so the the build succeeding is enough.
|
# Package notes not supported with clang, so the the build succeeding is enough.
|
||||||
%if %{without ld_lld}
|
%if %{without clang}
|
||||||
%check
|
%check
|
||||||
# avoid any attempt to access the network by readelf
|
# avoid any attempt to access the network by readelf
|
||||||
export DEBUGINFOD_URLS=
|
export DEBUGINFOD_URLS=
|
||||||
|
Loading…
Reference in New Issue
Block a user