From a5562e1cf4eab216b99c4478666447ee7efa2f89 Mon Sep 17 00:00:00 2001 From: smallville7123 Date: Wed, 1 Sep 2021 12:06:22 +1000 Subject: [PATCH 01/11] mgood7123: fix graphite/issues/68 --- CMakeLists.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 496712d5..8eda0478 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,8 +4,9 @@ include(TestBigEndian) find_package(PythonInterp 3.6) project(graphite2) set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}) -if (NOT CMAKE_BUILD_TYPE) - set_property(CACHE CMAKE_BUILD_TYPE PROPERTY VALUE Release) +if(NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE Release CACHE STRING "" FORCE) + message(STATUS "CMAKE_BUILD_TYPE is not specified, default to Release. Note that this is only relevant for single-configuration generators (such as Makefile Generators and Ninja).") endif() option(BUILD_SHARED_LIBS "Make library a shared library instead of static" ON) From f08ce31df45e4d09f4a3fa72d9c1b7d997e89734 Mon Sep 17 00:00:00 2001 From: smallville7123 Date: Wed, 1 Sep 2021 12:07:44 +1000 Subject: [PATCH 02/11] glennpj: fix graphite/issues/61 --- src/inc/Machine.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/inc/Machine.h b/src/inc/Machine.h index b23819fb..0f75ae89 100644 --- a/src/inc/Machine.h +++ b/src/inc/Machine.h @@ -46,7 +46,7 @@ of the License or (at your option) any later version. #endif #else #define HOT __attribute__((hot)) -#if defined(__x86_64) +#if defined(__x86_64) && !defined(__INTEL_COMPILER) #define REGPARM(n) __attribute__((hot, regparm(n))) #else #define REGPARM(n) From 22248f44a3d996a0eb32a97d1dce8b25d0cc6cc0 Mon Sep 17 00:00:00 2001 From: smallville7123 Date: Wed, 1 Sep 2021 12:08:54 +1000 Subject: [PATCH 03/11] bgermann: fix graphite/pull/45 --- python/graphite2/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/graphite2/__init__.py b/python/graphite2/__init__.py index cddf6240..0d5e8003 100644 --- a/python/graphite2/__init__.py +++ b/python/graphite2/__init__.py @@ -39,9 +39,9 @@ # find wheel's library wheel = os.path.dirname(__file__) if os.name == 'nt': - libpath = os.path.join(wheel, 'bin', 'graphite2.dll') + libpath = os.path.join(wheel, '..', 'bin', 'graphite2.dll') else: - libpath = os.path.join(wheel, 'lib', 'libgraphite2.so') + libpath = os.path.join(wheel, '..', 'lib', 'libgraphite2.so') gr2 = ctypes.cdll.LoadLibrary(libpath) From d06433b9b95c13a62c5b273959b6913887a52d16 Mon Sep 17 00:00:00 2001 From: smallville7123 Date: Wed, 1 Sep 2021 12:10:56 +1000 Subject: [PATCH 04/11] spl: fix graphite/pull/54 --- src/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b6ac26bf..b651eff8 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -144,7 +144,9 @@ if (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") endif() target_link_libraries(graphite2 c) include(Graphite) - nolib_test(stdc++ $) + if (BUILD_SHARED_LIBS) + nolib_test(stdc++ $) + endif() set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "") CREATE_LIBTOOL_FILE(graphite2 "/lib${LIB_SUFFIX}") endif() From 69d2f5e768cae0ca99d7964618508953442bd7b3 Mon Sep 17 00:00:00 2001 From: smallville7123 Date: Wed, 1 Sep 2021 12:12:36 +1000 Subject: [PATCH 05/11] spl: fix graphite/pull/56 --- src/CMakeLists.txt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b651eff8..83403f52 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -152,8 +152,13 @@ if (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") endif() if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") - set_target_properties(graphite2 PROPERTIES - COMPILE_DEFINITIONS "_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;UNICODE;GRAPHITE2_EXPORTING") + if (BUILD_SHARED_LIBS) + set_target_properties(graphite2 PROPERTIES + COMPILE_DEFINITIONS "_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;UNICODE;GRAPHITE2_EXPORTING") + else() + set_target_properties(graphite2 PROPERTIES + COMPILE_DEFINITIONS "_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;UNICODE;GRAPHITE2_STATIC") + endif() endif() From 862d733cc14a5b08091b9d57125a922f76892bf1 Mon Sep 17 00:00:00 2001 From: smallville7123 Date: Wed, 1 Sep 2021 12:14:24 +1000 Subject: [PATCH 06/11] mapreri: fix graphite/pull/59 --- src/CMakeLists.txt | 2 +- tests/examples/CMakeLists.txt | 2 +- tests/vm/CMakeLists.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 83403f52..723a38de 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -102,7 +102,7 @@ set_target_properties(graphite2 PROPERTIES PUBLIC_HEADER "${GRAPHITE_HEADERS}" LT_VERSION_REVISION ${GRAPHITE_API_REVISION} LT_VERSION_AGE ${GRAPHITE_API_AGE}) -if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") +if (${CMAKE_SYSTEM_NAME} STREQUAL ".*Linux" OR ${CMAKE_SYSTEM_NAME} MATCHES ".*BSD" OR ${CMAKE_SYSTEM_NAME} STREQUAL ".*GNU") set_target_properties(graphite2 PROPERTIES COMPILE_FLAGS "-Wall -Wextra -Wno-unknown-pragmas -Wendif-labels -Wshadow -Wctor-dtor-privacy -Wnon-virtual-dtor -fno-rtti -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden" LINK_FLAGS "-nodefaultlibs ${GRAPHITE_LINK_FLAGS}" diff --git a/tests/examples/CMakeLists.txt b/tests/examples/CMakeLists.txt index 103c78be..e8c9fb40 100644 --- a/tests/examples/CMakeLists.txt +++ b/tests/examples/CMakeLists.txt @@ -23,7 +23,7 @@ macro(test_example TESTNAME SRCFILE) set_tests_properties(${TESTNAME} PROPERTIES TIMEOUT 3) endmacro() -if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") +if (${CMAKE_SYSTEM_NAME} STREQUAL ".*Linux" OR ${CMAKE_SYSTEM_NAME} MATCHES ".*BSD" OR ${CMAKE_SYSTEM_NAME} STREQUAL ".*GNU") find_package(Freetype) if (${FREETYPE_FOUND}) include_directories(${FREETYPE_INCLUDE_DIRS}) diff --git a/tests/vm/CMakeLists.txt b/tests/vm/CMakeLists.txt index ee866de9..b41e73f8 100644 --- a/tests/vm/CMakeLists.txt +++ b/tests/vm/CMakeLists.txt @@ -29,7 +29,7 @@ if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang") target_link_libraries(vm-test-direct vm-test-common) endif() -if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") +if (${CMAKE_SYSTEM_NAME} STREQUAL ".*Linux" OR ${CMAKE_SYSTEM_NAME} MATCHES ".*BSD" OR ${CMAKE_SYSTEM_NAME} STREQUAL ".*GNU") add_definitions(-fno-rtti -fno-exceptions) if ("${CMAKE_BUILD_TYPE}" STREQUAL "Release") add_definitions(-DNDEBUG -fomit-frame-pointer) From d80d0a140539bcf7baa7b508147d47e079708998 Mon Sep 17 00:00:00 2001 From: smallville7123 Date: Wed, 1 Sep 2021 12:14:59 +1000 Subject: [PATCH 07/11] Erick555: fix graphite/pull/60 --- src/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 723a38de..65ac266e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -163,4 +163,4 @@ endif() install(TARGETS graphite2 EXPORT graphite2 LIBRARY DESTINATION lib${LIB_SUFFIX} ARCHIVE DESTINATION lib${LIB_SUFFIX} PUBLIC_HEADER DESTINATION include/graphite2 RUNTIME DESTINATION bin) -install(EXPORT graphite2 DESTINATION share/graphite2 NAMESPACE gr2_) +install(EXPORT graphite2 DESTINATION lib${LIB_SUFFIX}/graphite2 NAMESPACE gr2_) From c061e3499a5f91c39cf26d595e576c4e23594713 Mon Sep 17 00:00:00 2001 From: smallville7123 Date: Wed, 1 Sep 2021 12:15:54 +1000 Subject: [PATCH 08/11] ffontaine: fix graphite/pull/65 --- src/CMakeLists.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 65ac266e..dff66bb3 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -131,7 +131,9 @@ if (${CMAKE_SYSTEM_NAME} STREQUAL ".*Linux" OR ${CMAKE_SYSTEM_NAME} MATCHES ".*B nolib_test(stdc++ $) endif () set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "") - CREATE_LIBTOOL_FILE(graphite2 "/lib${LIB_SUFFIX}") + if (BUILD_SHARED_LIBS) + CREATE_LIBTOOL_FILE(graphite2 "/lib${LIB_SUFFIX}") + endif() endif() if (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") @@ -148,7 +150,9 @@ if (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") nolib_test(stdc++ $) endif() set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "") - CREATE_LIBTOOL_FILE(graphite2 "/lib${LIB_SUFFIX}") + if (BUILD_SHARED_LIBS) + CREATE_LIBTOOL_FILE(graphite2 "/lib${LIB_SUFFIX}") + endif() endif() if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") From 4657a2c696286d07c562d79aafc6383c08a3b663 Mon Sep 17 00:00:00 2001 From: smallville7123 Date: Wed, 1 Sep 2021 12:16:50 +1000 Subject: [PATCH 09/11] Biswa96: fix graphite/pull/66 --- CMakeLists.txt | 3 ++- graphite2.pc.in | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8eda0478..32931511 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -90,9 +90,10 @@ if (NOT GRAPHITE2_NFILEFACE) endif() set(version 3.0.1) +set(prefix ${CMAKE_INSTALL_PREFIX}) set(libdir ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}) set(includedir ${CMAKE_INSTALL_PREFIX}/include) -configure_file(graphite2.pc.in graphite2.pc) +configure_file(graphite2.pc.in graphite2.pc @ONLY) install(FILES ${PROJECT_BINARY_DIR}/graphite2.pc DESTINATION lib${LIB_SUFFIX}/pkgconfig) diff --git a/graphite2.pc.in b/graphite2.pc.in index a4f19b39..bfbd9fc2 100644 --- a/graphite2.pc.in +++ b/graphite2.pc.in @@ -1,7 +1,11 @@ +prefix=@prefix@ +exec_prefix=${prefix} +libdir=${prefix}/lib +includedir=${prefix}/include Name: Graphite2 Description: Font rendering engine for Complex Scripts -Version: ${version} +Version: @version@ Libs: -L${libdir} -lgraphite2 Cflags: -I${includedir} From afc67cc90d34f4d82f21edba87762db5ad36fac1 Mon Sep 17 00:00:00 2001 From: smallville7123 Date: Wed, 1 Sep 2021 12:19:26 +1000 Subject: [PATCH 10/11] spl: fix graphite/issues/55 --- CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 32931511..aa07592d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -83,7 +83,10 @@ if (BUILD_SHARED_LIBS) endif() add_subdirectory(src) -add_subdirectory(tests) +if (NOT GRAPHITE2_NFILEFACE) + # tests cannot be built with GRAPHITE2_NFILEFACE + add_subdirectory(tests) +endif() add_subdirectory(doc) if (NOT GRAPHITE2_NFILEFACE) add_subdirectory(gr2fonttest) From 44804287adc57e9a2233dd3d1a3eee29bf87fcf5 Mon Sep 17 00:00:00 2001 From: mgood7123 Date: Sat, 8 Jan 2022 21:43:08 +1000 Subject: [PATCH 11/11] FreeBSD uses amd64 instead of x86_64 --- src/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index dff66bb3..d1293633 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -107,7 +107,7 @@ if (${CMAKE_SYSTEM_NAME} STREQUAL ".*Linux" OR ${CMAKE_SYSTEM_NAME} MATCHES ".*B COMPILE_FLAGS "-Wall -Wextra -Wno-unknown-pragmas -Wendif-labels -Wshadow -Wctor-dtor-privacy -Wnon-virtual-dtor -fno-rtti -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden" LINK_FLAGS "-nodefaultlibs ${GRAPHITE_LINK_FLAGS}" LINKER_LANGUAGE C) - if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86|i.86") + if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86|i.86|amd64") add_definitions(-mfpmath=sse -msse2) endif() if (CMAKE_COMPILER_IS_GNUCXX) @@ -141,7 +141,7 @@ if (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") COMPILE_FLAGS "-Wall -Wextra -Wno-unknown-pragmas -Wimplicit-fallthrough -Wendif-labels -Wshadow -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -fno-rtti -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden" LINK_FLAGS "-nodefaultlibs" LINKER_LANGUAGE C) - if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86|i.86") + if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86|i.86|amd64") add_definitions(-mfpmath=sse -msse2) endif() target_link_libraries(graphite2 c)