Skip to content

Commit

Permalink
Remove deprecated call to add_compiler_export_flags()
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
foonathan committed Mar 18, 2019
1 parent 1104369 commit abf3a7a
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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})
Expand Down

0 comments on commit abf3a7a

Please sign in to comment.