Skip to content

Commit

Permalink
[build] Apply -stdc=99 on SRT library.
Browse files Browse the repository at this point in the history
  • Loading branch information
maxsharabayko committed Oct 29, 2024
1 parent c1803bb commit d2811cc
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1046,8 +1046,23 @@ macro(srt_set_stdcxx targetname spec)
endif()
endmacro()

macro(srt_set_stdc targetname spec)
set (stdcspec ${spec})
if (NOT "${stdcspec}" STREQUAL "")
if (CMAKE_VERSION VERSION_LESS "3.1")
target_compile_options(${targetname} PRIVATE -std=c${stdcspec})
message(STATUS "C STD: ${targetname}: forced C${stdcspec} standard - GNU option: -std=c${stdcspec}")
else()
set_target_properties(${targetname} PROPERTIES C_STANDARD ${stdcspec})
message(STATUS "C STD: ${targetname}: forced C${stdcspec} standard - portable way")
endif()
else()
message(STATUS "APP: ${targetname}: using default C standard")
endif()
endmacro()

srt_set_stdcxx(srt_virtual "${USE_CXX_STD_LIB}")
srt_set_stdc(srt_virtual "99")

set (VIRTUAL_srt $<TARGET_OBJECTS:srt_virtual>)

Expand Down

0 comments on commit d2811cc

Please sign in to comment.