Enable gnu extensions for Optick profiler when using gcc compiler, i.e. support ##__VA_ARGS__

This commit is contained in:
Stephen Saunders 2023-07-06 11:21:07 -04:00
parent 37fd056c2d
commit eaa5cf8ff4

View file

@ -1677,6 +1677,15 @@ else()
ENDFOREACH(item)
endif()
# SRS - if using gcc compiler enable gnu extensions for ##__VA_ARGS__ support within optick profiler (i.e. __STRICT_ANSI__ not set)
if(CMAKE_COMPILER_IS_GNUCC)
set_source_files_properties(
${OPTICK_SOURCES}
PROPERTIES
COMPILE_FLAGS "-std=gnu++${CMAKE_CXX_STANDARD}"
)
endif()
GET_DIRECTORY_PROPERTY(_directory_flags DEFINITIONS)
LIST(APPEND _compiler_FLAGS ${_directory_flags})
SEPARATE_ARGUMENTS(_compiler_FLAGS)