How to turn off project references please?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to turn off project references please?

2,706 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by cyberstudio on Sun Mar 23 13:34:44 MST 2014
After doing a headless build on the command line, LPCXpresso always fills in Project references automatically (under the project's Properties). I have been struggling to turn off this behaviour but to no avail yet.

As for why I wish to turn this off, I have a set of projects each with a set of configurations. If project A depends on project B, I would expect when I build configuration X of project A, it would build configuration X of project B first. But it is not doing that - it is building whatever happens to be the active configuration of project B at the time, which is pointless.

I can always precisely specify which configurations are depended upon by "C/C++ General" > "Path and Symbols" > "References", which is the feature I am depending upon (no pun intended), but the automatic "Project References" gets in the way whenever I do a headless build, then I will have to go to each project and each configuration to uncheck all the project references it has automatically found, which is a huge pain.

How to prevent the headless build from automatically adding all those project references? Thanks.
0 Kudos
Reply
12 Replies

2,670 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by cyberstudio on Sun Apr 06 15:53:08 MST 2014
Thank you very much. Using regular expressions the build is fixed but unfortunately a new problem arises: it is not cleaning the proper configurations before building the projects. It is cleaning the active configurations first, but sometimes other configurations do not get cleaned before getting built.
0 Kudos
Reply

2,670 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Wed Mar 26 02:19:40 MST 2014
Problem 1: This behaviour is correct. It may not be what you want, but it is correct. See
http://www.lpcware.com/content/faq/lpcxpresso/change-build-config

Problem 2: There does appear to be a bug in Eclipse here. The workaround is to specify which build configuration you want built. So, instead of using
-cleanBuild all

use
-cleanBuild .*/Release
or
-cleanBuild .*/Debug

depending on which configuration you want to build. Doing it this way seems to workaround the bug.

Note: the parameter to the cleanBuild option is defined as:
{project_name_reg_ex{/config_reg_ex} | all}

where:
[list]
  [*]project_name_reg_ex is a regular expression that matches the projects you wish to build. ".*" is a regular expression that matches every project name
  [*]config_reg_ex is a regular expression for the build configurations. If you wanted to build both Debug and Release, you would use "(Debug|Release)"
[/list]
0 Kudos
Reply

2,670 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by cyberstudio on Tue Mar 25 12:57:27 MST 2014
Problem 2: use of "Paths and Symbols" references result in automatic addition of top level "Project References"

1. Continue with the workspace above.
2. Uncheck all in the top level "Project References" tab.
3. right click project "a", Properties > C/C++ general > Path and Symbols > References.
4. make Release "a" depend on Release LPCOpen library and Release board library.
5. Active configuration of "a" = "Release". Active configuration of all dependent libraries = "Debug".
6. Build "a". Note "Release" configurations of dependencies are built, as it is supposed to.
7. Close LPCXpresso to save workspace.
8. execute headless build on command line.
C:\nxp\LPCXpresso_7.0.2_102/lpcxpresso/lpcxpressoc.exe -clean -nosplash --launcher.suppressErrors -application org.eclipse.cdt.managedbuilder.core.headlessbuild -cleanBuild all -data (workspace directory)

9. Open LPCXpresso again.
10. right click project "a", Properties > "Project References".
11. All projects are checked, though they were unchecked in step 2.
0 Kudos
Reply

2,670 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by cyberstudio on Tue Mar 25 12:41:16 MST 2014
Problem 1: Project References build the wrong configuration of dependency, resulting in build failure.

1, Start with a completely new workspace.
2. New > Project > LPCXpresso C Project > select MCU > LPCOpen C Project > name it "a".
3. Import LPCOpen into workspace as required.
4. Point "a" to LPCOpen in "select LPCOpen libraries" in wizard.
5. Click through the remaining pages of wizard and "Finish".
6. Set active configuration of "a" to "Release".
7. Build "a".
8. Active configuration of LPCOpen happens to be "Debug", so "Debug" got built.
9. See error
Building target: a.axf
Invoking: MCU Linker
arm-none-eabi-gcc -nostdlib -Xlinker -Map="a.map" -Xlinker --gc-sections -Xlinker --allow-multiple-definition -mcpu=cortex-m0 -mthumb -T "a_Release.ld" -o "a.axf"  ./src/aeabi_romdiv_patch.o ./src/cr_startup_lpc11uxx.o ./src/crp.o ./src/main.o ./src/sysinit.o   -lnxp_lpcxpresso_11u37h_board_lib -llpc_chip_11uxx_lib
c:/nxp/lpcxpresso_7.0.2_102/lpcxpresso/tools/bin/../lib/gcc/arm-none-eabi/4.8.3/../../../../arm-none-eabi/bin/ld.exe: cannot find -lnxp_lpcxpresso_11u37h_board_lib
c:/nxp/lpcxpresso_7.0.2_102/lpcxpresso/tools/bin/../lib/gcc/arm-none-eabi/4.8.3/../../../../arm-none-eabi/bin/ld.exe: cannot find -llpc_chip_11uxx_lib
collect2.exe: error: ld returned 1 exit status
make: *** [a.axf] Error 1


How do we resolve problem 1?
0 Kudos
Reply

2,670 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Tue Mar 25 11:30:29 MST 2014
I am really confused. There is no automatic feature that adds project references.

So please supply an example project that demonstrates this behaviour, giving exact details of how to reproduce your problem.
0 Kudos
Reply

2,670 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by cyberstudio on Tue Mar 25 11:04:52 MST 2014
Thank you.

Basically the docs say project references does not account for configurations but references tab does. So the answer to my second question is "it can't be done".

See how I am still in a limbo? All I am asking is either an automatic feature which makes sense, OR there is some way to turn that said automatic feature off. So far, neither can be accomplished?!
0 Kudos
Reply

2,670 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Tue Mar 25 10:29:17 MST 2014
I suggest you read the Help docs on "project references" and "references tab".
0 Kudos
Reply

2,670 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by cyberstudio on Tue Mar 25 10:26:05 MST 2014
Your help is very much appreciated!

I unchecked every checkbox in both the top level Project References and also the ones under Paths and Symbols. Now do a headless build. Of course there were failures because without the references the projects were built in the wrong order.

Then, I checked the checkboxes under Paths and Symbols and build again. After the build, the top level Project References are automatically checked, too.

I am now in a limbo. Like I explained in my original question why I didn't want to use the top level project references, I have many configurations for each project but unfortunately the top level "project references" feature only reference the active configuration.

Consider project A with config X and Y, and project B with config X and Y, and project A depends on project B. Let's say the active configuration of B is Y and the active configuration A is X. When I build project A, it builds configuration Y of project B, which is pointless and wrong. If X=Release and Y=Debug, then you could see how pointless it is to build project B's Debug configuration first. Project A's Release configuration can't even find the binary from Project B's Release configuration, which wasn't built at all.

The deep "Path and Symbols" references allowed me to precisely specify which configuration was depended upon, but the top level Project References were insistent on coming back in with its pointless behaviour.

If the behvaiour of the top level project references makes any sense, I would be more than happy to use it instead of the one in Paths and Symbols. Unfortunately what the top level project references do doesn't make any sense.

I was asking 2 questions actually, sorry if that confused you. So let's say the answer to my first question which was how to turn off automatic project references, and the answer was to not use Path and Symbols. Okay that's fine. Now to my second question, how do we make the top level Project References build the same configuration instead of whatever the active configuration happens to be? How about that one? Thanks.
0 Kudos
Reply

2,670 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Tue Mar 25 02:59:55 MST 2014
BTW: Did you follow my instructions for turning off Project References (which is not the way that you described in your first email). i.e. DO NOT use the "Paths and Symbols" project references.
0 Kudos
Reply

2,670 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Tue Mar 25 02:55:03 MST 2014
If you uncheck them they stay unchecked. Are you sure you are saving the project and using the saved version in your build? Are you using a version control system and forgotten to check the project files back in?
0 Kudos
Reply

2,670 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by cyberstudio on Tue Mar 25 02:23:29 MST 2014
Thank you but every time I do a headless clean build on the command line those references come back "automatically". How do I make those checkboxes stay unchecked? It is a huge nuisances to have to manually uncheck every time I do a headless build.
0 Kudos
Reply

2,670 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Tue Mar 25 00:44:38 MST 2014
In Project properties, at the 'top level, there is a section for "Project References".
0 Kudos
Reply