!311 [sync] PR-304: Support build with clang

From: @openeuler-sync-bot 
Reviewed-by: @xuxuepeng 
Signed-off-by: @xuxuepeng
This commit is contained in:
openeuler-ci-bot 2024-04-15 06:59:29 +00:00 committed by Gitee
commit 6b810ecf53
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -1,5 +1,5 @@
%global _version 2.1.4
%global _release 5
%global _release 6
%global _inner_name isula_libutils
%global enable_lxc 1
@ -72,10 +72,14 @@ the libisula-devel package contains json, log and utils headers for developing p
%build
mkdir -p build
cd build
%if "%toolchain" == "clang"
%global cmake_opts -DCMAKE_C_FLAGS="${CFLAGS}"
%endif
%if 0%{?enable_lxc}
%cmake -DDEBUG=ON -DENABLE_LIBLCR=ON -DCMAKE_SKIP_RPATH=TRUE -DLIB_INSTALL_DIR=%{_libdir} ../
%cmake -DDEBUG=ON -DENABLE_LIBLCR=ON -DCMAKE_SKIP_RPATH=TRUE -DLIB_INSTALL_DIR=%{_libdir} %{?cmake_opts} ../
%else
%cmake -DDEBUG=ON -DENABLE_LIBLCR=OFF -DCMAKE_SKIP_RPATH=TRUE -DLIB_INSTALL_DIR=%{_libdir} ../
%cmake -DDEBUG=ON -DENABLE_LIBLCR=OFF -DCMAKE_SKIP_RPATH=TRUE -DLIB_INSTALL_DIR=%{_libdir} %{?cmake_opts} ../
%endif
%make_build
@ -137,6 +141,12 @@ rm -rf %{buildroot}
%{_includedir}/lcr/utils_compile.h
%changelog
* Fri Apr 12 2024 luofeng<luofeng13@huawei.com> - 2.1.4-6
- Type:enhancement
- CVE:NA
- SUG:NA
- DESC:support clang build
* Thu Apr 11 2024 jikai<jikai11@huawei.com> - 2.1.4-5
- Type:enhancement
- CVE:NA