refactor: tweak cmake settings

This commit is contained in:
Dimitris Panokostas 2024-10-14 09:25:26 +02:00
parent 8ff8a18861
commit 0e301d4671
No known key found for this signature in database
GPG Key ID: 330156A68E9E0929
2 changed files with 3 additions and 3 deletions

View File

@ -1,8 +1,8 @@
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pipe")
set(CMAKE_C_FLAGS_RELEASE "-O3 ${CMAKE_C_FLAGS}")
set(CMAKE_C_FLAGS_DEBUG "-Og -g -funwind-tables -DDEBUG ${CMAKE_C_FLAGS}")
set(CMAKE_C_FLAGS_RELEASE "-O3")
set(CMAKE_C_FLAGS_DEBUG "-Og -g -funwind-tables -DDEBUG")
set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS}")
set(CMAKE_CXX_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE})

View File

@ -16,7 +16,7 @@ endif()
# Run gcc to get the compilation details and remove unwanted flags after -dumpbase
execute_process(
COMMAND sh -c "gcc -### -E - -march=native -mtune=native -mcpu=native 2>&1 | sed -r '/cc1/!d;s/(\")|(^.* - )|( -mno-[^\ ]+)//g;s/ -dumpbase.*//'"
COMMAND sh -c "gcc -### -E - -march=native -mtune=native -mcpu=native 2>&1 | sed -r '/cc1/!d; s/\"//g; s/^.* - //g; s/ -dumpbase.*//'"
OUTPUT_VARIABLE CMAKE_C_FLAGS
OUTPUT_STRIP_TRAILING_WHITESPACE
)