I created a default build2
executable,
bdep new -t exe -l c++,cpp hello
edited the hello.cpp
,
#include <iostream>
int main (int argc, char* argv[]) {
using namespace std;
#ifdef NDEBUG
cout << "Debug: off\n";
#else
cout << "Debug: on\n";
#endif
}
created two configs (debug and release),
cd hello/
bdep config create ../hello-debug @debug cc config.cxx=g++ config.cxx.coptions=-g
bdep config create ../hello-release @releasecc config.cxx=g++ config.cxx.coptions=-O3
and initialized both.
bdep init @debug @release
I then run
bdep update @debug
and when I run the program I get Debug: on
.
But now I want to build the executable in release mode
bdep update @release
but I still get the Debug: on
output.
How do I switch configurations in build2