Skip to content

Commit

Permalink
[INFRA] Ensure that CXX and C compilers are same major version
Browse files Browse the repository at this point in the history
  • Loading branch information
eseiler committed Aug 17, 2023
1 parent 34019df commit b376837
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 9 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ list (APPEND CMAKE_MODULE_PATH "${RAPTOR_MODULE_PATH}")
include (raptor-config-version)

project (raptor
LANGUAGES CXX
LANGUAGES CXX C
VERSION "${RAPTOR_PROJECT_VERSION}"
DESCRIPTION "Raptor -- A fast and space-efficient pre-filter for querying very large collections of nucleotide sequences"
HOMEPAGE_URL "https://github.com/seqan/raptor"
Expand Down
14 changes: 14 additions & 0 deletions build_system/raptor-config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,20 @@ macro (raptor_config_error text)
endif ()
endmacro ()

# ----------------------------------------------------------------------------
# Check CXX and C compiler versions (xxHash uses C).
# ----------------------------------------------------------------------------

string (REGEX MATCH "^[0-9]+" RAPTOR_CXX_MAJOR_VERSION "${CMAKE_CXX_COMPILER_VERSION}")
string (REGEX MATCH "^[0-9]+" RAPTOR_C_MAJOR_VERSION "${CMAKE_C_COMPILER_VERSION}")
if (NOT "${RAPTOR_CXX_MAJOR_VERSION}" STREQUAL "${RAPTOR_C_MAJOR_VERSION}")
raptor_config_error ("CXX and C compiler major versions differ (${RAPTOR_CXX_MAJOR_VERSION} and\
${RAPTOR_C_MAJOR_VERSION})! This will likely result in linker errors. Please set both\
-DCMAKE_CXX_COMPILER and -DCMAKE_C_COMPILER to use the same major version, and/or set the\
environment variables CXX and CC accordingly."
)
endif ()

# ----------------------------------------------------------------------------
# Find RAPTOR include path
# ----------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion test/coverage/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

cmake_minimum_required (VERSION 3.18)

project (raptor_test_coverage CXX)
project (raptor_test_coverage LANGUAGES CXX C)

include (../cmake/raptor_require_ccache.cmake)
raptor_require_ccache ()
Expand Down
2 changes: 1 addition & 1 deletion test/header/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

cmake_minimum_required (VERSION 3.10)

project (raptor_test_header CXX)
project (raptor_test_header LANGUAGES CXX C)

include (../raptor-test.cmake)
include (GoogleTest OPTIONAL)
Expand Down
2 changes: 1 addition & 1 deletion test/performance/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

cmake_minimum_required (VERSION 3.10)

project (raptor_test_performance CXX)
project (raptor_test_performance LANGUAGES CXX C)

option (BUILD_RAPTOR_APP_FOR_TEST "" OFF)
include (../raptor-test.cmake)
Expand Down
2 changes: 1 addition & 1 deletion test/snippet/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# --------------------------------------------------------------------------------------------------------

cmake_minimum_required (VERSION 3.10...3.22)
project (raptor_test_snippet CXX)
project (raptor_test_snippet LANGUAGES CXX C)

include (../raptor-test.cmake)
include (raptor_test_component)
Expand Down
2 changes: 1 addition & 1 deletion test/unit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

cmake_minimum_required (VERSION 3.10)

project (raptor_test_unit CXX)
project (raptor_test_unit LANGUAGES CXX C)

include (../raptor-test.cmake)
include (GoogleTest OPTIONAL)
Expand Down
2 changes: 1 addition & 1 deletion util/applications/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ list (APPEND CMAKE_MODULE_PATH "${RAPTOR_CLONE_DIR}/build_system")

include (raptor-config-version)

project (raptor_utility_common LANGUAGES CXX)
project (raptor_utility_common LANGUAGES CXX C)

find_package (Raptor REQUIRED HINTS ${RAPTOR_CLONE_DIR}/build_system)

Expand Down
2 changes: 1 addition & 1 deletion util/iScience/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ list (APPEND CMAKE_MODULE_PATH "${RAPTOR_CLONE_DIR}/build_system")

include (raptor-config-version)

project (raptor_utility_common LANGUAGES CXX)
project (raptor_utility_common LANGUAGES CXX C)

find_package (Raptor REQUIRED HINTS ${RAPTOR_CLONE_DIR}/build_system)

Expand Down
2 changes: 1 addition & 1 deletion util/iScience/thresholding/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
cmake_minimum_required (VERSION 3.18)

# Define the application name.
project (minimizer_thresholds CXX)
project (minimizer_thresholds LANGUAGES CXX C)

# Make Release default build type
if (NOT CMAKE_BUILD_TYPE)
Expand Down

0 comments on commit b376837

Please sign in to comment.