!33 【LLVM平行宇宙】Add clang compile support

From: @liyunfei33 
Reviewed-by: @t_feng 
Signed-off-by: @t_feng
This commit is contained in:
openeuler-ci-bot 2023-09-08 06:40:42 +00:00 committed by Gitee
commit dff6566d11
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

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