>From cbf549f2042293c8e87fef906e6423d2871bc5b4 Mon Sep 17 00:00:00 2001 From: Nikolaus Waxweiler Date: Sat, 7 Apr 2018 21:48:17 +0100 Subject: [PATCH 06/19] CMakeLists.txt: hide symbols by default for static and shared builds FreeType explicitly marks functions to export. This change mimics the Autotools build where a symbol list is generated and used. Due to the old CMake version required, a policy override has to be set. --- CMakeLists.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8ef0fc947..00d8916f8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -89,10 +89,11 @@ # CentOS 5.11 with cmake 2.8.11.2 installed. Raising the minimum version makes # sure this requirement is actually tested. cmake_minimum_required(VERSION 2.8.11.2) +# Allow symbol visibility settings also on static libraries. +cmake_policy(SET CMP0063 NEW) include(CheckIncludeFile) - # CMAKE_TOOLCHAIN_FILE must be set before `project' is called, which # configures the base build environment and references the toolchain file if (APPLE) @@ -352,6 +353,10 @@ add_library(freetype ${BASE_SRCS} ) +set_target_properties( + freetype PROPERTIES + C_VISIBILITY_PRESET hidden) + if (BUILD_SHARED_LIBS) set_target_properties(freetype PROPERTIES -- 2.14.3