diff options
| author | Tim Foley <tfoleyNV@users.noreply.github.com> | 2017-06-19 10:23:16 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-06-19 10:23:16 -0700 |
| commit | bb9ca29160f5d95f3860504262693ea650d96be5 (patch) | |
| tree | 04f502283ed818f661e368b3d8d1ba5ce875d1d2 /slang.h | |
| parent | cafed774d99f95bce6f182599913f3417dc68a3a (diff) | |
| parent | 634522da69b14b38c15b14d6b717b1289812e9bb (diff) | |
Merge pull request #29 from tfoleyNV/auto-import
Allow for automatic importing of Slang code
Diffstat (limited to 'slang.h')
| -rw-r--r-- | slang.h | 22 |
1 files changed, 20 insertions, 2 deletions
@@ -194,8 +194,8 @@ extern "C" void const* userData); /*! - @brief Add a path in which source files are being search. When the programmer specifies @code using <file_name> @endcode in code, the compiler searches the file - in all search pathes in order. + @brief Add a path to use when searching for referenced files. + This will be used for both `#include` directives and also for explicit `__import` declarations. @param ctx The compilation context. @param searchDir The additional search directory. */ @@ -204,6 +204,16 @@ extern "C" const char* searchDir); /*! + @brief Add a path to use when searching for referenced files, that automatically treats `#include` as `__import` + This behaves just like `spAddSearchPath()` except that any `#include` file found through this path + will be treated as if it was referenced with `__import`. + @param ctx The compilation context. + @param searchDir The additional search directory. + */ + SLANG_API void spAddAutoImportPath( + SlangCompileRequest* request, + const char* searchDir); + /*! @brief Add a macro definition to be used during preprocessing. @param key The name of the macro to define. @param value The value of the macro to define. @@ -213,6 +223,13 @@ extern "C" const char* key, const char* value); + /*! + @brief Set options using arguments as if specified via command line. + */ + SLANG_API int spProcessCommandLineArguments( + SlangCompileRequest* request, + char const* const* args, + int argCount); /** Add a distinct translation unit to the compilation request @@ -890,6 +907,7 @@ namespace slang #include "source/slang/diagnostics.cpp" #include "source/slang/emit.cpp" #include "source/slang/lexer.cpp" +#include "source/slang/options.cpp" #include "source/slang/parameter-binding.cpp" #include "source/slang/parser.cpp" #include "source/slang/preprocessor.cpp" |
