Skip to content

Commit

Permalink
Remove brotli from cmake files.
Browse files Browse the repository at this point in the history
  • Loading branch information
szabadka committed Jul 5, 2024
1 parent 5a4220b commit f2a00ed
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 92 deletions.
8 changes: 0 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,6 @@ set(JPEGXL_ENABLE_COVERAGE false CACHE BOOL
"Enable code coverage tracking for libjxl. This also enables debug and disables optimizations.")
set(JPEGXL_ENABLE_SIZELESS_VECTORS false CACHE BOOL
"Builds in support for SVE/RVV vectorization")
set(JPEGXL_ENABLE_TRANSCODE_JPEG true CACHE BOOL
"Builds in support for decoding transcoded JXL files back to JPEG,\
disabling it makes the decoder reject JXL_DEC_JPEG_RECONSTRUCTION events,\
(default enabled)")
set(JPEGXL_ENABLE_BOXES true CACHE BOOL
"Builds in support for decoding boxes in JXL files,\
disabling it makes the decoder reject JXL_DEC_BOX events,\
(default enabled)")
set(JPEGXL_STATIC false CACHE BOOL
"Build tools as static binaries.")
set(JPEGXL_WARNINGS_AS_ERRORS false CACHE BOOL
Expand Down
21 changes: 1 addition & 20 deletions lib/jxl.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,10 @@ set(JPEGXL_DEC_INTERNAL_LIBS
${ATOMICS_LIBRARIES}
)

if (JPEGXL_ENABLE_TRANSCODE_JPEG OR JPEGXL_ENABLE_BOXES)
list(APPEND JPEGXL_DEC_INTERNAL_LIBS brotlidec brotlicommon)
endif()

set(JPEGXL_INTERNAL_LIBS
${JPEGXL_DEC_INTERNAL_LIBS}
brotlienc
)

if (JPEGXL_ENABLE_TRANSCODE_JPEG)
list(APPEND JPEGXL_INTERNAL_FLAGS -DJPEGXL_ENABLE_TRANSCODE_JPEG=1)
else()
list(APPEND JPEGXL_INTERNAL_FLAGS -DJPEGXL_ENABLE_TRANSCODE_JPEG=0)
endif ()

if (JPEGXL_ENABLE_BOXES)
list(APPEND JPEGXL_INTERNAL_FLAGS -DJPEGXL_ENABLE_BOXES=1)
else()
list(APPEND JPEGXL_INTERNAL_FLAGS -DJPEGXL_ENABLE_BOXES=0)
endif ()

set(OBJ_COMPILE_DEFINITIONS
# Used to determine if we are building the library when defined or just
# including the library when not defined. This is public so libjxl shared
Expand Down Expand Up @@ -100,7 +83,6 @@ set_property(TARGET jxl_dec-obj PROPERTY POSITION_INDEPENDENT_CODE ON)
target_include_directories(jxl_dec-obj BEFORE PUBLIC
"$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}>"
"${JXL_HWY_INCLUDE_DIRS}"
"$<BUILD_INTERFACE:$<TARGET_PROPERTY:brotlicommon,INTERFACE_INCLUDE_DIRECTORIES>>"
)
target_compile_definitions(jxl_dec-obj PUBLIC
${OBJ_COMPILE_DEFINITIONS}
Expand Down Expand Up @@ -229,8 +211,7 @@ install(TARGETS jxl
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})

# Add a pkg-config file for libjxl.
set(JPEGXL_LIBRARY_REQUIRES
"libhwy libbrotlienc libbrotlidec libjxl_cms")
set(JPEGXL_LIBRARY_REQUIRES "libhwy libjxl_cms")

if (BUILD_SHARED_LIBS)
set(JPEGXL_REQUIRES_TYPE "Requires.private")
Expand Down
15 changes: 0 additions & 15 deletions lib/jxl/base/testing.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,13 @@
// GTest specific macros / wrappers.

#include "gtest/gtest.h"
// JPEGXL_ENABLE_BOXES, JPEGXL_ENABLE_TRANSCODE_JPEG

#ifdef JXL_DISABLE_SLOW_TESTS
#define JXL_SLOW_TEST(T, C) TEST(T, DISABLED_##C)
#else
#define JXL_SLOW_TEST(T, C) TEST(T, C)
#endif // JXL_DISABLE_SLOW_TESTS

#if JPEGXL_ENABLE_TRANSCODE_JPEG
#define JXL_TRANSCODE_JPEG_TEST(T, C) TEST(T, C)
#else
#define JXL_TRANSCODE_JPEG_TEST(T, C) TEST(T, DISABLED_##C)
#endif // JPEGXL_ENABLE_TRANSCODE_JPEG

#if JPEGXL_ENABLE_BOXES
#define JXL_BOXES_TEST(T, C) TEST(T, C)
#define JXL_BOXES_TEST_P(T, C) TEST_P(T, C)
#else
#define JXL_BOXES_TEST(T, C) TEST(T, DISABLED_##C)
#define JXL_BOXES_TEST_P(T, C) TEST_P(T, DISABLED_##C)
#endif // JPEGXL_ENABLE_BOXES

#ifdef THREAD_SANITIZER
#define JXL_TSAN_SLOW_TEST(T, C) TEST(T, DISABLED_##C)
#else
Expand Down
49 changes: 0 additions & 49 deletions third_party/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,55 +45,6 @@ else()
endif() # JPEGXL_DEP_LICENSE_DIR
endif()

# brotli
if (NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/brotli/c/include/brotli/decode.h" OR
JPEGXL_FORCE_SYSTEM_BROTLI)
find_package(Brotli)
if (NOT Brotli_FOUND)
message(FATAL_ERROR
"Brotli not found, install brotli-dev or download brotli source code to"
" third_party/brotli from https://github.com/google/brotli. You can use"
" ${PROJECT_SOURCE_DIR}/deps.sh to download this dependency.")
endif ()
if(JPEGXL_DEP_LICENSE_DIR)
configure_file("${JPEGXL_DEP_LICENSE_DIR}/libbrotli-dev/copyright"
${PROJECT_BINARY_DIR}/LICENSE.brotli COPYONLY)
endif() # JPEGXL_DEP_LICENSE_DIR
else()
# Compile brotli from sources.
set(BROTLI_DISABLE_TESTS ON CACHE STRING "Disable Brotli tests")
# Override default "no-install" policy.
if((NOT SANITIZER STREQUAL "asan") AND (NOT SANITIZER STREQUAL "msan"))
set(BROTLI_BUNDLED_MODE OFF CACHE INTERNAL "")
endif()
add_subdirectory(brotli)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/brotli/LICENSE"
${PROJECT_BINARY_DIR}/LICENSE.brotli COPYONLY)
if(APPLE)
if(NOT DEFINED CMAKE_MACOSX_RPATH)
# Use @rpath in install_name when CMAKE_MACOSX_RPATH is not set.
set_property(TARGET brotlienc PROPERTY MACOSX_RPATH TRUE)
set_property(TARGET brotlidec PROPERTY MACOSX_RPATH TRUE)
set_property(TARGET brotlicommon PROPERTY MACOSX_RPATH TRUE)
endif()
if((NOT DEFINED CMAKE_MACOSX_RPATH) OR CMAKE_MACOSX_RPATH)
# Set library search path when @rpath is used.
if(NOT DEFINED CMAKE_INSTALL_RPATH)
set_property(TARGET brotlienc PROPERTY INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
set_property(TARGET brotlidec PROPERTY INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
set_property(TARGET brotlicommon PROPERTY INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
endif()
else()
# Set conventional install_name when @rpath is not used.
if(NOT DEFINED CMAKE_INSTALL_NAME_DIR)
set_property(TARGET brotlienc PROPERTY INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib")
set_property(TARGET brotlidec PROPERTY INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib")
set_property(TARGET brotlicommon PROPERTY INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib")
endif()
endif()
endif() # APPLE
endif()

# *cms
if (JPEGXL_ENABLE_SKCMS)
if( NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/skcms/skcms.h" )
Expand Down

0 comments on commit f2a00ed

Please sign in to comment.