Skip to content

Commit

Permalink
lv_sim: cmake: let the user specify the C++ standard version
Browse files Browse the repository at this point in the history
  • Loading branch information
NeroBurner committed Jan 30, 2022
1 parent 40494b7 commit b22e175
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions lv_sim/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,17 @@ set(PROJECT_VERSION ${CMAKE_MATCH_1})
message(STATUS "InfiniTime PROJECT_VERSION extracted: ${PROJECT_VERSION}")

project(lv_sim VERSION ${PROJECT_VERSION} LANGUAGES C CXX)
# https://cmake.org/cmake/help/latest/prop_tgt/CXX_STANDARD.html
string(COMPARE EQUAL "${CMAKE_CXX_STANDARD}" "" no_cmake_cxx_standard_set)
if(no_cmake_cxx_standard_set)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
message(STATUS "Using default C++ standard ${CMAKE_CXX_STANDARD}")
else()
message(STATUS "Using user specified C++ standard ${CMAKE_CXX_STANDARD}")
endif()
set(CMAKE_C_STANDARD 11)#C11
set(CMAKE_CXX_STANDARD 17)#C17
set(CMAKE_CXX_STANDARD_REQUIRED ON)

file(GLOB_RECURSE INCLUDES "lv_drivers/*.h" "../src/libs/lvgl/src/*.h" "./*.h" )
file(GLOB_RECURSE SOURCES "lv_drivers/*.c" "../src/libs/lvgl/src/*.c" )
Expand Down

0 comments on commit b22e175

Please sign in to comment.