feat: added woodpecker config

Reviewed-on: #1
Co-authored-by: Tobias Schmidl <tobias@schmidl.dev>
Co-committed-by: Tobias Schmidl <tobias@schmidl.dev>
This commit is contained in:
Tobias Schmidl 2023-10-06 07:10:26 +02:00
parent 70dcc822fd
commit 2c822ce773
15 changed files with 129 additions and 129 deletions

View file

@ -6,19 +6,18 @@ set(CPM_DOWNLOAD_VERSION 0.38.5)
set(CPM_HASH_SUM "192aa0ccdc57dfe75bd9e4b176bf7fb5692fd2b3e3f7b09c74856fc39572b31c")
if(CPM_SOURCE_CACHE)
set(CPM_DOWNLOAD_LOCATION "${CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
set(CPM_DOWNLOAD_LOCATION "${CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
elseif(DEFINED ENV{CPM_SOURCE_CACHE})
set(CPM_DOWNLOAD_LOCATION "$ENV{CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
set(CPM_DOWNLOAD_LOCATION "$ENV{CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
else()
set(CPM_DOWNLOAD_LOCATION "${CMAKE_BINARY_DIR}/cmake/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
set(CPM_DOWNLOAD_LOCATION "${CMAKE_BINARY_DIR}/cmake/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
endif()
# Expand relative path. This is important if the provided path contains a tilde (~)
get_filename_component(CPM_DOWNLOAD_LOCATION ${CPM_DOWNLOAD_LOCATION} ABSOLUTE)
file(DOWNLOAD
https://github.com/cpm-cmake/CPM.cmake/releases/download/v${CPM_DOWNLOAD_VERSION}/CPM.cmake
${CPM_DOWNLOAD_LOCATION} EXPECTED_HASH SHA256=${CPM_HASH_SUM}
file(DOWNLOAD https://github.com/cpm-cmake/CPM.cmake/releases/download/v${CPM_DOWNLOAD_VERSION}/CPM.cmake ${CPM_DOWNLOAD_LOCATION}
EXPECTED_HASH SHA256=${CPM_HASH_SUM}
)
include(${CPM_DOWNLOAD_LOCATION})

View file

@ -2,69 +2,52 @@
#
# SPDX-License-Identifier: CC0-1.0
# this file contains a list of tools that can be activated and downloaded on-demand each tool is
# enabled during configuration by passing an additional `-DUSE_<TOOL>=<VALUE>` argument to CMake
# this file contains a list of tools that can be activated and downloaded on-demand each tool is enabled during configuration by passing an
# additional `-DUSE_<TOOL>=<VALUE>` argument to CMake
# only activate tools for top level project
if(NOT PROJECT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
return()
return()
endif()
include(${CMAKE_CURRENT_LIST_DIR}/CPM.cmake)
# enables sanitizers support using the the `USE_SANITIZER` flag available values are: Address,
# Memory, MemoryWithOrigins, Undefined, Thread, Leak, 'Address;Undefined'
# enables sanitizers support using the the `USE_SANITIZER` flag available values are: Address, Memory, MemoryWithOrigins, Undefined, Thread,
# Leak, 'Address;Undefined'
if(USE_SANITIZER OR USE_STATIC_ANALYZER)
CPMAddPackage("gh:StableCoder/cmake-scripts#1f822d1fc87c8d7720c074cde8a278b44963c354")
CPMAddPackage("gh:StableCoder/cmake-scripts#1f822d1fc87c8d7720c074cde8a278b44963c354")
if(USE_SANITIZER)
include(${cmake-scripts_SOURCE_DIR}/sanitizers.cmake)
endif()
if(USE_SANITIZER)
include(${cmake-scripts_SOURCE_DIR}/sanitizers.cmake)
endif()
if(USE_STATIC_ANALYZER)
if("clang-tidy" IN_LIST USE_STATIC_ANALYZER)
set(CLANG_TIDY
ON
CACHE INTERNAL ""
)
else()
set(CLANG_TIDY
OFF
CACHE INTERNAL ""
)
endif()
if("iwyu" IN_LIST USE_STATIC_ANALYZER)
set(IWYU
ON
CACHE INTERNAL ""
)
else()
set(IWYU
OFF
CACHE INTERNAL ""
)
endif()
if("cppcheck" IN_LIST USE_STATIC_ANALYZER)
set(CPPCHECK
ON
CACHE INTERNAL ""
)
else()
set(CPPCHECK
OFF
CACHE INTERNAL ""
)
endif()
# cmake-lint: disable=C0103
if(USE_STATIC_ANALYZER)
if("clang-tidy" IN_LIST USE_STATIC_ANALYZER)
set(CLANG_TIDY ON CACHE INTERNAL "")
else()
set(CLANG_TIDY OFF CACHE INTERNAL "")
endif()
if("iwyu" IN_LIST USE_STATIC_ANALYZER)
set(IWYU ON CACHE INTERNAL "")
else()
set(IWYU OFF CACHE INTERNAL "")
endif()
if("cppcheck" IN_LIST USE_STATIC_ANALYZER)
set(CPPCHECK ON CACHE INTERNAL "")
else()
set(CPPCHECK OFF CACHE INTERNAL "")
endif()
include(${cmake-scripts_SOURCE_DIR}/tools.cmake)
include(${cmake-scripts_SOURCE_DIR}/tools.cmake)
clang_tidy(${CLANG_TIDY_ARGS})
include_what_you_use(${IWYU_ARGS})
cppcheck(${CPPCHECK_ARGS})
endif()
clang_tidy(${CLANG_TIDY_ARGS})
include_what_you_use(${IWYU_ARGS})
cppcheck(${CPPCHECK_ARGS})
endif()
endif()
# enables CCACHE support through the USE_CCACHE flag possible values are: YES, NO or equivalent
if(USE_CCACHE)
CPMAddPackage("gh:TheLartians/Ccache.cmake@1.2.3")
CPMAddPackage("gh:TheLartians/Ccache.cmake@1.2.3")
endif()

View file

@ -12,12 +12,7 @@ execute_process(
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if(GIT_DESCRIBE_ERROR_CODE EQUAL 0)
string(
REGEX MATCH
"^v?([0-9]+)(\\.([0-9]+))?(\\.([0-9]+))?(\\.([0-9]+))?.*$"
_
"${GIT_DESCRIBE_VERSION_STRING}"
)
string(REGEX MATCH "^v?([0-9]+)(\\.([0-9]+))?(\\.([0-9]+))?(\\.([0-9]+))?.*$" _ "${GIT_DESCRIBE_VERSION_STRING}")
if(DEFINED CMAKE_MATCH_1)
set(VERSION_STRING "${CMAKE_MATCH_1}")
if(DEFINED CMAKE_MATCH_3)