2024-10-24 17:27:07 +03:00
|
|
|
function(CFlagsToVar NAME)
|
|
|
|
set(C_FLAGS ${CMAKE_C_FLAGS})
|
2024-11-07 22:10:17 +03:00
|
|
|
string(REPLACE "${CMAKE_SOURCE_DIR}" "<src dir>" C_FLAGS "${C_FLAGS}")
|
|
|
|
string(REPLACE "${CMAKE_BINARY_DIR}" "<build dir>" C_FLAGS "${C_FLAGS}")
|
|
|
|
|
2024-10-24 17:27:07 +03:00
|
|
|
if (CMAKE_BUILD_TYPE)
|
|
|
|
string(TOUPPER "${CMAKE_BUILD_TYPE}" CAPS_BUILD_TYPE)
|
|
|
|
string(APPEND C_FLAGS " ${CMAKE_C_FLAGS_${CAPS_BUILD_TYPE}}")
|
|
|
|
endif()
|
|
|
|
string(REPLACE "\$" "\\\$" C_FLAGS "${C_FLAGS}")
|
|
|
|
string(REPLACE "\"" "\\\"" C_FLAGS "${C_FLAGS}")
|
|
|
|
set(${NAME} ${C_FLAGS} PARENT_SCOPE)
|
|
|
|
endfunction()
|
|
|
|
|