why is cmake producing a binary with debug_info and not stripped?
here is my CMakeLists.txt
cmake_minimum_required(VERSION 3.22)
# project name
project(c-program)
set(CMAKE_C_COMPILER "/usr/bin/gcc")
set(CMAKE_C_STANDARD "90")
set(CMAKE_C_STANDARD_REQUIRED true)
set(CMAKE_C_FLAGS "-ansi -Wall")
set(CMAKE_C_FLAGS_DEBUG "-g3 -ggdb3")
set(CMAKE_C_FLAGS_RELEASE "-O3 -DNDEBUG")
add_executable(c-program c-program.c)
i build like this from the project root folder
$ cmake -S . -B build/release -DCMAKE_BUILD_TYPE=Release
$ cmake --build build/release
when running
$ file build/release/c-program
i get
build/release/c-program: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-musl-x86_64.so.1, with debug_info, not stripped
i am confused about how debug/release builds are supposed to work, and nothing in the cmake tutorial guides or docs or otherwise online is helping me figure out why this is happening