Skip to content

Commit

Permalink
Merge pull request #122 from eseiler/infra/fixes
Browse files Browse the repository at this point in the history
[INFRA] Small CMake fixes
  • Loading branch information
eseiler authored Sep 11, 2023
2 parents ec4cedc + 845f5a7 commit 206a5f7
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci_asan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
- name: Install CMake
uses: seqan/actions/setup-cmake@main
with:
cmake: 3.12.4
cmake: 3.13.5

- name: Configure tests
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci_header.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
- name: Install CMake
uses: seqan/actions/setup-cmake@main
with:
cmake: 3.12.4
cmake: 3.13.5

- name: Configure tests
run: |
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 @@ -88,7 +88,7 @@ jobs:
- name: Install CMake
uses: seqan/actions/setup-cmake@main
with:
cmake: 3.12.4
cmake: 3.13.5

- name: Configure tests
run: |
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 @@ -67,7 +67,7 @@ jobs:
- name: Install CMake
uses: seqan/actions/setup-cmake@main
with:
cmake: 3.12.4
cmake: 3.13.5

- name: Configure tests
run: |
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required (VERSION 3.2 FATAL_ERROR)
cmake_minimum_required (VERSION 3.13 FATAL_ERROR)
set (CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules")

## (1) Read and set library version
Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ Tests are run with C++20 and C++23.

As SDSL v3 is header-only, dependencies marked as `required` only apply to building tests/examples.

* required: [CMake >= 3.2](https://github.com/Kitware/CMake)
* required: [googletest 1.13.0](https://github.com/google/googletest/releases/tag/release-1.13.0)
* optional: [cereal 1.3.2](https://github.com/USCiLab/cereal)
GoogleTest and cereal are provided as submodules within this repository.

* required: [CMake >= 3.13](https://github.com/Kitware/CMake)
* required: [GoogleTest 1.14.0](https://github.com/google/googletest/releases/tag/v1.14.0)
* optional: [cereal 1.3.2](https://github.com/USCiLab/cereal/releases/tag/v1.3.2)

cereal can be activated by passing `-DSDSL_CEREAL=1` to CMake.
9 changes: 9 additions & 0 deletions external/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ macro (add_gtest)
list (APPEND SDSL_EXTERNAL_PROJECT_CMAKE_ARGS "-DCMAKE_INSTALL_PREFIX=${PROJECT_BINARY_DIR}")
list (APPEND SDSL_EXTERNAL_PROJECT_CMAKE_ARGS "-DCMAKE_VERBOSE_MAKEFILE=${CMAKE_VERBOSE_MAKEFILE}")

if (NOT EXISTS "${CMAKE_CURRENT_LIST_DIR}/googletest/googletest/include/gtest/gtest.h")
message (STATUS "Checking out googletest submodule")
execute_process (
COMMAND git submodule update --init external/googletest
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/..
OUTPUT_QUIET
)
endif ()

set (gtest_project_args ${SDSL_EXTERNAL_PROJECT_CMAKE_ARGS})
list (APPEND gtest_project_args "-DCMAKE_CXX_FLAGS=-w")
Expand Down Expand Up @@ -64,6 +72,7 @@ if (SDSL_CEREAL)
set (cereal_dir ${CMAKE_CURRENT_LIST_DIR}/cereal/include/cereal)
set (cereal_file ${cereal_dir}/cereal.hpp)
if (NOT EXISTS ${cereal_file})
message (STATUS " Checking out cereal submodule")
execute_process (
COMMAND git submodule update --init external/cereal
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/..
Expand Down
2 changes: 1 addition & 1 deletion external/googletest
Submodule googletest updated 144 files
7 changes: 7 additions & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@ file (GLOB test_sources ${CMAKE_CURRENT_SOURCE_DIR}/*_test.cpp)
include_directories (${sdsl_include_directory})
include_directories (SYSTEM ${gtest_dir}/googletest/include)

## Bogus warnings in GCC12
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU"
AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 12
AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 13)
add_compile_options (-Wno-restrict)
endif ()

link_libraries ("gtest_main" "gtest")

if (SDSL_CEREAL)
Expand Down

0 comments on commit 206a5f7

Please sign in to comment.