From 0f3c756cbfe8a263ee388481acac7a24d9684c44 Mon Sep 17 00:00:00 2001 From: Garret Rieger Date: Thu, 8 Feb 2018 14:59:32 -0800 Subject: [PATCH] Add CMake config for building a separate harfbuzz-subset. --- CMakeLists.txt | 17 ++++++++++++++--- test/api/CMakeLists.txt | 2 +- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bfe0e306..6199e442 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -253,8 +253,10 @@ set (project_sources ${HB_FALLBACK_sources} ${HB_OT_sources} - ${HB_OT_RAGEL_GENERATED_sources} + ${HB_OT_RAGEL_GENERATED_sources} +) +set (subset_project_sources ${HB_SUBSET_sources} ) @@ -268,6 +270,10 @@ set (project_headers ${HB_SUBSET_headers} ) +set (subset_project_headers + ${HB_SUBSET_headers} +) + ## Find and include needed header folders and libraries if (HB_HAVE_FREETYPE) @@ -530,6 +536,11 @@ endif () add_library(harfbuzz ${project_sources} ${project_extra_sources} ${project_headers}) target_link_libraries(harfbuzz ${THIRD_PARTY_LIBS}) +## Define harfbuzz-subset library +add_library(harfbuzz-subset ${subset_project_sources} ${subset_project_headers}) +add_dependencies(harfbuzz-subset harfbuzz) +target_link_libraries(harfbuzz-subset harfbuzz ${THIRD_PARTY_LIBS}) + if (UNIX OR MINGW) # Make symbols link locally link_libraries(-Bsymbolic-functions) @@ -540,6 +551,7 @@ if (UNIX OR MINGW) set (CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "m") # libm set (CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "") set_target_properties(harfbuzz PROPERTIES LINKER_LANGUAGE C) + set_target_properties(harfbuzz-subset PROPERTIES LINKER_LANGUAGE C) endif () # No threadsafe statics as we do it ourselves @@ -548,7 +560,6 @@ if (UNIX OR MINGW) endif () endif () - ## Define harfbuzz-gobject library if (HB_HAVE_GOBJECT) add_library(harfbuzz-gobject @@ -720,7 +731,7 @@ if (HB_BUILD_UTILS) target_link_libraries(hb-shape harfbuzz) add_executable(hb-subset ${HB_SUBSET_CLI_sources}) - target_link_libraries(hb-subset harfbuzz) + target_link_libraries(hb-subset harfbuzz harfbuzz-subset) add_executable(hb-ot-shape-closure ${HB_OT_SHAPE_CLOSURE_sources}) target_link_libraries(hb-ot-shape-closure harfbuzz) diff --git a/test/api/CMakeLists.txt b/test/api/CMakeLists.txt index c3914e48..f1a2300f 100644 --- a/test/api/CMakeLists.txt +++ b/test/api/CMakeLists.txt @@ -20,7 +20,7 @@ if (HB_HAVE_GLIB) else () message (FATAL_ERROR "No source file found for test ${test_name}") endif () - target_link_libraries (${test_name} harfbuzz) + target_link_libraries (${test_name} harfbuzz harfbuzz-subset) add_test (${test_name} ${test_name}) endforeach () set_tests_properties (${TEST_PROGS} PROPERTIES ENVIRONMENT -- GitLab