diff options
Diffstat (limited to 'Build/source/libs/graphite2/graphite2-src/CMakeLists.txt')
-rw-r--r-- | Build/source/libs/graphite2/graphite2-src/CMakeLists.txt | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/Build/source/libs/graphite2/graphite2-src/CMakeLists.txt b/Build/source/libs/graphite2/graphite2-src/CMakeLists.txt index a4c648e3085..496712d54f8 100644 --- a/Build/source/libs/graphite2/graphite2-src/CMakeLists.txt +++ b/Build/source/libs/graphite2/graphite2-src/CMakeLists.txt @@ -1,13 +1,12 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0 FATAL_ERROR) cmake_policy(SET CMP0012 NEW) include(TestBigEndian) -include(FindPythonInterp) - +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) -endif (NOT CMAKE_BUILD_TYPE) +endif() option(BUILD_SHARED_LIBS "Make library a shared library instead of static" ON) @@ -24,6 +23,7 @@ option(GRAPHITE2_NFILEFACE "Compile out the gr_make_file_face* APIs") option(GRAPHITE2_NTRACING "Compile out log segment tracing capability" ON) option(GRAPHITE2_TELEMETRY "Add memory usage telemetry") set(GRAPHITE2_SANITIZERS "" CACHE STRING "Set compiler sanitizers passed to -fsanitize") +set(GRAPHITE2_FUZZING_ENGINE libFuzzer.a CACHE STRING "Fuzzing engine to link against for the fuzzers") message(STATUS "Build: " ${CMAKE_BUILD_TYPE}) string(REPLACE "ON" "shared" _LIB_OBJECT_TYPE ${BUILD_SHARED_LIBS}) @@ -50,18 +50,18 @@ endif () string(TOLOWER ${GRAPHITE2_VM_TYPE} GRAPHITE2_VM_TYPE) if (NOT GRAPHITE2_VM_TYPE MATCHES "auto|direct|call") message(SEND_ERROR "unrecognised vm machine type: ${GRAPHITE2_VM_TYPE}. Only Auto, Direct or Call are available") -endif (NOT GRAPHITE2_VM_TYPE MATCHES "auto|direct|call") +endif() if (GRAPHITE2_VM_TYPE STREQUAL "auto") if (CMAKE_BUILD_TYPE MATCHES "[Rr]el(ease|[Ww]ith[Dd]eb[Ii]nfo)") set(GRAPHITE2_VM_TYPE "direct") else(CMAKE_BUILD_TYPE MATCHES "[Rr]el(ease|[Ww]ith[Dd]eb[Ii]nfo)") set(GRAPHITE2_VM_TYPE "call") - endif(CMAKE_BUILD_TYPE MATCHES "[Rr]el(ease|[Ww]ith[Dd]eb[Ii]nfo)") -endif (GRAPHITE2_VM_TYPE STREQUAL "auto") + endif() +endif() if (GRAPHITE2_VM_TYPE STREQUAL "direct" AND NOT (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")) message(WARNING "vm machine type direct can only be built using GCC") set(GRAPHITE2_VM_TYPE "call") -endif (GRAPHITE2_VM_TYPE STREQUAL "direct" AND NOT (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")) +endif() message(STATUS "Using vm machine type: ${GRAPHITE2_VM_TYPE}") if (BUILD_SHARED_LIBS) @@ -69,22 +69,24 @@ if (BUILD_SHARED_LIBS) EXEC_PROGRAM(${PYTHON_EXECUTABLE} ARGS -c \"import ctypes\; print(ctypes.sizeof(ctypes.c_void_p)) \" OUTPUT_VARIABLE PYTHON_SIZEOF_VOID_P) - if ((PYTHON_SIZEOF_VOID_P STREQUAL CMAKE_SIZEOF_VOID_P) AND (NOT GRAPHITE2_NFILEFACE) AND ((NOT GRAPHITE2_SANITIZERS MATCHES "address") OR CMAKE_COMPILER_IS_GNUCXX)) + if (NOT (PYTHON_VERSION_MAJOR GREATER 2 AND PYTHON_VERSION_MINOR GREATER 5)) + message(WARNING "Python version 3.6 or greater required. Disabling some tests.") + elseif ((PYTHON_SIZEOF_VOID_P STREQUAL CMAKE_SIZEOF_VOID_P) AND (NOT GRAPHITE2_NFILEFACE) AND ((NOT GRAPHITE2_SANITIZERS MATCHES "address") OR CMAKE_COMPILER_IS_GNUCXX)) set(PYTHON_CTYPES_COMPATBILE TRUE) else () if ((NOT GRAPHITE2_SANITIZERS MATCHES "address") OR CMAKE_COMPILER_IS_GNUCXX) message(WARNING "Python ctypes is incompatible with built DLL. Disabling some tests.") endif () endif () - endif (PYTHONINTERP_FOUND) -endif (BUILD_SHARED_LIBS) + endif() +endif() add_subdirectory(src) add_subdirectory(tests) add_subdirectory(doc) if (NOT GRAPHITE2_NFILEFACE) add_subdirectory(gr2fonttest) -endif (NOT GRAPHITE2_NFILEFACE) +endif() set(version 3.0.1) set(libdir ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}) |