mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 10:54:24 -04:00
Corrected include-file search-path
This commit is contained in:
parent
0df3c4849b
commit
7dc0da379b
@ -1394,22 +1394,36 @@ handle_include_directive(const string &args, int first_line,
|
|||||||
CPPFile::Source source = CPPFile::S_none;
|
CPPFile::Source source = CPPFile::S_none;
|
||||||
|
|
||||||
if (okflag) {
|
if (okflag) {
|
||||||
if (!angle_quotes) {
|
|
||||||
found_file = filename.exists();
|
found_file = false;
|
||||||
|
|
||||||
|
if (!angle_quotes && !found_file && filename.exists()) {
|
||||||
|
found_file = true;
|
||||||
source = CPPFile::S_local;
|
source = CPPFile::S_local;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!angle_quotes && !found_file) {
|
||||||
|
DSearchPath local_search_path(Filename(get_file()._filename.get_dirname()));
|
||||||
|
|
||||||
|
// Now look for it in the same directory as the includer.
|
||||||
|
if (!found_file && filename.resolve_filename(local_search_path)) {
|
||||||
|
found_file = true;
|
||||||
|
source = CPPFile::S_alternate;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Now look for it on the include path.
|
// Now look for it on the primary include path.
|
||||||
|
if (!angle_quotes && !found_file && filename.resolve_filename(_include_path)) {
|
||||||
|
found_file = true;
|
||||||
|
source = CPPFile::S_alternate;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Now look for it on the system include path.
|
||||||
if (!found_file && filename.resolve_filename(_system_include_path)) {
|
if (!found_file && filename.resolve_filename(_system_include_path)) {
|
||||||
found_file = true;
|
found_file = true;
|
||||||
source = CPPFile::S_system;
|
source = CPPFile::S_system;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!found_file && filename.resolve_filename(_include_path)) {
|
|
||||||
found_file = true;
|
|
||||||
source = CPPFile::S_alternate;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!found_file) {
|
if (!found_file) {
|
||||||
warning("Cannot find " + filename.get_fullpath(),
|
warning("Cannot find " + filename.get_fullpath(),
|
||||||
first_line, first_col, first_file);
|
first_line, first_col, first_file);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user