Controlling Custom Build execution

Technical Note 83760

Arkitekturer:

All

Komponent:

IDE

Uppdaterad:

2020-11-13 16:36

Introduction

The generic feature named Custom Build can give unexpected results, such as messages about missing files.

Discussion

When Custom Build is not working as expected, typically files generated by the tool (invoked by Custom Build) are reported as missing. For example:

Fatal Error[Pe1696]: cannot open source file [...]

Background

The reason is that the project build engine executes the Custom Build tool in parallel with the compiler and the assembler. Thus, files used when compiling might be missing (for example a header file), files that the Custom Build tool will be generating.

Solution for IDE versions 7.1.5 to 8.x.x

In order to make sure that the tool called from Custom Build executes before any files are compiled, select the option Run this tool before all other tools.

There are also situations where it is desirable to run the Custom Build tool prior to linking. In IDE versions up to 8.x.x that is not possible. (For such situations, build from the command line.)

Possible solution for older IDE versions

Rename the files that the Custom Build tool invokes and then force the project dependencies to be rebuilt.

  1. Change the filename of the input files to be alphabetically sorted before all C, C++, and assembler source files. (For example, a file named input.xxx can be renamed to _input.xxx to be sorted first alphabetically.)
  2. Choose Project>Clean (This removes the .dep file and forces the project dependencies to be rebuilt.)
  3. Choose Project>Make

Steps 2 and 3 must be repeated twice (or more times), so that the dependency file (extension .dep) will be properly rebuilt.

Conclusion

In IDE versions 7.1.5 to 8.x.x, Custom Build can run prior to compilation.

For IDE versions older than 7.1.5, this technical note gives a possible solution.

 

All product names are trademarks or registered trademarks of their respective owners.

Det här innehållet finns tyvärr inte på svenska.

Vår webbplats finns främst på vårt koncernspråk engelska, förutom det innehåll för investerare som vi är lagstadgade att kommunicera på svenska. Vi rekommenderar att du besöker vår globala webbplats på engelska för att få en bättre upplevelse.

Vi stöder inte längre Internet Explorer. För att få bästa möjliga upplevelse av iar.com rekommenderar vi att du uppgraderar till en modern webbläsare som Chrome eller Edge.