From 802e5e34aacb21c0ac1cc32af63830f6311d96ea Mon Sep 17 00:00:00 2001 From: Fredrik Robertsen Date: Thu, 29 Jan 2026 14:42:27 +0100 Subject: [PATCH] add debug-info to cmakelists --- CMakeLists.txt | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index dc3f711..8a0c925 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,17 @@ cmake_minimum_required(VERSION 3.10) project(PS1) +# generate compile_commands.json for clangd/LSP support +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) + +# set default build type to Debug if not specified +if(NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE Debug) +endif() + add_executable(ps1 src/driver.c) + +# ensure debug symbols are included +target_compile_options(ps1 PRIVATE + $<$:-g> +)