Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[INFRA] Bump CMake for tests #3050

Merged
merged 1 commit into from
Sep 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ concurrency:
cancel-in-progress: true

env:
CMAKE_VERSION: 3.10.3
CMAKE_VERSION: 3.16.9
SEQAN3_NO_VERSION_CHECK: 1
TZ: Europe/Berlin
ISSUE: 2746 # Issue number to use for reporting failures
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/avx2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ concurrency:
cancel-in-progress: true

env:
CMAKE_VERSION: 3.10.3
CMAKE_VERSION: 3.16.9
SEQAN3_NO_VERSION_CHECK: 1
TZ: Europe/Berlin
ISSUE: 2905 # Issue number to use for reporting failures
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci_coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ concurrency:
cancel-in-progress: false # PRs will be canceled by the clang-format CI

env:
CMAKE_VERSION: 3.10.3
CMAKE_VERSION: 3.16.9
SEQAN3_NO_VERSION_CHECK: 1
TZ: Europe/Berlin

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ concurrency:
cancel-in-progress: ${{ github.event_name == 'push' }}

env:
CMAKE_VERSION: 3.10.3
CMAKE_VERSION: 3.16.9
SEQAN3_NO_VERSION_CHECK: 1
TZ: Europe/Berlin

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci_macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ concurrency:
cancel-in-progress: ${{ github.event_name == 'push' }}

env:
CMAKE_VERSION: 3.10.3
CMAKE_VERSION: 3.16.9
SEQAN3_NO_VERSION_CHECK: 1
TZ: Europe/Berlin

Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/ci_misc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
build_threads: 2
test_threads: 1 # snippets create and delete files and some separate tests create/delete the same files
cxx_flags: "-std=c++2a"
cmake: 3.10.3
cmake: 3.16.9
requires_toolchain: true
requires_ccache: true
skip_build_tests: false
Expand All @@ -59,7 +59,7 @@ jobs:
build_threads: 2
test_threads: 2
cxx_flags: "-std=c++2a"
cmake: 3.10.3
cmake: 3.16.9
requires_toolchain: true
requires_ccache: true
skip_build_tests: false
Expand All @@ -73,7 +73,7 @@ jobs:
build_type: Release
build_threads: 2
test_threads: 2
cmake: 3.10.3
cmake: 3.16.9
requires_toolchain: true
requires_ccache: true
skip_build_tests: false
Expand All @@ -88,7 +88,7 @@ jobs:
build_threads: 2
test_threads: 2
cxx_flags: "-std=c++2a"
cmake: 3.10.3
cmake: 3.16.9
requires_toolchain: true
requires_ccache: true
skip_build_tests: false
Expand All @@ -103,7 +103,7 @@ jobs:
build_threads: 2
test_threads: 2
cxx_flags: "-std=c++2a"
cmake: 3.10.3
cmake: 3.16.9
requires_toolchain: true
requires_ccache: true
skip_build_tests: true
Expand All @@ -118,7 +118,7 @@ jobs:
build_threads: 1 # output is important to be in sequential order
test_threads: 2
cxx_flags: "-std=c++2a"
cmake: 3.14.6 # the whole test suite needs at least cmake 3.14
cmake: 3.16.9
requires_toolchain: true
requires_ccache: false
skip_build_tests: false
Expand All @@ -129,7 +129,7 @@ jobs:
build: documentation
build_threads: 2
test_threads: 2
cmake: 3.10.3
cmake: 3.16.9
doxygen: 1.9.4
requires_toolchain: false
requires_ccache: false
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cmake_format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ concurrency:
cancel-in-progress: true

env:
CMAKE_VERSION: 3.10.3
CMAKE_VERSION: 3.16.9
SEQAN3_NO_VERSION_CHECK: 1
TZ: Europe/Berlin

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/documentation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ concurrency:
cancel-in-progress: false

env:
CMAKE_VERSION: 3.10.3
CMAKE_VERSION: 3.16.9
DOXYGEN_VERSION: 1.9.4
TZ: Europe/Berlin

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/latest_libraries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ concurrency:
cancel-in-progress: true

env:
CMAKE_VERSION: 3.10.3
CMAKE_VERSION: 3.16.9
SEQAN3_NO_VERSION_CHECK: 1
TZ: Europe/Berlin
ISSUE: 2747 # Issue number to use for reporting failures
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ram_usage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ concurrency:
cancel-in-progress: true

