Simplify doctest download workaround
This commit is contained in:
parent
74cb6fd2dd
commit
bae3d56b98
24
c4fs.spec
24
c4fs.spec
@ -55,24 +55,26 @@ applications that use c4fs.
|
|||||||
%autosetup -n c4fs-%{commit} -p1
|
%autosetup -n c4fs-%{commit} -p1
|
||||||
|
|
||||||
# Remove/unbundle additional dependencies
|
# Remove/unbundle additional dependencies
|
||||||
|
|
||||||
# c4project (CMake build scripts)
|
# c4project (CMake build scripts)
|
||||||
rm -rvf ext/c4core/cmake
|
find ext
|
||||||
cp -rvp %{_datadir}/cmake/c4project ext/c4core/cmake
|
cp -rp '%{_datadir}/cmake/c4project' ext/c4core/cmake
|
||||||
# Patch out download of doctest:
|
|
||||||
awk '/^ if\(_DOCTEST\)$/ { x=1 }
|
|
||||||
x != 1
|
|
||||||
x == 1 && /^ endif\(\)$/ { x=0 }' \
|
|
||||||
'%{_datadir}/cmake/c4project/c4Project.cmake' \
|
|
||||||
> 'ext/c4core/cmake/c4Project.cmake'
|
|
||||||
# This comment fixes confused vim syntax highlighting: '
|
|
||||||
# Do not try to link against a nonexistent doctest library (doctest is
|
# Do not try to link against a nonexistent doctest library (doctest is
|
||||||
# header-only, and we do not have the complete CMake project for doctest that
|
# header-only, and we do not have the complete CMake project for doctest that
|
||||||
# would provide a target that knows this):
|
# would provide a target that knows this):
|
||||||
sed -r -i 's/\bdoctest\b//' test/CMakeLists.txt
|
sed -r -i \
|
||||||
|
-e 's/(LIBS.*)\bdoctest\b/\1/' \
|
||||||
|
-e 's/(c4_setup_testing\()DOCTEST\)/\1\)/' \
|
||||||
|
test/CMakeLists.txt
|
||||||
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%cmake -DC4FS_BUILD_TESTS=ON -GNinja
|
# We can stop the CMake scripts from downloading doctest by setting
|
||||||
|
# C4FS_CACHE_DOWNLOAD_DOCTEST to any directory that exists.
|
||||||
|
%cmake -GNinja \
|
||||||
|
-DC4FS_CACHE_DOWNLOAD_DOCTEST:PATH=/ \
|
||||||
|
-DC4FS_BUILD_TESTS=ON
|
||||||
%cmake_build
|
%cmake_build
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user