I have a Makefile that based on given target (all/debug) generates executable in release/debug directories on the project folder. I have setup the Eclipse-CDT C/C++ build behavior mechanism to generate the r开发者_如何学JAVAight output depending on the active build configuration.
For example the "release" build configuration will call "make" with "all" as the behavior, that makes release/output file, "debug" configuration makes a debug version at debug/output
So far so good, but when I need to setup the "run configurations" I should enter the path for the binary (search project just does not show anything), Variable ${ConfigName} also does not expand there so I cannot use something like ${ConfigName}/output as binary to run/debug. I also tried adding release and debug to the "Paths and symbols"/"Output location" and that not help either.
I can enter the relative/absolute path (for examle ./release/output) there and if I hit run, it runs the binary or if I hit debug it debugs it. However, because of the reliance on the path I have to have two launch configurations one for debug and one for release.
The problem is that run and debug configurations are basically the same only one has the option to customize gdb, which makes it very confusing. Regardless of whether it is debug or release active, one can run/debug any of the four combinations!
Is there anyway I can run/debug what actually is built? so if the debug build is active one can run/debug the debug build? I am not even constraining the debug build to be non-runnable or the release build to be non-debuggable, I guess that is asking too much. The problem is because of the two launch configurations, and I cannot find anyway to make it just one that depends on the build configuration.
精彩评论