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.

How to build only the Dependent Build Configuration for a project on CCSv4.2?

Hello,

I have a Application project that has many dependent static library projects.  Those static library projects have multiple build configurations.  I set the dependent library projects with a specific build configuration.  When I build my application, it compiles two versions of one dependent library.  It compiles the version defined as the dependent configuration and it also compiles the selected configuration on that project.

Example:

Project liba has Release and Debug build configurations. Debug is selected.

Project libb has Release and Debug build configurations. Debug is selected.

Project app.out is set to active Release build configuration.  For this configuration, liba Release and libb Release are dependencies.

When I build this example.  liba relese and debug are generated, libb release and debug are generated. and my release app.out is generated.

With a project of many more static libraries, this is not acceptable.  Is there a way to avoid this behaviour?

 

I am using Code Composer Studio Version 4.2.0.

 

-Hector

  • Hector,

    I could reproduce this behavior, looks like a bug to me. Both the Debug and Release configurations of the library project do seem to get built every time even if the dependency lists only one of build configurations. I will submit a defect report for this and then report the tracking number here.

  • Bug tracking # for this issue is SDSCM00039514.

  • What is happening is that Eclipse doesn't associate the specific config in the dependency relationship so when you click on build Eclipse builds the current config of the dependent project, then when it gets to the main project the TI code goes and looks and sees if the specified dependent config needs to be built and builds it.  

    I agree with Aarti that this is a bug.  However it might be a while before it can be fixed depending on what is involved.  One potential workaround would be to use the scripting console to do the build.  You could create a little script that explicitly built the correct configurations prior to building the main project.  Then when you want to build you could just type BuildMyProjects (or whatever the function is called) in the scripting console and it would run that function.  The functions can take parameters so you could have BuildMyProjects Debug or BuildMyProjects Release.  

    Based on our earlier discussions this is something you will deploy to others so you could make them pretty simple.  

    If you think this idea might work we could provide some more info on this.  There is an overview of the scripting console here: http://processors.wiki.ti.com/index.php/Scripting_Console

     

    Regards,

    John

     

     

  • Hello,  I have more unexpected behaviour in relation to Project Dependencies:

     

    I have an Application project that has many dependent static library projects.  Those static library projects have multiple build configurations.  I set the dependent library projects with a specific build configuration.  When I build my application with a configuration that does not exist on the dependent projects, but the project dependencies are defined to build configurations that exist, I get unexpected behaviour as to what gets built. 

    Example:

     

    Project liba has Release and Debug build configurations.

    Project libb has Release and Debug build configurations.

     

    Project app.out is set to active Test_Release build configuration.  For this configuration, liba Release and libb Release are dependencies.

     

    When I build this example, the tool looks to build Test_Release on liba and libb even when my Project Dependency is set to Release.  It says Test_Release was not found and defaults to active Build Configuration.

     

    On the real project that I am working on with many build configurations, the tool looks for a Build Configuration that does not exist and then builds one configuration that I don’t need (Debug) and it never builds the correct configuration.

     

    As you can see, this is not acceptable behavior.  Can you please advice me as to how avoid this behavior?

     

     

     

    I am using Code Composer Studio Version 4.2.1.

     

     

     

    -Hector

  • Hector,

    For now if I created some examples scripts that built a specific set of dependent configs for a project would that help you?

    i.e. for the above example I could create one that would build liba release, libb release and app Test_Release

    This would need to be expanded to handle your real app which has many dependent projects but the general idea would still work.

     

    Regards,

    John

  • Please do.

    -Thanks

    Hector

  • Hector,

    In the attached zip there is a javascript file for the scripting console.  It defines a new function called buildConfig which takes 2 parameters, project name and config name.  Also in the file are some example functions that build sets of configurations.  They should show how you can create functions that perform a desired build combination.

     

    function buildSet1()

    {

    buildConfig("LibA", "Debug");

    buildConfig("LibB", "Debug");

    buildConfig("App", "Debug");

    }

     

    function buildSet2()

    {

    buildConfig("LibA", "Release");

    buildConfig("LibB", "Release");

    buildConfig("App", "Release");

    }

     

     

    function buildSet3()

    {

    buildConfig("LibA", "Release");

    buildConfig("LibB", "Release");

    buildConfig("App", "Debug");

    }

     

     

    In the script I also show how you can add menu items to the scripts menu that map to these items.

     

    To use the example script open the scripting console from the view menu.  type loadJSfile and give it the path in quotes to where the file is on your machine.  For me this is:

    loadJSFile "C:\Development Tools\Examples\Scripting Console\buildConfig.js" 

    There is also a folder you can drop scripts into that will automatically be loaded.  I will try to find that.

     

    Now to use the function you can just type buildConfig("project", "config") where project and config are the names of the project and config you want to build.

    IMPORTANT: you will have to remove the project dependencies you have setup since if they are still there then building the parent project will trigger a build of the dependent project (and probably the wrong config).

     

    5226.buildConfig.zip

     

    Give it a try and let me know how it works.

     

    I may tweak the script a bit more so that you can type help buildConfig and get help for the function.  I can't recall how to do that right now.

     

    Regards,

    John

     

     

     

  • I loaded the file and it works great.  My question is, how do I get this to work from the command line?  My App Project does not have dependencies anymore.  I was going to use the command line functionality to build the dependent projects but since it does a rebuild (clean and then build) of the projects all the time, it will not work.

    -Hector 

  • Attached is an updated version of the script.  I changed the comments so that they populate the help command in the scripting console.

    0435.buildConfig.zip

    When you say command line do you mean outside of CCS using the tool described here http://processors.wiki.ti.com/index.php/Projects_-_Command_Line_Build/Create?

    I tested out the commands there and if you don't pass clean it will do an incremental build.

     

    John