add fix to prevent GCC compilation crashing
This commit is contained in:
@@ -6,9 +6,15 @@ set(CMAKE_CXX_STANDARD 23)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
# define explicitely GCC version to prevent redefintion by CLANG
|
||||
# if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
# add_compile_options(-fgnuc-version=${CMAKE_CXX_COMPILER_VERSION})
|
||||
# endif()
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
# add_compile_options(-fgnuc-version=${CMAKE_CXX_COMPILER_VERSION})
|
||||
string(REPLACE "." ";" VERSION_LIST ${CMAKE_CXX_COMPILER_VERSION})
|
||||
list(GET VERSION_LIST 0 VER_MAJOR)
|
||||
list(GET VERSION_LIST 1 VER_MINOR)
|
||||
list(GET VERSION_LIST 2 VER_PATCH)
|
||||
math(EXPR GCC_VER "${VER_MAJOR}*10000+${VER_MINOR}*100+${VER_PATCH}")
|
||||
add_compile_definitions("GCC_VERSION=${GCC_VER}")
|
||||
endif()
|
||||
|
||||
# for ccls
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
|
||||
Reference in New Issue
Block a user