Skip to content

Commit

Permalink
CMake: checks if we have C++ compiler before setting standard
Browse files Browse the repository at this point in the history
  • Loading branch information
nicmorais committed Mar 30, 2024
1 parent 5e93082 commit efa5cd9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ set(TESTS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/test)
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules/")
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
if(${CMAKE_CXX_COMPILER} NOT STREQUAL "")
set(CMAKE_CXX_STANDARD 17)
endif(${CMAKE_CXX_COMPILER} NOT STREQUAL "")

if(CMAKE_GENERATOR MATCHES "Unix Makefiles|Ninja")
# some LSP servers expect compile_commands.json in the project root
Expand Down

0 comments on commit efa5cd9

Please sign in to comment.