Skip to content

Commit

Permalink
PROTON-2786: Don't reuse possibly incorrect CMAKE_CXX_COMPILER valu…
Browse files Browse the repository at this point in the history
…e determined by `check_language(CXX)` (#415)
  • Loading branch information
jiridanek committed Dec 22, 2023
1 parent 058dcaa commit 001195c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,12 @@ set (C_EXTENDED_FLAGS ${C_EXTENDED_${CMAKE_C_COMPILER_ID}})
## C++
check_language (CXX)
if (CMAKE_CXX_COMPILER)
# check_language(CXX) does not handle compiler parameters in CXX env variable well
# forget the result of the check and let enable_language(CXX) to do this correctly
unset(CMAKE_CXX_COMPILER)
unset(CMAKE_CXX_COMPILER CACHE)
enable_language(CXX)

# This effectively checks for cmake version 3.1 or later
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_EXTENSIONS OFF)
endif()
Expand Down

0 comments on commit 001195c

Please sign in to comment.