Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2014-08-05 13:53:00 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2014-08-05 13:53:00 +0400
commitb3e3ca7464074ca76cd8761f9a94724ff6730349 (patch)
tree0268c87081cabcd97663be2c99115f3ce87c88f3 /intern/cycles/render/osl.cpp
parentb9c8572d7161633d1cc4528bf1159458e8248bcf (diff)
Fix T41318: OSL broken on Linux kubuntu 14.04
Now for real, hopefully.
Diffstat (limited to 'intern/cycles/render/osl.cpp')
-rw-r--r--intern/cycles/render/osl.cpp15
1 files changed, 6 insertions, 9 deletions
diff --git a/intern/cycles/render/osl.cpp b/intern/cycles/render/osl.cpp
index c95c626f5d0..f57e16471a1 100644
--- a/intern/cycles/render/osl.cpp
+++ b/intern/cycles/render/osl.cpp
@@ -248,12 +248,13 @@ void OSLShaderManager::shading_system_free()
bool OSLShaderManager::osl_compile(const string& inputfile, const string& outputfile)
{
-#if OSL_LIBRARY_VERSION_CODE >= 10500
- vector<string_view> options;
-#else
- vector<string> options;
+#if OSL_LIBRARY_VERSION_CODE < 10500
+ typedef string string_view;
#endif
+
+ vector<string_view> options;
string stdosl_path;
+ string shader_path = path_get("shader");
/* specify output file name */
options.push_back("-o");
@@ -261,17 +262,13 @@ bool OSLShaderManager::osl_compile(const string& inputfile, const string& output
/* specify standard include path */
options.push_back("-I");
- options.push_back(path_get("shader"));
+ options.push_back(shader_path);
stdosl_path = path_get("shader/stdosl.h");
/* compile */
OSL::OSLCompiler *compiler = OSL::OSLCompiler::create();
-#if OSL_LIBRARY_VERSION_CODE >= 10500
bool ok = compiler->compile(string_view(inputfile), options, string_view(stdosl_path));
-#else
- bool ok = compiler->compile(inputfile, options, stdosl_path);
-#endif
delete compiler;
return ok;