OpenShadingLanguage
OpenShadingLanguage copied to clipboard
clang10 and pkgconfig issues with v1.11.4.1-dev
With gcc9 and clang10 libclang-cpp has been introduced resulting in liboslexec and liboslcomp failing at link time, sorry I didn't have time to make a patch, I work around this in the spec file with: %if 0%{?llvm_version} >= 10 "#" Add missing -lclang-cpp to linker scripts for liboslcomp and liboslexec sed -i 's/-ldl /-ldl -lclang-cpp /' src/liboslexec/CMakeFiles/oslexec.dir/link.txt sed -i 's/-ldl /-ldl -lclang-cpp /' src/liboslcomp/CMakeFiles/oslcomp.dir/link.txt %endif I'm not 100% sure when libclang was split but it wasn't in clang7 but it is in clang10 The other issue I made a patch for is: CMakeLists.txt fails to provide Version: @PACKAGE_VERSION_MAJOR@.@PACKAGE_VERSION_MINOR@.@PACKAGE_VERSION_PATCH@ for pc files resulting in a Version: field of .. I wouldn't have picked this up but rpmbuild chokes on the .. Version field when it creates the pkgconfig() provides. osl-pkgconfig-versions.patch.txt See: https://build.opensuse.org/package/show/home:plater:blender/OpenShadingLanguage
OH, I see, there is an error in the .pc.in files!
I will make a patch to fix it.
For the version issue, the real bug was that the .pc.in files said PACKAGE_VERSION when they should have said PROJECT_VERSION. That is the correct fix rather than setting an additional PACKAGE_VERSION set of variables.
Proposed fix for that is here: https://github.com/imageworks/OpenShadingLanguage/pull/1168
I'm not sure I know how to solve the first problem you mention. If you know specifically how to fix it, a patch would be very helpful.
We would have to locate where the relevant flags are created and use an if (${LLVM_PACKAGE_VERSION} VERSION_GREATER "9.9")conditional maybe.