添加编译开关

This commit is contained in:
wxf 2020-12-17 20:14:49 +08:00
parent acc5ecb937
commit af6446507e

View File

@ -1,9 +1,16 @@
%if 0%{?fedora} >= 15 || 0%{?rhel} >= 7 %if 0%{?fedora} >= 15 || 0%{?rhel} >= 7
%global use_devtoolset 0 %global use_devtoolset 0
%bcond_without faac
%bcond_without x264
%else %else
%global use_devtoolset 1 %global use_devtoolset 1
%bcond_with faac
%bcond_with x264
%endif %endif
%bcond_without openssl
%bcond_without mysql
Name: ZLMediaKit Name: ZLMediaKit
Version: 5.0.0 Version: 5.0.0
Release: 1%{?dist} Release: 1%{?dist}
@ -14,10 +21,21 @@ License: MIT
URL: https://github.com/xia-chu/ZLMediaKit URL: https://github.com/xia-chu/ZLMediaKit
Source0: %{name}-%{version}.tar.xz Source0: %{name}-%{version}.tar.xz
%if %{with openssl}
BuildRequires: openssl-devel BuildRequires: openssl-devel
%endif
%if %{with mysql}
BuildRequires: mysql-devel BuildRequires: mysql-devel
%endif
%if %{with faac}
BuildRequires: faac-devel BuildRequires: faac-devel
%endif
%if %{with x264}
BuildRequires: x264-devel BuildRequires: x264-devel
%endif
%if 0%{?use_devtoolset} %if 0%{?use_devtoolset}
BuildRequires: devtoolset-8-gcc-c++ BuildRequires: devtoolset-8-gcc-c++
@ -64,11 +82,12 @@ pushd %{_target_platform}
%endif %endif
%cmake \ %cmake \
-DCMAKE_BUILD_TYPE:STRING=Release \
-DENABLE_HLS:BOOL=ON \ -DENABLE_HLS:BOOL=ON \
-DENABLE_OPENSSL:BOOL=ON \ -DENABLE_OPENSSL:BOOL=%{with openssl} \
-DENABLE_MYSQL:BOOL=ON \ -DENABLE_MYSQL:BOOL=%{with mysql} \
-DENABLE_FAAC:BOOL=ON \ -DENABLE_FAAC:BOOL=%{with faac} \
-DENABLE_X264:BOOL=ON \ -DENABLE_X264:BOOL=%{with x264} \
-DENABLE_MP4:BOOL=ON \ -DENABLE_MP4:BOOL=ON \
-DENABLE_RTPPROXY:BOOL=ON \ -DENABLE_RTPPROXY:BOOL=ON \
-DENABLE_API:BOOL=ON \ -DENABLE_API:BOOL=ON \