Skip to content

Commit 1e30143

Browse files
winterheartjgm
authored andcommitted
Update cmake_minimum_required to 3.14
Recent CMake 4.1 warns that <3.10 support will be deprecated. Update minimum version and simplify some parts of project.
1 parent 21abe60 commit 1e30143

File tree

2 files changed

+6
-20
lines changed

2 files changed

+6
-20
lines changed

CMakeLists.txt

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
cmake_minimum_required(VERSION 3.7)
2-
3-
if(POLICY CMP0092)
4-
cmake_policy(SET CMP0092 NEW)
5-
endif()
1+
cmake_minimum_required(VERSION 3.14)
62

73
project(cmark
84
LANGUAGES C CXX
95
VERSION 0.31.1)
106

7+
set(CMAKE_C_STANDARD 99)
8+
set(CMAKE_C_STANDARD_REQUIRED YES)
9+
set(CMAKE_C_EXTENSIONS NO)
10+
1111
if(CMAKE_BUILD_TYPE STREQUAL Asan)
1212
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/modules)
1313
include(FindAsan)
@@ -54,12 +54,6 @@ option(CMARK_LIB_FUZZER "Build libFuzzer fuzzing harness" OFF)
5454
option(BUILD_SHARED_LIBS "Build the CMark library as shared"
5555
${_CMARK_BUILD_SHARED_LIBS_DEFAULT})
5656

57-
if(NOT MSVC)
58-
set(CMAKE_C_STANDARD 99)
59-
set(CMAKE_C_STANDARD_REQUIRED YES)
60-
set(CMAKE_C_EXTENSIONS NO)
61-
endif()
62-
6357
# -fvisibility=hidden
6458
set(CMAKE_C_VISIBILITY_PRESET hidden)
6559
set(CMAKE_VISIBILITY_INLINES_HIDDEN 1)

test/CMakeLists.txt

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,7 @@ else()
99
set(PYTHON_REQUIRED)
1010
endif()
1111

12-
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.12)
13-
find_package(Python3 ${PYTHON_REQUIRED} COMPONENTS Interpreter)
14-
else()
15-
find_package(PythonInterp 3 ${PYTHON_REQUIRED})
16-
set(Python3_Interpreter_FOUND ${PYTHONINTERP_FOUND})
17-
add_executable(Python3::Interpreter IMPORTED)
18-
set_target_properties(Python3::Interpreter PROPERTIES
19-
IMPORTED_LOCATION ${PYTHON_EXECUTABLE})
20-
endif()
12+
find_package(Python3 ${PYTHON_REQUIRED} COMPONENTS Interpreter)
2113

2214
IF (Python3_Interpreter_FOUND)
2315

0 commit comments

Comments
 (0)