Make deps: Fix detection/linking of PugiXML on Linux
authorSergey Sharybin <sergey.vfx@gmail.com>
Wed, 26 Jun 2019 17:50:38 +0000 (19:50 +0200)
committerSergey Sharybin <sergey.vfx@gmail.com>
Wed, 26 Jun 2019 17:50:38 +0000 (19:50 +0200)
This time both full `make deps` and final compilation is tested on
a freshly installed CentOS 7.

The thing is: OpenImageIO is not configured to use an external PugiXML
library, so it was compiling its own.
At the same time the OpenShadingLanguage library was commanded to use
an externally compiled PugiXML. This caused some sort of discrepancy
which lead to Blender-link-time errors. Could be linking error, could
be namespace related, could be ABI related. In any case since we do
have PugiXML in the OpenImageIO already lets just stick to it.

build_files/build_environment/CMakeLists.txt
build_files/build_environment/cmake/osl.cmake

index c21ed8267361057fb62b069b8b9601e368a18e94..e4fe7d90176bb297c481182a826d7d59e47a08fd 100644 (file)
@@ -91,7 +91,11 @@ include(cmake/openvdb.cmake)
 include(cmake/python.cmake)
 include(cmake/python_site_packages.cmake)
 include(cmake/numpy.cmake)
-include(cmake/pugixml.cmake)
+if(UNIX AND NOT APPLE)
+  # Rely on PugiXML compiled with OpenImageIO
+else()
+  include(cmake/pugixml.cmake)
+endif()
 
 if(WITH_WEBP)
   include(cmake/webp.cmake)
index 7b5909e3700101a8a23f212f05d2d2ec1a405f46..b8268f90c3358580c9eece529487c50019a2c22d 100644 (file)
@@ -81,11 +81,6 @@ if(WIN32)
     ${OSL_EXTRA_ARGS}
     -DPUGIXML_HOME=${LIBDIR}/pugixml
   )
-elseif(UNIX AND NOT APPLE)
-  set(OSL_EXTRA_ARGS
-    ${OSL_EXTRA_ARGS}
-    -DPUGIXML_HOME=${LIBDIR}/pugixml
-  )
 elseif(APPLE)
   # Make symbol hiding consistent with OIIO which defaults to OFF,
   # avoids linker warnings on macOS
@@ -116,9 +111,17 @@ add_dependencies(
   external_zlib
   external_flexbison
   external_openimageio
-  external_pugixml
 )
 
+if(UNIX AND NOT APPLE)
+  # Rely on PugiXML compiled with OpenImageIO
+else()
+  add_dependencies(
+    external_osl
+    external_pugixml
+  )
+endif()
+
 if(WIN32)
   if(BUILD_MODE STREQUAL Release)
     ExternalProject_Add_Step(external_osl after_install