Change CMakeLists.txt to expect Catch2 in system path to speed up builds
All checks were successful
ci/woodpecker/push/workflow Pipeline was successful

This commit is contained in:
2025-10-02 18:08:22 +03:00
committed by Emin Arslan
parent 2dd10e08d9
commit 15176cdbf6
2 changed files with 5 additions and 12 deletions

View File

@@ -6,12 +6,12 @@ steps:
- name: build - name: build
image: gcc:latest image: gcc:latest
commands: # we probably shouldn't install cmake every time commands: # we probably shouldn't install cmake every time
- apt update && apt install -y cmake - apt update && apt install -y cmake catch2
- mkdir -p build/ && cd build - mkdir -p build/ && cd build
- cmake .. --toolchain ../toolchain/sanitize.cmake - cmake .. --toolchain ../toolchain/sanitize.cmake
- make - make
- name: test - name: test
image: ubuntu image: gcc:latest
commands: commands:
# Automated tests, this should not fail # Automated tests, this should not fail
- ./build/test - ./build/test

View File

@@ -1,20 +1,13 @@
cmake_minimum_required(VERSION 3.16) cmake_minimum_required(VERSION 3.16)
project(lispy_stuff) project(lispy_stuff)
# we'll use catch2 as testing library.
# Catch2 version 3 or above needs to be installed on your system.
find_package(Catch2 3 REQUIRED)
# we'll use a recent c++ standard. # we'll use a recent c++ standard.
set(CMAKE_CXX_STANDARD 23) set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD_REQUIRED ON)
# we'll use catch2 as testing library.
include(FetchContent)
FetchContent_Declare(
Catch2
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
GIT_TAG v3.8.1
)
FetchContent_MakeAvailable(Catch2)
list(APPEND CMAKE_MODULE_PATH ${catch2_SOURCE_DIR}/extras)
include(Catch)
set(HEADER_FILES src/include/lex.hpp) set(HEADER_FILES src/include/lex.hpp)
set(SOURCE_FILES src/lex.cpp) set(SOURCE_FILES src/lex.cpp)