I basically want to know how to turn off optimization so that gdb works correctly.
When I set up an Automake project from scratch, it seems like the defaults for CPPFLAGS are "-g -O2", but I just want "-g". There is an unrelated question where the answer shows Project.ede files that have the configuration-variables field set for the target here:
Setting up an emacs EDE-project with libraries
Based on this, I edited my target to produce the following Project.ede:
;; Object test3
;; EDE Project Files are auto generated: Do Not Edit
(ede-proj-project "test3"
:file "Project.ede"
:name "test3"
:targets (list
(ede-proj-target-makefile-program "test3"
:name "test3"
:path ""
:source '("main.cpp")
:configuration-variables '(("debug" ("CPPFLAGS" . "-g")) ("release" ("CPPFLAGS" . "-O3")))
:ldlibs '("boost_program_options" "boost_system")
)
)
:makefile-type 'Makefile.am
)
However, executing ede-compile-project and ede-compile-target after these edits still produces the same "-g -O2" values. How do I activate the "debug" configuration that I created? Also, how can I set this to be the default set of configurations for new projects so I don't need to change every new project that I create manually?
You can change current configuration in project settings.
M-x customize-project, then go to the Settings tab and change the Current Configuration value.