env:
CMAKE_VERSION: 3.10.3
CMAKE_VERSION: 3.16.9
SEQAN3_NO_VERSION_CHECK: 1
TZ: Europe/Berlin

Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ deprecated. Please keep this in mind if you encounter errors with `seqan3::views

#### Dependencies
* We now use Doxygen version 1.9.4 to build our documentation ([\#2979](https://github.com/seqan/seqan3/pull/2979)).
* We require at least CMake 3.16 for our test suite. Note that the minimum requirement for using SeqAn3 is unchanged
([\#3050](https://github.com/seqan/seqan3/pull/3050)).
* Removed range-v3 ([\#2998](https://github.com/seqan/seqan3/pull/2998)).
* Updated cereal to 1.3.2 ([\#3012](https://github.com/seqan/seqan3/pull/3012)).
* Updated sdsl-lite to 3.0.1 ([\#3012](https://github.com/seqan/seqan3/pull/3012)).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# shipped with this file and also available at: https://github.com/seqan/seqan3/blob/master/LICENSE.md
# -----------------------------------------------------------------------------------------------------

cmake_minimum_required (VERSION 3.10)
cmake_minimum_required (VERSION 3.12)

function (generate_include_dependencies_impl)
cmake_parse_arguments (
Expand Down Expand Up @@ -46,17 +46,7 @@ function (generate_include_dependencies_impl)

# filter out object files, e.g., discard "utility/views/CMakeFiles/zip_test.dir/zip_test.cpp.o: " in the line
# `utility/views/CMakeFiles/zip_test.dir/zip_test.cpp.o: /seqan3/include/seqan3/core/platform.hpp`
if (CMAKE_VERSION VERSION_LESS 3.12)
set (_header_files "${header_files}")
set (header_files "")
foreach (header_file ${_header_files})
string (REGEX REPLACE "^.+: " "" header_file "${header_file}")
list (APPEND header_files "${header_file}")
endforeach ()
else () # ^^^ workaround / no workaround vvv
# list (TRANSFORM) needs cmake >= 3.12
list (TRANSFORM header_files REPLACE "^.+: " "")
endif ()
list (TRANSFORM header_files REPLACE "^.+: " "")

if (NOT header_files)
# The pre-processing step that generates the dependency file did not produce it.
Expand Down
93 changes: 16 additions & 77 deletions test/cmake/seqan3_require_benchmark.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,92 +5,31 @@
# shipped with this file and also available at: https://github.com/seqan/seqan3/blob/master/LICENSE.md
# -----------------------------------------------------------------------------------------------------

cmake_minimum_required (VERSION 3.10)
cmake_minimum_required (VERSION 3.16)

# Exposes the google-benchmark target `gbenchmark`.
macro (seqan3_require_benchmark_old gbenchmark_git_tag)
set (SEQAN3_BENCHMARK_CLONE_DIR "${PROJECT_BINARY_DIR}/vendor/benchmark")

# needed for add_library (seqan3::test::* INTERFACE IMPORTED)
# see cmake bug https://gitlab.kitware.com/cmake/cmake/issues/15052
file (MAKE_DIRECTORY ${SEQAN3_BENCHMARK_CLONE_DIR}/include/)

set (gbenchmark_project_args ${SEQAN3_EXTERNAL_PROJECT_CMAKE_ARGS})
list (APPEND gbenchmark_project_args "-DBENCHMARK_ENABLE_TESTING=false")
list (APPEND gbenchmark_project_args "-DBENCHMARK_ENABLE_WERROR=false") # Does not apply to Debug builds.
# google-benchmarks suggest to use LTO (link-time optimisation), but we don't really need that because we are a
# header only library. This option might be still interesting for external libraries benchmarks.
# see https://github.com/google/benchmark#debug-vs-release
# list (APPEND gbenchmark_project_args "-DBENCHMARK_ENABLE_LTO=true")

# force that libraries are installed to `lib/`, because GNUInstallDirs might install it into `lib64/`
list (APPEND gbenchmark_project_args "-DCMAKE_INSTALL_LIBDIR=${PROJECT_BINARY_DIR}/lib/")

include (ExternalProject)
ExternalProject_Add (
gbenchmark_project
PREFIX gbenchmark_project
GIT_REPOSITORY "https://github.com/google/benchmark.git"
GIT_TAG "${gbenchmark_git_tag}"
SOURCE_DIR "${SEQAN3_BENCHMARK_CLONE_DIR}"
CMAKE_ARGS "${gbenchmark_project_args}"
BUILD_BYPRODUCTS "${gbenchmark_path}"
UPDATE_DISCONNECTED ${SEQAN3_TEST_BUILD_OFFLINE})
unset (gbenchmark_project_args)

foreach (lname "benchmark" "benchmark_main")
add_library (lib${lname} STATIC IMPORTED)
set_target_properties (
lib${lname}
PROPERTIES IMPORTED_LOCATION
"${PROJECT_BINARY_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}${lname}${CMAKE_STATIC_LIBRARY_SUFFIX}")
endforeach ()

add_library (gbenchmark INTERFACE)
add_dependencies (gbenchmark gbenchmark_project)
target_link_libraries (gbenchmark INTERFACE "libbenchmark" "libbenchmark_main" "pthread")
include_directories (gbenchmark INTERFACE "${PROJECT_BINARY_DIR}/include/")

# NOTE: google benchmarks needs Shlwapi (Shell Lightweight Utility Functions) on windows
# see https://msdn.microsoft.com/en-us/library/windows/desktop/bb759844(v=vs.85).aspx
# see https://github.com/google/benchmark/blob/c614dfc0d4eadcd19b188ff9c7e226c138f894a1/README.md#platform-specific-libraries
if (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
target_link_libraries (gbenchmark INTERFACE "Shlwapi")
endif ()

endmacro ()

macro (seqan3_require_benchmark)
enable_testing ()

set (gbenchmark_git_tag "v1.6.1")

if (NOT CMAKE_VERSION VERSION_LESS 3.14)
message (STATUS "Fetch Google Benchmark:")
message (STATUS "Fetch Google Benchmark:")

include (FetchContent)
FetchContent_Declare (
gbenchmark_fetch_content
GIT_REPOSITORY "https://github.com/google/benchmark.git"
GIT_TAG "${gbenchmark_git_tag}")
option (BENCHMARK_ENABLE_TESTING "" OFF)
option (BENCHMARK_ENABLE_WERROR "" OFF) # Does not apply to Debug builds.
FetchContent_MakeAvailable (gbenchmark_fetch_content)

# NOTE: google benchmark's CMakeLists.txt already defines Shlwapi
add_library (gbenchmark ALIAS benchmark_main)

if (NOT TARGET gbenchmark_build)
add_custom_target (gbenchmark_build DEPENDS gbenchmark)
target_compile_options ("benchmark_main" PUBLIC "-w")
endif ()
else ()
message (STATUS "Use Google Benchmark as external project:")
include (FetchContent)
FetchContent_Declare (
gbenchmark_fetch_content
GIT_REPOSITORY "https://github.com/google/benchmark.git"
GIT_TAG "${gbenchmark_git_tag}")
option (BENCHMARK_ENABLE_TESTING "" OFF)
option (BENCHMARK_ENABLE_WERROR "" OFF) # Does not apply to Debug builds.
FetchContent_MakeAvailable (gbenchmark_fetch_content)

seqan3_require_benchmark_old ("${gbenchmark_git_tag}")
# NOTE: google benchmark's CMakeLists.txt already defines Shlwapi
add_library (gbenchmark ALIAS benchmark_main)

if (NOT TARGET gbenchmark_build)
add_custom_target (gbenchmark_build DEPENDS gbenchmark)
endif ()
if (NOT TARGET gbenchmark_build)
add_custom_target (gbenchmark_build DEPENDS gbenchmark)
target_compile_options ("benchmark_main" PUBLIC "-w")
endif ()

endmacro ()
12 changes: 3 additions & 9 deletions test/cmake/seqan3_require_ccache.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# shipped with this file and also available at: https://github.com/seqan/seqan3/blob/master/LICENSE.md
# -----------------------------------------------------------------------------------------------------

cmake_minimum_required (VERSION 3.10)
cmake_minimum_required (VERSION 3.15)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why 15 here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CMAKE_CXX_COMPILER_LAUNCHER is 3.15, I removed the fallback for pre 3.15


# Uses `ccache` to cache build results.
#
Expand All @@ -20,14 +20,8 @@ macro (seqan3_require_ccache)
find_package_message (CCACHE_PROGRAM "Finding program ccache - Failed" "[${CCACHE_PROGRAM}]")
else ()
find_package_message (CCACHE_PROGRAM "Finding program ccache - Success" "[${CCACHE_PROGRAM}]")
# New option since cmake >= 3.4:
# https://cmake.org/cmake/help/latest/variable/CMAKE_LANG_COMPILER_LAUNCHER.html
if (NOT CMAKE_VERSION VERSION_LESS 3.15) # cmake >= 3.15
list (PREPEND CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE_PROGRAM}")
else ()
# prepend ccache to CMAKE_CXX_COMPILER_LAUNCHER
list (INSERT CMAKE_CXX_COMPILER_LAUNCHER 0 "${CCACHE_PROGRAM}")
endif ()

list (PREPEND CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE_PROGRAM}")

# use ccache in external cmake projects
list (APPEND SEQAN3_EXTERNAL_PROJECT_CMAKE_ARGS "-DCMAKE_CXX_COMPILER_LAUNCHER=${CMAKE_CXX_COMPILER_LAUNCHER}")
Expand Down
Loading