From c38801e6486ea9d5b4916451a5ea2442100d17b6 Mon Sep 17 00:00:00 2001 From: Matt Blair Date: Sun, 4 Oct 2020 23:08:46 -0400 Subject: [PATCH] Apply compiler flags from Harfbuzz CMake config --- CMakeLists.txt | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8578a43..445a482 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -363,14 +363,17 @@ set(HARFBUZZ_LIBRARIES CACHE INTERNAL "Harfbuzz libraries" FORCE) if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") - target_compile_options(harfbuzz PRIVATE -utf-8 -wd4996 -wd4267 -wd4244) + target_compile_options(harfbuzz PRIVATE -utf-8 -wd4996 -wd4267 -wd4244) endif() -if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") - target_compile_options(harfbuzz - PRIVATE - -Wno-vla-extension - -Wno-extended-offsetof) +if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + # Apply compiler flags from Harfbuzz CMake config. + target_compile_options(harfbuzz + PRIVATE + -fno-rtti + -fno-exceptions + -fno-threadsafe-statics + ) endif() target_compile_definitions(harfbuzz PUBLIC