Skip to content

Commit 4ab2a22

Browse files
agruzdevfarindk
authored andcommitted
Added extra CMAKE flags for linking plugins statically: plugin_DEBUG_LIBRARY and plugin_LINK_DIRS
1 parent 02d3caa commit 4ab2a22

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

libheif/plugins/CMakeLists.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,13 @@ macro(plugin_compilation name varName foundName optionName defineName)
2929
target_sources(heif PRIVATE ${${optionName}_sources})
3030
target_compile_definitions(heif PRIVATE HAVE_${defineName}=1)
3131
target_include_directories(heif PRIVATE ${${varName}_INCLUDE_DIRS})
32-
target_link_libraries(heif PRIVATE ${${varName}_LIBRARIES})
32+
target_link_directories(heif PRIVATE ${${varName}_LINK_DIRS})
33+
if (${varName}_DEBUG_LIBRARY)
34+
target_link_libraries(heif PRIVATE debug ${${varName}_DEBUG_LIBRARY})
35+
target_link_libraries(heif PRIVATE optimized ${${varName}_LIBRARIES})
36+
else()
37+
target_link_libraries(heif PRIVATE ${${varName}_LIBRARIES})
38+
endif()
3339
endif ()
3440

3541
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${${varName}_CFLAGS}")

0 commit comments

Comments
 (0)