Skip to content

Commit abf3a7a

Browse files
committed
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.
1 parent 1104369 commit abf3a7a

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/CMakeLists.txt

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmark_version.h.in
5959
include (GenerateExportHeader)
6060

6161
add_executable(${PROGRAM} ${PROGRAM_SOURCES})
62-
add_compiler_export_flags()
6362

6463
# Disable the PUBLIC declarations when compiling the executable:
6564
set_target_properties(${PROGRAM} PROPERTIES
@@ -72,12 +71,9 @@ set(CMAKE_LINKER_DEBUG "${CMAKE_LINKER_FLAGS_DEBUG}")
7271
set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE} -pg")
7372
set(CMAKE_LINKER_PROFILE "${CMAKE_LINKER_FLAGS_RELEASE} -pg")
7473

75-
if (${CMAKE_VERSION} VERSION_GREATER "1.8")
76-
set(CMAKE_C_VISIBILITY_PRESET hidden)
77-
set(CMAKE_VISIBILITY_INLINES_HIDDEN 1)
78-
elseif(CMAKE_COMPILER_IS_GNUCC OR ${CMAKE_C_COMPILER_ID} STREQUAL "Clang")
79-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden")
80-
endif ()
74+
# -fvisibility=hidden
75+
set(CMAKE_C_VISIBILITY_PRESET hidden)
76+
set(CMAKE_VISIBILITY_INLINES_HIDDEN 1)
8177

8278
if (CMARK_SHARED)
8379
add_library(${LIBRARY} SHARED ${LIBRARY_SOURCES})

0 commit comments

Comments
 (0)