Add CMake config for building a separate harfbuzz-subset.

This commit is contained in:
Garret Rieger 2018-02-08 14:59:32 -08:00 committed by Behdad Esfahbod
parent d4d120ad79
commit 0f3c756cbf
2 changed files with 15 additions and 4 deletions

View File

@ -253,8 +253,10 @@ set (project_sources
${HB_FALLBACK_sources} ${HB_FALLBACK_sources}
${HB_OT_sources} ${HB_OT_sources}
${HB_OT_RAGEL_GENERATED_sources} ${HB_OT_RAGEL_GENERATED_sources}
)
set (subset_project_sources
${HB_SUBSET_sources} ${HB_SUBSET_sources}
) )
@ -268,6 +270,10 @@ set (project_headers
${HB_SUBSET_headers} ${HB_SUBSET_headers}
) )
set (subset_project_headers
${HB_SUBSET_headers}
)
## Find and include needed header folders and libraries ## Find and include needed header folders and libraries
if (HB_HAVE_FREETYPE) if (HB_HAVE_FREETYPE)
@ -530,6 +536,11 @@ endif ()
add_library(harfbuzz ${project_sources} ${project_extra_sources} ${project_headers}) add_library(harfbuzz ${project_sources} ${project_extra_sources} ${project_headers})
target_link_libraries(harfbuzz ${THIRD_PARTY_LIBS}) 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) if (UNIX OR MINGW)
# Make symbols link locally # Make symbols link locally
link_libraries(-Bsymbolic-functions) 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_LIBRARIES "m") # libm
set (CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "") set (CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "")
set_target_properties(harfbuzz PROPERTIES LINKER_LANGUAGE C) set_target_properties(harfbuzz PROPERTIES LINKER_LANGUAGE C)
set_target_properties(harfbuzz-subset PROPERTIES LINKER_LANGUAGE C)
endif () endif ()
# No threadsafe statics as we do it ourselves # No threadsafe statics as we do it ourselves
@ -548,7 +560,6 @@ if (UNIX OR MINGW)
endif () endif ()
endif () endif ()
## Define harfbuzz-gobject library ## Define harfbuzz-gobject library
if (HB_HAVE_GOBJECT) if (HB_HAVE_GOBJECT)
add_library(harfbuzz-gobject add_library(harfbuzz-gobject
@ -720,7 +731,7 @@ if (HB_BUILD_UTILS)
target_link_libraries(hb-shape harfbuzz) target_link_libraries(hb-shape harfbuzz)
add_executable(hb-subset ${HB_SUBSET_CLI_sources}) 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}) add_executable(hb-ot-shape-closure ${HB_OT_SHAPE_CLOSURE_sources})
target_link_libraries(hb-ot-shape-closure harfbuzz) target_link_libraries(hb-ot-shape-closure harfbuzz)

View File

@ -20,7 +20,7 @@ if (HB_HAVE_GLIB)
else () else ()
message (FATAL_ERROR "No source file found for test ${test_name}") message (FATAL_ERROR "No source file found for test ${test_name}")
endif () endif ()
target_link_libraries (${test_name} harfbuzz) target_link_libraries (${test_name} harfbuzz harfbuzz-subset)
add_test (${test_name} ${test_name}) add_test (${test_name} ${test_name})
endforeach () endforeach ()
set_tests_properties (${TEST_PROGS} PROPERTIES ENVIRONMENT set_tests_properties (${TEST_PROGS} PROPERTIES ENVIRONMENT