Add #include processing to glslang (though turned off by default).
When an include directive is recognized by the preprocessor, it executes a callback on the filepath argument to obtain the file contents. That way the compilation client can deal with the file system, include paths, etc. Currently only accepts quoted filepaths -- no angle brackets yet.
This commit is contained in:
committed by
Lei Zhang
parent
1363fcd60b
commit
7be4b8282d
8
Test/baseResults/preprocessor.include.vert.err
Normal file
8
Test/baseResults/preprocessor.include.vert.err
Normal file
@@ -0,0 +1,8 @@
|
||||
ERROR: 0:8000: '#include' : must be followed by a file designation
|
||||
ERROR: 0:8001: '#include' : must be followed by a file designation
|
||||
ERROR: 0:8002: '#error' : unexpected include directive
|
||||
ERROR: 0:8003: '#include' : extra content after file designation
|
||||
ERROR: 0:8004: '#error' : unexpected include directive
|
||||
ERROR: 5 compilation errors. No code generated.
|
||||
|
||||
|
||||
0
Test/baseResults/preprocessor.include.vert.out
Normal file
0
Test/baseResults/preprocessor.include.vert.out
Normal file
6
Test/preprocessor.include.vert
Normal file
6
Test/preprocessor.include.vert
Normal file
@@ -0,0 +1,6 @@
|
||||
#line 8000
|
||||
#include
|
||||
#include 123
|
||||
#include "foo"
|
||||
#include "foo" garbage
|
||||
#include "no-eol"
|
||||
@@ -4,6 +4,7 @@ preprocessor.edge_cases.vert
|
||||
preprocessor.errors.vert
|
||||
preprocessor.extensions.vert
|
||||
preprocessor.function_macro.vert
|
||||
preprocessor.include.vert
|
||||
preprocessor.line.vert
|
||||
preprocessor.line.frag
|
||||
preprocessor.pragma.vert
|
||||
|
||||
Reference in New Issue
Block a user