CMake: resolve issue building without sorted libs
[blender.git] / build_files / cmake / macros.cmake
index c4ae75db9d70138f8a20faa7fb90be57c80dfac2..3947f087105b3c1653f249f7c17f6f76dede1dab 100644 (file)
@@ -236,7 +236,9 @@ function(blender_add_lib__impl
 
        # Use for testing 'BLENDER_SORTED_LIBS' removal.
        if(DEFINED WITHOUT_SORTED_LIBS AND WITHOUT_SORTED_LIBS)
-               target_link_libraries(${name} "${libraries}")
+               if (NOT "${libraries}" STREQUAL "")
+                       target_link_libraries(${name} "${libraries}")
+               endif()
        endif()
 
        # works fine without having the includes