add clang compile support

This commit is contained in:
liyunfei 2023-08-15 09:47:54 +08:00
parent 3af3ff2d5c
commit 4392ad20d0

View File

@ -1,6 +1,6 @@
Name: python-dmidecode
Version: 3.12.3
Release: 3
Release: 4
Summary: Python extension module for dmidecode
License: GPLv2
@ -13,6 +13,9 @@ Patch1: python-dmidecode-3.12.3-sw.patch
Patch2: python-dmidecode-rhbz2154949.patch
BuildRequires: gcc libxml2-devel python3-libxml2 python3-devel
%if "%toolchain" == "clang"
BuildRequires: clang llvm lld
%endif
%description
Dmidecode reports information about your system's hardware as described in
@ -47,7 +50,9 @@ sed -i 's/python2/python3/g' Makefile unit-tests/Makefile
export PYTHON_BIN=%{__python3}
export PYTHON_VERSION=%{python3_version}
export CFLAGS="%{build_cflags} -std=gnu89"
export CC=gcc
%if "%toolchain" == "clang"
export CFLAGS="$CFLAGS -Wno-error=int-conversion"
%endif
%make_build
%install
@ -71,6 +76,9 @@ make -C unit-tests
%doc README doc/README.upstream
%changelog
* Fri Aug 11 2023 liyunfei <liyunfei33@huawei.com> - 3.12.3-4
- add clang compile support
* Wed Jul 05 2023 zhouwenpei <zhouwenpei@h-partners.com> - 3.12.3-3
- fix build error