Hi,
The documentation for using TwineCompile with msbuild describes Import-ing the TwineCompile target file in a specific location in the .cbproj file (after the CodeGear.Cpp.Targets line).
This works well as described - the multi-threaded compiler in invoked for all .cbproj files that have this addition.
However, in a setting such as ours with our total build made up of a number of .cbproj files, it seems a little cumbersome to inject this Import into each and every file.
We already use .targets files to reuse build config, along with the higher level msbuild .proj files. Is it at all possible to activate TwineCompile using an Import statement for the TwineCompile .target in our own "myApp.targets" file, include that at the top in the "app.proj" file and have the magic happen for all builds covered by that .proj? I have not had any success with my initial attempts at this, so my assumption is that the location of the import matters in order for the Twine targets to be applied in the individual .cbproj builds.
Grateful for any input or suggestions on this. I would like to be able to "sneak in" TwineCompile support using a conditional Import without touching every .cbproj (including future ones).
TwineCompile and msbuild: .proj/.targets instead of .cbproj?
Re: TwineCompile and msbuild: .proj/.targets instead of .cbproj?
This is an interesting problem, and I don't think I have a solution for you unfortunately.
The reason why the TwineCompile targets file has to be at the end is because it has to overwrite a number of settings set by CodeGear.Cpp.Targets, which is imported by all C++Builder projects right at the end of the file. If these settings are not overwritten, TwineCompile doesn't get inserted into the build process, and the standard C++Builder MSBuild flow is executed.
I can only think of the following solutions for you:
The reason why the TwineCompile targets file has to be at the end is because it has to overwrite a number of settings set by CodeGear.Cpp.Targets, which is imported by all C++Builder projects right at the end of the file. If these settings are not overwritten, TwineCompile doesn't get inserted into the build process, and the standard C++Builder MSBuild flow is executed.
I can only think of the following solutions for you:
- Add the import manually at the bottom of all project files, including future ones
- Alter CodeGear.Cpp.Targets to Import the TwineCompile targets file at the end (conditionally)
- Use jtmake.exe to run the MSBuild process for your projects (automatically includes the TwineCompile targets). This is a command-line build tool that ships with TwineCompile
Jon
Re: TwineCompile and msbuild: .proj/.targets instead of .cbproj?
Thank you for the prompt and useful feedback! We will take those options into consideration, hacky or not.
I will also send a line to Embarcadero, to make sure they are aware of the "itch".
I will also send a line to Embarcadero, to make sure they are aware of the "itch".