This commit is contained in:
tavo 2025-10-05 21:26:33 -06:00
parent 6b979b4a86
commit 4c53238d01
2 changed files with 11 additions and 2 deletions

View file

@ -160,11 +160,13 @@ if(CMAKE_C_COMPILER_ID MATCHES "GNU|Clang")
target_compile_options(${BIN} PRIVATE
$<$<CONFIG:Debug>:-g3 -O0 -Wall -Wextra -DDEBUG -fno-omit-frame-pointer -fsanitize=address,undefined>
$<$<CONFIG:Release>:-O3 -g0 -DNDEBUG -ffunction-sections -fdata-sections -fmacro-prefix-map=${CMAKE_SOURCE_DIR}/=>
$<$<CONFIG:Fast>:-O1 -g0 -DNDEBUG -pipe -march=native>
)
target_link_options(${BIN} PRIVATE
$<$<CONFIG:Debug>:-fno-omit-frame-pointer -fsanitize=address,undefined>
$<$<CONFIG:Release>:-Wl,--gc-sections>
$<$<CONFIG:Fast>:-pipe -march=native>
)
# Enable LTO in Release if supported

View file

@ -1,6 +1,6 @@
BUILD_DIR = build
BUILD_DIR = build
.PHONY: all debug release clean run/debug run/release
.PHONY: all debug release fast clean run/debug run/release run/fast
all: debug
@ -12,11 +12,18 @@ release:
cmake -B $(BUILD_DIR) -DCMAKE_BUILD_TYPE=Release
cmake --build $(BUILD_DIR)
fast:
cmake -B $(BUILD_DIR) -DCMAKE_BUILD_TYPE=Fast
cmake --build $(BUILD_DIR)
run/debug: debug
./$(BUILD_DIR)/proyecto
run/release: release
./$(BUILD_DIR)/proyecto
run/fast: fast
./$(BUILD_DIR)/proyecto
clean:
rm -rf build