开发者

How to let Eclipse run different make targets before Run/Debug

开发者 https://www.devze.com 2023-03-12 04:43 出处:网络
I am developing a C++ app in Eclipse with CDT plugin, using my own Makefile. Is there a way how to force Eclipse to run make all before I run the project but make debug before I try to debug it? I wan

I am developing a C++ app in Eclipse with CDT plugin, using my own Makefile. Is there a way how to force Eclipse to run make all before I run the project but make debug before I try to debug it? I want to have the app compiled with -开发者_开发百科g switch during debugging but with -O3 when I run it, without manually rewriting the -g switch in the Makefile each time.

Thanks


If you have created a C++ project of type 'Makefile Project' (i.e where the user is supposed to provide his own Makefile), then you will be able to create several 'Build configurations' using the menu :

Project > Build Configurations > Manage ...

I suggest you create a 'Debug' configuration where the build settings will be 'make debug' and a 'Release' or 'Default' configuration where the build settings are 'make all'.
This way you will be able to build and run/debug in either mode after selecting the wished configuration in menu :

Project > Build Configurations > Set active > ...

I hope this can help! Cheers.

0

精彩评论

暂无评论...
验证码 换一张
取 消