From f83a43b56134188c2e1f3496d40ec0cd9109f250 Mon Sep 17 00:00:00 2001 From: Garret Rieger Date: Fri, 2 Feb 2018 17:50:45 -0800 Subject: [PATCH] Add CMake configuration for all of the new subsetting code. --- CMakeLists.txt | 14 ++++++++++++++ src/Makefile.sources | 9 +++++++-- test/CMakeLists.txt | 1 + test/subset/CMakeLists.txt | 9 +++++++++ util/Makefile.am | 2 +- util/Makefile.sources | 2 +- 6 files changed, 33 insertions(+), 4 deletions(-) create mode 100644 test/subset/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 9e067edf8..bfe0e3062 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -171,6 +171,12 @@ add_prefix_to_list(HB_OT_sources "${PROJECT_SOURCE_DIR}/src/") extract_make_variable(HB_OT_headers ${SRCSOURCES}) add_prefix_to_list(HB_OT_headers "${PROJECT_SOURCE_DIR}/src/") +extract_make_variable(HB_SUBSET_sources ${SRCSOURCES}) +add_prefix_to_list(HB_SUBSET_sources "${PROJECT_SOURCE_DIR}/src/") + +extract_make_variable(HB_SUBSET_headers ${SRCSOURCES}) +add_prefix_to_list(HB_SUBSET_headers "${PROJECT_SOURCE_DIR}/src/") + extract_make_variable(HB_BASE_RAGEL_GENERATED_sources ${SRCSOURCES}) extract_make_variable(HB_OT_RAGEL_GENERATED_sources ${SRCSOURCES}) if (IN_HB_DIST) @@ -185,6 +191,8 @@ extract_make_variable(HB_VIEW_sources ${UTILSOURCES}) add_prefix_to_list(HB_VIEW_sources "${PROJECT_SOURCE_DIR}/util/") extract_make_variable(HB_SHAPE_sources ${UTILSOURCES}) add_prefix_to_list(HB_SHAPE_sources "${PROJECT_SOURCE_DIR}/util/") +extract_make_variable(HB_SUBSET_CLI_sources ${UTILSOURCES}) +add_prefix_to_list(HB_SUBSET_CLI_sources "${PROJECT_SOURCE_DIR}/util/") extract_make_variable(HB_OT_SHAPE_CLOSURE_sources ${UTILSOURCES}) add_prefix_to_list(HB_OT_SHAPE_CLOSURE_sources "${PROJECT_SOURCE_DIR}/util/") @@ -246,6 +254,8 @@ set (project_sources ${HB_FALLBACK_sources} ${HB_OT_sources} ${HB_OT_RAGEL_GENERATED_sources} + + ${HB_SUBSET_sources} ) set (project_extra_sources) @@ -255,6 +265,7 @@ set (project_headers ${HB_BASE_headers} ${HB_OT_headers} + ${HB_SUBSET_headers} ) @@ -708,6 +719,9 @@ if (HB_BUILD_UTILS) add_executable(hb-shape ${HB_SHAPE_sources}) target_link_libraries(hb-shape harfbuzz) + add_executable(hb-subset ${HB_SUBSET_CLI_sources}) + target_link_libraries(hb-subset harfbuzz) + add_executable(hb-ot-shape-closure ${HB_OT_SHAPE_CLOSURE_sources}) target_link_libraries(hb-ot-shape-closure harfbuzz) diff --git a/src/Makefile.sources b/src/Makefile.sources index f223fcfee..0b9beb961 100644 --- a/src/Makefile.sources +++ b/src/Makefile.sources @@ -182,8 +182,13 @@ HB_ICU_sources = hb-icu.cc HB_ICU_headers = hb-icu.h # Sources for libharfbuzz-subset -HB_SUBSET_sources = hb-subset.cc -HB_SUBSET_headers = hb-subset.h +HB_SUBSET_sources = \ + hb-subset.cc \ + $(NULL) + +HB_SUBSET_headers = \ + hb-subset.h \ + $(NULL) HB_GOBJECT_sources = hb-gobject-structs.cc HB_GOBJECT_STRUCTS_headers = hb-gobject-structs.h diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 2c97f4f81..d2b199428 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,3 +1,4 @@ add_subdirectory(api) add_subdirectory(shaping) +add_subdirectory(subset) add_subdirectory(fuzzing) diff --git a/test/subset/CMakeLists.txt b/test/subset/CMakeLists.txt new file mode 100644 index 000000000..0a1e8f953 --- /dev/null +++ b/test/subset/CMakeLists.txt @@ -0,0 +1,9 @@ +if (HB_BUILD_UTILS) + file (READ "${CMAKE_CURRENT_SOURCE_DIR}/data/Makefile.sources" SOURCES) + extract_make_variable (TESTS ${SOURCES}) + foreach (test IN ITEMS ${TESTS}) + add_test (NAME ${test} + COMMAND python run-tests.py $ "data/${test}" + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) + endforeach () +endif () diff --git a/util/Makefile.am b/util/Makefile.am index 283dd91ff..cd5e31cbc 100644 --- a/util/Makefile.am +++ b/util/Makefile.am @@ -46,7 +46,7 @@ endif # HAVE_FREETYPE hb_shape_SOURCES = $(HB_SHAPE_sources) bin_PROGRAMS += hb-shape -hb_subset_SOURCES = $(HB_SUBSET_sources) +hb_subset_SOURCES = $(HB_SUBSET_CLI_sources) bin_PROGRAMS += hb-subset if HAVE_OT diff --git a/util/Makefile.sources b/util/Makefile.sources index c4516ebcb..6c815d26b 100644 --- a/util/Makefile.sources +++ b/util/Makefile.sources @@ -29,7 +29,7 @@ HB_OT_SHAPE_CLOSURE_sources = \ main-font-text.hh \ $(NULL) -HB_SUBSET_sources = \ +HB_SUBSET_CLI_sources = \ hb-subset.cc \ options.cc \ options.hh \