suzuki toshiya pushed to branch master at FreeType / FreeType
Commits:
-
35740aa6
by suzuki toshiya at 2022-01-29T01:36:12+00:00
1 changed file:
Changes:
... | ... | @@ -271,11 +271,16 @@ if (NOT FT_DISABLE_ZLIB) |
271 | 271 |
endif ()
|
272 | 272 |
|
273 | 273 |
if (NOT FT_DISABLE_BZIP2)
|
274 |
+ # Genuine BZip2 does not provide bzip2.pc, but some platforms have it.
|
|
275 |
+ # For better dependency in freetype2.pc, bzip2.pc is searched
|
|
276 |
+ # regardless of the availability of libbz2. If bzip2.pc is found,
|
|
277 |
+ # Requires.private is used instead of Libs.private.
|
|
274 | 278 |
if (FT_REQUIRE_BZIP2)
|
275 | 279 |
find_package(BZip2 REQUIRED)
|
276 | 280 |
else ()
|
277 | 281 |
find_package(BZip2)
|
278 | 282 |
endif ()
|
283 |
+ pkg_check_modules(PC_BZIP2 bzip2)
|
|
279 | 284 |
endif ()
|
280 | 285 |
|
281 | 286 |
if (NOT FT_DISABLE_BROTLI)
|
... | ... | @@ -504,7 +509,11 @@ endif () |
504 | 509 |
if (BZIP2_FOUND)
|
505 | 510 |
target_link_libraries(freetype PRIVATE ${BZIP2_LIBRARIES})
|
506 | 511 |
target_include_directories(freetype PRIVATE ${BZIP2_INCLUDE_DIR}) # not BZIP2_INCLUDE_DIRS
|
507 |
- list(APPEND PKG_CONFIG_LIBS_PRIVATE "-lbz2")
|
|
512 |
+ if (PC_BZIP2_FOUND)
|
|
513 |
+ list(APPEND PKG_CONFIG_REQUIRED_PRIVATE "bzip2")
|
|
514 |
+ else ()
|
|
515 |
+ list(APPEND PKG_CONFIG_LIBS_PRIVATE "-lbz2")
|
|
516 |
+ endif ()
|
|
508 | 517 |
endif ()
|
509 | 518 |
if (PNG_FOUND)
|
510 | 519 |
target_link_libraries(freetype PRIVATE ${PNG_LIBRARIES})
|