From abf3a7a47d45ddad2a1bd69b176a4c471f65231d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20M=C3=BCller?= Date: Mon, 18 Mar 2019 12:22:15 +0100 Subject: Remove deprecated call to add_compiler_export_flags() It is deprecated in CMake 3.0, the replacement is to set the CXX_VISIBILITY_PRESET (or in our case C_VISIBILITY_PRESET) and VISIBILITY_INLINES_HIDDEN properties of the target. We're already setting them by setting the CMake variables anyway, so the call can be removed. --- src/CMakeLists.txt | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 468b0f0..10fcb1d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -59,7 +59,6 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmark_version.h.in include (GenerateExportHeader) add_executable(${PROGRAM} ${PROGRAM_SOURCES}) -add_compiler_export_flags() # Disable the PUBLIC declarations when compiling the executable: set_target_properties(${PROGRAM} PROPERTIES @@ -72,12 +71,9 @@ set(CMAKE_LINKER_DEBUG "${CMAKE_LINKER_FLAGS_DEBUG}") set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE} -pg") set(CMAKE_LINKER_PROFILE "${CMAKE_LINKER_FLAGS_RELEASE} -pg") -if (${CMAKE_VERSION} VERSION_GREATER "1.8") - set(CMAKE_C_VISIBILITY_PRESET hidden) - set(CMAKE_VISIBILITY_INLINES_HIDDEN 1) -elseif(CMAKE_COMPILER_IS_GNUCC OR ${CMAKE_C_COMPILER_ID} STREQUAL "Clang") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden") -endif () +# -fvisibility=hidden +set(CMAKE_C_VISIBILITY_PRESET hidden) +set(CMAKE_VISIBILITY_INLINES_HIDDEN 1) if (CMARK_SHARED) add_library(${LIBRARY} SHARED ${LIBRARY_SOURCES}) -- cgit v1.2.3