1 set(CMAKE_EXPORT_COMPILE_COMMANDS 1 CACHE BOOL "Enable/Disable output of compile commands during generation.")
2 mark_as_advanced(CMAKE_EXPORT_COMPILE_COMMANDS)
3 if(NOT DEFINED CACHE{LIBA_CXX})
4 option(LIBA_CXX "Enable/Disable C++" 1)
6 list(FIND LANGUAGES CXX index)
7 if(${index} EQUAL -1 AND LIBA_CXX)
8 list(INSERT LANGUAGES 0 CXX)
10 list(FIND LANGUAGES C index)
12 list(INSERT LANGUAGES 0 C)
15 if(NOT CMAKE_C_STANDARD)
16 set(CMAKE_C_STANDARD 11)
18 if(NOT CMAKE_C_EXTENSIONS)
19 set(CMAKE_C_EXTENSIONS 0)
21 if(NOT CMAKE_C_STANDARD_REQUIRED)
22 set(CMAKE_C_STANDARD_REQUIRED 0)
24 # default C++ standard
25 if(NOT CMAKE_CXX_STANDARD)
26 set(CMAKE_CXX_STANDARD 11)
28 if(NOT CMAKE_CXX_EXTENSIONS)
29 set(CMAKE_CXX_EXTENSIONS 0)
31 if(NOT CMAKE_CXX_STANDARD_REQUIRED)
32 set(CMAKE_CXX_STANDARD_REQUIRED 0)
34 if(CMAKE_C_COMPILER_ID MATCHES "TinyCC")
35 string(FIND CMAKE_C_FLAGS "-std=c${CMAKE_C_STANDARD}" index)
37 string(STRIP "${CMAKE_C_FLAGS} -std=c${CMAKE_C_STANDARD}" CMAKE_C_FLAGS)