Skip to content
Snippets Groups Projects
Verified Commit 3b64edc5 authored by Nicolas Werner's avatar Nicolas Werner
Browse files

Make tests use FetchContent

parent 6e8f817e
No related branches found
No related tags found
No related merge requests found
Pipeline #4123 passed
......@@ -54,7 +54,7 @@ build-cmake:
before_script:
- apk update && apk add git curl-dev libevent-dev spdlog-dev g++ cmake pkgconf openssl samurai
script:
- cmake -GNinja -S . -B build
- cmake -GNinja -S tests/ -B build
- ninja -C build
build-hunter:
......@@ -64,7 +64,7 @@ build-hunter:
before_script:
- apk update && apk add git curl-dev libevent-dev spdlog-dev g++ cmake pkgconf openssl samurai perl make linux-headers
script:
- cmake -GNinja -S . -B build -DHUNTER_ENABLED=ON
- cmake -GNinja -S tests/ -B build -DHUNTER_ENABLED=ON
- ninja -C build
test-pages:
......
......@@ -30,9 +30,7 @@ project(coeurl
HOMEPAGE_URL "https://nheko.im/nheko-reborn/cocurl")
if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
message(STATUS ${CMAKE_SOURCE_DIR})
message(STATUS ${CMAKE_CURRENT_SOURCE_DIR})
message(FATAL_ERROR "The CMake build for coeurl is not intended for installation or usage outside of FetchContent.")
message(FATAL_ERROR "The CMake build for coeurl is not intended for installation or usage outside of FetchContent. Use meson instead.")
endif()
add_library(coeurl lib/client.cpp lib/request.cpp lib/errors.cpp)
......
cmake_minimum_required(VERSION 3.12...3.13)
set(
CMAKE_TOOLCHAIN_FILE
"${CMAKE_CURRENT_LIST_DIR}/../toolchain.cmake"
CACHE
FILEPATH
"Default toolchain"
)
set(CMAKE_CXX_STANDARD 17 CACHE STRING "C++ standard")
set(CMAKE_CXX_STANDARD_REQUIRED ON CACHE BOOL "Require C++ standard to be supported")
set(CMAKE_POSITION_INDEPENDENT_CODE ON CACHE BOOL "compile as PIC by default")
option(HUNTER_ENABLED "Enable Hunter package manager" OFF)
include("../cmake/HunterGate.cmake")
HunterGate(
URL "https://github.com/cpp-pm/hunter/archive/v0.24.8.tar.gz"
SHA1 "ca7838dded9a1811b04ffd56175f629e0af82d3d"
)
project(coeurl-cmake-buildtest)
include(FetchContent)
FetchContent_Declare(
coeurl
GIT_REPOSITORY "${CMAKE_CURRENT_LIST_DIR}/.."
GIT_TAG HEAD
)
FetchContent_MakeAvailable(coeurl)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment