Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
/woff2_compress
/woff2_decompress
/woff2_info

build
20 changes: 7 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,7 @@ if ("${isSystemDir}" STREQUAL "-1")
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_LIBDIR}")
endif()

# Find Brotli dependencies
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
find_package(BrotliDec)
if (NOT BROTLIDEC_FOUND)
message(FATAL_ERROR "librotlidec is needed to build woff2.")
endif ()
find_package(BrotliEnc)
if (NOT BROTLIENC_FOUND)
message(FATAL_ERROR "librotlienc is needed to build woff2.")
endif ()
add_subdirectory(brotli)

# Set compiler flags
if (NOT CANONICAL_PREFIXES)
Expand All @@ -65,30 +56,33 @@ set(CMAKE_CXX_STANDARD 11)

# Set search path for our private/public headers as well as Brotli headers
include_directories("src" "include"
"${BROTLIDEC_INCLUDE_DIRS}" "${BROTLIENC_INCLUDE_DIRS}")
"${BROTLI_INCLUDE_DIRS}")

# Common part used by decoder and encoder
add_library(woff2common
STATIC
src/table_tags.cc
src/variable_length.cc
src/woff2_common.cc)

# WOFF2 Decoder
add_library(woff2dec
STATIC
src/woff2_dec.cc
src/woff2_out.cc)
target_link_libraries(woff2dec woff2common "${BROTLIDEC_LIBRARIES}")
target_link_libraries(woff2dec woff2common brotlidec-static)
add_executable(woff2_decompress src/woff2_decompress.cc)
target_link_libraries(woff2_decompress woff2dec)

# WOFF2 Encoder
add_library(woff2enc
STATIC
src/font.cc
src/glyph.cc
src/normalize.cc
src/transform.cc
src/woff2_enc.cc)
target_link_libraries(woff2enc woff2common "${BROTLIENC_LIBRARIES}")
target_link_libraries(woff2enc woff2common brotlienc-static)
add_executable(woff2_compress src/woff2_compress.cc)
target_link_libraries(woff2_compress woff2enc)

Expand Down
35 changes: 0 additions & 35 deletions cmake/FindBrotliDec.cmake

This file was deleted.

35 changes: 0 additions & 35 deletions cmake/FindBrotliEnc.cmake

This file was deleted.