Fixed error with cmake not taking build flags

This commit is contained in:
2025-03-28 11:03:30 -04:00
parent e97bd6a727
commit 67b0b77156
2 changed files with 5 additions and 8 deletions

View File

@ -6,11 +6,7 @@ set(CMAKE_C_STANDARD 17)
add_executable($ENV{MAKE_NAME})
if(NOT "$ENV{MAKE_CFLAGS}" STREQUAL "")
string(REPLACE " " ";" CFLAGS_LIST $ENV{MAKE_CFLAGS})
foreach(X IN LISTS CFLAGS_LIST)
message(STATUS "Using C compilation flag ${X}")
add_compile_options(${X})
endforeach()
set_target_properties($ENV{MAKE_NAME} PROPERTIES COMPILE_FLAGS $ENV{MAKE_CFLAGS})
endif()
if(NOT "$ENV{MAKE_C_SRCS}" STREQUAL "")