Код: Выделить всё
add_executable(hello main.cpp)
set(helloCompileOptions -Wall -Wextra -O3 -Wno-narrowing -ffast-math -march=native)
target_compile_options(hello PRIVATE ${helloCompileOptions})
target_compile_features(hello PUBLIC cxx_std_23)
add_compile_definitions(COMPILE_OPTIONS="${helloCompileOptions}")
< /code>
создает эти ошибки компиляции: < /p>
[build] :1:9: error: macro name must be an identifier
[build] 1 | #define -O3 1
[build] | ^
[build] :2:9: error: macro name must be an identifier
[build] 2 | #define -Wextra 1
[build] | ^
...
Подробнее здесь: https://stackoverflow.com/questions/777 ... t-argument