Skip to content

Commit f90f256

Browse files
authored
Merge pull request commonmark#269 from foonathan/master
Fix cmake warning about CMP0048, again
2 parents faf7ab3 + abf3a7a commit f90f256

File tree

2 files changed

+5
-23
lines changed

2 files changed

+5
-23
lines changed

CMakeLists.txt

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,12 @@
1-
cmake_minimum_required(VERSION 2.8.9)
2-
3-
# prevent ugly developer warnings because version is set directly, not through project()
4-
# it should be redone properly by using VERSION in project() if on CMake 3.x
5-
if(CMAKE_MAJOR_VERSION GREATER 2)
6-
cmake_policy(SET CMP0048 OLD)
7-
endif()
8-
9-
project(cmark)
1+
cmake_minimum_required(VERSION 3.0)
2+
project(cmark VERSION 0.28.3)
103

114
include("FindAsan.cmake")
125

136
if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
147
message(FATAL_ERROR "Do not build in-source.\nPlease remove CMakeCache.txt and the CMakeFiles/ directory.\nThen: mkdir build ; cd build ; cmake .. ; make")
158
endif()
169

17-
set(PROJECT_NAME "cmark")
18-
19-
set(PROJECT_VERSION_MAJOR 0)
20-
set(PROJECT_VERSION_MINOR 28)
21-
set(PROJECT_VERSION_PATCH 3)
22-
set(PROJECT_VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH} )
23-
2410
option(CMARK_TESTS "Build cmark tests and enable testing" ON)
2511
option(CMARK_STATIC "Build static libcmark library" ON)
2612
option(CMARK_SHARED "Build shared libcmark library" ON)

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)