This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Build profile information in .cfg file

Hi,

is there a way to distinguish between "Release" and "Debug" build profile (CCS build configuration) in a SYS/Bios .cfg file?
The .cfg file I am using is in a "CCS RTSC Configuration" project.

I tried the following code, but it always returns "release":

var Main = xdc.useModule('xdc.tools.configuro.ccs.Main');
var params = new Main.Params;

print("Build profile: "+params.profile);

Is there an other way to figure this out?


Thanking you in anticipation,

Sebastian


  • Sebastian,
    the RTSC profile and the CCS build configuration are not automatically synchronized. The first one is used to build C files generated by RTSC, while the other refers to build options for your app. If you want them to be the same, you have to do it manually. Switch between CCS build configurations, and for each go to Project->Properties->CCS General->RTSC and set the RTSC profile.

    If you don't want to do that, you can get the name of the directory of the RTSC package you are building, and then parse it for "Debug" or "Release".  You can get the directory name from
    xdc.loadPackage(Program.build.cfgHome).packageRepository

    BTW, to get the RTSC profile, you don't need the code you posted. You can simply reference Program.build.profile. Here is the documentation for Program, with the various properties that you can get from it: http://rtsc.eclipse.org/cdoc-tip/xdc/cfg/Program.html

  • Thank you for the answer,

    parsing xdc.loadPackage(Program.build.cfgHome).packageRepository for "Release" did the trick.
    My code now looks like this:

    var repLocation=xdc.loadPackage(Program.build.cfgHome).packageRepository;
    if(repLocation.search(/Debug.$/i)>=0)
    {
        print('Debug Build Configuration');
    }
    else if(repLocation.search(/Release.$/i)>=0)
    {    
        print('Release Build Configuration');
    }
    else
    {
        print('Unknown Build Configuration');
    }