Skip to content

Commit

Permalink
Check that CMAKE_CXX_COMPILER_VERSION is set and if not, issue an err…
Browse files Browse the repository at this point in the history
…or. Refs #74.
  • Loading branch information
pdimov committed Sep 9, 2024
1 parent 2132658 commit d85e1b5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions BoostDetectToolset.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt)

if(NOT DEFINED CMAKE_CXX_COMPILER_VERSION)

message(SEND_ERROR "Boost requires C++, but no C++ compiler is configured; add LANGUAGES CXX to your project() declaration")
return()

endif()

string(REGEX MATCHALL "[0-9]+" _BOOST_COMPILER_VERSION ${CMAKE_CXX_COMPILER_VERSION})

list(GET _BOOST_COMPILER_VERSION 0 _BOOST_COMPILER_VERSION_MAJOR)
Expand Down

0 comments on commit d85e1b5

Please sign in to comment.