I have a source file similar to this:
#include "opt.h"
#include INCLUDE_FILENAME
In #include <opt.h> there's something similar to:
#include "user_opt.h"
#ifndef INCLUDE_FILENAME
# define INCLUDE_FILENAME "include.h"
#endif
It seems C::B isn't able to detect that .c file depends on include.h too. If I change something in "include.h" only, the build process doesn't anything.
You are correct, that is a limitation in our compiler plugin. You can have a look at the Code::Blocks' source code to understand how the dependency is calculated. It is in the folder src\plugins\compilergcc\depslib. Can you find a better way to do it?
Why not add a setting with a command that creates a .depend file that C::B will look during building?
I think many compilers have an option to create a dependecy file that is completely correct.
I am guessing external dependency in code::blocks would not do what you want; but, did you try it to be sure?
Edit: I just recalled external dependency is a linker dependency; and, you likely need an compiler dependency.
Tim S.
Quote from: ollydbg on February 27, 2018, 03:47:17 PM
You are correct, that is a limitation in our compiler plugin. You can have a look at the Code::Blocks' source code to understand how the dependency is calculated. It is in the folder src\plugins\compilergcc\depslib. Can you find a better way to do it?
So for, I have found "plugins\compilergcc\directcommands.cpp" tends to be the file that calls the depslib functions.
Tim S.
Quote from: stahta01 on February 28, 2018, 02:47:17 AM
Quote from: ollydbg on February 27, 2018, 03:47:17 PM
You are correct, that is a limitation in our compiler plugin. You can have a look at the Code::Blocks' source code to understand how the dependency is calculated. It is in the folder src\plugins\compilergcc\depslib. Can you find a better way to do it?
So for, I have found "plugins\compilergcc\directcommands.cpp" tends to be the file that calls the depslib functions.
Tim S.
Correct, if I remember correctly, the depslib just scan each file for some pattern like
#include <xxx.h>
or
#include "xxx.h"
And put the xxx.h as the dependency of the current file. It does not use the preprocessor to handle all the sources.