[Bf-blender-cvs] [447368b4729] master: Fix: OpenPGL related build error on windows

Ray Molenkamp noreply at git.blender.org
Tue Sep 27 18:48:15 CEST 2022


Commit: 447368b472962fc4431f713a7908e26abe3aaf90
Author: Ray Molenkamp
Date:   Tue Sep 27 10:48:09 2022 -0600
Branches: master
https://developer.blender.org/rB447368b472962fc4431f713a7908e26abe3aaf90

Fix: OpenPGL related build error on windows

Debug and Release libs are different libs on
Windows and will give linker errors when you
try to mix and match them.

This changes retrieves both libs and fills the
OPENPGL_LIBRARIES variable appropriately resolving
the linker error.

===================================================================

M	intern/cycles/cmake/external_libs.cmake

===================================================================

diff --git a/intern/cycles/cmake/external_libs.cmake b/intern/cycles/cmake/external_libs.cmake
index ab709b1ca10..184bf7d6ae3 100644
--- a/intern/cycles/cmake/external_libs.cmake
+++ b/intern/cycles/cmake/external_libs.cmake
@@ -284,7 +284,13 @@ if(WITH_CYCLES_PATH_GUIDING)
 
   find_package(openpgl QUIET)
   if(openpgl_FOUND)
-    get_target_property(OPENPGL_LIBRARIES openpgl::openpgl LOCATION)
+    if(WIN32)
+      get_target_property(OPENPGL_LIBRARIES_RELEASE openpgl::openpgl LOCATION_RELEASE)
+      get_target_property(OPENPGL_LIBRARIES_DEBUG openpgl::openpgl LOCATION_DEBUG)
+      set(OPENPGL_LIBRARIES optimized ${OPENPGL_LIBRARIES_RELEASE} debug ${OPENPGL_LIBRARIES_DEBUG})
+    else()
+      get_target_property(OPENPGL_LIBRARIES openpgl::openpgl LOCATION)
+    endif()
     get_target_property(OPENPGL_INCLUDE_DIR openpgl::openpgl INTERFACE_INCLUDE_DIRECTORIES)
   else()
     set(WITH_CYCLES_PATH_GUIDING OFF)



More information about the Bf-blender-cvs mailing list