summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2021-10-08 09:20:38 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2021-10-08 09:20:38 +0900
commit3761443457135cc302ff9486ddda82ce53b37432 (patch)
tree6c9b9b830185f1f03d8d2f2f6a4f026c39654c32
parent9107136a24189311310158f4847403d96b058adf (diff)
downloadcmake-3761443457135cc302ff9486ddda82ce53b37432.tar.gz
cmake-3761443457135cc302ff9486ddda82ce53b37432.tar.bz2
cmake-3761443457135cc302ff9486ddda82ce53b37432.zip
Imported Upstream version 3.19.6upstream/3.19.6
-rw-r--r--Help/release/3.19.rst9
-rw-r--r--Modules/Compiler/Intel-Fortran.cmake12
-rw-r--r--Modules/FindPython/Support.cmake4
-rw-r--r--Source/CMakeVersion.cmake4
-rw-r--r--Source/cmCMakePresetsFile.cxx1
-rw-r--r--Tests/RunCMake/CMakePresets/CMakePresets.json.in4
-rw-r--r--Tests/RunCMake/CMakePresets/Comment-result.txt1
-rw-r--r--Tests/RunCMake/CMakePresets/Comment-stderr.txt2
-rw-r--r--Tests/RunCMake/CMakePresets/Comment.json.in11
-rw-r--r--Tests/RunCMake/CMakePresets/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/CMakePresets/validate_schema.py3
-rw-r--r--Tests/RunCMake/Ninja/RunCMakeTest.cmake2
-rw-r--r--Tests/RunCMake/RunCMake.cmake6
-rw-r--r--Tests/RunCMake/try_compile/RunCMakeTest.cmake4
14 files changed, 51 insertions, 13 deletions
diff --git a/Help/release/3.19.rst b/Help/release/3.19.rst
index d8f4f9d79..1d55f1e57 100644
--- a/Help/release/3.19.rst
+++ b/Help/release/3.19.rst
@@ -409,7 +409,6 @@ Changes made since CMake 3.19.0 include the following.
:generator:`Visual Studio 14 2015` generator. It has now been fixed to
work with :ref:`Visual Studio Generators` for later VS versions too.
-
3.19.5
------
@@ -425,3 +424,11 @@ Changes made since CMake 3.19.0 include the following.
*Link Binaries With Libraries* build phase broke the ability to switch
between device and simulator builds without reconfiguring. That capability
has now been restored.
+
+3.19.6
+------
+
+* The :manual:`cmake-presets(7)` feature no longer allows comments in
+ ``CMakePresets.json`` or ``CMakeUserPresets.json`` files.
+ This was mistakenly allowed by the implementation in CMake 3.19.0 through
+ CMake 3.19.5, and was not documented.
diff --git a/Modules/Compiler/Intel-Fortran.cmake b/Modules/Compiler/Intel-Fortran.cmake
index 71f25f43f..9fb6d46c3 100644
--- a/Modules/Compiler/Intel-Fortran.cmake
+++ b/Modules/Compiler/Intel-Fortran.cmake
@@ -13,7 +13,15 @@ set(CMAKE_Fortran_COMPILE_WITH_DEFINES 1)
set(CMAKE_Fortran_CREATE_PREPROCESSED_SOURCE "<CMAKE_Fortran_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
set(CMAKE_Fortran_CREATE_ASSEMBLY_SOURCE "<CMAKE_Fortran_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
-set(CMAKE_Fortran_PREPROCESS_SOURCE
- "<CMAKE_Fortran_COMPILER> -fpp <DEFINES> <INCLUDES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
+if(CMAKE_HOST_WIN32)
+ # MSVC-like
+ set(CMAKE_Fortran_PREPROCESS_SOURCE
+ "<CMAKE_Fortran_COMPILER> -fpp <DEFINES> <INCLUDES> <FLAGS> -P <SOURCE> -Fi<PREPROCESSED_SOURCE>")
+else()
+ # GNU-like
+ set(CMAKE_Fortran_PREPROCESS_SOURCE
+ "<CMAKE_Fortran_COMPILER> -fpp <DEFINES> <INCLUDES> <FLAGS> -P <SOURCE> -o <PREPROCESSED_SOURCE>")
+endif()
+
set(CMAKE_Fortran_COMPILE_OPTIONS_PREPROCESS_ON "-fpp")
set(CMAKE_Fortran_COMPILE_OPTIONS_PREPROCESS_OFF "-nofpp")
diff --git a/Modules/FindPython/Support.cmake b/Modules/FindPython/Support.cmake
index 79b1d1843..8b2d73948 100644
--- a/Modules/FindPython/Support.cmake
+++ b/Modules/FindPython/Support.cmake
@@ -1528,7 +1528,7 @@ if ("Interpreter" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS)
if (${_PYTHON_PREFIX}_FIND_VERSION_RANGE)
list (APPEND _${_PYTHON_PREFIX}_VALIDATE_OPTIONS IN_RANGE)
elseif (DEFINED ${_PYTHON_PREFIX}_FIND_VERSION)
- list (APPEND VERSION ${${_PYTHON_PREFIX}_FIND_VERSION})
+ list (APPEND _${_PYTHON_PREFIX}_VALIDATE_OPTIONS VERSION ${${_PYTHON_PREFIX}_FIND_VERSION})
endif()
while (TRUE)
@@ -1996,7 +1996,7 @@ if ("Compiler" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS)
if (${_PYTHON_PREFIX}_FIND_VERSION_RANGE)
list (APPEND _${_PYTHON_PREFIX}_VALIDATE_OPTIONS IN_RANGE)
elseif (DEFINED ${_PYTHON_PREFIX}_FIND_VERSION)
- list (APPEND VERSION ${${_PYTHON_PREFIX}_FIND_VERSION})
+ list (APPEND _${_PYTHON_PREFIX}_VALIDATE_OPTIONS VERSION ${${_PYTHON_PREFIX}_FIND_VERSION})
endif()
while (TRUE)
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 2db3ea84a..2652592f9 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -1,7 +1,7 @@
# CMake version number components.
set(CMake_VERSION_MAJOR 3)
set(CMake_VERSION_MINOR 19)
-set(CMake_VERSION_PATCH 5)
+set(CMake_VERSION_PATCH 6)
#set(CMake_VERSION_RC 0)
set(CMake_VERSION_IS_DIRTY 0)
@@ -21,7 +21,7 @@ endif()
if(NOT CMake_VERSION_NO_GIT)
# If this source was exported by 'git archive', use its commit info.
- set(git_info [==[d5401de605 CMake 3.19.5]==])
+ set(git_info [==[0ecd9de6dd CMake 3.19.6]==])
# Otherwise, try to identify the current development source version.
if(NOT git_info MATCHES "^([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]?[0-9a-f]?)[0-9a-f]* "
diff --git a/Source/cmCMakePresetsFile.cxx b/Source/cmCMakePresetsFile.cxx
index cf5db6ec4..872cb4e63 100644
--- a/Source/cmCMakePresetsFile.cxx
+++ b/Source/cmCMakePresetsFile.cxx
@@ -839,6 +839,7 @@ cmCMakePresetsFile::ReadFileResult cmCMakePresetsFile::ReadJSONFile(
Json::Value root;
Json::CharReaderBuilder builder;
+ Json::CharReaderBuilder::strictMode(&builder.settings_);
if (!Json::parseFromStream(builder, fin, &root, nullptr)) {
return ReadFileResult::JSON_PARSE_ERROR;
}
diff --git a/Tests/RunCMake/CMakePresets/CMakePresets.json.in b/Tests/RunCMake/CMakePresets/CMakePresets.json.in
index 54e41403e..e65c1a920 100644
--- a/Tests/RunCMake/CMakePresets/CMakePresets.json.in
+++ b/Tests/RunCMake/CMakePresets/CMakePresets.json.in
@@ -1,8 +1,4 @@
-/*
- * Block comment
- */
{
- // Inline comment
"version": 1,
"cmakeMinimumRequired": {
"major": 3,
diff --git a/Tests/RunCMake/CMakePresets/Comment-result.txt b/Tests/RunCMake/CMakePresets/Comment-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/CMakePresets/Comment-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMakePresets/Comment-stderr.txt b/Tests/RunCMake/CMakePresets/Comment-stderr.txt
new file mode 100644
index 000000000..2f404bc45
--- /dev/null
+++ b/Tests/RunCMake/CMakePresets/Comment-stderr.txt
@@ -0,0 +1,2 @@
+^CMake Error: Could not read presets from [^
+]*/Tests/RunCMake/CMakePresets/Comment: JSON parse error$
diff --git a/Tests/RunCMake/CMakePresets/Comment.json.in b/Tests/RunCMake/CMakePresets/Comment.json.in
new file mode 100644
index 000000000..0f7120c11
--- /dev/null
+++ b/Tests/RunCMake/CMakePresets/Comment.json.in
@@ -0,0 +1,11 @@
+// Comment
+{
+ "version": 1,
+ "configurePresets": [
+ {
+ "name": "Comment",
+ "generator": "@RunCMake_GENERATOR@",
+ "binaryDir": "${sourceDir}/build"
+ }
+ ]
+}
diff --git a/Tests/RunCMake/CMakePresets/RunCMakeTest.cmake b/Tests/RunCMake/CMakePresets/RunCMakeTest.cmake
index 1ffda3d62..1f399fe10 100644
--- a/Tests/RunCMake/CMakePresets/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CMakePresets/RunCMakeTest.cmake
@@ -77,6 +77,7 @@ endfunction()
# Test CMakePresets.json errors
set(CMakePresets_SCHEMA_EXPECTED_RESULT 1)
run_cmake_presets(NoCMakePresets)
+run_cmake_presets(Comment)
run_cmake_presets(JSONParseError)
run_cmake_presets(InvalidRoot)
run_cmake_presets(NoVersion)
diff --git a/Tests/RunCMake/CMakePresets/validate_schema.py b/Tests/RunCMake/CMakePresets/validate_schema.py
index c9f84ee17..b2a67fc4b 100644
--- a/Tests/RunCMake/CMakePresets/validate_schema.py
+++ b/Tests/RunCMake/CMakePresets/validate_schema.py
@@ -1,4 +1,3 @@
-import jsmin
import json
import jsonschema
import os.path
@@ -6,7 +5,7 @@ import sys
with open(sys.argv[1], "rb") as f:
- contents = json.loads(jsmin.jsmin(f.read().decode("utf-8-sig")))
+ contents = json.loads(f.read().decode("utf-8-sig"))
schema_file = os.path.join(
os.path.dirname(__file__),
diff --git a/Tests/RunCMake/Ninja/RunCMakeTest.cmake b/Tests/RunCMake/Ninja/RunCMakeTest.cmake
index e6f86a1a9..35be2ecfc 100644
--- a/Tests/RunCMake/Ninja/RunCMakeTest.cmake
+++ b/Tests/RunCMake/Ninja/RunCMakeTest.cmake
@@ -34,6 +34,7 @@ function(run_NoWorkToDo)
run_cmake(NoWorkToDo)
set(RunCMake_TEST_NO_CLEAN 1)
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/NoWorkToDo-build)
+ set(RunCMake_TEST_OUTPUT_MERGE 1)
run_cmake_command(NoWorkToDo-build ${CMAKE_COMMAND} --build .)
run_cmake_command(NoWorkToDo-nowork ${CMAKE_COMMAND} --build . -- -d explain)
endfunction()
@@ -43,6 +44,7 @@ function(run_VerboseBuild)
run_cmake(VerboseBuild)
set(RunCMake_TEST_NO_CLEAN 1)
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/VerboseBuild-build)
+ set(RunCMake_TEST_OUTPUT_MERGE 1)
run_cmake_command(VerboseBuild-build ${CMAKE_COMMAND} --build . -v --clean-first)
run_cmake_command(VerboseBuild-nowork ${CMAKE_COMMAND} --build . --verbose)
endfunction()
diff --git a/Tests/RunCMake/RunCMake.cmake b/Tests/RunCMake/RunCMake.cmake
index e8fbd6a7c..a26f632e0 100644
--- a/Tests/RunCMake/RunCMake.cmake
+++ b/Tests/RunCMake/RunCMake.cmake
@@ -139,6 +139,12 @@ function(run_cmake test)
if(NOT "${actual_result}" MATCHES "${expect_result}")
string(APPEND msg "Result is [${actual_result}], not [${expect_result}].\n")
endif()
+
+ # Special case: remove ninja no-op line from stderr, but not stdout.
+ # Test cases that look for it should use RunCMake_TEST_OUTPUT_MERGE.
+ string(REGEX REPLACE "(^|\r?\n)ninja: no work to do\\.\r?\n" "\\1" actual_stderr "${actual_stderr}")
+
+ # Remove incidental content from both stdout and stderr.
string(CONCAT ignore_line_regex
"(^|\n)((==[0-9]+=="
"|BullseyeCoverage"
diff --git a/Tests/RunCMake/try_compile/RunCMakeTest.cmake b/Tests/RunCMake/try_compile/RunCMakeTest.cmake
index 5b849bf8a..fffb03819 100644
--- a/Tests/RunCMake/try_compile/RunCMakeTest.cmake
+++ b/Tests/RunCMake/try_compile/RunCMakeTest.cmake
@@ -93,7 +93,9 @@ if(RunCMake_GENERATOR MATCHES "Make|Ninja")
message(STATUS "RerunCMake: first configuration...")
run_cmake(RerunCMake)
if(NOT CMake_TEST_FILESYSTEM_1S)
+ set(RunCMake_TEST_OUTPUT_MERGE 1)
run_cmake_command(RerunCMake-nowork${ninja} ${CMAKE_COMMAND} --build .)
+ unset(RunCMake_TEST_OUTPUT_MERGE)
endif()
execute_process(COMMAND ${CMAKE_COMMAND} -E sleep 1) # handle 1s resolution
@@ -101,7 +103,9 @@ if(RunCMake_GENERATOR MATCHES "Make|Ninja")
file(WRITE "${in_tc}" "does-not-compile\n")
run_cmake_command(RerunCMake-rerun${ninja} ${CMAKE_COMMAND} --build .)
if(NOT CMake_TEST_FILESYSTEM_1S)
+ set(RunCMake_TEST_OUTPUT_MERGE 1)
run_cmake_command(RerunCMake-nowork${ninja} ${CMAKE_COMMAND} --build .)
+ unset(RunCMake_TEST_OUTPUT_MERGE)
endif()
unset(RunCMake_TEST_BINARY_DIR)