Skip to content

Commit

Permalink
Fix pixbufloader build (libjxl#2924)
Browse files Browse the repository at this point in the history
  • Loading branch information
eustas authored Nov 1, 2023
1 parent 70667c1 commit 723cf49
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
19 changes: 13 additions & 6 deletions lib/jxl_cms.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,25 @@ if (JPEGXL_ENABLE_SKCMS)
target_include_directories(jxl_cms-obj PRIVATE
$<TARGET_PROPERTY:skcms-obj,INCLUDE_DIRECTORIES>
)
list(APPEND JXL_CMS_OBJECTS $<TARGET_OBJECTS:skcms-obj>)
if (NOT JPEGXL_BUNDLE_SKCMS)
if (JPEGXL_BUNDLE_SKCMS)
list(APPEND JXL_CMS_OBJECTS $<TARGET_OBJECTS:skcms-obj>)
else()
message(ERROR "Non-bundles skcms is not currently supported")
set(JXL_CMS_LIBS "skcms")
set(JXL_CMS_PK_LIBS "-lskcms")
endif ()
else ()
endif()
else()
target_include_directories(jxl_cms-obj PRIVATE
$<TARGET_PROPERTY:lcms2-obj,INCLUDE_DIRECTORIES>
)
list(APPEND JXL_CMS_OBJECTS $<TARGET_OBJECTS:lcms2-obj>)
endif ()
if (NOT JPEGXL_FORCE_SYSTEM_LCMS2)
list(APPEND JXL_CMS_OBJECTS $<TARGET_OBJECTS:lcms2-obj>)
else()
set(JXL_CMS_LIBS "lcms2")
set(JXL_CMS_PK_LIBS "-llcms2")
endif()
endif()

target_link_libraries(jxl_cms-obj PUBLIC ${JXL_CMS_LIBS})

if (BUILD_SHARED_LIBS)
Expand Down
4 changes: 4 additions & 0 deletions third_party/lcms2.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,7 @@ else()
endif()

set_property(TARGET lcms2-obj PROPERTY POSITION_INDEPENDENT_CODE ON)

add_library(lcms2 STATIC EXCLUDE_FROM_ALL $<TARGET_OBJECTS:lcms2-obj>)
target_include_directories(lcms2
PUBLIC $<TARGET_PROPERTY:lcms2-obj,INCLUDE_DIRECTORIES>)

0 comments on commit 723cf49

Please sign in to comment.