Trigger trigger when title changes

I have non-system headers that I use to compile a program through SCons. The problem is that they sometimes change, but SCons does not seem to see changes in the headers at all. Is there a way to tell SCons to scan the headers for changes?

+4
source share
1 answer

Assuming you're talking about c / C ++, SCons should always check the header files, assuming that the included paths were correctly configured for this.

If the included paths were specified using the CPPPATH construction variable, then the included files in this path will be scanned for changes. The inclusion paths specified by this variable must not contain -I , since SCons will make this portable.

This variable can be added as follows:

 env = Environment() # These paths WILL BE scanned for header file changes env.Append(CPPPATH = ['path1', '/another/path', 'path3']) 

If the included paths were specified in the CCFLAGS or CXXFLAGS construction variables, then the included files in this path will be checked for no changes. The include paths specified in one of these variables must have -I added. This approach is useful when specifying the system header, including paths that are likely to never change, which will speed up the build process.

Contours can be added to the CXXFLAGS variable:

 env = Environment() # These paths will NOT be scanned for header file changes env.Append(CXXFLAGS = ['-Ipath1', '-I/another/path', '-Ipath3']) 

Here is a list of other SCons build variables.

+5
source

Source: https://habr.com/ru/post/1433448/


All Articles