From kwrobot at kitware.com Sat Jun 1 00:03:06 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Sat, 1 Jun 2019 00:03:06 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.14.5-1178-g7f4a1d8 Message-ID: <20190601040306.7F28F1281E3@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 7f4a1d83790cad143dc8400cc78186dbef88e23d (commit) from 187928875d215df8757b291ad629a36df75da42b (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7f4a1d83790cad143dc8400cc78186dbef88e23d commit 7f4a1d83790cad143dc8400cc78186dbef88e23d Author: Kitware Robot AuthorDate: Sat Jun 1 00:01:07 2019 -0400 Commit: Kitware Robot CommitDate: Sat Jun 1 00:01:07 2019 -0400 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index a3d46bc..63333ef 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 14) -set(CMake_VERSION_PATCH 20190531) +set(CMake_VERSION_PATCH 20190601) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From kwrobot at kitware.com Sun Jun 2 00:03:04 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Sun, 2 Jun 2019 00:03:04 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.14.5-1179-g51e7488 Message-ID: <20190602040305.05D96110308@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 51e7488c03f29ae6247d5012fed7dc3fa7924ce0 (commit) from 7f4a1d83790cad143dc8400cc78186dbef88e23d (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=51e7488c03f29ae6247d5012fed7dc3fa7924ce0 commit 51e7488c03f29ae6247d5012fed7dc3fa7924ce0 Author: Kitware Robot AuthorDate: Sun Jun 2 00:01:04 2019 -0400 Commit: Kitware Robot CommitDate: Sun Jun 2 00:01:04 2019 -0400 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 63333ef..a1a4c22 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 14) -set(CMake_VERSION_PATCH 20190601) +set(CMake_VERSION_PATCH 20190602) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From kwrobot at kitware.com Mon Jun 3 00:03:04 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Mon, 3 Jun 2019 00:03:04 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.14.5-1180-g7dae93b Message-ID: <20190603040304.A27B6125BD7@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 7dae93b4053812d344a80918a8c1c05600800c21 (commit) from 51e7488c03f29ae6247d5012fed7dc3fa7924ce0 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7dae93b4053812d344a80918a8c1c05600800c21 commit 7dae93b4053812d344a80918a8c1c05600800c21 Author: Kitware Robot AuthorDate: Mon Jun 3 00:01:05 2019 -0400 Commit: Kitware Robot CommitDate: Mon Jun 3 00:01:05 2019 -0400 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index a1a4c22..29543b8 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 14) -set(CMake_VERSION_PATCH 20190602) +set(CMake_VERSION_PATCH 20190603) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From kwrobot at kitware.com Mon Jun 3 08:23:06 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Mon, 3 Jun 2019 08:23:06 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.14.5-1184-g3cb5a8d9 Message-ID: <20190603122306.B14A8E58B4@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 3cb5a8d9b3add4394b12d61b5ce83ea6ca148fd1 (commit) via 18d6bdb42d6fceb2b753430e74a4d6076e321f03 (commit) via 774102aaec1a74ea069be9b10a2c846cdbfa609f (commit) via 4127f82179acb13746c6249dd420ffa8b4abeb72 (commit) from 7dae93b4053812d344a80918a8c1c05600800c21 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3cb5a8d9b3add4394b12d61b5ce83ea6ca148fd1 commit 3cb5a8d9b3add4394b12d61b5ce83ea6ca148fd1 Merge: 18d6bdb 774102a Author: Craig Scott AuthorDate: Mon Jun 3 12:20:13 2019 +0000 Commit: Kitware Robot CommitDate: Mon Jun 3 08:20:22 2019 -0400 Merge topic 'doc-test-cost-default' 774102aaec Help: Clarify the default value for test property COST Acked-by: Kitware Robot Merge-request: !3397 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=18d6bdb42d6fceb2b753430e74a4d6076e321f03 commit 18d6bdb42d6fceb2b753430e74a4d6076e321f03 Merge: 7dae93b 4127f82 Author: Craig Scott AuthorDate: Mon Jun 3 12:17:42 2019 +0000 Commit: Kitware Robot CommitDate: Mon Jun 3 08:18:02 2019 -0400 Merge topic 'add_library_unknown' 4127f82179 add_library: Document UNKNOWN type of imported targets Acked-by: Kitware Robot Merge-request: !3346 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=774102aaec1a74ea069be9b10a2c846cdbfa609f commit 774102aaec1a74ea069be9b10a2c846cdbfa609f Author: Craig Scott AuthorDate: Wed May 29 20:57:52 2019 -0400 Commit: Craig Scott CommitDate: Sun Jun 2 21:08:56 2019 +1000 Help: Clarify the default value for test property COST Co-Authored-By: Steve Mokris diff --git a/Help/prop_test/COST.rst b/Help/prop_test/COST.rst index 0c0fca7..9300d7b 100644 --- a/Help/prop_test/COST.rst +++ b/Help/prop_test/COST.rst @@ -1,8 +1,14 @@ COST ---- -Set this to a floating point value. Tests in a test set will be run -in descending order of cost. +This property describes the cost of a test. When parallel testing is +enabled, tests in the test set will be run in descending order of cost. +Projects can explicitly define the cost of a test by setting this property +to a floating point value. -This property describes the cost of a test. You can explicitly set -this value; tests with higher ``COST`` values will run first. +When the cost of a test is not defined by the project, +:manual:`ctest ` will initially use a default cost of ``0``. +It computes a weighted average of the cost each time a test is run and +uses that as an improved estimate of the cost for the next run. The more +a test is re-run in the same build directory, the more representative the +cost should become. https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4127f82179acb13746c6249dd420ffa8b4abeb72 commit 4127f82179acb13746c6249dd420ffa8b4abeb72 Author: Cristian Adam AuthorDate: Mon May 20 22:40:17 2019 +0200 Commit: Cristian Adam CommitDate: Sun Jun 2 08:44:47 2019 +0200 add_library: Document UNKNOWN type of imported targets diff --git a/Help/command/add_library.rst b/Help/command/add_library.rst index b42fe42..7274e44 100644 --- a/Help/command/add_library.rst +++ b/Help/command/add_library.rst @@ -94,6 +94,12 @@ The most important properties are: See documentation of the ``IMPORTED_*`` and ``INTERFACE_*`` properties for more information. +An ``UNKNOWN`` library type is typically only used in the implementation of +:ref:`Find Modules`. It allows the path to an imported library (often found +using the :command:`find_library` command) to be used without having to know +what type of library it is. This is especially useful on Windows where a +static library and a DLL's import library both have the same file extension. + Object Libraries ^^^^^^^^^^^^^^^^ ----------------------------------------------------------------------- Summary of changes: Help/command/add_library.rst | 6 ++++++ Help/prop_test/COST.rst | 14 ++++++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) hooks/post-receive -- CMake From kwrobot at kitware.com Mon Jun 3 09:23:07 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Mon, 3 Jun 2019 09:23:07 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.14.5-1186-g5e2d22c Message-ID: <20190603132307.37C6A10C9F1@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 5e2d22c177add56b2538ab10954dfb049c5cf945 (commit) via 52b298bd031d97df7cdb36e6386ebbfab10946b7 (commit) from 3cb5a8d9b3add4394b12d61b5ce83ea6ca148fd1 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5e2d22c177add56b2538ab10954dfb049c5cf945 commit 5e2d22c177add56b2538ab10954dfb049c5cf945 Merge: 3cb5a8d9 52b298b Author: Brad King AuthorDate: Mon Jun 3 13:22:25 2019 +0000 Commit: Kitware Robot CommitDate: Mon Jun 3 09:22:33 2019 -0400 Merge topic 'FindPython-Python_ROOT_DIR-searched-first' 52b298bd03 FindPython: ensure Python_ROOT_DIR is always searched first Acked-by: Kitware Robot Merge-request: !3408 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=52b298bd031d97df7cdb36e6386ebbfab10946b7 commit 52b298bd031d97df7cdb36e6386ebbfab10946b7 Author: Marc Chevrier AuthorDate: Fri May 31 19:05:04 2019 +0200 Commit: Marc Chevrier CommitDate: Fri May 31 19:05:04 2019 +0200 FindPython: ensure Python_ROOT_DIR is always searched first diff --git a/Modules/FindPython/Support.cmake b/Modules/FindPython/Support.cmake index 5d39240..49d8e26 100644 --- a/Modules/FindPython/Support.cmake +++ b/Modules/FindPython/Support.cmake @@ -1228,6 +1228,7 @@ if ("Development" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS find_library (${_PYTHON_PREFIX}_LIBRARY_RELEASE NAMES ${_${_PYTHON_PREFIX}_LIB_NAMES} NAMES_PER_DIR + HINTS ${_${_PYTHON_PREFIX}_HINTS} PATHS ${_${_PYTHON_PREFIX}_FRAMEWORK_PATHS} PATH_SUFFIXES ${_${_PYTHON_PREFIX}_PATH_SUFFIXES} NO_CMAKE_PATH @@ -1338,6 +1339,7 @@ if ("Development" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS find_library (${_PYTHON_PREFIX}_LIBRARY_RELEASE NAMES ${_${_PYTHON_PREFIX}_LIB_NAMES} NAMES_PER_DIR + HINTS ${_${_PYTHON_PREFIX}_HINTS} PATHS ${_${_PYTHON_PREFIX}_FRAMEWORK_PATHS} PATH_SUFFIXES ${_${_PYTHON_PREFIX}_PATH_SUFFIXES} NO_CMAKE_PATH ----------------------------------------------------------------------- Summary of changes: Modules/FindPython/Support.cmake | 2 ++ 1 file changed, 2 insertions(+) hooks/post-receive -- CMake From kwrobot at kitware.com Mon Jun 3 11:53:06 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Mon, 3 Jun 2019 11:53:06 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.14.5-1217-g7347240 Message-ID: <20190603155306.8EB6F107376@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 73472408c501e66c9dd8c027293b8c0907001b42 (commit) via 7d9e66a405ccd44fe3271278449ce0887a462d41 (commit) via ccf950795666406e59f420fd2732149711cb0362 (commit) via df06c8d7921d09a2a627731866a8ce895990067b (commit) via 409922f695df4fc885d04338f56dcfb4dc406f7d (commit) via 7fd3811400b9b2483d635dbcc1b0bfab268527df (commit) via 834ec4ebfe982ff75b2a34bac2515d221bc3ab38 (commit) via 465d6d7f9b53aeaab4b388f30adc324fae8ab4c8 (commit) via 4c9e99e1f9c09e947890e2fe3372ba463904f381 (commit) via cba85845172e8e12652e871d6109dba3127e8363 (commit) via c79b666c432fe5e0f3532d3ea508218f58bbc9a6 (commit) via 477f9e309563ec642c7323337e0aaf79a1256dac (commit) via fc451f130ded493ae13fda1950d31acc39002ffc (commit) via 2dc483476c134ec6fb05802990a98df406a39caf (commit) via 5823510745224f0e9ba6d69313c139bcfd9a3953 (commit) via fe018819cb4b944cafbd6d8b9e9f6332014579a9 (commit) via c367f7d5469e21739629a896aea3a04bb476c2bf (commit) via 1e7e47f597754e800673b158ce1bd59c8b6c566a (commit) via e97ea5201037b67012ecabb1cb7aebabebfed20d (commit) via 43af4ca78e80c65d3c0cf2c5121d61988e9d5192 (commit) via e762da6dc98474a71d0e69866ec3800af3117466 (commit) via 0d0cb136fb19d96f857f8d7da918e18038d5b627 (commit) via 09c21914b320567583ce5ff4c92e56b8a54bf3cb (commit) via dff42d481230599ba7962a5895d75e7c0d16939e (commit) via df72f06182f3481fe8929c49578052748d980712 (commit) via 0eed548d3f0387a3bcbdc42ad4456987a37b2934 (commit) via b6dc977ff17b451b43d8a67584400c3b53c7eb8f (commit) via 846b4b1062cc83b420ad1405fd74186c33bb1513 (commit) via 8a46a07c8bd2fddde5e4db797279e21a5575e213 (commit) via 15c644437ae355ac196cfcfe1e874d8280451b43 (commit) via 1b16d7656733a89d1d9735cf31654824b76aab9b (commit) from 5e2d22c177add56b2538ab10954dfb049c5cf945 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=73472408c501e66c9dd8c027293b8c0907001b42 commit 73472408c501e66c9dd8c027293b8c0907001b42 Merge: 5e2d22c 7d9e66a Author: Brad King AuthorDate: Mon Jun 3 15:51:09 2019 +0000 Commit: Kitware Robot CommitDate: Mon Jun 3 11:51:23 2019 -0400 Merge topic 'ninja_build_class' 7d9e66a405 Ninja: Remove non cmNinjaBuild based WriteBuild method ccf9507956 Ninja: Use cmNinjaBuild class for WriteBuild df06c8d792 Ninja: Use cmNinjaBuild class for WriteBuild 409922f695 Ninja: Use cmNinjaBuild class for WriteBuild 7fd3811400 Ninja: Use cmNinjaBuild class for WriteBuild 834ec4ebfe Ninja: Use cmNinjaBuild class for WriteBuild 465d6d7f9b Ninja: Use cmNinjaBuild class for WriteBuild 4c9e99e1f9 Ninja: Use cmNinjaBuild class for WriteBuild ... Acked-by: Kitware Robot Merge-request: !3403 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7d9e66a405ccd44fe3271278449ce0887a462d41 commit 7d9e66a405ccd44fe3271278449ce0887a462d41 Author: Sebastian Holtermann AuthorDate: Thu May 30 17:39:22 2019 +0200 Commit: Sebastian Holtermann CommitDate: Thu May 30 18:38:21 2019 +0200 Ninja: Remove non cmNinjaBuild based WriteBuild method diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index db0e01c..2d52356 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -127,113 +127,107 @@ std::string cmGlobalNinjaGenerator::EncodePath(const std::string& path) return result; } -void cmGlobalNinjaGenerator::WriteBuild( - std::ostream& os, const std::string& comment, const std::string& rule, - const cmNinjaDeps& outputs, const cmNinjaDeps& implicitOuts, - const cmNinjaDeps& explicitDeps, const cmNinjaDeps& implicitDeps, - const cmNinjaDeps& orderOnlyDeps, const cmNinjaVars& variables, - const std::string& rspfile, int cmdLineLimit, bool* usedResponseFile) +void cmGlobalNinjaGenerator::WriteBuild(std::ostream& os, + cmNinjaBuild const& build, + int cmdLineLimit, + bool* usedResponseFile) { // Make sure there is a rule. - if (rule.empty()) { + if (build.Rule.empty()) { cmSystemTools::Error("No rule for WriteBuild! called with comment: " + - comment); + build.Comment); return; } // Make sure there is at least one output file. - if (outputs.empty()) { + if (build.Outputs.empty()) { cmSystemTools::Error( - "No output files for WriteBuild! called with comment: " + comment); + "No output files for WriteBuild! called with comment: " + build.Comment); return; } - cmGlobalNinjaGenerator::WriteComment(os, comment); - - std::string arguments; - - // TODO: Better formatting for when there are multiple input/output files. - - // Write explicit dependencies. - for (std::string const& explicitDep : explicitDeps) { - arguments += " " + EncodePath(explicitDep); - } + cmGlobalNinjaGenerator::WriteComment(os, build.Comment); - // Write implicit dependencies. - if (!implicitDeps.empty()) { - arguments += " |"; - for (std::string const& implicitDep : implicitDeps) { - arguments += " " + EncodePath(implicitDep); + // Write output files. + std::string buildStr("build"); + { + // Write explicit outputs + for (std::string const& output : build.Outputs) { + buildStr += " " + EncodePath(output); + if (this->ComputingUnknownDependencies) { + this->CombinedBuildOutputs.insert(output); + } } - } - - // Write order-only dependencies. - if (!orderOnlyDeps.empty()) { - arguments += " ||"; - for (std::string const& orderOnlyDep : orderOnlyDeps) { - arguments += " " + EncodePath(orderOnlyDep); + // Write implicit outputs + if (!build.ImplicitOuts.empty()) { + buildStr += " |"; + for (std::string const& implicitOut : build.ImplicitOuts) { + buildStr += " " + EncodePath(implicitOut); + } } + buildStr += ":"; + + // Write the rule. + buildStr += " "; + buildStr += build.Rule; } - arguments += "\n"; + std::string arguments; + { + // TODO: Better formatting for when there are multiple input/output files. - std::string build; + // Write explicit dependencies. + for (std::string const& explicitDep : build.ExplicitDeps) { + arguments += " " + EncodePath(explicitDep); + } - // Write outputs files. - build += "build"; - for (std::string const& output : outputs) { - build += " " + EncodePath(output); - if (this->ComputingUnknownDependencies) { - this->CombinedBuildOutputs.insert(output); + // Write implicit dependencies. + if (!build.ImplicitDeps.empty()) { + arguments += " |"; + for (std::string const& implicitDep : build.ImplicitDeps) { + arguments += " " + EncodePath(implicitDep); + } } - } - if (!implicitOuts.empty()) { - build += " |"; - for (std::string const& implicitOut : implicitOuts) { - build += " " + EncodePath(implicitOut); + + // Write order-only dependencies. + if (!build.OrderOnlyDeps.empty()) { + arguments += " ||"; + for (std::string const& orderOnlyDep : build.OrderOnlyDeps) { + arguments += " " + EncodePath(orderOnlyDep); + } } - } - build += ":"; - // Write the rule. - build += " " + rule; + arguments += "\n"; + } // Write the variables bound to this build statement. - std::ostringstream variable_assignments; - for (auto const& variable : variables) { - cmGlobalNinjaGenerator::WriteVariable(variable_assignments, variable.first, - variable.second, "", 1); - } + std::string assignments; + { + std::ostringstream variable_assignments; + for (auto const& variable : build.Variables) { + cmGlobalNinjaGenerator::WriteVariable( + variable_assignments, variable.first, variable.second, "", 1); + } - // check if a response file rule should be used - std::string buildstr = build; - std::string assignments = variable_assignments.str(); - bool useResponseFile = false; - if (cmdLineLimit < 0 || - (cmdLineLimit > 0 && - (arguments.size() + buildstr.size() + assignments.size() + 1000) > - static_cast(cmdLineLimit))) { - variable_assignments.str(std::string()); - cmGlobalNinjaGenerator::WriteVariable(variable_assignments, "RSP_FILE", - rspfile, "", 1); - assignments += variable_assignments.str(); - useResponseFile = true; - } - if (usedResponseFile) { - *usedResponseFile = useResponseFile; + // check if a response file rule should be used + assignments = variable_assignments.str(); + bool useResponseFile = false; + if (cmdLineLimit < 0 || + (cmdLineLimit > 0 && + (arguments.size() + buildStr.size() + assignments.size() + 1000) > + static_cast(cmdLineLimit))) { + variable_assignments.str(std::string()); + cmGlobalNinjaGenerator::WriteVariable(variable_assignments, "RSP_FILE", + build.RspFile, "", 1); + assignments += variable_assignments.str(); + useResponseFile = true; + } + if (usedResponseFile) { + *usedResponseFile = useResponseFile; + } } - os << buildstr << arguments << assignments; -} - -void cmGlobalNinjaGenerator::WriteBuild(std::ostream& os, - cmNinjaBuild const& build, - int cmdLineLimit, - bool* usedResponseFile) -{ - WriteBuild(os, build.Comment, build.Rule, build.Outputs, build.ImplicitOuts, - build.ExplicitDeps, build.ImplicitDeps, build.OrderOnlyDeps, - build.Variables, build.RspFile, cmdLineLimit, usedResponseFile); + os << buildStr << arguments << assignments << "\n"; } void cmGlobalNinjaGenerator::AddCustomCommandRule() diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h index 4ccd927..15dd404 100644 --- a/Source/cmGlobalNinjaGenerator.h +++ b/Source/cmGlobalNinjaGenerator.h @@ -101,22 +101,6 @@ public: bool IsIPOSupported() const override { return true; } /** - * Write a build statement to @a os with the @a comment using - * the @a rule the list of @a outputs files and inputs. - * It also writes the variables bound to this build statement. - * @warning no escaping of any kind is done here. - */ - void WriteBuild(std::ostream& os, const std::string& comment, - const std::string& rule, const cmNinjaDeps& outputs, - const cmNinjaDeps& implicitOuts, - const cmNinjaDeps& explicitDeps, - const cmNinjaDeps& implicitDeps, - const cmNinjaDeps& orderOnlyDeps, - const cmNinjaVars& variables, - const std::string& rspfile = std::string(), - int cmdLineLimit = 0, bool* usedResponseFile = nullptr); - - /** * Write a build statement @a build to @a os. * @warning no escaping of any kind is done here. */ https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ccf950795666406e59f420fd2732149711cb0362 commit ccf950795666406e59f420fd2732149711cb0362 Author: Sebastian Holtermann AuthorDate: Thu May 30 17:29:06 2019 +0200 Commit: Sebastian Holtermann CommitDate: Thu May 30 18:38:21 2019 +0200 Ninja: Use cmNinjaBuild class for WriteBuild diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index ed604d9..db0e01c 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -1940,32 +1940,29 @@ bool cmGlobalNinjaGenerator::WriteDyndepFile( cmGeneratedFileStream ddf(arg_dd); ddf << "ninja_dyndep_version = 1.0\n"; - for (cmDyndepObjectInfo const& object : objects) { - std::string const ddComment; - std::string const ddRule = "dyndep"; - cmNinjaDeps ddOutputs; - cmNinjaDeps ddImplicitOuts; - cmNinjaDeps ddExplicitDeps; - cmNinjaDeps ddImplicitDeps; - cmNinjaDeps ddOrderOnlyDeps; - cmNinjaVars ddVars; - - ddOutputs.push_back(object.Object); - for (std::string const& p : object.Provides) { - ddImplicitOuts.push_back(this->ConvertToNinjaPath(mod_files[p])); - } - for (std::string const& r : object.Requires) { - std::map::iterator m = mod_files.find(r); - if (m != mod_files.end()) { - ddImplicitDeps.push_back(this->ConvertToNinjaPath(m->second)); + { + cmNinjaBuild build("dyndep"); + build.Outputs.emplace_back(""); + for (cmDyndepObjectInfo const& object : objects) { + build.Outputs[0] = object.Object; + build.ImplicitOuts.clear(); + for (std::string const& p : object.Provides) { + build.ImplicitOuts.push_back(this->ConvertToNinjaPath(mod_files[p])); + } + build.ImplicitDeps.clear(); + for (std::string const& r : object.Requires) { + auto mit = mod_files.find(r); + if (mit != mod_files.end()) { + build.ImplicitDeps.push_back(this->ConvertToNinjaPath(mit->second)); + } + } + build.Variables.clear(); + if (!object.Provides.empty()) { + build.Variables.emplace("restat", "1"); } - } - if (!object.Provides.empty()) { - ddVars["restat"] = "1"; - } - this->WriteBuild(ddf, ddComment, ddRule, ddOutputs, ddImplicitOuts, - ddExplicitDeps, ddImplicitDeps, ddOrderOnlyDeps, ddVars); + this->WriteBuild(ddf, build); + } } // Store the map of modules provided by this target in a file for https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=df06c8d7921d09a2a627731866a8ce895990067b commit df06c8d7921d09a2a627731866a8ce895990067b Author: Sebastian Holtermann AuthorDate: Thu May 30 17:22:56 2019 +0200 Commit: Sebastian Holtermann CommitDate: Thu May 30 18:38:21 2019 +0200 Ninja: Use cmNinjaBuild class for WriteBuild diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index c6e4be4..ed604d9 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -1562,13 +1562,12 @@ void cmGlobalNinjaGenerator::WriteTargetHelp(std::ostream& os) rule.Comment = "Rule for printing all primary targets available."; WriteRule(*this->RulesFileStream, rule); } - WriteBuild(os, "Print all primary targets available.", "HELP", - /*outputs=*/cmNinjaDeps(1, this->NinjaOutputPath("help")), - /*implicitOuts=*/cmNinjaDeps(), - /*explicitDeps=*/cmNinjaDeps(), - /*implicitDeps=*/cmNinjaDeps(), - /*orderOnlyDeps=*/cmNinjaDeps(), - /*variables=*/cmNinjaVars()); + { + cmNinjaBuild build("HELP"); + build.Comment = "Print all primary targets available."; + build.Outputs.push_back(this->NinjaOutputPath("help")); + WriteBuild(os, build); + } } void cmGlobalNinjaGenerator::InitOutputPathPrefix() https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=409922f695df4fc885d04338f56dcfb4dc406f7d commit 409922f695df4fc885d04338f56dcfb4dc406f7d Author: Sebastian Holtermann AuthorDate: Thu May 30 17:20:28 2019 +0200 Commit: Sebastian Holtermann CommitDate: Thu May 30 18:38:21 2019 +0200 Ninja: Use cmNinjaBuild class for WriteBuild diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index fb4f41d..c6e4be4 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -1542,20 +1542,14 @@ void cmGlobalNinjaGenerator::WriteTargetClean(std::ostream& os) // Write build { - cmNinjaDeps explicitDeps; + cmNinjaBuild build("CLEAN"); + build.Comment = "Clean all the built files."; + build.Outputs.push_back(this->NinjaOutputPath(this->GetCleanTargetName())); if (additionalFiles) { - explicitDeps.emplace_back( + build.ExplicitDeps.push_back( this->NinjaOutputPath(this->GetAdditionalCleanTargetName())); } - cmNinjaDeps outputs; - outputs.emplace_back(this->NinjaOutputPath(this->GetCleanTargetName())); - WriteBuild(os, "Clean all the built files.", "CLEAN", - /*outputs=*/outputs, - /*implicitOuts=*/cmNinjaDeps(), - /*explicitDeps=*/explicitDeps, - /*implicitDeps=*/cmNinjaDeps(), - /*orderOnlyDeps=*/cmNinjaDeps(), - /*variables=*/cmNinjaVars()); + WriteBuild(os, build); } } https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7fd3811400b9b2483d635dbcc1b0bfab268527df commit 7fd3811400b9b2483d635dbcc1b0bfab268527df Author: Sebastian Holtermann AuthorDate: Thu May 30 17:18:36 2019 +0200 Commit: Sebastian Holtermann CommitDate: Thu May 30 18:38:20 2019 +0200 Ninja: Use cmNinjaBuild class for WriteBuild diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 265fe7d..fb4f41d 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -1515,16 +1515,11 @@ bool cmGlobalNinjaGenerator::WriteTargetCleanAdditional(std::ostream& os) // Write build { - cmNinjaDeps outputs; - outputs.emplace_back( + cmNinjaBuild build("CLEAN_ADDITIONAL"); + build.Comment = "Clean additional files."; + build.Outputs.push_back( this->NinjaOutputPath(this->GetAdditionalCleanTargetName())); - WriteBuild(os, "Clean additional files.", "CLEAN_ADDITIONAL", - /*outputs=*/outputs, - /*implicitOuts=*/cmNinjaDeps(), - /*explicitDeps=*/cmNinjaDeps(), - /*implicitDeps=*/cmNinjaDeps(), - /*orderOnlyDeps=*/cmNinjaDeps(), - /*variables=*/cmNinjaVars()); + WriteBuild(os, build); } // Return success return true; https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=834ec4ebfe982ff75b2a34bac2515d221bc3ab38 commit 834ec4ebfe982ff75b2a34bac2515d221bc3ab38 Author: Sebastian Holtermann AuthorDate: Thu May 30 17:12:15 2019 +0200 Commit: Sebastian Holtermann CommitDate: Thu May 30 18:38:20 2019 +0200 Ninja: Use cmNinjaBuild class for WriteBuild diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index cde764f..265fe7d 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -1342,20 +1342,21 @@ void cmGlobalNinjaGenerator::WriteTargetRebuildManifest(std::ostream& os) WriteRule(*this->RulesFileStream, rule); } - cmNinjaDeps implicitDeps; - cmNinjaDeps explicitDeps; + cmNinjaBuild reBuild("RERUN_CMAKE"); + reBuild.Comment = "Re-run CMake if any of its inputs changed."; + reBuild.Outputs.push_back(this->NinjaOutputPath(NINJA_BUILD_FILE)); + for (cmLocalGenerator* localGen : this->LocalGenerators) { for (std::string const& fi : localGen->GetMakefile()->GetListFiles()) { - implicitDeps.push_back(this->ConvertToNinjaPath(fi)); + reBuild.ImplicitDeps.push_back(this->ConvertToNinjaPath(fi)); } } - implicitDeps.push_back(this->CMakeCacheFile); + reBuild.ImplicitDeps.push_back(this->CMakeCacheFile); - cmNinjaVars variables; // Use 'console' pool to get non buffered output of the CMake re-run call // Available since Ninja 1.5 if (SupportsConsolePool()) { - variables["pool"] = "console"; + reBuild.Variables["pool"] = "console"; } cmake* cm = this->GetCMakeInstance(); @@ -1377,23 +1378,23 @@ void cmGlobalNinjaGenerator::WriteTargetRebuildManifest(std::ostream& os) phonyBuild.Outputs.push_back(cm->GetGlobVerifyScript() + "_force"); this->WriteBuild(os, phonyBuild); - variables["restat"] = "1"; + reBuild.Variables["restat"] = "1"; std::string const verifyScriptFile = this->NinjaOutputPath(cm->GetGlobVerifyScript()); std::string const verifyStampFile = this->NinjaOutputPath(cm->GetGlobVerifyStamp()); - this->WriteBuild(os, - "Re-run CMake to check if globbed directories changed.", - "VERIFY_GLOBS", - /*outputs=*/cmNinjaDeps(1, verifyStampFile), - /*implicitOuts=*/cmNinjaDeps(), - /*explicitDeps=*/cmNinjaDeps(), - /*implicitDeps=*/phonyBuild.Outputs, - /*orderOnlyDeps=*/cmNinjaDeps(), variables); - - variables.erase("restat"); - implicitDeps.push_back(verifyScriptFile); - explicitDeps.push_back(verifyStampFile); + { + cmNinjaBuild vgBuild("VERIFY_GLOBS"); + vgBuild.Comment = + "Re-run CMake to check if globbed directories changed."; + vgBuild.Outputs.push_back(verifyStampFile); + vgBuild.ImplicitDeps = phonyBuild.Outputs; + vgBuild.Variables = reBuild.Variables; + this->WriteBuild(os, vgBuild); + } + reBuild.Variables.erase("restat"); + reBuild.ImplicitDeps.push_back(verifyScriptFile); + reBuild.ExplicitDeps.push_back(verifyStampFile); } else if (!this->SupportsManifestRestat() && cm->DoWriteGlobVerifyTarget()) { std::ostringstream msg; @@ -1411,22 +1412,18 @@ void cmGlobalNinjaGenerator::WriteTargetRebuildManifest(std::ostream& os) msg.str()); } - std::sort(implicitDeps.begin(), implicitDeps.end()); - implicitDeps.erase(std::unique(implicitDeps.begin(), implicitDeps.end()), - implicitDeps.end()); + std::sort(reBuild.ImplicitDeps.begin(), reBuild.ImplicitDeps.end()); + reBuild.ImplicitDeps.erase( + std::unique(reBuild.ImplicitDeps.begin(), reBuild.ImplicitDeps.end()), + reBuild.ImplicitDeps.end()); - std::string const ninjaBuildFile = this->NinjaOutputPath(NINJA_BUILD_FILE); - this->WriteBuild(os, "Re-run CMake if any of its inputs changed.", - "RERUN_CMAKE", - /*outputs=*/cmNinjaDeps(1, ninjaBuildFile), - /*implicitOuts=*/cmNinjaDeps(), explicitDeps, implicitDeps, - /*orderOnlyDeps=*/cmNinjaDeps(), variables); + this->WriteBuild(os, reBuild); { cmNinjaBuild build("phony"); build.Comment = "A missing CMake input file is not an error."; - std::set_difference(std::make_move_iterator(implicitDeps.begin()), - std::make_move_iterator(implicitDeps.end()), + std::set_difference(std::make_move_iterator(reBuild.ImplicitDeps.begin()), + std::make_move_iterator(reBuild.ImplicitDeps.end()), CustomCommandOutputs.begin(), CustomCommandOutputs.end(), std::back_inserter(build.Outputs)); https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=465d6d7f9b53aeaab4b388f30adc324fae8ab4c8 commit 465d6d7f9b53aeaab4b388f30adc324fae8ab4c8 Author: Sebastian Holtermann AuthorDate: Thu May 30 16:41:50 2019 +0200 Commit: Sebastian Holtermann CommitDate: Thu May 30 18:38:20 2019 +0200 Ninja: Use cmNinjaBuild class for WriteBuild diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index 9c488fb..1399ee2 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -554,11 +554,12 @@ std::vector cmNinjaNormalTargetGenerator::ComputeLinkCmd() void cmNinjaNormalTargetGenerator::WriteDeviceLinkStatement() { - if (!this->GetGlobalGenerator()->GetLanguageEnabled("CUDA")) { + cmGlobalNinjaGenerator* globalGen = this->GetGlobalGenerator(); + if (!globalGen->GetLanguageEnabled("CUDA")) { return; } - cmGeneratorTarget& genTarget = *this->GetGeneratorTarget(); + cmGeneratorTarget* genTarget = this->GetGeneratorTarget(); bool requiresDeviceLinking = requireDeviceLinking( *this->GeneratorTarget, *this->GetLocalGenerator(), this->ConfigName); @@ -576,38 +577,39 @@ void cmNinjaNormalTargetGenerator::WriteDeviceLinkStatement() std::string const cfgName = this->GetConfigName(); std::string const targetOutputReal = ConvertToNinjaPath( - genTarget.ObjectDirectory + "cmake_device_link" + objExt); + genTarget->ObjectDirectory + "cmake_device_link" + objExt); std::string const targetOutputImplib = ConvertToNinjaPath( - genTarget.GetFullPath(cfgName, cmStateEnums::ImportLibraryArtifact)); + genTarget->GetFullPath(cfgName, cmStateEnums::ImportLibraryArtifact)); this->DeviceLinkObject = targetOutputReal; // Write comments. cmGlobalNinjaGenerator::WriteDivider(this->GetBuildFileStream()); - const cmStateEnums::TargetType targetType = genTarget.GetType(); + const cmStateEnums::TargetType targetType = genTarget->GetType(); this->GetBuildFileStream() << "# Device Link build statements for " << cmState::GetTargetTypeName(targetType) << " target " << this->GetTargetName() << "\n\n"; // Compute the comment. - std::ostringstream comment; - comment << "Link the " << this->GetVisibleTypeName() << " " - << targetOutputReal; + cmNinjaBuild build(this->LanguageLinkerDeviceRule()); + build.Comment = "Link the "; + build.Comment += this->GetVisibleTypeName(); + build.Comment += " "; + build.Comment += targetOutputReal; - cmNinjaVars vars; + cmNinjaVars& vars = build.Variables; // Compute outputs. - cmNinjaDeps outputs; - outputs.push_back(targetOutputReal); + build.Outputs.push_back(targetOutputReal); // Compute specific libraries to link with. - cmNinjaDeps explicitDeps = this->GetObjects(); - cmNinjaDeps implicitDeps = this->ComputeLinkDeps(this->TargetLinkLanguage); + build.ExplicitDeps = this->GetObjects(); + build.ImplicitDeps = this->ComputeLinkDeps(this->TargetLinkLanguage); std::string frameworkPath; std::string linkPath; - std::string createRule = genTarget.GetCreateRuleVariable( + std::string createRule = genTarget->GetCreateRuleVariable( this->TargetLinkLanguage, this->GetConfigName()); const bool useWatcomQuote = this->GetMakefile()->IsOn(createRule + "_USE_WATCOM_QUOTE"); @@ -620,14 +622,14 @@ void cmNinjaNormalTargetGenerator::WriteDeviceLinkStatement() new cmNinjaLinkLineDeviceComputer( this->GetLocalGenerator(), this->GetLocalGenerator()->GetStateSnapshot().GetDirectory(), - this->GetGlobalGenerator())); + globalGen)); linkLineComputer->SetUseWatcomQuote(useWatcomQuote); localGen.GetTargetFlags( linkLineComputer.get(), this->GetConfigName(), vars["LINK_LIBRARIES"], - vars["FLAGS"], vars["LINK_FLAGS"], frameworkPath, linkPath, &genTarget); + vars["FLAGS"], vars["LINK_FLAGS"], frameworkPath, linkPath, genTarget); - this->addPoolNinjaVariable("JOB_POOL_LINK", &genTarget, vars); + this->addPoolNinjaVariable("JOB_POOL_LINK", genTarget, vars); vars["LINK_FLAGS"] = cmGlobalNinjaGenerator::EncodeLiteral(vars["LINK_FLAGS"]); @@ -641,18 +643,18 @@ void cmNinjaNormalTargetGenerator::WriteDeviceLinkStatement() // code between the Makefile executable and library generators. if (targetType == cmStateEnums::EXECUTABLE) { std::string t = vars["FLAGS"]; - localGen.AddArchitectureFlags(t, &genTarget, cudaLinkLanguage, cfgName); + localGen.AddArchitectureFlags(t, genTarget, cudaLinkLanguage, cfgName); vars["FLAGS"] = t; } else { std::string t = vars["ARCH_FLAGS"]; - localGen.AddArchitectureFlags(t, &genTarget, cudaLinkLanguage, cfgName); + localGen.AddArchitectureFlags(t, genTarget, cudaLinkLanguage, cfgName); vars["ARCH_FLAGS"] = t; t.clear(); - localGen.AddLanguageFlagsForLinking(t, &genTarget, cudaLinkLanguage, + localGen.AddLanguageFlagsForLinking(t, genTarget, cudaLinkLanguage, cfgName); vars["LANGUAGE_COMPILE_FLAGS"] = t; } - if (this->GetGeneratorTarget()->HasSOName(cfgName)) { + if (genTarget->HasSOName(cfgName)) { vars["SONAME_FLAG"] = this->GetMakefile()->GetSONameFlag(this->TargetLinkLanguage); vars["SONAME"] = this->TargetNames.SharedObject; @@ -680,7 +682,7 @@ void cmNinjaNormalTargetGenerator::WriteDeviceLinkStatement() this->SetMsvcTargetPdbVariable(vars); - if (this->GetGlobalGenerator()->IsGCCOnWindows()) { + if (globalGen->IsGCCOnWindows()) { // ar.exe can't handle backslashes in rsp files (implicitly used by gcc) std::string& linkLibraries = vars["LINK_LIBRARIES"]; std::replace(linkLibraries.begin(), linkLibraries.end(), '\\', '/'); @@ -688,29 +690,23 @@ void cmNinjaNormalTargetGenerator::WriteDeviceLinkStatement() std::replace(link_path.begin(), link_path.end(), '\\', '/'); } - cmGlobalNinjaGenerator& globalGen = *this->GetGlobalGenerator(); - // Device linking currently doesn't support response files so // do not check if the user has explicitly forced a response file. int const commandLineLengthLimit = static_cast(cmSystemTools::CalculateCommandLineLengthLimit()) - - globalGen.GetRuleCmdLength(this->LanguageLinkerDeviceRule()); + globalGen->GetRuleCmdLength(this->LanguageLinkerDeviceRule()); - const std::string rspfile = this->ConvertToNinjaPath( - std::string("CMakeFiles/") + genTarget.GetName() + ".rsp"); + build.RspFile = this->ConvertToNinjaPath(std::string("CMakeFiles/") + + genTarget->GetName() + ".rsp"); // Gather order-only dependencies. - cmNinjaDeps orderOnlyDeps; this->GetLocalGenerator()->AppendTargetDepends(this->GetGeneratorTarget(), - orderOnlyDeps); + build.OrderOnlyDeps); // Write the build statement for this target. bool usedResponseFile = false; - globalGen.WriteBuild(this->GetBuildFileStream(), comment.str(), - this->LanguageLinkerDeviceRule(), outputs, - /*implicitOuts=*/cmNinjaDeps(), explicitDeps, - implicitDeps, orderOnlyDeps, vars, rspfile, - commandLineLengthLimit, &usedResponseFile); + globalGen->WriteBuild(this->GetBuildFileStream(), build, + commandLineLengthLimit, &usedResponseFile); this->WriteDeviceLinkRule(false); } https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4c9e99e1f9c09e947890e2fe3372ba463904f381 commit 4c9e99e1f9c09e947890e2fe3372ba463904f381 Author: Sebastian Holtermann AuthorDate: Thu May 30 16:33:30 2019 +0200 Commit: Sebastian Holtermann CommitDate: Thu May 30 18:38:20 2019 +0200 Ninja: Use cmNinjaBuild class for WriteBuild diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index f214229..9c488fb 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -716,18 +716,21 @@ void cmNinjaNormalTargetGenerator::WriteDeviceLinkStatement() void cmNinjaNormalTargetGenerator::WriteLinkStatement() { - cmGeneratorTarget& gt = *this->GetGeneratorTarget(); + cmMakefile* mf = this->GetMakefile(); + cmGlobalNinjaGenerator* globalGen = this->GetGlobalGenerator(); + cmGeneratorTarget* gt = this->GetGeneratorTarget(); + const std::string cfgName = this->GetConfigName(); - std::string targetOutput = ConvertToNinjaPath(gt.GetFullPath(cfgName)); + std::string targetOutput = ConvertToNinjaPath(gt->GetFullPath(cfgName)); std::string targetOutputReal = ConvertToNinjaPath( - gt.GetFullPath(cfgName, cmStateEnums::RuntimeBinaryArtifact, - /*realname=*/true)); + gt->GetFullPath(cfgName, cmStateEnums::RuntimeBinaryArtifact, + /*realname=*/true)); std::string targetOutputImplib = ConvertToNinjaPath( - gt.GetFullPath(cfgName, cmStateEnums::ImportLibraryArtifact)); + gt->GetFullPath(cfgName, cmStateEnums::ImportLibraryArtifact)); - if (gt.IsAppBundleOnApple()) { + if (gt->IsAppBundleOnApple()) { // Create the app bundle - std::string outpath = gt.GetDirectory(cfgName); + std::string outpath = gt->GetDirectory(cfgName); this->OSXBundleGenerator->CreateAppBundle(this->TargetNames.Output, outpath); @@ -740,33 +743,34 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement() targetOutputReal += "/"; targetOutputReal += this->TargetNames.Real; targetOutputReal = this->ConvertToNinjaPath(targetOutputReal); - } else if (gt.IsFrameworkOnApple()) { + } else if (gt->IsFrameworkOnApple()) { // Create the library framework. this->OSXBundleGenerator->CreateFramework(this->TargetNames.Output, - gt.GetDirectory(cfgName)); - } else if (gt.IsCFBundleOnApple()) { + gt->GetDirectory(cfgName)); + } else if (gt->IsCFBundleOnApple()) { // Create the core foundation bundle. this->OSXBundleGenerator->CreateCFBundle(this->TargetNames.Output, - gt.GetDirectory(cfgName)); + gt->GetDirectory(cfgName)); } // Write comments. cmGlobalNinjaGenerator::WriteDivider(this->GetBuildFileStream()); - const cmStateEnums::TargetType targetType = gt.GetType(); + const cmStateEnums::TargetType targetType = gt->GetType(); this->GetBuildFileStream() << "# Link build statements for " << cmState::GetTargetTypeName(targetType) << " target " << this->GetTargetName() << "\n\n"; - cmNinjaVars vars; + cmNinjaBuild linkBuild(this->LanguageLinkerRule()); + cmNinjaVars& vars = linkBuild.Variables; // Compute the comment. - std::ostringstream comment; - comment << "Link the " << this->GetVisibleTypeName() << " " - << targetOutputReal; + linkBuild.Comment = "Link the "; + linkBuild.Comment += this->GetVisibleTypeName(); + linkBuild.Comment += " "; + linkBuild.Comment += targetOutputReal; // Compute outputs. - cmNinjaDeps outputs; - outputs.push_back(targetOutputReal); + linkBuild.Outputs.push_back(targetOutputReal); if (this->TargetLinkLanguage == "Swift") { vars["SWIFT_LIBRARY_NAME"] = [this]() -> std::string { @@ -775,12 +779,11 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement() return targetNames.Base; }(); - vars["SWIFT_MODULE_NAME"] = [this]() -> std::string { - if (const char* name = - this->GetGeneratorTarget()->GetProperty("Swift_MODULE_NAME")) { + vars["SWIFT_MODULE_NAME"] = [gt]() -> std::string { + if (const char* name = gt->GetProperty("Swift_MODULE_NAME")) { return name; } - return this->GetGeneratorTarget()->GetName(); + return gt->GetName(); }(); vars["SWIFT_MODULE"] = [this](const std::string& module) -> std::string { @@ -804,7 +807,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement() vars["SWIFT_OUTPUT_FILE_MAP"] = this->GetLocalGenerator()->ConvertToOutputFormat( - this->ConvertToNinjaPath(gt.GetSupportDirectory() + + this->ConvertToNinjaPath(gt->GetSupportDirectory() + "/output-file-map.json"), cmOutputConverter::SHELL); @@ -833,35 +836,31 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement() } // Compute specific libraries to link with. - cmNinjaDeps explicitDeps; if (this->TargetLinkLanguage == "Swift") { std::vector sources; - this->GetGeneratorTarget()->GetObjectSources(sources, - this->GetConfigName()); + gt->GetObjectSources(sources, this->GetConfigName()); for (const auto& source : sources) { - outputs.push_back( + linkBuild.Outputs.push_back( this->ConvertToNinjaPath(this->GetObjectFilePath(source))); - explicitDeps.push_back( + linkBuild.ExplicitDeps.push_back( this->ConvertToNinjaPath(this->GetSourceFilePath(source))); } - outputs.push_back(vars["SWIFT_MODULE"]); + linkBuild.Outputs.push_back(vars["SWIFT_MODULE"]); } else { - explicitDeps = this->GetObjects(); + linkBuild.ExplicitDeps = this->GetObjects(); } - cmNinjaDeps implicitDeps = this->ComputeLinkDeps(this->TargetLinkLanguage); + linkBuild.ImplicitDeps = this->ComputeLinkDeps(this->TargetLinkLanguage); if (!this->DeviceLinkObject.empty()) { - explicitDeps.push_back(this->DeviceLinkObject); + linkBuild.ExplicitDeps.push_back(this->DeviceLinkObject); } - cmMakefile* mf = this->GetMakefile(); - std::string frameworkPath; std::string linkPath; std::string createRule = - gt.GetCreateRuleVariable(this->TargetLinkLanguage, this->GetConfigName()); + gt->GetCreateRuleVariable(this->TargetLinkLanguage, this->GetConfigName()); bool useWatcomQuote = mf->IsOn(createRule + "_USE_WATCOM_QUOTE"); cmLocalNinjaGenerator& localGen = *this->GetLocalGenerator(); @@ -869,14 +868,14 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement() localGen.ConvertToOutputFormat(targetOutputReal, cmOutputConverter::SHELL); std::unique_ptr linkLineComputer( - this->GetGlobalGenerator()->CreateLinkLineComputer( + globalGen->CreateLinkLineComputer( this->GetLocalGenerator(), this->GetLocalGenerator()->GetStateSnapshot().GetDirectory())); linkLineComputer->SetUseWatcomQuote(useWatcomQuote); localGen.GetTargetFlags(linkLineComputer.get(), this->GetConfigName(), vars["LINK_LIBRARIES"], vars["FLAGS"], - vars["LINK_FLAGS"], frameworkPath, linkPath, >); + vars["LINK_FLAGS"], frameworkPath, linkPath, gt); // Add OS X version flags, if any. if (this->GeneratorTarget->GetType() == cmStateEnums::SHARED_LIBRARY || @@ -887,7 +886,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement() "CURRENT", false); } - this->addPoolNinjaVariable("JOB_POOL_LINK", >, vars); + this->addPoolNinjaVariable("JOB_POOL_LINK", gt, vars); this->AddModuleDefinitionFlag(linkLineComputer.get(), vars["LINK_FLAGS"]); vars["LINK_FLAGS"] = @@ -897,7 +896,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement() vars["LINK_PATH"] = frameworkPath + linkPath; std::string lwyuFlags; - if (gt.GetPropertyAsBool("LINK_WHAT_YOU_USE")) { + if (gt->GetPropertyAsBool("LINK_WHAT_YOU_USE")) { lwyuFlags = " -Wl,--no-as-needed"; } @@ -906,24 +905,23 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement() // code between the Makefile executable and library generators. if (targetType == cmStateEnums::EXECUTABLE) { std::string t = vars["FLAGS"]; - localGen.AddArchitectureFlags(t, >, TargetLinkLanguage, cfgName); + localGen.AddArchitectureFlags(t, gt, TargetLinkLanguage, cfgName); t += lwyuFlags; vars["FLAGS"] = t; } else { std::string t = vars["ARCH_FLAGS"]; - localGen.AddArchitectureFlags(t, >, TargetLinkLanguage, cfgName); + localGen.AddArchitectureFlags(t, gt, TargetLinkLanguage, cfgName); vars["ARCH_FLAGS"] = t; t.clear(); t += lwyuFlags; - localGen.AddLanguageFlagsForLinking(t, >, TargetLinkLanguage, cfgName); + localGen.AddLanguageFlagsForLinking(t, gt, TargetLinkLanguage, cfgName); vars["LANGUAGE_COMPILE_FLAGS"] = t; } - if (this->GetGeneratorTarget()->HasSOName(cfgName)) { + if (gt->HasSOName(cfgName)) { vars["SONAME_FLAG"] = mf->GetSONameFlag(this->TargetLinkLanguage); vars["SONAME"] = this->TargetNames.SharedObject; if (targetType == cmStateEnums::SHARED_LIBRARY) { - std::string install_dir = - this->GetGeneratorTarget()->GetInstallNameDirForBuildTree(cfgName); + std::string install_dir = gt->GetInstallNameDirForBuildTree(cfgName); if (!install_dir.empty()) { vars["INSTALLNAME_DIR"] = localGen.ConvertToOutputFormat( install_dir, cmOutputConverter::SHELL); @@ -938,7 +936,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement() targetOutputImplib, cmOutputConverter::SHELL); vars["TARGET_IMPLIB"] = impLibPath; EnsureParentDirectoryExists(impLibPath); - if (gt.HasImportLibrary(cfgName)) { + if (gt->HasImportLibrary(cfgName)) { byproducts.push_back(targetOutputImplib); } } @@ -949,7 +947,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement() std::string prefix; std::string base; std::string suffix; - this->GetGeneratorTarget()->GetFullNameComponents(prefix, base, suffix); + gt->GetFullNameComponents(prefix, base, suffix); std::string dbg_suffix = ".dbg"; // TODO: Where to document? if (mf->GetDefinition("CMAKE_DEBUG_SYMBOL_SUFFIX")) { @@ -958,12 +956,12 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement() vars["TARGET_PDB"] = base + suffix + dbg_suffix; } - const std::string objPath = GetGeneratorTarget()->GetSupportDirectory(); + const std::string objPath = gt->GetSupportDirectory(); vars["OBJECT_DIR"] = this->GetLocalGenerator()->ConvertToOutputFormat( this->ConvertToNinjaPath(objPath), cmOutputConverter::SHELL); EnsureDirectoryExists(objPath); - if (this->GetGlobalGenerator()->IsGCCOnWindows()) { + if (globalGen->IsGCCOnWindows()) { // ar.exe can't handle backslashes in rsp files (implicitly used by gcc) std::string& linkLibraries = vars["LINK_LIBRARIES"]; std::replace(linkLibraries.begin(), linkLibraries.end(), '\\', '/'); @@ -972,8 +970,8 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement() } const std::vector* cmdLists[3] = { - >.GetPreBuildCommands(), >.GetPreLinkCommands(), - >.GetPostBuildCommands() + >->GetPreBuildCommands(), >->GetPreLinkCommands(), + >->GetPostBuildCommands() }; std::vector preLinkCmdLines, postBuildCmdLines; @@ -993,7 +991,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement() // maybe create .def file from list of objects cmGeneratorTarget::ModuleDefinitionInfo const* mdi = - gt.GetModuleDefinitionInfo(this->GetConfigName()); + gt->GetModuleDefinitionInfo(this->GetConfigName()); if (mdi && mdi->DefFileGenerated) { std::string cmakeCommand = this->GetLocalGenerator()->ConvertToOutputFormat( @@ -1025,8 +1023,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement() } } // If we have any PRE_LINK commands, we need to go back to CMAKE_BINARY_DIR - // for - // the link commands. + // for the link commands. if (!preLinkCmdLines.empty()) { const std::string homeOutDir = localGen.ConvertToOutputFormat( localGen.GetBinaryDirectory(), cmOutputConverter::SHELL); @@ -1040,14 +1037,13 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement() cmNinjaVars symlinkVars; bool const symlinkNeeded = - (targetOutput != targetOutputReal && !gt.IsFrameworkOnApple()); + (targetOutput != targetOutputReal && !gt->IsFrameworkOnApple()); if (!symlinkNeeded) { vars["POST_BUILD"] = postBuildCmdLine; } else { vars["POST_BUILD"] = cmGlobalNinjaGenerator::SHELL_NOOP; symlinkVars["POST_BUILD"] = postBuildCmdLine; } - cmGlobalNinjaGenerator& globalGen = *this->GetGlobalGenerator(); bool const lang_supports_response = !(this->TargetLinkLanguage == "RC" || this->TargetLinkLanguage == "CUDA"); @@ -1055,32 +1051,27 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement() if (!lang_supports_response || !this->ForceResponseFile()) { commandLineLengthLimit = static_cast(cmSystemTools::CalculateCommandLineLengthLimit()) - - globalGen.GetRuleCmdLength(this->LanguageLinkerRule()); + globalGen->GetRuleCmdLength(linkBuild.Rule); } - const std::string rspfile = this->ConvertToNinjaPath( - std::string("CMakeFiles/") + gt.GetName() + ".rsp"); + linkBuild.RspFile = this->ConvertToNinjaPath(std::string("CMakeFiles/") + + gt->GetName() + ".rsp"); // Gather order-only dependencies. - cmNinjaDeps orderOnlyDeps; - this->GetLocalGenerator()->AppendTargetDepends(this->GetGeneratorTarget(), - orderOnlyDeps); + this->GetLocalGenerator()->AppendTargetDepends(gt, linkBuild.OrderOnlyDeps); // Ninja should restat after linking if and only if there are byproducts. vars["RESTAT"] = byproducts.empty() ? "" : "1"; for (std::string const& o : byproducts) { - this->GetGlobalGenerator()->SeenCustomCommandOutput(o); - outputs.push_back(o); + globalGen->SeenCustomCommandOutput(o); + linkBuild.Outputs.push_back(o); } // Write the build statement for this target. bool usedResponseFile = false; - globalGen.WriteBuild(this->GetBuildFileStream(), comment.str(), - this->LanguageLinkerRule(), outputs, - /*implicitOuts=*/cmNinjaDeps(), explicitDeps, - implicitDeps, orderOnlyDeps, vars, rspfile, - commandLineLengthLimit, &usedResponseFile); + globalGen->WriteBuild(this->GetBuildFileStream(), linkBuild, + commandLineLengthLimit, &usedResponseFile); this->WriteLinkRule(usedResponseFile); if (symlinkNeeded) { @@ -1090,7 +1081,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement() build.Outputs.push_back(targetOutput); build.ExplicitDeps.push_back(targetOutputReal); build.Variables = std::move(symlinkVars); - globalGen.WriteBuild(this->GetBuildFileStream(), build); + globalGen->WriteBuild(this->GetBuildFileStream(), build); } else { cmNinjaBuild build("CMAKE_SYMLINK_LIBRARY"); build.Comment = "Create library symlink " + targetOutput; @@ -1110,13 +1101,13 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement() build.ExplicitDeps.push_back(targetOutputReal); build.Variables = std::move(symlinkVars); - globalGen.WriteBuild(this->GetBuildFileStream(), build); + globalGen->WriteBuild(this->GetBuildFileStream(), build); } } // Add aliases for the file name and the target name. - globalGen.AddTargetAlias(this->TargetNames.Output, >); - globalGen.AddTargetAlias(this->GetTargetName(), >); + globalGen->AddTargetAlias(this->TargetNames.Output, gt); + globalGen->AddTargetAlias(this->GetTargetName(), gt); } void cmNinjaNormalTargetGenerator::WriteObjectLibStatement() https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=cba85845172e8e12652e871d6109dba3127e8363 commit cba85845172e8e12652e871d6109dba3127e8363 Author: Sebastian Holtermann AuthorDate: Thu May 30 16:16:20 2019 +0200 Commit: Sebastian Holtermann CommitDate: Thu May 30 18:38:20 2019 +0200 Ninja: Use cmNinjaBuild class for WriteBuild diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index 2e410c8..f214229 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -595,7 +595,6 @@ void cmNinjaNormalTargetGenerator::WriteDeviceLinkStatement() comment << "Link the " << this->GetVisibleTypeName() << " " << targetOutputReal; - cmNinjaDeps emptyDeps; cmNinjaVars vars; // Compute outputs. @@ -758,7 +757,6 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement() << "# Link build statements for " << cmState::GetTargetTypeName(targetType) << " target " << this->GetTargetName() << "\n\n"; - cmNinjaDeps emptyDeps; cmNinjaVars vars; // Compute the comment. @@ -1087,14 +1085,16 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement() if (symlinkNeeded) { if (targetType == cmStateEnums::EXECUTABLE) { - globalGen.WriteBuild( - this->GetBuildFileStream(), - "Create executable symlink " + targetOutput, - "CMAKE_SYMLINK_EXECUTABLE", cmNinjaDeps(1, targetOutput), - /*implicitOuts=*/cmNinjaDeps(), cmNinjaDeps(1, targetOutputReal), - emptyDeps, emptyDeps, symlinkVars); + cmNinjaBuild build("CMAKE_SYMLINK_EXECUTABLE"); + build.Comment = "Create executable symlink " + targetOutput; + build.Outputs.push_back(targetOutput); + build.ExplicitDeps.push_back(targetOutputReal); + build.Variables = std::move(symlinkVars); + globalGen.WriteBuild(this->GetBuildFileStream(), build); } else { - cmNinjaDeps symlinks; + cmNinjaBuild build("CMAKE_SYMLINK_LIBRARY"); + build.Comment = "Create library symlink " + targetOutput; + std::string const soName = this->ConvertToNinjaPath( this->GetTargetFilePath(this->TargetNames.SharedObject)); // If one link has to be created. @@ -1104,14 +1104,13 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement() soName, cmOutputConverter::SHELL); } else { symlinkVars["SONAME"].clear(); - symlinks.push_back(soName); + build.Outputs.push_back(soName); } - symlinks.push_back(targetOutput); - globalGen.WriteBuild( - this->GetBuildFileStream(), "Create library symlink " + targetOutput, - "CMAKE_SYMLINK_LIBRARY", symlinks, - /*implicitOuts=*/cmNinjaDeps(), cmNinjaDeps(1, targetOutputReal), - emptyDeps, emptyDeps, symlinkVars); + build.Outputs.push_back(targetOutput); + build.ExplicitDeps.push_back(targetOutputReal); + build.Variables = std::move(symlinkVars); + + globalGen.WriteBuild(this->GetBuildFileStream(), build); } } https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c79b666c432fe5e0f3532d3ea508218f58bbc9a6 commit c79b666c432fe5e0f3532d3ea508218f58bbc9a6 Author: Sebastian Holtermann AuthorDate: Thu May 30 16:04:52 2019 +0200 Commit: Sebastian Holtermann CommitDate: Thu May 30 18:38:20 2019 +0200 Ninja: Use cmNinjaBuild class for WriteBuild diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index 47fec28..4c93cf1 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -949,7 +949,8 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement( int const commandLineLengthLimit = ((lang_supports_response && this->ForceResponseFile())) ? -1 : 0; - cmNinjaVars vars; + cmNinjaBuild objBuild(this->LanguageCompilerRule(language)); + cmNinjaVars& vars = objBuild.Variables; vars["FLAGS"] = this->ComputeFlagsForObject(source, language); vars["DEFINES"] = this->ComputeDefines(source, language); vars["INCLUDES"] = this->ComputeIncludes(source, language); @@ -980,32 +981,26 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement( language, sourceFileName, objectDir, objectFileName, objectFileDir, vars["FLAGS"], vars["DEFINES"], vars["INCLUDES"]); - std::string comment; - std::string rule = this->LanguageCompilerRule(language); - - cmNinjaDeps outputs; - outputs.push_back(objectFileName); + objBuild.Outputs.push_back(objectFileName); // Add this object to the list of object files. this->Objects.push_back(objectFileName); - cmNinjaDeps explicitDeps; - explicitDeps.push_back(sourceFileName); + objBuild.ExplicitDeps.push_back(sourceFileName); - cmNinjaDeps implicitDeps; if (const char* objectDeps = source->GetProperty("OBJECT_DEPENDS")) { - std::vector depList; - cmSystemTools::ExpandListArgument(objectDeps, depList); + std::vector depList = + cmSystemTools::ExpandedListArgument(objectDeps); for (std::string& odi : depList) { if (cmSystemTools::FileIsFullPath(odi)) { odi = cmSystemTools::CollapseFullPath(odi); } } std::transform(depList.begin(), depList.end(), - std::back_inserter(implicitDeps), MapToNinjaPath()); + std::back_inserter(objBuild.ImplicitDeps), + MapToNinjaPath()); } - cmNinjaDeps orderOnlyDeps; - orderOnlyDeps.push_back(this->OrderDependsTargetForTarget()); + objBuild.OrderOnlyDeps.push_back(this->OrderDependsTargetForTarget()); // If the source file is GENERATED and does not have a custom command // (either attached to this source file or another one), assume that one of @@ -1015,8 +1010,8 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement( !source->GetPropertyAsBool("__CMAKE_GENERATED_BY_CMAKE") && !source->GetCustomCommand() && !this->GetGlobalGenerator()->HasCustomCommandOutput(sourceFileName)) { - this->GetGlobalGenerator()->AddAssumedSourceDependencies(sourceFileName, - orderOnlyDeps); + this->GetGlobalGenerator()->AddAssumedSourceDependencies( + sourceFileName, objBuild.OrderOnlyDeps); } // For some cases we need to generate a ninja dyndep file. @@ -1036,18 +1031,18 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement( bool const compilePP = this->UsePreprocessedSource(language); if (compilePP) { // Move compilation dependencies to the preprocessing build statement. - std::swap(ppBuild.ExplicitDeps, explicitDeps); - std::swap(ppBuild.ImplicitDeps, implicitDeps); - std::swap(ppBuild.OrderOnlyDeps, orderOnlyDeps); + std::swap(ppBuild.ExplicitDeps, objBuild.ExplicitDeps); + std::swap(ppBuild.ImplicitDeps, objBuild.ImplicitDeps); + std::swap(ppBuild.OrderOnlyDeps, objBuild.OrderOnlyDeps); std::swap(ppBuild.Variables["IN_ABS"], vars["IN_ABS"]); // The actual compilation will now use the preprocessed source. - explicitDeps.push_back(ppFileName); + objBuild.ExplicitDeps.push_back(ppFileName); } else { // Copy compilation dependencies to the preprocessing build statement. - ppBuild.ExplicitDeps = explicitDeps; - ppBuild.ImplicitDeps = implicitDeps; - ppBuild.OrderOnlyDeps = orderOnlyDeps; + ppBuild.ExplicitDeps = objBuild.ExplicitDeps; + ppBuild.ImplicitDeps = objBuild.ImplicitDeps; + ppBuild.OrderOnlyDeps = objBuild.OrderOnlyDeps; ppBuild.Variables["IN_ABS"] = vars["IN_ABS"]; } @@ -1119,7 +1114,7 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement( } if (needDyndep) { std::string const dyndep = this->GetDyndepFilePath(language); - orderOnlyDeps.push_back(dyndep); + objBuild.OrderOnlyDeps.push_back(dyndep); vars["dyndep"] = dyndep; } @@ -1135,15 +1130,13 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement( this->SetMsvcTargetPdbVariable(vars); - std::string const rspfile = objectFileName + ".rsp"; + objBuild.RspFile = objectFileName + ".rsp"; if (language == "Swift") { this->EmitSwiftDependencyInfo(source); } else { - this->GetGlobalGenerator()->WriteBuild( - this->GetBuildFileStream(), comment, rule, outputs, - /*implicitOuts=*/cmNinjaDeps(), explicitDeps, implicitDeps, - orderOnlyDeps, vars, rspfile, commandLineLengthLimit); + this->GetGlobalGenerator()->WriteBuild(this->GetBuildFileStream(), + objBuild, commandLineLengthLimit); } if (const char* objectOutputs = source->GetProperty("OBJECT_OUTPUTS")) { @@ -1152,7 +1145,7 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement( build.Outputs = cmSystemTools::ExpandedListArgument(objectOutputs); std::transform(build.Outputs.begin(), build.Outputs.end(), build.Outputs.begin(), MapToNinjaPath()); - build.ExplicitDeps = std::move(outputs); + build.ExplicitDeps = objBuild.Outputs; this->GetGlobalGenerator()->WriteBuild(this->GetBuildFileStream(), build); } } https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=477f9e309563ec642c7323337e0aaf79a1256dac commit 477f9e309563ec642c7323337e0aaf79a1256dac Author: Sebastian Holtermann AuthorDate: Thu May 30 15:52:10 2019 +0200 Commit: Sebastian Holtermann CommitDate: Thu May 30 18:38:20 2019 +0200 Ninja: Use cmNinjaBuild class for WriteBuild diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index 2bc5765..47fec28 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -1025,39 +1025,34 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement( // For some cases we do an explicit preprocessor invocation. bool const explicitPP = this->NeedExplicitPreprocessing(language); if (explicitPP) { - bool const compilePP = this->UsePreprocessedSource(language); - std::string const ppComment; - std::string const ppRule = this->LanguagePreprocessRule(language); - cmNinjaDeps ppOutputs; - cmNinjaDeps ppImplicitOuts; - cmNinjaDeps ppExplicitDeps; - cmNinjaDeps ppImplicitDeps; - cmNinjaDeps ppOrderOnlyDeps; - cmNinjaVars ppVars; + cmNinjaBuild ppBuild(this->LanguagePreprocessRule(language)); std::string const ppFileName = this->ConvertToNinjaPath(this->GetPreprocessedFilePath(source)); - ppOutputs.push_back(ppFileName); + ppBuild.Outputs.push_back(ppFileName); + + ppBuild.RspFile = ppFileName + ".rsp"; + bool const compilePP = this->UsePreprocessedSource(language); if (compilePP) { // Move compilation dependencies to the preprocessing build statement. - std::swap(ppExplicitDeps, explicitDeps); - std::swap(ppImplicitDeps, implicitDeps); - std::swap(ppOrderOnlyDeps, orderOnlyDeps); - std::swap(ppVars["IN_ABS"], vars["IN_ABS"]); + std::swap(ppBuild.ExplicitDeps, explicitDeps); + std::swap(ppBuild.ImplicitDeps, implicitDeps); + std::swap(ppBuild.OrderOnlyDeps, orderOnlyDeps); + std::swap(ppBuild.Variables["IN_ABS"], vars["IN_ABS"]); // The actual compilation will now use the preprocessed source. explicitDeps.push_back(ppFileName); } else { // Copy compilation dependencies to the preprocessing build statement. - ppExplicitDeps = explicitDeps; - ppImplicitDeps = implicitDeps; - ppOrderOnlyDeps = orderOnlyDeps; - ppVars["IN_ABS"] = vars["IN_ABS"]; + ppBuild.ExplicitDeps = explicitDeps; + ppBuild.ImplicitDeps = implicitDeps; + ppBuild.OrderOnlyDeps = orderOnlyDeps; + ppBuild.Variables["IN_ABS"] = vars["IN_ABS"]; } // Preprocessing and compilation generally use the same flags. - ppVars["FLAGS"] = vars["FLAGS"]; + ppBuild.Variables["FLAGS"] = vars["FLAGS"]; if (compilePP) { // In case compilation requires flags that are incompatible with @@ -1069,16 +1064,16 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement( if (compilePP) { // Move preprocessor definitions to the preprocessor build statement. - std::swap(ppVars["DEFINES"], vars["DEFINES"]); + std::swap(ppBuild.Variables["DEFINES"], vars["DEFINES"]); } else { // Copy preprocessor definitions to the preprocessor build statement. - ppVars["DEFINES"] = vars["DEFINES"]; + ppBuild.Variables["DEFINES"] = vars["DEFINES"]; } // Copy include directories to the preprocessor build statement. The // Fortran compilation build statement still needs them for the INCLUDE // directive. - ppVars["INCLUDES"] = vars["INCLUDES"]; + ppBuild.Variables["INCLUDES"] = vars["INCLUDES"]; if (compilePP) { // Prepend source file's original directory as an include directory @@ -1095,8 +1090,9 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement( } // Explicit preprocessing always uses a depfile. - ppVars["DEP_FILE"] = this->GetLocalGenerator()->ConvertToOutputFormat( - objectFileName + ".pp.d", cmOutputConverter::SHELL); + ppBuild.Variables["DEP_FILE"] = + this->GetLocalGenerator()->ConvertToOutputFormat( + objectFileName + ".pp.d", cmOutputConverter::SHELL); if (compilePP) { // The actual compilation does not need a depfile because it // depends on the already-preprocessed source. @@ -1106,24 +1102,20 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement( if (needDyndep) { // Tell dependency scanner the object file that will result from // compiling the source. - ppVars["OBJ_FILE"] = objectFileName; + ppBuild.Variables["OBJ_FILE"] = objectFileName; // Tell dependency scanner where to store dyndep intermediate results. std::string const ddiFile = objectFileName + ".ddi"; - ppVars["DYNDEP_INTERMEDIATE_FILE"] = ddiFile; - ppImplicitOuts.push_back(ddiFile); + ppBuild.Variables["DYNDEP_INTERMEDIATE_FILE"] = ddiFile; + ppBuild.ImplicitOuts.push_back(ddiFile); this->DDIFiles[language].push_back(ddiFile); } this->addPoolNinjaVariable("JOB_POOL_COMPILE", this->GetGeneratorTarget(), - ppVars); - - std::string const ppRspFile = ppFileName + ".rsp"; + ppBuild.Variables); - this->GetGlobalGenerator()->WriteBuild( - this->GetBuildFileStream(), ppComment, ppRule, ppOutputs, ppImplicitOuts, - ppExplicitDeps, ppImplicitDeps, ppOrderOnlyDeps, ppVars, ppRspFile, - commandLineLengthLimit); + this->GetGlobalGenerator()->WriteBuild(this->GetBuildFileStream(), ppBuild, + commandLineLengthLimit); } if (needDyndep) { std::string const dyndep = this->GetDyndepFilePath(language); https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fc451f130ded493ae13fda1950d31acc39002ffc commit fc451f130ded493ae13fda1950d31acc39002ffc Author: Sebastian Holtermann AuthorDate: Thu May 30 15:41:27 2019 +0200 Commit: Sebastian Holtermann CommitDate: Thu May 30 18:38:20 2019 +0200 Ninja: Use cmNinjaBuild class for WriteBuild diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index 8eb9dbd..2bc5765 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -886,19 +886,12 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatements() std::string const& language = langDDIFiles.first; cmNinjaDeps const& ddiFiles = langDDIFiles.second; - std::string const ddComment; - std::string const ddRule = this->LanguageDyndepRule(language); - cmNinjaDeps ddOutputs; - cmNinjaDeps ddImplicitOuts; - cmNinjaDeps const& ddExplicitDeps = ddiFiles; - cmNinjaDeps ddImplicitDeps; - cmNinjaDeps ddOrderOnlyDeps; - cmNinjaVars ddVars; + cmNinjaBuild build(this->LanguageDyndepRule(language)); + build.Outputs.push_back(this->GetDyndepFilePath(language)); + build.ExplicitDeps = ddiFiles; this->WriteTargetDependInfo(language); - ddOutputs.push_back(this->GetDyndepFilePath(language)); - // Make sure dyndep files for all our dependencies have already // been generated so that the 'Modules.json' files they // produced as side-effects are available for us to read. @@ -908,11 +901,9 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatements() // refactoring the Ninja generator to generate targets in // dependency order so that we can collect the needed information. this->GetLocalGenerator()->AppendTargetDepends( - this->GeneratorTarget, ddOrderOnlyDeps, DependOnTargetArtifact); + this->GeneratorTarget, build.OrderOnlyDeps, DependOnTargetArtifact); - this->GetGlobalGenerator()->WriteBuild( - this->GetBuildFileStream(), ddComment, ddRule, ddOutputs, ddImplicitOuts, - ddExplicitDeps, ddImplicitDeps, ddOrderOnlyDeps, ddVars); + this->GetGlobalGenerator()->WriteBuild(this->GetBuildFileStream(), build); } this->GetBuildFileStream() << "\n"; https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2dc483476c134ec6fb05802990a98df406a39caf commit 2dc483476c134ec6fb05802990a98df406a39caf Author: Sebastian Holtermann AuthorDate: Thu May 30 15:18:43 2019 +0200 Commit: Sebastian Holtermann CommitDate: Thu May 30 18:38:20 2019 +0200 Ninja: Remove WritePhonyBuild method diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index c40b571..cde764f 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -236,16 +236,6 @@ void cmGlobalNinjaGenerator::WriteBuild(std::ostream& os, build.Variables, build.RspFile, cmdLineLimit, usedResponseFile); } -void cmGlobalNinjaGenerator::WritePhonyBuild( - std::ostream& os, const std::string& comment, const cmNinjaDeps& outputs, - const cmNinjaDeps& explicitDeps, const cmNinjaDeps& implicitDeps, - const cmNinjaDeps& orderOnlyDeps, const cmNinjaVars& variables) -{ - this->WriteBuild(os, comment, "phony", outputs, - /*implicitOuts=*/cmNinjaDeps(), explicitDeps, implicitDeps, - orderOnlyDeps, variables); -} - void cmGlobalNinjaGenerator::AddCustomCommandRule() { cmNinjaRule rule("CUSTOM_COMMAND"); diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h index ffd00b5..4ccd927 100644 --- a/Source/cmGlobalNinjaGenerator.h +++ b/Source/cmGlobalNinjaGenerator.h @@ -123,16 +123,6 @@ public: void WriteBuild(std::ostream& os, cmNinjaBuild const& build, int cmdLineLimit = 0, bool* usedResponseFile = nullptr); - /** - * Helper to write a build statement with the special 'phony' rule. - */ - void WritePhonyBuild(std::ostream& os, const std::string& comment, - const cmNinjaDeps& outputs, - const cmNinjaDeps& explicitDeps, - const cmNinjaDeps& implicitDeps = cmNinjaDeps(), - const cmNinjaDeps& orderOnlyDeps = cmNinjaDeps(), - const cmNinjaVars& variables = cmNinjaVars()); - void WriteCustomCommandBuild( const std::string& command, const std::string& description, const std::string& comment, const std::string& depfile, https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5823510745224f0e9ba6d69313c139bcfd9a3953 commit 5823510745224f0e9ba6d69313c139bcfd9a3953 Author: Sebastian Holtermann AuthorDate: Thu May 30 15:14:19 2019 +0200 Commit: Sebastian Holtermann CommitDate: Thu May 30 18:38:19 2019 +0200 Ninja: Use cmNinjaBuild instead of WritePhonyBuild diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index e3ea489..c40b571 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -1432,14 +1432,16 @@ void cmGlobalNinjaGenerator::WriteTargetRebuildManifest(std::ostream& os) /*implicitOuts=*/cmNinjaDeps(), explicitDeps, implicitDeps, /*orderOnlyDeps=*/cmNinjaDeps(), variables); - cmNinjaDeps missingInputs; - std::set_difference(std::make_move_iterator(implicitDeps.begin()), - std::make_move_iterator(implicitDeps.end()), - CustomCommandOutputs.begin(), CustomCommandOutputs.end(), - std::back_inserter(missingInputs)); - - this->WritePhonyBuild(os, "A missing CMake input file is not an error.", - missingInputs, cmNinjaDeps()); + { + cmNinjaBuild build("phony"); + build.Comment = "A missing CMake input file is not an error."; + std::set_difference(std::make_move_iterator(implicitDeps.begin()), + std::make_move_iterator(implicitDeps.end()), + CustomCommandOutputs.begin(), + CustomCommandOutputs.end(), + std::back_inserter(build.Outputs)); + this->WriteBuild(os, build); + } } std::string cmGlobalNinjaGenerator::CMakeCmd() const https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fe018819cb4b944cafbd6d8b9e9f6332014579a9 commit fe018819cb4b944cafbd6d8b9e9f6332014579a9 Author: Sebastian Holtermann AuthorDate: Thu May 30 15:03:23 2019 +0200 Commit: Sebastian Holtermann CommitDate: Thu May 30 18:38:19 2019 +0200 Ninja: Use cmNinjaBuild instead of WritePhonyBuild diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 1980261..e3ea489 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -1382,11 +1382,10 @@ void cmGlobalNinjaGenerator::WriteTargetRebuildManifest(std::ostream& os) this->WriteRule(*this->RulesFileStream, rule); } - std::string verifyForce = cm->GetGlobVerifyScript() + "_force"; - cmNinjaDeps verifyForceDeps(1, this->NinjaOutputPath(verifyForce)); - - this->WritePhonyBuild(os, "Phony target to force glob verification run.", - verifyForceDeps, cmNinjaDeps()); + cmNinjaBuild phonyBuild("phony"); + phonyBuild.Comment = "Phony target to force glob verification run."; + phonyBuild.Outputs.push_back(cm->GetGlobVerifyScript() + "_force"); + this->WriteBuild(os, phonyBuild); variables["restat"] = "1"; std::string const verifyScriptFile = @@ -1399,7 +1398,7 @@ void cmGlobalNinjaGenerator::WriteTargetRebuildManifest(std::ostream& os) /*outputs=*/cmNinjaDeps(1, verifyStampFile), /*implicitOuts=*/cmNinjaDeps(), /*explicitDeps=*/cmNinjaDeps(), - /*implicitDeps=*/verifyForceDeps, + /*implicitDeps=*/phonyBuild.Outputs, /*orderOnlyDeps=*/cmNinjaDeps(), variables); variables.erase("restat"); https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c367f7d5469e21739629a896aea3a04bb476c2bf commit c367f7d5469e21739629a896aea3a04bb476c2bf Author: Sebastian Holtermann AuthorDate: Thu May 30 14:58:18 2019 +0200 Commit: Sebastian Holtermann CommitDate: Thu May 30 18:38:19 2019 +0200 Ninja: Use cmNinjaBuild instead of WritePhonyBuild diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 87a9dac..1980261 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -1318,14 +1318,14 @@ void cmGlobalNinjaGenerator::WriteBuiltinTargets(std::ostream& os) void cmGlobalNinjaGenerator::WriteTargetAll(std::ostream& os) { - cmNinjaDeps outputs; - outputs.push_back(this->TargetAll); - - this->WritePhonyBuild(os, "The main all target.", outputs, - this->AllDependencies); + cmNinjaBuild build("phony"); + build.Comment = "The main all target."; + build.Outputs.push_back(this->TargetAll); + build.ExplicitDeps = this->AllDependencies; + this->WriteBuild(os, build); if (!this->HasOutputPathPrefix()) { - cmGlobalNinjaGenerator::WriteDefault(os, outputs, + cmGlobalNinjaGenerator::WriteDefault(os, build.Outputs, "Make the all target the default."); } } https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1e7e47f597754e800673b158ce1bd59c8b6c566a commit 1e7e47f597754e800673b158ce1bd59c8b6c566a Author: Sebastian Holtermann AuthorDate: Thu May 30 14:52:17 2019 +0200 Commit: Sebastian Holtermann CommitDate: Thu May 30 18:38:19 2019 +0200 Ninja: Use cmNinjaBuild instead of WritePhonyBuild diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 2d84271..87a9dac 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -1258,23 +1258,26 @@ void cmGlobalNinjaGenerator::WriteUnknownExplicitDependencies(std::ostream& os) knownDependencies.begin(), knownDependencies.end(), std::back_inserter(unknownExplicitDepends)); - std::string const rootBuildDirectory = - this->GetCMakeInstance()->GetHomeOutputDirectory(); - bool const inSourceBuild = - (rootBuildDirectory == this->GetCMakeInstance()->GetHomeDirectory()); std::vector warnExplicitDepends; - for (std::string const& i : unknownExplicitDepends) { - // verify the file is in the build directory - std::string const absDepPath = - cmSystemTools::CollapseFullPath(i, rootBuildDirectory); - bool const inBuildDir = - cmSystemTools::IsSubDirectory(absDepPath, rootBuildDirectory); - if (inBuildDir) { - cmNinjaDeps deps(1, i); - this->WritePhonyBuild(os, "", deps, cmNinjaDeps()); - if (this->PolicyCMP0058 == cmPolicies::WARN && !inSourceBuild && - warnExplicitDepends.size() < 10) { - warnExplicitDepends.push_back(i); + if (!unknownExplicitDepends.empty()) { + cmake* cmk = this->GetCMakeInstance(); + std::string const& buildRoot = cmk->GetHomeOutputDirectory(); + bool const inSource = (buildRoot == cmk->GetHomeDirectory()); + bool const warn = (!inSource && (this->PolicyCMP0058 == cmPolicies::WARN)); + cmNinjaBuild build("phony"); + build.Outputs.emplace_back(""); + for (std::string const& ued : unknownExplicitDepends) { + // verify the file is in the build directory + std::string const absDepPath = + cmSystemTools::CollapseFullPath(ued, buildRoot); + if (cmSystemTools::IsSubDirectory(absDepPath, buildRoot)) { + // Generate phony build statement + build.Outputs[0] = ued; + this->WriteBuild(os, build); + // Add to warning on demand + if (warn && warnExplicitDepends.size() < 10) { + warnExplicitDepends.push_back(ued); + } } } } https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e97ea5201037b67012ecabb1cb7aebabebfed20d commit e97ea5201037b67012ecabb1cb7aebabebfed20d Author: Sebastian Holtermann AuthorDate: Thu May 30 14:21:17 2019 +0200 Commit: Sebastian Holtermann CommitDate: Thu May 30 18:38:19 2019 +0200 Ninja: Use cmNinjaBuild instead of WritePhonyBuild diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 8cfbae3..2d84271 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -1125,13 +1125,22 @@ void cmGlobalNinjaGenerator::WriteFolderTargets(std::ostream& os) cmGlobalNinjaGenerator::WriteDivider(os); os << "# Folder targets.\n\n"; + std::string const& rootBinaryDir = + this->LocalGenerators[0]->GetBinaryDirectory(); + std::map targetsPerFolder; for (cmLocalGenerator const* lg : this->LocalGenerators) { - const std::string currentBinaryFolder( + std::string const& currentBinaryFolder( lg->GetStateSnapshot().GetDirectory().GetCurrentBinary()); + + // Do not generate a rule for the root binary dir. + if (currentBinaryFolder == rootBinaryDir) { + continue; + } + // The directory-level rule should depend on the target-level rules // for all targets in the directory. - targetsPerFolder[currentBinaryFolder] = cmNinjaDeps(); + cmNinjaDeps& folderTargets = targetsPerFolder[currentBinaryFolder]; for (auto gt : lg->GetGeneratorTargets()) { cmStateEnums::TargetType const type = gt->GetType(); if ((type == cmStateEnums::EXECUTABLE || @@ -1141,37 +1150,34 @@ void cmGlobalNinjaGenerator::WriteFolderTargets(std::ostream& os) type == cmStateEnums::OBJECT_LIBRARY || type == cmStateEnums::UTILITY) && !gt->GetPropertyAsBool("EXCLUDE_FROM_ALL")) { - targetsPerFolder[currentBinaryFolder].push_back(gt->GetName()); + folderTargets.push_back(gt->GetName()); } } // The directory-level rule should depend on the directory-level // rules of the subdirectories. for (cmStateSnapshot const& state : lg->GetStateSnapshot().GetChildren()) { - std::string const currentBinaryDir = + std::string const& currentBinaryDir = state.GetDirectory().GetCurrentBinary(); - - targetsPerFolder[currentBinaryFolder].push_back( + folderTargets.push_back( this->ConvertToNinjaPath(currentBinaryDir + "/all")); } } - std::string const rootBinaryDir = - this->LocalGenerators[0]->GetBinaryDirectory(); - for (auto const& it : targetsPerFolder) { - cmGlobalNinjaGenerator::WriteDivider(os); - std::string const& currentBinaryDir = it.first; + if (!targetsPerFolder.empty()) { + cmNinjaBuild build("phony"); + build.Outputs.emplace_back(""); + for (auto& it : targetsPerFolder) { + cmGlobalNinjaGenerator::WriteDivider(os); + std::string const& currentBinaryDir = it.first; - // Do not generate a rule for the root binary dir. - if (rootBinaryDir.length() >= currentBinaryDir.length()) { - continue; + // Setup target + build.Comment = "Folder: " + currentBinaryDir; + build.Outputs[0] = this->ConvertToNinjaPath(currentBinaryDir + "/all"); + build.ExplicitDeps = std::move(it.second); + // Write target + this->WriteBuild(os, build); } - - std::string const comment = "Folder: " + currentBinaryDir; - cmNinjaDeps output(1); - output.push_back(this->ConvertToNinjaPath(currentBinaryDir + "/all")); - - this->WritePhonyBuild(os, comment, output, it.second); } } https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=43af4ca78e80c65d3c0cf2c5121d61988e9d5192 commit 43af4ca78e80c65d3c0cf2c5121d61988e9d5192 Author: Sebastian Holtermann AuthorDate: Thu May 30 13:46:04 2019 +0200 Commit: Sebastian Holtermann CommitDate: Thu May 30 18:38:19 2019 +0200 Ninja: Use cmNinjaBuild instead of WritePhonyBuild diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index ef06ebe..8cfbae3 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -1096,6 +1096,8 @@ void cmGlobalNinjaGenerator::WriteTargetAliases(std::ostream& os) cmGlobalNinjaGenerator::WriteDivider(os); os << "# Target aliases.\n\n"; + cmNinjaBuild build("phony"); + build.Outputs.emplace_back(""); for (auto const& ta : TargetAliases) { // Don't write ambiguous aliases. if (!ta.second) { @@ -1108,10 +1110,13 @@ void cmGlobalNinjaGenerator::WriteTargetAliases(std::ostream& os) continue; } - cmNinjaDeps deps; - this->AppendTargetOutputs(ta.second, deps); - - this->WritePhonyBuild(os, "", cmNinjaDeps(1, ta.first), deps); + // Outputs + build.Outputs[0] = ta.first; + // Explicit depdendencies + build.ExplicitDeps.clear(); + this->AppendTargetOutputs(ta.second, build.ExplicitDeps); + // Write + this->WriteBuild(os, build); } } https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e762da6dc98474a71d0e69866ec3800af3117466 commit e762da6dc98474a71d0e69866ec3800af3117466 Author: Sebastian Holtermann AuthorDate: Thu May 30 13:40:09 2019 +0200 Commit: Sebastian Holtermann CommitDate: Thu May 30 18:38:19 2019 +0200 Ninja: Use cmNinjaBuild instead of WritePhonyBuild diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx index 9b651a4..81cafa3 100644 --- a/Source/cmLocalNinjaGenerator.cxx +++ b/Source/cmLocalNinjaGenerator.cxx @@ -454,7 +454,8 @@ void cmLocalNinjaGenerator::AppendCustomCommandLines( void cmLocalNinjaGenerator::WriteCustomCommandBuildStatement( cmCustomCommand const* cc, const cmNinjaDeps& orderOnlyDeps) { - if (this->GetGlobalNinjaGenerator()->SeenCustomCommand(cc)) { + cmGlobalNinjaGenerator* gg = this->GetGlobalNinjaGenerator(); + if (gg->SeenCustomCommand(cc)) { return; } @@ -462,13 +463,12 @@ void cmLocalNinjaGenerator::WriteCustomCommandBuildStatement( const std::vector& outputs = ccg.GetOutputs(); const std::vector& byproducts = ccg.GetByproducts(); - cmNinjaDeps ninjaOutputs(outputs.size() + byproducts.size()), ninjaDeps; bool symbolic = false; for (std::string const& output : outputs) { if (cmSourceFile* sf = this->Makefile->GetSource(output)) { - symbolic = sf->GetPropertyAsBool("SYMBOLIC"); - if (symbolic) { + if (sf->GetPropertyAsBool("SYMBOLIC")) { + symbolic = true; break; } } @@ -479,25 +479,29 @@ void cmLocalNinjaGenerator::WriteCustomCommandBuildStatement( file of each imported target that has an add_dependencies pointing \ at us. How to know which ExternalProject step actually provides it? #endif + cmNinjaDeps ninjaOutputs(outputs.size() + byproducts.size()); std::transform(outputs.begin(), outputs.end(), ninjaOutputs.begin(), - this->GetGlobalNinjaGenerator()->MapToNinjaPath()); + gg->MapToNinjaPath()); std::transform(byproducts.begin(), byproducts.end(), - ninjaOutputs.begin() + outputs.size(), - this->GetGlobalNinjaGenerator()->MapToNinjaPath()); - this->AppendCustomCommandDeps(ccg, ninjaDeps); + ninjaOutputs.begin() + outputs.size(), gg->MapToNinjaPath()); for (std::string const& ninjaOutput : ninjaOutputs) { - this->GetGlobalNinjaGenerator()->SeenCustomCommandOutput(ninjaOutput); + gg->SeenCustomCommandOutput(ninjaOutput); } + cmNinjaDeps ninjaDeps; + this->AppendCustomCommandDeps(ccg, ninjaDeps); + std::vector cmdLines; this->AppendCustomCommandLines(ccg, cmdLines); if (cmdLines.empty()) { - this->GetGlobalNinjaGenerator()->WritePhonyBuild( - this->GetBuildFileStream(), - "Phony custom command for " + ninjaOutputs[0], ninjaOutputs, ninjaDeps, - cmNinjaDeps(), orderOnlyDeps, cmNinjaVars()); + cmNinjaBuild build("phony"); + build.Comment = "Phony custom command for " + ninjaOutputs[0]; + build.Outputs = std::move(ninjaOutputs); + build.ExplicitDeps = std::move(ninjaDeps); + build.OrderOnlyDeps = orderOnlyDeps; + gg->WriteBuild(this->GetBuildFileStream(), build); } else { std::string customStep = cmSystemTools::GetFilenameName(ninjaOutputs[0]); // Hash full path to make unique. @@ -505,7 +509,7 @@ void cmLocalNinjaGenerator::WriteCustomCommandBuildStatement( cmCryptoHash hash(cmCryptoHash::AlgoSHA256); customStep += hash.HashString(ninjaOutputs[0]).substr(0, 7); - this->GetGlobalNinjaGenerator()->WriteCustomCommandBuild( + gg->WriteCustomCommandBuild( this->BuildCommandLine(cmdLines, customStep), this->ConstructComment(ccg), "Custom command for " + ninjaOutputs[0], cc->GetDepfile(), cc->GetJobPool(), cc->GetUsesTerminal(), https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0d0cb136fb19d96f857f8d7da918e18038d5b627 commit 0d0cb136fb19d96f857f8d7da918e18038d5b627 Author: Sebastian Holtermann AuthorDate: Thu May 30 13:23:06 2019 +0200 Commit: Sebastian Holtermann CommitDate: Thu May 30 18:38:14 2019 +0200 Ninja: Use cmNinjaBuild instead of WritePhonyBuild diff --git a/Source/cmNinjaUtilityTargetGenerator.cxx b/Source/cmNinjaUtilityTargetGenerator.cxx index 9d05110..1225cbd 100644 --- a/Source/cmNinjaUtilityTargetGenerator.cxx +++ b/Source/cmNinjaUtilityTargetGenerator.cxx @@ -19,6 +19,7 @@ #include #include #include +#include #include cmNinjaUtilityTargetGenerator::cmNinjaUtilityTargetGenerator( @@ -41,8 +42,9 @@ void cmNinjaUtilityTargetGenerator::Generate() utilCommandName += this->GetTargetName() + ".util"; utilCommandName = this->ConvertToNinjaPath(utilCommandName); + cmNinjaBuild phonyBuild("phony"); std::vector commands; - cmNinjaDeps deps, outputs, util_outputs(1, utilCommandName); + cmNinjaDeps deps, util_outputs(1, utilCommandName); bool uses_terminal = false; { @@ -86,13 +88,13 @@ void cmNinjaUtilityTargetGenerator::Generate() } } - lg->AppendTargetOutputs(genTarget, outputs); + lg->AppendTargetOutputs(genTarget, phonyBuild.Outputs); lg->AppendTargetDepends(genTarget, deps); if (commands.empty()) { - gg->WritePhonyBuild(this->GetBuildFileStream(), - "Utility command for " + this->GetTargetName(), - outputs, deps); + phonyBuild.Comment = "Utility command for " + this->GetTargetName(); + phonyBuild.ExplicitDeps = std::move(deps); + gg->WriteBuild(this->GetBuildFileStream(), phonyBuild); } else { std::string command = lg->BuildCommandLine(commands, "utility", this->GeneratorTarget); @@ -129,8 +131,8 @@ void cmNinjaUtilityTargetGenerator::Generate() /*depfile*/ "", /*job_pool*/ "", uses_terminal, /*restat*/ true, util_outputs, deps); - gg->WritePhonyBuild(this->GetBuildFileStream(), "", outputs, - cmNinjaDeps(1, utilCommandName)); + phonyBuild.ExplicitDeps.push_back(utilCommandName); + gg->WriteBuild(this->GetBuildFileStream(), phonyBuild); } // Add an alias for the logical target name regardless of what directory https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=09c21914b320567583ce5ff4c92e56b8a54bf3cb commit 09c21914b320567583ce5ff4c92e56b8a54bf3cb Author: Sebastian Holtermann AuthorDate: Thu May 30 12:25:12 2019 +0200 Commit: Sebastian Holtermann CommitDate: Thu May 30 18:21:40 2019 +0200 Ninja: Embrace temporary objects in scopes diff --git a/Source/cmNinjaUtilityTargetGenerator.cxx b/Source/cmNinjaUtilityTargetGenerator.cxx index ab777c8..9d05110 100644 --- a/Source/cmNinjaUtilityTargetGenerator.cxx +++ b/Source/cmNinjaUtilityTargetGenerator.cxx @@ -16,6 +16,7 @@ #include "cmSystemTools.h" #include +#include #include #include #include @@ -30,8 +31,11 @@ cmNinjaUtilityTargetGenerator::~cmNinjaUtilityTargetGenerator() = default; void cmNinjaUtilityTargetGenerator::Generate() { - std::string utilCommandName = - this->GetLocalGenerator()->GetCurrentBinaryDirectory(); + cmGlobalNinjaGenerator* gg = this->GetGlobalGenerator(); + cmLocalNinjaGenerator* lg = this->GetLocalGenerator(); + cmGeneratorTarget* genTarget = this->GetGeneratorTarget(); + + std::string utilCommandName = lg->GetCurrentBinaryDirectory(); utilCommandName += "/CMakeFiles"; utilCommandName += "/"; utilCommandName += this->GetTargetName() + ".util"; @@ -40,64 +44,60 @@ void cmNinjaUtilityTargetGenerator::Generate() std::vector commands; cmNinjaDeps deps, outputs, util_outputs(1, utilCommandName); - const std::vector* cmdLists[2] = { - &this->GetGeneratorTarget()->GetPreBuildCommands(), - &this->GetGeneratorTarget()->GetPostBuildCommands() - }; - bool uses_terminal = false; - - for (unsigned i = 0; i != 2; ++i) { - for (cmCustomCommand const& ci : *cmdLists[i]) { - cmCustomCommandGenerator ccg(ci, this->GetConfigName(), - this->GetLocalGenerator()); - this->GetLocalGenerator()->AppendCustomCommandDeps(ccg, deps); - this->GetLocalGenerator()->AppendCustomCommandLines(ccg, commands); - std::vector const& ccByproducts = ccg.GetByproducts(); - std::transform(ccByproducts.begin(), ccByproducts.end(), - std::back_inserter(util_outputs), MapToNinjaPath()); - if (ci.GetUsesTerminal()) { - uses_terminal = true; + { + std::array const*, 2> const cmdLists = { + { &genTarget->GetPreBuildCommands(), &genTarget->GetPostBuildCommands() } + }; + + for (std::vector const* cmdList : cmdLists) { + for (cmCustomCommand const& ci : *cmdList) { + cmCustomCommandGenerator ccg(ci, this->GetConfigName(), lg); + lg->AppendCustomCommandDeps(ccg, deps); + lg->AppendCustomCommandLines(ccg, commands); + std::vector const& ccByproducts = ccg.GetByproducts(); + std::transform(ccByproducts.begin(), ccByproducts.end(), + std::back_inserter(util_outputs), MapToNinjaPath()); + if (ci.GetUsesTerminal()) { + uses_terminal = true; + } } } } - std::vector sources; - std::string config = - this->GetMakefile()->GetSafeDefinition("CMAKE_BUILD_TYPE"); - this->GetGeneratorTarget()->GetSourceFiles(sources, config); - for (cmSourceFile const* source : sources) { - if (cmCustomCommand const* cc = source->GetCustomCommand()) { - cmCustomCommandGenerator ccg(*cc, this->GetConfigName(), - this->GetLocalGenerator()); - this->GetLocalGenerator()->AddCustomCommandTarget( - cc, this->GetGeneratorTarget()); - - // Depend on all custom command outputs. - const std::vector& ccOutputs = ccg.GetOutputs(); - const std::vector& ccByproducts = ccg.GetByproducts(); - std::transform(ccOutputs.begin(), ccOutputs.end(), - std::back_inserter(deps), MapToNinjaPath()); - std::transform(ccByproducts.begin(), ccByproducts.end(), - std::back_inserter(deps), MapToNinjaPath()); + { + std::string const& config = + this->GetMakefile()->GetSafeDefinition("CMAKE_BUILD_TYPE"); + std::vector sources; + genTarget->GetSourceFiles(sources, config); + for (cmSourceFile const* source : sources) { + if (cmCustomCommand const* cc = source->GetCustomCommand()) { + cmCustomCommandGenerator ccg(*cc, this->GetConfigName(), lg); + lg->AddCustomCommandTarget(cc, genTarget); + + // Depend on all custom command outputs. + const std::vector& ccOutputs = ccg.GetOutputs(); + const std::vector& ccByproducts = ccg.GetByproducts(); + std::transform(ccOutputs.begin(), ccOutputs.end(), + std::back_inserter(deps), MapToNinjaPath()); + std::transform(ccByproducts.begin(), ccByproducts.end(), + std::back_inserter(deps), MapToNinjaPath()); + } } } - this->GetLocalGenerator()->AppendTargetOutputs(this->GetGeneratorTarget(), - outputs); - this->GetLocalGenerator()->AppendTargetDepends(this->GetGeneratorTarget(), - deps); + lg->AppendTargetOutputs(genTarget, outputs); + lg->AppendTargetDepends(genTarget, deps); if (commands.empty()) { - this->GetGlobalGenerator()->WritePhonyBuild( - this->GetBuildFileStream(), - "Utility command for " + this->GetTargetName(), outputs, deps); + gg->WritePhonyBuild(this->GetBuildFileStream(), + "Utility command for " + this->GetTargetName(), + outputs, deps); } else { - std::string command = this->GetLocalGenerator()->BuildCommandLine( - commands, "utility", this->GeneratorTarget); - const char* echoStr = - this->GetGeneratorTarget()->GetProperty("EchoString"); + std::string command = + lg->BuildCommandLine(commands, "utility", this->GeneratorTarget); std::string desc; + const char* echoStr = genTarget->GetProperty("EchoString"); if (echoStr) { desc = echoStr; } else { @@ -108,18 +108,12 @@ void cmNinjaUtilityTargetGenerator::Generate() // makefile vars. cmSystemTools::ReplaceString( command, "$(CMAKE_SOURCE_DIR)", - this->GetLocalGenerator() - ->ConvertToOutputFormat( - this->GetLocalGenerator()->GetSourceDirectory(), - cmOutputConverter::SHELL) - .c_str()); + lg->ConvertToOutputFormat(lg->GetSourceDirectory(), + cmOutputConverter::SHELL)); cmSystemTools::ReplaceString( command, "$(CMAKE_BINARY_DIR)", - this->GetLocalGenerator() - ->ConvertToOutputFormat( - this->GetLocalGenerator()->GetBinaryDirectory(), - cmOutputConverter::SHELL) - .c_str()); + lg->ConvertToOutputFormat(lg->GetBinaryDirectory(), + cmOutputConverter::SHELL)); cmSystemTools::ReplaceString(command, "$(ARGS)", ""); if (command.find('$') != std::string::npos) { @@ -127,24 +121,22 @@ void cmNinjaUtilityTargetGenerator::Generate() } for (std::string const& util_output : util_outputs) { - this->GetGlobalGenerator()->SeenCustomCommandOutput(util_output); + gg->SeenCustomCommandOutput(util_output); } - this->GetGlobalGenerator()->WriteCustomCommandBuild( - command, desc, "Utility command for " + this->GetTargetName(), - /*depfile*/ "", /*job_pool*/ "", uses_terminal, - /*restat*/ true, util_outputs, deps); + gg->WriteCustomCommandBuild(command, desc, + "Utility command for " + this->GetTargetName(), + /*depfile*/ "", /*job_pool*/ "", uses_terminal, + /*restat*/ true, util_outputs, deps); - this->GetGlobalGenerator()->WritePhonyBuild( - this->GetBuildFileStream(), "", outputs, - cmNinjaDeps(1, utilCommandName)); + gg->WritePhonyBuild(this->GetBuildFileStream(), "", outputs, + cmNinjaDeps(1, utilCommandName)); } // Add an alias for the logical target name regardless of what directory // contains it. Skip this for GLOBAL_TARGET because they are meant to // be per-directory and have one at the top-level anyway. - if (this->GetGeneratorTarget()->GetType() != cmStateEnums::GLOBAL_TARGET) { - this->GetGlobalGenerator()->AddTargetAlias(this->GetTargetName(), - this->GetGeneratorTarget()); + if (genTarget->GetType() != cmStateEnums::GLOBAL_TARGET) { + gg->AddTargetAlias(this->GetTargetName(), genTarget); } } https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=dff42d481230599ba7962a5895d75e7c0d16939e commit dff42d481230599ba7962a5895d75e7c0d16939e Author: Sebastian Holtermann AuthorDate: Thu May 30 11:52:22 2019 +0200 Commit: Sebastian Holtermann CommitDate: Thu May 30 18:21:40 2019 +0200 Ninja: Use cmNinjaBuild instead of WritePhonyBuild diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index 6e9e112..2e410c8 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -1123,13 +1123,14 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement() void cmNinjaNormalTargetGenerator::WriteObjectLibStatement() { // Write a phony output that depends on all object files. - cmNinjaDeps outputs; - this->GetLocalGenerator()->AppendTargetOutputs(this->GetGeneratorTarget(), - outputs); - cmNinjaDeps depends = this->GetObjects(); - this->GetGlobalGenerator()->WritePhonyBuild( - this->GetBuildFileStream(), "Object library " + this->GetTargetName(), - outputs, depends); + { + cmNinjaBuild build("phony"); + build.Comment = "Object library " + this->GetTargetName(); + this->GetLocalGenerator()->AppendTargetOutputs(this->GetGeneratorTarget(), + build.Outputs); + build.ExplicitDeps = this->GetObjects(); + this->GetGlobalGenerator()->WriteBuild(this->GetBuildFileStream(), build); + } // Add aliases for the target name. this->GetGlobalGenerator()->AddTargetAlias(this->GetTargetName(), https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=df72f06182f3481fe8929c49578052748d980712 commit df72f06182f3481fe8929c49578052748d980712 Author: Sebastian Holtermann AuthorDate: Thu May 30 15:11:52 2019 +0200 Commit: Sebastian Holtermann CommitDate: Thu May 30 18:21:40 2019 +0200 Ninja: Use cmNinjaBuild instead of WritePhonyBuild diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index e878adb..8eb9dbd 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -1164,13 +1164,13 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement( } if (const char* objectOutputs = source->GetProperty("OBJECT_OUTPUTS")) { - std::vector outputList; - cmSystemTools::ExpandListArgument(objectOutputs, outputList); - std::transform(outputList.begin(), outputList.end(), outputList.begin(), - MapToNinjaPath()); - this->GetGlobalGenerator()->WritePhonyBuild(this->GetBuildFileStream(), - "Additional output files.", - outputList, outputs); + cmNinjaBuild build("phony"); + build.Comment = "Additional output files."; + build.Outputs = cmSystemTools::ExpandedListArgument(objectOutputs); + std::transform(build.Outputs.begin(), build.Outputs.end(), + build.Outputs.begin(), MapToNinjaPath()); + build.ExplicitDeps = std::move(outputs); + this->GetGlobalGenerator()->WriteBuild(this->GetBuildFileStream(), build); } } https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0eed548d3f0387a3bcbdc42ad4456987a37b2934 commit 0eed548d3f0387a3bcbdc42ad4456987a37b2934 Author: Sebastian Holtermann AuthorDate: Thu May 30 12:19:00 2019 +0200 Commit: Sebastian Holtermann CommitDate: Thu May 30 18:21:40 2019 +0200 Ninja: Use cmNinjaBuild instead of WritePhonyBuild diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index 140730b..e878adb 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -829,7 +829,11 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatements() } { - cmNinjaDeps orderOnlyDeps; + cmNinjaBuild build("phony"); + build.Comment = "Order-only phony target for " + this->GetTargetName(); + build.Outputs.push_back(this->OrderDependsTargetForTarget()); + + cmNinjaDeps& orderOnlyDeps = build.OrderOnlyDeps; this->GetLocalGenerator()->AppendTargetDepends( this->GeneratorTarget, orderOnlyDeps, DependOnTargetOrdering); @@ -867,14 +871,7 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatements() orderOnlyDeps.push_back(this->ConvertToNinjaPath(tgtDir)); } - { - cmNinjaDeps orderOnlyTarget; - orderOnlyTarget.push_back(this->OrderDependsTargetForTarget()); - this->GetGlobalGenerator()->WritePhonyBuild( - this->GetBuildFileStream(), - "Order-only phony target for " + this->GetTargetName(), - orderOnlyTarget, cmNinjaDeps(), cmNinjaDeps(), orderOnlyDeps); - } + this->GetGlobalGenerator()->WriteBuild(this->GetBuildFileStream(), build); } { https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b6dc977ff17b451b43d8a67584400c3b53c7eb8f commit b6dc977ff17b451b43d8a67584400c3b53c7eb8f Author: Sebastian Holtermann AuthorDate: Thu May 30 12:06:25 2019 +0200 Commit: Sebastian Holtermann CommitDate: Thu May 30 18:21:40 2019 +0200 Ninja: Embrace temporary objects in scopes diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index 5b8ed90..140730b 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -796,78 +796,93 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatements() const std::string& config = this->Makefile->GetSafeDefinition("CMAKE_BUILD_TYPE"); - std::vector customCommands; - this->GeneratorTarget->GetCustomCommands(customCommands, config); - for (cmSourceFile const* sf : customCommands) { - cmCustomCommand const* cc = sf->GetCustomCommand(); - this->GetLocalGenerator()->AddCustomCommandTarget( - cc, this->GetGeneratorTarget()); - // Record the custom commands for this target. The container is used - // in WriteObjectBuildStatement when called in a loop below. - this->CustomCommands.push_back(cc); + { + std::vector customCommands; + this->GeneratorTarget->GetCustomCommands(customCommands, config); + for (cmSourceFile const* sf : customCommands) { + cmCustomCommand const* cc = sf->GetCustomCommand(); + this->GetLocalGenerator()->AddCustomCommandTarget( + cc, this->GetGeneratorTarget()); + // Record the custom commands for this target. The container is used + // in WriteObjectBuildStatement when called in a loop below. + this->CustomCommands.push_back(cc); + } } - std::vector headerSources; - this->GeneratorTarget->GetHeaderSources(headerSources, config); - this->OSXBundleGenerator->GenerateMacOSXContentStatements( - headerSources, this->MacOSXContentGenerator.get()); - std::vector extraSources; - this->GeneratorTarget->GetExtraSources(extraSources, config); - this->OSXBundleGenerator->GenerateMacOSXContentStatements( - extraSources, this->MacOSXContentGenerator.get()); - std::vector externalObjects; - this->GeneratorTarget->GetExternalObjects(externalObjects, config); - for (cmSourceFile const* sf : externalObjects) { - this->Objects.push_back(this->GetSourceFilePath(sf)); + { + std::vector headerSources; + this->GeneratorTarget->GetHeaderSources(headerSources, config); + this->OSXBundleGenerator->GenerateMacOSXContentStatements( + headerSources, this->MacOSXContentGenerator.get()); } - - cmNinjaDeps orderOnlyDeps; - this->GetLocalGenerator()->AppendTargetDepends( - this->GeneratorTarget, orderOnlyDeps, DependOnTargetOrdering); - - // Add order-only dependencies on other files associated with the target. - cmAppend(orderOnlyDeps, this->ExtraFiles); - - // Add order-only dependencies on custom command outputs. - for (cmCustomCommand const* cc : this->CustomCommands) { - cmCustomCommandGenerator ccg(*cc, this->GetConfigName(), - this->GetLocalGenerator()); - const std::vector& ccoutputs = ccg.GetOutputs(); - const std::vector& ccbyproducts = ccg.GetByproducts(); - std::transform(ccoutputs.begin(), ccoutputs.end(), - std::back_inserter(orderOnlyDeps), MapToNinjaPath()); - std::transform(ccbyproducts.begin(), ccbyproducts.end(), - std::back_inserter(orderOnlyDeps), MapToNinjaPath()); + { + std::vector extraSources; + this->GeneratorTarget->GetExtraSources(extraSources, config); + this->OSXBundleGenerator->GenerateMacOSXContentStatements( + extraSources, this->MacOSXContentGenerator.get()); } - - std::sort(orderOnlyDeps.begin(), orderOnlyDeps.end()); - orderOnlyDeps.erase(std::unique(orderOnlyDeps.begin(), orderOnlyDeps.end()), - orderOnlyDeps.end()); - - // The phony target must depend on at least one input or ninja will explain - // that "output ... of phony edge with no inputs doesn't exist" and consider - // the phony output "dirty". - if (orderOnlyDeps.empty()) { - // Any path that always exists will work here. It would be nice to - // use just "." but that is not supported by Ninja < 1.7. - std::string tgtDir; - tgtDir += this->LocalGenerator->GetCurrentBinaryDirectory(); - tgtDir += "/"; - tgtDir += this->LocalGenerator->GetTargetDirectory(this->GeneratorTarget); - orderOnlyDeps.push_back(this->ConvertToNinjaPath(tgtDir)); + { + std::vector externalObjects; + this->GeneratorTarget->GetExternalObjects(externalObjects, config); + for (cmSourceFile const* sf : externalObjects) { + this->Objects.push_back(this->GetSourceFilePath(sf)); + } } { - cmNinjaDeps orderOnlyTarget; - orderOnlyTarget.push_back(this->OrderDependsTargetForTarget()); - this->GetGlobalGenerator()->WritePhonyBuild( - this->GetBuildFileStream(), - "Order-only phony target for " + this->GetTargetName(), orderOnlyTarget, - cmNinjaDeps(), cmNinjaDeps(), orderOnlyDeps); + cmNinjaDeps orderOnlyDeps; + this->GetLocalGenerator()->AppendTargetDepends( + this->GeneratorTarget, orderOnlyDeps, DependOnTargetOrdering); + + // Add order-only dependencies on other files associated with the target. + cmAppend(orderOnlyDeps, this->ExtraFiles); + + // Add order-only dependencies on custom command outputs. + for (cmCustomCommand const* cc : this->CustomCommands) { + cmCustomCommandGenerator ccg(*cc, this->GetConfigName(), + this->GetLocalGenerator()); + const std::vector& ccoutputs = ccg.GetOutputs(); + const std::vector& ccbyproducts = ccg.GetByproducts(); + std::transform(ccoutputs.begin(), ccoutputs.end(), + std::back_inserter(orderOnlyDeps), MapToNinjaPath()); + std::transform(ccbyproducts.begin(), ccbyproducts.end(), + std::back_inserter(orderOnlyDeps), MapToNinjaPath()); + } + + std::sort(orderOnlyDeps.begin(), orderOnlyDeps.end()); + orderOnlyDeps.erase( + std::unique(orderOnlyDeps.begin(), orderOnlyDeps.end()), + orderOnlyDeps.end()); + + // The phony target must depend on at least one input or ninja will explain + // that "output ... of phony edge with no inputs doesn't exist" and + // consider the phony output "dirty". + if (orderOnlyDeps.empty()) { + // Any path that always exists will work here. It would be nice to + // use just "." but that is not supported by Ninja < 1.7. + std::string tgtDir; + tgtDir += this->LocalGenerator->GetCurrentBinaryDirectory(); + tgtDir += "/"; + tgtDir += + this->LocalGenerator->GetTargetDirectory(this->GeneratorTarget); + orderOnlyDeps.push_back(this->ConvertToNinjaPath(tgtDir)); + } + + { + cmNinjaDeps orderOnlyTarget; + orderOnlyTarget.push_back(this->OrderDependsTargetForTarget()); + this->GetGlobalGenerator()->WritePhonyBuild( + this->GetBuildFileStream(), + "Order-only phony target for " + this->GetTargetName(), + orderOnlyTarget, cmNinjaDeps(), cmNinjaDeps(), orderOnlyDeps); + } } - std::vector objectSources; - this->GeneratorTarget->GetObjectSources(objectSources, config); - for (cmSourceFile const* sf : objectSources) { - this->WriteObjectBuildStatement(sf); + + { + std::vector objectSources; + this->GeneratorTarget->GetObjectSources(objectSources, config); + for (cmSourceFile const* sf : objectSources) { + this->WriteObjectBuildStatement(sf); + } } for (auto const& langDDIFiles : this->DDIFiles) { https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=846b4b1062cc83b420ad1405fd74186c33bb1513 commit 846b4b1062cc83b420ad1405fd74186c33bb1513 Author: Sebastian Holtermann AuthorDate: Thu May 30 16:56:22 2019 +0200 Commit: Sebastian Holtermann CommitDate: Thu May 30 18:21:36 2019 +0200 Ninja: Make WriteCustomCommandBuild method use cmNinjaBuild internally diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 94c7659..ef06ebe 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -259,40 +259,47 @@ void cmGlobalNinjaGenerator::WriteCustomCommandBuild( const std::string& command, const std::string& description, const std::string& comment, const std::string& depfile, const std::string& job_pool, bool uses_terminal, bool restat, - const cmNinjaDeps& outputs, const cmNinjaDeps& deps, - const cmNinjaDeps& orderOnly) + const cmNinjaDeps& outputs, const cmNinjaDeps& explicitDeps, + const cmNinjaDeps& orderOnlyDeps) { - std::string cmd = command; // NOLINT(*) -#ifdef _WIN32 - if (cmd.empty()) - // TODO Shouldn't an empty command be handled by ninja? - cmd = "cmd.exe /c"; -#endif - this->AddCustomCommandRule(); - cmNinjaVars vars; - vars["COMMAND"] = cmd; - vars["DESC"] = EncodeLiteral(description); - if (restat) { - vars["restat"] = "1"; - } - if (uses_terminal && SupportsConsolePool()) { - vars["pool"] = "console"; - } else if (!job_pool.empty()) { - vars["pool"] = job_pool; - } - if (!depfile.empty()) { - vars["depfile"] = depfile; + { + cmNinjaBuild build("CUSTOM_COMMAND"); + build.Comment = comment; + build.Outputs = outputs; + build.ExplicitDeps = explicitDeps; + build.OrderOnlyDeps = orderOnlyDeps; + + cmNinjaVars& vars = build.Variables; + { + std::string cmd = command; // NOLINT(*) +#ifdef _WIN32 + if (cmd.empty()) + // TODO Shouldn't an empty command be handled by ninja? + cmd = "cmd.exe /c"; +#endif + vars["COMMAND"] = std::move(cmd); + } + vars["DESC"] = EncodeLiteral(description); + if (restat) { + vars["restat"] = "1"; + } + if (uses_terminal && SupportsConsolePool()) { + vars["pool"] = "console"; + } else if (!job_pool.empty()) { + vars["pool"] = job_pool; + } + if (!depfile.empty()) { + vars["depfile"] = depfile; + } + this->WriteBuild(*this->BuildFileStream, build); } - this->WriteBuild(*this->BuildFileStream, comment, "CUSTOM_COMMAND", outputs, - /*implicitOuts=*/cmNinjaDeps(), deps, cmNinjaDeps(), - orderOnly, vars); if (this->ComputingUnknownDependencies) { // we need to track every dependency that comes in, since we are trying // to find dependencies that are side effects of build commands - for (std::string const& dep : deps) { + for (std::string const& dep : explicitDeps) { this->CombinedCustomCommandExplicitDependencies.insert(dep); } } diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h index 7b62e38..ffd00b5 100644 --- a/Source/cmGlobalNinjaGenerator.h +++ b/Source/cmGlobalNinjaGenerator.h @@ -133,14 +133,13 @@ public: const cmNinjaDeps& orderOnlyDeps = cmNinjaDeps(), const cmNinjaVars& variables = cmNinjaVars()); - void WriteCustomCommandBuild(const std::string& command, - const std::string& description, - const std::string& comment, - const std::string& depfile, - const std::string& pool, bool uses_terminal, - bool restat, const cmNinjaDeps& outputs, - const cmNinjaDeps& deps = cmNinjaDeps(), - const cmNinjaDeps& orderOnly = cmNinjaDeps()); + void WriteCustomCommandBuild( + const std::string& command, const std::string& description, + const std::string& comment, const std::string& depfile, + const std::string& pool, bool uses_terminal, bool restat, + const cmNinjaDeps& outputs, + const cmNinjaDeps& explicitDeps = cmNinjaDeps(), + const cmNinjaDeps& orderOnlyDeps = cmNinjaDeps()); void WriteMacOSXContentBuild(std::string input, std::string output); https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8a46a07c8bd2fddde5e4db797279e21a5575e213 commit 8a46a07c8bd2fddde5e4db797279e21a5575e213 Author: Sebastian Holtermann AuthorDate: Thu May 30 11:20:20 2019 +0200 Commit: Sebastian Holtermann CommitDate: Thu May 30 16:44:30 2019 +0200 Ninja: Make WriteMacOSXContentBuild use cmNinjaBuild internally diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index c362dc6..94c7659 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -307,20 +307,16 @@ void cmGlobalNinjaGenerator::AddMacOSXContentRule() this->AddRule(rule); } -void cmGlobalNinjaGenerator::WriteMacOSXContentBuild(const std::string& input, - const std::string& output) +void cmGlobalNinjaGenerator::WriteMacOSXContentBuild(std::string input, + std::string output) { this->AddMacOSXContentRule(); - - cmNinjaDeps outputs; - outputs.push_back(output); - cmNinjaDeps deps; - deps.push_back(input); - cmNinjaVars vars; - - this->WriteBuild(*this->BuildFileStream, "", "COPY_OSX_CONTENT", outputs, - /*implicitOuts=*/cmNinjaDeps(), deps, cmNinjaDeps(), - cmNinjaDeps(), cmNinjaVars()); + { + cmNinjaBuild build("COPY_OSX_CONTENT"); + build.Outputs.push_back(std::move(output)); + build.ExplicitDeps.push_back(std::move(input)); + this->WriteBuild(*this->BuildFileStream, build); + } } void cmGlobalNinjaGenerator::WriteRule(std::ostream& os, diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h index 037c20e..7b62e38 100644 --- a/Source/cmGlobalNinjaGenerator.h +++ b/Source/cmGlobalNinjaGenerator.h @@ -141,8 +141,8 @@ public: bool restat, const cmNinjaDeps& outputs, const cmNinjaDeps& deps = cmNinjaDeps(), const cmNinjaDeps& orderOnly = cmNinjaDeps()); - void WriteMacOSXContentBuild(const std::string& input, - const std::string& output); + + void WriteMacOSXContentBuild(std::string input, std::string output); /** * Write a rule statement to @a os. https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=15c644437ae355ac196cfcfe1e874d8280451b43 commit 15c644437ae355ac196cfcfe1e874d8280451b43 Author: Sebastian Holtermann AuthorDate: Thu May 30 11:15:07 2019 +0200 Commit: Sebastian Holtermann CommitDate: Thu May 30 16:44:30 2019 +0200 Ninja: Add cmNinjaBuild based WriteBuild (wrapper) method diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 3fce29e..c362dc6 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -226,6 +226,16 @@ void cmGlobalNinjaGenerator::WriteBuild( os << buildstr << arguments << assignments; } +void cmGlobalNinjaGenerator::WriteBuild(std::ostream& os, + cmNinjaBuild const& build, + int cmdLineLimit, + bool* usedResponseFile) +{ + WriteBuild(os, build.Comment, build.Rule, build.Outputs, build.ImplicitOuts, + build.ExplicitDeps, build.ImplicitDeps, build.OrderOnlyDeps, + build.Variables, build.RspFile, cmdLineLimit, usedResponseFile); +} + void cmGlobalNinjaGenerator::WritePhonyBuild( std::ostream& os, const std::string& comment, const cmNinjaDeps& outputs, const cmNinjaDeps& explicitDeps, const cmNinjaDeps& implicitDeps, diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h index dcc358b..037c20e 100644 --- a/Source/cmGlobalNinjaGenerator.h +++ b/Source/cmGlobalNinjaGenerator.h @@ -117,6 +117,13 @@ public: int cmdLineLimit = 0, bool* usedResponseFile = nullptr); /** + * Write a build statement @a build to @a os. + * @warning no escaping of any kind is done here. + */ + void WriteBuild(std::ostream& os, cmNinjaBuild const& build, + int cmdLineLimit = 0, bool* usedResponseFile = nullptr); + + /** * Helper to write a build statement with the special 'phony' rule. */ void WritePhonyBuild(std::ostream& os, const std::string& comment, https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1b16d7656733a89d1d9735cf31654824b76aab9b commit 1b16d7656733a89d1d9735cf31654824b76aab9b Author: Sebastian Holtermann AuthorDate: Thu May 30 11:08:56 2019 +0200 Commit: Sebastian Holtermann CommitDate: Thu May 30 16:44:30 2019 +0200 Ninja: Add cmNinjaBuild utility class diff --git a/Source/cmNinjaTypes.h b/Source/cmNinjaTypes.h index 78f3917..52c05b6 100644 --- a/Source/cmNinjaTypes.h +++ b/Source/cmNinjaTypes.h @@ -41,4 +41,24 @@ public: bool Generator = false; }; +class cmNinjaBuild +{ +public: + cmNinjaBuild() = default; + cmNinjaBuild(std::string rule) + : Rule(std::move(rule)) + { + } + + std::string Comment; + std::string Rule; + cmNinjaDeps Outputs; + cmNinjaDeps ImplicitOuts; + cmNinjaDeps ExplicitDeps; + cmNinjaDeps ImplicitDeps; + cmNinjaDeps OrderOnlyDeps; + cmNinjaVars Variables; + std::string RspFile; +}; + #endif // ! cmNinjaTypes_h ----------------------------------------------------------------------- Summary of changes: Source/cmGlobalNinjaGenerator.cxx | 508 +++++++++++++++---------------- Source/cmGlobalNinjaGenerator.h | 42 +-- Source/cmLocalNinjaGenerator.cxx | 32 +- Source/cmNinjaNormalTargetGenerator.cxx | 243 +++++++-------- Source/cmNinjaTargetGenerator.cxx | 274 ++++++++--------- Source/cmNinjaTypes.h | 20 ++ Source/cmNinjaUtilityTargetGenerator.cxx | 134 ++++---- 7 files changed, 610 insertions(+), 643 deletions(-) hooks/post-receive -- CMake From kwrobot at kitware.com Tue Jun 4 00:03:04 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Tue, 4 Jun 2019 00:03:04 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.14.5-1218-g99496f5 Message-ID: <20190604040304.E7F1D11CD6A@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 99496f57769a45fb664f6865bd6935d37fe45467 (commit) from 73472408c501e66c9dd8c027293b8c0907001b42 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=99496f57769a45fb664f6865bd6935d37fe45467 commit 99496f57769a45fb664f6865bd6935d37fe45467 Author: Kitware Robot AuthorDate: Tue Jun 4 00:01:06 2019 -0400 Commit: Kitware Robot CommitDate: Tue Jun 4 00:01:06 2019 -0400 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 29543b8..aeccf8e 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 14) -set(CMake_VERSION_PATCH 20190603) +set(CMake_VERSION_PATCH 20190604) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From kwrobot at kitware.com Tue Jun 4 08:33:06 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Tue, 4 Jun 2019 08:33:06 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.14.5-1232-g4b68baa Message-ID: <20190604123306.CD79DFCCBB@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 4b68baa776bf8ccc2911057fc79b558515438900 (commit) via d4108f5585ae4e0ab79c9b192f9d6a0614f868cd (commit) via 99b9b01c020a0b20c0eefa73a39138471c01a053 (commit) via e591e22d4c7d2b4d4806cf47923e54269644b2a2 (commit) via 7561fcda0918abf71b7fb0cfe67dd70fafe577ae (commit) via f263650f95bdf87e2c50ada4a28d4fb729ac6f1c (commit) via fada8cbfd6ae13d15b015f667a85096b15dc07b1 (commit) via 162555d7ecd510a84fb26a2ebc90f0a3e9eabc1a (commit) via 808b8180632aef06e7a3644fb4d3957722abc3f3 (commit) via 9fd602bfd33479b1acecd40e5c1b76ce37d59798 (commit) via ec66af2026e085e7b648b222794f0f213183ea1e (commit) via 2d4787fc4ddc077e1d8fcb807768d1ecc7902a73 (commit) via 3475e2728bad16899b50131785a61f43083e8ba9 (commit) via 619416f8a30c99f87869559cf3829ce6d3431dca (commit) from 99496f57769a45fb664f6865bd6935d37fe45467 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4b68baa776bf8ccc2911057fc79b558515438900 commit 4b68baa776bf8ccc2911057fc79b558515438900 Merge: d4108f5 162555d Author: Brad King AuthorDate: Tue Jun 4 12:32:11 2019 +0000 Commit: Kitware Robot CommitDate: Tue Jun 4 08:32:19 2019 -0400 Merge topic 'compiler_id_gen_exp_supports_multiple_ids' 162555d7ec Help: Add release notes for updated generator expressions 808b818063 Genex: CompileLang and CompileLangAndId now match against a list of ids 9fd602bfd3 Genex: PlatformId now can match against a list of ids. ec66af2026 Genex: CompilerId now can match against a list of ids. 2d4787fc4d Genex: Add more extensive support for an unbounded number of parameters Acked-by: Kitware Robot Merge-request: !3405 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d4108f5585ae4e0ab79c9b192f9d6a0614f868cd commit d4108f5585ae4e0ab79c9b192f9d6a0614f868cd Merge: 99b9b01 fada8cb Author: Brad King AuthorDate: Tue Jun 4 12:30:18 2019 +0000 Commit: Kitware Robot CommitDate: Tue Jun 4 08:30:26 2019 -0400 Merge topic 'check_language_respects_cuda_host_compiler' fada8cbfd6 CheckLanguage: Report CMAKE_CUDA_HOST_COMPILER if needed for compilation Acked-by: Kitware Robot Merge-request: !3407 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=99b9b01c020a0b20c0eefa73a39138471c01a053 commit 99b9b01c020a0b20c0eefa73a39138471c01a053 Merge: e591e22 3475e27 Author: Brad King AuthorDate: Tue Jun 4 12:27:58 2019 +0000 Commit: Kitware Robot CommitDate: Tue Jun 4 08:28:09 2019 -0400 Merge topic 'print-correct-line-number' 3475e2728b cmListFileCache: When missing ending ) print starting line instead of last one Acked-by: Kitware Robot Merge-request: !3398 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e591e22d4c7d2b4d4806cf47923e54269644b2a2 commit e591e22d4c7d2b4d4806cf47923e54269644b2a2 Merge: 7561fcd 619416f Author: Brad King AuthorDate: Tue Jun 4 12:25:38 2019 +0000 Commit: Kitware Robot CommitDate: Tue Jun 4 08:25:47 2019 -0400 Merge topic 'better_error_message_for_visibility_preset_property' 619416f8a3 The error message for VISIBILITY_PRESET now documents valid options. Acked-by: Kitware Robot Merge-request: !3409 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7561fcda0918abf71b7fb0cfe67dd70fafe577ae commit 7561fcda0918abf71b7fb0cfe67dd70fafe577ae Merge: 99496f5 f263650 Author: Brad King AuthorDate: Tue Jun 4 12:24:18 2019 +0000 Commit: Kitware Robot CommitDate: Tue Jun 4 08:24:29 2019 -0400 Merge topic 'test-explicit-dirs' f263650f95 Tests: Fix RunCMake.CommandLine test to use generator in no-S-B case Acked-by: Kitware Robot Merge-request: !3414 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f263650f95bdf87e2c50ada4a28d4fb729ac6f1c commit f263650f95bdf87e2c50ada4a28d4fb729ac6f1c Author: Brad King AuthorDate: Mon Jun 3 14:57:19 2019 -0400 Commit: Brad King CommitDate: Mon Jun 3 14:57:19 2019 -0400 Tests: Fix RunCMake.CommandLine test to use generator in no-S-B case Apply the fix from commit baed22c4b0 (Tests: Fix RunCMake.CommandLine test to use generator with -S and -B, 2019-04-10) to the `no-S-B` case too. It also generates a build system and should use the generator being tested. diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake index cee996c..7798b62 100644 --- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake +++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake @@ -68,6 +68,9 @@ run_cmake_command(cache-empty-entry ${CMAKE_COMMAND} --build ${RunCMake_SOURCE_DIR}/cache-empty-entry/) function(run_ExplicitDirs) + set(RunCMake_TEST_NO_CLEAN 1) + set(RunCMake_TEST_NO_SOURCE_DIR 1) + set(source_dir ${RunCMake_BINARY_DIR}/ExplicitDirsMissing) file(REMOVE_RECURSE "${source_dir}") @@ -76,16 +79,15 @@ function(run_ExplicitDirs) cmake_minimum_required(VERSION 3.13) project(ExplicitDirsMissing LANGUAGES NONE) ]=]) - run_cmake_command(no-S-B ${CMAKE_COMMAND} -E chdir ${source_dir} - ${CMAKE_COMMAND} -DFOO=BAR) + set(RunCMake_TEST_SOURCE_DIR "${source_dir}") + set(RunCMake_TEST_BINARY_DIR "${source_dir}") + run_cmake_with_options(no-S-B -DFOO=BAR) set(source_dir ${RunCMake_SOURCE_DIR}/ExplicitDirs) set(binary_dir ${RunCMake_BINARY_DIR}/ExplicitDirs-build) set(RunCMake_TEST_SOURCE_DIR "${source_dir}") set(RunCMake_TEST_BINARY_DIR "${binary_dir}") - set(RunCMake_TEST_NO_CLEAN 1) - set(RunCMake_TEST_NO_SOURCE_DIR 1) file(REMOVE_RECURSE "${binary_dir}") run_cmake_with_options(S-arg -S ${source_dir} ${binary_dir}) https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fada8cbfd6ae13d15b015f667a85096b15dc07b1 commit fada8cbfd6ae13d15b015f667a85096b15dc07b1 Author: Robert Maynard AuthorDate: Fri May 31 08:39:16 2019 -0400 Commit: Brad King CommitDate: Mon Jun 3 10:36:06 2019 -0400 CheckLanguage: Report CMAKE_CUDA_HOST_COMPILER if needed for compilation Fixes: #19013 diff --git a/Modules/CheckLanguage.cmake b/Modules/CheckLanguage.cmake index d096849..a1a3a7a 100644 --- a/Modules/CheckLanguage.cmake +++ b/Modules/CheckLanguage.cmake @@ -18,7 +18,9 @@ such as ``Fortran``. If :variable:`CMAKE__COMPILER` is already defined the check does nothing. Otherwise it tries enabling the language in a test project. The result is cached in :variable:`CMAKE__COMPILER` as the compiler that was found, or ``NOTFOUND`` if the language cannot be -enabled. +enabled. For CUDA which can have an explicit host compiler, the cache +:variable:`CMAKE_CUDA_HOST_COMPILER` variable will be set if it was required +for compilation. Example: @@ -39,13 +41,23 @@ macro(check_language lang) set(_desc "Looking for a ${lang} compiler") message(STATUS ${_desc}) file(REMOVE_RECURSE ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/Check${lang}) - file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/Check${lang}/CMakeLists.txt" + + set(extra_compiler_variables) + if(lang STREQUAL CUDA) + set(extra_compiler_variables "set(CMAKE_CUDA_HOST_COMPILER \\\"\${CMAKE_CUDA_HOST_COMPILER}\\\")") + endif() + + set(content "cmake_minimum_required(VERSION ${CMAKE_VERSION}) project(Check${lang} ${lang}) file(WRITE \"\${CMAKE_CURRENT_BINARY_DIR}/result.cmake\" \"set(CMAKE_${lang}_COMPILER \\\"\${CMAKE_${lang}_COMPILER}\\\")\\n\" - ) -") + \"${extra_compiler_variables}\\n\" + )" + ) + + file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/Check${lang}/CMakeLists.txt" + "${content}") if(CMAKE_GENERATOR_INSTANCE) set(_D_CMAKE_GENERATOR_INSTANCE "-DCMAKE_GENERATOR_INSTANCE:INTERNAL=${CMAKE_GENERATOR_INSTANCE}") else() @@ -75,5 +87,12 @@ file(WRITE \"\${CMAKE_CURRENT_BINARY_DIR}/result.cmake\" message(STATUS "${_desc} - ${CMAKE_${lang}_COMPILER}") set(CMAKE_${lang}_COMPILER "${CMAKE_${lang}_COMPILER}" CACHE FILEPATH "${lang} compiler") mark_as_advanced(CMAKE_${lang}_COMPILER) + + if(CMAKE_${lang}_HOST_COMPILER) + message(STATUS "Looking for a ${lang} host compiler - ${CMAKE_${lang}_HOST_COMPILER}") + set(CMAKE_${lang}_HOST_COMPILER "${CMAKE_${lang}_HOST_COMPILER}" CACHE FILEPATH "${lang} host compiler") + mark_as_advanced(CMAKE_${lang}_HOST_COMPILER) + endif() + endif() endmacro() diff --git a/Tests/CMakeOnly/CheckLanguage/CMakeLists.txt b/Tests/CMakeOnly/CheckLanguage/CMakeLists.txt index f5336dc..ca4becb 100644 --- a/Tests/CMakeOnly/CheckLanguage/CMakeLists.txt +++ b/Tests/CMakeOnly/CheckLanguage/CMakeLists.txt @@ -7,7 +7,8 @@ set(expect_C 1) set(expect_CXX 1) unset(expect_Fortran) set(expect_NoSuchLanguage 0) -foreach(lang C CXX Fortran NoSuchLanguage) + +foreach(lang C CXX Fortran CUDA NoSuchLanguage) check_language(${lang}) if(NOT DEFINED CMAKE_${lang}_COMPILER) message(FATAL_ERROR "check_language(${lang}) did not set result") https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=162555d7ecd510a84fb26a2ebc90f0a3e9eabc1a commit 162555d7ecd510a84fb26a2ebc90f0a3e9eabc1a Author: Robert Maynard AuthorDate: Thu May 30 16:46:22 2019 -0400 Commit: Brad King CommitDate: Mon Jun 3 10:23:49 2019 -0400 Help: Add release notes for updated generator expressions diff --git a/Help/release/dev/genex-comma-separated.rst b/Help/release/dev/genex-comma-separated.rst new file mode 100644 index 0000000..f27f781 --- /dev/null +++ b/Help/release/dev/genex-comma-separated.rst @@ -0,0 +1,8 @@ +genex-comma-separated +--------------------- + +* The :manual:`generator expressions ` + ``C_COMPILER_ID``, ``CXX_COMPILER_ID``, ``CUDA_COMPILER_ID``, + ``Fortran_COMPILER_ID``, ``COMPILE_LANGUAGE``, ``COMPILE_LANG_AND_ID``, and + ``PLATFORM_ID`` learned to support matching one value from a comma-separated + list. https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=808b8180632aef06e7a3644fb4d3957722abc3f3 commit 808b8180632aef06e7a3644fb4d3957722abc3f3 Author: Robert Maynard AuthorDate: Thu May 30 10:00:19 2019 -0400 Commit: Brad King CommitDate: Mon Jun 3 10:20:23 2019 -0400 Genex: CompileLang and CompileLangAndId now match against a list of ids This allows for expressions such as: $ diff --git a/Help/manual/cmake-generator-expressions.7.rst b/Help/manual/cmake-generator-expressions.7.rst index 1136151..c0449fb 100644 --- a/Help/manual/cmake-generator-expressions.7.rst +++ b/Help/manual/cmake-generator-expressions.7.rst @@ -164,20 +164,20 @@ Variable Queries .. _`Boolean COMPILE_LANGUAGE Generator Expression`: -``$`` +``$`` ``1`` when the language used for compilation unit matches ``language`` and - the CMake's compiler id of the language compiler matches ``compiler_id``, - otherwise ``0``. This expression is a short form for the combination of - ``$`` and ``$``. - This expression may be used to specify compile options, - compile definitions, and include directories for source files of a + the CMake's compiler id of the language compiler matches any one of the + entries in ``compiler_ids``, otherwise ``0``. This expression is a short form + for the combination of ``$`` and + ``$``. This expression may be used to specify + compile options, compile definitions, and include directories for source files of a particular language and compiler combination in a target. For example: .. code-block:: cmake add_executable(myapp main.cpp foo.c bar.cpp zot.cu) target_compile_definitions(myapp - PRIVATE $<$:COMPILING_CXX_WITH_CLANG> + PRIVATE $<$:COMPILING_CXX_WITH_CLANG> $<$:COMPILING_CXX_WITH_INTEL> $<$:COMPILING_C_WITH_CLANG> ) @@ -200,10 +200,10 @@ Variable Queries $<$,$>:COMPILING_C_WITH_CLANG> ) -``$`` - ``1`` when the language used for compilation unit matches ``language``, - otherwise ``0``. This expression may be used to specify compile options, - compile definitions, and include directories for source files of a +``$`` + ``1`` when the language used for compilation unit matches any of the entries + in ``languages``, otherwise ``0``. This expression may be used to specify + compile options, compile definitions, and include directories for source files of a particular language in a target. For example: .. code-block:: cmake @@ -217,7 +217,7 @@ Variable Queries $<$:COMPILING_CUDA> ) target_include_directories(myapp - PRIVATE $<$:/opt/foo/cxx_headers> + PRIVATE $<$:/opt/foo/headers> ) This specifies the use of the ``-fno-exceptions`` compile option, diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx index 4744309..a60c75c 100644 --- a/Source/cmGeneratorExpressionNode.cxx +++ b/Source/cmGeneratorExpressionNode.cxx @@ -951,7 +951,7 @@ static const struct CompileLanguageNode : public cmGeneratorExpressionNode { CompileLanguageNode() {} // NOLINT(modernize-use-equals-default) - int NumExpectedParameters() const override { return OneOrZeroParameters; } + int NumExpectedParameters() const override { return ZeroOrMoreParameters; } std::string Evaluate( const std::vector& parameters, @@ -982,7 +982,13 @@ static const struct CompileLanguageNode : public cmGeneratorExpressionNode if (parameters.empty()) { return context->Language; } - return context->Language == parameters.front() ? "1" : "0"; + + for (auto& param : parameters) { + if (context->Language == param) { + return "1"; + } + } + return "0"; } } languageNode; @@ -990,7 +996,7 @@ static const struct CompileLanguageAndIdNode : public cmGeneratorExpressionNode { CompileLanguageAndIdNode() {} // NOLINT(modernize-use-equals-default) - int NumExpectedParameters() const override { return 2; } + int NumExpectedParameters() const override { return TwoOrMoreParameters; } std::string Evaluate( const std::vector& parameters, @@ -1023,7 +1029,8 @@ static const struct CompileLanguageAndIdNode : public cmGeneratorExpressionNode const std::string& lang = context->Language; if (lang == parameters.front()) { - std::vector idParameter = { parameters[1] }; + std::vector idParameter((parameters.cbegin() + 1), + parameters.cend()); return CompilerIdNode{ lang.c_str() }.EvaluateWithLanguage( idParameter, context, content, dagChecker, lang); } diff --git a/Tests/CMakeCommands/target_compile_definitions/CMakeLists.txt b/Tests/CMakeCommands/target_compile_definitions/CMakeLists.txt index 7dc7995..a5bc1e1 100644 --- a/Tests/CMakeCommands/target_compile_definitions/CMakeLists.txt +++ b/Tests/CMakeCommands/target_compile_definitions/CMakeLists.txt @@ -34,6 +34,7 @@ target_compile_definitions(consumer CONSUMER_LANG_$ LANG_IS_CXX=$ LANG_IS_C=$ + LANG_IS_C_OR_CXX=$ ) if(CMAKE_GENERATOR MATCHES "Visual Studio|Xcode") target_compile_definitions(consumer diff --git a/Tests/CMakeCommands/target_compile_definitions/consumer.c b/Tests/CMakeCommands/target_compile_definitions/consumer.c index bacd4c4..bb65e01 100644 --- a/Tests/CMakeCommands/target_compile_definitions/consumer.c +++ b/Tests/CMakeCommands/target_compile_definitions/consumer.c @@ -35,6 +35,10 @@ # endif #endif +#if !LANG_IS_C_OR_CXX +# error Expected LANG_IS_C_OR_CXX +#endif + void consumer_c() { } diff --git a/Tests/CMakeCommands/target_compile_options/CMakeLists.txt b/Tests/CMakeCommands/target_compile_options/CMakeLists.txt index ee187f5..a7055b1 100644 --- a/Tests/CMakeCommands/target_compile_options/CMakeLists.txt +++ b/Tests/CMakeCommands/target_compile_options/CMakeLists.txt @@ -9,6 +9,7 @@ add_executable(target_compile_options target_compile_options(target_compile_options PRIVATE $<$:-DMY_PRIVATE_DEFINE> PUBLIC $<$:-DMY_PUBLIC_DEFINE> + PUBLIC $<$:-DMY_MUTLI_COMP_PUBLIC_DEFINE> INTERFACE $<$:-DMY_INTERFACE_DEFINE> INTERFACE $<$:-DMY_MULTI_COMP_INTERFACE_DEFINE> ) diff --git a/Tests/CMakeCommands/target_compile_options/consumer.cpp b/Tests/CMakeCommands/target_compile_options/consumer.cpp index 5cbe049..78928b4 100644 --- a/Tests/CMakeCommands/target_compile_options/consumer.cpp +++ b/Tests/CMakeCommands/target_compile_options/consumer.cpp @@ -17,6 +17,10 @@ # error Expected MY_MULTI_COMP_INTERFACE_DEFINE # endif +# ifndef MY_MUTLI_COMP_PUBLIC_DEFINE +# error Expected MY_MUTLI_COMP_PUBLIC_DEFINE +# endif + #endif #ifdef DO_CLANG_TESTS @@ -29,6 +33,10 @@ # error Expected MY_MULTI_COMP_INTERFACE_DEFINE # endif +# ifndef MY_MUTLI_COMP_PUBLIC_DEFINE +# error Expected MY_MUTLI_COMP_PUBLIC_DEFINE +# endif + #endif #ifndef CONSUMER_LANG_CXX diff --git a/Tests/CMakeCommands/target_compile_options/main.cpp b/Tests/CMakeCommands/target_compile_options/main.cpp index edefdf2..7608400 100644 --- a/Tests/CMakeCommands/target_compile_options/main.cpp +++ b/Tests/CMakeCommands/target_compile_options/main.cpp @@ -9,6 +9,10 @@ # error Expected MY_PUBLIC_DEFINE # endif +# ifndef MY_MUTLI_COMP_PUBLIC_DEFINE +# error Expected MY_MUTLI_COMP_PUBLIC_DEFINE +# endif + # ifdef MY_INTERFACE_DEFINE # error Unexpected MY_INTERFACE_DEFINE # endif @@ -25,6 +29,10 @@ # error Unexpected MY_PUBLIC_DEFINE # endif +# ifndef MY_MUTLI_COMP_PUBLIC_DEFINE +# error Expected MY_MUTLI_COMP_PUBLIC_DEFINE +# endif + #endif int main() diff --git a/Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-add_custom_command-stderr.txt b/Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-add_custom_command-stderr.txt index fc3c3de..2ee96ed 100644 --- a/Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-add_custom_command-stderr.txt +++ b/Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-add_custom_command-stderr.txt @@ -3,7 +3,6 @@ CMake Error at COMPILE_LANG_AND_ID-add_custom_command.cmake:2 \(add_custom_comma \$ - \$ expression requires 2 comma separated parameters, - but got 0 instead. + \$ expression requires at least two parameters. Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-target_sources-stderr.txt b/Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-target_sources-stderr.txt index 44d8684..3ecbdc3 100644 --- a/Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-target_sources-stderr.txt +++ b/Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-target_sources-stderr.txt @@ -3,7 +3,6 @@ CMake Error at COMPILE_LANG_AND_ID-target_sources.cmake:2 \(target_sources\): \$ - \$ expression requires 2 comma separated parameters, - but got 0 instead. + \$ expression requires at least two parameters. Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9fd602bfd33479b1acecd40e5c1b76ce37d59798 commit 9fd602bfd33479b1acecd40e5c1b76ce37d59798 Author: Robert Maynard AuthorDate: Wed May 29 14:55:45 2019 -0400 Commit: Brad King CommitDate: Mon Jun 3 10:20:23 2019 -0400 Genex: PlatformId now can match against a list of ids. diff --git a/Help/manual/cmake-generator-expressions.7.rst b/Help/manual/cmake-generator-expressions.7.rst index c03e701..1136151 100644 --- a/Help/manual/cmake-generator-expressions.7.rst +++ b/Help/manual/cmake-generator-expressions.7.rst @@ -110,9 +110,10 @@ Variable Queries The mapping in :prop_tgt:`MAP_IMPORTED_CONFIG_` is also considered by this expression when it is evaluated on a property on an :prop_tgt:`IMPORTED` target. -``$`` - ``1`` if the CMake's platform id matches ``platform_id`` - otherwise ``0``. +``$`` + where ``platform_ids`` is a comma-separated list. + ``1`` if the CMake's platform id matches any one of the entries in + ``platform_ids``, otherwise ``0``. See also the :variable:`CMAKE_SYSTEM_NAME` variable. ``$`` where ``compiler_ids`` is a comma-separated list. diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx index 7fcd3f3..4744309 100644 --- a/Source/cmGeneratorExpressionNode.cxx +++ b/Source/cmGeneratorExpressionNode.cxx @@ -776,7 +776,7 @@ struct PlatformIdNode : public cmGeneratorExpressionNode { PlatformIdNode() {} // NOLINT(modernize-use-equals-default) - int NumExpectedParameters() const override { return OneOrZeroParameters; } + int NumExpectedParameters() const override { return ZeroOrMoreParameters; } std::string Evaluate( const std::vector& parameters, @@ -794,8 +794,10 @@ struct PlatformIdNode : public cmGeneratorExpressionNode return parameters.front().empty() ? "1" : "0"; } - if (parameters.front() == platformId) { - return "1"; + for (auto& param : parameters) { + if (param == platformId) { + return "1"; + } } return "0"; } diff --git a/Tests/GeneratorExpression/CMakeLists.txt b/Tests/GeneratorExpression/CMakeLists.txt index 5ba0dc0..3ff2b85 100644 --- a/Tests/GeneratorExpression/CMakeLists.txt +++ b/Tests/GeneratorExpression/CMakeLists.txt @@ -220,6 +220,7 @@ add_custom_target(check-part3 ALL -Dtest_early_termination_2=$<$<1:>:, -Dsystem_name=${CMAKE_HOST_SYSTEM_NAME} -Dtest_platform_id=$ + -Dtest_platform_id_supported=$ -Dtest_platform_id_Linux=$ -Dtest_platform_id_Windows=$ -Dtest_platform_id_Darwin=$ diff --git a/Tests/GeneratorExpression/check-part3.cmake b/Tests/GeneratorExpression/check-part3.cmake index 9014406..4fb7308 100644 --- a/Tests/GeneratorExpression/check-part3.cmake +++ b/Tests/GeneratorExpression/check-part3.cmake @@ -28,11 +28,16 @@ check(test_early_termination_2 "$<:,") check(test_platform_id "${system_name}") foreach(system Linux Windows Darwin) if(system_name STREQUAL system) + check(test_platform_id_supported 1) check(test_platform_id_${system} 1) + set(platform_supported 1) else() check(test_platform_id_${system} 0) endif() endforeach() +if(NOT platform_supported) + check(test_platform_id_supported 0) +endif() check(lower_case "mi,xed") check(upper_case "MIX,ED") check(make_c_identifier "_4f_oo__bar__") https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ec66af2026e085e7b648b222794f0f213183ea1e commit ec66af2026e085e7b648b222794f0f213183ea1e Author: Robert Maynard AuthorDate: Wed May 29 14:55:18 2019 -0400 Commit: Brad King CommitDate: Mon Jun 3 10:20:23 2019 -0400 Genex: CompilerId now can match against a list of ids. This allows for expressions like: $<$:-DMY_PRIVATE_DEFINE> diff --git a/Help/manual/cmake-generator-expressions.7.rst b/Help/manual/cmake-generator-expressions.7.rst index f2e6597..c03e701 100644 --- a/Help/manual/cmake-generator-expressions.7.rst +++ b/Help/manual/cmake-generator-expressions.7.rst @@ -114,20 +114,25 @@ Variable Queries ``1`` if the CMake's platform id matches ``platform_id`` otherwise ``0``. See also the :variable:`CMAKE_SYSTEM_NAME` variable. -``$`` - ``1`` if the CMake's compiler id of the C compiler matches ``compiler_id``, - otherwise ``0``. +``$`` + where ``compiler_ids`` is a comma-separated list. + ``1`` if the CMake's compiler id of the C compiler matches any one + of the entries in ``compiler_ids``, otherwise ``0``. See also the :variable:`CMAKE__COMPILER_ID` variable. -``$`` - ``1`` if the CMake's compiler id of the CXX compiler matches ``compiler_id``, - otherwise ``0``. -``$`` - ``1`` if the CMake's compiler id of the CUDA compiler matches ``compiler_id``, - otherwise ``0``. +``$`` + where ``compiler_ids`` is a comma-separated list. + ``1`` if the CMake's compiler id of the CXX compiler matches any one + of the entries in ``compiler_ids``, otherwise ``0``. See also the :variable:`CMAKE__COMPILER_ID` variable. -``$`` - ``1`` if the CMake's compiler id of the Fortran compiler matches ``compiler_id``, - otherwise ``0``. +``$`` + where ``compiler_ids`` is a comma-separated list. + ``1`` if the CMake's compiler id of the CUDA compiler matches any one + of the entries in ``compiler_ids``, otherwise ``0``. + See also the :variable:`CMAKE__COMPILER_ID` variable. +``$`` + where ``compiler_ids`` is a comma-separated list. + ``1`` if the CMake's compiler id of the Fortran compiler matches any one + of the entries in ``compiler_ids``, otherwise ``0``. See also the :variable:`CMAKE__COMPILER_ID` variable. ``$`` ``1`` if the version of the C compiler matches ``version``, otherwise ``0``. diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx index 68ef170..7fcd3f3 100644 --- a/Source/cmGeneratorExpressionNode.cxx +++ b/Source/cmGeneratorExpressionNode.cxx @@ -632,7 +632,7 @@ struct CompilerIdNode : public cmGeneratorExpressionNode { } - int NumExpectedParameters() const override { return OneOrZeroParameters; } + int NumExpectedParameters() const override { return ZeroOrMoreParameters; } std::string Evaluate( const std::vector& parameters, @@ -664,36 +664,39 @@ struct CompilerIdNode : public cmGeneratorExpressionNode if (parameters.empty()) { return compilerId; } - static cmsys::RegularExpression compilerIdValidator("^[A-Za-z0-9_]*$"); - if (!compilerIdValidator.find(parameters.front())) { - reportError(context, content->GetOriginalExpression(), - "Expression syntax not recognized."); - return std::string(); - } if (compilerId.empty()) { return parameters.front().empty() ? "1" : "0"; } + static cmsys::RegularExpression compilerIdValidator("^[A-Za-z0-9_]*$"); - if (strcmp(parameters.front().c_str(), compilerId.c_str()) == 0) { - return "1"; - } + for (auto& param : parameters) { - if (cmsysString_strcasecmp(parameters.front().c_str(), - compilerId.c_str()) == 0) { - switch (context->LG->GetPolicyStatus(cmPolicies::CMP0044)) { - case cmPolicies::WARN: { - std::ostringstream e; - e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0044); - context->LG->GetCMakeInstance()->IssueMessage( - MessageType::AUTHOR_WARNING, e.str(), context->Backtrace); - CM_FALLTHROUGH; + if (!compilerIdValidator.find(param)) { + reportError(context, content->GetOriginalExpression(), + "Expression syntax not recognized."); + return std::string(); + } + + if (strcmp(param.c_str(), compilerId.c_str()) == 0) { + return "1"; + } + + if (cmsysString_strcasecmp(param.c_str(), compilerId.c_str()) == 0) { + switch (context->LG->GetPolicyStatus(cmPolicies::CMP0044)) { + case cmPolicies::WARN: { + std::ostringstream e; + e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0044); + context->LG->GetCMakeInstance()->IssueMessage( + MessageType::AUTHOR_WARNING, e.str(), context->Backtrace); + CM_FALLTHROUGH; + } + case cmPolicies::OLD: + return "1"; + case cmPolicies::NEW: + case cmPolicies::REQUIRED_ALWAYS: + case cmPolicies::REQUIRED_IF_USED: + break; } - case cmPolicies::OLD: - return "1"; - case cmPolicies::NEW: - case cmPolicies::REQUIRED_ALWAYS: - case cmPolicies::REQUIRED_IF_USED: - break; } } return "0"; diff --git a/Tests/CMakeCommands/target_compile_options/CMakeLists.txt b/Tests/CMakeCommands/target_compile_options/CMakeLists.txt index a24cd53..ee187f5 100644 --- a/Tests/CMakeCommands/target_compile_options/CMakeLists.txt +++ b/Tests/CMakeCommands/target_compile_options/CMakeLists.txt @@ -7,9 +7,10 @@ add_executable(target_compile_options "${CMAKE_CURRENT_SOURCE_DIR}/main.cpp" ) target_compile_options(target_compile_options - PRIVATE $<$:-DMY_PRIVATE_DEFINE> + PRIVATE $<$:-DMY_PRIVATE_DEFINE> PUBLIC $<$:-DMY_PUBLIC_DEFINE> INTERFACE $<$:-DMY_INTERFACE_DEFINE> + INTERFACE $<$:-DMY_MULTI_COMP_INTERFACE_DEFINE> ) if(CMAKE_CXX_COMPILER_ID MATCHES "GNU") @@ -17,6 +18,11 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU") PRIVATE "DO_GNU_TESTS" ) +elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + target_compile_definitions(target_compile_options + PRIVATE + "DO_CLANG_TESTS" + ) endif() add_executable(consumer @@ -40,7 +46,7 @@ if(CMAKE_GENERATOR MATCHES "Visual Studio") endif() target_compile_options(consumer - PRIVATE $<$:$> + PRIVATE $<$:$> ) if(CMAKE_CXX_COMPILER_ID MATCHES "GNU") @@ -48,6 +54,11 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU") PRIVATE "DO_GNU_TESTS" ) +elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + target_compile_definitions(consumer + PRIVATE + "DO_CLANG_TESTS" + ) endif() # Test no items diff --git a/Tests/CMakeCommands/target_compile_options/consumer.cpp b/Tests/CMakeCommands/target_compile_options/consumer.cpp index fe79eb5..5cbe049 100644 --- a/Tests/CMakeCommands/target_compile_options/consumer.cpp +++ b/Tests/CMakeCommands/target_compile_options/consumer.cpp @@ -13,6 +13,22 @@ # error Expected MY_INTERFACE_DEFINE # endif +# ifndef MY_MULTI_COMP_INTERFACE_DEFINE +# error Expected MY_MULTI_COMP_INTERFACE_DEFINE +# endif + +#endif + +#ifdef DO_CLANG_TESTS + +# ifdef MY_PRIVATE_DEFINE +# error Unexpected MY_PRIVATE_DEFINE +# endif + +# ifndef MY_MULTI_COMP_INTERFACE_DEFINE +# error Expected MY_MULTI_COMP_INTERFACE_DEFINE +# endif + #endif #ifndef CONSUMER_LANG_CXX diff --git a/Tests/CMakeCommands/target_compile_options/main.cpp b/Tests/CMakeCommands/target_compile_options/main.cpp index 829a25e..edefdf2 100644 --- a/Tests/CMakeCommands/target_compile_options/main.cpp +++ b/Tests/CMakeCommands/target_compile_options/main.cpp @@ -15,6 +15,18 @@ #endif +#ifdef DO_CLANG_TESTS + +# ifndef MY_PRIVATE_DEFINE +# error Expected MY_PRIVATE_DEFINE +# endif + +# ifdef MY_PUBLIC_DEFINE +# error Unexpected MY_PUBLIC_DEFINE +# endif + +#endif + int main() { return 0; diff --git a/Tests/RunCMake/PolicyScope/dir1/CMakeLists.txt b/Tests/RunCMake/PolicyScope/dir1/CMakeLists.txt index 16bcb36..66ff016 100644 --- a/Tests/RunCMake/PolicyScope/dir1/CMakeLists.txt +++ b/Tests/RunCMake/PolicyScope/dir1/CMakeLists.txt @@ -2,4 +2,4 @@ add_library(foo STATIC foo.cpp) string(TOLOWER ${CMAKE_CXX_COMPILER_ID} compiler_id) -target_compile_definitions(foo PRIVATE Foo=$) +target_compile_definitions(foo PRIVATE Foo=$) https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2d4787fc4ddc077e1d8fcb807768d1ecc7902a73 commit 2d4787fc4ddc077e1d8fcb807768d1ecc7902a73 Author: Robert Maynard AuthorDate: Wed May 29 14:49:36 2019 -0400 Commit: Brad King CommitDate: Mon Jun 3 10:20:22 2019 -0400 Genex: Add more extensive support for an unbounded number of parameters Previously genex support for unbounded number of parameters required at least 1 parameter. We now support zero or more parameters, and two or more parameters. diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx index 268de6f..7442018 100644 --- a/Source/cmGeneratorExpressionEvaluator.cxx +++ b/Source/cmGeneratorExpressionEvaluator.cxx @@ -166,9 +166,13 @@ std::string GeneratorExpressionContent::EvaluateParameters( reportError(context, this->GetOriginalExpression(), "$<" + identifier + "> expression requires at least one parameter."); - } - if (numExpected == cmGeneratorExpressionNode::OneOrZeroParameters && - parameters.size() > 1) { + } else if (numExpected == cmGeneratorExpressionNode::TwoOrMoreParameters && + parameters.size() < 2) { + reportError(context, this->GetOriginalExpression(), + "$<" + identifier + + "> expression requires at least two parameters."); + } else if (numExpected == cmGeneratorExpressionNode::OneOrZeroParameters && + parameters.size() > 1) { reportError(context, this->GetOriginalExpression(), "$<" + identifier + "> expression requires one or zero parameters."); diff --git a/Source/cmGeneratorExpressionNode.h b/Source/cmGeneratorExpressionNode.h index 3dbfc6e..7a36924 100644 --- a/Source/cmGeneratorExpressionNode.h +++ b/Source/cmGeneratorExpressionNode.h @@ -20,7 +20,9 @@ struct cmGeneratorExpressionNode { DynamicParameters = 0, OneOrMoreParameters = -1, - OneOrZeroParameters = -2 + TwoOrMoreParameters = -2, + ZeroOrMoreParameters = -3, + OneOrZeroParameters = -4 }; virtual ~cmGeneratorExpressionNode() = default; https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3475e2728bad16899b50131785a61f43083e8ba9 commit 3475e2728bad16899b50131785a61f43083e8ba9 Author: Bartosz Kosiorek AuthorDate: Thu May 30 09:18:16 2019 +0200 Commit: Brad King CommitDate: Mon Jun 3 10:03:53 2019 -0400 cmListFileCache: When missing ending ) print starting line instead of last one Fixes: #19301 diff --git a/Source/cmListFileCache.cxx b/Source/cmListFileCache.cxx index f99caed..df0d00c 100644 --- a/Source/cmListFileCache.cxx +++ b/Source/cmListFileCache.cxx @@ -192,12 +192,9 @@ bool cmListFileParser::ParseFunction(const char* name, long line) } // Arguments. - unsigned long lastLine; unsigned long parenDepth = 0; this->Separation = SeparationOkay; - while ( - (static_cast(lastLine = cmListFileLexer_GetCurrentLine(this->Lexer)), - token = cmListFileLexer_Scan(this->Lexer))) { + while ((token = cmListFileLexer_Scan(this->Lexer))) { if (token->type == cmListFileLexer_Token_Space || token->type == cmListFileLexer_Token_Newline) { this->Separation = SeparationOkay; @@ -252,7 +249,7 @@ bool cmListFileParser::ParseFunction(const char* name, long line) std::ostringstream error; cmListFileContext lfc; lfc.FilePath = this->FileName; - lfc.Line = lastLine; + lfc.Line = line; cmListFileBacktrace lfbt = this->Backtrace; lfbt = lfbt.Push(lfc); error << "Parse error. Function missing ending \")\". " diff --git a/Tests/RunCMake/Syntax/UnterminatedCall1-stderr.txt b/Tests/RunCMake/Syntax/UnterminatedCall1-stderr.txt index 3f52244..f3ee895 100644 --- a/Tests/RunCMake/Syntax/UnterminatedCall1-stderr.txt +++ b/Tests/RunCMake/Syntax/UnterminatedCall1-stderr.txt @@ -1,4 +1,4 @@ -CMake Error at UnterminatedCall1.cmake:2: +CMake Error at UnterminatedCall1.cmake:1: Parse error. Function missing ending "\)". End of file reached. Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/Syntax/UnterminatedCall1.cmake b/Tests/RunCMake/Syntax/UnterminatedCall1.cmake index 1166109..e1d2118 100644 --- a/Tests/RunCMake/Syntax/UnterminatedCall1.cmake +++ b/Tests/RunCMake/Syntax/UnterminatedCall1.cmake @@ -1 +1,4 @@ message( + + +message("Additional message") diff --git a/Tests/RunCMake/Syntax/UnterminatedCall2-stderr.txt b/Tests/RunCMake/Syntax/UnterminatedCall2-stderr.txt index 18656f7..04216c3 100644 --- a/Tests/RunCMake/Syntax/UnterminatedCall2-stderr.txt +++ b/Tests/RunCMake/Syntax/UnterminatedCall2-stderr.txt @@ -1,4 +1,4 @@ -CMake Error at UnterminatedCall2.cmake:4: +CMake Error at UnterminatedCall2.cmake:3: Parse error. Function missing ending "\)". End of file reached. Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/Syntax/UnterminatedCall2.cmake b/Tests/RunCMake/Syntax/UnterminatedCall2.cmake index 26e9e62..8d4088d 100644 --- a/Tests/RunCMake/Syntax/UnterminatedCall2.cmake +++ b/Tests/RunCMake/Syntax/UnterminatedCall2.cmake @@ -1,3 +1,6 @@ set(var "\ ") message( + + +message("Additional message") https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=619416f8a30c99f87869559cf3829ce6d3431dca commit 619416f8a30c99f87869559cf3829ce6d3431dca Author: Robert Maynard AuthorDate: Fri May 31 13:18:11 2019 -0400 Commit: Brad King CommitDate: Mon Jun 3 09:56:03 2019 -0400 The error message for VISIBILITY_PRESET now documents valid options. Rather than just state the value for VISIBILITY_PRESET was invalid, we additionally list the accepted values. diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 87d2232..e20747f 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -1914,7 +1914,9 @@ static void AddVisibilityCompileOption(std::string& flags, strcmp(prop, "protected") != 0 && strcmp(prop, "internal") != 0) { std::ostringstream e; e << "Target " << target->GetName() << " uses unsupported value \"" << prop - << "\" for " << flagDefine << "."; + << "\" for " << flagDefine << "." + << " The supported values are: default, hidden, protected, and " + "internal."; cmSystemTools::Error(e.str()); return; } diff --git a/Tests/RunCMake/VisibilityPreset/PropertyTypo-stderr.txt b/Tests/RunCMake/VisibilityPreset/PropertyTypo-stderr.txt index ca8c33f..a63591f 100644 --- a/Tests/RunCMake/VisibilityPreset/PropertyTypo-stderr.txt +++ b/Tests/RunCMake/VisibilityPreset/PropertyTypo-stderr.txt @@ -1 +1 @@ -CMake Error: Target visibility_preset uses unsupported value \"hiden\" for CXX_VISIBILITY_PRESET +CMake Error: Target visibility_preset uses unsupported value \"hiden\" for CXX_VISIBILITY_PRESET. The supported values are: default, hidden, protected, and internal. ----------------------------------------------------------------------- Summary of changes: Help/manual/cmake-generator-expressions.7.rst | 60 +++++++++-------- Help/release/dev/genex-comma-separated.rst | 8 +++ Modules/CheckLanguage.cmake | 27 ++++++-- Source/cmGeneratorExpressionEvaluator.cxx | 10 ++- Source/cmGeneratorExpressionNode.cxx | 76 +++++++++++++--------- Source/cmGeneratorExpressionNode.h | 4 +- Source/cmListFileCache.cxx | 7 +- Source/cmLocalGenerator.cxx | 4 +- .../target_compile_definitions/CMakeLists.txt | 1 + .../target_compile_definitions/consumer.c | 4 ++ .../target_compile_options/CMakeLists.txt | 16 ++++- .../target_compile_options/consumer.cpp | 24 +++++++ .../CMakeCommands/target_compile_options/main.cpp | 20 ++++++ Tests/CMakeOnly/CheckLanguage/CMakeLists.txt | 3 +- Tests/GeneratorExpression/CMakeLists.txt | 1 + Tests/GeneratorExpression/check-part3.cmake | 5 ++ Tests/RunCMake/CommandLine/RunCMakeTest.cmake | 10 +-- ...MPILE_LANG_AND_ID-add_custom_command-stderr.txt | 3 +- .../COMPILE_LANG_AND_ID-target_sources-stderr.txt | 3 +- Tests/RunCMake/PolicyScope/dir1/CMakeLists.txt | 2 +- Tests/RunCMake/Syntax/UnterminatedCall1-stderr.txt | 2 +- Tests/RunCMake/Syntax/UnterminatedCall1.cmake | 3 + Tests/RunCMake/Syntax/UnterminatedCall2-stderr.txt | 2 +- Tests/RunCMake/Syntax/UnterminatedCall2.cmake | 3 + .../VisibilityPreset/PropertyTypo-stderr.txt | 2 +- 25 files changed, 212 insertions(+), 88 deletions(-) create mode 100644 Help/release/dev/genex-comma-separated.rst hooks/post-receive -- CMake From kwrobot at kitware.com Tue Jun 4 08:43:05 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Tue, 4 Jun 2019 08:43:05 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.14.5-1245-g842f70c Message-ID: <20190604124305.A2979FE0D7@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 842f70c49359bfd9a13e333f2571371f64d163e1 (commit) via a7d2efc15b117e404aeaf952c762a96ba34787a3 (commit) via 36140d864e71ee3d61240da42df2318b01cfbced (commit) via 65f5df7d08f2c96d551f578ec509271888ecb7be (commit) via 9ba901eb3c6579baaf2fec9996e0cbf7b5514fa7 (commit) via 07a80c70020e0e533db8d75d7fe7c4270cc25afb (commit) via 013bee698e8470169d99e90aa86d5d85693c6b12 (commit) via 3eb16de32733c7d3f61d22b16a893135267e7bbc (commit) via b06f4c8a745c96f19a9e9a7c7eb0ac22250472a2 (commit) via d91b5a72cd751b75fbce163fa7a3ea2f05bf484d (commit) via 5efac09beda23c1fb188c660df39b1884f252f64 (commit) via fec441ec17d74b6444fad2a3e32a47dd19f1be5b (commit) via 7456739e2401baa34ccec2989d604ea74ebb2f77 (commit) from 4b68baa776bf8ccc2911057fc79b558515438900 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=842f70c49359bfd9a13e333f2571371f64d163e1 commit 842f70c49359bfd9a13e333f2571371f64d163e1 Merge: a7d2efc fec441e Author: Brad King AuthorDate: Tue Jun 4 12:35:05 2019 +0000 Commit: Kitware Robot CommitDate: Tue Jun 4 08:37:55 2019 -0400 Merge topic 'emulator-arguments' fec441ec17 Teach CROSSCOMPILING_EMULATOR to support arguments Acked-by: Kitware Robot Merge-request: !3402 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a7d2efc15b117e404aeaf952c762a96ba34787a3 commit a7d2efc15b117e404aeaf952c762a96ba34787a3 Merge: 36140d8 07a80c7 Author: Brad King AuthorDate: Tue Jun 4 12:34:10 2019 +0000 Commit: Kitware Robot CommitDate: Tue Jun 4 08:37:04 2019 -0400 Merge topic 'remove_directories' 07a80c7002 cmake: Teach -E remove_directory to remove multiple directories 013bee698e Tests: Add RunCMake.CommandLine make_directory test checks 3eb16de327 Tests: Fix RunCMake.CommandLine make_directory test name Acked-by: Kitware Robot Merge-request: !3411 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=36140d864e71ee3d61240da42df2318b01cfbced commit 36140d864e71ee3d61240da42df2318b01cfbced Merge: 65f5df7 d91b5a7 Author: Brad King AuthorDate: Tue Jun 4 12:33:11 2019 +0000 Commit: Kitware Robot CommitDate: Tue Jun 4 08:35:47 2019 -0400 Merge topic 'ninja-nvcc-rsp' d91b5a72cd Ninja: Add support for CUDA nvcc response files 5efac09bed Ninja: Compute linker response file flag earlier Acked-by: Kitware Robot Merge-request: !3399 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=65f5df7d08f2c96d551f578ec509271888ecb7be commit 65f5df7d08f2c96d551f578ec509271888ecb7be Merge: 9ba901e b06f4c8 Author: Brad King AuthorDate: Tue Jun 4 12:33:32 2019 +0000 Commit: Kitware Robot CommitDate: Tue Jun 4 08:34:21 2019 -0400 Merge topic 'executables-are-consoled' b06f4c8a74 Swift: disallow WIN32_EXECUTABLE properties Acked-by: Kitware Robot Merge-request: !3410 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9ba901eb3c6579baaf2fec9996e0cbf7b5514fa7 commit 9ba901eb3c6579baaf2fec9996e0cbf7b5514fa7 Merge: 4b68baa 7456739 Author: Brad King AuthorDate: Tue Jun 4 12:32:47 2019 +0000 Commit: Kitware Robot CommitDate: Tue Jun 4 08:33:14 2019 -0400 Merge topic 'swift-linker-flags' 7456739e24 Swift: avoid `CMAKE_{EXE,SHARED}_LINKER_FLAGS` Acked-by: Kitware Robot Merge-request: !3406 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=07a80c70020e0e533db8d75d7fe7c4270cc25afb commit 07a80c70020e0e533db8d75d7fe7c4270cc25afb Author: John Freeman AuthorDate: Fri May 31 16:35:41 2019 -0500 Commit: Brad King CommitDate: Mon Jun 3 14:20:00 2019 -0400 cmake: Teach -E remove_directory to remove multiple directories The `make_directory` command can make multiple directories in a single invocation. Make `remove_directory` mirror that behavior. diff --git a/Help/manual/cmake.1.rst b/Help/manual/cmake.1.rst index 107c2cb..f1d02eb 100644 --- a/Help/manual/cmake.1.rst +++ b/Help/manual/cmake.1.rst @@ -514,8 +514,8 @@ Available commands are: ``remove`` does not follow symlinks. That means it remove only symlinks and not files it point to. -``remove_directory `` - Remove a directory and its contents. If a directory does +``remove_directory ...`` + Remove ```` directories and their contents. If a directory does not exist it will be silently ignored. ``rename `` diff --git a/Help/release/dev/remove_directories.rst b/Help/release/dev/remove_directories.rst new file mode 100644 index 0000000..1b16df1 --- /dev/null +++ b/Help/release/dev/remove_directories.rst @@ -0,0 +1,5 @@ +remove_directories +------------------ + +* The :manual:`cmake(1)` ``-E remove_directory`` command learned to support + removing multiple directories. diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx index f4ef45c..a983d30 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -103,7 +103,7 @@ void CMakeCommandUsage(const char* program) << " sha512sum ... - create SHA512 checksum of files\n" << " remove [-f] ... - remove the file(s), use -f to force " "it\n" - << " remove_directory dir - remove a directory and its contents\n" + << " remove_directory ... - remove directories and their contents\n" << " rename oldname newname - rename a file or directory " "(on one volume)\n" << " server - start cmake in server mode\n" @@ -661,7 +661,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector const& args) #endif if (args[1] == "make_directory" && args.size() > 2) { - // If error occurs we want to continue copying next files. + // If an error occurs, we want to continue making directories. bool return_value = false; for (auto const& arg : cmMakeRange(args).advance(2)) { if (!cmSystemTools::MakeDirectory(arg)) { @@ -672,13 +672,17 @@ int cmcmd::ExecuteCMakeCommand(std::vector const& args) return return_value; } - if (args[1] == "remove_directory" && args.size() == 3) { - if (cmSystemTools::FileIsDirectory(args[2]) && - !cmSystemTools::RemoveADirectory(args[2])) { - std::cerr << "Error removing directory \"" << args[2] << "\".\n"; - return 1; + if (args[1] == "remove_directory" && args.size() > 2) { + // If an error occurs, we want to continue removing directories. + bool return_value = false; + for (auto const& arg : cmMakeRange(args).advance(2)) { + if (cmSystemTools::FileIsDirectory(arg) && + !cmSystemTools::RemoveADirectory(arg)) { + std::cerr << "Error removing directory \"" << arg << "\".\n"; + return_value = true; + } } - return 0; + return return_value; } // Remove file diff --git a/Tests/RunCMake/CommandLine/E_remove_directory-directory-with-parent-check.cmake b/Tests/RunCMake/CommandLine/E_remove_directory-directory-with-parent-check.cmake new file mode 100644 index 0000000..fd6ea11 --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_remove_directory-directory-with-parent-check.cmake @@ -0,0 +1,3 @@ +if(IS_DIRECTORY ${out}/parent/child) + set(RunCMake_TEST_FAILED "child directory was not removed") +endif() diff --git a/Tests/RunCMake/CommandLine/E_remove_directory-directory-with-parent-stderr.txt b/Tests/RunCMake/CommandLine/E_remove_directory-directory-with-parent-stderr.txt new file mode 100644 index 0000000..e69de29 diff --git a/Tests/RunCMake/CommandLine/E_remove_directory-three-directories-check.cmake b/Tests/RunCMake/CommandLine/E_remove_directory-three-directories-check.cmake new file mode 100644 index 0000000..2b7202a --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_remove_directory-three-directories-check.cmake @@ -0,0 +1,6 @@ +if(IS_DIRECTORY ${out}/d1) + set(RunCMake_TEST_FAILED "directory d1 was not removed") +endif() +if(IS_DIRECTORY ${out}/d2) + set(RunCMake_TEST_FAILED "directory d2 was not removed") +endif() diff --git a/Tests/RunCMake/CommandLine/E_remove_directory-three-directories-stderr.txt b/Tests/RunCMake/CommandLine/E_remove_directory-three-directories-stderr.txt new file mode 100644 index 0000000..e69de29 diff --git a/Tests/RunCMake/CommandLine/E_remove_directory-two-directories-and-file-check.cmake b/Tests/RunCMake/CommandLine/E_remove_directory-two-directories-and-file-check.cmake new file mode 100644 index 0000000..0aa4a52 --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_remove_directory-two-directories-and-file-check.cmake @@ -0,0 +1,3 @@ +if(NOT EXISTS ${outfile}) + set(RunCMake_TEST_FAILED "removed non-directory ${outfile}") +endif() diff --git a/Tests/RunCMake/CommandLine/E_remove_directory-two-directories-and-file-stderr.txt b/Tests/RunCMake/CommandLine/E_remove_directory-two-directories-and-file-stderr.txt new file mode 100644 index 0000000..e69de29 diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake index 25a6435..6c17a6a 100644 --- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake +++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake @@ -332,10 +332,16 @@ file(MAKE_DIRECTORY ${out}) file(WRITE ${outfile} "") run_cmake_command(E_make_directory-three-directories ${CMAKE_COMMAND} -E make_directory ${out}/d1 ${out}/d2 ${out}/d2) +run_cmake_command(E_remove_directory-three-directories + ${CMAKE_COMMAND} -E remove_directory ${out}/d1 ${out}/d2 ${out}/d2) run_cmake_command(E_make_directory-directory-with-parent ${CMAKE_COMMAND} -E make_directory ${out}/parent/child) +run_cmake_command(E_remove_directory-directory-with-parent + ${CMAKE_COMMAND} -E remove_directory ${out}/parent) run_cmake_command(E_make_directory-two-directories-and-file ${CMAKE_COMMAND} -E make_directory ${out}/d1 ${out}/d2 ${outfile}) +run_cmake_command(E_remove_directory-two-directories-and-file + ${CMAKE_COMMAND} -E remove_directory ${out}/d1 ${out}/d2 ${outfile}) unset(out) unset(outfile) diff --git a/Tests/StagingPrefix/CMakeLists.txt b/Tests/StagingPrefix/CMakeLists.txt index 64a3cd2..8d2519e 100644 --- a/Tests/StagingPrefix/CMakeLists.txt +++ b/Tests/StagingPrefix/CMakeLists.txt @@ -5,11 +5,12 @@ project(StagingPrefix) # Wipe out the install tree add_custom_command( OUTPUT ${CMAKE_BINARY_DIR}/CleanupProject - COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_BINARY_DIR}/ConsumerBuild - COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_BINARY_DIR}/ProducerBuild - COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_BINARY_DIR}/stage - COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_BINARY_DIR}/prefix - COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_BINARY_DIR}/ignored + COMMAND ${CMAKE_COMMAND} -E remove_directory + ${CMAKE_BINARY_DIR}/ConsumerBuild + ${CMAKE_BINARY_DIR}/ProducerBuild + ${CMAKE_BINARY_DIR}/stage + ${CMAKE_BINARY_DIR}/prefix + ${CMAKE_BINARY_DIR}/ignored ) add_custom_target(CleanupTarget ALL DEPENDS ${CMAKE_BINARY_DIR}/CleanupProject) set_property( https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=013bee698e8470169d99e90aa86d5d85693c6b12 commit 013bee698e8470169d99e90aa86d5d85693c6b12 Author: John Freeman AuthorDate: Fri May 31 16:35:41 2019 -0500 Commit: Brad King CommitDate: Mon Jun 3 14:17:11 2019 -0400 Tests: Add RunCMake.CommandLine make_directory test checks diff --git a/Tests/RunCMake/CommandLine/E_make_directory-directory-with-parent-check.cmake b/Tests/RunCMake/CommandLine/E_make_directory-directory-with-parent-check.cmake new file mode 100644 index 0000000..ea3d161 --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_make_directory-directory-with-parent-check.cmake @@ -0,0 +1,3 @@ +if(NOT IS_DIRECTORY ${out}/parent/child) + set(RunCMake_TEST_FAILED "child directory was not created") +endif() diff --git a/Tests/RunCMake/CommandLine/E_make_directory-three-directories-check.cmake b/Tests/RunCMake/CommandLine/E_make_directory-three-directories-check.cmake new file mode 100644 index 0000000..c1e8474 --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_make_directory-three-directories-check.cmake @@ -0,0 +1,6 @@ +if(NOT IS_DIRECTORY ${out}/d1) + set(RunCMake_TEST_FAILED "directory d1 was not created") +endif() +if(NOT IS_DIRECTORY ${out}/d2) + set(RunCMake_TEST_FAILED "directory d2 was not created") +endif() https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3eb16de32733c7d3f61d22b16a893135267e7bbc commit 3eb16de32733c7d3f61d22b16a893135267e7bbc Author: John Freeman AuthorDate: Fri May 31 16:35:41 2019 -0500 Commit: Brad King CommitDate: Mon Jun 3 14:16:50 2019 -0400 Tests: Fix RunCMake.CommandLine make_directory test name diff --git a/Tests/RunCMake/CommandLine/E_make_directory-three-directories-and-file-result.txt b/Tests/RunCMake/CommandLine/E_make_directory-two-directories-and-file-result.txt similarity index 100% rename from Tests/RunCMake/CommandLine/E_make_directory-three-directories-and-file-result.txt rename to Tests/RunCMake/CommandLine/E_make_directory-two-directories-and-file-result.txt diff --git a/Tests/RunCMake/CommandLine/E_make_directory-three-directories-and-file-stderr.txt b/Tests/RunCMake/CommandLine/E_make_directory-two-directories-and-file-stderr.txt similarity index 100% rename from Tests/RunCMake/CommandLine/E_make_directory-three-directories-and-file-stderr.txt rename to Tests/RunCMake/CommandLine/E_make_directory-two-directories-and-file-stderr.txt diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake index cee996c..25a6435 100644 --- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake +++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake @@ -334,7 +334,7 @@ run_cmake_command(E_make_directory-three-directories ${CMAKE_COMMAND} -E make_directory ${out}/d1 ${out}/d2 ${out}/d2) run_cmake_command(E_make_directory-directory-with-parent ${CMAKE_COMMAND} -E make_directory ${out}/parent/child) -run_cmake_command(E_make_directory-three-directories-and-file +run_cmake_command(E_make_directory-two-directories-and-file ${CMAKE_COMMAND} -E make_directory ${out}/d1 ${out}/d2 ${outfile}) unset(out) unset(outfile) https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b06f4c8a745c96f19a9e9a7c7eb0ac22250472a2 commit b06f4c8a745c96f19a9e9a7c7eb0ac22250472a2 Author: Saleem Abdulrasool AuthorDate: Fri May 31 11:30:58 2019 -0700 Commit: Brad King CommitDate: Mon Jun 3 14:05:10 2019 -0400 Swift: disallow WIN32_EXECUTABLE properties Currently, the compiler does not synthesize the correct entry point for the application and passing the subsystem flag does not work the same way with the Swift linker language. Add a check to prevent the application of `WIN32_EXECUTABLE` to Swift executables until they can be properly supported. This will prevent the need for a future policy change. Closes: #19325 diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 26886f5..df0f33f 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -331,6 +331,37 @@ bool cmGlobalGenerator::CheckTargetsForMissingSources() const return failed; } +bool cmGlobalGenerator::CheckTargetsForType() const +{ + if (!this->GetLanguageEnabled("Swift")) { + return false; + } + bool failed = false; + for (cmLocalGenerator* generator : this->LocalGenerators) { + for (cmGeneratorTarget* target : generator->GetGeneratorTargets()) { + std::vector configs; + target->Makefile->GetConfigurations(configs); + if (configs.empty()) { + configs.emplace_back(); + } + + for (std::string const& config : configs) { + if (target->GetLinkerLanguage(config) == "Swift") { + if (target->GetPropertyAsBool("WIN32_EXECUTABLE")) { + this->GetCMakeInstance()->IssueMessage( + MessageType::FATAL_ERROR, + "WIN32_EXECUTABLE property is not supported on Swift " + "executables", + target->GetBacktrace()); + failed = true; + } + } + } + } + } + return failed; +} + bool cmGlobalGenerator::IsExportedTargetsFile( const std::string& filename) const { @@ -1414,6 +1445,10 @@ bool cmGlobalGenerator::Compute() return false; } + if (this->CheckTargetsForType()) { + return false; + } + for (cmLocalGenerator* localGen : this->LocalGenerators) { localGen->ComputeHomeRelativeOutputPath(); } diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index dcd8c5f..db96489 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -609,6 +609,7 @@ private: virtual void ForceLinkerLanguages(); bool CheckTargetsForMissingSources() const; + bool CheckTargetsForType() const; void CreateLocalGenerators(); diff --git a/Tests/RunCMake/Swift/E.swift b/Tests/RunCMake/Swift/E.swift new file mode 100644 index 0000000..a415467 --- /dev/null +++ b/Tests/RunCMake/Swift/E.swift @@ -0,0 +1,2 @@ +func f() { +} diff --git a/Tests/RunCMake/Swift/RunCMakeTest.cmake b/Tests/RunCMake/Swift/RunCMakeTest.cmake index de99042..4817045 100644 --- a/Tests/RunCMake/Swift/RunCMakeTest.cmake +++ b/Tests/RunCMake/Swift/RunCMakeTest.cmake @@ -6,7 +6,7 @@ if(RunCMake_GENERATOR STREQUAL Xcode) endif() elseif(RunCMake_GENERATOR STREQUAL Ninja) if(CMAKE_Swift_COMPILER) - # Add Ninja-specific Swift tests here. + run_cmake(Win32ExecutableDisallowed) endif() else() run_cmake(NotSupported) diff --git a/Tests/RunCMake/Swift/Win32ExecutableDisallowed-result.txt b/Tests/RunCMake/Swift/Win32ExecutableDisallowed-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/Swift/Win32ExecutableDisallowed-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/Swift/Win32ExecutableDisallowed-stderr.txt b/Tests/RunCMake/Swift/Win32ExecutableDisallowed-stderr.txt new file mode 100644 index 0000000..d78101a --- /dev/null +++ b/Tests/RunCMake/Swift/Win32ExecutableDisallowed-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at Win32ExecutableDisallowed.cmake:[0-9]+ \(add_executable\): + WIN32_EXECUTABLE property is not supported on Swift executables +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/Swift/Win32ExecutableDisallowed.cmake b/Tests/RunCMake/Swift/Win32ExecutableDisallowed.cmake new file mode 100644 index 0000000..02d5447 --- /dev/null +++ b/Tests/RunCMake/Swift/Win32ExecutableDisallowed.cmake @@ -0,0 +1,4 @@ +enable_language(Swift) +add_executable(E E.swift) +set_target_properties(E PROPERTIES + WIN32_EXECUTABLE TRUE) https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d91b5a72cd751b75fbce163fa7a3ea2f05bf484d commit d91b5a72cd751b75fbce163fa7a3ea2f05bf484d Author: Francisco Facioni AuthorDate: Thu May 30 09:35:03 2019 +0100 Commit: Brad King CommitDate: Mon Jun 3 11:53:27 2019 -0400 Ninja: Add support for CUDA nvcc response files diff --git a/Modules/Compiler/NVIDIA-CUDA.cmake b/Modules/Compiler/NVIDIA-CUDA.cmake index de9dd99..c0ccb71 100644 --- a/Modules/Compiler/NVIDIA-CUDA.cmake +++ b/Modules/Compiler/NVIDIA-CUDA.cmake @@ -40,3 +40,8 @@ endif() set(CMAKE_CUDA_USE_RESPONSE_FILE_FOR_INCLUDES 0) set(CMAKE_CUDA_USE_RESPONSE_FILE_FOR_LIBRARIES 0) set(CMAKE_CUDA_USE_RESPONSE_FILE_FOR_OBJECTS 0) + +if (CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL "9.0") + set(CMAKE_CUDA_RESPONSE_FILE_LINK_FLAG "--options-file ") + set(CMAKE_CUDA_RESPONSE_FILE_FLAG "--options-file ") +endif() diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index 63af69e..7ad8ab3 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -182,11 +182,11 @@ void cmNinjaNormalTargetGenerator::WriteDeviceLinkRule(bool useResponseFile) if (flag) { responseFlag = flag; - } else { + } else if (this->TargetLinkLanguage != "CUDA") { responseFlag = "@"; } - if (!useResponseFile) { + if (!useResponseFile || responseFlag.empty()) { vars.Objects = "$in"; vars.LinkLibraries = "$LINK_PATH $LINK_LIBRARIES"; } else { @@ -300,11 +300,11 @@ void cmNinjaNormalTargetGenerator::WriteLinkRule(bool useResponseFile) if (flag) { responseFlag = flag; - } else { + } else if (this->TargetLinkLanguage != "CUDA") { responseFlag = "@"; } - if (!useResponseFile) { + if (!useResponseFile || responseFlag.empty()) { vars.Objects = "$in"; vars.LinkLibraries = "$LINK_PATH $LINK_LIBRARIES"; } else { @@ -713,7 +713,7 @@ void cmNinjaNormalTargetGenerator::WriteDeviceLinkStatement() bool usedResponseFile = false; globalGen->WriteBuild(this->GetBuildFileStream(), build, commandLineLengthLimit, &usedResponseFile); - this->WriteDeviceLinkRule(false); + this->WriteDeviceLinkRule(usedResponseFile); } void cmNinjaNormalTargetGenerator::WriteLinkStatement() @@ -1047,8 +1047,17 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement() symlinkVars["POST_BUILD"] = postBuildCmdLine; } + std::string cmakeVarLang = "CMAKE_"; + cmakeVarLang += this->TargetLinkLanguage; + + // build response file name + std::string cmakeLinkVar = cmakeVarLang + "_RESPONSE_FILE_LINK_FLAG"; + + const char* flag = GetMakefile()->GetDefinition(cmakeLinkVar); + bool const lang_supports_response = - !(this->TargetLinkLanguage == "RC" || this->TargetLinkLanguage == "CUDA"); + !(this->TargetLinkLanguage == "RC" || + (this->TargetLinkLanguage == "CUDA" && !flag)); int commandLineLengthLimit = -1; if (!lang_supports_response || !this->ForceResponseFile()) { commandLineLengthLimit = diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index 4c93cf1..2139a45 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -465,12 +465,12 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang) std::string flags = "$FLAGS"; std::string responseFlag; - bool const lang_supports_response = !(lang == "RC" || lang == "CUDA"); + bool const lang_supports_response = lang != "RC"; if (lang_supports_response && this->ForceResponseFile()) { std::string const responseFlagVar = "CMAKE_" + lang + "_RESPONSE_FILE_FLAG"; responseFlag = this->Makefile->GetSafeDefinition(responseFlagVar); - if (responseFlag.empty()) { + if (responseFlag.empty() && lang != "CUDA") { responseFlag = "@"; } } @@ -944,8 +944,16 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement( std::string const objectFileDir = cmSystemTools::GetFilenamePath(objectFileName); + std::string cmakeVarLang = "CMAKE_"; + cmakeVarLang += language; + + // build response file name + std::string cmakeLinkVar = cmakeVarLang + "_RESPONSE_FILE_FLAG"; + + const char* flag = GetMakefile()->GetDefinition(cmakeLinkVar); + bool const lang_supports_response = - !(language == "RC" || language == "CUDA"); + !(language == "RC" || (language == "CUDA" && !flag)); int const commandLineLengthLimit = ((lang_supports_response && this->ForceResponseFile())) ? -1 : 0; https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5efac09beda23c1fb188c660df39b1884f252f64 commit 5efac09beda23c1fb188c660df39b1884f252f64 Author: Francisco Facioni AuthorDate: Thu May 30 09:35:03 2019 +0100 Commit: Brad King CommitDate: Mon Jun 3 11:52:28 2019 -0400 Ninja: Compute linker response file flag earlier diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index 1399ee2..63af69e 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -172,21 +172,24 @@ void cmNinjaNormalTargetGenerator::WriteDeviceLinkRule(bool useResponseFile) vars.Language = "CUDA"; std::string responseFlag; + + std::string cmakeVarLang = "CMAKE_"; + cmakeVarLang += this->TargetLinkLanguage; + + // build response file name + std::string cmakeLinkVar = cmakeVarLang + "_RESPONSE_FILE_LINK_FLAG"; + const char* flag = GetMakefile()->GetDefinition(cmakeLinkVar); + + if (flag) { + responseFlag = flag; + } else { + responseFlag = "@"; + } + if (!useResponseFile) { vars.Objects = "$in"; vars.LinkLibraries = "$LINK_PATH $LINK_LIBRARIES"; } else { - std::string cmakeVarLang = "CMAKE_"; - cmakeVarLang += this->TargetLinkLanguage; - - // build response file name - std::string cmakeLinkVar = cmakeVarLang + "_RESPONSE_FILE_LINK_FLAG"; - const char* flag = GetMakefile()->GetDefinition(cmakeLinkVar); - if (flag) { - responseFlag = flag; - } else { - responseFlag = "@"; - } rule.RspFile = "$RSP_FILE"; responseFlag += rule.RspFile; @@ -287,21 +290,24 @@ void cmNinjaNormalTargetGenerator::WriteLinkRule(bool useResponseFile) } std::string responseFlag; + + std::string cmakeVarLang = "CMAKE_"; + cmakeVarLang += this->TargetLinkLanguage; + + // build response file name + std::string cmakeLinkVar = cmakeVarLang + "_RESPONSE_FILE_LINK_FLAG"; + const char* flag = GetMakefile()->GetDefinition(cmakeLinkVar); + + if (flag) { + responseFlag = flag; + } else { + responseFlag = "@"; + } + if (!useResponseFile) { vars.Objects = "$in"; vars.LinkLibraries = "$LINK_PATH $LINK_LIBRARIES"; } else { - std::string cmakeVarLang = "CMAKE_"; - cmakeVarLang += this->TargetLinkLanguage; - - // build response file name - std::string cmakeLinkVar = cmakeVarLang + "_RESPONSE_FILE_LINK_FLAG"; - const char* flag = GetMakefile()->GetDefinition(cmakeLinkVar); - if (flag) { - responseFlag = flag; - } else { - responseFlag = "@"; - } rule.RspFile = "$RSP_FILE"; responseFlag += rule.RspFile; https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fec441ec17d74b6444fad2a3e32a47dd19f1be5b commit fec441ec17d74b6444fad2a3e32a47dd19f1be5b Author: Marek Antoniak AuthorDate: Thu May 30 16:11:10 2019 +0200 Commit: Brad King CommitDate: Mon Jun 3 10:17:17 2019 -0400 Teach CROSSCOMPILING_EMULATOR to support arguments Fixes: #19321 diff --git a/Help/prop_tgt/CROSSCOMPILING_EMULATOR.rst b/Help/prop_tgt/CROSSCOMPILING_EMULATOR.rst index a0811bc..87c5978 100644 --- a/Help/prop_tgt/CROSSCOMPILING_EMULATOR.rst +++ b/Help/prop_tgt/CROSSCOMPILING_EMULATOR.rst @@ -6,6 +6,10 @@ This command will be added as a prefix to :command:`add_test`, :command:`add_custom_command`, and :command:`add_custom_target` commands for built target system executables. +If this property contains a :ref:`semicolon-separated list `, then the first value is the command and remaining values are its +arguments. + This property is initialized by the value of the :variable:`CMAKE_CROSSCOMPILING_EMULATOR` variable if it is set when a target is created. diff --git a/Help/release/dev/emulator-arguments.rst b/Help/release/dev/emulator-arguments.rst new file mode 100644 index 0000000..3edb790 --- /dev/null +++ b/Help/release/dev/emulator-arguments.rst @@ -0,0 +1,6 @@ +emulator-arguments +------------------ + +* The :variable:`CMAKE_CROSSCOMPILING_EMULATOR` variable and corresponding + :prop_tgt:`CROSSCOMPILING_EMULATOR` target property learned to support + arguments to the emulator. diff --git a/Help/variable/CMAKE_CROSSCOMPILING_EMULATOR.rst b/Help/variable/CMAKE_CROSSCOMPILING_EMULATOR.rst index e7774f2..1d013b7 100644 --- a/Help/variable/CMAKE_CROSSCOMPILING_EMULATOR.rst +++ b/Help/variable/CMAKE_CROSSCOMPILING_EMULATOR.rst @@ -5,6 +5,10 @@ This variable is only used when :variable:`CMAKE_CROSSCOMPILING` is on. It should point to a command on the host system that can run executable built for the target system. +If this variable contains a :ref:`semicolon-separated list `, then the first value is the command and remaining values are its +arguments. + The command will be used to run :command:`try_run` generated executables, which avoids manual population of the ``TryRunResults.cmake`` file. diff --git a/Source/cmCustomCommandGenerator.cxx b/Source/cmCustomCommandGenerator.cxx index e58fc76..89aaad0 100644 --- a/Source/cmCustomCommandGenerator.cxx +++ b/Source/cmCustomCommandGenerator.cxx @@ -75,6 +75,8 @@ cmCustomCommandGenerator::cmCustomCommandGenerator(cmCustomCommand const& cc, cmSystemTools::CollapseFullPath(this->WorkingDirectory, build_dir); } } + + this->FillEmulatorsWithArguments(); } cmCustomCommandGenerator::~cmCustomCommandGenerator() @@ -87,19 +89,38 @@ unsigned int cmCustomCommandGenerator::GetNumberOfCommands() const return static_cast(this->CC.GetCommandLines().size()); } -const char* cmCustomCommandGenerator::GetCrossCompilingEmulator( - unsigned int c) const +void cmCustomCommandGenerator::FillEmulatorsWithArguments() { if (!this->LG->GetMakefile()->IsOn("CMAKE_CROSSCOMPILING")) { - return nullptr; + return; } - std::string const& argv0 = this->CommandLines[c][0]; - cmGeneratorTarget* target = this->LG->FindGeneratorTargetToUse(argv0); - if (target && target->GetType() == cmStateEnums::EXECUTABLE && - !target->IsImported()) { - return target->GetProperty("CROSSCOMPILING_EMULATOR"); + + for (unsigned int c = 0; c < this->GetNumberOfCommands(); ++c) { + std::string const& argv0 = this->CommandLines[c][0]; + cmGeneratorTarget* target = this->LG->FindGeneratorTargetToUse(argv0); + if (target && target->GetType() == cmStateEnums::EXECUTABLE && + !target->IsImported()) { + + const char* emulator_property = + target->GetProperty("CROSSCOMPILING_EMULATOR"); + if (!emulator_property) { + continue; + } + + this->EmulatorsWithArguments.emplace_back(); + cmSystemTools::ExpandListArgument(emulator_property, + this->EmulatorsWithArguments[c]); + } } - return nullptr; +} + +std::vector cmCustomCommandGenerator::GetCrossCompilingEmulator( + unsigned int c) const +{ + if (c >= this->EmulatorsWithArguments.size()) { + return std::vector(); + } + return this->EmulatorsWithArguments[c]; } const char* cmCustomCommandGenerator::GetArgv0Location(unsigned int c) const @@ -129,8 +150,9 @@ bool cmCustomCommandGenerator::HasOnlyEmptyCommandLines() const std::string cmCustomCommandGenerator::GetCommand(unsigned int c) const { - if (const char* emulator = this->GetCrossCompilingEmulator(c)) { - return std::string(emulator); + std::vector emulator = this->GetCrossCompilingEmulator(c); + if (!emulator.empty()) { + return emulator[0]; } if (const char* location = this->GetArgv0Location(c)) { return std::string(location); @@ -168,9 +190,20 @@ void cmCustomCommandGenerator::AppendArguments(unsigned int c, std::string& cmd) const { unsigned int offset = 1; - if (this->GetCrossCompilingEmulator(c) != nullptr) { + std::vector emulator = this->GetCrossCompilingEmulator(c); + if (!emulator.empty()) { + for (unsigned j = 1; j < emulator.size(); ++j) { + cmd += " "; + if (this->OldStyle) { + cmd += escapeForShellOldStyle(emulator[j]); + } else { + cmd += this->LG->EscapeForShell(emulator[j], this->MakeVars); + } + } + offset = 0; } + cmCustomCommandLine const& commandLine = this->CommandLines[c]; for (unsigned int j = offset; j < commandLine.size(); ++j) { std::string arg; diff --git a/Source/cmCustomCommandGenerator.h b/Source/cmCustomCommandGenerator.h index 7fd60c0..766f4b8 100644 --- a/Source/cmCustomCommandGenerator.h +++ b/Source/cmCustomCommandGenerator.h @@ -22,10 +22,12 @@ class cmCustomCommandGenerator bool MakeVars; cmGeneratorExpression* GE; cmCustomCommandLines CommandLines; + std::vector> EmulatorsWithArguments; std::vector Depends; std::string WorkingDirectory; - const char* GetCrossCompilingEmulator(unsigned int c) const; + void FillEmulatorsWithArguments(); + std::vector GetCrossCompilingEmulator(unsigned int c) const; const char* GetArgv0Location(unsigned int c) const; public: diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 0ccfca8..6e6b9f1 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -448,9 +448,11 @@ endif() add_executable(pseudo_emulator pseudo_emulator.c) add_executable(pseudo_emulator_custom_command pseudo_emulator_custom_command.c) +add_executable(pseudo_emulator_custom_command_arg pseudo_emulator_custom_command_arg.c) add_RunCMake_test(CrosscompilingEmulator -DPSEUDO_EMULATOR=$ - -DPSEUDO_EMULATOR_CUSTOM_COMMAND=$) + -DPSEUDO_EMULATOR_CUSTOM_COMMAND=$ + -DPSEUDO_EMULATOR_CUSTOM_COMMAND_ARG=$) if("${CMAKE_GENERATOR}" MATCHES "Make|Ninja") if(UNIX AND NOT CYGWIN) execute_process(COMMAND ldd --help diff --git a/Tests/RunCMake/CrosscompilingEmulator/AddCustomCommandWithArg-build-check.cmake b/Tests/RunCMake/CrosscompilingEmulator/AddCustomCommandWithArg-build-check.cmake new file mode 100644 index 0000000..9ca6106 --- /dev/null +++ b/Tests/RunCMake/CrosscompilingEmulator/AddCustomCommandWithArg-build-check.cmake @@ -0,0 +1,3 @@ +if(NOT EXISTS "${RunCMake_TEST_BINARY_DIR}/output") + message(FATAL_ERROR "Failed to create output: ${RunCMake_TEST_BINARY_DIR}/output") +endif() diff --git a/Tests/RunCMake/CrosscompilingEmulator/AddCustomCommandWithArg.cmake b/Tests/RunCMake/CrosscompilingEmulator/AddCustomCommandWithArg.cmake new file mode 100644 index 0000000..d9059ca --- /dev/null +++ b/Tests/RunCMake/CrosscompilingEmulator/AddCustomCommandWithArg.cmake @@ -0,0 +1,14 @@ +set(CMAKE_CROSSCOMPILING 1) + +# Executable: Return error code different from 0 +add_executable(generated_exe_emulator_expected simple_src_exiterror.cxx) + +add_custom_command(OUTPUT output + COMMAND generated_exe_emulator_expected + COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/output + DEPENDS generated_exe_emulator_expected) + +add_custom_target(ensure_build ALL + SOURCES + ${CMAKE_CURRENT_BINARY_DIR}/output +) diff --git a/Tests/RunCMake/CrosscompilingEmulator/AddCustomTargetWithArg-build-check.cmake b/Tests/RunCMake/CrosscompilingEmulator/AddCustomTargetWithArg-build-check.cmake new file mode 100644 index 0000000..13c0db9 --- /dev/null +++ b/Tests/RunCMake/CrosscompilingEmulator/AddCustomTargetWithArg-build-check.cmake @@ -0,0 +1 @@ +include(${CMAKE_CURRENT_LIST_DIR}/AddCustomCommandWithArg-build-check.cmake) diff --git a/Tests/RunCMake/CrosscompilingEmulator/AddCustomTargetWithArg.cmake b/Tests/RunCMake/CrosscompilingEmulator/AddCustomTargetWithArg.cmake new file mode 100644 index 0000000..dcd80d5 --- /dev/null +++ b/Tests/RunCMake/CrosscompilingEmulator/AddCustomTargetWithArg.cmake @@ -0,0 +1,9 @@ +set(CMAKE_CROSSCOMPILING 1) + +# Executable: Return error code different from 0 +add_executable(generated_exe_emulator_expected simple_src_exiterror.cxx) + +add_custom_target(generate_output ALL + generated_exe_emulator_expected + COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/output + DEPENDS generated_exe_emulator_expected) diff --git a/Tests/RunCMake/CrosscompilingEmulator/RunCMakeTest.cmake b/Tests/RunCMake/CrosscompilingEmulator/RunCMakeTest.cmake index 71aaad1..97b7b5a 100644 --- a/Tests/RunCMake/CrosscompilingEmulator/RunCMakeTest.cmake +++ b/Tests/RunCMake/CrosscompilingEmulator/RunCMakeTest.cmake @@ -11,13 +11,18 @@ function(CustomCommandGenerator_run_and_build case) # Use a single build tree for a few tests without cleaning. set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${case}-build) set(RunCMake_TEST_NO_CLEAN 1) - set(RunCMake_TEST_OPTIONS - "-DCMAKE_CROSSCOMPILING_EMULATOR=${PSEUDO_EMULATOR_CUSTOM_COMMAND}") file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}") file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}") run_cmake(${case}) run_cmake_command(${case}-build ${CMAKE_COMMAND} --build .) endfunction() +set(RunCMake_TEST_OPTIONS +"-DCMAKE_CROSSCOMPILING_EMULATOR=${PSEUDO_EMULATOR_CUSTOM_COMMAND}") CustomCommandGenerator_run_and_build(AddCustomCommand) CustomCommandGenerator_run_and_build(AddCustomTarget) + +set(RunCMake_TEST_OPTIONS +"-DCMAKE_CROSSCOMPILING_EMULATOR=${PSEUDO_EMULATOR_CUSTOM_COMMAND_ARG}\;custom_argument") +CustomCommandGenerator_run_and_build(AddCustomCommandWithArg) +CustomCommandGenerator_run_and_build(AddCustomTargetWithArg) diff --git a/Tests/RunCMake/pseudo_emulator_custom_command_arg.c b/Tests/RunCMake/pseudo_emulator_custom_command_arg.c new file mode 100644 index 0000000..d00deda --- /dev/null +++ b/Tests/RunCMake/pseudo_emulator_custom_command_arg.c @@ -0,0 +1,30 @@ +#include +#include +#include + +// Usage: +// +// /path/to/program arg1 [arg2 [...]] +// +// Return EXIT_SUCCESS if 'custom_argument' string was found +// in and 'generated_exe_emulator_expected' +// string was found in +// Return EXIT_FAILURE if 'custom_argument' string was not +// found in or 'generated_exe_emulator_expected' +// string was not found in . + +int main(int argc, const char* argv[]) +{ + // Require a slash to make sure it is a path and not a target name. + const char* substring_success = "/generated_exe_emulator_expected"; + const char* substring_custom_argument = "custom_argument"; + + if (argc < 2) { + return EXIT_FAILURE; + } + if (strstr(argv[1], substring_custom_argument) != 0 && + strstr(argv[2], substring_success) != 0) { + return EXIT_SUCCESS; + } + return EXIT_FAILURE; +} https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7456739e2401baa34ccec2989d604ea74ebb2f77 commit 7456739e2401baa34ccec2989d604ea74ebb2f77 Author: Saleem Abdulrasool AuthorDate: Thu May 30 14:22:20 2019 -0700 Commit: Brad King CommitDate: Mon Jun 3 09:59:39 2019 -0400 Swift: avoid `CMAKE_{EXE,SHARED}_LINKER_FLAGS` Avoid the use of `CMAKE_{EXE,SHARED}_LINKER_FLAGS` when linking with the Swift language. This required hoisting the executable flags of `CMAKE_CREATE_WIN32_EXE`, `CMAKE_CREATE_CONSOLE_EXE`, and `CMAKE_EXE_EXPORTS_*_FLAG` earlier to avoid a second clause which checks the language. This allows for mixed-language Swift projects to properly link on Windows. Fixes #19298 diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 87d2232..a6d22ef 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -1169,30 +1169,34 @@ void cmLocalGenerator::GetTargetFlags( libraryLinkVariable = "CMAKE_MODULE_LINKER_FLAGS"; CM_FALLTHROUGH; case cmStateEnums::SHARED_LIBRARY: { - linkFlags = this->Makefile->GetSafeDefinition(libraryLinkVariable); - linkFlags += " "; - if (!buildType.empty()) { - std::string build = libraryLinkVariable; - build += "_"; - build += buildType; - linkFlags += this->Makefile->GetSafeDefinition(build); + if (linkLanguage != "Swift") { + linkFlags = this->Makefile->GetSafeDefinition(libraryLinkVariable); linkFlags += " "; - } - if (this->Makefile->IsOn("WIN32") && - !(this->Makefile->IsOn("CYGWIN") || this->Makefile->IsOn("MINGW"))) { - std::vector sources; - target->GetSourceFiles(sources, buildType); - std::string defFlag = - this->Makefile->GetSafeDefinition("CMAKE_LINK_DEF_FILE_FLAG"); - for (cmSourceFile* sf : sources) { - if (sf->GetExtension() == "def") { - linkFlags += defFlag; - linkFlags += this->ConvertToOutputFormat( - cmSystemTools::CollapseFullPath(sf->GetFullPath()), SHELL); - linkFlags += " "; + if (!buildType.empty()) { + std::string build = libraryLinkVariable; + build += "_"; + build += buildType; + linkFlags += this->Makefile->GetSafeDefinition(build); + linkFlags += " "; + } + if (this->Makefile->IsOn("WIN32") && + !(this->Makefile->IsOn("CYGWIN") || + this->Makefile->IsOn("MINGW"))) { + std::vector sources; + target->GetSourceFiles(sources, buildType); + std::string defFlag = + this->Makefile->GetSafeDefinition("CMAKE_LINK_DEF_FILE_FLAG"); + for (cmSourceFile* sf : sources) { + if (sf->GetExtension() == "def") { + linkFlags += defFlag; + linkFlags += this->ConvertToOutputFormat( + cmSystemTools::CollapseFullPath(sf->GetFullPath()), SHELL); + linkFlags += " "; + } } } } + const char* targetLinkFlags = target->GetProperty("LINK_FLAGS"); if (targetLinkFlags) { linkFlags += targetLinkFlags; @@ -1207,6 +1211,7 @@ void cmLocalGenerator::GetTargetFlags( linkFlags += " "; } } + std::vector opts; target->GetLinkOptions(opts, config, linkLanguage); // LINK_OPTIONS are escaped. @@ -1217,25 +1222,49 @@ void cmLocalGenerator::GetTargetFlags( } } break; case cmStateEnums::EXECUTABLE: { - linkFlags += this->Makefile->GetSafeDefinition("CMAKE_EXE_LINKER_FLAGS"); - linkFlags += " "; - if (!buildType.empty()) { - std::string build = "CMAKE_EXE_LINKER_FLAGS_"; - build += buildType; - linkFlags += this->Makefile->GetSafeDefinition(build); + if (linkLanguage != "Swift") { + linkFlags += + this->Makefile->GetSafeDefinition("CMAKE_EXE_LINKER_FLAGS"); linkFlags += " "; + if (!buildType.empty()) { + std::string build = "CMAKE_EXE_LINKER_FLAGS_"; + build += buildType; + linkFlags += this->Makefile->GetSafeDefinition(build); + linkFlags += " "; + } + if (linkLanguage.empty()) { + cmSystemTools::Error( + "CMake can not determine linker language for target: " + + target->GetName()); + return; + } + + if (target->GetPropertyAsBool("WIN32_EXECUTABLE")) { + linkFlags += + this->Makefile->GetSafeDefinition("CMAKE_CREATE_WIN32_EXE"); + linkFlags += " "; + } else { + linkFlags += + this->Makefile->GetSafeDefinition("CMAKE_CREATE_CONSOLE_EXE"); + linkFlags += " "; + } + + if (target->IsExecutableWithExports()) { + std::string exportFlagVar = "CMAKE_EXE_EXPORTS_"; + exportFlagVar += linkLanguage; + exportFlagVar += "_FLAG"; + + linkFlags += this->Makefile->GetSafeDefinition(exportFlagVar); + linkFlags += " "; + } } - if (linkLanguage.empty()) { - cmSystemTools::Error( - "CMake can not determine linker language for target: " + - target->GetName()); - return; - } + this->AddLanguageFlagsForLinking(flags, target, linkLanguage, buildType); if (pcli) { this->OutputLinkLibraries(pcli, linkLineComputer, linkLibs, frameworkPath, linkPath); } + if (cmSystemTools::IsOn( this->Makefile->GetDefinition("BUILD_SHARED_LIBS"))) { std::string sFlagVar = std::string("CMAKE_SHARED_BUILD_") + @@ -1243,23 +1272,6 @@ void cmLocalGenerator::GetTargetFlags( linkFlags += this->Makefile->GetSafeDefinition(sFlagVar); linkFlags += " "; } - if (target->GetPropertyAsBool("WIN32_EXECUTABLE")) { - linkFlags += - this->Makefile->GetSafeDefinition("CMAKE_CREATE_WIN32_EXE"); - linkFlags += " "; - } else { - linkFlags += - this->Makefile->GetSafeDefinition("CMAKE_CREATE_CONSOLE_EXE"); - linkFlags += " "; - } - if (target->IsExecutableWithExports()) { - std::string exportFlagVar = "CMAKE_EXE_EXPORTS_"; - exportFlagVar += linkLanguage; - exportFlagVar += "_FLAG"; - - linkFlags += this->Makefile->GetSafeDefinition(exportFlagVar); - linkFlags += " "; - } std::string cmp0065Flags = this->GetLinkLibsCMP0065(linkLanguage, *target); @@ -1282,6 +1294,7 @@ void cmLocalGenerator::GetTargetFlags( linkFlags += " "; } } + std::vector opts; target->GetLinkOptions(opts, config, linkLanguage); // LINK_OPTIONS are escaped. ----------------------------------------------------------------------- Summary of changes: Help/manual/cmake.1.rst | 4 +- Help/prop_tgt/CROSSCOMPILING_EMULATOR.rst | 4 + Help/release/dev/emulator-arguments.rst | 6 ++ Help/release/dev/remove_directories.rst | 5 + Help/variable/CMAKE_CROSSCOMPILING_EMULATOR.rst | 4 + Modules/Compiler/NVIDIA-CUDA.cmake | 5 + Source/cmCustomCommandGenerator.cxx | 57 ++++++++--- Source/cmCustomCommandGenerator.h | 4 +- Source/cmGlobalGenerator.cxx | 35 +++++++ Source/cmGlobalGenerator.h | 1 + Source/cmLocalGenerator.cxx | 111 ++++++++++++--------- Source/cmNinjaNormalTargetGenerator.cxx | 67 ++++++++----- Source/cmNinjaTargetGenerator.cxx | 14 ++- Source/cmcmd.cxx | 20 ++-- Tests/RunCMake/CMakeLists.txt | 4 +- ...ake_directory-directory-with-parent-check.cmake | 3 + ...directory-three-directories-and-file-result.txt | 1 - .../E_make_directory-three-directories-check.cmake | 6 ++ ..._directory-two-directories-and-file-result.txt} | 0 ..._directory-two-directories-and-file-stderr.txt} | 0 ...ove_directory-directory-with-parent-check.cmake | 3 + ...ove_directory-directory-with-parent-stderr.txt} | 0 ..._remove_directory-three-directories-check.cmake | 6 ++ ..._remove_directory-three-directories-stderr.txt} | 0 ..._directory-two-directories-and-file-check.cmake | 3 + ..._directory-two-directories-and-file-stderr.txt} | 0 Tests/RunCMake/CommandLine/RunCMakeTest.cmake | 8 +- .../AddCustomCommandWithArg-build-check.cmake | 3 + .../AddCustomCommandWithArg.cmake | 14 +++ .../AddCustomTargetWithArg-build-check.cmake | 1 + .../AddCustomTargetWithArg.cmake | 9 ++ .../CrosscompilingEmulator/RunCMakeTest.cmake | 9 +- Tests/RunCMake/Swift/E.swift | 2 + Tests/RunCMake/Swift/RunCMakeTest.cmake | 2 +- .../Win32ExecutableDisallowed-result.txt} | 0 .../Swift/Win32ExecutableDisallowed-stderr.txt | 4 + .../RunCMake/Swift/Win32ExecutableDisallowed.cmake | 4 + .../RunCMake/pseudo_emulator_custom_command_arg.c | 30 ++++++ Tests/StagingPrefix/CMakeLists.txt | 11 +- 39 files changed, 348 insertions(+), 112 deletions(-) create mode 100644 Help/release/dev/emulator-arguments.rst create mode 100644 Help/release/dev/remove_directories.rst create mode 100644 Tests/RunCMake/CommandLine/E_make_directory-directory-with-parent-check.cmake delete mode 100644 Tests/RunCMake/CommandLine/E_make_directory-three-directories-and-file-result.txt create mode 100644 Tests/RunCMake/CommandLine/E_make_directory-three-directories-check.cmake copy Tests/RunCMake/{while/MissingArgument-result.txt => CommandLine/E_make_directory-two-directories-and-file-result.txt} (100%) rename Tests/RunCMake/CommandLine/{E_make_directory-three-directories-and-file-stderr.txt => E_make_directory-two-directories-and-file-stderr.txt} (100%) create mode 100644 Tests/RunCMake/CommandLine/E_remove_directory-directory-with-parent-check.cmake copy Tests/{Wrapping/vtkIncluded.cxx => RunCMake/CommandLine/E_remove_directory-directory-with-parent-stderr.txt} (100%) create mode 100644 Tests/RunCMake/CommandLine/E_remove_directory-three-directories-check.cmake copy Tests/{Wrapping/vtkIncluded.cxx => RunCMake/CommandLine/E_remove_directory-three-directories-stderr.txt} (100%) create mode 100644 Tests/RunCMake/CommandLine/E_remove_directory-two-directories-and-file-check.cmake copy Tests/{Wrapping/vtkIncluded.cxx => RunCMake/CommandLine/E_remove_directory-two-directories-and-file-stderr.txt} (100%) create mode 100644 Tests/RunCMake/CrosscompilingEmulator/AddCustomCommandWithArg-build-check.cmake create mode 100644 Tests/RunCMake/CrosscompilingEmulator/AddCustomCommandWithArg.cmake create mode 100644 Tests/RunCMake/CrosscompilingEmulator/AddCustomTargetWithArg-build-check.cmake create mode 100644 Tests/RunCMake/CrosscompilingEmulator/AddCustomTargetWithArg.cmake create mode 100644 Tests/RunCMake/Swift/E.swift copy Tests/RunCMake/{while/MissingArgument-result.txt => Swift/Win32ExecutableDisallowed-result.txt} (100%) create mode 100644 Tests/RunCMake/Swift/Win32ExecutableDisallowed-stderr.txt create mode 100644 Tests/RunCMake/Swift/Win32ExecutableDisallowed.cmake create mode 100644 Tests/RunCMake/pseudo_emulator_custom_command_arg.c hooks/post-receive -- CMake From kwrobot at kitware.com Tue Jun 4 08:53:03 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Tue, 4 Jun 2019 08:53:03 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.14.5-1249-g4d80bd5 Message-ID: <20190604125303.CEB95FE78A@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 4d80bd5cd5d7889fcd5d3b02519979034aec82e3 (commit) via 435f71fe124c9bde1d04b24589f118e908b2a48f (commit) via 9098d3176018055f3c0208e2ee3aa065f7bbfa21 (commit) via bb8b3727c9aa9b17a55f3f37d8884bb57aeaa73d (commit) from 842f70c49359bfd9a13e333f2571371f64d163e1 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4d80bd5cd5d7889fcd5d3b02519979034aec82e3 commit 4d80bd5cd5d7889fcd5d3b02519979034aec82e3 Merge: 842f70c 435f71f Author: Brad King AuthorDate: Tue Jun 4 12:46:25 2019 +0000 Commit: Kitware Robot CommitDate: Tue Jun 4 08:46:33 2019 -0400 Merge topic 'tweaks_to_release_notes' 435f71fe12 Help: Clarify COMPILE_LANG_AND_ID release note 9098d31760 Help: Clarify vs-just-my-code-debugging release note language bb8b3727c9 Help: Reference project command in CMAKE_PROJECT_INCLUDE_BEFORE relnotes Acked-by: Kitware Robot Merge-request: !3419 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=435f71fe124c9bde1d04b24589f118e908b2a48f commit 435f71fe124c9bde1d04b24589f118e908b2a48f Author: Robert Maynard AuthorDate: Tue Jun 4 08:37:20 2019 -0400 Commit: Brad King CommitDate: Tue Jun 4 08:45:49 2019 -0400 Help: Clarify COMPILE_LANG_AND_ID release note diff --git a/Help/release/dev/genex-COMPILE_LANG_AND_ID.rst b/Help/release/dev/genex-COMPILE_LANG_AND_ID.rst index 27e0ebd..760fca8 100644 --- a/Help/release/dev/genex-COMPILE_LANG_AND_ID.rst +++ b/Help/release/dev/genex-COMPILE_LANG_AND_ID.rst @@ -3,5 +3,5 @@ genex-COMPILE_LANG_AND_ID * A new ``COMPILE_LANG_AND_ID`` generator expression was introduced to allow specification of compile options for target files based on the - :variable:`CMAKE__COMPILER_ID` and :prop_sf:`LANGUAGE` and of + :variable:`CMAKE__COMPILER_ID` and :prop_sf:`LANGUAGE` of each source file. https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9098d3176018055f3c0208e2ee3aa065f7bbfa21 commit 9098d3176018055f3c0208e2ee3aa065f7bbfa21 Author: Robert Maynard AuthorDate: Tue Jun 4 08:36:08 2019 -0400 Commit: Brad King CommitDate: Tue Jun 4 08:45:49 2019 -0400 Help: Clarify vs-just-my-code-debugging release note language diff --git a/Help/release/dev/vs-just-my-code-debugging.rst b/Help/release/dev/vs-just-my-code-debugging.rst index 73299d9..c53ee6c 100644 --- a/Help/release/dev/vs-just-my-code-debugging.rst +++ b/Help/release/dev/vs-just-my-code-debugging.rst @@ -1,9 +1,9 @@ vs-just-my-code-debugging ------------------------- -* For the :ref:`Visual Studio Generators`, for the - :ref:`Makefile Generators` and the :generator:`Ninja` generator - the Just My Code feature of the Visual Studio Debugger could be +* For the :ref:`Visual Studio Generators`, + :ref:`Makefile Generators`, and the :generator:`Ninja` generators + the Just My Code feature of the Visual Studio Debugger can be leveraged by turning on the :prop_tgt:`VS_JUST_MY_CODE_DEBUGGING` target property. Its default value is provided by the variable :variable:`CMAKE_VS_JUST_MY_CODE_DEBUGGING`. https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bb8b3727c9aa9b17a55f3f37d8884bb57aeaa73d commit bb8b3727c9aa9b17a55f3f37d8884bb57aeaa73d Author: Robert Maynard AuthorDate: Tue Jun 4 08:35:46 2019 -0400 Commit: Brad King CommitDate: Tue Jun 4 08:45:49 2019 -0400 Help: Reference project command in CMAKE_PROJECT_INCLUDE_BEFORE relnotes diff --git a/Help/release/dev/project-include-before.rst b/Help/release/dev/project-include-before.rst index 3f16cd7..9a9e067 100644 --- a/Help/release/dev/project-include-before.rst +++ b/Help/release/dev/project-include-before.rst @@ -2,4 +2,4 @@ cmake_project_include_before ---------------------------- * A variable :variable:`CMAKE_PROJECT_INCLUDE_BEFORE` was added to allow - injection of custom code into the project. + injection of custom code before the :command:`project` call. ----------------------------------------------------------------------- Summary of changes: Help/release/dev/genex-COMPILE_LANG_AND_ID.rst | 2 +- Help/release/dev/project-include-before.rst | 2 +- Help/release/dev/vs-just-my-code-debugging.rst | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) hooks/post-receive -- CMake From kwrobot at kitware.com Tue Jun 4 10:53:07 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Tue, 4 Jun 2019 10:53:07 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.14.5-1253-gdae9b3e Message-ID: <20190604145307.82FBE127B5E@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via dae9b3e16fdacda16ea28f47dd42d3243ba42be5 (commit) via 4272297b6ea84eec87d596f970b5ba4f9516f424 (commit) via 01d5730411561b7278d0350dffb8b7dd89ac8970 (commit) via e075e64fd80c3b63492232c7f9019ce65d1d8e4a (commit) from 4d80bd5cd5d7889fcd5d3b02519979034aec82e3 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=dae9b3e16fdacda16ea28f47dd42d3243ba42be5 commit dae9b3e16fdacda16ea28f47dd42d3243ba42be5 Merge: 4d80bd5 4272297 Author: Brad King AuthorDate: Tue Jun 4 14:51:45 2019 +0000 Commit: Kitware Robot CommitDate: Tue Jun 4 10:51:52 2019 -0400 Merge topic 'doc-3.15-relnotes' 4272297b6e Help: Organize and revise 3.15 release notes 01d5730411 Help: Consolidate 3.15 release notes e075e64fd8 Help: Document Swift_DEPENDENCIES_FILE property defaults Acked-by: Kitware Robot Merge-request: !3420 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4272297b6ea84eec87d596f970b5ba4f9516f424 commit 4272297b6ea84eec87d596f970b5ba4f9516f424 Author: Brad King AuthorDate: Tue Jun 4 09:55:17 2019 -0400 Commit: Brad King CommitDate: Tue Jun 4 10:37:29 2019 -0400 Help: Organize and revise 3.15 release notes Add section headers similar to the 3.14 release notes and move each individual bullet into an appropriate section. Revise a few bullets. diff --git a/Help/release/3.15.rst b/Help/release/3.15.rst index 5366ec7..2cff419 100644 --- a/Help/release/3.15.rst +++ b/Help/release/3.15.rst @@ -7,125 +7,190 @@ CMake 3.15 Release Notes Changes made since CMake 3.14 include the following. -* The :command:`execute_process` command gained a `COMMAND_ECHO` option - and supporting :variable:`CMAKE_EXECUTE_PROCESS_COMMAND_ECHO` variable - to enable echoing of the command-line string before execution. +New Features +============ -* New target property :prop_tgt:`ADDITIONAL_CLEAN_FILES` and directory property - :prop_dir:`ADDITIONAL_CLEAN_FILES` were added. They allow to register - additional files that should be removed during the clean stage. +Generators +---------- -* Directory property :prop_dir:`ADDITIONAL_MAKE_CLEAN_FILES` was marked - deprecated. The new directory property :prop_dir:`ADDITIONAL_CLEAN_FILES` - should be used instead. +* The :generator:`Xcode` generator now supports per-target schemes. + See the :variable:`CMAKE_XCODE_GENERATE_SCHEME` variable and + :prop_tgt:`XCODE_GENERATE_SCHEME` target property. -* IBM Clang-based XL compilers that define ``__ibmxl__`` now use the - compiler id ``XLClang`` instead of ``XL``. See policy :policy:`CMP0089`. +* The :generator:`Green Hills MULTI` generator has been updated: -* :command:`add_library` command ``ALIAS`` option learned to support - import libraries of the ``UNKNOWN`` type. + * It now supports the :command:`add_custom_command` and + :command:`add_custom_target` commands. + + * It is now available on Linux. + +Languages +--------- + +* Preliminary support for the ``Swift`` language was added to the + :generator:`Ninja` generator: + + * Use the :envvar:`SWIFTC` environment variable to specify a compiler. + + * The :prop_tgt:`Swift_DEPENDENCIES_FILE` target property and + :prop_sf:`Swift_DEPENDENCIES_FILE` source file property were added + to customize dependency files. -* AppleClang compiler have learned how to compile C++20. + * The :prop_tgt:`Swift_MODULE_NAME` target property was added to + customize the Swift module name. -* Support for the Clang-based ARM compiler was added with compiler id ``ARMClang``. + * The :prop_sf:`Swift_DIAGNOSTICS_FILE` source property was added to + indicate where to write the serialised Swift diagnostics. + + The Swift support is experimental, not considered stable, and may change + in future releases of CMake. + +Compilers +--------- * The ``Clang`` compiler variant on Windows that targets the MSVC ABI but has a GNU-like command line is now supported. -* The variable :variable:`CMAKE_AUTOMOC_RELAXED_MODE` is considered - deprecated. Support still exists but will be removed in future versions. - -* The :manual:`cmake(1)` ``--build`` tool ``--target`` parameter gained support for - multiple targets, e.g. ``cmake --build . --target Library1 Library2``. +* Support for the Clang-based ARM compiler was added with compiler id + ``ARMClang``. -* The :manual:`cmake(1)` ``-E tar`` tool now continues adding files to an - archive, even if some of the files aren't readable. This behavior is more - consistent with the classic ``tar`` tool. +* Support was added for the IAR compiler architectures Renesas RX, + RL78, RH850 and Texas Instruments MSP430. -* The :manual:`cmake(1)` ``-E tar`` tool now parses all flags, and if an - invalid flag was provided, a warning is issued. -* The :manual:`cmake(1)` ``-E tar`` tool now displays an error if no action - flag was specified, along with a list of possible actions: ``t`` (list), - ``c`` (create) or ``x`` (extract). +* Support was added for the IAR compilers built for Linux (IAR BuildLx). -* The :manual:`cmake(1)` ``-E tar`` tool allow for extract (``-x``) or list - (``-t``) only specific files or directories. To select pathnames append - a space-separated list of file names or directories. - When extracting selected files or directories, you must provide their exact - pathname, as printed by list (``-t``) +Command-Line +------------ -* The :manual:`cmake(1)` ``-E tar`` tool now support Zstandard compression - algorithm with ``--zstd`` option. Zstandard was designed to give - a compression ratio comparable to that of the DEFLATE (zip) algorithm, - but faster, especially for decompression. +* The :envvar:`CMAKE_GENERATOR` environment variable was added + to specify a default generator to use when :manual:`cmake(1)` is + run without a ``-G`` option. Additionally, environment variables + :envvar:`CMAKE_GENERATOR_PLATFORM`, :envvar:`CMAKE_GENERATOR_TOOLSET`, + and :envvar:`CMAKE_GENERATOR_INSTANCE` were created to configure + the generator. -* A :variable:`CMAKE_FRAMEWORK` variable was added to - initialize the :prop_tgt:`FRAMEWORK` property on all - targets. +* The :manual:`cmake(1)` ``--build`` tool ``--target`` parameter gained support + for multiple targets, e.g. ``cmake --build . --target Library1 Library2``. + It now also has a short form ``-t`` alias, e.g. + ``cmake --build . -t Library1 Library2``. -* A new ``--install`` option was added to :manual:`cmake(1)`. +* The :manual:`cmake(1)` command gained a new ``--install`` option. This may be used after building a project to run installation without using the generated build system or the native build tool. +* The :manual:`cmake(1)` command learned a new CLI option ``--loglevel``. + +* The :manual:`cmake(1)` ``-E remove_directory`` command-line tool learned + to support removing multiple directories. + +* The :manual:`cmake(1)` ``-E tar`` tool has been improved: + + * It now continues adding files to an archive even if some of the files + are not readable. This behavior is more consistent with the + classic ``tar`` tool. + + * It now parses all flags, and if an invalid flag was provided, a + warning is issued. + + * It now displays an error if no action flag was specified, along with a + list of possible actions: ``t`` (list), ``c`` (create) or ``x`` (extract). + + * It now supports extracting (``-x``) or listing (``-t``) only specific + files or directories. + + * It now supports Zstandard compression with a ``--zstd`` option. + Zstandard was designed to give a compression ratio comparable to that + of the DEFLATE (zip) algorithm, but faster, especially for decompression. + +Commands +-------- + +* The :command:`add_custom_command` and :command:`add_custom_target` commands + gained a new ``JOB_POOL`` option that works with the :generator:`Ninja` + generator to set the pool variable on the build statement. + +* The :command:`add_library` command ``ALIAS`` option learned to support + import libraries of the ``UNKNOWN`` type. + * The :command:`cmake_parse_arguments` command gained an additional ``_KEYWORDS_MISSING_VALUES`` output variable to report keyword arguments that were given by the caller with no values. -* The :manual:`cmake(1)` ``--target`` parameter gained shorter - version ``-t``, e.g. ``cmake --build . -t Library1 Library2`` is - equivalant to ``cmake --build . --target Library1 Library2``. - -* The :cpack_gen:`CPack IFW Generator` gained a new - :variable:`CPACK_IFW_PACKAGE_STYLE_SHEET` variable to customize the - installer stylesheet. +* The :command:`execute_process` command gained a ``COMMAND_ECHO`` option + and supporting :variable:`CMAKE_EXECUTE_PROCESS_COMMAND_ECHO` variable + to enable echoing of the command-line string before execution. -* The :command:`ctest_submit` command learned a new option: ``BUILD_ID``. - This can be used to store the ID assigned to this build by CDash to a - variable. +* The :command:`file(INSTALL)` command learned a new argument, + ``FOLLOW_SYMLINK_CHAIN``, which can be used to recursively resolve and + install symlinks. -* The :command:`ctest_update` command learned to honor a new variable: - :variable:`CTEST_UPDATE_VERSION_OVERRIDE`. This can be used to specify - the current version of your source tree rather than using the update - command to discover the current version that is checked out. +* :command:`list` learned new sub-commands: + ``PREPEND``, ``POP_FRONT`` and ``POP_BACK``. -* The ``$`` and ``$`` - :manual:`generator expressions ` were added. +* The :command:`message` command learned new types: + ``NOTICE``, ``VERBOSE``, ``DEBUG`` and ``TRACE``. -* The :envvar:`CMAKE_GENERATOR` environment variable was added - to specify a default generator to use when :manual:`cmake(1)` is - run without a ``-G`` option. Additionally, environment variables - :envvar:`CMAKE_GENERATOR_PLATFORM`, :envvar:`CMAKE_GENERATOR_TOOLSET`, - and :envvar:`CMAKE_GENERATOR_INSTANCE` were created to configure - the generator. +* The :command:`string` learned a new sub-command ``REPEAT``. -* An explicit deprecation diagnostic was added for policy ``CMP0066`` - (``CMP0065`` and below were already deprecated). - The :manual:`cmake-policies(7)` manual explains that the OLD behaviors - of all policies are deprecated and that projects should port to the - NEW behaviors. +Variables +--------- * The :variable:`CMAKE_CROSSCOMPILING_EMULATOR` variable and corresponding :prop_tgt:`CROSSCOMPILING_EMULATOR` target property learned to support arguments to the emulator. -* The :module:`FindEnvModules` module was added to use Lua- and TCL-based - environment modules in :ref:`CTest Scripts `. +* The :variable:`CMAKE_FIND_PACKAGE_PREFER_CONFIG` variable was added to tell + :command:`find_package` calls to look for a package configuration + file first even if a find module is available. -* The :command:`export(PACKAGE)` command now does nothing unless - enabled via :variable:`CMAKE_EXPORT_PACKAGE_REGISTRY`. - See policy :policy:`CMP0090`. +* The :variable:`CMAKE_FRAMEWORK` variable was added to initialize the + :prop_tgt:`FRAMEWORK` property on all targets. -* The :command:`file(INSTALL)` command learned a new argument, - ``FOLLOW_SYMLINK_CHAIN``, which can be used to recursively resolve and - install symlinks. +* The :variable:`CMAKE_VS_JUST_MY_CODE_DEBUGGING` variable and + :prop_tgt:`VS_JUST_MY_CODE_DEBUGGING` target property were added to + enable the Just My Code feature of the Visual Studio Debugger when + compiling with MSVC cl 19.05 and higher. -* The :command:`file(REMOVE)` and :command:`file(REMOVE_RECURSE)` commands - were changed to ignore empty arguments with a warning instead of treating - them as a relative path and removing the contents of the current directory. +* The :variable:`CMAKE_MSVC_RUNTIME_LIBRARY` variable and + :prop_tgt:`MSVC_RUNTIME_LIBRARY` target property were introduced to + select the runtime library used by compilers targeting the MSVC ABI. + See policy :policy:`CMP0091`. + +* The :variable:`CMAKE_PROJECT_INCLUDE` and + :variable:`CMAKE_PROJECT_INCLUDE_BEFORE` variables were added to allow + injection of custom code at the sites of :command:`project` calls + without knowing the project name a priori. + +Properties +---------- + +* The :prop_tgt:`ADDITIONAL_CLEAN_FILES` target property and + :prop_dir:`ADDITIONAL_CLEAN_FILES` directory property were added. + They allow to register additional files that should be removed during + the clean stage. + +* The :prop_tgt:`PUBLIC_HEADER` and :prop_tgt:`PRIVATE_HEADER` properties + may now be set on :ref:`Interface Libraries`. The headers specified by those + properties can be installed using the :command:`install(TARGETS)` command by + passing the ``PUBLIC_HEADER`` and ``PRIVATE_HEADER`` arguments respectively. + +* The :prop_tgt:`VS_PACKAGE_REFERENCES` target property was added to + tell :ref:`Visual Studio Generators` to add references to ``nuget`` + packages. + +* The :prop_tgt:`VS_PROJECT_IMPORT` target property was added to allow + managed Visual Studio project files to import external ``.props`` files. + +* The :prop_tgt:`VS_NO_SOLUTION_DEPLOY` target property was added to + tell :ref:`Visual Studio Generators` whether to deploy an artifact + to the WinCE or Windows Phone target device. + +Modules +------- -* The :module:`FindBoost` module was reworked to expose a more - consistent user experience between its config and module modes - and with other find modules in general. +* The :module:`FindBoost` module was reworked to expose a more consistent + user experience between its "Config" and "Module" modes and with other + find modules in general. * A new imported target ``Boost::headers`` is now defined (same as ``Boost::boost``). @@ -135,46 +200,33 @@ Changes made since CMake 3.14 include the following. ``Boost_VERSION_PATCH``, and ``Boost_VERSION_COUNT`` were added. - * The internal logic for determining the value for - ``Boost_FOUND``, for version and component checks, and - for reporting the result to the user was replaced with - the :module:`FindPackageHandleStandardArgs` module. (This - fixed a bug that sometimes printed wrong status - messages in config mode.) - * The ``QUIET`` argument passed to :command:`find_package` is no - longer ignored in config mode. - - * *Known issue*: The CMake package shipped with Boost ``1.70.0`` - ignores the ``QUIET`` argument passed to :command:`find_package`. - This is fixed in the next Boost release. + longer ignored in config mode. Note that the CMake package shipped with + Boost ``1.70.0`` ignores the ``QUIET`` argument passed to + :command:`find_package`. This is fixed in the next Boost release. - * The input switch ``Boost_DETAILED_FAILURE_MSG`` was - removed. + * The input switch ``Boost_DETAILED_FAILURE_MSG`` was removed. * ``Boost_VERSION`` now reports the version in ``x.y.z`` format in module mode. See policy :policy:`CMP0093`. * The :module:`FindCups` module now provides imported targets. +* The :module:`FindEnvModules` module was added to use Lua- and TCL-based + environment modules in :ref:`CTest Scripts `. + * The :module:`FindGLEW` module now provides an interface more consistent with what upstream GLEW provides in its own CMake package files. -* Variable :variable:`CMAKE_FIND_PACKAGE_PREFER_CONFIG` was added to tell - :command:`find_package` calls to look for a package configuration - file first even if a find module is available. +* The :module:`FindPkgConfig` now populates :prop_tgt:`INTERFACE_LINK_OPTIONS` + property of imported targets with other (non-library) linker flags. * The :module:`FindPostgreSQL` module learned to find debug and release variants separately. * Modules :module:`FindPython3`, :module:`FindPython2` and :module:`FindPython` - have changed default strategy for lookup. See policy :policy:`CMP0094`. - -* Modules :module:`FindPython3`, :module:`FindPython2` and :module:`FindPython` - gain a new variable to control frameworks lookup on macOS. - -* Modules :module:`FindPython3`, :module:`FindPython2` and :module:`FindPython` - gain a new way to control lookup strategy. + gained additional lookup strategies and controls, and a new default. + See policy :policy:`CMP0094`. * Modules :module:`FindPython`, :module:`FindPython2` and :module:`FindPython3` gain a new target (respectively ``Python::Module``, ``Python2::Module`` @@ -183,143 +235,113 @@ Changes made since CMake 3.14 include the following. * Modules :module:`FindPython3`, :module:`FindPython2` and :module:`FindPython` gain capability to control how virtual environments are handled. +* The :module:`UseSWIG` module learned to manage alternate library names + by passing ``-interface `` for ``python`` language or + ``-dllimport `` for ``CSharp`` language to the ``SWIG`` + compiler. + +Generator Expressions +--------------------- + * The :manual:`generator expressions ` ``C_COMPILER_ID``, ``CXX_COMPILER_ID``, ``CUDA_COMPILER_ID``, ``Fortran_COMPILER_ID``, ``COMPILE_LANGUAGE``, ``COMPILE_LANG_AND_ID``, and ``PLATFORM_ID`` learned to support matching one value from a comma-separated list. -* A new ``COMPILE_LANG_AND_ID`` generator expression was introduced to +* The ``$`` and ``$`` + :manual:`generator expressions ` were added. + +* The ``$`` generator expression was introduced to allow specification of compile options for target files based on the :variable:`CMAKE__COMPILER_ID` and :prop_sf:`LANGUAGE` of each source file. -* A new ``$`` +* A ``$`` :manual:`generator expression ` has been added. -* New ``$``, ``$`` - and ``$`` - :manual:`generator expressions ` have been - added to retrieve the base name of various artifacts. - -* New ``$``, ``$``, - ``$`` and ``$`` - :manual:`generator expressions ` have been - added to retrieve the prefix and suffix of various artifacts. - -* The :generator:`Green Hills MULTI` generator now supports - :command:`add_custom_command` and :command:`add_custom_target` - -* The :generator:`Green Hills MULTI` generator is now available on Linux. - -* Support was added for the IAR compiler architectures Renesas RX, - RL78, RH850 and Texas Instruments MSP430. -* The IAR compilers built for Linux (IAR BuildLx) now work as well. - -* ``INTERFACE`` library can now have :prop_tgt:`PUBLIC_HEADER` and - :prop_tgt:`PRIVATE_HEADER` properties set. The headers specified by those - properties can be installed using the :command:`install(TARGETS)` command by - passing the ``PUBLIC_HEADER`` and ``PRIVATE_HEADER`` arguments respectively. - -* :command:`list` learned new sub-commands ``PREPEND``, ``POP_FRONT`` and ``POP_BACK``. - -* The :variable:`CMAKE_MSVC_RUNTIME_LIBRARY` variable and - :prop_tgt:`MSVC_RUNTIME_LIBRARY` target property were introduced to - select the runtime library used by compilers targeting the MSVC ABI. - See policy :policy:`CMP0091`. - -* With MSVC-like compilers the value of :variable:`CMAKE__FLAGS` - no longer contains warning flags like ``/W3`` by default. - See policy :policy:`CMP0092`. +* A ``$`` + :manual:`generator expression ` + has been added. -* The :command:`message` command learned new types: ``NOTICE``, ``VERBOSE``, - ``DEBUG`` and ``TRACE``. +* The ``$`` :manual:`generator expression + ` gained support for a list of paths. -* The :manual:`cmake(1)` command learned a new CLI option ``--loglevel``. +* New ``$`` :manual:`generator expressions + ` were added to retrieve the prefix, base + name, and suffix of the file names of various artifacts: -* The commands :command:`add_custom_command` and :command:`add_custom_target` - gained a new ``JOB_POOL`` option that works with the :generator:`Ninja` - generator to set the pool variable on the build statement. + * ``$`` + * ``$`` + * ``$`` + * ``$`` + * ``$`` + * ``$`` + * ``$`` -* The :module:`FindPkgConfig` now populates :prop_tgt:`INTERFACE_LINK_OPTIONS` - property of imported targets with other (non-library) linker flags. +* The ``$`` :manual:`generator expression + ` is now supported on ``SHARED``, + ``STATIC``, ``MODULE`` libraries and executables. -* A variable :variable:`CMAKE_PROJECT_INCLUDE_BEFORE` was added to allow - injection of custom code before the :command:`project` call. +CTest +----- -* A variable :variable:`CMAKE_PROJECT_INCLUDE` was added to allow injection - of custom code into the project without knowing the project name a priori. +* The :command:`ctest_submit` command learned a new option: ``BUILD_ID``. + This can be used to store the ID assigned to this build by CDash to a + variable. -* The ``TARGET_OBJECTS`` :manual:`generator expression ` - is now supported on ``SHARED``, ``STATIC``, ``MODULE`` libraries and executables. +* The :command:`ctest_update` command learned to honor a new variable: + :variable:`CTEST_UPDATE_VERSION_OVERRIDE`. This can be used to specify + the current version of your source tree rather than using the update + command to discover the current version that is checked out. -* The :manual:`cmake(1)` ``-E remove_directory`` command learned to support - removing multiple directories. +CPack +----- -* A new ``$`` - :manual:`generator expression ` - has been added. +* The :cpack_gen:`CPack IFW Generator` gained a new + :variable:`CPACK_IFW_PACKAGE_STYLE_SHEET` variable to customize the + installer stylesheet. -* The :generator:`Xcode` generator now requires at least Xcode 5. +Deprecated and Removed Features +=============================== * The :manual:`cmake-server(7)` mode has been deprecated and will be removed from a future version of CMake. Please port clients to use the :manual:`cmake-file-api(7)` instead. -* The ``$`` :manual:`generator expression - ` gained support for a list of paths. - -* The :command:`string` learned a new sub-command ``REPEAT``. - -* SunPro compiler have learned how to compile C++14. - -* Preliminary support for the Swift language with the :generator:`Ninja` - generator was added. Use the :envvar:`SWIFTC` environment variable to - specify a compiler. +* The :prop_dir:`ADDITIONAL_MAKE_CLEAN_FILES` directory property is now + deprecated. Use the :prop_dir:`ADDITIONAL_CLEAN_FILES` directory property + instead. -* Support to emit an output file map was added to enable Swift compilation. - -* A target property :prop_tgt:`Swift_DEPENDENCIES_FILE` was added to targets to - indicate where to save the target swift dependencies file. If one is not - specified, it will default to `.swiftdeps`. - -* A target property :prop_tgt:`Swift_MODULE_NAME` was added to targets to - indicate the Swift module name. If it is not specified, it will default to - the name of the target. - -* A source property :prop_sf:`Swift_DEPENDENCIES_FILE` was added to sources to - indicate where to save the target swift dependencies file. If one is not - specified, it will default to `.swiftdeps`. +* The variable :variable:`CMAKE_AUTOMOC_RELAXED_MODE` is considered + deprecated. Support still exists but will be removed in future versions. -* A source property :prop_sf:`Swift_DIAGNOSTICS_FILE` was added to sources to - indicate where to write the serialised Swift diagnostics. +* The :command:`export(PACKAGE)` command now does nothing unless + enabled via :variable:`CMAKE_EXPORT_PACKAGE_REGISTRY`. + See policy :policy:`CMP0090`. -* The :module:`UseSWIG` module learned to manage alternate library names by - passing ``-interface `` for ``python`` language or - ``-dllimport `` for ``CSharp`` language to the ``SWIG`` - compiler. +* The :generator:`Xcode` generator now requires at least Xcode 5. -* A :prop_tgt:`VS_PACKAGE_REFERENCES` target property was added to - tell :ref:`Visual Studio Generators` to add references to nuget - packages. +* An explicit deprecation diagnostic was added for policy ``CMP0066`` + (``CMP0065`` and below were already deprecated). + The :manual:`cmake-policies(7)` manual explains that the OLD behaviors + of all policies are deprecated and that projects should port to the + NEW behaviors. -* For the :ref:`Visual Studio Generators`, - :ref:`Makefile Generators`, and the :generator:`Ninja` generators - the Just My Code feature of the Visual Studio Debugger can be - leveraged by turning on the :prop_tgt:`VS_JUST_MY_CODE_DEBUGGING` target - property. Its default value is provided by the variable - :variable:`CMAKE_VS_JUST_MY_CODE_DEBUGGING`. +Other Changes +============= -* The :prop_tgt:`VS_PROJECT_IMPORT` target property was added which allows - to import external .props files in managed Visual Studio targets. +* CMake learned how to compile C++14 with the IBM AIX XL compiler + and the SunPro compiler and to compile C++20 with the AppleClang compiler. -* A :prop_tgt:`VS_NO_SOLUTION_DEPLOY` target property was added to - tell :ref:`Visual Studio Generators` whether to deploy an artifact - to the WinCE or Windows Phone target device. +* With MSVC-like compilers the value of :variable:`CMAKE__FLAGS` + no longer contains warning flags like ``/W3`` by default. + See policy :policy:`CMP0092`. -* The :generator:`Xcode` generator now supports per-target schemes. - See the :variable:`CMAKE_XCODE_GENERATE_SCHEME` variable and - :prop_tgt:`XCODE_GENERATE_SCHEME` target property. +* IBM Clang-based XL compilers that define ``__ibmxl__`` now use the + compiler id ``XLClang`` instead of ``XL``. See policy :policy:`CMP0089`. -* IBM AIX XL compiler have learned how to compile C++14. +* The :command:`file(REMOVE)` and :command:`file(REMOVE_RECURSE)` commands + were changed to ignore empty arguments with a warning instead of treating + them as a relative path and removing the contents of the current directory. https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=01d5730411561b7278d0350dffb8b7dd89ac8970 commit 01d5730411561b7278d0350dffb8b7dd89ac8970 Author: Brad King AuthorDate: Tue Jun 4 08:50:40 2019 -0400 Commit: Brad King CommitDate: Tue Jun 4 09:55:37 2019 -0400 Help: Consolidate 3.15 release notes Run the `Utilities/Release/consolidate-relnotes.bash` script to move notes from `Help/release/dev/*` into `Help/release/3.15.rst`. diff --git a/Help/release/3.15.rst b/Help/release/3.15.rst new file mode 100644 index 0000000..5366ec7 --- /dev/null +++ b/Help/release/3.15.rst @@ -0,0 +1,325 @@ +CMake 3.15 Release Notes +************************ + +.. only:: html + + .. contents:: + +Changes made since CMake 3.14 include the following. + +* The :command:`execute_process` command gained a `COMMAND_ECHO` option + and supporting :variable:`CMAKE_EXECUTE_PROCESS_COMMAND_ECHO` variable + to enable echoing of the command-line string before execution. + +* New target property :prop_tgt:`ADDITIONAL_CLEAN_FILES` and directory property + :prop_dir:`ADDITIONAL_CLEAN_FILES` were added. They allow to register + additional files that should be removed during the clean stage. + +* Directory property :prop_dir:`ADDITIONAL_MAKE_CLEAN_FILES` was marked + deprecated. The new directory property :prop_dir:`ADDITIONAL_CLEAN_FILES` + should be used instead. + +* IBM Clang-based XL compilers that define ``__ibmxl__`` now use the + compiler id ``XLClang`` instead of ``XL``. See policy :policy:`CMP0089`. + +* :command:`add_library` command ``ALIAS`` option learned to support + import libraries of the ``UNKNOWN`` type. + +* AppleClang compiler have learned how to compile C++20. + +* Support for the Clang-based ARM compiler was added with compiler id ``ARMClang``. + +* The ``Clang`` compiler variant on Windows that targets the MSVC ABI + but has a GNU-like command line is now supported. + +* The variable :variable:`CMAKE_AUTOMOC_RELAXED_MODE` is considered + deprecated. Support still exists but will be removed in future versions. + +* The :manual:`cmake(1)` ``--build`` tool ``--target`` parameter gained support for + multiple targets, e.g. ``cmake --build . --target Library1 Library2``. + +* The :manual:`cmake(1)` ``-E tar`` tool now continues adding files to an + archive, even if some of the files aren't readable. This behavior is more + consistent with the classic ``tar`` tool. + +* The :manual:`cmake(1)` ``-E tar`` tool now parses all flags, and if an + invalid flag was provided, a warning is issued. +* The :manual:`cmake(1)` ``-E tar`` tool now displays an error if no action + flag was specified, along with a list of possible actions: ``t`` (list), + ``c`` (create) or ``x`` (extract). + +* The :manual:`cmake(1)` ``-E tar`` tool allow for extract (``-x``) or list + (``-t``) only specific files or directories. To select pathnames append + a space-separated list of file names or directories. + When extracting selected files or directories, you must provide their exact + pathname, as printed by list (``-t``) + +* The :manual:`cmake(1)` ``-E tar`` tool now support Zstandard compression + algorithm with ``--zstd`` option. Zstandard was designed to give + a compression ratio comparable to that of the DEFLATE (zip) algorithm, + but faster, especially for decompression. + +* A :variable:`CMAKE_FRAMEWORK` variable was added to + initialize the :prop_tgt:`FRAMEWORK` property on all + targets. + +* A new ``--install`` option was added to :manual:`cmake(1)`. + This may be used after building a project to run installation without + using the generated build system or the native build tool. + +* The :command:`cmake_parse_arguments` command gained an additional + ``_KEYWORDS_MISSING_VALUES`` output variable to report + keyword arguments that were given by the caller with no values. + +* The :manual:`cmake(1)` ``--target`` parameter gained shorter + version ``-t``, e.g. ``cmake --build . -t Library1 Library2`` is + equivalant to ``cmake --build . --target Library1 Library2``. + +* The :cpack_gen:`CPack IFW Generator` gained a new + :variable:`CPACK_IFW_PACKAGE_STYLE_SHEET` variable to customize the + installer stylesheet. + +* The :command:`ctest_submit` command learned a new option: ``BUILD_ID``. + This can be used to store the ID assigned to this build by CDash to a + variable. + +* The :command:`ctest_update` command learned to honor a new variable: + :variable:`CTEST_UPDATE_VERSION_OVERRIDE`. This can be used to specify + the current version of your source tree rather than using the update + command to discover the current version that is checked out. + +* The ``$`` and ``$`` + :manual:`generator expressions ` were added. + +* The :envvar:`CMAKE_GENERATOR` environment variable was added + to specify a default generator to use when :manual:`cmake(1)` is + run without a ``-G`` option. Additionally, environment variables + :envvar:`CMAKE_GENERATOR_PLATFORM`, :envvar:`CMAKE_GENERATOR_TOOLSET`, + and :envvar:`CMAKE_GENERATOR_INSTANCE` were created to configure + the generator. + +* An explicit deprecation diagnostic was added for policy ``CMP0066`` + (``CMP0065`` and below were already deprecated). + The :manual:`cmake-policies(7)` manual explains that the OLD behaviors + of all policies are deprecated and that projects should port to the + NEW behaviors. + +* The :variable:`CMAKE_CROSSCOMPILING_EMULATOR` variable and corresponding + :prop_tgt:`CROSSCOMPILING_EMULATOR` target property learned to support + arguments to the emulator. + +* The :module:`FindEnvModules` module was added to use Lua- and TCL-based + environment modules in :ref:`CTest Scripts `. + +* The :command:`export(PACKAGE)` command now does nothing unless + enabled via :variable:`CMAKE_EXPORT_PACKAGE_REGISTRY`. + See policy :policy:`CMP0090`. + +* The :command:`file(INSTALL)` command learned a new argument, + ``FOLLOW_SYMLINK_CHAIN``, which can be used to recursively resolve and + install symlinks. + +* The :command:`file(REMOVE)` and :command:`file(REMOVE_RECURSE)` commands + were changed to ignore empty arguments with a warning instead of treating + them as a relative path and removing the contents of the current directory. + +* The :module:`FindBoost` module was reworked to expose a more + consistent user experience between its config and module modes + and with other find modules in general. + + * A new imported target ``Boost::headers`` is now defined (same + as ``Boost::boost``). + + * New output variables ``Boost_VERSION_MACRO``, + ``Boost_VERSION_MAJOR``, ``Boost_VERSION_MINOR``, + ``Boost_VERSION_PATCH``, and ``Boost_VERSION_COUNT`` + were added. + + * The internal logic for determining the value for + ``Boost_FOUND``, for version and component checks, and + for reporting the result to the user was replaced with + the :module:`FindPackageHandleStandardArgs` module. (This + fixed a bug that sometimes printed wrong status + messages in config mode.) + + * The ``QUIET`` argument passed to :command:`find_package` is no + longer ignored in config mode. + + * *Known issue*: The CMake package shipped with Boost ``1.70.0`` + ignores the ``QUIET`` argument passed to :command:`find_package`. + This is fixed in the next Boost release. + + * The input switch ``Boost_DETAILED_FAILURE_MSG`` was + removed. + + * ``Boost_VERSION`` now reports the version in ``x.y.z`` + format in module mode. See policy :policy:`CMP0093`. + +* The :module:`FindCups` module now provides imported targets. + +* The :module:`FindGLEW` module now provides an interface more consistent + with what upstream GLEW provides in its own CMake package files. + +* Variable :variable:`CMAKE_FIND_PACKAGE_PREFER_CONFIG` was added to tell + :command:`find_package` calls to look for a package configuration + file first even if a find module is available. + +* The :module:`FindPostgreSQL` module learned to find debug and release + variants separately. + +* Modules :module:`FindPython3`, :module:`FindPython2` and :module:`FindPython` + have changed default strategy for lookup. See policy :policy:`CMP0094`. + +* Modules :module:`FindPython3`, :module:`FindPython2` and :module:`FindPython` + gain a new variable to control frameworks lookup on macOS. + +* Modules :module:`FindPython3`, :module:`FindPython2` and :module:`FindPython` + gain a new way to control lookup strategy. + +* Modules :module:`FindPython`, :module:`FindPython2` and :module:`FindPython3` + gain a new target (respectively ``Python::Module``, ``Python2::Module`` + and ``Python3::Module``) which can be used to develop Python modules. + +* Modules :module:`FindPython3`, :module:`FindPython2` and :module:`FindPython` + gain capability to control how virtual environments are handled. + +* The :manual:`generator expressions ` + ``C_COMPILER_ID``, ``CXX_COMPILER_ID``, ``CUDA_COMPILER_ID``, + ``Fortran_COMPILER_ID``, ``COMPILE_LANGUAGE``, ``COMPILE_LANG_AND_ID``, and + ``PLATFORM_ID`` learned to support matching one value from a comma-separated + list. + +* A new ``COMPILE_LANG_AND_ID`` generator expression was introduced to + allow specification of compile options for target files based on the + :variable:`CMAKE__COMPILER_ID` and :prop_sf:`LANGUAGE` of + each source file. + +* A new ``$`` + :manual:`generator expression ` + has been added. + +* New ``$``, ``$`` + and ``$`` + :manual:`generator expressions ` have been + added to retrieve the base name of various artifacts. + +* New ``$``, ``$``, + ``$`` and ``$`` + :manual:`generator expressions ` have been + added to retrieve the prefix and suffix of various artifacts. + +* The :generator:`Green Hills MULTI` generator now supports + :command:`add_custom_command` and :command:`add_custom_target` + +* The :generator:`Green Hills MULTI` generator is now available on Linux. + +* Support was added for the IAR compiler architectures Renesas RX, + RL78, RH850 and Texas Instruments MSP430. +* The IAR compilers built for Linux (IAR BuildLx) now work as well. + +* ``INTERFACE`` library can now have :prop_tgt:`PUBLIC_HEADER` and + :prop_tgt:`PRIVATE_HEADER` properties set. The headers specified by those + properties can be installed using the :command:`install(TARGETS)` command by + passing the ``PUBLIC_HEADER`` and ``PRIVATE_HEADER`` arguments respectively. + +* :command:`list` learned new sub-commands ``PREPEND``, ``POP_FRONT`` and ``POP_BACK``. + +* The :variable:`CMAKE_MSVC_RUNTIME_LIBRARY` variable and + :prop_tgt:`MSVC_RUNTIME_LIBRARY` target property were introduced to + select the runtime library used by compilers targeting the MSVC ABI. + See policy :policy:`CMP0091`. + +* With MSVC-like compilers the value of :variable:`CMAKE__FLAGS` + no longer contains warning flags like ``/W3`` by default. + See policy :policy:`CMP0092`. + +* The :command:`message` command learned new types: ``NOTICE``, ``VERBOSE``, + ``DEBUG`` and ``TRACE``. + +* The :manual:`cmake(1)` command learned a new CLI option ``--loglevel``. + +* The commands :command:`add_custom_command` and :command:`add_custom_target` + gained a new ``JOB_POOL`` option that works with the :generator:`Ninja` + generator to set the pool variable on the build statement. + +* The :module:`FindPkgConfig` now populates :prop_tgt:`INTERFACE_LINK_OPTIONS` + property of imported targets with other (non-library) linker flags. + +* A variable :variable:`CMAKE_PROJECT_INCLUDE_BEFORE` was added to allow + injection of custom code before the :command:`project` call. + +* A variable :variable:`CMAKE_PROJECT_INCLUDE` was added to allow injection + of custom code into the project without knowing the project name a priori. + +* The ``TARGET_OBJECTS`` :manual:`generator expression ` + is now supported on ``SHARED``, ``STATIC``, ``MODULE`` libraries and executables. + +* The :manual:`cmake(1)` ``-E remove_directory`` command learned to support + removing multiple directories. + +* A new ``$`` + :manual:`generator expression ` + has been added. + +* The :generator:`Xcode` generator now requires at least Xcode 5. + +* The :manual:`cmake-server(7)` mode has been deprecated and will be + removed from a future version of CMake. Please port clients to use + the :manual:`cmake-file-api(7)` instead. + +* The ``$`` :manual:`generator expression + ` gained support for a list of paths. + +* The :command:`string` learned a new sub-command ``REPEAT``. + +* SunPro compiler have learned how to compile C++14. + +* Preliminary support for the Swift language with the :generator:`Ninja` + generator was added. Use the :envvar:`SWIFTC` environment variable to + specify a compiler. + +* Support to emit an output file map was added to enable Swift compilation. + +* A target property :prop_tgt:`Swift_DEPENDENCIES_FILE` was added to targets to + indicate where to save the target swift dependencies file. If one is not + specified, it will default to `.swiftdeps`. + +* A target property :prop_tgt:`Swift_MODULE_NAME` was added to targets to + indicate the Swift module name. If it is not specified, it will default to + the name of the target. + +* A source property :prop_sf:`Swift_DEPENDENCIES_FILE` was added to sources to + indicate where to save the target swift dependencies file. If one is not + specified, it will default to `.swiftdeps`. + +* A source property :prop_sf:`Swift_DIAGNOSTICS_FILE` was added to sources to + indicate where to write the serialised Swift diagnostics. + +* The :module:`UseSWIG` module learned to manage alternate library names by + passing ``-interface `` for ``python`` language or + ``-dllimport `` for ``CSharp`` language to the ``SWIG`` + compiler. + +* A :prop_tgt:`VS_PACKAGE_REFERENCES` target property was added to + tell :ref:`Visual Studio Generators` to add references to nuget + packages. + +* For the :ref:`Visual Studio Generators`, + :ref:`Makefile Generators`, and the :generator:`Ninja` generators + the Just My Code feature of the Visual Studio Debugger can be + leveraged by turning on the :prop_tgt:`VS_JUST_MY_CODE_DEBUGGING` target + property. Its default value is provided by the variable + :variable:`CMAKE_VS_JUST_MY_CODE_DEBUGGING`. + +* The :prop_tgt:`VS_PROJECT_IMPORT` target property was added which allows + to import external .props files in managed Visual Studio targets. + +* A :prop_tgt:`VS_NO_SOLUTION_DEPLOY` target property was added to + tell :ref:`Visual Studio Generators` whether to deploy an artifact + to the WinCE or Windows Phone target device. + +* The :generator:`Xcode` generator now supports per-target schemes. + See the :variable:`CMAKE_XCODE_GENERATE_SCHEME` variable and + :prop_tgt:`XCODE_GENERATE_SCHEME` target property. + +* IBM AIX XL compiler have learned how to compile C++14. diff --git a/Help/release/dev/CMAKE_FRAMEWORK.rst b/Help/release/dev/CMAKE_FRAMEWORK.rst deleted file mode 100644 index 0253e04..0000000 --- a/Help/release/dev/CMAKE_FRAMEWORK.rst +++ /dev/null @@ -1,6 +0,0 @@ -CMAKE_FRAMEWORK ---------------- - -* A :variable:`CMAKE_FRAMEWORK` variable was added to - initialize the :prop_tgt:`FRAMEWORK` property on all - targets. diff --git a/Help/release/dev/FindBoost-fphsa.rst b/Help/release/dev/FindBoost-fphsa.rst deleted file mode 100644 index 30a4b13..0000000 --- a/Help/release/dev/FindBoost-fphsa.rst +++ /dev/null @@ -1,34 +0,0 @@ -FindBoost-fphsa ---------------- - -* The :module:`FindBoost` module was reworked to expose a more - consistent user experience between its config and module modes - and with other find modules in general. - - * A new imported target ``Boost::headers`` is now defined (same - as ``Boost::boost``). - - * New output variables ``Boost_VERSION_MACRO``, - ``Boost_VERSION_MAJOR``, ``Boost_VERSION_MINOR``, - ``Boost_VERSION_PATCH``, and ``Boost_VERSION_COUNT`` - were added. - - * The internal logic for determining the value for - ``Boost_FOUND``, for version and component checks, and - for reporting the result to the user was replaced with - the :module:`FindPackageHandleStandardArgs` module. (This - fixed a bug that sometimes printed wrong status - messages in config mode.) - - * The ``QUIET`` argument passed to :command:`find_package` is no - longer ignored in config mode. - - * *Known issue*: The CMake package shipped with Boost ``1.70.0`` - ignores the ``QUIET`` argument passed to :command:`find_package`. - This is fixed in the next Boost release. - - * The input switch ``Boost_DETAILED_FAILURE_MSG`` was - removed. - - * ``Boost_VERSION`` now reports the version in ``x.y.z`` - format in module mode. See policy :policy:`CMP0093`. diff --git a/Help/release/dev/FindCups-imported-target.rst b/Help/release/dev/FindCups-imported-target.rst deleted file mode 100644 index 0fd9178..0000000 --- a/Help/release/dev/FindCups-imported-target.rst +++ /dev/null @@ -1,4 +0,0 @@ -FindCups-imported-target ------------------------- - -* The :module:`FindCups` module now provides imported targets. diff --git a/Help/release/dev/FindGLEW-updates.rst b/Help/release/dev/FindGLEW-updates.rst deleted file mode 100644 index 6487052..0000000 --- a/Help/release/dev/FindGLEW-updates.rst +++ /dev/null @@ -1,5 +0,0 @@ -FindGLEW-updates ----------------- - -* The :module:`FindGLEW` module now provides an interface more consistent - with what upstream GLEW provides in its own CMake package files. diff --git a/Help/release/dev/FindPostgreSQL-config-support.rst b/Help/release/dev/FindPostgreSQL-config-support.rst deleted file mode 100644 index f24dc68..0000000 --- a/Help/release/dev/FindPostgreSQL-config-support.rst +++ /dev/null @@ -1,5 +0,0 @@ -FindPostgreSQL-config-support ------------------------------ - -* The :module:`FindPostgreSQL` module learned to find debug and release - variants separately. diff --git a/Help/release/dev/FindPython-CMP0094.rst b/Help/release/dev/FindPython-CMP0094.rst deleted file mode 100644 index 43442fc..0000000 --- a/Help/release/dev/FindPython-CMP0094.rst +++ /dev/null @@ -1,5 +0,0 @@ -FindPython-CMP0094 ------------------- - -* Modules :module:`FindPython3`, :module:`FindPython2` and :module:`FindPython` - have changed default strategy for lookup. See policy :policy:`CMP0094`. diff --git a/Help/release/dev/FindPython-FIND_FRAMEWORK.rst b/Help/release/dev/FindPython-FIND_FRAMEWORK.rst deleted file mode 100644 index f390460..0000000 --- a/Help/release/dev/FindPython-FIND_FRAMEWORK.rst +++ /dev/null @@ -1,5 +0,0 @@ -FindPython-FIND_FRAMEWORK -------------------------- - -* Modules :module:`FindPython3`, :module:`FindPython2` and :module:`FindPython` - gain a new variable to control frameworks lookup on macOS. diff --git a/Help/release/dev/FindPython-FIND_STRATEGY.rst b/Help/release/dev/FindPython-FIND_STRATEGY.rst deleted file mode 100644 index 1d06e04..0000000 --- a/Help/release/dev/FindPython-FIND_STRATEGY.rst +++ /dev/null @@ -1,5 +0,0 @@ -FindPython-FIND_STRATEGY ------------------------- - -* Modules :module:`FindPython3`, :module:`FindPython2` and :module:`FindPython` - gain a new way to control lookup strategy. diff --git a/Help/release/dev/FindPython-module.rst b/Help/release/dev/FindPython-module.rst deleted file mode 100644 index 79ff9d8..0000000 --- a/Help/release/dev/FindPython-module.rst +++ /dev/null @@ -1,6 +0,0 @@ -FindPython-module ------------------ - -* Modules :module:`FindPython`, :module:`FindPython2` and :module:`FindPython3` - gain a new target (respectively ``Python::Module``, ``Python2::Module`` - and ``Python3::Module``) which can be used to develop Python modules. diff --git a/Help/release/dev/FindPython-virtual-env.rst b/Help/release/dev/FindPython-virtual-env.rst deleted file mode 100644 index 5489dc2..0000000 --- a/Help/release/dev/FindPython-virtual-env.rst +++ /dev/null @@ -1,5 +0,0 @@ -FindPython-virtual-env ----------------------- - -* Modules :module:`FindPython3`, :module:`FindPython2` and :module:`FindPython` - gain capability to control how virtual environments are handled. diff --git a/Help/release/dev/UseSWIG-alternate-library-name.rst b/Help/release/dev/UseSWIG-alternate-library-name.rst deleted file mode 100644 index 8e58b8d..0000000 --- a/Help/release/dev/UseSWIG-alternate-library-name.rst +++ /dev/null @@ -1,7 +0,0 @@ -UseSWIG-alternate-library-name ------------------------------- - -* The :module:`UseSWIG` module learned to manage alternate library names by - passing ``-interface `` for ``python`` language or - ``-dllimport `` for ``CSharp`` language to the ``SWIG`` - compiler. diff --git a/Help/release/dev/add-execute_process-command-echo.rst b/Help/release/dev/add-execute_process-command-echo.rst deleted file mode 100644 index a44e40e..0000000 --- a/Help/release/dev/add-execute_process-command-echo.rst +++ /dev/null @@ -1,6 +0,0 @@ -add-execute_process-command-echo --------------------------------- - -* The :command:`execute_process` command gained a `COMMAND_ECHO` option - and supporting :variable:`CMAKE_EXECUTE_PROCESS_COMMAND_ECHO` variable - to enable echoing of the command-line string before execution. diff --git a/Help/release/dev/add-xlclang.rst b/Help/release/dev/add-xlclang.rst deleted file mode 100644 index 77ff938..0000000 --- a/Help/release/dev/add-xlclang.rst +++ /dev/null @@ -1,5 +0,0 @@ -add-xlclang ------------ - -* IBM Clang-based XL compilers that define ``__ibmxl__`` now use the - compiler id ``XLClang`` instead of ``XL``. See policy :policy:`CMP0089`. diff --git a/Help/release/dev/additional_clean_files.rst b/Help/release/dev/additional_clean_files.rst deleted file mode 100644 index 9b56642..0000000 --- a/Help/release/dev/additional_clean_files.rst +++ /dev/null @@ -1,10 +0,0 @@ -additional_clean_files ----------------------- - -* New target property :prop_tgt:`ADDITIONAL_CLEAN_FILES` and directory property - :prop_dir:`ADDITIONAL_CLEAN_FILES` were added. They allow to register - additional files that should be removed during the clean stage. - -* Directory property :prop_dir:`ADDITIONAL_MAKE_CLEAN_FILES` was marked - deprecated. The new directory property :prop_dir:`ADDITIONAL_CLEAN_FILES` - should be used instead. diff --git a/Help/release/dev/allow-aliasing-unkown-import-targets.rst b/Help/release/dev/allow-aliasing-unkown-import-targets.rst deleted file mode 100644 index aa5da0c..0000000 --- a/Help/release/dev/allow-aliasing-unkown-import-targets.rst +++ /dev/null @@ -1,5 +0,0 @@ -allow-aliasing-unkown-import-targets ------------------------------------- - -* :command:`add_library` command ``ALIAS`` option learned to support - import libraries of the ``UNKNOWN`` type. diff --git a/Help/release/dev/apple-clang-supports-cxx20.rst b/Help/release/dev/apple-clang-supports-cxx20.rst deleted file mode 100644 index f19ee68..0000000 --- a/Help/release/dev/apple-clang-supports-cxx20.rst +++ /dev/null @@ -1,4 +0,0 @@ -apple-clang-supports-cxx20 --------------------------- - -* AppleClang compiler have learned how to compile C++20. diff --git a/Help/release/dev/armclang.rst b/Help/release/dev/armclang.rst deleted file mode 100644 index da82032..0000000 --- a/Help/release/dev/armclang.rst +++ /dev/null @@ -1,4 +0,0 @@ -armclang --------- - -* Support for the Clang-based ARM compiler was added with compiler id ``ARMClang``. diff --git a/Help/release/dev/clang-gnulike-support.rst b/Help/release/dev/clang-gnulike-support.rst deleted file mode 100644 index 87715d7..0000000 --- a/Help/release/dev/clang-gnulike-support.rst +++ /dev/null @@ -1,5 +0,0 @@ -clang-gnulike-support ---------------------- - -* The ``Clang`` compiler variant on Windows that targets the MSVC ABI - but has a GNU-like command line is now supported. diff --git a/Help/release/dev/cmake--install_option.rst b/Help/release/dev/cmake--install_option.rst deleted file mode 100644 index 8e526a0..0000000 --- a/Help/release/dev/cmake--install_option.rst +++ /dev/null @@ -1,6 +0,0 @@ -cmake--install-option ---------------------- - -* A new ``--install`` option was added to :manual:`cmake(1)`. - This may be used after building a project to run installation without - using the generated build system or the native build tool. diff --git a/Help/release/dev/cmake-build-multiply-targets.rst b/Help/release/dev/cmake-build-multiply-targets.rst deleted file mode 100644 index 1275ca3..0000000 --- a/Help/release/dev/cmake-build-multiply-targets.rst +++ /dev/null @@ -1,5 +0,0 @@ -cmake-build-multiply-targets ----------------------------- - -* The :manual:`cmake(1)` ``--build`` tool ``--target`` parameter gained support for - multiple targets, e.g. ``cmake --build . --target Library1 Library2``. diff --git a/Help/release/dev/cmake-e-tar-creating-archive.rst b/Help/release/dev/cmake-e-tar-creating-archive.rst deleted file mode 100644 index 717855c..0000000 --- a/Help/release/dev/cmake-e-tar-creating-archive.rst +++ /dev/null @@ -1,6 +0,0 @@ -cmake-e-tar-creating-archive ----------------------------- - -* The :manual:`cmake(1)` ``-E tar`` tool now continues adding files to an - archive, even if some of the files aren't readable. This behavior is more - consistent with the classic ``tar`` tool. diff --git a/Help/release/dev/cmake-e-tar-error-handling.rst b/Help/release/dev/cmake-e-tar-error-handling.rst deleted file mode 100644 index d1f2c72..0000000 --- a/Help/release/dev/cmake-e-tar-error-handling.rst +++ /dev/null @@ -1,8 +0,0 @@ -cmake-e-tar-error-handling --------------------------- - -* The :manual:`cmake(1)` ``-E tar`` tool now parses all flags, and if an - invalid flag was provided, a warning is issued. -* The :manual:`cmake(1)` ``-E tar`` tool now displays an error if no action - flag was specified, along with a list of possible actions: ``t`` (list), - ``c`` (create) or ``x`` (extract). diff --git a/Help/release/dev/cmake-e-tar-extract-specific-files.rst b/Help/release/dev/cmake-e-tar-extract-specific-files.rst deleted file mode 100644 index 4ab3eab..0000000 --- a/Help/release/dev/cmake-e-tar-extract-specific-files.rst +++ /dev/null @@ -1,8 +0,0 @@ -cmake-e-tar-extract-specific-files ----------------------------------- - -* The :manual:`cmake(1)` ``-E tar`` tool allow for extract (``-x``) or list - (``-t``) only specific files or directories. To select pathnames append - a space-separated list of file names or directories. - When extracting selected files or directories, you must provide their exact - pathname, as printed by list (``-t``) diff --git a/Help/release/dev/cmake-e-tar-zstd-support.rst b/Help/release/dev/cmake-e-tar-zstd-support.rst deleted file mode 100644 index e3488b5..0000000 --- a/Help/release/dev/cmake-e-tar-zstd-support.rst +++ /dev/null @@ -1,7 +0,0 @@ -Help/release/dev/cmake-e-tar-zstd-support ------------------------------------------ - -* The :manual:`cmake(1)` ``-E tar`` tool now support Zstandard compression - algorithm with ``--zstd`` option. Zstandard was designed to give - a compression ratio comparable to that of the DEFLATE (zip) algorithm, - but faster, especially for decompression. diff --git a/Help/release/dev/cmake-short-target-option.rst b/Help/release/dev/cmake-short-target-option.rst deleted file mode 100644 index 5eac042..0000000 --- a/Help/release/dev/cmake-short-target-option.rst +++ /dev/null @@ -1,6 +0,0 @@ -cmake-short-target-option ----------------------------- - -* The :manual:`cmake(1)` ``--target`` parameter gained shorter - version ``-t``, e.g. ``cmake --build . -t Library1 Library2`` is - equivalant to ``cmake --build . --target Library1 Library2``. diff --git a/Help/release/dev/cmake_automoc_relaxed_mode.rst b/Help/release/dev/cmake_automoc_relaxed_mode.rst deleted file mode 100644 index aa4772a..0000000 --- a/Help/release/dev/cmake_automoc_relaxed_mode.rst +++ /dev/null @@ -1,5 +0,0 @@ -cmake_automoc_relaxed_mode --------------------------- - -* The variable :variable:`CMAKE_AUTOMOC_RELAXED_MODE` is considered - deprecated. Support still exists but will be removed in future versions. diff --git a/Help/release/dev/cmake_parse_arguments-keywords_missing_values.rst b/Help/release/dev/cmake_parse_arguments-keywords_missing_values.rst deleted file mode 100644 index c7fe96b..0000000 --- a/Help/release/dev/cmake_parse_arguments-keywords_missing_values.rst +++ /dev/null @@ -1,6 +0,0 @@ -cmake_parse_arguments-keywords_missing_values ---------------------------------------------- - -* The :command:`cmake_parse_arguments` command gained an additional - ``_KEYWORDS_MISSING_VALUES`` output variable to report - keyword arguments that were given by the caller with no values. diff --git a/Help/release/dev/cpackifw-package-style-sheet.rst b/Help/release/dev/cpackifw-package-style-sheet.rst deleted file mode 100644 index cf99244..0000000 --- a/Help/release/dev/cpackifw-package-style-sheet.rst +++ /dev/null @@ -1,6 +0,0 @@ -cpackifw-package-style-sheet ----------------------------- - -* The :cpack_gen:`CPack IFW Generator` gained a new - :variable:`CPACK_IFW_PACKAGE_STYLE_SHEET` variable to customize the - installer stylesheet. diff --git a/Help/release/dev/ctest_submit_get_buildid.rst b/Help/release/dev/ctest_submit_get_buildid.rst deleted file mode 100644 index 39a0010..0000000 --- a/Help/release/dev/ctest_submit_get_buildid.rst +++ /dev/null @@ -1,6 +0,0 @@ -ctest_submit_get_buildid --------------------------- - -* The :command:`ctest_submit` command learned a new option: ``BUILD_ID``. - This can be used to store the ID assigned to this build by CDash to a - variable. diff --git a/Help/release/dev/ctest_update_version_override.rst b/Help/release/dev/ctest_update_version_override.rst deleted file mode 100644 index 03b47db..0000000 --- a/Help/release/dev/ctest_update_version_override.rst +++ /dev/null @@ -1,7 +0,0 @@ -CTEST_UPDATE_VERSION_OVERRIDE ------------------------------ - -* The :command:`ctest_update` command learned to honor a new variable: - :variable:`CTEST_UPDATE_VERSION_OVERRIDE`. This can be used to specify - the current version of your source tree rather than using the update - command to discover the current version that is checked out. diff --git a/Help/release/dev/cuda-compiler-generator-expressions.rst b/Help/release/dev/cuda-compiler-generator-expressions.rst deleted file mode 100644 index 2610a39..0000000 --- a/Help/release/dev/cuda-compiler-generator-expressions.rst +++ /dev/null @@ -1,5 +0,0 @@ -cuda-compiler-generator-expressions ------------------------------------ - -* The ``$`` and ``$`` - :manual:`generator expressions ` were added. diff --git a/Help/release/dev/default-generator-env.rst b/Help/release/dev/default-generator-env.rst deleted file mode 100644 index 3f20475..0000000 --- a/Help/release/dev/default-generator-env.rst +++ /dev/null @@ -1,9 +0,0 @@ -default-generator-env ---------------------- - -* The :envvar:`CMAKE_GENERATOR` environment variable was added - to specify a default generator to use when :manual:`cmake(1)` is - run without a ``-G`` option. Additionally, environment variables - :envvar:`CMAKE_GENERATOR_PLATFORM`, :envvar:`CMAKE_GENERATOR_TOOLSET`, - and :envvar:`CMAKE_GENERATOR_INSTANCE` were created to configure - the generator. diff --git a/Help/release/dev/deprecate-policy-old.rst b/Help/release/dev/deprecate-policy-old.rst deleted file mode 100644 index b94f4b7..0000000 --- a/Help/release/dev/deprecate-policy-old.rst +++ /dev/null @@ -1,8 +0,0 @@ -deprecate-policy-old --------------------- - -* An explicit deprecation diagnostic was added for policy ``CMP0066`` - (``CMP0065`` and below were already deprecated). - The :manual:`cmake-policies(7)` manual explains that the OLD behaviors - of all policies are deprecated and that projects should port to the - NEW behaviors. diff --git a/Help/release/dev/emulator-arguments.rst b/Help/release/dev/emulator-arguments.rst deleted file mode 100644 index 3edb790..0000000 --- a/Help/release/dev/emulator-arguments.rst +++ /dev/null @@ -1,6 +0,0 @@ -emulator-arguments ------------------- - -* The :variable:`CMAKE_CROSSCOMPILING_EMULATOR` variable and corresponding - :prop_tgt:`CROSSCOMPILING_EMULATOR` target property learned to support - arguments to the emulator. diff --git a/Help/release/dev/environment-modules.rst b/Help/release/dev/environment-modules.rst deleted file mode 100644 index eace35d..0000000 --- a/Help/release/dev/environment-modules.rst +++ /dev/null @@ -1,5 +0,0 @@ -environment-modules -------------------- - -* The :module:`FindEnvModules` module was added to use Lua- and TCL-based - environment modules in :ref:`CTest Scripts `. diff --git a/Help/release/dev/export-package-default-off.rst b/Help/release/dev/export-package-default-off.rst deleted file mode 100644 index 0868c82..0000000 --- a/Help/release/dev/export-package-default-off.rst +++ /dev/null @@ -1,6 +0,0 @@ -export-package-default-off --------------------------- - -* The :command:`export(PACKAGE)` command now does nothing unless - enabled via :variable:`CMAKE_EXPORT_PACKAGE_REGISTRY`. - See policy :policy:`CMP0090`. diff --git a/Help/release/dev/file-install-follow-symlink-chain.rst b/Help/release/dev/file-install-follow-symlink-chain.rst deleted file mode 100644 index 8d22512..0000000 --- a/Help/release/dev/file-install-follow-symlink-chain.rst +++ /dev/null @@ -1,6 +0,0 @@ -file-install-follow-symlink-chain ---------------------------------- - -* The :command:`file(INSTALL)` command learned a new argument, - ``FOLLOW_SYMLINK_CHAIN``, which can be used to recursively resolve and - install symlinks. diff --git a/Help/release/dev/file-remove-no-empty.rst b/Help/release/dev/file-remove-no-empty.rst deleted file mode 100644 index 0a68d67..0000000 --- a/Help/release/dev/file-remove-no-empty.rst +++ /dev/null @@ -1,6 +0,0 @@ -file-remove-no-empty --------------------- - -* The :command:`file(REMOVE)` and :command:`file(REMOVE_RECURSE)` commands - were changed to ignore empty arguments with a warning instead of treating - them as a relative path and removing the contents of the current directory. diff --git a/Help/release/dev/find-package-prefer-config.rst b/Help/release/dev/find-package-prefer-config.rst deleted file mode 100644 index 377e8c5..0000000 --- a/Help/release/dev/find-package-prefer-config.rst +++ /dev/null @@ -1,6 +0,0 @@ -find-package-prefer-config --------------------------- - -* Variable :variable:`CMAKE_FIND_PACKAGE_PREFER_CONFIG` was added to tell - :command:`find_package` calls to look for a package configuration - file first even if a find module is available. diff --git a/Help/release/dev/genex-COMPILE_LANG_AND_ID.rst b/Help/release/dev/genex-COMPILE_LANG_AND_ID.rst deleted file mode 100644 index 760fca8..0000000 --- a/Help/release/dev/genex-COMPILE_LANG_AND_ID.rst +++ /dev/null @@ -1,7 +0,0 @@ -genex-COMPILE_LANG_AND_ID --------------------------- - -* A new ``COMPILE_LANG_AND_ID`` generator expression was introduced to - allow specification of compile options for target files based on the - :variable:`CMAKE__COMPILER_ID` and :prop_sf:`LANGUAGE` of - each source file. diff --git a/Help/release/dev/genex-TARGET_FILE_BASE_NAME.rst b/Help/release/dev/genex-TARGET_FILE_BASE_NAME.rst deleted file mode 100644 index d8b2b21..0000000 --- a/Help/release/dev/genex-TARGET_FILE_BASE_NAME.rst +++ /dev/null @@ -1,7 +0,0 @@ -genex-TARGET_FILE_BASE_NAME ---------------------------- - -* New ``$``, ``$`` - and ``$`` - :manual:`generator expressions ` have been - added to retrieve the base name of various artifacts. diff --git a/Help/release/dev/genex-TARGET_FILE_PREFIX.rst b/Help/release/dev/genex-TARGET_FILE_PREFIX.rst deleted file mode 100644 index 3e480bb..0000000 --- a/Help/release/dev/genex-TARGET_FILE_PREFIX.rst +++ /dev/null @@ -1,7 +0,0 @@ -genex-TARGET_FILE_PREFIX ------------------------- - -* New ``$``, ``$``, - ``$`` and ``$`` - :manual:`generator expressions ` have been - added to retrieve the prefix and suffix of various artifacts. diff --git a/Help/release/dev/genex-comma-separated.rst b/Help/release/dev/genex-comma-separated.rst deleted file mode 100644 index f27f781..0000000 --- a/Help/release/dev/genex-comma-separated.rst +++ /dev/null @@ -1,8 +0,0 @@ -genex-comma-separated ---------------------- - -* The :manual:`generator expressions ` - ``C_COMPILER_ID``, ``CXX_COMPILER_ID``, ``CUDA_COMPILER_ID``, - ``Fortran_COMPILER_ID``, ``COMPILE_LANGUAGE``, ``COMPILE_LANG_AND_ID``, and - ``PLATFORM_ID`` learned to support matching one value from a comma-separated - list. diff --git a/Help/release/dev/genex_filter.rst b/Help/release/dev/genex_filter.rst deleted file mode 100644 index ad23134..0000000 --- a/Help/release/dev/genex_filter.rst +++ /dev/null @@ -1,6 +0,0 @@ -genex_filter ------------- - -* A new ``$`` - :manual:`generator expression ` - has been added. diff --git a/Help/release/dev/ghs-custom-commands.rst b/Help/release/dev/ghs-custom-commands.rst deleted file mode 100644 index a29ef88..0000000 --- a/Help/release/dev/ghs-custom-commands.rst +++ /dev/null @@ -1,5 +0,0 @@ -ghs_custom_commands -------------------- - -* The :generator:`Green Hills MULTI` generator now supports - :command:`add_custom_command` and :command:`add_custom_target` diff --git a/Help/release/dev/ghs-linux.rst b/Help/release/dev/ghs-linux.rst deleted file mode 100644 index 6b663c8..0000000 --- a/Help/release/dev/ghs-linux.rst +++ /dev/null @@ -1,4 +0,0 @@ -ghs-linux ---------- - -* The :generator:`Green Hills MULTI` generator is now available on Linux. diff --git a/Help/release/dev/iar-new_architectures.rst b/Help/release/dev/iar-new_architectures.rst deleted file mode 100644 index d661c80..0000000 --- a/Help/release/dev/iar-new_architectures.rst +++ /dev/null @@ -1,6 +0,0 @@ -iar-new_architectures ---------------------- - -* Support was added for the IAR compiler architectures Renesas RX, - RL78, RH850 and Texas Instruments MSP430. -* The IAR compilers built for Linux (IAR BuildLx) now work as well. diff --git a/Help/release/dev/iface-headers.rst b/Help/release/dev/iface-headers.rst deleted file mode 100644 index 2e1de5e..0000000 --- a/Help/release/dev/iface-headers.rst +++ /dev/null @@ -1,7 +0,0 @@ -iface-headers -------------- - -* ``INTERFACE`` library can now have :prop_tgt:`PUBLIC_HEADER` and - :prop_tgt:`PRIVATE_HEADER` properties set. The headers specified by those - properties can be installed using the :command:`install(TARGETS)` command by - passing the ``PUBLIC_HEADER`` and ``PRIVATE_HEADER`` arguments respectively. diff --git a/Help/release/dev/list-prepend-and-pop-subcommands.rst b/Help/release/dev/list-prepend-and-pop-subcommands.rst deleted file mode 100644 index 16b14f1..0000000 --- a/Help/release/dev/list-prepend-and-pop-subcommands.rst +++ /dev/null @@ -1,4 +0,0 @@ -list-prepend-and-pop-subcommands --------------------------------- - -* :command:`list` learned new sub-commands ``PREPEND``, ``POP_FRONT`` and ``POP_BACK``. diff --git a/Help/release/dev/msvc-runtime-library.rst b/Help/release/dev/msvc-runtime-library.rst deleted file mode 100644 index 4dddac2..0000000 --- a/Help/release/dev/msvc-runtime-library.rst +++ /dev/null @@ -1,7 +0,0 @@ -msvc-runtime-library --------------------- - -* The :variable:`CMAKE_MSVC_RUNTIME_LIBRARY` variable and - :prop_tgt:`MSVC_RUNTIME_LIBRARY` target property were introduced to - select the runtime library used by compilers targeting the MSVC ABI. - See policy :policy:`CMP0091`. diff --git a/Help/release/dev/msvc-warning-flags.rst b/Help/release/dev/msvc-warning-flags.rst deleted file mode 100644 index b89d6fa..0000000 --- a/Help/release/dev/msvc-warning-flags.rst +++ /dev/null @@ -1,6 +0,0 @@ -msvc-warning-flags ------------------- - -* With MSVC-like compilers the value of :variable:`CMAKE__FLAGS` - no longer contains warning flags like ``/W3`` by default. - See policy :policy:`CMP0092`. diff --git a/Help/release/dev/new-message-types-and-logging.rst b/Help/release/dev/new-message-types-and-logging.rst deleted file mode 100644 index cd470bb..0000000 --- a/Help/release/dev/new-message-types-and-logging.rst +++ /dev/null @@ -1,7 +0,0 @@ -new-message-types-and-logging ------------------------------ - -* The :command:`message` command learned new types: ``NOTICE``, ``VERBOSE``, - ``DEBUG`` and ``TRACE``. - -* The :manual:`cmake(1)` command learned a new CLI option ``--loglevel``. diff --git a/Help/release/dev/ninja-add_custom_command-pool.rst b/Help/release/dev/ninja-add_custom_command-pool.rst deleted file mode 100644 index f5a2db9..0000000 --- a/Help/release/dev/ninja-add_custom_command-pool.rst +++ /dev/null @@ -1,6 +0,0 @@ -ninja-add_custom_command-pool --------------------------------- - -* The commands :command:`add_custom_command` and :command:`add_custom_target` - gained a new ``JOB_POOL`` option that works with the :generator:`Ninja` - generator to set the pool variable on the build statement. diff --git a/Help/release/dev/pkg-config-linker-flags.rst b/Help/release/dev/pkg-config-linker-flags.rst deleted file mode 100644 index 85c13be..0000000 --- a/Help/release/dev/pkg-config-linker-flags.rst +++ /dev/null @@ -1,5 +0,0 @@ -pkg-config-linker-flags ------------------------ - -* The :module:`FindPkgConfig` now populates :prop_tgt:`INTERFACE_LINK_OPTIONS` - property of imported targets with other (non-library) linker flags. diff --git a/Help/release/dev/project-include-before.rst b/Help/release/dev/project-include-before.rst deleted file mode 100644 index 9a9e067..0000000 --- a/Help/release/dev/project-include-before.rst +++ /dev/null @@ -1,5 +0,0 @@ -cmake_project_include_before ----------------------------- - -* A variable :variable:`CMAKE_PROJECT_INCLUDE_BEFORE` was added to allow - injection of custom code before the :command:`project` call. diff --git a/Help/release/dev/project-include.rst b/Help/release/dev/project-include.rst deleted file mode 100644 index 659e933..0000000 --- a/Help/release/dev/project-include.rst +++ /dev/null @@ -1,5 +0,0 @@ -cmake_project_include ---------------------- - -* A variable :variable:`CMAKE_PROJECT_INCLUDE` was added to allow injection - of custom code into the project without knowing the project name a priori. diff --git a/Help/release/dev/relax-TARGET_OBJECTS-generator-expression.rst b/Help/release/dev/relax-TARGET_OBJECTS-generator-expression.rst deleted file mode 100644 index 25ca0c9..0000000 --- a/Help/release/dev/relax-TARGET_OBJECTS-generator-expression.rst +++ /dev/null @@ -1,5 +0,0 @@ -relax-TARGET_OBJECTS-generator-expression ------------------------------------------ - -* The ``TARGET_OBJECTS`` :manual:`generator expression ` - is now supported on ``SHARED``, ``STATIC``, ``MODULE`` libraries and executables. diff --git a/Help/release/dev/remove_directories.rst b/Help/release/dev/remove_directories.rst deleted file mode 100644 index 1b16df1..0000000 --- a/Help/release/dev/remove_directories.rst +++ /dev/null @@ -1,5 +0,0 @@ -remove_directories ------------------- - -* The :manual:`cmake(1)` ``-E remove_directory`` command learned to support - removing multiple directories. diff --git a/Help/release/dev/remove_duplicates.rst b/Help/release/dev/remove_duplicates.rst deleted file mode 100644 index f6a7fff..0000000 --- a/Help/release/dev/remove_duplicates.rst +++ /dev/null @@ -1,6 +0,0 @@ -remove_duplicates ------------------ - -* A new ``$`` - :manual:`generator expression ` - has been added. diff --git a/Help/release/dev/require-xcode-5.rst b/Help/release/dev/require-xcode-5.rst deleted file mode 100644 index 6cfe96a..0000000 --- a/Help/release/dev/require-xcode-5.rst +++ /dev/null @@ -1,4 +0,0 @@ -require-xcode-5 ---------------- - -* The :generator:`Xcode` generator now requires at least Xcode 5. diff --git a/Help/release/dev/server-deprecate.rst b/Help/release/dev/server-deprecate.rst deleted file mode 100644 index 65c86e1..0000000 --- a/Help/release/dev/server-deprecate.rst +++ /dev/null @@ -1,6 +0,0 @@ -server-deprecate ----------------- - -* The :manual:`cmake-server(7)` mode has been deprecated and will be - removed from a future version of CMake. Please port clients to use - the :manual:`cmake-file-api(7)` instead. diff --git a/Help/release/dev/shell_path.rst b/Help/release/dev/shell_path.rst deleted file mode 100644 index e8ebfb5..0000000 --- a/Help/release/dev/shell_path.rst +++ /dev/null @@ -1,5 +0,0 @@ -shell_path ----------- - -* The ``$`` :manual:`generator expression - ` gained support for a list of paths. diff --git a/Help/release/dev/string-repeat.rst b/Help/release/dev/string-repeat.rst deleted file mode 100644 index 4be0d5c..0000000 --- a/Help/release/dev/string-repeat.rst +++ /dev/null @@ -1,4 +0,0 @@ -string-repeat --------------- - -* The :command:`string` learned a new sub-command ``REPEAT``. diff --git a/Help/release/dev/sunpro-supports-cxx14.rst b/Help/release/dev/sunpro-supports-cxx14.rst deleted file mode 100644 index c287386..0000000 --- a/Help/release/dev/sunpro-supports-cxx14.rst +++ /dev/null @@ -1,4 +0,0 @@ -sunpro-supports-cxx14 ---------------------- - -* SunPro compiler have learned how to compile C++14. diff --git a/Help/release/dev/swift-support.rst b/Help/release/dev/swift-support.rst deleted file mode 100644 index 49784e2..0000000 --- a/Help/release/dev/swift-support.rst +++ /dev/null @@ -1,23 +0,0 @@ -Swift Language Support ----------------------- - -* Preliminary support for the Swift language with the :generator:`Ninja` - generator was added. Use the :envvar:`SWIFTC` environment variable to - specify a compiler. - -* Support to emit an output file map was added to enable Swift compilation. - -* A target property :prop_tgt:`Swift_DEPENDENCIES_FILE` was added to targets to - indicate where to save the target swift dependencies file. If one is not - specified, it will default to `.swiftdeps`. - -* A target property :prop_tgt:`Swift_MODULE_NAME` was added to targets to - indicate the Swift module name. If it is not specified, it will default to - the name of the target. - -* A source property :prop_sf:`Swift_DEPENDENCIES_FILE` was added to sources to - indicate where to save the target swift dependencies file. If one is not - specified, it will default to `.swiftdeps`. - -* A source property :prop_sf:`Swift_DIAGNOSTICS_FILE` was added to sources to - indicate where to write the serialised Swift diagnostics. diff --git a/Help/release/dev/vs-add-package-references.rst b/Help/release/dev/vs-add-package-references.rst deleted file mode 100644 index 2d260dc..0000000 --- a/Help/release/dev/vs-add-package-references.rst +++ /dev/null @@ -1,6 +0,0 @@ -vs-add-package-references -------------------------- - -* A :prop_tgt:`VS_PACKAGE_REFERENCES` target property was added to - tell :ref:`Visual Studio Generators` to add references to nuget - packages. diff --git a/Help/release/dev/vs-just-my-code-debugging.rst b/Help/release/dev/vs-just-my-code-debugging.rst deleted file mode 100644 index c53ee6c..0000000 --- a/Help/release/dev/vs-just-my-code-debugging.rst +++ /dev/null @@ -1,9 +0,0 @@ -vs-just-my-code-debugging -------------------------- - -* For the :ref:`Visual Studio Generators`, - :ref:`Makefile Generators`, and the :generator:`Ninja` generators - the Just My Code feature of the Visual Studio Debugger can be - leveraged by turning on the :prop_tgt:`VS_JUST_MY_CODE_DEBUGGING` target - property. Its default value is provided by the variable - :variable:`CMAKE_VS_JUST_MY_CODE_DEBUGGING`. diff --git a/Help/release/dev/vs-project-import.rst b/Help/release/dev/vs-project-import.rst deleted file mode 100644 index de6024d..0000000 --- a/Help/release/dev/vs-project-import.rst +++ /dev/null @@ -1,5 +0,0 @@ -vs-project-import ------------------ - -* The :prop_tgt:`VS_PROJECT_IMPORT` target property was added which allows - to import external .props files in managed Visual Studio targets. diff --git a/Help/release/dev/vs-wince-no-deploy.rst b/Help/release/dev/vs-wince-no-deploy.rst deleted file mode 100644 index 6c18d89..0000000 --- a/Help/release/dev/vs-wince-no-deploy.rst +++ /dev/null @@ -1,6 +0,0 @@ -vs_wince_no_deploy ------------------- - -* A :prop_tgt:`VS_NO_SOLUTION_DEPLOY` target property was added to - tell :ref:`Visual Studio Generators` whether to deploy an artifact - to the WinCE or Windows Phone target device. diff --git a/Help/release/dev/xcode-scheme-per-target.rst b/Help/release/dev/xcode-scheme-per-target.rst deleted file mode 100644 index 3febe79..0000000 --- a/Help/release/dev/xcode-scheme-per-target.rst +++ /dev/null @@ -1,6 +0,0 @@ -xcode-scheme-per-target ------------------------ - -* The :generator:`Xcode` generator now supports per-target schemes. - See the :variable:`CMAKE_XCODE_GENERATE_SCHEME` variable and - :prop_tgt:`XCODE_GENERATE_SCHEME` target property. diff --git a/Help/release/dev/xl-supports-cxx14.rst b/Help/release/dev/xl-supports-cxx14.rst deleted file mode 100644 index a18e0ad..0000000 --- a/Help/release/dev/xl-supports-cxx14.rst +++ /dev/null @@ -1,4 +0,0 @@ -xlc-supports-cxx14 ----------------------- - -* IBM AIX XL compiler have learned how to compile C++14. diff --git a/Help/release/index.rst b/Help/release/index.rst index 2318e03..62032e6 100644 --- a/Help/release/index.rst +++ b/Help/release/index.rst @@ -15,6 +15,7 @@ Releases .. toctree:: :maxdepth: 1 + 3.15 <3.15> 3.14 <3.14> 3.13 <3.13> 3.12 <3.12> https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e075e64fd80c3b63492232c7f9019ce65d1d8e4a commit e075e64fd80c3b63492232c7f9019ce65d1d8e4a Author: Brad King AuthorDate: Tue Jun 4 09:54:25 2019 -0400 Commit: Brad King CommitDate: Tue Jun 4 09:55:37 2019 -0400 Help: Document Swift_DEPENDENCIES_FILE property defaults Copy wording from the release notes. diff --git a/Help/prop_sf/Swift_DEPENDENCIES_FILE.rst b/Help/prop_sf/Swift_DEPENDENCIES_FILE.rst index a8cf063..faac2df 100644 --- a/Help/prop_sf/Swift_DEPENDENCIES_FILE.rst +++ b/Help/prop_sf/Swift_DEPENDENCIES_FILE.rst @@ -2,4 +2,4 @@ Swift_DEPENDENCIES_FILE ----------------------- This property sets the path for the Swift dependency file (swiftdeps) for the -source. +source. If one is not specified, it will default to ``.swiftdeps``. diff --git a/Help/prop_tgt/Swift_DEPENDENCIES_FILE.rst b/Help/prop_tgt/Swift_DEPENDENCIES_FILE.rst index 93cdd2c..46c9a1d 100644 --- a/Help/prop_tgt/Swift_DEPENDENCIES_FILE.rst +++ b/Help/prop_tgt/Swift_DEPENDENCIES_FILE.rst @@ -2,4 +2,4 @@ Swift_DEPENDENCIES_FILE ----------------------- This property sets the path for the Swift dependency file (swiftdep) for the -target. +target. If one is not specified, it will default to ``.swiftdeps``. ----------------------------------------------------------------------- Summary of changes: Help/prop_sf/Swift_DEPENDENCIES_FILE.rst | 2 +- Help/prop_tgt/Swift_DEPENDENCIES_FILE.rst | 2 +- Help/release/3.15.rst | 347 +++++++++++++++++++++ Help/release/dev/CMAKE_FRAMEWORK.rst | 6 - Help/release/dev/FindBoost-fphsa.rst | 34 -- Help/release/dev/FindCups-imported-target.rst | 4 - Help/release/dev/FindGLEW-updates.rst | 5 - Help/release/dev/FindPostgreSQL-config-support.rst | 5 - Help/release/dev/FindPython-CMP0094.rst | 5 - Help/release/dev/FindPython-FIND_FRAMEWORK.rst | 5 - Help/release/dev/FindPython-FIND_STRATEGY.rst | 5 - Help/release/dev/FindPython-module.rst | 6 - Help/release/dev/FindPython-virtual-env.rst | 5 - .../release/dev/UseSWIG-alternate-library-name.rst | 7 - .../dev/add-execute_process-command-echo.rst | 6 - Help/release/dev/add-xlclang.rst | 5 - Help/release/dev/additional_clean_files.rst | 10 - .../dev/allow-aliasing-unkown-import-targets.rst | 5 - Help/release/dev/apple-clang-supports-cxx20.rst | 4 - Help/release/dev/armclang.rst | 4 - Help/release/dev/clang-gnulike-support.rst | 5 - Help/release/dev/cmake--install_option.rst | 6 - Help/release/dev/cmake-build-multiply-targets.rst | 5 - Help/release/dev/cmake-e-tar-creating-archive.rst | 6 - Help/release/dev/cmake-e-tar-error-handling.rst | 8 - .../dev/cmake-e-tar-extract-specific-files.rst | 8 - Help/release/dev/cmake-e-tar-zstd-support.rst | 7 - Help/release/dev/cmake-short-target-option.rst | 6 - Help/release/dev/cmake_automoc_relaxed_mode.rst | 5 - ...ake_parse_arguments-keywords_missing_values.rst | 6 - Help/release/dev/cpackifw-package-style-sheet.rst | 6 - Help/release/dev/ctest_submit_get_buildid.rst | 6 - Help/release/dev/ctest_update_version_override.rst | 7 - .../dev/cuda-compiler-generator-expressions.rst | 5 - Help/release/dev/default-generator-env.rst | 9 - Help/release/dev/deprecate-policy-old.rst | 8 - Help/release/dev/emulator-arguments.rst | 6 - Help/release/dev/environment-modules.rst | 5 - Help/release/dev/export-package-default-off.rst | 6 - .../dev/file-install-follow-symlink-chain.rst | 6 - Help/release/dev/file-remove-no-empty.rst | 6 - Help/release/dev/find-package-prefer-config.rst | 6 - Help/release/dev/genex-COMPILE_LANG_AND_ID.rst | 7 - Help/release/dev/genex-TARGET_FILE_BASE_NAME.rst | 7 - Help/release/dev/genex-TARGET_FILE_PREFIX.rst | 7 - Help/release/dev/genex-comma-separated.rst | 8 - Help/release/dev/genex_filter.rst | 6 - Help/release/dev/ghs-custom-commands.rst | 5 - Help/release/dev/ghs-linux.rst | 4 - Help/release/dev/iar-new_architectures.rst | 6 - Help/release/dev/iface-headers.rst | 7 - .../dev/list-prepend-and-pop-subcommands.rst | 4 - Help/release/dev/msvc-runtime-library.rst | 7 - Help/release/dev/msvc-warning-flags.rst | 6 - Help/release/dev/new-message-types-and-logging.rst | 7 - Help/release/dev/ninja-add_custom_command-pool.rst | 6 - Help/release/dev/pkg-config-linker-flags.rst | 5 - Help/release/dev/project-include-before.rst | 5 - Help/release/dev/project-include.rst | 5 - .../relax-TARGET_OBJECTS-generator-expression.rst | 5 - Help/release/dev/remove_directories.rst | 5 - Help/release/dev/remove_duplicates.rst | 6 - Help/release/dev/require-xcode-5.rst | 4 - Help/release/dev/server-deprecate.rst | 6 - Help/release/dev/shell_path.rst | 5 - Help/release/dev/string-repeat.rst | 4 - Help/release/dev/sunpro-supports-cxx14.rst | 4 - Help/release/dev/swift-support.rst | 23 -- Help/release/dev/vs-add-package-references.rst | 6 - Help/release/dev/vs-just-my-code-debugging.rst | 9 - Help/release/dev/vs-project-import.rst | 5 - Help/release/dev/vs-wince-no-deploy.rst | 6 - Help/release/dev/xcode-scheme-per-target.rst | 6 - Help/release/dev/xl-supports-cxx14.rst | 4 - Help/release/index.rst | 1 + 75 files changed, 350 insertions(+), 461 deletions(-) create mode 100644 Help/release/3.15.rst delete mode 100644 Help/release/dev/CMAKE_FRAMEWORK.rst delete mode 100644 Help/release/dev/FindBoost-fphsa.rst delete mode 100644 Help/release/dev/FindCups-imported-target.rst delete mode 100644 Help/release/dev/FindGLEW-updates.rst delete mode 100644 Help/release/dev/FindPostgreSQL-config-support.rst delete mode 100644 Help/release/dev/FindPython-CMP0094.rst delete mode 100644 Help/release/dev/FindPython-FIND_FRAMEWORK.rst delete mode 100644 Help/release/dev/FindPython-FIND_STRATEGY.rst delete mode 100644 Help/release/dev/FindPython-module.rst delete mode 100644 Help/release/dev/FindPython-virtual-env.rst delete mode 100644 Help/release/dev/UseSWIG-alternate-library-name.rst delete mode 100644 Help/release/dev/add-execute_process-command-echo.rst delete mode 100644 Help/release/dev/add-xlclang.rst delete mode 100644 Help/release/dev/additional_clean_files.rst delete mode 100644 Help/release/dev/allow-aliasing-unkown-import-targets.rst delete mode 100644 Help/release/dev/apple-clang-supports-cxx20.rst delete mode 100644 Help/release/dev/armclang.rst delete mode 100644 Help/release/dev/clang-gnulike-support.rst delete mode 100644 Help/release/dev/cmake--install_option.rst delete mode 100644 Help/release/dev/cmake-build-multiply-targets.rst delete mode 100644 Help/release/dev/cmake-e-tar-creating-archive.rst delete mode 100644 Help/release/dev/cmake-e-tar-error-handling.rst delete mode 100644 Help/release/dev/cmake-e-tar-extract-specific-files.rst delete mode 100644 Help/release/dev/cmake-e-tar-zstd-support.rst delete mode 100644 Help/release/dev/cmake-short-target-option.rst delete mode 100644 Help/release/dev/cmake_automoc_relaxed_mode.rst delete mode 100644 Help/release/dev/cmake_parse_arguments-keywords_missing_values.rst delete mode 100644 Help/release/dev/cpackifw-package-style-sheet.rst delete mode 100644 Help/release/dev/ctest_submit_get_buildid.rst delete mode 100644 Help/release/dev/ctest_update_version_override.rst delete mode 100644 Help/release/dev/cuda-compiler-generator-expressions.rst delete mode 100644 Help/release/dev/default-generator-env.rst delete mode 100644 Help/release/dev/deprecate-policy-old.rst delete mode 100644 Help/release/dev/emulator-arguments.rst delete mode 100644 Help/release/dev/environment-modules.rst delete mode 100644 Help/release/dev/export-package-default-off.rst delete mode 100644 Help/release/dev/file-install-follow-symlink-chain.rst delete mode 100644 Help/release/dev/file-remove-no-empty.rst delete mode 100644 Help/release/dev/find-package-prefer-config.rst delete mode 100644 Help/release/dev/genex-COMPILE_LANG_AND_ID.rst delete mode 100644 Help/release/dev/genex-TARGET_FILE_BASE_NAME.rst delete mode 100644 Help/release/dev/genex-TARGET_FILE_PREFIX.rst delete mode 100644 Help/release/dev/genex-comma-separated.rst delete mode 100644 Help/release/dev/genex_filter.rst delete mode 100644 Help/release/dev/ghs-custom-commands.rst delete mode 100644 Help/release/dev/ghs-linux.rst delete mode 100644 Help/release/dev/iar-new_architectures.rst delete mode 100644 Help/release/dev/iface-headers.rst delete mode 100644 Help/release/dev/list-prepend-and-pop-subcommands.rst delete mode 100644 Help/release/dev/msvc-runtime-library.rst delete mode 100644 Help/release/dev/msvc-warning-flags.rst delete mode 100644 Help/release/dev/new-message-types-and-logging.rst delete mode 100644 Help/release/dev/ninja-add_custom_command-pool.rst delete mode 100644 Help/release/dev/pkg-config-linker-flags.rst delete mode 100644 Help/release/dev/project-include-before.rst delete mode 100644 Help/release/dev/project-include.rst delete mode 100644 Help/release/dev/relax-TARGET_OBJECTS-generator-expression.rst delete mode 100644 Help/release/dev/remove_directories.rst delete mode 100644 Help/release/dev/remove_duplicates.rst delete mode 100644 Help/release/dev/require-xcode-5.rst delete mode 100644 Help/release/dev/server-deprecate.rst delete mode 100644 Help/release/dev/shell_path.rst delete mode 100644 Help/release/dev/string-repeat.rst delete mode 100644 Help/release/dev/sunpro-supports-cxx14.rst delete mode 100644 Help/release/dev/swift-support.rst delete mode 100644 Help/release/dev/vs-add-package-references.rst delete mode 100644 Help/release/dev/vs-just-my-code-debugging.rst delete mode 100644 Help/release/dev/vs-project-import.rst delete mode 100644 Help/release/dev/vs-wince-no-deploy.rst delete mode 100644 Help/release/dev/xcode-scheme-per-target.rst delete mode 100644 Help/release/dev/xl-supports-cxx14.rst hooks/post-receive -- CMake From kwrobot at kitware.com Tue Jun 4 11:03:05 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Tue, 4 Jun 2019 11:03:05 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.14.5-1257-g9800461 Message-ID: <20190604150305.1AB1E109298@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 98004612f6b5c613d49dde85549d0d556e91a60d (commit) via 4ec377f5c2f1cc287a433f009a6d0e3e753fe837 (commit) via 9d78ce02933cd913af3da66a23e8ada09db89e3e (commit) via 118bd8b53ea672375bc9d177ef518f42a93c8e5b (commit) from dae9b3e16fdacda16ea28f47dd42d3243ba42be5 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=98004612f6b5c613d49dde85549d0d556e91a60d commit 98004612f6b5c613d49dde85549d0d556e91a60d Author: Brad King AuthorDate: Tue Jun 4 10:56:45 2019 -0400 Commit: Brad King CommitDate: Tue Jun 4 10:56:45 2019 -0400 Begin post-3.15 development diff --git a/Help/release/dev/0-sample-topic.rst b/Help/release/dev/0-sample-topic.rst new file mode 100644 index 0000000..e4cc01e --- /dev/null +++ b/Help/release/dev/0-sample-topic.rst @@ -0,0 +1,7 @@ +0-sample-topic +-------------- + +* This is a sample release note for the change in a topic. + Developers should add similar notes for each topic branch + making a noteworthy change. Each document should be named + and titled to match the topic name to avoid merge conflicts. diff --git a/Help/release/index.rst b/Help/release/index.rst index 35a47aa..62032e6 100644 --- a/Help/release/index.rst +++ b/Help/release/index.rst @@ -7,6 +7,8 @@ CMake Release Notes This file should include the adjacent "dev.txt" file in development versions but not in release versions. +.. include:: dev.txt + Releases ======== diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index e22d37c..a3679e5 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 15) -set(CMake_VERSION_PATCH 0) -set(CMake_VERSION_RC 1) +set(CMake_VERSION_PATCH 20190604) +#set(CMake_VERSION_RC 1) https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4ec377f5c2f1cc287a433f009a6d0e3e753fe837 commit 4ec377f5c2f1cc287a433f009a6d0e3e753fe837 Merge: dae9b3e 9d78ce0 Author: Brad King AuthorDate: Tue Jun 4 10:55:43 2019 -0400 Commit: Brad King CommitDate: Tue Jun 4 10:55:43 2019 -0400 Merge branch 'release-3.15' ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From kwrobot at kitware.com Tue Jun 4 11:03:08 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Tue, 4 Jun 2019 11:03:08 -0400 (EDT) Subject: [Cmake-commits] CMake branch, release, updated. v3.14.5-1255-g9d78ce0 Message-ID: <20190604150308.3F7A11138D9@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, release has been updated via 9d78ce02933cd913af3da66a23e8ada09db89e3e (commit) via 118bd8b53ea672375bc9d177ef518f42a93c8e5b (commit) via dae9b3e16fdacda16ea28f47dd42d3243ba42be5 (commit) via 4272297b6ea84eec87d596f970b5ba4f9516f424 (commit) via 01d5730411561b7278d0350dffb8b7dd89ac8970 (commit) via e075e64fd80c3b63492232c7f9019ce65d1d8e4a (commit) via 4d80bd5cd5d7889fcd5d3b02519979034aec82e3 (commit) via 435f71fe124c9bde1d04b24589f118e908b2a48f (commit) via 9098d3176018055f3c0208e2ee3aa065f7bbfa21 (commit) via bb8b3727c9aa9b17a55f3f37d8884bb57aeaa73d (commit) via 842f70c49359bfd9a13e333f2571371f64d163e1 (commit) via a7d2efc15b117e404aeaf952c762a96ba34787a3 (commit) via 36140d864e71ee3d61240da42df2318b01cfbced (commit) via 65f5df7d08f2c96d551f578ec509271888ecb7be (commit) via 9ba901eb3c6579baaf2fec9996e0cbf7b5514fa7 (commit) via 4b68baa776bf8ccc2911057fc79b558515438900 (commit) via d4108f5585ae4e0ab79c9b192f9d6a0614f868cd (commit) via 99b9b01c020a0b20c0eefa73a39138471c01a053 (commit) via e591e22d4c7d2b4d4806cf47923e54269644b2a2 (commit) via 7561fcda0918abf71b7fb0cfe67dd70fafe577ae (commit) via 99496f57769a45fb664f6865bd6935d37fe45467 (commit) via f263650f95bdf87e2c50ada4a28d4fb729ac6f1c (commit) via 07a80c70020e0e533db8d75d7fe7c4270cc25afb (commit) via 013bee698e8470169d99e90aa86d5d85693c6b12 (commit) via 3eb16de32733c7d3f61d22b16a893135267e7bbc (commit) via b06f4c8a745c96f19a9e9a7c7eb0ac22250472a2 (commit) via d91b5a72cd751b75fbce163fa7a3ea2f05bf484d (commit) via 5efac09beda23c1fb188c660df39b1884f252f64 (commit) via 73472408c501e66c9dd8c027293b8c0907001b42 (commit) via fada8cbfd6ae13d15b015f667a85096b15dc07b1 (commit) via 162555d7ecd510a84fb26a2ebc90f0a3e9eabc1a (commit) via 808b8180632aef06e7a3644fb4d3957722abc3f3 (commit) via 9fd602bfd33479b1acecd40e5c1b76ce37d59798 (commit) via ec66af2026e085e7b648b222794f0f213183ea1e (commit) via 2d4787fc4ddc077e1d8fcb807768d1ecc7902a73 (commit) via fec441ec17d74b6444fad2a3e32a47dd19f1be5b (commit) via 3475e2728bad16899b50131785a61f43083e8ba9 (commit) via 7456739e2401baa34ccec2989d604ea74ebb2f77 (commit) via 619416f8a30c99f87869559cf3829ce6d3431dca (commit) via 5e2d22c177add56b2538ab10954dfb049c5cf945 (commit) via 3cb5a8d9b3add4394b12d61b5ce83ea6ca148fd1 (commit) via 18d6bdb42d6fceb2b753430e74a4d6076e321f03 (commit) via 7dae93b4053812d344a80918a8c1c05600800c21 (commit) via 774102aaec1a74ea069be9b10a2c846cdbfa609f (commit) via 4127f82179acb13746c6249dd420ffa8b4abeb72 (commit) via 51e7488c03f29ae6247d5012fed7dc3fa7924ce0 (commit) via 7f4a1d83790cad143dc8400cc78186dbef88e23d (commit) via 187928875d215df8757b291ad629a36df75da42b (commit) via 52b298bd031d97df7cdb36e6386ebbfab10946b7 (commit) via 66bba23a4b4c6e7901524677f245d02a31b3eff8 (commit) via 720253393c42d64118faf92a56949bfa271a0424 (commit) via ec4d70b564f8ac2928cf27aaa10d57ac2a8226bc (commit) via d8e90be04df9d10a2b635323ccf421f1822ade8c (commit) via 7e1c3b36455df9403b88920586453f0bbabacaca (commit) via 82fec3784b8b89bd98ddf2c7462bfab11e6cbca4 (commit) via 0d025f75c14c0f5a7b7199a0712c958f5703c24e (commit) via ebee9ff160569481aed4e0db5cbb3f3ac925c044 (commit) via c0b560f6641ab406894864c2534740bd1fd538a4 (commit) via fd28e24947af12f661516dc2b942f2f1a8f586c4 (commit) via 7d9e66a405ccd44fe3271278449ce0887a462d41 (commit) via ccf950795666406e59f420fd2732149711cb0362 (commit) via df06c8d7921d09a2a627731866a8ce895990067b (commit) via 409922f695df4fc885d04338f56dcfb4dc406f7d (commit) via 7fd3811400b9b2483d635dbcc1b0bfab268527df (commit) via 834ec4ebfe982ff75b2a34bac2515d221bc3ab38 (commit) via 465d6d7f9b53aeaab4b388f30adc324fae8ab4c8 (commit) via 4c9e99e1f9c09e947890e2fe3372ba463904f381 (commit) via cba85845172e8e12652e871d6109dba3127e8363 (commit) via c79b666c432fe5e0f3532d3ea508218f58bbc9a6 (commit) via 477f9e309563ec642c7323337e0aaf79a1256dac (commit) via fc451f130ded493ae13fda1950d31acc39002ffc (commit) via 2dc483476c134ec6fb05802990a98df406a39caf (commit) via 5823510745224f0e9ba6d69313c139bcfd9a3953 (commit) via fe018819cb4b944cafbd6d8b9e9f6332014579a9 (commit) via c367f7d5469e21739629a896aea3a04bb476c2bf (commit) via 1e7e47f597754e800673b158ce1bd59c8b6c566a (commit) via e97ea5201037b67012ecabb1cb7aebabebfed20d (commit) via 43af4ca78e80c65d3c0cf2c5121d61988e9d5192 (commit) via e762da6dc98474a71d0e69866ec3800af3117466 (commit) via 0d0cb136fb19d96f857f8d7da918e18038d5b627 (commit) via 09c21914b320567583ce5ff4c92e56b8a54bf3cb (commit) via dff42d481230599ba7962a5895d75e7c0d16939e (commit) via df72f06182f3481fe8929c49578052748d980712 (commit) via 0eed548d3f0387a3bcbdc42ad4456987a37b2934 (commit) via b6dc977ff17b451b43d8a67584400c3b53c7eb8f (commit) via 846b4b1062cc83b420ad1405fd74186c33bb1513 (commit) via 8a46a07c8bd2fddde5e4db797279e21a5575e213 (commit) via 15c644437ae355ac196cfcfe1e874d8280451b43 (commit) via 1b16d7656733a89d1d9735cf31654824b76aab9b (commit) via 7a8a24d0284856b7b38037884d0b17a1de7a9926 (commit) via 42e14d90b1b38df6c698ef230ab06ae9504436d5 (commit) via 5bb1e9a382f7ed4d42e799581acaa63a909b7b5a (commit) via a6a04cc446e67017e74e294a4aef84e9e8da4323 (commit) via 6e8acc51a57e60aff307e4730c8a2314e5cf737a (commit) via 9dad42d21a67592040d1100882147eed77753392 (commit) via 05af1770a05e00d67f12f4e3ef294360d8d6480d (commit) via 3a7f493b7b92eeead6841c393d7bbed62b52cbc9 (commit) via 9ef1e13bcccd46c822ee813017601781bbe9a43d (commit) via 4a871d51a3fa05000ea7a03587cd995783988c36 (commit) via 49f5b6f7bf426d760e6c935f6e8c308d921138a7 (commit) via c68efd196eace176bed5216573d99fabba66df84 (commit) via 4fe34b2d29ca67ea91b2545b223dad8abbcad282 (commit) via b410dd5a05c83b7728a9c4501d5ca5bf7d11822c (commit) via 06434fc2748f241eb6d89ffd2c0c66fb95dba9cb (commit) via 57cedb18c097a7231223b8a4279534216cad1b93 (commit) via 067a4f484b1e2f650918d90051653b5c434c77a2 (commit) via 8b42d560028b8da0a3cf7e1a14962f2245d21227 (commit) via 5a720a30fad4cb7dc4b9d9b783a7d3a8a9a1b231 (commit) via a1c291e0ac2cfe62e394842192b12e9e092c5a0b (commit) via f093ac36c0e389447af210d1f596baa5207bd6b3 (commit) via 0f9d7dc3ba2f6a82d6d0d54e7cc79899576981b8 (commit) via 6136ab5e179b33ddd659ad458ad8efd773ec8db8 (commit) via 6a23fbce47294e746c15ee851dc3460a3a17da2b (commit) via 7c39a9c6b6e2463b9fefc7516faeb48c2cbbd997 (commit) via c7db6ce98617aa846d213027c9ea9505f7d11d08 (commit) via 4ff3ab2ac9d0c81c927d25117e5a14cb8ebbbb86 (commit) via 35bfc85d95a480f0b0b6f22d764e06672cd8d6ac (commit) via a15595e4c9ae27677180b0b5374ead7a754be1f7 (commit) via 6baa80d1e31b26f06c68afddd096d3d8c5961718 (commit) via 45e4f470c02b16622c281371d30ecc0f7d71e5c6 (commit) via dfd2e0a4ede4a7c31eb7132f8e74d234b260a519 (commit) via 22aabdfde0c3e73812b596c21479c8418075d644 (commit) via f326591c1369680541311eabe8d3eae6d1bce293 (commit) via 76cb43c7c5515e0ca8c1858311a54954fbc39870 (commit) via da0937c04fe8cb167a55a1e37cf275d24a262fa7 (commit) via 56fec2fe8f7014abb5677fd4fca03fa208c498e8 (commit) via da78d0f5ea5506602db9f761e559ff9057430c57 (commit) via 540640fc0aca7f181098b0270fb1cae1cd684791 (commit) via e13b18e2c70f42c23ed7e7fddb93557ce19b7359 (commit) via ed593cbe645d7e5a0131b0695a607999e70af5c6 (commit) via 711f1bf1db0bbfb64323f81ee52864560776ebff (commit) via df6adb02c067a5714587365bc6ffdd90b342732c (commit) via 5bf07b9cfc5fda0c9d81f90e34761eb256733785 (commit) via b5ad572ac181c6e9754e31bd907abe59e7016d8a (commit) via c0e763d6880e842d8fc874e58c93583e014bd988 (commit) via a7754448f66acc50427a04b1e5b699a041ae295a (commit) via b7b7f1806acf8aabd5cd99e3d08fac15f4f95bdc (commit) via 902af25512545db441043ea8f1fd2637fa1e1129 (commit) via 63f149f5989ea4adfa522cec63a954b5059c223c (commit) via e32f8393388d28de7d713f35d076a33060368ec3 (commit) via abea06efdfebbf5becfde40cb8ecc8427054edf1 (commit) via 26f2b65fec383bbab74f30c4b0bc6649d0b5b509 (commit) via 62d6ed79fb4cc4cdeb1a246f0f12db7e6031f4ba (commit) via 4ec2b999414495ae58871755307ea17f391f7910 (commit) via 2b8e5a3ba772d6df6e56a28d8645127008636b03 (commit) via 3b7894b96c53dad1818588ebb3577d5ef863e5c2 (commit) via 96189e99e10493ba9cd50be0f26177bd6bd599a8 (commit) via 96a013d44c020163865d5f2f270c4cc609e76322 (commit) via ff0fb58fb5e0c543d97359c39ce4108cb55e3b86 (commit) via 59c392b44eb2920240b05a46e7f9c069ef374558 (commit) via 9bf97363b0d0f3ba0bf89247ce4f8811b4286961 (commit) via 25b2c7e4cd4e24a7723f5701afc1555a1a065301 (commit) via 3a0ab3ba2303784e20f1025cf3cd337d840a5b17 (commit) via 74829f01b13de0031e659bf8dac3e6672fbfa77b (commit) via 19669abe1d714d9dba3dcd642588160c0814f9e7 (commit) via a2a90f41e312ef1b6f60dd700db441e4b637d853 (commit) via 4819ff964714faec8ad2d92a3ee541b19196bcfc (commit) via c22693b99df12f540480438275cd5bae1cfc5846 (commit) via 26af0b25e77ba48b6d015adef6d54b6725fd7977 (commit) via d44c0db0b2f8fa24b932b5c0d506fc8842baffd6 (commit) via 9e5457d3b4f5c46028c29d731f4057e3fa76415a (commit) via 006229278b54ee92003100773a0430565fb8fe87 (commit) via c8e217e0a70f8f445e2c593f44e1105c959fb9d7 (commit) via 999516478d56d8604d1413fe3c677a860357516c (commit) via f03a80aefd4073bc1502c2e486fedfdbd8addfb6 (commit) via 32e4f236b7635fe5008966065ec4099ba23ecf58 (commit) via 3dfc8b9bd6b75d35b959ee4a79c056f4af8ea28a (commit) via a4faf7788cc40b17c48a9393cd15425ee65abfd9 (commit) via 22df62b58d8e2b9af5e754f4ed413d90088eb79e (commit) via 4f739a4e47d450406818804e45e5daaf452b39a8 (commit) via 5222400d9f574b5f953a2fe1d2c95a9754c683f3 (commit) via cbd1c5b4ab16fa3e1086417f010e7bbad42cc50d (commit) via 79c6a573f4c6690914511e4e1894221a94f1b3e3 (commit) via d1a570f18c47bb840fc19a9979d3970fbaa7e58a (commit) via d7e70d01fe510b6f5760a88cc6f244cbc0ed5f32 (commit) via 7b4b61a4d38e4c7fe3fe992a6263d8d1f0785858 (commit) via 22d58e07e5dc54e113ae7414dea604549b0cfc43 (commit) via 90766347dbee280a6fd911d5242fa2342c1e7dd2 (commit) via a39138ef9a7f3e3ec94ae4fd99602ca711bbcf5f (commit) via b26487c663ec29d972fd61adc2b14ac5880b78c7 (commit) via 2de8af0121c3ca64dcb82a1220d2ba255aab3553 (commit) via e884b1b69365e9dc15fff572a6ff2237c1bb7644 (commit) via 8ee6584a9975e766047fd73815a81a8d9c7db3f5 (commit) via 8ed6efbbd377c0941ba018200282fc961aa7d20e (commit) via fc4cbbc2a5f9f7d38e77c991a88400b29c39f182 (commit) via c024e44abea66e37fefe358659d70d8811dd73c8 (commit) via aefd424b6b2f5b630f9a511cfadd6b07228656c1 (commit) via f83f29dbaa254053ac7fe2cc0e6403908fc04ac9 (commit) via 9e07ea190bcbd83ffb054cff525fc1a0336a1a7d (commit) via 021c61408cc042b1467fbee5cfac4a1ea509118f (commit) via 5a1af142f120ccc6834efcf786e346b06e0f05c6 (commit) via 01b6a2c4ee8930e60459b46b4d751148ce28d5a9 (commit) via 974f4abbf8632bdd202ed5899f178d7c971b38fd (commit) via ad32282a3e6e7ca648f2e4a40410f08f95023df1 (commit) via d0f0ba0f7a39e70fbed197e717292b74150cf84f (commit) via a48ce8f4bf0677e9e8d054892836e8a980ffa435 (commit) via 71d6a1455e402755023b509629971afd1ed98922 (commit) via 5b53cfda247f7d688a058f358628639a431313a8 (commit) via 9c576a88d95b302882bcb0a021dcf03982a40902 (commit) via 4b45a5d5c7f9266e5ca08f6d5676759b9aac4235 (commit) via f01e18eb4699df530e310d376e66752fa6c1dedf (commit) via 53cb1f2d04bc9ca7bd50bd3b1a60dc933eab0777 (commit) via 02c14b7fcd29a7dcedb930fe5d9138cb185493e1 (commit) via 81b4d10d8f421242f9989ff0c2d37a12be66f405 (commit) via 24223ac84bd1610cef2ab0935233387227653dfd (commit) via 7e636fd8e0f10c8e0ba5eea529f4fedffd899ecf (commit) via 0fbf936b4630ca9db0d492d8c7e583f45d959b45 (commit) via 4c0fb923b7747f1eed0bfa73b8d1653997e1bda9 (commit) via 26a99da206526efb203d0e448d7e095a07bec2fd (commit) via 8517b549f44eb41c93eb1c448de176ad4172f083 (commit) via 9f205acefe256ac9707cd500ea1d421916f013cd (commit) via 0bf53483295a4b7de358e8b85ad44866d89633c5 (commit) via 8538685c85f75d1904800999a50e12d3abb7484e (commit) via 389f795d2e68d287fcbba0d5e0e4678f3d90fe4c (commit) via a1eb03569d0e82fb6eaf9a11da1960cfa456f5ef (commit) via 9c07cefee541d47be9c378a9285711e07be7a16f (commit) via 639e14def6ada307c25a422a4b51f1fceaebeead (commit) via 26ea022c3bf081d9e1f7266e5ae52719cb59301b (commit) via 1db0edb2a65b272a7c91e719e818da2e2ce49fb5 (commit) via c365243a3a282523062b5378898aa4fe6436f8fb (commit) via 62381effba418cdccff0b18f234e3a307446d635 (commit) via 368bcba28a9cd4a9f75d6671cd391b8ceef8e973 (commit) via 3205c7c950d5b90d47ce1c5c58073e511339b78c (commit) via e025495b8500f9aaf6745571ffdb48a6218e7929 (commit) via a9fb9a8774a7b1dd411542d1d14fb537968e32f1 (commit) via 28ee31149030c75c32ebbf134502a9d020dbd54b (commit) via 9860b4c5e8756cb58c4cdfc27a14194f823aa0ab (commit) via 13c92b4a300934e9f8573dee01ab4ec5e06fa7a1 (commit) via 96cf96d4ebd27a1cc725c938899a23a2ddd25334 (commit) via 273257222ee6207dcb9ad290a08db5d6b7cc9db8 (commit) via 7024fe33b8ea1d1fba3bf881f8c530688107c505 (commit) via dec5693641f794901851eafe24aed6a9338ad786 (commit) via f945c3e755469457bd1c89fe7c9153521005f43f (commit) via 1ded3599d698c1bfa0243d58ece8b619d2900a17 (commit) via 827da1119ef2d0978dd6dbc58aeee803e43b2455 (commit) via 3bd8ed22e8017e5490b8e758f486433b005ace30 (commit) via 8ada05980f1a12a2673f78f4ea7bab9df6b9d987 (commit) via a59662bb5ba571907baf9d6d6ed4ea9dd025e706 (commit) via b7d5ef23e9c9c76c7b8422c969ce806f9fd965e6 (commit) via 3d0210d8dc48f3e85f771b9e301ba867272c106d (commit) via 53fbe23f3fc6a6680308bb01edc02442ca9c7a57 (commit) via 21c74faa1ad75aa52d465467908edcb888cb53bf (commit) via adc3459707c4c942b547eb57d02a82b8d5085962 (commit) via 0d41b45cc931530d5dbc51674699f4da2290a6d3 (commit) via a9180ccf9a9e845658ba455e2dbc2447b18d2654 (commit) via 94b2c757725b86a38b7934f9e1084debe6dbe2de (commit) via e1c95bc2788c0c71418a303306a66ff5bad7c938 (commit) via 21f5ed80918507dc3a9dcd0b617ded901d6db74e (commit) via acc2f022bb538cbd61621f66d64d13b751d23f39 (commit) via 3020354f7c86f959d707aed2b833692204dd7778 (commit) via 73a829e0785a497069f55d8b2be2fb7b859a3e20 (commit) via 736f9d184da2109b009078e3184e996883bd7554 (commit) via 124564504a4f3d8416899de96e0dec048c588372 (commit) via 083cf7e8a2515d9f838f3edbb2724fd3b17d83cd (commit) via e3ff7ced630808e2e74f0853a720bc90d3f35abb (commit) via d745551fb6311f5db6e8133df63a7fc410e8a68b (commit) via 9a182c9e5b36ba68fc91b53e3d755c263ee3d0ef (commit) via e9b0063e8e0f2fcb5cc4239a06deec17c49688c4 (commit) via b6412e3e38ba22bf816445f19394e7c8027c186f (commit) via 7d7f31161d65d8b1f460eaf23e1b092bdaf7c238 (commit) via d688c4c19d0ec6d639ba7047e786bdacb7a4b45b (commit) via 0723582208dda7da9815a319973eed596c61a44c (commit) via 086c51dc045c75662500b39da3341af83281d6df (commit) via 64a7f491ef8ab6f70a77f89c91d1e7e9d549333e (commit) via 92b7a8fa2976208e3f7e5f1c5db422982b0dc1d4 (commit) via 9fdad3a601e529e07c23d34cab8279747e11054e (commit) via 62b0d14e24907f1b234d18035c3a44b94b32c808 (commit) via 89ab54c11239f4832668ecca6a0b0b9edf112bd8 (commit) via 82c6ec964db9ff3cc6bece9bc0667e5ec691f02d (commit) via 9ee24ede7363f8349c876e2f1dbbc541f60e3452 (commit) via fb39f09dc2b4bc7ccca9a8836c4bca4e879a0ed5 (commit) via 23e8364aedcbeb7ce606b6075c98827e52f0c7f6 (commit) via e1e3935f5d93687040738943bccdd53b6926f9ae (commit) via eda3963615e64f180e452b6e4bd1cce7f9fb14a9 (commit) via 8c47be28cc2e5d45c53a089b681257c0b8387964 (commit) via ac86c02d1b6da921c93d53fed85ad70ab05c4608 (commit) via 2532e00339d34e36e90f78a28c3e4ce882f6fac0 (commit) via 4edc0ef359578ddaa7db0163e3a6097e12530c9b (commit) via 93ee7dd044dcebe99531169a0cfd96b3b0c5a2ef (commit) via 4b4fd99f41e4178d914c41883ee12b63e9cb145a (commit) via 66efdbd21a46b63572f5de677ed126a68e524e7a (commit) via 0064edf4173fad72749da2c66753387e9a671223 (commit) via ac0411f1662f64fe1320e22e5a8906b8a40d6677 (commit) via 7063ed271e5343adafa485e82614f844a8e31d24 (commit) via 23b3ca5e1f599d05e822b651a09bb8b9e0df6240 (commit) via 49f8351a1812ea55acd97aca15f72bf677e00fa9 (commit) via 6faa69047fc393219ec56627e15ebce039c45171 (commit) via 359e2d401d72f36eb297d0aa52ff255fdaef2af7 (commit) via 38bedaef726529298604823ae11f03270ca82526 (commit) via b5bf369ec68a60bf71297e941bcc742904aae148 (commit) via 4e2ce0a67ae3c4355c696b018da28e23853f991f (commit) via 932dcce1e63b98739ab547f2146a39310c2d0e1e (commit) via 7b0abaac318b080d9d9044a2665541b840087c89 (commit) via e214abdaab4f8097095a601067b4071194ad01a5 (commit) via dfa24355eacbf99cf98bbf4027b8188c13ac7154 (commit) via e2d0aea2c734c8c5028f3573082e75bd157dbe72 (commit) via 2a9ff9703e20172ca14b6c872b300d0dbb75f5da (commit) via 7c3b84e3cd1b07ac21b5b2d11426e575a42c38cc (commit) via 338994d65d35e08e5ac4c71eee662c1b38aee53a (commit) via c11f089d7381747d9e2eac88c00621e2ec32e4b7 (commit) via 012d599e26392312266e96d5ff6d0b905e7e2647 (commit) via 890a1b9dc34820b73f77221f68e04cf1ae811234 (commit) via 7b23001f20440d6c631d9fd6df4ec0092efce4f5 (commit) via d745df4b01f860c16fd65494a9735d1c73cfde04 (commit) via 124ec11720ba116fcec73c2397b43fb040d8b173 (commit) via 43640fc80aaff645ba0d2897667cd2b4a85add03 (commit) via 7c8c18b1e61ca717941214c2365ce5c5056bad14 (commit) via f00f3fb4ab93ed3d914f881874919e143bc240ce (commit) via a9837130cdda163225367aaed51d66ba4d924e34 (commit) via c0b6eec800beb8335127043d2fee99cf8388b64b (commit) via c5255556afedb98c15f4c994a1903555ab6268b3 (commit) via a0b07cdcf54d661c8f61f8a83dc11427998d3e14 (commit) via 2389fcc677414b95667caa898e1b396e96b4bf3f (commit) via 1f0a695561f12b8e3929066d7dc61535a20af66c (commit) via bae7a2e25074145a8b57baa96624f0b87428840d (commit) via 050bf5747287f9c00be5e2659d93c2b164d0dcec (commit) via 0302d40faa572aeca1769969550730cd9b283b1b (commit) via 730d8a135e140f0e7860021b7989954a893798d4 (commit) via e0ab9e1cb9b07a1a320db6a788442cd9bc2a98c6 (commit) via 9ca45a51ae5ee511988728a84764e1b9eacf8f51 (commit) via b0b357a878712d1125744d0afc7389239ec1def2 (commit) via 7d9db24f4c1eb68687bf66002577781d01684478 (commit) via 9f76961de87d8911d13867d469c38087e47a0b60 (commit) via 9d48d3f61b25400a191f12ea92b8e5496ab47a8f (commit) via f84ed796a220c6a4879f08e9003fe5489d8d104d (commit) via d156f8f5a2702aa64b74fa01f48b38c7078054d1 (commit) via 62dbe53a8a2809c0c38386e5880acb446feacf28 (commit) via 1ebb0d79fe1330eea4b044bcfd9b613db8bfe86b (commit) via 5108759ed2bb211105f02fcc857fc89f3db768f0 (commit) via 054954d855fea6f4dd31fbd78c5e0cab0635396e (commit) via 30a550d6ade191e6510fb74a73fe34f1615b6086 (commit) via 0024356f8e8e5f9ec2fa6af1e651c634eba3b22b (commit) via b133d14fb1c0183c647136188cf4fff0ed05c58e (commit) via f9feab40a195716a6bba11b39a809a18830df956 (commit) via df6c4afa777098c6a2fcc01e4513ab5a6e444bc7 (commit) via 8cc04b1918301964ef7de0f44b77fdf1d82729ba (commit) via 342936963479d59400a5f6ba8ef4de339212d303 (commit) via 2bc9ddcad9f9a01055e5e3acc02a501b31af9940 (commit) via b498967243cb531c8c6fe60e6712432a2064507b (commit) via 9af34615ae1a84a890a280c3cdd75856e879fb64 (commit) via cdff7f4e2a255e083e5a19ac541b4de2874785af (commit) via a8f1527ba46b31c5583999391c05421eb86f4973 (commit) via 8691b3cf914c97ed9e3612009707bc5a791ef4f0 (commit) via 9d2ea1449265ae6b9ff504ce5a46abe51ea09162 (commit) via 15004e431923035227bf502fe07c6bef2beb2d74 (commit) via bd6c3f8609b87f6995acb2aef21aa572f0f73fa7 (commit) via 54903af84bc8656344e7fe1ea0a11d5f09e94f86 (commit) via 081104fb003a56bb3d8330363795ace5b71bc3f8 (commit) via eff6e622d6cd66186ad42c9ec2ae6b2055008707 (commit) via 47da9859e8b5e938fa40b69d117aecef82e090a9 (commit) via e329944d098fdaa8f55fdcb90120125efaa51c35 (commit) via 990270213408bb4d11fa620ba9c96b25da313945 (commit) via 12aa6fe07bc2f3903386fb1f57ace6601ec91100 (commit) via 02293841e742c14a18155bc0e10c39462c97dcbf (commit) via a173a1173e06dad812afe17c9751cb7c2f94eda4 (commit) via 741fb95f660c73035a26b572dfcd3d628d324d57 (commit) via 62e826d11b91185208363f9c10220b67c75450e5 (commit) via 5a2023f904c5da80a4614c133b7d7d8f4f719e96 (commit) via 9a34031081ccd0a3a782d756d6e24be6fdc1740c (commit) via 29f4f70b41858b8d89a4cf77a8f87ceb1df3b80a (commit) via 1069a3f02bbe12fdf326cf7cfdb12820cee6030a (commit) via 41780964936b03754a6551c65d4fd938521130b5 (commit) via ca0ac8f2896fc0de0341dfdbcb1baa67aedea7c1 (commit) via 0af57a18520c0df50ba6609aa9cbd4af876b23f8 (commit) via 9a324cbee092276b4c344b5deec5875ab76b3e3b (commit) via 4aace9b015cd95209c191139b091acbe0c047864 (commit) via afd7df9d1cd9f4aefc3a15e274cd8c6fb01e339c (commit) via 9523ca72e29350b66c37e60f9db6a8025f67cad1 (commit) via 26025d6e106ffd4cd777fdc3a4343b33c8554c15 (commit) via daad51c3b7ab65276937b38dae566c3d25b80e0c (commit) via 6b04d1cdc281b9b0dee5f59394a1c41d8b96c4a1 (commit) via 634f6ea159d917a048a1591ee34a06677b538a22 (commit) via fa077acba51393030586aa50f5eff9d6034c5c11 (commit) via be132dc6a6b5a979bdd115880911296e50c961a0 (commit) via 707c180ff0e16753a4053c86fb9ba49e58596c63 (commit) via 50c6204d26136176d95b69d0d399d4d8dd36b373 (commit) via ccb12f93c76d3867e963dbe0777b7dc0ced04025 (commit) via 1628e4677a25fc253e94eaae33f6e9aed13ca98a (commit) via 2a34d0ac3613101996b4e751bc2653e4cbeaf5b0 (commit) via 30b873c05d6281b865ba08524bb1b90e0afd1ece (commit) via a22dd5d8be7336152e5cd99b364265e7afcec083 (commit) via a3159775954772e25f3785775b89e0147382c939 (commit) via 24342d5ef772b9873c0f041fb422503acc06ff50 (commit) via 26634752d0412ecee5d124a461423460eaf3af9b (commit) via d6c12f374d304df9cc93e753fa9afd2bf25cdb78 (commit) via 7d50e1c6118b292ea3061ec9fee0230c5d50a5ff (commit) via 37bf503db268c41d5a337265300357c76bda34ea (commit) via 9bf6cbc8f78c616087ded2154c6cb7e04ef33db1 (commit) via c499eccc5caa91700e033360f31604ecefff0238 (commit) via 521ea77fc03090175feb624cf266ecd5a2f2d904 (commit) via c672a6a4b95b5d5dd08620b3abdf286698c18229 (commit) via c6f6e2b3053de02de149e80bd6a0f686a6731f68 (commit) via aae79c2d7057fbf20519db857cca6ba3c896a5ed (commit) via f0185ff14a1c25dc603e207fbf3cc73457c5990c (commit) via 1820c7e780e827a509a340835229d7075f5d1d1e (commit) via b9ee95fe5e621037f415de675eb378504170a056 (commit) via 1527defbfe4ae9cb8f74d5954c790c403727063b (commit) via 0f27e7d165c96f2c3ada1695df4f6cfaa44afe51 (commit) via a6a543ced6b29ed32dc6e944dc0aee63db27f17d (commit) via 3771a75d58c253efdbc4579a098e318649aace2b (commit) via 8527dbbf4443daf3b43f3b1543192c3a2f26be80 (commit) via d3a0582b0c0095ab95c3610ba93f3d38b5a13620 (commit) via 41d262bd3ddf752a28f8e926b19bcc24224f8303 (commit) via 911b97867b72226df7cfab95374a6c2b89d9ffa3 (commit) via e3919bae17d3442e18b5ec1f4a1ae994c87c455b (commit) via 186ca170da51d64a50bb15bfd067ca9b4c987327 (commit) via 6f242acfcb72881d184f5b2468fd4ddcadce01d8 (commit) via 9713154cf609691dfe9b8484c16cc034ea52d799 (commit) via cd285b749615c64e72ddadda0ba014c91829529c (commit) via 323c4fb989e0259c733f5a34044c693667a31842 (commit) via 784dd90fd40ff3cdc9fb44d37c0eef992ed05a92 (commit) via 7ddac9512188d1dbfcac76b24957956a197370ad (commit) via 541f079bd7ba7f141218ed93177af4d848e516fa (commit) via 713f1a0e7da7c76b0502b4ee885a74eb2e07c3b4 (commit) via c85524a94ace9ee400229fede179a605b1c144e3 (commit) via c474fb2777ea3e675237fccf23f64fe37371a5b0 (commit) via a0d04d8810cb40daaaa7876453df81ff228beb82 (commit) via 3dbec532555eb4d088f35b4a2593ca1cc247dab0 (commit) via ce79364581643700ab88ee4c442e0cf1736c926e (commit) via eef1dacf51ea32b98596608e6d4dab0f18b1457b (commit) via e08efc36eb17992f4bb8697b4173ede913aafab4 (commit) via 3b4315dc23bdedb3163a0c84b9fdbae2324470c6 (commit) via 1ee21c6ec5ef783d2b960fc3e13161582cf22e10 (commit) via 6e5ccabe9ba1b92bb5244683c4315964b01e0df7 (commit) via 1f4c9aa7d2c93f2377a6d1cb4cf2c1137466e927 (commit) via 3ee16ef31b78ff73d7a0c569fdb87b41f2a5e97d (commit) via c846dbf89ee5b11a74dceb1c19fd7472eb8b075d (commit) via fb325daa55b1bd6aa2b2b7f2c615214378224938 (commit) via 13b73ff65f2a6107f1257bac92df94fed31c25f8 (commit) via 34d67a24058477dfb0ec69faca7847dd6b1847be (commit) via a6c78c049ab01dbfee34b639364d8b1b05adeb0d (commit) via 6dbc12df684e146d15e9d5f9a68972f0a2196e10 (commit) via a1709057ef6fa557d9106bac0da54899952d5cba (commit) via 24e7554e15f12233b6e2fd294b9be4c1f8c24a06 (commit) via 87120b9c2a1aae4671b674ad3e06cd9666d91752 (commit) via 6ad699358b6b421da6c49cf540b30eb8b0a3a996 (commit) via b7b66919a3952a3a2c31d659fcbe3bebf7e5887e (commit) via cab5471a7ba0f45273f293104f5d00d1af8284ac (commit) via f4e2face6f867601f8a73754d627a81b26cdfd60 (commit) via e138207c42f39e8cc49a7f954a75b2a8da522e6a (commit) via 4783b842baf0e081b3385b00d696b6635eee655d (commit) via 5f5e3062cf2394f4e28e078817e074892e9c508d (commit) via ea026fb2198ebd47353270461059183bbff867bd (commit) via 40852eed8e304dffd7254d6790850e0a73766d9e (commit) via d0e6fc28334023a42fbae797ece8c8e8526dc1c3 (commit) via 60515b205e0151fa0194a984850e652a04a9a165 (commit) via d9a4da453fb6fe2a5f16eb35a0d3756f88801ba1 (commit) via 60b28de5c8c364d26824dbe2c2666ea47e8870a2 (commit) via b74061ba386a46d273bea37f377998a4e1936a65 (commit) via 71371e3d936c89945e4369c0daebe9c7e13dec31 (commit) via 94c5fa5f7a189c1a99891bbacc6a3b291f399d7a (commit) via 101135069425a1f3af85aa7d1fedf2656d9674f0 (commit) via d9beea0ccacc8c3cdc14b71b660a73a458f09650 (commit) via 4eebc52eca3d551423d7e512284a3b71e13d30a0 (commit) via 8d45a2ffe0439187ba3873e81ebf894906745bc5 (commit) via 1c7863a7654724af0afca6d20b80a50153f6d5f7 (commit) via a40c9825bbb1ce5ac43b041bcd54a5cea85f4a92 (commit) via 599587feb1685eb75b7efe32cfcc16fed13d65b5 (commit) via 6cc93b370ef59208b9b468ebc9d84cc02e3cbd85 (commit) via d8426b57a66d7a420f28b0b0309d1502e7bcfea8 (commit) via 377d1b7896e07a171bcfe8da6d9dcda6545052c2 (commit) via a9c113fd3e24f95908fedfb6cd2601d8a4795105 (commit) via 4d78bea5dfa53958a1317f655b1e761e457a54c7 (commit) via 68031b4fdd2ec2eff7338b8f44bb563678299f8a (commit) via a893018c47dba503caca0c8e2e22d12aaa9b6752 (commit) via 1ddce8fd6de1a88af6e81f6cfa36b48b7948a53d (commit) via 8d93815d204b4827ff9f1280a73e55861c00f47c (commit) via c74698cb75b9923517f7f87eacf04ca0eefc8e72 (commit) via 8cfd25db711c22f9478e565a496145577df24d77 (commit) via c0e6b22d0a81c0e0dc1ee87366790882a3d54667 (commit) via 0b684524ac657b03ea233e039aad5c8e43a52f2c (commit) via 01a4eec446496f52146949a959fab2f1fab6e654 (commit) via 4ccf40e61e02cffb28b549a3de6f4794ea3e3d92 (commit) via c3ef56795102516c2d5c86b5d90808e854cda514 (commit) via 75643755a1492f3d07e811541207769341eb2b9e (commit) via a7eb2877b87117fb02ae4d3b730361defca4a96d (commit) via 56890ede2a6eed4db074e3fe6c56e5d03dc42b6e (commit) via 9794b72d38d4aadef352d3ae80d7dee2fbfcb7fb (commit) via 993dfa89d8f49e06d44e86c97502a5d7630f3dcf (commit) via d8af0700a3cf1391f33c5585c4d19e331d968d4a (commit) via 95db11fdb189a08a8530a767dea2c272e3605077 (commit) via cb811d11cee1e2873cc2bf506cd081769e894ac3 (commit) via d170a3177fdc57c96034f8a2ecf5d0f9aff70af4 (commit) via 615fb2633cd6f4e7543eb172e10f32f09cad6d88 (commit) via 30c98db61be3e0079305514b98b2d3d07b6877cc (commit) via 3d856eba16fae90f66dd142f91c21d4121b760d0 (commit) via 9e1df5df5479b78d65d37e58b5cd0c93d70838ae (commit) via 36f36d6a49976527a13a77d1ffff1fcdc5c3f5ba (commit) via 3f57787dffa629b7c10ca2a02229b7e1a4bfe1f9 (commit) via 20d7c5631e88d80cb683a5e120c0c1e1f077945a (commit) via abd62201bd7d10f8eb27229ac3f5e55d52d0659e (commit) via f2c8ff825995c1425a134e24eee6c4fb73c3a6b2 (commit) via 996e1885c4995e2d73712a7d0aaa0d615be5fdf0 (commit) via 955f7f41c08b90553fb4bcf364c12c072802d925 (commit) via 61f70e81a708db126ba5e2d1135ff0e2a5ffba25 (commit) via 800b2aad13ec36c61c6d4bfe825aed6afaacd301 (commit) via eca275f63d1ef03c366cf498db4f4ffd393a5245 (commit) via d0e37018616d43defbc16c752ca9b2be72261fb6 (commit) via 246fdcc049caf19cc85f3ed7a6c20940c6c3cb00 (commit) via 637292a3a9b60ff4a6febe8080f47d20af787a17 (commit) via cb23f2ac8b2484c9bf1e0db78831b3ea8d54766c (commit) via 8c322f9313e60af28d2deee739a88a683885e484 (commit) via 77ae6ae8601e41028fa3bd9454dfbf63ed7b876a (commit) via 7db32efbab1c61e4b8032702eba5ac6d7768d531 (commit) via 0116bb19d354f1bdc8ae1152202ff5d829b4acf7 (commit) via ce078dda79df1c8d9f142e45d2fa3cf971a09594 (commit) via 044dcf9f8d2bfb10825627f7e18456a1679d5ab6 (commit) via d350fb688954f476d8df79bf582cf366b5861dd2 (commit) via 1baf122cd41d6500139649661052236b8e684565 (commit) via 66f3f11af5ecea17680077c39c6e0fe7738ca34a (commit) via 8542152626590db6a13b20aa3d36214186c6b40d (commit) via bf64e50da4a36e17ea0e27a45a5277226e123210 (commit) via a9428fc473ca6eff749bd9868e2caabf7f84cc39 (commit) via e27437d0e0180fc03c44621b0918b559ee393efb (commit) via 2e94c1185b09cc56e9874969b159836606d0c983 (commit) via 9ecb3f8d5c82a86734ee3af3c17a3a08e6b8daa2 (commit) via a000ec7a087b8d221f52960abc5a9785e27551e2 (commit) via 52ef218664ff3bb4c162cf9e722756a22e6dc2e3 (commit) via 44c6acc053ebaf0565408a1395ea1bde5d105305 (commit) via 2ed688a863671d58513055ad56ab04d6be05295b (commit) via fb3370b6a1681190ffd8daf63975c44ce8fc1c49 (commit) via 5cd187147ecbd29a0afc5a6b49f2232b61a1ab8c (commit) via 0238295c7e9d19340e968b766d6d0cf07fc5af50 (commit) via 87609eebf390bdf183aab80061ee9fa2fbdbc17a (commit) via 0e4739140028932879643609e88b90eb0145dcbe (commit) via fb15c27562856e01565d6903d38b9c4ab73c3fa8 (commit) via 0225b05afea1d291e37e29b361f4252c4313aab2 (commit) via 8d5eb9787885d21d5d20630473c11a79250ca28e (commit) via 2d3767822662ad3f19190eb5a84b43becdb84a1f (commit) via 9aecda56ba960267b392e54e5c28388a6cfa92ed (commit) via 3205561b8a04f16d0004f73d0dc5eeffd0c7dd02 (commit) via 34975815a8b07879ea10b23e8cb630bb1930a3ee (commit) via 68a0b51ef882456affb852e33317cc58aa1e3692 (commit) via 7f9e93aa0599e039f7673fb55143701754f33bb9 (commit) via fc4324a27cb534080fa981a77391e0224df2ef67 (commit) via 5ec9d16b5a955de40d1ba904d08479ab204c0cb7 (commit) via d145d72e708b7d742fb1324c056ba2c0254dda76 (commit) via 458ea9d76c42b982b48104e700d844a50dc4978c (commit) via 60ec2922585d3710b45212fb5671676ff726965e (commit) via 536cca60ea1c037d751b03bf5da8385783856000 (commit) via d38d7747fe91db4753e9aa26e9b7dd8d065e1cdc (commit) via 8905f04a1d17dbec61a8be29ac37da223222c005 (commit) via 8b667f24d4d65422dd889eb7102136bd651ee47b (commit) via 0793464d95c3dbbe9ed87bb5882d29efb7a8e3c3 (commit) via e2128e11ac7ac38f33100f5277cb4ace8697bad8 (commit) via 6aab5e0ef9b95933495042f3e2dab64c3c002f37 (commit) via 58f04b6ecf853e4ee5cce2bfb258fa7d4cc75b79 (commit) via a3f062091f488237c0151f3f4753e0668f37c60d (commit) via 8cb26a0a2ad57ca9012f97c7437711ee94f1a9db (commit) via ef9c38ccf8b6bf12e8d8b539a316a304076948c8 (commit) via 9194e9a78268e8976b1de7d7c421018e4530f0a2 (commit) via e59e17c1c7059b7d0f02d6b12bc3094a2afee778 (commit) via 8e4899fd6cb3518723710f7ba57d28ef058518c0 (commit) via 81cc3de28e2245f0fa9aa017aed9aa120e87cb23 (commit) via 032e969879f4362471eb4a952b28aae6fd5a8116 (commit) via 717e85418b068734dd9d8d0aa3063ec4e363fcbf (commit) via 3e70a8d0df08301e11fd5c01e623223e434b3d3c (commit) via e10b04ef055f2c46749e683d13b643c9e2cf32e7 (commit) via 2418a5aec0cad5cfd23fdb82ac6e11aa2a20a63e (commit) via 7f83e8033bd30ad112989f7dc17840fdf497586b (commit) via e3ebad7def73fa656069835e916db3245ab70a62 (commit) via 4adc0b7c758ed98776bec63d21bb2037b0f28e2d (commit) via db6fdfdb053a372382ff8eadad9bfa47c1a3b4bc (commit) via 4ff7706f2d7eaaffe3970da5f77d18f67771a4a8 (commit) via f70367e4ed8a3092cd333acb8bb79735e8307980 (commit) via d798d2f7c5cc6b3fc69974f8d9392265228dbe5b (commit) via 90c616b936027ee7db2507d6310cb2f80459bda6 (commit) via a5932438cd71a8ef4a7480d9e2e86f70bbf571d5 (commit) via 680641a882254d3b8c6eb52415e7be841a46a6eb (commit) via ea83d0f8fb8fd6806c4d5f32e0392638ddc3b65e (commit) via 1601b47b3e55e5de755412ced342a5bb75c4507a (commit) via 2bae6a1346cb95703a93dbf73c9689598c9056d1 (commit) via 3b415c60c1a02b9ac76089a44c28e70692dcdef1 (commit) via 83c47ef5b8a6b1a63edbd82092d8eae68da453d6 (commit) via 5d2e1404bdfa83eeae5b361bd7d8a882aadc7242 (commit) via b6bfa7eeb29937fbed44153518abfa4f28b9aa62 (commit) via 39ee9718d9a56e7b8b15f63576f042415a2771f8 (commit) via 8d3dad9a76591ae0426335d039b8aaacb95862cd (commit) via f0948499f6b47a7a856aef3334a8d8a38c1265d5 (commit) via 239a8a026626449bb09508d88a650eb0faad2a97 (commit) via a40f9083dd17d1cccf89ccdf290c3f494cab3aac (commit) via 67645c132b39d1bacc524f1afa58367b8d4ba4fd (commit) via aeddf63587c242a7995598f4b1a5f248e4e3cb13 (commit) via a550e2d6e48798d342a5ba7436013c6aa6ce5151 (commit) via 5ae15061c36f45551d0308a5ff916067970705ff (commit) via be101e909e42c4a22c180d29ee217d5b8c4508d1 (commit) via b70bac647dd2124011f8b98c7472ecfebb404d35 (commit) via f621e7fa5df8d35cc379f9f7825f3d75b8489876 (commit) via f65763fe9be16ccded53f26dda257fdb028cccf6 (commit) via 37acc9e2299713b9b23c767e72b0e0169697e510 (commit) via 06dab0f0e5dcef89a0d03c4fd395a13a99056ea4 (commit) via 39e7fd8c68a1f039f089756352a418bd0ae36aea (commit) via baed22c4b000d524f4890af86cf3c02dc885cba6 (commit) via 44d6370db35c82d182bfc9480f0f0031b6b559ed (commit) via 538721939faef01b00ffd20416e8f7146d7368ac (commit) via 876680e94bed75e1e22a78f1e063e545ff6bce69 (commit) via 784c35b4445ca4ecf5a6aad859bd3724cdb49ff6 (commit) via 6aef0aa5fe2fa85342f3903f8e9ac0afdc62aa07 (commit) via 0a29875313566c12cbc16391fc23dbe2da8c5c18 (commit) via 613ac56e508be666e2b6fcf42a6502055bf0764c (commit) via b0f46c48f6e3efc0481d7c573f67cc76dfa5b2fd (commit) via 646fb1a646a3b860e983f3d030dfd223c761d49f (commit) via 0d641fcfad232a6981f587a8ee077dcf08432843 (commit) via a289d7951734d7d107e3d3f780740e4f6f759b05 (commit) via aa0692de6707face3ee45c458923f1820441ba95 (commit) via 6b126c47bd0b90f2af9f800910054b3139667a73 (commit) via 3d15ae4ea121ba68572f0314a93b756ed2659e09 (commit) via 0e953e138bf4a5e6f1e66bf6d89241781502f088 (commit) via 284429ac879a91fe00e6f2c773b9a0d187667b9b (commit) via d6488cb6b3f417af1756e82171256724c8283e24 (commit) via 698f51abacb572508c5386b406c2c8a30f0be1e8 (commit) via 4f07fdde26f1de59e2e8c2a32f0af7a2caff422d (commit) via 18962f8f8f71cfb29cf56bef7dfecb022f423a28 (commit) via a53c3f03bc0f659f326810af31b094dfde4a98e5 (commit) via 32d7b0cc2c1ffe26fe4d84adfa9d1e7595c9ec10 (commit) via 68b307caae74ad0c8b455434fe1444f0f61bf638 (commit) via 442f4c49026f4fb0d8eaa7f9d004cedff42bf9bb (commit) via cb33befe2dec44728003720ec187ff2e7eb0317a (commit) via 0e4fbb4a1f24bf1e9cda4fca41f9cf80bd57aaf4 (commit) via 7e60e77c3c2a09eb11750616db50d2dc149a9c54 (commit) via 14270eab369c3b700d89ef385af2cb94a6497b1e (commit) via 1889ed923ea8c2dd204ca38b8109efdf1963c578 (commit) via 26b6d2aff0076b44fac605de0d3dbfc3f55e64fb (commit) via c756fbce9ba94e2d7f1b787d595df24dbe99c9c1 (commit) via 99ce35ab9cbdac4a7cc626590f5e86c36ae29070 (commit) via 658efb4c1ab309646f0a29f806315f805de477a4 (commit) via 52aa68228401c62dbe79c54b2b8346bdb8621dfc (commit) via 2f01090d81c086cffd6d4dc048a635343d7a4528 (commit) via 7b98a6eb68e6a2c9a422e42c8eeb78dfa4038364 (commit) via 9710d4aacf801d3dc7ab243bc2c8e051a65871a6 (commit) via 95e72c0157ecd9c603fc541fa7e9fa246b777969 (commit) via f161cfe5a8fa00d6d203885e9c1985ec53d7d625 (commit) via 7baec5e94b372cfc21e777488ecf993e4bce368e (commit) via 191269d247827a4c1de739165c0555b4c9ea9d79 (commit) via 95de172b68b23124d8dfa3fb238876b8f2ecd3e7 (commit) via 521475b41b06d6f99edeeb9a36edb2bde8b55579 (commit) via 7cbde5c503f15bcc568a64239977b8e1f6f501cb (commit) via 7a5adae94dc8ca38fb2323742c6e4164682a876f (commit) via ffcb4f7ec5789fb62812b88f3909100a29277e44 (commit) via 0090907e86d5e837f23fea9823664ceff6b3832f (commit) via a9b38a17571bca0801594adf85fef59fac51d6ba (commit) via 2024327746747989f47dec3859e2ca4bc66267c3 (commit) via 52fb35bd69ec2fa1a5307695cb22c3f125debf4f (commit) via b783e625334bbac9bbc16edce9a818d2d213de3a (commit) via 9bddb03f318dd152b32c651354c9f1c30eb4d902 (commit) via 45edf1ad66a97e9083b37aeab18e33436df70b29 (commit) via f5acecaa6f653ac6d4f216e5403d917856fbe19e (commit) via e6b6bb06188ec54a568b54d45930bf38d6547c27 (commit) via 4336a29edd5fd3a70db83103df8f36c5d8bebc59 (commit) via 4359fe133b03aac5d0b0c1ed2aa98a49515edf56 (commit) via 8c28e63cb4da99dbb894573a996c27e260b5baeb (commit) via 56abc31270cbe60845021107383f1cede0ed075e (commit) via a6324490e501154dba620a2495afd6f09eea8167 (commit) via cf70b871438f1ae8a40a4d3822376f75151af258 (commit) via 5c1ead795d3fc003908a515565842cf1815eb111 (commit) via 85b26a7254ce66404227f2b715fd4e29c64668f6 (commit) via a15ed54dca5ebd2535a737b7200677c945c5c082 (commit) via 0dfb056cd3fa655ddf3cabb6b3ce0309b3037ca1 (commit) via 7795b3f2bfe3dbab35a494ceee37745eaff110f4 (commit) via dc6b76d1e751224c60aba5489fb62228cd8a6bad (commit) via d1c2f8787ceb0cb5e30d433e05f774bbdd910ef9 (commit) via a63a50c77af65092d82b9c3a6de3ea34c63605d4 (commit) via 456e0fb64f5c70191145c34104d6f25bd24b7b37 (commit) via 3d6d7c170ca9ad291a0deedd125b8f9ce82d15bb (commit) via 78ac8cb04a0723b10a9225e97a9e04c126a38a99 (commit) via d48bf97fd3ec9c6cc818d32978122f019e35f638 (commit) via 6fdba8b8beb6d971a3c2efe8973cdee970dfd40a (commit) via 058217669fdb089f652c68b9eb0a3231a7172c91 (commit) via 8a2f62cc18ece0ebfed0ff6abf53d419d43d2fa1 (commit) via 14c7396fb940d04f2afd3e9a7230fa6d4fac8145 (commit) via d724060459f6adb5e7d99efde08c8fbacc4fdb5d (commit) via c1d1027ac1bf922972ebb121f369ff59be27103d (commit) via 707283981fd455bf0bf3ec62a669cf1c0a2e1edb (commit) via 8ca1b262863d8a5cbb8306a52873101c2e940f78 (commit) via 81985b7c6c9a15ca7a59c54979d8371c783fb581 (commit) via 18f7b2ed2111ff9dac5ef83d8bbf20b826b8bbe9 (commit) via 5fb122ff75f0fac2c421a6cba6c78a2123e3fd49 (commit) via b32e18fb88434d3f9d58447212ee33a51430c144 (commit) via 5431395d68a44d42149fb93692636f4138ddf6ed (commit) via 78eccc7836e068652ea772ec65614bc446f23b14 (commit) via 30bb14c65777bad02b3360797bf9c7b0fbe3280e (commit) via 56ae290284a7f6f7298bf7410a361aaecb7ebbe9 (commit) via abbb8a7b1d40b98fb1841a76efb676eea7771cf0 (commit) via 11338389e5f89a58b18d63e29e21c099cfbf407e (commit) via 076118694995c19de7637156322818f3994de76a (commit) via 3e129d71bc12a325c0548aaaea24470cd172470b (commit) via 29802ed27227fe91be1d531d6e894e4efbbb3d11 (commit) via fa2dbbbdde6c0861b2a950db1e5e2bb8476a8d19 (commit) via 6b5fb23e362d8e99e5fe78334d4bcec5e2ad8f29 (commit) via 249fb7f71d6ed5feaae0dfbfa48f9bf665b1f551 (commit) via afa2614eea6571c36be130805ff876d25f3edae5 (commit) via 922480e6f14fa5b248475fb58ab07c3b2ef5befa (commit) via c5eb01d4d412610673c85ca1bf8b9d15c168ab5e (commit) via 5ad73b608d4fc7cc6b30017159b800802a503b0c (commit) via 99698ee351a6ec05ec1436299818e759a58bc0a3 (commit) via 735c6f39d9bed0ee291ce20368028ae682756095 (commit) via 11475cc5811e6d665cb41fcb1b7f68e6f1cb8af6 (commit) via 2d66567dca2a5a80e41493ec0a9d6d86f7d955f5 (commit) via f13aef4de57a74db72c258edb78108da60a030f1 (commit) via e9bbfdd9a115332deb40da10784d478f4930c68f (commit) via 5bdee3786359b6560eb9ee1d6fab8664feb90db4 (commit) via 9e4de543d067586b0f74666f7b07717a3f3173e0 (commit) via 37da6af17d0d2cc8b499dc58f74866351e06c288 (commit) via a1e6b414b9ade99a8f4e6bbe9bbff43ee1a05e88 (commit) via 266dadf8683c9c0081368604c4ccae12e8ffc9f7 (commit) via 7d19b3091d7d2982a0d6b2b4408011efbb56f167 (commit) via 1177464dda0849644d78abb1802b46238fe3feb3 (commit) via 50a5b7beee03693b45cbed1ee0422213ccd07f47 (commit) via c690e11a56d713d4137e8a719c26269bd18e8030 (commit) via 5674018cc6e7f1823a5baec7e4732cbd64f28795 (commit) via ce0e402934a7f93a98ee86462c472938eee9226c (commit) via e2d439a11488733511a5a258ee56dc39d543eeb7 (commit) via e532052a0a766747f439bb5ce7c96c5a7ce60b81 (commit) via 15be06a5ecad09b08c9e81aa5712173be3f88f72 (commit) via 45ec5a2270e19662ae4b3eeb8a5f63c5f2431f42 (commit) via 24da7da68657c7c719e908f519c0f94da3a15701 (commit) via 816663495874e123c2d4a187edb6eab07593f10d (commit) via 14b6cd497f0e27dc5d02d678fcab0ca1492a320b (commit) via 983533a4b8cc3abbeaf11c1cadad4e14dccc5824 (commit) via f92ccbc306c20554af35709faf00f402a6c34978 (commit) via dda01904587627a3d2bda5b684f7bef1e62596bb (commit) via 390f14a24416f23801f5644eb51590f8317d35c7 (commit) via 07dd1d2782603126e65c57b3a71248dbdf83ed46 (commit) via a60f1c4faf32e0e1d89a4f88e3b5851e1c0aec27 (commit) via c03ee3ca714715671ff54cd2f61217b62637ff14 (commit) via c126e80b5a7a9cf98ebea7c34a2b5b5f848dfab1 (commit) via 3843d0550bf0657b5626d02c4184350c8f26aff5 (commit) via fcfbc01d68aac2eca7435bfa0f01e5d1b3524303 (commit) via 87341d8328c7b3a1d50cfd534ff4cb44334a2561 (commit) via 5a15c9e7cb63fb5b884271a1184607a8fa87d442 (commit) via 5f6c236481da552dfdbfff6579dc9d833993adad (commit) via 18c30786a9a1444e726e23366dd9badb01f1d464 (commit) via c518f305bb8344e79cb2487f8bc0186a0b0c0336 (commit) via 5e958ccd79024cb0dbd654ecd71120e6367d6cc4 (commit) via 07f3082d3b52f1bcba8dd4ef82b3e02c362b392e (commit) via d2c0350c7b2e4e30673ddd09a7c6b1413b0c9471 (commit) via 6d5872a3969b75686ee7d67449581ab723559bf5 (commit) via 82dec5191ccfd1308c157075acc53f677a8895de (commit) via 36611418ab5eb86158beb235a7c26b43fa057015 (commit) via f288383b3ff3f1c095ecefc41e53a638f76e9744 (commit) via ba55fc2aa5f80efb49f53eba2bf8f2e1d2b6899a (commit) via 8494bc271399cf4e474f640fde08e6cd61d932da (commit) via db20cb2f9f2ff1d00593e0fc921184d99f58749a (commit) via 9fbad8b40be8e915f84f51842d88e97b0c949b2b (commit) via 28ef639d2b08c1cbdef20e70f4b30f2841916cc8 (commit) via b289243d993b697594a5593033b9178b0511a177 (commit) via bf9afa1e15f9d61850143ad279d1fc1d515c84d1 (commit) via e7a760fe7d20b5c3da53e2daa415ac09865da78c (commit) via e7fb007b615bfc4d7cb0ddfb096225e36c6496e4 (commit) via c85f23a016c0567665865f4ddf4c7ea43b8d2d18 (commit) via de0d57c97abe88a1025d5a26ed94a82438468349 (commit) via ecc782c75d7ce98c03164f616e9adf9760ce0d7f (commit) via be2764a6576baf4b380cfcf5418284e9bee80dfa (commit) via 2bfee8a58b01fc94db56dc0ed8bb5da3f33cf2a6 (commit) via a65a404186c69fabc61ea87459e22110c998fb1b (commit) via ff91071a14885b9e031b262e5d576b8f174870a2 (commit) via afc4612fa57da09748745fefac02a2086f374db1 (commit) via 72b0eeeb21807132e110011add7a243a01653f83 (commit) via db182eb160f2e61bebeb1bb5f289a6d899da18da (commit) via 30495bb1c291627f94912049da6e06d951a062ec (commit) via 0dcef68cd8961f8b3d89edbf46093949778daac8 (commit) via 5db17e9d8107629c1dabd0c1e2bf26429e5d841d (commit) via ccf76c6e4cfd9fc7b04db099f7e165cda2336096 (commit) via 7742bf4ff5180f85bc4401745e11ce6e031f32e7 (commit) via 2c14eb4852924e5423d58785e2cb3bcd72af7710 (commit) via f6241db3e0b69fbf99835b955b17be0f253a742f (commit) via 3c09bf0fa7139be0215224ef85a4c2d3c38227f0 (commit) via 856a271fb7023e5ee1a251a9ebe55c91072d9cf6 (commit) via 46075091d55334d04a2f11207cfedee10149b1d3 (commit) via 2cd41046007de479f660a7794292105908276345 (commit) via fa8e2dfc7b10066b2ba575c20ea96d802109e6c3 (commit) via c9bd2e941f106c4c23bb2bb2623991251b528aa5 (commit) via 4bbd315097fb7161ab245ff0959472729cea2793 (commit) via ba7e44eb7a319d15c7ac18bdf6d15487311a85a2 (commit) via 89abbdd8c8db5bf587373f2a00f6a816eddd8496 (commit) via 4e47e9967aa9d4cd76375468e3b175cd313f3877 (commit) via fb05b6a8f53bbfd15dc549f24c11035ec5272b36 (commit) via 6d8f0627a39ff18c7c7d1d744de405f30aa4d9c4 (commit) via 3744bd0a0afa696546afa3bd128c2c1825fd2fdb (commit) via 94be5f9344aa770d38bc5487aa57ba9566512a1e (commit) via 204c5ccb43e8a0bc937d8adac5eaa4b73f12140d (commit) via 2c43fb5be345b75d12bba227979efd74b810b49a (commit) via 0404efe786b1e2c5c28065a53e55ec77217e7b49 (commit) via 2060a1445c6c6350eb886cfe70f956dccaef798e (commit) via ddad70c8a48eb90493760b7fa3d3850235ad451a (commit) via 413b71485a456456e204183f0d62e11e1ec3c1da (commit) via d79fa9dd55daa24e90c8609fb9d1759f13e2f2e5 (commit) via 868dc1a121f9876a19852e0c6467483ad0d67951 (commit) via 775c8b21dac805da914557f85c2bb1408530c5fe (commit) via 965da8d787ad0ca9b78f98cd276211e997016d07 (commit) via 03d17a35b50e409d466b3042ad5e79010e746f35 (commit) via fac093802a85cad720efe9e42957014b3b5c5561 (commit) via e09c606eb47c13bd435892625943e95bb9452996 (commit) via 1e9cb46c8a9c78261d22ad40af5aff1635b919cf (commit) via 58b83f24c7a3cff8fabc175ea85e24bc0543ba42 (commit) via b54517bf75bcd856461eb2eb54f0e1143c891319 (commit) via 732b7b9dd0aedcfe6281613bc16eee4540ecd387 (commit) via b581cd01744b5d897ef964176d32ef1c1b7e421f (commit) via 12cf0a8e4846e2adcafa6c8527911aad7ed15994 (commit) via c63bd7e06ceb488aeec9447b9faeb4c901b5dff7 (commit) via fbc0f355eac3b1c700da7a6c6cc30e1303282b9b (commit) via be9a133cbf6f055179907fabd6efa66d36cd16b5 (commit) via f401a5716025ecafc5c11da322eba25b77abee0c (commit) via 4d769419244aadb9742cafb06e704d3aa5cc10bc (commit) via 78f23de70c14634db3fcdae4b6cc31f1e43ed3b6 (commit) via 0295b153f4ee0506f1b23f5b941cfd28ee7201db (commit) via 33efdfc0b541d8ccb9d4a5b06598c2964a7285ba (commit) via cd524c1c333fdba71d684bf2759ebb583ad0b021 (commit) via 85415afbdc65baa5dbe86a61008a3a3373e74e09 (commit) via 616282a5ce05d29ddad12c43e64e0764d91e817b (commit) via 5a72dbd40cee412d63099ec7c84f0e1276dc97bf (commit) via a5eeb0310db04aa661dec37f7cc1073e058f3acf (commit) via 71a3391b5ff95271074cf15a4a5d09ded42a362f (commit) via b172a81d5512a2f0973dae6d5545b159e5b1ec2b (commit) via f2d3e233cd2c2d2d623793e5178d9b8707c59e41 (commit) via 23a84ac99006043338ce41bf68314e31ababf6dc (commit) via f7dca1fc97c08146da33a2d6a3ba22ad8e08d94a (commit) via ea9a2c175929f8276ef80ee85f81675fccd9c757 (commit) via 35e09c7aefabc958a550d3256ff367759ce80fa8 (commit) via 51f3a76ab23fda217e61f0d2a53272836897717f (commit) via eea9eda834466272b42f694a14d5d5f3d1975ec2 (commit) via 8c0b7aa17dcbe24b38453843544bc61a25e1a851 (commit) via f1e53266e9ce7e8a9568bde23f865136be958887 (commit) via 8f723e48b8ee79909209ec27ab3a3c979983e34d (commit) via bca0c162230f0391a7cc701922b69d44532b7ebc (commit) via b52d9d69603fa430750fe3528aef2400f5edcda2 (commit) via a13a5c948e3e530716efaae0f56d9d9766c5d315 (commit) via d2101e944a03056dc2180dd790ba85175e04d653 (commit) via 3c4f92cf5bd38355b4843dd6e882fea012306a10 (commit) via 6bbc82b4b30ff17c5b3c899c482b1a724e15d5fb (commit) via 51a1a7e64f1d01a293eb848260925743f0fabf68 (commit) via 0587c4b247626cda58e55f3bdc0adc8c09ac8e16 (commit) via 146b95949194ccf9aff3cfbe2243bde9727e16d5 (commit) via a9a4f3b1936c8e9b659b7b59166d1e73dc6d2397 (commit) via e67e4dbaadf3583d665fb5409b425e1a238d9748 (commit) via 46090c2337f9d867b8662247f0033f002742d42b (commit) via da5ee509b21d6cc83700f280afa75517fffb059c (commit) via 670d27da64bba1fc284db8567c187c12a3e281dd (commit) via 94068446161dbef9ce42a0333d5ec9afdd3c24ce (commit) via 53184a727d0f3b233988212628fec6ef7803da69 (commit) via 8634576dcb03087fc507b8012a47f1ecc852f65f (commit) via c7c6a4a2cc06fd22eeb1c545dba030eddf39363a (commit) via 7c47fd8cd1e7d9aae60412ce7544fdfa82c9e798 (commit) via 0adb0e01784ab114efeb2bf24df9c40be706cf01 (commit) via dfea916d3c1e09d7a008a27029540b5ec77adb5d (commit) via 875f49cc588b898f5da24bff34638d16de5c6413 (commit) via f6cbb02b59d179c572c347461e81201bdd2337ed (commit) via 23874e407839bdd93a05285c65a5dc20c225ac24 (commit) via 4480769f8bdcc0fa954da098a1612003102a7056 (commit) via 8d179cce8790d2a514075b72c11a1e039c51d942 (commit) via ec3c968de27d0d352dce53e3400a33b1bc576496 (commit) via 1de0c827a16e1ef5b4c6c900982c6a76061d2c97 (commit) via 5536cec46e9af9af3ee5756e59b57bcb7fa23e44 (commit) via 98d48469534f7a491b8c358d513472806c858d22 (commit) via a6d75a1ce0daec9c60ed850163f76416de35edb7 (commit) via 216416219ae438ec5e93a1e125298fa0b5fd64d9 (commit) via 31602583930b6c517c439ae8c15df26043031345 (commit) via 103aa9e46a5a59dc2c41cc1fa1aa6dd406b2924b (commit) via 6f24c4e93f6ae897b793f894b67543d86c7de477 (commit) via b06f8c93e5bc65394fe55b3f7ae923fe296048b3 (commit) via 482d9ef9a8fe640d45eabbf4d6b32cfe5c1d124d (commit) via 283330976f2379eec214bfe1d51a27c29cc1f8fc (commit) via 73f23d1e0087a3b025ab7ba6b3e6195f19b40e1b (commit) via 0bd2e3aa5747f455971e1bf5960a2a623327e5cd (commit) via 49f606f3bbce969a4fc79e0be5bdcb690c78c959 (commit) via 90b775848913296af976d05dc82b8a45add4c6cf (commit) via c213e34d0cbcd2dcc8b0735103d9f4a1f1346dda (commit) via a77a30e657acea42787b22e88f84fa829b6234d0 (commit) via a7d853868b147d9051c40564f2b3e445011b888b (commit) via 380b2dae554f4da2a6ea5d335bab2b789e932cae (commit) via c58f5e116e0fd4fd883320812bfb052582005e90 (commit) via 3261f2387038e251d25852069f0ffc6fb81ed0a0 (commit) via a6d8165dd2abe81dd133d188c8fe81323944c469 (commit) via 5940d18e49fd7269e611fd020b97279a2c9e1942 (commit) via 9bede5c4cecd71fba7ce6a0687c4a68e1c84a54b (commit) via 0db702c7024a507f5c2ab67522d1d2a7699df611 (commit) via f739654ddf3b628660e1a1550ba570061d909f02 (commit) via 7d77607d109c1061cc90bdde8fcbe5ebdcfdb016 (commit) via 41d796c09be11da2284182e7da7f79940e86e07b (commit) via 164261910d573605b437e7abace210ea8e80e598 (commit) via 80af3ddea7ce2717c9a33a51954b9ccd6246af1d (commit) via 2efecea485a76df149ecc5d644cc2a1ec6c33cf3 (commit) via 8355665f8df5d9e1de5a50cb78d62071f55b7b43 (commit) via 00b5f1a1b5f44167184e5602385986172afa7a3a (commit) via 98e6822fdf02d74e1b3e3ff4b1e7ac27138654c9 (commit) via fb5de060bc99635a5b18b3389cc15e9937b19a0e (commit) via a11e5e021b5c30a0d6490cfff0399a14a3fb798a (commit) via 7111873efd91c4ed7c38af117e50ff2ea4d8f0e5 (commit) via bba2b1c89b32030289623cd9f5cc68d7c40ab0bb (commit) via 28ae243ca695915b3e7d572ab70ca74db56f1d36 (commit) via dd8c2f3e574673b452830a69555680042c0c5cc0 (commit) via 32a569e8771311348306f15644bfa048ee183892 (commit) via 7bc03aa6e24a7120497b639148268d52df3d691d (commit) via 9915003eae2c483f783eca4d73bb0cf49cdfbae0 (commit) via 101621ee528c84a56d2938a6683b5a7a20999a0a (commit) via accbf41da54ee9cbbedd040676e02ee57d47b73b (commit) via 46ad0f7e9dfa57ed4c1bd9f85f08ec5ec9d32f17 (commit) via e1af2489fda9129e735007a069fae018c4ab3431 (commit) via b759fa9b8e2fa8ac93e4b57a0e09fcdc5e0e50af (commit) via e2e8f6b132967844a8bafc866d6cb5c90342af08 (commit) via 3039fd7a2934f726b37ba4ef8379364441241e7d (commit) via 1761a9a54668da90c61f47afbb4e520a7079a697 (commit) via 2cf29217492a951ee40c17f855faa48aa26098f8 (commit) via f92b4b52ebb335ce540966d7f198df3878f6f46f (commit) via fbaf65639ada9f3dc58337bf86c1cc036bc1694f (commit) via 9337cbfccab0b7a0984b837d71ff59543acb574d (commit) via 80b761b9244d5ab9047082be40ebeee256be95ef (commit) via 7b81b1c72c5885ac5ec8097ff8f15677e55d8f94 (commit) via 40ad7cabc69149391d95c39bb578def164c80441 (commit) via c0f53f743edd0946a267e384da0d390753409533 (commit) via 61023e0b8f3835dd0ad8253158fa8f3e75d00a32 (commit) via 1b8c5a0c35bdc8e7004a56fca356f6c917e31a15 (commit) via d7c4a8ab81182ec438a444464a9f13847080d8a6 (commit) via f74bb6527e669a02ee9f042023fcb4c9cb9f9594 (commit) via 76e6e01c6ca67f1449a2bcd1f434657de7f0240b (commit) via 414332ff57650862face4b23872062c4b4e018ca (commit) via 2c280acdf836b661cdfb2bdf3a3b5f1fda15a424 (commit) via da2e58893524414a84cde576a472293c4641fe8a (commit) via 57d178bbca7757792653f1a658423826c52b5730 (commit) via 5822a7bed289100b78a502e449b436da2fe67af1 (commit) via 077ab5774c637eb2262587425199579c90967577 (commit) via 071f5e15440d676c36c6ed8a92618b8ca4bb36fe (commit) via b96c3c74dd76fb9805f02d7b9ce604bd135b34f8 (commit) via e81b4250190fce338711026489f1521fd4cf2acf (commit) via d1a54ee26a5a9637b60d094c2b4a7b3251c78b1c (commit) via ae416a6b5c58f1e897692fcddf3154483782e0bd (commit) via 60a407b01c40921bed2fd30336fc09b9ad48e154 (commit) via addd1ce4024498b00499f971ef065537209b51a6 (commit) via 7358f317e356dff8ef2c1cdd216b9e6063cd4d9a (commit) via 05774d4b5845d0b7cbdd1985922b3351a4ebb39d (commit) via b53766b2058160853a29c2bbf8dbfef7345552a4 (commit) via b544e34af61d2f12a5da62e29de5d635171b2b1d (commit) via 463c2fba4eec7f364689a11b7c36afe966b1f151 (commit) via 21da25d2a878cfccf9496ef7b227de2c98601ef2 (commit) via 06a59f1bda3ee5e1990f664dc3e2dd6d1acba81c (commit) via 40be48f8907e37e5bd1ce94d6b28f3bb4727db70 (commit) via 7a30d72728b9334e18205dc65cf4419efdcfba34 (commit) via 5c106bfc42a5eb068719c3dec28ddc6dfc493973 (commit) via ba3e8f9166e3128ce96a92bf84b91a3b9d2257cd (commit) via ec459c10c46c149f6938c852b4bd0295975cec50 (commit) via 42bbde4193537ac9e9e955304ef63ed696c2c225 (commit) via 18ff7cc34f5769bd14ba2893b54647f9b639f847 (commit) via 8145876a1f17eb13878d6b9e0f45662e8873fddf (commit) via 9b2665fc2cee185fe7ceaf767c4a39c1d9749219 (commit) via 89215c8ccfdb3d38cfe59b8bc5c684c9a48a9cc0 (commit) via 93e19df1df1f205a80e9c5eea328dbf0c0d52775 (commit) via c2a3a945a5d57dd6630ec0a51434f6e3bdc0e274 (commit) via b7a861647ec5584e23d3730edddf18ad45a2e465 (commit) via adba2945b301ae1bc35dfbc70125654c8db237a7 (commit) via 58426958ab159ed1f05f6425f914f969dc954e25 (commit) via 4fe56a67d9452d7a5b8fb73d3cb311606668c868 (commit) via b90cab5bff63902818cc3cc6268a7f96157c1381 (commit) via 8c998e7523d93dd25a516dff6e88b7ee93d8b70e (commit) via d7ca0a2644ca2348c6e7273c3f20e1c51db2b321 (commit) via e58e38f2fbd31fd1527c19c2a33151a6c23ff22f (commit) via 46c5830394fc38c6c23cb5ba58efec69b90b33f5 (commit) via 2992ba2d02c1cdfe1ea181e3d560087126c700a1 (commit) via 6ae5fffd0f91632ff9c80bf6c28620fa5ff57eb3 (commit) via 3a5ccabd15ac535d73cd8d129974dea9d670b58a (commit) via 591fab8a6a49d4067121059d0e5c1092eccafc5b (commit) via 538e699e5a981012181e2f1a76a96848fef50caa (commit) via 8f05be992172e6d65bbb23426231fa253d7f15c9 (commit) via 629613ef977533abb91ba8679334f7f4f0068bb4 (commit) via 4de554b1a52aa82d797368008fe2e54340a20bf1 (commit) via bf1e73305ac1b6bc9021b80fc8da99fda032c018 (commit) via 83183cbaec0770baa5ed319858227cbbe83a277a (commit) via fb744ed49c613c1cb83f67af1c98bb2eba69b132 (commit) via d564d0619496612ea174d221a643fba8d1f62538 (commit) via 809890e3f6bcb1a5def21e2e99a54bb6f38505fc (commit) via 43771d6e7384d7539144638d77ea96cad16a8203 (commit) via ce9117fdbef582c7bf0dab7bcd492747a14e700a (commit) via 3e9ce09a56f639e4bee787f0e96185b31bd6ccc4 (commit) via 742339a779acd06a0808e9d0fb3315aa863f932a (commit) via 28186bd2bad418e7f9d813787812ba0ddf48ce09 (commit) via d53317130e84898c5328c237186dbd995aaf1c12 (commit) via 1166aa5ce784a07ca2ce7d750f11ed174562bdc6 (commit) via 67428e90255443769950cf2c46d00607eb6a878a (commit) via 64e2c14c4a2be32bcac53067c4cf00364139e9fe (commit) via 451d3907fdb0eea70f1107712324300d786433d7 (commit) via 168c11f70e52f9b4f00ef289a95023be3f273d2d (commit) via 324d18bb3418aee8dcb63e28106ac0dac6abea71 (commit) via 4b3a73980011344740f804ddda31cdde35a397b8 (commit) via c9d2e1cee07a9b93d9584768ce5610af70b7d44d (commit) via aa68ce6bd43356fb5ebb77a3e9eadd3bbef5bed9 (commit) via 6873e984869d7f0f96cc8d93ebe76413d1b14b36 (commit) via 80898a49d9c60f7f14c1135fe8eb3ba3b162f5fe (commit) via 70d204410af9745181ca3f9bc5c80e059f606fa8 (commit) via dbd3b1ac90b70f31f10488a97ec72c6a435106ec (commit) via bb97a377dd15819357937b4644baa8848d22a990 (commit) via ebc94500c1726f393ac6119848d53deca47e1ccf (commit) via fdeb364a84f99fd1d1f34a929d02a86653ea364f (commit) via b3955a08ab1af0e2f4dc8b42b2b387e474bc01db (commit) via f1367c8c51cacff745c77400c355cd038716f3ec (commit) via d1558fbf3ab770b8691a8548a297d1c48fe666eb (commit) via 033728e86780d61215ebcab442d9a130bdd0461c (commit) via 26068d2db88e685680fa400b1e4c26d710eeaadd (commit) via 6bc6f41068b06768f616d1602bd2e9edfab70b88 (commit) via 57fd4b9d65e86010b2aba0ab00d62eb90a5ddc50 (commit) via 980d9a987d10529e9e69d6d1991e0861fe03865d (commit) via 4cda0b66fa67bdf1ef0e3c859e49039366b981ff (commit) via 8b1716a62a4209d274cfb2334aa2330f21d6dbcb (commit) via 96a99d40698110dd81bf6222a6b9ad83daacc0e8 (commit) via 911d67b173ef2ece7f7e5f5ee73f69515bffe262 (commit) via 0465c32a82f4da7745294edb1b0efe50ca66e15c (commit) via 9a5fe96f4fb8b5fbc39f8a01a388cf428ffaed32 (commit) via e53a968ed582e28522b65c0f4ca00741294425b8 (commit) via 2f59cd637181cd246ab700767ea3e3cbd6cc3df4 (commit) via b8307adb9f1cd5c5d8fc5a75fb958356b2f091d7 (commit) via 19e15853e9ace8df5acfd784811479cc14d3a369 (commit) via d84fb10034fc7371474c3d1413e78c317f743833 (commit) via 95222584ee2a2ef7874c4eaf9cb20733fa347ad8 (commit) via ce4eec97af00d14c9a57c0ac4e6762c0a4edf686 (commit) via d0a328c9f67bb8e267bdeeb1cfa95da41bf7d6b6 (commit) via 6066aa471e28eb3d95b251d4d2a3bf83a31bba4f (commit) via bfd71fc05c8495d9afefc920f2d59776b184098c (commit) via e21bae378d54b24f695080d05d55a9cfc6858877 (commit) via 4a79cdc85f885abfde9c3da393a55ef8ec947637 (commit) via a4f2dd9577d23e77ad4daeea0e32bd8283204bdb (commit) via 93091cabace0b690fb1d977a6df219a42751bb12 (commit) via 8989fa255b7c4d1b9a7598eec29335801292e149 (commit) via 0d9471fa2dee221aef8166ea370a98cc26d783e4 (commit) via 0df31d99ae44e1e151feb4df977a4332833ea872 (commit) via 5c58a7e4d2eca9aa93518cc567e874fedcdf2a80 (commit) via c29a1d58d9bc80eacfc39bf0fe274cf617444f2d (commit) via dac7e8b833cd2e55e3d17edd9c26c3e06ce6bba1 (commit) via e6195989c7124904b6263a64e0b16938987cdfcd (commit) via a605bf438e303b3fa7fa3c3b5dfbcb5164c1e7d7 (commit) via 258298f59799311ad6a3f261f7e7bebcaf346657 (commit) via 1a281a1acdcce3d6ce5a2a37fc4e0f6ab77ff0c3 (commit) via fa339ced67d14bb608b2a71c37c3b99d90941d47 (commit) via b13a8441cd1338ac9f8352a4df54759a1b19088a (commit) via 07421e678556a7381578cafc9d717bd485f8a39c (commit) via 23bcac5d582b55f15a892b0e39f67e2d3e5057b0 (commit) via c3ce9cfe153cc2af510ee0ecdd05d7e55abfcbdb (commit) via 557d4b5882f0ea1e1ad7eb1d59674e8683e23058 (commit) via 8c3172e7c265d54ce02766db7ef1166f68bf897f (commit) via ec033b5b808680f2d8acb1579837d13db78191ac (commit) via 9b075d90326aeaf5450fa9b4f40bdcc76c3b2120 (commit) via 72a630645417dd19afeb621af6d64dcd71862065 (commit) via 2645839a83b96b43bb692f542b214ebee6a2245d (commit) via a490ea4a2854a4c08f01b34bd444333e1bdbdc76 (commit) via f20eab9cdc26ffbacb32e5942e2969058e50581a (commit) via b3191a0f5740d5efa5d6286d3f7c2b9356fa87c0 (commit) via e795be115e9c40d6092958d64f251db435acc4ba (commit) via 9636b03cca8b812fa2e33adf9b30ab5268b6eefb (commit) via c7213ca87064ba47984b4dd07192389366d5856a (commit) via 63191b169e28630db586ad7c975823cb985d6a10 (commit) via 78ff8d573777c099aea5bd2eb92d9866c0d85952 (commit) via 2621efac19e0538f0f92f69ecab60db184c70953 (commit) via 28a296b6c43f87e6b148c2207062fcc9a09961a1 (commit) via 3c7662fd625079553d3edd004fcf2b3348d38415 (commit) via 5ac1c809f7cc257807afc1fa779150aa1738fe4a (commit) via c24392eec1ae3d97bad99039cdb818ecd1e6263f (commit) via 406e6efb394d416668e62f05eee9f0abed90ca2d (commit) via 30fc5ecf239d4900d8131b7c0933ff4a1d57be80 (commit) via 7c292b37cfb28407f7716c63561c8ff7f0dc5540 (commit) via f22c18b1c1554b573c684efcb5c921c17c9b0f1d (commit) via 7c78adca8e0285c198e03163c2bb722cd86b389d (commit) via 933dd9164210a2f08dae6e1333ab7e5c30e3b012 (commit) via 2c0a7bc770367e80ce1fc68ea6cb9c9543e854e4 (commit) via 72f9bb29939f3765216e98e672197b3899d75f7d (commit) via 2dd0cb7aeb2d70dcc6e103c29ce2ce3a02bd381a (commit) via d3ffe90598da9c9439cc9a42012c0bef05ad25f7 (commit) via f259e8759ce300cd505e30cda1b5fca3ba100cc5 (commit) via 917c035ada212cec47f92b51449b554526119372 (commit) via f6eebee1943ef306ee4912aeff5012388d64b7a3 (commit) via 11fe7c9063d22197c8de7fe30575f5acf5a0a10c (commit) via d9d285c5ad2987ed4aa3ff89093818239781708f (commit) via 0d489fab194efdf77970cb981dc9b636c36da2ea (commit) via 1699f5c231bf0a9fa411eda637564b7f4deec7f0 (commit) via f709089d845bd70bd889a691b98cd60427e161d4 (commit) via 5c41386357977d931f73e3bb824080af795b3cd5 (commit) via 82782379337fe922f96f4f19b8deae1fab6212fe (commit) via 6f5cf2d2c6cf2eaa9f21fff8a4f1309de2963a47 (commit) via 90c6156aa8272ec9811647d9b6c87d7ee4326e35 (commit) via e0231fe439fef3e5f64912f65393e756c4473cc8 (commit) via 13b1d2f9f86249ca32113ed7057f5d92222496af (commit) via 747463d1b36a8bea31764db88ed4d9677b76f27f (commit) via 16c687825daef4008d52b9b68bfa603ba493ac03 (commit) via f3b4a12c610e6c4fc37ea03c902c354228208726 (commit) via 40768761b65e7644674f894a9dfff05c06515d72 (commit) via a6cb73b97f60b6cc09b9ccf80a65662ce41a5627 (commit) via a4d99e4dec6818406ef0c09c456a9dd08fb8c384 (commit) via 94970cd042963bedd4594d867802880b13fa9f69 (commit) via ac419931eed3e62cc69762a2a8b8dd76192999c0 (commit) via 0476d16589cf62bc631acc2f50ff2a0525b6d641 (commit) via ae309d757dfb4f654360f5412b86243e54cc387a (commit) via b583e43c2617e31262e46271c1889a27b5c870cc (commit) via 224a5c9b07d7f999f1c925454b44f0bc0a28549e (commit) via 2cc6eedde479568b99320fe17b418a520a7d1c10 (commit) via c068236bb9d003c43856dd2bc2052605d4377982 (commit) via 90323ff0513c8291bc36ea9b84a55eeebbf00329 (commit) via 283b8c2ae6234d7f71bfe372c71a80deadf9b39d (commit) via b5a69c62793b0b77f56a12c07946a691469ca3f6 (commit) via 3fff09096ab87914a08499958d956c2be1fdd085 (commit) via d930e8c0438a7cac85668a15dc6387d2296dc849 (commit) via e4ad054e496ced06a7bf315eec35bd6ee202daca (commit) via c7f3663b10178e3324bb22759198b19c7c3aa8c2 (commit) via 3f685ac3e131cbf89391b9e63163283e1e570a9b (commit) via 2d291667582dc8129ed1c3c4e7d7333f3b8627f4 (commit) via 8182c21d2d40506c3d4b0751e559173d0b47cdb5 (commit) via 63928f0868ae48f0b21464b466a0f8bc7b8e3369 (commit) via 84819c79e7efde0155dbb8431d0a205b325ce1cc (commit) via d9893fb594c904605b3b9ebf3548d2f48793f788 (commit) via 214fcefa5233fb9c5906921f72d067626a51a349 (commit) via 02587d80cf6d6250c461c0838180fc222dbce099 (commit) via b8031308f39d66d0dca3b5c59fe62805298dc91f (commit) via a8d51ef8b780644011da8974d99c524e93fe75f3 (commit) via da4773e8b8100f27ee117005c81e81574f5a9868 (commit) via 17a367e77f373e2781e80e80aaa32644754e6f88 (commit) via 9eb0e73f461f168fb036c304de13d7501edf6d12 (commit) via 5e36209f716900cb8a61c1bffd480c639be041bb (commit) via 14ae19c327100c137ec8cb549dfc7447c4888940 (commit) via eb08e68b77954a4b439ee66b4987789b213d878a (commit) via 0ffdcba1789dab86655bc787fc480183467573d4 (commit) via 4e315e9449735fc0f246c8cc838613693e849296 (commit) via 001446126e71b3829855aac29048999b7a4ce6f4 (commit) via 9dd255548d0a82994da71c3667f3b6668de50ffd (commit) via b76b83efd37a439e22d1d92af3b98c30e8f9ba97 (commit) via e0fbb7bf0843615e805ec325432d0c6d2ef9a30e (commit) via c2f6da3399efa1448eadbae65311795ced3f8930 (commit) via b38023f958325fedd99d5480149f4958e721fdd5 (commit) via bb6d46d7e4f65bad099b919ffb1e34c0571ca727 (commit) via 8732a2b3ba81d7e512d8c317b037db5caec10ee4 (commit) via 462a320c8db91f4f646a19f34b9b41154019a68e (commit) via 7abe332cedd2d92285233ced3cdf3ecaa3eb4803 (commit) via fcdd6efb724439502e9e0fa95a6c0ccb4d32a5a5 (commit) via 85d779442bbc9376a0c71f0dc8f42d0df52c11d4 (commit) via 943a50da55f8d1b25f92dd010c4c54e3b0dfcda7 (commit) via 18ff514b52600a6fb37ca6fd7d38e7e3aac7129b (commit) via a84e509844b74d445b654cd9d0be98a8f0e0641e (commit) via d59159afdb630734213a120334f394331ef18504 (commit) via 8a95808f8fb0766197ff904bc0c47ad9afa54098 (commit) via 7574e16096abe57d44cde4e6380a22d940cde98c (commit) via 2bff8513f22ae02d1559851d0eb814083d015a2e (commit) via 9cab31cc79b9c19f2a5121a392a3498d06e25723 (commit) via 2dd2079152ceda32a7e5f330f7182fd658716c41 (commit) via bc34282da63c3f25c17fee73c97fcc46a0a164ca (commit) via 55ad9304ed87f365e69b5dc01d5b07d25aecc9e2 (commit) via 2a1f6617911da55e6563a775c807270a7f566b18 (commit) via 0281f9a4cad6e189601a87c9ccfba8c54e71e14b (commit) via c489c3e7158417b1161d46555ce1c2bcb31527fc (commit) via c048cb75fcee6b31cfacdce714b343c6623f5c9c (commit) via 75b45956e044701c0ebe6dbc433f629e0558bdb8 (commit) via 566652b0c8ffe6896d3d3ae1cafd58dddd34eecd (commit) via 0923246b2e2fb5be0d2fa1b256879a326aeee13b (commit) via bafd0ffa987bea9216e7722c027478f26d5e8f6a (commit) via 0f2eb9ac6fff686c999c3058a76ec398c054bc0b (commit) via 786edf9ab408c35384a081d9f33ec048b4060f1f (commit) via 03e10384ecb779ba6e02028d6833c5e8cd3541c5 (commit) via d2489f2fde0adad51272b83e44957860f7b4c57f (commit) via f1235fd37d101d021ffa2dde1c67f0ea1cf1cc87 (commit) via 8ec1942f62a659154abdd99602440757f5eef485 (commit) via afb325018ebe7c41933b652732a43e4bb4777588 (commit) via 657b30905a9d03869c99064872ec715c9934312a (commit) via 706b93fa558c5a2e0e45a7068b5039d1f40fbc90 (commit) via 820424d95d7b10ae08affe79288ac594a561e5bd (commit) via 160735c479535f0137c7b9a14edeccb623473f74 (commit) via f2dc10d55c24d1714d65ce990a8e7658d92d2e14 (commit) via 3c9c91a360104b97aa6ad27934ff7603c862a2f7 (commit) via bd20cc29a20f087348e7724da2cbaf311626dc06 (commit) via 442cb77bf31c02f83c47167ef9842b7756029227 (commit) via 6646623993666ad4d18a82fd7571138a8c418046 (commit) via bb99ab8e539e47c05593806b495fc9cdc230570c (commit) via 029abf9733e15bdecfc166a0ca7ec8c384104adb (commit) via 3bc2fb55b46cb7daebe92bad3a5e6e9426af28b5 (commit) via ae5e97a00568d15dedea073b58668e646e3c0d2e (commit) via 3411c815752470432d56c7bf265d9f99d174d082 (commit) via 91344e7a46a9c6a2d20781d889673143bd74d15a (commit) via a2a903fe42f6ef54665135cac54b75d50bcd696c (commit) via 30faf7262561da45a79af5de9c77531091dac6b9 (commit) via 8c4de819449bbb1710b1cc2440357757e5cb757c (commit) via a930de85d88891b2516c60306bb49cc85d38c5a8 (commit) via f510aafbfc33d3bfd6ba919a17f608c7bb85cfcf (commit) via e3353a0175fb27bc2967c3df78b8be1c0615b21d (commit) via 0069825f50c83b8144374150dd682d48c84f6874 (commit) via 50ba2f019baa3e5487a975cb72059f1fc178f9d0 (commit) via fd74eba1402d66a4d6a1af3442cf219d02f7cbc8 (commit) via 49a53cac87fe3a303a2794ccdd7c1b5cecd2d016 (commit) via 8fc0c98f082177acadaa208117a56327fcb83d9f (commit) via 5b3683ec8a23d8cecb27f3cd2e3a649ae6ad5999 (commit) via a40864ae53ad22c369596699cc1bb791f65dc360 (commit) via 724359489e03c1c890bea4bc6ba71ca353b048b9 (commit) via 6ed4ae4bad3bf3e226e0c8009f9b4057707cfc21 (commit) via fedbd16f352a8202d30332228ca586a69b513c89 (commit) via 157570b5a2d3135e2d83f9bd2865ad666a709499 (commit) via 63efce507bfcf7eec1dbcb10acadeb3304d6f20d (commit) via 8914d4317a21a5673afbc72312559cc53e73eeec (commit) via 264128469df1460c60099a3321b80cedcf8d2d26 (commit) via 21853e247c6b18df4e691cf29855ede3bbcce28e (commit) via 122946def94e15cc2b6941197ac0cf3d92815206 (commit) via ec13bd523006151b4e0d2b9afc19562e5f05de38 (commit) via 99ec095d9ddc6c2a8f073d38e14da66d1a245f80 (commit) via c28abdb5aceac3fdf9383b0ee464d3578fbb86b3 (commit) via ded4bc136e5b120b2d047dc9b8eb6f7446043d08 (commit) via f3999a21c85e6caf19feef7c90afce3969d9102a (commit) via 9d2ab63aaf5fb29d812dbfc942da4d7671c5d1b3 (commit) via 20afd497c92f66883de5dae92e2105c2f0cb4f70 (commit) via a7a85719332b5be90bb9ce1f3707a767197566c0 (commit) via c0ba467d2de9b6af7bd1657c73eb0638f1d2c89c (commit) via 336300d53003d2ec135d302acfdd1827062a05a6 (commit) via f468c0e1b98389fde7df2baccdc3815171a47a35 (commit) via 9e34f11b3604269c8c4f98bbcf237daeca9eaa2c (commit) via f0a57d42a2b0309c14615b7a9572f611ddda435e (commit) via 64ae72c52ac44984c9d5a23b19f4bd9dc9a68fdf (commit) via 080a79ca4a0448043e0713b9b580c5f84b7330b3 (commit) via fc8b90af2c7f35f770b3167de2dd4c632b3042ea (commit) via 950c099d83757acd57cec78a3579ea1f6aaddf96 (commit) via 091afa7342e6c093f404b4777b81313535d73435 (commit) via 006768903cb6586098218822129d622737848299 (commit) via d625dfcdf9ad36802d0615cd929dd5c407a46524 (commit) via 8a1d25afdf92cabab88598cc9b9e5a9fb2a9493b (commit) via 4b37b4f1bb785a305ab742f37e5268d4cffef693 (commit) via 17de1eea806d7ba87a4ba6ad1073ced5f7ea9473 (commit) via 4a944deef99a8d2cfd676a3517b24fdf063a1f8c (commit) via 5651568d14ee227bcc8edfa3801e1847ff89a23e (commit) via d9ddb30e92ce1c9c98ce6603660b631cd42bfed0 (commit) via 56c2eab1e23fa92594bf0696ea351d77ae3aebe8 (commit) via f6291eee251ec4fbc699ee63294057b0bc7016a4 (commit) via 948c55857e126825ce5f8282857d6970ba14e6bb (commit) via e7d319714d3b45bf6ce94cab04fc4cc6f20032eb (commit) via 2f2295ec9ec35632b89213ed857e3bae4398f998 (commit) via 440b08e4f0f59f47b53eb8310832bd4a1b1eb912 (commit) via a3ec65c3e8758c5d70743a0241fd6838879fd950 (commit) via 48b377a08fd5269eb2473adf6776d45fffe448ff (commit) via 18b0329a8165c92cf94b5b97c2425df090c877f0 (commit) via 89ca5d7fdce7730f38a719683059bbe02e6fb19d (commit) via bf1279450496db727a646afb29109cb9eba3c7b4 (commit) via 9783825de5e3398806a432a3c72f048b88bf9640 (commit) via 3f0a5b3fe849776ef9c087d34bf3fb740913bae1 (commit) via 01b2d6ab7465e7f22fb821876027df86b0c8f363 (commit) via 15bdbec0176e3aa620bb5bda3631819c5ca18eaf (commit) via 82edd98300b9d050dd28fdfa1e6ea7b18ecca22c (commit) via 41802ef35d58ef9d8761388abeee202503f11642 (commit) via 5228432b45b7ce740b93f2c80c8c7ce6987d4bf1 (commit) via aeed642936c90dfbca9e28b2d5f662933ec1df56 (commit) via 0732cfd7a7985a3840a8e675f5c3f379b3158235 (commit) via 00ba28ffd03a9a0cf00d78001573bc5cc045ee72 (commit) via 0741eda2468e482baf1b5ff6a3a8d376143171e4 (commit) via 982e6e777556de8db44b16b144ab62f4b7172319 (commit) via 450a1904d5c7611806b8da55f2df72bcc0ddcacb (commit) via 555b3c11ec60ba7428f26c1faad0656e7b8fc606 (commit) via 6252a7ff61ed457f5e655dc6420d594f5b4ef0fa (commit) via ebb6b3a2da8d81cb95515ab4d5cc38f69f20cf47 (commit) via 7df10748e254c91cb9f39c000f98b6ed0e45f537 (commit) via f60ec9e63a3a237ba868d2a454152a59a8c38b6a (commit) via c2ffcb3aabc5d422784eed7d11412e754087ea58 (commit) via 8e746db6e11f9e017cd04552efaf40235d50363d (commit) via 42825fc220f9d05c8db629709a94deeced42be7a (commit) via dd45f23b0142fb92de17458dd69b2b6f967f94bd (commit) via 65baaa0e37e114cf8e505c10d80ec3efaf3887ad (commit) via f3534386b504430aec926e46a413b044ff64d769 (commit) via 562ea5d0e200a5e005ef33dca45a7d08a5e8fbb7 (commit) via 062cfd991faac000d484c74e5af7d65726c655dc (commit) via e97a4bed4f35e2508227460b0c537c9868925a6e (commit) from f3e9a6ff62f6f58cd661dd447c22a01c50f6f4ad (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- ----------------------------------------------------------------------- Summary of changes: .clang-tidy | 2 - Auxiliary/bash-completion/cmake | 5 +- Auxiliary/cmake.m4 | 2 +- Auxiliary/vim/cmake.vim.in | 4 +- Auxiliary/vim/extract-upper-case.pl | 18 +- Auxiliary/vim/syntax/cmake.vim | 881 +++- CMakeCPack.cmake | 3 - CMakeCPackOptions.cmake.in | 10 - CMakeLists.txt | 35 +- CompileFlags.cmake | 20 +- Help/command/add_custom_command.rst | 8 + Help/command/add_custom_target.rst | 8 + Help/command/add_definitions.rst | 2 +- Help/command/add_library.rst | 23 +- Help/command/add_link_options.rst | 17 +- Help/command/add_test.rst | 3 +- Help/command/aux_source_directory.rst | 4 +- Help/command/build_command.rst | 2 +- Help/command/cmake_parse_arguments.rst | 14 +- Help/command/cmake_policy.rst | 2 +- Help/command/ctest_submit.rst | 20 +- Help/command/ctest_update.rst | 3 +- Help/command/enable_testing.rst | 15 +- Help/command/execute_process.rst | 20 +- Help/command/export.rst | 11 +- Help/command/file.rst | 30 +- Help/command/find_package.rst | 27 +- Help/command/get_cmake_property.rst | 2 +- Help/command/get_target_property.rst | 2 +- Help/command/if.rst | 6 +- Help/command/include_external_msproject.rst | 4 +- Help/command/install.rst | 29 +- Help/command/install_files.rst | 2 +- Help/command/list.rst | 39 +- Help/command/math.rst | 2 +- Help/command/message.rst | 68 +- Help/command/output_required_files.rst | 6 +- Help/command/project.rst | 25 +- Help/command/set_property.rst | 4 +- Help/command/set_source_files_properties.rst | 2 +- Help/command/string.rst | 9 + Help/command/target_link_libraries.rst | 2 +- Help/command/target_link_options.rst | 24 +- Help/command/try_compile.rst | 1 + Help/command/use_mangled_mesa.rst | 2 +- Help/command/variable_requires.rst | 2 +- Help/cpack_gen/bundle.rst | 20 +- Help/cpack_gen/external.rst | 2 +- Help/cpack_gen/ifw.rst | 4 + Help/cpack_gen/nsis.rst | 38 +- Help/cpack_gen/rpm.rst | 40 +- Help/dev/maint.rst | 6 - Help/dev/review.rst | 75 +- Help/envvar/ASM_DIALECT.rst | 5 +- Help/envvar/ASM_DIALECTFLAGS.rst | 10 +- Help/envvar/CMAKE_GENERATOR.rst | 16 + Help/envvar/CMAKE_GENERATOR_INSTANCE.rst | 7 + Help/envvar/CMAKE_GENERATOR_PLATFORM.rst | 8 + Help/envvar/CMAKE_GENERATOR_TOOLSET.rst | 8 + Help/envvar/CTEST_INTERACTIVE_DEBUG_MODE.rst | 2 +- Help/envvar/CTEST_OUTPUT_ON_FAILURE.rst | 2 +- Help/envvar/CTEST_PROGRESS_OUTPUT.rst | 2 +- Help/envvar/DASHBOARD_TEST_FROM_CTEST.rst | 5 +- Help/envvar/PackageName_ROOT.rst | 2 +- Help/envvar/SWIFTC.rst | 11 + Help/generator/CodeBlocks.rst | 6 +- Help/generator/CodeLite.rst | 6 +- Help/generator/Eclipse CDT4.rst | 2 +- Help/generator/Green Hills MULTI.rst | 12 +- Help/generator/Kate.rst | 8 +- Help/generator/MSYS Makefiles.rst | 3 +- Help/generator/MinGW Makefiles.rst | 3 +- Help/generator/Ninja.rst | 4 +- Help/generator/Sublime Text 2.rst | 10 +- Help/generator/Unix Makefiles.rst | 2 +- Help/generator/VS_TOOLSET_HOST_ARCH.txt | 4 +- Help/generator/Xcode.rst | 4 +- Help/manual/LINKS.txt | 2 +- Help/manual/OPTIONS_BUILD.txt | 43 +- Help/manual/ccmake.1.rst | 2 +- Help/manual/cmake-buildsystem.7.rst | 25 +- Help/manual/cmake-env-variables.7.rst | 5 + Help/manual/cmake-generator-expressions.7.rst | 200 +- Help/manual/cmake-gui.1.rst | 2 +- Help/manual/cmake-language.7.rst | 6 +- Help/manual/cmake-modules.7.rst | 1 + Help/manual/cmake-packages.7.rst | 19 +- Help/manual/cmake-policies.7.rst | 14 + Help/manual/cmake-properties.7.rst | 14 + Help/manual/cmake-server.7.rst | 5 + Help/manual/cmake-toolchains.7.rst | 12 +- Help/manual/cmake-variables.7.rst | 12 +- Help/manual/cmake.1.rst | 144 +- Help/manual/cpack.1.rst | 2 +- Help/manual/ctest.1.rst | 83 +- Help/module/CPackWIX.rst | 3 +- Help/module/FindEnvModules.rst | 1 + Help/policy/CMP0000.rst | 24 +- Help/policy/CMP0001.rst | 16 +- Help/policy/CMP0002.rst | 12 +- Help/policy/CMP0003.rst | 10 +- Help/policy/CMP0004.rst | 11 +- Help/policy/CMP0005.rst | 10 +- Help/policy/CMP0006.rst | 26 +- Help/policy/CMP0007.rst | 10 +- Help/policy/CMP0008.rst | 19 +- Help/policy/CMP0009.rst | 16 +- Help/policy/CMP0010.rst | 10 +- Help/policy/CMP0011.rst | 31 +- Help/policy/CMP0012.rst | 27 +- Help/policy/CMP0013.rst | 6 +- Help/policy/CMP0014.rst | 16 +- Help/policy/CMP0015.rst | 20 +- Help/policy/CMP0016.rst | 9 +- Help/policy/CMP0017.rst | 16 +- Help/policy/CMP0018.rst | 35 +- Help/policy/CMP0019.rst | 8 +- Help/policy/CMP0020.rst | 22 +- Help/policy/CMP0021.rst | 19 +- Help/policy/CMP0022.rst | 30 +- Help/policy/CMP0023.rst | 22 +- Help/policy/CMP0024.rst | 19 +- Help/policy/CMP0025.rst | 10 +- Help/policy/CMP0026.rst | 23 +- Help/policy/CMP0027.rst | 28 +- Help/policy/CMP0028.rst | 26 +- Help/policy/CMP0037.rst | 23 +- Help/policy/CMP0038.rst | 8 +- Help/policy/CMP0039.rst | 8 +- Help/policy/CMP0041.rst | 8 +- Help/policy/CMP0042.rst | 4 +- Help/policy/CMP0043.rst | 8 +- Help/policy/CMP0044.rst | 8 +- Help/policy/CMP0045.rst | 8 +- Help/policy/CMP0046.rst | 8 +- Help/policy/CMP0047.rst | 10 +- Help/policy/CMP0048.rst | 14 +- Help/policy/CMP0049.rst | 8 +- Help/policy/CMP0050.rst | 8 +- Help/policy/CMP0052.rst | 7 +- Help/policy/CMP0055.rst | 8 +- Help/policy/CMP0056.rst | 6 +- Help/policy/CMP0060.rst | 6 +- Help/policy/CMP0061.rst | 2 +- Help/policy/CMP0062.rst | 2 +- Help/policy/CMP0065.rst | 2 +- Help/policy/CMP0066.rst | 2 +- Help/policy/CMP0067.rst | 2 +- Help/policy/CMP0071.rst | 2 +- Help/policy/CMP0082.rst | 2 +- Help/policy/CMP0089.rst | 30 + Help/policy/CMP0090.rst | 27 + Help/policy/CMP0091.rst | 47 + Help/policy/CMP0092.rst | 38 + Help/policy/CMP0093.rst | 24 + Help/policy/CMP0094.rst | 22 + Help/policy/DISALLOWED_COMMAND.txt | 8 +- Help/prop_cache/ADVANCED.rst | 2 +- Help/prop_cache/STRINGS.rst | 4 +- Help/prop_cache/TYPE.rst | 6 +- Help/prop_dir/ADDITIONAL_CLEAN_FILES.rst | 16 + Help/prop_dir/ADDITIONAL_MAKE_CLEAN_FILES.rst | 16 +- .../IMPLICIT_DEPENDS_INCLUDE_TRANSFORM.rst | 10 +- .../INTERPROCEDURAL_OPTIMIZATION_CONFIG.rst | 2 +- Help/prop_dir/MACROS.rst | 2 +- Help/prop_dir/TESTS.rst | 3 +- Help/prop_dir/VS_GLOBAL_SECTION_POST_section.rst | 12 +- Help/prop_dir/VS_GLOBAL_SECTION_PRE_section.rst | 4 +- Help/prop_dir/VS_STARTUP_PROJECT.rst | 2 +- Help/prop_gbl/ALLOW_DUPLICATE_CUSTOM_TARGETS.rst | 16 +- Help/prop_gbl/DISABLED_FEATURES.rst | 6 +- Help/prop_gbl/ENABLED_FEATURES.rst | 6 +- Help/prop_gbl/JOB_POOLS.rst | 5 + Help/prop_gbl/USE_FOLDERS.rst | 4 +- .../XCODE_EMIT_EFFECTIVE_PLATFORM_NAME.rst | 7 +- Help/prop_inst/CPACK_DESKTOP_SHORTCUTS.rst | 4 +- Help/prop_inst/CPACK_NEVER_OVERWRITE.rst | 2 +- Help/prop_inst/CPACK_PERMANENT.rst | 2 +- Help/prop_inst/CPACK_STARTUP_SHORTCUTS.rst | 4 +- Help/prop_inst/CPACK_START_MENU_SHORTCUTS.rst | 4 +- Help/prop_inst/CPACK_WIX_ACL.rst | 2 + Help/prop_sf/COMPILE_DEFINITIONS.rst | 10 +- Help/prop_sf/COMPILE_DEFINITIONS_CONFIG.rst | 6 +- Help/prop_sf/EXTERNAL_OBJECT.rst | 2 +- Help/prop_sf/Fortran_FORMAT.rst | 7 +- Help/prop_sf/KEEP_EXTENSION.rst | 2 +- Help/prop_sf/LABELS.rst | 2 +- Help/prop_sf/LANGUAGE.rst | 3 +- Help/prop_sf/OBJECT_OUTPUTS.rst | 6 +- Help/prop_sf/SYMBOLIC.rst | 2 +- Help/prop_sf/Swift_DEPENDENCIES_FILE.rst | 5 + Help/prop_sf/Swift_DIAGNOSTICS_FILE.rst | 4 + Help/prop_sf/VS_CSHARP_tagname.rst | 5 +- Help/prop_sf/VS_DEPLOYMENT_CONTENT.rst | 3 +- Help/prop_sf/VS_DEPLOYMENT_LOCATION.rst | 3 +- Help/prop_sf/VS_INCLUDE_IN_VSIX.rst | 6 +- Help/prop_sf/VS_SHADER_FLAGS.rst | 2 +- Help/prop_sf/VS_SHADER_TYPE.rst | 2 +- Help/prop_sf/VS_XAML_TYPE.rst | 7 +- Help/prop_sf/WRAP_EXCLUDE.rst | 9 +- Help/prop_sf/XCODE_EXPLICIT_FILE_TYPE.rst | 2 +- Help/prop_sf/XCODE_FILE_ATTRIBUTES.rst | 4 +- Help/prop_sf/XCODE_LAST_KNOWN_FILE_TYPE.rst | 4 +- Help/prop_test/COST.rst | 13 +- Help/prop_test/DISABLED.rst | 14 +- Help/prop_test/ENVIRONMENT.rst | 2 +- Help/prop_test/MEASUREMENT.rst | 8 +- Help/prop_test/RUN_SERIAL.rst | 2 +- Help/prop_test/SKIP_RETURN_CODE.rst | 2 +- Help/prop_tgt/ADDITIONAL_CLEAN_FILES.rst | 16 + Help/prop_tgt/AUTOGEN_BUILD_DIR.rst | 2 +- .../COMPILE_PDB_OUTPUT_DIRECTORY_CONFIG.rst | 2 +- Help/prop_tgt/CROSSCOMPILING_EMULATOR.rst | 4 + Help/prop_tgt/DEBUG_POSTFIX.rst | 6 +- Help/prop_tgt/DEFINE_SYMBOL.rst | 4 +- Help/prop_tgt/DOTNET_TARGET_FRAMEWORK_VERSION.rst | 2 +- Help/prop_tgt/EXCLUDE_FROM_DEFAULT_BUILD.rst | 6 +- .../prop_tgt/EXCLUDE_FROM_DEFAULT_BUILD_CONFIG.rst | 7 +- Help/prop_tgt/EXPORT_NAME.rst | 6 +- Help/prop_tgt/EchoString.rst | 4 +- Help/prop_tgt/FOLDER.rst | 6 +- Help/prop_tgt/Fortran_FORMAT.rst | 6 +- Help/prop_tgt/Fortran_MODULE_DIRECTORY.rst | 4 +- Help/prop_tgt/GENERATOR_FILE_NAME.rst | 2 +- Help/prop_tgt/GHS_INTEGRITY_APP.rst | 2 +- Help/prop_tgt/GNUtoMS.rst | 16 +- Help/prop_tgt/HAS_CXX.rst | 4 +- Help/prop_tgt/IMPORTED.rst | 4 +- Help/prop_tgt/IMPORTED_IMPLIB.rst | 4 +- Help/prop_tgt/IMPORTED_IMPLIB_CONFIG.rst | 2 +- .../prop_tgt/IMPORTED_LINK_DEPENDENT_LIBRARIES.rst | 2 +- .../IMPORTED_LINK_DEPENDENT_LIBRARIES_CONFIG.rst | 2 +- .../prop_tgt/IMPORTED_LINK_INTERFACE_LANGUAGES.rst | 6 +- .../IMPORTED_LINK_INTERFACE_LANGUAGES_CONFIG.rst | 2 +- .../prop_tgt/IMPORTED_LINK_INTERFACE_LIBRARIES.rst | 12 +- .../IMPORTED_LINK_INTERFACE_LIBRARIES_CONFIG.rst | 6 +- .../IMPORTED_LINK_INTERFACE_MULTIPLICITY.rst | 4 +- ...IMPORTED_LINK_INTERFACE_MULTIPLICITY_CONFIG.rst | 2 +- Help/prop_tgt/IMPORTED_LOCATION.rst | 18 +- Help/prop_tgt/IMPORTED_LOCATION_CONFIG.rst | 2 +- Help/prop_tgt/IMPORTED_NO_SONAME.rst | 6 +- Help/prop_tgt/IMPORTED_NO_SONAME_CONFIG.rst | 2 +- Help/prop_tgt/IMPORTED_SONAME.rst | 4 +- Help/prop_tgt/IMPORTED_SONAME_CONFIG.rst | 2 +- Help/prop_tgt/IMPORT_PREFIX.rst | 6 +- Help/prop_tgt/IMPORT_SUFFIX.rst | 8 +- Help/prop_tgt/INCLUDE_DIRECTORIES.rst | 2 +- Help/prop_tgt/INSTALL_NAME_DIR.rst | 6 +- Help/prop_tgt/INSTALL_RPATH.rst | 4 +- Help/prop_tgt/INSTALL_RPATH_USE_LINK_PATH.rst | 6 +- Help/prop_tgt/INTERFACE_LINK_DEPENDS.rst | 7 +- Help/prop_tgt/INTERPROCEDURAL_OPTIMIZATION.rst | 4 +- .../INTERPROCEDURAL_OPTIMIZATION_CONFIG.rst | 2 +- Help/prop_tgt/LIBRARY_OUTPUT_DIRECTORY_CONFIG.rst | 3 +- Help/prop_tgt/LINKER_LANGUAGE.rst | 2 +- Help/prop_tgt/LINK_DEPENDS.rst | 3 +- Help/prop_tgt/LINK_FLAGS_CONFIG.rst | 4 +- Help/prop_tgt/LINK_INTERFACE_MULTIPLICITY.rst | 4 +- .../LINK_INTERFACE_MULTIPLICITY_CONFIG.rst | 4 +- Help/prop_tgt/LINK_SEARCH_END_STATIC.rst | 11 +- Help/prop_tgt/LINK_SEARCH_START_STATIC.rst | 15 +- Help/prop_tgt/LOCATION.rst | 19 +- Help/prop_tgt/LOCATION_CONFIG.rst | 14 +- Help/prop_tgt/MSVC_RUNTIME_LIBRARY-VALUES.txt | 20 + Help/prop_tgt/MSVC_RUNTIME_LIBRARY.rst | 26 + Help/prop_tgt/NO_SONAME.rst | 6 +- Help/prop_tgt/PDB_OUTPUT_DIRECTORY_CONFIG.rst | 3 +- Help/prop_tgt/POST_INSTALL_SCRIPT.rst | 8 +- Help/prop_tgt/PREFIX.rst | 2 +- Help/prop_tgt/PRE_INSTALL_SCRIPT.rst | 8 +- Help/prop_tgt/PRIVATE_HEADER.rst | 2 +- Help/prop_tgt/PUBLIC_HEADER.rst | 2 +- Help/prop_tgt/RESOURCE.rst | 13 +- Help/prop_tgt/RUNTIME_OUTPUT_DIRECTORY_CONFIG.rst | 3 +- Help/prop_tgt/SKIP_BUILD_RPATH.rst | 4 +- Help/prop_tgt/SUFFIX.rst | 2 +- Help/prop_tgt/Swift_DEPENDENCIES_FILE.rst | 5 + Help/prop_tgt/Swift_MODULE_DIRECTORY.rst | 10 + Help/prop_tgt/Swift_MODULE_NAME.rst | 5 + Help/prop_tgt/TYPE.rst | 6 +- Help/prop_tgt/VS_JUST_MY_CODE_DEBUGGING.rst | 10 + Help/prop_tgt/VS_NO_SOLUTION_DEPLOY.rst | 46 + Help/prop_tgt/VS_PACKAGE_REFERENCES.rst | 13 + Help/prop_tgt/VS_PROJECT_IMPORT.rst | 8 + Help/prop_tgt/XCODE_ATTRIBUTE_an-attribute.rst | 4 +- Help/prop_tgt/XCODE_GENERATE_SCHEME.rst | 39 + Help/prop_tgt/XCODE_SCHEME_ADDRESS_SANITIZER.rst | 2 +- ...E_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN.rst | 2 +- Help/prop_tgt/XCODE_SCHEME_ARGUMENTS.rst | 2 +- Help/prop_tgt/XCODE_SCHEME_DEBUG_AS_ROOT.rst | 7 + .../XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER.rst | 2 +- .../XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS.rst | 2 +- .../XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE.rst | 2 +- Help/prop_tgt/XCODE_SCHEME_ENVIRONMENT.rst | 2 +- Help/prop_tgt/XCODE_SCHEME_EXECUTABLE.rst | 2 +- Help/prop_tgt/XCODE_SCHEME_GUARD_MALLOC.rst | 2 +- .../XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP.rst | 2 +- Help/prop_tgt/XCODE_SCHEME_MALLOC_GUARD_EDGES.rst | 2 +- Help/prop_tgt/XCODE_SCHEME_MALLOC_SCRIBBLE.rst | 2 +- Help/prop_tgt/XCODE_SCHEME_MALLOC_STACK.rst | 2 +- Help/prop_tgt/XCODE_SCHEME_THREAD_SANITIZER.rst | 2 +- .../XCODE_SCHEME_THREAD_SANITIZER_STOP.rst | 2 +- .../XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER.rst | 2 +- ...E_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP.rst | 2 +- Help/prop_tgt/XCODE_SCHEME_ZOMBIE_OBJECTS.rst | 2 +- Help/release/3.15.rst | 347 ++ Help/release/3.9.rst | 2 +- Help/release/index.rst | 1 + Help/variable/CMAKE_AUTOMOC_RELAXED_MODE.rst | 2 + Help/variable/CMAKE_CROSSCOMPILING.rst | 5 +- Help/variable/CMAKE_CROSSCOMPILING_EMULATOR.rst | 6 +- Help/variable/CMAKE_CUDA_HOST_COMPILER.rst | 2 +- .../CMAKE_EXECUTE_PROCESS_COMMAND_ECHO.rst | 6 + Help/variable/CMAKE_EXPORT_NO_PACKAGE_REGISTRY.rst | 9 +- Help/variable/CMAKE_EXPORT_PACKAGE_REGISTRY.rst | 15 + Help/variable/CMAKE_FIND_PACKAGE_PREFER_CONFIG.rst | 27 + .../variable/CMAKE_FIND_PACKAGE_WARN_NO_MODULE.rst | 3 + Help/variable/CMAKE_FRAMEWORK.rst | 7 + Help/variable/CMAKE_GENERATOR.rst | 5 + Help/variable/CMAKE_GENERATOR_INSTANCE.rst | 7 +- Help/variable/CMAKE_GENERATOR_PLATFORM.rst | 3 +- Help/variable/CMAKE_GENERATOR_TOOLSET.rst | 3 +- Help/variable/CMAKE_JOB_POOL_LINK.rst | 2 +- Help/variable/CMAKE_LANG_COMPILER_ID.rst | 2 +- Help/variable/CMAKE_MAKE_PROGRAM.rst | 11 +- Help/variable/CMAKE_MSVC_RUNTIME_LIBRARY.rst | 27 + Help/variable/CMAKE_POLICY_WARNING_CMPNNNN.rst | 2 + Help/variable/CMAKE_PROJECT_INCLUDE.rst | 6 + Help/variable/CMAKE_PROJECT_INCLUDE_BEFORE.rst | 6 + Help/variable/CMAKE_SKIP_INSTALL_RULES.rst | 2 +- Help/variable/CMAKE_SOURCE_DIR.rst | 2 +- Help/variable/CMAKE_STAGING_PREFIX.rst | 10 +- Help/variable/CMAKE_SUPPRESS_REGENERATION.rst | 8 +- Help/variable/CMAKE_SYSROOT.rst | 4 +- Help/variable/CMAKE_Swift_MODULE_DIRECTORY.rst | 8 + Help/variable/CMAKE_VS_JUST_MY_CODE_DEBUGGING.rst | 8 + Help/variable/CMAKE_XCODE_GENERATE_SCHEME.rst | 32 +- .../CMAKE_XCODE_SCHEME_ADDRESS_SANITIZER.rst | 2 +- ...E_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN.rst | 2 +- ...KE_XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER.rst | 2 +- .../CMAKE_XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS.rst | 2 +- ...CMAKE_XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE.rst | 2 +- Help/variable/CMAKE_XCODE_SCHEME_GUARD_MALLOC.rst | 2 +- ...CMAKE_XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP.rst | 2 +- .../CMAKE_XCODE_SCHEME_MALLOC_GUARD_EDGES.rst | 2 +- .../CMAKE_XCODE_SCHEME_MALLOC_SCRIBBLE.rst | 2 +- Help/variable/CMAKE_XCODE_SCHEME_MALLOC_STACK.rst | 2 +- .../CMAKE_XCODE_SCHEME_THREAD_SANITIZER.rst | 2 +- .../CMAKE_XCODE_SCHEME_THREAD_SANITIZER_STOP.rst | 2 +- ..._XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER.rst | 2 +- ...E_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP.rst | 2 +- .../variable/CMAKE_XCODE_SCHEME_ZOMBIE_OBJECTS.rst | 2 +- ...CPACK_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION.rst | 2 +- Help/variable/CTEST_CUSTOM_WARNING_EXCEPTION.rst | 2 +- Help/variable/CTEST_CUSTOM_WARNING_MATCH.rst | 2 +- Help/variable/CTEST_UPDATE_VERSION_ONLY.rst | 2 +- Help/variable/CTEST_UPDATE_VERSION_OVERRIDE.rst | 5 + Help/variable/PackageName_ROOT.rst | 2 +- Help/variable/XCODE_VERSION.rst | 4 +- Modules/AddFileDependencies.cmake | 16 +- .../BasicConfigVersion-AnyNewerVersion.cmake.in | 8 +- Modules/BasicConfigVersion-ExactVersion.cmake.in | 2 +- .../BasicConfigVersion-SameMajorVersion.cmake.in | 2 +- .../BasicConfigVersion-SameMinorVersion.cmake.in | 2 +- Modules/BundleUtilities.cmake | 126 +- Modules/CMakeASM_NASMInformation.cmake | 4 +- Modules/CMakeAddFortranSubdirectory.cmake | 8 +- Modules/CMakeAddNewLanguage.txt | 22 +- Modules/CMakeCCompiler.cmake.in | 1 + Modules/CMakeCXXCompiler.cmake.in | 1 + Modules/CMakeCheckCompilerFlagCommonPatterns.cmake | 49 +- Modules/CMakeCompilerIdDetection.cmake | 6 +- Modules/CMakeDetermineASMCompiler.cmake | 23 +- Modules/CMakeDetermineASM_MASMCompiler.cmake | 6 +- Modules/CMakeDetermineCCompiler.cmake | 7 +- Modules/CMakeDetermineCSharpCompiler.cmake | 2 +- Modules/CMakeDetermineCXXCompiler.cmake | 7 +- Modules/CMakeDetermineCompilerId.cmake | 131 +- Modules/CMakeDetermineSwiftCompiler.cmake | 49 +- Modules/CMakeDetermineVSServicePack.cmake | 52 +- Modules/CMakeExpandImportedTargets.cmake | 195 +- Modules/CMakeFindBinUtils.cmake | 21 +- Modules/CMakeFindCodeBlocks.cmake | 2 +- Modules/CMakeFindDependencyMacro.cmake | 51 +- Modules/CMakeFindSublimeText2.cmake | 2 +- Modules/CMakeForceCompiler.cmake | 33 +- Modules/CMakeFortranCompilerId.F.in | 7 - Modules/CMakeJavaInformation.cmake | 4 +- Modules/CMakeNinjaFindMake.cmake | 2 +- Modules/CMakeParseImplicitIncludeInfo.cmake | 6 +- Modules/CMakePlatformId.h.in | 12 + Modules/CMakePrintHelpers.cmake | 16 +- Modules/CMakePushCheckState.cmake | 66 +- Modules/CMakeRCInformation.cmake | 2 +- Modules/CMakeSwiftCompiler.cmake.in | 9 + Modules/CMakeSwiftInformation.cmake | 71 +- Modules/CMakeSystemSpecificInformation.cmake | 2 +- Modules/CMakeTestSwiftCompiler.cmake | 7 +- Modules/CTestCoverageCollectGCOV.cmake | 40 +- Modules/CheckCCompilerFlag.cmake | 42 +- Modules/CheckCXXCompilerFlag.cmake | 46 +- Modules/CheckLanguage.cmake | 37 +- Modules/CheckPIESupported.cmake | 4 +- Modules/CheckStructHasMember.cmake | 46 +- Modules/CheckTypeSize.c.in | 2 +- Modules/Compiler/ARMCC-ASM.cmake | 2 +- Modules/Compiler/ARMClang-ASM.cmake | 9 + Modules/Compiler/ARMClang-C-FeatureTests.cmake | 1 + Modules/Compiler/ARMClang-C.cmake | 15 + Modules/Compiler/ARMClang-CXX-FeatureTests.cmake | 1 + Modules/Compiler/ARMClang-CXX.cmake | 3 + Modules/Compiler/ARMClang-DetermineCompiler.cmake | 10 + Modules/Compiler/ARMClang.cmake | 71 + Modules/Compiler/AppleClang-C.cmake | 3 + Modules/Compiler/AppleClang-CXX.cmake | 12 + Modules/Compiler/CMakeCommonCompilerMacros.cmake | 56 +- Modules/Compiler/Clang-C.cmake | 6 + Modules/Compiler/Clang-CXX.cmake | 18 +- Modules/Compiler/Cray-C.cmake | 3 + Modules/Compiler/Cray-CXX.cmake | 3 + Modules/Compiler/CrayPrgEnv.cmake | 111 +- Modules/Compiler/GNU-C.cmake | 3 + Modules/Compiler/GNU-CXX.cmake | 9 + Modules/Compiler/GNU-FindBinUtils.cmake | 4 +- Modules/Compiler/IAR-ASM.cmake | 32 +- Modules/Compiler/IAR-C.cmake | 79 +- Modules/Compiler/IAR-CXX.cmake | 95 +- Modules/Compiler/IAR-DetermineCompiler.cmake | 2 +- Modules/Compiler/IAR-FindBinUtils.cmake | 46 +- Modules/Compiler/IAR.cmake | 37 +- .../IBMCPP-C-DetermineVersionInternal.cmake | 16 +- .../IBMCPP-CXX-DetermineVersionInternal.cmake | 16 +- Modules/Compiler/Intel-C.cmake | 6 + Modules/Compiler/Intel-CXX-FeatureTests.cmake | 2 +- Modules/Compiler/Intel-CXX.cmake | 10 + Modules/Compiler/Intel-DetermineCompiler.cmake | 14 + Modules/Compiler/MIPSpro-C.cmake | 1 - Modules/Compiler/MIPSpro-CXX.cmake | 1 - Modules/Compiler/MIPSpro-DetermineCompiler.cmake | 15 - Modules/Compiler/MIPSpro-Fortran.cmake | 3 - Modules/Compiler/MSVC-C.cmake | 19 +- Modules/Compiler/MSVC-CXX-FeatureTests.cmake | 6 +- Modules/Compiler/MSVC-CXX.cmake | 23 +- Modules/Compiler/NVIDIA-CUDA.cmake | 5 + Modules/Compiler/PGI-C.cmake | 3 + Modules/Compiler/PGI-CXX.cmake | 4 + Modules/Compiler/SunPro-C.cmake | 3 + Modules/Compiler/SunPro-CXX-FeatureTests.cmake | 8 + Modules/Compiler/SunPro-CXX.cmake | 6 + Modules/Compiler/XL-C-DetermineCompiler.cmake | 2 +- Modules/Compiler/XL-C.cmake | 40 +- Modules/Compiler/XL-CXX-DetermineCompiler.cmake | 2 +- Modules/Compiler/XL-CXX.cmake | 46 +- Modules/Compiler/XL.cmake | 22 - Modules/Compiler/XLClang-C-DetermineCompiler.cmake | 8 + Modules/Compiler/XLClang-C.cmake | 20 + .../Compiler/XLClang-CXX-DetermineCompiler.cmake | 8 + Modules/Compiler/XLClang-CXX.cmake | 27 + Modules/Compiler/XLClang.cmake | 22 + Modules/ExternalProject.cmake | 175 +- Modules/FindALSA.cmake | 4 +- Modules/FindAVIFile.cmake | 2 +- Modules/FindArmadillo.cmake | 5 +- Modules/FindBISON.cmake | 6 +- Modules/FindBLAS.cmake | 42 +- Modules/FindBZip2.cmake | 64 +- Modules/FindBacktrace.cmake | 18 +- Modules/FindBoost.cmake | 627 ++- Modules/FindBullet.cmake | 12 +- Modules/FindCUDA.cmake | 2 +- Modules/FindCURL.cmake | 8 +- Modules/FindCVS.cmake | 2 +- Modules/FindCups.cmake | 48 +- Modules/FindCurses.cmake | 2 +- Modules/FindCxxTest.cmake | 68 +- Modules/FindCygwin.cmake | 3 +- Modules/FindDCMTK.cmake | 2 +- Modules/FindDoxygen.cmake | 2 +- Modules/FindEXPAT.cmake | 1 + Modules/FindEnvModules.cmake | 333 ++ Modules/FindFLEX.cmake | 18 +- Modules/FindFLTK.cmake | 6 +- Modules/FindFLTK2.cmake | 3 +- Modules/FindGDAL.cmake | 2 +- Modules/FindGIF.cmake | 4 +- Modules/FindGLEW.cmake | 307 +- Modules/FindGLU.cmake | 1 - Modules/FindGLUT.cmake | 2 +- Modules/FindGSL.cmake | 2 +- Modules/FindGTK.cmake | 5 +- Modules/FindGTK2.cmake | 11 +- Modules/FindGettext.cmake | 244 +- Modules/FindGnuTLS.cmake | 40 +- Modules/FindHDF5.cmake | 45 +- Modules/FindHSPELL.cmake | 2 +- Modules/FindICU.cmake | 12 +- Modules/FindIce.cmake | 4 +- Modules/FindIcotool.cmake | 4 +- Modules/FindImageMagick.cmake | 14 +- Modules/FindJPEG.cmake | 2 +- Modules/FindJasper.cmake | 2 +- Modules/FindKDE3.cmake | 213 +- Modules/FindKDE4.cmake | 60 +- Modules/FindLAPACK.cmake | 116 +- Modules/FindLATEX.cmake | 6 +- Modules/FindLTTngUST.cmake | 3 +- Modules/FindLibArchive.cmake | 3 +- Modules/FindLibLZMA.cmake | 14 +- Modules/FindLibXml2.cmake | 6 +- Modules/FindLibXslt.cmake | 3 +- Modules/FindLua.cmake | 219 +- Modules/FindLua50.cmake | 13 +- Modules/FindLua51.cmake | 10 +- Modules/FindMFC.cmake | 2 +- Modules/FindMPI.cmake | 71 +- Modules/FindMPI/libver_mpi.c | 1 + Modules/FindMPI/test_mpi.c | 1 + Modules/FindOpenAL.cmake | 20 +- Modules/FindOpenCL.cmake | 2 +- Modules/FindOpenGL.cmake | 6 +- Modules/FindOpenMP.cmake | 7 +- Modules/FindOpenSceneGraph.cmake | 24 +- Modules/FindPNG.cmake | 5 +- Modules/FindPhysFS.cmake | 6 - Modules/FindPkgConfig.cmake | 243 +- Modules/FindPostgreSQL.cmake | 59 +- Modules/FindProducer.cmake | 12 +- Modules/FindProtobuf.cmake | 7 +- Modules/FindPython.cmake | 54 +- Modules/FindPython/Support.cmake | 1350 ++++-- Modules/FindPython2.cmake | 56 +- Modules/FindPython3.cmake | 58 +- Modules/FindRuby.cmake | 313 +- Modules/FindSDL.cmake | 3 - Modules/FindSDL_sound.cmake | 411 +- Modules/FindSWIG.cmake | 12 +- Modules/FindTIFF.cmake | 2 +- Modules/FindTclsh.cmake | 10 +- Modules/FindThreads.cmake | 44 +- Modules/FindUnixCommands.cmake | 5 +- Modules/FindVulkan.cmake | 5 +- Modules/FindZLIB.cmake | 4 +- Modules/Findosg.cmake | 2 - Modules/FindosgDB.cmake | 32 +- Modules/Findosg_functions.cmake | 98 +- Modules/FortranCInterface/CMakeLists.txt | 5 +- Modules/GenerateExportHeader.cmake | 2 +- Modules/GetPrerequisites.cmake | 16 +- Modules/Internal/CPack/CPackRPM.cmake | 13 +- Modules/Internal/FeatureTesting.cmake | 29 +- Modules/KDE3Macros.cmake | 453 +-- Modules/MacroAddFileDependencies.cmake | 16 +- Modules/Platform/AIX-XL.cmake | 22 + Modules/Platform/AIX-XLClang-C.cmake | 2 + Modules/Platform/AIX-XLClang-CXX.cmake | 2 + Modules/Platform/AIX-XLClang.cmake | 15 + Modules/Platform/Android.cmake | 8 +- Modules/Platform/CrayLinuxEnvironment.cmake | 72 +- Modules/Platform/Darwin.cmake | 17 +- Modules/Platform/GHS-MULTI-Determine.cmake | 56 + Modules/Platform/GHS-MULTI-Initialize.cmake | 51 - Modules/Platform/SunOS.cmake | 12 +- Modules/Platform/Windows-Clang.cmake | 117 +- Modules/Platform/Windows-Intel-Fortran.cmake | 37 +- Modules/Platform/Windows-MSVC.cmake | 67 +- Modules/Platform/Windows-NVIDIA-CUDA.cmake | 11 +- Modules/ProcessorCount.cmake | 14 + Modules/Qt4Macros.cmake | 108 +- Modules/UseEcos.cmake | 212 +- Modules/UseJava.cmake | 526 ++- Modules/UseQt4.cmake | 5 +- Modules/UseSWIG.cmake | 13 +- Modules/WriteCompilerDetectionHeader.cmake | 2 +- Modules/ecos_clean.cmake | 12 +- README.rst | 34 +- Source/CMakeInstallSignTool.cmake.in | 51 + Source/CMakeLists.txt | 65 +- Source/CMakeVersion.cmake | 6 +- Source/CMakeVersion.rc.in | 19 +- Source/CPack/IFW/cmCPackIFWGenerator.cxx | 8 +- Source/CPack/IFW/cmCPackIFWInstaller.cxx | 17 + Source/CPack/IFW/cmCPackIFWInstaller.h | 3 + Source/CPack/OSXScriptLauncher.cxx | 2 +- Source/CPack/WiX/cmCPackWIXGenerator.cxx | 7 +- Source/CPack/bills-comments.txt | 68 - Source/CPack/cmCPackCygwinBinaryGenerator.cxx | 5 +- Source/CPack/cmCPackDebGenerator.cxx | 2 +- Source/CPack/cmCPackDragNDropGenerator.cxx | 4 +- Source/CPack/cmCPackFreeBSDGenerator.cxx | 5 +- Source/CPack/cmCPackGenerator.cxx | 21 +- Source/CPack/cmCPackGenerator.h | 5 +- Source/CPack/cmCPackGeneratorFactory.h | 3 + Source/CPack/cmCPackLog.h | 3 + Source/CPack/cmCPackNSISGenerator.cxx | 41 +- Source/CPack/cmCPackOSXX11Generator.cxx | 10 +- Source/CPack/cmCPackPKGGenerator.cxx | 60 +- Source/CPack/cmCPackPackageMakerGenerator.cxx | 4 +- Source/CPack/cmCPackProductBuildGenerator.cxx | 4 +- Source/CPack/cpack.cxx | 5 +- Source/CTest/cmCTestBZR.cxx | 5 +- Source/CTest/cmCTestBuildAndTestHandler.cxx | 17 +- Source/CTest/cmCTestBuildAndTestHandler.h | 2 +- Source/CTest/cmCTestBuildCommand.cxx | 11 +- Source/CTest/cmCTestBuildHandler.cxx | 70 +- Source/CTest/cmCTestBuildHandler.h | 2 +- Source/CTest/cmCTestCVS.cxx | 2 +- Source/CTest/cmCTestConfigureCommand.cxx | 11 +- Source/CTest/cmCTestConfigureHandler.cxx | 2 +- Source/CTest/cmCTestCoverageCommand.cxx | 8 +- Source/CTest/cmCTestCoverageHandler.cxx | 39 +- Source/CTest/cmCTestCurl.cxx | 9 +- Source/CTest/cmCTestCurl.h | 2 + Source/CTest/cmCTestGIT.cxx | 4 +- Source/CTest/cmCTestGlobalVC.cxx | 5 + Source/CTest/cmCTestGlobalVC.h | 2 + Source/CTest/cmCTestHG.cxx | 5 +- Source/CTest/cmCTestHandlerCommand.cxx | 2 + Source/CTest/cmCTestLaunch.cxx | 2 +- Source/CTest/cmCTestLaunch.h | 3 + Source/CTest/cmCTestMemCheckCommand.cxx | 5 +- Source/CTest/cmCTestMemCheckHandler.cxx | 14 +- Source/CTest/cmCTestMemCheckHandler.h | 6 +- Source/CTest/cmCTestMultiProcessHandler.cxx | 25 +- Source/CTest/cmCTestP4.cxx | 16 +- Source/CTest/cmCTestRunTest.cxx | 123 +- Source/CTest/cmCTestRunTest.h | 5 - Source/CTest/cmCTestSVN.cxx | 15 +- Source/CTest/cmCTestScriptHandler.cxx | 44 +- Source/CTest/cmCTestSubmitCommand.cxx | 78 +- Source/CTest/cmCTestSubmitCommand.h | 30 +- Source/CTest/cmCTestSubmitHandler.cxx | 50 +- Source/CTest/cmCTestSubmitHandler.h | 4 +- Source/CTest/cmCTestTestCommand.cxx | 5 +- Source/CTest/cmCTestTestHandler.cxx | 6 +- Source/CTest/cmCTestTestHandler.h | 7 +- Source/CTest/cmCTestUpdateCommand.cxx | 13 +- Source/CTest/cmCTestUpdateHandler.cxx | 4 + Source/CTest/cmCTestUploadCommand.cxx | 12 +- Source/CTest/cmCTestUploadCommand.h | 6 +- Source/CTest/cmCTestUploadHandler.cxx | 5 +- Source/CTest/cmCTestUploadHandler.h | 9 +- Source/CTest/cmCTestVC.cxx | 14 + Source/CTest/cmCTestVC.h | 1 + Source/CTest/cmProcess.cxx | 67 +- Source/CTest/cmProcess.h | 9 +- Source/Checks/cm_cxx17_check.cpp | 13 + Source/CursesDialog/ccmake.cxx | 3 +- .../CursesDialog/cmCursesCacheEntryComposite.cxx | 2 +- Source/CursesDialog/cmCursesForm.h | 4 +- Source/CursesDialog/cmCursesLongMessageForm.cxx | 5 +- Source/CursesDialog/cmCursesMainForm.cxx | 145 +- Source/CursesDialog/cmCursesMainForm.h | 4 +- Source/LexerParser/cmCommandArgumentParser.cxx | 2 +- Source/QtDialog/CMakeLists.txt | 3 - Source/QtDialog/CMakeSetup.cxx | 1 + Source/QtDialog/FirstConfigure.cxx | 23 +- Source/QtDialog/QCMake.cxx | 47 +- Source/QtDialog/QCMake.h | 4 +- Source/cmAddCustomCommandCommand.cxx | 19 +- Source/cmAddCustomTargetCommand.cxx | 14 +- Source/cmAddDependenciesCommand.cxx | 9 +- Source/cmAddLibraryCommand.cxx | 7 +- Source/cmAddSubDirectoryCommand.cxx | 9 +- Source/cmAddTestCommand.cxx | 3 +- Source/cmAlgorithms.h | 117 +- Source/cmArchiveWrite.cxx | 20 +- Source/cmArchiveWrite.h | 6 +- Source/cmArgumentParser.cxx | 93 + Source/cmArgumentParser.h | 143 + Source/cmCMakeMinimumRequired.cxx | 2 +- Source/cmCMakePolicyCommand.cxx | 2 +- Source/cmCPluginAPI.cxx | 32 +- Source/cmCTest.cxx | 1148 +++--- Source/cmCTest.h | 266 +- Source/cmCacheManager.cxx | 10 +- Source/cmCacheManager.h | 24 +- Source/cmCallVisualStudioMacro.cxx | 42 +- Source/cmCallVisualStudioMacro.h | 12 +- Source/cmCommandArgumentsHelper.cxx | 233 -- Source/cmCommandArgumentsHelper.h | 194 - Source/cmComputeLinkDepends.cxx | 19 +- Source/cmComputeLinkDepends.h | 3 + Source/cmComputeLinkInformation.cxx | 6 +- Source/cmComputeTargetDepends.cxx | 6 +- Source/cmConditionEvaluator.cxx | 11 +- Source/cmConfigureFileCommand.cxx | 6 +- Source/cmCoreTryCompile.cxx | 30 +- Source/cmCreateTestSourceList.cxx | 3 +- Source/cmCustomCommand.cxx | 19 +- Source/cmCustomCommand.h | 5 + Source/cmCustomCommandGenerator.cxx | 69 +- Source/cmCustomCommandGenerator.h | 7 +- Source/cmDepends.cxx | 191 +- Source/cmDepends.h | 29 +- Source/cmDependsC.cxx | 50 +- Source/cmDependsC.h | 5 +- Source/cmDependsFortran.cxx | 2 +- Source/cmDependsJava.cxx | 3 +- Source/cmDependsJava.h | 7 +- Source/cmDependsJavaParserHelper.cxx | 13 +- Source/cmDependsJavaParserHelper.h | 4 + Source/cmDocumentationSection.h | 3 +- Source/cmELF.cxx | 3 +- Source/cmELF.h | 3 + Source/cmExecProgramCommand.cxx | 34 +- Source/cmExecProgramCommand.h | 2 +- Source/cmExecuteProcessCommand.cxx | 339 +- Source/cmExportBuildFileGenerator.h | 3 +- Source/cmExportCommand.cxx | 124 +- Source/cmExportCommand.h | 24 - Source/cmExportFileGenerator.cxx | 3 +- Source/cmExportLibraryDependenciesCommand.cxx | 8 +- Source/cmExportSet.h | 3 + Source/cmExportSetMap.cxx | 2 + Source/cmExportSetMap.h | 5 + Source/cmExternalMakefileProjectGenerator.h | 10 +- Source/cmExtraCodeBlocksGenerator.cxx | 82 +- Source/cmExtraCodeBlocksGenerator.h | 7 +- Source/cmExtraCodeLiteGenerator.cxx | 8 +- Source/cmExtraEclipseCDT4Generator.cxx | 7 +- Source/cmExtraKateGenerator.cxx | 6 +- Source/cmExtraSublimeTextGenerator.cxx | 10 +- Source/cmFLTKWrapUICommand.cxx | 10 +- Source/cmFileAPICodemodel.cxx | 4 +- Source/cmFileCommand.cxx | 1409 +------ Source/cmFileCopier.cxx | 713 ++++ Source/cmFileCopier.h | 122 + Source/cmFileInstaller.cxx | 350 ++ Source/cmFileInstaller.h | 55 + Source/cmFilePathChecksum.cxx | 2 +- Source/cmFileTime.cxx | 49 + Source/cmFileTime.h | 130 + Source/cmFileTimeCache.cxx | 62 + Source/cmFileTimeCache.h | 56 + Source/cmFileTimeComparison.cxx | 233 -- Source/cmFileTimeComparison.h | 42 - Source/cmFileTimes.cxx | 127 + Source/cmFileTimes.h | 40 + Source/cmFindBase.cxx | 13 +- Source/cmFindCommon.cxx | 5 +- Source/cmFindPackageCommand.cxx | 137 +- Source/cmFindPackageCommand.h | 3 + Source/cmForEachCommand.cxx | 7 +- Source/cmFortranParser.h | 3 + Source/cmFunctionCommand.cxx | 3 +- Source/cmGeneratedFileStream.cxx | 6 +- Source/cmGeneratorExpressionEvaluator.cxx | 37 +- Source/cmGeneratorExpressionNode.cxx | 1252 +++--- Source/cmGeneratorExpressionNode.h | 4 +- Source/cmGeneratorExpressionParser.cxx | 11 +- Source/cmGeneratorTarget.cxx | 578 ++- Source/cmGeneratorTarget.h | 44 +- Source/cmGetPipes.cxx | 48 + Source/cmGetPipes.h | 8 + Source/cmGhsMultiGpj.cxx | 10 +- Source/cmGhsMultiGpj.h | 9 +- Source/cmGhsMultiTargetGenerator.cxx | 539 ++- Source/cmGhsMultiTargetGenerator.h | 34 +- Source/cmGlobVerificationManager.cxx | 8 +- Source/cmGlobVerificationManager.h | 12 +- Source/cmGlobalBorlandMakefileGenerator.cxx | 19 +- Source/cmGlobalBorlandMakefileGenerator.h | 19 +- Source/cmGlobalGenerator.cxx | 434 +- Source/cmGlobalGenerator.h | 62 +- Source/cmGlobalGhsMultiGenerator.cxx | 569 ++- Source/cmGlobalGhsMultiGenerator.h | 105 +- Source/cmGlobalJOMMakefileGenerator.cxx | 20 +- Source/cmGlobalJOMMakefileGenerator.h | 17 +- Source/cmGlobalMSYSMakefileGenerator.cxx | 9 +- Source/cmGlobalMSYSMakefileGenerator.h | 2 +- Source/cmGlobalMinGWMakefileGenerator.cxx | 3 +- Source/cmGlobalMinGWMakefileGenerator.h | 2 +- Source/cmGlobalNMakeMakefileGenerator.cxx | 20 +- Source/cmGlobalNMakeMakefileGenerator.h | 17 +- Source/cmGlobalNinjaGenerator.cxx | 1164 +++--- Source/cmGlobalNinjaGenerator.h | 117 +- Source/cmGlobalUnixMakefileGenerator3.cxx | 194 +- Source/cmGlobalUnixMakefileGenerator3.h | 20 +- Source/cmGlobalVisualStudio10Generator.cxx | 147 +- Source/cmGlobalVisualStudio10Generator.h | 22 +- Source/cmGlobalVisualStudio11Generator.cxx | 11 +- Source/cmGlobalVisualStudio11Generator.h | 4 +- Source/cmGlobalVisualStudio14Generator.cxx | 2 +- Source/cmGlobalVisualStudio7Generator.cxx | 74 +- Source/cmGlobalVisualStudio7Generator.h | 25 +- Source/cmGlobalVisualStudio8Generator.cxx | 43 +- Source/cmGlobalVisualStudio8Generator.h | 12 +- Source/cmGlobalVisualStudioGenerator.cxx | 43 +- Source/cmGlobalVisualStudioVersionedGenerator.cxx | 6 +- Source/cmGlobalWatcomWMakeGenerator.cxx | 18 +- Source/cmGlobalWatcomWMakeGenerator.h | 17 +- Source/cmGlobalXCodeGenerator.cxx | 246 +- Source/cmGlobalXCodeGenerator.h | 34 +- Source/cmGraphVizWriter.cxx | 26 +- Source/cmGraphVizWriter.h | 10 +- Source/cmHexFileConverter.cxx | 6 +- Source/cmHexFileConverter.h | 6 +- Source/cmIDEOptions.cxx | 6 +- Source/cmIncludeDirectoryCommand.cxx | 7 +- Source/cmInstallCommand.cxx | 175 +- Source/cmInstallCommandArguments.cxx | 72 +- Source/cmInstallCommandArguments.h | 35 +- Source/cmInstallDirectoryGenerator.cxx | 15 +- Source/cmInstallDirectoryGenerator.h | 2 +- Source/cmInstallExportAndroidMKGenerator.cxx | 19 +- Source/cmInstallExportAndroidMKGenerator.h | 2 +- Source/cmInstallExportGenerator.cxx | 5 +- Source/cmInstallExportGenerator.h | 2 +- Source/cmInstallFilesCommand.cxx | 10 +- Source/cmInstallFilesGenerator.cxx | 15 +- Source/cmInstallFilesGenerator.h | 2 +- Source/cmInstallGenerator.cxx | 11 +- Source/cmInstallGenerator.h | 2 +- Source/cmInstallProgramsCommand.cxx | 3 +- Source/cmInstallScriptGenerator.cxx | 4 +- Source/cmInstallScriptGenerator.h | 2 +- Source/cmInstallSubdirectoryGenerator.cxx | 3 +- Source/cmInstallSubdirectoryGenerator.h | 2 +- Source/cmInstallTargetGenerator.cxx | 106 +- Source/cmInstallTargetGenerator.h | 2 +- Source/cmInstallTargetsCommand.cxx | 8 +- Source/cmInstalledFile.h | 6 + Source/cmJsonObjects.cxx | 4 +- Source/cmLinkLineDeviceComputer.cxx | 104 +- Source/cmLinkLineDeviceComputer.h | 22 +- Source/cmListCommand.cxx | 139 +- Source/cmListCommand.h | 3 + Source/cmListFileCache.cxx | 9 +- Source/cmLoadCommandCommand.cxx | 2 +- Source/cmLocalGenerator.cxx | 281 +- Source/cmLocalGenerator.h | 16 +- Source/cmLocalGhsMultiGenerator.cxx | 13 +- Source/cmLocalGhsMultiGenerator.h | 13 +- Source/cmLocalNinjaGenerator.cxx | 80 +- Source/cmLocalNinjaGenerator.h | 2 + Source/cmLocalUnixMakefileGenerator3.cxx | 155 +- Source/cmLocalUnixMakefileGenerator3.h | 13 +- Source/cmLocalVisualStudio10Generator.h | 2 +- Source/cmLocalVisualStudio7Generator.cxx | 170 +- Source/cmLocalVisualStudio7Generator.h | 2 +- Source/cmLocalVisualStudioGenerator.cxx | 1 + Source/cmLocalXCodeGenerator.h | 2 +- Source/cmMacroCommand.cxx | 3 +- Source/cmMakefile.cxx | 159 +- Source/cmMakefile.h | 60 +- Source/cmMakefileExecutableTargetGenerator.cxx | 80 +- Source/cmMakefileLibraryTargetGenerator.cxx | 148 +- Source/cmMakefileTargetGenerator.cxx | 121 +- Source/cmMakefileTargetGenerator.h | 12 +- Source/cmMakefileUtilityTargetGenerator.cxx | 9 +- Source/cmMessageCommand.cxx | 55 +- Source/cmNinjaLinkLineDeviceComputer.cxx | 20 + Source/cmNinjaLinkLineDeviceComputer.h | 34 + Source/cmNinjaNormalTargetGenerator.cxx | 632 +-- Source/cmNinjaNormalTargetGenerator.h | 9 +- Source/cmNinjaTargetGenerator.cxx | 736 ++-- Source/cmNinjaTargetGenerator.h | 21 +- Source/cmNinjaTypes.h | 41 + Source/cmNinjaUtilityTargetGenerator.cxx | 134 +- Source/cmOSXBundleGenerator.cxx | 8 +- Source/cmOrderDirectories.cxx | 6 +- Source/cmOrderDirectories.h | 2 + Source/cmOutputConverter.h | 2 +- Source/cmOutputRequiredFilesCommand.cxx | 16 +- Source/cmParseArgumentsCommand.cxx | 204 +- Source/cmPolicies.cxx | 8 +- Source/cmPolicies.h | 32 +- Source/cmProjectCommand.cxx | 48 +- Source/cmProjectCommand.h | 1 + Source/cmQTWrapCPPCommand.cxx | 15 +- Source/cmQTWrapUICommand.cxx | 15 +- Source/cmQtAutoGen.cxx | 202 +- Source/cmQtAutoGen.h | 95 +- Source/cmQtAutoGenGlobalInitializer.cxx | 67 +- Source/cmQtAutoGenGlobalInitializer.h | 41 +- Source/cmQtAutoGenInitializer.cxx | 999 ++--- Source/cmQtAutoGenInitializer.h | 100 +- Source/cmQtAutoGenerator.cxx | 613 +-- Source/cmQtAutoGenerator.h | 247 +- Source/cmQtAutoGeneratorMocUic.cxx | 2042 ---------- Source/cmQtAutoGeneratorMocUic.h | 450 -- Source/cmQtAutoGeneratorRcc.cxx | 672 --- Source/cmQtAutoGeneratorRcc.h | 108 - Source/cmQtAutoMocUic.cxx | 2193 ++++++++++ Source/cmQtAutoMocUic.h | 576 +++ Source/cmQtAutoRcc.cxx | 523 +++ Source/cmQtAutoRcc.h | 81 + Source/cmRST.cxx | 9 +- Source/cmRange.h | 239 ++ Source/cmRemoveCommand.cxx | 10 +- Source/cmRulePlaceholderExpander.cxx | 35 +- Source/cmRulePlaceholderExpander.h | 5 +- Source/cmSearchPath.cxx | 4 +- Source/cmServer.cxx | 11 +- Source/cmServer.h | 4 +- Source/cmServerConnection.cxx | 4 +- Source/cmServerProtocol.cxx | 5 + Source/cmSetCommand.cxx | 1 + Source/cmSetPropertyCommand.cxx | 37 +- Source/cmSetTargetPropertiesCommand.cxx | 3 +- Source/cmSetTestsPropertiesCommand.cxx | 3 +- Source/cmSiteNameCommand.cxx | 5 +- Source/cmSourceFile.h | 11 +- Source/cmSourceGroupCommand.cxx | 6 +- Source/cmState.cxx | 19 + Source/cmState.h | 5 +- Source/cmStateDirectory.cxx | 16 +- Source/cmStringCommand.cxx | 64 +- Source/cmStringCommand.h | 1 + Source/cmSystemTools.cxx | 454 +-- Source/cmSystemTools.h | 139 +- Source/cmTarget.cxx | 1052 ++--- Source/cmTarget.h | 236 +- Source/cmTargetPropertyComputer.cxx | 3 + Source/cmTargetPropertyComputer.h | 2 +- Source/cmTest.h | 4 +- Source/cmTestGenerator.cxx | 17 +- Source/cmTryRunCommand.cxx | 34 +- Source/cmUVHandlePtr.cxx | 62 +- Source/cmUVHandlePtr.h | 40 +- Source/cmUVProcessChain.cxx | 395 ++ Source/cmUVProcessChain.h | 100 + Source/cmUVStreambuf.h | 219 + Source/cmUseMangledMesaCommand.cxx | 22 +- Source/cmUseMangledMesaCommand.h | 3 +- Source/cmUtilitySourceCommand.cxx | 2 +- Source/cmUuid.cxx | 18 +- Source/cmUuid.h | 4 - Source/cmVariableWatch.h | 3 + Source/cmVisualStudio10TargetGenerator.cxx | 196 +- Source/cmVisualStudio10TargetGenerator.h | 6 +- Source/cmVisualStudioGeneratorOptions.cxx | 15 +- Source/cmWorkerPool.cxx | 763 ++++ Source/cmWorkerPool.h | 226 ++ Source/cmWorkingDirectory.h | 3 + Source/cmXCodeScheme.cxx | 5 + Source/cmXMLWriter.cxx | 2 +- Source/cmXMLWriter.h | 5 + Source/cm_utf8.c | 29 + Source/cm_utf8.h | 4 + Source/cmake.cxx | 256 +- Source/cmake.h | 155 +- Source/cmakemain.cxx | 247 +- Source/cmakexbuild.cxx | 80 - Source/cmcldeps.cxx | 2 +- Source/cmcmd.cxx | 329 +- Source/cmcmd.h | 14 +- Source/ctest.cxx | 4 +- Source/kwsys/CMakeLists.txt | 76 +- Source/kwsys/CommandLineArguments.hxx.in | 3 + Source/kwsys/Configure.h.in | 37 - Source/kwsys/Configure.hxx.in | 5 + Source/kwsys/Directory.cxx | 4 +- Source/kwsys/DynamicLoader.cxx | 110 +- Source/kwsys/DynamicLoader.hxx.in | 15 +- Source/kwsys/Glob.cxx | 2 +- Source/kwsys/Glob.hxx.in | 14 +- Source/kwsys/ProcessWin32.c | 23 +- Source/kwsys/SystemInformation.cxx | 109 +- Source/kwsys/SystemInformation.hxx.in | 3 + Source/kwsys/SystemTools.cxx | 533 +-- Source/kwsys/SystemTools.hxx.in | 46 +- Source/kwsys/hashtable.hxx.in | 2 +- Source/kwsys/kwsysPlatformTestsCXX.cxx | 42 - Source/kwsys/testConsoleBuf.cxx | 9 +- Source/kwsys/testDynamicLoader.cxx | 28 +- Source/kwsys/testDynloadImpl.c | 10 + Source/kwsys/testDynloadImpl.h | 15 + Source/kwsys/testDynloadUse.c | 15 + Tests/AliasTarget/CMakeLists.txt | 2 +- .../target_compile_definitions/CMakeLists.txt | 1 + .../target_compile_definitions/consumer.c | 4 + .../target_compile_options/CMakeLists.txt | 18 +- .../target_compile_options/consumer.cpp | 24 + .../CMakeCommands/target_compile_options/main.cpp | 20 + Tests/CMakeLib/CMakeLists.txt | 10 +- Tests/CMakeLib/testArgumentParser.cxx | 148 + Tests/CMakeLib/testRST.expect | 4 + Tests/CMakeLib/testRST.rst | 4 + Tests/CMakeLib/testRange.cxx | 45 + Tests/CMakeLib/testSystemTools.cxx | 17 + Tests/CMakeLib/testUTF8.cxx | 104 +- Tests/CMakeLib/testUVProcessChain.cxx | 335 ++ Tests/CMakeLib/testUVProcessChainHelper.cxx | 72 + Tests/CMakeLib/testUVRAII.cxx | 50 +- Tests/CMakeLib/testUVStreambuf.cxx | 457 +++ Tests/CMakeLists.txt | 106 +- Tests/CMakeOnly/CMakeLists.txt | 12 + .../CMakeOnly/CheckCXXCompilerFlag/CMakeLists.txt | 2 +- Tests/CMakeOnly/CheckLanguage/CMakeLists.txt | 3 +- Tests/CMakeOnly/ProjectInclude/CMakeLists.txt | 2 +- Tests/CMakeOnly/ProjectIncludeAny/CMakeLists.txt | 4 + .../CMakeOnly/ProjectIncludeBefore/CMakeLists.txt | 5 + Tests/CMakeOnly/ProjectIncludeBefore/include.cmake | 9 + Tests/COnly/CMakeLists.txt | 2 +- Tests/CTestCoverageCollectGCOV/fakegcov.cmake | 21 +- Tests/CheckSwift.cmake | 61 + Tests/CompileFeatures/CMakeLists.txt | 38 +- Tests/CompileFeatures/cxx_relaxed_constexpr.cpp | 3 +- Tests/CompileFeatures/genex_test.cpp | 15 +- Tests/CompileOptions/CMakeLists.txt | 3 +- Tests/CompileOptions/main.cpp | 3 + Tests/Complex/CMakeLists.txt | 5 + Tests/ComplexOneConfig/CMakeLists.txt | 5 + Tests/CudaOnly/WithDefs/CMakeLists.txt | 2 + Tests/CudaOnly/WithDefs/main.notcu | 8 + Tests/EnforceConfig.cmake.in | 13 +- Tests/ExportImport/Export/Interface/CMakeLists.txt | 2 + Tests/ExportImport/Import/A/CMakeLists.txt | 2 +- Tests/ExportImport/Import/Interface/CMakeLists.txt | 8 + Tests/FindBoost/CMakeLists.txt | 3 +- Tests/FindCups/CMakeLists.txt | 10 + Tests/FindCups/Test/CMakeLists.txt | 16 + Tests/FindCups/Test/main.c | 12 + Tests/FindEnvModules/CMakeLists.txt | 3 + Tests/FindEnvModules/EnvModules.cmake | 35 + Tests/FindGLEW/CMakeLists.txt | 10 + Tests/FindGLEW/Test/CMakeLists.txt | 18 + Tests/FindGLEW/Test/main.cpp | 8 + Tests/FindPackageTest/.gitignore | 1 + Tests/FindPackageTest/CMakeLists.txt | 77 +- Tests/FindPackageTest/PreferConfig/ABCConfig.cmake | 1 + Tests/FindPackageTest/PreferConfig/FindABC.cmake | 1 + Tests/FindPython/CMakeLists.txt | 65 +- Tests/FindPython/Python/CMakeLists.txt | 3 + Tests/FindPython/Python2/CMakeLists.txt | 3 + Tests/FindPython/Python2Embedded/CMakeLists.txt | 29 + Tests/FindPython/Python3/CMakeLists.txt | 3 + Tests/FindPython/Python3Embedded/CMakeLists.txt | 29 + Tests/FindPython/VirtualEnv/CMakeLists.txt | 42 + .../FindPython/VirtualEnv/VirtualEnvDefault.cmake | 6 + Tests/FindPython/VirtualEnv/VirtualEnvOnly.cmake | 16 + .../FindPython/VirtualEnv/VirtualEnvStandard.cmake | 7 + Tests/FindPython/display_time.c | 36 + Tests/FindPython/display_time.h | 2 + Tests/FindPython/main.c | 7 + Tests/Fortran/CMakeLists.txt | 2 +- Tests/GeneratorExpression/CMakeLists.txt | 77 +- Tests/GeneratorExpression/check-part3.cmake | 5 + Tests/GeneratorExpression/check-part4.cmake | 15 +- Tests/GhsMulti/GhsMultiCustomTarget/CMakeLists.txt | 110 + .../GhsMultiCustomTarget/CMakeLists.txt.in | 108 + .../exe1.c | 0 .../lib1.c | 0 Tests/GhsMulti/GhsMultiDepOrder/CMakeLists.txt | 12 + .../GhsMulti/GhsMultiDepOrder/exec/CMakeLists.txt | 11 + Tests/GhsMulti/GhsMultiDepOrder/exec/exe1.c | 8 + Tests/GhsMulti/GhsMultiDepOrder/lib/CMakeLists.txt | 17 + Tests/GhsMulti/GhsMultiDepOrder/lib/func1.c | 17 + Tests/GhsMulti/GhsMultiDepOrder/lib/lib1.h | 3 + .../GhsMultiDepOrder/protolib/CMakeLists.txt | 28 + .../GhsMulti/GhsMultiDepOrder/protolib/proto1.c.in | 16 + .../GhsMulti/GhsMultiDepOrder/protolib/proto1.h.in | 7 + .../GhsMultiExternalProject/CMakeLists.txt | 14 + .../GhsMultiExternalProject/empty/CMakeLists.txt | 8 + .../GhsMultiIntegrityDDInt/App/CMakeLists.txt | 1 - .../GhsMultiIntegrityDDInt/Lib/CMakeLists.txt | 1 + .../GhsMultiIntegrityMonolith/CMakeLists.txt | 1 + .../GhsMulti/GhsMultiObjectLibrary/CMakeLists.txt | 2 +- Tests/GhsMulti/GhsMultiPlatform/file1.c | 4 - .../GhsMulti/GhsMultiRenameInstall/CMakeLists.txt | 6 +- .../GhsMultiUnsupportedTargets/CMakeLists.txt | 2 - Tests/IncludeDirectories/CMakeLists.txt | 2 +- .../TargetIncludeDirectories/CMakeLists.txt | 16 +- .../TargetIncludeDirectories/main.cpp | 3 +- Tests/MSVCRuntimeLibrary/CMakeLists.txt | 64 + Tests/MSVCRuntimeLibrary/Fortran/CMakeLists.txt | 50 + Tests/MSVCRuntimeLibrary/Fortran/verify.F90 | 1 + Tests/MSVCRuntimeLibrary/verify.c | 1 + Tests/MSVCRuntimeLibrary/verify.cxx | 1 + Tests/MSVCRuntimeLibrary/verify.h | 29 + Tests/MakeClean/ToClean/CMakeLists.txt | 128 +- Tests/MakeClean/ToClean/EmptySubDir/CMakeLists.txt | 17 + Tests/MakeClean/check_clean.c.in | 2 +- Tests/Module/FindDependency/CMakeLists.txt | 4 +- Tests/Module/FindDependency/main.cpp | 12 + .../packages/Pack7/Pack7Config.cmake | 14 + .../packages/Pack8/Pack8Config.cmake | 7 + .../WriteCompilerDetectionHeader/CMakeLists.txt | 21 +- Tests/ObjectLibrary/CMakeLists.txt | 10 + Tests/Plugin/CMakeLists.txt | 18 +- Tests/Preprocess/CMakeLists.txt | 14 +- Tests/Preprocess/preprocess.c | 3 +- Tests/QtAutogen/GlobalAutogenTarget/CMakeLists.txt | 3 + Tests/QtAutogen/ManySources/CMakeLists.txt | 35 + Tests/QtAutogen/ManySources/data.qrc.in | 7 + Tests/QtAutogen/ManySources/item.cpp.in | 27 + Tests/QtAutogen/ManySources/item.h.in | 15 + Tests/QtAutogen/ManySources/main.cpp.in | 7 + Tests/QtAutogen/ManySources/object.h.in | 15 + Tests/QtAutogen/ManySources/view.ui.in | 24 + Tests/QtAutogen/RerunMocBasic/CMakeLists.txt | 98 +- Tests/QtAutogen/RerunMocPlugin/CMakeLists.txt | 144 +- .../QtAutogen/RerunRccConfigChange/CMakeLists.txt | 33 +- Tests/QtAutogen/RerunRccDepends/CMakeLists.txt | 175 +- Tests/QtAutogen/Tests.cmake | 1 + .../RunCMake/CMP0069/CMP0069-NEW-cmake-stderr.txt | 4 +- .../CMP0069/CMP0069-NEW-compiler-stderr.txt | 4 +- .../CMP0069/CMP0069-NEW-generator-stderr.txt | 4 +- Tests/RunCMake/CMakeLists.txt | 22 +- .../BuildDir--build--parallel-large-result.txt} | 0 .../BuildDir--build--parallel-large-stderr.txt | 3 + .../BuildDir--build--parallel-zero-result.txt} | 0 .../BuildDir--build--parallel-zero-stderr.txt | 3 + .../BuildDir--build-jobs-large-result.txt} | 0 .../BuildDir--build-jobs-large-stderr.txt | 3 + .../BuildDir--build-jobs-zero-result.txt} | 0 .../BuildDir--build-jobs-zero-stderr.txt | 3 + ...ildDir--build-multiple-targets-jobs-stderr.txt} | 0 .../BuildDir--build-multiple-targets-result.txt | 1 - .../BuildDir--build-multiple-targets-stderr.txt | 3 - ...d-multiple-targets-with-clean-first-result.txt} | 0 ...ld-multiple-targets-with-clean-first-stderr.txt | 2 + ...-multiple-targets-with-clean-second-result.txt} | 0 ...d-multiple-targets-with-clean-second-stderr.txt | 2 + ...ake_directory-directory-with-parent-check.cmake | 3 + ...directory-three-directories-and-file-result.txt | 1 - .../E_make_directory-three-directories-check.cmake | 6 + ..._directory-two-directories-and-file-result.txt} | 0 ..._directory-two-directories-and-file-stderr.txt} | 0 ...ove_directory-directory-with-parent-check.cmake | 3 + ...ove_directory-directory-with-parent-stderr.txt} | 0 ..._remove_directory-three-directories-check.cmake | 6 + ..._remove_directory-three-directories-stderr.txt} | 0 ..._directory-two-directories-and-file-check.cmake | 3 + ..._directory-two-directories-and-file-stderr.txt} | 0 .../CommandLine/EnvGenerator/CMakeLists.txt | 10 + .../Envgen-A-platform-result.txt} | 0 .../CommandLine/Envgen-A-platform-stderr-vs9.txt | 2 + .../CommandLine/Envgen-A-platform-stderr.txt | 2 + .../Envgen-G-implicit-platform-stdout.txt | 1 + .../Envgen-T-toolset-result.txt} | 0 .../CommandLine/Envgen-T-toolset-stderr.txt | 2 + .../Envgen-bad-result.txt} | 0 Tests/RunCMake/CommandLine/Envgen-bad-stderr.txt | 5 + .../Envgen-instance-invalid-result.txt} | 0 .../CommandLine/Envgen-instance-invalid-stderr.txt | 2 + .../Envgen-ninja-result.txt} | 0 Tests/RunCMake/CommandLine/Envgen-ninja-stderr.txt | 4 + .../Envgen-platform-invalid-result.txt} | 0 .../Envgen-platform-invalid-stderr-vs9.txt | 2 + .../CommandLine/Envgen-platform-invalid-stderr.txt | 2 + .../Envgen-toolset-invalid-result.txt} | 0 .../CommandLine/Envgen-toolset-invalid-stderr.txt | 2 + .../Envgen-unset-result.txt} | 0 Tests/RunCMake/CommandLine/Envgen-unset-stderr.txt | 4 + .../Envgen-warnings-result.txt} | 0 .../CommandLine/Envgen-warnings-stderr.txt | 7 + .../CommandLine/ExplicitDirs/CMakeLists.txt | 3 +- Tests/RunCMake/CommandLine/RunCMakeTest.cmake | 136 +- .../cmake_install.cmake | 15 + .../install-bad-dir-result.txt} | 0 .../CommandLine/install-bad-dir-stderr.txt | 1 + .../install-no-dir-result.txt} | 0 .../RunCMake/CommandLine/install-no-dir-stderr.txt | 1 + .../install-options-to-vars-result.txt} | 0 .../CommandLine/install-options-to-vars-stderr.txt | 4 + Tests/RunCMake/CommandLineTar/RunCMakeTest.cmake | 34 +- .../bad-file-result.txt} | 0 Tests/RunCMake/CommandLineTar/bad-file-stderr.txt | 2 + Tests/RunCMake/CommandLineTar/bad-from4-stderr.txt | 2 +- Tests/RunCMake/CommandLineTar/bad-from5-stderr.txt | 2 +- .../bad-without-action-result.txt} | 0 .../CommandLineTar/bad-without-action-stderr.txt | 1 + .../CommandLineTar/bad-wrong-flag-stderr.txt | 1 + Tests/RunCMake/CommandLineTar/end-opt1-stderr.txt | 2 +- Tests/RunCMake/CommandLineTar/end-opt2-stderr.txt | 1 + Tests/RunCMake/CommandLineTar/gnutar-gz.cmake | 4 +- Tests/RunCMake/CommandLineTar/pax-zstd.cmake | 10 + Tests/RunCMake/CommandLineTar/pax.cmake | 4 +- Tests/RunCMake/CommandLineTar/roundtrip.cmake | 14 +- .../CommandLineTar/test-file.txt} | 0 .../CommandLineTar/without-files-stderr.txt | 1 + Tests/RunCMake/CommandLineTar/zip-filtered.cmake | 28 + .../AddCustomCommandWithArg-build-check.cmake | 3 + .../AddCustomCommandWithArg.cmake | 14 + .../AddCustomTargetWithArg-build-check.cmake | 1 + .../AddCustomTargetWithArg.cmake | 9 + .../CrosscompilingEmulator/RunCMakeTest.cmake | 9 +- .../OutputNameMatchesObjects-stderr.txt | 3 +- .../File_Generate/OutputNameMatchesObjects.cmake | 7 +- Tests/RunCMake/FindBoost/CMP0093-NEW-stdout.txt | 1 + Tests/RunCMake/FindBoost/CMP0093-NEW.cmake | 2 + Tests/RunCMake/FindBoost/CMP0093-OLD-stdout.txt | 1 + Tests/RunCMake/FindBoost/CMP0093-OLD.cmake | 2 + Tests/RunCMake/FindBoost/CMP0093-UNSET-stdout.txt | 1 + Tests/RunCMake/FindBoost/CMP0093-UNSET.cmake | 1 + Tests/RunCMake/FindBoost/CMakePackage-stdout.txt | 5 +- .../FindBoost/CMakePackage/BoostConfig.cmake | 1 + .../Boost-1.70.0/BoostConfig.cmake | 140 + .../Boost-1.70.0/BoostConfigVersion.cmake | 12 + .../BoostDetectToolset-1.70.0.cmake | 1 + .../boost_chrono-config-version.cmake | 12 + .../boost_chrono-1.70.0/boost_chrono-config.cmake | 98 + .../libboost_chrono-variant-shared.cmake | 62 + .../libboost_chrono-variant-static.cmake | 58 + .../boost_headers-config-version.cmake | 12 + .../boost_headers-config.cmake | 20 + .../boost_system-config-version.cmake | 12 + .../boost_system-1.70.0/boost_system-config.cmake | 98 + .../libboost_system-variant-shared.cmake | 62 + .../libboost_system-variant-static.cmake | 58 + .../boost_timer-config-version.cmake | 12 + .../boost_timer-1.70.0/boost_timer-config.cmake | 98 + .../libboost_timer-variant-shared.cmake | 62 + .../libboost_timer-variant-static.cmake | 58 + .../CommonNotFound-stderr.txt} | 0 Tests/RunCMake/FindBoost/CommonNotFound-stdout.txt | 1 + Tests/RunCMake/FindBoost/CommonNotFound.cmake | 2 + Tests/RunCMake/FindBoost/CommonResults-stdout.txt | 13 + Tests/RunCMake/FindBoost/CommonResults.cmake | 25 + Tests/RunCMake/FindBoost/ConfigMode.cmake | 2 + Tests/RunCMake/FindBoost/ConfigModeNotFound.cmake | 2 + .../MockInstalls/1.70.0/include/boost/chrono.hpp} | 0 .../MockInstalls/1.70.0/include/boost/config.hpp} | 0 .../1.70.0/include/boost/system/config.hpp} | 0 .../MockInstalls/1.70.0/include/boost/timer.hpp} | 0 .../MockInstalls/1.70.0/include/boost/version.hpp | 34 + .../1.70.0/lib/boost_chrono-mt-1_70.lib} | 0 .../1.70.0/lib/boost_system-mt-1_70.lib} | 0 .../1.70.0/lib/boost_timer-mt-1_70.lib} | 0 .../1.70.0/lib/libboost_chrono-mt-1_70.lib} | 0 .../MockInstalls/1.70.0/lib/libboost_chrono.a} | 0 .../1.70.0/lib/libboost_chrono.so.1.70.0} | 0 .../1.70.0/lib/libboost_system-mt-1_70.lib} | 0 .../MockInstalls/1.70.0/lib/libboost_system.a} | 0 .../1.70.0/lib/libboost_system.so.1.70.0} | 0 .../1.70.0/lib/libboost_timer-mt-1_70.lib} | 0 .../MockInstalls/1.70.0/lib/libboost_timer.a} | 0 .../1.70.0/lib/libboost_timer.so.1.70.0} | 0 Tests/RunCMake/FindBoost/ModuleMode.cmake | 4 + Tests/RunCMake/FindBoost/ModuleModeNotFound.cmake | 4 + Tests/RunCMake/FindBoost/RunCMakeTest.cmake | 15 + ...FindPkgConfig_GET_VARIABLE_PKGCONFIG_PATH.cmake | 21 + .../FindPkgConfig_GET_VARIABLE_PREFIX_PATH.cmake | 21 + .../FindPkgConfig_IMPORTED_TARGET.cmake | 21 + Tests/RunCMake/FindPkgConfig/RunCMakeTest.cmake | 2 + .../pc-bletch/lib/pkgconfig/bletch.pc | 12 + Tests/RunCMake/Framework/FrameworkLayout.cmake | 5 +- Tests/RunCMake/Framework/RunCMakeTest.cmake | 18 +- Tests/RunCMake/GenerateExportHeader/GEH.cmake | 5 + .../RunCMake/GeneratorExpression/BadAND-stderr.txt | 4 +- .../GeneratorExpression/BadCONFIG-stderr.txt | 4 +- .../RunCMake/GeneratorExpression/BadNOT-stderr.txt | 4 +- .../RunCMake/GeneratorExpression/BadOR-stderr.txt | 4 +- .../GeneratorExpression/BadSHELL_PATH-stderr.txt | 9 + .../GeneratorExpression/BadSHELL_PATH.cmake | 1 + .../GeneratorExpression/BadStrEqual-stderr.txt | 4 +- .../GeneratorExpression/BadTargetName-stderr.txt | 4 +- ...PILE_LANG_AND_ID-add_custom_command-result.txt} | 0 ...MPILE_LANG_AND_ID-add_custom_command-stderr.txt | 8 + .../COMPILE_LANG_AND_ID-add_custom_command.cmake | 4 + ...MPILE_LANG_AND_ID-add_custom_target-result.txt} | 0 ...OMPILE_LANG_AND_ID-add_custom_target-stderr.txt | 11 + .../COMPILE_LANG_AND_ID-add_custom_target.cmake | 4 + .../COMPILE_LANG_AND_ID-add_executable-result.txt} | 0 .../COMPILE_LANG_AND_ID-add_executable-stderr.txt | 11 + .../COMPILE_LANG_AND_ID-add_executable.cmake | 5 + .../COMPILE_LANG_AND_ID-add_library-result.txt} | 0 .../COMPILE_LANG_AND_ID-add_library-stderr.txt | 11 + .../COMPILE_LANG_AND_ID-add_library.cmake | 2 + .../COMPILE_LANG_AND_ID-add_test-result.txt} | 0 .../COMPILE_LANG_AND_ID-add_test-stderr.txt | 11 + .../COMPILE_LANG_AND_ID-add_test.cmake | 5 + .../COMPILE_LANG_AND_ID-install-result.txt} | 0 .../COMPILE_LANG_AND_ID-install-stderr.txt | 9 + .../COMPILE_LANG_AND_ID-install.cmake | 5 + .../COMPILE_LANG_AND_ID-target_sources-result.txt} | 0 .../COMPILE_LANG_AND_ID-target_sources-stderr.txt | 8 + .../COMPILE_LANG_AND_ID-target_sources.cmake | 2 + .../COMPILE_LANG_AND_ID-unknown-lang.cmake | 4 + .../GeneratorExpression/FILTER-Exclude-check.cmake | 6 + .../GeneratorExpression/FILTER-Exclude.cmake | 4 + .../GeneratorExpression/FILTER-Include-check.cmake | 6 + .../GeneratorExpression/FILTER-Include.cmake | 4 + .../FILTER-InvalidOperator-result.txt} | 0 .../FILTER-InvalidOperator-stderr.txt | 8 + .../FILTER-InvalidOperator.cmake | 3 + .../GeneratorExpression/FILTER-empty-check.cmake | 6 + .../GeneratorExpression/FILTER-empty.cmake | 3 + ...tedTarget-TARGET_PDB_FILE_BASE_NAME-result.txt} | 0 ...rtedTarget-TARGET_PDB_FILE_BASE_NAME-stderr.txt | 8 + .../ImportedTarget-TARGET_PDB_FILE_BASE_NAME.cmake | 2 + ...dCompiler-TARGET_PDB_FILE_BASE_NAME-result.txt} | 0 ...idCompiler-TARGET_PDB_FILE_BASE_NAME-stderr.txt | 8 + ...onValidCompiler-TARGET_PDB_FILE_BASE_NAME.cmake | 9 + ...lidTarget-TARGET_PDB_FILE_BASE_NAME-result.txt} | 0 ...alidTarget-TARGET_PDB_FILE_BASE_NAME-stderr.txt | 9 + .../NonValidTarget-TARGET_PDB_FILE_BASE_NAME.cmake | 9 + .../OUTPUT_NAME-recursion-stderr.txt | 8 +- .../OUTPUT_NAME-recursion.cmake | 3 + .../REMOVE_DUPLICATES-1-check.cmake | 6 + .../GeneratorExpression/REMOVE_DUPLICATES-1.cmake | 3 + .../REMOVE_DUPLICATES-2-check.cmake | 6 + .../GeneratorExpression/REMOVE_DUPLICATES-2.cmake | 3 + .../REMOVE_DUPLICATES-3-check.cmake | 6 + .../GeneratorExpression/REMOVE_DUPLICATES-3.cmake | 3 + .../REMOVE_DUPLICATES-4-check.cmake | 6 + .../GeneratorExpression/REMOVE_DUPLICATES-4.cmake | 3 + .../REMOVE_DUPLICATES-empty-check.cmake | 6 + .../REMOVE_DUPLICATES-empty.cmake | 3 + .../GeneratorExpression/ResultValidator.cmake | 6 + .../GeneratorExpression/RunCMakeTest.cmake | 34 + .../TARGET_FILE_BASE_NAME-check.cmake | 2 + ...RGET_FILE_BASE_NAME-imported-target-check.cmake | 2 + .../TARGET_FILE_BASE_NAME-imported-target.cmake | 106 + ...GET_FILE_BASE_NAME-non-valid-target-result.txt} | 0 ...RGET_FILE_BASE_NAME-non-valid-target-stderr.txt | 6 + .../TARGET_FILE_BASE_NAME-non-valid-target.cmake | 7 + .../TARGET_FILE_BASE_NAME.cmake | 135 + .../TARGET_FILE_PREFIX-check.cmake | 2 + .../TARGET_FILE_PREFIX-imported-target-check.cmake | 2 + .../TARGET_FILE_PREFIX-imported-target.cmake | 49 + ...TARGET_FILE_PREFIX-non-valid-target-result.txt} | 0 .../TARGET_FILE_PREFIX-non-valid-target-stderr.txt | 6 + .../TARGET_FILE_PREFIX-non-valid-target.cmake | 7 + .../GeneratorExpression/TARGET_FILE_PREFIX.cmake | 49 + .../TARGET_FILE_SUFFIX-check.cmake | 2 + .../TARGET_FILE_SUFFIX-imported-target-check.cmake | 2 + .../TARGET_FILE_SUFFIX-imported-target.cmake | 49 + ...TARGET_FILE_SUFFIX-non-valid-target-result.txt} | 0 .../TARGET_FILE_SUFFIX-non-valid-target-stderr.txt | 6 + .../TARGET_FILE_SUFFIX-non-valid-target.cmake | 7 + .../GeneratorExpression/TARGET_FILE_SUFFIX.cmake | 49 + ...KER_FILE_BASE_NAME-non-valid-target-result.txt} | 0 ...NKER_FILE_BASE_NAME-non-valid-target-stderr.txt | 6 + ...ET_LINKER_FILE_BASE_NAME-non-valid-target.cmake | 7 + ...LINKER_FILE_PREFIX-non-valid-target-result.txt} | 0 ..._LINKER_FILE_PREFIX-non-valid-target-stderr.txt | 6 + ...ARGET_LINKER_FILE_PREFIX-non-valid-target.cmake | 7 + ...LINKER_FILE_SUFFIX-non-valid-target-result.txt} | 0 ..._LINKER_FILE_SUFFIX-non-valid-target-stderr.txt | 6 + ...ARGET_LINKER_FILE_SUFFIX-non-valid-target.cmake | 7 + .../TARGET_PROPERTY-INCLUDE_DIRECTORIES.cmake | 18 + ...lidTarget-TARGET_PDB_FILE_BASE_NAME-check.cmake | 7 + .../ValidTarget-TARGET_PDB_FILE_BASE_NAME.cmake | 16 + .../CMP0091-NEW-result.txt} | 0 .../MSVCRuntimeLibrary/CMP0091-NEW-stderr.txt | 4 + .../RunCMake/MSVCRuntimeLibrary/CMP0091-NEW.cmake | 2 + .../RunCMake/MSVCRuntimeLibrary/CMP0091-OLD.cmake | 2 + .../RunCMake/MSVCRuntimeLibrary/CMP0091-WARN.cmake | 2 + .../MSVCRuntimeLibrary/CMP0091-common.cmake | 37 + Tests/RunCMake/MSVCRuntimeLibrary/CMakeLists.txt | 3 + .../RunCMake/MSVCRuntimeLibrary/RunCMakeTest.cmake | 5 + .../empty.c | 0 Tests/RunCMake/MSVCWarningFlags/CMP0092-NEW.cmake | 2 + Tests/RunCMake/MSVCWarningFlags/CMP0092-OLD.cmake | 2 + Tests/RunCMake/MSVCWarningFlags/CMP0092-WARN.cmake | 2 + .../RunCMake/MSVCWarningFlags/CMP0092-common.cmake | 12 + Tests/RunCMake/MSVCWarningFlags/CMakeLists.txt | 3 + Tests/RunCMake/MSVCWarningFlags/RunCMakeTest.cmake | 5 + Tests/RunCMake/MetaCompileFeatures/C.cmake | 27 + Tests/RunCMake/MetaCompileFeatures/CMakeLists.txt | 3 + Tests/RunCMake/MetaCompileFeatures/CXX.cmake | 27 + .../MetaCompileFeatures/RunCMakeTest.cmake | 4 + .../MetaCompileFeatures/a.c} | 0 .../MetaCompileFeatures/a.cxx} | 0 .../Ninja/CustomCommandJobPool-check.cmake | 8 + Tests/RunCMake/Ninja/CustomCommandJobPool.cmake | 17 + .../JobPoolUsesTerminal-result.txt} | 0 .../RunCMake/Ninja/JobPoolUsesTerminal-stderr.txt | 9 + Tests/RunCMake/Ninja/JobPoolUsesTerminal.cmake | 2 + Tests/RunCMake/Ninja/RunCMakeTest.cmake | 2 + Tests/RunCMake/Ninja/greeting.c | 1 + Tests/RunCMake/Ninja/greeting2.c | 1 + .../ObjectLibrary/BadSourceExpression3-stderr.txt | 5 +- .../ObjectLibrary/BadSourceExpression3.cmake | 2 +- .../ObjectLibrary/CheckTargetObjects.cmake | 32 + Tests/RunCMake/ObjectLibrary/OwnSources-stderr.txt | 4 +- Tests/RunCMake/ObjectLibrary/RunCMakeTest.cmake | 5 + .../ObjectLibrary/check_object_files.cmake | 17 + .../ParseImplicitIncludeInfo.cmake | 1 + .../ParseImplicitIncludeInfo/data/CMakeLists.txt | 3 + .../data/aix-C-XLClang-16.1.0.1.input | 40 + .../data/aix-C-XLClang-16.1.0.1.output | 1 + .../data/aix-CXX-XLClang-16.1.0.1.input | 44 + .../data/aix-CXX-XLClang-16.1.0.1.output | 1 + Tests/RunCMake/PolicyScope/dir1/CMakeLists.txt | 2 +- Tests/RunCMake/RunCMake.cmake | 13 +- Tests/RunCMake/Swift/E.swift | 2 + Tests/RunCMake/Swift/RunCMakeTest.cmake | 4 + .../Win32ExecutableDisallowed-result.txt} | 0 .../Swift/Win32ExecutableDisallowed-stderr.txt | 4 + .../RunCMake/Swift/Win32ExecutableDisallowed.cmake | 4 + Tests/RunCMake/Syntax/UnterminatedCall1-stderr.txt | 2 +- Tests/RunCMake/Syntax/UnterminatedCall1.cmake | 3 + Tests/RunCMake/Syntax/UnterminatedCall2-stderr.txt | 2 +- Tests/RunCMake/Syntax/UnterminatedCall2.cmake | 3 + .../TargetObjects/NotObjlibTarget-stderr.txt | 9 +- Tests/RunCMake/TargetObjects/NotObjlibTarget.cmake | 4 +- .../BadInvalidName-stderr.txt | 4 +- .../BadNonTarget-stderr.txt | 4 +- .../BadSelfReference-stderr.txt | 4 +- Tests/RunCMake/UseSWIG/CMP0086-common.cmake | 2 +- Tests/RunCMake/VS10Project/RunCMakeTest.cmake | 8 + .../VS10Project/RuntimeLibrary-check.cmake | 36 + Tests/RunCMake/VS10Project/RuntimeLibrary.cmake | 20 + .../RunCMake/VS10Project/VsJustMyCode-check.cmake | 38 + Tests/RunCMake/VS10Project/VsJustMyCode.cmake | 24 + .../VS10Project/VsPackageReferences-check.cmake | 39 + .../RunCMake/VS10Project/VsPackageReferences.cmake | 4 + .../VS10Project/VsProjectImport-check.cmake | 28 + Tests/RunCMake/VS10Project/VsProjectImport.cmake | 11 + .../{target_link_libraries => VS10Project}/empty.c | 0 .../VS10Project/empty.cxx} | 0 .../VsCEDebuggerDeploy-check.cmake | 59 + .../VS10ProjectWinCE/VsCEDebuggerDeploy.cmake | 3 +- .../VisibilityPreset/PropertyTypo-stderr.txt | 2 +- .../PerConfigPerSourceDefinitions-stderr.txt | 4 +- .../PerConfigPerSourceFlags-stderr.txt | 4 +- .../PerConfigPerSourceIncludeDirs-stderr.txt | 4 +- .../PerConfigPerSourceOptions-stderr.txt | 4 +- .../XcodeProject/XcodeSchemaProperty-check.cmake | 9 + .../XcodeProject/XcodeSchemaProperty.cmake | 3 + Tests/RunCMake/add_executable/NoSources-stderr.txt | 4 +- .../NoSourcesButLinkObjects-stderr.txt | 4 +- .../add_library/MODULEwithNoSources-stderr.txt | 4 +- .../MODULEwithNoSourcesButLinkObjects-stderr.txt | 4 +- .../add_library/OBJECTwithNoSources-stderr.txt | 4 +- .../OBJECTwithNoSourcesButLinkObjects-stderr.txt | 4 +- .../add_library/SHAREDwithNoSources-stderr.txt | 4 +- .../SHAREDwithNoSourcesButLinkObjects-stderr.txt | 4 +- .../add_library/STATICwithNoSources-stderr.txt | 4 +- .../STATICwithNoSourcesButLinkObjects-stderr.txt | 4 +- .../KeyWordsMissingValues.cmake | 133 + .../cmake_parse_arguments/RunCMakeTest.cmake | 1 + Tests/RunCMake/ctest_submit/RunCMakeTest.cmake | 2 +- Tests/RunCMake/ctest_update/CMakeLists.txt.in | 4 + Tests/RunCMake/ctest_update/RunCMakeTest.cmake | 25 + .../ctest_update/UpdateActualVersion-check.cmake | 12 + .../ctest_update/UpdateChangeId-check.cmake | 12 + Tests/RunCMake/ctest_update/test.cmake.in | 16 + .../EchoCommand-result.txt} | 0 .../execute_process/EchoCommand-stderr.txt | 5 + .../execute_process/EchoCommand-stdout.txt | 12 + Tests/RunCMake/execute_process/EchoCommand.cmake | 41 + .../EchoCommand2-result.txt} | 0 .../execute_process/EchoCommand2-stderr.txt | 5 + .../execute_process/EchoCommand2-stdout.txt | 12 + .../EchoCommand3-result.txt} | 0 .../execute_process/EchoCommand3-stderr.txt | 2 + Tests/RunCMake/execute_process/RunCMakeTest.cmake | 8 + Tests/RunCMake/export/AppendExport-stderr.txt | 2 +- Tests/RunCMake/export/OldIface-stderr.txt | 3 +- .../file/INSTALL-FOLLOW_SYMLINK_CHAIN.cmake | 168 + Tests/RunCMake/file/REMOVE-empty-stderr.txt | 11 + Tests/RunCMake/file/REMOVE-empty.cmake | 2 + Tests/RunCMake/file/RunCMakeTest.cmake | 3 + .../install/TARGETS-Defaults-all-check.cmake | 6 + Tests/RunCMake/install/TARGETS-Defaults.cmake | 8 + Tests/RunCMake/install/obj2.h | 6 + Tests/RunCMake/interface_library/whitelist.cmake | 9 + .../POP_BACK-NoArgs-result.txt} | 0 Tests/RunCMake/list/POP_BACK-NoArgs-stderr.txt | 1 + Tests/RunCMake/list/POP_BACK-NoArgs.cmake | 1 + Tests/RunCMake/list/POP_BACK.cmake | 79 + .../POP_FRONT-NoArgs-result.txt} | 0 Tests/RunCMake/list/POP_FRONT-NoArgs-stderr.txt | 1 + Tests/RunCMake/list/POP_FRONT-NoArgs.cmake | 1 + Tests/RunCMake/list/POP_FRONT.cmake | 79 + .../PREPEND-NoArgs-result.txt} | 0 Tests/RunCMake/list/PREPEND-NoArgs-stderr.txt | 1 + Tests/RunCMake/list/PREPEND-NoArgs.cmake | 1 + Tests/RunCMake/list/PREPEND.cmake | 33 + .../list/REMOVE_DUPLICATES-PreserveOrder.cmake | 5 + Tests/RunCMake/list/RunCMakeTest.cmake | 14 + Tests/RunCMake/message/RunCMakeTest.cmake | 42 + Tests/RunCMake/message/message-all-loglevels.cmake | 10 + .../message/message-loglevel-debug-stderr.txt | 12 + .../message/message-loglevel-debug-stdout.txt | 3 + .../message/message-loglevel-default-stderr.txt | 12 + .../message/message-loglevel-default-stdout.txt | 1 + .../message-loglevel-invalid-result.txt} | 0 .../message/message-loglevel-invalid-stderr.txt | 1 + .../message/message-loglevel-notice-stderr.txt | 12 + .../message/message-loglevel-status-stderr.txt | 12 + .../message/message-loglevel-status-stdout.txt | 1 + .../message/message-loglevel-trace-stderr.txt | 12 + .../message/message-loglevel-trace-stdout.txt | 4 + .../message/message-loglevel-verbose-stderr.txt | 12 + .../message/message-loglevel-verbose-stdout.txt | 2 + .../message/message-loglevel-warning-stderr.txt | 9 + .../project_injected/CMP0048-WARN-stderr.txt | 12 + .../RunCMake/pseudo_emulator_custom_command_arg.c | 30 + Tests/RunCMake/string/Repeat.cmake | 45 + .../RepeatNegativeCount-result.txt} | 0 .../RunCMake/string/RepeatNegativeCount-stderr.txt | 4 + Tests/RunCMake/string/RepeatNegativeCount.cmake | 1 + .../RepeatNoArgs-result.txt} | 0 Tests/RunCMake/string/RepeatNoArgs-stderr.txt | 4 + Tests/RunCMake/string/RepeatNoArgs.cmake | 1 + Tests/RunCMake/string/RunCMakeTest.cmake | 4 + Tests/RunCMake/try_compile/CMP0066-stderr.txt | 13 +- Tests/RunCMake/try_compile/LinkOptions.cmake | 4 +- Tests/RunCMake/try_run/LinkOptions.cmake | 4 +- Tests/SourceGroups/CMakeLists.txt | 8 + Tests/StagingPrefix/CMakeLists.txt | 11 +- Tests/SwiftMix/CMain.c | 6 +- Tests/SwiftMix/CMakeLists.txt | 1 + Tests/SwiftMix/ObjCMain.m | 2 +- Tests/SwiftMix/SwiftMain.swift | 2 +- Tests/Tutorial/Complete/CMakeLists.txt | 3 +- Tests/Tutorial/Consumer/CMakeLists.txt | 3 +- Tests/Tutorial/Step10/CMakeLists.txt | 3 +- Tests/Tutorial/Step11/CMakeLists.txt | 3 +- Tests/Tutorial/Step2/CMakeLists.txt | 4 +- Tests/Tutorial/Step2/directions.txt | 3 +- Tests/Tutorial/Step3/CMakeLists.txt | 3 +- Tests/Tutorial/Step4/CMakeLists.txt | 3 +- Tests/Tutorial/Step5/CMakeLists.txt | 3 +- Tests/Tutorial/Step6/CMakeLists.txt | 3 +- Tests/Tutorial/Step7/CMakeLists.txt | 3 +- Tests/Tutorial/Step8/CMakeLists.txt | 3 +- Tests/Tutorial/Step9/CMakeLists.txt | 3 +- Tests/UseSWIG/AlternateLibraryName/CMakeLists.txt | 35 + Tests/UseSWIG/CMakeLists.txt | 12 + Tests/UseSWIG/ModuleName/CMakeLists.txt | 2 +- Tests/UseSWIG/ModuleVersion2/CMakeLists.txt | 4 +- Tests/UseSWIG/MultipleModules/CMakeLists.txt | 2 +- Tests/UseSWIG/MultiplePython/CMakeLists.txt | 4 +- Tests/UseSWIG/SwigSrcFileExtension/CMakeLists.txt | 4 +- .../UseTargetINCLUDE_DIRECTORIES/CMakeLists.txt | 4 +- Tests/WarnUnusedCliUnused/CMakeLists.txt | 8 +- Utilities/Doxygen/CMakeLists.txt | 2 +- Utilities/IWYU/mapping.imp | 1 + Utilities/Release/linux64_release.cmake | 1 + Utilities/Release/osx_release.cmake | 1 + Utilities/Release/push.bash | 70 + Utilities/Release/release_cmake.sh.in | 2 +- Utilities/Release/upload_release.cmake | 39 - Utilities/Release/win32_release.cmake | 15 +- Utilities/Release/win64_release.cmake | 15 +- Utilities/Scripts/update-curl.bash | 2 +- Utilities/Scripts/update-third-party.bash | 24 +- Utilities/Scripts/update-zstd.bash | 36 + Utilities/Sphinx/CMakeLists.txt | 2 +- Utilities/cmThirdParty.h.in | 1 + Utilities/cm_zstd.h | 14 + Utilities/cmcompress/CMakeLists.txt | 5 - Utilities/cmcompress/Copyright.txt | 34 - Utilities/cmcompress/cmcompress.c | 551 --- Utilities/cmcompress/cmcompress.h | 195 - Utilities/cmcompress/compress.c.original | 1308 ------ Utilities/cmcurl/CMake/CurlTests.c | 52 +- Utilities/cmcurl/CMake/FindGSS.cmake | 4 +- Utilities/cmcurl/CMake/OtherTests.cmake | 67 +- Utilities/cmcurl/CMakeLists.txt | 75 +- Utilities/cmcurl/COPYING | 2 +- Utilities/cmcurl/include/curl/curl.h | 66 +- Utilities/cmcurl/include/curl/curlver.h | 12 +- Utilities/cmcurl/include/curl/typecheck-gcc.h | 14 +- Utilities/cmcurl/include/curl/urlapi.h | 7 +- Utilities/cmcurl/lib/Makefile.inc | 19 +- Utilities/cmcurl/lib/altsvc.c | 569 +++ Utilities/cmcurl/lib/altsvc.h | 77 + Utilities/cmcurl/lib/amigaos.c | 32 +- Utilities/cmcurl/lib/amigaos.h | 10 +- Utilities/cmcurl/lib/asyn-ares.c | 157 +- Utilities/cmcurl/lib/asyn-thread.c | 70 +- Utilities/cmcurl/lib/asyn.h | 36 +- Utilities/cmcurl/lib/base64.c | 33 +- Utilities/cmcurl/lib/conncache.c | 38 +- Utilities/cmcurl/lib/conncache.h | 8 +- Utilities/cmcurl/lib/connect.c | 114 +- Utilities/cmcurl/lib/connect.h | 9 +- Utilities/cmcurl/lib/cookie.c | 202 +- Utilities/cmcurl/lib/cookie.h | 13 +- Utilities/cmcurl/lib/curl_addrinfo.c | 32 +- Utilities/cmcurl/lib/curl_addrinfo.h | 13 +- Utilities/cmcurl/lib/curl_config.h.cmake | 10 +- Utilities/cmcurl/lib/curl_endian.c | 10 +- Utilities/cmcurl/lib/curl_fnmatch.c | 15 +- Utilities/cmcurl/lib/curl_get_line.c | 55 + Utilities/cmcurl/lib/curl_get_line.h | 29 + Utilities/cmcurl/lib/curl_gssapi.c | 6 +- Utilities/cmcurl/lib/curl_gssapi.h | 16 +- Utilities/cmcurl/lib/curl_md4.h | 4 +- Utilities/cmcurl/lib/curl_md5.h | 10 +- Utilities/cmcurl/lib/curl_memory.h | 4 +- Utilities/cmcurl/lib/curl_multibyte.c | 12 +- Utilities/cmcurl/lib/curl_ntlm_core.c | 69 +- Utilities/cmcurl/lib/curl_ntlm_core.h | 4 +- Utilities/cmcurl/lib/curl_ntlm_wb.c | 86 +- Utilities/cmcurl/lib/curl_ntlm_wb.h | 11 +- Utilities/cmcurl/lib/curl_path.c | 6 +- Utilities/cmcurl/lib/curl_printf.h | 16 +- Utilities/cmcurl/lib/curl_rtmp.c | 9 +- Utilities/cmcurl/lib/curl_sasl.c | 40 +- Utilities/cmcurl/lib/curl_setup.h | 29 +- Utilities/cmcurl/lib/curlx.h | 11 +- Utilities/cmcurl/lib/dict.c | 11 +- Utilities/cmcurl/lib/doh.c | 127 +- Utilities/cmcurl/lib/doh.h | 10 +- Utilities/cmcurl/lib/easy.c | 111 +- Utilities/cmcurl/lib/escape.c | 2 +- Utilities/cmcurl/lib/file.c | 29 +- Utilities/cmcurl/lib/fileinfo.c | 5 +- Utilities/cmcurl/lib/formdata.c | 14 +- Utilities/cmcurl/lib/formdata.h | 11 +- Utilities/cmcurl/lib/ftp.c | 103 +- Utilities/cmcurl/lib/ftp.h | 3 +- Utilities/cmcurl/lib/ftplistparser.c | 7 +- Utilities/cmcurl/lib/getinfo.c | 8 +- Utilities/cmcurl/lib/gopher.c | 28 +- Utilities/cmcurl/lib/hostasyn.c | 8 +- Utilities/cmcurl/lib/hostcheck.c | 11 +- Utilities/cmcurl/lib/hostip.c | 153 +- Utilities/cmcurl/lib/hostip.h | 19 +- Utilities/cmcurl/lib/hostip4.c | 4 +- Utilities/cmcurl/lib/hostip6.c | 14 +- Utilities/cmcurl/lib/http.c | 492 ++- Utilities/cmcurl/lib/http.h | 9 +- Utilities/cmcurl/lib/http2.c | 76 +- Utilities/cmcurl/lib/http2.h | 7 +- Utilities/cmcurl/lib/http_digest.c | 5 +- Utilities/cmcurl/lib/http_digest.h | 12 +- Utilities/cmcurl/lib/http_negotiate.c | 132 +- Utilities/cmcurl/lib/http_negotiate.h | 8 +- Utilities/cmcurl/lib/http_ntlm.c | 40 +- Utilities/cmcurl/lib/http_ntlm.h | 10 +- Utilities/cmcurl/lib/http_proxy.c | 4 +- Utilities/cmcurl/lib/if2ip.c | 59 +- Utilities/cmcurl/lib/if2ip.h | 6 +- Utilities/cmcurl/lib/imap.c | 41 +- Utilities/cmcurl/lib/inet_ntop.c | 12 +- Utilities/cmcurl/lib/inet_pton.c | 3 +- Utilities/cmcurl/lib/ldap.c | 22 +- Utilities/cmcurl/lib/libcurl.rc | 12 +- Utilities/cmcurl/lib/md4.c | 114 +- Utilities/cmcurl/lib/md5.c | 174 +- Utilities/cmcurl/lib/memdebug.c | 154 +- Utilities/cmcurl/lib/memdebug.h | 123 +- Utilities/cmcurl/lib/mime.c | 94 +- Utilities/cmcurl/lib/mime.h | 27 +- Utilities/cmcurl/lib/mprintf.c | 2 +- Utilities/cmcurl/lib/multi.c | 916 ++--- Utilities/cmcurl/lib/multihandle.h | 48 +- Utilities/cmcurl/lib/multiif.h | 33 +- Utilities/cmcurl/lib/netrc.c | 16 +- Utilities/cmcurl/lib/netrc.h | 11 +- Utilities/cmcurl/lib/non-ascii.c | 4 +- Utilities/cmcurl/lib/openldap.c | 13 +- Utilities/cmcurl/lib/parsedate.c | 41 +- Utilities/cmcurl/lib/pingpong.c | 9 +- Utilities/cmcurl/lib/pingpong.h | 7 +- Utilities/cmcurl/lib/pipeline.c | 404 -- Utilities/cmcurl/lib/pipeline.h | 56 - Utilities/cmcurl/lib/pop3.c | 32 +- Utilities/cmcurl/lib/progress.c | 150 +- Utilities/cmcurl/lib/rand.h | 7 +- Utilities/cmcurl/lib/rtsp.c | 35 +- Utilities/cmcurl/lib/security.c | 19 +- Utilities/cmcurl/lib/sendf.c | 63 +- Utilities/cmcurl/lib/setopt.c | 358 +- Utilities/cmcurl/lib/sigpipe.h | 5 +- Utilities/cmcurl/lib/smb.c | 9 +- Utilities/cmcurl/lib/smtp.c | 33 +- Utilities/cmcurl/lib/socks.c | 26 +- Utilities/cmcurl/lib/socks_gssapi.c | 6 +- Utilities/cmcurl/lib/socks_sspi.c | 11 +- Utilities/cmcurl/lib/splay.c | 4 +- Utilities/cmcurl/lib/ssh-libssh.c | 90 +- Utilities/cmcurl/lib/ssh.c | 92 +- Utilities/cmcurl/lib/strerror.c | 44 +- Utilities/cmcurl/lib/strerror.h | 11 +- Utilities/cmcurl/lib/system_win32.c | 82 + Utilities/cmcurl/lib/system_win32.h | 6 + Utilities/cmcurl/lib/telnet.c | 34 +- Utilities/cmcurl/lib/tftp.c | 46 +- Utilities/cmcurl/lib/timeval.c | 46 +- Utilities/cmcurl/lib/timeval.h | 4 +- Utilities/cmcurl/lib/transfer.c | 361 +- Utilities/cmcurl/lib/transfer.h | 20 +- Utilities/cmcurl/lib/url.c | 969 ++--- Utilities/cmcurl/lib/url.h | 14 +- Utilities/cmcurl/lib/urlapi-int.h | 12 +- Utilities/cmcurl/lib/urlapi.c | 230 +- Utilities/cmcurl/lib/urldata.h | 634 +-- Utilities/cmcurl/lib/vauth/cleartext.c | 40 +- Utilities/cmcurl/lib/vauth/digest.c | 15 +- Utilities/cmcurl/lib/vauth/digest_sspi.c | 4 +- Utilities/cmcurl/lib/vauth/krb5_gssapi.c | 6 +- Utilities/cmcurl/lib/vauth/krb5_sspi.c | 6 +- Utilities/cmcurl/lib/vauth/ntlm.c | 262 +- Utilities/cmcurl/lib/vauth/ntlm_sspi.c | 51 +- Utilities/cmcurl/lib/vauth/oauth2.c | 56 +- Utilities/cmcurl/lib/vauth/spnego_gssapi.c | 14 +- Utilities/cmcurl/lib/vauth/spnego_sspi.c | 56 +- Utilities/cmcurl/lib/vauth/vauth.c | 42 +- Utilities/cmcurl/lib/vauth/vauth.h | 20 +- Utilities/cmcurl/lib/version.c | 55 +- Utilities/cmcurl/lib/vtls/axtls.c | 741 ---- Utilities/cmcurl/lib/vtls/axtls.h | 33 - Utilities/cmcurl/lib/vtls/cyassl.c | 42 +- Utilities/cmcurl/lib/vtls/darwinssl.c | 3260 --------------- Utilities/cmcurl/lib/vtls/darwinssl.h | 32 - Utilities/cmcurl/lib/vtls/gskit.c | 20 +- Utilities/cmcurl/lib/vtls/gtls.c | 82 +- Utilities/cmcurl/lib/vtls/mbedtls.c | 45 +- Utilities/cmcurl/lib/vtls/mesalink.c | 8 +- Utilities/cmcurl/lib/vtls/nss.c | 90 +- Utilities/cmcurl/lib/vtls/openssl.c | 309 +- Utilities/cmcurl/lib/vtls/polarssl.c | 17 +- Utilities/cmcurl/lib/vtls/polarssl_threadlock.c | 59 +- Utilities/cmcurl/lib/vtls/polarssl_threadlock.h | 9 +- Utilities/cmcurl/lib/vtls/schannel.c | 345 +- Utilities/cmcurl/lib/vtls/schannel.h | 4 +- Utilities/cmcurl/lib/vtls/schannel_verify.c | 55 +- Utilities/cmcurl/lib/vtls/sectransp.c | 3264 +++++++++++++++ Utilities/cmcurl/lib/vtls/sectransp.h | 32 + Utilities/cmcurl/lib/vtls/vtls.c | 67 +- Utilities/cmcurl/lib/vtls/vtls.h | 9 +- Utilities/cmcurl/lib/warnless.c | 40 +- Utilities/cmcurl/lib/warnless.h | 6 +- Utilities/cmcurl/lib/wildcard.c | 6 +- Utilities/cmcurl/lib/wildcard.h | 10 +- Utilities/cmcurl/lib/x509asn1.c | 269 +- Utilities/cmexpat/CMakeLists.txt | 2 +- Utilities/cmjsoncpp/CMakeLists.txt | 2 +- Utilities/cmjsoncpp/include/json/config.h | 17 +- Utilities/cmlibarchive/CMakeLists.txt | 8 +- .../libarchive/archive_read_support_filter_zstd.c | 2 +- .../libarchive/archive_version_details.c | 2 +- .../libarchive/archive_write_add_filter_zstd.c | 2 +- Utilities/cmliblzma/CMakeLists.txt | 2 +- Utilities/cmlibrhash/CMakeLists.txt | 2 +- Utilities/cmlibuv/CMakeLists.txt | 2 +- Utilities/cmlibuv/src/unix/atomic-ops.h | 4 +- Utilities/cmzlib/CMakeLists.txt | 2 +- Utilities/{cmvssetup => cmzstd}/.gitattributes | 0 Utilities/cmzstd/CMakeLists.txt | 47 + Utilities/cmzstd/LICENSE | 30 + Utilities/cmzstd/README.md | 167 + Utilities/cmzstd/lib/common/bitstream.h | 455 +++ Utilities/cmzstd/lib/common/compiler.h | 140 + Utilities/cmzstd/lib/common/cpu.h | 215 + Utilities/cmzstd/lib/common/debug.c | 44 + Utilities/cmzstd/lib/common/debug.h | 134 + Utilities/cmzstd/lib/common/entropy_common.c | 236 ++ Utilities/cmzstd/lib/common/error_private.c | 54 + Utilities/cmzstd/lib/common/error_private.h | 76 + Utilities/cmzstd/lib/common/fse.h | 708 ++++ Utilities/cmzstd/lib/common/fse_decompress.c | 309 ++ Utilities/cmzstd/lib/common/huf.h | 358 ++ Utilities/cmzstd/lib/common/mem.h | 380 ++ Utilities/cmzstd/lib/common/pool.c | 340 ++ Utilities/cmzstd/lib/common/pool.h | 84 + Utilities/cmzstd/lib/common/threading.c | 75 + Utilities/cmzstd/lib/common/threading.h | 123 + Utilities/cmzstd/lib/common/xxhash.c | 876 ++++ Utilities/cmzstd/lib/common/xxhash.h | 305 ++ Utilities/cmzstd/lib/common/zstd_common.c | 83 + Utilities/cmzstd/lib/common/zstd_errors.h | 93 + Utilities/cmzstd/lib/common/zstd_internal.h | 266 ++ Utilities/cmzstd/lib/compress/fse_compress.c | 721 ++++ Utilities/cmzstd/lib/compress/hist.c | 203 + Utilities/cmzstd/lib/compress/hist.h | 95 + Utilities/cmzstd/lib/compress/huf_compress.c | 798 ++++ Utilities/cmzstd/lib/compress/zstd_compress.c | 4290 ++++++++++++++++++++ .../cmzstd/lib/compress/zstd_compress_internal.h | 860 ++++ Utilities/cmzstd/lib/compress/zstd_double_fast.c | 499 +++ Utilities/cmzstd/lib/compress/zstd_double_fast.h | 38 + Utilities/cmzstd/lib/compress/zstd_fast.c | 391 ++ Utilities/cmzstd/lib/compress/zstd_fast.h | 37 + Utilities/cmzstd/lib/compress/zstd_lazy.c | 1106 +++++ Utilities/cmzstd/lib/compress/zstd_lazy.h | 67 + Utilities/cmzstd/lib/compress/zstd_ldm.c | 597 +++ Utilities/cmzstd/lib/compress/zstd_ldm.h | 105 + Utilities/cmzstd/lib/compress/zstd_opt.c | 1217 ++++++ Utilities/cmzstd/lib/compress/zstd_opt.h | 56 + Utilities/cmzstd/lib/compress/zstdmt_compress.c | 2107 ++++++++++ Utilities/cmzstd/lib/compress/zstdmt_compress.h | 174 + Utilities/cmzstd/lib/decompress/huf_decompress.c | 1232 ++++++ Utilities/cmzstd/lib/decompress/zstd_ddict.c | 240 ++ Utilities/cmzstd/lib/decompress/zstd_ddict.h | 44 + Utilities/cmzstd/lib/decompress/zstd_decompress.c | 1672 ++++++++ .../cmzstd/lib/decompress/zstd_decompress_block.c | 1307 ++++++ .../cmzstd/lib/decompress/zstd_decompress_block.h | 59 + .../lib/decompress/zstd_decompress_internal.h | 168 + Utilities/cmzstd/lib/deprecated/zbuff.h | 213 + Utilities/cmzstd/lib/deprecated/zbuff_common.c | 26 + Utilities/cmzstd/lib/deprecated/zbuff_compress.c | 147 + Utilities/cmzstd/lib/deprecated/zbuff_decompress.c | 75 + Utilities/cmzstd/lib/dictBuilder/cover.c | 1081 +++++ Utilities/cmzstd/lib/dictBuilder/cover.h | 83 + Utilities/cmzstd/lib/dictBuilder/divsufsort.c | 1913 +++++++++ Utilities/cmzstd/lib/dictBuilder/divsufsort.h | 67 + Utilities/cmzstd/lib/dictBuilder/fastcover.c | 728 ++++ Utilities/cmzstd/lib/dictBuilder/zdict.c | 1111 +++++ Utilities/cmzstd/lib/dictBuilder/zdict.h | 267 ++ Utilities/cmzstd/lib/zstd.h | 1766 ++++++++ bootstrap | 19 +- 1792 files changed, 77423 insertions(+), 32320 deletions(-) create mode 100644 Help/envvar/CMAKE_GENERATOR.rst create mode 100644 Help/envvar/CMAKE_GENERATOR_INSTANCE.rst create mode 100644 Help/envvar/CMAKE_GENERATOR_PLATFORM.rst create mode 100644 Help/envvar/CMAKE_GENERATOR_TOOLSET.rst create mode 100644 Help/envvar/SWIFTC.rst create mode 100644 Help/module/FindEnvModules.rst create mode 100644 Help/policy/CMP0089.rst create mode 100644 Help/policy/CMP0090.rst create mode 100644 Help/policy/CMP0091.rst create mode 100644 Help/policy/CMP0092.rst create mode 100644 Help/policy/CMP0093.rst create mode 100644 Help/policy/CMP0094.rst create mode 100644 Help/prop_dir/ADDITIONAL_CLEAN_FILES.rst create mode 100644 Help/prop_sf/Swift_DEPENDENCIES_FILE.rst create mode 100644 Help/prop_sf/Swift_DIAGNOSTICS_FILE.rst create mode 100644 Help/prop_tgt/ADDITIONAL_CLEAN_FILES.rst create mode 100644 Help/prop_tgt/MSVC_RUNTIME_LIBRARY-VALUES.txt create mode 100644 Help/prop_tgt/MSVC_RUNTIME_LIBRARY.rst create mode 100644 Help/prop_tgt/Swift_DEPENDENCIES_FILE.rst create mode 100644 Help/prop_tgt/Swift_MODULE_DIRECTORY.rst create mode 100644 Help/prop_tgt/Swift_MODULE_NAME.rst create mode 100644 Help/prop_tgt/VS_JUST_MY_CODE_DEBUGGING.rst create mode 100644 Help/prop_tgt/VS_NO_SOLUTION_DEPLOY.rst create mode 100644 Help/prop_tgt/VS_PACKAGE_REFERENCES.rst create mode 100644 Help/prop_tgt/VS_PROJECT_IMPORT.rst create mode 100644 Help/prop_tgt/XCODE_GENERATE_SCHEME.rst create mode 100644 Help/prop_tgt/XCODE_SCHEME_DEBUG_AS_ROOT.rst create mode 100644 Help/release/3.15.rst create mode 100644 Help/variable/CMAKE_EXECUTE_PROCESS_COMMAND_ECHO.rst create mode 100644 Help/variable/CMAKE_EXPORT_PACKAGE_REGISTRY.rst create mode 100644 Help/variable/CMAKE_FIND_PACKAGE_PREFER_CONFIG.rst create mode 100644 Help/variable/CMAKE_FRAMEWORK.rst create mode 100644 Help/variable/CMAKE_MSVC_RUNTIME_LIBRARY.rst create mode 100644 Help/variable/CMAKE_PROJECT_INCLUDE.rst create mode 100644 Help/variable/CMAKE_PROJECT_INCLUDE_BEFORE.rst create mode 100644 Help/variable/CMAKE_Swift_MODULE_DIRECTORY.rst create mode 100644 Help/variable/CMAKE_VS_JUST_MY_CODE_DEBUGGING.rst create mode 100644 Help/variable/CTEST_UPDATE_VERSION_OVERRIDE.rst create mode 100644 Modules/Compiler/ARMClang-ASM.cmake create mode 100644 Modules/Compiler/ARMClang-C-FeatureTests.cmake create mode 100644 Modules/Compiler/ARMClang-C.cmake create mode 100644 Modules/Compiler/ARMClang-CXX-FeatureTests.cmake create mode 100644 Modules/Compiler/ARMClang-CXX.cmake create mode 100644 Modules/Compiler/ARMClang-DetermineCompiler.cmake create mode 100644 Modules/Compiler/ARMClang.cmake delete mode 100644 Modules/Compiler/MIPSpro-C.cmake delete mode 100644 Modules/Compiler/MIPSpro-CXX.cmake delete mode 100644 Modules/Compiler/MIPSpro-DetermineCompiler.cmake delete mode 100644 Modules/Compiler/MIPSpro-Fortran.cmake create mode 100644 Modules/Compiler/XLClang-C-DetermineCompiler.cmake create mode 100644 Modules/Compiler/XLClang-C.cmake create mode 100644 Modules/Compiler/XLClang-CXX-DetermineCompiler.cmake create mode 100644 Modules/Compiler/XLClang-CXX.cmake create mode 100644 Modules/Compiler/XLClang.cmake create mode 100644 Modules/FindEnvModules.cmake create mode 100644 Modules/Platform/AIX-XLClang-C.cmake create mode 100644 Modules/Platform/AIX-XLClang-CXX.cmake create mode 100644 Modules/Platform/AIX-XLClang.cmake create mode 100644 Modules/Platform/GHS-MULTI-Determine.cmake delete mode 100644 Modules/Platform/GHS-MULTI-Initialize.cmake create mode 100644 Source/CMakeInstallSignTool.cmake.in delete mode 100644 Source/CPack/bills-comments.txt create mode 100644 Source/cmArgumentParser.cxx create mode 100644 Source/cmArgumentParser.h delete mode 100644 Source/cmCommandArgumentsHelper.cxx delete mode 100644 Source/cmCommandArgumentsHelper.h create mode 100644 Source/cmFileCopier.cxx create mode 100644 Source/cmFileCopier.h create mode 100644 Source/cmFileInstaller.cxx create mode 100644 Source/cmFileInstaller.h create mode 100644 Source/cmFileTime.cxx create mode 100644 Source/cmFileTime.h create mode 100644 Source/cmFileTimeCache.cxx create mode 100644 Source/cmFileTimeCache.h delete mode 100644 Source/cmFileTimeComparison.cxx delete mode 100644 Source/cmFileTimeComparison.h create mode 100644 Source/cmFileTimes.cxx create mode 100644 Source/cmFileTimes.h create mode 100644 Source/cmGetPipes.cxx create mode 100644 Source/cmGetPipes.h create mode 100644 Source/cmNinjaLinkLineDeviceComputer.cxx create mode 100644 Source/cmNinjaLinkLineDeviceComputer.h delete mode 100644 Source/cmQtAutoGeneratorMocUic.cxx delete mode 100644 Source/cmQtAutoGeneratorMocUic.h delete mode 100644 Source/cmQtAutoGeneratorRcc.cxx delete mode 100644 Source/cmQtAutoGeneratorRcc.h create mode 100644 Source/cmQtAutoMocUic.cxx create mode 100644 Source/cmQtAutoMocUic.h create mode 100644 Source/cmQtAutoRcc.cxx create mode 100644 Source/cmQtAutoRcc.h create mode 100644 Source/cmRange.h create mode 100644 Source/cmUVProcessChain.cxx create mode 100644 Source/cmUVProcessChain.h create mode 100644 Source/cmUVStreambuf.h create mode 100644 Source/cmWorkerPool.cxx create mode 100644 Source/cmWorkerPool.h delete mode 100644 Source/cmakexbuild.cxx create mode 100644 Source/kwsys/testDynloadImpl.c create mode 100644 Source/kwsys/testDynloadImpl.h create mode 100644 Source/kwsys/testDynloadUse.c create mode 100644 Tests/CMakeLib/testArgumentParser.cxx create mode 100644 Tests/CMakeLib/testRange.cxx create mode 100644 Tests/CMakeLib/testUVProcessChain.cxx create mode 100644 Tests/CMakeLib/testUVProcessChainHelper.cxx create mode 100644 Tests/CMakeLib/testUVStreambuf.cxx create mode 100644 Tests/CMakeOnly/ProjectIncludeAny/CMakeLists.txt create mode 100644 Tests/CMakeOnly/ProjectIncludeBefore/CMakeLists.txt create mode 100644 Tests/CMakeOnly/ProjectIncludeBefore/include.cmake create mode 100644 Tests/CheckSwift.cmake create mode 100644 Tests/FindCups/CMakeLists.txt create mode 100644 Tests/FindCups/Test/CMakeLists.txt create mode 100644 Tests/FindCups/Test/main.c create mode 100644 Tests/FindEnvModules/CMakeLists.txt create mode 100644 Tests/FindEnvModules/EnvModules.cmake create mode 100644 Tests/FindGLEW/CMakeLists.txt create mode 100644 Tests/FindGLEW/Test/CMakeLists.txt create mode 100644 Tests/FindGLEW/Test/main.cpp create mode 100644 Tests/FindPackageTest/.gitignore create mode 100644 Tests/FindPackageTest/PreferConfig/ABCConfig.cmake create mode 100644 Tests/FindPackageTest/PreferConfig/FindABC.cmake create mode 100644 Tests/FindPython/Python2Embedded/CMakeLists.txt create mode 100644 Tests/FindPython/Python3Embedded/CMakeLists.txt create mode 100644 Tests/FindPython/VirtualEnv/CMakeLists.txt create mode 100644 Tests/FindPython/VirtualEnv/VirtualEnvDefault.cmake create mode 100644 Tests/FindPython/VirtualEnv/VirtualEnvOnly.cmake create mode 100644 Tests/FindPython/VirtualEnv/VirtualEnvStandard.cmake create mode 100644 Tests/FindPython/display_time.c create mode 100644 Tests/FindPython/display_time.h create mode 100644 Tests/FindPython/main.c create mode 100644 Tests/GhsMulti/GhsMultiCustomTarget/CMakeLists.txt create mode 100644 Tests/GhsMulti/GhsMultiCustomTarget/CMakeLists.txt.in copy Tests/GhsMulti/{GhsMultiRenameInstall => GhsMultiCustomTarget}/exe1.c (100%) copy Tests/GhsMulti/{GhsMultiRenameInstall => GhsMultiCustomTarget}/lib1.c (100%) create mode 100644 Tests/GhsMulti/GhsMultiDepOrder/CMakeLists.txt create mode 100644 Tests/GhsMulti/GhsMultiDepOrder/exec/CMakeLists.txt create mode 100644 Tests/GhsMulti/GhsMultiDepOrder/exec/exe1.c create mode 100644 Tests/GhsMulti/GhsMultiDepOrder/lib/CMakeLists.txt create mode 100644 Tests/GhsMulti/GhsMultiDepOrder/lib/func1.c create mode 100644 Tests/GhsMulti/GhsMultiDepOrder/lib/lib1.h create mode 100644 Tests/GhsMulti/GhsMultiDepOrder/protolib/CMakeLists.txt create mode 100644 Tests/GhsMulti/GhsMultiDepOrder/protolib/proto1.c.in create mode 100644 Tests/GhsMulti/GhsMultiDepOrder/protolib/proto1.h.in create mode 100644 Tests/GhsMulti/GhsMultiExternalProject/CMakeLists.txt create mode 100644 Tests/GhsMulti/GhsMultiExternalProject/empty/CMakeLists.txt delete mode 100644 Tests/GhsMulti/GhsMultiPlatform/file1.c create mode 100644 Tests/MSVCRuntimeLibrary/CMakeLists.txt create mode 100644 Tests/MSVCRuntimeLibrary/Fortran/CMakeLists.txt create mode 100644 Tests/MSVCRuntimeLibrary/Fortran/verify.F90 create mode 100644 Tests/MSVCRuntimeLibrary/verify.c create mode 100644 Tests/MSVCRuntimeLibrary/verify.cxx create mode 100644 Tests/MSVCRuntimeLibrary/verify.h create mode 100644 Tests/MakeClean/ToClean/EmptySubDir/CMakeLists.txt create mode 100644 Tests/Module/FindDependency/packages/Pack7/Pack7Config.cmake create mode 100644 Tests/Module/FindDependency/packages/Pack8/Pack8Config.cmake create mode 100644 Tests/QtAutogen/ManySources/CMakeLists.txt create mode 100644 Tests/QtAutogen/ManySources/data.qrc.in create mode 100644 Tests/QtAutogen/ManySources/item.cpp.in create mode 100644 Tests/QtAutogen/ManySources/item.h.in create mode 100644 Tests/QtAutogen/ManySources/main.cpp.in create mode 100644 Tests/QtAutogen/ManySources/object.h.in create mode 100644 Tests/QtAutogen/ManySources/view.ui.in copy Tests/RunCMake/{while/MissingArgument-result.txt => CommandLine/BuildDir--build--parallel-large-result.txt} (100%) create mode 100644 Tests/RunCMake/CommandLine/BuildDir--build--parallel-large-stderr.txt copy Tests/RunCMake/{while/MissingArgument-result.txt => CommandLine/BuildDir--build--parallel-zero-result.txt} (100%) create mode 100644 Tests/RunCMake/CommandLine/BuildDir--build--parallel-zero-stderr.txt copy Tests/RunCMake/{while/MissingArgument-result.txt => CommandLine/BuildDir--build-jobs-large-result.txt} (100%) create mode 100644 Tests/RunCMake/CommandLine/BuildDir--build-jobs-large-stderr.txt copy Tests/RunCMake/{while/MissingArgument-result.txt => CommandLine/BuildDir--build-jobs-zero-result.txt} (100%) create mode 100644 Tests/RunCMake/CommandLine/BuildDir--build-jobs-zero-stderr.txt copy Tests/RunCMake/CommandLine/{BuildDir--build-jobs-no-space-good-number-trailing--target-stderr.txt => BuildDir--build-multiple-targets-jobs-stderr.txt} (100%) delete mode 100644 Tests/RunCMake/CommandLine/BuildDir--build-multiple-targets-result.txt delete mode 100644 Tests/RunCMake/CommandLine/BuildDir--build-multiple-targets-stderr.txt copy Tests/RunCMake/{while/MissingArgument-result.txt => CommandLine/BuildDir--build-multiple-targets-with-clean-first-result.txt} (100%) create mode 100644 Tests/RunCMake/CommandLine/BuildDir--build-multiple-targets-with-clean-first-stderr.txt copy Tests/RunCMake/{while/MissingArgument-result.txt => CommandLine/BuildDir--build-multiple-targets-with-clean-second-result.txt} (100%) create mode 100644 Tests/RunCMake/CommandLine/BuildDir--build-multiple-targets-with-clean-second-stderr.txt create mode 100644 Tests/RunCMake/CommandLine/E_make_directory-directory-with-parent-check.cmake delete mode 100644 Tests/RunCMake/CommandLine/E_make_directory-three-directories-and-file-result.txt create mode 100644 Tests/RunCMake/CommandLine/E_make_directory-three-directories-check.cmake copy Tests/RunCMake/{while/MissingArgument-result.txt => CommandLine/E_make_directory-two-directories-and-file-result.txt} (100%) rename Tests/RunCMake/CommandLine/{E_make_directory-three-directories-and-file-stderr.txt => E_make_directory-two-directories-and-file-stderr.txt} (100%) create mode 100644 Tests/RunCMake/CommandLine/E_remove_directory-directory-with-parent-check.cmake copy Tests/{Wrapping/vtkIncluded.cxx => RunCMake/CommandLine/E_remove_directory-directory-with-parent-stderr.txt} (100%) create mode 100644 Tests/RunCMake/CommandLine/E_remove_directory-three-directories-check.cmake copy Tests/{Wrapping/vtkIncluded.cxx => RunCMake/CommandLine/E_remove_directory-three-directories-stderr.txt} (100%) create mode 100644 Tests/RunCMake/CommandLine/E_remove_directory-two-directories-and-file-check.cmake copy Tests/{Wrapping/vtkIncluded.cxx => RunCMake/CommandLine/E_remove_directory-two-directories-and-file-stderr.txt} (100%) create mode 100644 Tests/RunCMake/CommandLine/EnvGenerator/CMakeLists.txt copy Tests/RunCMake/{while/MissingArgument-result.txt => CommandLine/Envgen-A-platform-result.txt} (100%) create mode 100644 Tests/RunCMake/CommandLine/Envgen-A-platform-stderr-vs9.txt create mode 100644 Tests/RunCMake/CommandLine/Envgen-A-platform-stderr.txt create mode 100644 Tests/RunCMake/CommandLine/Envgen-G-implicit-platform-stdout.txt copy Tests/RunCMake/{while/MissingArgument-result.txt => CommandLine/Envgen-T-toolset-result.txt} (100%) create mode 100644 Tests/RunCMake/CommandLine/Envgen-T-toolset-stderr.txt copy Tests/RunCMake/{while/MissingArgument-result.txt => CommandLine/Envgen-bad-result.txt} (100%) create mode 100644 Tests/RunCMake/CommandLine/Envgen-bad-stderr.txt copy Tests/RunCMake/{while/MissingArgument-result.txt => CommandLine/Envgen-instance-invalid-result.txt} (100%) create mode 100644 Tests/RunCMake/CommandLine/Envgen-instance-invalid-stderr.txt copy Tests/RunCMake/{while/MissingArgument-result.txt => CommandLine/Envgen-ninja-result.txt} (100%) create mode 100644 Tests/RunCMake/CommandLine/Envgen-ninja-stderr.txt copy Tests/RunCMake/{while/MissingArgument-result.txt => CommandLine/Envgen-platform-invalid-result.txt} (100%) create mode 100644 Tests/RunCMake/CommandLine/Envgen-platform-invalid-stderr-vs9.txt create mode 100644 Tests/RunCMake/CommandLine/Envgen-platform-invalid-stderr.txt copy Tests/RunCMake/{while/MissingArgument-result.txt => CommandLine/Envgen-toolset-invalid-result.txt} (100%) create mode 100644 Tests/RunCMake/CommandLine/Envgen-toolset-invalid-stderr.txt copy Tests/RunCMake/{while/MissingArgument-result.txt => CommandLine/Envgen-unset-result.txt} (100%) create mode 100644 Tests/RunCMake/CommandLine/Envgen-unset-stderr.txt copy Tests/RunCMake/{while/MissingArgument-result.txt => CommandLine/Envgen-warnings-result.txt} (100%) create mode 100644 Tests/RunCMake/CommandLine/Envgen-warnings-stderr.txt create mode 100644 Tests/RunCMake/CommandLine/dir-install-options-to-vars/cmake_install.cmake copy Tests/RunCMake/{while/MissingArgument-result.txt => CommandLine/install-bad-dir-result.txt} (100%) create mode 100644 Tests/RunCMake/CommandLine/install-bad-dir-stderr.txt copy Tests/RunCMake/{while/MissingArgument-result.txt => CommandLine/install-no-dir-result.txt} (100%) create mode 100644 Tests/RunCMake/CommandLine/install-no-dir-stderr.txt copy Tests/RunCMake/{target_link_options/LINK_OPTIONS-static-result.txt => CommandLine/install-options-to-vars-result.txt} (100%) create mode 100644 Tests/RunCMake/CommandLine/install-options-to-vars-stderr.txt copy Tests/RunCMake/{while/MissingArgument-result.txt => CommandLineTar/bad-file-result.txt} (100%) create mode 100644 Tests/RunCMake/CommandLineTar/bad-file-stderr.txt copy Tests/RunCMake/{while/MissingArgument-result.txt => CommandLineTar/bad-without-action-result.txt} (100%) create mode 100644 Tests/RunCMake/CommandLineTar/bad-without-action-stderr.txt create mode 100644 Tests/RunCMake/CommandLineTar/bad-wrong-flag-stderr.txt create mode 100644 Tests/RunCMake/CommandLineTar/end-opt2-stderr.txt create mode 100644 Tests/RunCMake/CommandLineTar/pax-zstd.cmake copy Tests/{Wrapping/vtkIncluded.cxx => RunCMake/CommandLineTar/test-file.txt} (100%) create mode 100644 Tests/RunCMake/CommandLineTar/without-files-stderr.txt create mode 100644 Tests/RunCMake/CommandLineTar/zip-filtered.cmake create mode 100644 Tests/RunCMake/CrosscompilingEmulator/AddCustomCommandWithArg-build-check.cmake create mode 100644 Tests/RunCMake/CrosscompilingEmulator/AddCustomCommandWithArg.cmake create mode 100644 Tests/RunCMake/CrosscompilingEmulator/AddCustomTargetWithArg-build-check.cmake create mode 100644 Tests/RunCMake/CrosscompilingEmulator/AddCustomTargetWithArg.cmake create mode 100644 Tests/RunCMake/FindBoost/CMP0093-NEW-stdout.txt create mode 100644 Tests/RunCMake/FindBoost/CMP0093-NEW.cmake create mode 100644 Tests/RunCMake/FindBoost/CMP0093-OLD-stdout.txt create mode 100644 Tests/RunCMake/FindBoost/CMP0093-OLD.cmake create mode 100644 Tests/RunCMake/FindBoost/CMP0093-UNSET-stdout.txt create mode 100644 Tests/RunCMake/FindBoost/CMP0093-UNSET.cmake create mode 100644 Tests/RunCMake/FindBoost/CMakePackageFixtures/Boost-1.70.0/BoostConfig.cmake create mode 100644 Tests/RunCMake/FindBoost/CMakePackageFixtures/Boost-1.70.0/BoostConfigVersion.cmake create mode 100644 Tests/RunCMake/FindBoost/CMakePackageFixtures/BoostDetectToolset-1.70.0.cmake create mode 100644 Tests/RunCMake/FindBoost/CMakePackageFixtures/boost_chrono-1.70.0/boost_chrono-config-version.cmake create mode 100644 Tests/RunCMake/FindBoost/CMakePackageFixtures/boost_chrono-1.70.0/boost_chrono-config.cmake create mode 100644 Tests/RunCMake/FindBoost/CMakePackageFixtures/boost_chrono-1.70.0/libboost_chrono-variant-shared.cmake create mode 100644 Tests/RunCMake/FindBoost/CMakePackageFixtures/boost_chrono-1.70.0/libboost_chrono-variant-static.cmake create mode 100644 Tests/RunCMake/FindBoost/CMakePackageFixtures/boost_headers-1.70.0/boost_headers-config-version.cmake create mode 100644 Tests/RunCMake/FindBoost/CMakePackageFixtures/boost_headers-1.70.0/boost_headers-config.cmake create mode 100644 Tests/RunCMake/FindBoost/CMakePackageFixtures/boost_system-1.70.0/boost_system-config-version.cmake create mode 100644 Tests/RunCMake/FindBoost/CMakePackageFixtures/boost_system-1.70.0/boost_system-config.cmake create mode 100644 Tests/RunCMake/FindBoost/CMakePackageFixtures/boost_system-1.70.0/libboost_system-variant-shared.cmake create mode 100644 Tests/RunCMake/FindBoost/CMakePackageFixtures/boost_system-1.70.0/libboost_system-variant-static.cmake create mode 100644 Tests/RunCMake/FindBoost/CMakePackageFixtures/boost_timer-1.70.0/boost_timer-config-version.cmake create mode 100644 Tests/RunCMake/FindBoost/CMakePackageFixtures/boost_timer-1.70.0/boost_timer-config.cmake create mode 100644 Tests/RunCMake/FindBoost/CMakePackageFixtures/boost_timer-1.70.0/libboost_timer-variant-shared.cmake create mode 100644 Tests/RunCMake/FindBoost/CMakePackageFixtures/boost_timer-1.70.0/libboost_timer-variant-static.cmake copy Tests/RunCMake/{target_link_options/LINK_OPTIONS-shared-result.txt => FindBoost/CommonNotFound-stderr.txt} (100%) create mode 100644 Tests/RunCMake/FindBoost/CommonNotFound-stdout.txt create mode 100644 Tests/RunCMake/FindBoost/CommonNotFound.cmake create mode 100644 Tests/RunCMake/FindBoost/CommonResults-stdout.txt create mode 100644 Tests/RunCMake/FindBoost/CommonResults.cmake create mode 100644 Tests/RunCMake/FindBoost/ConfigMode.cmake create mode 100644 Tests/RunCMake/FindBoost/ConfigModeNotFound.cmake copy Tests/{Wrapping/vtkIncluded.cxx => RunCMake/FindBoost/MockInstalls/1.70.0/include/boost/chrono.hpp} (100%) copy Tests/{Wrapping/vtkIncluded.cxx => RunCMake/FindBoost/MockInstalls/1.70.0/include/boost/config.hpp} (100%) copy Tests/{Wrapping/vtkIncluded.cxx => RunCMake/FindBoost/MockInstalls/1.70.0/include/boost/system/config.hpp} (100%) copy Tests/{Wrapping/vtkIncluded.cxx => RunCMake/FindBoost/MockInstalls/1.70.0/include/boost/timer.hpp} (100%) create mode 100644 Tests/RunCMake/FindBoost/MockInstalls/1.70.0/include/boost/version.hpp copy Tests/{Wrapping/vtkIncluded.cxx => RunCMake/FindBoost/MockInstalls/1.70.0/lib/boost_chrono-mt-1_70.lib} (100%) copy Tests/{Wrapping/vtkIncluded.cxx => RunCMake/FindBoost/MockInstalls/1.70.0/lib/boost_system-mt-1_70.lib} (100%) copy Tests/{Wrapping/vtkIncluded.cxx => RunCMake/FindBoost/MockInstalls/1.70.0/lib/boost_timer-mt-1_70.lib} (100%) copy Tests/{Wrapping/vtkIncluded.cxx => RunCMake/FindBoost/MockInstalls/1.70.0/lib/libboost_chrono-mt-1_70.lib} (100%) copy Tests/{Wrapping/vtkIncluded.cxx => RunCMake/FindBoost/MockInstalls/1.70.0/lib/libboost_chrono.a} (100%) copy Tests/{Wrapping/vtkIncluded.cxx => RunCMake/FindBoost/MockInstalls/1.70.0/lib/libboost_chrono.so.1.70.0} (100%) copy Tests/{Wrapping/vtkIncluded.cxx => RunCMake/FindBoost/MockInstalls/1.70.0/lib/libboost_system-mt-1_70.lib} (100%) copy Tests/{Wrapping/vtkIncluded.cxx => RunCMake/FindBoost/MockInstalls/1.70.0/lib/libboost_system.a} (100%) copy Tests/{Wrapping/vtkIncluded.cxx => RunCMake/FindBoost/MockInstalls/1.70.0/lib/libboost_system.so.1.70.0} (100%) copy Tests/{Wrapping/vtkIncluded.cxx => RunCMake/FindBoost/MockInstalls/1.70.0/lib/libboost_timer-mt-1_70.lib} (100%) copy Tests/{Wrapping/vtkIncluded.cxx => RunCMake/FindBoost/MockInstalls/1.70.0/lib/libboost_timer.a} (100%) copy Tests/{Wrapping/vtkIncluded.cxx => RunCMake/FindBoost/MockInstalls/1.70.0/lib/libboost_timer.so.1.70.0} (100%) create mode 100644 Tests/RunCMake/FindBoost/ModuleMode.cmake create mode 100644 Tests/RunCMake/FindBoost/ModuleModeNotFound.cmake create mode 100644 Tests/RunCMake/FindPkgConfig/FindPkgConfig_GET_VARIABLE_PKGCONFIG_PATH.cmake create mode 100644 Tests/RunCMake/FindPkgConfig/FindPkgConfig_GET_VARIABLE_PREFIX_PATH.cmake create mode 100644 Tests/RunCMake/FindPkgConfig/pc-bletch/lib/pkgconfig/bletch.pc copy Tests/RunCMake/{while/MissingArgument-result.txt => GeneratorExpression/COMPILE_LANG_AND_ID-add_custom_command-result.txt} (100%) create mode 100644 Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-add_custom_command-stderr.txt create mode 100644 Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-add_custom_command.cmake copy Tests/RunCMake/{while/MissingArgument-result.txt => GeneratorExpression/COMPILE_LANG_AND_ID-add_custom_target-result.txt} (100%) create mode 100644 Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-add_custom_target-stderr.txt create mode 100644 Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-add_custom_target.cmake copy Tests/RunCMake/{while/MissingArgument-result.txt => GeneratorExpression/COMPILE_LANG_AND_ID-add_executable-result.txt} (100%) create mode 100644 Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-add_executable-stderr.txt create mode 100644 Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-add_executable.cmake copy Tests/RunCMake/{while/MissingArgument-result.txt => GeneratorExpression/COMPILE_LANG_AND_ID-add_library-result.txt} (100%) create mode 100644 Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-add_library-stderr.txt create mode 100644 Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-add_library.cmake copy Tests/RunCMake/{while/MissingArgument-result.txt => GeneratorExpression/COMPILE_LANG_AND_ID-add_test-result.txt} (100%) create mode 100644 Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-add_test-stderr.txt create mode 100644 Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-add_test.cmake copy Tests/RunCMake/{while/MissingArgument-result.txt => GeneratorExpression/COMPILE_LANG_AND_ID-install-result.txt} (100%) create mode 100644 Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-install-stderr.txt create mode 100644 Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-install.cmake copy Tests/RunCMake/{while/MissingArgument-result.txt => GeneratorExpression/COMPILE_LANG_AND_ID-target_sources-result.txt} (100%) create mode 100644 Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-target_sources-stderr.txt create mode 100644 Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-target_sources.cmake create mode 100644 Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-unknown-lang.cmake create mode 100644 Tests/RunCMake/GeneratorExpression/FILTER-Exclude-check.cmake create mode 100644 Tests/RunCMake/GeneratorExpression/FILTER-Exclude.cmake create mode 100644 Tests/RunCMake/GeneratorExpression/FILTER-Include-check.cmake create mode 100644 Tests/RunCMake/GeneratorExpression/FILTER-Include.cmake copy Tests/RunCMake/{while/MissingArgument-result.txt => GeneratorExpression/FILTER-InvalidOperator-result.txt} (100%) create mode 100644 Tests/RunCMake/GeneratorExpression/FILTER-InvalidOperator-stderr.txt create mode 100644 Tests/RunCMake/GeneratorExpression/FILTER-InvalidOperator.cmake create mode 100644 Tests/RunCMake/GeneratorExpression/FILTER-empty-check.cmake create mode 100644 Tests/RunCMake/GeneratorExpression/FILTER-empty.cmake copy Tests/RunCMake/{while/MissingArgument-result.txt => GeneratorExpression/ImportedTarget-TARGET_PDB_FILE_BASE_NAME-result.txt} (100%) create mode 100644 Tests/RunCMake/GeneratorExpression/ImportedTarget-TARGET_PDB_FILE_BASE_NAME-stderr.txt create mode 100644 Tests/RunCMake/GeneratorExpression/ImportedTarget-TARGET_PDB_FILE_BASE_NAME.cmake copy Tests/RunCMake/{while/MissingArgument-result.txt => GeneratorExpression/NonValidCompiler-TARGET_PDB_FILE_BASE_NAME-result.txt} (100%) create mode 100644 Tests/RunCMake/GeneratorExpression/NonValidCompiler-TARGET_PDB_FILE_BASE_NAME-stderr.txt create mode 100644 Tests/RunCMake/GeneratorExpression/NonValidCompiler-TARGET_PDB_FILE_BASE_NAME.cmake copy Tests/RunCMake/{while/MissingArgument-result.txt => GeneratorExpression/NonValidTarget-TARGET_PDB_FILE_BASE_NAME-result.txt} (100%) create mode 100644 Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_PDB_FILE_BASE_NAME-stderr.txt create mode 100644 Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_PDB_FILE_BASE_NAME.cmake create mode 100644 Tests/RunCMake/GeneratorExpression/REMOVE_DUPLICATES-1-check.cmake create mode 100644 Tests/RunCMake/GeneratorExpression/REMOVE_DUPLICATES-1.cmake create mode 100644 Tests/RunCMake/GeneratorExpression/REMOVE_DUPLICATES-2-check.cmake create mode 100644 Tests/RunCMake/GeneratorExpression/REMOVE_DUPLICATES-2.cmake create mode 100644 Tests/RunCMake/GeneratorExpression/REMOVE_DUPLICATES-3-check.cmake create mode 100644 Tests/RunCMake/GeneratorExpression/REMOVE_DUPLICATES-3.cmake create mode 100644 Tests/RunCMake/GeneratorExpression/REMOVE_DUPLICATES-4-check.cmake create mode 100644 Tests/RunCMake/GeneratorExpression/REMOVE_DUPLICATES-4.cmake create mode 100644 Tests/RunCMake/GeneratorExpression/REMOVE_DUPLICATES-empty-check.cmake create mode 100644 Tests/RunCMake/GeneratorExpression/REMOVE_DUPLICATES-empty.cmake create mode 100644 Tests/RunCMake/GeneratorExpression/ResultValidator.cmake create mode 100644 Tests/RunCMake/GeneratorExpression/TARGET_FILE_BASE_NAME-check.cmake create mode 100644 Tests/RunCMake/GeneratorExpression/TARGET_FILE_BASE_NAME-imported-target-check.cmake create mode 100644 Tests/RunCMake/GeneratorExpression/TARGET_FILE_BASE_NAME-imported-target.cmake copy Tests/RunCMake/{while/MissingArgument-result.txt => GeneratorExpression/TARGET_FILE_BASE_NAME-non-valid-target-result.txt} (100%) create mode 100644 Tests/RunCMake/GeneratorExpression/TARGET_FILE_BASE_NAME-non-valid-target-stderr.txt create mode 100644 Tests/RunCMake/GeneratorExpression/TARGET_FILE_BASE_NAME-non-valid-target.cmake create mode 100644 Tests/RunCMake/GeneratorExpression/TARGET_FILE_BASE_NAME.cmake create mode 100644 Tests/RunCMake/GeneratorExpression/TARGET_FILE_PREFIX-check.cmake create mode 100644 Tests/RunCMake/GeneratorExpression/TARGET_FILE_PREFIX-imported-target-check.cmake create mode 100644 Tests/RunCMake/GeneratorExpression/TARGET_FILE_PREFIX-imported-target.cmake copy Tests/RunCMake/{while/MissingArgument-result.txt => GeneratorExpression/TARGET_FILE_PREFIX-non-valid-target-result.txt} (100%) create mode 100644 Tests/RunCMake/GeneratorExpression/TARGET_FILE_PREFIX-non-valid-target-stderr.txt create mode 100644 Tests/RunCMake/GeneratorExpression/TARGET_FILE_PREFIX-non-valid-target.cmake create mode 100644 Tests/RunCMake/GeneratorExpression/TARGET_FILE_PREFIX.cmake create mode 100644 Tests/RunCMake/GeneratorExpression/TARGET_FILE_SUFFIX-check.cmake create mode 100644 Tests/RunCMake/GeneratorExpression/TARGET_FILE_SUFFIX-imported-target-check.cmake create mode 100644 Tests/RunCMake/GeneratorExpression/TARGET_FILE_SUFFIX-imported-target.cmake copy Tests/RunCMake/{while/MissingArgument-result.txt => GeneratorExpression/TARGET_FILE_SUFFIX-non-valid-target-result.txt} (100%) create mode 100644 Tests/RunCMake/GeneratorExpression/TARGET_FILE_SUFFIX-non-valid-target-stderr.txt create mode 100644 Tests/RunCMake/GeneratorExpression/TARGET_FILE_SUFFIX-non-valid-target.cmake create mode 100644 Tests/RunCMake/GeneratorExpression/TARGET_FILE_SUFFIX.cmake copy Tests/RunCMake/{while/MissingArgument-result.txt => GeneratorExpression/TARGET_LINKER_FILE_BASE_NAME-non-valid-target-result.txt} (100%) create mode 100644 Tests/RunCMake/GeneratorExpression/TARGET_LINKER_FILE_BASE_NAME-non-valid-target-stderr.txt create mode 100644 Tests/RunCMake/GeneratorExpression/TARGET_LINKER_FILE_BASE_NAME-non-valid-target.cmake copy Tests/RunCMake/{while/MissingArgument-result.txt => GeneratorExpression/TARGET_LINKER_FILE_PREFIX-non-valid-target-result.txt} (100%) create mode 100644 Tests/RunCMake/GeneratorExpression/TARGET_LINKER_FILE_PREFIX-non-valid-target-stderr.txt create mode 100644 Tests/RunCMake/GeneratorExpression/TARGET_LINKER_FILE_PREFIX-non-valid-target.cmake copy Tests/RunCMake/{while/MissingArgument-result.txt => GeneratorExpression/TARGET_LINKER_FILE_SUFFIX-non-valid-target-result.txt} (100%) create mode 100644 Tests/RunCMake/GeneratorExpression/TARGET_LINKER_FILE_SUFFIX-non-valid-target-stderr.txt create mode 100644 Tests/RunCMake/GeneratorExpression/TARGET_LINKER_FILE_SUFFIX-non-valid-target.cmake create mode 100644 Tests/RunCMake/GeneratorExpression/TARGET_PROPERTY-INCLUDE_DIRECTORIES.cmake create mode 100644 Tests/RunCMake/GeneratorExpression/ValidTarget-TARGET_PDB_FILE_BASE_NAME-check.cmake create mode 100644 Tests/RunCMake/GeneratorExpression/ValidTarget-TARGET_PDB_FILE_BASE_NAME.cmake copy Tests/RunCMake/{while/MissingArgument-result.txt => MSVCRuntimeLibrary/CMP0091-NEW-result.txt} (100%) create mode 100644 Tests/RunCMake/MSVCRuntimeLibrary/CMP0091-NEW-stderr.txt create mode 100644 Tests/RunCMake/MSVCRuntimeLibrary/CMP0091-NEW.cmake create mode 100644 Tests/RunCMake/MSVCRuntimeLibrary/CMP0091-OLD.cmake create mode 100644 Tests/RunCMake/MSVCRuntimeLibrary/CMP0091-WARN.cmake create mode 100644 Tests/RunCMake/MSVCRuntimeLibrary/CMP0091-common.cmake create mode 100644 Tests/RunCMake/MSVCRuntimeLibrary/CMakeLists.txt create mode 100644 Tests/RunCMake/MSVCRuntimeLibrary/RunCMakeTest.cmake copy Tests/RunCMake/{target_link_libraries => MSVCRuntimeLibrary}/empty.c (100%) create mode 100644 Tests/RunCMake/MSVCWarningFlags/CMP0092-NEW.cmake create mode 100644 Tests/RunCMake/MSVCWarningFlags/CMP0092-OLD.cmake create mode 100644 Tests/RunCMake/MSVCWarningFlags/CMP0092-WARN.cmake create mode 100644 Tests/RunCMake/MSVCWarningFlags/CMP0092-common.cmake create mode 100644 Tests/RunCMake/MSVCWarningFlags/CMakeLists.txt create mode 100644 Tests/RunCMake/MSVCWarningFlags/RunCMakeTest.cmake create mode 100644 Tests/RunCMake/MetaCompileFeatures/C.cmake create mode 100644 Tests/RunCMake/MetaCompileFeatures/CMakeLists.txt create mode 100644 Tests/RunCMake/MetaCompileFeatures/CXX.cmake create mode 100644 Tests/RunCMake/MetaCompileFeatures/RunCMakeTest.cmake copy Tests/{Wrapping/vtkIncluded.cxx => RunCMake/MetaCompileFeatures/a.c} (100%) copy Tests/{Wrapping/vtkIncluded.cxx => RunCMake/MetaCompileFeatures/a.cxx} (100%) create mode 100644 Tests/RunCMake/Ninja/CustomCommandJobPool-check.cmake create mode 100644 Tests/RunCMake/Ninja/CustomCommandJobPool.cmake copy Tests/RunCMake/{while/MissingArgument-result.txt => Ninja/JobPoolUsesTerminal-result.txt} (100%) create mode 100644 Tests/RunCMake/Ninja/JobPoolUsesTerminal-stderr.txt create mode 100644 Tests/RunCMake/Ninja/JobPoolUsesTerminal.cmake create mode 100644 Tests/RunCMake/ObjectLibrary/CheckTargetObjects.cmake create mode 100644 Tests/RunCMake/ObjectLibrary/check_object_files.cmake create mode 100644 Tests/RunCMake/ParseImplicitIncludeInfo/data/aix-C-XLClang-16.1.0.1.input create mode 100644 Tests/RunCMake/ParseImplicitIncludeInfo/data/aix-C-XLClang-16.1.0.1.output create mode 100644 Tests/RunCMake/ParseImplicitIncludeInfo/data/aix-CXX-XLClang-16.1.0.1.input create mode 100644 Tests/RunCMake/ParseImplicitIncludeInfo/data/aix-CXX-XLClang-16.1.0.1.output create mode 100644 Tests/RunCMake/Swift/E.swift copy Tests/RunCMake/{while/MissingArgument-result.txt => Swift/Win32ExecutableDisallowed-result.txt} (100%) create mode 100644 Tests/RunCMake/Swift/Win32ExecutableDisallowed-stderr.txt create mode 100644 Tests/RunCMake/Swift/Win32ExecutableDisallowed.cmake create mode 100644 Tests/RunCMake/VS10Project/RuntimeLibrary-check.cmake create mode 100644 Tests/RunCMake/VS10Project/RuntimeLibrary.cmake create mode 100644 Tests/RunCMake/VS10Project/VsJustMyCode-check.cmake create mode 100644 Tests/RunCMake/VS10Project/VsJustMyCode.cmake create mode 100644 Tests/RunCMake/VS10Project/VsPackageReferences-check.cmake create mode 100644 Tests/RunCMake/VS10Project/VsPackageReferences.cmake create mode 100644 Tests/RunCMake/VS10Project/VsProjectImport-check.cmake create mode 100644 Tests/RunCMake/VS10Project/VsProjectImport.cmake copy Tests/RunCMake/{target_link_libraries => VS10Project}/empty.c (100%) copy Tests/{Wrapping/vtkIncluded.cxx => RunCMake/VS10Project/empty.cxx} (100%) create mode 100644 Tests/RunCMake/cmake_parse_arguments/KeyWordsMissingValues.cmake create mode 100644 Tests/RunCMake/ctest_update/CMakeLists.txt.in create mode 100644 Tests/RunCMake/ctest_update/RunCMakeTest.cmake create mode 100644 Tests/RunCMake/ctest_update/UpdateActualVersion-check.cmake create mode 100644 Tests/RunCMake/ctest_update/UpdateChangeId-check.cmake create mode 100644 Tests/RunCMake/ctest_update/test.cmake.in copy Tests/RunCMake/{while/MissingArgument-result.txt => execute_process/EchoCommand-result.txt} (100%) create mode 100644 Tests/RunCMake/execute_process/EchoCommand-stderr.txt create mode 100644 Tests/RunCMake/execute_process/EchoCommand-stdout.txt create mode 100644 Tests/RunCMake/execute_process/EchoCommand.cmake copy Tests/RunCMake/{while/MissingArgument-result.txt => execute_process/EchoCommand2-result.txt} (100%) create mode 100644 Tests/RunCMake/execute_process/EchoCommand2-stderr.txt create mode 100644 Tests/RunCMake/execute_process/EchoCommand2-stdout.txt copy Tests/RunCMake/{while/MissingArgument-result.txt => execute_process/EchoCommand3-result.txt} (100%) create mode 100644 Tests/RunCMake/execute_process/EchoCommand3-stderr.txt create mode 100644 Tests/RunCMake/file/INSTALL-FOLLOW_SYMLINK_CHAIN.cmake create mode 100644 Tests/RunCMake/file/REMOVE-empty-stderr.txt create mode 100644 Tests/RunCMake/file/REMOVE-empty.cmake create mode 100644 Tests/RunCMake/install/obj2.h copy Tests/RunCMake/{while/MissingArgument-result.txt => list/POP_BACK-NoArgs-result.txt} (100%) create mode 100644 Tests/RunCMake/list/POP_BACK-NoArgs-stderr.txt create mode 100644 Tests/RunCMake/list/POP_BACK-NoArgs.cmake create mode 100644 Tests/RunCMake/list/POP_BACK.cmake copy Tests/RunCMake/{while/MissingArgument-result.txt => list/POP_FRONT-NoArgs-result.txt} (100%) create mode 100644 Tests/RunCMake/list/POP_FRONT-NoArgs-stderr.txt create mode 100644 Tests/RunCMake/list/POP_FRONT-NoArgs.cmake create mode 100644 Tests/RunCMake/list/POP_FRONT.cmake copy Tests/RunCMake/{while/MissingArgument-result.txt => list/PREPEND-NoArgs-result.txt} (100%) create mode 100644 Tests/RunCMake/list/PREPEND-NoArgs-stderr.txt create mode 100644 Tests/RunCMake/list/PREPEND-NoArgs.cmake create mode 100644 Tests/RunCMake/list/PREPEND.cmake create mode 100644 Tests/RunCMake/list/REMOVE_DUPLICATES-PreserveOrder.cmake create mode 100644 Tests/RunCMake/message/message-all-loglevels.cmake create mode 100644 Tests/RunCMake/message/message-loglevel-debug-stderr.txt create mode 100644 Tests/RunCMake/message/message-loglevel-debug-stdout.txt create mode 100644 Tests/RunCMake/message/message-loglevel-default-stderr.txt create mode 100644 Tests/RunCMake/message/message-loglevel-default-stdout.txt copy Tests/RunCMake/{while/MissingArgument-result.txt => message/message-loglevel-invalid-result.txt} (100%) create mode 100644 Tests/RunCMake/message/message-loglevel-invalid-stderr.txt create mode 100644 Tests/RunCMake/message/message-loglevel-notice-stderr.txt create mode 100644 Tests/RunCMake/message/message-loglevel-status-stderr.txt create mode 100644 Tests/RunCMake/message/message-loglevel-status-stdout.txt create mode 100644 Tests/RunCMake/message/message-loglevel-trace-stderr.txt create mode 100644 Tests/RunCMake/message/message-loglevel-trace-stdout.txt create mode 100644 Tests/RunCMake/message/message-loglevel-verbose-stderr.txt create mode 100644 Tests/RunCMake/message/message-loglevel-verbose-stdout.txt create mode 100644 Tests/RunCMake/message/message-loglevel-warning-stderr.txt create mode 100644 Tests/RunCMake/project_injected/CMP0048-WARN-stderr.txt create mode 100644 Tests/RunCMake/pseudo_emulator_custom_command_arg.c create mode 100644 Tests/RunCMake/string/Repeat.cmake copy Tests/RunCMake/{while/MissingArgument-result.txt => string/RepeatNegativeCount-result.txt} (100%) create mode 100644 Tests/RunCMake/string/RepeatNegativeCount-stderr.txt create mode 100644 Tests/RunCMake/string/RepeatNegativeCount.cmake copy Tests/RunCMake/{while/MissingArgument-result.txt => string/RepeatNoArgs-result.txt} (100%) create mode 100644 Tests/RunCMake/string/RepeatNoArgs-stderr.txt create mode 100644 Tests/RunCMake/string/RepeatNoArgs.cmake create mode 100644 Tests/UseSWIG/AlternateLibraryName/CMakeLists.txt create mode 100755 Utilities/Release/push.bash delete mode 100644 Utilities/Release/upload_release.cmake create mode 100755 Utilities/Scripts/update-zstd.bash create mode 100644 Utilities/cm_zstd.h delete mode 100644 Utilities/cmcompress/CMakeLists.txt delete mode 100644 Utilities/cmcompress/Copyright.txt delete mode 100644 Utilities/cmcompress/cmcompress.c delete mode 100644 Utilities/cmcompress/cmcompress.h delete mode 100644 Utilities/cmcompress/compress.c.original create mode 100644 Utilities/cmcurl/lib/altsvc.c create mode 100644 Utilities/cmcurl/lib/altsvc.h create mode 100644 Utilities/cmcurl/lib/curl_get_line.c create mode 100644 Utilities/cmcurl/lib/curl_get_line.h delete mode 100644 Utilities/cmcurl/lib/pipeline.c delete mode 100644 Utilities/cmcurl/lib/pipeline.h delete mode 100644 Utilities/cmcurl/lib/vtls/axtls.c delete mode 100644 Utilities/cmcurl/lib/vtls/axtls.h delete mode 100644 Utilities/cmcurl/lib/vtls/darwinssl.c delete mode 100644 Utilities/cmcurl/lib/vtls/darwinssl.h create mode 100644 Utilities/cmcurl/lib/vtls/sectransp.c create mode 100644 Utilities/cmcurl/lib/vtls/sectransp.h copy Utilities/{cmvssetup => cmzstd}/.gitattributes (100%) create mode 100644 Utilities/cmzstd/CMakeLists.txt create mode 100644 Utilities/cmzstd/LICENSE create mode 100644 Utilities/cmzstd/README.md create mode 100644 Utilities/cmzstd/lib/common/bitstream.h create mode 100644 Utilities/cmzstd/lib/common/compiler.h create mode 100644 Utilities/cmzstd/lib/common/cpu.h create mode 100644 Utilities/cmzstd/lib/common/debug.c create mode 100644 Utilities/cmzstd/lib/common/debug.h create mode 100644 Utilities/cmzstd/lib/common/entropy_common.c create mode 100644 Utilities/cmzstd/lib/common/error_private.c create mode 100644 Utilities/cmzstd/lib/common/error_private.h create mode 100644 Utilities/cmzstd/lib/common/fse.h create mode 100644 Utilities/cmzstd/lib/common/fse_decompress.c create mode 100644 Utilities/cmzstd/lib/common/huf.h create mode 100644 Utilities/cmzstd/lib/common/mem.h create mode 100644 Utilities/cmzstd/lib/common/pool.c create mode 100644 Utilities/cmzstd/lib/common/pool.h create mode 100644 Utilities/cmzstd/lib/common/threading.c create mode 100644 Utilities/cmzstd/lib/common/threading.h create mode 100644 Utilities/cmzstd/lib/common/xxhash.c create mode 100644 Utilities/cmzstd/lib/common/xxhash.h create mode 100644 Utilities/cmzstd/lib/common/zstd_common.c create mode 100644 Utilities/cmzstd/lib/common/zstd_errors.h create mode 100644 Utilities/cmzstd/lib/common/zstd_internal.h create mode 100644 Utilities/cmzstd/lib/compress/fse_compress.c create mode 100644 Utilities/cmzstd/lib/compress/hist.c create mode 100644 Utilities/cmzstd/lib/compress/hist.h create mode 100644 Utilities/cmzstd/lib/compress/huf_compress.c create mode 100644 Utilities/cmzstd/lib/compress/zstd_compress.c create mode 100644 Utilities/cmzstd/lib/compress/zstd_compress_internal.h create mode 100644 Utilities/cmzstd/lib/compress/zstd_double_fast.c create mode 100644 Utilities/cmzstd/lib/compress/zstd_double_fast.h create mode 100644 Utilities/cmzstd/lib/compress/zstd_fast.c create mode 100644 Utilities/cmzstd/lib/compress/zstd_fast.h create mode 100644 Utilities/cmzstd/lib/compress/zstd_lazy.c create mode 100644 Utilities/cmzstd/lib/compress/zstd_lazy.h create mode 100644 Utilities/cmzstd/lib/compress/zstd_ldm.c create mode 100644 Utilities/cmzstd/lib/compress/zstd_ldm.h create mode 100644 Utilities/cmzstd/lib/compress/zstd_opt.c create mode 100644 Utilities/cmzstd/lib/compress/zstd_opt.h create mode 100644 Utilities/cmzstd/lib/compress/zstdmt_compress.c create mode 100644 Utilities/cmzstd/lib/compress/zstdmt_compress.h create mode 100644 Utilities/cmzstd/lib/decompress/huf_decompress.c create mode 100644 Utilities/cmzstd/lib/decompress/zstd_ddict.c create mode 100644 Utilities/cmzstd/lib/decompress/zstd_ddict.h create mode 100644 Utilities/cmzstd/lib/decompress/zstd_decompress.c create mode 100644 Utilities/cmzstd/lib/decompress/zstd_decompress_block.c create mode 100644 Utilities/cmzstd/lib/decompress/zstd_decompress_block.h create mode 100644 Utilities/cmzstd/lib/decompress/zstd_decompress_internal.h create mode 100644 Utilities/cmzstd/lib/deprecated/zbuff.h create mode 100644 Utilities/cmzstd/lib/deprecated/zbuff_common.c create mode 100644 Utilities/cmzstd/lib/deprecated/zbuff_compress.c create mode 100644 Utilities/cmzstd/lib/deprecated/zbuff_decompress.c create mode 100644 Utilities/cmzstd/lib/dictBuilder/cover.c create mode 100644 Utilities/cmzstd/lib/dictBuilder/cover.h create mode 100644 Utilities/cmzstd/lib/dictBuilder/divsufsort.c create mode 100644 Utilities/cmzstd/lib/dictBuilder/divsufsort.h create mode 100644 Utilities/cmzstd/lib/dictBuilder/fastcover.c create mode 100644 Utilities/cmzstd/lib/dictBuilder/zdict.c create mode 100644 Utilities/cmzstd/lib/dictBuilder/zdict.h create mode 100644 Utilities/cmzstd/lib/zstd.h hooks/post-receive -- CMake From kwrobot at kitware.com Tue Jun 4 12:13:06 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Tue, 4 Jun 2019 12:13:06 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.14.5-1259-g0a68c30 Message-ID: <20190604161306.612F2102BCE@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 0a68c30b81020dde3f149d9b02a598925d746d31 (commit) via 0da2c35d6bf0741ce91c682414b56fdca83160d8 (commit) from 98004612f6b5c613d49dde85549d0d556e91a60d (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0a68c30b81020dde3f149d9b02a598925d746d31 commit 0a68c30b81020dde3f149d9b02a598925d746d31 Merge: 9800461 0da2c35 Author: Brad King AuthorDate: Tue Jun 4 16:09:33 2019 +0000 Commit: Kitware Robot CommitDate: Tue Jun 4 12:09:41 2019 -0400 Merge topic 'GetPrerequisites-variable-typo' 0da2c35d6b GetPrerequisites: fix regression in gp_append_unique Acked-by: Kitware Robot Merge-request: !3421 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0da2c35d6bf0741ce91c682414b56fdca83160d8 commit 0da2c35d6bf0741ce91c682414b56fdca83160d8 Author: Ben Boeckel AuthorDate: Tue Jun 4 11:55:56 2019 -0400 Commit: Brad King CommitDate: Tue Jun 4 12:00:06 2019 -0400 GetPrerequisites: fix regression in gp_append_unique The `item` variable was the loop variable in the old code prior to commit 3dfc8b9bd6 (GetPrerequisites: use if(IN_LIST) instead of foreach, 2019-05-09). The function argument `value` should be used instead. diff --git a/Modules/GetPrerequisites.cmake b/Modules/GetPrerequisites.cmake index 06655a4..5be4676 100644 --- a/Modules/GetPrerequisites.cmake +++ b/Modules/GetPrerequisites.cmake @@ -173,7 +173,7 @@ cmake_policy(PUSH) cmake_policy(SET CMP0057 NEW) # if IN_LIST function(gp_append_unique list_var value) - if(NOT item IN_LIST ${list_var}) + if(NOT value IN_LIST ${list_var}) set(${list_var} ${${list_var}} "${value}" PARENT_SCOPE) endif() endfunction() ----------------------------------------------------------------------- Summary of changes: Modules/GetPrerequisites.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From kwrobot at kitware.com Tue Jun 4 12:33:04 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Tue, 4 Jun 2019 12:33:04 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.14.5-1264-g6a78bdb Message-ID: <20190604163304.8758C10305E@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 6a78bdbb06e27a5474bf3262d4dcf7459a8627f9 (commit) via a4231943117f5ba3dd0fdc6c8b1824334162b69f (commit) via ac16778a129fc1076d41490919b63a207591ebf1 (commit) via c0f00079a9d00539b0ca132e8be8fe63b1eed65c (commit) via 0eeb3690d1a65fbc864960e59f3cd43bcdae3a9a (commit) from 0a68c30b81020dde3f149d9b02a598925d746d31 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6a78bdbb06e27a5474bf3262d4dcf7459a8627f9 commit 6a78bdbb06e27a5474bf3262d4dcf7459a8627f9 Merge: ac16778 a423194 Author: Brad King AuthorDate: Tue Jun 4 12:29:55 2019 -0400 Commit: Brad King CommitDate: Tue Jun 4 12:29:55 2019 -0400 Merge branch 'release-3.15' https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ac16778a129fc1076d41490919b63a207591ebf1 commit ac16778a129fc1076d41490919b63a207591ebf1 Merge: 0a68c30 c0f0007 Author: Brad King AuthorDate: Tue Jun 4 16:28:07 2019 +0000 Commit: Kitware Robot CommitDate: Tue Jun 4 12:28:14 2019 -0400 Merge topic 'ctest_xml_tweaks' c0f00079a9 Tests: Fix RunCMake.ctest_update test to not require GIT_EXECUTABLE Acked-by: Kitware Robot Merge-request: !3423 ----------------------------------------------------------------------- Summary of changes: Tests/RunCMake/CMakeLists.txt | 2 +- Tests/RunCMake/ctest_update/test.cmake.in | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) hooks/post-receive -- CMake From kwrobot at kitware.com Tue Jun 4 12:33:04 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Tue, 4 Jun 2019 12:33:04 -0400 (EDT) Subject: [Cmake-commits] CMake branch, release, updated. v3.14.5-1259-ga423194 Message-ID: <20190604163304.AF80210AB63@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, release has been updated via a4231943117f5ba3dd0fdc6c8b1824334162b69f (commit) via c0f00079a9d00539b0ca132e8be8fe63b1eed65c (commit) via 0eeb3690d1a65fbc864960e59f3cd43bcdae3a9a (commit) via 0da2c35d6bf0741ce91c682414b56fdca83160d8 (commit) from 9d78ce02933cd913af3da66a23e8ada09db89e3e (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- ----------------------------------------------------------------------- Summary of changes: Modules/GetPrerequisites.cmake | 2 +- Tests/RunCMake/CMakeLists.txt | 2 +- Tests/RunCMake/ctest_update/test.cmake.in | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) hooks/post-receive -- CMake From kwrobot at kitware.com Tue Jun 4 14:23:04 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Tue, 4 Jun 2019 14:23:04 -0400 (EDT) Subject: [Cmake-commits] CMake annotated tag, v3.15.0-rc1, created. v3.15.0-rc1 Message-ID: <20190604182304.67023102CDB@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The annotated tag, v3.15.0-rc1 has been created at 3dc267d3824e0faacd3d80710d7c93003fbf4267 (tag) tagging a4231943117f5ba3dd0fdc6c8b1824334162b69f (commit) replaces v3.14.5 tagged by Brad King on Tue Jun 4 13:41:01 2019 -0400 - Log ----------------------------------------------------------------- CMake 3.15.0-rc1 -----BEGIN PGP SIGNATURE----- iQJKBAABCgA0FiEExsJlMku+vcNQtRPQLSzvEDSSFoQFAlz2rS0WHGJyYWQua2lu Z0BraXR3YXJlLmNvbQAKCRAtLO8QNJIWhPnFEACwIYCjEycWiCQCs+kZ2TPZJRYn qusBrv4/OQKqv3RC8/+ZoeolnT1jQMJUqLcfVEa81lUeDfXHX41AW8Wcrwko+eQH cFEvlFqcN+sVn+ReG47gK376++9KDhs8NIam9/f4h0ZGsIhRGDFHSztjYVY5izW+ S8kQrCohET9U4txKiFfYVoniJ+3mcZzvbgRgWu5lj8fDQs1ahyGDt1wuiNMW8Zvb xqi6HluuuIigTy7t6y2EV94K+c2vuoaqnAk0yxzyXqCSnQJDgvifrek70F8hMJiI BOMKHxemTvGygkMsTmN511fRae/m5Dbeg38lqMpNar0KNvB4MZKJela3xm7DisAz RZECLqej6SgtVqOjN5DNE0hFhc0Isau4ft5YNNk4oPO1Hb6Z3s0Q4IbmkNdwOEpR koskvhpdORKXulndYxz5lUGo1x88cVY1xdp3LVDsnzNezrmF40AFSgNLgiIlSaba bTOtdab3ebFFmbRQO8zdcLpHDVQemzHKjai7qRRZ9pvi7y9kkxNyMSNpe15Xoe3j RZRc1QlILVi3/BfxB4Y5sGc2bXXxcK01qdwDfZkt+Hesg75fVRJYvDEp0IikviWr 7GD+0a6wIg9YdaR4X2QxPPoJfcjDa25YglDdb0A9IGJiNytgoDBDChJF7hA27JUa ywcccUWSE0jO4PkuaQ== =vzsl -----END PGP SIGNATURE----- Albert Astals Cid (2): Remove return from void function Delete some default constructors and assignment operators Alex Turbov (6): list: add sub-commands PREPEND, POP_BACK, POP_FRONT cmake: Fix missed `return` statement when CLI errors found string: introduce `REPEAT` sub-command cmSystemTools: Remove unused message-related code, simplify logic message(): Add support for log levels message(): Minor code modernization Alexander Neumann (1): FindZLIB: Add more zlib library names Alexandru Croitor (6): Autogen: Fallback on internal qrc parser when RCC isn't built yet Autogen: Fix deadlock when uv_spawn() fails while trying to run moc iOS: Allow specifying CMAKE_MACOSX_BUNDLE in toolchain file iOS: Allow setting multiple CMAKE_FIND_ROOT_PATH values iOS: Only look for packages in the provided CMAKE_FIND_ROOT_PATHs iOS: Only set the CMAKE_FIND_ROOT_PATH_MODE_* variables when not defined Andrei Lebedev (1): FindPostgreSQL: Find debug lib, imported configs Artur Ryt (12): Prefer front/back/data over dereferencing begin/rbegin iter cmAlgorithms: Make cmRange advance/retreat safe for rvalues Modernize: Use ranged for-loops when possible cmCursesMainForm: Modernize with STL and ranged-for loops cmCursesMainForm: Fix lambda return type deducing warning Modernize: C-arrays and loops over them cmFileCommand: Refactor HandleCMakePathCommand cmAlgorithms: Refactor cmRemoveDuplicates cmcmd: Pass args vector by const& cmcmd: Modernize for loops with cmMakeRange Modernize: Prefer .substr in place of .c_str() + int Modernize: Enable modernize-raw-string-literal in clang-tidy Avraham Shukron (1): INTERFACE Target: allow (PUBLIC/PRIVATE)_HEADER properties Axel Huebl (1): FindPNG: Fix definitions on imported target Bartosz Kosiorek (28): cmGlobalGenerator: Remove unused code cmakemain: Remove ignored --use-stderr option from command line help cmGlobalGenerator: Change case of methods from GeneratedMakeCommand struct cmGlobalGenerator: Optimize Printable() method from GeneratedMakeCommand cmake: Teach --build mode to support multiple targets cmake: Reformat '--parallel' and '--verbose' options in help cmake: add short version of '--target ...' option cmake: Upgrade 'cmake -E' commands description ExternalProject: Re-run 'git clone' when GIT_REMOTE_NAME changes ExternalProject: Simplify generated 'git clone' scripts ExternalProject: Drop unnecessary 'git submodule init' ExternalProject: Extend documentation about GIT_TAG usage cmake: tar: Display warning when no files provided during archive creation Help: Update 'tar' documentation with supported arguments cmake: Don't interrupt archive creation if unable to read a file. ExternalProject: Optimize git commands ExternalProject: Optimize Mercurial commands cmake: tar: Parse 'cmake -E tar' arguments Help: Improve documentation links and formatting Help: Improve Cache documentation Help: Improve documentation formating Help: Improve formatting of Help documentation Modules: Update documentation formatting Help: Improve description of modules cmMakefile: Enforce explicit use of project() command cmake: Teach cmake -E tar command, Zstandard compression cmake: tar: Allow selective extracting and listing of archives cmListFileCache: When missing ending ) print starting line instead of last one Ben Boeckel (18): cmServerConnection: make return conversions explicit Help: note that Ninja also uses OBJECT_OUTPUTS ninja: make dyndep generation language aware ninja: pass language to cmake_ninja_depends ninja: do not assume explicit preprocessing uses that output cmNinjaTargetGenerator: remove "preprocessed" mentions in dyndep ninja: name dyndep internal files using the object file cmake_ninja_dyndep: don't duplicate slashes cmNinjaTargetGenerator: use a different depfile for preprocessing testUTF8: comment why sequences are invalid testUTF8: add more test cases cm_utf8: reject UTF-16 surrogate half codepoints cm_utf8: reject codepoints above 0x10FFFF cm_utf8: add an is_valid function GetPrerequisites: use if(IN_LIST) instead of foreach ARMClang: fix policy manipulation in the compiler module Help/CMAKE_JOB_POOL_LINK: match the header line with the variable GetPrerequisites: fix regression in gp_append_unique Bill Hoffman (1): execute_process: Add option to echo command lines Bob Weinand (1): Protobuf: Fix generated source path with PROTOBUF_GENERATE_CPP_APPEND_PATH OFF Brad King (550): Merge branch 'release-3.14' Begin post-3.14 development Tests: Add a way to configure custom options for FortranModules test Merge topic 'vs-csharp-nowarn-numbers' Merge topic 'xcode-stdlib-flags' Merge topic 'FindHDF5-cleanup' Merge topic 'cpack-ifw-error-wording' Merge branch 'release-3.14' Merge topic 'test-FortranModules-tweak' Merge topic 'findcups' Merge topic 'mingw-ar-suffix' Merge topic 'doc-object-library-link' Merge branch 'release-3.14' Merge topic 'prefer-front-back-over-begin-rbegin' Merge topic 'runsinglecommand' Merge topic 'getreqdef' Merge topic 'message-stdstring' Merge topic 'fix-exclude-dir-with-iface' Merge topic 'ghs-updates' Merge topic 'ghs-relnotes' Merge branch 'release-3.14' Merge topic 'modernize-for-loops' Merge topic 'ctest-exit-code-int64' Merge topic 'FindOctave-interp-target' Merge topic 'doc-if-legacy' Merge topic 'FindMatlab-version-empty' Merge branch 'release-3.14' Merge topic 'cmCTestRunTest-compress' Merge topic 'modernize-cmCursesMainForm' Merge topic 'progress-stdstring' Merge topic 'clangcl-fixes' Merge branch 'upstream-KWSys' into update-kwsys Tests: Disable test that builds KWSys if not also building CMake Merge topic 'genex-GENEX_EVAL-fix-recursion' Merge branch 'release-3.14' Merge topic 'cmcurses-fix-solaris-lambda-warning' Merge topic 'systools-stdstring2' Merge topic 'names' Tests: Fix Module.WriteCompilerDetectionHeader for Intel on Windows Merge topic 'update-kwsys' Merge topic 'fix-pointer-truncation' Merge topic 'fix-legacy-implicit-includes' Merge topic 'fortran-submodule-names' Merge branch 'release-3.14' Merge branch 'upstream-KWSys' into update-kwsys Merge topic 'autogen_refactor_rerun_tests' Merge topic 'try_compile-expand-compile-defs' Merge topic 'vs2017-sdk81' Merge topic 'FindLibXml2' Merge branch 'release-3.14' Merge topic 'tests-intel-fixup' Merge branch 'release-3.14' Merge topic 'update-kwsys' Merge topic 'ninja-swift-library-name' Merge topic 'systools-cleanup' Merge topic 'autogen_test_fix' Merge topic 'delete_copy_assign' Merge topic 'externalproject_docs' Merge topic 'get_filename_component_docs' Merge branch 'release-3.14' Merge topic 'require-xcode-5' Merge topic 'file_symlink_docs' Merge branch 'release-3.14' README: Explain how to bootstrap via MSYS2 on Windows Merge topic 'FindBoost-layout-tagged' Merge topic 'fix-legacy-implicit-includes' Merge topic 'modernize-for-loops-c-arrays' Merge branch 'release-3.14' README: Suggest bootstrapping out-of-source for development Merge topic 'asm-no-slash-question' Merge topic 'vs-win-sdk' Merge topic 'autogen_cache_binary_checks' Merge branch 'release-3.14' Merge topic 'once-is-enough' Merge topic 'ninja-swift-partial' Merge topic 'optimize-cmuuid-ctor' Merge topic 'configurefile-stdstring' Merge topic 'list-prepend-and-pop-subcommands' Merge topic 'cray-cleanup' Add deprecation warnings for policies CMP0066 and below Remove now-unused code once used for MIPSpro on IRIX Use shorter names in internal TARGET_PROPERTY expressions Merge topic 'fix-implicit-includes-fortran' Merge topic 'remove-exclude-from-all-warning' Merge topic 'link-options' Merge topic 'check_lang_source_runs_output' Merge topic 'docs_try_commands' Merge topic 'releasenotes_arch_independent' Merge branch 'release-3.14' Merge topic 'systools-stdstring3' Merge topic 'swift-partials' Merge topic 'error-consolidate' Merge topic 'cmrange-improvements' Merge topic 'deprecate-policy-old' Merge topic 'drop-MIPSpro' Merge topic 'return-explicit-conversion' XL: Look for CreateExportList only on AIX XL: Revert "Recognize compilers identified by __ibmxl__" XLClang: Add policy CMP0089 to present as XL for compatibility XLClang: Extract compiler implicit include directories Utilities: Suppress warnings in third-party code when using XLClang libuv: fix atomic ops compilation with xlclang jsoncpp: Fix include order for build within CMake Merge branch 'upstream-KWSys' into update-kwsys Merge topic 'gt-shorter-unique-names' Merge topic 'qcc-asm-detection' Merge topic 'doc-ctest-build-and-test-summary' Merge branch 'release-3.14' Merge topic 'autogen_headers_at_configure_time' Merge topic 'add-xlclang' Merge topic 'update-kwsys' Merge topic 'vs-wince-no-deploy' Merge topic 'cpack-rpm++' Merge topic 'restore-min-cmake-3.1' Merge topic 'vs-llvm-extension' Merge topic 'include_external_msproject-exclude-from-all' Merge topic 'FindOctave-remove' Merge topic 'docs-rpath-origin-apple' Merge topic 'cmake_role-vs-fix' Merge branch 'release-3.14' Merge topic 'ctest-clean-compress' Merge topic 'autogen_variable_names' Merge topic 'ninja-dyndep-lang-aware' Merge branch 'backport-check-std-size-cbegin-cend' Merge topic 'FindThreads-revert-libc-check' Merge branch 'release-3.14' Merge topic 'check-std-size-cbegin-cend' Merge branch 'release-3.14' WCDH: Restore definition for _COMPILER_IS_MIPSpro Merge topic 'features-from-default-standard' Merge topic 'optimize_ge_node_lookup' Merge topic 'refactor-handle-path-command' Merge topic 'doc-EXPORT_NAME' Merge topic 'doc-xref-EXPORT_NAME' Merge topic 'ppc64-toc-overflow' Merge topic 'drop-MIPSpro' Merge topic 'processor_count_linux_containers' Merge topic 'doc-install-internal-xref' Merge topic 'findjni-paths' Merge topic 'vs2019' Merge topic 'ExternalProject-fix-log-in-custom-stamp' Merge topic 'cuda_device_link_handle_frameworks' Merge branch 'release-3.14' Merge branch 'release-3.14' Merge topic 'vs-fortran-rc' Merge topic 'FindPython-NumPy-fix-include-dir' Merge branch 'release-3.14' Merge topic 'llvm-rc' Merge topic 'fix_autorcc_for_qt6' Merge topic 'restore_broken_curses_gui' Merge topic 'ios-variable' Merge topic 'ios-docs' Merge topic 'docs-install-destinations' Merge branch 'release-3.14' Merge topic 'issue-18883-support-for-multiple-targets' Merge topic 'android-versioned-soname' Merge topic 'fix-override' Merge topic 'vs-no-stamp-messages' Merge topic 'docs-xcode-schemes' Merge branch 'release-3.14' Merge topic 'vs-explicit-newline' Merge branch 'release-3.14' Merge topic 'doc-fix' Utilities/Release: Update for using Windows 10 SDK Utilities/Release: Update to Qt 5.12 on Windows builds Merge topic 'cxx-checks-warning-match' Merge topic 'install-no-imported-global' Merge branch 'release-3.14' Merge branch 'release-3.14' Merge topic 'win-rel-qt5.12' Merge topic 'find-pthread-update' Merge topic 'enable_testing' Merge topic 'cmalgorithm-modernize-cmremoveduplicates' Merge topic 'optimize-properties-processing' Merge topic 'FindSWIG-advanced-exe' Tests: Generalize GeneratorExpression MSYS path conversion workaround Merge topic 'shell_path' Merge topic 'FindBoost-dyn-link' Merge topic 'wix-cmake-downgrade-fix' Merge topic 'revert-vs-msbuild-arch' Merge branch 'release-3.13' Merge branch 'release-3.14' Merge topic 'ignore-json-deprecated-warnings' Merge topic 'cuda_compiler_generator_expressions' Merge topic 'update-documentation' zstd: add script to import zstd from upstream Merge branch 'upstream-zstd' into import-zstd zstd: Add CMake build system CMake: Enable use of zstd in libarchive Merge branch 'release-3.14' Merge topic 'short-commands' Merge topic 'xcodescheme' Merge topic 'import-zstd' Merge topic 'string_scopes' Merge topic 'refactor_cmfilecopier' cmake-gui: Drop code not needed with current required CMake version Tests: Run FindGTK2 tests only when explicitly enabled zstd: Disable BMI2 instructions for build within CMake Merge topic 'cmake-gui-unused-code' Merge topic 'test-FindGTK2-explicit' Merge topic 'vs2019-wow64' Merge topic 'FindPython-ensure-correct-architecture-selected' Merge topic 'find_program-windows-share' Merge branch 'release-3.14' Merge topic 'ninja-dyndep-touchups' Merge topic 'export-package-default-off' Merge topic 'import-zstd' Merge topic 'release_note_for_cuda_compiler_generator_expressions' Merge topic 'FindGLEW-updates' Merge topic 'ExternalProject-optimize-git' Merge topic 'utf8-fixes' Merge topic 'cray-bad-compiler-option' Merge topic 'environment-modules' Merge topic 'file_time_comparison' Merge topic 'FindBLAS-mklroot' Merge topic 'CheckTypeSize-decl-warning' Merge topic 'is-valid-utf8' Merge topic 'xcodegen-use-std-string' Replace use of CollapseCombinedPath with CollapseFullPath cmSystemTools: Drop unused CollapseCombinedPath method GHS: Fix include-what-you-use and clang-tidy diagnostics Merge topic 'dedup-path-normalization' Merge topic 'ExternalProject-optimize-vcs' Merge topic 'eclipse-interface-lib' Merge topic 'doc-cmp0082' Merge topic 'armcc-compiler-id' Merge branch 'release-3.14' Merge topic 'ctest-devirtualize-handlers' Merge topic 'Find-prefix-paths' Merge topic 'fix-range-tests' Merge topic 'timeout' Merge topic 'dont_do_compiler_feature_checks_for_version_with_no_features' update-third-party: update from upstream Merge branch 'upstream-KWSys' into update-kwsys Tests: Run GHS tests in a separate ctest process Merge topic 'xcodescheme2' Merge topic 'update-kwsys' Merge topic 'cmTarget_micro_fixes' Merge topic 'cmTarget_non_copyable' Merge topic 'ghs-linux' Merge topic 'pkg-get-variable-prefix-path' Merge topic 'ctest_submit_get_buildid' Merge topic 'toolchain-include_directories' Merge branch 'release-3.14' Merge topic 'fix_autogen_deadlock' Merge topic 'cmGlobalGenerator_code_maintenance' Merge topic 'cmTarget_pimpl' Merge topic 'find_dependency-cleanup' Merge topic 'cuda-bracket-output' Merge topic 'FindFontconfig-var-case' Merge topic 'jacoco_parser_crash' Merge branch 'release-3.14' Merge branch 'upstream-KWSys' into update-kwsys Tests: Fix Plugin test for international characters on Windows Merge topic 'update-kwsys' Merge topic 'backport-kwsys-SystemTools-copy-self' Merge topic 'ifw_group_option_parsing' Merge topic 'implicit-includes-autogen' Merge topic 'implicit-includes' Merge branch 'release-3.14' Merge branch 'release-3.14' Merge topic 'allow_aliasing_unkown_targets' Merge topic 'memorize_c_compilers_with_full_standard_support' Merge topic 'cmDepends_tweaks' Merge topic 'fix_doxygen_comments' Merge topic 'utilize-substr' Merge topic 'refactor-cmcmd' Merge topic 'project-include' Merge topic 'nasm-fix' cmLocalGenerator: Factor IPO logic out of AddLanguageFlags VS: Use AddLanguageFlags to de-duplicate CMAKE__FLAGS* lookup Merge topic 'find-dependency-fix-17583' Merge topic 'refactor-lang-flags' Merge topic 'remove_duplicates' Merge topic 'FindPython-handle-virtual-env' Merge topic 'autogen_keywords_class' Merge topic 'modernize-raw-string-literal' Merge topic 'pr.projectbefore' Merge topic 'FindBoost-clang-cl' Merge topic 'FindGLEW-lib-suffixes' Merge topic 'vs2019-redist' Merge topic 'armcc-compiler-id' Merge branch 'release-3.14' Merge topic 'improve-documentation' Merge topic 'if-EXISTS-doc' Help: Remove empty literal block markup in RESOURCE target property cmRST: Fix crash on empty markup block tidy: Fix modernize-raw-string-literal in FreeBSD CPack generator Merge topic 'rst-bad-markup-block' Merge topic 'modernize-raw-string-literal' Merge topic 'tidy-fixes' Merge topic 'ghs_os_dir' Merge topic 'genex-output_name' Merge topic 'autogen_autorcc_no_libuv' Merge branch 'backport-implicit-includes-relative' Merge branch 'backport-cmake-gui-windows-theme' Merge topic 'help_remove_duplicates' Merge topic 'implicit-includes-relative' Merge topic 'cmake-gui-windows-theme' Merge branch 'release-3.14' Merge topic 'argument-parser' Merge topic 'improve-formatting-of-help' Tests: Remove outdated portion of CompileFeatures genex test Merge topic 'meta-feature_only_infer_granular_support' Tests: Teach RunCMake to optionally exclude the source dir argument Tests: Add RunCMake helper to run cmake with options Tests: Fix RunCMake.CommandLine test to use generator with -S and -B Tests: Avoid enabling languages in RunCMake.CommandLine -S and -B cases Tests: Fix Qt*Autogen.GlobalAutogenTarget to use matching generator VS: Fix Fortran runtime library flag map special case for '-' options Merge topic 'test-explicit-dirs' Merge topic 'test-autogen-GAT-generator' cmArgumentParser: Fix -Wcomma warning cpack: Remove unused file with old development notes cmSystemTools: Fix StringToULong to reject negative numbers Merge topic 'xcode-extra-sources' Merge topic 'fix-overlay-icon-windows' Merge branch 'release-3.14' Merge topic 'argument-parser-warning' Merge topic 'cmSystemTools-StringToULong-negatives' Merge topic 'cpack-cleanup' Merge branch 'release-3.14' Merge topic 'iface-headers' Merge topic 'genex-target-prefix-suffix' Merge topic 'memorize_cxx_compilers_with_full_98_support' FindBoost: Add support for MSVC toolset version 14.2 Merge branch 'backport-FindBoost-msvc-toolset-14.2' ctest: drop incremental progress-only messages from build-and-test output Merge topic 'FindBoost-msvc-toolset-14.2' Merge branch 'release-3.14' Merge topic 'ghs_custom' Merge topic 'iar-generalize' Merge topic 'code-cleanup' Merge topic 'ctest-build-and-test-no-progress' Merge topic 'Boost-Gentoo' Merge topic 'vs2019-redist' Merge branch 'release-3.14' Merge topic 'autogen_moc_uic_single_job_queue' Merge topic 'string-repeat' Merge topic 'genex-output_name' Merge topic 'vs-project-import' Merge branch 'upstream-KWSys' into update-kwsys bootstrap: Update for new KWSys configuration option Merge topic 'libglvnd-subdir' Merge branch 'release-3.14' Merge topic 'memorize_msvc_like_compilers_C_support' MSVC: Add abstraction for runtime library selection Merge topic 'msvc-runtime-library' Merge topic 'update-kwsys' Merge topic 'add_xl_cxx14_support' Merge topic 'unique' Tests/FindPackageTest: Tell Git to ignore temporary symlink path Tests: Fix FindPackageTest when path to source has a symlink Merge topic 'test-find_package-resolve-symlinks' SunPro: Record support for C++14 features by SunPro 5.{14,15} MSVC: Do not add /W3 to CMAKE__FLAGS by default execute_process: Manage KWSys Process lifetime with unique_ptr Merge topic 'vs-default-platform' Merge topic 'findqt3-hints-fix' Merge branch 'release-3.14' Merge topic 'msvc-warning-flags' CompileFeatures: Fix hard-coded MSVC C features Merge topic 'sunpro-cxx14-features' MSVC: Document and test behavior of empty MSVC_RUNTIME_LIBRARY Merge branch 'release-3.14' server: deprecate in favor of the file-api cmGeneratorExpressionNode: Simplify static string constant Merge topic 'msvc-c-features' Merge topic 'msvc-runtime-library' Merge topic 'add-execute_process-command-echo' Merge topic 'server-deprecate' Merge topic 'findmpi-msvc-nolibdir' Merge topic 'relax_TARGET_OBJECT_generator_expr' Merge topic 'cmuvstreambuf' Merge topic 'out-of-dir-linking-private-deps' Merge branch 'release-3.13' Merge topic 'FindBoost-fix-fiber-compiler-features' Merge topic 'FindPython-NumPy-fix-dependencies-management' Merge branch 'release-3.14' Merge topic 'memorize_cxx_compilers_with_full_CXX11_support' Merge topic 'iar-binutils' Merge topic 'IAR_6_x_fix' Merge topic 'fix-swiftmix-test-for-xcode-10.2' Merge topic 'code-cleanup-3' Merge topic 'genex-code-cleanup' Merge topic 'cpackrpm.debug' Merge topic 'ios_fixes' Ensure stdin, stdout, and stderr pipes are always open Merge topic 'memorize_cxx_compilers_with_full_CXX14_support' Merge topic 'genex-TARGET_FILE_BASE_NAME-manage-postfix' Merge topic 'DetermineCompilerId-versioned-llvm-for-vs' Merge topic 'jobs-positive-value' Merge topic 'cpack-ifw-stylesheet' Merge topic 'std-pipes-always' Merge topic 'findice-clang-cl' Merge topic 'SWIG' Merge topic 'fix_ios_try_compile' Merge topic 'FindPython-fix-Python_RUNTIME_LIBRARY_DIRS-variable' Merge branch 'release-3.14' Merge topic 'touch-after-ranlib' Merge branch 'release-3.14' Merge topic 'use_intel_mkl_blas_intface_on_osX' Merge topic 'CTestCoverageCollectGCOV-updates' Merge topic 'findmpi-debug' Merge topic 'enforce-explicit-use-of-project' cmUVStreambuf: Initialize all members on construction Merge topic 'autogen_cache' Merge topic 'FindBoost-fphsa' Configure CMake itself with policies through CMake 3.14 Add undocumented option to sign CMake's own binaries on Windows Utilities/Release: Enable signing of Windows release binaries Merge topic 'windows-signing' Merge topic 'FindProtobuf-gen-sources' Merge topic 'iar-new_architectures' Merge topic 'apple_clang_full_cxx_14_support' Merge topic 'cmuvprocesschain' Merge topic 'autorcc_timestamp' Merge topic 'ios-xctest-lookup' Merge topic 'swig4' Merge branch 'release-3.14' Merge topic 'apple_clang_cxx_20_support' Merge topic 'relax_cxx_relaxed_constexpr_requirements' Merge topic 'cminstallgenerator-compute-error' Merge topic 'ninja_cleanups' Merge topic 'error-generate-step' Merge topic 'cmSytemTools_ExpandedList' Merge topic 'find-boost-cmp0093' Merge topic 'doc-relnotes-3.14' Merge branch 'doc-relnotes-3.13' into release-3.13 Merge branch 'release-3.13' Merge branch 'release-3.14' CMake 3.13.5 Merge branch 'release-3.13' Merge branch 'release-3.14' Merge branch 'upstream-KWSys' into update-kwsys Merge topic 'cmuvprocesschain-iterator-fix' Merge topic 'ninja-pool-custom-command' Merge topic 'additional_clean_files' Merge topic 'msvc-jmc' Merge topic 'update-kwsys' Merge topic 'FindBoost-allow-root' Merge topic 'sunpro-supports-cxx14-release-note' Merge topic 'armclang' CMakeDetermineCompilerId: Make CMAKE_${lang}_COMPILER available earlier Swift: Detect compiler version InterfaceLibrary: Whitelist EXPORT_PROPERTIES property Merge topic 'string-cleanup' Merge topic 'offer_compiler_lang_generator_expression' Merge topic 'use_additional_clean_files' Merge topic 'autogen_ninja_clean' Merge topic 'findblas_mklroot_bla_vendor' Merge topic 'interface-library-export-properties' Merge topic 'FindPNG-static-define' Merge topic 'ninja-swift' Merge topic 'makefiles_additional_clean_files' VS: Factor out helper to compute ApplicationTypeRevision VS: Fix ApplicationTypeRevision in builtin check projects file: Change REMOVE to ignore empty names Merge topic 'doc-ipo-check' Merge topic 'FindPostgreSQL-config-support' Merge topic 'string-param' IAR: Do not print compiler architecture id for non-IAR compilers Merge topic 'libarchive-solaris-11.4' Merge branch 'release-3.14' Genex: Fix value lifetimes in nested TARGET_PROPERTY evaluation Merge topic 'ninja-lib-symlink-space' Merge topic 'compiler-id-arch-only-iar' Merge topic 'vs-ApplicationTypeRevision' Merge topic 'swift-debug-variant' Merge topic 'find-package-prefer-config' Merge topic 'remove_unneeded_device_link_calls' Merge topic 'default-generator-env' Ninja,Makefile: Fix _COMPILER_LAUNCHER shell command syntax curl: Update script to get curl 7.65.0 Merge branch 'upstream-curl' into update-curl curl: Update build within CMake to account for 7.65 changes Merge topic 'autogen_compiler_features' Merge topic 'cmFileTimes' Merge topic 'swift-flags' Merge topic 'framework-var' Merge topic 'FindPython-find_strategy' Merge topic 'compiler-launcher-shell-format' Merge topic 'swift-flag-variables' Merge topic 'string-error' Merge topic 'genex-target-property-lifetime' Help: Add notes for topic 'clang-gnulike-support' Utilities/Release: Teach upload script to compute version automatically Utilities/Release: Replace upload step with a "push" script FindICU: Pass explicit NAMES argument to find command calls Merge topic 'update-curl' Merge topic 'cmTargetMap_definition' Merge topic 'cmAppend' Merge topic 'fix-armclang-policy' Merge topic 'ninja-pool-link-doc-nit' Merge topic 'selective-tar-extracting-and-listing' Merge topic 'FindBoost-contract-requires-compile-features' Merge topic 'rel-push' Merge topic 'FindICU-find-names' Merge topic 'swift-response' Merge topic 'GetPrerequisites-use-if-IN_LIST' Merge topic 'FindPython-find_framework' Merge topic 'cmake_automoc_relaxed_mode_deprecation' Merge topic 'FindThreads-doc-c++' Merge branch 'release-3.14' Merge topic 'flex' Merge topic 'findopenmp-new-dates' Merge topic 'linker-preference' Merge topic 'swift-wrapper' Merge topic 'samu' Merge topic 'FindZLIB-names' Merge topic 'clang-gnulike-support' Merge branch 'upstream-KWSys' into update-kwsys Merge topic 'tar-zstd-compression' Merge topic 'ninja_rule_class' Merge topic 'string-tar' Merge topic 'fix-clang-warnings' Merge topic 'doc-mr-resolve-states' Merge topic 'FindBoost-debug-messages' Merge topic 'update-vim-syntax' Merge topic 'implicit-includes-CPATH' Merge topic 'vs-depends-dedup' Merge branch 'release-3.14' Merge topic 'FindPython-remove-erroneous-code' Merge topic 'update-kwsys' Merge topic 'ninja-cmcldeps' Merge branch 'release-3.14' Merge topic 'vs-add-package-reference' Merge topic 'FindPython-Python_ROOT_DIR-searched-first' Merge topic 'ninja_build_class' Tests: Fix RunCMake.CommandLine test to use generator in no-S-B case Merge topic 'test-explicit-dirs' Merge topic 'better_error_message_for_visibility_preset_property' Merge topic 'print-correct-line-number' Merge topic 'check_language_respects_cuda_host_compiler' Merge topic 'compiler_id_gen_exp_supports_multiple_ids' Merge topic 'swift-linker-flags' Merge topic 'executables-are-consoled' Merge topic 'ninja-nvcc-rsp' Merge topic 'remove_directories' Merge topic 'emulator-arguments' Merge topic 'tweaks_to_release_notes' Help: Document Swift_DEPENDENCIES_FILE property defaults Help: Consolidate 3.15 release notes Help: Organize and revise 3.15 release notes Merge topic 'doc-3.15-relnotes' Help: Drop development topic notes to prepare release CMake 3.15.0-rc1 version update Merge branch 'GetPrerequisites-variable-typo' into release-3.15 Tests: Fix RunCMake.ctest_update test to not require GIT_EXECUTABLE Merge branch 'ctest_xml_tweaks' into release-3.15 Bryon Bean (1): cmFileCommand: Factor out cmFileCopier and cmFileInstaller Campbell Barton (1): CheckTypeSize: Fix with clang '-Werror,-Wmissing-variable-declarations' Christian Pfeiffer (5): FindMPI: Don't retain libdirs for Win32 FindMPI: Add error logging FindMPI: Correct documentaiton for library version FindMPI: Make tests valid C89 by returning 0 FindOpenMP: Add 5.0 and VS19 spec dates Chuck Atkins (7): XL: Record C compiler version that started using C99 by default XLClang: Add a new compiler ID for the clang-based XL compiler XL: Remove overlap with the new XLClang compiler ID ppc64: Work around TOC overflow with platform specific linker flags JsonCpp: Ignore deprecation warnings cray: Detect bad options passed on the command line FindEnvModules: Provide a CMake interface to environment modules Chuck Cranor (1): Cray: clean up CrayPrgEnv and CrayLinuxEnvironment modules Claudio Fantacci (3): FindGLEW: Update implementation FindGLEW: Add test FindGLEW: fix CMAKE_FIND_LIBRARY_SUFFIXES Connor Davis (1): Modules: Check nasm compile object variable Craig Scott (19): Merge topic 'readme-msys2' Merge topic 'readme-build-out-of-source' Merge topic 'bug/missed-return-on-cli-errors' Merge topic 'fix-submit-url' Merge branch 'release-3.14' Merge topic 'message-new-types-and-logging' Help: Clarify that link options don't apply to static library targets Merge topic 'ctest-update-version-override' Merge topic 'modules-indent-2-spaces' Merge topic 'refactor_docs_use_java' Merge topic 'bracket-comment-doc-clarification' Merge topic 'file-remove-no-empty' Help: Fix typo for CTEST_CUSTOM_WARNING_xxx vars Merge topic 'doc-install-export-android-mk' Merge topic 'doc-typo-CTEST_CUSTOM_WARNING_xxx' Help: Document the expire and external discussion resolve states Help: Clarify the default value for test property COST Merge topic 'add_library_unknown' Merge topic 'doc-test-cost-default' Cristian Adam (3): find_package: Factor out module and config find_package methods find_package: Add option to prefer Config mode add_library: Document UNKNOWN type of imported targets Cristian Morales Vega (2): CTestCoverageCollectGCOV: run gcov only once CTestCoverageCollectGCOV: run gcov with -x Curl Upstream (1): curl 2019-05-22 (885ce314) Damien R (2): find_dependency: Remove clearing of unused cmake_fd_exact_arg variable find_dependency: Always search dependencies Dan Kegel (3): More tests for pkg_get_variable FindPkgConfig: hoist PKG_CONFIG_PATH ops out into _pkg_set_path_internal pkg_get_variable now sets PKG_CONFIG_PATH like pkg_check_modules Daniel Sch?rmann (2): IAR: Fix building with IAR ARM 6.X IAR: Fail early in case of IAR ARM 4.XX Dennis Klein (9): FindBoost: Compare versions consistently against Boost_VERSION_STRING FindBoost: Introduce new imported target Boost::headers FindBoost: Add vars Boost_VERSION_MACRO/MAJOR/MINOR/PATCH/COUNT FindBoost: Fix and modernize config mode with FPHSA FindBoost: Modernize module mode with FPHSA FindBoost: Add new unit tests FindBoost: Introduce CMP0093 to report Boost_VERSION in x.y.z format FindBoost: Remove obsolete diagnostic message about Boost_ROOT FindBoost: Refactor debug messages Douman (1): FindBoost: Consider boost suffixes suitable for clang-cl Eicke Herbertz (3): cmake: Allow default generator to be set by environment variables Help: Add documentation for default generator environment variables Tests: Add environment generator tests Eike Ziller (1): Ninja: Fix creation of library symlinks in folders with spaces Felix Schwitzer (1): ccmake: fix curses dialog broken by refactoring Francisco Facioni (2): Ninja: Compute linker response file flag earlier Ninja: Add support for CUDA nvcc response files Fred Baksik (11): GHS: Print status message regarding GHS_OS_DIR GHS: Update GHS_BSP_NAME processing GHS: Update custom command build events GHS: Support add_custom_command( OUTPUT ) signature GHS: Support add_custom_target() command GHS: Support add_dependencies() command GHS: Update project layout to build targets correctly GHS: Update project layout to accommodate gbuild inconsistencies GHS: Update ExternalProject for GHS tools GHS: Update tests and notes cmake: --build -j should not accept 0. Gregor Jasny (6): Xcode: Require at least Xcode 5 cmUuid: Hide UUID group info in implementation ctest: refactor some code cmGlobalXCodeGenerator: Prefer std::string over char* SwiftMix: Get rid of pointer types mismatch warning SwiftMix: properly export SwiftMain method Harry Mallon (4): CPackRPM: Fix packaging in folders with ++ in name XCode: Add scheme option XCODE_SCHEME_DEBUG_AS_ROOT Xcode: Create Xcode schemes per target CPackRPM: Hide CPACK_RPM_ROOTDIR debug if not CPACK_RPM_PACKAGE_DEBUG Henri Manson (1): Genex: Teach SHELL_PATH to support a list of paths Jakub Benda (2): FindBLAS: Use Intel fortran interface on OS X even with GNU Fortran FindBLAS: Choose MKL arch based on BLA_VENDOR Jakub Kalinski (1): Enabled performance-inefficient-vector-operation check in clang-tidy JerryShih (1): FindThreads: Use complete program to test for pthreads in libc Jiang Yi (1): cmake: add '--install ' option Joachim Wuttke (l) (3): Help: describe what happens if command execute_process reaches timeout. Help: improve source formatting Help: describe the command pipeline of execute_process more explicitly Joachim Wuttke (o) (1): Help: for command enable_testing, explain relation to module CTest. Johan Stridkvist (1): ARMClang: Add support for Clang-based ARM compiler John Freeman (4): Help: Fix typo in install(EXPORT_ANDROID_MK) example Tests: Fix RunCMake.CommandLine make_directory test name Tests: Add RunCMake.CommandLine make_directory test checks cmake: Teach -E remove_directory to remove multiple directories KWSys Upstream (8): KWSys 2019-02-12 (44676809) KWSys 2019-02-14 (e270ce9f) KWSys 2019-02-25 (833b2470) KWSys 2019-03-21 (fd41ac36) KWSys 2019-03-28 (e92bdbe8) KWSys 2019-04-17 (c42b92f0) KWSys 2019-05-15 (dea11658) KWSys 2019-05-30 (f892bacf) Kinan Mahdi (1): VS: Added support for VS package references for nuget Kitware Robot (119): CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp Modules: Consistently use 2 space indentation CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp CMake Nightly Date Stamp Kyle Edwards (28): Merge topic 'cmake_parse_arguments-keywords_missing_values' Merge topic 'file_create_link_release_note' Merge branch 'release-3.14' Merge topic 'remove_return_void' Merge branch 'master' into cmake_role-vs-fix Help: Clarify ordering of list(REMOVE_DUPLICATES) Merge topic 'remove_duplicates-order' Merge topic 'feature/cleanup-ctest' Merge topic 'more_header_docs' Help: add code-block directive Merge topic 'improve-tar-command' Merge topic 'cmake--install' Merge topic 'tar-improve-error-handling' Merge topic 'update-policy-documentation' Merge topic 'ctest_xml_tweaks' Merge topic 'update-documentation' Refactor: Move/rename cmProcessGetPipes() to cmGetPipes() cmUVHandlePtr: Add cm::uv_loop_ptr cmUVStreambuf: Add std::streambuf implementation for uv_stream_t Merge topic 'cmWorkerPool_Tweaks' Merge topic 'intel_simulate' Merge topic 'source_group-tree-files' cmUVProcessChain: Add cmUVProcessChain cmake: Display error if generate step fails Refactor: Allow cmInstallGenerator::Compute() to return an error cmUVProcessChain: Add assert() for static analysis tools file(INSTALL): Add FOLLOW_SYMLINK_CHAIN argument Help: Clarify that bracket comments start with bracket open Leonid Pospelov (13): cmVisualStudio10TargetGenerator: Remove uses of const_cast cmVisualStudio10TargetGenerator: Use count instead of find cmVisualStudio10TargetGenerator: Simplify code of two functions VS: add target property VS_PROJECT_IMPORT_ cmGeneratorExpressionNode: simplify code in EqualNode cmGeneratorExpressionNode: add CharacterNode cmGeneratorExpressionNode: remove structs CompilerId*, CompilerVersion* cmGeneratorExpressionNode: add VersionNode cmGeneratorExpressionNode: use ctor arguments instead of macro cmGeneratorExpressionNode: refactor TargetPropertyNode cmGlobalVisualStudioGenerator: use auto instead of iterator types cmGlobalVisualStudioGenerator: use cmJoin to join the filenames cmGlobalVisualStudioGenerator: remove redundant variables Luca Cappa (1): MSVC: Add support for /JMC (Just My Code) Marc Chevrier (21): Optimize target properties processing at generation step Merge topic 'pkg-config-linker-flags' FindPython*: Add capability to control virtual env handling. Refactor struct TargetFileSystemArtifact Genex: Add capability to retrieve base name for various target artifacts Merge topic 'genex_filter' Refactor: Add new methods to retrieve prefix and suffix Genex: add $ and $ Genex: Rename $ in $ Refactor: introduce method cmGeneratorTarget::GetFilePostfix Genex: Update $: take care of POSTFIX UseSWIG: Manage alternate library name Merge topic 'docs-static-lib-link-options' FindPython*: Manage weak link for Python modules Merge topic 'FindPython-module' Merge topic 'file-install-follow-symlink-chain' FindPython: Implement lookup strategies. FindPython: Add policy to manage lookup stratgey default. FindPython: Add variable 'Python_FIND_FRAMEWORK' to control frameworks lookup. FindPython*: remove erroneous code FindPython: ensure Python_ROOT_DIR is always searched first Marc-Andr? Moreau (1): Windows-MSVC.cmake: fix disabling of CMAKE_NINJA_CMCLDEPS_RC Marcin ?lusarz (1): FindFLEX: fix example Marek Antoniak (1): Teach CROSSCOMPILING_EMULATOR to support arguments Mario Emmenlauer (1): FindBLAS: respect MKLROOT and MKL_ROOT if available Mateusz Janek (1): source_group command ensures that FILES arguments are actually files Mathieu Garaud (1): Extend C++17/C++14 feature checks to cover more standard library APIs Michael Forney (1): Ninja: Consider 'samu' when looking for CMAKE_MAKE_PROGRAM Naren Manimohan (3): Tests: Fix file name case in GHS object library test GHS: Add support for GHS Multi Generator in Linux FindThreads: Fix pthread library check in GHS Multi Generator NeroBurner (4): Help: Link from EXPORT_NAME to relevant export commands Help: Link from install(TARGET) to EXPORT_NAME to rename exported target Help: inter-link install() commands FindBoost: always define BOOST_ALL_DYN_LINK for Boost::dynamic_linking NeroBurner-tux (1): Help: add inter link anchors for install() commands Olli Kallioinen (1): VS: Do not print message when generate.stamp is up-to-date. Patrick Boettcher (1): Merge branch 'upstream-vim-cmake-syntax' into update-vim-syntax Patrick Gansterer (1): FindCups: add imported target R. Andrew Ohana (1): Project: Report intel's simulation of gcc. Radek Nadstawny (1): FindPkgConfig: Set linker flags on imported targets Regina Pfeifer (24): MinGW: Fix locating BinUtils when compiler has a suffix cmCTestRunTest: Remove duplicated compression logic cmRange: Move to dedicated header file cmRange: Stylistic cleanup cmRange: Add functions all_of, any_of, none_of cmRange: Add functions filter and transform cmRange: Add unit tests cmcompress: Delete unused 3rdParty module cmCTest: De-inline all member functions cmCTest: Remove friend declarations cmCTest: Move all data members to private implementation struct cmCTest: Store TestingHandlers by value testRange: Make sure tests can actually fail cmCTest: Use concrete accessor functions for TestingHandlers cmCTest: Use default member initialization cmCTest: Cleanup typedefs cmCTest: Remove dead code Introduce cmArgumentParser cmFileCommand: Port to cmArgumentParser cmInstallCommand: Port to cmArgumentParser cmExportCommand: Port to cmArgumentParser Retire cmCommandArgumentsHelper cmParseArgumentsCommand: Port to cmArgumentParser cmExecuteProcessCommand: Port to cmArgumentParser Robert Maynard (39): All VersionNode use the same capitalization pattern CUDA: Support compiler id and version generator expressions export: Disable PACKAGE mode user package registry by default Add a release note for the cuda compiler generator expressions CMake: Provide language level compile features lists CompileFeatures: Don't try_compile for language levels with no features add_library: Now support aliasing unknown import targets CompileFeatures: memoize C compilers with full language level support Record when C compilers have gained full support for 90,99,11 CompileFeatures: memoize C++ compilers with full language level support CompileFeatures: Now able to presume full language level support Add a test to verify meta-feature parity with granular features CompileFeatures: Record when CXX compilers have gained full support for 98 CompileFeatures: Record which C features the MSVC compiler supports XL: Add C++14 language level flags Relax the usage of TARGET_OBJECTS generator expression CompileFeatures: Record when compilers gained full CXX11 support CompileFeatures: Record when compilers gained full CXX14 support CompileFeatures: Record when AppleClang gained full CXX14 support Features: Activate C++20 support for AppleClang 10.0+ CompileFeatures: Relax cxx_relaxed_constexpr compiler requirements CompileFeatures: Record when Intel gained full CXX14 support CompileFeatures: Record when MSVC gained full CXX14 support Docs: Generator-expressions remove usage of `CMake-id` Genex: Add COMPILE_LANG_AND_ID generator expression UseJava: Refactor documentation for better formatting Help: Add release note that SunPro supports C++14 cmNinjaLinkLineDeviceComputer now lives in the correct source file CUDA: More exhaustive checks to determine when to do device linking The error message for VISIBILITY_PRESET now documents valid options. Genex: Add more extensive support for an unbounded number of parameters Genex: CompilerId now can match against a list of ids. Genex: PlatformId now can match against a list of ids. Genex: CompileLang and CompileLangAndId now match against a list of ids Help: Add release notes for updated generator expressions CheckLanguage: Report CMAKE_CUDA_HOST_COMPILER if needed for compilation Help: Reference project command in CMAKE_PROJECT_INCLUDE_BEFORE relnotes Help: Clarify vs-just-my-code-debugging release note language Help: Clarify COMPILE_LANG_AND_ID release note Rolf Eike Beer (1): remove some platform specific search paths from Find modules Rosen Matev (1): Support job pools in custom commands and targets Ruslan Baratov (6): Test ProjectInclude: Add NONE to avoid enabling languages project: Add variable CMAKE_PROJECT_INCLUDE Release note for CMAKE_PROJECT_INCLUDE variable project: Add variable CMAKE_PROJECT_INCLUDE_BEFORE Help: Add CheckIPOSupported link to INTERPROCEDURAL_OPTIMIZATION Add variable CMAKE_FRAMEWORK Saleem Abdulrasool (23): Create and use `cmGeneratorTarget::Names` Add placeholder for Swift's library name Ninja: add properties for Swift partial module and doc Ninja: remove duplicate local variable (NFC) Ninja: add final placeholders to merge Swift partials Ninja,Makefile: use `unique_ptr` for memory management Swift: remove unnecessary unreleased Ninja infrastructure Ninja: add support for Swift's output-file-map.json Ninja: add placeholders to support Swift build Modules: add build rules for Swift Ninja support Auxiliary: update vim syntax highlighting Help: add some initial documentation for Swift support Tests: add a check for the Swift compiler Ninja,Swift: reuse `SWIFT_MODULE_NAME` for `SWIFT_MODULE` Modules: remove `CMAKE_INCLUDE_FLAG_SEP_Swift` Modules: add `CMAKE_Swift_FRAMEWORK_SEARCH_FLAG` Modules: add Swift MSVC_RUNTIME_LIBRARY flags Ninja,Swift: pass along DEFINES/FLAGS/INCLUDES Ninja,Swift: correct response file handling Modules: setup `CMAKE_Swift_LINKER_PREFERENCE` Modules: correct linker wrapper flag for Swift Swift: avoid `CMAKE_{EXE,SHARED}_LINKER_FLAGS` Swift: disallow WIN32_EXECUTABLE properties Sebastian Holtermann (163): Autogen: Refactor RerunMocPlugin test with fixed timestamp comparison Autogen: Refactor RerunMocBasic test with fixed timestamp comparison Autogen: Refactor RerunRccConfigChange test Autogen: Refactor RerunRccDepends test with fixed timestamp comparison Autogen: Fix RerunMocPlugin test for Ninja generator Autogen: cmQtAutoGen: Store generator names in class static const strings Autogen: Rename cmQtAutoGen::GeneratorT enum to cmQtAutoGen::GenT Autogen: Refactor Qt executable name computation Autogen: Refactor cmQtAutoGenInitializer::AddGeneratedSource method Autogen: Use std::unordered_set instead of std::set for skip lists Autogen: Use cm::make_unique to allocate jobs Autogen: Refactor file lists computation Autogen: Move additional source header search to configuration stage Autogen: Use more readable variable names for static const AUTO* strings cmGeneratorExpressionNode: Initialize node key map in class constructor cmLocalUnixMakefileGenerator3: Move local strings into local brace scopes cmLocalUnixMakefileGenerator3: Pass strings instead of recomputing them cmLocalUnixMakefileGenerator3: Use std::unique_ptr instead of new/delete cmDepends: Reduce temporary object lifetime with local scopes cmDependsC: Remove useless string preallocation artifact cmDependsC: Use auto for long type names cmDependsC: Use faster cmSystemTools::FileTimeCompare New cmFileTime class cmFileTimeComparison: Use cmFileTime internally cmFileTimeComparison: Replace anonymous private class with std::map Rename cmFileTimeComparison to cmFileTimeCache Substitute FileComparison in variable names with FileTimeCache Rename cmFileTimeCache::FileTimesDiffer to cmFileTimeCache::DifferS Rename cmFileTimeCache::FileTimeCompare to cmFileTimeCache::Compare cmDependsC: Read cache file modification time only once cmake: Use scopes to limit temporary object lifetime cmTarget: Use helper function to append to lists cmTarget: Acquire data only when needed cmMakefile: Use std::unordered_map::emplace to add cmTargets to the list cmTarget: Rename member `Internal` to `impl` cmTarget: Move member `TargetType` to impl cmTarget: Move member `Makefile` to impl cmTarget: Move member `Properties` to impl class cmTarget: Move member `SystemIncludeDirectories` to impl cmTarget: Move member `Utilities` to impl cmTarget: Move member `OriginalLinkLibraries` to impl cmTarget: Move member `PolicyMap` to impl cmTarget: Move member `Backtrace` to impl cmTarget: Move member `TLLCommands` to impl cmTarget: Move member `Name` to impl cmTarget: Move member `InstallPath` to impl cmTarget: Move member `RuntimeInstallPath` to impl cmTarget: Move member `*Commands` to impl cmTarget: Move member booleans to impl cmTarget: Move member method `ProcessSourceItemCMP0049()` to impl cmTarget: Move member method `CheckImportedLibName` to impl cmTarget: Inline private HasImportLibrary method cmTarget: Remove obsolete `friend` definitions cmTarget: Make private `SetPropertyDefault` an in code lambda `InitProperty` cmTarget: Single line comment clanups cmTarget: Use std::unique_ptr instead of custom smart pointer cmGlobalGenerator: Use auto for long iterator types cmGlobalGenerator: Inline `aRange` acquisition in `for(x:aRange)` invocations cmFileTime: Make cmFileTime::Compare method const cmFiletimeCache: Add cmFiletimeCache::Remove method cmDepends: Refactor cmDepends::CheckDependencies method cmDepends: Define DependencyMap instead of DependencyVector Fix invalid ///! doxygen comment line starts Autogen: Remove lowercase generator name from generator variables class Autogen: Add cmQtAutogenGlobalInitializer::Keywords class Autogen: Remove static const generator name strings from cmQtAutoGen Autogen: Add `AUTO*_EXECUTABLE` strings to Keywords class Autogen: Add more frequently used keywords to Keywords class AutoRcc: Add cmQtAutoGen::RccLister class AutoRcc: Use cmQtAutoGen::RccLister in initializer and generator AutoRcc: Make rcc parsing function private AutoRcc: Remove libuv event loop from cmQtAutoGeneratorRcc AutoRcc: Don't use cmQtAutoGenerator::FileSystem methods Autogen: Move Logger and FileSystem member variables to generator classes Autogen: Make cmQtAutoGenerator::FileSystem Logger free Autogen: Move libuv loop from cmQtAutoGenerator to cmQtAutoGeneratorMocUic Autogen: Rename cmQtAutoGeneratorRcc to cmQtAutoRcc Autogen: Factor out concurrency framework to cmWorkerPool class Autogen: Rename `cmQtAutoGeneratorMocUic` class to `cmQtAutoMocUic` Autogen: Add ManySources test cmWorkerPool: Set worker thread count separately to Process() cmWorkerPool: Factor our worker thread class (internals) Autogen: Refactor AUTOMOC and AUTOUIC and add source file parse data caching Ninja: Simplify cmGlobalNinjaGenerator::WriteRule method Ninja: Simplify cmGlobalNinjaGenerator::AddRule and HasRule methods Ninja: Fix message in cmGlobalNinjaGenerator::WriteBuild method Ninja: Add and use cmGlobalNinjaGenerator::CMakeCmd method Ninja: In cmGlobalNinjaGenerator use std::unique_ptr to manage output streams Autogen: A missing info file is a critical error AutoRcc: Write re-generation reason and rcc command as one string AutoRcc: Don't read the info file time again AutoRcc: Rebuild if the rcc executable is newer than its output AutoRcc: Simplify error logging with utility lambda Ninja: Inline range loop range arguments cmSystemTools: Add ExpandedListArgument and ExpandedLists methods Ninja: In cmNinjaTargetGenerator optimize string composition Ninja: In cmNinjaTargetGenerator use std::unique_ptr to manage new instances Ninja: Use clean target instead of clean tool in `cmake --target clean` calls Makefiles: Sort clean files by using a std::set container Makefiles: Move ADDITIONAL_MAKE_CLEAN_FILES evaluation to lambda Makefiles: Add support for ADDITIONAL_CLEAN_FILES directory property Makefiles: Add support for ADDITIONAL_CLEAN_FILES target property Ninja: Add support for additional clean files Ninja: Add support for ADDITIONAL_CLEAN_FILES directory property Ninja: Add support for ADDITIONAL_CLEAN_FILES target property Tests: Extend MakeClean test to cover ADDITIONAL_CLEAN_FILES Doc: Add documentation for ADDITIONAL_CLEAN_FILES properties Doc: Update and deprecate ADDITIONAL_MAKE_CLEAN_FILES directory property Release notes: Add release notes for ADDITIONAL_CLEAN_FILES properties Autogen: Use ADDITIONAL_CLEAN_FILES target property for file cleaning Autogen: Update documentation for ADDITIONAL_CLEAN_FILES Test: Improve WarnUnusedCliUnused to run on all generators FindDoxygen: Use ADDITIONAL_CLEAN_FILES for cleaning UseEcos: Use ADDITIONAL_CLEAN_FILES for cleaning UseJava: Use ADDITIONAL_CLEAN_FILES for cleaning UseSWIG: Use ADDITIONAL_CLEAN_FILES for cleaning Makefiles: Inline range loop range arguments Makefiles: Avoid pointer repurposing Makefiles: Make build root targets "all", "clean" and "preinstall" recursive Makefiles: Process ADDTIONAL_CLEAN_FILES dir prop at directory level Tests: Extend MakeClean test to cover subdirectories without targets cmFileTimes: New RAII based cmFileTimes class Use cmFileTimes instead of cmSystemToolsFileTime interface cmSystemTools: Remove cmSystemToolsFileTime interface Autogen: Evaluate compiler features for the same exectuable only once cmMakefile: Define cmTargetMap type in cmMakefile instead of cmTarget cmAlgorithms: Add cmAppend function Use cmAppend to append ranges to std::vector instances Autogen: Deprecation message for CMAKE_AUTOMOC_RELAXED_MODE Help: Mark CMAKE_AUTOMOC_RELAXED_MODE as deprecated Autogen: Deprecation release notes for CMAKE_AUTOMOC_RELAXED_MODE Ninja: Add cmNinjaRule class Ninja: Use cmNinjaRule as sole parameter in the WriteRule and AddRule methods Ninja: Add cmNinjaBuild utility class Ninja: Add cmNinjaBuild based WriteBuild (wrapper) method Ninja: Make WriteMacOSXContentBuild use cmNinjaBuild internally Ninja: Make WriteCustomCommandBuild method use cmNinjaBuild internally Ninja: Embrace temporary objects in scopes Ninja: Use cmNinjaBuild instead of WritePhonyBuild Ninja: Use cmNinjaBuild instead of WritePhonyBuild Ninja: Use cmNinjaBuild instead of WritePhonyBuild Ninja: Embrace temporary objects in scopes Ninja: Use cmNinjaBuild instead of WritePhonyBuild Ninja: Use cmNinjaBuild instead of WritePhonyBuild Ninja: Use cmNinjaBuild instead of WritePhonyBuild Ninja: Use cmNinjaBuild instead of WritePhonyBuild Ninja: Use cmNinjaBuild instead of WritePhonyBuild Ninja: Use cmNinjaBuild instead of WritePhonyBuild Ninja: Use cmNinjaBuild instead of WritePhonyBuild Ninja: Use cmNinjaBuild instead of WritePhonyBuild Ninja: Remove WritePhonyBuild method Ninja: Use cmNinjaBuild class for WriteBuild Ninja: Use cmNinjaBuild class for WriteBuild Ninja: Use cmNinjaBuild class for WriteBuild Ninja: Use cmNinjaBuild class for WriteBuild Ninja: Use cmNinjaBuild class for WriteBuild Ninja: Use cmNinjaBuild class for WriteBuild Ninja: Use cmNinjaBuild class for WriteBuild Ninja: Use cmNinjaBuild class for WriteBuild Ninja: Use cmNinjaBuild class for WriteBuild Ninja: Use cmNinjaBuild class for WriteBuild Ninja: Use cmNinjaBuild class for WriteBuild Ninja: Remove non cmNinjaBuild based WriteBuild method Sebastian Lipponer (5): Help: Fix description in cmake-generator-expressions(7) manual Genex: Add $ Help: Add missing release notes for genex $ Help: Move entry to correct section in cmake-generator-expressions(7) manual Genex: Add $ Shoaib Meenai (1): Help: clarify if(EXISTS) operation for symlinks Stefan Andersson (3): IAR: Generalize and add support for IAR RX compiler IAR: Changes required for Linux IAR: Add architecture support for RL78, RH850 and MSP430 Sylvain Joubert (2): ProcessorCount: Return the container CPU count instead of the host count FindSWIG: mark_as_advanced SWIG_EXECUTABLE for cleaner cache display Tom Yan (1): Android: allow user to enable versioned soname Torsten Robitzki (2): cmake_parse_arguments: Factor out part of implementation for re-use cmake_parse_arguments: add KEYWORDS_MISSING_VALUES Vitaly Stakhovsky (14): cmSystemTools::RunSingleCommand: Accept std::string argument cmMakefile::GetRequiredDefinition: return const std::string& cmSystemTools: MessageCallback and Message() accept std::string argument cmake: Progress functions use `std::string` param cmSystemTools: More methods accept `std::string` params cmSystemTools: Remove redundant cmCopyFile() and Split() cmMakefile::ConfigureFile: Accept `std::string` parameters cmSystemTools::Error: consolidate parameters into single std::string cmSystemTools: More functions accept `std::string` params Fix missing `override` Source: std::string related cleanup Source: change parameters to std::string cmSystemTools::Error(): remove const char* overload cmSystemTools: std::string parameters for tar functions Wil Stark (1): VS: support suppressing deployment of selected targets Zack Galbreath (7): Help: provide example for HTTPHEADER option to ctest_submit ctest_submit: Add option BUILD_ID ctest: Include ChangeId in Update.xml ctest: consistently format generator name testing: Update terminology in ctest_update tests Help: cross-ref and wording of docs related to ctest_update() ctest: Add new variable CTEST_UPDATE_VERSION_OVERRIDE Zaytsev Yuriy (1): CPack/IFW: Add StyleSheet field Zsolt Parragi (17): CTest: Represent process exit codes as 64-bit signed integer Avoid compiling CMake itself as C++17 with Clang's MSVC ABI Work around clang-cl breakage on make_unique/std::forward Tests: Teach tests when to treat clang-cl as MSVC Features: Do not use a lower-than-default standard for requested features CMakeVersion.rc: Avoid preprocessor definitions to support llvm-rc RC: Pass output file in a way that llvm-rc 7 and below understand MSVC: Use -D instead of /D in RC_FLAGS clang: introduce CMAKE__COMPILER_FRONTEND_VARIANT binutils: add the llvm-* variants to the tool lists. cmGlobalNinjaGenerator: use gnu compatible paths with clang in gnu mode clang: setup correct configuration in gnu mode cmake: use correct stack size with gnu mode clang on windows Tests: fix failures with gnu mode clang on windows Tests: require C++14 for the Tutorial Tests: handle string escaping differences with NMake+clang Fixing warnings generated by clang 8.0 on Windows Zufu Liu (1): CMakeDetermineCompilerId: Support versioned LLVM for Visual Studio. jspam (1): FindIce: Support clang-cl by checking CMAKE_CXX_SIMULATE_ID mistersandman (1): Utilities/Release: Link statically to QWindowsVistaStyle plugin vim-cmake-syntax upstream (1): vim-cmake-syntax 2019-05-29 (c42ede9f) zstd upstream (1): zstd 2018-12-27 (470344d3) ----------------------------------------------------------------------- hooks/post-receive -- CMake From kwrobot at kitware.com Wed Jun 5 00:03:06 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Wed, 5 Jun 2019 00:03:06 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc1-6-g6ca4973 Message-ID: <20190605040306.5238410AAA8@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 6ca497365af59106976fd3cc0bff8357c6794522 (commit) from 6a78bdbb06e27a5474bf3262d4dcf7459a8627f9 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6ca497365af59106976fd3cc0bff8357c6794522 commit 6ca497365af59106976fd3cc0bff8357c6794522 Author: Kitware Robot AuthorDate: Wed Jun 5 00:01:09 2019 -0400 Commit: Kitware Robot CommitDate: Wed Jun 5 00:01:09 2019 -0400 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index a3679e5..c0b209c 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 15) -set(CMake_VERSION_PATCH 20190604) +set(CMake_VERSION_PATCH 20190605) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From kwrobot at kitware.com Wed Jun 5 10:03:05 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Wed, 5 Jun 2019 10:03:05 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc1-10-g8c704cf Message-ID: <20190605140305.1075DF6528@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 8c704cfad4deee359fb65cd49a7cf4686130d8ea (commit) via 8a07d511afdae53047ba23d257851753ed6eb858 (commit) via 556277eb100c2fa061677a59be33eb71876a2a72 (commit) via 15de26c7f307fe33c4284e7573154cb47bb19ec4 (commit) from 6ca497365af59106976fd3cc0bff8357c6794522 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8c704cfad4deee359fb65cd49a7cf4686130d8ea commit 8c704cfad4deee359fb65cd49a7cf4686130d8ea Merge: 8a07d51 556277e Author: Brad King AuthorDate: Wed Jun 5 10:01:14 2019 -0400 Commit: Brad King CommitDate: Wed Jun 5 10:01:14 2019 -0400 Merge branch 'release-3.15' https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8a07d511afdae53047ba23d257851753ed6eb858 commit 8a07d511afdae53047ba23d257851753ed6eb858 Merge: 6ca4973 15de26c Author: Brad King AuthorDate: Wed Jun 5 13:59:25 2019 +0000 Commit: Kitware Robot CommitDate: Wed Jun 5 09:59:33 2019 -0400 Merge topic 'doc-FindEnvModule-typos' 15de26c7f3 Help: Trivial typo and grammar fixes for FindEnvModules Acked-by: Kitware Robot Merge-request: !3425 ----------------------------------------------------------------------- Summary of changes: Modules/FindEnvModules.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) hooks/post-receive -- CMake From kwrobot at kitware.com Wed Jun 5 10:03:05 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Wed, 5 Jun 2019 10:03:05 -0400 (EDT) Subject: [Cmake-commits] CMake branch, release, updated. v3.15.0-rc1-2-g556277e Message-ID: <20190605140305.20EF610A867@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, release has been updated via 556277eb100c2fa061677a59be33eb71876a2a72 (commit) via 15de26c7f307fe33c4284e7573154cb47bb19ec4 (commit) from a4231943117f5ba3dd0fdc6c8b1824334162b69f (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- ----------------------------------------------------------------------- Summary of changes: Modules/FindEnvModules.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) hooks/post-receive -- CMake From kwrobot at kitware.com Thu Jun 6 00:03:06 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Thu, 6 Jun 2019 00:03:06 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc1-11-g9ef92b7 Message-ID: <20190606040306.B70651A77@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 9ef92b7d7d577350cc67c7762112b6056adef34d (commit) from 8c704cfad4deee359fb65cd49a7cf4686130d8ea (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9ef92b7d7d577350cc67c7762112b6056adef34d commit 9ef92b7d7d577350cc67c7762112b6056adef34d Author: Kitware Robot AuthorDate: Thu Jun 6 00:01:06 2019 -0400 Commit: Kitware Robot CommitDate: Thu Jun 6 00:01:06 2019 -0400 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index c0b209c..381fbe3 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 15) -set(CMake_VERSION_PATCH 20190605) +set(CMake_VERSION_PATCH 20190606) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From kwrobot at kitware.com Thu Jun 6 10:33:07 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Thu, 6 Jun 2019 10:33:07 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc1-13-gbaf3a84 Message-ID: <20190606143307.820FC2430@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via baf3a84eff415be8691724153a10031401321d0f (commit) via 8a4732c60e5cb2137fa824605e4668f3229a9684 (commit) from 9ef92b7d7d577350cc67c7762112b6056adef34d (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=baf3a84eff415be8691724153a10031401321d0f commit baf3a84eff415be8691724153a10031401321d0f Merge: 9ef92b7 8a4732c Author: Brad King AuthorDate: Thu Jun 6 14:32:02 2019 +0000 Commit: Kitware Robot CommitDate: Thu Jun 6 10:32:10 2019 -0400 Merge topic 'cpack-nuget-case' 8a4732c60e CPack/NuGet: Find nuget tool on case sensitive file system Acked-by: Kitware Robot Acked-by: Mathieu Malaterre Merge-request: !3427 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8a4732c60e5cb2137fa824605e4668f3229a9684 commit 8a4732c60e5cb2137fa824605e4668f3229a9684 Author: Mathieu Malaterre AuthorDate: Wed Jun 5 10:17:21 2019 +0200 Commit: Brad King CommitDate: Wed Jun 5 09:32:22 2019 -0400 CPack/NuGet: Find nuget tool on case sensitive file system There is no need to use a CamelCase executable name since it will be handled gracefully on Windows anyway. This change allow support for Linux system, in particular Debian distribution where the binary is called `nuget`. diff --git a/Modules/Internal/CPack/CPackNuGet.cmake b/Modules/Internal/CPack/CPackNuGet.cmake index 198ccad..4b2ce92 100644 --- a/Modules/Internal/CPack/CPackNuGet.cmake +++ b/Modules/Internal/CPack/CPackNuGet.cmake @@ -276,7 +276,7 @@ function(_cpack_nuget_make_files_tag) set(_CPACK_NUGET_FILES_TAG "\n${_files} " PARENT_SCOPE) endfunction() -find_program(NUGET_EXECUTABLE NuGet) +find_program(NUGET_EXECUTABLE nuget) _cpack_nuget_debug_var(NUGET_EXECUTABLE) if(NOT NUGET_EXECUTABLE) message(FATAL_ERROR "NuGet executable not found") ----------------------------------------------------------------------- Summary of changes: Modules/Internal/CPack/CPackNuGet.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From kwrobot at kitware.com Thu Jun 6 10:43:05 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Thu, 6 Jun 2019 10:43:05 -0400 (EDT) Subject: [Cmake-commits] CMake branch, release, updated. v3.15.0-rc1-6-g1f46693 Message-ID: <20190606144305.D5DCD188F4@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, release has been updated via 1f466935da2b04862307d126da0cf4d6b604d613 (commit) via 923f58ec735575a3e81f017c5dcdecb15f44a668 (commit) via 501a3cf195fc8b189d310c499d37ade63a7abb1d (commit) via 8a4732c60e5cb2137fa824605e4668f3229a9684 (commit) from 556277eb100c2fa061677a59be33eb71876a2a72 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- ----------------------------------------------------------------------- Summary of changes: Help/variable/CMAKE_LANG_COMPILER_ID.rst | 1 + Modules/Internal/CPack/CPackNuGet.cmake | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) hooks/post-receive -- CMake From kwrobot at kitware.com Thu Jun 6 10:43:05 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Thu, 6 Jun 2019 10:43:05 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc1-18-g6aee82f Message-ID: <20190606144305.A98062430@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 6aee82f325df2332b5c7563c3e10b3253ae851c1 (commit) via 676a0bf9bc97a8a4820d3ba4deb34cb14cbb5fe0 (commit) via 1f466935da2b04862307d126da0cf4d6b604d613 (commit) via 923f58ec735575a3e81f017c5dcdecb15f44a668 (commit) via 501a3cf195fc8b189d310c499d37ade63a7abb1d (commit) from baf3a84eff415be8691724153a10031401321d0f (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6aee82f325df2332b5c7563c3e10b3253ae851c1 commit 6aee82f325df2332b5c7563c3e10b3253ae851c1 Merge: 676a0bf 1f46693 Author: Brad King AuthorDate: Thu Jun 6 10:34:32 2019 -0400 Commit: Brad King CommitDate: Thu Jun 6 10:34:32 2019 -0400 Merge branch 'release-3.15' https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=676a0bf9bc97a8a4820d3ba4deb34cb14cbb5fe0 commit 676a0bf9bc97a8a4820d3ba4deb34cb14cbb5fe0 Merge: baf3a84 923f58e Author: Brad King AuthorDate: Thu Jun 6 14:32:12 2019 +0000 Commit: Kitware Robot CommitDate: Thu Jun 6 10:33:06 2019 -0400 Merge topic 'doc-xlclang-id' 923f58ec73 Help: Document XLClang compiler id Acked-by: Kitware Robot Merge-request: !3430 ----------------------------------------------------------------------- Summary of changes: Help/variable/CMAKE_LANG_COMPILER_ID.rst | 1 + 1 file changed, 1 insertion(+) hooks/post-receive -- CMake From kwrobot at kitware.com Thu Jun 6 14:13:05 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Thu, 6 Jun 2019 14:13:05 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc1-24-g0b3ba05 Message-ID: <20190606181305.A5185FF3@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 0b3ba05a9beada98e8e97445acef7ef2f4efb3e3 (commit) via 0e4493ec67865123d43034ef9bf1bd4919c705b1 (commit) via f1bdfdf2425d544b0cf897de626422ad3fa9e1e7 (commit) via 8af4b31b8ac44c87629fabec22d87e1e6e41f73f (commit) via 537ea119b9d65d8723b6df8a7ba71f29466c0f63 (commit) via c4826787d50d02a8e403b99b589a35875e7d7f23 (commit) from 6aee82f325df2332b5c7563c3e10b3253ae851c1 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0b3ba05a9beada98e8e97445acef7ef2f4efb3e3 commit 0b3ba05a9beada98e8e97445acef7ef2f4efb3e3 Merge: 6aee82f 0e4493e Author: Brad King AuthorDate: Thu Jun 6 18:07:12 2019 +0000 Commit: Kitware Robot CommitDate: Thu Jun 6 14:07:23 2019 -0400 Merge topic 'cmTarget_cleanups' 0e4493ec67 cmOutputConverter: Initialize static std::set on construction f1bdfdf242 cmAddCustomCommand: Initialize static std::unordered_set on construction 8af4b31b8a cmTargetPropertyComputer: Initialize static std::unordered_set on construction 537ea119b9 cmTarget: Initialize static std::unordered_set on construction c4826787d5 cmTarget: Property initialization cleanup Acked-by: Kitware Robot Merge-request: !3416 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0e4493ec67865123d43034ef9bf1bd4919c705b1 commit 0e4493ec67865123d43034ef9bf1bd4919c705b1 Author: Sebastian Holtermann AuthorDate: Tue Jun 4 12:24:44 2019 +0200 Commit: Sebastian Holtermann CommitDate: Tue Jun 4 18:11:19 2019 +0200 cmOutputConverter: Initialize static std::set on construction diff --git a/Source/cmOutputConverter.cxx b/Source/cmOutputConverter.cxx index 7d88b08..d7bcf7e 100644 --- a/Source/cmOutputConverter.cxx +++ b/Source/cmOutputConverter.cxx @@ -73,22 +73,10 @@ std::string cmOutputConverter::ConvertDirectorySeparatorsForShell( static bool cmOutputConverterIsShellOperator(const std::string& str) { - static std::set shellOperators; - if (shellOperators.empty()) { - shellOperators.insert("<"); - shellOperators.insert(">"); - shellOperators.insert("<<"); - shellOperators.insert(">>"); - shellOperators.insert("|"); - shellOperators.insert("||"); - shellOperators.insert("&&"); - shellOperators.insert("&>"); - shellOperators.insert("1>"); - shellOperators.insert("2>"); - shellOperators.insert("2>&1"); - shellOperators.insert("1>&2"); - } - return shellOperators.count(str) > 0; + static std::set const shellOperators{ + "<", ">", "<<", ">>", "|", "||", "&&", "&>", "1>", "2>", "2>&1", "1>&2" + }; + return (shellOperators.count(str) != 0); } std::string cmOutputConverter::EscapeForShell(const std::string& str, https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f1bdfdf2425d544b0cf897de626422ad3fa9e1e7 commit f1bdfdf2425d544b0cf897de626422ad3fa9e1e7 Author: Sebastian Holtermann AuthorDate: Tue Jun 4 12:19:59 2019 +0200 Commit: Sebastian Holtermann CommitDate: Tue Jun 4 18:11:19 2019 +0200 cmAddCustomCommand: Initialize static std::unordered_set on construction diff --git a/Source/cmAddCustomCommandCommand.cxx b/Source/cmAddCustomCommandCommand.cxx index 0be3c85..6eb38bd 100644 --- a/Source/cmAddCustomCommandCommand.cxx +++ b/Source/cmAddCustomCommandCommand.cxx @@ -95,30 +95,29 @@ bool cmAddCustomCommandCommand::InitialPass( MAKE_STATIC_KEYWORD(VERBATIM); MAKE_STATIC_KEYWORD(WORKING_DIRECTORY); #undef MAKE_STATIC_KEYWORD - static std::unordered_set keywords; - if (keywords.empty()) { - keywords.insert(keyAPPEND); - keywords.insert(keyARGS); - keywords.insert(keyBYPRODUCTS); - keywords.insert(keyCOMMAND); - keywords.insert(keyCOMMAND_EXPAND_LISTS); - keywords.insert(keyCOMMENT); - keywords.insert(keyDEPENDS); - keywords.insert(keyDEPFILE); - keywords.insert(keyIMPLICIT_DEPENDS); - keywords.insert(keyJOB_POOL); - keywords.insert(keyMAIN_DEPENDENCY); - keywords.insert(keyOUTPUT); - keywords.insert(keyOUTPUTS); - keywords.insert(keyPOST_BUILD); - keywords.insert(keyPRE_BUILD); - keywords.insert(keyPRE_LINK); - keywords.insert(keySOURCE); - keywords.insert(keyTARGET); - keywords.insert(keyUSES_TERMINAL); - keywords.insert(keyVERBATIM); - keywords.insert(keyWORKING_DIRECTORY); - } + static std::unordered_set const keywords{ + keyAPPEND, + keyARGS, + keyBYPRODUCTS, + keyCOMMAND, + keyCOMMAND_EXPAND_LISTS, + keyCOMMENT, + keyDEPENDS, + keyDEPFILE, + keyIMPLICIT_DEPENDS, + keyJOB_POOL, + keyMAIN_DEPENDENCY, + keyOUTPUT, + keyOUTPUTS, + keyPOST_BUILD, + keyPRE_BUILD, + keyPRE_LINK, + keySOURCE, + keyTARGET, + keyUSES_TERMINAL, + keyVERBATIM, + keyWORKING_DIRECTORY + }; for (std::string const& copy : args) { if (keywords.count(copy)) { https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8af4b31b8ac44c87629fabec22d87e1e6e41f73f commit 8af4b31b8ac44c87629fabec22d87e1e6e41f73f Author: Sebastian Holtermann AuthorDate: Tue Jun 4 12:17:45 2019 +0200 Commit: Sebastian Holtermann CommitDate: Tue Jun 4 18:11:19 2019 +0200 cmTargetPropertyComputer: Initialize static std::unordered_set on construction diff --git a/Source/cmTargetPropertyComputer.cxx b/Source/cmTargetPropertyComputer.cxx index 3f763af..eac300f 100644 --- a/Source/cmTargetPropertyComputer.cxx +++ b/Source/cmTargetPropertyComputer.cxx @@ -56,22 +56,21 @@ bool cmTargetPropertyComputer::WhiteListedInterfaceProperty( if (std::islower(prop[0])) { return true; } - static std::unordered_set builtIns; - if (builtIns.empty()) { - builtIns.insert("COMPATIBLE_INTERFACE_BOOL"); - builtIns.insert("COMPATIBLE_INTERFACE_NUMBER_MAX"); - builtIns.insert("COMPATIBLE_INTERFACE_NUMBER_MIN"); - builtIns.insert("COMPATIBLE_INTERFACE_STRING"); - builtIns.insert("EXPORT_NAME"); - builtIns.insert("EXPORT_PROPERTIES"); - builtIns.insert("IMPORTED"); - builtIns.insert("IMPORTED_GLOBAL"); - builtIns.insert("MANUALLY_ADDED_DEPENDENCIES"); - builtIns.insert("NAME"); - builtIns.insert("PRIVATE_HEADER"); - builtIns.insert("PUBLIC_HEADER"); - builtIns.insert("TYPE"); - } + static std::unordered_set const builtIns{ + "COMPATIBLE_INTERFACE_BOOL", + "COMPATIBLE_INTERFACE_NUMBER_MAX", + "COMPATIBLE_INTERFACE_NUMBER_MIN", + "COMPATIBLE_INTERFACE_STRING", + "EXPORT_NAME", + "EXPORT_PROPERTIES", + "IMPORTED", + "IMPORTED_GLOBAL", + "MANUALLY_ADDED_DEPENDENCIES", + "NAME", + "PRIVATE_HEADER", + "PUBLIC_HEADER", + "TYPE" + }; if (builtIns.count(prop)) { return true; https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=537ea119b9d65d8723b6df8a7ba71f29466c0f63 commit 537ea119b9d65d8723b6df8a7ba71f29466c0f63 Author: Sebastian Holtermann AuthorDate: Tue Jun 4 12:14:37 2019 +0200 Commit: Sebastian Holtermann CommitDate: Tue Jun 4 18:11:19 2019 +0200 cmTarget: Initialize static std::unordered_set on construction diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 6351189..b10b30f 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -1491,7 +1491,6 @@ const char* cmTarget::GetComputedProperty( const char* cmTarget::GetProperty(const std::string& prop) const { - static std::unordered_set specialProps; #define MAKE_STATIC_PROP(PROP) static const std::string prop##PROP = #PROP MAKE_STATIC_PROP(LINK_LIBRARIES); MAKE_STATIC_PROP(TYPE); @@ -1509,23 +1508,23 @@ const char* cmTarget::GetProperty(const std::string& prop) const MAKE_STATIC_PROP(SOURCE_DIR); MAKE_STATIC_PROP(SOURCES); #undef MAKE_STATIC_PROP - if (specialProps.empty()) { - specialProps.insert(propLINK_LIBRARIES); - specialProps.insert(propTYPE); - specialProps.insert(propINCLUDE_DIRECTORIES); - specialProps.insert(propCOMPILE_FEATURES); - specialProps.insert(propCOMPILE_OPTIONS); - specialProps.insert(propCOMPILE_DEFINITIONS); - specialProps.insert(propLINK_OPTIONS); - specialProps.insert(propLINK_DIRECTORIES); - specialProps.insert(propIMPORTED); - specialProps.insert(propIMPORTED_GLOBAL); - specialProps.insert(propMANUALLY_ADDED_DEPENDENCIES); - specialProps.insert(propNAME); - specialProps.insert(propBINARY_DIR); - specialProps.insert(propSOURCE_DIR); - specialProps.insert(propSOURCES); - } + static std::unordered_set const specialProps{ + propLINK_LIBRARIES, + propTYPE, + propINCLUDE_DIRECTORIES, + propCOMPILE_FEATURES, + propCOMPILE_OPTIONS, + propCOMPILE_DEFINITIONS, + propLINK_OPTIONS, + propLINK_DIRECTORIES, + propIMPORTED, + propIMPORTED_GLOBAL, + propMANUALLY_ADDED_DEPENDENCIES, + propNAME, + propBINARY_DIR, + propSOURCE_DIR, + propSOURCES + }; if (specialProps.count(prop)) { if (prop == propLINK_LIBRARIES) { if (impl->LinkImplementationPropertyEntries.empty()) { https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c4826787d50d02a8e403b99b589a35875e7d7f23 commit c4826787d50d02a8e403b99b589a35875e7d7f23 Author: Sebastian Holtermann AuthorDate: Tue Jun 4 12:09:04 2019 +0200 Commit: Sebastian Holtermann CommitDate: Tue Jun 4 18:11:19 2019 +0200 cmTarget: Property initialization cleanup diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index cd67586..6351189 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -231,14 +231,21 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type, impl->IsAndroid = (impl->Makefile->GetSafeDefinition("CMAKE_SYSTEM_NAME") == "Android"); - std::string gKey; - gKey.reserve(128); - gKey += "CMAKE_"; - auto InitProperty = [this, mf, &gKey](const std::string& property, - const char* default_value) { + std::string defKey; + defKey.reserve(128); + defKey += "CMAKE_"; + auto initProp = [this, mf, &defKey](const std::string& property) { // Replace everything after "CMAKE_" - gKey.replace(gKey.begin() + 6, gKey.end(), property); - if (const char* value = mf->GetDefinition(gKey)) { + defKey.replace(defKey.begin() + 6, defKey.end(), property); + if (const char* value = mf->GetDefinition(defKey)) { + this->SetProperty(property, value); + } + }; + auto initPropValue = [this, mf, &defKey](const std::string& property, + const char* default_value) { + // Replace everything after "CMAKE_" + defKey.replace(defKey.begin() + 6, defKey.end(), property); + if (const char* value = mf->GetDefinition(defKey)) { this->SetProperty(property, value); } else if (default_value) { this->SetProperty(property, default_value); @@ -248,107 +255,107 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type, // Setup default property values. if (this->GetType() != cmStateEnums::INTERFACE_LIBRARY && this->GetType() != cmStateEnums::UTILITY) { - InitProperty("ANDROID_API", nullptr); - InitProperty("ANDROID_API_MIN", nullptr); - InitProperty("ANDROID_ARCH", nullptr); - InitProperty("ANDROID_STL_TYPE", nullptr); - InitProperty("ANDROID_SKIP_ANT_STEP", nullptr); - InitProperty("ANDROID_PROCESS_MAX", nullptr); - InitProperty("ANDROID_PROGUARD", nullptr); - InitProperty("ANDROID_PROGUARD_CONFIG_PATH", nullptr); - InitProperty("ANDROID_SECURE_PROPS_PATH", nullptr); - InitProperty("ANDROID_NATIVE_LIB_DIRECTORIES", nullptr); - InitProperty("ANDROID_NATIVE_LIB_DEPENDENCIES", nullptr); - InitProperty("ANDROID_JAVA_SOURCE_DIR", nullptr); - InitProperty("ANDROID_JAR_DIRECTORIES", nullptr); - InitProperty("ANDROID_JAR_DEPENDENCIES", nullptr); - InitProperty("ANDROID_ASSETS_DIRECTORIES", nullptr); - InitProperty("ANDROID_ANT_ADDITIONAL_OPTIONS", nullptr); - InitProperty("BUILD_RPATH", nullptr); - InitProperty("BUILD_RPATH_USE_ORIGIN", nullptr); - InitProperty("INSTALL_NAME_DIR", nullptr); - InitProperty("INSTALL_RPATH", ""); - InitProperty("INSTALL_RPATH_USE_LINK_PATH", "OFF"); - InitProperty("INTERPROCEDURAL_OPTIMIZATION", nullptr); - InitProperty("SKIP_BUILD_RPATH", "OFF"); - InitProperty("BUILD_WITH_INSTALL_RPATH", "OFF"); - InitProperty("ARCHIVE_OUTPUT_DIRECTORY", nullptr); - InitProperty("LIBRARY_OUTPUT_DIRECTORY", nullptr); - InitProperty("RUNTIME_OUTPUT_DIRECTORY", nullptr); - InitProperty("PDB_OUTPUT_DIRECTORY", nullptr); - InitProperty("COMPILE_PDB_OUTPUT_DIRECTORY", nullptr); - InitProperty("FRAMEWORK", nullptr); - InitProperty("Fortran_FORMAT", nullptr); - InitProperty("Fortran_MODULE_DIRECTORY", nullptr); - InitProperty("Fortran_COMPILER_LAUNCHER", nullptr); - InitProperty("GNUtoMS", nullptr); - InitProperty("OSX_ARCHITECTURES", nullptr); - InitProperty("IOS_INSTALL_COMBINED", nullptr); - InitProperty("AUTOMOC", nullptr); - InitProperty("AUTOUIC", nullptr); - InitProperty("AUTORCC", nullptr); - InitProperty("AUTOGEN_ORIGIN_DEPENDS", nullptr); - InitProperty("AUTOGEN_PARALLEL", nullptr); - InitProperty("AUTOMOC_COMPILER_PREDEFINES", nullptr); - InitProperty("AUTOMOC_DEPEND_FILTERS", nullptr); - InitProperty("AUTOMOC_MACRO_NAMES", nullptr); - InitProperty("AUTOMOC_MOC_OPTIONS", nullptr); - InitProperty("AUTOUIC_OPTIONS", nullptr); - InitProperty("AUTOUIC_SEARCH_PATHS", nullptr); - InitProperty("AUTORCC_OPTIONS", nullptr); - InitProperty("LINK_DEPENDS_NO_SHARED", nullptr); - InitProperty("LINK_INTERFACE_LIBRARIES", nullptr); - InitProperty("MSVC_RUNTIME_LIBRARY", nullptr); - InitProperty("WIN32_EXECUTABLE", nullptr); - InitProperty("MACOSX_BUNDLE", nullptr); - InitProperty("MACOSX_RPATH", nullptr); - InitProperty("NO_SYSTEM_FROM_IMPORTED", nullptr); - InitProperty("BUILD_WITH_INSTALL_NAME_DIR", nullptr); - InitProperty("C_CLANG_TIDY", nullptr); - InitProperty("C_COMPILER_LAUNCHER", nullptr); - InitProperty("C_CPPLINT", nullptr); - InitProperty("C_CPPCHECK", nullptr); - InitProperty("C_INCLUDE_WHAT_YOU_USE", nullptr); - InitProperty("LINK_WHAT_YOU_USE", nullptr); - InitProperty("C_STANDARD", nullptr); - InitProperty("C_STANDARD_REQUIRED", nullptr); - InitProperty("C_EXTENSIONS", nullptr); - InitProperty("CXX_CLANG_TIDY", nullptr); - InitProperty("CXX_COMPILER_LAUNCHER", nullptr); - InitProperty("CXX_CPPLINT", nullptr); - InitProperty("CXX_CPPCHECK", nullptr); - InitProperty("CXX_INCLUDE_WHAT_YOU_USE", nullptr); - InitProperty("CXX_STANDARD", nullptr); - InitProperty("CXX_STANDARD_REQUIRED", nullptr); - InitProperty("CXX_EXTENSIONS", nullptr); - InitProperty("CUDA_STANDARD", nullptr); - InitProperty("CUDA_STANDARD_REQUIRED", nullptr); - InitProperty("CUDA_EXTENSIONS", nullptr); - InitProperty("CUDA_COMPILER_LAUNCHER", nullptr); - InitProperty("CUDA_SEPARABLE_COMPILATION", nullptr); - InitProperty("LINK_SEARCH_START_STATIC", nullptr); - InitProperty("LINK_SEARCH_END_STATIC", nullptr); - InitProperty("FOLDER", nullptr); - InitProperty("Swift_MODULE_DIRECTORY", nullptr); - InitProperty("VS_JUST_MY_CODE_DEBUGGING", nullptr); + initProp("ANDROID_API"); + initProp("ANDROID_API_MIN"); + initProp("ANDROID_ARCH"); + initProp("ANDROID_STL_TYPE"); + initProp("ANDROID_SKIP_ANT_STEP"); + initProp("ANDROID_PROCESS_MAX"); + initProp("ANDROID_PROGUARD"); + initProp("ANDROID_PROGUARD_CONFIG_PATH"); + initProp("ANDROID_SECURE_PROPS_PATH"); + initProp("ANDROID_NATIVE_LIB_DIRECTORIES"); + initProp("ANDROID_NATIVE_LIB_DEPENDENCIES"); + initProp("ANDROID_JAVA_SOURCE_DIR"); + initProp("ANDROID_JAR_DIRECTORIES"); + initProp("ANDROID_JAR_DEPENDENCIES"); + initProp("ANDROID_ASSETS_DIRECTORIES"); + initProp("ANDROID_ANT_ADDITIONAL_OPTIONS"); + initProp("BUILD_RPATH"); + initProp("BUILD_RPATH_USE_ORIGIN"); + initProp("INSTALL_NAME_DIR"); + initPropValue("INSTALL_RPATH", ""); + initPropValue("INSTALL_RPATH_USE_LINK_PATH", "OFF"); + initProp("INTERPROCEDURAL_OPTIMIZATION"); + initPropValue("SKIP_BUILD_RPATH", "OFF"); + initPropValue("BUILD_WITH_INSTALL_RPATH", "OFF"); + initProp("ARCHIVE_OUTPUT_DIRECTORY"); + initProp("LIBRARY_OUTPUT_DIRECTORY"); + initProp("RUNTIME_OUTPUT_DIRECTORY"); + initProp("PDB_OUTPUT_DIRECTORY"); + initProp("COMPILE_PDB_OUTPUT_DIRECTORY"); + initProp("FRAMEWORK"); + initProp("Fortran_FORMAT"); + initProp("Fortran_MODULE_DIRECTORY"); + initProp("Fortran_COMPILER_LAUNCHER"); + initProp("GNUtoMS"); + initProp("OSX_ARCHITECTURES"); + initProp("IOS_INSTALL_COMBINED"); + initProp("AUTOMOC"); + initProp("AUTOUIC"); + initProp("AUTORCC"); + initProp("AUTOGEN_ORIGIN_DEPENDS"); + initProp("AUTOGEN_PARALLEL"); + initProp("AUTOMOC_COMPILER_PREDEFINES"); + initProp("AUTOMOC_DEPEND_FILTERS"); + initProp("AUTOMOC_MACRO_NAMES"); + initProp("AUTOMOC_MOC_OPTIONS"); + initProp("AUTOUIC_OPTIONS"); + initProp("AUTOUIC_SEARCH_PATHS"); + initProp("AUTORCC_OPTIONS"); + initProp("LINK_DEPENDS_NO_SHARED"); + initProp("LINK_INTERFACE_LIBRARIES"); + initProp("MSVC_RUNTIME_LIBRARY"); + initProp("WIN32_EXECUTABLE"); + initProp("MACOSX_BUNDLE"); + initProp("MACOSX_RPATH"); + initProp("NO_SYSTEM_FROM_IMPORTED"); + initProp("BUILD_WITH_INSTALL_NAME_DIR"); + initProp("C_CLANG_TIDY"); + initProp("C_COMPILER_LAUNCHER"); + initProp("C_CPPLINT"); + initProp("C_CPPCHECK"); + initProp("C_INCLUDE_WHAT_YOU_USE"); + initProp("LINK_WHAT_YOU_USE"); + initProp("C_STANDARD"); + initProp("C_STANDARD_REQUIRED"); + initProp("C_EXTENSIONS"); + initProp("CXX_CLANG_TIDY"); + initProp("CXX_COMPILER_LAUNCHER"); + initProp("CXX_CPPLINT"); + initProp("CXX_CPPCHECK"); + initProp("CXX_INCLUDE_WHAT_YOU_USE"); + initProp("CXX_STANDARD"); + initProp("CXX_STANDARD_REQUIRED"); + initProp("CXX_EXTENSIONS"); + initProp("CUDA_STANDARD"); + initProp("CUDA_STANDARD_REQUIRED"); + initProp("CUDA_EXTENSIONS"); + initProp("CUDA_COMPILER_LAUNCHER"); + initProp("CUDA_SEPARABLE_COMPILATION"); + initProp("LINK_SEARCH_START_STATIC"); + initProp("LINK_SEARCH_END_STATIC"); + initProp("FOLDER"); + initProp("Swift_MODULE_DIRECTORY"); + initProp("VS_JUST_MY_CODE_DEBUGGING"); #ifdef __APPLE__ if (this->GetGlobalGenerator()->IsXcode()) { - InitProperty("XCODE_GENERATE_SCHEME", nullptr); - InitProperty("XCODE_SCHEME_ADDRESS_SANITIZER", nullptr); - InitProperty("XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN", nullptr); - InitProperty("XCODE_SCHEME_THREAD_SANITIZER", nullptr); - InitProperty("XCODE_SCHEME_THREAD_SANITIZER_STOP", nullptr); - InitProperty("XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER", nullptr); - InitProperty("XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP", nullptr); - InitProperty("XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER", nullptr); - InitProperty("XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP", nullptr); - InitProperty("XCODE_SCHEME_MALLOC_SCRIBBLE", nullptr); - InitProperty("XCODE_SCHEME_MALLOC_GUARD_EDGES", nullptr); - InitProperty("XCODE_SCHEME_GUARD_MALLOC", nullptr); - InitProperty("XCODE_SCHEME_ZOMBIE_OBJECTS", nullptr); - InitProperty("XCODE_SCHEME_MALLOC_STACK", nullptr); - InitProperty("XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE", nullptr); - InitProperty("XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS", nullptr); + initProp("XCODE_GENERATE_SCHEME"); + initProp("XCODE_SCHEME_ADDRESS_SANITIZER"); + initProp("XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN"); + initProp("XCODE_SCHEME_THREAD_SANITIZER"); + initProp("XCODE_SCHEME_THREAD_SANITIZER_STOP"); + initProp("XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER"); + initProp("XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP"); + initProp("XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER"); + initProp("XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP"); + initProp("XCODE_SCHEME_MALLOC_SCRIBBLE"); + initProp("XCODE_SCHEME_MALLOC_GUARD_EDGES"); + initProp("XCODE_SCHEME_GUARD_MALLOC"); + initProp("XCODE_SCHEME_ZOMBIE_OBJECTS"); + initProp("XCODE_SCHEME_MALLOC_STACK"); + initProp("XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE"); + initProp("XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS"); } #endif } @@ -376,7 +383,7 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type, } std::string property = prop; property += configUpper; - InitProperty(property, nullptr); + initProp(property); } // Initialize per-configuration name postfix property from the @@ -388,7 +395,7 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type, impl->TargetType != cmStateEnums::INTERFACE_LIBRARY) { std::string property = cmSystemTools::UpperCase(configName); property += "_POSTFIX"; - InitProperty(property, nullptr); + initProp(property); } } } @@ -427,16 +434,16 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type, if (this->GetType() != cmStateEnums::INTERFACE_LIBRARY && this->GetType() != cmStateEnums::UTILITY) { - InitProperty("C_VISIBILITY_PRESET", nullptr); - InitProperty("CXX_VISIBILITY_PRESET", nullptr); - InitProperty("CUDA_VISIBILITY_PRESET", nullptr); - InitProperty("VISIBILITY_INLINES_HIDDEN", nullptr); + initProp("C_VISIBILITY_PRESET"); + initProp("CXX_VISIBILITY_PRESET"); + initProp("CUDA_VISIBILITY_PRESET"); + initProp("VISIBILITY_INLINES_HIDDEN"); } if (impl->TargetType == cmStateEnums::EXECUTABLE) { - InitProperty("ANDROID_GUI", nullptr); - InitProperty("CROSSCOMPILING_EMULATOR", nullptr); - InitProperty("ENABLE_EXPORTS", nullptr); + initProp("ANDROID_GUI"); + initProp("CROSSCOMPILING_EMULATOR"); + initProp("ENABLE_EXPORTS"); } if (impl->TargetType == cmStateEnums::SHARED_LIBRARY || impl->TargetType == cmStateEnums::MODULE_LIBRARY) { @@ -444,12 +451,12 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type, } if (impl->TargetType == cmStateEnums::SHARED_LIBRARY || impl->TargetType == cmStateEnums::EXECUTABLE) { - InitProperty("WINDOWS_EXPORT_ALL_SYMBOLS", nullptr); + initProp("WINDOWS_EXPORT_ALL_SYMBOLS"); } if (this->GetType() != cmStateEnums::INTERFACE_LIBRARY && this->GetType() != cmStateEnums::UTILITY) { - InitProperty("POSITION_INDEPENDENT_CODE", nullptr); + initProp("POSITION_INDEPENDENT_CODE"); } // Record current policies for later use. @@ -465,12 +472,12 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type, if (this->GetType() != cmStateEnums::INTERFACE_LIBRARY && this->GetType() != cmStateEnums::UTILITY) { - InitProperty("JOB_POOL_COMPILE", nullptr); - InitProperty("JOB_POOL_LINK", nullptr); + initProp("JOB_POOL_COMPILE"); + initProp("JOB_POOL_LINK"); } if (impl->TargetType <= cmStateEnums::UTILITY) { - InitProperty("DOTNET_TARGET_FRAMEWORK_VERSION", nullptr); + initProp("DOTNET_TARGET_FRAMEWORK_VERSION"); } if (this->GetType() != cmStateEnums::INTERFACE_LIBRARY && @@ -491,7 +498,7 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type, if (assignment != std::string::npos) { const std::string propName = vsGlobal + i.substr(0, assignment); const std::string propValue = i.substr(assignment + 1); - InitProperty(propName, propValue.c_str()); + initPropValue(propName, propValue.c_str()); } } } ----------------------------------------------------------------------- Summary of changes: Source/cmAddCustomCommandCommand.cxx | 47 +++--- Source/cmOutputConverter.cxx | 20 +-- Source/cmTarget.cxx | 284 ++++++++++++++++++----------------- Source/cmTargetPropertyComputer.cxx | 31 ++-- 4 files changed, 187 insertions(+), 195 deletions(-) hooks/post-receive -- CMake From kwrobot at kitware.com Fri Jun 7 00:03:07 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Fri, 7 Jun 2019 00:03:07 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc1-25-ge2414ee Message-ID: <20190607040307.728BD1066FB@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via e2414ee13d1fad8b6775581d01975109c9867854 (commit) from 0b3ba05a9beada98e8e97445acef7ef2f4efb3e3 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e2414ee13d1fad8b6775581d01975109c9867854 commit e2414ee13d1fad8b6775581d01975109c9867854 Author: Kitware Robot AuthorDate: Fri Jun 7 00:01:07 2019 -0400 Commit: Kitware Robot CommitDate: Fri Jun 7 00:01:07 2019 -0400 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 381fbe3..07def95 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 15) -set(CMake_VERSION_PATCH 20190606) +set(CMake_VERSION_PATCH 20190607) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From kwrobot at kitware.com Fri Jun 7 11:23:07 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Fri, 7 Jun 2019 11:23:07 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc1-29-g891b555 Message-ID: <20190607152307.C5C93FD0A1@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 891b5559517b4027147f6d94a139953bdc687668 (commit) via 43316424d0f33d6dc12ae5d1d4528603e8f0fab9 (commit) via 8be4b173f1ed59cbc084eeedd6ef3706ea5ca10a (commit) via 00e6b67e0c89ca25c5efd78f4a4b27fa53b64e77 (commit) from e2414ee13d1fad8b6775581d01975109c9867854 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=891b5559517b4027147f6d94a139953bdc687668 commit 891b5559517b4027147f6d94a139953bdc687668 Merge: 8be4b17 4331642 Author: Brad King AuthorDate: Fri Jun 7 11:16:30 2019 -0400 Commit: Brad King CommitDate: Fri Jun 7 11:16:30 2019 -0400 Merge branch 'release-3.15' https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8be4b173f1ed59cbc084eeedd6ef3706ea5ca10a commit 8be4b173f1ed59cbc084eeedd6ef3706ea5ca10a Merge: e2414ee 00e6b67 Author: Brad King AuthorDate: Fri Jun 7 15:14:11 2019 +0000 Commit: Kitware Robot CommitDate: Fri Jun 7 11:14:20 2019 -0400 Merge topic 'autogen_header_in_symbolic_path_fix' 00e6b67e0c Autogen: Fix header detection for paths with symbolic links Acked-by: Kitware Robot Merge-request: !3431 ----------------------------------------------------------------------- Summary of changes: Source/cmQtAutoGenInitializer.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) hooks/post-receive -- CMake From kwrobot at kitware.com Fri Jun 7 11:23:07 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Fri, 7 Jun 2019 11:23:07 -0400 (EDT) Subject: [Cmake-commits] CMake branch, release, updated. v3.15.0-rc1-8-g4331642 Message-ID: <20190607152308.1F5C1113A84@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, release has been updated via 43316424d0f33d6dc12ae5d1d4528603e8f0fab9 (commit) via 00e6b67e0c89ca25c5efd78f4a4b27fa53b64e77 (commit) from 1f466935da2b04862307d126da0cf4d6b604d613 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- ----------------------------------------------------------------------- Summary of changes: Source/cmQtAutoGenInitializer.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) hooks/post-receive -- CMake From kwrobot at kitware.com Sat Jun 8 00:03:06 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Sat, 8 Jun 2019 00:03:06 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc1-30-g0e96fdb Message-ID: <20190608040306.623634960@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 0e96fdbc15471b652fe9e242ab4ff1e1dc87d8dc (commit) from 891b5559517b4027147f6d94a139953bdc687668 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0e96fdbc15471b652fe9e242ab4ff1e1dc87d8dc commit 0e96fdbc15471b652fe9e242ab4ff1e1dc87d8dc Author: Kitware Robot AuthorDate: Sat Jun 8 00:01:06 2019 -0400 Commit: Kitware Robot CommitDate: Sat Jun 8 00:01:06 2019 -0400 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 07def95..991b9f5 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 15) -set(CMake_VERSION_PATCH 20190607) +set(CMake_VERSION_PATCH 20190608) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From kwrobot at kitware.com Sat Jun 8 03:03:11 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Sat, 8 Jun 2019 03:03:11 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc1-33-gd93fe90 Message-ID: <20190608070311.67FD34960@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via d93fe90c17de741c3986c3b13a6c5f5653a8104e (commit) via e61074c67226e3def13e75173e3b8bbdb1c3df2d (commit) via cebccdebaf12adc83c50f418c51b2d6b989d5350 (commit) from 0e96fdbc15471b652fe9e242ab4ff1e1dc87d8dc (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d93fe90c17de741c3986c3b13a6c5f5653a8104e commit d93fe90c17de741c3986c3b13a6c5f5653a8104e Merge: 0e96fdb e61074c Author: Craig Scott AuthorDate: Sat Jun 8 06:52:53 2019 +0000 Commit: Kitware Robot CommitDate: Sat Jun 8 02:53:21 2019 -0400 Merge topic 'additional_clean_files_help' e61074c672 Help: Improve ADDITIONAL_CLEAN_FILES documentation cebccdebaf Help: Move ADDITIONAL_MAKE_CLEAN_FILES dir prop to deprecated section Acked-by: Kitware Robot Merge-request: !3428 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e61074c67226e3def13e75173e3b8bbdb1c3df2d commit e61074c67226e3def13e75173e3b8bbdb1c3df2d Author: Sebastian Holtermann AuthorDate: Wed Jun 5 16:26:27 2019 +0200 Commit: Craig Scott CommitDate: Fri Jun 7 21:10:19 2019 +1000 Help: Improve ADDITIONAL_CLEAN_FILES documentation Extend the `ADDITIONAL_CLEAN_FILES' target and directory property documentation. Fixes: #19341 diff --git a/Help/prop_dir/ADDITIONAL_CLEAN_FILES.rst b/Help/prop_dir/ADDITIONAL_CLEAN_FILES.rst index 54a78ef..051d22a 100644 --- a/Help/prop_dir/ADDITIONAL_CLEAN_FILES.rst +++ b/Help/prop_dir/ADDITIONAL_CLEAN_FILES.rst @@ -1,16 +1,21 @@ ADDITIONAL_CLEAN_FILES ---------------------- -Additional files to remove during the clean stage. +A :ref:`;-list ` of files or directories that will be +removed as a part of the global ``clean`` target. It is useful for +specifying generated files or directories that are used by multiple targets +or by CMake itself, or that are generated in ways which cannot be captured as +outputs or byproducts of custom commands. -A :ref:`;-list ` of files that will be removed as a -part of the ``clean`` target. +If an additional clean file is specific to a single target only, then the +:prop_tgt:`ADDITIONAL_CLEAN_FILES` target property would usually be a better +choice than this directory property. Relative paths are allowed and are interpreted relative to the current binary directory. -Arguments to :prop_dir:`ADDITIONAL_CLEAN_FILES` may use +Contents of ``ADDITIONAL_CLEAN_FILES`` may use :manual:`generator expressions `. This property only works for the :generator:`Ninja` and the Makefile -generators. It is ignored on other generators. +generators. It is ignored by other generators. diff --git a/Help/prop_tgt/ADDITIONAL_CLEAN_FILES.rst b/Help/prop_tgt/ADDITIONAL_CLEAN_FILES.rst index 856bb38..3b9d965 100644 --- a/Help/prop_tgt/ADDITIONAL_CLEAN_FILES.rst +++ b/Help/prop_tgt/ADDITIONAL_CLEAN_FILES.rst @@ -1,16 +1,23 @@ ADDITIONAL_CLEAN_FILES ---------------------- -Additional files to remove during the clean stage. +A :ref:`;-list ` of files or directories that will be +removed as a part of the global ``clean`` target. It can be used to specify +files and directories that are generated as part of building the target or +that are directly associated with the target in some way (e.g. created as a +result of running the target). -A :ref:`;-list ` of files that will be removed as a -part of the ``clean`` target. +For custom targets, if such files can be captured as outputs or byproducts +instead, then that should be preferred over adding them to this property. +If an additional clean file is used by multiple targets or isn't +target-specific, then the :prop_dir:`ADDITIONAL_CLEAN_FILES` directory +property may be the more appropriate property to use. Relative paths are allowed and are interpreted relative to the current binary directory. -Arguments to :prop_tgt:`ADDITIONAL_CLEAN_FILES` may use +Contents of ``ADDITIONAL_CLEAN_FILES`` may use :manual:`generator expressions `. This property only works for the :generator:`Ninja` and the Makefile -generators. It is ignored on other generators. +generators. It is ignored by other generators. https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=cebccdebaf12adc83c50f418c51b2d6b989d5350 commit cebccdebaf12adc83c50f418c51b2d6b989d5350 Author: Craig Scott AuthorDate: Fri Jun 7 21:08:08 2019 +1000 Commit: Craig Scott CommitDate: Fri Jun 7 21:08:08 2019 +1000 Help: Move ADDITIONAL_MAKE_CLEAN_FILES dir prop to deprecated section diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst index 25aab8d..77b1ae8 100644 --- a/Help/manual/cmake-properties.7.rst +++ b/Help/manual/cmake-properties.7.rst @@ -62,7 +62,6 @@ Properties on Directories :maxdepth: 1 /prop_dir/ADDITIONAL_CLEAN_FILES - /prop_dir/ADDITIONAL_MAKE_CLEAN_FILES /prop_dir/BINARY_DIR /prop_dir/BUILDSYSTEM_TARGETS /prop_dir/CACHE_VARIABLES @@ -505,6 +504,7 @@ Deprecated Properties on Directories .. toctree:: :maxdepth: 1 + /prop_dir/ADDITIONAL_MAKE_CLEAN_FILES /prop_dir/COMPILE_DEFINITIONS_CONFIG /prop_dir/TEST_INCLUDE_FILE ----------------------------------------------------------------------- Summary of changes: Help/manual/cmake-properties.7.rst | 2 +- Help/prop_dir/ADDITIONAL_CLEAN_FILES.rst | 15 ++++++++++----- Help/prop_tgt/ADDITIONAL_CLEAN_FILES.rst | 17 ++++++++++++----- 3 files changed, 23 insertions(+), 11 deletions(-) hooks/post-receive -- CMake From kwrobot at kitware.com Sat Jun 8 03:13:04 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Sat, 8 Jun 2019 03:13:04 -0400 (EDT) Subject: [Cmake-commits] CMake branch, release, updated. v3.15.0-rc1-11-g8d3c919 Message-ID: <20190608071304.A3A29151C@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, release has been updated via 8d3c919a3cbef7d92f24409fa7a5737e835957ee (commit) via e61074c67226e3def13e75173e3b8bbdb1c3df2d (commit) via cebccdebaf12adc83c50f418c51b2d6b989d5350 (commit) from 43316424d0f33d6dc12ae5d1d4528603e8f0fab9 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- ----------------------------------------------------------------------- Summary of changes: Help/manual/cmake-properties.7.rst | 2 +- Help/prop_dir/ADDITIONAL_CLEAN_FILES.rst | 15 ++++++++++----- Help/prop_tgt/ADDITIONAL_CLEAN_FILES.rst | 17 ++++++++++++----- 3 files changed, 23 insertions(+), 11 deletions(-) hooks/post-receive -- CMake From kwrobot at kitware.com Sat Jun 8 03:13:04 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Sat, 8 Jun 2019 03:13:04 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc1-35-gf4bbeb7 Message-ID: <20190608071304.946CD4960@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via f4bbeb785c8f673a5cff326cc717d0dfbb2734a2 (commit) via 8d3c919a3cbef7d92f24409fa7a5737e835957ee (commit) from d93fe90c17de741c3986c3b13a6c5f5653a8104e (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f4bbeb785c8f673a5cff326cc717d0dfbb2734a2 commit f4bbeb785c8f673a5cff326cc717d0dfbb2734a2 Merge: d93fe90 8d3c919 Author: Craig Scott AuthorDate: Sat Jun 8 16:59:49 2019 +1000 Commit: Craig Scott CommitDate: Sat Jun 8 16:59:49 2019 +1000 Merge branch 'release-3.15' ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From kwrobot at kitware.com Sun Jun 9 00:03:04 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Sun, 9 Jun 2019 00:03:04 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc1-36-gd443b86 Message-ID: <20190609040304.90CDB103078@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via d443b86e58de53fe367f642a91eb5f52c7cec22b (commit) from f4bbeb785c8f673a5cff326cc717d0dfbb2734a2 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d443b86e58de53fe367f642a91eb5f52c7cec22b commit d443b86e58de53fe367f642a91eb5f52c7cec22b Author: Kitware Robot AuthorDate: Sun Jun 9 00:01:05 2019 -0400 Commit: Kitware Robot CommitDate: Sun Jun 9 00:01:05 2019 -0400 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 991b9f5..8ab22fe 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 15) -set(CMake_VERSION_PATCH 20190608) +set(CMake_VERSION_PATCH 20190609) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From kwrobot at kitware.com Mon Jun 10 00:03:04 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Mon, 10 Jun 2019 00:03:04 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc1-37-gf367191 Message-ID: <20190610040304.DAEA1111D87@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via f36719111de99e5be426552e9aaba96518b888b7 (commit) from d443b86e58de53fe367f642a91eb5f52c7cec22b (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f36719111de99e5be426552e9aaba96518b888b7 commit f36719111de99e5be426552e9aaba96518b888b7 Author: Kitware Robot AuthorDate: Mon Jun 10 00:01:05 2019 -0400 Commit: Kitware Robot CommitDate: Mon Jun 10 00:01:05 2019 -0400 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 8ab22fe..732f80a 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 15) -set(CMake_VERSION_PATCH 20190609) +set(CMake_VERSION_PATCH 20190610) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From kwrobot at kitware.com Tue Jun 11 00:03:06 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Tue, 11 Jun 2019 00:03:06 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc1-38-g7c0a542 Message-ID: <20190611040306.CD5BE11208B@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 7c0a542cf17169d41abdb868d6daa1e0fc51bb81 (commit) from f36719111de99e5be426552e9aaba96518b888b7 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7c0a542cf17169d41abdb868d6daa1e0fc51bb81 commit 7c0a542cf17169d41abdb868d6daa1e0fc51bb81 Author: Kitware Robot AuthorDate: Tue Jun 11 00:01:05 2019 -0400 Commit: Kitware Robot CommitDate: Tue Jun 11 00:01:05 2019 -0400 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 732f80a..33aef1e 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 15) -set(CMake_VERSION_PATCH 20190610) +set(CMake_VERSION_PATCH 20190611) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From kwrobot at kitware.com Tue Jun 11 12:13:05 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Tue, 11 Jun 2019 12:13:05 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc1-41-g14254e9 Message-ID: <20190611161305.2A5B6FAE6D@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 14254e9ea8ea3efc6d67aa2bf6e29e5d4fbafe4b (commit) via 54ec4c1e799759798cc2b625f1e6a9e5efb4a78e (commit) via 1f9ef25130caa89969cc69b4873edf1723533a5f (commit) from 7c0a542cf17169d41abdb868d6daa1e0fc51bb81 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=14254e9ea8ea3efc6d67aa2bf6e29e5d4fbafe4b commit 14254e9ea8ea3efc6d67aa2bf6e29e5d4fbafe4b Merge: 7c0a542 54ec4c1 Author: Kyle Edwards AuthorDate: Tue Jun 11 16:03:08 2019 +0000 Commit: Kitware Robot CommitDate: Tue Jun 11 12:03:38 2019 -0400 Merge topic 'get-runtime-dependencies' 54ec4c1e79 GetPrerequisites: Add deprecation notice 1f9ef25130 file: Add GET_RUNTIME_DEPENDENCIES mode Acked-by: Kitware Robot Merge-request: !3335 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=54ec4c1e799759798cc2b625f1e6a9e5efb4a78e commit 54ec4c1e799759798cc2b625f1e6a9e5efb4a78e Author: Kyle Edwards AuthorDate: Fri May 31 13:43:55 2019 -0400 Commit: Kyle Edwards CommitDate: Mon Jun 10 14:35:28 2019 -0400 GetPrerequisites: Add deprecation notice GetPrerequisites has now been superceded by file(GET_RUNTIME_DEPENDENCIES), so add a deprecation notice stating such. diff --git a/Help/release/dev/get-runtime-dependencies.rst b/Help/release/dev/get-runtime-dependencies.rst index ef7bba4..b9dc6e6 100644 --- a/Help/release/dev/get-runtime-dependencies.rst +++ b/Help/release/dev/get-runtime-dependencies.rst @@ -5,3 +5,5 @@ get-runtime-dependencies ``GET_RUNTIME_DEPENDENCIES``, which allows you to recursively get the list of libraries linked by an executable or library. This sub-command is intended as a replacement for :module:`GetPrerequisites`. +* The :module:`GetPrerequisites` module has been deprecated, as it has been + superceded by :command:`file(GET_RUNTIME_DEPENDENCIES)`. diff --git a/Modules/GetPrerequisites.cmake b/Modules/GetPrerequisites.cmake index 5be4676..41d9dc1 100644 --- a/Modules/GetPrerequisites.cmake +++ b/Modules/GetPrerequisites.cmake @@ -5,6 +5,10 @@ GetPrerequisites ---------------- +.. deprecated:: 3.16 + + Use :command:`file(GET_RUNTIME_DEPENDENCIES)` instead. + Functions to analyze and list executable file prerequisites. This module provides functions to list the .dll, .dylib or .so files https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1f9ef25130caa89969cc69b4873edf1723533a5f commit 1f9ef25130caa89969cc69b4873edf1723533a5f Author: Kyle Edwards AuthorDate: Thu Mar 14 11:58:34 2019 -0400 Commit: Kyle Edwards CommitDate: Mon Jun 10 14:35:28 2019 -0400 file: Add GET_RUNTIME_DEPENDENCIES mode Co-Authored-by: Bryon Bean diff --git a/Help/command/file.rst b/Help/command/file.rst index f99021e..666a532 100644 --- a/Help/command/file.rst +++ b/Help/command/file.rst @@ -13,6 +13,7 @@ Synopsis file(`STRINGS`_ [...]) file(`\ `_ ) file(`TIMESTAMP`_ [...]) + file(`GET_RUNTIME_DEPENDENCIES`_ [...]) `Writing`_ file({`WRITE`_ | `APPEND`_} ...) @@ -130,6 +131,273 @@ timestamp variable will be set to the empty string (""). See the :command:`string(TIMESTAMP)` command for documentation of the ```` and ``UTC`` options. +.. _GET_RUNTIME_DEPENDENCIES: + +.. code-block:: cmake + + file(GET_RUNTIME_DEPENDENCIES + [RESOLVED_DEPENDENCIES_VAR ] + [UNRESOLVED_DEPENDENCIES_VAR ] + [CONFLICTING_DEPENDENICES_PREFIX ] + [EXECUTABLES [...]] + [LIBRARIES [...]] + [MODULES [...]] + [DIRECTORIES [...]] + [BUNDLE_EXECUTABLE ] + [PRE_INCLUDE_REGEXES [...]] + [PRE_EXCLUDE_REGEXES [...]] + [POST_INCLUDE_REGEXES [...]] + [POST_EXCLUDE_REGEXES [...]] + ) + +Recursively get the list of libraries depended on by the given files. + +Please note that this sub-command is not intended to be used in project mode. +Instead, use it in an :command:`install(CODE)` or :command:`install(SCRIPT)` +block. For example: + +.. code-block:: cmake + + install(CODE [[ + file(GET_RUNTIME_DEPENDENCIES + # ... + ) + ]]) + +The arguments are as follows: + +``RESOLVED_DEPENDENCIES_VAR `` + Name of the variable in which to store the list of resolved dependencies. + +``UNRESOLVED_DEPENDENCIES_VAR `` + Name of the variable in which to store the list of unresolved dependencies. + If this variable is not specified, and there are any unresolved dependencies, + an error is issued. + +``CONFLICTING_DEPENDENCIES_PREFIX `` + Variable prefix in which to store conflicting dependency information. + Dependencies are conflicting if two files with the same name are found in + two different directories. The list of filenames that conflict are stored in + ``_FILENAMES``. For each filename, the list of paths + that were found for that filename are stored in + ``_``. + +``EXECUTABLES `` + List of executable files to read for dependencies. These are executables that + are typically created with :command:`add_executable`, but they do not have to + be created by CMake. On Apple platforms, the paths to these files determine + the value of ``@executable_path`` when recursively resolving the libraries. + Specifying ``STATIC`` libraries, ``MODULE`` s, or ``SHARED`` libraries here + will result in undefined behavior. + +``LIBRARIES `` + List of library files to read for dependencies. These are libraries that are + typically created with :command:`add_library(SHARED)`, but they do not have + to be created by CMake. Specifying ``STATIC`` libraries, ``MODULE`` s, or + executables here will result in undefined behavior. + +``MODULES `` + List of loadable module files to read for dependencies. These are modules + that are typically created with :command:`add_library(MODULE)`, but they do + not have to be created by CMake. They are typically used by calling + ``dlopen()`` at runtime rather than linked at link time with ``ld -l``. + Specifying ``STATIC`` libraries, ``SHARED`` libraries, or executables here + will result in undefined behavior. + +``DIRECTORIES `` + List of additional directories to search for dependencies. On Linux + platforms, these directories are searched if the dependency is not found in + any of the other usual paths. If it is found in such a directory, a warning + is issued, because it means that the file is incomplete (it does not list all + of the directories that contain its dependencies.) On Windows platforms, + these directories are searched if the dependency is not found in any of the + other search paths, but no warning is issued, because searching other paths + is a normal part of Windows dependency resolution. On Apple platforms, this + argument has no effect. + +``BUNDLE_EXECTUBLE `` + Executable to treat as the "bundle executable" when resolving libraries. On + Apple platforms, this argument determines the value of ``@executable_path`` + when recursively resolving libraries for ``LIBRARIES`` and ``MODULES`` files. + It has no effect on ``EXECUTABLES`` files. On other platforms, it has no + effect. This is typically (but not always) one of the executables in the + ``EXECUTABLES`` argument which designates the "main" executable of the + package. + +The following arguments specify filters for including or excluding libraries to +be resolved. See below for a full description of how they work. + +``PRE_INCLUDE_REGEXES `` + List of pre-include regexes through which to filter the names of + not-yet-resolved dependencies. + +``PRE_EXCLUDE_REGEXES `` + List of pre-exclude regexes through which to filter the names of + not-yet-resolved dependencies. + +``POST_INCLUDE_REGEXES `` + List of post-include regexes through which to filter the names of resolved + dependencies. + +``POST_EXCLUDE_REGEXES `` + List of post-exclude regexes through which to filter the names of resolved + dependencies. + +These arguments can be used to blacklist unwanted system libraries when +resolving the dependencies, or to whitelist libraries from a specific +directory. The filtering works as follows: + +1. If the not-yet-resolved dependency matches any of the + ``PRE_INCLUDE_REGEXES``, steps 2 and 3 are skipped, and the dependency + resolution proceeds to step 4. +2. If the not-yet-resolved dependency matches any of the + ``PRE_EXCLUDE_REGEXES``, dependency resolution stops for that dependency. +3. Otherwise, dependency resolution proceeds. +4. ``file(GET_RUNTIME_DEPENDENCIES)`` searches for the dependency according to + the linking rules of the platform (see below). +5. If the dependency is found, and its full path matches one of the + ``POST_INCLUDE_REGEXES``, the full path is added to the resolved + dependencies, and ``file(GET_RUNTIME_DEPENDENCIES)`` recursively resolves + that library's own dependencies. Otherwise, resolution proceeds to step 6. +6. If the dependency is found, but its full path matches one of the + ``POST_EXCLUDE_REGEXES``, it is not added to the resolved dependencies, and + dependency resolution stops for that dependency. +7. If the dependency is found, and its full path does not match either + ``POST_INCLUDE_REGEXES`` or ``POST_EXCLUDE_REGEXES``, the full path is added + to the resolved dependencies, and ``file(GET_RUNTIME_DEPENDENCIES)`` + recursively resolves that library's own dependencies. + +Different platforms have different rules for how dependencies are resolved. +These specifics are described here. + +On Linux platforms, library resolution works as follows: + +1. If the depending file does not have any ``RUNPATH`` entries, and the library + exists in one of the depending file's ``RPATH`` entries, or its parents', in + that order, the dependency is resolved to that file. +2. Otherwise, if the depending file has any ``RUNPATH`` entries, and the + library exists in one of those entries, the dependency is resolved to that + file. +3. Otherwise, if the library exists in one of the directories listed by + ``ldconfig``, the dependency is resolved to that file. +4. Otherwise, if the library exists in one of the ``DIRECTORIES`` entries, the + dependency is resolved to that file. In this case, a warning is issued, + because finding a file in one of the ``DIRECTORIES`` means that the + depending file is not complete (it does not list all the directories from + which it pulls dependencies.) +5. Otherwise, the dependency is unresolved. + +On Windows platforms, library resolution works as follows: + +1. The dependent DLL name is converted to lowercase. Windows DLL names are + case-insensitive, and some linkers mangle the case of the DLL dependency + names. However, this makes it more difficult for ``PRE_INCLUDE_REGEXES``, + ``PRE_EXCLUDE_REGEXES``, ``POST_INCLUDE_REGEXES``, and + ``POST_EXCLUDE_REGEXES`` to properly filter DLL names - every regex would + have to check for both uppercase and lowercase letters. For example: + + .. code-block:: cmake + + file(GET_RUNTIME_DEPENDENCIES + # ... + PRE_INCLUDE_REGEXES "^[Mm][Yy][Ll][Ii][Bb][Rr][Aa][Rr][Yy]\\.[Dd][Ll][Ll]$" + ) + + Converting the DLL name to lowercase allows the regexes to only match + lowercase names, thus simplifying the regex. For example: + + .. code-block:: cmake + + file(GET_RUNTIME_DEPENDENCIES + # ... + PRE_INCLUDE_REGEXES "^mylibrary\\.dll$" + ) + + This regex will match ``mylibrary.dll`` regardless of how it is cased, + either on disk or in the depending file. (For example, it will match + ``mylibrary.dll``, ``MyLibrary.dll``, and ``MYLIBRARY.DLL``.) + + Please note that the directory portion of any resolved DLLs retains its + casing and is not converted to lowercase. Only the filename portion is + converted. + +2. (**Not yet implemented**) If the depending file is a Windows Store app, and + the dependency is listed as a dependency in the application's package + manifest, the dependency is resolved to that file. +3. Otherwise, if the library exists in the same directory as the depending + file, the dependency is resolved to that file. +4. Otherwise, if the library exists in either the operating system's + ``system32`` directory or the ``Windows`` directory, in that order, the + dependency is resolved to that file. +5. Otherwise, if the library exists in one of the directories specified by + ``DIRECTORIES``, in the order they are listed, the dependency is resolved to + that file. (In this case, a warning is not issued, because searching other + directories is a normal part of Windows library resolution.) +6. Otherwise, the dependency is unresolved. + +On Apple platforms, library resolution works as follows: + +1. If the dependency starts with ``@executable_path/``, and an ``EXECUTABLES`` + argument is in the process of being resolved, and replacing + ``@executable_path/`` with the directory of the executable yields an + existing file, the dependency is resolved to that file. +2. Otherwise, if the dependency starts with ``@executable_path/``, and there is + a ``BUNDLE_EXECUTABLE`` argument, and replacing ``@executable_path/`` with + the directory of the bundle executable yields an existing file, the + dependency is resolved to that file. +3. Otherwise, if the dependency starts with ``@loader_path/``, and replacing + ``@loader_path/`` with the directory of the depending file yields an + existing file, the dependency is resolved to that file. +4. Otherwise, if the dependency starts with ``@rpath/``, and replacing + ``@rpath/`` with one of the ``RPATH`` entries of the depending file yields + an existing file, the dependency is resolved to that file. (Note that + ``RPATH`` entries that start with ``@executable_path/`` or ``@loader_path/`` + also have these items replaced with the appropriate path.) +5. Otherwise, if the dependency is an absolute file that exists, the dependency + is resolved to that file. +6. Otherwise, the dependency is unresolved. + +This function accepts several variables that determine which tool is used for +dependency resolution: + +.. variable:: CMAKE_GET_RUNTIME_DEPENDENCIES_PLATFORM + + Determines which operating system and executable format the files are built + for. This could be one of several values: + + * ``linux+elf`` + * ``windows+pe`` + * ``macos+macho`` + + If this variable is not specified, it is determined automatically by system + introspection. + +.. variable:: CMAKE_GET_RUNTIME_DEPENDENCIES_TOOL + + Determines the tool to use for dependency resolution. It could be one of + several values, depending on the value of + :variable:`CMAKE_GET_RUNTIME_DEPENDENCIES_PLATFORM`: + + ================================================= ============================================= + ``CMAKE_GET_RUNTIME_DEPENDENCIES_PLATFORM`` ``CMAKE_GET_RUNTIME_DEPENDENCIES_TOOL`` + ================================================= ============================================= + ``linux+elf`` ``objdump`` + ``windows+pe`` ``dumpbin`` + ``windows+pe`` ``objdump`` + ``macos+macho`` ``otool`` + ================================================= ============================================= + + If this variable is not specified, it is determined automatically by system + introspection. + +.. variable:: CMAKE_GET_RUNTIME_DEPENDENCIES_COMMAND + + Determines the path to the tool to use for dependency resolution. This is the + actual path to ``objdump``, ``dumpbin``, or ``otool``. + + If this variable is not specified, it is determined automatically by system + introspection. + Writing ^^^^^^^ diff --git a/Help/release/dev/get-runtime-dependencies.rst b/Help/release/dev/get-runtime-dependencies.rst new file mode 100644 index 0000000..ef7bba4 --- /dev/null +++ b/Help/release/dev/get-runtime-dependencies.rst @@ -0,0 +1,7 @@ +get-runtime-dependencies +------------------------ + +* The :command:`file` command learned a new sub-command, + ``GET_RUNTIME_DEPENDENCIES``, which allows you to recursively get the list of + libraries linked by an executable or library. This sub-command is intended as + a replacement for :module:`GetPrerequisites`. diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 695e075..af3a283 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -146,6 +146,28 @@ set(SRCS cmArgumentParser.cxx cmArgumentParser.h cmBase32.cxx + cmBinUtilsLinker.cxx + cmBinUtilsLinker.h + cmBinUtilsLinuxELFGetRuntimeDependenciesTool.cxx + cmBinUtilsLinuxELFGetRuntimeDependenciesTool.h + cmBinUtilsLinuxELFLinker.cxx + cmBinUtilsLinuxELFLinker.h + cmBinUtilsLinuxELFObjdumpGetRuntimeDependenciesTool.cxx + cmBinUtilsLinuxELFObjdumpGetRuntimeDependenciesTool.h + cmBinUtilsMacOSMachOGetRuntimeDependenciesTool.cxx + cmBinUtilsMacOSMachOGetRuntimeDependenciesTool.h + cmBinUtilsMacOSMachOLinker.cxx + cmBinUtilsMacOSMachOLinker.h + cmBinUtilsMacOSMachOOToolGetRuntimeDependenciesTool.cxx + cmBinUtilsMacOSMachOOToolGetRuntimeDependenciesTool.h + cmBinUtilsWindowsPEDumpbinGetRuntimeDependenciesTool.cxx + cmBinUtilsWindowsPEDumpbinGetRuntimeDependenciesTool.h + cmBinUtilsWindowsPEGetRuntimeDependenciesTool.cxx + cmBinUtilsWindowsPEGetRuntimeDependenciesTool.h + cmBinUtilsWindowsPELinker.cxx + cmBinUtilsWindowsPELinker.h + cmBinUtilsWindowsPEObjdumpGetRuntimeDependenciesTool.cxx + cmBinUtilsWindowsPEObjdumpGetRuntimeDependenciesTool.h cmCacheManager.cxx cmCacheManager.h cmCLocaleEnvironmentScope.h @@ -295,6 +317,10 @@ set(SRCS cmInstallTargetGenerator.cxx cmInstallDirectoryGenerator.h cmInstallDirectoryGenerator.cxx + cmLDConfigLDConfigTool.cxx + cmLDConfigLDConfigTool.h + cmLDConfigTool.cxx + cmLDConfigTool.h cmLinkedTree.h cmLinkItem.cxx cmLinkItem.h @@ -360,6 +386,8 @@ set(SRCS cmQtAutoRcc.h cmRST.cxx cmRST.h + cmRuntimeDependencyArchive.cxx + cmRuntimeDependencyArchive.h cmScriptGenerator.h cmScriptGenerator.cxx cmSourceFile.cxx diff --git a/Source/cmBinUtilsLinker.cxx b/Source/cmBinUtilsLinker.cxx new file mode 100644 index 0000000..3dac85c --- /dev/null +++ b/Source/cmBinUtilsLinker.cxx @@ -0,0 +1,15 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ + +#include "cmBinUtilsLinker.h" +#include "cmRuntimeDependencyArchive.h" + +cmBinUtilsLinker::cmBinUtilsLinker(cmRuntimeDependencyArchive* archive) + : Archive(archive) +{ +} + +void cmBinUtilsLinker::SetError(const std::string& e) +{ + this->Archive->SetError(e); +} diff --git a/Source/cmBinUtilsLinker.h b/Source/cmBinUtilsLinker.h new file mode 100644 index 0000000..29853a5 --- /dev/null +++ b/Source/cmBinUtilsLinker.h @@ -0,0 +1,30 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ + +#ifndef cmBinUtilsLinker_h +#define cmBinUtilsLinker_h + +#include "cmStateTypes.h" + +#include + +class cmRuntimeDependencyArchive; + +class cmBinUtilsLinker +{ +public: + cmBinUtilsLinker(cmRuntimeDependencyArchive* archive); + virtual ~cmBinUtilsLinker() = default; + + virtual bool Prepare() { return true; } + + virtual bool ScanDependencies(std::string const& file, + cmStateEnums::TargetType type) = 0; + +protected: + cmRuntimeDependencyArchive* Archive; + + void SetError(const std::string& e); +}; + +#endif // cmBinUtilsLinker_h diff --git a/Source/cmBinUtilsLinuxELFGetRuntimeDependenciesTool.cxx b/Source/cmBinUtilsLinuxELFGetRuntimeDependenciesTool.cxx new file mode 100644 index 0000000..40de592 --- /dev/null +++ b/Source/cmBinUtilsLinuxELFGetRuntimeDependenciesTool.cxx @@ -0,0 +1,18 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ + +#include "cmBinUtilsLinuxELFGetRuntimeDependenciesTool.h" +#include "cmRuntimeDependencyArchive.h" + +cmBinUtilsLinuxELFGetRuntimeDependenciesTool:: + cmBinUtilsLinuxELFGetRuntimeDependenciesTool( + cmRuntimeDependencyArchive* archive) + : Archive(archive) +{ +} + +void cmBinUtilsLinuxELFGetRuntimeDependenciesTool::SetError( + const std::string& error) +{ + this->Archive->SetError(error); +} diff --git a/Source/cmBinUtilsLinuxELFGetRuntimeDependenciesTool.h b/Source/cmBinUtilsLinuxELFGetRuntimeDependenciesTool.h new file mode 100644 index 0000000..d514e7f --- /dev/null +++ b/Source/cmBinUtilsLinuxELFGetRuntimeDependenciesTool.h @@ -0,0 +1,30 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ + +#ifndef cmBinUtilsLinuxELFGetRuntimeDependenciesTool_h +#define cmBinUtilsLinuxELFGetRuntimeDependenciesTool_h + +#include +#include + +class cmRuntimeDependencyArchive; + +class cmBinUtilsLinuxELFGetRuntimeDependenciesTool +{ +public: + cmBinUtilsLinuxELFGetRuntimeDependenciesTool( + cmRuntimeDependencyArchive* archive); + virtual ~cmBinUtilsLinuxELFGetRuntimeDependenciesTool() = default; + + virtual bool GetFileInfo(std::string const& file, + std::vector& needed, + std::vector& rpaths, + std::vector& runpaths) = 0; + +protected: + cmRuntimeDependencyArchive* Archive; + + void SetError(const std::string& e); +}; + +#endif // cmBinUtilsLinuxELFGetRuntimeDependenciesTool_h diff --git a/Source/cmBinUtilsLinuxELFLinker.cxx b/Source/cmBinUtilsLinuxELFLinker.cxx new file mode 100644 index 0000000..4fb15f2 --- /dev/null +++ b/Source/cmBinUtilsLinuxELFLinker.cxx @@ -0,0 +1,177 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ + +#include "cmBinUtilsLinuxELFLinker.h" +#include "cmAlgorithms.h" +#include "cmBinUtilsLinuxELFObjdumpGetRuntimeDependenciesTool.h" +#include "cmLDConfigLDConfigTool.h" +#include "cmMakefile.h" +#include "cmMessageType.h" +#include "cmRuntimeDependencyArchive.h" +#include "cmSystemTools.h" + +#include + +#include +#include + +static std::string ReplaceOrigin(const std::string& rpath, + const std::string& origin) +{ + static const cmsys::RegularExpression originRegex( + "(\\$ORIGIN)([^a-zA-Z0-9_]|$)"); + static const cmsys::RegularExpression originCurlyRegex("\\${ORIGIN}"); + + cmsys::RegularExpressionMatch match; + if (originRegex.find(rpath.c_str(), match)) { + std::string begin = rpath.substr(0, match.start(1)); + std::string end = rpath.substr(match.end(1)); + return begin + origin + end; + } + if (originCurlyRegex.find(rpath.c_str(), match)) { + std::string begin = rpath.substr(0, match.start()); + std::string end = rpath.substr(match.end()); + return begin + origin + end; + } + return rpath; +} + +cmBinUtilsLinuxELFLinker::cmBinUtilsLinuxELFLinker( + cmRuntimeDependencyArchive* archive) + : cmBinUtilsLinker(archive) +{ +} + +bool cmBinUtilsLinuxELFLinker::Prepare() +{ + std::string tool = this->Archive->GetGetRuntimeDependenciesTool(); + if (tool.empty()) { + tool = "objdump"; + } + if (tool == "objdump") { + this->Tool = + cm::make_unique( + this->Archive); + } else { + std::ostringstream e; + e << "Invalid value for CMAKE_GET_RUNTIME_DEPENDENCIES_TOOL: " << tool; + this->SetError(e.str()); + return false; + } + + std::string ldConfigTool = + this->Archive->GetMakefile()->GetSafeDefinition("CMAKE_LDCONFIG_TOOL"); + if (ldConfigTool.empty()) { + ldConfigTool = "ldconfig"; + } + if (ldConfigTool == "ldconfig") { + this->LDConfigTool = + cm::make_unique(this->Archive); + } else { + std::ostringstream e; + e << "Invalid value for CMAKE_LDCONFIG_TOOL: " << ldConfigTool; + this->SetError(e.str()); + return false; + } + + return true; +} + +bool cmBinUtilsLinuxELFLinker::ScanDependencies( + std::string const& file, cmStateEnums::TargetType /* unused */) +{ + std::vector parentRpaths; + return this->ScanDependencies(file, parentRpaths); +} + +bool cmBinUtilsLinuxELFLinker::ScanDependencies( + std::string const& file, std::vector const& parentRpaths) +{ + std::string origin = cmSystemTools::GetFilenamePath(file); + std::vector needed; + std::vector rpaths; + std::vector runpaths; + if (!this->Tool->GetFileInfo(file, needed, rpaths, runpaths)) { + return false; + } + for (auto& runpath : runpaths) { + runpath = ReplaceOrigin(runpath, origin); + } + for (auto& rpath : rpaths) { + rpath = ReplaceOrigin(rpath, origin); + } + + std::vector searchPaths; + if (!runpaths.empty()) { + searchPaths = runpaths; + } else { + searchPaths = rpaths; + searchPaths.insert(searchPaths.end(), parentRpaths.begin(), + parentRpaths.end()); + } + + std::vector ldConfigPaths; + if (!this->LDConfigTool->GetLDConfigPaths(ldConfigPaths)) { + return false; + } + searchPaths.insert(searchPaths.end(), ldConfigPaths.begin(), + ldConfigPaths.end()); + + for (auto const& dep : needed) { + if (!this->Archive->IsPreExcluded(dep)) { + std::string path; + bool resolved = false; + if (dep.find('/') != std::string::npos) { + this->SetError("Paths to dependencies are not supported"); + return false; + } + if (!this->ResolveDependency(dep, searchPaths, path, resolved)) { + return false; + } + if (resolved) { + if (!this->Archive->IsPostExcluded(path)) { + bool unique; + this->Archive->AddResolvedPath(dep, path, unique); + if (unique && !this->ScanDependencies(path, rpaths)) { + return false; + } + } + } else { + this->Archive->AddUnresolvedPath(dep); + } + } + } + + return true; +} + +bool cmBinUtilsLinuxELFLinker::ResolveDependency( + std::string const& name, std::vector const& searchPaths, + std::string& path, bool& resolved) +{ + for (auto const& searchPath : searchPaths) { + path = searchPath + '/' + name; + if (cmSystemTools::PathExists(path)) { + resolved = true; + return true; + } + } + + for (auto const& searchPath : this->Archive->GetSearchDirectories()) { + path = searchPath + '/' + name; + if (cmSystemTools::PathExists(path)) { + std::ostringstream warning; + warning << "Dependency " << name << " found in search directory:\n " + << searchPath + << "\nSee file(GET_RUNTIME_DEPENDENCIES) documentation for " + << "more information."; + this->Archive->GetMakefile()->IssueMessage(MessageType::WARNING, + warning.str()); + resolved = true; + return true; + } + } + + resolved = false; + return true; +} diff --git a/Source/cmBinUtilsLinuxELFLinker.h b/Source/cmBinUtilsLinuxELFLinker.h new file mode 100644 index 0000000..348edc4 --- /dev/null +++ b/Source/cmBinUtilsLinuxELFLinker.h @@ -0,0 +1,44 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ + +#ifndef cmBinUtilsLinuxELFLinker_h +#define cmBinUtilsLinuxELFLinker_h + +#include "cmBinUtilsLinker.h" +#include "cmBinUtilsLinuxELFGetRuntimeDependenciesTool.h" +#include "cmLDConfigTool.h" +#include "cmStateTypes.h" + +#include // IWYU pragma: keep +#include +#include + +class cmRuntimeDependencyArchive; + +class cmBinUtilsLinuxELFLinker : public cmBinUtilsLinker +{ +public: + cmBinUtilsLinuxELFLinker(cmRuntimeDependencyArchive* archive); + + bool Prepare() override; + + bool ScanDependencies(std::string const& file, + cmStateEnums::TargetType type) override; + +private: + std::unique_ptr Tool; + std::unique_ptr LDConfigTool; + bool HaveLDConfigPaths = false; + std::vector LDConfigPaths; + + bool ScanDependencies(std::string const& file, + std::vector const& parentRpaths); + + bool ResolveDependency(std::string const& name, + std::vector const& searchPaths, + std::string& path, bool& resolved); + + bool GetLDConfigPaths(); +}; + +#endif // cmBinUtilsLinuxELFLinker_h diff --git a/Source/cmBinUtilsLinuxELFObjdumpGetRuntimeDependenciesTool.cxx b/Source/cmBinUtilsLinuxELFObjdumpGetRuntimeDependenciesTool.cxx new file mode 100644 index 0000000..3bf7bf8 --- /dev/null +++ b/Source/cmBinUtilsLinuxELFObjdumpGetRuntimeDependenciesTool.cxx @@ -0,0 +1,84 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ + +#include "cmBinUtilsLinuxELFObjdumpGetRuntimeDependenciesTool.h" +#include "cmRuntimeDependencyArchive.h" +#include "cmSystemTools.h" +#include "cmUVProcessChain.h" + +#include + +#include + +cmBinUtilsLinuxELFObjdumpGetRuntimeDependenciesTool:: + cmBinUtilsLinuxELFObjdumpGetRuntimeDependenciesTool( + cmRuntimeDependencyArchive* archive) + : cmBinUtilsLinuxELFGetRuntimeDependenciesTool(archive) +{ +} + +bool cmBinUtilsLinuxELFObjdumpGetRuntimeDependenciesTool::GetFileInfo( + std::string const& file, std::vector& needed, + std::vector& rpaths, std::vector& runpaths) +{ + cmUVProcessChainBuilder builder; + builder.SetBuiltinStream(cmUVProcessChainBuilder::Stream_OUTPUT); + + std::vector command; + if (!this->Archive->GetGetRuntimeDependenciesCommand("objdump", command)) { + this->SetError("Could not find objdump"); + return false; + } + command.emplace_back("-p"); + command.push_back(file); + builder.AddCommand(command); + + auto process = builder.Start(); + if (!process.Valid()) { + std::ostringstream e; + e << "Failed to start objdump process for:\n " << file; + this->SetError(e.str()); + return false; + } + + std::string line; + static const cmsys::RegularExpression neededRegex("^ *NEEDED *([^\n]*)$"); + static const cmsys::RegularExpression rpathRegex("^ *RPATH *([^\n]*)$"); + static const cmsys::RegularExpression runpathRegex("^ *RUNPATH *([^\n]*)$"); + while (std::getline(*process.OutputStream(), line)) { + cmsys::RegularExpressionMatch match; + if (neededRegex.find(line.c_str(), match)) { + needed.push_back(match.match(1)); + } else if (rpathRegex.find(line.c_str(), match)) { + std::vector rpathSplit = + cmSystemTools::SplitString(match.match(1), ':'); + rpaths.reserve(rpaths.size() + rpathSplit.size()); + for (auto const& rpath : rpathSplit) { + rpaths.push_back(rpath); + } + } else if (runpathRegex.find(line.c_str(), match)) { + std::vector runpathSplit = + cmSystemTools::SplitString(match.match(1), ':'); + runpaths.reserve(runpaths.size() + runpathSplit.size()); + for (auto const& runpath : runpathSplit) { + runpaths.push_back(runpath); + } + } + } + + if (!process.Wait()) { + std::ostringstream e; + e << "Failed to wait on objdump process for:\n " << file; + this->SetError(e.str()); + return false; + } + auto status = process.GetStatus(); + if (!status[0] || status[0]->ExitStatus != 0) { + std::ostringstream e; + e << "Failed to run objdump on:\n " << file; + this->SetError(e.str()); + return false; + } + + return true; +} diff --git a/Source/cmBinUtilsLinuxELFObjdumpGetRuntimeDependenciesTool.h b/Source/cmBinUtilsLinuxELFObjdumpGetRuntimeDependenciesTool.h new file mode 100644 index 0000000..286337f --- /dev/null +++ b/Source/cmBinUtilsLinuxELFObjdumpGetRuntimeDependenciesTool.h @@ -0,0 +1,26 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ + +#ifndef cmBinUtilsLinuxELFGetRuntimeCollectDependenciesTool_h +#define cmBinUtilsLinuxELFGetRuntimeCollectDependenciesTool_h + +#include "cmBinUtilsLinuxELFGetRuntimeDependenciesTool.h" + +#include +#include + +class cmRuntimeDependencyArchive; + +class cmBinUtilsLinuxELFObjdumpGetRuntimeDependenciesTool + : public cmBinUtilsLinuxELFGetRuntimeDependenciesTool +{ +public: + cmBinUtilsLinuxELFObjdumpGetRuntimeDependenciesTool( + cmRuntimeDependencyArchive* archive); + + bool GetFileInfo(std::string const& file, std::vector& needed, + std::vector& rpaths, + std::vector& runpaths) override; +}; + +#endif // cmBinUtilsLinuxELFObjdumpGetRuntimeDependenciesTool_h diff --git a/Source/cmBinUtilsMacOSMachOGetRuntimeDependenciesTool.cxx b/Source/cmBinUtilsMacOSMachOGetRuntimeDependenciesTool.cxx new file mode 100644 index 0000000..a296a47 --- /dev/null +++ b/Source/cmBinUtilsMacOSMachOGetRuntimeDependenciesTool.cxx @@ -0,0 +1,19 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ + +#include "cmBinUtilsMacOSMachOGetRuntimeDependenciesTool.h" + +#include "cmRuntimeDependencyArchive.h" + +cmBinUtilsMacOSMachOGetRuntimeDependenciesTool:: + cmBinUtilsMacOSMachOGetRuntimeDependenciesTool( + cmRuntimeDependencyArchive* archive) + : Archive(archive) +{ +} + +void cmBinUtilsMacOSMachOGetRuntimeDependenciesTool::SetError( + const std::string& error) +{ + this->Archive->SetError(error); +} diff --git a/Source/cmBinUtilsMacOSMachOGetRuntimeDependenciesTool.h b/Source/cmBinUtilsMacOSMachOGetRuntimeDependenciesTool.h new file mode 100644 index 0000000..dbb2882 --- /dev/null +++ b/Source/cmBinUtilsMacOSMachOGetRuntimeDependenciesTool.h @@ -0,0 +1,29 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ + +#ifndef cmBinUtilsMacOSMachOGetRuntimeDependenciesTool_h +#define cmBinUtilsMacOSMachOGetRuntimeDependenciesTool_h + +#include +#include + +class cmRuntimeDependencyArchive; + +class cmBinUtilsMacOSMachOGetRuntimeDependenciesTool +{ +public: + cmBinUtilsMacOSMachOGetRuntimeDependenciesTool( + cmRuntimeDependencyArchive* archive); + virtual ~cmBinUtilsMacOSMachOGetRuntimeDependenciesTool() = default; + + virtual bool GetFileInfo(std::string const& file, + std::vector& libs, + std::vector& rpaths) = 0; + +protected: + cmRuntimeDependencyArchive* Archive; + + void SetError(const std::string& error); +}; + +#endif // cmBinUtilsMacOSMachOGetRuntimeDependenciesTool_h diff --git a/Source/cmBinUtilsMacOSMachOLinker.cxx b/Source/cmBinUtilsMacOSMachOLinker.cxx new file mode 100644 index 0000000..e219847 --- /dev/null +++ b/Source/cmBinUtilsMacOSMachOLinker.cxx @@ -0,0 +1,228 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ + +#include "cmBinUtilsMacOSMachOLinker.h" + +#include "cmAlgorithms.h" +#include "cmBinUtilsMacOSMachOOToolGetRuntimeDependenciesTool.h" +#include "cmRuntimeDependencyArchive.h" +#include "cmSystemTools.h" + +#include +#include +#include + +cmBinUtilsMacOSMachOLinker::cmBinUtilsMacOSMachOLinker( + cmRuntimeDependencyArchive* archive) + : cmBinUtilsLinker(archive) +{ +} + +bool cmBinUtilsMacOSMachOLinker::Prepare() +{ + std::string tool = this->Archive->GetGetRuntimeDependenciesTool(); + if (tool.empty()) { + tool = "otool"; + } + if (tool == "otool") { + this->Tool = + cm::make_unique( + this->Archive); + } else { + std::ostringstream e; + e << "Invalid value for CMAKE_GET_RUNTIME_DEPENDENCIES_TOOL: " << tool; + this->SetError(e.str()); + return false; + } + + return true; +} + +bool cmBinUtilsMacOSMachOLinker::ScanDependencies( + std::string const& file, cmStateEnums::TargetType type) +{ + std::string executableFile; + if (type == cmStateEnums::EXECUTABLE) { + executableFile = file; + } else { + executableFile = this->Archive->GetBundleExecutable(); + } + std::string executablePath; + if (!executableFile.empty()) { + executablePath = cmSystemTools::GetFilenamePath(executableFile); + } + return this->ScanDependencies(file, executablePath); +} + +bool cmBinUtilsMacOSMachOLinker::ScanDependencies( + std::string const& file, std::string const& executablePath) +{ + std::vector libs, rpaths; + if (!this->Tool->GetFileInfo(file, libs, rpaths)) { + return false; + } + + std::string loaderPath = cmSystemTools::GetFilenamePath(file); + return this->GetFileDependencies(libs, executablePath, loaderPath, rpaths); +} + +bool cmBinUtilsMacOSMachOLinker::GetFileDependencies( + std::vector const& names, std::string const& executablePath, + std::string const& loaderPath, std::vector const& rpaths) +{ + for (std::string const& name : names) { + if (!this->Archive->IsPreExcluded(name)) { + std::string path; + bool resolved; + if (!this->ResolveDependency(name, executablePath, loaderPath, rpaths, + path, resolved)) { + return false; + } + if (resolved) { + if (!this->Archive->IsPostExcluded(path)) { + auto filename = cmSystemTools::GetFilenameName(path); + bool unique; + this->Archive->AddResolvedPath(filename, path, unique); + if (unique && !this->ScanDependencies(path, executablePath)) { + return false; + } + } + } else { + this->Archive->AddUnresolvedPath(name); + } + } + } + + return true; +} + +bool cmBinUtilsMacOSMachOLinker::ResolveDependency( + std::string const& name, std::string const& executablePath, + std::string const& loaderPath, std::vector const& rpaths, + std::string& path, bool& resolved) +{ + resolved = false; + if (cmHasLiteralPrefix(name, "@rpath/")) { + if (!this->ResolveRPathDependency(name, executablePath, loaderPath, rpaths, + path, resolved)) { + return false; + } + } else if (cmHasLiteralPrefix(name, "@loader_path/")) { + if (!this->ResolveLoaderPathDependency(name, loaderPath, path, resolved)) { + return false; + } + } else if (cmHasLiteralPrefix(name, "@executable_path/")) { + if (!this->ResolveExecutablePathDependency(name, executablePath, path, + resolved)) { + return false; + } + } else { + resolved = true; + path = name; + } + + if (resolved && !cmSystemTools::FileIsFullPath(path)) { + this->SetError("Resolved path is not absolute"); + return false; + } + + return true; +} + +bool cmBinUtilsMacOSMachOLinker::ResolveExecutablePathDependency( + std::string const& name, std::string const& executablePath, + std::string& path, bool& resolved) +{ + if (executablePath.empty()) { + resolved = false; + return true; + } + + // 16 is == "@executable_path".length() + path = name; + path.replace(0, 16, executablePath); + + if (!cmSystemTools::PathExists(path)) { + resolved = false; + return true; + } + + resolved = true; + return true; +} + +bool cmBinUtilsMacOSMachOLinker::ResolveLoaderPathDependency( + std::string const& name, std::string const& loaderPath, std::string& path, + bool& resolved) +{ + if (loaderPath.empty()) { + resolved = false; + return true; + } + + // 12 is "@loader_path".length(); + path = name; + path.replace(0, 12, loaderPath); + + if (!cmSystemTools::PathExists(path)) { + resolved = false; + return true; + } + + resolved = true; + return true; +} + +bool cmBinUtilsMacOSMachOLinker::ResolveRPathDependency( + std::string const& name, std::string const& executablePath, + std::string const& loaderPath, std::vector const& rpaths, + std::string& path, bool& resolved) +{ + for (std::string const& rpath : rpaths) { + std::string searchFile = name; + searchFile.replace(0, 6, rpath); + if (cmHasLiteralPrefix(searchFile, "@loader_path/")) { + if (!this->ResolveLoaderPathDependency(searchFile, loaderPath, path, + resolved)) { + return false; + } + if (resolved) { + return true; + } + } else if (cmHasLiteralPrefix(searchFile, "@executable_path/")) { + if (!this->ResolveExecutablePathDependency(searchFile, executablePath, + path, resolved)) { + return false; + } + if (resolved) { + return true; + } + } else if (cmSystemTools::PathExists(searchFile)) { + /* + * paraphrasing @ben.boeckel: + * if /b/libB.dylib is supposed to be used, + * /a/libbB.dylib will be found first if it exists. CMake tries to + * sort rpath directories to avoid this, but sometimes there is no + * right answer. + * + * I believe it is possible to resolve this using otools -l + * then checking the LC_LOAD_DYLIB command whose name is + * equal to the value of search_file, UNLESS the build + * specifically sets the RPath to paths that will match + * duplicate libs; at this point can we just point to + * user error, or is there a reason why the advantages + * to this scenario outweigh its disadvantages? + * + * Also priority seems to be the order as passed in when compiled + * so as long as this method's resolution guarantees priority + * in that manner further checking should not be necessary? + */ + path = searchFile; + resolved = true; + return true; + } + } + + resolved = false; + return true; +} diff --git a/Source/cmBinUtilsMacOSMachOLinker.h b/Source/cmBinUtilsMacOSMachOLinker.h new file mode 100644 index 0000000..0350d1e --- /dev/null +++ b/Source/cmBinUtilsMacOSMachOLinker.h @@ -0,0 +1,59 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ + +#ifndef cmBinUtilsMacOSMachOLinker_h +#define cmBinUtilsMacOSMachOLinker_h + +#include "cmBinUtilsLinker.h" +#include "cmBinUtilsMacOSMachOGetRuntimeDependenciesTool.h" +#include "cmStateTypes.h" + +#include // IWYU pragma: keep +#include +#include + +class cmRuntimeDependencyArchive; + +class cmBinUtilsMacOSMachOLinker : public cmBinUtilsLinker +{ +public: + cmBinUtilsMacOSMachOLinker(cmRuntimeDependencyArchive* archive); + + bool Prepare() override; + + bool ScanDependencies(std::string const& file, + cmStateEnums::TargetType type) override; + +private: + std::unique_ptr Tool; + + bool ScanDependencies(std::string const& file, + std::string const& executablePath); + + bool GetFileDependencies(std::vector const& names, + std::string const& executablePath, + std::string const& loaderPath, + std::vector const& rpaths); + + bool ResolveDependency(std::string const& name, + std::string const& executablePath, + std::string const& loaderPath, + std::vector const& rpaths, + std::string& path, bool& resolved); + + bool ResolveExecutablePathDependency(std::string const& name, + std::string const& executablePath, + std::string& path, bool& resolved); + + bool ResolveLoaderPathDependency(std::string const& name, + std::string const& loaderPath, + std::string& path, bool& resolved); + + bool ResolveRPathDependency(std::string const& name, + std::string const& executablePath, + std::string const& loaderPath, + std::vector const& rpaths, + std::string& path, bool& resolved); +}; + +#endif // cmBinUtilsMacOSMachOLinker_h diff --git a/Source/cmBinUtilsMacOSMachOOToolGetRuntimeDependenciesTool.cxx b/Source/cmBinUtilsMacOSMachOOToolGetRuntimeDependenciesTool.cxx new file mode 100644 index 0000000..bab2382 --- /dev/null +++ b/Source/cmBinUtilsMacOSMachOOToolGetRuntimeDependenciesTool.cxx @@ -0,0 +1,100 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ + +#include "cmBinUtilsMacOSMachOOToolGetRuntimeDependenciesTool.h" + +#include "cmRuntimeDependencyArchive.h" +#include "cmUVProcessChain.h" + +#include + +#include + +cmBinUtilsMacOSMachOOToolGetRuntimeDependenciesTool:: + cmBinUtilsMacOSMachOOToolGetRuntimeDependenciesTool( + cmRuntimeDependencyArchive* archive) + : cmBinUtilsMacOSMachOGetRuntimeDependenciesTool(archive) +{ +} + +bool cmBinUtilsMacOSMachOOToolGetRuntimeDependenciesTool::GetFileInfo( + std::string const& file, std::vector& libs, + std::vector& rpaths) +{ + std::vector command; + if (!this->Archive->GetGetRuntimeDependenciesCommand("otool", command)) { + this->SetError("Could not find otool"); + return false; + } + command.emplace_back("-l"); + command.emplace_back(file); + + cmUVProcessChainBuilder builder; + builder.SetBuiltinStream(cmUVProcessChainBuilder::Stream_OUTPUT) + .AddCommand(command); + + auto process = builder.Start(); + if (!process.Valid()) { + std::ostringstream e; + e << "Failed to start otool process for:\n " << file; + this->SetError(e.str()); + return false; + } + + std::string line; + static const cmsys::RegularExpression rpathRegex("^ *cmd LC_RPATH$"); + static const cmsys::RegularExpression loadDylibRegex( + "^ *cmd LC_LOAD_DYLIB$"); + static const cmsys::RegularExpression pathRegex( + "^ *path (.*) \\(offset [0-9]+\\)$"); + static const cmsys::RegularExpression nameRegex( + "^ *name (.*) \\(offset [0-9]+\\)$"); + while (std::getline(*process.OutputStream(), line)) { + cmsys::RegularExpressionMatch cmdMatch; + if (rpathRegex.find(line.c_str(), cmdMatch)) { + if (!std::getline(*process.OutputStream(), line) || + !std::getline(*process.OutputStream(), line)) { + this->SetError("Invalid output from otool"); + return false; + } + + cmsys::RegularExpressionMatch pathMatch; + if (pathRegex.find(line.c_str(), pathMatch)) { + rpaths.push_back(pathMatch.match(1)); + } else { + this->SetError("Invalid output from otool"); + return false; + } + } else if (loadDylibRegex.find(line.c_str(), cmdMatch)) { + if (!std::getline(*process.OutputStream(), line) || + !std::getline(*process.OutputStream(), line)) { + this->SetError("Invalid output from otool"); + return false; + } + + cmsys::RegularExpressionMatch nameMatch; + if (nameRegex.find(line.c_str(), nameMatch)) { + libs.push_back(nameMatch.match(1)); + } else { + this->SetError("Invalid output from otool"); + return false; + } + } + } + + if (!process.Wait()) { + std::ostringstream e; + e << "Failed to wait on otool process for:\n " << file; + this->SetError(e.str()); + return false; + } + auto status = process.GetStatus(); + if (!status[0] || status[0]->ExitStatus != 0) { + std::ostringstream e; + e << "Failed to run otool on:\n " << file; + this->SetError(e.str()); + return false; + } + + return true; +} diff --git a/Source/cmBinUtilsMacOSMachOOToolGetRuntimeDependenciesTool.h b/Source/cmBinUtilsMacOSMachOOToolGetRuntimeDependenciesTool.h new file mode 100644 index 0000000..12bcbc1 --- /dev/null +++ b/Source/cmBinUtilsMacOSMachOOToolGetRuntimeDependenciesTool.h @@ -0,0 +1,25 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ + +#ifndef cmBinUtilsMacOSMachOOToolGetRuntimeDependenciesTool_h +#define cmBinUtilsMacOSMachOOToolGetRuntimeDependenciesTool_h + +#include "cmBinUtilsMacOSMachOGetRuntimeDependenciesTool.h" + +#include +#include + +class cmRuntimeDependencyArchive; + +class cmBinUtilsMacOSMachOOToolGetRuntimeDependenciesTool + : public cmBinUtilsMacOSMachOGetRuntimeDependenciesTool +{ +public: + cmBinUtilsMacOSMachOOToolGetRuntimeDependenciesTool( + cmRuntimeDependencyArchive* archive); + + bool GetFileInfo(std::string const& file, std::vector& libs, + std::vector& rpaths) override; +}; + +#endif // cmBinUtilsMacOSMachOOToolGetRuntimeDependenciesTool_h diff --git a/Source/cmBinUtilsWindowsPEDumpbinGetRuntimeDependenciesTool.cxx b/Source/cmBinUtilsWindowsPEDumpbinGetRuntimeDependenciesTool.cxx new file mode 100644 index 0000000..2b35e30 --- /dev/null +++ b/Source/cmBinUtilsWindowsPEDumpbinGetRuntimeDependenciesTool.cxx @@ -0,0 +1,67 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ + +#include "cmBinUtilsWindowsPEDumpbinGetRuntimeDependenciesTool.h" +#include "cmRuntimeDependencyArchive.h" +#include "cmUVProcessChain.h" + +#include + +#include + +cmBinUtilsWindowsPEDumpbinGetRuntimeDependenciesTool:: + cmBinUtilsWindowsPEDumpbinGetRuntimeDependenciesTool( + cmRuntimeDependencyArchive* archive) + : cmBinUtilsWindowsPEGetRuntimeDependenciesTool(archive) +{ +} + +bool cmBinUtilsWindowsPEDumpbinGetRuntimeDependenciesTool::GetFileInfo( + const std::string& file, std::vector& needed) +{ + cmUVProcessChainBuilder builder; + builder.SetBuiltinStream(cmUVProcessChainBuilder::Stream_OUTPUT); + + std::vector command; + if (!this->Archive->GetGetRuntimeDependenciesCommand("dumpbin", command)) { + this->SetError("Could not find dumpbin"); + return false; + } + command.emplace_back("/dependents"); + command.push_back(file); + builder.AddCommand(command); + + auto process = builder.Start(); + if (!process.Valid()) { + std::ostringstream e; + e << "Failed to start dumpbin process for:\n " << file; + this->SetError(e.str()); + return false; + } + + std::string line; + static const cmsys::RegularExpression regex( + "^ ([^\n]*\\.[Dd][Ll][Ll])\r$"); + while (std::getline(*process.OutputStream(), line)) { + cmsys::RegularExpressionMatch match; + if (regex.find(line.c_str(), match)) { + needed.push_back(match.match(1)); + } + } + + if (!process.Wait()) { + std::ostringstream e; + e << "Failed to wait on dumpbin process for:\n " << file; + this->SetError(e.str()); + return false; + } + auto status = process.GetStatus(); + if (!status[0] || status[0]->ExitStatus != 0) { + std::ostringstream e; + e << "Failed to run dumpbin on:\n " << file; + this->SetError(e.str()); + return false; + } + + return true; +} diff --git a/Source/cmBinUtilsWindowsPEDumpbinGetRuntimeDependenciesTool.h b/Source/cmBinUtilsWindowsPEDumpbinGetRuntimeDependenciesTool.h new file mode 100644 index 0000000..4c17f8d --- /dev/null +++ b/Source/cmBinUtilsWindowsPEDumpbinGetRuntimeDependenciesTool.h @@ -0,0 +1,25 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ + +#ifndef cmBinUtilsWindowsPEDumpbinGetRuntimeDependenciesTool_h +#define cmBinUtilsWindowsPEDumpbinGetRuntimeDependenciesTool_h + +#include "cmBinUtilsWindowsPEGetRuntimeDependenciesTool.h" + +#include +#include + +class cmRuntimeDependencyArchive; + +class cmBinUtilsWindowsPEDumpbinGetRuntimeDependenciesTool + : public cmBinUtilsWindowsPEGetRuntimeDependenciesTool +{ +public: + cmBinUtilsWindowsPEDumpbinGetRuntimeDependenciesTool( + cmRuntimeDependencyArchive* archive); + + bool GetFileInfo(const std::string& file, + std::vector& needed) override; +}; + +#endif // cmBinUtilsWindowsPEDumpbinGetRuntimeDependenciesTool_h diff --git a/Source/cmBinUtilsWindowsPEGetRuntimeDependenciesTool.cxx b/Source/cmBinUtilsWindowsPEGetRuntimeDependenciesTool.cxx new file mode 100644 index 0000000..f5a4431 --- /dev/null +++ b/Source/cmBinUtilsWindowsPEGetRuntimeDependenciesTool.cxx @@ -0,0 +1,18 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ + +#include "cmBinUtilsWindowsPEGetRuntimeDependenciesTool.h" +#include "cmRuntimeDependencyArchive.h" + +cmBinUtilsWindowsPEGetRuntimeDependenciesTool:: + cmBinUtilsWindowsPEGetRuntimeDependenciesTool( + cmRuntimeDependencyArchive* archive) + : Archive(archive) +{ +} + +void cmBinUtilsWindowsPEGetRuntimeDependenciesTool::SetError( + const std::string& error) +{ + this->Archive->SetError(error); +} diff --git a/Source/cmBinUtilsWindowsPEGetRuntimeDependenciesTool.h b/Source/cmBinUtilsWindowsPEGetRuntimeDependenciesTool.h new file mode 100644 index 0000000..e9e402b --- /dev/null +++ b/Source/cmBinUtilsWindowsPEGetRuntimeDependenciesTool.h @@ -0,0 +1,28 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ + +#ifndef cmBinUtilsWindowsPEGetRuntimeDependenciesTool_h +#define cmBinUtilsWindowsPEGetRuntimeDependenciesTool_h + +#include +#include + +class cmRuntimeDependencyArchive; + +class cmBinUtilsWindowsPEGetRuntimeDependenciesTool +{ +public: + cmBinUtilsWindowsPEGetRuntimeDependenciesTool( + cmRuntimeDependencyArchive* archive); + virtual ~cmBinUtilsWindowsPEGetRuntimeDependenciesTool() = default; + + virtual bool GetFileInfo(const std::string& file, + std::vector& needed) = 0; + +protected: + cmRuntimeDependencyArchive* Archive; + + void SetError(const std::string& error); +}; + +#endif // cmBinUtilsWindowsPEGetRuntimeDependenciesTool_h diff --git a/Source/cmBinUtilsWindowsPELinker.cxx b/Source/cmBinUtilsWindowsPELinker.cxx new file mode 100644 index 0000000..796e9ed --- /dev/null +++ b/Source/cmBinUtilsWindowsPELinker.cxx @@ -0,0 +1,121 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ + +#include "cmBinUtilsWindowsPELinker.h" +#include "cmAlgorithms.h" +#include "cmBinUtilsWindowsPEDumpbinGetRuntimeDependenciesTool.h" +#include "cmBinUtilsWindowsPEObjdumpGetRuntimeDependenciesTool.h" +#include "cmRuntimeDependencyArchive.h" +#include "cmSystemTools.h" + +#include +#include +#include + +#ifdef _WIN32 +# include +#endif + +cmBinUtilsWindowsPELinker::cmBinUtilsWindowsPELinker( + cmRuntimeDependencyArchive* archive) + : cmBinUtilsLinker(archive) +{ +} + +bool cmBinUtilsWindowsPELinker::Prepare() +{ + std::string tool = this->Archive->GetGetRuntimeDependenciesTool(); + if (tool.empty()) { + std::vector command; + if (this->Archive->GetGetRuntimeDependenciesCommand("dumpbin", command)) { + tool = "dumpbin"; + } else { + tool = "objdump"; + } + } + if (tool == "dumpbin") { + this->Tool = + cm::make_unique( + this->Archive); + } else if (tool == "objdump") { + this->Tool = + cm::make_unique( + this->Archive); + } else { + std::ostringstream e; + e << "Invalid value for CMAKE_GET_RUNTIME_DEPENDENCIES_TOOL: " << tool; + this->SetError(e.str()); + return false; + } + + return true; +} + +bool cmBinUtilsWindowsPELinker::ScanDependencies( + std::string const& file, cmStateEnums::TargetType /* unused */) +{ + std::vector needed; + if (!this->Tool->GetFileInfo(file, needed)) { + return false; + } + for (auto& n : needed) { + n = cmSystemTools::LowerCase(n); + } + std::string origin = cmSystemTools::GetFilenamePath(file); + + for (auto const& lib : needed) { + if (!this->Archive->IsPreExcluded(lib)) { + std::string path; + bool resolved = false; + if (!this->ResolveDependency(lib, origin, path, resolved)) { + return false; + } + if (resolved) { + if (!this->Archive->IsPostExcluded(path)) { + bool unique; + this->Archive->AddResolvedPath(lib, path, unique); + if (unique && + !this->ScanDependencies(path, cmStateEnums::SHARED_LIBRARY)) { + return false; + } + } + } else { + this->Archive->AddUnresolvedPath(lib); + } + } + } + + return true; +} + +bool cmBinUtilsWindowsPELinker::ResolveDependency(std::string const& name, + std::string const& origin, + std::string& path, + bool& resolved) +{ + auto dirs = this->Archive->GetSearchDirectories(); + +#ifdef _WIN32 + char buf[MAX_PATH]; + unsigned int len; + if ((len = GetWindowsDirectoryA(buf, MAX_PATH)) > 0) { + dirs.insert(dirs.begin(), std::string(buf, len)); + } + if ((len = GetSystemDirectoryA(buf, MAX_PATH)) > 0) { + dirs.insert(dirs.begin(), std::string(buf, len)); + } +#endif + + dirs.insert(dirs.begin(), origin); + + for (auto const& searchPath : dirs) { + path = searchPath + '/' + name; + if (cmSystemTools::PathExists(path)) { + resolved = true; + return true; + } + } + + resolved = false; + return true; +} diff --git a/Source/cmBinUtilsWindowsPELinker.h b/Source/cmBinUtilsWindowsPELinker.h new file mode 100644 index 0000000..d742195 --- /dev/null +++ b/Source/cmBinUtilsWindowsPELinker.h @@ -0,0 +1,33 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ + +#ifndef cmBinUtilsWindowsPELinker_h +#define cmBinUtilsWindowsPELinker_h + +#include "cmBinUtilsLinker.h" +#include "cmBinUtilsWindowsPEGetRuntimeDependenciesTool.h" +#include "cmStateTypes.h" + +#include // IWYU pragma: keep +#include + +class cmRuntimeDependencyArchive; + +class cmBinUtilsWindowsPELinker : public cmBinUtilsLinker +{ +public: + cmBinUtilsWindowsPELinker(cmRuntimeDependencyArchive* archive); + + bool Prepare() override; + + bool ScanDependencies(std::string const& file, + cmStateEnums::TargetType type) override; + +private: + std::unique_ptr Tool; + + bool ResolveDependency(std::string const& name, std::string const& origin, + std::string& path, bool& resolved); +}; + +#endif // cmBinUtilsWindowsPELinker_h diff --git a/Source/cmBinUtilsWindowsPEObjdumpGetRuntimeDependenciesTool.cxx b/Source/cmBinUtilsWindowsPEObjdumpGetRuntimeDependenciesTool.cxx new file mode 100644 index 0000000..1f27003 --- /dev/null +++ b/Source/cmBinUtilsWindowsPEObjdumpGetRuntimeDependenciesTool.cxx @@ -0,0 +1,67 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ + +#include "cmBinUtilsWindowsPEObjdumpGetRuntimeDependenciesTool.h" +#include "cmRuntimeDependencyArchive.h" +#include "cmUVProcessChain.h" + +#include + +#include + +cmBinUtilsWindowsPEObjdumpGetRuntimeDependenciesTool:: + cmBinUtilsWindowsPEObjdumpGetRuntimeDependenciesTool( + cmRuntimeDependencyArchive* archive) + : cmBinUtilsWindowsPEGetRuntimeDependenciesTool(archive) +{ +} + +bool cmBinUtilsWindowsPEObjdumpGetRuntimeDependenciesTool::GetFileInfo( + const std::string& file, std::vector& needed) +{ + cmUVProcessChainBuilder builder; + builder.SetBuiltinStream(cmUVProcessChainBuilder::Stream_OUTPUT); + + std::vector command; + if (!this->Archive->GetGetRuntimeDependenciesCommand("objdump", command)) { + this->SetError("Could not find objdump"); + return false; + } + command.emplace_back("-p"); + command.push_back(file); + builder.AddCommand(command); + + auto process = builder.Start(); + if (!process.Valid()) { + std::ostringstream e; + e << "Failed to start objdump process for:\n " << file; + this->SetError(e.str()); + return false; + } + + std::string line; + static const cmsys::RegularExpression regex( + "^\t*DLL Name: ([^\n]*\\.[Dd][Ll][Ll])\r$"); + while (std::getline(*process.OutputStream(), line)) { + cmsys::RegularExpressionMatch match; + if (regex.find(line.c_str(), match)) { + needed.push_back(match.match(1)); + } + } + + if (!process.Wait()) { + std::ostringstream e; + e << "Failed to wait on objdump process for:\n " << file; + this->SetError(e.str()); + return false; + } + auto status = process.GetStatus(); + if (!status[0] || status[0]->ExitStatus != 0) { + std::ostringstream e; + e << "Failed to run objdump on:\n " << file; + this->SetError(e.str()); + return false; + } + + return true; +} diff --git a/Source/cmBinUtilsWindowsPEObjdumpGetRuntimeDependenciesTool.h b/Source/cmBinUtilsWindowsPEObjdumpGetRuntimeDependenciesTool.h new file mode 100644 index 0000000..1d1a5b0 --- /dev/null +++ b/Source/cmBinUtilsWindowsPEObjdumpGetRuntimeDependenciesTool.h @@ -0,0 +1,25 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ + +#ifndef cmBinUtilsWindowsPEObjdumpGetRuntimeDependenciesTool_h +#define cmBinUtilsWindowsPEObjdumpGetRuntimeDependenciesTool_h + +#include "cmBinUtilsWindowsPEGetRuntimeDependenciesTool.h" + +#include +#include + +class cmRuntimeDependencyArchive; + +class cmBinUtilsWindowsPEObjdumpGetRuntimeDependenciesTool + : public cmBinUtilsWindowsPEGetRuntimeDependenciesTool +{ +public: + cmBinUtilsWindowsPEObjdumpGetRuntimeDependenciesTool( + cmRuntimeDependencyArchive* archive); + + bool GetFileInfo(const std::string& file, + std::vector& needed) override; +}; + +#endif // cmBinUtilsWindowsPEObjdumpGetRuntimeDependenciesTool_h diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index 7a3954e..980ad21 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -12,7 +12,9 @@ #include #include #include +#include #include // IWYU pragma: keep +#include #include #include #include @@ -34,6 +36,8 @@ #include "cmMessageType.h" #include "cmPolicies.h" #include "cmRange.h" +#include "cmRuntimeDependencyArchive.h" +#include "cmState.h" #include "cmSystemTools.h" #include "cmTimestamp.h" #include "cm_sys_stat.h" @@ -184,6 +188,9 @@ bool cmFileCommand::InitialPass(std::vector const& args, if (subCommand == "CREATE_LINK") { return this->HandleCreateLinkCommand(args); } + if (subCommand == "GET_RUNTIME_DEPENDENCIES") { + return this->HandleGetRuntimeDependenciesCommand(args); + } std::string e = "does not recognize sub-command " + subCommand; this->SetError(e); @@ -2690,3 +2697,171 @@ bool cmFileCommand::HandleCreateLinkCommand( return true; } + +bool cmFileCommand::HandleGetRuntimeDependenciesCommand( + std::vector const& args) +{ + static const std::set supportedPlatforms = { "Windows", "Linux", + "Darwin" }; + std::string platform = + this->Makefile->GetSafeDefinition("CMAKE_HOST_SYSTEM_NAME"); + if (!supportedPlatforms.count(platform)) { + std::ostringstream e; + e << "GET_RUNTIME_DEPENDENCIES is not supported on system \"" << platform + << "\""; + this->SetError(e.str()); + cmSystemTools::SetFatalErrorOccured(); + return false; + } + + if (this->Makefile->GetState()->GetMode() == cmState::Project) { + this->Makefile->IssueMessage(MessageType::AUTHOR_WARNING, + "You have used file(GET_RUNTIME_DEPENDENCIES)" + " in project mode. This is probably not what " + "you intended to do. Instead, please consider" + " using it in an install(CODE) or " + "install(SCRIPT) command. For example:" + "\n install(CODE [[" + "\n file(GET_RUNTIME_DEPENDENCIES" + "\n # ..." + "\n )" + "\n ]])"); + } + + struct Arguments + { + std::string ResolvedDependenciesVar; + std::string UnresolvedDependenciesVar; + std::string ConflictingDependenciesPrefix; + std::string BundleExecutable; + std::vector Executables; + std::vector Libraries; + std::vector Directories; + std::vector Modules; + std::vector PreIncludeRegexes; + std::vector PreExcludeRegexes; + std::vector PostIncludeRegexes; + std::vector PostExcludeRegexes; + }; + + static auto const parser = + cmArgumentParser{} + .Bind("RESOLVED_DEPENDENCIES_VAR"_s, &Arguments::ResolvedDependenciesVar) + .Bind("UNRESOLVED_DEPENDENCIES_VAR"_s, + &Arguments::UnresolvedDependenciesVar) + .Bind("CONFLICTING_DEPENDENCIES_PREFIX"_s, + &Arguments::ConflictingDependenciesPrefix) + .Bind("BUNDLE_EXECUTABLE"_s, &Arguments::BundleExecutable) + .Bind("EXECUTABLES"_s, &Arguments::Executables) + .Bind("LIBRARIES"_s, &Arguments::Libraries) + .Bind("MODULES"_s, &Arguments::Modules) + .Bind("DIRECTORIES"_s, &Arguments::Directories) + .Bind("PRE_INCLUDE_REGEXES"_s, &Arguments::PreIncludeRegexes) + .Bind("PRE_EXCLUDE_REGEXES"_s, &Arguments::PreExcludeRegexes) + .Bind("POST_INCLUDE_REGEXES"_s, &Arguments::PostIncludeRegexes) + .Bind("POST_EXCLUDE_REGEXES"_s, &Arguments::PostExcludeRegexes); + + std::vector unrecognizedArguments; + std::vector keywordsMissingValues; + auto parsedArgs = + parser.Parse(cmMakeRange(args).advance(1), &unrecognizedArguments, + &keywordsMissingValues); + auto argIt = unrecognizedArguments.begin(); + if (argIt != unrecognizedArguments.end()) { + std::ostringstream e; + e << "Unrecognized argument: \"" << *argIt << "\""; + this->SetError(e.str()); + cmSystemTools::SetFatalErrorOccured(); + return false; + } + argIt = keywordsMissingValues.begin(); + if (argIt != keywordsMissingValues.end()) { + std::ostringstream e; + e << "Keyword missing value: " << *argIt; + this->SetError(e.str()); + cmSystemTools::SetFatalErrorOccured(); + return false; + } + + cmRuntimeDependencyArchive archive( + this, parsedArgs.Directories, parsedArgs.BundleExecutable, + parsedArgs.PreIncludeRegexes, parsedArgs.PreExcludeRegexes, + parsedArgs.PostIncludeRegexes, parsedArgs.PostExcludeRegexes); + if (!archive.Prepare()) { + cmSystemTools::SetFatalErrorOccured(); + return false; + } + + if (!archive.GetRuntimeDependencies( + parsedArgs.Executables, parsedArgs.Libraries, parsedArgs.Modules)) { + cmSystemTools::SetFatalErrorOccured(); + return false; + } + + std::vector deps, unresolvedDeps, conflictingDeps; + for (auto const& val : archive.GetResolvedPaths()) { + bool unique = true; + auto it = val.second.begin(); + assert(it != val.second.end()); + auto const& firstPath = *it; + while (++it != val.second.end()) { + if (!cmSystemTools::SameFile(firstPath, *it)) { + unique = false; + break; + } + } + + if (unique) { + deps.push_back(firstPath); + } else if (!parsedArgs.ConflictingDependenciesPrefix.empty()) { + conflictingDeps.push_back(val.first); + std::vector paths; + paths.insert(paths.begin(), val.second.begin(), val.second.end()); + std::string varName = + parsedArgs.ConflictingDependenciesPrefix + "_" + val.first; + std::string pathsStr = cmJoin(paths, ";"); + this->Makefile->AddDefinition(varName, pathsStr.c_str()); + } else { + std::ostringstream e; + e << "Multiple conflicting paths found for " << val.first << ":"; + for (auto const& path : val.second) { + e << "\n " << path; + } + this->SetError(e.str()); + cmSystemTools::SetFatalErrorOccured(); + return false; + } + } + if (!archive.GetUnresolvedPaths().empty()) { + if (!parsedArgs.UnresolvedDependenciesVar.empty()) { + unresolvedDeps.insert(unresolvedDeps.begin(), + archive.GetUnresolvedPaths().begin(), + archive.GetUnresolvedPaths().end()); + } else { + auto it = archive.GetUnresolvedPaths().begin(); + assert(it != archive.GetUnresolvedPaths().end()); + std::ostringstream e; + e << "Could not resolve file " << *it; + this->SetError(e.str()); + cmSystemTools::SetFatalErrorOccured(); + return false; + } + } + + if (!parsedArgs.ResolvedDependenciesVar.empty()) { + std::string val = cmJoin(deps, ";"); + this->Makefile->AddDefinition(parsedArgs.ResolvedDependenciesVar, + val.c_str()); + } + if (!parsedArgs.UnresolvedDependenciesVar.empty()) { + std::string val = cmJoin(unresolvedDeps, ";"); + this->Makefile->AddDefinition(parsedArgs.UnresolvedDependenciesVar, + val.c_str()); + } + if (!parsedArgs.ConflictingDependenciesPrefix.empty()) { + std::string val = cmJoin(conflictingDeps, ";"); + this->Makefile->AddDefinition( + parsedArgs.ConflictingDependenciesPrefix + "_FILENAMES", val.c_str()); + } + return true; +} diff --git a/Source/cmFileCommand.h b/Source/cmFileCommand.h index 12c5115..cfff894 100644 --- a/Source/cmFileCommand.h +++ b/Source/cmFileCommand.h @@ -62,6 +62,8 @@ protected: bool HandleSizeCommand(std::vector const& args); bool HandleReadSymlinkCommand(std::vector const& args); bool HandleCreateLinkCommand(std::vector const& args); + bool HandleGetRuntimeDependenciesCommand( + std::vector const& args); private: void AddEvaluationFile(const std::string& inputName, diff --git a/Source/cmLDConfigLDConfigTool.cxx b/Source/cmLDConfigLDConfigTool.cxx new file mode 100644 index 0000000..586ea96 --- /dev/null +++ b/Source/cmLDConfigLDConfigTool.cxx @@ -0,0 +1,70 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ + +#include "cmLDConfigLDConfigTool.h" +#include "cmMakefile.h" +#include "cmRuntimeDependencyArchive.h" +#include "cmSystemTools.h" +#include "cmUVProcessChain.h" + +#include "cmsys/RegularExpression.hxx" + +#include +#include +#include + +cmLDConfigLDConfigTool::cmLDConfigLDConfigTool( + cmRuntimeDependencyArchive* archive) + : cmLDConfigTool(archive) +{ +} + +bool cmLDConfigLDConfigTool::GetLDConfigPaths(std::vector& paths) +{ + std::string ldConfigPath = + this->Archive->GetMakefile()->GetSafeDefinition("CMAKE_LDCONFIG_COMMAND"); + if (ldConfigPath.empty()) { + ldConfigPath = cmSystemTools::FindProgram( + "ldconfig", { "/sbin", "/usr/sbin", "/usr/local/sbin" }); + if (ldConfigPath.empty()) { + this->Archive->SetError("Could not find ldconfig"); + return false; + } + } + + std::vector ldConfigCommand; + cmSystemTools::ExpandListArgument(ldConfigPath, ldConfigCommand); + ldConfigCommand.emplace_back("-v"); + ldConfigCommand.emplace_back("-N"); // Don't rebuild the cache. + ldConfigCommand.emplace_back("-X"); // Don't update links. + + cmUVProcessChainBuilder builder; + builder.SetBuiltinStream(cmUVProcessChainBuilder::Stream_OUTPUT) + .AddCommand(ldConfigCommand); + auto process = builder.Start(); + if (!process.Valid()) { + this->Archive->SetError("Failed to start ldconfig process"); + return false; + } + + std::string line; + static const cmsys::RegularExpression regex("^([^\t:]*):"); + while (std::getline(*process.OutputStream(), line)) { + cmsys::RegularExpressionMatch match; + if (regex.find(line.c_str(), match)) { + paths.push_back(match.match(1)); + } + } + + if (!process.Wait()) { + this->Archive->SetError("Failed to wait on ldconfig process"); + return false; + } + auto status = process.GetStatus(); + if (!status[0] || status[0]->ExitStatus != 0) { + this->Archive->SetError("Failed to run ldconfig"); + return false; + } + + return true; +} diff --git a/Source/cmLDConfigLDConfigTool.h b/Source/cmLDConfigLDConfigTool.h new file mode 100644 index 0000000..d945a9b --- /dev/null +++ b/Source/cmLDConfigLDConfigTool.h @@ -0,0 +1,22 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ + +#ifndef cmLDConfigLDConfigTool_h +#define cmLDConfigLDConfigTool_h + +#include "cmLDConfigTool.h" + +#include +#include + +class cmRuntimeDependencyArchive; + +class cmLDConfigLDConfigTool : public cmLDConfigTool +{ +public: + cmLDConfigLDConfigTool(cmRuntimeDependencyArchive* archive); + + bool GetLDConfigPaths(std::vector& paths) override; +}; + +#endif diff --git a/Source/cmLDConfigTool.cxx b/Source/cmLDConfigTool.cxx new file mode 100644 index 0000000..8d5d563 --- /dev/null +++ b/Source/cmLDConfigTool.cxx @@ -0,0 +1,9 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ + +#include "cmLDConfigTool.h" + +cmLDConfigTool::cmLDConfigTool(cmRuntimeDependencyArchive* archive) + : Archive(archive) +{ +} diff --git a/Source/cmLDConfigTool.h b/Source/cmLDConfigTool.h new file mode 100644 index 0000000..c816562 --- /dev/null +++ b/Source/cmLDConfigTool.h @@ -0,0 +1,24 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ + +#ifndef cmLDConfigTool_h +#define cmLDConfigTool_h + +#include +#include + +class cmRuntimeDependencyArchive; + +class cmLDConfigTool +{ +public: + cmLDConfigTool(cmRuntimeDependencyArchive* archive); + virtual ~cmLDConfigTool() = default; + + virtual bool GetLDConfigPaths(std::vector& paths) = 0; + +protected: + cmRuntimeDependencyArchive* Archive; +}; + +#endif diff --git a/Source/cmRuntimeDependencyArchive.cxx b/Source/cmRuntimeDependencyArchive.cxx new file mode 100644 index 0000000..b4c6c32 --- /dev/null +++ b/Source/cmRuntimeDependencyArchive.cxx @@ -0,0 +1,378 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ + +#include "cmRuntimeDependencyArchive.h" + +#include "cmAlgorithms.h" +#include "cmBinUtilsLinuxELFLinker.h" +#include "cmBinUtilsMacOSMachOLinker.h" +#include "cmBinUtilsWindowsPELinker.h" +#include "cmCommand.h" +#include "cmMakefile.h" +#include "cmStateTypes.h" +#include "cmSystemTools.h" + +#if defined(_WIN32) +# include "cmGlobalGenerator.h" +# ifdef CMAKE_BUILD_WITH_CMAKE +# include "cmGlobalVisualStudioVersionedGenerator.h" +# endif +# include "cmVSSetupHelper.h" +# include "cmsys/Glob.hxx" +#endif + +#include +#include +#include +#include +#include + +#if defined(_WIN32) +static void AddVisualStudioPath(std::vector& paths, + const std::string& prefix, + unsigned int version, cmGlobalGenerator* gg) +{ + // If generating for the VS IDE, use the same instance. + std::string vsloc; + bool found = false; +# ifdef CMAKE_BUILD_WITH_CMAKE + if (gg->GetName().find(prefix) == 0) { + cmGlobalVisualStudioVersionedGenerator* vsgen = + static_cast(gg); + if (vsgen->GetVSInstance(vsloc)) { + found = true; + } + } +# endif + + // Otherwise, find a VS instance ourselves. + if (!found) { + cmVSSetupAPIHelper vsSetupAPIHelper(version); + if (vsSetupAPIHelper.GetVSInstanceInfo(vsloc)) { + cmSystemTools::ConvertToUnixSlashes(vsloc); + found = true; + } + } + + if (found) { + cmsys::Glob glob; + glob.SetListDirs(true); + glob.FindFiles(vsloc + "/VC/Tools/MSVC/*"); + for (auto const& vcdir : glob.GetFiles()) { + paths.push_back(vcdir + "/bin/Hostx64/x64"); + paths.push_back(vcdir + "/bin/Hostx86/x64"); + paths.push_back(vcdir + "/bin/Hostx64/x86"); + paths.push_back(vcdir + "/bin/Hostx86/x86"); + } + } +} + +static void AddRegistryPath(std::vector& paths, + const std::string& path, cmMakefile* mf) +{ + // We should view the registry as the target application would view + // it. + cmSystemTools::KeyWOW64 view = cmSystemTools::KeyWOW64_32; + cmSystemTools::KeyWOW64 other_view = cmSystemTools::KeyWOW64_64; + if (mf->PlatformIs64Bit()) { + view = cmSystemTools::KeyWOW64_64; + other_view = cmSystemTools::KeyWOW64_32; + } + + // Expand using the view of the target application. + std::string expanded = path; + cmSystemTools::ExpandRegistryValues(expanded, view); + cmSystemTools::GlobDirs(expanded, paths); + + // Executables can be either 32-bit or 64-bit, so expand using the + // alternative view. + expanded = path; + cmSystemTools::ExpandRegistryValues(expanded, other_view); + cmSystemTools::GlobDirs(expanded, paths); +} + +static void AddEnvPath(std::vector& paths, const std::string& var, + const std::string& suffix) +{ + std::string value; + if (cmSystemTools::GetEnv(var, value)) { + paths.push_back(value + suffix); + } +} +#endif + +static cmsys::RegularExpression TransformCompile(const std::string& str) +{ + return cmsys::RegularExpression(str); +} + +cmRuntimeDependencyArchive::cmRuntimeDependencyArchive( + cmCommand* command, std::vector searchDirectories, + std::string bundleExecutable, + const std::vector& preIncludeRegexes, + const std::vector& preExcludeRegexes, + const std::vector& postIncludeRegexes, + const std::vector& postExcludeRegexes) + : Command(command) + , SearchDirectories(std::move(searchDirectories)) + , BundleExecutable(std::move(bundleExecutable)) + , PreIncludeRegexes(preIncludeRegexes.size()) + , PreExcludeRegexes(preExcludeRegexes.size()) + , PostIncludeRegexes(postIncludeRegexes.size()) + , PostExcludeRegexes(postExcludeRegexes.size()) +{ + std::transform(preIncludeRegexes.begin(), preIncludeRegexes.end(), + this->PreIncludeRegexes.begin(), TransformCompile); + std::transform(preExcludeRegexes.begin(), preExcludeRegexes.end(), + this->PreExcludeRegexes.begin(), TransformCompile); + std::transform(postIncludeRegexes.begin(), postIncludeRegexes.end(), + this->PostIncludeRegexes.begin(), TransformCompile); + std::transform(postExcludeRegexes.begin(), postExcludeRegexes.end(), + this->PostExcludeRegexes.begin(), TransformCompile); +} + +bool cmRuntimeDependencyArchive::Prepare() +{ + std::string platform = this->GetMakefile()->GetSafeDefinition( + "CMAKE_GET_RUNTIME_DEPENDENCIES_PLATFORM"); + if (platform.empty()) { + std::string systemName = + this->GetMakefile()->GetSafeDefinition("CMAKE_HOST_SYSTEM_NAME"); + if (systemName == "Windows") { + platform = "windows+pe"; + } else if (systemName == "Darwin") { + platform = "macos+macho"; + } else if (systemName == "Linux") { + platform = "linux+elf"; + } + } + if (platform == "linux+elf") { + this->Linker = cm::make_unique(this); + } else if (platform == "windows+pe") { + this->Linker = cm::make_unique(this); + } else if (platform == "macos+macho") { + this->Linker = cm::make_unique(this); + } else { + std::ostringstream e; + e << "Invalid value for CMAKE_GET_RUNTIME_DEPENDENCIES_PLATFORM: " + << platform; + this->SetError(e.str()); + return false; + } + + return this->Linker->Prepare(); +} + +bool cmRuntimeDependencyArchive::GetRuntimeDependencies( + const std::vector& executables, + const std::vector& libraries, + const std::vector& modules) +{ + for (auto const& exe : executables) { + if (!this->Linker->ScanDependencies(exe, cmStateEnums::EXECUTABLE)) { + return false; + } + } + for (auto const& lib : libraries) { + if (!this->Linker->ScanDependencies(lib, cmStateEnums::SHARED_LIBRARY)) { + return false; + } + } + for (auto const& mod : modules) { + if (!this->Linker->ScanDependencies(mod, cmStateEnums::MODULE_LIBRARY)) { + return false; + } + } + + return true; +} + +void cmRuntimeDependencyArchive::SetError(const std::string& e) +{ + this->Command->SetError(e); +} + +std::string cmRuntimeDependencyArchive::GetBundleExecutable() +{ + return this->BundleExecutable; +} + +const std::vector& +cmRuntimeDependencyArchive::GetSearchDirectories() +{ + return this->SearchDirectories; +} + +std::string cmRuntimeDependencyArchive::GetGetRuntimeDependenciesTool() +{ + return this->GetMakefile()->GetSafeDefinition( + "CMAKE_GET_RUNTIME_DEPENDENCIES_TOOL"); +} + +bool cmRuntimeDependencyArchive::GetGetRuntimeDependenciesCommand( + const std::string& search, std::vector& command) +{ + // First see if it was supplied by the user + std::string toolCommand = this->GetMakefile()->GetSafeDefinition( + "CMAKE_GET_RUNTIME_DEPENDENCIES_COMMAND"); + if (!toolCommand.empty()) { + cmSystemTools::ExpandListArgument(toolCommand, command); + return true; + } + + // Now go searching for it + std::vector paths; +#ifdef _WIN32 + cmGlobalGenerator* gg = this->GetMakefile()->GetGlobalGenerator(); + + // Add newer Visual Studio paths + AddVisualStudioPath(paths, "Visual Studio 16 ", 16, gg); + AddVisualStudioPath(paths, "Visual Studio 15 ", 15, gg); + + // Add older Visual Studio paths + AddRegistryPath( + paths, + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\14.0;InstallDir]/" + "../../VC/bin", + this->GetMakefile()); + AddEnvPath(paths, "VS140COMNTOOLS", "/../../VC/bin"); + paths.push_back( + "C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin"); + AddRegistryPath( + paths, + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\12.0;InstallDir]/" + "../../VC/bin", + this->GetMakefile()); + AddEnvPath(paths, "VS120COMNTOOLS", "/../../VC/bin"); + paths.push_back( + "C:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/bin"); + AddRegistryPath( + paths, + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\11.0;InstallDir]/" + "../../VC/bin", + this->GetMakefile()); + AddEnvPath(paths, "VS110COMNTOOLS", "/../../VC/bin"); + paths.push_back( + "C:/Program Files (x86)/Microsoft Visual Studio 11.0/VC/bin"); + AddRegistryPath( + paths, + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0;InstallDir]/" + "../../VC/bin", + this->GetMakefile()); + AddEnvPath(paths, "VS100COMNTOOLS", "/../../VC/bin"); + paths.push_back( + "C:/Program Files (x86)/Microsoft Visual Studio 10.0/VC/bin"); + AddRegistryPath( + paths, + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0;InstallDir]/" + "../../VC/bin", + this->GetMakefile()); + AddEnvPath(paths, "VS90COMNTOOLS", "/../../VC/bin"); + paths.push_back("C:/Program Files/Microsoft Visual Studio 9.0/VC/bin"); + paths.push_back("C:/Program Files (x86)/Microsoft Visual Studio 9.0/VC/bin"); + AddRegistryPath( + paths, + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0;InstallDir]/" + "../../VC/bin", + this->GetMakefile()); + AddEnvPath(paths, "VS80COMNTOOLS", "/../../VC/bin"); + paths.push_back("C:/Program Files/Microsoft Visual Studio 8/VC/BIN"); + paths.push_back("C:/Program Files (x86)/Microsoft Visual Studio 8/VC/BIN"); + AddRegistryPath( + paths, + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\7.1;InstallDir]/" + "../../VC7/bin", + this->GetMakefile()); + AddEnvPath(paths, "VS71COMNTOOLS", "/../../VC7/bin"); + paths.push_back( + "C:/Program Files/Microsoft Visual Studio .NET 2003/VC7/BIN"); + paths.push_back( + "C:/Program Files (x86)/Microsoft Visual Studio .NET 2003/VC7/BIN"); +#endif + + std::string program = cmSystemTools::FindProgram(search, paths); + if (!program.empty()) { + command = { program }; + return true; + } + + // Couldn't find it + return false; +} + +bool cmRuntimeDependencyArchive::IsPreExcluded(const std::string& name) +{ + cmsys::RegularExpressionMatch match; + + for (auto const& regex : this->PreIncludeRegexes) { + if (regex.find(name.c_str(), match)) { + return false; + } + } + + for (auto const& regex : this->PreExcludeRegexes) { + if (regex.find(name.c_str(), match)) { + return true; + } + } + + return false; +} + +bool cmRuntimeDependencyArchive::IsPostExcluded(const std::string& name) +{ + cmsys::RegularExpressionMatch match; + + for (auto const& regex : this->PostIncludeRegexes) { + if (regex.find(name.c_str(), match)) { + return false; + } + } + + for (auto const& regex : this->PostExcludeRegexes) { + if (regex.find(name.c_str(), match)) { + return true; + } + } + + return false; +} + +void cmRuntimeDependencyArchive::AddResolvedPath(const std::string& name, + const std::string& path, + bool& unique) +{ + auto it = + this->ResolvedPaths + .insert(std::pair>{ name, {} }) + .first; + unique = true; + for (auto const& other : it->second) { + if (cmSystemTools::SameFile(path, other)) { + unique = false; + break; + } + } + it->second.insert(path); +} + +void cmRuntimeDependencyArchive::AddUnresolvedPath(const std::string& name) +{ + this->UnresolvedPaths.insert(name); +} + +cmMakefile* cmRuntimeDependencyArchive::GetMakefile() +{ + return this->Command->GetMakefile(); +} + +const std::map>& +cmRuntimeDependencyArchive::GetResolvedPaths() +{ + return this->ResolvedPaths; +} + +const std::set& cmRuntimeDependencyArchive::GetUnresolvedPaths() +{ + return this->UnresolvedPaths; +} diff --git a/Source/cmRuntimeDependencyArchive.h b/Source/cmRuntimeDependencyArchive.h new file mode 100644 index 0000000..ec3ecd4 --- /dev/null +++ b/Source/cmRuntimeDependencyArchive.h @@ -0,0 +1,70 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ + +#ifndef cmRuntimeDependencyArchive_h +#define cmRuntimeDependencyArchive_h + +#include "cmBinUtilsLinker.h" + +#include "cmsys/RegularExpression.hxx" + +#include +#include // IWYU pragma: keep +#include +#include +#include + +class cmCommand; +class cmMakefile; + +class cmRuntimeDependencyArchive +{ +public: + explicit cmRuntimeDependencyArchive( + cmCommand* command, std::vector searchDirectories, + std::string bundleExecutable, + const std::vector& preIncludeRegexes, + const std::vector& preExcludeRegexes, + const std::vector& postIncludeRegexes, + const std::vector& postExcludeRegexes); + bool Prepare(); + bool GetRuntimeDependencies(const std::vector& executables, + const std::vector& libraries, + const std::vector& modules); + + void SetError(const std::string& e); + + std::string GetBundleExecutable(); + const std::vector& GetSearchDirectories(); + std::string GetGetRuntimeDependenciesTool(); + bool GetGetRuntimeDependenciesCommand(const std::string& search, + std::vector& command); + bool IsPreExcluded(const std::string& name); + bool IsPostExcluded(const std::string& name); + + void AddResolvedPath(const std::string& name, const std::string& path, + bool& unique); + void AddUnresolvedPath(const std::string& name); + + cmMakefile* GetMakefile(); + const std::map>& GetResolvedPaths(); + const std::set& GetUnresolvedPaths(); + +private: + cmCommand* Command; + std::unique_ptr Linker; + + std::string GetRuntimeDependenciesTool; + std::vector GetRuntimeDependenciesCommand; + + std::vector SearchDirectories; + std::string BundleExecutable; + std::vector PreIncludeRegexes; + std::vector PreExcludeRegexes; + std::vector PostIncludeRegexes; + std::vector PostExcludeRegexes; + std::map> ResolvedPaths; + std::set UnresolvedPaths; +}; + +#endif // cmRuntimeDependencyArchive_h diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 69f8162..075676a 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -408,7 +408,7 @@ else() set(NO_NAMELINK 0) endif() -add_RunCMake_test(install -DNO_NAMELINK=${NO_NAMELINK} -DCYGWIN=${CYGWIN}) +add_RunCMake_test(install -DNO_NAMELINK=${NO_NAMELINK} -DCYGWIN=${CYGWIN} -DCMAKE_C_COMPILER_ID=${CMAKE_C_COMPILER_ID}) add_RunCMake_test(CPackCommandLine) add_RunCMake_test(CPackConfig) add_RunCMake_test(CPackInstallProperties) diff --git a/Tests/RunCMake/install/CMakeLists.txt b/Tests/RunCMake/install/CMakeLists.txt index 6dd8cdf..c7e99ad 100644 --- a/Tests/RunCMake/install/CMakeLists.txt +++ b/Tests/RunCMake/install/CMakeLists.txt @@ -1,3 +1,6 @@ cmake_minimum_required(VERSION 3.4) +if(RunCMake_TEST MATCHES "^file-GET_RUNTIME_DEPENDENCIES") + cmake_policy(SET CMP0087 NEW) +endif() project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/install/RunCMakeTest.cmake b/Tests/RunCMake/install/RunCMakeTest.cmake index c637db1..026148e 100644 --- a/Tests/RunCMake/install/RunCMakeTest.cmake +++ b/Tests/RunCMake/install/RunCMakeTest.cmake @@ -139,6 +139,36 @@ run_install_test(FILES-PERMISSIONS) run_install_test(TARGETS-RPATH) run_install_test(InstallRequiredSystemLibraries) +if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin") + run_install_test(file-GET_RUNTIME_DEPENDENCIES-macos) + run_install_test(file-GET_RUNTIME_DEPENDENCIES-macos-unresolved) + run_install_test(file-GET_RUNTIME_DEPENDENCIES-macos-conflict) + run_install_test(file-GET_RUNTIME_DEPENDENCIES-macos-notfile) + run_cmake(file-GET_RUNTIME_DEPENDENCIES-project) + run_cmake(file-GET_RUNTIME_DEPENDENCIES-badargs1) + run_cmake(file-GET_RUNTIME_DEPENDENCIES-badargs2) +elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows") + run_install_test(file-GET_RUNTIME_DEPENDENCIES-windows) + run_install_test(file-GET_RUNTIME_DEPENDENCIES-windows-unresolved) + run_install_test(file-GET_RUNTIME_DEPENDENCIES-windows-conflict) + run_install_test(file-GET_RUNTIME_DEPENDENCIES-windows-notfile) + run_cmake(file-GET_RUNTIME_DEPENDENCIES-project) + run_cmake(file-GET_RUNTIME_DEPENDENCIES-badargs1) + run_cmake(file-GET_RUNTIME_DEPENDENCIES-badargs2) +elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux") + if(NOT CMAKE_C_COMPILER_ID MATCHES "^XL") + run_install_test(file-GET_RUNTIME_DEPENDENCIES-linux) + endif() + run_install_test(file-GET_RUNTIME_DEPENDENCIES-linux-unresolved) + run_install_test(file-GET_RUNTIME_DEPENDENCIES-linux-conflict) + run_install_test(file-GET_RUNTIME_DEPENDENCIES-linux-notfile) + run_cmake(file-GET_RUNTIME_DEPENDENCIES-project) + run_cmake(file-GET_RUNTIME_DEPENDENCIES-badargs1) + run_cmake(file-GET_RUNTIME_DEPENDENCIES-badargs2) +else() + run_cmake(file-GET_RUNTIME_DEPENDENCIES-unsupported) +endif() + set(run_install_test_components 1) run_install_test(FILES-EXCLUDE_FROM_ALL) run_install_test(TARGETS-EXCLUDE_FROM_ALL) diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs1-result.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs1-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs1-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs1-stderr.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs1-stderr.txt new file mode 100644 index 0000000..b66d1fe --- /dev/null +++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs1-stderr.txt @@ -0,0 +1,18 @@ +^CMake Warning \(dev\) at file-GET_RUNTIME_DEPENDENCIES-badargs1\.cmake:[0-9]+ \(file\): + You have used file\(GET_RUNTIME_DEPENDENCIES\) in project mode\. This is + probably not what you intended to do\. Instead, please consider using it in + an install\(CODE\) or install\(SCRIPT\) command\. For example: + + install\(CODE \[\[ + file\(GET_RUNTIME_DEPENDENCIES + # \.\.\. + \) + ]]\) +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\) +This warning is for project developers\. Use -Wno-dev to suppress it\. + +CMake Error at file-GET_RUNTIME_DEPENDENCIES-badargs1\.cmake:[0-9]+ \(file\): + file Unrecognized argument: "invalid" +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs1.cmake b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs1.cmake new file mode 100644 index 0000000..f3b8ce4 --- /dev/null +++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs1.cmake @@ -0,0 +1,2 @@ +file(GET_RUNTIME_DEPENDENCIES invalid) +message(FATAL_ERROR "This message should not be displayed") diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs2-result.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs2-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs2-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs2-stderr.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs2-stderr.txt new file mode 100644 index 0000000..94f0f46 --- /dev/null +++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs2-stderr.txt @@ -0,0 +1,18 @@ +^CMake Warning \(dev\) at file-GET_RUNTIME_DEPENDENCIES-badargs2\.cmake:[0-9]+ \(file\): + You have used file\(GET_RUNTIME_DEPENDENCIES\) in project mode\. This is + probably not what you intended to do\. Instead, please consider using it in + an install\(CODE\) or install\(SCRIPT\) command\. For example: + + install\(CODE \[\[ + file\(GET_RUNTIME_DEPENDENCIES + # \.\.\. + \) + ]]\) +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\) +This warning is for project developers\. Use -Wno-dev to suppress it\. + +CMake Error at file-GET_RUNTIME_DEPENDENCIES-badargs2\.cmake:[0-9]+ \(file\): + file Keyword missing value: BUNDLE_EXECUTABLE +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs2.cmake b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs2.cmake new file mode 100644 index 0000000..138ab95 --- /dev/null +++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs2.cmake @@ -0,0 +1,2 @@ +file(GET_RUNTIME_DEPENDENCIES BUNDLE_EXECUTABLE) +message(FATAL_ERROR "This message should not be displayed") diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-all-check.cmake b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-all-check.cmake new file mode 100644 index 0000000..ab630f0 --- /dev/null +++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-all-check.cmake @@ -0,0 +1,44 @@ +function(check_contents filename contents_regex) + if(EXISTS "${CMAKE_INSTALL_PREFIX}/${filename}") + file(READ "${CMAKE_INSTALL_PREFIX}/${filename}" contents) + if(NOT contents MATCHES "${contents_regex}") + string(APPEND RunCMake_TEST_FAILED "File contents: + ${contents} +do not match what we expected: + ${contents_regex} +in file: + ${CMAKE_INSTALL_PREFIX}/${filename}\n") + set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE) + endif() + else() + string(APPEND RunCMake_TEST_FAILED "File ${CMAKE_INSTALL_PREFIX}/${filename} does not exist") + set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE) + endif() +endfunction() + +set(_check + [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/libtest_rpath\.so]] + [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/libtest_runpath\.so]] + [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/rpath/librpath\.so]] + [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/rpath_parent/librpath_parent\.so]] + [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/rpath_search/librpath_search\.so]] + [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/runpath/librunpath\.so]] + [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/runpath_search/librunpath_search\.so]] + ) +check_contents(deps/deps1.txt "^${_check}$") +check_contents(deps/deps2.txt "^${_check}$") +check_contents(deps/deps3.txt "^${_check}$") +set(_check + [[librpath_unresolved\.so]] + [[librunpath_parent_unresolved\.so]] + [[librunpath_unresolved\.so]] + ) +check_contents(deps/udeps1.txt "^${_check}$") +check_contents(deps/udeps2.txt "^${_check}$") +check_contents(deps/udeps3.txt "^${_check}$") +set(_check + "^libconflict\\.so:[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/conflict/libconflict\\.so;[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/conflict2/libconflict\\.so\n$" + ) +check_contents(deps/cdeps1.txt "${_check}") +check_contents(deps/cdeps2.txt "${_check}") +check_contents(deps/cdeps3.txt "${_check}") diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-all-stderr.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-all-stderr.txt new file mode 100644 index 0000000..123ae48 --- /dev/null +++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-all-stderr.txt @@ -0,0 +1,119 @@ +^CMake Warning at cmake_install\.cmake:[0-9]+ \(file\): + Dependency librpath_search_postexcluded\.so found in search directory: + + [^ +]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/rpath_search_postexcluded + + See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\. +Call Stack \(most recent call first\): + cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\) + +*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\): + Dependency librpath_search\.so found in search directory: + + [^ +]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/rpath_search + + See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\. +Call Stack \(most recent call first\): + cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\) + +*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\): + Dependency librunpath_search_postexcluded\.so found in search directory: + + [^ +]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/runpath_search_postexcluded + + See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\. +Call Stack \(most recent call first\): + cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\) + +*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\): + Dependency librunpath_search\.so found in search directory: + + [^ +]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/runpath_search + + See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\. +Call Stack \(most recent call first\): + cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\) + +*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\): + Dependency librpath_search_postexcluded\.so found in search directory: + + [^ +]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/rpath_search_postexcluded + + See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\. +Call Stack \(most recent call first\): + cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\) + +*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\): + Dependency librpath_search\.so found in search directory: + + [^ +]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/rpath_search + + See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\. +Call Stack \(most recent call first\): + cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\) + +*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\): + Dependency librunpath_search_postexcluded\.so found in search directory: + + [^ +]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/runpath_search_postexcluded + + See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\. +Call Stack \(most recent call first\): + cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\) + +*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\): + Dependency librunpath_search\.so found in search directory: + + [^ +]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/runpath_search + + See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\. +Call Stack \(most recent call first\): + cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\) + +*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\): + Dependency librpath_search_postexcluded\.so found in search directory: + + [^ +]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/rpath_search_postexcluded + + See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\. +Call Stack \(most recent call first\): + cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\) + +*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\): + Dependency librpath_search\.so found in search directory: + + [^ +]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/rpath_search + + See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\. +Call Stack \(most recent call first\): + cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\) + +*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\): + Dependency librunpath_search_postexcluded\.so found in search directory: + + [^ +]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/runpath_search_postexcluded + + See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\. +Call Stack \(most recent call first\): + cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\) + +*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\): + Dependency librunpath_search\.so found in search directory: + + [^ +]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/runpath_search + + See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\. +Call Stack \(most recent call first\): + cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\)$ diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-conflict-all-result.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-conflict-all-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-conflict-all-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-conflict-all-stderr.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-conflict-all-stderr.txt new file mode 100644 index 0000000..1692348 --- /dev/null +++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-conflict-all-stderr.txt @@ -0,0 +1,7 @@ +^CMake Error at cmake_install\.cmake:[0-9]+ \(file\): + file Multiple conflicting paths found for librpath\.so: + + [^ +]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-conflict-build/root-all/lib/rpath1/librpath\.so + [^ +]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-conflict-build/root-all/lib/rpath2/librpath\.so$ diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-conflict.cmake b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-conflict.cmake new file mode 100644 index 0000000..f719499 --- /dev/null +++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-conflict.cmake @@ -0,0 +1,54 @@ +enable_language(C) + +set(test1_names rpath) +set(test2_names rpath) + +file(WRITE "${CMAKE_BINARY_DIR}/rpath.c" "void rpath(void) {}\n") +add_library(rpath SHARED "${CMAKE_BINARY_DIR}/rpath.c") +install(TARGETS rpath DESTINATION lib/rpath1) +install(TARGETS rpath DESTINATION lib/rpath2) + +file(REMOVE "${CMAKE_BINARY_DIR}/test1.c") +add_library(test1 SHARED "${CMAKE_BINARY_DIR}/test1.c") +foreach(name ${test1_names}) + file(APPEND "${CMAKE_BINARY_DIR}/test1.c" "extern void ${name}(void);\n") +endforeach() +file(APPEND "${CMAKE_BINARY_DIR}/test1.c" "void test1(void)\n{\n") +foreach(name ${test1_names}) + file(APPEND "${CMAKE_BINARY_DIR}/test1.c" " ${name}();\n") +endforeach() +file(APPEND "${CMAKE_BINARY_DIR}/test1.c" "}\n") + +target_link_libraries(test1 PRIVATE ${test1_names}) +set_property(TARGET test1 PROPERTY INSTALL_RPATH + "${CMAKE_BINARY_DIR}/root-all/lib/rpath1" + ) + +file(REMOVE "${CMAKE_BINARY_DIR}/test2.c") +add_library(test2 SHARED "${CMAKE_BINARY_DIR}/test2.c") +foreach(name ${test2_names}) + file(APPEND "${CMAKE_BINARY_DIR}/test2.c" "extern void ${name}(void);\n") +endforeach() +file(APPEND "${CMAKE_BINARY_DIR}/test2.c" "void test2(void)\n{\n") +foreach(name ${test2_names}) + file(APPEND "${CMAKE_BINARY_DIR}/test2.c" " ${name}();\n") +endforeach() +file(APPEND "${CMAKE_BINARY_DIR}/test2.c" "}\n") + +target_link_libraries(test2 PRIVATE ${test2_names}) +set_property(TARGET test2 PROPERTY INSTALL_RPATH + "${CMAKE_BINARY_DIR}/root-all/lib/rpath2" + ) + +install(TARGETS test1 test2 DESTINATION lib) + +install(CODE [[ + file(GET_RUNTIME_DEPENDENCIES + LIBRARIES + "${CMAKE_INSTALL_PREFIX}/lib/$" + "${CMAKE_INSTALL_PREFIX}/lib/$" + PRE_INCLUDE_REGEXES "^librpath\\.so$" + PRE_EXCLUDE_REGEXES ".*" + ) + message(FATAL_ERROR "This message should not be displayed") + ]]) diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-notfile-all-result.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-notfile-all-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-notfile-all-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-notfile-all-stderr.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-notfile-all-stderr.txt new file mode 100644 index 0000000..83a87c9 --- /dev/null +++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-notfile-all-stderr.txt @@ -0,0 +1,5 @@ +^CMake Error at cmake_install\.cmake:[0-9]+ \(file\): + file Failed to run objdump on: + + [^ +]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-notfile-build/root-all/bin/\.\./lib/libtest\.so$ diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-notfile.cmake b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-notfile.cmake new file mode 100644 index 0000000..6e718f8 --- /dev/null +++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-notfile.cmake @@ -0,0 +1,29 @@ +enable_language(C) + +file(WRITE "${CMAKE_BINARY_DIR}/test.c" "void test(void) {}\n") +file(WRITE "${CMAKE_BINARY_DIR}/main.c" [[extern void test(void); + +int main(void) +{ + test(); + return 0; +} +]]) + +add_library(test SHARED "${CMAKE_BINARY_DIR}/test.c") +add_executable(exe "${CMAKE_BINARY_DIR}/main.c") +target_link_libraries(exe PRIVATE test) +set_property(TARGET exe PROPERTY INSTALL_RPATH "\\\${ORIGIN}/../lib") + +install(TARGETS exe DESTINATION bin) + +install(CODE [[ + file(MAKE_DIRECTORY "${CMAKE_INSTALL_PREFIX}/lib/$") + file(GET_RUNTIME_DEPENDENCIES + EXECUTABLES + "${CMAKE_INSTALL_PREFIX}/bin/$" + PRE_INCLUDE_REGEXES "^libtest\\.so$" + PRE_EXCLUDE_REGEXES ".*" + ) + message(FATAL_ERROR "This message should not be displayed") + ]]) diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-unresolved-all-result.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-unresolved-all-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-unresolved-all-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-unresolved-all-stderr.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-unresolved-all-stderr.txt new file mode 100644 index 0000000..eaca512 --- /dev/null +++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-unresolved-all-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error at cmake_install\.cmake:[0-9]+ \(file\): + file Could not resolve file libunresolved\.so$ diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-unresolved.cmake b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-unresolved.cmake new file mode 100644 index 0000000..3efa305 --- /dev/null +++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-unresolved.cmake @@ -0,0 +1,18 @@ +enable_language(C) + +file(WRITE "${CMAKE_BINARY_DIR}/testlib.c" "extern void unresolved(void);\nvoid testlib(void)\n{\n unresolved();\n}\n") +add_library(testlib SHARED "${CMAKE_BINARY_DIR}/testlib.c") +file(WRITE "${CMAKE_BINARY_DIR}/unresolved.c" "void unresolved(void) {}\n") +add_library(unresolved SHARED "${CMAKE_BINARY_DIR}/unresolved.c") +target_link_libraries(testlib PRIVATE unresolved) +install(TARGETS testlib DESTINATION lib) + +install(CODE [[ + file(GET_RUNTIME_DEPENDENCIES + PRE_INCLUDE_REGEXES "^libunresolved\\.so$" + PRE_EXCLUDE_REGEXES ".*" + LIBRARIES + "${CMAKE_INSTALL_PREFIX}/lib/$" + ) + message(FATAL_ERROR "This message should not be displayed") + ]]) diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux.cmake b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux.cmake new file mode 100644 index 0000000..433dd3b --- /dev/null +++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux.cmake @@ -0,0 +1,168 @@ +enable_language(C) + +set(test_rpath_names + preexcluded + rpath_postexcluded + rpath + rpath_parent_postexcluded + rpath_parent + rpath_origin_postexcluded + rpath_origin + rpath_search_postexcluded + rpath_search + rpath_unresolved + conflict + ) +set(test_runpath_names + runpath_postexcluded + runpath + runpath_origin_postexcluded + runpath_origin + runpath_parent_unresolved + runpath_search_postexcluded + runpath_search + runpath_unresolved + ) + +file(REMOVE "${CMAKE_BINARY_DIR}/test_rpath.c") +add_library(test_rpath SHARED "${CMAKE_BINARY_DIR}/test_rpath.c") +foreach(name ${test_rpath_names}) + file(WRITE "${CMAKE_BINARY_DIR}/${name}.c" "void ${name}(void) {}\n") + add_library(${name} SHARED "${CMAKE_BINARY_DIR}/${name}.c") + + file(APPEND "${CMAKE_BINARY_DIR}/test_rpath.c" "extern void ${name}(void);\n") +endforeach() +file(APPEND "${CMAKE_BINARY_DIR}/test_rpath.c" "void test_rpath(void)\n{\n") +foreach(name ${test_rpath_names}) + file(APPEND "${CMAKE_BINARY_DIR}/test_rpath.c" " ${name}();\n") +endforeach() +file(APPEND "${CMAKE_BINARY_DIR}/test_rpath.c" "}\n") + +install(TARGETS rpath_postexcluded DESTINATION lib/rpath_postexcluded) +install(TARGETS rpath DESTINATION lib/rpath) +install(TARGETS rpath_origin_postexcluded DESTINATION lib/rpath_origin_postexcluded) +install(TARGETS rpath_origin DESTINATION lib/rpath_origin) +install(TARGETS rpath_parent_postexcluded DESTINATION lib/rpath_parent_postexcluded) +install(TARGETS rpath rpath_origin rpath_parent DESTINATION lib/rpath_parent) +install(TARGETS rpath_search_postexcluded DESTINATION lib/rpath_search_postexcluded) +install(TARGETS rpath rpath_origin rpath_parent rpath_search DESTINATION lib/rpath_search) +install(TARGETS conflict DESTINATION lib/conflict) + +target_link_libraries(test_rpath PRIVATE ${test_rpath_names}) +set_property(TARGET test_rpath PROPERTY INSTALL_RPATH + "${CMAKE_BINARY_DIR}/root-all/lib/rpath_postexcluded" + "${CMAKE_BINARY_DIR}/root-all/lib/rpath" + "\\\$ORIGIN/rpath_origin_postexcluded" + "\\\${ORIGIN}/rpath_origin" # This must be double-escaped because of issue #19225. + "${CMAKE_BINARY_DIR}/root-all/lib/conflict" + ) +target_link_options(test_rpath PRIVATE -Wl,--disable-new-dtags) + +file(REMOVE "${CMAKE_BINARY_DIR}/test_runpath.c") +add_library(test_runpath SHARED "${CMAKE_BINARY_DIR}/test_runpath.c") +foreach(name ${test_runpath_names} rpath conflict) + file(WRITE "${CMAKE_BINARY_DIR}/${name}.c" "void ${name}(void) {}\n") + if(NOT name MATCHES "^(rpath|conflict)$") + add_library(${name} SHARED "${CMAKE_BINARY_DIR}/${name}.c") + endif() + + file(APPEND "${CMAKE_BINARY_DIR}/test_runpath.c" "extern void ${name}(void);\n") +endforeach() +file(APPEND "${CMAKE_BINARY_DIR}/test_runpath.c" "void test_runpath(void)\n{\n") +foreach(name ${test_runpath_names} rpath conflict) + file(APPEND "${CMAKE_BINARY_DIR}/test_runpath.c" " ${name}();\n") +endforeach() +file(APPEND "${CMAKE_BINARY_DIR}/test_runpath.c" "}\n") + +install(TARGETS runpath_postexcluded DESTINATION lib/runpath_postexcluded) +install(TARGETS runpath DESTINATION lib/runpath) +install(TARGETS runpath_origin_postexcluded DESTINATION lib/runpath_origin_postexcluded) +install(TARGETS runpath_origin DESTINATION lib/runpath_origin) +install(TARGETS runpath_parent_unresolved DESTINATION lib/runpath_parent_unresolved) +install(TARGETS runpath_search_postexcluded DESTINATION lib/runpath_search_postexcluded) +install(TARGETS runpath runpath_origin runpath_search DESTINATION lib/runpath_search) +install(TARGETS conflict DESTINATION lib/conflict2) + +target_link_libraries(test_runpath PRIVATE ${test_runpath_names} rpath conflict) +set_property(TARGET test_runpath PROPERTY INSTALL_RPATH + "${CMAKE_BINARY_DIR}/root-all/lib/runpath/../rpath" # Ensure that files that don't conflict are treated correctly + "${CMAKE_BINARY_DIR}/root-all/lib/runpath_postexcluded" + "${CMAKE_BINARY_DIR}/root-all/lib/runpath" + "\\\${ORIGIN}/runpath_origin_postexcluded" # This must be double-escaped because of issue #19225. + "\\\$ORIGIN/runpath_origin" + "${CMAKE_BINARY_DIR}/root-all/lib/conflict2" + ) +target_link_options(test_runpath PRIVATE -Wl,--enable-new-dtags) + +set_property(TARGET test_rpath ${test_rpath_names} test_runpath ${test_runpath_names} PROPERTY LIBRARY_OUTPUT_DIRECTORY lib) +install(TARGETS test_rpath test_runpath DESTINATION lib) + +add_executable(topexe file-GET_RUNTIME_DEPENDENCIES-linux/topexe.c) +add_library(toplib SHARED file-GET_RUNTIME_DEPENDENCIES-linux/toplib.c) +add_library(topmod MODULE file-GET_RUNTIME_DEPENDENCIES-linux/toplib.c) +target_link_libraries(topexe PRIVATE test_rpath test_runpath) +target_link_libraries(toplib PRIVATE test_rpath test_runpath) +target_link_libraries(topmod PRIVATE test_rpath test_runpath) +set_property(TARGET topexe toplib topmod PROPERTY INSTALL_RPATH + "${CMAKE_BINARY_DIR}/root-all/lib" + "${CMAKE_BINARY_DIR}/root-all/lib/rpath_parent_postexcluded" + "${CMAKE_BINARY_DIR}/root-all/lib/rpath_parent" + "${CMAKE_BINARY_DIR}/root-all/lib/runpath_parent_unresolved" + ) +target_link_options(topexe PRIVATE -Wl,--disable-new-dtags) +target_link_options(toplib PRIVATE -Wl,--disable-new-dtags) +target_link_options(topmod PRIVATE -Wl,--disable-new-dtags) + +install(TARGETS topexe toplib RUNTIME DESTINATION bin LIBRARY DESTINATION lib) +install(TARGETS topmod LIBRARY DESTINATION lib/modules) + +install(CODE [[ + function(exec_get_runtime_dependencies depsfile udepsfile cdepsfile) + file(GET_RUNTIME_DEPENDENCIES + RESOLVED_DEPENDENCIES_VAR deps + UNRESOLVED_DEPENDENCIES_VAR udeps + CONFLICTING_DEPENDENCIES_PREFIX cdeps + PRE_INCLUDE_REGEXES + "^lib(test_rpath|rpath_postexcluded|rpath|rpath_parent_postexcluded|rpath_parent|rpath_origin_postexcluded|rpath_origin|rpath_search_postexcluded|rpath_search|rpath_unresolved|test_runpath|runpath_postexcluded|runpath|runpath_origin_postexcluded|runpath_origin|runpath_parent_unresolved|runpath_search_postexcluded|runpath_search|runpath_unresolved|conflict)\\.so$" + "^libc\\.so" + PRE_EXCLUDE_REGEXES ".*" + POST_INCLUDE_REGEXES "^.*/(libtest_rpath|rpath/librpath|rpath_parent/librpath_parent|rpath_search/librpath_search|libtest_runpath|runpath/librunpath|runpath_origin_postexcluded|runpath_origin|runpath_search/librunpath_search|conflict2?/libconflict)\\.so$" + POST_EXCLUDE_REGEXES ".*" + DIRECTORIES + "${CMAKE_INSTALL_PREFIX}/lib/rpath_search_postexcluded" + "${CMAKE_INSTALL_PREFIX}/lib/rpath_search" + "${CMAKE_INSTALL_PREFIX}/lib/runpath_search_postexcluded" + "${CMAKE_INSTALL_PREFIX}/lib/runpath_search" + ${ARGN} + ) + list(SORT deps) + list(SORT udeps) + list(SORT cdeps_FILENAMES) + file(WRITE "${CMAKE_INSTALL_PREFIX}/deps/${depsfile}" "${deps}") + file(WRITE "${CMAKE_INSTALL_PREFIX}/deps/${udepsfile}" "${udeps}") + file(WRITE "${CMAKE_INSTALL_PREFIX}/deps/${cdepsfile}" "") + foreach(cdep IN LISTS cdeps_FILENAMES) + set(cdep_values ${cdeps_${cdep}}) + list(SORT cdep_values) + file(APPEND "${CMAKE_INSTALL_PREFIX}/deps/${cdepsfile}" "${cdep}:${cdep_values}\n") + endforeach() + endfunction() + + exec_get_runtime_dependencies( + deps1.txt udeps1.txt cdeps1.txt + EXECUTABLES + "${CMAKE_INSTALL_PREFIX}/bin/$" + ) + + exec_get_runtime_dependencies( + deps2.txt udeps2.txt cdeps2.txt + LIBRARIES + "${CMAKE_INSTALL_PREFIX}/lib/$" + ) + + exec_get_runtime_dependencies( + deps3.txt udeps3.txt cdeps3.txt + MODULES + "${CMAKE_INSTALL_PREFIX}/lib/modules/$" + ) + ]]) diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux/topexe.c b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux/topexe.c new file mode 100644 index 0000000..d196afe --- /dev/null +++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux/topexe.c @@ -0,0 +1,9 @@ +extern void test_rpath(void); +extern void test_runpath(void); + +int main(void) +{ + test_rpath(); + test_runpath(); + return 0; +} diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux/toplib.c b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux/toplib.c new file mode 100644 index 0000000..040e591 --- /dev/null +++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux/toplib.c @@ -0,0 +1,8 @@ +extern void test_rpath(void); +extern void test_runpath(void); + +void toplib(void) +{ + test_rpath(); + test_runpath(); +} diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-all-check.cmake b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-all-check.cmake new file mode 100644 index 0000000..4d6dde1 --- /dev/null +++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-all-check.cmake @@ -0,0 +1,157 @@ +function(check_contents filename contents_regex) + if(EXISTS "${CMAKE_INSTALL_PREFIX}/${filename}") + file(READ "${CMAKE_INSTALL_PREFIX}/${filename}" contents) + if(NOT contents MATCHES "${contents_regex}") + string(APPEND RunCMake_TEST_FAILED "File contents: + ${contents} +do not match what we expected: + ${contents_regex} +in file: + ${CMAKE_INSTALL_PREFIX}/${filename}\n") + set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE) + endif() + else() + string(APPEND RunCMake_TEST_FAILED "File ${CMAKE_INSTALL_PREFIX}/${filename} does not exist") + set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE) + endif() +endfunction() + +set(_check + [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/bin/../lib/executable_path/libexecutable_path\.dylib]] + [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/bin/../lib/rpath_executable_path/librpath_executable_path\.dylib]] + [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/libtestlib\.dylib]] + [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/loader_path/libloader_path\.dylib]] + [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/normal/../rpath/librpath\.dylib]] + [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/normal/libnormal\.dylib]] + [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/rpath_loader_path/librpath_loader_path\.dylib]] + [[/usr/lib/libSystem\.B\.dylib]] + ) +check_contents(deps/deps1.txt "^${_check}$") + +set(_check + [[@executable_path/../lib/executable_path_bundle/libexecutable_path_bundle\.dylib]] + [[@loader_path/loader_path_unresolved/libloader_path_unresolved\.dylib]] + [[@rpath/librpath_executable_path_bundle\.dylib]] + [[@rpath/librpath_loader_path_unresolved\.dylib]] + [[@rpath/librpath_unresolved\.dylib]] + ) +check_contents(deps/udeps1.txt "^${_check}$") + +set(_check + [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/libtestlib\.dylib]] + [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/loader_path/libloader_path\.dylib]] + [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/normal/../rpath/librpath\.dylib]] + [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/normal/libnormal\.dylib]] + [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/rpath_loader_path/librpath_loader_path\.dylib]] + [[/usr/lib/libSystem\.B\.dylib]] + ) +check_contents(deps/deps2.txt "^${_check}$") + +set(_check + [[@executable_path/../lib/executable_path/libexecutable_path\.dylib]] + [[@executable_path/../lib/executable_path_bundle/libexecutable_path_bundle\.dylib]] + [[@executable_path/../lib/executable_path_postexcluded/libexecutable_path_postexcluded\.dylib]] + [[@loader_path/loader_path_unresolved/libloader_path_unresolved\.dylib]] + [[@rpath/librpath_executable_path\.dylib]] + [[@rpath/librpath_executable_path_bundle\.dylib]] + [[@rpath/librpath_executable_path_postexcluded\.dylib]] + [[@rpath/librpath_loader_path_unresolved\.dylib]] + [[@rpath/librpath_unresolved\.dylib]] + ) +check_contents(deps/udeps2.txt "^${_check}$") + +set(_check + [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/libtestlib\.dylib]] + [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/loader_path/libloader_path\.dylib]] + [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/normal/../rpath/librpath\.dylib]] + [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/normal/libnormal\.dylib]] + [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/rpath_loader_path/librpath_loader_path\.dylib]] + [[/usr/lib/libSystem\.B\.dylib]] + ) +check_contents(deps/deps3.txt "^${_check}$") + +set(_check + [[@executable_path/../lib/executable_path/libexecutable_path\.dylib]] + [[@executable_path/../lib/executable_path_bundle/libexecutable_path_bundle\.dylib]] + [[@executable_path/../lib/executable_path_postexcluded/libexecutable_path_postexcluded\.dylib]] + [[@loader_path/loader_path_unresolved/libloader_path_unresolved\.dylib]] + [[@rpath/librpath_executable_path\.dylib]] + [[@rpath/librpath_executable_path_bundle\.dylib]] + [[@rpath/librpath_executable_path_postexcluded\.dylib]] + [[@rpath/librpath_loader_path_unresolved\.dylib]] + [[@rpath/librpath_unresolved\.dylib]] + ) +check_contents(deps/udeps3.txt "^${_check}$") + +set(_check + [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/bin/../lib/executable_path/libexecutable_path\.dylib]] + [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/bin/../lib/rpath_executable_path/librpath_executable_path\.dylib]] + [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/libtestlib\.dylib]] + [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/loader_path/libloader_path\.dylib]] + [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/normal/../rpath/librpath\.dylib]] + [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/normal/libnormal\.dylib]] + [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/rpath_loader_path/librpath_loader_path\.dylib]] + [[/usr/lib/libSystem\.B\.dylib]] + ) +check_contents(deps/deps4.txt "^${_check}$") + +set(_check + [[@executable_path/../lib/executable_path_bundle/libexecutable_path_bundle\.dylib]] + [[@loader_path/loader_path_unresolved/libloader_path_unresolved\.dylib]] + [[@rpath/librpath_executable_path_bundle\.dylib]] + [[@rpath/librpath_loader_path_unresolved\.dylib]] + [[@rpath/librpath_unresolved\.dylib]] + ) +check_contents(deps/udeps4.txt "^${_check}$") + +set(_check + [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/bundle_executable/bin/../lib/executable_path_bundle/libexecutable_path_bundle\.dylib]] + [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/libtestlib\.dylib]] + [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/loader_path/libloader_path\.dylib]] + [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/normal/../rpath/librpath\.dylib]] + [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/normal/libnormal\.dylib]] + [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/rpath_loader_path/librpath_loader_path\.dylib]] + [[/usr/lib/libSystem\.B\.dylib]] + ) +check_contents(deps/deps5.txt "^${_check}$") + +set(_check + [[@executable_path/../lib/executable_path/libexecutable_path\.dylib]] + [[@loader_path/loader_path_unresolved/libloader_path_unresolved\.dylib]] + [[@rpath/librpath_executable_path\.dylib]] + [[@rpath/librpath_executable_path_bundle\.dylib]] + [[@rpath/librpath_loader_path_unresolved\.dylib]] + [[@rpath/librpath_unresolved\.dylib]] + ) +check_contents(deps/udeps5.txt "^${_check}$") + +set(_check + [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/bundle_executable/bin/../lib/executable_path_bundle/libexecutable_path_bundle\.dylib]] + [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/libtestlib\.dylib]] + [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/loader_path/libloader_path\.dylib]] + [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/normal/../rpath/librpath\.dylib]] + [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/normal/libnormal\.dylib]] + [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/rpath_loader_path/librpath_loader_path\.dylib]] + [[/usr/lib/libSystem\.B\.dylib]] + ) +check_contents(deps/deps6.txt "^${_check}$") + +set(_check + [[@executable_path/../lib/executable_path/libexecutable_path\.dylib]] + [[@loader_path/loader_path_unresolved/libloader_path_unresolved\.dylib]] + [[@rpath/librpath_executable_path\.dylib]] + [[@rpath/librpath_executable_path_bundle\.dylib]] + [[@rpath/librpath_loader_path_unresolved\.dylib]] + [[@rpath/librpath_unresolved\.dylib]] + ) +check_contents(deps/udeps6.txt "^${_check}$") + +set(_check + "^libconflict\\.dylib:[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/conflict/libconflict\\.dylib;[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/conflict2/libconflict\\.dylib\n$" + ) +check_contents(deps/cdeps1.txt "${_check}") +check_contents(deps/cdeps2.txt "${_check}") +check_contents(deps/cdeps3.txt "${_check}") +check_contents(deps/cdeps4.txt "${_check}") +check_contents(deps/cdeps5.txt "${_check}") +check_contents(deps/cdeps6.txt "${_check}") diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-conflict-all-result.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-conflict-all-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-conflict-all-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-conflict-all-stderr.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-conflict-all-stderr.txt new file mode 100644 index 0000000..bc9e97a --- /dev/null +++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-conflict-all-stderr.txt @@ -0,0 +1,7 @@ +^CMake Error at cmake_install\.cmake:[0-9]+ \(file\): + file Multiple conflicting paths found for librpath\.dylib: + + [^ +]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-conflict-build/root-all/lib/rpath1/librpath\.dylib + [^ +]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-conflict-build/root-all/lib/rpath2/librpath\.dylib$ diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-conflict.cmake b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-conflict.cmake new file mode 100644 index 0000000..a8446fe --- /dev/null +++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-conflict.cmake @@ -0,0 +1,55 @@ +enable_language(C) + +set(test1_names rpath) +set(test2_names rpath) + +file(WRITE "${CMAKE_BINARY_DIR}/rpath.c" "void rpath(void) {}\n") +add_library(rpath SHARED "${CMAKE_BINARY_DIR}/rpath.c") +set_property(TARGET rpath PROPERTY INSTALL_NAME_DIR @rpath) +install(TARGETS rpath DESTINATION lib/rpath1) +install(TARGETS rpath DESTINATION lib/rpath2) + +file(REMOVE "${CMAKE_BINARY_DIR}/test1.c") +add_library(test1 SHARED "${CMAKE_BINARY_DIR}/test1.c") +foreach(name ${test1_names}) + file(APPEND "${CMAKE_BINARY_DIR}/test1.c" "extern void ${name}(void);\n") +endforeach() +file(APPEND "${CMAKE_BINARY_DIR}/test1.c" "void test1(void)\n{\n") +foreach(name ${test1_names}) + file(APPEND "${CMAKE_BINARY_DIR}/test1.c" " ${name}();\n") +endforeach() +file(APPEND "${CMAKE_BINARY_DIR}/test1.c" "}\n") + +target_link_libraries(test1 PRIVATE ${test1_names}) +set_property(TARGET test1 PROPERTY INSTALL_RPATH + "${CMAKE_BINARY_DIR}/root-all/lib/rpath1" + ) + +file(REMOVE "${CMAKE_BINARY_DIR}/test2.c") +add_library(test2 SHARED "${CMAKE_BINARY_DIR}/test2.c") +foreach(name ${test2_names}) + file(APPEND "${CMAKE_BINARY_DIR}/test2.c" "extern void ${name}(void);\n") +endforeach() +file(APPEND "${CMAKE_BINARY_DIR}/test2.c" "void test2(void)\n{\n") +foreach(name ${test2_names}) + file(APPEND "${CMAKE_BINARY_DIR}/test2.c" " ${name}();\n") +endforeach() +file(APPEND "${CMAKE_BINARY_DIR}/test2.c" "}\n") + +target_link_libraries(test2 PRIVATE ${test2_names}) +set_property(TARGET test2 PROPERTY INSTALL_RPATH + "${CMAKE_BINARY_DIR}/root-all/lib/rpath2" + ) + +install(TARGETS test1 test2 DESTINATION lib) + +install(CODE [[ + file(GET_RUNTIME_DEPENDENCIES + LIBRARIES + "${CMAKE_INSTALL_PREFIX}/lib/$" + "${CMAKE_INSTALL_PREFIX}/lib/$" + PRE_INCLUDE_REGEXES "^@rpath/librpath\\.dylib$" + PRE_EXCLUDE_REGEXES ".*" + ) + message(FATAL_ERROR "This message should not be displayed") + ]]) diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-notfile-all-result.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-notfile-all-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-notfile-all-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-notfile-all-stderr.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-notfile-all-stderr.txt new file mode 100644 index 0000000..73ab9f1 --- /dev/null +++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-notfile-all-stderr.txt @@ -0,0 +1,5 @@ +^CMake Error at cmake_install\.cmake:[0-9]+ \(file\): + file Failed to run otool on: + + [^ +]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-notfile-build/root-all/bin/\.\./lib/libtest\.dylib$ diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-notfile.cmake b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-notfile.cmake new file mode 100644 index 0000000..3e4c434 --- /dev/null +++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-notfile.cmake @@ -0,0 +1,30 @@ +enable_language(C) + +file(WRITE "${CMAKE_BINARY_DIR}/test.c" "void test(void) {}\n") +file(WRITE "${CMAKE_BINARY_DIR}/main.c" [[extern void test(void); + +int main(void) +{ + test(); + return 0; +} +]]) + +add_library(test SHARED "${CMAKE_BINARY_DIR}/test.c") +set_property(TARGET test PROPERTY INSTALL_NAME_DIR @rpath) +add_executable(exe "${CMAKE_BINARY_DIR}/main.c") +target_link_libraries(exe PRIVATE test) +set_property(TARGET exe PROPERTY INSTALL_RPATH "@loader_path/../lib") + +install(TARGETS exe DESTINATION bin) + +install(CODE [[ + file(MAKE_DIRECTORY "${CMAKE_INSTALL_PREFIX}/lib/$") + file(GET_RUNTIME_DEPENDENCIES + EXECUTABLES + "${CMAKE_INSTALL_PREFIX}/bin/$" + PRE_INCLUDE_REGEXES "^@rpath/libtest\\.dylib$" + PRE_EXCLUDE_REGEXES ".*" + ) + message(FATAL_ERROR "This message should not be displayed") + ]]) diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-unresolved-all-result.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-unresolved-all-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-unresolved-all-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-unresolved-all-stderr.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-unresolved-all-stderr.txt new file mode 100644 index 0000000..01762b4 --- /dev/null +++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-unresolved-all-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error at cmake_install\.cmake:[0-9]+ \(file\): + file Could not resolve file @rpath/libunresolved\.dylib$ diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-unresolved.cmake b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-unresolved.cmake new file mode 100644 index 0000000..c9b6c95 --- /dev/null +++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-unresolved.cmake @@ -0,0 +1,18 @@ +enable_language(C) + +file(WRITE "${CMAKE_BINARY_DIR}/testlib.c" "extern void unresolved(void);\nvoid testlib(void)\n{\n unresolved();\n}\n") +add_library(testlib SHARED "${CMAKE_BINARY_DIR}/testlib.c") +file(WRITE "${CMAKE_BINARY_DIR}/unresolved.c" "void unresolved(void) {}\n") +add_library(unresolved SHARED "${CMAKE_BINARY_DIR}/unresolved.c") +target_link_libraries(testlib PRIVATE unresolved) +install(TARGETS testlib DESTINATION lib) + +install(CODE [[ + file(GET_RUNTIME_DEPENDENCIES + PRE_INCLUDE_REGEXES "^@rpath/libunresolved\\.dylib$" + PRE_EXCLUDE_REGEXES ".*" + LIBRARIES + "${CMAKE_INSTALL_PREFIX}/lib/$" + ) + message(FATAL_ERROR "This message should not be displayed") + ]]) diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos.cmake b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos.cmake new file mode 100644 index 0000000..6db05b3 --- /dev/null +++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos.cmake @@ -0,0 +1,216 @@ +enable_language(C) + +set(testlib_names + preexcluded + executable_path + executable_path_bundle + executable_path_postexcluded + loader_path + loader_path_unresolved + loader_path_postexcluded + rpath + rpath_unresolved + rpath_postexcluded + rpath_executable_path + rpath_executable_path_bundle + rpath_executable_path_postexcluded + rpath_loader_path + rpath_loader_path_unresolved + rpath_loader_path_postexcluded + normal + normal_unresolved + normal_postexcluded + conflict + ) + +file(REMOVE "${CMAKE_BINARY_DIR}/testlib.c") +add_library(testlib SHARED "${CMAKE_BINARY_DIR}/testlib.c") +foreach(name ${testlib_names}) + if(name STREQUAL "normal") + file(WRITE "${CMAKE_BINARY_DIR}/normal.c" "extern void rpath(void);\nvoid normal(void)\n{\n rpath();\n}\n") + else() + file(WRITE "${CMAKE_BINARY_DIR}/${name}.c" "void ${name}(void) {}\n") + endif() + add_library(${name} SHARED "${CMAKE_BINARY_DIR}/${name}.c") + + file(APPEND "${CMAKE_BINARY_DIR}/testlib.c" "extern void ${name}(void);\n") +endforeach() +file(APPEND "${CMAKE_BINARY_DIR}/testlib.c" "void testlib(void)\n{\n") +foreach(name ${testlib_names}) + file(APPEND "${CMAKE_BINARY_DIR}/testlib.c" " ${name}();\n") +endforeach() +file(APPEND "${CMAKE_BINARY_DIR}/testlib.c" "}\n") +set_property(TARGET ${testlib_names} PROPERTY BUILD_WITH_INSTALL_NAME_DIR 1) +target_link_libraries(normal PRIVATE rpath) +set_property(TARGET normal PROPERTY INSTALL_RPATH + "${CMAKE_BINARY_DIR}/root-all/executable/lib/normal/../rpath" + ) + +file(WRITE "${CMAKE_BINARY_DIR}/testlib_conflict.c" "extern void conflict(void);\nvoid testlib_conflict(void)\n{\n conflict();\n}\n") +add_library(testlib_conflict SHARED "${CMAKE_BINARY_DIR}/testlib_conflict.c") +target_link_libraries(testlib_conflict PRIVATE conflict) + +set_property(TARGET testlib PROPERTY INSTALL_RPATH + "${CMAKE_BINARY_DIR}/root-all/executable/lib/rpath" + "${CMAKE_BINARY_DIR}/root-all/executable/lib/rpath_unresolved" + "${CMAKE_BINARY_DIR}/root-all/executable/lib/rpath_postexcluded" + "${CMAKE_BINARY_DIR}/root-all/executable/lib/conflict" + @executable_path/../lib/rpath_executable_path + @executable_path/../lib/rpath_executable_path_unresolved + @executable_path/../lib/rpath_executable_path_postexcluded + @loader_path/rpath_loader_path + @loader_path/rpath_loader_path_unresolved + @loader_path/rpath_loader_path_postexcluded + ) +set_property(TARGET testlib_conflict PROPERTY INSTALL_RPATH + "${CMAKE_BINARY_DIR}/root-all/executable/lib/conflict2" + ) + +foreach(t + executable_path + executable_path_postexcluded + loader_path + loader_path_postexcluded + rpath + rpath_postexcluded + rpath_executable_path + rpath_executable_path_postexcluded + rpath_loader_path + rpath_loader_path_postexcluded + conflict + ) + install(TARGETS ${t} DESTINATION executable/lib/${t}) +endforeach() +install(TARGETS conflict DESTINATION executable/lib/conflict2) + +foreach(t + executable_path_bundle + executable_path_postexcluded + loader_path_postexcluded + rpath_postexcluded + rpath_executable_path_bundle + rpath_executable_path_postexcluded + rpath_loader_path_postexcluded + ) + install(TARGETS ${t} DESTINATION bundle_executable/lib/${t}) +endforeach() + +foreach(t executable_path executable_path_bundle executable_path_postexcluded) + set_property(TARGET ${t} PROPERTY INSTALL_NAME_DIR @executable_path/../lib/${t}) +endforeach() + +foreach(t loader_path loader_path_unresolved loader_path_postexcluded) + set_property(TARGET ${t} PROPERTY INSTALL_NAME_DIR @loader_path/${t}) +endforeach() + +foreach(t + rpath + rpath_unresolved + rpath_postexcluded + rpath_executable_path + rpath_executable_path_bundle + rpath_executable_path_postexcluded + rpath_loader_path + rpath_loader_path_unresolved + rpath_loader_path_postexcluded + conflict + ) + set_property(TARGET ${t} PROPERTY INSTALL_NAME_DIR @rpath) +endforeach() + +foreach(t normal normal_unresolved normal_postexcluded) + set_property(TARGET ${t} PROPERTY INSTALL_NAME_DIR "${CMAKE_BINARY_DIR}/root-all/executable/lib/${t}") + if(NOT t STREQUAL "normal_unresolved") + install(TARGETS ${t} DESTINATION executable/lib/${t}) + endif() +endforeach() + +target_link_libraries(testlib PRIVATE ${testlib_names}) + +add_executable(topexe file-GET_RUNTIME_DEPENDENCIES-macos/topexe.c) +add_library(toplib SHARED file-GET_RUNTIME_DEPENDENCIES-macos/toplib.c) +add_library(topmod MODULE file-GET_RUNTIME_DEPENDENCIES-macos/toplib.c) +target_link_libraries(topexe PRIVATE testlib) +target_link_libraries(toplib PRIVATE testlib) +target_link_libraries(topmod PRIVATE testlib) + +set_property(TARGET topexe toplib topmod PROPERTY INSTALL_RPATH "${CMAKE_BINARY_DIR}/root-all/executable/lib") + +install(TARGETS topexe toplib topmod testlib testlib_conflict RUNTIME DESTINATION executable/bin LIBRARY DESTINATION executable/lib) +install(TARGETS topexe toplib topmod testlib testlib_conflict RUNTIME DESTINATION bundle_executable/bin LIBRARY DESTINATION bundle_executable/lib) + +install(CODE [[ + function(exec_get_runtime_dependencies depsfile udepsfile cdepsfile) + file(GET_RUNTIME_DEPENDENCIES + RESOLVED_DEPENDENCIES_VAR deps + UNRESOLVED_DEPENDENCIES_VAR udeps + CONFLICTING_DEPENDENCIES_PREFIX cdeps + PRE_INCLUDE_REGEXES "^.*/lib(testlib|executable_path|executable_path_bundle|executable_path_postexcluded|loader_path|loader_path_unresolved|loader_path_postexcluded|rpath|rpath_unresolved|rpath_postexcluded|rpath_executable_path|rpath_executable_path_bundle|rpath_executable_path_postexcluded|rpath_loader_path|rpath_loader_path_unresolved|rpath_loader_path_postexcluded|normal|normal_unresolved|normal_postexcluded|conflict|System\\.B)\\.dylib$" + PRE_EXCLUDE_REGEXES ".*" + POST_INCLUDE_REGEXES "^.*/lib(testlib|executable_path|executable_path_bundle|loader_path|rpath|rpath_executable_path|rpath_executable_path_bundle|rpath_loader_path|normal|conflict|System\\.B)\\.dylib$" + POST_EXCLUDE_REGEXES ".*" + ${ARGN} + ) + list(SORT deps) + list(SORT udeps) + list(SORT cdeps_FILENAMES) + file(WRITE "${CMAKE_INSTALL_PREFIX}/deps/${depsfile}" "${deps}") + file(WRITE "${CMAKE_INSTALL_PREFIX}/deps/${udepsfile}" "${udeps}") + file(WRITE "${CMAKE_INSTALL_PREFIX}/deps/${cdepsfile}" "") + foreach(cdep IN LISTS cdeps_FILENAMES) + set(cdep_values ${cdeps_${cdep}}) + list(SORT cdep_values) + file(APPEND "${CMAKE_INSTALL_PREFIX}/deps/${cdepsfile}" "${cdep}:${cdep_values}\n") + endforeach() + endfunction() + + exec_get_runtime_dependencies( + deps1.txt udeps1.txt cdeps1.txt + EXECUTABLES + "${CMAKE_INSTALL_PREFIX}/executable/bin/$" + LIBRARIES + "${CMAKE_INSTALL_PREFIX}/executable/lib/$" + ) + + exec_get_runtime_dependencies( + deps2.txt udeps2.txt cdeps2.txt + LIBRARIES + "${CMAKE_INSTALL_PREFIX}/executable/lib/$" + "${CMAKE_INSTALL_PREFIX}/executable/lib/$" + ) + + exec_get_runtime_dependencies( + deps3.txt udeps3.txt cdeps3.txt + MODULES + "${CMAKE_INSTALL_PREFIX}/executable/lib/$" + LIBRARIES + "${CMAKE_INSTALL_PREFIX}/executable/lib/$" + ) + + exec_get_runtime_dependencies( + deps4.txt udeps4.txt cdeps4.txt + EXECUTABLES + "${CMAKE_INSTALL_PREFIX}/executable/bin/$" + LIBRARIES + "${CMAKE_INSTALL_PREFIX}/executable/lib/$" + BUNDLE_EXECUTABLE + "${CMAKE_INSTALL_PREFIX}/bundle_executable/bin/$" + ) + + exec_get_runtime_dependencies( + deps5.txt udeps5.txt cdeps5.txt + LIBRARIES + "${CMAKE_INSTALL_PREFIX}/executable/lib/$" + "${CMAKE_INSTALL_PREFIX}/executable/lib/$" + BUNDLE_EXECUTABLE "${CMAKE_INSTALL_PREFIX}/bundle_executable/bin/$" + ) + + exec_get_runtime_dependencies( + deps6.txt udeps6.txt cdeps6.txt + MODULES + "${CMAKE_INSTALL_PREFIX}/executable/lib/$" + LIBRARIES + "${CMAKE_INSTALL_PREFIX}/executable/lib/$" + BUNDLE_EXECUTABLE "${CMAKE_INSTALL_PREFIX}/bundle_executable/bin/$" + ) + ]]) diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos/topexe.c b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos/topexe.c new file mode 100644 index 0000000..20c6087 --- /dev/null +++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos/topexe.c @@ -0,0 +1,7 @@ +extern void testlib(void); + +int main(void) +{ + testlib(); + return 0; +} diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos/toplib.c b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos/toplib.c new file mode 100644 index 0000000..cff1bff --- /dev/null +++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos/toplib.c @@ -0,0 +1,6 @@ +extern void testlib(void); + +void toplib(void) +{ + testlib(); +} diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-project-stderr.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-project-stderr.txt new file mode 100644 index 0000000..d506645 --- /dev/null +++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-project-stderr.txt @@ -0,0 +1,13 @@ +^CMake Warning \(dev\) at file-GET_RUNTIME_DEPENDENCIES-project\.cmake:[0-9]+ \(file\): + You have used file\(GET_RUNTIME_DEPENDENCIES\) in project mode\. This is + probably not what you intended to do\. Instead, please consider using it in + an install\(CODE\) or install\(SCRIPT\) command\. For example: + + install\(CODE \[\[ + file\(GET_RUNTIME_DEPENDENCIES + # \.\.\. + \) + ]]\) +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\) +This warning is for project developers\. Use -Wno-dev to suppress it\.$ diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-project.cmake b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-project.cmake new file mode 100644 index 0000000..842d7ab --- /dev/null +++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-project.cmake @@ -0,0 +1 @@ +file(GET_RUNTIME_DEPENDENCIES RESOLVED_DEPENDENCIES_VAR deps) diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-unsupported-result.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-unsupported-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-unsupported-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-unsupported-stderr.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-unsupported-stderr.txt new file mode 100644 index 0000000..3db835c --- /dev/null +++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-unsupported-stderr.txt @@ -0,0 +1,5 @@ +^CMake Error at file-GET_RUNTIME_DEPENDENCIES-unsupported\.cmake:[0-9]+ \(file\): + file GET_RUNTIME_DEPENDENCIES is not supported on system "[^ + ]+" +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-unsupported.cmake b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-unsupported.cmake new file mode 100644 index 0000000..b91eefe --- /dev/null +++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-unsupported.cmake @@ -0,0 +1,2 @@ +file(GET_RUNTIME_DEPENDENCIES RESOLVED_DEPENDENCIES_VAR deps) +message(FATAL_ERROR "This message should not be displayed") diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-all-check.cmake b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-all-check.cmake new file mode 100644 index 0000000..c120ce4 --- /dev/null +++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-all-check.cmake @@ -0,0 +1,38 @@ +function(check_contents filename contents_regex) + if(EXISTS "${CMAKE_INSTALL_PREFIX}/${filename}") + file(READ "${CMAKE_INSTALL_PREFIX}/${filename}" contents) + if(NOT contents MATCHES "${contents_regex}") + string(APPEND RunCMake_TEST_FAILED "File contents: + ${contents} +do not match what we expected: + ${contents_regex} +in file: + ${CMAKE_INSTALL_PREFIX}/${filename}\n") + set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE) + endif() + else() + string(APPEND RunCMake_TEST_FAILED "File ${CMAKE_INSTALL_PREFIX}/${filename} does not exist") + set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE) + endif() +endfunction() + +set(_check + [=[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-build/root-all/bin/\.conflict/\.\./(lib)?libdir\.dll]=] + [=[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-build/root-all/bin/\.search/(lib)?search\.dll]=] + [=[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-build/root-all/bin/(lib)?testlib\.dll]=] + ) +check_contents(deps/deps1.txt "^${_check}$") +check_contents(deps/deps2.txt "^${_check}$") +check_contents(deps/deps3.txt "^${_check}$") +set(_check + [=[(lib)?unresolved\.dll]=] + ) +check_contents(deps/udeps1.txt "^${_check}$") +check_contents(deps/udeps2.txt "^${_check}$") +check_contents(deps/udeps3.txt "^${_check}$") +set(_check + "^(lib)?conflict\\.dll:[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-build/root-all/bin/\\.conflict/(lib)?conflict\\.dll;[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-build/root-all/bin/(lib)?conflict\\.dll\n$" + ) +check_contents(deps/cdeps1.txt "${_check}") +check_contents(deps/cdeps2.txt "${_check}") +check_contents(deps/cdeps3.txt "${_check}") diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-conflict-all-result.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-conflict-all-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-conflict-all-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-conflict-all-stderr.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-conflict-all-stderr.txt new file mode 100644 index 0000000..66ecb93 --- /dev/null +++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-conflict-all-stderr.txt @@ -0,0 +1,7 @@ +^CMake Error at cmake_install\.cmake:[0-9]+ \(file\): + file Multiple conflicting paths found for (lib)?path\.dll: + + [^ +]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-conflict-build/root-all/lib/test1/(lib)?path\.dll + [^ +]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-conflict-build/root-all/lib/test2/(lib)?path\.dll$ diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-conflict.cmake b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-conflict.cmake new file mode 100644 index 0000000..d413443 --- /dev/null +++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-conflict.cmake @@ -0,0 +1,47 @@ +enable_language(C) + +set(test1_names path) +set(test2_names path) + +file(WRITE "${CMAKE_BINARY_DIR}/path.c" "__declspec(dllexport) void path(void) {}\n") +add_library(path SHARED "${CMAKE_BINARY_DIR}/path.c") + +file(REMOVE "${CMAKE_BINARY_DIR}/test1.c") +add_library(test1 SHARED "${CMAKE_BINARY_DIR}/test1.c") +foreach(name ${test1_names}) + file(APPEND "${CMAKE_BINARY_DIR}/test1.c" "__declspec(dllimport) extern void ${name}(void);\n") +endforeach() +file(APPEND "${CMAKE_BINARY_DIR}/test1.c" "__declspec(dllexport) void test1(void)\n{\n") +foreach(name ${test1_names}) + file(APPEND "${CMAKE_BINARY_DIR}/test1.c" " ${name}();\n") +endforeach() +file(APPEND "${CMAKE_BINARY_DIR}/test1.c" "}\n") + +target_link_libraries(test1 PRIVATE ${test1_names}) + +file(REMOVE "${CMAKE_BINARY_DIR}/test2.c") +add_library(test2 SHARED "${CMAKE_BINARY_DIR}/test2.c") +foreach(name ${test2_names}) + file(APPEND "${CMAKE_BINARY_DIR}/test2.c" "__declspec(dllimport) extern void ${name}(void);\n") +endforeach() +file(APPEND "${CMAKE_BINARY_DIR}/test2.c" "__declspec(dllexport) void test2(void)\n{\n") +foreach(name ${test2_names}) + file(APPEND "${CMAKE_BINARY_DIR}/test2.c" " ${name}();\n") +endforeach() +file(APPEND "${CMAKE_BINARY_DIR}/test2.c" "}\n") + +target_link_libraries(test2 PRIVATE ${test2_names}) + +install(TARGETS test1 path DESTINATION lib/test1) +install(TARGETS test2 path DESTINATION lib/test2) + +install(CODE [[ + file(GET_RUNTIME_DEPENDENCIES + LIBRARIES + "${CMAKE_INSTALL_PREFIX}/lib/test1/$" + "${CMAKE_INSTALL_PREFIX}/lib/test2/$" + PRE_INCLUDE_REGEXES "^(lib)?path\\.dll$" + PRE_EXCLUDE_REGEXES ".*" + ) + message(FATAL_ERROR "This message should not be displayed") + ]]) diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-notfile-all-result.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-notfile-all-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-notfile-all-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-notfile-all-stderr.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-notfile-all-stderr.txt new file mode 100644 index 0000000..f921409 --- /dev/null +++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-notfile-all-stderr.txt @@ -0,0 +1,5 @@ +^CMake Error at cmake_install\.cmake:[0-9]+ \(file\): + file Failed to run (dumpbin|objdump) on: + + [^ +]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-notfile-build/root-all/bin/(lib)?test\.dll$ diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-notfile.cmake b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-notfile.cmake new file mode 100644 index 0000000..6665a3b --- /dev/null +++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-notfile.cmake @@ -0,0 +1,28 @@ +enable_language(C) + +file(WRITE "${CMAKE_BINARY_DIR}/test.c" "__declspec(dllexport) void test(void) {}\n") +file(WRITE "${CMAKE_BINARY_DIR}/main.c" [[__declspec(dllimport) extern void test(void); + +int main(void) +{ + test(); + return 0; +} +]]) + +add_library(test SHARED "${CMAKE_BINARY_DIR}/test.c") +add_executable(exe "${CMAKE_BINARY_DIR}/main.c") +target_link_libraries(exe PRIVATE test) + +install(TARGETS exe DESTINATION bin) + +install(CODE [[ + file(MAKE_DIRECTORY "${CMAKE_INSTALL_PREFIX}/bin/$") + file(GET_RUNTIME_DEPENDENCIES + EXECUTABLES + "${CMAKE_INSTALL_PREFIX}/bin/$" + PRE_INCLUDE_REGEXES "^(lib)?test\\.dll$" + PRE_EXCLUDE_REGEXES ".*" + ) + message(FATAL_ERROR "This message should not be displayed") + ]]) diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-unresolved-all-result.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-unresolved-all-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-unresolved-all-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-unresolved-all-stderr.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-unresolved-all-stderr.txt new file mode 100644 index 0000000..a20654c --- /dev/null +++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-unresolved-all-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error at cmake_install\.cmake:[0-9]+ \(file\): + file Could not resolve file (lib)?unresolved\.dll$ diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-unresolved.cmake b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-unresolved.cmake new file mode 100644 index 0000000..4cc74c7 --- /dev/null +++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-unresolved.cmake @@ -0,0 +1,18 @@ +enable_language(C) + +file(WRITE "${CMAKE_BINARY_DIR}/testlib.c" "__declspec(dllimport) extern void unresolved(void);\n__declspec(dllexport) void testlib(void)\n{\n unresolved();\n}\n") +add_library(testlib SHARED "${CMAKE_BINARY_DIR}/testlib.c") +file(WRITE "${CMAKE_BINARY_DIR}/unresolved.c" "__declspec(dllexport) void unresolved(void) {}\n") +add_library(unresolved SHARED "${CMAKE_BINARY_DIR}/unresolved.c") +target_link_libraries(testlib PRIVATE unresolved) +install(TARGETS testlib DESTINATION lib) + +install(CODE [[ + file(GET_RUNTIME_DEPENDENCIES + PRE_INCLUDE_REGEXES "^(lib)?unresolved\\.dll$" + PRE_EXCLUDE_REGEXES ".*" + LIBRARIES + "${CMAKE_INSTALL_PREFIX}/lib/$" + ) + message(FATAL_ERROR "This message should not be displayed") + ]]) diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows.cmake b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows.cmake new file mode 100644 index 0000000..19288d8 --- /dev/null +++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows.cmake @@ -0,0 +1,114 @@ +enable_language(C) + +set(testlib_names + preexcluded + libdir_postexcluded + libdir + search_postexcluded + search + unresolved + conflict + ) + +file(REMOVE "${CMAKE_BINARY_DIR}/testlib.c") +add_library(testlib SHARED "${CMAKE_BINARY_DIR}/testlib.c") +foreach(name ${testlib_names}) + file(WRITE "${CMAKE_BINARY_DIR}/${name}.c" "__declspec(dllexport) void ${name}(void) {}\n") + add_library(${name} SHARED "${CMAKE_BINARY_DIR}/${name}.c") + + file(APPEND "${CMAKE_BINARY_DIR}/testlib.c" "__declspec(dllimport) extern void ${name}(void);\n") +endforeach() +file(APPEND "${CMAKE_BINARY_DIR}/testlib.c" "__declspec(dllexport) void testlib(void)\n{\n") +foreach(name ${testlib_names}) + file(APPEND "${CMAKE_BINARY_DIR}/testlib.c" " ${name}();\n") +endforeach() +file(APPEND "${CMAKE_BINARY_DIR}/testlib.c" "}\n") + +target_link_libraries(testlib PRIVATE ${testlib_names}) + +file(WRITE "${CMAKE_BINARY_DIR}/testlib_conflict.c" "__declspec(dllimport) extern void conflict(void);\n__declspec(dllexport) void testlib_conflict(void)\n{\n conflict();\n}\n") +add_library(testlib_conflict SHARED "${CMAKE_BINARY_DIR}/testlib_conflict.c") +target_link_libraries(testlib_conflict PRIVATE conflict) + +file(WRITE "${CMAKE_BINARY_DIR}/testlib_noconflict.c" "__declspec(dllimport) extern void libdir(void);\n__declspec(dllexport) void testlib_noconflict(void)\n{\n libdir();\n}\n") +add_library(testlib_noconflict SHARED "${CMAKE_BINARY_DIR}/testlib_noconflict.c") +target_link_libraries(testlib_noconflict PRIVATE libdir) + +install(TARGETS testlib libdir_postexcluded libdir conflict testlib_noconflict DESTINATION bin) +install(TARGETS libdir search_postexcluded search DESTINATION bin/.search) # Prefixing with "." ensures it is the first item after list(SORT) +install(TARGETS testlib_conflict conflict DESTINATION bin/.conflict) + +add_executable(topexe file-GET_RUNTIME_DEPENDENCIES-windows/topexe.c) +add_library(toplib SHARED file-GET_RUNTIME_DEPENDENCIES-windows/toplib.c) +add_library(topmod MODULE file-GET_RUNTIME_DEPENDENCIES-windows/toplib.c) +target_link_libraries(topexe PRIVATE testlib) +target_link_libraries(toplib PRIVATE testlib) +target_link_libraries(topmod PRIVATE testlib) + +install(TARGETS topexe toplib topmod DESTINATION bin) + +install(CODE [[ + function(exec_get_runtime_dependencies depsfile udepsfile cdepsfile) + file(GET_RUNTIME_DEPENDENCIES + RESOLVED_DEPENDENCIES_VAR deps + UNRESOLVED_DEPENDENCIES_VAR udeps + CONFLICTING_DEPENDENCIES_PREFIX cdeps + PRE_INCLUDE_REGEXES + "^(lib)?testlib\\.dll$" + "^(lib)?libdir_postexcluded\\.dll$" + "^(lib)?libdir\\.dll$" + "^(lib)?search_postexcluded\\.dll$" + "^(lib)?search\\.dll$" + "^(lib)?unresolved\\.dll$" + "^(lib)?conflict\\.dll$" + "^kernel32\\.dll$" + PRE_EXCLUDE_REGEXES ".*" + POST_INCLUDE_REGEXES + "^.*/(lib)?testlib\\.dll$" + "^.*/(lib)?libdir\\.dll$" + "^.*/(lib)?search\\.dll$" + "^.*/(lib)?conflict\\.dll$" + POST_EXCLUDE_REGEXES ".*" + DIRECTORIES + "${CMAKE_INSTALL_PREFIX}/bin/.search" + ${ARGN} + ) + list(SORT deps) + list(SORT udeps) + list(SORT cdeps_FILENAMES) + file(WRITE "${CMAKE_INSTALL_PREFIX}/deps/${depsfile}" "${deps}") + file(WRITE "${CMAKE_INSTALL_PREFIX}/deps/${udepsfile}" "${udeps}") + file(WRITE "${CMAKE_INSTALL_PREFIX}/deps/${cdepsfile}" "") + foreach(cdep IN LISTS cdeps_FILENAMES) + set(cdep_values ${cdeps_${cdep}}) + list(SORT cdep_values) + file(APPEND "${CMAKE_INSTALL_PREFIX}/deps/${cdepsfile}" "${cdep}:${cdep_values}\n") + endforeach() + endfunction() + + exec_get_runtime_dependencies( + deps1.txt udeps1.txt cdeps1.txt + EXECUTABLES + "${CMAKE_INSTALL_PREFIX}/bin/$" + LIBRARIES + "${CMAKE_INSTALL_PREFIX}/bin/.conflict/$" + "${CMAKE_INSTALL_PREFIX}/bin/.conflict/../$" + ) + + exec_get_runtime_dependencies( + deps2.txt udeps2.txt cdeps2.txt + LIBRARIES + "${CMAKE_INSTALL_PREFIX}/bin/$" + "${CMAKE_INSTALL_PREFIX}/bin/.conflict/$" + "${CMAKE_INSTALL_PREFIX}/bin/.conflict/../$" + ) + + exec_get_runtime_dependencies( + deps3.txt udeps3.txt cdeps3.txt + MODULES + "${CMAKE_INSTALL_PREFIX}/bin/$" + LIBRARIES + "${CMAKE_INSTALL_PREFIX}/bin/.conflict/$" + "${CMAKE_INSTALL_PREFIX}/bin/.conflict/../$" + ) + ]]) diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows/topexe.c b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows/topexe.c new file mode 100644 index 0000000..713b8eb --- /dev/null +++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows/topexe.c @@ -0,0 +1,7 @@ +__declspec(dllimport) extern void testlib(void); + +int main(void) +{ + testlib(); + return 0; +} diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows/toplib.c b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows/toplib.c new file mode 100644 index 0000000..6997175 --- /dev/null +++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows/toplib.c @@ -0,0 +1,6 @@ +__declspec(dllimport) extern void testlib(void); + +__declspec(dllexport) void toplib(void) +{ + testlib(); +} diff --git a/bootstrap b/bootstrap index 38fa32b..5ccb6b3 100755 --- a/bootstrap +++ b/bootstrap @@ -261,6 +261,17 @@ CMAKE_CXX_SOURCES="\ cmAddSubDirectoryCommand \ cmAddTestCommand \ cmArgumentParser \ + cmBinUtilsLinker \ + cmBinUtilsLinuxELFGetRuntimeDependenciesTool \ + cmBinUtilsLinuxELFLinker \ + cmBinUtilsLinuxELFObjdumpGetRuntimeDependenciesTool \ + cmBinUtilsMacOSMachOGetRuntimeDependenciesTool \ + cmBinUtilsMacOSMachOLinker \ + cmBinUtilsMacOSMachOOToolGetRuntimeDependenciesTool \ + cmBinUtilsWindowsPEGetRuntimeDependenciesTool \ + cmBinUtilsWindowsPEDumpbinGetRuntimeDependenciesTool \ + cmBinUtilsWindowsPELinker \ + cmBinUtilsWindowsPEObjdumpGetRuntimeDependenciesTool \ cmBreakCommand \ cmBuildCommand \ cmCMakeMinimumRequired \ @@ -357,6 +368,8 @@ CMAKE_CXX_SOURCES="\ cmInstallTargetGenerator \ cmInstallTargetsCommand \ cmInstalledFile \ + cmLDConfigLDConfigTool \ + cmLDConfigTool \ cmLinkDirectoriesCommand \ cmLinkItem \ cmLinkLineComputer \ @@ -394,6 +407,7 @@ CMAKE_CXX_SOURCES="\ cmPropertyMap \ cmReturnCommand \ cmRulePlaceholderExpander \ + cmRuntimeDependencyArchive \ cmScriptGenerator \ cmSearchPath \ cmSeparateArgumentsCommand \ @@ -443,7 +457,9 @@ CMAKE_CXX_SOURCES="\ if ${cmake_system_mingw}; then CMAKE_CXX_SOURCES="${CMAKE_CXX_SOURCES}\ cmGlobalMSYSMakefileGenerator \ - cmGlobalMinGWMakefileGenerator" + cmGlobalMinGWMakefileGenerator \ + cmVSSetupHelper \ + " fi LexerParser_CXX_SOURCES="\ @@ -1370,7 +1386,7 @@ libs="" uv_c_flags="" if ${cmake_system_mingw}; then uv_c_flags="${uv_c_flags} -DWIN32_LEAN_AND_MEAN -D_WIN32_WINNT=0x0600" - libs="${libs} -lws2_32 -lpsapi -liphlpapi -lshell32 -luserenv" + libs="${libs} -lws2_32 -lpsapi -liphlpapi -lshell32 -luserenv -lole32 -loleaut32" else uv_c_flags="${uv_c_flags} -DCMAKE_BOOTSTRAP" case "${cmake_system}" in ----------------------------------------------------------------------- Summary of changes: Help/command/file.rst | 268 +++++++++++++++ Help/release/dev/get-runtime-dependencies.rst | 9 + Modules/GetPrerequisites.cmake | 4 + Source/CMakeLists.txt | 28 ++ Source/cmBinUtilsLinker.cxx | 15 + Source/cmBinUtilsLinker.h | 30 ++ ...mBinUtilsLinuxELFGetRuntimeDependenciesTool.cxx | 18 + .../cmBinUtilsLinuxELFGetRuntimeDependenciesTool.h | 30 ++ Source/cmBinUtilsLinuxELFLinker.cxx | 177 ++++++++++ Source/cmBinUtilsLinuxELFLinker.h | 44 +++ ...lsLinuxELFObjdumpGetRuntimeDependenciesTool.cxx | 84 +++++ ...tilsLinuxELFObjdumpGetRuntimeDependenciesTool.h | 26 ++ ...inUtilsMacOSMachOGetRuntimeDependenciesTool.cxx | 19 ++ ...mBinUtilsMacOSMachOGetRuntimeDependenciesTool.h | 29 ++ Source/cmBinUtilsMacOSMachOLinker.cxx | 228 +++++++++++++ Source/cmBinUtilsMacOSMachOLinker.h | 59 ++++ ...lsMacOSMachOOToolGetRuntimeDependenciesTool.cxx | 100 ++++++ ...tilsMacOSMachOOToolGetRuntimeDependenciesTool.h | 25 ++ ...sWindowsPEDumpbinGetRuntimeDependenciesTool.cxx | 67 ++++ ...ilsWindowsPEDumpbinGetRuntimeDependenciesTool.h | 25 ++ ...BinUtilsWindowsPEGetRuntimeDependenciesTool.cxx | 18 + ...cmBinUtilsWindowsPEGetRuntimeDependenciesTool.h | 28 ++ Source/cmBinUtilsWindowsPELinker.cxx | 121 +++++++ Source/cmBinUtilsWindowsPELinker.h | 33 ++ ...sWindowsPEObjdumpGetRuntimeDependenciesTool.cxx | 67 ++++ ...ilsWindowsPEObjdumpGetRuntimeDependenciesTool.h | 25 ++ Source/cmFileCommand.cxx | 175 ++++++++++ Source/cmFileCommand.h | 2 + Source/cmLDConfigLDConfigTool.cxx | 70 ++++ Source/cmLDConfigLDConfigTool.h | 22 ++ Source/cmLDConfigTool.cxx | 9 + Source/cmLDConfigTool.h | 24 ++ Source/cmRuntimeDependencyArchive.cxx | 378 +++++++++++++++++++++ Source/cmRuntimeDependencyArchive.h | 70 ++++ Tests/RunCMake/CMakeLists.txt | 2 +- Tests/RunCMake/install/CMakeLists.txt | 3 + Tests/RunCMake/install/RunCMakeTest.cmake | 30 ++ ...e-GET_RUNTIME_DEPENDENCIES-badargs1-result.txt} | 0 ...le-GET_RUNTIME_DEPENDENCIES-badargs1-stderr.txt | 18 + .../file-GET_RUNTIME_DEPENDENCIES-badargs1.cmake | 2 + ...e-GET_RUNTIME_DEPENDENCIES-badargs2-result.txt} | 0 ...le-GET_RUNTIME_DEPENDENCIES-badargs2-stderr.txt | 18 + .../file-GET_RUNTIME_DEPENDENCIES-badargs2.cmake | 2 + ...-GET_RUNTIME_DEPENDENCIES-linux-all-check.cmake | 44 +++ ...e-GET_RUNTIME_DEPENDENCIES-linux-all-stderr.txt | 119 +++++++ ...IME_DEPENDENCIES-linux-conflict-all-result.txt} | 0 ...TIME_DEPENDENCIES-linux-conflict-all-stderr.txt | 7 + ...e-GET_RUNTIME_DEPENDENCIES-linux-conflict.cmake | 54 +++ ...TIME_DEPENDENCIES-linux-notfile-all-result.txt} | 0 ...NTIME_DEPENDENCIES-linux-notfile-all-stderr.txt | 5 + ...le-GET_RUNTIME_DEPENDENCIES-linux-notfile.cmake | 29 ++ ...E_DEPENDENCIES-linux-unresolved-all-result.txt} | 0 ...ME_DEPENDENCIES-linux-unresolved-all-stderr.txt | 2 + ...GET_RUNTIME_DEPENDENCIES-linux-unresolved.cmake | 18 + .../file-GET_RUNTIME_DEPENDENCIES-linux.cmake | 168 +++++++++ .../file-GET_RUNTIME_DEPENDENCIES-linux/topexe.c | 9 + .../file-GET_RUNTIME_DEPENDENCIES-linux/toplib.c | 8 + ...-GET_RUNTIME_DEPENDENCIES-macos-all-check.cmake | 157 +++++++++ ...IME_DEPENDENCIES-macos-conflict-all-result.txt} | 0 ...TIME_DEPENDENCIES-macos-conflict-all-stderr.txt | 7 + ...e-GET_RUNTIME_DEPENDENCIES-macos-conflict.cmake | 55 +++ ...TIME_DEPENDENCIES-macos-notfile-all-result.txt} | 0 ...NTIME_DEPENDENCIES-macos-notfile-all-stderr.txt | 5 + ...le-GET_RUNTIME_DEPENDENCIES-macos-notfile.cmake | 30 ++ ...E_DEPENDENCIES-macos-unresolved-all-result.txt} | 0 ...ME_DEPENDENCIES-macos-unresolved-all-stderr.txt | 2 + ...GET_RUNTIME_DEPENDENCIES-macos-unresolved.cmake | 18 + .../file-GET_RUNTIME_DEPENDENCIES-macos.cmake | 216 ++++++++++++ .../file-GET_RUNTIME_DEPENDENCIES-macos/topexe.c | 7 + .../file-GET_RUNTIME_DEPENDENCIES-macos/toplib.c | 6 + ...ile-GET_RUNTIME_DEPENDENCIES-project-stderr.txt | 13 + .../file-GET_RUNTIME_DEPENDENCIES-project.cmake | 1 + ...ET_RUNTIME_DEPENDENCIES-unsupported-result.txt} | 0 ...GET_RUNTIME_DEPENDENCIES-unsupported-stderr.txt | 5 + ...file-GET_RUNTIME_DEPENDENCIES-unsupported.cmake | 2 + ...ET_RUNTIME_DEPENDENCIES-windows-all-check.cmake | 38 +++ ...E_DEPENDENCIES-windows-conflict-all-result.txt} | 0 ...ME_DEPENDENCIES-windows-conflict-all-stderr.txt | 7 + ...GET_RUNTIME_DEPENDENCIES-windows-conflict.cmake | 47 +++ ...ME_DEPENDENCIES-windows-notfile-all-result.txt} | 0 ...IME_DEPENDENCIES-windows-notfile-all-stderr.txt | 5 + ...-GET_RUNTIME_DEPENDENCIES-windows-notfile.cmake | 28 ++ ...DEPENDENCIES-windows-unresolved-all-result.txt} | 0 ..._DEPENDENCIES-windows-unresolved-all-stderr.txt | 2 + ...T_RUNTIME_DEPENDENCIES-windows-unresolved.cmake | 18 + .../file-GET_RUNTIME_DEPENDENCIES-windows.cmake | 114 +++++++ .../file-GET_RUNTIME_DEPENDENCIES-windows/topexe.c | 7 + .../file-GET_RUNTIME_DEPENDENCIES-windows/toplib.c | 6 + bootstrap | 20 +- 89 files changed, 3678 insertions(+), 3 deletions(-) create mode 100644 Help/release/dev/get-runtime-dependencies.rst create mode 100644 Source/cmBinUtilsLinker.cxx create mode 100644 Source/cmBinUtilsLinker.h create mode 100644 Source/cmBinUtilsLinuxELFGetRuntimeDependenciesTool.cxx create mode 100644 Source/cmBinUtilsLinuxELFGetRuntimeDependenciesTool.h create mode 100644 Source/cmBinUtilsLinuxELFLinker.cxx create mode 100644 Source/cmBinUtilsLinuxELFLinker.h create mode 100644 Source/cmBinUtilsLinuxELFObjdumpGetRuntimeDependenciesTool.cxx create mode 100644 Source/cmBinUtilsLinuxELFObjdumpGetRuntimeDependenciesTool.h create mode 100644 Source/cmBinUtilsMacOSMachOGetRuntimeDependenciesTool.cxx create mode 100644 Source/cmBinUtilsMacOSMachOGetRuntimeDependenciesTool.h create mode 100644 Source/cmBinUtilsMacOSMachOLinker.cxx create mode 100644 Source/cmBinUtilsMacOSMachOLinker.h create mode 100644 Source/cmBinUtilsMacOSMachOOToolGetRuntimeDependenciesTool.cxx create mode 100644 Source/cmBinUtilsMacOSMachOOToolGetRuntimeDependenciesTool.h create mode 100644 Source/cmBinUtilsWindowsPEDumpbinGetRuntimeDependenciesTool.cxx create mode 100644 Source/cmBinUtilsWindowsPEDumpbinGetRuntimeDependenciesTool.h create mode 100644 Source/cmBinUtilsWindowsPEGetRuntimeDependenciesTool.cxx create mode 100644 Source/cmBinUtilsWindowsPEGetRuntimeDependenciesTool.h create mode 100644 Source/cmBinUtilsWindowsPELinker.cxx create mode 100644 Source/cmBinUtilsWindowsPELinker.h create mode 100644 Source/cmBinUtilsWindowsPEObjdumpGetRuntimeDependenciesTool.cxx create mode 100644 Source/cmBinUtilsWindowsPEObjdumpGetRuntimeDependenciesTool.h create mode 100644 Source/cmLDConfigLDConfigTool.cxx create mode 100644 Source/cmLDConfigLDConfigTool.h create mode 100644 Source/cmLDConfigTool.cxx create mode 100644 Source/cmLDConfigTool.h create mode 100644 Source/cmRuntimeDependencyArchive.cxx create mode 100644 Source/cmRuntimeDependencyArchive.h copy Tests/RunCMake/{while/MissingArgument-result.txt => install/file-GET_RUNTIME_DEPENDENCIES-badargs1-result.txt} (100%) create mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs1-stderr.txt create mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs1.cmake copy Tests/RunCMake/{while/MissingArgument-result.txt => install/file-GET_RUNTIME_DEPENDENCIES-badargs2-result.txt} (100%) create mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs2-stderr.txt create mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs2.cmake create mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-all-check.cmake create mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-all-stderr.txt copy Tests/RunCMake/{while/MissingArgument-result.txt => install/file-GET_RUNTIME_DEPENDENCIES-linux-conflict-all-result.txt} (100%) create mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-conflict-all-stderr.txt create mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-conflict.cmake copy Tests/RunCMake/{while/MissingArgument-result.txt => install/file-GET_RUNTIME_DEPENDENCIES-linux-notfile-all-result.txt} (100%) create mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-notfile-all-stderr.txt create mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-notfile.cmake copy Tests/RunCMake/{while/MissingArgument-result.txt => install/file-GET_RUNTIME_DEPENDENCIES-linux-unresolved-all-result.txt} (100%) create mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-unresolved-all-stderr.txt create mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-unresolved.cmake create mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux.cmake create mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux/topexe.c create mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux/toplib.c create mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-all-check.cmake copy Tests/RunCMake/{while/MissingArgument-result.txt => install/file-GET_RUNTIME_DEPENDENCIES-macos-conflict-all-result.txt} (100%) create mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-conflict-all-stderr.txt create mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-conflict.cmake copy Tests/RunCMake/{while/MissingArgument-result.txt => install/file-GET_RUNTIME_DEPENDENCIES-macos-notfile-all-result.txt} (100%) create mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-notfile-all-stderr.txt create mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-notfile.cmake copy Tests/RunCMake/{while/MissingArgument-result.txt => install/file-GET_RUNTIME_DEPENDENCIES-macos-unresolved-all-result.txt} (100%) create mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-unresolved-all-stderr.txt create mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-unresolved.cmake create mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos.cmake create mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos/topexe.c create mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos/toplib.c create mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-project-stderr.txt create mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-project.cmake copy Tests/RunCMake/{while/MissingArgument-result.txt => install/file-GET_RUNTIME_DEPENDENCIES-unsupported-result.txt} (100%) create mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-unsupported-stderr.txt create mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-unsupported.cmake create mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-all-check.cmake copy Tests/RunCMake/{while/MissingArgument-result.txt => install/file-GET_RUNTIME_DEPENDENCIES-windows-conflict-all-result.txt} (100%) create mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-conflict-all-stderr.txt create mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-conflict.cmake copy Tests/RunCMake/{while/MissingArgument-result.txt => install/file-GET_RUNTIME_DEPENDENCIES-windows-notfile-all-result.txt} (100%) create mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-notfile-all-stderr.txt create mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-notfile.cmake copy Tests/RunCMake/{while/MissingArgument-result.txt => install/file-GET_RUNTIME_DEPENDENCIES-windows-unresolved-all-result.txt} (100%) create mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-unresolved-all-stderr.txt create mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-unresolved.cmake create mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows.cmake create mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows/topexe.c create mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows/toplib.c hooks/post-receive -- CMake From kwrobot at kitware.com Wed Jun 12 00:03:05 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Wed, 12 Jun 2019 00:03:05 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc1-42-gb7d72db Message-ID: <20190612040305.398C0103365@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via b7d72db89de6a9ddc8c8740a6e8b8980d108b900 (commit) from 14254e9ea8ea3efc6d67aa2bf6e29e5d4fbafe4b (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b7d72db89de6a9ddc8c8740a6e8b8980d108b900 commit b7d72db89de6a9ddc8c8740a6e8b8980d108b900 Author: Kitware Robot AuthorDate: Wed Jun 12 00:01:08 2019 -0400 Commit: Kitware Robot CommitDate: Wed Jun 12 00:01:08 2019 -0400 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 33aef1e..55e4455 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 15) -set(CMake_VERSION_PATCH 20190611) +set(CMake_VERSION_PATCH 20190612) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From kwrobot at kitware.com Wed Jun 12 11:43:05 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Wed, 12 Jun 2019 11:43:05 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc1-46-g1492dc8 Message-ID: <20190612154305.928BFF9C2D@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 1492dc8301ba5844b830316bcc2677aa1bdae897 (commit) via c932f498426609beb14b9339c2a7dec3ea624998 (commit) via 6696855f72adebbb40d475c39dace1e9f855ca2a (commit) via 6b815e58baa037335fb0008f6d0345fa29931e08 (commit) from b7d72db89de6a9ddc8c8740a6e8b8980d108b900 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1492dc8301ba5844b830316bcc2677aa1bdae897 commit 1492dc8301ba5844b830316bcc2677aa1bdae897 Merge: b7d72db c932f49 Author: Brad King AuthorDate: Wed Jun 12 15:40:33 2019 +0000 Commit: Kitware Robot CommitDate: Wed Jun 12 11:40:47 2019 -0400 Merge topic 'capabilities-fileapi' c932f49842 cmake: Teach -E capabilities to report supported fileapi requests 6696855f72 cmake: Simplify implementation of -E capabilities 6b815e58ba fileapi: Factor out helper to construct a version object Acked-by: Kitware Robot Merge-request: !3433 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c932f498426609beb14b9339c2a7dec3ea624998 commit c932f498426609beb14b9339c2a7dec3ea624998 Author: Brad King AuthorDate: Fri Jun 7 10:22:34 2019 -0400 Commit: Brad King CommitDate: Fri Jun 7 11:08:38 2019 -0400 cmake: Teach -E capabilities to report supported fileapi requests Fixes: #19339 diff --git a/Help/manual/cmake-file-api.7.rst b/Help/manual/cmake-file-api.7.rst index f3e0208..04b6ed2 100644 --- a/Help/manual/cmake-file-api.7.rst +++ b/Help/manual/cmake-file-api.7.rst @@ -379,6 +379,8 @@ finds the file missing, that means a concurrent CMake has generated a new reply. The client may simply start again by reading the new reply index file. +.. _`file-api object kinds`: + Object Kinds ============ diff --git a/Help/manual/cmake.1.rst b/Help/manual/cmake.1.rst index f1d02eb..13cba71 100644 --- a/Help/manual/cmake.1.rst +++ b/Help/manual/cmake.1.rst @@ -423,6 +423,22 @@ Available commands are: A list of strings with all the extra generators compatible with the generator. + ``fileApi`` + Optional member that is present when the :manual:`cmake-file-api(7)` + is available. The value is a JSON object with one member: + + ``requests`` + A JSON array containing zero or more supported file-api requests. + Each request is a JSON object with members: + + ``kind`` + Specifies one of the supported :ref:`file-api object kinds`. + + ``version`` + A JSON array whose elements are each a JSON object containing + ``major`` and ``minor`` members specifying non-negative integer + version components. + ``serverMode`` ``true`` if cmake supports server-mode and ``false`` otherwise. diff --git a/Source/cmFileAPI.cxx b/Source/cmFileAPI.cxx index 9cb484c..ed45398 100644 --- a/Source/cmFileAPI.cxx +++ b/Source/cmFileAPI.cxx @@ -801,3 +801,35 @@ Json::Value cmFileAPI::BuildInternalTest(Object const& object) } return test; } + +Json::Value cmFileAPI::ReportCapabilities() +{ + Json::Value capabilities = Json::objectValue; + Json::Value& requests = capabilities["requests"] = Json::arrayValue; + + { + Json::Value request = Json::objectValue; + request["kind"] = ObjectKindName(ObjectKind::CodeModel); + Json::Value& versions = request["version"] = Json::arrayValue; + versions.append(BuildVersion(2, CodeModelV2Minor)); + requests.append(std::move(request)); + } + + { + Json::Value request = Json::objectValue; + request["kind"] = ObjectKindName(ObjectKind::Cache); + Json::Value& versions = request["version"] = Json::arrayValue; + versions.append(BuildVersion(2, CacheV2Minor)); + requests.append(std::move(request)); + } + + { + Json::Value request = Json::objectValue; + request["kind"] = ObjectKindName(ObjectKind::CMakeFiles); + Json::Value& versions = request["version"] = Json::arrayValue; + versions.append(BuildVersion(1, CMakeFilesV1Minor)); + requests.append(std::move(request)); + } + + return capabilities; +} diff --git a/Source/cmFileAPI.h b/Source/cmFileAPI.h index 1315532..602efa8 100644 --- a/Source/cmFileAPI.h +++ b/Source/cmFileAPI.h @@ -36,6 +36,9 @@ public: and holding the original object. Other JSON types are unchanged. */ Json::Value MaybeJsonFile(Json::Value in, std::string const& prefix); + /** Report file-api capabilities for cmake -E capabilities. */ + static Json::Value ReportCapabilities(); + private: cmake* CMakeInstance; diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 0dca578..3772f09 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -284,6 +284,7 @@ Json::Value cmake::ReportCapabilitiesJson() const generators.append(i.second); } obj["generators"] = generators; + obj["fileApi"] = cmFileAPI::ReportCapabilities(); obj["serverMode"] = true; return obj; diff --git a/Tests/RunCMake/CommandLine/E_capabilities-stdout.txt b/Tests/RunCMake/CommandLine/E_capabilities-stdout.txt index 6c5ea44..b4b170e 100644 --- a/Tests/RunCMake/CommandLine/E_capabilities-stdout.txt +++ b/Tests/RunCMake/CommandLine/E_capabilities-stdout.txt @@ -1 +1 @@ -^{.*}$ +^{"fileApi":{"requests":\[{"kind":"codemodel","version":\[{"major":2,"minor":0}]},{"kind":"cache","version":\[{"major":2,"minor":0}]},{"kind":"cmakeFiles","version":\[{"major":1,"minor":0}]}]},"generators":\[.*\],"serverMode":true,"version":{.*}}$ https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6696855f72adebbb40d475c39dace1e9f855ca2a commit 6696855f72adebbb40d475c39dace1e9f855ca2a Author: Brad King AuthorDate: Fri Jun 7 09:33:11 2019 -0400 Commit: Brad King CommitDate: Fri Jun 7 11:08:38 2019 -0400 cmake: Simplify implementation of -E capabilities The `cmake -E capabilities` command-line tool is implemented only in a full-featured (non-bootstrap) CMake, and server mode is now always available in this case. diff --git a/Source/cmServerProtocol.cxx b/Source/cmServerProtocol.cxx index dad8821..558391f 100644 --- a/Source/cmServerProtocol.cxx +++ b/Source/cmServerProtocol.cxx @@ -630,7 +630,7 @@ cmServerResponse cmServerProtocol1::ProcessGlobalSettings( Json::Value obj = Json::objectValue; // Capabilities information: - obj[kCAPABILITIES_KEY] = cm->ReportCapabilitiesJson(true); + obj[kCAPABILITIES_KEY] = cm->ReportCapabilitiesJson(); obj[kDEBUG_OUTPUT_KEY] = cm->GetDebugOutput(); obj[kTRACE_KEY] = cm->GetTrace(); diff --git a/Source/cmake.cxx b/Source/cmake.cxx index f0b53f4..0dca578 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -248,7 +248,7 @@ Json::Value cmake::ReportVersionJson() const return version; } -Json::Value cmake::ReportCapabilitiesJson(bool haveServerMode) const +Json::Value cmake::ReportCapabilitiesJson() const { Json::Value obj = Json::objectValue; @@ -284,18 +284,18 @@ Json::Value cmake::ReportCapabilitiesJson(bool haveServerMode) const generators.append(i.second); } obj["generators"] = generators; - obj["serverMode"] = haveServerMode; + obj["serverMode"] = true; return obj; } #endif -std::string cmake::ReportCapabilities(bool haveServerMode) const +std::string cmake::ReportCapabilities() const { std::string result; #if defined(CMAKE_BUILD_WITH_CMAKE) Json::FastWriter writer; - result = writer.write(this->ReportCapabilitiesJson(haveServerMode)); + result = writer.write(this->ReportCapabilitiesJson()); #else result = "Not supported"; #endif diff --git a/Source/cmake.h b/Source/cmake.h index 4de9d28..fa4409a 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -136,9 +136,9 @@ public: #if defined(CMAKE_BUILD_WITH_CMAKE) Json::Value ReportVersionJson() const; - Json::Value ReportCapabilitiesJson(bool haveServerMode) const; + Json::Value ReportCapabilitiesJson() const; #endif - std::string ReportCapabilities(bool haveServerMode) const; + std::string ReportCapabilities() const; //@{ /** diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx index a983d30..86082e5 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -734,11 +734,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector const& args) return 1; } cmake cm(cmake::RoleInternal, cmState::Unknown); -#if defined(CMAKE_BUILD_WITH_CMAKE) - std::cout << cm.ReportCapabilities(true); -#else - std::cout << cm.ReportCapabilities(false); -#endif + std::cout << cm.ReportCapabilities(); return 0; } https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6b815e58baa037335fb0008f6d0345fa29931e08 commit 6b815e58baa037335fb0008f6d0345fa29931e08 Author: Brad King AuthorDate: Fri Jun 7 11:01:43 2019 -0400 Commit: Brad King CommitDate: Fri Jun 7 11:08:38 2019 -0400 fileapi: Factor out helper to construct a version object diff --git a/Source/cmFileAPI.cxx b/Source/cmFileAPI.cxx index 34b6b33..9cb484c 100644 --- a/Source/cmFileAPI.cxx +++ b/Source/cmFileAPI.cxx @@ -413,6 +413,14 @@ std::string cmFileAPI::ObjectName(Object const& o) return name; } +Json::Value cmFileAPI::BuildVersion(unsigned int major, unsigned int minor) +{ + Json::Value version; + version["major"] = major; + version["minor"] = minor; + return version; +} + Json::Value cmFileAPI::BuildObject(Object const& object) { Json::Value value; @@ -680,10 +688,9 @@ Json::Value cmFileAPI::BuildCodeModel(Object const& object) Json::Value codemodel = cmFileAPICodemodelDump(*this, object.Version); codemodel["kind"] = this->ObjectKindName(object.Kind); - Json::Value& version = codemodel["version"] = Json::objectValue; + Json::Value& version = codemodel["version"]; if (object.Version == 2) { - version["major"] = 2; - version["minor"] = CodeModelV2Minor; + version = BuildVersion(2, CodeModelV2Minor); } else { return codemodel; // should be unreachable } @@ -716,10 +723,9 @@ Json::Value cmFileAPI::BuildCache(Object const& object) Json::Value cache = cmFileAPICacheDump(*this, object.Version); cache["kind"] = this->ObjectKindName(object.Kind); - Json::Value& version = cache["version"] = Json::objectValue; + Json::Value& version = cache["version"]; if (object.Version == 2) { - version["major"] = 2; - version["minor"] = CacheV2Minor; + version = BuildVersion(2, CacheV2Minor); } else { return cache; // should be unreachable } @@ -752,10 +758,9 @@ Json::Value cmFileAPI::BuildCMakeFiles(Object const& object) Json::Value cmakeFiles = cmFileAPICMakeFilesDump(*this, object.Version); cmakeFiles["kind"] = this->ObjectKindName(object.Kind); - Json::Value& version = cmakeFiles["version"] = Json::objectValue; + Json::Value& version = cmakeFiles["version"]; if (object.Version == 1) { - version["major"] = 1; - version["minor"] = CMakeFilesV1Minor; + version = BuildVersion(1, CMakeFilesV1Minor); } else { return cmakeFiles; // should be unreachable } @@ -788,13 +793,11 @@ Json::Value cmFileAPI::BuildInternalTest(Object const& object) { Json::Value test = Json::objectValue; test["kind"] = this->ObjectKindName(object.Kind); - Json::Value& version = test["version"] = Json::objectValue; + Json::Value& version = test["version"]; if (object.Version == 2) { - version["major"] = 2; - version["minor"] = InternalTestV2Minor; + version = BuildVersion(2, InternalTestV2Minor); } else { - version["major"] = 1; - version["minor"] = InternalTestV1Minor; + version = BuildVersion(1, InternalTestV1Minor); } return test; } diff --git a/Source/cmFileAPI.h b/Source/cmFileAPI.h index 341b072..1315532 100644 --- a/Source/cmFileAPI.h +++ b/Source/cmFileAPI.h @@ -162,6 +162,8 @@ private: static const char* ObjectKindName(ObjectKind kind); static std::string ObjectName(Object const& o); + static Json::Value BuildVersion(unsigned int major, unsigned int minor); + Json::Value BuildObject(Object const& object); ClientRequests BuildClientRequests(Json::Value const& requests); ----------------------------------------------------------------------- Summary of changes: Help/manual/cmake-file-api.7.rst | 2 + Help/manual/cmake.1.rst | 16 ++++++ Source/cmFileAPI.cxx | 63 +++++++++++++++++----- Source/cmFileAPI.h | 5 ++ Source/cmServerProtocol.cxx | 2 +- Source/cmake.cxx | 9 ++-- Source/cmake.h | 4 +- Source/cmcmd.cxx | 6 +-- .../RunCMake/CommandLine/E_capabilities-stdout.txt | 2 +- 9 files changed, 82 insertions(+), 27 deletions(-) hooks/post-receive -- CMake From kwrobot at kitware.com Wed Jun 12 11:53:03 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Wed, 12 Jun 2019 11:53:03 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc1-52-g00132e6 Message-ID: <20190612155303.5C549FA828@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 00132e60a6b85d12a6614d773e8d0d86810ede76 (commit) via 069e42f7c34e1a721fcc6101ba2f6827e07e855a (commit) via 445c7bc219aeeb2c8684ba920bec0bd05db915d2 (commit) via f26c3d5c6056f6920f6082b97e06d55c34ddfbcf (commit) via 49b1a2852dc0a3a8b1e98bfc408134a06dba0d67 (commit) via fa00a3b29bdc962429af13c64f11b51fee8c58bb (commit) from 1492dc8301ba5844b830316bcc2677aa1bdae897 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=00132e60a6b85d12a6614d773e8d0d86810ede76 commit 00132e60a6b85d12a6614d773e8d0d86810ede76 Merge: 445c7bc 069e42f Author: Brad King AuthorDate: Wed Jun 12 11:51:26 2019 -0400 Commit: Brad King CommitDate: Wed Jun 12 11:51:26 2019 -0400 Merge branch 'release-3.15' https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=445c7bc219aeeb2c8684ba920bec0bd05db915d2 commit 445c7bc219aeeb2c8684ba920bec0bd05db915d2 Merge: 49b1a28 f26c3d5 Author: Brad King AuthorDate: Wed Jun 12 15:50:08 2019 +0000 Commit: Kitware Robot CommitDate: Wed Jun 12 11:50:16 2019 -0400 Merge topic 'CheckCXXSymbolExists-xref' f26c3d5c60 CheckCXXSymbolExists: reference to CheckCXXSourceCompiles instead of C version Acked-by: Kitware Robot Merge-request: !3437 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=49b1a2852dc0a3a8b1e98bfc408134a06dba0d67 commit 49b1a2852dc0a3a8b1e98bfc408134a06dba0d67 Merge: 1492dc8 fa00a3b Author: Brad King AuthorDate: Wed Jun 12 11:43:20 2019 -0400 Commit: Brad King CommitDate: Wed Jun 12 11:43:20 2019 -0400 Merge branch 'release-3.15' ----------------------------------------------------------------------- Summary of changes: Modules/CheckCXXSymbolExists.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From kwrobot at kitware.com Wed Jun 12 11:53:03 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Wed, 12 Jun 2019 11:53:03 -0400 (EDT) Subject: [Cmake-commits] CMake branch, release, updated. v3.15.0-rc1-17-g069e42f Message-ID: <20190612155303.73F41FA828@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, release has been updated via 069e42f7c34e1a721fcc6101ba2f6827e07e855a (commit) via f26c3d5c6056f6920f6082b97e06d55c34ddfbcf (commit) via fa00a3b29bdc962429af13c64f11b51fee8c58bb (commit) via c932f498426609beb14b9339c2a7dec3ea624998 (commit) via 6696855f72adebbb40d475c39dace1e9f855ca2a (commit) via 6b815e58baa037335fb0008f6d0345fa29931e08 (commit) from 8d3c919a3cbef7d92f24409fa7a5737e835957ee (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- ----------------------------------------------------------------------- Summary of changes: Help/manual/cmake-file-api.7.rst | 2 + Help/manual/cmake.1.rst | 16 ++++++ Modules/CheckCXXSymbolExists.cmake | 2 +- Source/cmFileAPI.cxx | 63 +++++++++++++++++----- Source/cmFileAPI.h | 5 ++ Source/cmServerProtocol.cxx | 2 +- Source/cmake.cxx | 9 ++-- Source/cmake.h | 4 +- Source/cmcmd.cxx | 6 +-- .../RunCMake/CommandLine/E_capabilities-stdout.txt | 2 +- 10 files changed, 83 insertions(+), 28 deletions(-) hooks/post-receive -- CMake From kwrobot at kitware.com Wed Jun 12 12:53:08 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Wed, 12 Jun 2019 12:53:08 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc1-63-gf07200f Message-ID: <20190612165308.C3519F9A16@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via f07200fe163640f708c62de3cbdc0fb49a7e0471 (commit) via c1580ecc13cf2dea3f047d1018e705bd34cecc53 (commit) via 1af08229a7b871ea592cdf6d2aa41e47787eb713 (commit) via 00d265e3c812516e2a71faed4f352b36f51112e2 (commit) via 1b945f95bafc9a795b092904f7c6bd84dad940e8 (commit) via e0a8ff31480df672e42e2382e8ed7f33ea65afb4 (commit) via 8d934d861be8c2a8b43d4c421715fb1e8c0c54fd (commit) via 026f65d284deaea9f2dba41ed956fabf84e17b6d (commit) via 9e64e617eb295c7e2725d871225659ae7bcf7c48 (commit) via e791ffac61912f6540742aabaf4cb78a4d475a16 (commit) via a982916304fc7a66edb7a587144cb192f13ef6be (commit) from 00132e60a6b85d12a6614d773e8d0d86810ede76 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f07200fe163640f708c62de3cbdc0fb49a7e0471 commit f07200fe163640f708c62de3cbdc0fb49a7e0471 Merge: c1580ec e791ffa Author: Brad King AuthorDate: Wed Jun 12 16:48:04 2019 +0000 Commit: Kitware Robot CommitDate: Wed Jun 12 12:48:13 2019 -0400 Merge topic 'add-test-command-expand-lists' e791ffac61 add_test: Add COMMAND_EXPAND_LISTS option Acked-by: Kitware Robot Merge-request: !3422 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c1580ecc13cf2dea3f047d1018e705bd34cecc53 commit c1580ecc13cf2dea3f047d1018e705bd34cecc53 Merge: 1af0822 00d265e Author: Brad King AuthorDate: Wed Jun 12 16:45:55 2019 +0000 Commit: Kitware Robot CommitDate: Wed Jun 12 12:46:18 2019 -0400 Merge topic 'cmPropertyMap_unordered_map' 00d265e3c8 cmPropertyMap: Use std::unordered_map as container instead of std::map 1b945f95ba cmPropertyMap: Add RemoveProperty method e0a8ff3148 cmPropertyMap: Use std::string as value container class 8d934d861b cmPropertyMap: Make std::map container private 026f65d284 cmPropertyMap: Add GetList method 9e64e617eb cmPropertyMap: Rename GetPropertyList method to GetKeys Acked-by: Kitware Robot Merge-request: !3435 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1af08229a7b871ea592cdf6d2aa41e47787eb713 commit 1af08229a7b871ea592cdf6d2aa41e47787eb713 Merge: 00132e6 a982916 Author: Brad King AuthorDate: Wed Jun 12 16:44:56 2019 +0000 Commit: Kitware Robot CommitDate: Wed Jun 12 12:45:15 2019 -0400 Merge topic 'language-dependent-linker-flags' a982916304 Support per-language library link flags Acked-by: Kitware Robot Merge-request: !3429 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=00d265e3c812516e2a71faed4f352b36f51112e2 commit 00d265e3c812516e2a71faed4f352b36f51112e2 Author: Sebastian Holtermann AuthorDate: Mon Jun 3 10:29:12 2019 +0200 Commit: Sebastian Holtermann CommitDate: Sat Jun 8 12:25:35 2019 +0200 cmPropertyMap: Use std::unordered_map as container instead of std::map diff --git a/Source/cmPropertyMap.cxx b/Source/cmPropertyMap.cxx index 64bceb5..3ed4c05 100644 --- a/Source/cmPropertyMap.cxx +++ b/Source/cmPropertyMap.cxx @@ -2,6 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmPropertyMap.h" +#include #include void cmPropertyMap::Clear() @@ -59,15 +60,21 @@ std::vector cmPropertyMap::GetKeys() const for (auto const& item : Map_) { keyList.push_back(item.first); } + std::sort(keyList.begin(), keyList.end()); return keyList; } std::vector> cmPropertyMap::GetList() const { - std::vector> kvList; + typedef std::pair StringPair; + std::vector kvList; kvList.reserve(Map_.size()); for (auto const& item : Map_) { kvList.emplace_back(item.first, item.second); } + std::sort(kvList.begin(), kvList.end(), + [](StringPair const& a, StringPair const& b) { + return a.first < b.first; + }); return kvList; } diff --git a/Source/cmPropertyMap.h b/Source/cmPropertyMap.h index 6284e8c..9aed349 100644 --- a/Source/cmPropertyMap.h +++ b/Source/cmPropertyMap.h @@ -5,11 +5,14 @@ #include "cmConfigure.h" // IWYU pragma: keep -#include #include +#include #include #include +/** \class cmPropertyMap + * \brief String property map. + */ class cmPropertyMap { public: @@ -34,6 +37,7 @@ public: void RemoveProperty(const std::string& name); // -- Lists + //! Get a sorted list of property keys std::vector GetKeys() const; @@ -41,7 +45,7 @@ public: std::vector> GetList() const; private: - std::map Map_; + std::unordered_map Map_; }; #endif https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1b945f95bafc9a795b092904f7c6bd84dad940e8 commit 1b945f95bafc9a795b092904f7c6bd84dad940e8 Author: Sebastian Holtermann AuthorDate: Mon Jun 3 09:19:58 2019 +0200 Commit: Sebastian Holtermann CommitDate: Sat Jun 8 12:25:35 2019 +0200 cmPropertyMap: Add RemoveProperty method The new `cmPropertyMap::RemoveProperty` allows to remove a property from the map. diff --git a/Source/cmPropertyMap.cxx b/Source/cmPropertyMap.cxx index 0874977..64bceb5 100644 --- a/Source/cmPropertyMap.cxx +++ b/Source/cmPropertyMap.cxx @@ -36,6 +36,11 @@ void cmPropertyMap::AppendProperty(const std::string& name, const char* value, } } +void cmPropertyMap::RemoveProperty(const std::string& name) +{ + Map_.erase(name); +} + const char* cmPropertyMap::GetPropertyValue(const std::string& name) const { { diff --git a/Source/cmPropertyMap.h b/Source/cmPropertyMap.h index 165eb92..6284e8c 100644 --- a/Source/cmPropertyMap.h +++ b/Source/cmPropertyMap.h @@ -14,17 +14,25 @@ class cmPropertyMap { public: // -- General + //! Clear property list void Clear(); // -- Properties + + //! Set the property value void SetProperty(const std::string& name, const char* value); + //! Append to the property value void AppendProperty(const std::string& name, const char* value, bool asString = false); + //! Get the property value const char* GetPropertyValue(const std::string& name) const; + //! Remove the property @a name from the map + void RemoveProperty(const std::string& name); + // -- Lists //! Get a sorted list of property keys std::vector GetKeys() const; https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e0a8ff31480df672e42e2382e8ed7f33ea65afb4 commit e0a8ff31480df672e42e2382e8ed7f33ea65afb4 Author: Sebastian Holtermann AuthorDate: Mon Jun 3 09:26:59 2019 +0200 Commit: Sebastian Holtermann CommitDate: Sat Jun 8 12:25:35 2019 +0200 cmPropertyMap: Use std::string as value container class diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 695e075..67bc598 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -338,7 +338,6 @@ set(SRCS cmProcessOutput.h cmProcessTools.cxx cmProcessTools.h - cmProperty.cxx cmProperty.h cmPropertyDefinition.cxx cmPropertyDefinition.h diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx index 6621797..c366183 100644 --- a/Source/cmExportFileGenerator.cxx +++ b/Source/cmExportFileGenerator.cxx @@ -12,7 +12,6 @@ #include "cmMessageType.h" #include "cmOutputConverter.h" #include "cmPolicies.h" -#include "cmProperty.h" #include "cmPropertyMap.h" #include "cmStateTypes.h" #include "cmSystemTools.h" diff --git a/Source/cmJsonObjects.cxx b/Source/cmJsonObjects.cxx index 657d681..8d065e1 100644 --- a/Source/cmJsonObjects.cxx +++ b/Source/cmJsonObjects.cxx @@ -14,7 +14,6 @@ #include "cmLinkLineComputer.h" #include "cmLocalGenerator.h" #include "cmMakefile.h" -#include "cmProperty.h" #include "cmPropertyMap.h" #include "cmSourceFile.h" #include "cmState.h" diff --git a/Source/cmProperty.cxx b/Source/cmProperty.cxx deleted file mode 100644 index 27f0ecd..0000000 --- a/Source/cmProperty.cxx +++ /dev/null @@ -1,26 +0,0 @@ -/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying - file Copyright.txt or https://cmake.org/licensing for details. */ -#include "cmProperty.h" - -void cmProperty::Set(const char* value) -{ - this->Value = value; - this->ValueHasBeenSet = true; -} - -void cmProperty::Append(const char* value, bool asString) -{ - if (!this->Value.empty() && *value && !asString) { - this->Value += ";"; - } - this->Value += value; - this->ValueHasBeenSet = true; -} - -const char* cmProperty::GetValue() const -{ - if (this->ValueHasBeenSet) { - return this->Value.c_str(); - } - return nullptr; -} diff --git a/Source/cmProperty.h b/Source/cmProperty.h index d11c5ef..80f131a 100644 --- a/Source/cmProperty.h +++ b/Source/cmProperty.h @@ -5,8 +5,6 @@ #include "cmConfigure.h" // IWYU pragma: keep -#include - class cmProperty { public: @@ -22,22 +20,6 @@ public: CACHED_VARIABLE, INSTALL }; - - // set this property - void Set(const char* value); - - // append to this property - void Append(const char* value, bool asString = false); - - // get the value - const char* GetValue() const; - - // construct with the value not set - cmProperty() { this->ValueHasBeenSet = false; } - -protected: - std::string Value; - bool ValueHasBeenSet; }; #endif diff --git a/Source/cmPropertyMap.cxx b/Source/cmPropertyMap.cxx index 7177a63..0874977 100644 --- a/Source/cmPropertyMap.cxx +++ b/Source/cmPropertyMap.cxx @@ -16,7 +16,7 @@ void cmPropertyMap::SetProperty(const std::string& name, const char* value) return; } - Map_[name].Set(value); + Map_[name] = value; } void cmPropertyMap::AppendProperty(const std::string& name, const char* value, @@ -27,7 +27,13 @@ void cmPropertyMap::AppendProperty(const std::string& name, const char* value, return; } - Map_[name].Append(value, asString); + { + std::string& pVal = Map_[name]; + if (!pVal.empty() && !asString) { + pVal += ';'; + } + pVal += value; + } } const char* cmPropertyMap::GetPropertyValue(const std::string& name) const @@ -35,7 +41,7 @@ const char* cmPropertyMap::GetPropertyValue(const std::string& name) const { auto it = Map_.find(name); if (it != Map_.end()) { - return it->second.GetValue(); + return it->second.c_str(); } } return nullptr; @@ -56,7 +62,7 @@ std::vector> cmPropertyMap::GetList() const std::vector> kvList; kvList.reserve(Map_.size()); for (auto const& item : Map_) { - kvList.emplace_back(item.first, item.second.GetValue()); + kvList.emplace_back(item.first, item.second); } return kvList; } diff --git a/Source/cmPropertyMap.h b/Source/cmPropertyMap.h index 4fcbf58..165eb92 100644 --- a/Source/cmPropertyMap.h +++ b/Source/cmPropertyMap.h @@ -5,8 +5,6 @@ #include "cmConfigure.h" // IWYU pragma: keep -#include "cmProperty.h" - #include #include #include @@ -35,7 +33,7 @@ public: std::vector> GetList() const; private: - std::map Map_; + std::map Map_; }; #endif diff --git a/Source/cmTestGenerator.cxx b/Source/cmTestGenerator.cxx index 3840e50..174fb8a 100644 --- a/Source/cmTestGenerator.cxx +++ b/Source/cmTestGenerator.cxx @@ -10,7 +10,6 @@ #include "cmListFileCache.h" #include "cmLocalGenerator.h" #include "cmOutputConverter.h" -#include "cmProperty.h" #include "cmPropertyMap.h" #include "cmRange.h" #include "cmStateTypes.h" diff --git a/bootstrap b/bootstrap index 38fa32b..569a6a4 100755 --- a/bootstrap +++ b/bootstrap @@ -388,7 +388,6 @@ CMAKE_CXX_SOURCES="\ cmPolicies \ cmProcessOutput \ cmProjectCommand \ - cmProperty \ cmPropertyDefinition \ cmPropertyDefinitionMap \ cmPropertyMap \ https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8d934d861be8c2a8b43d4c421715fb1e8c0c54fd commit 8d934d861be8c2a8b43d4c421715fb1e8c0c54fd Author: Sebastian Holtermann AuthorDate: Sun Jun 2 13:34:31 2019 +0200 Commit: Sebastian Holtermann CommitDate: Sat Jun 8 12:25:35 2019 +0200 cmPropertyMap: Make std::map container private diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx index a12e0c4..6621797 100644 --- a/Source/cmExportFileGenerator.cxx +++ b/Source/cmExportFileGenerator.cxx @@ -1205,12 +1205,9 @@ bool cmExportFileGenerator::PopulateExportProperties( std::string& errorMessage) { auto& targetProperties = gte->Target->GetProperties(); - const auto& exportProperties = targetProperties.find("EXPORT_PROPERTIES"); - if (exportProperties != targetProperties.end()) { - std::vector propsToExport; - cmSystemTools::ExpandListArgument(exportProperties->second.GetValue(), - propsToExport); - for (auto& prop : propsToExport) { + if (const char* exportProperties = + targetProperties.GetPropertyValue("EXPORT_PROPERTIES")) { + for (auto& prop : cmSystemTools::ExpandedListArgument(exportProperties)) { /* Black list reserved properties */ if (cmSystemTools::StringStartsWith(prop, "IMPORTED_") || cmSystemTools::StringStartsWith(prop, "INTERFACE_")) { diff --git a/Source/cmPropertyMap.cxx b/Source/cmPropertyMap.cxx index 09b30ba..7177a63 100644 --- a/Source/cmPropertyMap.cxx +++ b/Source/cmPropertyMap.cxx @@ -2,30 +2,21 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmPropertyMap.h" -#include #include -cmProperty* cmPropertyMap::GetOrCreateProperty(const std::string& name) +void cmPropertyMap::Clear() { - cmPropertyMap::iterator it = this->find(name); - cmProperty* prop; - if (it == this->end()) { - prop = &(*this)[name]; - } else { - prop = &(it->second); - } - return prop; + Map_.clear(); } void cmPropertyMap::SetProperty(const std::string& name, const char* value) { if (!value) { - this->erase(name); + Map_.erase(name); return; } - cmProperty* prop = this->GetOrCreateProperty(name); - prop->Set(value); + Map_[name].Set(value); } void cmPropertyMap::AppendProperty(const std::string& name, const char* value, @@ -36,26 +27,25 @@ void cmPropertyMap::AppendProperty(const std::string& name, const char* value, return; } - cmProperty* prop = this->GetOrCreateProperty(name); - prop->Append(value, asString); + Map_[name].Append(value, asString); } const char* cmPropertyMap::GetPropertyValue(const std::string& name) const { - assert(!name.empty()); - - cmPropertyMap::const_iterator it = this->find(name); - if (it == this->end()) { - return nullptr; + { + auto it = Map_.find(name); + if (it != Map_.end()) { + return it->second.GetValue(); + } } - return it->second.GetValue(); + return nullptr; } std::vector cmPropertyMap::GetKeys() const { std::vector keyList; - keyList.reserve(this->size()); - for (auto const& item : *this) { + keyList.reserve(Map_.size()); + for (auto const& item : Map_) { keyList.push_back(item.first); } return keyList; @@ -64,8 +54,8 @@ std::vector cmPropertyMap::GetKeys() const std::vector> cmPropertyMap::GetList() const { std::vector> kvList; - kvList.reserve(this->size()); - for (auto const& item : *this) { + kvList.reserve(Map_.size()); + for (auto const& item : Map_) { kvList.emplace_back(item.first, item.second.GetValue()); } return kvList; diff --git a/Source/cmPropertyMap.h b/Source/cmPropertyMap.h index e2348a3..4fcbf58 100644 --- a/Source/cmPropertyMap.h +++ b/Source/cmPropertyMap.h @@ -12,12 +12,14 @@ #include #include -class cmPropertyMap : public std::map +class cmPropertyMap { public: - // -- Properties - cmProperty* GetOrCreateProperty(const std::string& name); + // -- General + //! Clear property list + void Clear(); + // -- Properties void SetProperty(const std::string& name, const char* value); void AppendProperty(const std::string& name, const char* value, @@ -31,6 +33,9 @@ public: //! Get a sorted by key list of property key,value pairs std::vector> GetList() const; + +private: + std::map Map_; }; #endif diff --git a/Source/cmState.cxx b/Source/cmState.cxx index fa7df0b..091c2e0 100644 --- a/Source/cmState.cxx +++ b/Source/cmState.cxx @@ -267,7 +267,7 @@ void cmState::RemoveCacheEntryProperty(std::string const& key, cmStateSnapshot cmState::Reset() { - this->GlobalProperties.clear(); + this->GlobalProperties.Clear(); this->PropertyDefinitions.clear(); this->GlobVerificationManager->Reset(); @@ -289,7 +289,7 @@ cmStateSnapshot cmState::Reset() it->LinkDirectoriesBacktraces.clear(); it->DirectoryEnd = pos; it->NormalTargetNames.clear(); - it->Properties.clear(); + it->Properties.Clear(); it->Children.clear(); } diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 9368414..634c990 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -774,11 +774,11 @@ void cmVisualStudio10TargetGenerator::WriteDotNetReferences(Elem& e0) cmSystemTools::ExpandListArgument(vsDotNetReferences, references); } cmPropertyMap const& props = this->GeneratorTarget->Target->GetProperties(); - for (auto const& i : props) { + for (auto const& i : props.GetList()) { if (i.first.find("VS_DOTNET_REFERENCE_") == 0) { std::string name = i.first.substr(20); if (!name.empty()) { - std::string path = i.second.GetValue(); + std::string path = i.second; if (!cmsys::SystemTools::FileIsFullPath(path)) { path = this->Makefile->GetCurrentSourceDirectory() + "/" + path; } @@ -870,10 +870,10 @@ void cmVisualStudio10TargetGenerator::WriteDotNetReferenceCustomTags( typedef std::map CustomTags; CustomTags tags; cmPropertyMap const& props = this->GeneratorTarget->Target->GetProperties(); - for (const auto& i : props) { + for (const auto& i : props.GetList()) { if (i.first.find(refPropFullPrefix) == 0) { std::string refTag = i.first.substr(refPropFullPrefix.length()); - std::string refVal = i.second.GetValue(); + std::string refVal = i.second; if (!refTag.empty() && !refVal.empty()) { tags[refTag] = refVal; } @@ -967,12 +967,12 @@ void cmVisualStudio10TargetGenerator::WriteEmbeddedResourceGroup(Elem& e0) } } const cmPropertyMap& props = oi->GetProperties(); - for (const auto& p : props) { + for (const std::string& p : props.GetKeys()) { static const std::string propNamePrefix = "VS_CSHARP_"; - if (p.first.find(propNamePrefix) == 0) { - std::string tagName = p.first.substr(propNamePrefix.length()); + if (p.find(propNamePrefix) == 0) { + std::string tagName = p.substr(propNamePrefix.length()); if (!tagName.empty()) { - std::string value = props.GetPropertyValue(p.first); + std::string value = props.GetPropertyValue(p); if (!value.empty()) { e2.Element(tagName.c_str(), value); } @@ -4681,12 +4681,12 @@ void cmVisualStudio10TargetGenerator::GetCSharpSourceProperties( { if (this->ProjectType == csproj) { const cmPropertyMap& props = sf->GetProperties(); - for (auto const& p : props) { + for (const std::string& p : props.GetKeys()) { static const std::string propNamePrefix = "VS_CSHARP_"; - if (p.first.find(propNamePrefix) == 0) { - std::string tagName = p.first.substr(propNamePrefix.length()); + if (p.find(propNamePrefix) == 0) { + std::string tagName = p.substr(propNamePrefix.length()); if (!tagName.empty()) { - const std::string val = props.GetPropertyValue(p.first); + const std::string val = props.GetPropertyValue(p); if (!val.empty()) { tags[tagName] = val; } else { https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=026f65d284deaea9f2dba41ed956fabf84e17b6d commit 026f65d284deaea9f2dba41ed956fabf84e17b6d Author: Sebastian Holtermann AuthorDate: Sun Jun 2 12:43:16 2019 +0200 Commit: Sebastian Holtermann CommitDate: Sat Jun 8 12:25:35 2019 +0200 cmPropertyMap: Add GetList method diff --git a/Source/cmJsonObjects.cxx b/Source/cmJsonObjects.cxx index 636a8e1..657d681 100644 --- a/Source/cmJsonObjects.cxx +++ b/Source/cmJsonObjects.cxx @@ -363,12 +363,12 @@ static Json::Value DumpCTestInfo(cmLocalGenerator* lg, cmTest* testInfo, // Build up the list of properties that may have been specified Json::Value properties = Json::arrayValue; - for (auto& prop : testInfo->GetProperties()) { + for (auto& prop : testInfo->GetProperties().GetList()) { Json::Value entry = Json::objectValue; entry[kKEY_KEY] = prop.first; // Remove config variables from the value too. - auto cge_value = ge.Parse(prop.second.GetValue()); + auto cge_value = ge.Parse(prop.second); const std::string& processed_value = cge_value->Evaluate(lg, config); entry[kVALUE_KEY] = processed_value; properties.append(entry); diff --git a/Source/cmPropertyMap.cxx b/Source/cmPropertyMap.cxx index a97e1f0..09b30ba 100644 --- a/Source/cmPropertyMap.cxx +++ b/Source/cmPropertyMap.cxx @@ -60,3 +60,13 @@ std::vector cmPropertyMap::GetKeys() const } return keyList; } + +std::vector> cmPropertyMap::GetList() const +{ + std::vector> kvList; + kvList.reserve(this->size()); + for (auto const& item : *this) { + kvList.emplace_back(item.first, item.second.GetValue()); + } + return kvList; +} diff --git a/Source/cmPropertyMap.h b/Source/cmPropertyMap.h index 5c93627..e2348a3 100644 --- a/Source/cmPropertyMap.h +++ b/Source/cmPropertyMap.h @@ -9,6 +9,7 @@ #include #include +#include #include class cmPropertyMap : public std::map @@ -27,6 +28,9 @@ public: // -- Lists //! Get a sorted list of property keys std::vector GetKeys() const; + + //! Get a sorted by key list of property key,value pairs + std::vector> GetList() const; }; #endif diff --git a/Source/cmTestGenerator.cxx b/Source/cmTestGenerator.cxx index 571cd09..3840e50 100644 --- a/Source/cmTestGenerator.cxx +++ b/Source/cmTestGenerator.cxx @@ -117,13 +117,12 @@ void cmTestGenerator::GenerateScriptForConfig(std::ostream& os, os << ")\n"; // Output properties for the test. - cmPropertyMap& pm = this->Test->GetProperties(); os << indent << "set_tests_properties(" << this->Test->GetName() << " PROPERTIES "; - for (auto const& i : pm) { + for (auto const& i : this->Test->GetProperties().GetList()) { os << " " << i.first << " " << cmOutputConverter::EscapeForCMake( - ge.Parse(i.second.GetValue())->Evaluate(this->LG, config)); + ge.Parse(i.second)->Evaluate(this->LG, config)); } this->GenerateInternalProperties(os); os << ")" << std::endl; @@ -173,12 +172,11 @@ void cmTestGenerator::GenerateOldStyle(std::ostream& fout, Indent indent) fout << ")" << std::endl; // Output properties for the test. - cmPropertyMap& pm = this->Test->GetProperties(); fout << indent << "set_tests_properties(" << this->Test->GetName() << " PROPERTIES "; - for (auto const& i : pm) { + for (auto const& i : this->Test->GetProperties().GetList()) { fout << " " << i.first << " " - << cmOutputConverter::EscapeForCMake(i.second.GetValue()); + << cmOutputConverter::EscapeForCMake(i.second); } this->GenerateInternalProperties(fout); fout << ")" << std::endl; https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9e64e617eb295c7e2725d871225659ae7bcf7c48 commit 9e64e617eb295c7e2725d871225659ae7bcf7c48 Author: Sebastian Holtermann AuthorDate: Sun Jun 2 12:35:33 2019 +0200 Commit: Sebastian Holtermann CommitDate: Sat Jun 8 12:25:35 2019 +0200 cmPropertyMap: Rename GetPropertyList method to GetKeys diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx index 358f095..e8fc350 100644 --- a/Source/cmCacheManager.cxx +++ b/Source/cmCacheManager.cxx @@ -620,7 +620,7 @@ bool cmCacheManager::CacheIterator::GetValueAsBool() const std::vector cmCacheManager::CacheEntry::GetPropertyList() const { - return this->Properties.GetPropertyList(); + return this->Properties.GetKeys(); } const char* cmCacheManager::CacheEntry::GetProperty( diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 036a07d..de0f371 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -5032,13 +5032,7 @@ void cmGeneratorTarget::ComputeVersionedName(std::string& vName, std::vector cmGeneratorTarget::GetPropertyKeys() const { - cmPropertyMap const& propsObject = this->Target->GetProperties(); - std::vector props; - props.reserve(propsObject.size()); - for (auto const& it : propsObject) { - props.push_back(it.first); - } - return props; + return this->Target->GetProperties().GetKeys(); } void cmGeneratorTarget::ReportPropertyOrigin( diff --git a/Source/cmPropertyMap.cxx b/Source/cmPropertyMap.cxx index 3f6d7c8..a97e1f0 100644 --- a/Source/cmPropertyMap.cxx +++ b/Source/cmPropertyMap.cxx @@ -2,7 +2,6 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmPropertyMap.h" -#include #include #include @@ -18,16 +17,6 @@ cmProperty* cmPropertyMap::GetOrCreateProperty(const std::string& name) return prop; } -std::vector cmPropertyMap::GetPropertyList() const -{ - std::vector keyList; - for (auto const& i : *this) { - keyList.push_back(i.first); - } - std::sort(keyList.begin(), keyList.end()); - return keyList; -} - void cmPropertyMap::SetProperty(const std::string& name, const char* value) { if (!value) { @@ -61,3 +50,13 @@ const char* cmPropertyMap::GetPropertyValue(const std::string& name) const } return it->second.GetValue(); } + +std::vector cmPropertyMap::GetKeys() const +{ + std::vector keyList; + keyList.reserve(this->size()); + for (auto const& item : *this) { + keyList.push_back(item.first); + } + return keyList; +} diff --git a/Source/cmPropertyMap.h b/Source/cmPropertyMap.h index 5a05150..5c93627 100644 --- a/Source/cmPropertyMap.h +++ b/Source/cmPropertyMap.h @@ -14,16 +14,19 @@ class cmPropertyMap : public std::map { public: + // -- Properties cmProperty* GetOrCreateProperty(const std::string& name); - std::vector GetPropertyList() const; - void SetProperty(const std::string& name, const char* value); void AppendProperty(const std::string& name, const char* value, bool asString = false); const char* GetPropertyValue(const std::string& name) const; + + // -- Lists + //! Get a sorted list of property keys + std::vector GetKeys() const; }; #endif diff --git a/Source/cmStateDirectory.cxx b/Source/cmStateDirectory.cxx index 182d3fe..6ca1c9f 100644 --- a/Source/cmStateDirectory.cxx +++ b/Source/cmStateDirectory.cxx @@ -6,7 +6,6 @@ #include #include #include -#include #include "cmAlgorithms.h" #include "cmProperty.h" @@ -667,12 +666,7 @@ bool cmStateDirectory::GetPropertyAsBool(const std::string& prop) const std::vector cmStateDirectory::GetPropertyKeys() const { - std::vector keys; - keys.reserve(this->DirectoryState->Properties.size()); - for (auto const& it : this->DirectoryState->Properties) { - keys.push_back(it.first); - } - return keys; + return this->DirectoryState->Properties.GetKeys(); } void cmStateDirectory::AddNormalTargetName(std::string const& name) https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e791ffac61912f6540742aabaf4cb78a4d475a16 commit e791ffac61912f6540742aabaf4cb78a4d475a16 Author: Sergey Bobrenok AuthorDate: Wed May 15 22:10:39 2019 +0700 Commit: Brad King CommitDate: Fri Jun 7 13:14:29 2019 -0400 add_test: Add COMMAND_EXPAND_LISTS option Add a `COMMAND_EXPAND_LISTS` option to the `add_test` command to cause `;`-separated lists produced by generator expressions to be expanded into multiple arguments. The `add_custom_command` command already has such an option. Fixes: #17284 diff --git a/Help/command/add_test.rst b/Help/command/add_test.rst index 46b9b63..884b2ee 100644 --- a/Help/command/add_test.rst +++ b/Help/command/add_test.rst @@ -7,7 +7,8 @@ Add a test to the project to be run by :manual:`ctest(1)`. add_test(NAME COMMAND [...] [CONFIGURATIONS ...] - [WORKING_DIRECTORY ]) + [WORKING_DIRECTORY ] + [COMMAND_EXPAND_LISTS]) Adds a test called ````. The test name may not contain spaces, quotes, or other characters special in CMake syntax. The options are: @@ -28,6 +29,11 @@ quotes, or other characters special in CMake syntax. The options are: directory set to the build directory corresponding to the current source directory. +``COMMAND_EXPAND_LISTS`` + Lists in ``COMMAND`` arguments will be expanded, including those + created with + :manual:`generator expressions `. + The given test command is expected to exit with code ``0`` to pass and non-zero to fail, or vice-versa if the :prop_test:`WILL_FAIL` test property is set. Any output written to stdout or stderr will be diff --git a/Help/release/dev/add_test-expand_lists.rst b/Help/release/dev/add_test-expand_lists.rst new file mode 100644 index 0000000..88d26b7 --- /dev/null +++ b/Help/release/dev/add_test-expand_lists.rst @@ -0,0 +1,6 @@ +add_test-expand_lists +--------------------- + +* The command :command:`add_test` learned the option ``COMMAND_EXPAND_LISTS`` + which causes lists in the ``COMMAND`` argument to be expanded, including + lists created by generator expressions. diff --git a/Source/cmAddTestCommand.cxx b/Source/cmAddTestCommand.cxx index bf28702..b0c462b 100644 --- a/Source/cmAddTestCommand.cxx +++ b/Source/cmAddTestCommand.cxx @@ -58,6 +58,7 @@ bool cmAddTestCommand::HandleNameMode(std::vector const& args) std::vector configurations; std::string working_directory; std::vector command; + bool command_expand_lists = false; // Read the arguments. enum Doing @@ -88,6 +89,13 @@ bool cmAddTestCommand::HandleNameMode(std::vector const& args) return false; } doing = DoingWorkingDirectory; + } else if (args[i] == "COMMAND_EXPAND_LISTS") { + if (command_expand_lists) { + this->SetError(" may be given at most one COMMAND_EXPAND_LISTS."); + return false; + } + command_expand_lists = true; + doing = DoingNone; } else if (doing == DoingName) { name = args[i]; doing = DoingNone; @@ -134,6 +142,7 @@ bool cmAddTestCommand::HandleNameMode(std::vector const& args) if (!working_directory.empty()) { test->SetProperty("WORKING_DIRECTORY", working_directory.c_str()); } + test->SetCommandExpandLists(command_expand_lists); this->Makefile->AddTestGenerator(new cmTestGenerator(test, configurations)); return true; diff --git a/Source/cmTest.cxx b/Source/cmTest.cxx index 7d45cf5..01f2b96 100644 --- a/Source/cmTest.cxx +++ b/Source/cmTest.cxx @@ -8,7 +8,8 @@ #include "cmSystemTools.h" cmTest::cmTest(cmMakefile* mf) - : Backtrace(mf->GetBacktrace()) + : CommandExpandLists(false) + , Backtrace(mf->GetBacktrace()) { this->Makefile = mf; this->OldStyle = true; @@ -59,3 +60,13 @@ void cmTest::AppendProperty(const std::string& prop, const char* value, { this->Properties.AppendProperty(prop, value, asString); } + +bool cmTest::GetCommandExpandLists() const +{ + return this->CommandExpandLists; +} + +void cmTest::SetCommandExpandLists(bool b) +{ + this->CommandExpandLists = b; +} diff --git a/Source/cmTest.h b/Source/cmTest.h index 88dc730..02d8f46 100644 --- a/Source/cmTest.h +++ b/Source/cmTest.h @@ -51,10 +51,15 @@ public: bool GetOldStyle() const { return this->OldStyle; } void SetOldStyle(bool b) { this->OldStyle = b; } + /** Set/Get whether lists in command lines should be expanded. */ + bool GetCommandExpandLists() const; + void SetCommandExpandLists(bool b); + private: cmPropertyMap Properties; std::string Name; std::vector Command; + bool CommandExpandLists; bool OldStyle; diff --git a/Source/cmTestGenerator.cxx b/Source/cmTestGenerator.cxx index 571cd09..ce960dc 100644 --- a/Source/cmTestGenerator.cxx +++ b/Source/cmTestGenerator.cxx @@ -76,12 +76,22 @@ void cmTestGenerator::GenerateScriptForConfig(std::ostream& os, // Start the test command. os << indent << "add_test(" << this->Test->GetName() << " "; - // Get the test command line to be executed. - std::vector const& command = this->Test->GetCommand(); + // Evaluate command line arguments + std::vector argv = + EvaluateCommandLineArguments(this->Test->GetCommand(), ge, config); + + // Expand arguments if COMMAND_EXPAND_LISTS is set + if (this->Test->GetCommandExpandLists()) { + argv = cmSystemTools::ExpandedLists(argv.begin(), argv.end()); + // Expanding lists on an empty command may have left it empty + if (argv.empty()) { + argv.emplace_back(); + } + } // Check whether the command executable is a target whose name is to // be translated. - std::string exe = command[0]; + std::string exe = argv[0]; cmGeneratorTarget* target = this->LG->FindGeneratorTargetToUse(exe); if (target && target->GetType() == cmStateEnums::EXECUTABLE) { // Use the target file on disk. @@ -101,16 +111,14 @@ void cmTestGenerator::GenerateScriptForConfig(std::ostream& os, } } else { // Use the command name given. - exe = ge.Parse(exe)->Evaluate(this->LG, config); cmSystemTools::ConvertToUnixSlashes(exe); } // Generate the command line with full escapes. os << cmOutputConverter::EscapeForCMake(exe); - for (std::string const& arg : cmMakeRange(command).advance(1)) { - os << " " - << cmOutputConverter::EscapeForCMake( - ge.Parse(arg)->Evaluate(this->LG, config)); + + for (auto const& arg : cmMakeRange(argv).advance(1)) { + os << " " << cmOutputConverter::EscapeForCMake(arg); } // Finish the test command. @@ -208,3 +216,16 @@ void cmTestGenerator::GenerateInternalProperties(std::ostream& os) os << "\""; } + +std::vector cmTestGenerator::EvaluateCommandLineArguments( + const std::vector& argv, cmGeneratorExpression& ge, + const std::string& config) const +{ + // Evaluate executable name and arguments + auto evaluatedRange = + cmMakeRange(argv).transform([&](const std::string& arg) { + return ge.Parse(arg)->Evaluate(this->LG, config); + }); + + return { evaluatedRange.begin(), evaluatedRange.end() }; +} diff --git a/Source/cmTestGenerator.h b/Source/cmTestGenerator.h index 8b9cf78..7ac68eb 100644 --- a/Source/cmTestGenerator.h +++ b/Source/cmTestGenerator.h @@ -11,6 +11,7 @@ #include #include +class cmGeneratorExpression; class cmLocalGenerator; class cmTest; @@ -38,6 +39,9 @@ public: private: void GenerateInternalProperties(std::ostream& os); + std::vector EvaluateCommandLineArguments( + const std::vector& argv, cmGeneratorExpression& ge, + const std::string& config) const; protected: void GenerateScriptConfigs(std::ostream& os, Indent indent) override; diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 69f8162..9a9d543 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -565,3 +565,5 @@ if(${CMAKE_GENERATOR} MATCHES "Visual Studio ([^9]|9[0-9])") add_RunCMake_test(CSharpCustomCommand) add_RunCMake_test(CSharpReferenceImport) endif() + +add_RunCMake_test("CTestCommandExpandLists") diff --git a/Tests/RunCMake/CTestCommandExpandLists/CMakeLists.txt b/Tests/RunCMake/CTestCommandExpandLists/CMakeLists.txt new file mode 100644 index 0000000..3e470a2 --- /dev/null +++ b/Tests/RunCMake/CTestCommandExpandLists/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 3.14) +project(${RunCMake_TEST} NONE) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/CTestCommandExpandLists/CMakeLists.txt.in b/Tests/RunCMake/CTestCommandExpandLists/CMakeLists.txt.in new file mode 100644 index 0000000..7d56c90 --- /dev/null +++ b/Tests/RunCMake/CTestCommandExpandLists/CMakeLists.txt.in @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 3.14) +project(@CASE_NAME@ NONE) +include("@RunCMake_SOURCE_DIR@/@CASE_NAME at .cmake") diff --git a/Tests/RunCMake/CTestCommandExpandLists/RunCMakeTest.cmake b/Tests/RunCMake/CTestCommandExpandLists/RunCMakeTest.cmake new file mode 100644 index 0000000..7c3779e --- /dev/null +++ b/Tests/RunCMake/CTestCommandExpandLists/RunCMakeTest.cmake @@ -0,0 +1,5 @@ +include(RunCTest) + +run_ctest(expandGeneratorExpressionResult) +run_ctest(expandEmptyCommand) +run_cmake(multipleExpandOptions) diff --git a/Tests/RunCMake/CTestCommandExpandLists/compare_options.cmake b/Tests/RunCMake/CTestCommandExpandLists/compare_options.cmake new file mode 100644 index 0000000..a32e579 --- /dev/null +++ b/Tests/RunCMake/CTestCommandExpandLists/compare_options.cmake @@ -0,0 +1,14 @@ +set(range 1 2 3 4 5 6 7 8 9 10) +set(aargs "") +set(bargs "") +foreach(n IN LISTS range) + set(aval "${A${n}ARG}") + set(bval "${B${n}ARG}") + if(aval OR bval) + list(APPEND aargs "\"${aval}\"") + list(APPEND bargs "\"${bval}\"") + endif() +endforeach() +if(NOT "${aargs}" STREQUAL "${bargs}") + message(FATAL_ERROR "COMPARE_OPTIONS: \n\t${aargs} != \n\t${bargs}") +endif() diff --git a/Tests/RunCMake/CTestCommandExpandLists/expandEmptyCommand-result.txt b/Tests/RunCMake/CTestCommandExpandLists/expandEmptyCommand-result.txt new file mode 100644 index 0000000..b57e2de --- /dev/null +++ b/Tests/RunCMake/CTestCommandExpandLists/expandEmptyCommand-result.txt @@ -0,0 +1 @@ +(-1|255) diff --git a/Tests/RunCMake/CTestCommandExpandLists/expandEmptyCommand-stderr.txt b/Tests/RunCMake/CTestCommandExpandLists/expandEmptyCommand-stderr.txt new file mode 100644 index 0000000..c656b4c --- /dev/null +++ b/Tests/RunCMake/CTestCommandExpandLists/expandEmptyCommand-stderr.txt @@ -0,0 +1 @@ +Unable to find executable: diff --git a/Tests/RunCMake/CTestCommandExpandLists/expandEmptyCommand-stdout.txt b/Tests/RunCMake/CTestCommandExpandLists/expandEmptyCommand-stdout.txt new file mode 100644 index 0000000..0752580 --- /dev/null +++ b/Tests/RunCMake/CTestCommandExpandLists/expandEmptyCommand-stdout.txt @@ -0,0 +1,13 @@ +Test project .*/Tests/RunCMake/CTestCommandExpandLists/expandEmptyCommand-build +.* +Start 1: CommandExpandEmptyList +Could not find executable + +Looked in the following places: +.* +1/1 Test #1: CommandExpandEmptyList +\.+\*\*\*Not Run +[0-9.]+ sec ++ +0% tests passed, 1 tests failed out of 1 ++ +Total Test time \(real\) = +[0-9.]+ sec ++ +The following tests FAILED: +.* +1 - CommandExpandEmptyList \(Not Run\)$ diff --git a/Tests/RunCMake/CTestCommandExpandLists/expandEmptyCommand.cmake b/Tests/RunCMake/CTestCommandExpandLists/expandEmptyCommand.cmake new file mode 100644 index 0000000..b75828e --- /dev/null +++ b/Tests/RunCMake/CTestCommandExpandLists/expandEmptyCommand.cmake @@ -0,0 +1,10 @@ +include(CTest) + +set(argv /bin/true) +list(POP_BACK argv) + +add_test( + NAME CommandExpandEmptyList + COMMAND "$" + COMMAND_EXPAND_LISTS +) diff --git a/Tests/RunCMake/CTestCommandExpandLists/expandGeneratorExpressionResult-result.txt b/Tests/RunCMake/CTestCommandExpandLists/expandGeneratorExpressionResult-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/CTestCommandExpandLists/expandGeneratorExpressionResult-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/CTestCommandExpandLists/expandGeneratorExpressionResult-stdout.txt b/Tests/RunCMake/CTestCommandExpandLists/expandGeneratorExpressionResult-stdout.txt new file mode 100644 index 0000000..2f21592 --- /dev/null +++ b/Tests/RunCMake/CTestCommandExpandLists/expandGeneratorExpressionResult-stdout.txt @@ -0,0 +1,7 @@ +Test project .*/Tests/RunCMake/CTestCommandExpandLists/expandGeneratorExpressionResult-build +.* +Start 1: CommandExpandList +1/1 Test #1: CommandExpandList +\.+ +Passed +[0-9.]+ sec ++ +100% tests passed, 0 tests failed out of 1 ++ +Total Test time \(real\) = +[0-9.]+ sec diff --git a/Tests/RunCMake/CTestCommandExpandLists/expandGeneratorExpressionResult.cmake b/Tests/RunCMake/CTestCommandExpandLists/expandGeneratorExpressionResult.cmake new file mode 100644 index 0000000..20608ae --- /dev/null +++ b/Tests/RunCMake/CTestCommandExpandLists/expandGeneratorExpressionResult.cmake @@ -0,0 +1,19 @@ +include(CTest) + + +set(cmp_args "1ARG=COMMAND_EXPAND_LISTS" "2ARG=test" "3ARG=outfile" + "4ARG=content") +set(AARGS "") +foreach(arg IN LISTS cmp_args) + list(APPEND AARGS "-DA${arg}") +endforeach() + + + +add_test( + NAME CommandExpandList + COMMAND ${CMAKE_COMMAND} ${AARGS} -V + "-DB$" + "-P" "${CMAKE_CURRENT_LIST_DIR}/compare_options.cmake" + COMMAND_EXPAND_LISTS +) diff --git a/Tests/RunCMake/CTestCommandExpandLists/multipleExpandOptions-result.txt b/Tests/RunCMake/CTestCommandExpandLists/multipleExpandOptions-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CTestCommandExpandLists/multipleExpandOptions-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CTestCommandExpandLists/multipleExpandOptions-stderr.txt b/Tests/RunCMake/CTestCommandExpandLists/multipleExpandOptions-stderr.txt new file mode 100644 index 0000000..e48513f --- /dev/null +++ b/Tests/RunCMake/CTestCommandExpandLists/multipleExpandOptions-stderr.txt @@ -0,0 +1,2 @@ +CMake Error at multipleExpandOptions\.cmake:3 \(add_test\): + +add_test may be given at most one COMMAND_EXPAND_LISTS\. diff --git a/Tests/RunCMake/CTestCommandExpandLists/multipleExpandOptions-stdout.txt b/Tests/RunCMake/CTestCommandExpandLists/multipleExpandOptions-stdout.txt new file mode 100644 index 0000000..55bb894 --- /dev/null +++ b/Tests/RunCMake/CTestCommandExpandLists/multipleExpandOptions-stdout.txt @@ -0,0 +1,2 @@ +-- Configuring incomplete, errors occurred! +See also ".*/Tests/RunCMake/CTestCommandExpandLists/multipleExpandOptions-build/CMakeFiles/CMakeOutput\.log". diff --git a/Tests/RunCMake/CTestCommandExpandLists/multipleExpandOptions.cmake b/Tests/RunCMake/CTestCommandExpandLists/multipleExpandOptions.cmake new file mode 100644 index 0000000..dcf2dc4 --- /dev/null +++ b/Tests/RunCMake/CTestCommandExpandLists/multipleExpandOptions.cmake @@ -0,0 +1,8 @@ +include(CTest) + +add_test( + NAME MultipleExpandOptions + COMMAND /bin/true + COMMAND_EXPAND_LISTS + COMMAND_EXPAND_LISTS +) diff --git a/Tests/RunCMake/CTestCommandExpandLists/test.cmake.in b/Tests/RunCMake/CTestCommandExpandLists/test.cmake.in new file mode 100644 index 0000000..d9a8ccb --- /dev/null +++ b/Tests/RunCMake/CTestCommandExpandLists/test.cmake.in @@ -0,0 +1,15 @@ +cmake_minimum_required(VERSION 3.14) + +set(CTEST_SITE "test-site") +set(CTEST_BUILD_NAME "test-build-name") +set(CTEST_SOURCE_DIRECTORY "@RunCMake_BINARY_DIR@/@CASE_NAME@") +set(CTEST_BINARY_DIRECTORY "@RunCMake_BINARY_DIR@/@CASE_NAME at -build") +set(CTEST_CMAKE_GENERATOR "@RunCMake_GENERATOR@") +set(CTEST_CMAKE_GENERATOR_PLATFORM "@RunCMake_GENERATOR_PLATFORM@") +set(CTEST_CMAKE_GENERATOR_TOOLSET "@RunCMake_GENERATOR_TOOLSET@") +set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") + +ctest_start(Experimental) +ctest_configure() +ctest_build() +ctest_test() https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a982916304fc7a66edb7a587144cb192f13ef6be commit a982916304fc7a66edb7a587144cb192f13ef6be Author: Saleem Abdulrasool AuthorDate: Wed Jun 5 22:01:16 2019 -0700 Commit: Saleem Abdulrasool CommitDate: Thu Jun 6 15:28:43 2019 -0700 Support per-language library link flags This changes the behaviour of the generators to use a per-language library search path flag. This is needed for multi-language projects with different compilers (e.g. cl + gfortran). Since the adjusted variable has been part of the user settings, we control this based on a policy. Fixes: #19307 diff --git a/Modules/CMakeSwiftInformation.cmake b/Modules/CMakeSwiftInformation.cmake index 21f18d4..6f99c1f 100644 --- a/Modules/CMakeSwiftInformation.cmake +++ b/Modules/CMakeSwiftInformation.cmake @@ -23,6 +23,8 @@ set(CMAKE_Swift_COMPILE_OPTIONS_TARGET "-target ") set(CMAKE_Swift_COMPILER_ARG1 -frontend) set(CMAKE_Swift_DEFINE_FLAG -D) set(CMAKE_Swift_FRAMEWORK_SEARCH_FLAG "-F ") +set(CMAKE_Swift_LIBRARY_PATH_FLAG "-L ") +set(CMAKE_Swift_LIBRARY_PATH_TERMINATOR "") set(CMAKE_Swift_LINKER_WRAPPER_FLAG "-Xlinker" " ") set(CMAKE_Swift_RESPONSE_FILE_LINK_FLAG @) diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index fe5c8af..3abf2dd 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -1444,10 +1444,23 @@ void cmLocalGenerator::OutputLinkLibraries( std::string linkLanguage = cli.GetLinkLanguage(); - const std::string& libPathFlag = - this->Makefile->GetRequiredDefinition("CMAKE_LIBRARY_PATH_FLAG"); - const std::string& libPathTerminator = - this->Makefile->GetSafeDefinition("CMAKE_LIBRARY_PATH_TERMINATOR"); + std::string libPathFlag; + if (const char* value = this->Makefile->GetDefinition( + "CMAKE_" + cli.GetLinkLanguage() + "_LIBRARY_PATH_FLAG")) { + libPathFlag = value; + } else { + libPathFlag = + this->Makefile->GetRequiredDefinition("CMAKE_LIBRARY_PATH_FLAG"); + } + + std::string libPathTerminator; + if (const char* value = this->Makefile->GetDefinition( + "CMAKE_" + cli.GetLinkLanguage() + "_LIBRARY_PATH_TERMINATOR")) { + libPathTerminator = value; + } else { + libPathTerminator = + this->Makefile->GetRequiredDefinition("CMAKE_LIBRARY_PATH_TERMINATOR"); + } // Add standard libraries for this language. std::string standardLibsVar = "CMAKE_"; ----------------------------------------------------------------------- Summary of changes: Help/command/add_test.rst | 8 ++- Help/release/dev/add_test-expand_lists.rst | 6 ++ Modules/CMakeSwiftInformation.cmake | 2 + Source/CMakeLists.txt | 1 - Source/cmAddTestCommand.cxx | 9 +++ Source/cmCacheManager.cxx | 2 +- Source/cmExportFileGenerator.cxx | 10 +-- Source/cmGeneratorTarget.cxx | 8 +-- Source/cmJsonObjects.cxx | 5 +- Source/cmLocalGenerator.cxx | 21 ++++-- Source/cmProperty.cxx | 26 -------- Source/cmProperty.h | 18 ----- Source/cmPropertyMap.cxx | 77 +++++++++++++--------- Source/cmPropertyMap.h | 34 ++++++++-- Source/cmState.cxx | 4 +- Source/cmStateDirectory.cxx | 8 +-- Source/cmTest.cxx | 13 +++- Source/cmTest.h | 5 ++ Source/cmTestGenerator.cxx | 48 +++++++++----- Source/cmTestGenerator.h | 4 ++ Source/cmVisualStudio10TargetGenerator.cxx | 24 +++---- Tests/RunCMake/CMakeLists.txt | 2 + .../CMakeLists.txt | 0 .../CTestCommandExpandLists/CMakeLists.txt.in | 3 + .../CTestCommandExpandLists/RunCMakeTest.cmake | 5 ++ .../CTestCommandExpandLists}/compare_options.cmake | 0 .../expandEmptyCommand-result.txt} | 0 .../expandEmptyCommand-stderr.txt | 1 + .../expandEmptyCommand-stdout.txt | 13 ++++ .../expandEmptyCommand.cmake | 10 +++ .../expandGeneratorExpressionResult-result.txt} | 0 .../expandGeneratorExpressionResult-stdout.txt | 7 ++ .../expandGeneratorExpressionResult.cmake | 19 ++++++ .../multipleExpandOptions-result.txt} | 0 .../multipleExpandOptions-stderr.txt | 2 + .../multipleExpandOptions-stdout.txt | 2 + .../multipleExpandOptions.cmake | 8 +++ .../RunCMake/CTestCommandExpandLists/test.cmake.in | 15 +++++ bootstrap | 1 - 39 files changed, 279 insertions(+), 142 deletions(-) create mode 100644 Help/release/dev/add_test-expand_lists.rst delete mode 100644 Source/cmProperty.cxx copy Tests/RunCMake/{MetaCompileFeatures => CTestCommandExpandLists}/CMakeLists.txt (100%) create mode 100644 Tests/RunCMake/CTestCommandExpandLists/CMakeLists.txt.in create mode 100644 Tests/RunCMake/CTestCommandExpandLists/RunCMakeTest.cmake copy Tests/{CustomCommand => RunCMake/CTestCommandExpandLists}/compare_options.cmake (100%) copy Tests/RunCMake/{ctest_submit/RepeatRETURN_VALUE-result.txt => CTestCommandExpandLists/expandEmptyCommand-result.txt} (100%) create mode 100644 Tests/RunCMake/CTestCommandExpandLists/expandEmptyCommand-stderr.txt create mode 100644 Tests/RunCMake/CTestCommandExpandLists/expandEmptyCommand-stdout.txt create mode 100644 Tests/RunCMake/CTestCommandExpandLists/expandEmptyCommand.cmake copy Tests/RunCMake/{target_link_options/LINK_OPTIONS-static-result.txt => CTestCommandExpandLists/expandGeneratorExpressionResult-result.txt} (100%) create mode 100644 Tests/RunCMake/CTestCommandExpandLists/expandGeneratorExpressionResult-stdout.txt create mode 100644 Tests/RunCMake/CTestCommandExpandLists/expandGeneratorExpressionResult.cmake copy Tests/RunCMake/{while/MissingArgument-result.txt => CTestCommandExpandLists/multipleExpandOptions-result.txt} (100%) create mode 100644 Tests/RunCMake/CTestCommandExpandLists/multipleExpandOptions-stderr.txt create mode 100644 Tests/RunCMake/CTestCommandExpandLists/multipleExpandOptions-stdout.txt create mode 100644 Tests/RunCMake/CTestCommandExpandLists/multipleExpandOptions.cmake create mode 100644 Tests/RunCMake/CTestCommandExpandLists/test.cmake.in hooks/post-receive -- CMake From kwrobot at kitware.com Thu Jun 13 00:03:05 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Thu, 13 Jun 2019 00:03:05 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc1-64-gd24121d Message-ID: <20190613040305.EB7B01135D1@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via d24121d62518d4ce8672737d83ef448e8b2a0ae6 (commit) from f07200fe163640f708c62de3cbdc0fb49a7e0471 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d24121d62518d4ce8672737d83ef448e8b2a0ae6 commit d24121d62518d4ce8672737d83ef448e8b2a0ae6 Author: Kitware Robot AuthorDate: Thu Jun 13 00:01:08 2019 -0400 Commit: Kitware Robot CommitDate: Thu Jun 13 00:01:08 2019 -0400 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 55e4455..63cb1c6 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 15) -set(CMake_VERSION_PATCH 20190612) +set(CMake_VERSION_PATCH 20190613) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From kwrobot at kitware.com Thu Jun 13 07:03:07 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Thu, 13 Jun 2019 07:03:07 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc1-66-g82629cb Message-ID: <20190613110307.2F6E711D986@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 82629cb377ff30a53fee49b9d6f8efd86a969c69 (commit) via c1d6b135edb08431252c5deabc68a1361a2ee2e3 (commit) from d24121d62518d4ce8672737d83ef448e8b2a0ae6 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=82629cb377ff30a53fee49b9d6f8efd86a969c69 commit 82629cb377ff30a53fee49b9d6f8efd86a969c69 Merge: d24121d c1d6b13 Author: Craig Scott AuthorDate: Thu Jun 13 10:54:39 2019 +0000 Commit: Kitware Robot CommitDate: Thu Jun 13 06:55:18 2019 -0400 Merge topic 'cmake-gui-qt-notice' c1d6b135ed cmake-gui: Update Qt copyright holder in About dialog Acked-by: Kitware Robot Merge-request: !3441 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c1d6b135edb08431252c5deabc68a1361a2ee2e3 commit c1d6b135edb08431252c5deabc68a1361a2ee2e3 Author: Brad King AuthorDate: Wed Jun 12 12:39:25 2019 -0400 Commit: Brad King CommitDate: Wed Jun 12 12:39:25 2019 -0400 cmake-gui: Update Qt copyright holder in About dialog Qt is now copyright "The Qt Company Ltd.". diff --git a/Source/QtDialog/CMakeSetupDialog.cxx b/Source/QtDialog/CMakeSetupDialog.cxx index 5f6ccca..e98cdcf 100644 --- a/Source/QtDialog/CMakeSetupDialog.cxx +++ b/Source/QtDialog/CMakeSetupDialog.cxx @@ -862,7 +862,7 @@ void CMakeSetupDialog::doAbout() "built using Qt %2 (qt-project.org).\n" #ifdef USE_LGPL "\n" - "The Qt Toolkit is Copyright (C) Digia Plc and/or its subsidiary(-ies).\n" + "The Qt Toolkit is Copyright (C) The Qt Company Ltd.\n" "Qt is licensed under terms of the GNU LGPLv" USE_LGPL ", available at:\n" " \"%3\"" #endif ----------------------------------------------------------------------- Summary of changes: Source/QtDialog/CMakeSetupDialog.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From kwrobot at kitware.com Thu Jun 13 07:13:04 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Thu, 13 Jun 2019 07:13:04 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc1-68-gacc7da6 Message-ID: <20190613111304.D0539125364@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via acc7da6351f9809b3fa91432e2de6e6b5043639f (commit) via 95b9d6af80d08e795cde9f94454d2431263dd084 (commit) from 82629cb377ff30a53fee49b9d6f8efd86a969c69 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=acc7da6351f9809b3fa91432e2de6e6b5043639f commit acc7da6351f9809b3fa91432e2de6e6b5043639f Merge: 82629cb 95b9d6a Author: Craig Scott AuthorDate: Thu Jun 13 06:59:17 2019 -0400 Commit: Craig Scott CommitDate: Thu Jun 13 06:59:17 2019 -0400 Merge branch 'release-3.15' ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From kwrobot at kitware.com Thu Jun 13 07:13:04 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Thu, 13 Jun 2019 07:13:04 -0400 (EDT) Subject: [Cmake-commits] CMake branch, release, updated. v3.15.0-rc1-19-g95b9d6a Message-ID: <20190613111304.DA9A911F61A@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, release has been updated via 95b9d6af80d08e795cde9f94454d2431263dd084 (commit) via c1d6b135edb08431252c5deabc68a1361a2ee2e3 (commit) from 069e42f7c34e1a721fcc6101ba2f6827e07e855a (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- ----------------------------------------------------------------------- Summary of changes: Source/QtDialog/CMakeSetupDialog.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From kwrobot at kitware.com Fri Jun 14 00:03:07 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Fri, 14 Jun 2019 00:03:07 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc1-69-gd229a09 Message-ID: <20190614040307.C2A9211DF56@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via d229a095a2d02851b93b6db58cd10799af2a1040 (commit) from acc7da6351f9809b3fa91432e2de6e6b5043639f (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d229a095a2d02851b93b6db58cd10799af2a1040 commit d229a095a2d02851b93b6db58cd10799af2a1040 Author: Kitware Robot AuthorDate: Fri Jun 14 00:01:06 2019 -0400 Commit: Kitware Robot CommitDate: Fri Jun 14 00:01:06 2019 -0400 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 63cb1c6..bc9f912 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 15) -set(CMake_VERSION_PATCH 20190613) +set(CMake_VERSION_PATCH 20190614) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From kwrobot at kitware.com Sat Jun 15 00:03:07 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Sat, 15 Jun 2019 00:03:07 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc1-70-g6f7b68e Message-ID: <20190615040308.093221253B7@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 6f7b68e7f969ae39622492b27a6f4bbb79d25117 (commit) from d229a095a2d02851b93b6db58cd10799af2a1040 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6f7b68e7f969ae39622492b27a6f4bbb79d25117 commit 6f7b68e7f969ae39622492b27a6f4bbb79d25117 Author: Kitware Robot AuthorDate: Sat Jun 15 00:01:04 2019 -0400 Commit: Kitware Robot CommitDate: Sat Jun 15 00:01:04 2019 -0400 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index bc9f912..6f6bafb 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 15) -set(CMake_VERSION_PATCH 20190614) +set(CMake_VERSION_PATCH 20190615) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From kwrobot at kitware.com Sun Jun 16 00:03:04 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Sun, 16 Jun 2019 00:03:04 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc1-71-gddb02c3 Message-ID: <20190616040304.A2EC711EE15@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via ddb02c3e0a5ded89e23cc5c9b09094e932a87b63 (commit) from 6f7b68e7f969ae39622492b27a6f4bbb79d25117 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ddb02c3e0a5ded89e23cc5c9b09094e932a87b63 commit ddb02c3e0a5ded89e23cc5c9b09094e932a87b63 Author: Kitware Robot AuthorDate: Sun Jun 16 00:01:05 2019 -0400 Commit: Kitware Robot CommitDate: Sun Jun 16 00:01:05 2019 -0400 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 6f6bafb..b7eef4e 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 15) -set(CMake_VERSION_PATCH 20190615) +set(CMake_VERSION_PATCH 20190616) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From kwrobot at kitware.com Mon Jun 17 00:03:05 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Mon, 17 Jun 2019 00:03:05 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc1-72-g6903c5b Message-ID: <20190617040305.804D01183D4@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 6903c5bbfbdde52f9f8f7689a49fcd02d6c7ae64 (commit) from ddb02c3e0a5ded89e23cc5c9b09094e932a87b63 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6903c5bbfbdde52f9f8f7689a49fcd02d6c7ae64 commit 6903c5bbfbdde52f9f8f7689a49fcd02d6c7ae64 Author: Kitware Robot AuthorDate: Mon Jun 17 00:01:04 2019 -0400 Commit: Kitware Robot CommitDate: Mon Jun 17 00:01:04 2019 -0400 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index b7eef4e..89858aa 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 15) -set(CMake_VERSION_PATCH 20190616) +set(CMake_VERSION_PATCH 20190617) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From kwrobot at kitware.com Mon Jun 17 08:03:06 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Mon, 17 Jun 2019 08:03:06 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc1-79-g0da805b Message-ID: <20190617120306.9C2C8494B@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 0da805bff39f5e465d48f678f3b49b3dc738ab9f (commit) via 3d8216330da76bac8267d64d4940af0b05e502a9 (commit) via 805cb43d3e82630b8489b6bdb6cb46bc2178fa96 (commit) via e815fad43f46c9145510972aef2d706b1c8a05d2 (commit) via 8f8b95395d70f8f58963f5285a32c86ed932bf4e (commit) via 22e65d10c175081ed5f21f86c7064c014fc3f39c (commit) via d63398d32da8948fae80ce2e29f9ca139112a03f (commit) from 6903c5bbfbdde52f9f8f7689a49fcd02d6c7ae64 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0da805bff39f5e465d48f678f3b49b3dc738ab9f commit 0da805bff39f5e465d48f678f3b49b3dc738ab9f Merge: 805cb43 3d82163 Author: Brad King AuthorDate: Mon Jun 17 08:00:15 2019 -0400 Commit: Brad King CommitDate: Mon Jun 17 08:00:15 2019 -0400 Merge branch 'release-3.15' https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=805cb43d3e82630b8489b6bdb6cb46bc2178fa96 commit 805cb43d3e82630b8489b6bdb6cb46bc2178fa96 Merge: 8f8b953 22e65d1 Author: Brad King AuthorDate: Mon Jun 17 11:58:52 2019 +0000 Commit: Kitware Robot CommitDate: Mon Jun 17 07:59:00 2019 -0400 Merge topic 'find_package_prefer_config_fix' 22e65d10c1 find_package: Fixed CMAKE_FIND_PACKAGE_PREFER_CONFIG Module fallback Acked-by: Kitware Robot Merge-request: !3446 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8f8b95395d70f8f58963f5285a32c86ed932bf4e commit 8f8b95395d70f8f58963f5285a32c86ed932bf4e Merge: 6903c5b d63398d Author: Brad King AuthorDate: Mon Jun 17 11:54:44 2019 +0000 Commit: Kitware Robot CommitDate: Mon Jun 17 07:54:55 2019 -0400 Merge topic 'capabilities-fileapi' d63398d32d fileapi: Suppress lint warning about non-move with old jsoncpp Acked-by: Kitware Robot Merge-request: !3442 ----------------------------------------------------------------------- Summary of changes: Source/cmFileAPI.cxx | 6 +++--- Source/cmFindPackageCommand.cxx | 20 ++++++++++++++++---- Source/cmFindPackageCommand.h | 9 ++++++++- Tests/FindPackageTest/CMakeLists.txt | 13 +++++++++++++ .../PreferConfigOnlyModule/FindACME.cmake | 1 + 5 files changed, 41 insertions(+), 8 deletions(-) create mode 100644 Tests/FindPackageTest/PreferConfigOnlyModule/FindACME.cmake hooks/post-receive -- CMake From kwrobot at kitware.com Mon Jun 17 08:03:06 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Mon, 17 Jun 2019 08:03:06 -0400 (EDT) Subject: [Cmake-commits] CMake branch, release, updated. v3.15.0-rc1-23-g3d82163 Message-ID: <20190617120306.CEB17F3B77@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, release has been updated via 3d8216330da76bac8267d64d4940af0b05e502a9 (commit) via e815fad43f46c9145510972aef2d706b1c8a05d2 (commit) via 22e65d10c175081ed5f21f86c7064c014fc3f39c (commit) via d63398d32da8948fae80ce2e29f9ca139112a03f (commit) from 95b9d6af80d08e795cde9f94454d2431263dd084 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- ----------------------------------------------------------------------- Summary of changes: Source/cmFileAPI.cxx | 6 +++--- Source/cmFindPackageCommand.cxx | 20 ++++++++++++++++---- Source/cmFindPackageCommand.h | 9 ++++++++- Tests/FindPackageTest/CMakeLists.txt | 13 +++++++++++++ .../PreferConfigOnlyModule/FindACME.cmake | 1 + 5 files changed, 41 insertions(+), 8 deletions(-) create mode 100644 Tests/FindPackageTest/PreferConfigOnlyModule/FindACME.cmake hooks/post-receive -- CMake From kwrobot at kitware.com Mon Jun 17 08:13:03 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Mon, 17 Jun 2019 08:13:03 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc1-87-g2c2c575 Message-ID: <20190617121303.AD4E4F50E8@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 2c2c575383c049a312a9a276e195df6699364530 (commit) via 24916ce81e1bd172a5d17450cab24282e6364819 (commit) via ab63072381171e9c5a7164536f0912b8b3a4a313 (commit) via dad271e8b7eec9ce781bccb9e7e7c9ed4f55003c (commit) via 1e1e306d9a13cdc1f8110c84192c37d7eedf5b3c (commit) via 276b56f01c757ef0fc8b08d2a55422c59b3f007c (commit) via 563205d6f84251dfef9658853e0b9a90af9ced71 (commit) via 3092c27f30b52e737a499a3eb91b2a160e9f3863 (commit) from 0da805bff39f5e465d48f678f3b49b3dc738ab9f (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2c2c575383c049a312a9a276e195df6699364530 commit 2c2c575383c049a312a9a276e195df6699364530 Merge: 24916ce 563205d Author: Brad King AuthorDate: Mon Jun 17 12:05:59 2019 +0000 Commit: Kitware Robot CommitDate: Mon Jun 17 08:06:46 2019 -0400 Merge topic 'cmDefinitions_avoid_string_copy' 563205d6f8 cmDefinitions: Avoid string copy when setting a definition Acked-by: Kitware Robot Merge-request: !3443 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=24916ce81e1bd172a5d17450cab24282e6364819 commit 24916ce81e1bd172a5d17450cab24282e6364819 Merge: ab63072 3092c27 Author: Brad King AuthorDate: Mon Jun 17 12:05:29 2019 +0000 Commit: Kitware Robot CommitDate: Mon Jun 17 08:05:53 2019 -0400 Merge topic 'cpack-deb-soname' 3092c27f30 CPack: Fix SONAME regex in DEB generator Acked-by: Kitware Robot Merge-request: !3440 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ab63072381171e9c5a7164536f0912b8b3a4a313 commit ab63072381171e9c5a7164536f0912b8b3a4a313 Merge: 1e1e306 dad271e Author: Brad King AuthorDate: Mon Jun 17 08:05:42 2019 -0400 Commit: Brad King CommitDate: Mon Jun 17 08:05:42 2019 -0400 Merge branch 'release-3.15' https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1e1e306d9a13cdc1f8110c84192c37d7eedf5b3c commit 1e1e306d9a13cdc1f8110c84192c37d7eedf5b3c Merge: 0da805b 276b56f Author: Brad King AuthorDate: Mon Jun 17 12:03:14 2019 +0000 Commit: Kitware Robot CommitDate: Mon Jun 17 08:03:22 2019 -0400 Merge topic 'FindBLAS-OpenBLAS-thread' 276b56f01c FindBLAS: Add second try for OpenBLAS with thread libraries. Acked-by: Kitware Robot Merge-request: !3434 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=563205d6f84251dfef9658853e0b9a90af9ced71 commit 563205d6f84251dfef9658853e0b9a90af9ced71 Author: Sebastian Holtermann AuthorDate: Thu Jun 13 12:01:08 2019 +0200 Commit: Sebastian Holtermann CommitDate: Thu Jun 13 12:01:08 2019 +0200 cmDefinitions: Avoid string copy when setting a definition diff --git a/Source/cmDefinitions.cxx b/Source/cmDefinitions.cxx index 5fafaf9..894447c 100644 --- a/Source/cmDefinitions.cxx +++ b/Source/cmDefinitions.cxx @@ -57,8 +57,7 @@ bool cmDefinitions::HasKey(const std::string& key, StackIter begin, void cmDefinitions::Set(const std::string& key, const char* value) { - Def def(value); - this->Map[key] = def; + this->Map[key] = Def(value); } std::vector cmDefinitions::UnusedKeys() const https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3092c27f30b52e737a499a3eb91b2a160e9f3863 commit 3092c27f30b52e737a499a3eb91b2a160e9f3863 Author: Kyle Edwards AuthorDate: Wed Jun 12 10:13:43 2019 -0400 Commit: Kyle Edwards CommitDate: Wed Jun 12 10:13:43 2019 -0400 CPack: Fix SONAME regex in DEB generator The DEB generator was written to parse output from GNU readelf. However, LLVM's readelf has a slightly different output format, without parentheses around the word "SONAME". Update the regex to account for this difference. Fixes: #19362 diff --git a/Modules/Internal/CPack/CPackDeb.cmake b/Modules/Internal/CPack/CPackDeb.cmake index 89dc6f0..7791822 100644 --- a/Modules/Internal/CPack/CPackDeb.cmake +++ b/Modules/Internal/CPack/CPackDeb.cmake @@ -45,7 +45,7 @@ function(extract_so_info shared_object libname version) ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE) if(result EQUAL 0) - string(REGEX MATCH "\\(SONAME\\)[^\n]*\\[([^\n]+)\\.so\\.([^\n]*)\\]" soname "${output}") + string(REGEX MATCH "\\(?SONAME\\)?[^\n]*\\[([^\n]+)\\.so\\.([^\n]*)\\]" soname "${output}") set(${libname} "${CMAKE_MATCH_1}" PARENT_SCOPE) set(${version} "${CMAKE_MATCH_2}" PARENT_SCOPE) else() ----------------------------------------------------------------------- Summary of changes: Modules/FindBLAS.cmake | 16 +++++++++++++++- Modules/Internal/CPack/CPackDeb.cmake | 2 +- Source/cmDefinitions.cxx | 3 +-- 3 files changed, 17 insertions(+), 4 deletions(-) hooks/post-receive -- CMake From kwrobot at kitware.com Mon Jun 17 08:13:03 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Mon, 17 Jun 2019 08:13:03 -0400 (EDT) Subject: [Cmake-commits] CMake branch, release, updated. v3.15.0-rc1-25-gdad271e Message-ID: <20190617121303.BDE20F5973@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, release has been updated via dad271e8b7eec9ce781bccb9e7e7c9ed4f55003c (commit) via 276b56f01c757ef0fc8b08d2a55422c59b3f007c (commit) from 3d8216330da76bac8267d64d4940af0b05e502a9 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- ----------------------------------------------------------------------- Summary of changes: Modules/FindBLAS.cmake | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) hooks/post-receive -- CMake From kwrobot at kitware.com Mon Jun 17 10:13:07 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Mon, 17 Jun 2019 10:13:07 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc1-91-g77e59e4 Message-ID: <20190617141307.8474A1256DF@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 77e59e442d110b2cb3c5d206e79f631175805974 (commit) via 4caefbb42369cf652df920edd07ee9e81eb95577 (commit) via 749ce48eb5b2876b347115a857839fdf9c24a221 (commit) via 9e84c7c5e8e243624858692bddb6f13485f46774 (commit) from 2c2c575383c049a312a9a276e195df6699364530 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=77e59e442d110b2cb3c5d206e79f631175805974 commit 77e59e442d110b2cb3c5d206e79f631175805974 Merge: 2c2c575 4caefbb Author: Kyle Edwards AuthorDate: Mon Jun 17 14:03:56 2019 +0000 Commit: Kitware Robot CommitDate: Mon Jun 17 10:04:47 2019 -0400 Merge topic 'escape-install-rpath' 4caefbb423 cmInstallTargetGenerator: Add tests for the RPATH_CHANGE rule 749ce48eb5 cmInstallTargetGenerator: Escape generated OLD_RPATH argument 9e84c7c5e8 cmInstallTargetGenerator: Introduce CMP0095 Acked-by: Kitware Robot Merge-request: !3383 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4caefbb42369cf652df920edd07ee9e81eb95577 commit 4caefbb42369cf652df920edd07ee9e81eb95577 Author: Dennis Klein AuthorDate: Thu Jun 13 16:40:01 2019 +0200 Commit: Dennis Klein CommitDate: Thu Jun 13 16:41:11 2019 +0200 cmInstallTargetGenerator: Add tests for the RPATH_CHANGE rule diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 075676a..d5ac7e0 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -408,7 +408,12 @@ else() set(NO_NAMELINK 0) endif() -add_RunCMake_test(install -DNO_NAMELINK=${NO_NAMELINK} -DCYGWIN=${CYGWIN} -DCMAKE_C_COMPILER_ID=${CMAKE_C_COMPILER_ID}) +add_RunCMake_test(install -DNO_NAMELINK=${NO_NAMELINK} -DCYGWIN=${CYGWIN} -DCMAKE_C_COMPILER_ID=${CMAKE_C_COMPILER_ID} + -DCMAKE_SHARED_LIBRARY_RPATH_ORIGIN_TOKEN=${CMAKE_SHARED_LIBRARY_RPATH_ORIGIN_TOKEN} + -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME} + -DCMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG=${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG} + -DCMAKE_EXECUTABLE_FORMAT=${CMAKE_EXECUTABLE_FORMAT}) + add_RunCMake_test(CPackCommandLine) add_RunCMake_test(CPackConfig) add_RunCMake_test(CPackInstallProperties) diff --git a/Tests/RunCMake/install/RunCMakeTest.cmake b/Tests/RunCMake/install/RunCMakeTest.cmake index 026148e..21c320b 100644 --- a/Tests/RunCMake/install/RunCMakeTest.cmake +++ b/Tests/RunCMake/install/RunCMakeTest.cmake @@ -48,6 +48,22 @@ in directory: endif() endfunction() +# Wrapper for run_cmake() that skips platforms that are non-ELF or have no RPATH support +function(run_cmake_ELFRPATH_only case) + if(UNIX AND CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG AND CMAKE_EXECUTABLE_FORMAT STREQUAL "ELF") + run_cmake(${case}) + else() + # Sanity check against a platform known to be ELF-based + if(CMAKE_SYSTEM_NAME STREQUAL "Linux") + message(FATAL_ERROR "Expected platform Linux to advertize itself as ELF-based, but it did not.") + else() + message(STATUS "${case} - SKIPPED (No ELF-based platform found)") + endif() + endif() +endfunction() + +run_cmake(TARGETS-FILE_RPATH_CHANGE-old_rpath) +run_cmake_ELFRPATH_only(TARGETS-FILE_RPATH_CHANGE-new_rpath) run_cmake(DIRECTORY-MESSAGE_NEVER) run_cmake(DIRECTORY-PATTERN-MESSAGE_NEVER) run_cmake(DIRECTORY-message) diff --git a/Tests/RunCMake/install/TARGETS-FILE_RPATH_CHANGE-check-common.cmake b/Tests/RunCMake/install/TARGETS-FILE_RPATH_CHANGE-check-common.cmake new file mode 100644 index 0000000..673fdde --- /dev/null +++ b/Tests/RunCMake/install/TARGETS-FILE_RPATH_CHANGE-check-common.cmake @@ -0,0 +1,30 @@ +file(READ ${RunCMake_TEST_BINARY_DIR}/cmake_install.cmake install_script) +#message(STATUS ${install_script}) + +set(wsnl " *[\n\r]+ *") # whitespace + single newline + whitespace +set(wssl " *[\n\r]+[^\n\r]*[\n\r]+ *") # ws nl skipline nl ws +string(CONCAT prefix [[file\(RPATH_CHANGE]]) +set(_msg "cmake_install.cmake does not match ") + +macro(check) + if(NOT install_script MATCHES "${regex}") + message(STATUS "${test} - check \"${target}\" - FAILED:") + string(CONCAT RunCMake_TEST_FAILED "${_msg}" ">>>${regex}<<<") + return() + else() + message(STATUS "${test} - check \"${target}\" - PASSED") + endif() +endmacro() + +macro(skip_without_rpath_change_rule) +# Not all platforms generate a file(RPATH_CHANGE) rule + if(NOT install_script MATCHES [[file\(RPATH_CHANGE]]) + # Sanity check against a platform known to generate a file(RPATH_CHANGE) rule + if(CMAKE_SYSTEM_NAME STREQUAL "Linux") + message(FATAL_ERROR "Expected generated file(RPATH_CHANGE) rule on platform Linux.") + else() + message(STATUS "${test} - All checks skipped. No file(RPATH_CHANGE) rule found on this platform.") + return() + endif() + endif() +endmacro() diff --git a/Tests/RunCMake/install/TARGETS-FILE_RPATH_CHANGE-new_rpath-check.cmake b/Tests/RunCMake/install/TARGETS-FILE_RPATH_CHANGE-new_rpath-check.cmake new file mode 100644 index 0000000..930ef70 --- /dev/null +++ b/Tests/RunCMake/install/TARGETS-FILE_RPATH_CHANGE-new_rpath-check.cmake @@ -0,0 +1,63 @@ +include(${RunCMake_SOURCE_DIR}/TARGETS-FILE_RPATH_CHANGE-check-common.cmake) +skip_without_rpath_change_rule() +string(APPEND prefix "${wsnl}" [[FILE "[^"]*/]]) + +set(target "exe1_cmp0095_old") +string(CONCAT regex "${prefix}${target}\"${wssl}" + [[NEW_RPATH "/foo/bar]]) +check() + +set(target "exe1_cmp0095_warn") +string(CONCAT regex "${prefix}${target}\"${wssl}" + [[NEW_RPATH "/foo/bar]]) +check() + +set(target "exe1_cmp0095_new") +string(CONCAT regex "${prefix}${target}\"${wssl}" + [[NEW_RPATH "/foo/bar]]) +check() + +set(target "exe2_cmp0095_old") +string(CONCAT regex "${prefix}${target}\"${wssl}" + [[NEW_RPATH "\$ORIGIN/../lib]]) +check() + +set(target "exe2_cmp0095_warn") +string(CONCAT regex "${prefix}${target}\"${wssl}" + [[NEW_RPATH "\$ORIGIN/../lib]]) +check() + +set(target "exe2_cmp0095_new") +string(CONCAT regex "${prefix}${target}\"${wssl}" + [[NEW_RPATH "\\\$ORIGIN/../lib]]) +check() + +set(target "exe3_cmp0095_old") +string(CONCAT regex "${prefix}${target}\"${wssl}" + [[NEW_RPATH "\${ORIGIN}/../lib]]) +check() + +set(target "exe3_cmp0095_warn") +string(CONCAT regex "${prefix}${target}\"${wssl}" + [[NEW_RPATH "\${ORIGIN}/../lib]]) +check() + +set(target "exe3_cmp0095_new") +string(CONCAT regex "${prefix}${target}\"${wssl}" + [[NEW_RPATH "\\\${ORIGIN}/../lib]]) +check() + +set(target "exe4_cmp0095_old") +string(CONCAT regex "${prefix}${target}\"${wssl}" + [[NEW_RPATH "/foo/bar/\${PLATFORM}]]) +check() + +set(target "exe4_cmp0095_warn") +string(CONCAT regex "${prefix}${target}\"${wssl}" + [[NEW_RPATH "/foo/bar/\${PLATFORM}]]) +check() + +set(target "exe4_cmp0095_new") +string(CONCAT regex "${prefix}${target}\"${wssl}" + [[NEW_RPATH "/foo/bar/\\\${PLATFORM}]]) +check() diff --git a/Tests/RunCMake/install/TARGETS-FILE_RPATH_CHANGE-new_rpath-stderr.txt b/Tests/RunCMake/install/TARGETS-FILE_RPATH_CHANGE-new_rpath-stderr.txt new file mode 100644 index 0000000..1e123f6 --- /dev/null +++ b/Tests/RunCMake/install/TARGETS-FILE_RPATH_CHANGE-new_rpath-stderr.txt @@ -0,0 +1,23 @@ +^CMake Warning \(dev\) at TARGETS-FILE_RPATH_CHANGE-new_rpath\.cmake:[0-9]+ \(install\): + Policy CMP0095 is not set: RPATH entries are properly escaped in the + intermediary CMake install script\. Run "cmake --help-policy CMP0095" for + policy details\. Use the cmake_policy command to set the policy and + suppress this warning\. + + RPATH entries for target 'exe3_cmp0095_warn' will not be escaped in the + intermediary cmake_install\.cmake script\. +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\) +This warning is for project developers\. Use -Wno-dev to suppress it\. + +CMake Warning \(dev\) at TARGETS-FILE_RPATH_CHANGE-new_rpath\.cmake:[0-9]+ \(install\): + Policy CMP0095 is not set: RPATH entries are properly escaped in the + intermediary CMake install script\. Run "cmake --help-policy CMP0095" for + policy details\. Use the cmake_policy command to set the policy and + suppress this warning\. + + RPATH entries for target 'exe4_cmp0095_warn' will not be escaped in the + intermediary cmake_install\.cmake script\. +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\) +This warning is for project developers\. Use -Wno-dev to suppress it\.$ diff --git a/Tests/RunCMake/install/TARGETS-FILE_RPATH_CHANGE-new_rpath.cmake b/Tests/RunCMake/install/TARGETS-FILE_RPATH_CHANGE-new_rpath.cmake new file mode 100644 index 0000000..cba04b2 --- /dev/null +++ b/Tests/RunCMake/install/TARGETS-FILE_RPATH_CHANGE-new_rpath.cmake @@ -0,0 +1,72 @@ +cmake_minimum_required(VERSION 3.14) +enable_language(C) + +# test matrix +# +# A := +# | no cmake syntax | cmake syntax | +# -----------------------+-----------------+--------------+ +# absolute install RPATH | exe1 | exe4 | +# relative install RPATH | exe2 | exe3 | +# +# all := A * CMP005_OLD + A * CMP0095_WARN + A * CMP0095_NEW + +add_library(utils SHARED obj1.c) +set(targets utils) + +set(exe1_install_rpath "/foo/bar") +set(exe2_install_rpath "\$ORIGIN/../lib") +set(exe3_install_rpath "\${ORIGIN}/../lib") +set(exe4_install_rpath "/foo/bar/\${PLATFORM}") + +macro(A_CMP0095 policy_value) + cmake_policy(PUSH) + if(NOT "x${policy_value}x" STREQUAL "xWARNx") + cmake_policy(SET CMP0095 ${policy_value}) + endif() + string(TOLOWER "${policy_value}" p) + + # exe1: absolute install RPATH, no cmake syntax + set(case "exe1") + set(target "${case}_cmp0095_${p}") + list(APPEND targets ${target}) + add_executable(${target} main.c) + target_link_libraries(${target} PRIVATE utils) + set_target_properties(${target} PROPERTIES + INSTALL_RPATH "${${case}_install_rpath}") + + # exe2: relative install RPATH, no cmake syntax + set(case "exe2") + set(target "${case}_cmp0095_${p}") + list(APPEND targets ${target}) + add_executable(${target} main.c) + target_link_libraries(${target} PRIVATE utils) + set_target_properties(${target} PROPERTIES + INSTALL_RPATH "${${case}_install_rpath}") + + # exe3: relative install RPATH, cmake syntax + set(case "exe3") + set(target "${case}_cmp0095_${p}") + list(APPEND targets ${target}) + add_executable(${target} main.c) + target_link_libraries(${target} PRIVATE utils) + set_target_properties(${target} PROPERTIES + INSTALL_RPATH "${${case}_install_rpath}") + + # exe4: absolute install RPATH, cmake syntax + set(case "exe4") + set(target "${case}_cmp0095_${p}") + list(APPEND targets ${target}) + add_executable(${target} main.c) + target_link_libraries(${target} PRIVATE utils) + set_target_properties(${target} PROPERTIES + INSTALL_RPATH "${${case}_install_rpath}") + + cmake_policy(POP) +endmacro() + +A_CMP0095("OLD") +A_CMP0095("WARN") # exe3 and exe4 are expected to issue an author warning +A_CMP0095("NEW") + +install(TARGETS ${targets}) diff --git a/Tests/RunCMake/install/TARGETS-FILE_RPATH_CHANGE-old_rpath-check.cmake b/Tests/RunCMake/install/TARGETS-FILE_RPATH_CHANGE-old_rpath-check.cmake new file mode 100644 index 0000000..814f405 --- /dev/null +++ b/Tests/RunCMake/install/TARGETS-FILE_RPATH_CHANGE-old_rpath-check.cmake @@ -0,0 +1,15 @@ +include(${RunCMake_SOURCE_DIR}/TARGETS-FILE_RPATH_CHANGE-check-common.cmake) +skip_without_rpath_change_rule() +string(APPEND prefix "${wsnl}" [[FILE "[^"]*/]]) + +set(target "exe1") +string(CONCAT regex "${prefix}${target}\"${wsnl}" + [[OLD_RPATH "]] "${RunCMake_BINARY_DIR}") +check() + +if("x${CMAKE_SHARED_LIBRARY_RPATH_ORIGIN_TOKEN}" STREQUAL "x\$ORIGIN") + set(target "exe2") + string(CONCAT regex "${prefix}${target}\"${wsnl}" + [[OLD_RPATH "\\\$ORIGIN]]) + check() +endif() diff --git a/Tests/RunCMake/install/TARGETS-FILE_RPATH_CHANGE-old_rpath.cmake b/Tests/RunCMake/install/TARGETS-FILE_RPATH_CHANGE-old_rpath.cmake new file mode 100644 index 0000000..43ae787 --- /dev/null +++ b/Tests/RunCMake/install/TARGETS-FILE_RPATH_CHANGE-old_rpath.cmake @@ -0,0 +1,18 @@ +cmake_minimum_required(VERSION 3.14) +enable_language(C) + +add_library(utils SHARED obj1.c) + +# exe1: absolute build RPATH, no cmake syntax +set(CMAKE_BUILD_RPATH_USE_ORIGIN OFF) +set(CMAKE_INSTALL_RPATH "/foo/bar") +add_executable(exe1 main.c) +target_link_libraries(exe1 PRIVATE utils) + +# exe2: relative build RPATH, no cmake syntax +set(CMAKE_BUILD_RPATH_USE_ORIGIN ON) +set(CMAKE_INSTALL_RPATH "/foo/bar") +add_executable(exe2 main.c) +target_link_libraries(exe2 PRIVATE utils) + +install(TARGETS utils exe1 exe2) https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=749ce48eb5b2876b347115a857839fdf9c24a221 commit 749ce48eb5b2876b347115a857839fdf9c24a221 Author: Dennis Klein AuthorDate: Fri May 31 16:43:24 2019 +0200 Commit: Dennis Klein CommitDate: Thu Jun 13 16:41:11 2019 +0200 cmInstallTargetGenerator: Escape generated OLD_RPATH argument On some platforms, e.g. most ELF-based ones, RPATHs may contain keywords that match CMake's variable syntax. To prevent them from being falsely substituted when running the cmake_install.cmake script CMake syntax needs to be escaped. diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx index 0e2f9c5..0774436 100644 --- a/Source/cmInstallTargetGenerator.cxx +++ b/Source/cmInstallTargetGenerator.cxx @@ -750,13 +750,14 @@ void cmInstallTargetGenerator::AddChrpathPatchRule( return; } - // Escape any CMake syntax in the install RPATH. + // Escape any CMake syntax in the RPATHs. + std::string escapedOldRpath = cmOutputConverter::EscapeForCMake(oldRpath); std::string escapedNewRpath = cmOutputConverter::EscapeForCMake(newRpath); // Write a rule to run chrpath to set the install-tree RPATH os << indent << "file(RPATH_CHANGE\n" << indent << " FILE \"" << toDestDirPath << "\"\n" - << indent << " OLD_RPATH \"" << oldRpath << "\"\n"; + << indent << " OLD_RPATH " << escapedOldRpath << "\n"; // CMP0095: ``RPATH`` entries are properly escaped in the intermediary // CMake install script. https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9e84c7c5e8e243624858692bddb6f13485f46774 commit 9e84c7c5e8e243624858692bddb6f13485f46774 Author: Dennis Klein AuthorDate: Mon May 27 22:00:43 2019 +0200 Commit: Dennis Klein CommitDate: Thu Jun 13 16:41:04 2019 +0200 cmInstallTargetGenerator: Introduce CMP0095 Escape coincidental CMake syntax in RPATH entries when generating the intermediary cmake_install.cmake script. Fixes #19225 diff --git a/Help/manual/cmake-policies.7.rst b/Help/manual/cmake-policies.7.rst index 1d023cb..bac1c6c 100644 --- a/Help/manual/cmake-policies.7.rst +++ b/Help/manual/cmake-policies.7.rst @@ -57,6 +57,7 @@ Policies Introduced by CMake 3.15 .. toctree:: :maxdepth: 1 + CMP0095: RPATH entries are properly escaped in the intermediary CMake install script. CMP0094: FindPython3, FindPython2 and FindPython use LOCATION for lookup strategy. CMP0093: FindBoost reports Boost_VERSION in x.y.z format. CMP0092: MSVC warning flags are not in CMAKE_{C,CXX}_FLAGS by default. diff --git a/Help/policy/CMP0095.rst b/Help/policy/CMP0095.rst new file mode 100644 index 0000000..4c56a05 --- /dev/null +++ b/Help/policy/CMP0095.rst @@ -0,0 +1,30 @@ +CMP0095 +------- + +``RPATH`` entries are properly escaped in the intermediary CMake install script. + +In CMake 3.15 and earlier, ``RPATH`` entries set via +:variable:`CMAKE_INSTALL_RPATH` or via :prop_tgt:`INSTALL_RPATH` have not been +escaped before being inserted into the ``cmake_install.cmake`` script. Dynamic +linkers on ELF-based systems (e.g. Linux and FreeBSD) allow certain keywords in +``RPATH`` entries, such as ``${ORIGIN}`` (More details are available in the +``ld.so`` man pages on those systems). The syntax of these keywords can match +CMake's variable syntax. In order to not be substituted (usually to an empty +string) already by the intermediary ``cmake_install.cmake`` script, the user had +to double-escape such ``RPATH`` keywords, e.g. +``set(CMAKE_INSTALL_RPATH "\\\${ORIGIN}/../lib")``. Since the intermediary +``cmake_install.cmake`` script is an implementation detail of CMake, CMake 3.16 +and later will make sure ``RPATH`` entries are inserted literally by escaping +any coincidental CMake syntax. + +The ``OLD`` behavior of this policy is to not escape ``RPATH`` entries in the +intermediary ``cmake_install.cmake`` script. The ``NEW`` behavior is to properly +escape coincidental CMake syntax in ``RPATH`` entries when generating the +intermediary ``cmake_install.cmake`` script. + +This policy was introduced in CMake version 3.16. CMake version |release| warns +when the policy is not set and detected usage of CMake-like syntax and uses +``OLD`` behavior. Use the :command:`cmake_policy` command to set it to ``OLD`` +or ``NEW`` explicitly. + +.. include:: DEPRECATED.txt diff --git a/Help/release/dev/CMP0095.rst b/Help/release/dev/CMP0095.rst new file mode 100644 index 0000000..21d0550 --- /dev/null +++ b/Help/release/dev/CMP0095.rst @@ -0,0 +1,5 @@ +CMP0095 +------- + +* ``RPATH`` entries are properly escaped in the intermediary CMake install script. + See policy :policy:`CMP0095`. diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx index 7c5a55b..0e2f9c5 100644 --- a/Source/cmInstallTargetGenerator.cxx +++ b/Source/cmInstallTargetGenerator.cxx @@ -16,6 +16,8 @@ #include "cmLocalGenerator.h" #include "cmMakefile.h" #include "cmMessageType.h" +#include "cmOutputConverter.h" +#include "cmPolicies.h" #include "cmStateTypes.h" #include "cmSystemTools.h" #include "cmTarget.h" @@ -632,17 +634,34 @@ void cmInstallTargetGenerator::AddRPathCheckRule( return; } - // Get the install RPATH from the link information. - std::string newRpath = cli->GetChrpathString(); - // Write a rule to remove the installed file if its rpath is not the // new rpath. This is needed for existing build/install trees when // the installed rpath changes but the file is not rebuilt. - /* clang-format off */ os << indent << "file(RPATH_CHECK\n" - << indent << " FILE \"" << toDestDirPath << "\"\n" - << indent << " RPATH \"" << newRpath << "\")\n"; - /* clang-format on */ + << indent << " FILE \"" << toDestDirPath << "\"\n"; + + // CMP0095: ``RPATH`` entries are properly escaped in the intermediary + // CMake install script. + switch (this->Target->GetPolicyStatusCMP0095()) { + case cmPolicies::WARN: + // No author warning needed here, we warn later in + // cmInstallTargetGenerator::AddChrpathPatchRule(). + CM_FALLTHROUGH; + case cmPolicies::OLD: { + // Get the install RPATH from the link information. + std::string newRpath = cli->GetChrpathString(); + os << indent << " RPATH \"" << newRpath << "\")\n"; + break; + } + default: { + // Get the install RPATH from the link information and + // escape any CMake syntax in the install RPATH. + std::string escapedNewRpath = + cmOutputConverter::EscapeForCMake(cli->GetChrpathString()); + os << indent << " RPATH " << escapedNewRpath << ")\n"; + break; + } + } } void cmInstallTargetGenerator::AddChrpathPatchRule( @@ -731,11 +750,27 @@ void cmInstallTargetGenerator::AddChrpathPatchRule( return; } + // Escape any CMake syntax in the install RPATH. + std::string escapedNewRpath = cmOutputConverter::EscapeForCMake(newRpath); + // Write a rule to run chrpath to set the install-tree RPATH os << indent << "file(RPATH_CHANGE\n" << indent << " FILE \"" << toDestDirPath << "\"\n" - << indent << " OLD_RPATH \"" << oldRpath << "\"\n" - << indent << " NEW_RPATH \"" << newRpath << "\")\n"; + << indent << " OLD_RPATH \"" << oldRpath << "\"\n"; + + // CMP0095: ``RPATH`` entries are properly escaped in the intermediary + // CMake install script. + switch (this->Target->GetPolicyStatusCMP0095()) { + case cmPolicies::WARN: + this->IssueCMP0095Warning(newRpath); + CM_FALLTHROUGH; + case cmPolicies::OLD: + os << indent << " NEW_RPATH \"" << newRpath << "\")\n"; + break; + default: + os << indent << " NEW_RPATH " << escapedNewRpath << ")\n"; + break; + } } } @@ -838,3 +873,26 @@ void cmInstallTargetGenerator::AddUniversalInstallRule( << "\"" << this->Target->Target->GetName() << "\" " << "\"" << toDestDirPath << "\")\n"; } + +void cmInstallTargetGenerator::IssueCMP0095Warning( + const std::string& unescapedRpath) +{ + // Reduce warning noise to cases where used RPATHs may actually be affected + // by CMP0095. This filter is meant to skip warnings in cases when + // non-curly-braces syntax (e.g. $ORIGIN) or no keyword is used which has + // worked already before CMP0095. We intend to issue a warning in all cases + // with curly-braces syntax, even if the workaround of double-escaping is in + // place, since we deprecate the need for it with CMP0095. + const bool potentially_affected(unescapedRpath.find("${") != + std::string::npos); + + if (potentially_affected) { + std::ostringstream w; + w << cmPolicies::GetPolicyWarning(cmPolicies::CMP0095) << "\n"; + w << "RPATH entries for target '" << this->Target->GetName() << "' " + << "will not be escaped in the intermediary " + << "cmake_install.cmake script."; + this->Target->GetGlobalGenerator()->GetCMakeInstance()->IssueMessage( + MessageType::AUTHOR_WARNING, w.str(), this->GetBacktrace()); + } +} diff --git a/Source/cmInstallTargetGenerator.h b/Source/cmInstallTargetGenerator.h index ed3ab52..9ccad63 100644 --- a/Source/cmInstallTargetGenerator.h +++ b/Source/cmInstallTargetGenerator.h @@ -104,6 +104,7 @@ protected: const std::string& toDestDirPath); void AddUniversalInstallRule(std::ostream& os, Indent indent, const std::string& toDestDirPath); + void IssueCMP0095Warning(const std::string& unescapedRpath); std::string TargetName; cmGeneratorTarget* Target; diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h index b705119..c16a46f 100644 --- a/Source/cmPolicies.h +++ b/Source/cmPolicies.h @@ -279,7 +279,11 @@ class cmMakefile; SELECT(POLICY, CMP0094, \ "FindPython3, FindPython2 and FindPyton use " \ "LOCATION for lookup strategy.", \ - 3, 15, 0, cmPolicies::WARN) + 3, 15, 0, cmPolicies::WARN) \ + SELECT(POLICY, CMP0095, \ + "RPATH entries are properly escaped in the intermediary CMake " \ + "install script.", \ + 3, 16, 0, cmPolicies::WARN) #define CM_SELECT_ID(F, A1, A2, A3, A4, A5, A6) F(A1) #define CM_FOR_EACH_POLICY_ID(POLICY) \ @@ -307,7 +311,8 @@ class cmMakefile; F(CMP0073) \ F(CMP0076) \ F(CMP0081) \ - F(CMP0083) + F(CMP0083) \ + F(CMP0095) /** \class cmPolicies * \brief Handles changes in CMake behavior and policies diff --git a/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt b/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt index 0bcf886..6d72fac 100644 --- a/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt +++ b/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt @@ -27,6 +27,7 @@ \* CMP0076 \* CMP0081 \* CMP0083 + \* CMP0095 Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-notfile.cmake b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-notfile.cmake index 6e718f8..6567438 100644 --- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-notfile.cmake +++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-notfile.cmake @@ -1,4 +1,5 @@ enable_language(C) +cmake_policy(SET CMP0095 NEW) file(WRITE "${CMAKE_BINARY_DIR}/test.c" "void test(void) {}\n") file(WRITE "${CMAKE_BINARY_DIR}/main.c" [[extern void test(void); @@ -13,7 +14,7 @@ int main(void) add_library(test SHARED "${CMAKE_BINARY_DIR}/test.c") add_executable(exe "${CMAKE_BINARY_DIR}/main.c") target_link_libraries(exe PRIVATE test) -set_property(TARGET exe PROPERTY INSTALL_RPATH "\\\${ORIGIN}/../lib") +set_property(TARGET exe PROPERTY INSTALL_RPATH "\${ORIGIN}/../lib") install(TARGETS exe DESTINATION bin) diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux.cmake b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux.cmake index 433dd3b..bd0f9f1 100644 --- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux.cmake +++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux.cmake @@ -1,4 +1,5 @@ enable_language(C) +cmake_policy(SET CMP0095 NEW) set(test_rpath_names preexcluded @@ -52,8 +53,8 @@ target_link_libraries(test_rpath PRIVATE ${test_rpath_names}) set_property(TARGET test_rpath PROPERTY INSTALL_RPATH "${CMAKE_BINARY_DIR}/root-all/lib/rpath_postexcluded" "${CMAKE_BINARY_DIR}/root-all/lib/rpath" - "\\\$ORIGIN/rpath_origin_postexcluded" - "\\\${ORIGIN}/rpath_origin" # This must be double-escaped because of issue #19225. + "\$ORIGIN/rpath_origin_postexcluded" + "\${ORIGIN}/rpath_origin" "${CMAKE_BINARY_DIR}/root-all/lib/conflict" ) target_link_options(test_rpath PRIVATE -Wl,--disable-new-dtags) @@ -88,8 +89,8 @@ set_property(TARGET test_runpath PROPERTY INSTALL_RPATH "${CMAKE_BINARY_DIR}/root-all/lib/runpath/../rpath" # Ensure that files that don't conflict are treated correctly "${CMAKE_BINARY_DIR}/root-all/lib/runpath_postexcluded" "${CMAKE_BINARY_DIR}/root-all/lib/runpath" - "\\\${ORIGIN}/runpath_origin_postexcluded" # This must be double-escaped because of issue #19225. - "\\\$ORIGIN/runpath_origin" + "\${ORIGIN}/runpath_origin_postexcluded" + "\$ORIGIN/runpath_origin" "${CMAKE_BINARY_DIR}/root-all/lib/conflict2" ) target_link_options(test_runpath PRIVATE -Wl,--enable-new-dtags) ----------------------------------------------------------------------- Summary of changes: Help/manual/cmake-policies.7.rst | 1 + Help/policy/CMP0095.rst | 30 +++++++++ Help/release/dev/CMP0095.rst | 5 ++ Source/cmInstallTargetGenerator.cxx | 77 +++++++++++++++++++--- Source/cmInstallTargetGenerator.h | 1 + Source/cmPolicies.h | 9 ++- Tests/RunCMake/CMakeLists.txt | 7 +- .../RunCMake/TargetPolicies/PolicyList-stderr.txt | 1 + Tests/RunCMake/install/RunCMakeTest.cmake | 16 +++++ .../TARGETS-FILE_RPATH_CHANGE-check-common.cmake | 30 +++++++++ ...TARGETS-FILE_RPATH_CHANGE-new_rpath-check.cmake | 63 ++++++++++++++++++ .../TARGETS-FILE_RPATH_CHANGE-new_rpath-stderr.txt | 23 +++++++ .../TARGETS-FILE_RPATH_CHANGE-new_rpath.cmake | 72 ++++++++++++++++++++ ...TARGETS-FILE_RPATH_CHANGE-old_rpath-check.cmake | 15 +++++ .../TARGETS-FILE_RPATH_CHANGE-old_rpath.cmake | 18 +++++ ...le-GET_RUNTIME_DEPENDENCIES-linux-notfile.cmake | 3 +- .../file-GET_RUNTIME_DEPENDENCIES-linux.cmake | 9 +-- 17 files changed, 363 insertions(+), 17 deletions(-) create mode 100644 Help/policy/CMP0095.rst create mode 100644 Help/release/dev/CMP0095.rst create mode 100644 Tests/RunCMake/install/TARGETS-FILE_RPATH_CHANGE-check-common.cmake create mode 100644 Tests/RunCMake/install/TARGETS-FILE_RPATH_CHANGE-new_rpath-check.cmake create mode 100644 Tests/RunCMake/install/TARGETS-FILE_RPATH_CHANGE-new_rpath-stderr.txt create mode 100644 Tests/RunCMake/install/TARGETS-FILE_RPATH_CHANGE-new_rpath.cmake create mode 100644 Tests/RunCMake/install/TARGETS-FILE_RPATH_CHANGE-old_rpath-check.cmake create mode 100644 Tests/RunCMake/install/TARGETS-FILE_RPATH_CHANGE-old_rpath.cmake hooks/post-receive -- CMake From kwrobot at kitware.com Tue Jun 18 00:03:04 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Tue, 18 Jun 2019 00:03:04 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc1-92-gdb7fc1e Message-ID: <20190618040304.E6F0F111104@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via db7fc1e04507fc18475c0af0dacd7b45b4f69389 (commit) from 77e59e442d110b2cb3c5d206e79f631175805974 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=db7fc1e04507fc18475c0af0dacd7b45b4f69389 commit db7fc1e04507fc18475c0af0dacd7b45b4f69389 Author: Kitware Robot AuthorDate: Tue Jun 18 00:01:07 2019 -0400 Commit: Kitware Robot CommitDate: Tue Jun 18 00:01:07 2019 -0400 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 89858aa..9bef298 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 15) -set(CMake_VERSION_PATCH 20190617) +set(CMake_VERSION_PATCH 20190618) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From kwrobot at kitware.com Tue Jun 18 08:03:12 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Tue, 18 Jun 2019 08:03:12 -0400 (EDT) Subject: [Cmake-commits] CMake branch, release, updated. v3.15.0-rc1-27-ge2b4fa1 Message-ID: <20190618120312.9E68CC0487@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, release has been updated via e2b4fa114184a0a8eeec9c8005e09f70a8ae6832 (commit) via 8a08d0c0926a9f950ff49d5547b374c0bd282440 (commit) from dad271e8b7eec9ce781bccb9e7e7c9ed4f55003c (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- ----------------------------------------------------------------------- Summary of changes: Help/variable/CMAKE_PROJECT_INCLUDE.rst | 9 ++++++--- Help/variable/CMAKE_PROJECT_INCLUDE_BEFORE.rst | 9 ++++++--- Help/variable/CMAKE_PROJECT_PROJECT-NAME_INCLUDE.rst | 10 +++++++--- 3 files changed, 19 insertions(+), 9 deletions(-) hooks/post-receive -- CMake From kwrobot at kitware.com Tue Jun 18 08:03:12 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Tue, 18 Jun 2019 08:03:12 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc1-104-g0a10422 Message-ID: <20190618120312.8E3D9F50E8@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 0a104224182565645b6bb8a1f81031c5afdc67ed (commit) via 7af2dedc0895e0ba685b49092c7ec48b3468e833 (commit) via 1b5a7adf5e5b9343f6f6dc608b1dee0b17316af8 (commit) via cc7f1be54e923a8459279638594238650c9a0529 (commit) via a45f061296f6646c2633333fa034758dd23783d5 (commit) via e2b4fa114184a0a8eeec9c8005e09f70a8ae6832 (commit) via 9c7ea95ab0961d6f0b6b317a45fbde9cb65dab1b (commit) via 2746c61e6d36f3d49744b11259395a8684007e9f (commit) via 8a08d0c0926a9f950ff49d5547b374c0bd282440 (commit) via 63bf207cd67972785fba5d48533022e0945f0bd7 (commit) via 68dcbeee01a301876011a8310509e3860cbb9b34 (commit) via 34a7e5ab587f5441ed5854b6ad9a159f3af88365 (commit) from db7fc1e04507fc18475c0af0dacd7b45b4f69389 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0a104224182565645b6bb8a1f81031c5afdc67ed commit 0a104224182565645b6bb8a1f81031c5afdc67ed Merge: 7af2ded 63bf207 Author: Brad King AuthorDate: Tue Jun 18 11:58:39 2019 +0000 Commit: Kitware Robot CommitDate: Tue Jun 18 07:59:46 2019 -0400 Merge topic 'cxx_lambda_init_captures_document_why_not_supported_on_gcc48' 63bf207cd6 CompileFeatures: document why lambda_init_captures requires GCC 4.9 Acked-by: Kitware Robot Merge-request: !3452 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7af2dedc0895e0ba685b49092c7ec48b3468e833 commit 7af2dedc0895e0ba685b49092c7ec48b3468e833 Merge: 1b5a7ad 68dcbee Author: Brad King AuthorDate: Tue Jun 18 11:58:21 2019 +0000 Commit: Kitware Robot CommitDate: Tue Jun 18 07:58:48 2019 -0400 Merge topic 'implicit_lapack_library' 68dcbeee01 FindLAPACK: Test for implicitly linked LAPACK libraries Acked-by: Kitware Robot Merge-request: !3451 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1b5a7adf5e5b9343f6f6dc608b1dee0b17316af8 commit 1b5a7adf5e5b9343f6f6dc608b1dee0b17316af8 Merge: cc7f1be 2746c61 Author: Brad King AuthorDate: Tue Jun 18 11:57:46 2019 +0000 Commit: Kitware Robot CommitDate: Tue Jun 18 07:57:56 2019 -0400 Merge topic 'library-search-paths' 2746c61e6d Swift: Add library search paths for dependencies Acked-by: Kitware Robot Merge-request: !3436 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=cc7f1be54e923a8459279638594238650c9a0529 commit cc7f1be54e923a8459279638594238650c9a0529 Merge: a45f061 e2b4fa1 Author: Brad King AuthorDate: Tue Jun 18 07:57:33 2019 -0400 Commit: Brad King CommitDate: Tue Jun 18 07:57:33 2019 -0400 Merge branch 'release-3.15' https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a45f061296f6646c2633333fa034758dd23783d5 commit a45f061296f6646c2633333fa034758dd23783d5 Merge: 9c7ea95 8a08d0c Author: Brad King AuthorDate: Tue Jun 18 11:55:49 2019 +0000 Commit: Kitware Robot CommitDate: Tue Jun 18 07:56:08 2019 -0400 Merge topic 'doc-project-include' 8a08d0c092 Help: Document what project() calls use CMAKE_PROJECT_INCLUDE and friends Acked-by: Kitware Robot Merge-request: !3453 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9c7ea95ab0961d6f0b6b317a45fbde9cb65dab1b commit 9c7ea95ab0961d6f0b6b317a45fbde9cb65dab1b Merge: db7fc1e 34a7e5a Author: Brad King AuthorDate: Tue Jun 18 11:54:27 2019 +0000 Commit: Kitware Robot CommitDate: Tue Jun 18 07:54:39 2019 -0400 Merge topic 'tutorial-fix-version' 34a7e5ab58 Tests/Tutorial: Fix version displayed in tutorial executable Acked-by: Kitware Robot Merge-request: !3448 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2746c61e6d36f3d49744b11259395a8684007e9f commit 2746c61e6d36f3d49744b11259395a8684007e9f Author: Saleem Abdulrasool AuthorDate: Sun Jun 9 12:51:00 2019 -0700 Commit: Brad King CommitDate: Mon Jun 17 14:09:15 2019 -0400 Swift: Add library search paths for dependencies When building Swift executables and libraries which import a module, an implicit link will be added by the driver. Because this links by name rather than path, the library search path needs to be provided to indicate where to find the library. For all local dependencies, add the library paths for the targets when linking. This ensures that you can link against local libraries without explicitly setting a library path. Fixes: #19304 diff --git a/Source/cmLinkLineComputer.cxx b/Source/cmLinkLineComputer.cxx index 2a8bee6..469faca 100644 --- a/Source/cmLinkLineComputer.cxx +++ b/Source/cmLinkLineComputer.cxx @@ -99,14 +99,34 @@ std::string cmLinkLineComputer::ComputeLinkPath( std::string const& libPathTerminator) { std::string linkPath; - std::vector const& libDirs = cli.GetDirectories(); - for (std::string const& libDir : libDirs) { - std::string libpath = this->ConvertToOutputForExisting(libDir); - linkPath += " " + libPathFlag; - linkPath += libpath; - linkPath += libPathTerminator; - linkPath += " "; + + if (cli.GetLinkLanguage() == "Swift") { + for (const cmComputeLinkInformation::Item& item : cli.GetItems()) { + const cmGeneratorTarget* target = item.Target; + if (!target) { + continue; + } + + if (target->GetType() == cmStateEnums::STATIC_LIBRARY || + target->GetType() == cmStateEnums::SHARED_LIBRARY) { + cmStateEnums::ArtifactType type = cmStateEnums::RuntimeBinaryArtifact; + if (target->GetType() == cmStateEnums::SHARED_LIBRARY && + target->IsDLLPlatform()) { + type = cmStateEnums::ImportLibraryArtifact; + } + + linkPath += " " + libPathFlag + + item.Target->GetDirectory(cli.GetConfig(), type) + + libPathTerminator + " "; + } + } } + + for (std::string const& libDir : cli.GetDirectories()) { + linkPath += " " + libPathFlag + this->ConvertToOutputForExisting(libDir) + + libPathTerminator + " "; + } + return linkPath; } https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=63bf207cd67972785fba5d48533022e0945f0bd7 commit 63bf207cd67972785fba5d48533022e0945f0bd7 Author: Robert Maynard AuthorDate: Fri Jun 14 16:50:52 2019 -0400 Commit: Robert Maynard CommitDate: Mon Jun 17 09:20:03 2019 -0400 CompileFeatures: document why lambda_init_captures requires GCC 4.9 diff --git a/Modules/Compiler/GNU-CXX-FeatureTests.cmake b/Modules/Compiler/GNU-CXX-FeatureTests.cmake index d18adaf..45c5470 100644 --- a/Modules/Compiler/GNU-CXX-FeatureTests.cmake +++ b/Modules/Compiler/GNU-CXX-FeatureTests.cmake @@ -18,18 +18,18 @@ set(_cmake_feature_test_cxx_attribute_deprecated "${GNU49_CXX14}") set(_cmake_feature_test_cxx_decltype_auto "${GNU49_CXX14}") set(_cmake_feature_test_cxx_digit_separators "${GNU49_CXX14}") set(_cmake_feature_test_cxx_generic_lambdas "${GNU49_CXX14}") -set(_cmake_feature_test_cxx_lambda_init_captures "${GNU49_CXX14}") # GNU 4.3 supports binary literals as an extension, but may warn about # use of extensions prior to GNU 4.9 # http://stackoverflow.com/questions/16334024/difference-between-gcc-binary-literals-and-c14-ones set(_cmake_feature_test_cxx_binary_literals "${GNU49_CXX14}") -# The feature below is documented as available in GNU 4.8 (by implementing an +# The features below are documented as available in GNU 4.8 (by implementing an # earlier draft of the standard paper), but that version of the compiler # does not set __cplusplus to a value greater than 201103L until GNU 4.9: # http://gcc.gnu.org/onlinedocs/gcc-4.8.2/cpp/Standard-Predefined-Macros.html#Standard-Predefined-Macros # http://gcc.gnu.org/onlinedocs/gcc-4.9.0/cpp/Standard-Predefined-Macros.html#Standard-Predefined-Macros # So, CMake only reports availability for it with GNU 4.9 or later. set(_cmake_feature_test_cxx_return_type_deduction "${GNU49_CXX14}") +set(_cmake_feature_test_cxx_lambda_init_captures "${GNU49_CXX14}") # Introduced in GCC 4.8.1 set(GNU481_CXX11 "((__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) >= 40801) && __cplusplus >= 201103L") https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=68dcbeee01a301876011a8310509e3860cbb9b34 commit 68dcbeee01a301876011a8310509e3860cbb9b34 Author: Jakub Benda AuthorDate: Tue Jun 11 16:26:51 2019 +0100 Commit: Brad King CommitDate: Mon Jun 17 08:56:05 2019 -0400 FindLAPACK: Test for implicitly linked LAPACK libraries Apply the change from commit 5b8f69ebe9 (FindBLAS: Detect implicitly linked BLAS library, 2018-08-28, v3.13.0-rc1~150^2~2), to FindLAPACK also. Typically both BLAS and LAPACK are provided the same way, e.g. in a Cray Compiler Environment. diff --git a/Modules/FindLAPACK.cmake b/Modules/FindLAPACK.cmake index c9c3cce..844d36d 100644 --- a/Modules/FindLAPACK.cmake +++ b/Modules/FindLAPACK.cmake @@ -173,11 +173,15 @@ if(_libraries_work) #message("DEBUG: ${LIBRARIES} = ${${LIBRARIES}}") endif() -if(_libraries_work) - set(${LIBRARIES} ${${LIBRARIES}} ${_blas} ${_threads}) -else() - set(${LIBRARIES} FALSE) -endif() + if(_libraries_work) + if("${_list}" STREQUAL "") + set(${LIBRARIES} "${LIBRARIES}-PLACEHOLDER-FOR-EMPTY-LIBRARIES") + else() + set(${LIBRARIES} ${${LIBRARIES}} ${_blas} ${_threads}) + endif() + else() + set(${LIBRARIES} FALSE) + endif() endmacro() @@ -206,6 +210,7 @@ if(BLAS_FOUND) #intel lapack if (BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All") + if(NOT LAPACK_LIBRARIES) if (NOT WIN32) set(LAPACK_mkl_LM "-lm") set(LAPACK_mkl_LDL "-ldl") @@ -280,6 +285,7 @@ if (BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All") unset(LAPACK_mkl_LM) unset(LAPACK_mkl_LDL) endif () + endif() endif() if (BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All") @@ -426,5 +432,11 @@ else() endif() endif() +# On compilers that implicitly link LAPACK (such as ftn, cc, and CC on Cray HPC machines) +# we used a placeholder for empty LAPACK_LIBRARIES to get through our logic above. +if (LAPACK_LIBRARIES STREQUAL "LAPACK_LIBRARIES-PLACEHOLDER-FOR-EMPTY-LIBRARIES") + set(LAPACK_LIBRARIES "") +endif() + cmake_pop_check_state() set(CMAKE_FIND_LIBRARY_SUFFIXES ${_lapack_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES}) https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=34a7e5ab587f5441ed5854b6ad9a159f3af88365 commit 34a7e5ab587f5441ed5854b6ad9a159f3af88365 Author: Jean-Christophe Fillion-Robin AuthorDate: Fri Jun 14 11:39:28 2019 -0400 Commit: Jean-Christophe Fillion-Robin CommitDate: Fri Jun 14 11:39:28 2019 -0400 Tests/Tutorial: Fix version displayed in tutorial executable diff --git a/Tests/Tutorial/Complete/tutorial.cxx b/Tests/Tutorial/Complete/tutorial.cxx index 443d195..4451cbd 100644 --- a/Tests/Tutorial/Complete/tutorial.cxx +++ b/Tests/Tutorial/Complete/tutorial.cxx @@ -10,7 +10,7 @@ int main(int argc, char* argv[]) { if (argc < 2) { std::cout << argv[0] << " Version " << Tutorial_VERSION_MAJOR << "." - << Tutorial_VERSION_MAJOR << std::endl; + << Tutorial_VERSION_MINOR << std::endl; std::cout << "Usage: " << argv[0] << " number" << std::endl; return 1; } diff --git a/Tests/Tutorial/MultiPackage/tutorial.cxx b/Tests/Tutorial/MultiPackage/tutorial.cxx index 443d195..4451cbd 100644 --- a/Tests/Tutorial/MultiPackage/tutorial.cxx +++ b/Tests/Tutorial/MultiPackage/tutorial.cxx @@ -10,7 +10,7 @@ int main(int argc, char* argv[]) { if (argc < 2) { std::cout << argv[0] << " Version " << Tutorial_VERSION_MAJOR << "." - << Tutorial_VERSION_MAJOR << std::endl; + << Tutorial_VERSION_MINOR << std::endl; std::cout << "Usage: " << argv[0] << " number" << std::endl; return 1; } diff --git a/Tests/Tutorial/Step10/tutorial.cxx b/Tests/Tutorial/Step10/tutorial.cxx index 443d195..4451cbd 100644 --- a/Tests/Tutorial/Step10/tutorial.cxx +++ b/Tests/Tutorial/Step10/tutorial.cxx @@ -10,7 +10,7 @@ int main(int argc, char* argv[]) { if (argc < 2) { std::cout << argv[0] << " Version " << Tutorial_VERSION_MAJOR << "." - << Tutorial_VERSION_MAJOR << std::endl; + << Tutorial_VERSION_MINOR << std::endl; std::cout << "Usage: " << argv[0] << " number" << std::endl; return 1; } diff --git a/Tests/Tutorial/Step11/tutorial.cxx b/Tests/Tutorial/Step11/tutorial.cxx index 3768855..38d4a79 100644 --- a/Tests/Tutorial/Step11/tutorial.cxx +++ b/Tests/Tutorial/Step11/tutorial.cxx @@ -10,7 +10,7 @@ int main(int argc, char* argv[]) { if (argc < 2) { std::cout << argv[0] << " Version " << Tutorial_VERSION_MAJOR << "." - << Tutorial_VERSION_MAJOR << std::endl; + << Tutorial_VERSION_MINOR << std::endl; std::cout << "Usage: " << argv[0] << " number" << std::endl; return 1; } diff --git a/Tests/Tutorial/Step2/tutorial.cxx b/Tests/Tutorial/Step2/tutorial.cxx index 75b7d67..5ba34e8 100644 --- a/Tests/Tutorial/Step2/tutorial.cxx +++ b/Tests/Tutorial/Step2/tutorial.cxx @@ -9,7 +9,7 @@ int main(int argc, char* argv[]) { if (argc < 2) { std::cout << argv[0] << " Version " << Tutorial_VERSION_MAJOR << "." - << Tutorial_VERSION_MAJOR << std::endl; + << Tutorial_VERSION_MINOR << std::endl; std::cout << "Usage: " << argv[0] << " number" << std::endl; return 1; } diff --git a/Tests/Tutorial/Step3/tutorial.cxx b/Tests/Tutorial/Step3/tutorial.cxx index 1d5742d..c2b89df 100644 --- a/Tests/Tutorial/Step3/tutorial.cxx +++ b/Tests/Tutorial/Step3/tutorial.cxx @@ -13,7 +13,7 @@ int main(int argc, char* argv[]) { if (argc < 2) { std::cout << argv[0] << " Version " << Tutorial_VERSION_MAJOR << "." - << Tutorial_VERSION_MAJOR << std::endl; + << Tutorial_VERSION_MINOR << std::endl; std::cout << "Usage: " << argv[0] << " number" << std::endl; return 1; } diff --git a/Tests/Tutorial/Step4/tutorial.cxx b/Tests/Tutorial/Step4/tutorial.cxx index 1d5742d..c2b89df 100644 --- a/Tests/Tutorial/Step4/tutorial.cxx +++ b/Tests/Tutorial/Step4/tutorial.cxx @@ -13,7 +13,7 @@ int main(int argc, char* argv[]) { if (argc < 2) { std::cout << argv[0] << " Version " << Tutorial_VERSION_MAJOR << "." - << Tutorial_VERSION_MAJOR << std::endl; + << Tutorial_VERSION_MINOR << std::endl; std::cout << "Usage: " << argv[0] << " number" << std::endl; return 1; } diff --git a/Tests/Tutorial/Step5/tutorial.cxx b/Tests/Tutorial/Step5/tutorial.cxx index 1d5742d..c2b89df 100644 --- a/Tests/Tutorial/Step5/tutorial.cxx +++ b/Tests/Tutorial/Step5/tutorial.cxx @@ -13,7 +13,7 @@ int main(int argc, char* argv[]) { if (argc < 2) { std::cout << argv[0] << " Version " << Tutorial_VERSION_MAJOR << "." - << Tutorial_VERSION_MAJOR << std::endl; + << Tutorial_VERSION_MINOR << std::endl; std::cout << "Usage: " << argv[0] << " number" << std::endl; return 1; } diff --git a/Tests/Tutorial/Step6/tutorial.cxx b/Tests/Tutorial/Step6/tutorial.cxx index 1d5742d..c2b89df 100644 --- a/Tests/Tutorial/Step6/tutorial.cxx +++ b/Tests/Tutorial/Step6/tutorial.cxx @@ -13,7 +13,7 @@ int main(int argc, char* argv[]) { if (argc < 2) { std::cout << argv[0] << " Version " << Tutorial_VERSION_MAJOR << "." - << Tutorial_VERSION_MAJOR << std::endl; + << Tutorial_VERSION_MINOR << std::endl; std::cout << "Usage: " << argv[0] << " number" << std::endl; return 1; } diff --git a/Tests/Tutorial/Step7/tutorial.cxx b/Tests/Tutorial/Step7/tutorial.cxx index 1d5742d..c2b89df 100644 --- a/Tests/Tutorial/Step7/tutorial.cxx +++ b/Tests/Tutorial/Step7/tutorial.cxx @@ -13,7 +13,7 @@ int main(int argc, char* argv[]) { if (argc < 2) { std::cout << argv[0] << " Version " << Tutorial_VERSION_MAJOR << "." - << Tutorial_VERSION_MAJOR << std::endl; + << Tutorial_VERSION_MINOR << std::endl; std::cout << "Usage: " << argv[0] << " number" << std::endl; return 1; } diff --git a/Tests/Tutorial/Step8/tutorial.cxx b/Tests/Tutorial/Step8/tutorial.cxx index 1d5742d..c2b89df 100644 --- a/Tests/Tutorial/Step8/tutorial.cxx +++ b/Tests/Tutorial/Step8/tutorial.cxx @@ -13,7 +13,7 @@ int main(int argc, char* argv[]) { if (argc < 2) { std::cout << argv[0] << " Version " << Tutorial_VERSION_MAJOR << "." - << Tutorial_VERSION_MAJOR << std::endl; + << Tutorial_VERSION_MINOR << std::endl; std::cout << "Usage: " << argv[0] << " number" << std::endl; return 1; } diff --git a/Tests/Tutorial/Step9/tutorial.cxx b/Tests/Tutorial/Step9/tutorial.cxx index 73e67a9..6c41859 100644 --- a/Tests/Tutorial/Step9/tutorial.cxx +++ b/Tests/Tutorial/Step9/tutorial.cxx @@ -14,7 +14,7 @@ int main(int argc, char* argv[]) { if (argc < 2) { std::cout << argv[0] << " Version " << Tutorial_VERSION_MAJOR << "." - << Tutorial_VERSION_MAJOR << std::endl; + << Tutorial_VERSION_MINOR << std::endl; std::cout << "Usage: " << argv[0] << " number" << std::endl; return 1; } ----------------------------------------------------------------------- Summary of changes: Help/variable/CMAKE_PROJECT_INCLUDE.rst | 9 ++++-- Help/variable/CMAKE_PROJECT_INCLUDE_BEFORE.rst | 9 ++++-- .../CMAKE_PROJECT_PROJECT-NAME_INCLUDE.rst | 10 +++++-- Modules/Compiler/GNU-CXX-FeatureTests.cmake | 4 +-- Modules/FindLAPACK.cmake | 22 ++++++++++---- Source/cmLinkLineComputer.cxx | 34 +++++++++++++++++----- Tests/Tutorial/Complete/tutorial.cxx | 2 +- Tests/Tutorial/MultiPackage/tutorial.cxx | 2 +- Tests/Tutorial/Step10/tutorial.cxx | 2 +- Tests/Tutorial/Step11/tutorial.cxx | 2 +- Tests/Tutorial/Step2/tutorial.cxx | 2 +- Tests/Tutorial/Step3/tutorial.cxx | 2 +- Tests/Tutorial/Step4/tutorial.cxx | 2 +- Tests/Tutorial/Step5/tutorial.cxx | 2 +- Tests/Tutorial/Step6/tutorial.cxx | 2 +- Tests/Tutorial/Step7/tutorial.cxx | 2 +- Tests/Tutorial/Step8/tutorial.cxx | 2 +- Tests/Tutorial/Step9/tutorial.cxx | 2 +- 18 files changed, 77 insertions(+), 35 deletions(-) hooks/post-receive -- CMake From kwrobot at kitware.com Wed Jun 19 00:03:07 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Wed, 19 Jun 2019 00:03:07 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc1-105-gc9f284c Message-ID: <20190619040307.AEE9510F15B@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via c9f284c73634b7935a12c1912dbb8eae71650ae5 (commit) from 0a104224182565645b6bb8a1f81031c5afdc67ed (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c9f284c73634b7935a12c1912dbb8eae71650ae5 commit c9f284c73634b7935a12c1912dbb8eae71650ae5 Author: Kitware Robot AuthorDate: Wed Jun 19 00:01:05 2019 -0400 Commit: Kitware Robot CommitDate: Wed Jun 19 00:01:05 2019 -0400 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 9bef298..e9e4c29 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 15) -set(CMake_VERSION_PATCH 20190618) +set(CMake_VERSION_PATCH 20190619) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From kwrobot at kitware.com Wed Jun 19 07:23:10 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Wed, 19 Jun 2019 07:23:10 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc1-115-ga5d4457 Message-ID: <20190619112311.070F8125D04@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via a5d44570832414be3879a8e77f6079811619f1fc (commit) via a7e34e6952cf6c74ce2d30824fb460155f743e99 (commit) via 7c7c8a01c54ff6c18b3fa944a9ac47c01defb608 (commit) via 421be81413a6020193716a5416da1a060daefbd4 (commit) via 65fc109dc62ef4853c010e06a938069e0bfc8c50 (commit) via 830b332f32ac0782fe3380eb7b0b55fa8f81f456 (commit) via 0dd6772a89df2e7640187028573f7d981bbd0f67 (commit) via e4181eeaf2c6f5204443177fe71176ed94977c1b (commit) via 4cb652e1d35d5ea98cde36b8a877e43ad3e71a0d (commit) via 7251d54bd104680317c58e08d3244b57ca5b57b0 (commit) from c9f284c73634b7935a12c1912dbb8eae71650ae5 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a5d44570832414be3879a8e77f6079811619f1fc commit a5d44570832414be3879a8e77f6079811619f1fc Merge: a7e34e6 421be81 Author: Brad King AuthorDate: Wed Jun 19 11:22:39 2019 +0000 Commit: Kitware Robot CommitDate: Wed Jun 19 07:22:50 2019 -0400 Merge topic 'FindCUDA-more-libs' 421be81413 FindCUDA: Add nvToolsExt and OpenCL libraries Acked-by: Kitware Robot Merge-request: !3456 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a7e34e6952cf6c74ce2d30824fb460155f743e99 commit a7e34e6952cf6c74ce2d30824fb460155f743e99 Merge: 7c7c8a0 65fc109 Author: Brad King AuthorDate: Wed Jun 19 07:22:18 2019 -0400 Commit: Brad King CommitDate: Wed Jun 19 07:22:18 2019 -0400 Merge branch 'release-3.15' https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7c7c8a01c54ff6c18b3fa944a9ac47c01defb608 commit 7c7c8a01c54ff6c18b3fa944a9ac47c01defb608 Merge: c9f284c 830b332 Author: Brad King AuthorDate: Wed Jun 19 11:19:12 2019 +0000 Commit: Kitware Robot CommitDate: Wed Jun 19 07:21:02 2019 -0400 Merge topic 'FindBoost-component' 830b332f32 FindBoost: Add tests for legacy variables 0dd6772a89 FindBoost: Add legacy variables and targets for compatibility e4181eeaf2 FindBoost: Don't overwrite Boost_${_comp}_FOUND 4cb652e1d3 Tests.RunCMake.FindBoost: Fix example BoostConfig 7251d54bd1 Tests.FindBoost: Don't use BoostConfig in MODULE test Acked-by: Kitware Robot Merge-request: !3438 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=421be81413a6020193716a5416da1a060daefbd4 commit 421be81413a6020193716a5416da1a060daefbd4 Author: Eyal Rozenberg AuthorDate: Mon Jun 17 21:22:14 2019 +0300 Commit: Brad King CommitDate: Tue Jun 18 08:56:34 2019 -0400 FindCUDA: Add nvToolsExt and OpenCL libraries Find these libraries with CUDA 5 and above. Fixes: #19386 diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake index 3315505..b6859aa 100644 --- a/Modules/FindCUDA.cmake +++ b/Modules/FindCUDA.cmake @@ -375,6 +375,11 @@ The script defines the following variables:: CUDA_nvcuvid_LIBRARY -- CUDA Video Decoder library. Only available for CUDA version 3.2+. Windows only. + CUDA_nvToolsExt_LIBRARY + -- NVIDA CUDA Tools Extension library. + Available for CUDA version 5+. + CUDA_OpenCL_LIBRARY -- NVIDA CUDA OpenCL library. + Available for CUDA version 5+. #]=======================================================================] @@ -642,6 +647,8 @@ macro(cuda_unset_include_and_libraries) unset(CUDA_npps_LIBRARY CACHE) unset(CUDA_nvcuvenc_LIBRARY CACHE) unset(CUDA_nvcuvid_LIBRARY CACHE) + unset(CUDA_nvToolsExt_LIBRARY CACHE) + unset(CUDA_OpenCL_LIBRARY CACHE) unset(CUDA_GPU_DETECT_OUTPUT CACHE) endmacro() @@ -973,6 +980,11 @@ if(CUDA_VERSION VERSION_GREATER "5.0" AND CUDA_VERSION VERSION_LESS "9.2") find_cuda_helper_libs(cublas_device) endif() +if(NOT CUDA_VERSION VERSION_LESS "5.0") + find_cuda_helper_libs(nvToolsExt) + find_cuda_helper_libs(OpenCL) +endif() + if(NOT CUDA_VERSION VERSION_LESS "9.0") # In CUDA 9.0 NPP was nppi was removed find_cuda_helper_libs(nppc) ----------------------------------------------------------------------- Summary of changes: Modules/FindBoost.cmake | 162 ++++++++++++++++++++- Modules/FindCUDA.cmake | 12 ++ Tests/FindBoost/Test/CMakeLists.txt | 1 + .../FindBoost/CMakePackage/BoostConfig.cmake | 3 + .../BoostConfig.cmake | 26 ++++ .../BoostConfigVersion.cmake | 7 + .../include/boost/version.hpp | 34 +++++ .../CMakePackage_MissingTarget/BoostConfig.cmake | 7 + .../BoostConfigVersion.cmake | 7 + .../include/boost/version.hpp | 34 +++++ .../FindBoost/CMakePackage_New/BoostConfig.cmake | 24 +++ .../CMakePackage_New/BoostConfigVersion.cmake | 7 + .../CMakePackage_New/include/boost/version.hpp | 34 +++++ .../CMakePackage_New/lib/libboost_date_time.a} | 0 .../CMakePackage_New/lib/libboost_mpi_python.a} | 0 .../CMakePackage_New/lib/libboost_python.a} | 0 .../lib/libboost_python_release.a} | 0 .../CMakePackage_NoHeaderTarget/BoostConfig.cmake | 25 ++++ .../BoostConfigVersion.cmake | 7 + .../include/boost/version.hpp | 34 +++++ .../LegacyVars-LowercaseTargetPrefix-stdout.txt | 34 +++++ .../LegacyVars-LowercaseTargetPrefix.cmake | 6 + .../FindBoost/LegacyVars-NoHeaderTarget.cmake | 6 + .../FindBoost/LegacyVars-TargetsDefined-stdout.txt | 34 +++++ .../FindBoost/LegacyVars-TargetsDefined.cmake | 6 + Tests/RunCMake/FindBoost/LegacyVars.cmake | 28 ++++ Tests/RunCMake/FindBoost/MissingTarget-stdout.txt | 22 +++ Tests/RunCMake/FindBoost/MissingTarget.cmake | 25 ++++ Tests/RunCMake/FindBoost/RunCMakeTest.cmake | 8 + 29 files changed, 588 insertions(+), 5 deletions(-) create mode 100644 Tests/RunCMake/FindBoost/CMakePackage_LowerCaseTargetPrefix/BoostConfig.cmake create mode 100644 Tests/RunCMake/FindBoost/CMakePackage_LowerCaseTargetPrefix/BoostConfigVersion.cmake create mode 100644 Tests/RunCMake/FindBoost/CMakePackage_LowerCaseTargetPrefix/include/boost/version.hpp create mode 100644 Tests/RunCMake/FindBoost/CMakePackage_MissingTarget/BoostConfig.cmake create mode 100644 Tests/RunCMake/FindBoost/CMakePackage_MissingTarget/BoostConfigVersion.cmake create mode 100644 Tests/RunCMake/FindBoost/CMakePackage_MissingTarget/include/boost/version.hpp create mode 100644 Tests/RunCMake/FindBoost/CMakePackage_New/BoostConfig.cmake create mode 100644 Tests/RunCMake/FindBoost/CMakePackage_New/BoostConfigVersion.cmake create mode 100644 Tests/RunCMake/FindBoost/CMakePackage_New/include/boost/version.hpp copy Tests/{Wrapping/vtkIncluded.cxx => RunCMake/FindBoost/CMakePackage_New/lib/libboost_date_time.a} (100%) copy Tests/{Wrapping/vtkIncluded.cxx => RunCMake/FindBoost/CMakePackage_New/lib/libboost_mpi_python.a} (100%) copy Tests/{Wrapping/vtkIncluded.cxx => RunCMake/FindBoost/CMakePackage_New/lib/libboost_python.a} (100%) copy Tests/{Wrapping/vtkIncluded.cxx => RunCMake/FindBoost/CMakePackage_New/lib/libboost_python_release.a} (100%) create mode 100644 Tests/RunCMake/FindBoost/CMakePackage_NoHeaderTarget/BoostConfig.cmake create mode 100644 Tests/RunCMake/FindBoost/CMakePackage_NoHeaderTarget/BoostConfigVersion.cmake create mode 100644 Tests/RunCMake/FindBoost/CMakePackage_NoHeaderTarget/include/boost/version.hpp create mode 100644 Tests/RunCMake/FindBoost/LegacyVars-LowercaseTargetPrefix-stdout.txt create mode 100644 Tests/RunCMake/FindBoost/LegacyVars-LowercaseTargetPrefix.cmake create mode 100644 Tests/RunCMake/FindBoost/LegacyVars-NoHeaderTarget.cmake create mode 100644 Tests/RunCMake/FindBoost/LegacyVars-TargetsDefined-stdout.txt create mode 100644 Tests/RunCMake/FindBoost/LegacyVars-TargetsDefined.cmake create mode 100644 Tests/RunCMake/FindBoost/LegacyVars.cmake create mode 100644 Tests/RunCMake/FindBoost/MissingTarget-stdout.txt create mode 100644 Tests/RunCMake/FindBoost/MissingTarget.cmake hooks/post-receive -- CMake From kwrobot at kitware.com Wed Jun 19 07:23:11 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Wed, 19 Jun 2019 07:23:11 -0400 (EDT) Subject: [Cmake-commits] CMake branch, release, updated. v3.15.0-rc1-33-g65fc109 Message-ID: <20190619112311.12CE7125889@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, release has been updated via 65fc109dc62ef4853c010e06a938069e0bfc8c50 (commit) via 830b332f32ac0782fe3380eb7b0b55fa8f81f456 (commit) via 0dd6772a89df2e7640187028573f7d981bbd0f67 (commit) via e4181eeaf2c6f5204443177fe71176ed94977c1b (commit) via 4cb652e1d35d5ea98cde36b8a877e43ad3e71a0d (commit) via 7251d54bd104680317c58e08d3244b57ca5b57b0 (commit) from e2b4fa114184a0a8eeec9c8005e09f70a8ae6832 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- ----------------------------------------------------------------------- Summary of changes: Modules/FindBoost.cmake | 162 ++++++++++++++++++++- Tests/FindBoost/Test/CMakeLists.txt | 1 + .../FindBoost/CMakePackage/BoostConfig.cmake | 3 + .../BoostConfig.cmake | 26 ++++ .../BoostConfigVersion.cmake | 7 + .../include/boost/version.hpp | 34 +++++ .../CMakePackage_MissingTarget/BoostConfig.cmake | 7 + .../BoostConfigVersion.cmake | 7 + .../include/boost/version.hpp | 34 +++++ .../FindBoost/CMakePackage_New/BoostConfig.cmake | 24 +++ .../CMakePackage_New/BoostConfigVersion.cmake | 7 + .../CMakePackage_New/include/boost/version.hpp | 34 +++++ .../CMakePackage_New/lib/libboost_date_time.a} | 0 .../CMakePackage_New/lib/libboost_mpi_python.a} | 0 .../CMakePackage_New/lib/libboost_python.a} | 0 .../lib/libboost_python_release.a} | 0 .../CMakePackage_NoHeaderTarget/BoostConfig.cmake | 25 ++++ .../BoostConfigVersion.cmake | 7 + .../include/boost/version.hpp | 34 +++++ .../LegacyVars-LowercaseTargetPrefix-stdout.txt | 34 +++++ .../LegacyVars-LowercaseTargetPrefix.cmake | 6 + .../FindBoost/LegacyVars-NoHeaderTarget.cmake | 6 + .../FindBoost/LegacyVars-TargetsDefined-stdout.txt | 34 +++++ .../FindBoost/LegacyVars-TargetsDefined.cmake | 6 + Tests/RunCMake/FindBoost/LegacyVars.cmake | 28 ++++ Tests/RunCMake/FindBoost/MissingTarget-stdout.txt | 22 +++ Tests/RunCMake/FindBoost/MissingTarget.cmake | 25 ++++ Tests/RunCMake/FindBoost/RunCMakeTest.cmake | 8 + 28 files changed, 576 insertions(+), 5 deletions(-) create mode 100644 Tests/RunCMake/FindBoost/CMakePackage_LowerCaseTargetPrefix/BoostConfig.cmake create mode 100644 Tests/RunCMake/FindBoost/CMakePackage_LowerCaseTargetPrefix/BoostConfigVersion.cmake create mode 100644 Tests/RunCMake/FindBoost/CMakePackage_LowerCaseTargetPrefix/include/boost/version.hpp create mode 100644 Tests/RunCMake/FindBoost/CMakePackage_MissingTarget/BoostConfig.cmake create mode 100644 Tests/RunCMake/FindBoost/CMakePackage_MissingTarget/BoostConfigVersion.cmake create mode 100644 Tests/RunCMake/FindBoost/CMakePackage_MissingTarget/include/boost/version.hpp create mode 100644 Tests/RunCMake/FindBoost/CMakePackage_New/BoostConfig.cmake create mode 100644 Tests/RunCMake/FindBoost/CMakePackage_New/BoostConfigVersion.cmake create mode 100644 Tests/RunCMake/FindBoost/CMakePackage_New/include/boost/version.hpp copy Tests/{Wrapping/vtkIncluded.cxx => RunCMake/FindBoost/CMakePackage_New/lib/libboost_date_time.a} (100%) copy Tests/{Wrapping/vtkIncluded.cxx => RunCMake/FindBoost/CMakePackage_New/lib/libboost_mpi_python.a} (100%) copy Tests/{Wrapping/vtkIncluded.cxx => RunCMake/FindBoost/CMakePackage_New/lib/libboost_python.a} (100%) copy Tests/{Wrapping/vtkIncluded.cxx => RunCMake/FindBoost/CMakePackage_New/lib/libboost_python_release.a} (100%) create mode 100644 Tests/RunCMake/FindBoost/CMakePackage_NoHeaderTarget/BoostConfig.cmake create mode 100644 Tests/RunCMake/FindBoost/CMakePackage_NoHeaderTarget/BoostConfigVersion.cmake create mode 100644 Tests/RunCMake/FindBoost/CMakePackage_NoHeaderTarget/include/boost/version.hpp create mode 100644 Tests/RunCMake/FindBoost/LegacyVars-LowercaseTargetPrefix-stdout.txt create mode 100644 Tests/RunCMake/FindBoost/LegacyVars-LowercaseTargetPrefix.cmake create mode 100644 Tests/RunCMake/FindBoost/LegacyVars-NoHeaderTarget.cmake create mode 100644 Tests/RunCMake/FindBoost/LegacyVars-TargetsDefined-stdout.txt create mode 100644 Tests/RunCMake/FindBoost/LegacyVars-TargetsDefined.cmake create mode 100644 Tests/RunCMake/FindBoost/LegacyVars.cmake create mode 100644 Tests/RunCMake/FindBoost/MissingTarget-stdout.txt create mode 100644 Tests/RunCMake/FindBoost/MissingTarget.cmake hooks/post-receive -- CMake From kwrobot at kitware.com Wed Jun 19 07:33:08 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Wed, 19 Jun 2019 07:33:08 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc1-121-g7ccd9a2 Message-ID: <20190619113308.BDA501275AF@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 7ccd9a27df8649c17d7b6925851d4e258ea913d9 (commit) via 1ca4be5d90b47894f6742d390796ec3b08001906 (commit) via 89e80933d60766e50855f6e7d9b43d6515f6ee30 (commit) via f7eaa342de316707d99e6ae29c693a480861560d (commit) via 631fe145e68cddd98fb42636833549d14113aa0d (commit) via 5d8f1a8421367aab8fc81b43a8f999862aa42190 (commit) from a5d44570832414be3879a8e77f6079811619f1fc (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7ccd9a27df8649c17d7b6925851d4e258ea913d9 commit 7ccd9a27df8649c17d7b6925851d4e258ea913d9 Merge: 89e8093 1ca4be5 Author: Brad King AuthorDate: Wed Jun 19 07:27:14 2019 -0400 Commit: Brad King CommitDate: Wed Jun 19 07:27:14 2019 -0400 Merge branch 'release-3.15' https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=89e80933d60766e50855f6e7d9b43d6515f6ee30 commit 89e80933d60766e50855f6e7d9b43d6515f6ee30 Merge: 631fe14 f7eaa34 Author: Brad King AuthorDate: Wed Jun 19 11:25:56 2019 +0000 Commit: Kitware Robot CommitDate: Wed Jun 19 07:26:04 2019 -0400 Merge topic 'FindMPI-imported-link-flags' f7eaa342de FindMPI: Store imported target link flags as a list instead of a string Acked-by: Kitware Robot Merge-request: !3449 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=631fe145e68cddd98fb42636833549d14113aa0d commit 631fe145e68cddd98fb42636833549d14113aa0d Merge: a5d4457 5d8f1a8 Author: Brad King AuthorDate: Wed Jun 19 11:23:20 2019 +0000 Commit: Kitware Robot CommitDate: Wed Jun 19 07:23:40 2019 -0400 Merge topic 'generated_export_remove_duplicate_required_cmake_lines' 5d8f1a8421 Export: A singular CMake version written for interface targets Acked-by: Kitware Robot Merge-request: !3458 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5d8f1a8421367aab8fc81b43a8f999862aa42190 commit 5d8f1a8421367aab8fc81b43a8f999862aa42190 Author: Robert Maynard AuthorDate: Mon Jun 17 17:30:34 2019 -0400 Commit: Robert Maynard CommitDate: Mon Jun 17 17:38:46 2019 -0400 Export: A singular CMake version written for interface targets diff --git a/Source/cmExportBuildFileGenerator.cxx b/Source/cmExportBuildFileGenerator.cxx index 012355b..3fe84a9 100644 --- a/Source/cmExportBuildFileGenerator.cxx +++ b/Source/cmExportBuildFileGenerator.cxx @@ -45,6 +45,7 @@ bool cmExportBuildFileGenerator::GenerateMainFile(std::ostream& os) std::string expectedTargets; std::string sep; std::vector targets; + bool generatedInterfaceRequired = false; this->GetTargets(targets); for (std::string const& tei : targets) { cmGeneratorTarget* te = this->LG->FindGeneratorTargetToUse(tei); @@ -60,11 +61,13 @@ bool cmExportBuildFileGenerator::GenerateMainFile(std::ostream& os) this->LG->GetMakefile()->GetBacktrace()); return false; } - if (this->GetExportTargetType(te) == cmStateEnums::INTERFACE_LIBRARY) { - this->GenerateRequiredCMakeVersion(os, "3.0.0"); - } + generatedInterfaceRequired |= + this->GetExportTargetType(te) == cmStateEnums::INTERFACE_LIBRARY; } + if (generatedInterfaceRequired) { + this->GenerateRequiredCMakeVersion(os, "3.0.0"); + } this->GenerateExpectedTargetsCode(os, expectedTargets); } ----------------------------------------------------------------------- Summary of changes: Modules/FindMPI.cmake | 4 +++- Source/cmExportBuildFileGenerator.cxx | 9 ++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) hooks/post-receive -- CMake From kwrobot at kitware.com Wed Jun 19 07:33:08 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Wed, 19 Jun 2019 07:33:08 -0400 (EDT) Subject: [Cmake-commits] CMake branch, release, updated. v3.15.0-rc1-35-g1ca4be5 Message-ID: <20190619113309.16269127775@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, release has been updated via 1ca4be5d90b47894f6742d390796ec3b08001906 (commit) via f7eaa342de316707d99e6ae29c693a480861560d (commit) from 65fc109dc62ef4853c010e06a938069e0bfc8c50 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- ----------------------------------------------------------------------- Summary of changes: Modules/FindMPI.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) hooks/post-receive -- CMake From kwrobot at kitware.com Wed Jun 19 08:23:09 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Wed, 19 Jun 2019 08:23:09 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc1-123-g5773f12 Message-ID: <20190619122309.D158CF8929@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 5773f12d849815c0a61f09e622e90dd56fb4f333 (commit) via 9e99a95c7db5be8c6b979b0170ab4cf78bb32307 (commit) from 7ccd9a27df8649c17d7b6925851d4e258ea913d9 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5773f12d849815c0a61f09e622e90dd56fb4f333 commit 5773f12d849815c0a61f09e622e90dd56fb4f333 Merge: 7ccd9a2 9e99a95 Author: Brad King AuthorDate: Wed Jun 19 12:22:05 2019 +0000 Commit: Kitware Robot CommitDate: Wed Jun 19 08:22:17 2019 -0400 Merge topic 'android-pie-cmp0083' 9e99a95c7d Android: ensure PIE behavior is consistent regardless CMP0083 policy Acked-by: Kitware Robot Merge-request: !3459 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9e99a95c7db5be8c6b979b0170ab4cf78bb32307 commit 9e99a95c7db5be8c6b979b0170ab4cf78bb32307 Author: Marc Chevrier AuthorDate: Tue Jun 18 17:34:19 2019 +0200 Commit: Brad King CommitDate: Wed Jun 19 08:12:45 2019 -0400 Android: ensure PIE behavior is consistent regardless CMP0083 policy In commit c4b4d8b3a6 (POSITION_INDEPENDENT_CODE: Manage link flags for executables, 2018-10-02, v3.14.0-rc1~395^2) we accidentally removed our Android-specific logic for PIE under the CMP0083 OLD behavior. Restore it and also implement Android-specific logic for CMP0083 NEW behavior. Fixes: #19393 diff --git a/Help/policy/CMP0083.rst b/Help/policy/CMP0083.rst index 32acf1f..e0b09cf 100644 --- a/Help/policy/CMP0083.rst +++ b/Help/policy/CMP0083.rst @@ -28,6 +28,12 @@ This policy was introduced in CMake version 3.14. Use the Unlike most policies, CMake version |release| does not warn when this policy is not set and simply uses ``OLD`` behavior. +.. Note:: + + Android platform has a special handling of ``PIE`` so it is not required + to use the :module:`CheckPIESupported` module to ensure flags are passed to + the linker. + .. include:: DEPRECATED.txt Examples diff --git a/Modules/Platform/Android/abi-common.cmake b/Modules/Platform/Android/abi-common.cmake index a0b47f4..6bce3c7 100644 --- a/Modules/Platform/Android/abi-common.cmake +++ b/Modules/Platform/Android/abi-common.cmake @@ -12,6 +12,26 @@ if(NOT DEFINED CMAKE_POSITION_INDEPENDENT_CODE set(CMAKE_POSITION_INDEPENDENT_CODE ON) endif() +cmake_policy(GET CMP0083 _CMP0083) +if(_CMP0083 STREQUAL NEW) + # PIE Flags are managed by compiler configuration files + if(CMAKE_SYSTEM_VERSION VERSION_GREATER_EQUAL 16) + # ensure PIE flags are passed to the linker + set(CMAKE_C_LINK_PIE_SUPPORTED YES CACHE INTERNAL "PIE (C)") + set(CMAKE_CXX_LINK_PIE_SUPPORTED YES CACHE INTERNAL "PIE (CXX)") + if(CMAKE_SYSTEM_VERSION VERSION_GREATER_EQUAL 21) + # no PIE executable are no longer supported + set(CMAKE_C_LINK_NO_PIE_SUPPORTED NO CACHE INTERNAL "NO_PIE (C)") + set(CMAKE_CXX_LINK_NO_PIE_SUPPORTED NO CACHE INTERNAL "NO_PIE (CXX)") + endif() + endif() +else() + if(CMAKE_POSITION_INDEPENDENT_CODE) + string(APPEND _ANDROID_ABI_INIT_EXE_LDFLAGS " -fPIE -pie") + endif() +endif() +unset(_CMP0083) + string(APPEND _ANDROID_ABI_INIT_EXE_LDFLAGS " -Wl,--gc-sections") if(NOT _ANDROID_ABI_INIT_EXE_LDFLAGS_NO_nocopyreloc) ----------------------------------------------------------------------- Summary of changes: Help/policy/CMP0083.rst | 6 ++++++ Modules/Platform/Android/abi-common.cmake | 20 ++++++++++++++++++++ 2 files changed, 26 insertions(+) hooks/post-receive -- CMake From kwrobot at kitware.com Wed Jun 19 08:33:05 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Wed, 19 Jun 2019 08:33:05 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc1-127-g6425a5f Message-ID: <20190619123305.1812EFBE99@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 6425a5f3a06459914cca17172e2b6f557e7d79a4 (commit) via 08f935536780d54e1a678fe3e1ff590e90edb424 (commit) via 00ad0b9d127fb0587443c6346aacb72a5c96f234 (commit) via c54fc8213bfbd33b9584188b90cd494e2bf515db (commit) from 5773f12d849815c0a61f09e622e90dd56fb4f333 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6425a5f3a06459914cca17172e2b6f557e7d79a4 commit 6425a5f3a06459914cca17172e2b6f557e7d79a4 Merge: 08f9355 00ad0b9 Author: Brad King AuthorDate: Wed Jun 19 08:23:31 2019 -0400 Commit: Brad King CommitDate: Wed Jun 19 08:23:31 2019 -0400 Merge branch 'release-3.15' https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=08f935536780d54e1a678fe3e1ff590e90edb424 commit 08f935536780d54e1a678fe3e1ff590e90edb424 Merge: 5773f12 c54fc82 Author: Brad King AuthorDate: Wed Jun 19 08:23:27 2019 -0400 Commit: Brad King CommitDate: Wed Jun 19 08:23:27 2019 -0400 Merge branch 'release-3.14' https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c54fc8213bfbd33b9584188b90cd494e2bf515db commit c54fc8213bfbd33b9584188b90cd494e2bf515db Merge: f3e9a6f 9e99a95 Author: Brad King AuthorDate: Wed Jun 19 08:20:25 2019 -0400 Commit: Brad King CommitDate: Wed Jun 19 08:20:25 2019 -0400 Merge branch 'android-pie-cmp0083' into release-3.14 Merge-request: !3459 ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From kwrobot at kitware.com Wed Jun 19 08:33:05 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Wed, 19 Jun 2019 08:33:05 -0400 (EDT) Subject: [Cmake-commits] CMake branch, release, updated. v3.15.0-rc1-37-g00ad0b9 Message-ID: <20190619123305.2B705FBE99@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, release has been updated via 00ad0b9d127fb0587443c6346aacb72a5c96f234 (commit) via 9e99a95c7db5be8c6b979b0170ab4cf78bb32307 (commit) from 1ca4be5d90b47894f6742d390796ec3b08001906 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- ----------------------------------------------------------------------- Summary of changes: Help/policy/CMP0083.rst | 6 ++++++ Modules/Platform/Android/abi-common.cmake | 20 ++++++++++++++++++++ 2 files changed, 26 insertions(+) hooks/post-receive -- CMake From kwrobot at kitware.com Wed Jun 19 09:53:06 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Wed, 19 Jun 2019 09:53:06 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc2-91-g90bd7d0 Message-ID: <20190619135306.5FE7810D3B3@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 90bd7d0ecf02688afb36257deb35699fd86ca781 (commit) via 5c7880956f9b3daea561c7bf817b27aa47b53dd0 (commit) from 6425a5f3a06459914cca17172e2b6f557e7d79a4 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=90bd7d0ecf02688afb36257deb35699fd86ca781 commit 90bd7d0ecf02688afb36257deb35699fd86ca781 Merge: 6425a5f 5c78809 Author: Brad King AuthorDate: Wed Jun 19 09:46:45 2019 -0400 Commit: Brad King CommitDate: Wed Jun 19 09:46:45 2019 -0400 Merge branch 'release-3.15' ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From kwrobot at kitware.com Wed Jun 19 09:53:06 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Wed, 19 Jun 2019 09:53:06 -0400 (EDT) Subject: [Cmake-commits] CMake branch, release, updated. v3.15.0-rc2 Message-ID: <20190619135306.6EC4910DC9B@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, release has been updated via 5c7880956f9b3daea561c7bf817b27aa47b53dd0 (commit) from 00ad0b9d127fb0587443c6346aacb72a5c96f234 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From kwrobot at kitware.com Wed Jun 19 09:53:06 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Wed, 19 Jun 2019 09:53:06 -0400 (EDT) Subject: [Cmake-commits] CMake annotated tag, v3.15.0-rc2, created. v3.15.0-rc2 Message-ID: <20190619135306.835CC10D3B3@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The annotated tag, v3.15.0-rc2 has been created at 7410b254c77670dc1eff7e68c36c819ae48beff5 (tag) tagging 5c7880956f9b3daea561c7bf817b27aa47b53dd0 (commit) replaces v3.15.0-rc1 tagged by Brad King on Wed Jun 19 09:45:33 2019 -0400 - Log ----------------------------------------------------------------- CMake 3.15.0-rc2 -----BEGIN PGP SIGNATURE----- iQJKBAABCgA0FiEExsJlMku+vcNQtRPQLSzvEDSSFoQFAl0KPH0WHGJyYWQua2lu Z0BraXR3YXJlLmNvbQAKCRAtLO8QNJIWhJv/D/0YQBJ5rol/HCahNZ1ZZu4sJLGW SoxLbIYoG8FZV6XMa+JrddzB1+9scS10glRSlfOadqlf91hAk6Z7KAjspQ3nANUA l9jGdg+GKbceLXA+vG9TUt2uct55AFa23L6H5rXPlivhSYCU11ztZJA5GW18tDTP ZB5CWFSaSHDcYS6qK7oDNuKzFlA1gTP1ZO2HI1tfQ983q+sHaQ+hAJg5M/5ZkwaP hm1cduJJdNxEiCsjggziHC85CllulukwwfrJLlv1epJfWD1KoK7GXN/8j8fMzc56 cp7pbeooUi959OnPw8YDbdlLJreQMx3ISvN8tvF3lx4Rboc5DGtZLbcWvmuhXPyt xlmxawQRZwuOtO4FGXqgC85QRHKoIyB1SGJ0dpJvL8jCMN9NuzaH9JR3w037pv2k nIqN0oH4pvUSjpzaebtfu8srRerFx3Ljk6tBXT5tAbrRAkexEvDajB9bH42LZizx eMYYtve2b3vDblSEQSa/g6YgcKUkRlvccZhN4L9/mOHA17tjgDSyGE2EboR1bN2V 5pPf//DPh0c5tHFd6Hy9EtKsjjiPzzHnSlSfaqvaUi5Q+l79cEd685h8sAsdxSPB ihLrMo2Rp6pHgd2YHLIqCHGmCrx3YiiqzpsiUM+NeHByx9GtukOzYhXM9mAnMsaH KIj55949YwAwftq7OA== =CC/y -----END PGP SIGNATURE----- Alexander Grund (5): Tests.FindBoost: Don't use BoostConfig in MODULE test Tests.RunCMake.FindBoost: Fix example BoostConfig FindBoost: Don't overwrite Boost_${_comp}_FOUND FindBoost: Add legacy variables and targets for compatibility FindBoost: Add tests for legacy variables Alexander Neumann (1): FindBLAS: Add second try for OpenBLAS with thread libraries. Brad King (21): Merge branch 'doc-FindEnvModule-typos' into release-3.15 Merge branch 'cpack-nuget-case' into release-3.15 Help: Document XLClang compiler id Merge branch 'doc-xlclang-id' into release-3.15 fileapi: Factor out helper to construct a version object cmake: Simplify implementation of -E capabilities cmake: Teach -E capabilities to report supported fileapi requests Merge branch 'autogen_header_in_symbolic_path_fix' into release-3.15 Merge branch 'capabilities-fileapi' into release-3.15 Merge branch 'CheckCXXSymbolExists-xref' into release-3.15 cmake-gui: Update Qt copyright holder in About dialog fileapi: Suppress lint warning about non-move with old jsoncpp Merge branch 'capabilities-fileapi' into release-3.15 Merge branch 'find_package_prefer_config_fix' into release-3.15 Merge branch 'FindBLAS-OpenBLAS-thread' into release-3.15 Help: Document what project() calls use CMAKE_PROJECT_INCLUDE and friends Merge branch 'doc-project-include' into release-3.15 Merge branch 'FindBoost-component' into release-3.15 Merge branch 'FindMPI-imported-link-flags' into release-3.15 Merge branch 'android-pie-cmp0083' into release-3.15 CMake 3.15.0-rc2 Craig Scott (4): Help: Trivial typo and grammar fixes for FindEnvModules Help: Move ADDITIONAL_MAKE_CLEAN_FILES dir prop to deprecated section Merge branch 'additional_clean_files_help' into release-3.15 Merge branch 'cmake-gui-qt-notice' into release-3.15 Cristian Adam (1): find_package: Fixed CMAKE_FIND_PACKAGE_PREFER_CONFIG Module fallback Marc Chevrier (1): Android: ensure PIE behavior is consistent regardless CMP0083 policy Mathieu Malaterre (1): CPack/NuGet: Find nuget tool on case sensitive file system Robert Maynard (1): FindMPI: Store imported target link flags as a list instead of a string Rolf Eike Beer (1): CheckCXXSymbolExists: reference to CheckCXXSourceCompiles instead of C version Sebastian Holtermann (2): Autogen: Fix header detection for paths with symbolic links Help: Improve ADDITIONAL_CLEAN_FILES documentation ----------------------------------------------------------------------- hooks/post-receive -- CMake From kwrobot at kitware.com Thu Jun 20 00:03:08 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Thu, 20 Jun 2019 00:03:08 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc2-92-g3e1dac7 Message-ID: <20190620040308.49503AECAF@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 3e1dac739155cdbc05dc8a1e328c029af28f614b (commit) from 90bd7d0ecf02688afb36257deb35699fd86ca781 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3e1dac739155cdbc05dc8a1e328c029af28f614b commit 3e1dac739155cdbc05dc8a1e328c029af28f614b Author: Kitware Robot AuthorDate: Thu Jun 20 00:01:07 2019 -0400 Commit: Kitware Robot CommitDate: Thu Jun 20 00:01:07 2019 -0400 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index e9e4c29..39d6e36 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 15) -set(CMake_VERSION_PATCH 20190619) +set(CMake_VERSION_PATCH 20190620) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From kwrobot at kitware.com Thu Jun 20 11:33:08 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Thu, 20 Jun 2019 11:33:08 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc2-96-g282fa97 Message-ID: <20190620153308.C6BA5E5515@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 282fa97a45f19356260e73dbe26ae4b1d2501a07 (commit) via b55e5d6641b6233eeb85926bb3abf39336051d90 (commit) via fdab21f30b48021a6ecad2307b092b4d55561ae9 (commit) via d08548c62424437909a6b7f0198733cbff22296f (commit) from 3e1dac739155cdbc05dc8a1e328c029af28f614b (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=282fa97a45f19356260e73dbe26ae4b1d2501a07 commit 282fa97a45f19356260e73dbe26ae4b1d2501a07 Merge: 3e1dac7 b55e5d6 Author: Brad King AuthorDate: Thu Jun 20 15:27:17 2019 +0000 Commit: Kitware Robot CommitDate: Thu Jun 20 11:27:52 2019 -0400 Merge topic 'autogen_documentation' b55e5d6641 Help: Autogen: Overhaul AUTOMOC target property documentation fdab21f30b Help: Autogen: Overhaul AUTOUIC target property documentation d08548c624 Help: Autogen: Overhaul AUTORCC target property documentation Acked-by: Kitware Robot Merge-request: !3461 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b55e5d6641b6233eeb85926bb3abf39336051d90 commit b55e5d6641b6233eeb85926bb3abf39336051d90 Author: Sebastian Holtermann AuthorDate: Sat Jun 15 18:37:07 2019 +0200 Commit: Brad King CommitDate: Wed Jun 19 10:40:42 2019 -0400 Help: Autogen: Overhaul AUTOMOC target property documentation - Rewrites and restructures the AUTOMOC target property documentation - Remove the reference to the deprecated CMAKE_AUTOMOC_RELAXED_MODE Fixes: #19167 diff --git a/Help/prop_tgt/AUTOMOC.rst b/Help/prop_tgt/AUTOMOC.rst index 3e6d560..f6dfabd 100644 --- a/Help/prop_tgt/AUTOMOC.rst +++ b/Help/prop_tgt/AUTOMOC.rst @@ -1,97 +1,247 @@ AUTOMOC ------- -Should the target be processed with automoc (for Qt projects). +Should the target be processed with auto-moc (for Qt projects). :prop_tgt:`AUTOMOC` is a boolean specifying whether CMake will handle the Qt ``moc`` preprocessor automatically, i.e. without having to use the -:module:`QT4_WRAP_CPP() ` or QT5_WRAP_CPP() macro. +:module:`QT4_WRAP_CPP() ` or ``QT5_WRAP_CPP()`` macro. Currently Qt4 and Qt5 are supported. +This property is initialized by the value of the :variable:`CMAKE_AUTOMOC` +variable if it is set when a target is created. + When this property is set ``ON``, CMake will scan the header and -source files at build time and invoke moc accordingly. +source files at build time and invoke ``moc`` accordingly. -* If an ``#include`` statement like ``#include "moc_.cpp"`` is found, - a macro from :prop_tgt:`AUTOMOC_MACRO_NAMES` is expected to appear in the - ``.h(xx)`` header file. ``moc`` is run on the header - file to generate ``moc_.cpp`` in the - ``/include`` directory which is automatically added - to the target's :prop_tgt:`INCLUDE_DIRECTORIES`. - This allows the compiler to find the included ``moc_.cpp`` file - regardless of the location the original source. - * For :prop_gbl:`multi configuration generators `, - the include directory is ``/include_``. +Header file processing +^^^^^^^^^^^^^^^^^^^^^^ - * See :prop_tgt:`AUTOGEN_BUILD_DIR`. +At configuration time, a list of header files that should be scanned by +:prop_tgt:`AUTOMOC` is computed from the target's sources. -* If an ``#include`` statement like ``#include ".moc"`` is found, - a macro from :prop_tgt:`AUTOMOC_MACRO_NAMES` is expected to appear in the - source file and ``moc`` is run on the source file itself. +- All header files in the target's sources are added to the scan list. +- For all C++ source files ``.`` in the + target's sources, CMake searches for -* Header files that are not included by an ``#include "moc_.cpp"`` - statement are nonetheless scanned for a macro out of - :prop_tgt:`AUTOMOC_MACRO_NAMES`. - The resulting ``moc_.cpp`` files are generated in custom - directories and automatically included in a generated - ``/mocs_compilation.cpp`` file, - which is compiled as part of the target. + - a regular header with the same base name + (``.``) and + - a private header with the same base name and a ``_p`` suffix + (``_p.``) - * The custom directories with checksum - based names help to avoid name collisions for ``moc`` files with the same - ````. + and adds these to the scan list. - * See :prop_tgt:`AUTOGEN_BUILD_DIR`. +At build time, CMake scans each unknown or modified header file from the +list and searches for -* Additionally, header files with the same base name as a source file, - (like ``.h``) or ``_p`` appended to the base name (like - ``_p.h``), are scanned for a macro out of - :prop_tgt:`AUTOMOC_MACRO_NAMES`, and if found, ``moc`` - is also executed on those files. +- a Qt macro from :prop_tgt:`AUTOMOC_MACRO_NAMES`, +- additional file dependencies from the ``FILE`` argument of a + ``Q_PLUGIN_METADATA`` macro and +- additional file dependencies detected by filters defined in + :prop_tgt:`AUTOMOC_DEPEND_FILTERS`. -* ``AUTOMOC`` always checks multiple header alternative extensions, - such as ``hpp``, ``hxx``, etc. when searching for headers. +If a Qt macro is found, then the header will be compiled by the ``moc`` to the +output file ``moc_.cpp``. The complete output file path is +described in the section `Output file location`_. -* ``AUTOMOC`` looks for the ``Q_PLUGIN_METADATA`` macro and reruns the - ``moc`` when the file addressed by the ``FILE`` argument of the macro changes. +The header will be ``moc`` compiled again if a file from the additional file +dependencies changes. -This property is initialized by the value of the :variable:`CMAKE_AUTOMOC` -variable if it is set when a target is created. +Header ``moc`` output files ``moc_.cpp`` can be included in source +files. In the section `Including header moc files in sources`_ there is more +information on that topic. + + +Source file processing +^^^^^^^^^^^^^^^^^^^^^^ + +At build time, CMake scans each unknown or modified C++ source file from the +target's sources for + +- a Qt macro from :prop_tgt:`AUTOMOC_MACRO_NAMES`, +- includes of header ``moc`` files + (see `Including header moc files in sources`_), +- additional file dependencies from the ``FILE`` argument of a + ``Q_PLUGIN_METADATA`` macro and +- additional file dependencies detected by filters defined in + :prop_tgt:`AUTOMOC_DEPEND_FILTERS`. + +If a Qt macro is found, then the C++ source file +``.`` is expected to as well contain an include +statement + +.. code-block:: c++ + + #include <.moc> // or + #include ".moc" + +The source file then will be compiled by the ``moc`` to the output file +``.moc``. A description of the complete output file path is in section +`Output file location`_. + +The source will be ``moc`` compiled again if a file from the additional file +dependencies changes. + +Including header moc files in sources +""""""""""""""""""""""""""""""""""""" + +A source file can include the ``moc`` output file of a header +``.`` by using an include statement of +the form + +.. code-block:: c++ + + #include .cpp> // or + #include "moc_.cpp" + +If the ``moc`` output file of a header is included by a source, it will +be generated in a different location than if it was not included. This is +described in the section `Output file location`_. + + +Output file location +^^^^^^^^^^^^^^^^^^^^ + +Included moc output files +""""""""""""""""""""""""" + +``moc`` output files that are included by a source file will be generated in + +- ``/include`` + for single configuration generators or in +- ``/include_`` + for :prop_gbl:`multi configuration ` generators. + +Where ```` is the value of the target property +:prop_tgt:`AUTOGEN_BUILD_DIR`. + +The include directory is automatically added to the target's +:prop_tgt:`INCLUDE_DIRECTORIES`. + +Not included moc output files +""""""""""""""""""""""""""""" + +``moc`` output files that are not included in a source file will be generated +in + +- ``/`` + for single configuration generators or in, +- ``/include_/`` + for :prop_gbl:`multi configuration ` generators. + +Where ```` is a checksum computed from the relative +parent directory path of the ``moc`` input file. This scheme allows to have +``moc`` input files with the same name in different directories. + +All not included ``moc`` output files will be included automatically by the +CMake generated file + +- ``/mocs_compilation.cpp``, + +which is added to the target's sources. + + +Qt version detection +^^^^^^^^^^^^^^^^^^^^ + +:prop_tgt:`AUTOMOC` enabled targets need to know the Qt major and minor +version they're working with. The major version usually is provided by the +``INTERFACE_QT_MAJOR_VERSION`` property of the ``Qt[45]Core`` library, +that the target links to. To find the minor version, CMake builds a list of +available Qt versions from + +- ``Qt5Core_VERSION_MAJOR`` and ``Qt5Core_VERSION_MINOR`` variables + (usually set by ``find_package(Qt5...)``) +- ``Qt5Core_VERSION_MAJOR`` and ``Qt5Core_VERSION_MINOR`` directory properties +- ``QT_VERSION_MAJOR`` and ``QT_VERSION_MINOR`` variables + (usually set by ``find_package(Qt4...)``) +- ``QT_VERSION_MAJOR`` and ``QT_VERSION_MINOR`` directory properties + +in the context of the :command:`add_executable` or :command:`add_library` call. + +Assumed ``INTERFACE_QT_MAJOR_VERSION`` is a valid number, the first +entry in the list with a matching major version is taken. If no matching major +version was found, an error is generated. +If ``INTERFACE_QT_MAJOR_VERSION`` is not a valid number, the first +entry in the list is taken. + +A ``find_package(Qt[45]...)`` call sets the ``QT/Qt5Core_VERSION_MAJOR/MINOR`` +variables. If the call is in a different context than the +:command:`add_executable` or :command:`add_library` call, e.g. in a function, +then the version variables might not be available to the :prop_tgt:`AUTOMOC` +enabled target. +In that case the version variables can be forwarded from the +`find_package(Qt[45]...)` calling context to the :command:`add_executable` +or :command:`add_library` calling context as directory properties. +The following Qt5 example demonstrates the procedure. + +.. code-block:: cmake + + function (add_qt5_client) + find_package(Qt5 REQUIRED QUIET COMPONENTS Core Widgets) + ... + set_property(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" + PROPERTY Qt5Core_VERSION_MAJOR "${Qt5Core_VERSION_MAJOR}") + set_property(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" + PROPERTY Qt5Core_VERSION_MINOR "${Qt5Core_VERSION_MAJOR}") + ... + endfunction () + ... + add_qt5_client() + add_executable(myTarget main.cpp) + target_link_libraries(myTarget Qt5::QtWidgets) + set_property(TARGET myTarget PROPERTY AUTOMOC ON) + + +Modifiers +^^^^^^^^^ +:prop_tgt:`AUTOMOC_EXECUTABLE`: The ``moc`` executable will be detected automatically, but can be forced to -a certain binary using the :prop_tgt:`AUTOMOC_EXECUTABLE` property. +a certain binary using this target property. -Additional command line options for ``moc`` can be set via the -:prop_tgt:`AUTOMOC_MOC_OPTIONS` property. +:prop_tgt:`AUTOMOC_MOC_OPTIONS`: +Additional command line options for ``moc`` can be set in this target property. -By enabling the :variable:`CMAKE_AUTOMOC_RELAXED_MODE` variable the -rules for searching the files which will be processed by ``moc`` can be relaxed. -See the documentation for this variable for more details. +:prop_tgt:`AUTOMOC_MACRO_NAMES`: +This list of Qt macro names can be extended to search for additional macros in +headers and sources. -The global property :prop_gbl:`AUTOGEN_TARGETS_FOLDER` can be used to group the -automoc targets together in an IDE, e.g. in MSVS. +:prop_tgt:`AUTOMOC_DEPEND_FILTERS`: +``moc`` dependency file names can be extracted from headers or sources by +defining file name filters in this target property. -The global property :prop_gbl:`AUTOGEN_SOURCE_GROUP` can be used to group -files generated by :prop_tgt:`AUTOMOC` together in an IDE, e.g. in MSVS. +:prop_tgt:`AUTOMOC_COMPILER_PREDEFINES`: +Compiler pre definitions for ``moc`` are written to the ``moc_predefs.h`` file. +The generation of this file can be enabled or disabled in this target property. -Additional macro names to search for can be added to -:prop_tgt:`AUTOMOC_MACRO_NAMES`. +:prop_sf:`SKIP_AUTOMOC`: +Sources and headers can be excluded from :prop_tgt:`AUTOMOC` processing by +setting this source file property. -Additional ``moc`` dependency file names can be extracted from source code -by using :prop_tgt:`AUTOMOC_DEPEND_FILTERS`. +:prop_sf:`SKIP_AUTOGEN`: +Source files can be excluded from :prop_tgt:`AUTOMOC`, +:prop_tgt:`AUTOUIC` and :prop_tgt:`AUTORCC` processing by +setting this source file property. -Compiler pre definitions for ``moc`` are written to a ``moc_predefs.h`` file -which is controlled by :prop_tgt:`AUTOMOC_COMPILER_PREDEFINES`. +:prop_gbl:`AUTOGEN_SOURCE_GROUP`: +This global property can be used to group files generated by +:prop_tgt:`AUTOMOC` or :prop_tgt:`AUTORCC` together in an IDE, e.g. in MSVS. -Source C++ files can be excluded from :prop_tgt:`AUTOMOC` processing by -enabling :prop_sf:`SKIP_AUTOMOC` or the broader :prop_sf:`SKIP_AUTOGEN`. +:prop_gbl:`AUTOGEN_TARGETS_FOLDER`: +This global property can be used to group :prop_tgt:`AUTOMOC`, +:prop_tgt:`AUTOUIC` and :prop_tgt:`AUTORCC` targets together in an IDE, +e.g. in MSVS. -The number of parallel ``moc`` processes to start can be modified by -setting :prop_tgt:`AUTOGEN_PARALLEL`. +:variable:`CMAKE_GLOBAL_AUTOGEN_TARGET`: +A global ``autogen`` target, that depends on all :prop_tgt:`AUTOMOC` or +:prop_tgt:`AUTOUIC` generated ``_autogen`` targets in the project, +will be generated when this variable is ``ON``. -A global ``autogen`` target that depends on all :prop_tgt:`AUTOMOC` generated -``_autogen`` targets in the project can be generated by enabling -:variable:`CMAKE_GLOBAL_AUTOGEN_TARGET`. +:prop_tgt:`AUTOGEN_PARALLEL`: +This target property controls the number of ``moc`` or ``uic`` processes to +start in parallel during builds. See the :manual:`cmake-qt(7)` manual for more information on using CMake with Qt. https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fdab21f30b48021a6ecad2307b092b4d55561ae9 commit fdab21f30b48021a6ecad2307b092b4d55561ae9 Author: Sebastian Holtermann AuthorDate: Mon Jun 17 13:44:28 2019 +0200 Commit: Brad King CommitDate: Wed Jun 19 10:40:42 2019 -0400 Help: Autogen: Overhaul AUTOUIC target property documentation diff --git a/Help/prop_tgt/AUTOUIC.rst b/Help/prop_tgt/AUTOUIC.rst index 85226c1..5cf8755 100644 --- a/Help/prop_tgt/AUTOUIC.rst +++ b/Help/prop_tgt/AUTOUIC.rst @@ -1,47 +1,82 @@ AUTOUIC ------- -Should the target be processed with autouic (for Qt projects). +Should the target be processed with auto-uic (for Qt projects). :prop_tgt:`AUTOUIC` is a boolean specifying whether CMake will handle the Qt ``uic`` code generator automatically, i.e. without having to use the :module:`QT4_WRAP_UI() ` or ``QT5_WRAP_UI()`` macro. Currently Qt4 and Qt5 are supported. -When this property is ``ON``, CMake will scan the source files at build time -and invoke ``uic`` accordingly. If an ``#include`` statement like -``#include "ui_foo.h"`` is found in ``source.cpp``, a ``foo.ui`` file is -searched for first in the vicinity of ``source.cpp`` and afterwards in the -optional :prop_tgt:`AUTOUIC_SEARCH_PATHS` of the target. -``uic`` is run on the ``foo.ui`` file to generate ``ui_foo.h`` in the directory -``/include``, -which is automatically added to the target's :prop_tgt:`INCLUDE_DIRECTORIES`. +This property is initialized by the value of the :variable:`CMAKE_AUTOUIC` +variable if it is set when a target is created. -* For :prop_gbl:`multi configuration generators `, - the include directory is ``/include_``. +When this property is ``ON``, CMake will scan the header and source files at +build time and invoke ``uic`` accordingly. -* See :prop_tgt:`AUTOGEN_BUILD_DIR`. -This property is initialized by the value of the :variable:`CMAKE_AUTOUIC` -variable if it is set when a target is created. +Header and source file processing +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +At build time, CMake scans each header and source file from the +target's sources for include statements of the form + +.. code-block:: c++ + + #include "ui_.h" + +Once such an include statement is found in a file, CMake searches for the +``uic`` input file ``.ui`` + +- in the vicinity of the file and +- in the :prop_tgt:`AUTOUIC_SEARCH_PATHS` of the target. -Additional command line options for ``uic`` can be set via the -:prop_sf:`AUTOUIC_OPTIONS` source file property on the ``foo.ui`` file. -The global property :prop_gbl:`AUTOGEN_TARGETS_FOLDER` can be used to group the -autouic targets together in an IDE, e.g. in MSVS. +If the ``.ui`` file was found, ``uic`` is called on it to generate +``ui_.h`` in the directory +- ``/include`` for single configuration generators or in +- ``/include_`` for + :prop_gbl:`multi configuration ` generators. + +Where ```` is the value of the target property +:prop_tgt:`AUTOGEN_BUILD_DIR`. + +The include directory is automatically added to the target's +:prop_tgt:`INCLUDE_DIRECTORIES`. + + +Modifiers +^^^^^^^^^ + +:prop_tgt:`AUTOUIC_EXECUTABLE`: The ``uic`` executable will be detected automatically, but can be forced to -a certain binary using the :prop_tgt:`AUTOUIC_EXECUTABLE` property. +a certain binary using this target property. + +:prop_sf:`AUTOUIC_OPTIONS`: Additional command line options for ``uic`` can +be set via this source file property on a ``.ui`` file. + +:prop_sf:`SKIP_AUTOUIC`: +Source files can be excluded from :prop_tgt:`AUTOUIC` processing by setting +this source file property. + +:prop_sf:`SKIP_AUTOGEN`: +Source files can be excluded from :prop_tgt:`AUTOMOC`, +:prop_tgt:`AUTOUIC` and :prop_tgt:`AUTORCC` processing by +setting this source file property. -Source files can be excluded from :prop_tgt:`AUTOUIC` processing by -enabling :prop_sf:`SKIP_AUTOUIC` or the broader :prop_sf:`SKIP_AUTOGEN`. +:prop_gbl:`AUTOGEN_TARGETS_FOLDER`: +This global property can be used to group :prop_tgt:`AUTOMOC`, +:prop_tgt:`AUTOUIC` and :prop_tgt:`AUTORCC` targets together in an IDE, +e.g. in MSVS. -The number of parallel ``uic`` processes to start can be modified by -setting :prop_tgt:`AUTOGEN_PARALLEL`. +:variable:`CMAKE_GLOBAL_AUTOGEN_TARGET`: +A global ``autogen`` target, that depends on all :prop_tgt:`AUTOMOC` or +:prop_tgt:`AUTOUIC` generated ``_autogen`` targets in the project, +will be generated when this variable is ``ON``. -A global ``autogen`` target that depends on all :prop_tgt:`AUTOUIC` generated -``_autogen`` targets in the project can be generated by enabling -:variable:`CMAKE_GLOBAL_AUTOGEN_TARGET`. +:prop_tgt:`AUTOGEN_PARALLEL`: +This target property controls the number of ``moc`` or ``uic`` processes to +start in parallel during builds. See the :manual:`cmake-qt(7)` manual for more information on using CMake with Qt. https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d08548c62424437909a6b7f0198733cbff22296f commit d08548c62424437909a6b7f0198733cbff22296f Author: Sebastian Holtermann AuthorDate: Mon Jun 17 13:16:09 2019 +0200 Commit: Brad King CommitDate: Wed Jun 19 10:40:42 2019 -0400 Help: Autogen: Overhaul AUTORCC target property documentation diff --git a/Help/prop_tgt/AUTORCC.rst b/Help/prop_tgt/AUTORCC.rst index 5db6ed0..cca3e58 100644 --- a/Help/prop_tgt/AUTORCC.rst +++ b/Help/prop_tgt/AUTORCC.rst @@ -1,7 +1,7 @@ AUTORCC ------- -Should the target be processed with autorcc (for Qt projects). +Should the target be processed with auto-rcc (for Qt projects). :prop_tgt:`AUTORCC` is a boolean specifying whether CMake will handle the Qt ``rcc`` code generator automatically, i.e. without having to use @@ -13,34 +13,49 @@ as target sources at build time and invoke ``rcc`` accordingly. This property is initialized by the value of the :variable:`CMAKE_AUTORCC` variable if it is set when a target is created. -By default :prop_tgt:`AUTORCC` is processed inside a +By default :prop_tgt:`AUTORCC` is processed by a :command:`custom command `. -If the ``.qrc`` file is :prop_sf:`GENERATED` though, a +If the ``.qrc`` file is :prop_sf:`GENERATED`, a :command:`custom target ` is used instead. -Additional command line options for rcc can be set via the -:prop_sf:`AUTORCC_OPTIONS` source file property on the ``.qrc`` file. +When there are multiple ``.qrc`` files with the same name, CMake will +generate unspecified unique output file names for ``rcc``. Therefore, if +``Q_INIT_RESOURCE()`` or ``Q_CLEANUP_RESOURCE()`` need to be used, the +``.qrc`` file name must be unique. + + +Modifiers +^^^^^^^^^ +:prop_tgt:`AUTORCC_EXECUTABLE`: The ``rcc`` executable will be detected automatically, but can be forced to -a certain binary using the :prop_tgt:`AUTORCC_EXECUTABLE` property. +a certain binary by setting this target property. -The global property :prop_gbl:`AUTOGEN_TARGETS_FOLDER` can be used to group -the autorcc targets together in an IDE, e.g. in MSVS. +:prop_sf:`AUTORCC_OPTIONS`: +Additional command line options for ``rcc`` can be set via this ``.qrc`` +source file property. -The global property :prop_gbl:`AUTOGEN_SOURCE_GROUP` can be used to group -files generated by :prop_tgt:`AUTORCC` together in an IDE, e.g. in MSVS. +:prop_sf:`SKIP_AUTORCC`: +``.qrc`` files can be excluded from :prop_tgt:`AUTORCC` processing by +setting this source file property. -When there are multiple ``.qrc`` files with the same name, CMake will -generate unspecified unique names for ``rcc``. Therefore if -``Q_INIT_RESOURCE()`` or ``Q_CLEANUP_RESOURCE()`` need to be used the -``.qrc`` file name must be unique. +:prop_sf:`SKIP_AUTOGEN`: +Source files can be excluded from :prop_tgt:`AUTOMOC`, +:prop_tgt:`AUTOUIC` and :prop_tgt:`AUTORCC` processing by +setting this source file property. + +:prop_gbl:`AUTOGEN_SOURCE_GROUP`: +This global property can be used to group files generated by +:prop_tgt:`AUTOMOC` or :prop_tgt:`AUTORCC` together in an IDE, e.g. in MSVS. -Source files can be excluded from :prop_tgt:`AUTORCC` processing by -enabling :prop_sf:`SKIP_AUTORCC` or the broader :prop_sf:`SKIP_AUTOGEN`. +:prop_gbl:`AUTOGEN_TARGETS_FOLDER`: +This global property can be used to group :prop_tgt:`AUTOMOC`, +:prop_tgt:`AUTOUIC` and :prop_tgt:`AUTORCC` targets together in an IDE, +e.g. in MSVS. +:variable:`CMAKE_GLOBAL_AUTORCC_TARGET`: A global ``autorcc`` target that depends on all :prop_tgt:`AUTORCC` targets -in the project can be generated by enabling -:variable:`CMAKE_GLOBAL_AUTORCC_TARGET`. +in the project will be generated when this variable is ``ON``. See the :manual:`cmake-qt(7)` manual for more information on using CMake with Qt. ----------------------------------------------------------------------- Summary of changes: Help/prop_tgt/AUTOMOC.rst | 274 +++++++++++++++++++++++++++++++++++----------- Help/prop_tgt/AUTORCC.rst | 51 ++++++--- Help/prop_tgt/AUTOUIC.rst | 87 ++++++++++----- 3 files changed, 306 insertions(+), 106 deletions(-) hooks/post-receive -- CMake From kwrobot at kitware.com Thu Jun 20 11:43:06 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Thu, 20 Jun 2019 11:43:06 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc2-103-gfe11593 Message-ID: <20190620154306.5281DF50E8@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via fe11593d3075c6bd7f425c55c7bfbb12b25f8b1f (commit) via d94d54966803c579c0139531bfa1282896572008 (commit) via 036752cc0e5f98a611c23c044e3bc1b484b02f53 (commit) via db4667cc727fd7e52f6731642501e680922f72e7 (commit) via cee57246ef03ba5c2a6e67b472d2d1f8946c4f75 (commit) via 69b139cfca6c5eef64558070f533b6c898f410e0 (commit) via b4069b04ff63b327ff4881282200c3c73fded34d (commit) from 282fa97a45f19356260e73dbe26ae4b1d2501a07 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fe11593d3075c6bd7f425c55c7bfbb12b25f8b1f commit fe11593d3075c6bd7f425c55c7bfbb12b25f8b1f Merge: d94d549 db4667c Author: Brad King AuthorDate: Thu Jun 20 15:42:40 2019 +0000 Commit: Kitware Robot CommitDate: Thu Jun 20 11:42:49 2019 -0400 Merge topic 'update-libuv' db4667cc72 libuv: fix compilation with macOS 10.10 SDK cee57246ef libuv: Add uv__statx() stub to cmake-bootstrap.c 69b139cfca Merge branch 'upstream-libuv' into update-libuv b4069b04ff libuv 2019-06-10 (ee24ce90) Acked-by: Kitware Robot Merge-request: !3457 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d94d54966803c579c0139531bfa1282896572008 commit d94d54966803c579c0139531bfa1282896572008 Merge: 282fa97 036752c Author: Brad King AuthorDate: Thu Jun 20 11:42:10 2019 -0400 Commit: Brad King CommitDate: Thu Jun 20 11:42:10 2019 -0400 Merge branch 'release-3.15' https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=db4667cc727fd7e52f6731642501e680922f72e7 commit db4667cc727fd7e52f6731642501e680922f72e7 Author: Brad King AuthorDate: Wed Jun 19 06:52:19 2019 -0400 Commit: Brad King CommitDate: Wed Jun 19 06:57:38 2019 -0400 libuv: fix compilation with macOS 10.10 SDK The `F_BARRIERFSYNC` constant was not added until the macOS 10.11 SDK. Hard-code its value instead. This approach is backported from upstream libuv PR 2334. diff --git a/Utilities/cmlibuv/src/unix/fs.c b/Utilities/cmlibuv/src/unix/fs.c index 48500ff..3023b1e 100644 --- a/Utilities/cmlibuv/src/unix/fs.c +++ b/Utilities/cmlibuv/src/unix/fs.c @@ -168,7 +168,7 @@ static ssize_t uv__fs_fsync(uv_fs_t* req) { r = fcntl(req->file, F_FULLFSYNC); if (r != 0) - r = fcntl(req->file, F_BARRIERFSYNC); /* fsync + barrier */ + r = fcntl(req->file, 85 /* F_BARRIERFSYNC */); /* fsync + barrier */ if (r != 0) r = fsync(req->file); return r; https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=cee57246ef03ba5c2a6e67b472d2d1f8946c4f75 commit cee57246ef03ba5c2a6e67b472d2d1f8946c4f75 Author: Kyle Edwards AuthorDate: Mon Jun 17 15:48:48 2019 -0400 Commit: Brad King CommitDate: Tue Jun 18 07:46:08 2019 -0400 libuv: Add uv__statx() stub to cmake-bootstrap.c diff --git a/Utilities/cmlibuv/src/unix/cmake-bootstrap.c b/Utilities/cmlibuv/src/unix/cmake-bootstrap.c index 309ec79..d42ff05 100644 --- a/Utilities/cmlibuv/src/unix/cmake-bootstrap.c +++ b/Utilities/cmlibuv/src/unix/cmake-bootstrap.c @@ -137,4 +137,13 @@ int uv__utimesat(int dirfd, const char* path, const struct timespec times[2], errno = ENOSYS; return -1; } + +int uv__statx(int dirfd, + const char* path, + int flags, + unsigned int mask, + struct uv__statx* statxbuf) { + errno = ENOSYS; + return -1; +} #endif https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=69b139cfca6c5eef64558070f533b6c898f410e0 commit 69b139cfca6c5eef64558070f533b6c898f410e0 Merge: ab63072 b4069b0 Author: Brad King AuthorDate: Tue Jun 18 07:45:53 2019 -0400 Commit: Brad King CommitDate: Tue Jun 18 07:45:53 2019 -0400 Merge branch 'upstream-libuv' into update-libuv * upstream-libuv: libuv 2019-06-10 (ee24ce90) diff --cc Utilities/cmlibuv/include/uv.h index e6dc736,0000000..eb80bfb mode 100644,000000..100644 --- a/Utilities/cmlibuv/include/uv.h +++ b/Utilities/cmlibuv/include/uv.h @@@ -1,1653 -1,0 +1,1717 @@@ +/* Copyright Joyent, Inc. and other Node contributors. All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +/* See https://github.com/libuv/libuv#documentation for documentation. */ + +#ifndef UV_H +#define UV_H + +/* Include KWSys Large File Support configuration. */ +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef _WIN32 + /* Windows - set up dll import/export decorators. */ +# if defined(BUILDING_UV_SHARED) + /* Building shared library. */ +# define UV_EXTERN __declspec(dllexport) +# elif defined(USING_UV_SHARED) + /* Using shared library. */ +# define UV_EXTERN __declspec(dllimport) +# else + /* Building static library. */ +# define UV_EXTERN /* nothing */ +# endif +#elif __GNUC__ >= 4 +# define UV_EXTERN __attribute__((visibility("default"))) +#else +# define UV_EXTERN /* nothing */ +#endif + +#include "uv/errno.h" +#include "uv/version.h" +#include +#include + +#if defined(_MSC_VER) && _MSC_VER < 1600 +# include "uv/stdint-msvc2008.h" +#else +# include +#endif + +#if defined(_WIN32) +# include "uv/win.h" +#else +# include "uv/unix.h" +#endif + +/* Expand this list if necessary. */ +#define UV_ERRNO_MAP(XX) \ + XX(E2BIG, "argument list too long") \ + XX(EACCES, "permission denied") \ + XX(EADDRINUSE, "address already in use") \ + XX(EADDRNOTAVAIL, "address not available") \ + XX(EAFNOSUPPORT, "address family not supported") \ + XX(EAGAIN, "resource temporarily unavailable") \ + XX(EAI_ADDRFAMILY, "address family not supported") \ + XX(EAI_AGAIN, "temporary failure") \ + XX(EAI_BADFLAGS, "bad ai_flags value") \ + XX(EAI_BADHINTS, "invalid value for hints") \ + XX(EAI_CANCELED, "request canceled") \ + XX(EAI_FAIL, "permanent failure") \ + XX(EAI_FAMILY, "ai_family not supported") \ + XX(EAI_MEMORY, "out of memory") \ + XX(EAI_NODATA, "no address") \ + XX(EAI_NONAME, "unknown node or service") \ + XX(EAI_OVERFLOW, "argument buffer overflow") \ + XX(EAI_PROTOCOL, "resolved protocol is unknown") \ + XX(EAI_SERVICE, "service not available for socket type") \ + XX(EAI_SOCKTYPE, "socket type not supported") \ + XX(EALREADY, "connection already in progress") \ + XX(EBADF, "bad file descriptor") \ + XX(EBUSY, "resource busy or locked") \ + XX(ECANCELED, "operation canceled") \ + XX(ECHARSET, "invalid Unicode character") \ + XX(ECONNABORTED, "software caused connection abort") \ + XX(ECONNREFUSED, "connection refused") \ + XX(ECONNRESET, "connection reset by peer") \ + XX(EDESTADDRREQ, "destination address required") \ + XX(EEXIST, "file already exists") \ + XX(EFAULT, "bad address in system call argument") \ + XX(EFBIG, "file too large") \ + XX(EHOSTUNREACH, "host is unreachable") \ + XX(EINTR, "interrupted system call") \ + XX(EINVAL, "invalid argument") \ + XX(EIO, "i/o error") \ + XX(EISCONN, "socket is already connected") \ + XX(EISDIR, "illegal operation on a directory") \ + XX(ELOOP, "too many symbolic links encountered") \ + XX(EMFILE, "too many open files") \ + XX(EMSGSIZE, "message too long") \ + XX(ENAMETOOLONG, "name too long") \ + XX(ENETDOWN, "network is down") \ + XX(ENETUNREACH, "network is unreachable") \ + XX(ENFILE, "file table overflow") \ + XX(ENOBUFS, "no buffer space available") \ + XX(ENODEV, "no such device") \ + XX(ENOENT, "no such file or directory") \ + XX(ENOMEM, "not enough memory") \ + XX(ENONET, "machine is not on the network") \ + XX(ENOPROTOOPT, "protocol not available") \ + XX(ENOSPC, "no space left on device") \ + XX(ENOSYS, "function not implemented") \ + XX(ENOTCONN, "socket is not connected") \ + XX(ENOTDIR, "not a directory") \ + XX(ENOTEMPTY, "directory not empty") \ + XX(ENOTSOCK, "socket operation on non-socket") \ + XX(ENOTSUP, "operation not supported on socket") \ + XX(EPERM, "operation not permitted") \ + XX(EPIPE, "broken pipe") \ + XX(EPROTO, "protocol error") \ + XX(EPROTONOSUPPORT, "protocol not supported") \ + XX(EPROTOTYPE, "protocol wrong type for socket") \ + XX(ERANGE, "result too large") \ + XX(EROFS, "read-only file system") \ + XX(ESHUTDOWN, "cannot send after transport endpoint shutdown") \ + XX(ESPIPE, "invalid seek") \ + XX(ESRCH, "no such process") \ + XX(ETIMEDOUT, "connection timed out") \ + XX(ETXTBSY, "text file is busy") \ + XX(EXDEV, "cross-device link not permitted") \ + XX(UNKNOWN, "unknown error") \ + XX(EOF, "end of file") \ + XX(ENXIO, "no such device or address") \ + XX(EMLINK, "too many links") \ + XX(EHOSTDOWN, "host is down") \ + XX(EREMOTEIO, "remote I/O error") \ + XX(ENOTTY, "inappropriate ioctl for device") \ + XX(EFTYPE, "inappropriate file type or format") \ + +#define UV_HANDLE_TYPE_MAP(XX) \ + XX(ASYNC, async) \ + XX(CHECK, check) \ + XX(FS_EVENT, fs_event) \ + XX(FS_POLL, fs_poll) \ + XX(HANDLE, handle) \ + XX(IDLE, idle) \ + XX(NAMED_PIPE, pipe) \ + XX(POLL, poll) \ + XX(PREPARE, prepare) \ + XX(PROCESS, process) \ + XX(STREAM, stream) \ + XX(TCP, tcp) \ + XX(TIMER, timer) \ + XX(TTY, tty) \ + XX(UDP, udp) \ + XX(SIGNAL, signal) \ + +#define UV_REQ_TYPE_MAP(XX) \ + XX(REQ, req) \ + XX(CONNECT, connect) \ + XX(WRITE, write) \ + XX(SHUTDOWN, shutdown) \ + XX(UDP_SEND, udp_send) \ + XX(FS, fs) \ + XX(WORK, work) \ + XX(GETADDRINFO, getaddrinfo) \ + XX(GETNAMEINFO, getnameinfo) \ + +typedef enum { +#define XX(code, _) UV_ ## code = UV__ ## code, + UV_ERRNO_MAP(XX) +#undef XX + UV_ERRNO_MAX = UV__EOF - 1 +} uv_errno_t; + +typedef enum { + UV_UNKNOWN_HANDLE = 0, +#define XX(uc, lc) UV_##uc, + UV_HANDLE_TYPE_MAP(XX) +#undef XX + UV_FILE, + UV_HANDLE_TYPE_MAX +} uv_handle_type; + +typedef enum { + UV_UNKNOWN_REQ = 0, +#define XX(uc, lc) UV_##uc, + UV_REQ_TYPE_MAP(XX) +#undef XX + UV_REQ_TYPE_PRIVATE + UV_REQ_TYPE_MAX +} uv_req_type; + + +/* Handle types. */ +typedef struct uv_loop_s uv_loop_t; +typedef struct uv_handle_s uv_handle_t; ++typedef struct uv_dir_s uv_dir_t; +typedef struct uv_stream_s uv_stream_t; +typedef struct uv_tcp_s uv_tcp_t; +typedef struct uv_udp_s uv_udp_t; +typedef struct uv_pipe_s uv_pipe_t; +typedef struct uv_tty_s uv_tty_t; +typedef struct uv_poll_s uv_poll_t; +typedef struct uv_timer_s uv_timer_t; +typedef struct uv_prepare_s uv_prepare_t; +typedef struct uv_check_s uv_check_t; +typedef struct uv_idle_s uv_idle_t; +typedef struct uv_async_s uv_async_t; +typedef struct uv_process_s uv_process_t; +typedef struct uv_fs_event_s uv_fs_event_t; +typedef struct uv_fs_poll_s uv_fs_poll_t; +typedef struct uv_signal_s uv_signal_t; + +/* Request types. */ +typedef struct uv_req_s uv_req_t; +typedef struct uv_getaddrinfo_s uv_getaddrinfo_t; +typedef struct uv_getnameinfo_s uv_getnameinfo_t; +typedef struct uv_shutdown_s uv_shutdown_t; +typedef struct uv_write_s uv_write_t; +typedef struct uv_connect_s uv_connect_t; +typedef struct uv_udp_send_s uv_udp_send_t; +typedef struct uv_fs_s uv_fs_t; +typedef struct uv_work_s uv_work_t; + +/* None of the above. */ +typedef struct uv_cpu_info_s uv_cpu_info_t; +typedef struct uv_interface_address_s uv_interface_address_t; +typedef struct uv_dirent_s uv_dirent_t; +typedef struct uv_passwd_s uv_passwd_t; +typedef struct uv_utsname_s uv_utsname_t; + +typedef enum { + UV_LOOP_BLOCK_SIGNAL +} uv_loop_option; + +typedef enum { + UV_RUN_DEFAULT = 0, + UV_RUN_ONCE, + UV_RUN_NOWAIT +} uv_run_mode; + + +UV_EXTERN unsigned int uv_version(void); +UV_EXTERN const char* uv_version_string(void); + +typedef void* (*uv_malloc_func)(size_t size); +typedef void* (*uv_realloc_func)(void* ptr, size_t size); +typedef void* (*uv_calloc_func)(size_t count, size_t size); +typedef void (*uv_free_func)(void* ptr); + +UV_EXTERN int uv_replace_allocator(uv_malloc_func malloc_func, + uv_realloc_func realloc_func, + uv_calloc_func calloc_func, + uv_free_func free_func); + +UV_EXTERN uv_loop_t* uv_default_loop(void); +UV_EXTERN int uv_loop_init(uv_loop_t* loop); +UV_EXTERN int uv_loop_close(uv_loop_t* loop); +/* + * NOTE: + * This function is DEPRECATED (to be removed after 0.12), users should + * allocate the loop manually and use uv_loop_init instead. + */ +UV_EXTERN uv_loop_t* uv_loop_new(void); +/* + * NOTE: + * This function is DEPRECATED (to be removed after 0.12). Users should use + * uv_loop_close and free the memory manually instead. + */ +UV_EXTERN void uv_loop_delete(uv_loop_t*); +UV_EXTERN size_t uv_loop_size(void); +UV_EXTERN int uv_loop_alive(const uv_loop_t* loop); +UV_EXTERN int uv_loop_configure(uv_loop_t* loop, uv_loop_option option, ...); +UV_EXTERN int uv_loop_fork(uv_loop_t* loop); + +UV_EXTERN int uv_run(uv_loop_t*, uv_run_mode mode); +UV_EXTERN void uv_stop(uv_loop_t*); + +UV_EXTERN void uv_ref(uv_handle_t*); +UV_EXTERN void uv_unref(uv_handle_t*); +UV_EXTERN int uv_has_ref(const uv_handle_t*); + +UV_EXTERN void uv_update_time(uv_loop_t*); +UV_EXTERN uint64_t uv_now(const uv_loop_t*); + +UV_EXTERN int uv_backend_fd(const uv_loop_t*); +UV_EXTERN int uv_backend_timeout(const uv_loop_t*); + +typedef void (*uv_alloc_cb)(uv_handle_t* handle, + size_t suggested_size, + uv_buf_t* buf); +typedef void (*uv_read_cb)(uv_stream_t* stream, + ssize_t nread, + const uv_buf_t* buf); +typedef void (*uv_write_cb)(uv_write_t* req, int status); +typedef void (*uv_connect_cb)(uv_connect_t* req, int status); +typedef void (*uv_shutdown_cb)(uv_shutdown_t* req, int status); +typedef void (*uv_connection_cb)(uv_stream_t* server, int status); +typedef void (*uv_close_cb)(uv_handle_t* handle); +typedef void (*uv_poll_cb)(uv_poll_t* handle, int status, int events); +typedef void (*uv_timer_cb)(uv_timer_t* handle); +typedef void (*uv_async_cb)(uv_async_t* handle); +typedef void (*uv_prepare_cb)(uv_prepare_t* handle); +typedef void (*uv_check_cb)(uv_check_t* handle); +typedef void (*uv_idle_cb)(uv_idle_t* handle); +typedef void (*uv_exit_cb)(uv_process_t*, int64_t exit_status, int term_signal); +typedef void (*uv_walk_cb)(uv_handle_t* handle, void* arg); +typedef void (*uv_fs_cb)(uv_fs_t* req); +typedef void (*uv_work_cb)(uv_work_t* req); +typedef void (*uv_after_work_cb)(uv_work_t* req, int status); +typedef void (*uv_getaddrinfo_cb)(uv_getaddrinfo_t* req, + int status, + struct addrinfo* res); +typedef void (*uv_getnameinfo_cb)(uv_getnameinfo_t* req, + int status, + const char* hostname, + const char* service); + +typedef struct { + long tv_sec; + long tv_nsec; +} uv_timespec_t; + + +typedef struct { + uint64_t st_dev; + uint64_t st_mode; + uint64_t st_nlink; + uint64_t st_uid; + uint64_t st_gid; + uint64_t st_rdev; + uint64_t st_ino; + uint64_t st_size; + uint64_t st_blksize; + uint64_t st_blocks; + uint64_t st_flags; + uint64_t st_gen; + uv_timespec_t st_atim; + uv_timespec_t st_mtim; + uv_timespec_t st_ctim; + uv_timespec_t st_birthtim; +} uv_stat_t; + + +typedef void (*uv_fs_event_cb)(uv_fs_event_t* handle, + const char* filename, + int events, + int status); + +typedef void (*uv_fs_poll_cb)(uv_fs_poll_t* handle, + int status, + const uv_stat_t* prev, + const uv_stat_t* curr); + +typedef void (*uv_signal_cb)(uv_signal_t* handle, int signum); + + +typedef enum { + UV_LEAVE_GROUP = 0, + UV_JOIN_GROUP +} uv_membership; + + +UV_EXTERN int uv_translate_sys_error(int sys_errno); + +UV_EXTERN const char* uv_strerror(int err); +UV_EXTERN char* uv_strerror_r(int err, char* buf, size_t buflen); + +UV_EXTERN const char* uv_err_name(int err); +UV_EXTERN char* uv_err_name_r(int err, char* buf, size_t buflen); + + +#define UV_REQ_FIELDS \ + /* public */ \ + void* data; \ + /* read-only */ \ + uv_req_type type; \ + /* private */ \ + void* reserved[6]; \ + UV_REQ_PRIVATE_FIELDS \ + +/* Abstract base class of all requests. */ +struct uv_req_s { + UV_REQ_FIELDS +}; + + +/* Platform-specific request types. */ +UV_PRIVATE_REQ_TYPES + + +UV_EXTERN int uv_shutdown(uv_shutdown_t* req, + uv_stream_t* handle, + uv_shutdown_cb cb); + +struct uv_shutdown_s { + UV_REQ_FIELDS + uv_stream_t* handle; + uv_shutdown_cb cb; + UV_SHUTDOWN_PRIVATE_FIELDS +}; + + +#define UV_HANDLE_FIELDS \ + /* public */ \ + void* data; \ + /* read-only */ \ + uv_loop_t* loop; \ + uv_handle_type type; \ + /* private */ \ + uv_close_cb close_cb; \ + void* handle_queue[2]; \ + union { \ + int fd; \ + void* reserved[4]; \ + } u; \ + UV_HANDLE_PRIVATE_FIELDS \ + +/* The abstract base class of all handles. */ +struct uv_handle_s { + UV_HANDLE_FIELDS +}; + +UV_EXTERN size_t uv_handle_size(uv_handle_type type); +UV_EXTERN uv_handle_type uv_handle_get_type(const uv_handle_t* handle); +UV_EXTERN const char* uv_handle_type_name(uv_handle_type type); +UV_EXTERN void* uv_handle_get_data(const uv_handle_t* handle); +UV_EXTERN uv_loop_t* uv_handle_get_loop(const uv_handle_t* handle); +UV_EXTERN void uv_handle_set_data(uv_handle_t* handle, void* data); + +UV_EXTERN size_t uv_req_size(uv_req_type type); +UV_EXTERN void* uv_req_get_data(const uv_req_t* req); +UV_EXTERN void uv_req_set_data(uv_req_t* req, void* data); +UV_EXTERN uv_req_type uv_req_get_type(const uv_req_t* req); +UV_EXTERN const char* uv_req_type_name(uv_req_type type); + +UV_EXTERN int uv_is_active(const uv_handle_t* handle); + +UV_EXTERN void uv_walk(uv_loop_t* loop, uv_walk_cb walk_cb, void* arg); + +/* Helpers for ad hoc debugging, no API/ABI stability guaranteed. */ +UV_EXTERN void uv_print_all_handles(uv_loop_t* loop, FILE* stream); +UV_EXTERN void uv_print_active_handles(uv_loop_t* loop, FILE* stream); + +UV_EXTERN void uv_close(uv_handle_t* handle, uv_close_cb close_cb); + +UV_EXTERN int uv_send_buffer_size(uv_handle_t* handle, int* value); +UV_EXTERN int uv_recv_buffer_size(uv_handle_t* handle, int* value); + +UV_EXTERN int uv_fileno(const uv_handle_t* handle, uv_os_fd_t* fd); + +UV_EXTERN uv_buf_t uv_buf_init(char* base, unsigned int len); + + +#define UV_STREAM_FIELDS \ + /* number of bytes queued for writing */ \ + size_t write_queue_size; \ + uv_alloc_cb alloc_cb; \ + uv_read_cb read_cb; \ + /* private */ \ + UV_STREAM_PRIVATE_FIELDS + +/* + * uv_stream_t is a subclass of uv_handle_t. + * + * uv_stream is an abstract class. + * + * uv_stream_t is the parent class of uv_tcp_t, uv_pipe_t and uv_tty_t. + */ +struct uv_stream_s { + UV_HANDLE_FIELDS + UV_STREAM_FIELDS +}; + +UV_EXTERN size_t uv_stream_get_write_queue_size(const uv_stream_t* stream); + +UV_EXTERN int uv_listen(uv_stream_t* stream, int backlog, uv_connection_cb cb); +UV_EXTERN int uv_accept(uv_stream_t* server, uv_stream_t* client); + +UV_EXTERN int uv_read_start(uv_stream_t*, + uv_alloc_cb alloc_cb, + uv_read_cb read_cb); +UV_EXTERN int uv_read_stop(uv_stream_t*); + +UV_EXTERN int uv_write(uv_write_t* req, + uv_stream_t* handle, + const uv_buf_t bufs[], + unsigned int nbufs, + uv_write_cb cb); +UV_EXTERN int uv_write2(uv_write_t* req, + uv_stream_t* handle, + const uv_buf_t bufs[], + unsigned int nbufs, + uv_stream_t* send_handle, + uv_write_cb cb); +UV_EXTERN int uv_try_write(uv_stream_t* handle, + const uv_buf_t bufs[], + unsigned int nbufs); + +/* uv_write_t is a subclass of uv_req_t. */ +struct uv_write_s { + UV_REQ_FIELDS + uv_write_cb cb; + uv_stream_t* send_handle; /* TODO: make private and unix-only in v2.x. */ + uv_stream_t* handle; + UV_WRITE_PRIVATE_FIELDS +}; + + +UV_EXTERN int uv_is_readable(const uv_stream_t* handle); +UV_EXTERN int uv_is_writable(const uv_stream_t* handle); + +UV_EXTERN int uv_stream_set_blocking(uv_stream_t* handle, int blocking); + +UV_EXTERN int uv_is_closing(const uv_handle_t* handle); + + +/* + * uv_tcp_t is a subclass of uv_stream_t. + * + * Represents a TCP stream or TCP server. + */ +struct uv_tcp_s { + UV_HANDLE_FIELDS + UV_STREAM_FIELDS + UV_TCP_PRIVATE_FIELDS +}; + +UV_EXTERN int uv_tcp_init(uv_loop_t*, uv_tcp_t* handle); +UV_EXTERN int uv_tcp_init_ex(uv_loop_t*, uv_tcp_t* handle, unsigned int flags); +UV_EXTERN int uv_tcp_open(uv_tcp_t* handle, uv_os_sock_t sock); +UV_EXTERN int uv_tcp_nodelay(uv_tcp_t* handle, int enable); +UV_EXTERN int uv_tcp_keepalive(uv_tcp_t* handle, + int enable, + unsigned int delay); +UV_EXTERN int uv_tcp_simultaneous_accepts(uv_tcp_t* handle, int enable); + +enum uv_tcp_flags { + /* Used with uv_tcp_bind, when an IPv6 address is used. */ + UV_TCP_IPV6ONLY = 1 +}; + +UV_EXTERN int uv_tcp_bind(uv_tcp_t* handle, + const struct sockaddr* addr, + unsigned int flags); +UV_EXTERN int uv_tcp_getsockname(const uv_tcp_t* handle, + struct sockaddr* name, + int* namelen); +UV_EXTERN int uv_tcp_getpeername(const uv_tcp_t* handle, + struct sockaddr* name, + int* namelen); +UV_EXTERN int uv_tcp_connect(uv_connect_t* req, + uv_tcp_t* handle, + const struct sockaddr* addr, + uv_connect_cb cb); + +/* uv_connect_t is a subclass of uv_req_t. */ +struct uv_connect_s { + UV_REQ_FIELDS + uv_connect_cb cb; + uv_stream_t* handle; + UV_CONNECT_PRIVATE_FIELDS +}; + + +/* + * UDP support. + */ + +enum uv_udp_flags { + /* Disables dual stack mode. */ + UV_UDP_IPV6ONLY = 1, + /* + * Indicates message was truncated because read buffer was too small. The + * remainder was discarded by the OS. Used in uv_udp_recv_cb. + */ + UV_UDP_PARTIAL = 2, + /* + * Indicates if SO_REUSEADDR will be set when binding the handle. + * This sets the SO_REUSEPORT socket flag on the BSDs and OS X. On other + * Unix platforms, it sets the SO_REUSEADDR flag. What that means is that + * multiple threads or processes can bind to the same address without error + * (provided they all set the flag) but only the last one to bind will receive + * any traffic, in effect "stealing" the port from the previous listener. + */ + UV_UDP_REUSEADDR = 4 +}; + +typedef void (*uv_udp_send_cb)(uv_udp_send_t* req, int status); +typedef void (*uv_udp_recv_cb)(uv_udp_t* handle, + ssize_t nread, + const uv_buf_t* buf, + const struct sockaddr* addr, + unsigned flags); + +/* uv_udp_t is a subclass of uv_handle_t. */ +struct uv_udp_s { + UV_HANDLE_FIELDS + /* read-only */ + /* + * Number of bytes queued for sending. This field strictly shows how much + * information is currently queued. + */ + size_t send_queue_size; + /* + * Number of send requests currently in the queue awaiting to be processed. + */ + size_t send_queue_count; + UV_UDP_PRIVATE_FIELDS +}; + +/* uv_udp_send_t is a subclass of uv_req_t. */ +struct uv_udp_send_s { + UV_REQ_FIELDS + uv_udp_t* handle; + uv_udp_send_cb cb; + UV_UDP_SEND_PRIVATE_FIELDS +}; + +UV_EXTERN int uv_udp_init(uv_loop_t*, uv_udp_t* handle); +UV_EXTERN int uv_udp_init_ex(uv_loop_t*, uv_udp_t* handle, unsigned int flags); +UV_EXTERN int uv_udp_open(uv_udp_t* handle, uv_os_sock_t sock); +UV_EXTERN int uv_udp_bind(uv_udp_t* handle, + const struct sockaddr* addr, + unsigned int flags); ++UV_EXTERN int uv_udp_connect(uv_udp_t* handle, const struct sockaddr* addr); + ++UV_EXTERN int uv_udp_getpeername(const uv_udp_t* handle, ++ struct sockaddr* name, ++ int* namelen); +UV_EXTERN int uv_udp_getsockname(const uv_udp_t* handle, + struct sockaddr* name, + int* namelen); +UV_EXTERN int uv_udp_set_membership(uv_udp_t* handle, + const char* multicast_addr, + const char* interface_addr, + uv_membership membership); +UV_EXTERN int uv_udp_set_multicast_loop(uv_udp_t* handle, int on); +UV_EXTERN int uv_udp_set_multicast_ttl(uv_udp_t* handle, int ttl); +UV_EXTERN int uv_udp_set_multicast_interface(uv_udp_t* handle, + const char* interface_addr); +UV_EXTERN int uv_udp_set_broadcast(uv_udp_t* handle, int on); +UV_EXTERN int uv_udp_set_ttl(uv_udp_t* handle, int ttl); +UV_EXTERN int uv_udp_send(uv_udp_send_t* req, + uv_udp_t* handle, + const uv_buf_t bufs[], + unsigned int nbufs, + const struct sockaddr* addr, + uv_udp_send_cb send_cb); +UV_EXTERN int uv_udp_try_send(uv_udp_t* handle, + const uv_buf_t bufs[], + unsigned int nbufs, + const struct sockaddr* addr); +UV_EXTERN int uv_udp_recv_start(uv_udp_t* handle, + uv_alloc_cb alloc_cb, + uv_udp_recv_cb recv_cb); +UV_EXTERN int uv_udp_recv_stop(uv_udp_t* handle); +UV_EXTERN size_t uv_udp_get_send_queue_size(const uv_udp_t* handle); +UV_EXTERN size_t uv_udp_get_send_queue_count(const uv_udp_t* handle); + + +/* + * uv_tty_t is a subclass of uv_stream_t. + * + * Representing a stream for the console. + */ +struct uv_tty_s { + UV_HANDLE_FIELDS + UV_STREAM_FIELDS + UV_TTY_PRIVATE_FIELDS +}; + +typedef enum { + /* Initial/normal terminal mode */ + UV_TTY_MODE_NORMAL, + /* Raw input mode (On Windows, ENABLE_WINDOW_INPUT is also enabled) */ + UV_TTY_MODE_RAW, + /* Binary-safe I/O mode for IPC (Unix-only) */ + UV_TTY_MODE_IO +} uv_tty_mode_t; + +UV_EXTERN int uv_tty_init(uv_loop_t*, uv_tty_t*, uv_file fd, int readable); +UV_EXTERN int uv_tty_set_mode(uv_tty_t*, uv_tty_mode_t mode); +UV_EXTERN int uv_tty_reset_mode(void); +UV_EXTERN int uv_tty_get_winsize(uv_tty_t*, int* width, int* height); + +#ifdef __cplusplus +extern "C++" { + +inline int uv_tty_set_mode(uv_tty_t* handle, int mode) { + return uv_tty_set_mode(handle, static_cast(mode)); +} + +} +#endif + +UV_EXTERN uv_handle_type uv_guess_handle(uv_file file); + +/* + * uv_pipe_t is a subclass of uv_stream_t. + * + * Representing a pipe stream or pipe server. On Windows this is a Named + * Pipe. On Unix this is a Unix domain socket. + */ +struct uv_pipe_s { + UV_HANDLE_FIELDS + UV_STREAM_FIELDS + int ipc; /* non-zero if this pipe is used for passing handles */ + UV_PIPE_PRIVATE_FIELDS +}; + +UV_EXTERN int uv_pipe_init(uv_loop_t*, uv_pipe_t* handle, int ipc); +UV_EXTERN int uv_pipe_open(uv_pipe_t*, uv_file file); +UV_EXTERN int uv_pipe_bind(uv_pipe_t* handle, const char* name); +UV_EXTERN void uv_pipe_connect(uv_connect_t* req, + uv_pipe_t* handle, + const char* name, + uv_connect_cb cb); +UV_EXTERN int uv_pipe_getsockname(const uv_pipe_t* handle, + char* buffer, + size_t* size); +UV_EXTERN int uv_pipe_getpeername(const uv_pipe_t* handle, + char* buffer, + size_t* size); +UV_EXTERN void uv_pipe_pending_instances(uv_pipe_t* handle, int count); +UV_EXTERN int uv_pipe_pending_count(uv_pipe_t* handle); +UV_EXTERN uv_handle_type uv_pipe_pending_type(uv_pipe_t* handle); +UV_EXTERN int uv_pipe_chmod(uv_pipe_t* handle, int flags); + + +struct uv_poll_s { + UV_HANDLE_FIELDS + uv_poll_cb poll_cb; + UV_POLL_PRIVATE_FIELDS +}; + +enum uv_poll_event { + UV_READABLE = 1, + UV_WRITABLE = 2, + UV_DISCONNECT = 4, + UV_PRIORITIZED = 8 +}; + +UV_EXTERN int uv_poll_init(uv_loop_t* loop, uv_poll_t* handle, int fd); +UV_EXTERN int uv_poll_init_socket(uv_loop_t* loop, + uv_poll_t* handle, + uv_os_sock_t socket); +UV_EXTERN int uv_poll_start(uv_poll_t* handle, int events, uv_poll_cb cb); +UV_EXTERN int uv_poll_stop(uv_poll_t* handle); + + +struct uv_prepare_s { + UV_HANDLE_FIELDS + UV_PREPARE_PRIVATE_FIELDS +}; + +UV_EXTERN int uv_prepare_init(uv_loop_t*, uv_prepare_t* prepare); +UV_EXTERN int uv_prepare_start(uv_prepare_t* prepare, uv_prepare_cb cb); +UV_EXTERN int uv_prepare_stop(uv_prepare_t* prepare); + + +struct uv_check_s { + UV_HANDLE_FIELDS + UV_CHECK_PRIVATE_FIELDS +}; + +UV_EXTERN int uv_check_init(uv_loop_t*, uv_check_t* check); +UV_EXTERN int uv_check_start(uv_check_t* check, uv_check_cb cb); +UV_EXTERN int uv_check_stop(uv_check_t* check); + + +struct uv_idle_s { + UV_HANDLE_FIELDS + UV_IDLE_PRIVATE_FIELDS +}; + +UV_EXTERN int uv_idle_init(uv_loop_t*, uv_idle_t* idle); +UV_EXTERN int uv_idle_start(uv_idle_t* idle, uv_idle_cb cb); +UV_EXTERN int uv_idle_stop(uv_idle_t* idle); + + +struct uv_async_s { + UV_HANDLE_FIELDS + UV_ASYNC_PRIVATE_FIELDS +}; + +UV_EXTERN int uv_async_init(uv_loop_t*, + uv_async_t* async, + uv_async_cb async_cb); +UV_EXTERN int uv_async_send(uv_async_t* async); + + +/* + * uv_timer_t is a subclass of uv_handle_t. + * + * Used to get woken up at a specified time in the future. + */ +struct uv_timer_s { + UV_HANDLE_FIELDS + UV_TIMER_PRIVATE_FIELDS +}; + +UV_EXTERN int uv_timer_init(uv_loop_t*, uv_timer_t* handle); +UV_EXTERN int uv_timer_start(uv_timer_t* handle, + uv_timer_cb cb, + uint64_t timeout, + uint64_t repeat); +UV_EXTERN int uv_timer_stop(uv_timer_t* handle); +UV_EXTERN int uv_timer_again(uv_timer_t* handle); +UV_EXTERN void uv_timer_set_repeat(uv_timer_t* handle, uint64_t repeat); +UV_EXTERN uint64_t uv_timer_get_repeat(const uv_timer_t* handle); + + +/* + * uv_getaddrinfo_t is a subclass of uv_req_t. + * + * Request object for uv_getaddrinfo. + */ +struct uv_getaddrinfo_s { + UV_REQ_FIELDS + /* read-only */ + uv_loop_t* loop; + /* struct addrinfo* addrinfo is marked as private, but it really isn't. */ + UV_GETADDRINFO_PRIVATE_FIELDS +}; + + +UV_EXTERN int uv_getaddrinfo(uv_loop_t* loop, + uv_getaddrinfo_t* req, + uv_getaddrinfo_cb getaddrinfo_cb, + const char* node, + const char* service, + const struct addrinfo* hints); +UV_EXTERN void uv_freeaddrinfo(struct addrinfo* ai); + + +/* +* uv_getnameinfo_t is a subclass of uv_req_t. +* +* Request object for uv_getnameinfo. +*/ +struct uv_getnameinfo_s { + UV_REQ_FIELDS + /* read-only */ + uv_loop_t* loop; + /* host and service are marked as private, but they really aren't. */ + UV_GETNAMEINFO_PRIVATE_FIELDS +}; + +UV_EXTERN int uv_getnameinfo(uv_loop_t* loop, + uv_getnameinfo_t* req, + uv_getnameinfo_cb getnameinfo_cb, + const struct sockaddr* addr, + int flags); + + +/* uv_spawn() options. */ +typedef enum { + UV_IGNORE = 0x00, + UV_CREATE_PIPE = 0x01, + UV_INHERIT_FD = 0x02, + UV_INHERIT_STREAM = 0x04, + + /* + * When UV_CREATE_PIPE is specified, UV_READABLE_PIPE and UV_WRITABLE_PIPE + * determine the direction of flow, from the child process' perspective. Both + * flags may be specified to create a duplex data stream. + */ + UV_READABLE_PIPE = 0x10, + UV_WRITABLE_PIPE = 0x20, + + /* + * Open the child pipe handle in overlapped mode on Windows. + * On Unix it is silently ignored. + */ + UV_OVERLAPPED_PIPE = 0x40 +} uv_stdio_flags; + +typedef struct uv_stdio_container_s { + uv_stdio_flags flags; + + union { + uv_stream_t* stream; + int fd; + } data; +} uv_stdio_container_t; + +typedef struct uv_process_options_s { + uv_exit_cb exit_cb; /* Called after the process exits. */ + const char* file; /* Path to program to execute. */ + /* + * Command line arguments. args[0] should be the path to the program. On + * Windows this uses CreateProcess which concatenates the arguments into a + * string this can cause some strange errors. See the note at + * windows_verbatim_arguments. + */ + char** args; + /* + * This will be set as the environ variable in the subprocess. If this is + * NULL then the parents environ will be used. + */ + char** env; + /* + * If non-null this represents a directory the subprocess should execute + * in. Stands for current working directory. + */ + const char* cwd; + /* + * Various flags that control how uv_spawn() behaves. See the definition of + * `enum uv_process_flags` below. + */ + unsigned int flags; + /* + * The `stdio` field points to an array of uv_stdio_container_t structs that + * describe the file descriptors that will be made available to the child + * process. The convention is that stdio[0] points to stdin, fd 1 is used for + * stdout, and fd 2 is stderr. + * + * Note that on windows file descriptors greater than 2 are available to the + * child process only if the child processes uses the MSVCRT runtime. + */ + int stdio_count; + uv_stdio_container_t* stdio; + /* + * Libuv can change the child process' user/group id. This happens only when + * the appropriate bits are set in the flags fields. This is not supported on + * windows; uv_spawn() will fail and set the error to UV_ENOTSUP. + */ + uv_uid_t uid; + uv_gid_t gid; + /* + Libuv can set the child process' CPU affinity mask. This happens when + `cpumask` is non-NULL. It must point to an array of char values + of length `cpumask_size`, whose value must be at least that returned by + uv_cpumask_size(). Each byte in the mask can be either zero (false) + or non-zero (true) to indicate whether the corresponding processor at + that index is included. + + If enabled on an unsupported platform, uv_spawn() will fail with + UV_ENOTSUP. + */ + char* cpumask; + size_t cpumask_size; +} uv_process_options_t; + +/* + * These are the flags that can be used for the uv_process_options.flags field. + */ +enum uv_process_flags { + /* + * Set the child process' user id. The user id is supplied in the `uid` field + * of the options struct. This does not work on windows; setting this flag + * will cause uv_spawn() to fail. + */ + UV_PROCESS_SETUID = (1 << 0), + /* + * Set the child process' group id. The user id is supplied in the `gid` + * field of the options struct. This does not work on windows; setting this + * flag will cause uv_spawn() to fail. + */ + UV_PROCESS_SETGID = (1 << 1), + /* + * Do not wrap any arguments in quotes, or perform any other escaping, when + * converting the argument list into a command line string. This option is + * only meaningful on Windows systems. On Unix it is silently ignored. + */ + UV_PROCESS_WINDOWS_VERBATIM_ARGUMENTS = (1 << 2), + /* + * Spawn the child process in a detached state - this will make it a process + * group leader, and will effectively enable the child to keep running after + * the parent exits. Note that the child process will still keep the + * parent's event loop alive unless the parent process calls uv_unref() on + * the child's process handle. + */ + UV_PROCESS_DETACHED = (1 << 3), + /* + * Hide the subprocess window that would normally be created. This option is + * only meaningful on Windows systems. On Unix it is silently ignored. + */ + UV_PROCESS_WINDOWS_HIDE = (1 << 4), + /* + * Hide the subprocess console window that would normally be created. This + * option is only meaningful on Windows systems. On Unix it is silently + * ignored. + */ + UV_PROCESS_WINDOWS_HIDE_CONSOLE = (1 << 5), + /* + * Hide the subprocess GUI window that would normally be created. This + * option is only meaningful on Windows systems. On Unix it is silently + * ignored. + */ + UV_PROCESS_WINDOWS_HIDE_GUI = (1 << 6) +}; + +/* + * uv_process_t is a subclass of uv_handle_t. + */ +struct uv_process_s { + UV_HANDLE_FIELDS + uv_exit_cb exit_cb; + int pid; + UV_PROCESS_PRIVATE_FIELDS +}; + +UV_EXTERN int uv_spawn(uv_loop_t* loop, + uv_process_t* handle, + const uv_process_options_t* options); +UV_EXTERN int uv_process_kill(uv_process_t*, int signum); +UV_EXTERN int uv_kill(int pid, int signum); +UV_EXTERN uv_pid_t uv_process_get_pid(const uv_process_t*); + + +/* + * uv_work_t is a subclass of uv_req_t. + */ +struct uv_work_s { + UV_REQ_FIELDS + uv_loop_t* loop; + uv_work_cb work_cb; + uv_after_work_cb after_work_cb; + UV_WORK_PRIVATE_FIELDS +}; + +UV_EXTERN int uv_queue_work(uv_loop_t* loop, + uv_work_t* req, + uv_work_cb work_cb, + uv_after_work_cb after_work_cb); + +UV_EXTERN int uv_cancel(uv_req_t* req); + + +struct uv_cpu_times_s { + uint64_t user; + uint64_t nice; + uint64_t sys; + uint64_t idle; + uint64_t irq; +}; + +struct uv_cpu_info_s { + char* model; + int speed; + struct uv_cpu_times_s cpu_times; +}; + +struct uv_interface_address_s { + char* name; + char phys_addr[6]; + int is_internal; + union { + struct sockaddr_in address4; + struct sockaddr_in6 address6; + } address; + union { + struct sockaddr_in netmask4; + struct sockaddr_in6 netmask6; + } netmask; +}; + +struct uv_passwd_s { + char* username; + long uid; + long gid; + char* shell; + char* homedir; +}; + +struct uv_utsname_s { + char sysname[256]; + char release[256]; + char version[256]; + char machine[256]; + /* This struct does not contain the nodename and domainname fields present in + the utsname type. domainname is a GNU extension. Both fields are referred + to as meaningless in the docs. */ +}; + +typedef enum { + UV_DIRENT_UNKNOWN, + UV_DIRENT_FILE, + UV_DIRENT_DIR, + UV_DIRENT_LINK, + UV_DIRENT_FIFO, + UV_DIRENT_SOCKET, + UV_DIRENT_CHAR, + UV_DIRENT_BLOCK +} uv_dirent_type_t; + +struct uv_dirent_s { + const char* name; + uv_dirent_type_t type; +}; + +UV_EXTERN char** uv_setup_args(int argc, char** argv); +UV_EXTERN int uv_get_process_title(char* buffer, size_t size); +UV_EXTERN int uv_set_process_title(const char* title); +UV_EXTERN int uv_resident_set_memory(size_t* rss); +UV_EXTERN int uv_uptime(double* uptime); +UV_EXTERN uv_os_fd_t uv_get_osfhandle(int fd); +UV_EXTERN int uv_open_osfhandle(uv_os_fd_t os_fd); + +typedef struct { + long tv_sec; + long tv_usec; +} uv_timeval_t; + +typedef struct { ++ int64_t tv_sec; ++ int32_t tv_usec; ++} uv_timeval64_t; ++ ++typedef struct { + uv_timeval_t ru_utime; /* user CPU time used */ + uv_timeval_t ru_stime; /* system CPU time used */ + uint64_t ru_maxrss; /* maximum resident set size */ + uint64_t ru_ixrss; /* integral shared memory size */ + uint64_t ru_idrss; /* integral unshared data size */ + uint64_t ru_isrss; /* integral unshared stack size */ + uint64_t ru_minflt; /* page reclaims (soft page faults) */ + uint64_t ru_majflt; /* page faults (hard page faults) */ + uint64_t ru_nswap; /* swaps */ + uint64_t ru_inblock; /* block input operations */ + uint64_t ru_oublock; /* block output operations */ + uint64_t ru_msgsnd; /* IPC messages sent */ + uint64_t ru_msgrcv; /* IPC messages received */ + uint64_t ru_nsignals; /* signals received */ + uint64_t ru_nvcsw; /* voluntary context switches */ + uint64_t ru_nivcsw; /* involuntary context switches */ +} uv_rusage_t; + +UV_EXTERN int uv_getrusage(uv_rusage_t* rusage); + +UV_EXTERN int uv_os_homedir(char* buffer, size_t* size); +UV_EXTERN int uv_os_tmpdir(char* buffer, size_t* size); +UV_EXTERN int uv_os_get_passwd(uv_passwd_t* pwd); +UV_EXTERN void uv_os_free_passwd(uv_passwd_t* pwd); +UV_EXTERN uv_pid_t uv_os_getpid(void); +UV_EXTERN uv_pid_t uv_os_getppid(void); + +#define UV_PRIORITY_LOW 19 +#define UV_PRIORITY_BELOW_NORMAL 10 +#define UV_PRIORITY_NORMAL 0 +#define UV_PRIORITY_ABOVE_NORMAL -7 +#define UV_PRIORITY_HIGH -14 +#define UV_PRIORITY_HIGHEST -20 + +UV_EXTERN int uv_os_getpriority(uv_pid_t pid, int* priority); +UV_EXTERN int uv_os_setpriority(uv_pid_t pid, int priority); + +UV_EXTERN int uv_cpu_info(uv_cpu_info_t** cpu_infos, int* count); +UV_EXTERN void uv_free_cpu_info(uv_cpu_info_t* cpu_infos, int count); +UV_EXTERN int uv_cpumask_size(void); + +UV_EXTERN int uv_interface_addresses(uv_interface_address_t** addresses, + int* count); +UV_EXTERN void uv_free_interface_addresses(uv_interface_address_t* addresses, + int count); + +UV_EXTERN int uv_os_getenv(const char* name, char* buffer, size_t* size); +UV_EXTERN int uv_os_setenv(const char* name, const char* value); +UV_EXTERN int uv_os_unsetenv(const char* name); + ++#ifdef MAXHOSTNAMELEN ++# define UV_MAXHOSTNAMESIZE (MAXHOSTNAMELEN + 1) ++#else ++ /* ++ Fallback for the maximum hostname size, including the null terminator. The ++ Windows gethostname() documentation states that 256 bytes will always be ++ large enough to hold the null-terminated hostname. ++ */ ++# define UV_MAXHOSTNAMESIZE 256 ++#endif ++ +UV_EXTERN int uv_os_gethostname(char* buffer, size_t* size); + +UV_EXTERN int uv_os_uname(uv_utsname_t* buffer); + + +typedef enum { + UV_FS_UNKNOWN = -1, + UV_FS_CUSTOM, + UV_FS_OPEN, + UV_FS_CLOSE, + UV_FS_READ, + UV_FS_WRITE, + UV_FS_SENDFILE, + UV_FS_STAT, + UV_FS_LSTAT, + UV_FS_FSTAT, + UV_FS_FTRUNCATE, + UV_FS_UTIME, + UV_FS_FUTIME, + UV_FS_ACCESS, + UV_FS_CHMOD, + UV_FS_FCHMOD, + UV_FS_FSYNC, + UV_FS_FDATASYNC, + UV_FS_UNLINK, + UV_FS_RMDIR, + UV_FS_MKDIR, + UV_FS_MKDTEMP, + UV_FS_RENAME, + UV_FS_SCANDIR, + UV_FS_LINK, + UV_FS_SYMLINK, + UV_FS_READLINK, + UV_FS_CHOWN, + UV_FS_FCHOWN, + UV_FS_REALPATH, + UV_FS_COPYFILE, - UV_FS_LCHOWN ++ UV_FS_LCHOWN, ++ UV_FS_OPENDIR, ++ UV_FS_READDIR, ++ UV_FS_CLOSEDIR +} uv_fs_type; + ++struct uv_dir_s { ++ uv_dirent_t* dirents; ++ size_t nentries; ++ void* reserved[4]; ++ UV_DIR_PRIVATE_FIELDS ++}; ++ +/* uv_fs_t is a subclass of uv_req_t. */ +struct uv_fs_s { + UV_REQ_FIELDS + uv_fs_type fs_type; + uv_loop_t* loop; + uv_fs_cb cb; + ssize_t result; + void* ptr; + const char* path; + uv_stat_t statbuf; /* Stores the result of uv_fs_stat() and uv_fs_fstat(). */ + UV_FS_PRIVATE_FIELDS +}; + +UV_EXTERN uv_fs_type uv_fs_get_type(const uv_fs_t*); +UV_EXTERN ssize_t uv_fs_get_result(const uv_fs_t*); +UV_EXTERN void* uv_fs_get_ptr(const uv_fs_t*); +UV_EXTERN const char* uv_fs_get_path(const uv_fs_t*); +UV_EXTERN uv_stat_t* uv_fs_get_statbuf(uv_fs_t*); + +UV_EXTERN void uv_fs_req_cleanup(uv_fs_t* req); +UV_EXTERN int uv_fs_close(uv_loop_t* loop, + uv_fs_t* req, + uv_file file, + uv_fs_cb cb); +UV_EXTERN int uv_fs_open(uv_loop_t* loop, + uv_fs_t* req, + const char* path, + int flags, + int mode, + uv_fs_cb cb); +UV_EXTERN int uv_fs_read(uv_loop_t* loop, + uv_fs_t* req, + uv_file file, + const uv_buf_t bufs[], + unsigned int nbufs, + int64_t offset, + uv_fs_cb cb); +UV_EXTERN int uv_fs_unlink(uv_loop_t* loop, + uv_fs_t* req, + const char* path, + uv_fs_cb cb); +UV_EXTERN int uv_fs_write(uv_loop_t* loop, + uv_fs_t* req, + uv_file file, + const uv_buf_t bufs[], + unsigned int nbufs, + int64_t offset, + uv_fs_cb cb); +/* + * This flag can be used with uv_fs_copyfile() to return an error if the + * destination already exists. + */ +#define UV_FS_COPYFILE_EXCL 0x0001 + +/* + * This flag can be used with uv_fs_copyfile() to attempt to create a reflink. + * If copy-on-write is not supported, a fallback copy mechanism is used. + */ +#define UV_FS_COPYFILE_FICLONE 0x0002 + +/* + * This flag can be used with uv_fs_copyfile() to attempt to create a reflink. + * If copy-on-write is not supported, an error is returned. + */ +#define UV_FS_COPYFILE_FICLONE_FORCE 0x0004 + +UV_EXTERN int uv_fs_copyfile(uv_loop_t* loop, + uv_fs_t* req, + const char* path, + const char* new_path, + int flags, + uv_fs_cb cb); +UV_EXTERN int uv_fs_mkdir(uv_loop_t* loop, + uv_fs_t* req, + const char* path, + int mode, + uv_fs_cb cb); +UV_EXTERN int uv_fs_mkdtemp(uv_loop_t* loop, + uv_fs_t* req, + const char* tpl, + uv_fs_cb cb); +UV_EXTERN int uv_fs_rmdir(uv_loop_t* loop, + uv_fs_t* req, + const char* path, + uv_fs_cb cb); +UV_EXTERN int uv_fs_scandir(uv_loop_t* loop, + uv_fs_t* req, + const char* path, + int flags, + uv_fs_cb cb); +UV_EXTERN int uv_fs_scandir_next(uv_fs_t* req, + uv_dirent_t* ent); ++UV_EXTERN int uv_fs_opendir(uv_loop_t* loop, ++ uv_fs_t* req, ++ const char* path, ++ uv_fs_cb cb); ++UV_EXTERN int uv_fs_readdir(uv_loop_t* loop, ++ uv_fs_t* req, ++ uv_dir_t* dir, ++ uv_fs_cb cb); ++UV_EXTERN int uv_fs_closedir(uv_loop_t* loop, ++ uv_fs_t* req, ++ uv_dir_t* dir, ++ uv_fs_cb cb); +UV_EXTERN int uv_fs_stat(uv_loop_t* loop, + uv_fs_t* req, + const char* path, + uv_fs_cb cb); +UV_EXTERN int uv_fs_fstat(uv_loop_t* loop, + uv_fs_t* req, + uv_file file, + uv_fs_cb cb); +UV_EXTERN int uv_fs_rename(uv_loop_t* loop, + uv_fs_t* req, + const char* path, + const char* new_path, + uv_fs_cb cb); +UV_EXTERN int uv_fs_fsync(uv_loop_t* loop, + uv_fs_t* req, + uv_file file, + uv_fs_cb cb); +UV_EXTERN int uv_fs_fdatasync(uv_loop_t* loop, + uv_fs_t* req, + uv_file file, + uv_fs_cb cb); +UV_EXTERN int uv_fs_ftruncate(uv_loop_t* loop, + uv_fs_t* req, + uv_file file, + int64_t offset, + uv_fs_cb cb); +UV_EXTERN int uv_fs_sendfile(uv_loop_t* loop, + uv_fs_t* req, + uv_file out_fd, + uv_file in_fd, + int64_t in_offset, + size_t length, + uv_fs_cb cb); +UV_EXTERN int uv_fs_access(uv_loop_t* loop, + uv_fs_t* req, + const char* path, + int mode, + uv_fs_cb cb); +UV_EXTERN int uv_fs_chmod(uv_loop_t* loop, + uv_fs_t* req, + const char* path, + int mode, + uv_fs_cb cb); +UV_EXTERN int uv_fs_utime(uv_loop_t* loop, + uv_fs_t* req, + const char* path, + double atime, + double mtime, + uv_fs_cb cb); +UV_EXTERN int uv_fs_futime(uv_loop_t* loop, + uv_fs_t* req, + uv_file file, + double atime, + double mtime, + uv_fs_cb cb); +UV_EXTERN int uv_fs_lstat(uv_loop_t* loop, + uv_fs_t* req, + const char* path, + uv_fs_cb cb); +UV_EXTERN int uv_fs_link(uv_loop_t* loop, + uv_fs_t* req, + const char* path, + const char* new_path, + uv_fs_cb cb); + +/* + * This flag can be used with uv_fs_symlink() on Windows to specify whether + * path argument points to a directory. + */ +#define UV_FS_SYMLINK_DIR 0x0001 + +/* + * This flag can be used with uv_fs_symlink() on Windows to specify whether + * the symlink is to be created using junction points. + */ +#define UV_FS_SYMLINK_JUNCTION 0x0002 + +UV_EXTERN int uv_fs_symlink(uv_loop_t* loop, + uv_fs_t* req, + const char* path, + const char* new_path, + int flags, + uv_fs_cb cb); +UV_EXTERN int uv_fs_readlink(uv_loop_t* loop, + uv_fs_t* req, + const char* path, + uv_fs_cb cb); +UV_EXTERN int uv_fs_realpath(uv_loop_t* loop, + uv_fs_t* req, + const char* path, + uv_fs_cb cb); +UV_EXTERN int uv_fs_fchmod(uv_loop_t* loop, + uv_fs_t* req, + uv_file file, + int mode, + uv_fs_cb cb); +UV_EXTERN int uv_fs_chown(uv_loop_t* loop, + uv_fs_t* req, + const char* path, + uv_uid_t uid, + uv_gid_t gid, + uv_fs_cb cb); +UV_EXTERN int uv_fs_fchown(uv_loop_t* loop, + uv_fs_t* req, + uv_file file, + uv_uid_t uid, + uv_gid_t gid, + uv_fs_cb cb); +UV_EXTERN int uv_fs_lchown(uv_loop_t* loop, + uv_fs_t* req, + const char* path, + uv_uid_t uid, + uv_gid_t gid, + uv_fs_cb cb); + + +enum uv_fs_event { + UV_RENAME = 1, + UV_CHANGE = 2 +}; + + +struct uv_fs_event_s { + UV_HANDLE_FIELDS + /* private */ + char* path; + UV_FS_EVENT_PRIVATE_FIELDS +}; + + +/* + * uv_fs_stat() based polling file watcher. + */ +struct uv_fs_poll_s { + UV_HANDLE_FIELDS + /* Private, don't touch. */ + void* poll_ctx; +}; + +UV_EXTERN int uv_fs_poll_init(uv_loop_t* loop, uv_fs_poll_t* handle); +UV_EXTERN int uv_fs_poll_start(uv_fs_poll_t* handle, + uv_fs_poll_cb poll_cb, + const char* path, + unsigned int interval); +UV_EXTERN int uv_fs_poll_stop(uv_fs_poll_t* handle); +UV_EXTERN int uv_fs_poll_getpath(uv_fs_poll_t* handle, + char* buffer, + size_t* size); + + +struct uv_signal_s { + UV_HANDLE_FIELDS + uv_signal_cb signal_cb; + int signum; + UV_SIGNAL_PRIVATE_FIELDS +}; + +UV_EXTERN int uv_signal_init(uv_loop_t* loop, uv_signal_t* handle); +UV_EXTERN int uv_signal_start(uv_signal_t* handle, + uv_signal_cb signal_cb, + int signum); +UV_EXTERN int uv_signal_start_oneshot(uv_signal_t* handle, + uv_signal_cb signal_cb, + int signum); +UV_EXTERN int uv_signal_stop(uv_signal_t* handle); + +UV_EXTERN void uv_loadavg(double avg[3]); + + +/* + * Flags to be passed to uv_fs_event_start(). + */ +enum uv_fs_event_flags { + /* + * By default, if the fs event watcher is given a directory name, we will + * watch for all events in that directory. This flags overrides this behavior + * and makes fs_event report only changes to the directory entry itself. This + * flag does not affect individual files watched. + * This flag is currently not implemented yet on any backend. + */ + UV_FS_EVENT_WATCH_ENTRY = 1, + + /* + * By default uv_fs_event will try to use a kernel interface such as inotify + * or kqueue to detect events. This may not work on remote filesystems such + * as NFS mounts. This flag makes fs_event fall back to calling stat() on a + * regular interval. + * This flag is currently not implemented yet on any backend. + */ + UV_FS_EVENT_STAT = 2, + + /* + * By default, event watcher, when watching directory, is not registering + * (is ignoring) changes in it's subdirectories. + * This flag will override this behaviour on platforms that support it. + */ + UV_FS_EVENT_RECURSIVE = 4 +}; + + +UV_EXTERN int uv_fs_event_init(uv_loop_t* loop, uv_fs_event_t* handle); +UV_EXTERN int uv_fs_event_start(uv_fs_event_t* handle, + uv_fs_event_cb cb, + const char* path, + unsigned int flags); +UV_EXTERN int uv_fs_event_stop(uv_fs_event_t* handle); +UV_EXTERN int uv_fs_event_getpath(uv_fs_event_t* handle, + char* buffer, + size_t* size); + +UV_EXTERN int uv_ip4_addr(const char* ip, int port, struct sockaddr_in* addr); +UV_EXTERN int uv_ip6_addr(const char* ip, int port, struct sockaddr_in6* addr); + +UV_EXTERN int uv_ip4_name(const struct sockaddr_in* src, char* dst, size_t size); +UV_EXTERN int uv_ip6_name(const struct sockaddr_in6* src, char* dst, size_t size); + +UV_EXTERN int uv_inet_ntop(int af, const void* src, char* dst, size_t size); +UV_EXTERN int uv_inet_pton(int af, const char* src, void* dst); + +#if defined(IF_NAMESIZE) +# define UV_IF_NAMESIZE (IF_NAMESIZE + 1) +#elif defined(IFNAMSIZ) +# define UV_IF_NAMESIZE (IFNAMSIZ + 1) +#else +# define UV_IF_NAMESIZE (16 + 1) +#endif + +UV_EXTERN int uv_if_indextoname(unsigned int ifindex, + char* buffer, + size_t* size); +UV_EXTERN int uv_if_indextoiid(unsigned int ifindex, + char* buffer, + size_t* size); + +UV_EXTERN int uv_exepath(char* buffer, size_t* size); + +UV_EXTERN int uv_cwd(char* buffer, size_t* size); + +UV_EXTERN int uv_chdir(const char* dir); + +UV_EXTERN uint64_t uv_get_free_memory(void); +UV_EXTERN uint64_t uv_get_total_memory(void); ++UV_EXTERN uint64_t uv_get_constrained_memory(void); + +UV_EXTERN uint64_t uv_hrtime(void); + +UV_EXTERN void uv_disable_stdio_inheritance(void); + +UV_EXTERN int uv_dlopen(const char* filename, uv_lib_t* lib); +UV_EXTERN void uv_dlclose(uv_lib_t* lib); +UV_EXTERN int uv_dlsym(uv_lib_t* lib, const char* name, void** ptr); +UV_EXTERN const char* uv_dlerror(const uv_lib_t* lib); + +UV_EXTERN int uv_mutex_init(uv_mutex_t* handle); +UV_EXTERN int uv_mutex_init_recursive(uv_mutex_t* handle); +UV_EXTERN void uv_mutex_destroy(uv_mutex_t* handle); +UV_EXTERN void uv_mutex_lock(uv_mutex_t* handle); +UV_EXTERN int uv_mutex_trylock(uv_mutex_t* handle); +UV_EXTERN void uv_mutex_unlock(uv_mutex_t* handle); + +UV_EXTERN int uv_rwlock_init(uv_rwlock_t* rwlock); +UV_EXTERN void uv_rwlock_destroy(uv_rwlock_t* rwlock); +UV_EXTERN void uv_rwlock_rdlock(uv_rwlock_t* rwlock); +UV_EXTERN int uv_rwlock_tryrdlock(uv_rwlock_t* rwlock); +UV_EXTERN void uv_rwlock_rdunlock(uv_rwlock_t* rwlock); +UV_EXTERN void uv_rwlock_wrlock(uv_rwlock_t* rwlock); +UV_EXTERN int uv_rwlock_trywrlock(uv_rwlock_t* rwlock); +UV_EXTERN void uv_rwlock_wrunlock(uv_rwlock_t* rwlock); + +UV_EXTERN int uv_sem_init(uv_sem_t* sem, unsigned int value); +UV_EXTERN void uv_sem_destroy(uv_sem_t* sem); +UV_EXTERN void uv_sem_post(uv_sem_t* sem); +UV_EXTERN void uv_sem_wait(uv_sem_t* sem); +UV_EXTERN int uv_sem_trywait(uv_sem_t* sem); + +UV_EXTERN int uv_cond_init(uv_cond_t* cond); +UV_EXTERN void uv_cond_destroy(uv_cond_t* cond); +UV_EXTERN void uv_cond_signal(uv_cond_t* cond); +UV_EXTERN void uv_cond_broadcast(uv_cond_t* cond); + +UV_EXTERN int uv_barrier_init(uv_barrier_t* barrier, unsigned int count); +UV_EXTERN void uv_barrier_destroy(uv_barrier_t* barrier); +UV_EXTERN int uv_barrier_wait(uv_barrier_t* barrier); + +UV_EXTERN void uv_cond_wait(uv_cond_t* cond, uv_mutex_t* mutex); +UV_EXTERN int uv_cond_timedwait(uv_cond_t* cond, + uv_mutex_t* mutex, + uint64_t timeout); + +UV_EXTERN void uv_once(uv_once_t* guard, void (*callback)(void)); + +UV_EXTERN int uv_key_create(uv_key_t* key); +UV_EXTERN void uv_key_delete(uv_key_t* key); +UV_EXTERN void* uv_key_get(uv_key_t* key); +UV_EXTERN void uv_key_set(uv_key_t* key, void* value); + ++UV_EXTERN int uv_gettimeofday(uv_timeval64_t* tv); ++ +typedef void (*uv_thread_cb)(void* arg); + +UV_EXTERN int uv_thread_create(uv_thread_t* tid, uv_thread_cb entry, void* arg); ++ ++typedef enum { ++ UV_THREAD_NO_FLAGS = 0x00, ++ UV_THREAD_HAS_STACK_SIZE = 0x01 ++} uv_thread_create_flags; ++ ++struct uv_thread_options_s { ++ unsigned int flags; ++ size_t stack_size; ++ /* More fields may be added at any time. */ ++}; ++ ++typedef struct uv_thread_options_s uv_thread_options_t; ++ ++UV_EXTERN int uv_thread_create_ex(uv_thread_t* tid, ++ const uv_thread_options_t* params, ++ uv_thread_cb entry, ++ void* arg); +UV_EXTERN uv_thread_t uv_thread_self(void); +UV_EXTERN int uv_thread_join(uv_thread_t *tid); +UV_EXTERN int uv_thread_equal(const uv_thread_t* t1, const uv_thread_t* t2); + +/* The presence of these unions force similar struct layout. */ +#define XX(_, name) uv_ ## name ## _t name; +union uv_any_handle { + UV_HANDLE_TYPE_MAP(XX) +}; + +union uv_any_req { + UV_REQ_TYPE_MAP(XX) +}; +#undef XX + + +struct uv_loop_s { + /* User data - use this for whatever. */ + void* data; + /* Loop reference counting. */ + unsigned int active_handles; + void* handle_queue[2]; + union { + void* unused[2]; + unsigned int count; + } active_reqs; + /* Internal flag to signal loop stop. */ + unsigned int stop_flag; + UV_LOOP_PRIVATE_FIELDS +}; + +UV_EXTERN void* uv_loop_get_data(const uv_loop_t*); +UV_EXTERN void uv_loop_set_data(uv_loop_t*, void* data); + +/* Don't export the private CPP symbols. */ +#undef UV_HANDLE_TYPE_PRIVATE +#undef UV_REQ_TYPE_PRIVATE +#undef UV_REQ_PRIVATE_FIELDS +#undef UV_STREAM_PRIVATE_FIELDS +#undef UV_TCP_PRIVATE_FIELDS +#undef UV_PREPARE_PRIVATE_FIELDS +#undef UV_CHECK_PRIVATE_FIELDS +#undef UV_IDLE_PRIVATE_FIELDS +#undef UV_ASYNC_PRIVATE_FIELDS +#undef UV_TIMER_PRIVATE_FIELDS +#undef UV_GETADDRINFO_PRIVATE_FIELDS +#undef UV_GETNAMEINFO_PRIVATE_FIELDS +#undef UV_FS_REQ_PRIVATE_FIELDS +#undef UV_WORK_PRIVATE_FIELDS +#undef UV_FS_EVENT_PRIVATE_FIELDS +#undef UV_SIGNAL_PRIVATE_FIELDS +#undef UV_LOOP_PRIVATE_FIELDS +#undef UV_LOOP_PRIVATE_PLATFORM_FIELDS +#undef UV__ERR + +#ifdef __cplusplus +} +#endif +#endif /* UV_H */ diff --cc Utilities/cmlibuv/include/uv/unix.h index 3c1b363,0000000..011abcf mode 100644,000000..100644 --- a/Utilities/cmlibuv/include/uv/unix.h +++ b/Utilities/cmlibuv/include/uv/unix.h @@@ -1,497 -1,0 +1,504 @@@ +/* Copyright Joyent, Inc. and other Node contributors. All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +#ifndef UV_UNIX_H +#define UV_UNIX_H + +#include +#include +#include +#include + +#include +#include +#include +#include - #include ++#include /* MAXHOSTNAMELEN on Solaris */ + +#include +#include + +#if !defined(__MVS__) +#include ++#include /* MAXHOSTNAMELEN on Linux and the BSDs */ +#endif +#include +#include + +#include "threadpool.h" + +#ifdef CMAKE_BOOTSTRAP +# include "posix.h" +#elif defined(__linux__) +# include "linux.h" +#elif defined (__MVS__) +# include "os390.h" - #elif defined(__PASE__) - # include "posix.h" +#elif defined(_AIX) +# include "aix.h" +#elif defined(__sun) +# include "sunos.h" +#elif defined(__APPLE__) +# include "darwin.h" +#elif defined(__DragonFly__) || \ + defined(__FreeBSD__) || \ + defined(__FreeBSD_kernel__) || \ + defined(__OpenBSD__) || \ + defined(__NetBSD__) +# include "bsd.h" - #elif defined(__CYGWIN__) || defined(__MSYS__) ++#elif defined(__PASE__) || \ ++ defined(__CYGWIN__) || \ ++ defined(__MSYS__) || \ ++ defined(__GNU__) +# include "posix.h" - #elif defined(__GNU__) ++#elif defined(__HAIKU__) +# include "posix.h" +#endif + +#ifndef NI_MAXHOST +# define NI_MAXHOST 1025 +#endif + +#ifndef NI_MAXSERV +# define NI_MAXSERV 32 +#endif + +#ifndef UV_IO_PRIVATE_PLATFORM_FIELDS +# define UV_IO_PRIVATE_PLATFORM_FIELDS /* empty */ +#endif + +struct uv__io_s; +struct uv_loop_s; + +typedef void (*uv__io_cb)(struct uv_loop_s* loop, + struct uv__io_s* w, + unsigned int events); +typedef struct uv__io_s uv__io_t; + +struct uv__io_s { + uv__io_cb cb; + void* pending_queue[2]; + void* watcher_queue[2]; + unsigned int pevents; /* Pending event mask i.e. mask at next tick. */ + unsigned int events; /* Current event mask. */ + int fd; + UV_IO_PRIVATE_PLATFORM_FIELDS +}; + +#ifndef UV_PLATFORM_SEM_T +# define UV_PLATFORM_SEM_T sem_t +#endif + +#ifndef UV_PLATFORM_LOOP_FIELDS +# define UV_PLATFORM_LOOP_FIELDS /* empty */ +#endif + +#ifndef UV_PLATFORM_FS_EVENT_FIELDS +# define UV_PLATFORM_FS_EVENT_FIELDS /* empty */ +#endif + +#ifndef UV_STREAM_PRIVATE_PLATFORM_FIELDS +# define UV_STREAM_PRIVATE_PLATFORM_FIELDS /* empty */ +#endif + +/* Note: May be cast to struct iovec. See writev(2). */ +typedef struct uv_buf_t { + char* base; + size_t len; +} uv_buf_t; + +typedef int uv_file; +typedef int uv_os_sock_t; +typedef int uv_os_fd_t; +typedef pid_t uv_pid_t; + +#ifdef CMAKE_BOOTSTRAP +#define UV_ONCE_INIT 0 +typedef int uv_once_t; +typedef int uv_thread_t; +typedef int uv_mutex_t; +typedef int uv_rwlock_t; +typedef int uv_sem_t; +typedef int uv_cond_t; +typedef int uv_key_t; +typedef int uv_barrier_t; +#else +#define UV_ONCE_INIT PTHREAD_ONCE_INIT + +typedef pthread_once_t uv_once_t; +typedef pthread_t uv_thread_t; +typedef pthread_mutex_t uv_mutex_t; +typedef pthread_rwlock_t uv_rwlock_t; +typedef UV_PLATFORM_SEM_T uv_sem_t; +typedef pthread_cond_t uv_cond_t; +typedef pthread_key_t uv_key_t; + +/* Note: guard clauses should match uv_barrier_init's in src/unix/thread.c. */ - #if defined(_AIX) || !defined(PTHREAD_BARRIER_SERIAL_THREAD) ++#if defined(_AIX) || \ ++ defined(__OpenBSD__) || \ ++ !defined(PTHREAD_BARRIER_SERIAL_THREAD) +/* TODO(bnoordhuis) Merge into uv_barrier_t in v2. */ +struct _uv_barrier { + uv_mutex_t mutex; + uv_cond_t cond; + unsigned threshold; + unsigned in; + unsigned out; +}; + +typedef struct { + struct _uv_barrier* b; +# if defined(PTHREAD_BARRIER_SERIAL_THREAD) + /* TODO(bnoordhuis) Remove padding in v2. */ + char pad[sizeof(pthread_barrier_t) - sizeof(struct _uv_barrier*)]; +# endif +} uv_barrier_t; +#else +typedef pthread_barrier_t uv_barrier_t; +#endif + +#endif + +/* Platform-specific definitions for uv_spawn support. */ +typedef gid_t uv_gid_t; +typedef uid_t uv_uid_t; + +typedef struct dirent uv__dirent_t; + ++#define UV_DIR_PRIVATE_FIELDS \ ++ DIR* dir; ++ +#if defined(DT_UNKNOWN) +# define HAVE_DIRENT_TYPES +# if defined(DT_REG) +# define UV__DT_FILE DT_REG +# else +# define UV__DT_FILE -1 +# endif +# if defined(DT_DIR) +# define UV__DT_DIR DT_DIR +# else +# define UV__DT_DIR -2 +# endif +# if defined(DT_LNK) +# define UV__DT_LINK DT_LNK +# else +# define UV__DT_LINK -3 +# endif +# if defined(DT_FIFO) +# define UV__DT_FIFO DT_FIFO +# else +# define UV__DT_FIFO -4 +# endif +# if defined(DT_SOCK) +# define UV__DT_SOCKET DT_SOCK +# else +# define UV__DT_SOCKET -5 +# endif +# if defined(DT_CHR) +# define UV__DT_CHAR DT_CHR +# else +# define UV__DT_CHAR -6 +# endif +# if defined(DT_BLK) +# define UV__DT_BLOCK DT_BLK +# else +# define UV__DT_BLOCK -7 +# endif +#endif + +/* Platform-specific definitions for uv_dlopen support. */ +#define UV_DYNAMIC /* empty */ + +typedef struct { + void* handle; + char* errmsg; +} uv_lib_t; + +#define UV_LOOP_PRIVATE_FIELDS \ + unsigned long flags; \ + int backend_fd; \ + void* pending_queue[2]; \ + void* watcher_queue[2]; \ + uv__io_t** watchers; \ + unsigned int nwatchers; \ + unsigned int nfds; \ + void* wq[2]; \ + uv_mutex_t wq_mutex; \ + uv_async_t wq_async; \ + uv_rwlock_t cloexec_lock; \ + uv_handle_t* closing_handles; \ + void* process_handles[2]; \ + void* prepare_handles[2]; \ + void* check_handles[2]; \ + void* idle_handles[2]; \ + void* async_handles[2]; \ + void (*async_unused)(void); /* TODO(bnoordhuis) Remove in libuv v2. */ \ + uv__io_t async_io_watcher; \ + int async_wfd; \ + struct { \ + void* min; \ + unsigned int nelts; \ + } timer_heap; \ + uint64_t timer_counter; \ + uint64_t time; \ + int signal_pipefd[2]; \ + uv__io_t signal_io_watcher; \ + uv_signal_t child_watcher; \ + int emfile_fd; \ + UV_PLATFORM_LOOP_FIELDS \ + +#define UV_REQ_TYPE_PRIVATE /* empty */ + +#define UV_REQ_PRIVATE_FIELDS /* empty */ + +#define UV_PRIVATE_REQ_TYPES /* empty */ + +#define UV_WRITE_PRIVATE_FIELDS \ + void* queue[2]; \ + unsigned int write_index; \ + uv_buf_t* bufs; \ + unsigned int nbufs; \ + int error; \ + uv_buf_t bufsml[4]; \ + +#define UV_CONNECT_PRIVATE_FIELDS \ + void* queue[2]; \ + +#define UV_SHUTDOWN_PRIVATE_FIELDS /* empty */ + +#define UV_UDP_SEND_PRIVATE_FIELDS \ + void* queue[2]; \ + struct sockaddr_storage addr; \ + unsigned int nbufs; \ + uv_buf_t* bufs; \ + ssize_t status; \ + uv_udp_send_cb send_cb; \ + uv_buf_t bufsml[4]; \ + +#define UV_HANDLE_PRIVATE_FIELDS \ + uv_handle_t* next_closing; \ + unsigned int flags; \ + +#define UV_STREAM_PRIVATE_FIELDS \ + uv_connect_t *connect_req; \ + uv_shutdown_t *shutdown_req; \ + uv__io_t io_watcher; \ + void* write_queue[2]; \ + void* write_completed_queue[2]; \ + uv_connection_cb connection_cb; \ + int delayed_error; \ + int accepted_fd; \ + void* queued_fds; \ + UV_STREAM_PRIVATE_PLATFORM_FIELDS \ + +#define UV_TCP_PRIVATE_FIELDS /* empty */ + +#define UV_UDP_PRIVATE_FIELDS \ + uv_alloc_cb alloc_cb; \ + uv_udp_recv_cb recv_cb; \ + uv__io_t io_watcher; \ + void* write_queue[2]; \ + void* write_completed_queue[2]; \ + +#define UV_PIPE_PRIVATE_FIELDS \ + const char* pipe_fname; /* strdup'ed */ + +#define UV_POLL_PRIVATE_FIELDS \ + uv__io_t io_watcher; + +#define UV_PREPARE_PRIVATE_FIELDS \ + uv_prepare_cb prepare_cb; \ + void* queue[2]; \ + +#define UV_CHECK_PRIVATE_FIELDS \ + uv_check_cb check_cb; \ + void* queue[2]; \ + +#define UV_IDLE_PRIVATE_FIELDS \ + uv_idle_cb idle_cb; \ + void* queue[2]; \ + +#define UV_ASYNC_PRIVATE_FIELDS \ + uv_async_cb async_cb; \ + void* queue[2]; \ + int pending; \ + +#define UV_TIMER_PRIVATE_FIELDS \ + uv_timer_cb timer_cb; \ + void* heap_node[3]; \ + uint64_t timeout; \ + uint64_t repeat; \ + uint64_t start_id; + +#define UV_GETADDRINFO_PRIVATE_FIELDS \ + struct uv__work work_req; \ + uv_getaddrinfo_cb cb; \ + struct addrinfo* hints; \ + char* hostname; \ + char* service; \ + struct addrinfo* addrinfo; \ + int retcode; + +#define UV_GETNAMEINFO_PRIVATE_FIELDS \ + struct uv__work work_req; \ + uv_getnameinfo_cb getnameinfo_cb; \ + struct sockaddr_storage storage; \ + int flags; \ + char host[NI_MAXHOST]; \ + char service[NI_MAXSERV]; \ + int retcode; + +#define UV_PROCESS_PRIVATE_FIELDS \ + void* queue[2]; \ + int status; \ + +#define UV_FS_PRIVATE_FIELDS \ + const char *new_path; \ + uv_file file; \ + int flags; \ + mode_t mode; \ + unsigned int nbufs; \ + uv_buf_t* bufs; \ + off_t off; \ + uv_uid_t uid; \ + uv_gid_t gid; \ + double atime; \ + double mtime; \ + struct uv__work work_req; \ + uv_buf_t bufsml[4]; \ + +#define UV_WORK_PRIVATE_FIELDS \ + struct uv__work work_req; + +#define UV_TTY_PRIVATE_FIELDS \ + struct termios orig_termios; \ + int mode; + +#define UV_SIGNAL_PRIVATE_FIELDS \ + /* RB_ENTRY(uv_signal_s) tree_entry; */ \ + struct { \ + struct uv_signal_s* rbe_left; \ + struct uv_signal_s* rbe_right; \ + struct uv_signal_s* rbe_parent; \ + int rbe_color; \ + } tree_entry; \ + /* Use two counters here so we don have to fiddle with atomics. */ \ + unsigned int caught_signals; \ + unsigned int dispatched_signals; + +#define UV_FS_EVENT_PRIVATE_FIELDS \ + uv_fs_event_cb cb; \ + UV_PLATFORM_FS_EVENT_FIELDS \ + +/* fs open() flags supported on this platform: */ +#if defined(O_APPEND) +# define UV_FS_O_APPEND O_APPEND +#else +# define UV_FS_O_APPEND 0 +#endif +#if defined(O_CREAT) +# define UV_FS_O_CREAT O_CREAT +#else +# define UV_FS_O_CREAT 0 +#endif +#if defined(O_DIRECT) +# define UV_FS_O_DIRECT O_DIRECT +#else +# define UV_FS_O_DIRECT 0 +#endif +#if defined(O_DIRECTORY) +# define UV_FS_O_DIRECTORY O_DIRECTORY +#else +# define UV_FS_O_DIRECTORY 0 +#endif +#if defined(O_DSYNC) +# define UV_FS_O_DSYNC O_DSYNC +#else +# define UV_FS_O_DSYNC 0 +#endif +#if defined(O_EXCL) +# define UV_FS_O_EXCL O_EXCL +#else +# define UV_FS_O_EXCL 0 +#endif +#if defined(O_EXLOCK) +# define UV_FS_O_EXLOCK O_EXLOCK +#else +# define UV_FS_O_EXLOCK 0 +#endif +#if defined(O_NOATIME) +# define UV_FS_O_NOATIME O_NOATIME +#else +# define UV_FS_O_NOATIME 0 +#endif +#if defined(O_NOCTTY) +# define UV_FS_O_NOCTTY O_NOCTTY +#else +# define UV_FS_O_NOCTTY 0 +#endif +#if defined(O_NOFOLLOW) +# define UV_FS_O_NOFOLLOW O_NOFOLLOW +#else +# define UV_FS_O_NOFOLLOW 0 +#endif +#if defined(O_NONBLOCK) +# define UV_FS_O_NONBLOCK O_NONBLOCK +#else +# define UV_FS_O_NONBLOCK 0 +#endif +#if defined(O_RDONLY) +# define UV_FS_O_RDONLY O_RDONLY +#else +# define UV_FS_O_RDONLY 0 +#endif +#if defined(O_RDWR) +# define UV_FS_O_RDWR O_RDWR +#else +# define UV_FS_O_RDWR 0 +#endif +#if defined(O_SYMLINK) +# define UV_FS_O_SYMLINK O_SYMLINK +#else +# define UV_FS_O_SYMLINK 0 +#endif +#if defined(O_SYNC) +# define UV_FS_O_SYNC O_SYNC +#else +# define UV_FS_O_SYNC 0 +#endif +#if defined(O_TRUNC) +# define UV_FS_O_TRUNC O_TRUNC +#else +# define UV_FS_O_TRUNC 0 +#endif +#if defined(O_WRONLY) +# define UV_FS_O_WRONLY O_WRONLY +#else +# define UV_FS_O_WRONLY 0 +#endif + +/* fs open() flags supported on other platforms: */ +#define UV_FS_O_RANDOM 0 +#define UV_FS_O_SHORT_LIVED 0 +#define UV_FS_O_SEQUENTIAL 0 +#define UV_FS_O_TEMPORARY 0 + +#endif /* UV_UNIX_H */ diff --cc Utilities/cmlibuv/include/uv/win.h index f3d3809,0000000..7f77cc2 mode 100644,000000..100644 --- a/Utilities/cmlibuv/include/uv/win.h +++ b/Utilities/cmlibuv/include/uv/win.h @@@ -1,696 -1,0 +1,701 @@@ +/* Copyright Joyent, Inc. and other Node contributors. All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +#ifndef _WIN32_WINNT +# define _WIN32_WINNT 0x0600 +#endif + +#if !defined(_SSIZE_T_) && !defined(_SSIZE_T_DEFINED) +typedef intptr_t ssize_t; +# define SSIZE_MAX INTPTR_MAX +# define _SSIZE_T_ +# define _SSIZE_T_DEFINED +#endif + +#include + +#if defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR) +typedef struct pollfd { + SOCKET fd; + short events; + short revents; +} WSAPOLLFD, *PWSAPOLLFD, *LPWSAPOLLFD; +#endif + +#ifndef LOCALE_INVARIANT +# define LOCALE_INVARIANT 0x007f +#endif + +#include +#include +#include + +#include +#include +#include +#include + +#if defined(_MSC_VER) && _MSC_VER < 1600 +# include "stdint-msvc2008.h" +#else +# include +#endif + +#include "tree.h" +#include "threadpool.h" + +#define MAX_PIPENAME_LEN 256 + +#ifndef S_IFLNK +# define S_IFLNK 0xA000 +#endif + +/* Additional signals supported by uv_signal and or uv_kill. The CRT defines + * the following signals already: + * + * #define SIGINT 2 + * #define SIGILL 4 + * #define SIGABRT_COMPAT 6 + * #define SIGFPE 8 + * #define SIGSEGV 11 + * #define SIGTERM 15 + * #define SIGBREAK 21 + * #define SIGABRT 22 + * + * The additional signals have values that are common on other Unix + * variants (Linux and Darwin) + */ +#define SIGHUP 1 +#define SIGKILL 9 +#define SIGWINCH 28 + +/* Redefine NSIG to take SIGWINCH into consideration */ +#if defined(NSIG) && NSIG <= SIGWINCH +# undef NSIG +#endif +#ifndef NSIG +# define NSIG SIGWINCH + 1 +#endif + +/* The CRT defines SIGABRT_COMPAT as 6, which equals SIGABRT on many unix-like + * platforms. However MinGW doesn't define it, so we do. */ +#ifndef SIGABRT_COMPAT +# define SIGABRT_COMPAT 6 +#endif + +/* + * Guids and typedefs for winsock extension functions + * Mingw32 doesn't have these :-( + */ +#ifndef WSAID_ACCEPTEX +# define WSAID_ACCEPTEX \ + {0xb5367df1, 0xcbac, 0x11cf, \ + {0x95, 0xca, 0x00, 0x80, 0x5f, 0x48, 0xa1, 0x92}} +#endif + +#ifndef WSAID_CONNECTEX +# define WSAID_CONNECTEX \ + {0x25a207b9, 0xddf3, 0x4660, \ + {0x8e, 0xe9, 0x76, 0xe5, 0x8c, 0x74, 0x06, 0x3e}} +#endif + +#ifndef WSAID_GETACCEPTEXSOCKADDRS +# define WSAID_GETACCEPTEXSOCKADDRS \ + {0xb5367df2, 0xcbac, 0x11cf, \ + {0x95, 0xca, 0x00, 0x80, 0x5f, 0x48, 0xa1, 0x92}} +#endif + +#ifndef WSAID_DISCONNECTEX +# define WSAID_DISCONNECTEX \ + {0x7fda2e11, 0x8630, 0x436f, \ + {0xa0, 0x31, 0xf5, 0x36, 0xa6, 0xee, 0xc1, 0x57}} +#endif + +#ifndef WSAID_TRANSMITFILE +# define WSAID_TRANSMITFILE \ + {0xb5367df0, 0xcbac, 0x11cf, \ + {0x95, 0xca, 0x00, 0x80, 0x5f, 0x48, 0xa1, 0x92}} +#endif + +#if (defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR)) \ + || (defined(_MSC_VER) && _MSC_VER < 1500) + typedef BOOL (PASCAL *LPFN_ACCEPTEX) + (SOCKET sListenSocket, + SOCKET sAcceptSocket, + PVOID lpOutputBuffer, + DWORD dwReceiveDataLength, + DWORD dwLocalAddressLength, + DWORD dwRemoteAddressLength, + LPDWORD lpdwBytesReceived, + LPOVERLAPPED lpOverlapped); + + typedef BOOL (PASCAL *LPFN_CONNECTEX) + (SOCKET s, + const struct sockaddr* name, + int namelen, + PVOID lpSendBuffer, + DWORD dwSendDataLength, + LPDWORD lpdwBytesSent, + LPOVERLAPPED lpOverlapped); + + typedef void (PASCAL *LPFN_GETACCEPTEXSOCKADDRS) + (PVOID lpOutputBuffer, + DWORD dwReceiveDataLength, + DWORD dwLocalAddressLength, + DWORD dwRemoteAddressLength, + LPSOCKADDR* LocalSockaddr, + LPINT LocalSockaddrLength, + LPSOCKADDR* RemoteSockaddr, + LPINT RemoteSockaddrLength); + + typedef BOOL (PASCAL *LPFN_DISCONNECTEX) + (SOCKET hSocket, + LPOVERLAPPED lpOverlapped, + DWORD dwFlags, + DWORD reserved); + + typedef BOOL (PASCAL *LPFN_TRANSMITFILE) + (SOCKET hSocket, + HANDLE hFile, + DWORD nNumberOfBytesToWrite, + DWORD nNumberOfBytesPerSend, + LPOVERLAPPED lpOverlapped, + LPTRANSMIT_FILE_BUFFERS lpTransmitBuffers, + DWORD dwFlags); + + typedef PVOID RTL_SRWLOCK; + typedef RTL_SRWLOCK SRWLOCK, *PSRWLOCK; +#endif + +typedef int (WSAAPI* LPFN_WSARECV) + (SOCKET socket, + LPWSABUF buffers, + DWORD buffer_count, + LPDWORD bytes, + LPDWORD flags, + LPWSAOVERLAPPED overlapped, + LPWSAOVERLAPPED_COMPLETION_ROUTINE completion_routine); + +typedef int (WSAAPI* LPFN_WSARECVFROM) + (SOCKET socket, + LPWSABUF buffers, + DWORD buffer_count, + LPDWORD bytes, + LPDWORD flags, + struct sockaddr* addr, + LPINT addr_len, + LPWSAOVERLAPPED overlapped, + LPWSAOVERLAPPED_COMPLETION_ROUTINE completion_routine); + +#ifndef _NTDEF_ + typedef LONG NTSTATUS; + typedef NTSTATUS *PNTSTATUS; +#endif + +#ifndef RTL_CONDITION_VARIABLE_INIT + typedef PVOID CONDITION_VARIABLE, *PCONDITION_VARIABLE; +#endif + +typedef struct _AFD_POLL_HANDLE_INFO { + HANDLE Handle; + ULONG Events; + NTSTATUS Status; +} AFD_POLL_HANDLE_INFO, *PAFD_POLL_HANDLE_INFO; + +typedef struct _AFD_POLL_INFO { + LARGE_INTEGER Timeout; + ULONG NumberOfHandles; + ULONG Exclusive; + AFD_POLL_HANDLE_INFO Handles[1]; +} AFD_POLL_INFO, *PAFD_POLL_INFO; + +#define UV_MSAFD_PROVIDER_COUNT 3 + + +/** + * It should be possible to cast uv_buf_t[] to WSABUF[] + * see http://msdn.microsoft.com/en-us/library/ms741542(v=vs.85).aspx + */ +typedef struct uv_buf_t { + ULONG len; + char* base; +} uv_buf_t; + +typedef int uv_file; +typedef SOCKET uv_os_sock_t; +typedef HANDLE uv_os_fd_t; +typedef int uv_pid_t; + +typedef HANDLE uv_thread_t; + +typedef HANDLE uv_sem_t; + +typedef CRITICAL_SECTION uv_mutex_t; + +/* This condition variable implementation is based on the SetEvent solution + * (section 3.2) at http://www.cs.wustl.edu/~schmidt/win32-cv-1.html + * We could not use the SignalObjectAndWait solution (section 3.4) because + * it want the 2nd argument (type uv_mutex_t) of uv_cond_wait() and + * uv_cond_timedwait() to be HANDLEs, but we use CRITICAL_SECTIONs. + */ + +typedef union { + CONDITION_VARIABLE cond_var; + struct { + unsigned int waiters_count; + CRITICAL_SECTION waiters_count_lock; + HANDLE signal_event; + HANDLE broadcast_event; + } unused_; /* TODO: retained for ABI compatibility; remove me in v2.x. */ +} uv_cond_t; + +typedef union { + struct { + unsigned int num_readers_; + CRITICAL_SECTION num_readers_lock_; + HANDLE write_semaphore_; + } state_; + /* TODO: remove me in v2.x. */ + struct { + SRWLOCK unused_; + } unused1_; + /* TODO: remove me in v2.x. */ + struct { + uv_mutex_t unused1_; + uv_mutex_t unused2_; + } unused2_; +} uv_rwlock_t; + +typedef struct { + unsigned int n; + unsigned int count; + uv_mutex_t mutex; + uv_sem_t turnstile1; + uv_sem_t turnstile2; +} uv_barrier_t; + +typedef struct { + DWORD tls_index; +} uv_key_t; + +#define UV_ONCE_INIT { 0, NULL } + +typedef struct uv_once_s { + unsigned char ran; + HANDLE event; +} uv_once_t; + +/* Platform-specific definitions for uv_spawn support. */ +typedef unsigned char uv_uid_t; +typedef unsigned char uv_gid_t; + +typedef struct uv__dirent_s { + int d_type; + char d_name[1]; +} uv__dirent_t; + ++#define UV_DIR_PRIVATE_FIELDS \ ++ HANDLE dir_handle; \ ++ WIN32_FIND_DATAW find_data; \ ++ BOOL need_find_call; ++ +#define HAVE_DIRENT_TYPES +#define UV__DT_DIR UV_DIRENT_DIR +#define UV__DT_FILE UV_DIRENT_FILE +#define UV__DT_LINK UV_DIRENT_LINK +#define UV__DT_FIFO UV_DIRENT_FIFO +#define UV__DT_SOCKET UV_DIRENT_SOCKET +#define UV__DT_CHAR UV_DIRENT_CHAR +#define UV__DT_BLOCK UV_DIRENT_BLOCK + +/* Platform-specific definitions for uv_dlopen support. */ +#define UV_DYNAMIC FAR WINAPI +typedef struct { + HMODULE handle; + char* errmsg; +} uv_lib_t; + +#define UV_LOOP_PRIVATE_FIELDS \ + /* The loop's I/O completion port */ \ + HANDLE iocp; \ + /* The current time according to the event loop. in msecs. */ \ + uint64_t time; \ + /* Tail of a single-linked circular queue of pending reqs. If the queue */ \ + /* is empty, tail_ is NULL. If there is only one item, */ \ + /* tail_->next_req == tail_ */ \ + uv_req_t* pending_reqs_tail; \ + /* Head of a single-linked list of closed handles */ \ + uv_handle_t* endgame_handles; \ + /* TODO(bnoordhuis) Stop heap-allocating |timer_heap| in libuv v2.x. */ \ + void* timer_heap; \ + /* Lists of active loop (prepare / check / idle) watchers */ \ + uv_prepare_t* prepare_handles; \ + uv_check_t* check_handles; \ + uv_idle_t* idle_handles; \ + /* This pointer will refer to the prepare/check/idle handle whose */ \ + /* callback is scheduled to be called next. This is needed to allow */ \ + /* safe removal from one of the lists above while that list being */ \ + /* iterated over. */ \ + uv_prepare_t* next_prepare_handle; \ + uv_check_t* next_check_handle; \ + uv_idle_t* next_idle_handle; \ + /* This handle holds the peer sockets for the fast variant of uv_poll_t */ \ + SOCKET poll_peer_sockets[UV_MSAFD_PROVIDER_COUNT]; \ + /* Counter to keep track of active tcp streams */ \ + unsigned int active_tcp_streams; \ + /* Counter to keep track of active udp streams */ \ + unsigned int active_udp_streams; \ + /* Counter to started timer */ \ + uint64_t timer_counter; \ + /* Threadpool */ \ + void* wq[2]; \ + uv_mutex_t wq_mutex; \ + uv_async_t wq_async; + +#define UV_REQ_TYPE_PRIVATE \ + /* TODO: remove the req suffix */ \ + UV_ACCEPT, \ + UV_FS_EVENT_REQ, \ + UV_POLL_REQ, \ + UV_PROCESS_EXIT, \ + UV_READ, \ + UV_UDP_RECV, \ + UV_WAKEUP, \ + UV_SIGNAL_REQ, + +#define UV_REQ_PRIVATE_FIELDS \ + union { \ + /* Used by I/O operations */ \ + struct { \ + OVERLAPPED overlapped; \ + size_t queued_bytes; \ + } io; \ + } u; \ + struct uv_req_s* next_req; + +#define UV_WRITE_PRIVATE_FIELDS \ + int coalesced; \ + uv_buf_t write_buffer; \ + HANDLE event_handle; \ + HANDLE wait_handle; + +#define UV_CONNECT_PRIVATE_FIELDS \ + /* empty */ + +#define UV_SHUTDOWN_PRIVATE_FIELDS \ + /* empty */ + +#define UV_UDP_SEND_PRIVATE_FIELDS \ + /* empty */ + +#define UV_PRIVATE_REQ_TYPES \ + typedef struct uv_pipe_accept_s { \ + UV_REQ_FIELDS \ + HANDLE pipeHandle; \ + struct uv_pipe_accept_s* next_pending; \ + } uv_pipe_accept_t; \ + \ + typedef struct uv_tcp_accept_s { \ + UV_REQ_FIELDS \ + SOCKET accept_socket; \ + char accept_buffer[sizeof(struct sockaddr_storage) * 2 + 32]; \ + HANDLE event_handle; \ + HANDLE wait_handle; \ + struct uv_tcp_accept_s* next_pending; \ + } uv_tcp_accept_t; \ + \ + typedef struct uv_read_s { \ + UV_REQ_FIELDS \ + HANDLE event_handle; \ + HANDLE wait_handle; \ + } uv_read_t; + +#define uv_stream_connection_fields \ + unsigned int write_reqs_pending; \ + uv_shutdown_t* shutdown_req; + +#define uv_stream_server_fields \ + uv_connection_cb connection_cb; + +#define UV_STREAM_PRIVATE_FIELDS \ + unsigned int reqs_pending; \ + int activecnt; \ + uv_read_t read_req; \ + union { \ + struct { uv_stream_connection_fields } conn; \ + struct { uv_stream_server_fields } serv; \ + } stream; + +#define uv_tcp_server_fields \ + uv_tcp_accept_t* accept_reqs; \ + unsigned int processed_accepts; \ + uv_tcp_accept_t* pending_accepts; \ + LPFN_ACCEPTEX func_acceptex; + +#define uv_tcp_connection_fields \ + uv_buf_t read_buffer; \ + LPFN_CONNECTEX func_connectex; + +#define UV_TCP_PRIVATE_FIELDS \ + SOCKET socket; \ + int delayed_error; \ + union { \ + struct { uv_tcp_server_fields } serv; \ + struct { uv_tcp_connection_fields } conn; \ + } tcp; + +#define UV_UDP_PRIVATE_FIELDS \ + SOCKET socket; \ + unsigned int reqs_pending; \ + int activecnt; \ + uv_req_t recv_req; \ + uv_buf_t recv_buffer; \ + struct sockaddr_storage recv_from; \ + int recv_from_len; \ + uv_udp_recv_cb recv_cb; \ + uv_alloc_cb alloc_cb; \ + LPFN_WSARECV func_wsarecv; \ + LPFN_WSARECVFROM func_wsarecvfrom; + +#define uv_pipe_server_fields \ + int pending_instances; \ + uv_pipe_accept_t* accept_reqs; \ + uv_pipe_accept_t* pending_accepts; + +#define uv_pipe_connection_fields \ + uv_timer_t* eof_timer; \ + uv_write_t dummy; /* TODO: retained for ABI compat; remove this in v2.x. */ \ + DWORD ipc_remote_pid; \ + union { \ + uint32_t payload_remaining; \ + uint64_t dummy; /* TODO: retained for ABI compat; remove this in v2.x. */ \ + } ipc_data_frame; \ + void* ipc_xfer_queue[2]; \ + int ipc_xfer_queue_length; \ + uv_write_t* non_overlapped_writes_tail; \ + CRITICAL_SECTION readfile_thread_lock; \ + volatile HANDLE readfile_thread_handle; + +#define UV_PIPE_PRIVATE_FIELDS \ + HANDLE handle; \ + WCHAR* name; \ + union { \ + struct { uv_pipe_server_fields } serv; \ + struct { uv_pipe_connection_fields } conn; \ + } pipe; + +/* TODO: put the parser states in an union - TTY handles are always half-duplex + * so read-state can safely overlap write-state. */ +#define UV_TTY_PRIVATE_FIELDS \ + HANDLE handle; \ + union { \ + struct { \ + /* Used for readable TTY handles */ \ + /* TODO: remove me in v2.x. */ \ + HANDLE unused_; \ + uv_buf_t read_line_buffer; \ + HANDLE read_raw_wait; \ + /* Fields used for translating win keystrokes into vt100 characters */ \ + char last_key[8]; \ + unsigned char last_key_offset; \ + unsigned char last_key_len; \ + WCHAR last_utf16_high_surrogate; \ + INPUT_RECORD last_input_record; \ + } rd; \ + struct { \ + /* Used for writable TTY handles */ \ + /* utf8-to-utf16 conversion state */ \ + unsigned int utf8_codepoint; \ + unsigned char utf8_bytes_left; \ + /* eol conversion state */ \ + unsigned char previous_eol; \ + /* ansi parser state */ \ + unsigned char ansi_parser_state; \ + unsigned char ansi_csi_argc; \ + unsigned short ansi_csi_argv[4]; \ + COORD saved_position; \ + WORD saved_attributes; \ + } wr; \ + } tty; + +#define UV_POLL_PRIVATE_FIELDS \ + SOCKET socket; \ + /* Used in fast mode */ \ + SOCKET peer_socket; \ + AFD_POLL_INFO afd_poll_info_1; \ + AFD_POLL_INFO afd_poll_info_2; \ + /* Used in fast and slow mode. */ \ + uv_req_t poll_req_1; \ + uv_req_t poll_req_2; \ + unsigned char submitted_events_1; \ + unsigned char submitted_events_2; \ + unsigned char mask_events_1; \ + unsigned char mask_events_2; \ + unsigned char events; + +#define UV_TIMER_PRIVATE_FIELDS \ + void* heap_node[3]; \ + int unused; \ + uint64_t timeout; \ + uint64_t repeat; \ + uint64_t start_id; \ + uv_timer_cb timer_cb; + +#define UV_ASYNC_PRIVATE_FIELDS \ + struct uv_req_s async_req; \ + uv_async_cb async_cb; \ + /* char to avoid alignment issues */ \ + char volatile async_sent; + +#define UV_PREPARE_PRIVATE_FIELDS \ + uv_prepare_t* prepare_prev; \ + uv_prepare_t* prepare_next; \ + uv_prepare_cb prepare_cb; + +#define UV_CHECK_PRIVATE_FIELDS \ + uv_check_t* check_prev; \ + uv_check_t* check_next; \ + uv_check_cb check_cb; + +#define UV_IDLE_PRIVATE_FIELDS \ + uv_idle_t* idle_prev; \ + uv_idle_t* idle_next; \ + uv_idle_cb idle_cb; + +#define UV_HANDLE_PRIVATE_FIELDS \ + uv_handle_t* endgame_next; \ + unsigned int flags; + +#define UV_GETADDRINFO_PRIVATE_FIELDS \ + struct uv__work work_req; \ + uv_getaddrinfo_cb getaddrinfo_cb; \ + void* alloc; \ + WCHAR* node; \ + WCHAR* service; \ + /* The addrinfoW field is used to store a pointer to the hints, and */ \ + /* later on to store the result of GetAddrInfoW. The final result will */ \ + /* be converted to struct addrinfo* and stored in the addrinfo field. */ \ + struct addrinfoW* addrinfow; \ + struct addrinfo* addrinfo; \ + int retcode; + +#define UV_GETNAMEINFO_PRIVATE_FIELDS \ + struct uv__work work_req; \ + uv_getnameinfo_cb getnameinfo_cb; \ + struct sockaddr_storage storage; \ + int flags; \ + char host[NI_MAXHOST]; \ + char service[NI_MAXSERV]; \ + int retcode; + +#define UV_PROCESS_PRIVATE_FIELDS \ + struct uv_process_exit_s { \ + UV_REQ_FIELDS \ + } exit_req; \ + BYTE* child_stdio_buffer; \ + int exit_signal; \ + HANDLE wait_handle; \ + HANDLE process_handle; \ + volatile char exit_cb_pending; + +#define UV_FS_PRIVATE_FIELDS \ + struct uv__work work_req; \ + int flags; \ + DWORD sys_errno_; \ + union { \ + /* TODO: remove me in 0.9. */ \ + WCHAR* pathw; \ + int fd; \ + } file; \ + union { \ + struct { \ + int mode; \ + WCHAR* new_pathw; \ + int file_flags; \ + int fd_out; \ + unsigned int nbufs; \ + uv_buf_t* bufs; \ + int64_t offset; \ + uv_buf_t bufsml[4]; \ + } info; \ + struct { \ + double atime; \ + double mtime; \ + } time; \ + } fs; + +#define UV_WORK_PRIVATE_FIELDS \ + struct uv__work work_req; + +#define UV_FS_EVENT_PRIVATE_FIELDS \ + struct uv_fs_event_req_s { \ + UV_REQ_FIELDS \ + } req; \ + HANDLE dir_handle; \ + int req_pending; \ + uv_fs_event_cb cb; \ + WCHAR* filew; \ + WCHAR* short_filew; \ + WCHAR* dirw; \ + char* buffer; + +#define UV_SIGNAL_PRIVATE_FIELDS \ + RB_ENTRY(uv_signal_s) tree_entry; \ + struct uv_req_s signal_req; \ + unsigned long pending_signum; + +#ifndef F_OK +#define F_OK 0 +#endif +#ifndef R_OK +#define R_OK 4 +#endif +#ifndef W_OK +#define W_OK 2 +#endif +#ifndef X_OK +#define X_OK 1 +#endif + +/* fs open() flags supported on this platform: */ +#define UV_FS_O_APPEND _O_APPEND +#define UV_FS_O_CREAT _O_CREAT +#define UV_FS_O_EXCL _O_EXCL +#define UV_FS_O_RANDOM _O_RANDOM +#define UV_FS_O_RDONLY _O_RDONLY +#define UV_FS_O_RDWR _O_RDWR +#define UV_FS_O_SEQUENTIAL _O_SEQUENTIAL +#define UV_FS_O_SHORT_LIVED _O_SHORT_LIVED +#define UV_FS_O_TEMPORARY _O_TEMPORARY +#define UV_FS_O_TRUNC _O_TRUNC +#define UV_FS_O_WRONLY _O_WRONLY + +/* fs open() flags supported on other platforms (or mapped on this platform): */ +#define UV_FS_O_DIRECT 0x02000000 /* FILE_FLAG_NO_BUFFERING */ +#define UV_FS_O_DIRECTORY 0 +#define UV_FS_O_DSYNC 0x04000000 /* FILE_FLAG_WRITE_THROUGH */ +#define UV_FS_O_EXLOCK 0x10000000 /* EXCLUSIVE SHARING MODE */ +#define UV_FS_O_NOATIME 0 +#define UV_FS_O_NOCTTY 0 +#define UV_FS_O_NOFOLLOW 0 +#define UV_FS_O_NONBLOCK 0 +#define UV_FS_O_SYMLINK 0 +#define UV_FS_O_SYNC 0x08000000 /* FILE_FLAG_WRITE_THROUGH */ diff --cc Utilities/cmlibuv/src/unix/atomic-ops.h index be741dc,0000000..995aca6 mode 100644,000000..100644 --- a/Utilities/cmlibuv/src/unix/atomic-ops.h +++ b/Utilities/cmlibuv/src/unix/atomic-ops.h @@@ -1,100 -1,0 +1,63 @@@ +/* Copyright (c) 2013, Ben Noordhuis + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef UV_ATOMIC_OPS_H_ +#define UV_ATOMIC_OPS_H_ + +#include "internal.h" /* UV_UNUSED */ + +#if defined(__SUNPRO_C) || defined(__SUNPRO_CC) +#include +#endif + +UV_UNUSED(static int cmpxchgi(int* ptr, int oldval, int newval)); - UV_UNUSED(static long cmpxchgl(long* ptr, long oldval, long newval)); +UV_UNUSED(static void cpu_relax(void)); + +/* Prefer hand-rolled assembly over the gcc builtins because the latter also + * issue full memory barriers. + */ +UV_UNUSED(static int cmpxchgi(int* ptr, int oldval, int newval)) { +#if defined(__i386__) || defined(__x86_64__) + int out; + __asm__ __volatile__ ("lock; cmpxchg %2, %1;" + : "=a" (out), "+m" (*(volatile int*) ptr) + : "r" (newval), "0" (oldval) + : "memory"); + return out; +#elif defined(_AIX) && (defined(__xlC__) || defined(__ibmxl__)) + const int out = (*(volatile int*) ptr); + __compare_and_swap(ptr, &oldval, newval); + return out; +#elif defined(__MVS__) + unsigned int op4; + if (__plo_CSST(ptr, (unsigned int*) &oldval, newval, + (unsigned int*) ptr, *ptr, &op4)) + return oldval; + else + return op4; +#elif defined(__SUNPRO_C) || defined(__SUNPRO_CC) - return atomic_cas_uint(ptr, oldval, newval); - #else - return __sync_val_compare_and_swap(ptr, oldval, newval); - #endif - } - - UV_UNUSED(static long cmpxchgl(long* ptr, long oldval, long newval)) { - #if defined(__i386__) || defined(__x86_64__) - long out; - __asm__ __volatile__ ("lock; cmpxchg %2, %1;" - : "=a" (out), "+m" (*(volatile long*) ptr) - : "r" (newval), "0" (oldval) - : "memory"); - return out; - #elif defined(_AIX) && (defined(__xlC__) || defined(__ibmxl__)) - const long out = (*(volatile int*) ptr); - # if defined(__64BIT__) - __compare_and_swaplp(ptr, &oldval, newval); - # else - __compare_and_swap(ptr, &oldval, newval); - # endif /* if defined(__64BIT__) */ - return out; - #elif defined (__MVS__) - #ifdef _LP64 - unsigned long long op4; - if (__plo_CSSTGR(ptr, (unsigned long long*) &oldval, newval, - (unsigned long long*) ptr, *ptr, &op4)) - #else - unsigned long op4; - if (__plo_CSST(ptr, (unsigned int*) &oldval, newval, - (unsigned int*) ptr, *ptr, &op4)) - #endif - return oldval; - else - return op4; - #elif defined(__SUNPRO_C) || defined(__SUNPRO_CC) - return atomic_cas_ulong(ptr, oldval, newval); ++ return atomic_cas_uint((uint_t *)ptr, (uint_t)oldval, (uint_t)newval); +#else + return __sync_val_compare_and_swap(ptr, oldval, newval); +#endif +} + +UV_UNUSED(static void cpu_relax(void)) { +#if defined(__i386__) || defined(__x86_64__) + __asm__ __volatile__ ("rep; nop"); /* a.k.a. PAUSE */ +#endif +} + +#endif /* UV_ATOMIC_OPS_H_ */ diff --cc Utilities/cmlibuv/src/unix/core.c index a8d6adb,0000000..93df7af mode 100644,000000..100644 --- a/Utilities/cmlibuv/src/unix/core.c +++ b/Utilities/cmlibuv/src/unix/core.c @@@ -1,1428 -1,0 +1,1490 @@@ +/* Copyright Joyent, Inc. and other Node contributors. All rights reserved. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +#include "uv.h" +#include "internal.h" + +#include /* NULL */ +#include /* printf */ +#include +#include /* strerror */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include /* INT_MAX, PATH_MAX, IOV_MAX */ +#include /* writev */ +#include /* getrusage */ +#include +#include +#include ++#include + +#ifdef __sun - # include /* MAXHOSTNAMELEN on Solaris */ +# include +# include +# include +#endif + +#ifdef __APPLE__ +# include /* _NSGetExecutablePath */ +# include +# if defined(O_CLOEXEC) +# define UV__O_CLOEXEC O_CLOEXEC +# endif +#endif + +#if defined(__DragonFly__) || \ + defined(__FreeBSD__) || \ + defined(__FreeBSD_kernel__) || \ + defined(__NetBSD__) +# include +# include +# include +# include +# include +# define UV__O_CLOEXEC O_CLOEXEC +# if defined(__FreeBSD__) && __FreeBSD__ >= 10 +# define uv__accept4 accept4 +# endif +# if defined(__NetBSD__) +# define uv__accept4(a, b, c, d) paccept((a), (b), (c), NULL, (d)) +# endif +# if (defined(__FreeBSD__) && __FreeBSD__ >= 10) || defined(__NetBSD__) +# define UV__SOCK_NONBLOCK SOCK_NONBLOCK +# define UV__SOCK_CLOEXEC SOCK_CLOEXEC +# endif +# if !defined(F_DUP2FD_CLOEXEC) && defined(_F_DUP2FD_CLOEXEC) +# define F_DUP2FD_CLOEXEC _F_DUP2FD_CLOEXEC +# endif +#endif + +#if defined(__ANDROID_API__) && __ANDROID_API__ < 21 +# include /* for dlsym */ +#endif + +#if defined(__MVS__) +#include +#endif + - #if !defined(__MVS__) - #include /* MAXHOSTNAMELEN on Linux and the BSDs */ - #endif - - /* Fallback for the maximum hostname length */ - #ifndef MAXHOSTNAMELEN - # define MAXHOSTNAMELEN 256 ++#if defined(__linux__) ++#include +#endif + +static int uv__run_pending(uv_loop_t* loop); + +/* Verify that uv_buf_t is ABI-compatible with struct iovec. */ +STATIC_ASSERT(sizeof(uv_buf_t) == sizeof(struct iovec)); +STATIC_ASSERT(sizeof(&((uv_buf_t*) 0)->base) == + sizeof(((struct iovec*) 0)->iov_base)); +STATIC_ASSERT(sizeof(&((uv_buf_t*) 0)->len) == + sizeof(((struct iovec*) 0)->iov_len)); +STATIC_ASSERT(offsetof(uv_buf_t, base) == offsetof(struct iovec, iov_base)); +STATIC_ASSERT(offsetof(uv_buf_t, len) == offsetof(struct iovec, iov_len)); + + +uint64_t uv_hrtime(void) { + return uv__hrtime(UV_CLOCK_PRECISE); +} + + +void uv_close(uv_handle_t* handle, uv_close_cb close_cb) { + assert(!uv__is_closing(handle)); + + handle->flags |= UV_HANDLE_CLOSING; + handle->close_cb = close_cb; + + switch (handle->type) { + case UV_NAMED_PIPE: + uv__pipe_close((uv_pipe_t*)handle); + break; + + case UV_TTY: + uv__stream_close((uv_stream_t*)handle); + break; + + case UV_TCP: + uv__tcp_close((uv_tcp_t*)handle); + break; + + case UV_UDP: + uv__udp_close((uv_udp_t*)handle); + break; + + case UV_PREPARE: + uv__prepare_close((uv_prepare_t*)handle); + break; + + case UV_CHECK: + uv__check_close((uv_check_t*)handle); + break; + + case UV_IDLE: + uv__idle_close((uv_idle_t*)handle); + break; + + case UV_ASYNC: + uv__async_close((uv_async_t*)handle); + break; + + case UV_TIMER: + uv__timer_close((uv_timer_t*)handle); + break; + + case UV_PROCESS: + uv__process_close((uv_process_t*)handle); + break; + + case UV_FS_EVENT: + uv__fs_event_close((uv_fs_event_t*)handle); + break; + + case UV_POLL: + uv__poll_close((uv_poll_t*)handle); + break; + + case UV_FS_POLL: + uv__fs_poll_close((uv_fs_poll_t*)handle); - break; ++ /* Poll handles use file system requests, and one of them may still be ++ * running. The poll code will call uv__make_close_pending() for us. */ ++ return; + + case UV_SIGNAL: + uv__signal_close((uv_signal_t*) handle); + /* Signal handles may not be closed immediately. The signal code will + * itself close uv__make_close_pending whenever appropriate. */ + return; + + default: + assert(0); + } + + uv__make_close_pending(handle); +} + +int uv__socket_sockopt(uv_handle_t* handle, int optname, int* value) { + int r; + int fd; + socklen_t len; + + if (handle == NULL || value == NULL) + return UV_EINVAL; + + if (handle->type == UV_TCP || handle->type == UV_NAMED_PIPE) + fd = uv__stream_fd((uv_stream_t*) handle); + else if (handle->type == UV_UDP) + fd = ((uv_udp_t *) handle)->io_watcher.fd; + else + return UV_ENOTSUP; + + len = sizeof(*value); + + if (*value == 0) + r = getsockopt(fd, SOL_SOCKET, optname, value, &len); + else + r = setsockopt(fd, SOL_SOCKET, optname, (const void*) value, len); + + if (r < 0) + return UV__ERR(errno); + + return 0; +} + +void uv__make_close_pending(uv_handle_t* handle) { + assert(handle->flags & UV_HANDLE_CLOSING); + assert(!(handle->flags & UV_HANDLE_CLOSED)); + handle->next_closing = handle->loop->closing_handles; + handle->loop->closing_handles = handle; +} + +int uv__getiovmax(void) { +#if defined(IOV_MAX) + return IOV_MAX; +#elif defined(_SC_IOV_MAX) + static int iovmax = -1; + if (iovmax == -1) { + iovmax = sysconf(_SC_IOV_MAX); + /* On some embedded devices (arm-linux-uclibc based ip camera), + * sysconf(_SC_IOV_MAX) can not get the correct value. The return + * value is -1 and the errno is EINPROGRESS. Degrade the value to 1. + */ + if (iovmax == -1) iovmax = 1; + } + return iovmax; +#else + return 1024; +#endif +} + + +static void uv__finish_close(uv_handle_t* handle) { + /* Note: while the handle is in the UV_HANDLE_CLOSING state now, it's still + * possible for it to be active in the sense that uv__is_active() returns + * true. + * + * A good example is when the user calls uv_shutdown(), immediately followed + * by uv_close(). The handle is considered active at this point because the + * completion of the shutdown req is still pending. + */ + assert(handle->flags & UV_HANDLE_CLOSING); + assert(!(handle->flags & UV_HANDLE_CLOSED)); + handle->flags |= UV_HANDLE_CLOSED; + + switch (handle->type) { + case UV_PREPARE: + case UV_CHECK: + case UV_IDLE: + case UV_ASYNC: + case UV_TIMER: + case UV_PROCESS: + case UV_FS_EVENT: + case UV_FS_POLL: + case UV_POLL: + case UV_SIGNAL: + break; + + case UV_NAMED_PIPE: + case UV_TCP: + case UV_TTY: + uv__stream_destroy((uv_stream_t*)handle); + break; + + case UV_UDP: + uv__udp_finish_close((uv_udp_t*)handle); + break; + + default: + assert(0); + break; + } + + uv__handle_unref(handle); + QUEUE_REMOVE(&handle->handle_queue); + + if (handle->close_cb) { + handle->close_cb(handle); + } +} + + +static void uv__run_closing_handles(uv_loop_t* loop) { + uv_handle_t* p; + uv_handle_t* q; + + p = loop->closing_handles; + loop->closing_handles = NULL; + + while (p) { + q = p->next_closing; + uv__finish_close(p); + p = q; + } +} + + +int uv_is_closing(const uv_handle_t* handle) { + return uv__is_closing(handle); +} + + +int uv_backend_fd(const uv_loop_t* loop) { + return loop->backend_fd; +} + + +int uv_backend_timeout(const uv_loop_t* loop) { + if (loop->stop_flag != 0) + return 0; + + if (!uv__has_active_handles(loop) && !uv__has_active_reqs(loop)) + return 0; + + if (!QUEUE_EMPTY(&loop->idle_handles)) + return 0; + + if (!QUEUE_EMPTY(&loop->pending_queue)) + return 0; + + if (loop->closing_handles) + return 0; + + return uv__next_timeout(loop); +} + + +static int uv__loop_alive(const uv_loop_t* loop) { + return uv__has_active_handles(loop) || + uv__has_active_reqs(loop) || + loop->closing_handles != NULL; +} + + +int uv_loop_alive(const uv_loop_t* loop) { + return uv__loop_alive(loop); +} + + +int uv_run(uv_loop_t* loop, uv_run_mode mode) { + int timeout; + int r; + int ran_pending; + + r = uv__loop_alive(loop); + if (!r) + uv__update_time(loop); + + while (r != 0 && loop->stop_flag == 0) { + uv__update_time(loop); + uv__run_timers(loop); + ran_pending = uv__run_pending(loop); + uv__run_idle(loop); + uv__run_prepare(loop); + + timeout = 0; + if ((mode == UV_RUN_ONCE && !ran_pending) || mode == UV_RUN_DEFAULT) + timeout = uv_backend_timeout(loop); + + uv__io_poll(loop, timeout); + uv__run_check(loop); + uv__run_closing_handles(loop); + + if (mode == UV_RUN_ONCE) { + /* UV_RUN_ONCE implies forward progress: at least one callback must have + * been invoked when it returns. uv__io_poll() can return without doing + * I/O (meaning: no callbacks) when its timeout expires - which means we + * have pending timers that satisfy the forward progress constraint. + * + * UV_RUN_NOWAIT makes no guarantees about progress so it's omitted from + * the check. + */ + uv__update_time(loop); + uv__run_timers(loop); + } + + r = uv__loop_alive(loop); + if (mode == UV_RUN_ONCE || mode == UV_RUN_NOWAIT) + break; + } + + /* The if statement lets gcc compile it to a conditional store. Avoids + * dirtying a cache line. + */ + if (loop->stop_flag != 0) + loop->stop_flag = 0; + + return r; +} + + +void uv_update_time(uv_loop_t* loop) { + uv__update_time(loop); +} + + +int uv_is_active(const uv_handle_t* handle) { + return uv__is_active(handle); +} + + +/* Open a socket in non-blocking close-on-exec mode, atomically if possible. */ +int uv__socket(int domain, int type, int protocol) { + int sockfd; + int err; + +#if defined(SOCK_NONBLOCK) && defined(SOCK_CLOEXEC) + sockfd = socket(domain, type | SOCK_NONBLOCK | SOCK_CLOEXEC, protocol); + if (sockfd != -1) + return sockfd; + + if (errno != EINVAL) + return UV__ERR(errno); +#endif + + sockfd = socket(domain, type, protocol); + if (sockfd == -1) + return UV__ERR(errno); + + err = uv__nonblock(sockfd, 1); + if (err == 0) + err = uv__cloexec(sockfd, 1); + + if (err) { + uv__close(sockfd); + return err; + } + +#if defined(SO_NOSIGPIPE) + { + int on = 1; + setsockopt(sockfd, SOL_SOCKET, SO_NOSIGPIPE, &on, sizeof(on)); + } +#endif + + return sockfd; +} + +/* get a file pointer to a file in read-only and close-on-exec mode */ +FILE* uv__open_file(const char* path) { + int fd; + FILE* fp; + + fd = uv__open_cloexec(path, O_RDONLY); + if (fd < 0) + return NULL; + + fp = fdopen(fd, "r"); + if (fp == NULL) + uv__close(fd); + + return fp; +} + + +int uv__accept(int sockfd) { + int peerfd; + int err; + + assert(sockfd >= 0); + + while (1) { +#if defined(__linux__) || \ + (defined(__FreeBSD__) && __FreeBSD__ >= 10) || \ + defined(__NetBSD__) + static int no_accept4; + + if (no_accept4) + goto skip; + + peerfd = uv__accept4(sockfd, + NULL, + NULL, + UV__SOCK_NONBLOCK|UV__SOCK_CLOEXEC); + if (peerfd != -1) + return peerfd; + + if (errno == EINTR) + continue; + + if (errno != ENOSYS) + return UV__ERR(errno); + + no_accept4 = 1; +skip: +#endif + + peerfd = accept(sockfd, NULL, NULL); + if (peerfd == -1) { + if (errno == EINTR) + continue; + return UV__ERR(errno); + } + + err = uv__cloexec(peerfd, 1); + if (err == 0) + err = uv__nonblock(peerfd, 1); + + if (err) { + uv__close(peerfd); + return err; + } + + return peerfd; + } +} + + ++/* close() on macos has the "interesting" quirk that it fails with EINTR ++ * without closing the file descriptor when a thread is in the cancel state. ++ * That's why libuv calls close$NOCANCEL() instead. ++ * ++ * glibc on linux has a similar issue: close() is a cancellation point and ++ * will unwind the thread when it's in the cancel state. Work around that ++ * by making the system call directly. Musl libc is unaffected. ++ */ ++int uv__close_nocancel(int fd) { ++#if defined(__APPLE__) ++#pragma GCC diagnostic push ++#pragma GCC diagnostic ignored "-Wdollar-in-identifier-extension" ++#if defined(__LP64__) ++ extern int close$NOCANCEL(int); ++ return close$NOCANCEL(fd); ++#else ++ extern int close$NOCANCEL$UNIX2003(int); ++ return close$NOCANCEL$UNIX2003(fd); ++#endif ++#pragma GCC diagnostic pop ++#elif defined(__linux__) ++ return syscall(SYS_close, fd); ++#else ++ return close(fd); ++#endif ++} ++ ++ +int uv__close_nocheckstdio(int fd) { + int saved_errno; + int rc; + + assert(fd > -1); /* Catch uninitialized io_watcher.fd bugs. */ + + saved_errno = errno; - rc = close(fd); ++ rc = uv__close_nocancel(fd); + if (rc == -1) { + rc = UV__ERR(errno); + if (rc == UV_EINTR || rc == UV__ERR(EINPROGRESS)) + rc = 0; /* The close is in progress, not an error. */ + errno = saved_errno; + } + + return rc; +} + + +int uv__close(int fd) { + assert(fd > STDERR_FILENO); /* Catch stdio close bugs. */ +#if defined(__MVS__) + SAVE_ERRNO(epoll_file_close(fd)); +#endif + return uv__close_nocheckstdio(fd); +} + + +int uv__nonblock_ioctl(int fd, int set) { + int r; + + do + r = ioctl(fd, FIONBIO, &set); + while (r == -1 && errno == EINTR); + + if (r) + return UV__ERR(errno); + + return 0; +} + + - #if !defined(__CYGWIN__) && !defined(__MSYS__) ++#if !defined(__CYGWIN__) && !defined(__MSYS__) && !defined(__HAIKU__) +int uv__cloexec_ioctl(int fd, int set) { + int r; + + do + r = ioctl(fd, set ? FIOCLEX : FIONCLEX); + while (r == -1 && errno == EINTR); + + if (r) + return UV__ERR(errno); + + return 0; +} +#endif + + +int uv__nonblock_fcntl(int fd, int set) { + int flags; + int r; + + do + r = fcntl(fd, F_GETFL); + while (r == -1 && errno == EINTR); + + if (r == -1) + return UV__ERR(errno); + + /* Bail out now if already set/clear. */ + if (!!(r & O_NONBLOCK) == !!set) + return 0; + + if (set) + flags = r | O_NONBLOCK; + else + flags = r & ~O_NONBLOCK; + + do + r = fcntl(fd, F_SETFL, flags); + while (r == -1 && errno == EINTR); + + if (r) + return UV__ERR(errno); + + return 0; +} + + +int uv__cloexec_fcntl(int fd, int set) { + int flags; + int r; + + do + r = fcntl(fd, F_GETFD); + while (r == -1 && errno == EINTR); + + if (r == -1) + return UV__ERR(errno); + + /* Bail out now if already set/clear. */ + if (!!(r & FD_CLOEXEC) == !!set) + return 0; + + if (set) + flags = r | FD_CLOEXEC; + else + flags = r & ~FD_CLOEXEC; + + do + r = fcntl(fd, F_SETFD, flags); + while (r == -1 && errno == EINTR); + + if (r) + return UV__ERR(errno); + + return 0; +} + + +ssize_t uv__recvmsg(int fd, struct msghdr* msg, int flags) { + struct cmsghdr* cmsg; + ssize_t rc; + int* pfd; + int* end; +#if defined(__linux__) + static int no_msg_cmsg_cloexec; + if (no_msg_cmsg_cloexec == 0) { + rc = recvmsg(fd, msg, flags | 0x40000000); /* MSG_CMSG_CLOEXEC */ + if (rc != -1) + return rc; + if (errno != EINVAL) + return UV__ERR(errno); + rc = recvmsg(fd, msg, flags); + if (rc == -1) + return UV__ERR(errno); + no_msg_cmsg_cloexec = 1; + } else { + rc = recvmsg(fd, msg, flags); + } +#else + rc = recvmsg(fd, msg, flags); +#endif + if (rc == -1) + return UV__ERR(errno); + if (msg->msg_controllen == 0) + return rc; + for (cmsg = CMSG_FIRSTHDR(msg); cmsg != NULL; cmsg = CMSG_NXTHDR(msg, cmsg)) + if (cmsg->cmsg_type == SCM_RIGHTS) + for (pfd = (int*) CMSG_DATA(cmsg), + end = (int*) ((char*) cmsg + cmsg->cmsg_len); + pfd < end; + pfd += 1) + uv__cloexec(*pfd, 1); + return rc; +} + + +int uv_cwd(char* buffer, size_t* size) { + if (buffer == NULL || size == NULL) + return UV_EINVAL; + + if (getcwd(buffer, *size) == NULL) + return UV__ERR(errno); + + *size = strlen(buffer); + if (*size > 1 && buffer[*size - 1] == '/') { + buffer[*size-1] = '\0'; + (*size)--; + } + + return 0; +} + + +int uv_chdir(const char* dir) { + if (chdir(dir)) + return UV__ERR(errno); + + return 0; +} + + +void uv_disable_stdio_inheritance(void) { + int fd; + + /* Set the CLOEXEC flag on all open descriptors. Unconditionally try the + * first 16 file descriptors. After that, bail out after the first error. + */ + for (fd = 0; ; fd++) + if (uv__cloexec(fd, 1) && fd > 15) + break; +} + + +int uv_fileno(const uv_handle_t* handle, uv_os_fd_t* fd) { + int fd_out; + + switch (handle->type) { + case UV_TCP: + case UV_NAMED_PIPE: + case UV_TTY: + fd_out = uv__stream_fd((uv_stream_t*) handle); + break; + + case UV_UDP: + fd_out = ((uv_udp_t *) handle)->io_watcher.fd; + break; + + case UV_POLL: + fd_out = ((uv_poll_t *) handle)->io_watcher.fd; + break; + + default: + return UV_EINVAL; + } + + if (uv__is_closing(handle) || fd_out == -1) + return UV_EBADF; + + *fd = fd_out; + return 0; +} + + +static int uv__run_pending(uv_loop_t* loop) { + QUEUE* q; + QUEUE pq; + uv__io_t* w; + + if (QUEUE_EMPTY(&loop->pending_queue)) + return 0; + + QUEUE_MOVE(&loop->pending_queue, &pq); + + while (!QUEUE_EMPTY(&pq)) { + q = QUEUE_HEAD(&pq); + QUEUE_REMOVE(q); + QUEUE_INIT(q); + w = QUEUE_DATA(q, uv__io_t, pending_queue); + w->cb(loop, w, POLLOUT); + } + + return 1; +} + + +static unsigned int next_power_of_two(unsigned int val) { + val -= 1; + val |= val >> 1; + val |= val >> 2; + val |= val >> 4; + val |= val >> 8; + val |= val >> 16; + val += 1; + return val; +} + +static void maybe_resize(uv_loop_t* loop, unsigned int len) { + uv__io_t** watchers; + void* fake_watcher_list; + void* fake_watcher_count; + unsigned int nwatchers; + unsigned int i; + + if (len <= loop->nwatchers) + return; + + /* Preserve fake watcher list and count at the end of the watchers */ + if (loop->watchers != NULL) { + fake_watcher_list = loop->watchers[loop->nwatchers]; + fake_watcher_count = loop->watchers[loop->nwatchers + 1]; + } else { + fake_watcher_list = NULL; + fake_watcher_count = NULL; + } + + nwatchers = next_power_of_two(len + 2) - 2; + watchers = uv__realloc(loop->watchers, + (nwatchers + 2) * sizeof(loop->watchers[0])); + + if (watchers == NULL) + abort(); + for (i = loop->nwatchers; i < nwatchers; i++) + watchers[i] = NULL; + watchers[nwatchers] = fake_watcher_list; + watchers[nwatchers + 1] = fake_watcher_count; + + loop->watchers = watchers; + loop->nwatchers = nwatchers; +} + + +void uv__io_init(uv__io_t* w, uv__io_cb cb, int fd) { + assert(cb != NULL); + assert(fd >= -1); + QUEUE_INIT(&w->pending_queue); + QUEUE_INIT(&w->watcher_queue); + w->cb = cb; + w->fd = fd; + w->events = 0; + w->pevents = 0; + +#if defined(UV_HAVE_KQUEUE) + w->rcount = 0; + w->wcount = 0; +#endif /* defined(UV_HAVE_KQUEUE) */ +} + + +void uv__io_start(uv_loop_t* loop, uv__io_t* w, unsigned int events) { + assert(0 == (events & ~(POLLIN | POLLOUT | UV__POLLRDHUP | UV__POLLPRI))); + assert(0 != events); + assert(w->fd >= 0); + assert(w->fd < INT_MAX); + + w->pevents |= events; + maybe_resize(loop, w->fd + 1); + +#if !defined(__sun) + /* The event ports backend needs to rearm all file descriptors on each and + * every tick of the event loop but the other backends allow us to + * short-circuit here if the event mask is unchanged. + */ + if (w->events == w->pevents) + return; +#endif + + if (QUEUE_EMPTY(&w->watcher_queue)) + QUEUE_INSERT_TAIL(&loop->watcher_queue, &w->watcher_queue); + + if (loop->watchers[w->fd] == NULL) { + loop->watchers[w->fd] = w; + loop->nfds++; + } +} + + +void uv__io_stop(uv_loop_t* loop, uv__io_t* w, unsigned int events) { + assert(0 == (events & ~(POLLIN | POLLOUT | UV__POLLRDHUP | UV__POLLPRI))); + assert(0 != events); + + if (w->fd == -1) + return; + + assert(w->fd >= 0); + + /* Happens when uv__io_stop() is called on a handle that was never started. */ + if ((unsigned) w->fd >= loop->nwatchers) + return; + + w->pevents &= ~events; + + if (w->pevents == 0) { + QUEUE_REMOVE(&w->watcher_queue); + QUEUE_INIT(&w->watcher_queue); + + if (loop->watchers[w->fd] != NULL) { + assert(loop->watchers[w->fd] == w); + assert(loop->nfds > 0); + loop->watchers[w->fd] = NULL; + loop->nfds--; + w->events = 0; + } + } + else if (QUEUE_EMPTY(&w->watcher_queue)) + QUEUE_INSERT_TAIL(&loop->watcher_queue, &w->watcher_queue); +} + + +void uv__io_close(uv_loop_t* loop, uv__io_t* w) { + uv__io_stop(loop, w, POLLIN | POLLOUT | UV__POLLRDHUP | UV__POLLPRI); + QUEUE_REMOVE(&w->pending_queue); + + /* Remove stale events for this file descriptor */ - uv__platform_invalidate_fd(loop, w->fd); ++ if (w->fd != -1) ++ uv__platform_invalidate_fd(loop, w->fd); +} + + +void uv__io_feed(uv_loop_t* loop, uv__io_t* w) { + if (QUEUE_EMPTY(&w->pending_queue)) + QUEUE_INSERT_TAIL(&loop->pending_queue, &w->pending_queue); +} + + +int uv__io_active(const uv__io_t* w, unsigned int events) { + assert(0 == (events & ~(POLLIN | POLLOUT | UV__POLLRDHUP | UV__POLLPRI))); + assert(0 != events); + return 0 != (w->pevents & events); +} + + +int uv__fd_exists(uv_loop_t* loop, int fd) { + return (unsigned) fd < loop->nwatchers && loop->watchers[fd] != NULL; +} + + +int uv_getrusage(uv_rusage_t* rusage) { + struct rusage usage; + + if (getrusage(RUSAGE_SELF, &usage)) + return UV__ERR(errno); + + rusage->ru_utime.tv_sec = usage.ru_utime.tv_sec; + rusage->ru_utime.tv_usec = usage.ru_utime.tv_usec; + + rusage->ru_stime.tv_sec = usage.ru_stime.tv_sec; + rusage->ru_stime.tv_usec = usage.ru_stime.tv_usec; + - #if !defined(__MVS__) ++#if !defined(__MVS__) && !defined(__HAIKU__) + rusage->ru_maxrss = usage.ru_maxrss; + rusage->ru_ixrss = usage.ru_ixrss; + rusage->ru_idrss = usage.ru_idrss; + rusage->ru_isrss = usage.ru_isrss; + rusage->ru_minflt = usage.ru_minflt; + rusage->ru_majflt = usage.ru_majflt; + rusage->ru_nswap = usage.ru_nswap; + rusage->ru_inblock = usage.ru_inblock; + rusage->ru_oublock = usage.ru_oublock; + rusage->ru_msgsnd = usage.ru_msgsnd; + rusage->ru_msgrcv = usage.ru_msgrcv; + rusage->ru_nsignals = usage.ru_nsignals; + rusage->ru_nvcsw = usage.ru_nvcsw; + rusage->ru_nivcsw = usage.ru_nivcsw; +#endif + + return 0; +} + + +int uv__open_cloexec(const char* path, int flags) { + int err; + int fd; + +#if defined(UV__O_CLOEXEC) + static int no_cloexec; + + if (!no_cloexec) { + fd = open(path, flags | UV__O_CLOEXEC); + if (fd != -1) + return fd; + + if (errno != EINVAL) + return UV__ERR(errno); + + /* O_CLOEXEC not supported. */ + no_cloexec = 1; + } +#endif + + fd = open(path, flags); + if (fd == -1) + return UV__ERR(errno); + + err = uv__cloexec(fd, 1); + if (err) { + uv__close(fd); + return err; + } + + return fd; +} + + +int uv__dup2_cloexec(int oldfd, int newfd) { + int r; +#if (defined(__FreeBSD__) && __FreeBSD__ >= 10) || defined(__NetBSD__) + r = dup3(oldfd, newfd, O_CLOEXEC); + if (r == -1) + return UV__ERR(errno); + return r; +#elif defined(__FreeBSD__) && defined(F_DUP2FD_CLOEXEC) + r = fcntl(oldfd, F_DUP2FD_CLOEXEC, newfd); + if (r != -1) + return r; + if (errno != EINVAL) + return UV__ERR(errno); + /* Fall through. */ +#elif defined(__linux__) + static int no_dup3; + if (!no_dup3) { + do + r = uv__dup3(oldfd, newfd, UV__O_CLOEXEC); + while (r == -1 && errno == EBUSY); + if (r != -1) + return r; + if (errno != ENOSYS) + return UV__ERR(errno); + /* Fall through. */ + no_dup3 = 1; + } +#endif + { + int err; + do + r = dup2(oldfd, newfd); +#if defined(__linux__) + while (r == -1 && errno == EBUSY); +#else + while (0); /* Never retry. */ +#endif + + if (r == -1) + return UV__ERR(errno); + + err = uv__cloexec(newfd, 1); + if (err) { + uv__close(newfd); + return err; + } + + return r; + } +} + + +int uv_os_homedir(char* buffer, size_t* size) { + uv_passwd_t pwd; + size_t len; + int r; + + /* Check if the HOME environment variable is set first. The task of + performing input validation on buffer and size is taken care of by + uv_os_getenv(). */ + r = uv_os_getenv("HOME", buffer, size); + + if (r != UV_ENOENT) + return r; + + /* HOME is not set, so call uv__getpwuid_r() */ + r = uv__getpwuid_r(&pwd); + + if (r != 0) { + return r; + } + + len = strlen(pwd.homedir); + + if (len >= *size) { + *size = len + 1; + uv_os_free_passwd(&pwd); + return UV_ENOBUFS; + } + + memcpy(buffer, pwd.homedir, len + 1); + *size = len; + uv_os_free_passwd(&pwd); + + return 0; +} + + +int uv_os_tmpdir(char* buffer, size_t* size) { + const char* buf; + size_t len; + + if (buffer == NULL || size == NULL || *size == 0) + return UV_EINVAL; + +#define CHECK_ENV_VAR(name) \ + do { \ + buf = getenv(name); \ + if (buf != NULL) \ + goto return_buffer; \ + } \ + while (0) + + /* Check the TMPDIR, TMP, TEMP, and TEMPDIR environment variables in order */ + CHECK_ENV_VAR("TMPDIR"); + CHECK_ENV_VAR("TMP"); + CHECK_ENV_VAR("TEMP"); + CHECK_ENV_VAR("TEMPDIR"); + +#undef CHECK_ENV_VAR + + /* No temp environment variables defined */ + #if defined(__ANDROID__) + buf = "/data/local/tmp"; + #else + buf = "/tmp"; + #endif + +return_buffer: + len = strlen(buf); + + if (len >= *size) { + *size = len + 1; + return UV_ENOBUFS; + } + + /* The returned directory should not have a trailing slash. */ + if (len > 1 && buf[len - 1] == '/') { + len--; + } + + memcpy(buffer, buf, len + 1); + buffer[len] = '\0'; + *size = len; + + return 0; +} + + +int uv__getpwuid_r(uv_passwd_t* pwd) { + struct passwd pw; + struct passwd* result; + char* buf; + uid_t uid; + size_t bufsize; + size_t name_size; + size_t homedir_size; + size_t shell_size; + long initsize; + int r; +#if defined(__ANDROID_API__) && __ANDROID_API__ < 21 + int (*getpwuid_r)(uid_t, struct passwd*, char*, size_t, struct passwd**); + + getpwuid_r = dlsym(RTLD_DEFAULT, "getpwuid_r"); + if (getpwuid_r == NULL) + return UV_ENOSYS; +#endif + + if (pwd == NULL) + return UV_EINVAL; + + initsize = sysconf(_SC_GETPW_R_SIZE_MAX); + + if (initsize <= 0) + bufsize = 4096; + else + bufsize = (size_t) initsize; + + uid = geteuid(); + buf = NULL; + + for (;;) { + uv__free(buf); + buf = uv__malloc(bufsize); + + if (buf == NULL) + return UV_ENOMEM; + + r = getpwuid_r(uid, &pw, buf, bufsize, &result); + + if (r != ERANGE) + break; + + bufsize *= 2; + } + + if (r != 0) { + uv__free(buf); + return -r; + } + + if (result == NULL) { + uv__free(buf); + return UV_ENOENT; + } + + /* Allocate memory for the username, shell, and home directory */ + name_size = strlen(pw.pw_name) + 1; + homedir_size = strlen(pw.pw_dir) + 1; + shell_size = strlen(pw.pw_shell) + 1; + pwd->username = uv__malloc(name_size + homedir_size + shell_size); + + if (pwd->username == NULL) { + uv__free(buf); + return UV_ENOMEM; + } + + /* Copy the username */ + memcpy(pwd->username, pw.pw_name, name_size); + + /* Copy the home directory */ + pwd->homedir = pwd->username + name_size; + memcpy(pwd->homedir, pw.pw_dir, homedir_size); + + /* Copy the shell */ + pwd->shell = pwd->homedir + homedir_size; + memcpy(pwd->shell, pw.pw_shell, shell_size); + + /* Copy the uid and gid */ + pwd->uid = pw.pw_uid; + pwd->gid = pw.pw_gid; + + uv__free(buf); + + return 0; +} + + +void uv_os_free_passwd(uv_passwd_t* pwd) { + if (pwd == NULL) + return; + + /* + The memory for name, shell, and homedir are allocated in a single + uv__malloc() call. The base of the pointer is stored in pwd->username, so + that is the field that needs to be freed. + */ + uv__free(pwd->username); + pwd->username = NULL; + pwd->shell = NULL; + pwd->homedir = NULL; +} + + +int uv_os_get_passwd(uv_passwd_t* pwd) { + return uv__getpwuid_r(pwd); +} + + +int uv_translate_sys_error(int sys_errno) { + /* If < 0 then it's already a libuv error. */ + return sys_errno <= 0 ? sys_errno : -sys_errno; +} + + +int uv_os_getenv(const char* name, char* buffer, size_t* size) { + char* var; + size_t len; + + if (name == NULL || buffer == NULL || size == NULL || *size == 0) + return UV_EINVAL; + + var = getenv(name); + + if (var == NULL) + return UV_ENOENT; + + len = strlen(var); + + if (len >= *size) { + *size = len + 1; + return UV_ENOBUFS; + } + + memcpy(buffer, var, len + 1); + *size = len; + + return 0; +} + + +int uv_os_setenv(const char* name, const char* value) { + if (name == NULL || value == NULL) + return UV_EINVAL; + + if (setenv(name, value, 1) != 0) + return UV__ERR(errno); + + return 0; +} + + +int uv_os_unsetenv(const char* name) { + if (name == NULL) + return UV_EINVAL; + + if (unsetenv(name) != 0) + return UV__ERR(errno); + + return 0; +} + + +int uv_os_gethostname(char* buffer, size_t* size) { + /* + On some platforms, if the input buffer is not large enough, gethostname() + succeeds, but truncates the result. libuv can detect this and return ENOBUFS + instead by creating a large enough buffer and comparing the hostname length + to the size input. + */ - char buf[MAXHOSTNAMELEN + 1]; ++ char buf[UV_MAXHOSTNAMESIZE]; + size_t len; + + if (buffer == NULL || size == NULL || *size == 0) + return UV_EINVAL; + + if (gethostname(buf, sizeof(buf)) != 0) + return UV__ERR(errno); + + buf[sizeof(buf) - 1] = '\0'; /* Null terminate, just to be safe. */ + len = strlen(buf); + + if (len >= *size) { + *size = len + 1; + return UV_ENOBUFS; + } + + memcpy(buffer, buf, len + 1); + *size = len; + return 0; +} + + +int uv_cpumask_size(void) { +#if defined(__linux__) || defined(__FreeBSD__) + return CPU_SETSIZE; +#else + return UV_ENOTSUP; +#endif +} + + +uv_os_fd_t uv_get_osfhandle(int fd) { + return fd; +} + +int uv_open_osfhandle(uv_os_fd_t os_fd) { + return os_fd; +} + +uv_pid_t uv_os_getpid(void) { + return getpid(); +} + + +uv_pid_t uv_os_getppid(void) { + return getppid(); +} + + +int uv_os_getpriority(uv_pid_t pid, int* priority) { + int r; + + if (priority == NULL) + return UV_EINVAL; + + errno = 0; + r = getpriority(PRIO_PROCESS, (int) pid); + + if (r == -1 && errno != 0) + return UV__ERR(errno); + + *priority = r; + return 0; +} + + +int uv_os_setpriority(uv_pid_t pid, int priority) { + if (priority < UV_PRIORITY_HIGHEST || priority > UV_PRIORITY_LOW) + return UV_EINVAL; + + if (setpriority(PRIO_PROCESS, (int) pid, priority) != 0) + return UV__ERR(errno); + + return 0; +} + + +int uv_os_uname(uv_utsname_t* buffer) { + struct utsname buf; + int r; + + if (buffer == NULL) + return UV_EINVAL; + + if (uname(&buf) == -1) { + r = UV__ERR(errno); + goto error; + } + + r = uv__strscpy(buffer->sysname, buf.sysname, sizeof(buffer->sysname)); + if (r == UV_E2BIG) + goto error; + +#ifdef _AIX + r = snprintf(buffer->release, + sizeof(buffer->release), + "%s.%s", + buf.version, + buf.release); + if (r >= sizeof(buffer->release)) { + r = UV_E2BIG; + goto error; + } +#else + r = uv__strscpy(buffer->release, buf.release, sizeof(buffer->release)); + if (r == UV_E2BIG) + goto error; +#endif + + r = uv__strscpy(buffer->version, buf.version, sizeof(buffer->version)); + if (r == UV_E2BIG) + goto error; + +#if defined(_AIX) || defined(__PASE__) + r = uv__strscpy(buffer->machine, "ppc64", sizeof(buffer->machine)); +#else + r = uv__strscpy(buffer->machine, buf.machine, sizeof(buffer->machine)); +#endif + + if (r == UV_E2BIG) + goto error; + + return 0; + +error: + buffer->sysname[0] = '\0'; + buffer->release[0] = '\0'; + buffer->version[0] = '\0'; + buffer->machine[0] = '\0'; + return r; +} ++ ++int uv__getsockpeername(const uv_handle_t* handle, ++ uv__peersockfunc func, ++ struct sockaddr* name, ++ int* namelen) { ++ socklen_t socklen; ++ uv_os_fd_t fd; ++ int r; ++ ++ r = uv_fileno(handle, &fd); ++ if (r < 0) ++ return r; ++ ++ /* sizeof(socklen_t) != sizeof(int) on some systems. */ ++ socklen = (socklen_t) *namelen; ++ ++ if (func(fd, name, &socklen)) ++ return UV__ERR(errno); ++ ++ *namelen = (int) socklen; ++ return 0; ++} ++ ++int uv_gettimeofday(uv_timeval64_t* tv) { ++ struct timeval time; ++ ++ if (tv == NULL) ++ return UV_EINVAL; ++ ++ if (gettimeofday(&time, NULL) != 0) ++ return UV__ERR(errno); ++ ++ tv->tv_sec = (int64_t) time.tv_sec; ++ tv->tv_usec = (int32_t) time.tv_usec; ++ return 0; ++} diff --cc Utilities/cmlibuv/src/unix/fs.c index bffc956,0000000..48500ff mode 100644,000000..100644 --- a/Utilities/cmlibuv/src/unix/fs.c +++ b/Utilities/cmlibuv/src/unix/fs.c @@@ -1,1627 -1,0 +1,1818 @@@ +/* Copyright Joyent, Inc. and other Node contributors. All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +/* Caveat emptor: this file deviates from the libuv convention of returning + * negated errno codes. Most uv_fs_*() functions map directly to the system + * call of the same name. For more complex wrappers, it's easier to just + * return -1 with errno set. The dispatcher in uv__fs_work() takes care of + * getting the errno to the right place (req->result or as the return value.) + */ + +#include "uv.h" +#include "internal.h" + +#include +#include +#include +#include +#include /* PATH_MAX */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if defined(__DragonFly__) || \ + defined(__FreeBSD__) || \ - defined(__FreeBSD_kernel_) || \ ++ defined(__FreeBSD_kernel__) || \ + defined(__OpenBSD__) || \ + defined(__NetBSD__) +# define HAVE_PREADV 1 +#else +# define HAVE_PREADV 0 +#endif + +#if defined(__linux__) || defined(__sun) +# include +#endif + +#if defined(__APPLE__) - # include +# include +#elif defined(__linux__) && !defined(FICLONE) +# include +# define FICLONE _IOW(0x94, 9, int) +#endif + +#if defined(_AIX) && !defined(_AIX71) +# include +#endif + +#if defined(_AIX) && _XOPEN_SOURCE <= 600 +extern char *mkdtemp(char *template); /* See issue #740 on AIX < 7 */ +#endif + +#define INIT(subtype) \ + do { \ + if (req == NULL) \ + return UV_EINVAL; \ + UV_REQ_INIT(req, UV_FS); \ + req->fs_type = UV_FS_ ## subtype; \ + req->result = 0; \ + req->ptr = NULL; \ + req->loop = loop; \ + req->path = NULL; \ + req->new_path = NULL; \ + req->bufs = NULL; \ + req->cb = cb; \ + } \ + while (0) + +#define PATH \ + do { \ + assert(path != NULL); \ + if (cb == NULL) { \ + req->path = path; \ + } else { \ + req->path = uv__strdup(path); \ + if (req->path == NULL) \ + return UV_ENOMEM; \ + } \ + } \ + while (0) + +#define PATH2 \ + do { \ + if (cb == NULL) { \ + req->path = path; \ + req->new_path = new_path; \ + } else { \ + size_t path_len; \ + size_t new_path_len; \ + path_len = strlen(path) + 1; \ + new_path_len = strlen(new_path) + 1; \ + req->path = uv__malloc(path_len + new_path_len); \ + if (req->path == NULL) \ + return UV_ENOMEM; \ + req->new_path = req->path + path_len; \ + memcpy((void*) req->path, path, path_len); \ + memcpy((void*) req->new_path, new_path, new_path_len); \ + } \ + } \ + while (0) + +#define POST \ + do { \ + if (cb != NULL) { \ + uv__req_register(loop, req); \ + uv__work_submit(loop, \ + &req->work_req, \ + UV__WORK_FAST_IO, \ + uv__fs_work, \ + uv__fs_done); \ + return 0; \ + } \ + else { \ + uv__fs_work(&req->work_req); \ + return req->result; \ + } \ + } \ + while (0) + + ++static int uv__fs_close(int fd) { ++ int rc; ++ ++ rc = uv__close_nocancel(fd); ++ if (rc == -1) ++ if (errno == EINTR || errno == EINPROGRESS) ++ rc = 0; /* The close is in progress, not an error. */ ++ ++ return rc; ++} ++ ++ +static ssize_t uv__fs_fsync(uv_fs_t* req) { +#if defined(__APPLE__) + /* Apple's fdatasync and fsync explicitly do NOT flush the drive write cache + * to the drive platters. This is in contrast to Linux's fdatasync and fsync + * which do, according to recent man pages. F_FULLFSYNC is Apple's equivalent + * for flushing buffered data to permanent storage. If F_FULLFSYNC is not - * supported by the file system we should fall back to fsync(). This is the - * same approach taken by sqlite. ++ * supported by the file system we fall back to F_BARRIERFSYNC or fsync(). ++ * This is the same approach taken by sqlite, except sqlite does not issue ++ * an F_BARRIERFSYNC call. + */ + int r; + + r = fcntl(req->file, F_FULLFSYNC); + if (r != 0) ++ r = fcntl(req->file, F_BARRIERFSYNC); /* fsync + barrier */ ++ if (r != 0) + r = fsync(req->file); + return r; +#else + return fsync(req->file); +#endif +} + + +static ssize_t uv__fs_fdatasync(uv_fs_t* req) { +#if defined(__linux__) || defined(__sun) || defined(__NetBSD__) + return fdatasync(req->file); +#elif defined(__APPLE__) + /* See the comment in uv__fs_fsync. */ + return uv__fs_fsync(req); +#else + return fsync(req->file); +#endif +} + + +static ssize_t uv__fs_futime(uv_fs_t* req) { +#if defined(__linux__) \ - || defined(_AIX71) ++ || defined(_AIX71) \ ++ || defined(__HAIKU__) + /* utimesat() has nanosecond resolution but we stick to microseconds + * for the sake of consistency with other platforms. + */ + struct timespec ts[2]; + ts[0].tv_sec = req->atime; + ts[0].tv_nsec = (uint64_t)(req->atime * 1000000) % 1000000 * 1000; + ts[1].tv_sec = req->mtime; + ts[1].tv_nsec = (uint64_t)(req->mtime * 1000000) % 1000000 * 1000; + return futimens(req->file, ts); +#elif defined(__APPLE__) \ + || defined(__DragonFly__) \ + || defined(__FreeBSD__) \ + || defined(__FreeBSD_kernel__) \ + || defined(__NetBSD__) \ + || defined(__OpenBSD__) \ + || defined(__sun) + struct timeval tv[2]; + tv[0].tv_sec = req->atime; + tv[0].tv_usec = (uint64_t)(req->atime * 1000000) % 1000000; + tv[1].tv_sec = req->mtime; + tv[1].tv_usec = (uint64_t)(req->mtime * 1000000) % 1000000; +# if defined(__sun) + return futimesat(req->file, NULL, tv); +# else + return futimes(req->file, tv); +# endif +#elif defined(__MVS__) + attrib_t atr; + memset(&atr, 0, sizeof(atr)); + atr.att_mtimechg = 1; + atr.att_atimechg = 1; + atr.att_mtime = req->mtime; + atr.att_atime = req->atime; + return __fchattr(req->file, &atr, sizeof(atr)); +#else + errno = ENOSYS; + return -1; +#endif +} + +#if defined(__sun) && (_XOPEN_SOURCE < 600 || defined(CMAKE_BOOTSTRAP)) +static char* uv__mkdtemp(char *template) +{ + if (!mktemp(template) || mkdir(template, 0700)) + return NULL; + return template; +} +#else +#define uv__mkdtemp mkdtemp +#endif + +static ssize_t uv__fs_mkdtemp(uv_fs_t* req) { + return uv__mkdtemp((char*) req->path) ? 0 : -1; +} + + +static ssize_t uv__fs_open(uv_fs_t* req) { + static int no_cloexec_support; + int r; + + /* Try O_CLOEXEC before entering locks */ + if (no_cloexec_support == 0) { +#ifdef O_CLOEXEC + r = open(req->path, req->flags | O_CLOEXEC, req->mode); + if (r >= 0) + return r; + if (errno != EINVAL) + return r; + no_cloexec_support = 1; +#endif /* O_CLOEXEC */ + } + + if (req->cb != NULL) + uv_rwlock_rdlock(&req->loop->cloexec_lock); + + r = open(req->path, req->flags, req->mode); + + /* In case of failure `uv__cloexec` will leave error in `errno`, + * so it is enough to just set `r` to `-1`. + */ + if (r >= 0 && uv__cloexec(r, 1) != 0) { + r = uv__close(r); + if (r != 0) + abort(); + r = -1; + } + + if (req->cb != NULL) + uv_rwlock_rdunlock(&req->loop->cloexec_lock); + + return r; +} + + +static ssize_t uv__fs_read(uv_fs_t* req) { +#if defined(__linux__) + static int no_preadv; +#endif + unsigned int iovmax; + ssize_t result; + + iovmax = uv__getiovmax(); + if (req->nbufs > iovmax) + req->nbufs = iovmax; + + if (req->off < 0) { + if (req->nbufs == 1) + result = read(req->file, req->bufs[0].base, req->bufs[0].len); + else + result = readv(req->file, (struct iovec*) req->bufs, req->nbufs); + } else { + if (req->nbufs == 1) { + result = pread(req->file, req->bufs[0].base, req->bufs[0].len, req->off); + goto done; + } + +#if HAVE_PREADV + result = preadv(req->file, (struct iovec*) req->bufs, req->nbufs, req->off); +#else +# if defined(__linux__) + if (no_preadv) retry: +# endif + { + result = pread(req->file, req->bufs[0].base, req->bufs[0].len, req->off); + } +# if defined(__linux__) + else { + result = uv__preadv(req->file, + (struct iovec*)req->bufs, + req->nbufs, + req->off); + if (result == -1 && errno == ENOSYS) { + no_preadv = 1; + goto retry; + } + } +# endif +#endif + } + +done: + /* Early cleanup of bufs allocation, since we're done with it. */ + if (req->bufs != req->bufsml) + uv__free(req->bufs); + + req->bufs = NULL; + req->nbufs = 0; + ++#ifdef __PASE__ ++ /* PASE returns EOPNOTSUPP when reading a directory, convert to EISDIR */ ++ if (result == -1 && errno == EOPNOTSUPP) { ++ struct stat buf; ++ ssize_t rc; ++ rc = fstat(req->file, &buf); ++ if (rc == 0 && S_ISDIR(buf.st_mode)) { ++ errno = EISDIR; ++ } ++ } ++#endif ++ + return result; +} + + +#if defined(__APPLE__) && !defined(MAC_OS_X_VERSION_10_8) +#define UV_CONST_DIRENT uv__dirent_t +#else +#define UV_CONST_DIRENT const uv__dirent_t +#endif + + +static int uv__fs_scandir_filter(UV_CONST_DIRENT* dent) { + return strcmp(dent->d_name, ".") != 0 && strcmp(dent->d_name, "..") != 0; +} + + +static int uv__fs_scandir_sort(UV_CONST_DIRENT** a, UV_CONST_DIRENT** b) { + return strcmp((*a)->d_name, (*b)->d_name); +} + + +static ssize_t uv__fs_scandir(uv_fs_t* req) { - uv__dirent_t **dents; ++ uv__dirent_t** dents; + int n; + + dents = NULL; + n = scandir(req->path, &dents, uv__fs_scandir_filter, uv__fs_scandir_sort); + + /* NOTE: We will use nbufs as an index field */ + req->nbufs = 0; + + if (n == 0) { + /* OS X still needs to deallocate some memory. + * Memory was allocated using the system allocator, so use free() here. + */ + free(dents); + dents = NULL; + } else if (n == -1) { + return n; + } + + req->ptr = dents; + + return n; +} + ++static int uv__fs_opendir(uv_fs_t* req) { ++ uv_dir_t* dir; ++ ++ dir = uv__malloc(sizeof(*dir)); ++ if (dir == NULL) ++ goto error; ++ ++ dir->dir = opendir(req->path); ++ if (dir->dir == NULL) ++ goto error; ++ ++ req->ptr = dir; ++ return 0; ++ ++error: ++ uv__free(dir); ++ req->ptr = NULL; ++ return -1; ++} ++ ++static int uv__fs_readdir(uv_fs_t* req) { ++ uv_dir_t* dir; ++ uv_dirent_t* dirent; ++ struct dirent* res; ++ unsigned int dirent_idx; ++ unsigned int i; ++ ++ dir = req->ptr; ++ dirent_idx = 0; ++ ++ while (dirent_idx < dir->nentries) { ++ /* readdir() returns NULL on end of directory, as well as on error. errno ++ is used to differentiate between the two conditions. */ ++ errno = 0; ++ res = readdir(dir->dir); ++ ++ if (res == NULL) { ++ if (errno != 0) ++ goto error; ++ break; ++ } ++ ++ if (strcmp(res->d_name, ".") == 0 || strcmp(res->d_name, "..") == 0) ++ continue; ++ ++ dirent = &dir->dirents[dirent_idx]; ++ dirent->name = uv__strdup(res->d_name); ++ ++ if (dirent->name == NULL) ++ goto error; ++ ++ dirent->type = uv__fs_get_dirent_type(res); ++ ++dirent_idx; ++ } ++ ++ return dirent_idx; ++ ++error: ++ for (i = 0; i < dirent_idx; ++i) { ++ uv__free((char*) dir->dirents[i].name); ++ dir->dirents[i].name = NULL; ++ } ++ ++ return -1; ++} ++ ++static int uv__fs_closedir(uv_fs_t* req) { ++ uv_dir_t* dir; ++ ++ dir = req->ptr; ++ ++ if (dir->dir != NULL) { ++ closedir(dir->dir); ++ dir->dir = NULL; ++ } ++ ++ uv__free(req->ptr); ++ req->ptr = NULL; ++ return 0; ++} ++ +#if defined(_POSIX_PATH_MAX) +# define UV__FS_PATH_MAX _POSIX_PATH_MAX +#elif defined(PATH_MAX) +# define UV__FS_PATH_MAX PATH_MAX +#else +# define UV__FS_PATH_MAX_FALLBACK 8192 +# define UV__FS_PATH_MAX UV__FS_PATH_MAX_FALLBACK +#endif + +static ssize_t uv__fs_pathmax_size(const char* path) { + ssize_t pathmax; + + pathmax = pathconf(path, _PC_PATH_MAX); + + if (pathmax == -1) + pathmax = UV__FS_PATH_MAX; + + return pathmax; +} + +static ssize_t uv__fs_readlink(uv_fs_t* req) { + ssize_t maxlen; + ssize_t len; + char* buf; + char* newbuf; + +#if defined(UV__FS_PATH_MAX_FALLBACK) + /* We may not have a real PATH_MAX. Read size of link. */ + struct stat st; + int ret; + ret = lstat(req->path, &st); + if (ret != 0) + return -1; + if (!S_ISLNK(st.st_mode)) { + errno = EINVAL; + return -1; + } + + maxlen = st.st_size; + + /* According to readlink(2) lstat can report st_size == 0 + for some symlinks, such as those in /proc or /sys. */ + if (maxlen == 0) + maxlen = uv__fs_pathmax_size(req->path); +#else + maxlen = uv__fs_pathmax_size(req->path); +#endif + + buf = uv__malloc(maxlen); + + if (buf == NULL) { + errno = ENOMEM; + return -1; + } + +#if defined(__MVS__) + len = os390_readlink(req->path, buf, maxlen); +#else + len = readlink(req->path, buf, maxlen); +#endif + + if (len == -1) { + uv__free(buf); + return -1; + } + + /* Uncommon case: resize to make room for the trailing nul byte. */ + if (len == maxlen) { + newbuf = uv__realloc(buf, len + 1); + + if (newbuf == NULL) { + uv__free(buf); + return -1; + } + + buf = newbuf; + } + + buf[len] = '\0'; + req->ptr = buf; + + return 0; +} + +static ssize_t uv__fs_realpath(uv_fs_t* req) { + char* buf; + +#if defined(_POSIX_VERSION) && _POSIX_VERSION >= 200809L + buf = realpath(req->path, NULL); + if (buf == NULL) + return -1; +#else + ssize_t len; + + len = uv__fs_pathmax_size(req->path); + buf = uv__malloc(len + 1); + + if (buf == NULL) { + errno = ENOMEM; + return -1; + } + + if (realpath(req->path, buf) == NULL) { + uv__free(buf); + return -1; + } +#endif + + req->ptr = buf; + + return 0; +} + +static ssize_t uv__fs_sendfile_emul(uv_fs_t* req) { + struct pollfd pfd; + int use_pread; + off_t offset; + ssize_t nsent; + ssize_t nread; + ssize_t nwritten; + size_t buflen; + size_t len; + ssize_t n; + int in_fd; + int out_fd; + char buf[8192]; + + len = req->bufsml[0].len; + in_fd = req->flags; + out_fd = req->file; + offset = req->off; + use_pread = 1; + + /* Here are the rules regarding errors: + * + * 1. Read errors are reported only if nsent==0, otherwise we return nsent. + * The user needs to know that some data has already been sent, to stop + * them from sending it twice. + * + * 2. Write errors are always reported. Write errors are bad because they + * mean data loss: we've read data but now we can't write it out. + * + * We try to use pread() and fall back to regular read() if the source fd + * doesn't support positional reads, for example when it's a pipe fd. + * + * If we get EAGAIN when writing to the target fd, we poll() on it until + * it becomes writable again. + * + * FIXME: If we get a write error when use_pread==1, it should be safe to + * return the number of sent bytes instead of an error because pread() + * is, in theory, idempotent. However, special files in /dev or /proc + * may support pread() but not necessarily return the same data on + * successive reads. + * + * FIXME: There is no way now to signal that we managed to send *some* data + * before a write error. + */ + for (nsent = 0; (size_t) nsent < len; ) { + buflen = len - nsent; + + if (buflen > sizeof(buf)) + buflen = sizeof(buf); + + do + if (use_pread) + nread = pread(in_fd, buf, buflen, offset); + else + nread = read(in_fd, buf, buflen); + while (nread == -1 && errno == EINTR); + + if (nread == 0) + goto out; + + if (nread == -1) { + if (use_pread && nsent == 0 && (errno == EIO || errno == ESPIPE)) { + use_pread = 0; + continue; + } + + if (nsent == 0) + nsent = -1; + + goto out; + } + + for (nwritten = 0; nwritten < nread; ) { + do + n = write(out_fd, buf + nwritten, nread - nwritten); + while (n == -1 && errno == EINTR); + + if (n != -1) { + nwritten += n; + continue; + } + + if (errno != EAGAIN && errno != EWOULDBLOCK) { + nsent = -1; + goto out; + } + + pfd.fd = out_fd; + pfd.events = POLLOUT; + pfd.revents = 0; + + do + n = poll(&pfd, 1, -1); + while (n == -1 && errno == EINTR); + + if (n == -1 || (pfd.revents & ~POLLOUT) != 0) { + errno = EIO; + nsent = -1; + goto out; + } + } + + offset += nread; + nsent += nread; + } + +out: + if (nsent != -1) + req->off = offset; + + return nsent; +} + + +static ssize_t uv__fs_sendfile(uv_fs_t* req) { + int in_fd; + int out_fd; + + in_fd = req->flags; + out_fd = req->file; + +#if defined(__linux__) || defined(__sun) + { + off_t off; + ssize_t r; + + off = req->off; + r = sendfile(out_fd, in_fd, &off, req->bufsml[0].len); + + /* sendfile() on SunOS returns EINVAL if the target fd is not a socket but + * it still writes out data. Fortunately, we can detect it by checking if + * the offset has been updated. + */ + if (r != -1 || off > req->off) { + r = off - req->off; + req->off = off; + return r; + } + + if (errno == EINVAL || + errno == EIO || + errno == ENOTSOCK || + errno == EXDEV) { + errno = 0; + return uv__fs_sendfile_emul(req); + } + + return -1; + } +#elif defined(__APPLE__) || \ + defined(__DragonFly__) || \ + defined(__FreeBSD__) || \ + defined(__FreeBSD_kernel__) + { + off_t len; + ssize_t r; + + /* sendfile() on FreeBSD and Darwin returns EAGAIN if the target fd is in + * non-blocking mode and not all data could be written. If a non-zero + * number of bytes have been sent, we don't consider it an error. + */ + +#if defined(__FreeBSD__) || defined(__DragonFly__) + len = 0; + r = sendfile(in_fd, out_fd, req->off, req->bufsml[0].len, NULL, &len, 0); +#elif defined(__FreeBSD_kernel__) + len = 0; + r = bsd_sendfile(in_fd, + out_fd, + req->off, + req->bufsml[0].len, + NULL, + &len, + 0); +#else + /* The darwin sendfile takes len as an input for the length to send, + * so make sure to initialize it with the caller's value. */ + len = req->bufsml[0].len; + r = sendfile(in_fd, out_fd, req->off, &len, NULL, 0); +#endif + + /* + * The man page for sendfile(2) on DragonFly states that `len` contains + * a meaningful value ONLY in case of EAGAIN and EINTR. + * Nothing is said about it's value in case of other errors, so better + * not depend on the potential wrong assumption that is was not modified + * by the syscall. + */ + if (r == 0 || ((errno == EAGAIN || errno == EINTR) && len != 0)) { + req->off += len; + return (ssize_t) len; + } + + if (errno == EINVAL || + errno == EIO || + errno == ENOTSOCK || + errno == EXDEV) { + errno = 0; + return uv__fs_sendfile_emul(req); + } + + return -1; + } +#else + /* Squelch compiler warnings. */ + (void) &in_fd; + (void) &out_fd; + + return uv__fs_sendfile_emul(req); +#endif +} + + +static ssize_t uv__fs_utime(uv_fs_t* req) { +#if defined(__linux__) \ + || defined(_AIX71) \ - || defined(__sun) ++ || defined(__sun) \ ++ || defined(__HAIKU__) + /* utimesat() has nanosecond resolution but we stick to microseconds + * for the sake of consistency with other platforms. + */ + struct timespec ts[2]; + ts[0].tv_sec = req->atime; + ts[0].tv_nsec = (uint64_t)(req->atime * 1000000) % 1000000 * 1000; + ts[1].tv_sec = req->mtime; + ts[1].tv_nsec = (uint64_t)(req->mtime * 1000000) % 1000000 * 1000; + return utimensat(AT_FDCWD, req->path, ts, 0); +#elif defined(__APPLE__) \ + || defined(__DragonFly__) \ + || defined(__FreeBSD__) \ + || defined(__FreeBSD_kernel__) \ + || defined(__NetBSD__) \ + || defined(__OpenBSD__) + struct timeval tv[2]; + tv[0].tv_sec = req->atime; + tv[0].tv_usec = (uint64_t)(req->atime * 1000000) % 1000000; + tv[1].tv_sec = req->mtime; + tv[1].tv_usec = (uint64_t)(req->mtime * 1000000) % 1000000; + return utimes(req->path, tv); +#elif defined(_AIX) \ + && !defined(_AIX71) + struct utimbuf buf; + buf.actime = req->atime; + buf.modtime = req->mtime; + return utime(req->path, &buf); +#elif defined(__MVS__) + attrib_t atr; + memset(&atr, 0, sizeof(atr)); + atr.att_mtimechg = 1; + atr.att_atimechg = 1; + atr.att_mtime = req->mtime; + atr.att_atime = req->atime; + return __lchattr((char*) req->path, &atr, sizeof(atr)); +#else + errno = ENOSYS; + return -1; +#endif +} + + +static ssize_t uv__fs_write(uv_fs_t* req) { +#if defined(__linux__) + static int no_pwritev; +#endif + ssize_t r; + + /* Serialize writes on OS X, concurrent write() and pwrite() calls result in + * data loss. We can't use a per-file descriptor lock, the descriptor may be + * a dup(). + */ +#if defined(__APPLE__) + static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER; + + if (pthread_mutex_lock(&lock)) + abort(); +#endif + + if (req->off < 0) { + if (req->nbufs == 1) + r = write(req->file, req->bufs[0].base, req->bufs[0].len); + else + r = writev(req->file, (struct iovec*) req->bufs, req->nbufs); + } else { + if (req->nbufs == 1) { + r = pwrite(req->file, req->bufs[0].base, req->bufs[0].len, req->off); + goto done; + } +#if HAVE_PREADV + r = pwritev(req->file, (struct iovec*) req->bufs, req->nbufs, req->off); +#else +# if defined(__linux__) + if (no_pwritev) retry: +# endif + { + r = pwrite(req->file, req->bufs[0].base, req->bufs[0].len, req->off); + } +# if defined(__linux__) + else { + r = uv__pwritev(req->file, + (struct iovec*) req->bufs, + req->nbufs, + req->off); + if (r == -1 && errno == ENOSYS) { + no_pwritev = 1; + goto retry; + } + } +# endif +#endif + } + +done: +#if defined(__APPLE__) + if (pthread_mutex_unlock(&lock)) + abort(); +#endif + + return r; +} + +static ssize_t uv__fs_copyfile(uv_fs_t* req) { - #if defined(__APPLE__) && !TARGET_OS_IPHONE - /* On macOS, use the native copyfile(3). */ - static int can_clone; - copyfile_flags_t flags; - char buf[64]; - size_t len; - int major; - - flags = COPYFILE_ALL; - - if (req->flags & UV_FS_COPYFILE_EXCL) - flags |= COPYFILE_EXCL; - - /* Check OS version. Cloning is only supported on macOS >= 10.12. */ - if (req->flags & UV_FS_COPYFILE_FICLONE_FORCE) { - if (can_clone == 0) { - len = sizeof(buf); - if (sysctlbyname("kern.osrelease", buf, &len, NULL, 0)) - return UV__ERR(errno); - - if (1 != sscanf(buf, "%d", &major)) - abort(); - - can_clone = -1 + 2 * (major >= 16); /* macOS >= 10.12 */ - } - - if (can_clone < 0) - return UV_ENOSYS; - } - - /* copyfile() simply ignores COPYFILE_CLONE if it's not supported. */ - if (req->flags & UV_FS_COPYFILE_FICLONE) - flags |= 1 << 24; /* COPYFILE_CLONE */ - - if (req->flags & UV_FS_COPYFILE_FICLONE_FORCE) - flags |= 1 << 25; /* COPYFILE_CLONE_FORCE */ - - return copyfile(req->path, req->new_path, NULL, flags); - #else + uv_fs_t fs_req; + uv_file srcfd; + uv_file dstfd; + struct stat statsbuf; + int dst_flags; + int result; + int err; + size_t bytes_to_send; + int64_t in_offset; + + dstfd = -1; + err = 0; + + /* Open the source file. */ + srcfd = uv_fs_open(NULL, &fs_req, req->path, O_RDONLY, 0, NULL); + uv_fs_req_cleanup(&fs_req); + + if (srcfd < 0) + return srcfd; + + /* Get the source file's mode. */ + if (fstat(srcfd, &statsbuf)) { + err = UV__ERR(errno); + goto out; + } + + dst_flags = O_WRONLY | O_CREAT | O_TRUNC; + + if (req->flags & UV_FS_COPYFILE_EXCL) + dst_flags |= O_EXCL; + + /* Open the destination file. */ + dstfd = uv_fs_open(NULL, + &fs_req, + req->new_path, + dst_flags, + statsbuf.st_mode, + NULL); + uv_fs_req_cleanup(&fs_req); + + if (dstfd < 0) { + err = dstfd; + goto out; + } + + if (fchmod(dstfd, statsbuf.st_mode) == -1) { + err = UV__ERR(errno); + goto out; + } + +#ifdef FICLONE + if (req->flags & UV_FS_COPYFILE_FICLONE || + req->flags & UV_FS_COPYFILE_FICLONE_FORCE) { + if (ioctl(dstfd, FICLONE, srcfd) == -1) { + /* If an error occurred that the sendfile fallback also won't handle, or + this is a force clone then exit. Otherwise, fall through to try using + sendfile(). */ + if (errno != ENOTTY && errno != EOPNOTSUPP && errno != EXDEV) { + err = UV__ERR(errno); + goto out; + } else if (req->flags & UV_FS_COPYFILE_FICLONE_FORCE) { + err = UV_ENOTSUP; + goto out; + } + } else { + goto out; + } + } +#else + if (req->flags & UV_FS_COPYFILE_FICLONE_FORCE) { + err = UV_ENOSYS; + goto out; + } +#endif + + bytes_to_send = statsbuf.st_size; + in_offset = 0; + while (bytes_to_send != 0) { + err = uv_fs_sendfile(NULL, + &fs_req, + dstfd, + srcfd, + in_offset, + bytes_to_send, + NULL); + uv_fs_req_cleanup(&fs_req); + if (err < 0) + break; + bytes_to_send -= fs_req.result; + in_offset += fs_req.result; + } + +out: + if (err < 0) + result = err; + else + result = 0; + + /* Close the source file. */ + err = uv__close_nocheckstdio(srcfd); + + /* Don't overwrite any existing errors. */ + if (err != 0 && result == 0) + result = err; + + /* Close the destination file if it is open. */ + if (dstfd >= 0) { + err = uv__close_nocheckstdio(dstfd); + + /* Don't overwrite any existing errors. */ + if (err != 0 && result == 0) + result = err; + + /* Remove the destination file if something went wrong. */ + if (result != 0) { + uv_fs_unlink(NULL, &fs_req, req->new_path, NULL); + /* Ignore the unlink return value, as an error already happened. */ + uv_fs_req_cleanup(&fs_req); + } + } + + if (result == 0) + return 0; + + errno = UV__ERR(result); + return -1; - #endif +} + +static void uv__to_stat(struct stat* src, uv_stat_t* dst) { + dst->st_dev = src->st_dev; + dst->st_mode = src->st_mode; + dst->st_nlink = src->st_nlink; + dst->st_uid = src->st_uid; + dst->st_gid = src->st_gid; + dst->st_rdev = src->st_rdev; + dst->st_ino = src->st_ino; + dst->st_size = src->st_size; + dst->st_blksize = src->st_blksize; + dst->st_blocks = src->st_blocks; + +#if defined(__APPLE__) + dst->st_atim.tv_sec = src->st_atimespec.tv_sec; + dst->st_atim.tv_nsec = src->st_atimespec.tv_nsec; + dst->st_mtim.tv_sec = src->st_mtimespec.tv_sec; + dst->st_mtim.tv_nsec = src->st_mtimespec.tv_nsec; + dst->st_ctim.tv_sec = src->st_ctimespec.tv_sec; + dst->st_ctim.tv_nsec = src->st_ctimespec.tv_nsec; + dst->st_birthtim.tv_sec = src->st_birthtimespec.tv_sec; + dst->st_birthtim.tv_nsec = src->st_birthtimespec.tv_nsec; + dst->st_flags = src->st_flags; + dst->st_gen = src->st_gen; +#elif defined(__ANDROID__) + dst->st_atim.tv_sec = src->st_atime; + dst->st_atim.tv_nsec = src->st_atimensec; + dst->st_mtim.tv_sec = src->st_mtime; + dst->st_mtim.tv_nsec = src->st_mtimensec; + dst->st_ctim.tv_sec = src->st_ctime; + dst->st_ctim.tv_nsec = src->st_ctimensec; + dst->st_birthtim.tv_sec = src->st_ctime; + dst->st_birthtim.tv_nsec = src->st_ctimensec; + dst->st_flags = 0; + dst->st_gen = 0; +#elif !defined(_AIX) && ( \ + defined(__DragonFly__) || \ + defined(__FreeBSD__) || \ + defined(__OpenBSD__) || \ + defined(__NetBSD__) || \ + defined(_GNU_SOURCE) || \ + defined(_BSD_SOURCE) || \ + defined(_SVID_SOURCE) || \ + defined(_XOPEN_SOURCE) || \ + defined(_DEFAULT_SOURCE)) + dst->st_atim.tv_sec = src->st_atim.tv_sec; + dst->st_atim.tv_nsec = src->st_atim.tv_nsec; + dst->st_mtim.tv_sec = src->st_mtim.tv_sec; + dst->st_mtim.tv_nsec = src->st_mtim.tv_nsec; + dst->st_ctim.tv_sec = src->st_ctim.tv_sec; + dst->st_ctim.tv_nsec = src->st_ctim.tv_nsec; +# if defined(__FreeBSD__) || \ + defined(__NetBSD__) + dst->st_birthtim.tv_sec = src->st_birthtim.tv_sec; + dst->st_birthtim.tv_nsec = src->st_birthtim.tv_nsec; + dst->st_flags = src->st_flags; + dst->st_gen = src->st_gen; +# else + dst->st_birthtim.tv_sec = src->st_ctim.tv_sec; + dst->st_birthtim.tv_nsec = src->st_ctim.tv_nsec; + dst->st_flags = 0; + dst->st_gen = 0; +# endif +#else + dst->st_atim.tv_sec = src->st_atime; + dst->st_atim.tv_nsec = 0; + dst->st_mtim.tv_sec = src->st_mtime; + dst->st_mtim.tv_nsec = 0; + dst->st_ctim.tv_sec = src->st_ctime; + dst->st_ctim.tv_nsec = 0; + dst->st_birthtim.tv_sec = src->st_ctime; + dst->st_birthtim.tv_nsec = 0; + dst->st_flags = 0; + dst->st_gen = 0; +#endif +} + + ++static int uv__fs_statx(int fd, ++ const char* path, ++ int is_fstat, ++ int is_lstat, ++ uv_stat_t* buf) { ++ STATIC_ASSERT(UV_ENOSYS != -1); ++#ifdef __linux__ ++ static int no_statx; ++ struct uv__statx statxbuf; ++ int dirfd; ++ int flags; ++ int mode; ++ int rc; ++ ++ if (no_statx) ++ return UV_ENOSYS; ++ ++ dirfd = AT_FDCWD; ++ flags = 0; /* AT_STATX_SYNC_AS_STAT */ ++ mode = 0xFFF; /* STATX_BASIC_STATS + STATX_BTIME */ ++ ++ if (is_fstat) { ++ dirfd = fd; ++ flags |= 0x1000; /* AT_EMPTY_PATH */ ++ } ++ ++ if (is_lstat) ++ flags |= AT_SYMLINK_NOFOLLOW; ++ ++ rc = uv__statx(dirfd, path, flags, mode, &statxbuf); ++ ++ if (rc == -1) { ++ /* EPERM happens when a seccomp filter rejects the system call. ++ * Has been observed with libseccomp < 2.3.3 and docker < 18.04. ++ */ ++ if (errno != EINVAL && errno != EPERM && errno != ENOSYS) ++ return -1; ++ ++ no_statx = 1; ++ return UV_ENOSYS; ++ } ++ ++ buf->st_dev = 256 * statxbuf.stx_dev_major + statxbuf.stx_dev_minor; ++ buf->st_mode = statxbuf.stx_mode; ++ buf->st_nlink = statxbuf.stx_nlink; ++ buf->st_uid = statxbuf.stx_uid; ++ buf->st_gid = statxbuf.stx_gid; ++ buf->st_rdev = statxbuf.stx_rdev_major; ++ buf->st_ino = statxbuf.stx_ino; ++ buf->st_size = statxbuf.stx_size; ++ buf->st_blksize = statxbuf.stx_blksize; ++ buf->st_blocks = statxbuf.stx_blocks; ++ buf->st_atim.tv_sec = statxbuf.stx_atime.tv_sec; ++ buf->st_atim.tv_nsec = statxbuf.stx_atime.tv_nsec; ++ buf->st_mtim.tv_sec = statxbuf.stx_mtime.tv_sec; ++ buf->st_mtim.tv_nsec = statxbuf.stx_mtime.tv_nsec; ++ buf->st_ctim.tv_sec = statxbuf.stx_ctime.tv_sec; ++ buf->st_ctim.tv_nsec = statxbuf.stx_ctime.tv_nsec; ++ buf->st_birthtim.tv_sec = statxbuf.stx_btime.tv_sec; ++ buf->st_birthtim.tv_nsec = statxbuf.stx_btime.tv_nsec; ++ buf->st_flags = 0; ++ buf->st_gen = 0; ++ ++ return 0; ++#else ++ return UV_ENOSYS; ++#endif /* __linux__ */ ++} ++ ++ +static int uv__fs_stat(const char *path, uv_stat_t *buf) { + struct stat pbuf; + int ret; + ++ ret = uv__fs_statx(-1, path, /* is_fstat */ 0, /* is_lstat */ 0, buf); ++ if (ret != UV_ENOSYS) ++ return ret; ++ + ret = stat(path, &pbuf); + if (ret == 0) + uv__to_stat(&pbuf, buf); + + return ret; +} + + +static int uv__fs_lstat(const char *path, uv_stat_t *buf) { + struct stat pbuf; + int ret; + ++ ret = uv__fs_statx(-1, path, /* is_fstat */ 0, /* is_lstat */ 1, buf); ++ if (ret != UV_ENOSYS) ++ return ret; ++ + ret = lstat(path, &pbuf); + if (ret == 0) + uv__to_stat(&pbuf, buf); + + return ret; +} + + +static int uv__fs_fstat(int fd, uv_stat_t *buf) { + struct stat pbuf; + int ret; + ++ ret = uv__fs_statx(fd, "", /* is_fstat */ 1, /* is_lstat */ 0, buf); ++ if (ret != UV_ENOSYS) ++ return ret; ++ + ret = fstat(fd, &pbuf); + if (ret == 0) + uv__to_stat(&pbuf, buf); + + return ret; +} + +static size_t uv__fs_buf_offset(uv_buf_t* bufs, size_t size) { + size_t offset; + /* Figure out which bufs are done */ + for (offset = 0; size > 0 && bufs[offset].len <= size; ++offset) + size -= bufs[offset].len; + + /* Fix a partial read/write */ + if (size > 0) { + bufs[offset].base += size; + bufs[offset].len -= size; + } + return offset; +} + +static ssize_t uv__fs_write_all(uv_fs_t* req) { + unsigned int iovmax; + unsigned int nbufs; + uv_buf_t* bufs; + ssize_t total; + ssize_t result; + + iovmax = uv__getiovmax(); + nbufs = req->nbufs; + bufs = req->bufs; + total = 0; + + while (nbufs > 0) { + req->nbufs = nbufs; + if (req->nbufs > iovmax) + req->nbufs = iovmax; + + do + result = uv__fs_write(req); + while (result < 0 && errno == EINTR); + + if (result <= 0) { + if (total == 0) + total = result; + break; + } + + if (req->off >= 0) + req->off += result; + + req->nbufs = uv__fs_buf_offset(req->bufs, result); + req->bufs += req->nbufs; + nbufs -= req->nbufs; + total += result; + } + + if (bufs != req->bufsml) + uv__free(bufs); + + req->bufs = NULL; + req->nbufs = 0; + + return total; +} + + +static void uv__fs_work(struct uv__work* w) { + int retry_on_eintr; + uv_fs_t* req; + ssize_t r; + + req = container_of(w, uv_fs_t, work_req); + retry_on_eintr = !(req->fs_type == UV_FS_CLOSE || + req->fs_type == UV_FS_READ); + + do { + errno = 0; + +#define X(type, action) \ + case UV_FS_ ## type: \ + r = action; \ + break; + + switch (req->fs_type) { + X(ACCESS, access(req->path, req->flags)); + X(CHMOD, chmod(req->path, req->mode)); + X(CHOWN, chown(req->path, req->uid, req->gid)); - X(CLOSE, close(req->file)); ++ X(CLOSE, uv__fs_close(req->file)); + X(COPYFILE, uv__fs_copyfile(req)); + X(FCHMOD, fchmod(req->file, req->mode)); + X(FCHOWN, fchown(req->file, req->uid, req->gid)); + X(LCHOWN, lchown(req->path, req->uid, req->gid)); + X(FDATASYNC, uv__fs_fdatasync(req)); + X(FSTAT, uv__fs_fstat(req->file, &req->statbuf)); + X(FSYNC, uv__fs_fsync(req)); + X(FTRUNCATE, ftruncate(req->file, req->off)); + X(FUTIME, uv__fs_futime(req)); + X(LSTAT, uv__fs_lstat(req->path, &req->statbuf)); + X(LINK, link(req->path, req->new_path)); + X(MKDIR, mkdir(req->path, req->mode)); + X(MKDTEMP, uv__fs_mkdtemp(req)); + X(OPEN, uv__fs_open(req)); + X(READ, uv__fs_read(req)); + X(SCANDIR, uv__fs_scandir(req)); ++ X(OPENDIR, uv__fs_opendir(req)); ++ X(READDIR, uv__fs_readdir(req)); ++ X(CLOSEDIR, uv__fs_closedir(req)); + X(READLINK, uv__fs_readlink(req)); + X(REALPATH, uv__fs_realpath(req)); + X(RENAME, rename(req->path, req->new_path)); + X(RMDIR, rmdir(req->path)); + X(SENDFILE, uv__fs_sendfile(req)); + X(STAT, uv__fs_stat(req->path, &req->statbuf)); + X(SYMLINK, symlink(req->path, req->new_path)); + X(UNLINK, unlink(req->path)); + X(UTIME, uv__fs_utime(req)); + X(WRITE, uv__fs_write_all(req)); + default: abort(); + } +#undef X + } while (r == -1 && errno == EINTR && retry_on_eintr); + + if (r == -1) + req->result = UV__ERR(errno); + else + req->result = r; + + if (r == 0 && (req->fs_type == UV_FS_STAT || + req->fs_type == UV_FS_FSTAT || + req->fs_type == UV_FS_LSTAT)) { + req->ptr = &req->statbuf; + } +} + + +static void uv__fs_done(struct uv__work* w, int status) { + uv_fs_t* req; + + req = container_of(w, uv_fs_t, work_req); + uv__req_unregister(req->loop, req); + + if (status == UV_ECANCELED) { + assert(req->result == 0); + req->result = UV_ECANCELED; + } + + req->cb(req); +} + + +int uv_fs_access(uv_loop_t* loop, + uv_fs_t* req, + const char* path, + int flags, + uv_fs_cb cb) { + INIT(ACCESS); + PATH; + req->flags = flags; + POST; +} + + +int uv_fs_chmod(uv_loop_t* loop, + uv_fs_t* req, + const char* path, + int mode, + uv_fs_cb cb) { + INIT(CHMOD); + PATH; + req->mode = mode; + POST; +} + + +int uv_fs_chown(uv_loop_t* loop, + uv_fs_t* req, + const char* path, + uv_uid_t uid, + uv_gid_t gid, + uv_fs_cb cb) { + INIT(CHOWN); + PATH; + req->uid = uid; + req->gid = gid; + POST; +} + + +int uv_fs_close(uv_loop_t* loop, uv_fs_t* req, uv_file file, uv_fs_cb cb) { + INIT(CLOSE); + req->file = file; + POST; +} + + +int uv_fs_fchmod(uv_loop_t* loop, + uv_fs_t* req, + uv_file file, + int mode, + uv_fs_cb cb) { + INIT(FCHMOD); + req->file = file; + req->mode = mode; + POST; +} + + +int uv_fs_fchown(uv_loop_t* loop, + uv_fs_t* req, + uv_file file, + uv_uid_t uid, + uv_gid_t gid, + uv_fs_cb cb) { + INIT(FCHOWN); + req->file = file; + req->uid = uid; + req->gid = gid; + POST; +} + + +int uv_fs_lchown(uv_loop_t* loop, + uv_fs_t* req, + const char* path, + uv_uid_t uid, + uv_gid_t gid, + uv_fs_cb cb) { + INIT(LCHOWN); + PATH; + req->uid = uid; + req->gid = gid; + POST; +} + + +int uv_fs_fdatasync(uv_loop_t* loop, uv_fs_t* req, uv_file file, uv_fs_cb cb) { + INIT(FDATASYNC); + req->file = file; + POST; +} + + +int uv_fs_fstat(uv_loop_t* loop, uv_fs_t* req, uv_file file, uv_fs_cb cb) { + INIT(FSTAT); + req->file = file; + POST; +} + + +int uv_fs_fsync(uv_loop_t* loop, uv_fs_t* req, uv_file file, uv_fs_cb cb) { + INIT(FSYNC); + req->file = file; + POST; +} + + +int uv_fs_ftruncate(uv_loop_t* loop, + uv_fs_t* req, + uv_file file, + int64_t off, + uv_fs_cb cb) { + INIT(FTRUNCATE); + req->file = file; + req->off = off; + POST; +} + + +int uv_fs_futime(uv_loop_t* loop, + uv_fs_t* req, + uv_file file, + double atime, + double mtime, + uv_fs_cb cb) { + INIT(FUTIME); + req->file = file; + req->atime = atime; + req->mtime = mtime; + POST; +} + + +int uv_fs_lstat(uv_loop_t* loop, uv_fs_t* req, const char* path, uv_fs_cb cb) { + INIT(LSTAT); + PATH; + POST; +} + + +int uv_fs_link(uv_loop_t* loop, + uv_fs_t* req, + const char* path, + const char* new_path, + uv_fs_cb cb) { + INIT(LINK); + PATH2; + POST; +} + + +int uv_fs_mkdir(uv_loop_t* loop, + uv_fs_t* req, + const char* path, + int mode, + uv_fs_cb cb) { + INIT(MKDIR); + PATH; + req->mode = mode; + POST; +} + + +int uv_fs_mkdtemp(uv_loop_t* loop, + uv_fs_t* req, + const char* tpl, + uv_fs_cb cb) { + INIT(MKDTEMP); + req->path = uv__strdup(tpl); + if (req->path == NULL) + return UV_ENOMEM; + POST; +} + + +int uv_fs_open(uv_loop_t* loop, + uv_fs_t* req, + const char* path, + int flags, + int mode, + uv_fs_cb cb) { + INIT(OPEN); + PATH; + req->flags = flags; + req->mode = mode; + POST; +} + + +int uv_fs_read(uv_loop_t* loop, uv_fs_t* req, + uv_file file, + const uv_buf_t bufs[], + unsigned int nbufs, + int64_t off, + uv_fs_cb cb) { + INIT(READ); + + if (bufs == NULL || nbufs == 0) + return UV_EINVAL; + + req->file = file; + + req->nbufs = nbufs; + req->bufs = req->bufsml; + if (nbufs > ARRAY_SIZE(req->bufsml)) + req->bufs = uv__malloc(nbufs * sizeof(*bufs)); + + if (req->bufs == NULL) + return UV_ENOMEM; + + memcpy(req->bufs, bufs, nbufs * sizeof(*bufs)); + + req->off = off; + POST; +} + + +int uv_fs_scandir(uv_loop_t* loop, + uv_fs_t* req, + const char* path, + int flags, + uv_fs_cb cb) { + INIT(SCANDIR); + PATH; + req->flags = flags; + POST; +} + ++int uv_fs_opendir(uv_loop_t* loop, ++ uv_fs_t* req, ++ const char* path, ++ uv_fs_cb cb) { ++ INIT(OPENDIR); ++ PATH; ++ POST; ++} ++ ++int uv_fs_readdir(uv_loop_t* loop, ++ uv_fs_t* req, ++ uv_dir_t* dir, ++ uv_fs_cb cb) { ++ INIT(READDIR); ++ ++ if (dir == NULL || dir->dir == NULL || dir->dirents == NULL) ++ return UV_EINVAL; ++ ++ req->ptr = dir; ++ POST; ++} ++ ++int uv_fs_closedir(uv_loop_t* loop, ++ uv_fs_t* req, ++ uv_dir_t* dir, ++ uv_fs_cb cb) { ++ INIT(CLOSEDIR); ++ ++ if (dir == NULL) ++ return UV_EINVAL; ++ ++ req->ptr = dir; ++ POST; ++} + +int uv_fs_readlink(uv_loop_t* loop, + uv_fs_t* req, + const char* path, + uv_fs_cb cb) { + INIT(READLINK); + PATH; + POST; +} + + +int uv_fs_realpath(uv_loop_t* loop, + uv_fs_t* req, + const char * path, + uv_fs_cb cb) { + INIT(REALPATH); + PATH; + POST; +} + + +int uv_fs_rename(uv_loop_t* loop, + uv_fs_t* req, + const char* path, + const char* new_path, + uv_fs_cb cb) { + INIT(RENAME); + PATH2; + POST; +} + + +int uv_fs_rmdir(uv_loop_t* loop, uv_fs_t* req, const char* path, uv_fs_cb cb) { + INIT(RMDIR); + PATH; + POST; +} + + +int uv_fs_sendfile(uv_loop_t* loop, + uv_fs_t* req, + uv_file out_fd, + uv_file in_fd, + int64_t off, + size_t len, + uv_fs_cb cb) { + INIT(SENDFILE); + req->flags = in_fd; /* hack */ + req->file = out_fd; + req->off = off; + req->bufsml[0].len = len; + POST; +} + + +int uv_fs_stat(uv_loop_t* loop, uv_fs_t* req, const char* path, uv_fs_cb cb) { + INIT(STAT); + PATH; + POST; +} + + +int uv_fs_symlink(uv_loop_t* loop, + uv_fs_t* req, + const char* path, + const char* new_path, + int flags, + uv_fs_cb cb) { + INIT(SYMLINK); + PATH2; + req->flags = flags; + POST; +} + + +int uv_fs_unlink(uv_loop_t* loop, uv_fs_t* req, const char* path, uv_fs_cb cb) { + INIT(UNLINK); + PATH; + POST; +} + + +int uv_fs_utime(uv_loop_t* loop, + uv_fs_t* req, + const char* path, + double atime, + double mtime, + uv_fs_cb cb) { + INIT(UTIME); + PATH; + req->atime = atime; + req->mtime = mtime; + POST; +} + + +int uv_fs_write(uv_loop_t* loop, + uv_fs_t* req, + uv_file file, + const uv_buf_t bufs[], + unsigned int nbufs, + int64_t off, + uv_fs_cb cb) { + INIT(WRITE); + + if (bufs == NULL || nbufs == 0) + return UV_EINVAL; + + req->file = file; + + req->nbufs = nbufs; + req->bufs = req->bufsml; + if (nbufs > ARRAY_SIZE(req->bufsml)) + req->bufs = uv__malloc(nbufs * sizeof(*bufs)); + + if (req->bufs == NULL) + return UV_ENOMEM; + + memcpy(req->bufs, bufs, nbufs * sizeof(*bufs)); + + req->off = off; + POST; +} + + +void uv_fs_req_cleanup(uv_fs_t* req) { + if (req == NULL) + return; + + /* Only necessary for asychronous requests, i.e., requests with a callback. + * Synchronous ones don't copy their arguments and have req->path and + * req->new_path pointing to user-owned memory. UV_FS_MKDTEMP is the + * exception to the rule, it always allocates memory. + */ + if (req->path != NULL && (req->cb != NULL || req->fs_type == UV_FS_MKDTEMP)) + uv__free((void*) req->path); /* Memory is shared with req->new_path. */ + + req->path = NULL; + req->new_path = NULL; + ++ if (req->fs_type == UV_FS_READDIR && req->ptr != NULL) ++ uv__fs_readdir_cleanup(req); ++ + if (req->fs_type == UV_FS_SCANDIR && req->ptr != NULL) + uv__fs_scandir_cleanup(req); + + if (req->bufs != req->bufsml) + uv__free(req->bufs); + req->bufs = NULL; + - if (req->ptr != &req->statbuf) ++ if (req->fs_type != UV_FS_OPENDIR && req->ptr != &req->statbuf) + uv__free(req->ptr); + req->ptr = NULL; +} + + +int uv_fs_copyfile(uv_loop_t* loop, + uv_fs_t* req, + const char* path, + const char* new_path, + int flags, + uv_fs_cb cb) { + INIT(COPYFILE); + + if (flags & ~(UV_FS_COPYFILE_EXCL | + UV_FS_COPYFILE_FICLONE | + UV_FS_COPYFILE_FICLONE_FORCE)) { + return UV_EINVAL; + } + + PATH2; + req->flags = flags; + POST; +} diff --cc Utilities/cmlibuv/src/unix/haiku.c index 0000000,7708851..7708851 mode 000000,100644..100644 --- a/Utilities/cmlibuv/src/unix/haiku.c +++ b/Utilities/cmlibuv/src/unix/haiku.c diff --cc Utilities/cmlibuv/src/unix/internal.h index 48fe6e8,0000000..b43c0b1 mode 100644,000000..100644 --- a/Utilities/cmlibuv/src/unix/internal.h +++ b/Utilities/cmlibuv/src/unix/internal.h @@@ -1,319 -1,0 +1,326 @@@ +/* Copyright Joyent, Inc. and other Node contributors. All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +#ifndef UV_UNIX_INTERNAL_H_ +#define UV_UNIX_INTERNAL_H_ + +#include "uv-common.h" + +#include +#include /* abort */ +#include /* strrchr */ +#include /* O_CLOEXEC, may be */ +#include +#include + +#if defined(__STRICT_ANSI__) +# define inline __inline +#endif + +#if defined(__linux__) +# include "linux-syscalls.h" +#endif /* __linux__ */ + +#if defined(__MVS__) +# include "os390-syscalls.h" +#endif /* __MVS__ */ + +#if defined(__sun) +# include +# include +#endif /* __sun */ + +#if defined(_AIX) +# define reqevents events +# define rtnevents revents +# include +#else +# include +#endif /* _AIX */ + +#if defined(__APPLE__) && !TARGET_OS_IPHONE +# include +#endif + +#if defined(CMAKE_BOOTSTRAP) +# undef pthread_atfork +# define pthread_atfork(prepare, parent, child) \ + uv__pthread_atfork(prepare, parent, child) +int uv__pthread_atfork(void (*prepare)(void), void (*parent)(void), + void (*child)(void)); +# undef pthread_sigmask +# define pthread_sigmask(how, set, oldset) \ + uv__pthread_sigmask(how, set, oldset) +int uv__pthread_sigmask(int how, const sigset_t* set, sigset_t* oset); +#elif defined(__ANDROID__) +int uv__pthread_sigmask(int how, const sigset_t* set, sigset_t* oset); +# ifdef pthread_sigmask +# undef pthread_sigmask +# endif +# define pthread_sigmask(how, set, oldset) uv__pthread_sigmask(how, set, oldset) +#endif + +#define ACCESS_ONCE(type, var) \ + (*(volatile type*) &(var)) + +#define ROUND_UP(a, b) \ + ((a) % (b) ? ((a) + (b)) - ((a) % (b)) : (a)) + +#define UNREACHABLE() \ + do { \ + assert(0 && "unreachable code"); \ + abort(); \ + } \ + while (0) + +#define SAVE_ERRNO(block) \ + do { \ + int _saved_errno = errno; \ + do { block; } while (0); \ + errno = _saved_errno; \ + } \ + while (0) + +/* The __clang__ and __INTEL_COMPILER checks are superfluous because they + * define __GNUC__. They are here to convey to you, dear reader, that these + * macros are enabled when compiling with clang or icc. + */ +#if defined(__clang__) || \ + defined(__GNUC__) || \ - defined(__INTEL_COMPILER) || \ - defined(__SUNPRO_C) ++ defined(__INTEL_COMPILER) +# define UV_DESTRUCTOR(declaration) __attribute__((destructor)) declaration +# define UV_UNUSED(declaration) __attribute__((unused)) declaration +#else +# define UV_DESTRUCTOR(declaration) declaration +# define UV_UNUSED(declaration) declaration +#endif + +/* Leans on the fact that, on Linux, POLLRDHUP == EPOLLRDHUP. */ +#ifdef POLLRDHUP +# define UV__POLLRDHUP POLLRDHUP +#else +# define UV__POLLRDHUP 0x2000 +#endif + +#ifdef POLLPRI +# define UV__POLLPRI POLLPRI +#else +# define UV__POLLPRI 0 +#endif + +#if !defined(O_CLOEXEC) && defined(__FreeBSD__) +/* + * It may be that we are just missing `__POSIX_VISIBLE >= 200809`. + * Try using fixed value const and give up, if it doesn't work + */ +# define O_CLOEXEC 0x00100000 +#endif + +typedef struct uv__stream_queued_fds_s uv__stream_queued_fds_t; + +/* loop flags */ +enum { + UV_LOOP_BLOCK_SIGPROF = 1 +}; + +/* flags of excluding ifaddr */ +enum { + UV__EXCLUDE_IFPHYS, + UV__EXCLUDE_IFADDR +}; + +typedef enum { + UV_CLOCK_PRECISE = 0, /* Use the highest resolution clock available. */ + UV_CLOCK_FAST = 1 /* Use the fastest clock with <= 1ms granularity. */ +} uv_clocktype_t; + +struct uv__stream_queued_fds_s { + unsigned int size; + unsigned int offset; + int fds[1]; +}; + + +#if defined(_AIX) || \ + defined(__APPLE__) || \ + defined(__DragonFly__) || \ + defined(__FreeBSD__) || \ + defined(__FreeBSD_kernel__) || \ + defined(__linux__) || \ + defined(__OpenBSD__) || \ + defined(__NetBSD__) +#define uv__cloexec uv__cloexec_ioctl +#define uv__nonblock uv__nonblock_ioctl +#else +#define uv__cloexec uv__cloexec_fcntl +#define uv__nonblock uv__nonblock_fcntl +#endif + +/* On Linux, uv__nonblock_fcntl() and uv__nonblock_ioctl() do not commute + * when O_NDELAY is not equal to O_NONBLOCK. Case in point: linux/sparc32 + * and linux/sparc64, where O_NDELAY is O_NONBLOCK + another bit. + * + * Libuv uses uv__nonblock_fcntl() directly sometimes so ensure that it + * commutes with uv__nonblock(). + */ +#if defined(__linux__) && O_NDELAY != O_NONBLOCK +#undef uv__nonblock +#define uv__nonblock uv__nonblock_fcntl +#endif + +/* core */ +int uv__cloexec_ioctl(int fd, int set); +int uv__cloexec_fcntl(int fd, int set); +int uv__nonblock_ioctl(int fd, int set); +int uv__nonblock_fcntl(int fd, int set); +int uv__close(int fd); /* preserves errno */ +int uv__close_nocheckstdio(int fd); ++int uv__close_nocancel(int fd); +int uv__socket(int domain, int type, int protocol); +ssize_t uv__recvmsg(int fd, struct msghdr *msg, int flags); +void uv__make_close_pending(uv_handle_t* handle); +int uv__getiovmax(void); + +void uv__io_init(uv__io_t* w, uv__io_cb cb, int fd); +void uv__io_start(uv_loop_t* loop, uv__io_t* w, unsigned int events); +void uv__io_stop(uv_loop_t* loop, uv__io_t* w, unsigned int events); +void uv__io_close(uv_loop_t* loop, uv__io_t* w); +void uv__io_feed(uv_loop_t* loop, uv__io_t* w); +int uv__io_active(const uv__io_t* w, unsigned int events); +int uv__io_check_fd(uv_loop_t* loop, int fd); +void uv__io_poll(uv_loop_t* loop, int timeout); /* in milliseconds or -1 */ +int uv__io_fork(uv_loop_t* loop); +int uv__fd_exists(uv_loop_t* loop, int fd); + +/* async */ +void uv__async_stop(uv_loop_t* loop); +int uv__async_fork(uv_loop_t* loop); + + +/* loop */ +void uv__run_idle(uv_loop_t* loop); +void uv__run_check(uv_loop_t* loop); +void uv__run_prepare(uv_loop_t* loop); + +/* stream */ +void uv__stream_init(uv_loop_t* loop, uv_stream_t* stream, + uv_handle_type type); +int uv__stream_open(uv_stream_t*, int fd, int flags); +void uv__stream_destroy(uv_stream_t* stream); +#if defined(__APPLE__) +int uv__stream_try_select(uv_stream_t* stream, int* fd); +#endif /* defined(__APPLE__) */ +void uv__server_io(uv_loop_t* loop, uv__io_t* w, unsigned int events); +int uv__accept(int sockfd); +int uv__dup2_cloexec(int oldfd, int newfd); +int uv__open_cloexec(const char* path, int flags); + +/* tcp */ +int uv_tcp_listen(uv_tcp_t* tcp, int backlog, uv_connection_cb cb); +int uv__tcp_nodelay(int fd, int on); +int uv__tcp_keepalive(int fd, int on, unsigned int delay); + +/* pipe */ +int uv_pipe_listen(uv_pipe_t* handle, int backlog, uv_connection_cb cb); + +/* signal */ +void uv__signal_close(uv_signal_t* handle); +void uv__signal_global_once_init(void); +void uv__signal_loop_cleanup(uv_loop_t* loop); +int uv__signal_loop_fork(uv_loop_t* loop); + +/* platform specific */ +uint64_t uv__hrtime(uv_clocktype_t type); +int uv__kqueue_init(uv_loop_t* loop); +int uv__platform_loop_init(uv_loop_t* loop); +void uv__platform_loop_delete(uv_loop_t* loop); +void uv__platform_invalidate_fd(uv_loop_t* loop, int fd); + +/* various */ +void uv__async_close(uv_async_t* handle); +void uv__check_close(uv_check_t* handle); +void uv__fs_event_close(uv_fs_event_t* handle); +void uv__idle_close(uv_idle_t* handle); +void uv__pipe_close(uv_pipe_t* handle); +void uv__poll_close(uv_poll_t* handle); +void uv__prepare_close(uv_prepare_t* handle); +void uv__process_close(uv_process_t* handle); +void uv__stream_close(uv_stream_t* handle); +void uv__tcp_close(uv_tcp_t* handle); +void uv__udp_close(uv_udp_t* handle); +void uv__udp_finish_close(uv_udp_t* handle); +uv_handle_type uv__handle_type(int fd); +FILE* uv__open_file(const char* path); +int uv__getpwuid_r(uv_passwd_t* pwd); + + +#if defined(__APPLE__) && !defined(CMAKE_BOOTSTRAP) +int uv___stream_fd(const uv_stream_t* handle); +#define uv__stream_fd(handle) (uv___stream_fd((const uv_stream_t*) (handle))) +#else +#define uv__stream_fd(handle) ((handle)->io_watcher.fd) +#endif /* defined(__APPLE__) */ + +#ifdef UV__O_NONBLOCK +# define UV__F_NONBLOCK UV__O_NONBLOCK +#else +# define UV__F_NONBLOCK 1 +#endif + +int uv__make_socketpair(int fds[2], int flags); +int uv__make_pipe(int fds[2], int flags); + +#if defined(__APPLE__) + +int uv__fsevents_init(uv_fs_event_t* handle); +int uv__fsevents_close(uv_fs_event_t* handle); +void uv__fsevents_loop_delete(uv_loop_t* loop); + +#endif /* defined(__APPLE__) */ + +UV_UNUSED(static void uv__update_time(uv_loop_t* loop)) { + /* Use a fast time source if available. We only need millisecond precision. + */ + loop->time = uv__hrtime(UV_CLOCK_FAST) / 1000000; +} + +UV_UNUSED(static char* uv__basename_r(const char* path)) { + char* s; + + s = strrchr(path, '/'); + if (s == NULL) + return (char*) path; + + return s + 1; +} + +#if defined(__linux__) +int uv__inotify_fork(uv_loop_t* loop, void* old_watchers); +#endif + ++typedef int (*uv__peersockfunc)(int, struct sockaddr*, socklen_t*); ++ ++int uv__getsockpeername(const uv_handle_t* handle, ++ uv__peersockfunc func, ++ struct sockaddr* name, ++ int* namelen); ++ +#endif /* UV_UNIX_INTERNAL_H_ */ diff --cc Utilities/cmlibuv/src/unix/pipe.c index 9657bc9,0000000..7d97550 mode 100644,000000..100644 --- a/Utilities/cmlibuv/src/unix/pipe.c +++ b/Utilities/cmlibuv/src/unix/pipe.c @@@ -1,375 -1,0 +1,375 @@@ +/* Copyright Joyent, Inc. and other Node contributors. All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +#include "uv.h" +#include "internal.h" + +#include +#include +#include +#include +#include +#include + + +int uv_pipe_init(uv_loop_t* loop, uv_pipe_t* handle, int ipc) { + uv__stream_init(loop, (uv_stream_t*)handle, UV_NAMED_PIPE); + handle->shutdown_req = NULL; + handle->connect_req = NULL; + handle->pipe_fname = NULL; + handle->ipc = ipc; + return 0; +} + + +int uv_pipe_bind(uv_pipe_t* handle, const char* name) { + struct sockaddr_un saddr; + const char* pipe_fname = NULL; + int sockfd = -1; + int err; + + /* Already bound? */ + if (uv__stream_fd(handle) >= 0) + return UV_EINVAL; + + /* Make a copy of the file name, it outlives this function's scope. */ + pipe_fname = uv__strdup(name); + if (pipe_fname == NULL) + return UV_ENOMEM; + + /* We've got a copy, don't touch the original any more. */ + name = NULL; + + err = uv__socket(AF_UNIX, SOCK_STREAM, 0); + if (err < 0) + goto err_socket; + sockfd = err; + + memset(&saddr, 0, sizeof saddr); + uv__strscpy(saddr.sun_path, pipe_fname, sizeof(saddr.sun_path)); + saddr.sun_family = AF_UNIX; + + if (bind(sockfd, (struct sockaddr*)&saddr, sizeof saddr)) { + err = UV__ERR(errno); + /* Convert ENOENT to EACCES for compatibility with Windows. */ + if (err == UV_ENOENT) + err = UV_EACCES; + + uv__close(sockfd); + goto err_socket; + } + + /* Success. */ + handle->flags |= UV_HANDLE_BOUND; + handle->pipe_fname = pipe_fname; /* Is a strdup'ed copy. */ + handle->io_watcher.fd = sockfd; + return 0; + +err_socket: + uv__free((void*)pipe_fname); + return err; +} + + +int uv_pipe_listen(uv_pipe_t* handle, int backlog, uv_connection_cb cb) { + if (uv__stream_fd(handle) == -1) + return UV_EINVAL; + +#if defined(__MVS__) + /* On zOS, backlog=0 has undefined behaviour */ + if (backlog == 0) + backlog = 1; + else if (backlog < 0) + backlog = SOMAXCONN; +#endif + + if (listen(uv__stream_fd(handle), backlog)) + return UV__ERR(errno); + + handle->connection_cb = cb; + handle->io_watcher.cb = uv__server_io; + uv__io_start(handle->loop, &handle->io_watcher, POLLIN); + return 0; +} + + +void uv__pipe_close(uv_pipe_t* handle) { + if (handle->pipe_fname) { + /* + * Unlink the file system entity before closing the file descriptor. + * Doing it the other way around introduces a race where our process + * unlinks a socket with the same name that's just been created by + * another thread or process. + */ + unlink(handle->pipe_fname); + uv__free((void*)handle->pipe_fname); + handle->pipe_fname = NULL; + } + + uv__stream_close((uv_stream_t*)handle); +} + + +int uv_pipe_open(uv_pipe_t* handle, uv_file fd) { + int flags; + int mode; + int err; + flags = 0; + + if (uv__fd_exists(handle->loop, fd)) + return UV_EEXIST; + + do + mode = fcntl(fd, F_GETFL); + while (mode == -1 && errno == EINTR); + + if (mode == -1) + return UV__ERR(errno); /* according to docs, must be EBADF */ + + err = uv__nonblock(fd, 1); + if (err) + return err; + +#if defined(__APPLE__) && !defined(CMAKE_BOOTSTRAP) + err = uv__stream_try_select((uv_stream_t*) handle, &fd); + if (err) + return err; +#endif /* defined(__APPLE__) */ + + mode &= O_ACCMODE; + if (mode != O_WRONLY) + flags |= UV_HANDLE_READABLE; + if (mode != O_RDONLY) + flags |= UV_HANDLE_WRITABLE; + + return uv__stream_open((uv_stream_t*)handle, fd, flags); +} + + +void uv_pipe_connect(uv_connect_t* req, + uv_pipe_t* handle, + const char* name, + uv_connect_cb cb) { + struct sockaddr_un saddr; + int new_sock; + int err; + int r; + + new_sock = (uv__stream_fd(handle) == -1); + + if (new_sock) { + err = uv__socket(AF_UNIX, SOCK_STREAM, 0); + if (err < 0) + goto out; + handle->io_watcher.fd = err; + } + + memset(&saddr, 0, sizeof saddr); + uv__strscpy(saddr.sun_path, name, sizeof(saddr.sun_path)); + saddr.sun_family = AF_UNIX; + + do { + r = connect(uv__stream_fd(handle), + (struct sockaddr*)&saddr, sizeof saddr); + } + while (r == -1 && errno == EINTR); + + if (r == -1 && errno != EINPROGRESS) { + err = UV__ERR(errno); +#if defined(__CYGWIN__) || defined(__MSYS__) + /* EBADF is supposed to mean that the socket fd is bad, but + Cygwin reports EBADF instead of ENOTSOCK when the file is + not a socket. We do not expect to see a bad fd here + (e.g. due to new_sock), so translate the error. */ + if (err == UV_EBADF) + err = UV_ENOTSOCK; +#endif + goto out; + } + + err = 0; + if (new_sock) { + err = uv__stream_open((uv_stream_t*)handle, + uv__stream_fd(handle), + UV_HANDLE_READABLE | UV_HANDLE_WRITABLE); + } + + if (err == 0) - uv__io_start(handle->loop, &handle->io_watcher, POLLIN | POLLOUT); ++ uv__io_start(handle->loop, &handle->io_watcher, POLLOUT); + +out: + handle->delayed_error = err; + handle->connect_req = req; + + uv__req_init(handle->loop, req, UV_CONNECT); + req->handle = (uv_stream_t*)handle; + req->cb = cb; + QUEUE_INIT(&req->queue); + + /* Force callback to run on next tick in case of error. */ + if (err) + uv__io_feed(handle->loop, &handle->io_watcher); + +} + + - typedef int (*uv__peersockfunc)(int, struct sockaddr*, socklen_t*); - - +static int uv__pipe_getsockpeername(const uv_pipe_t* handle, + uv__peersockfunc func, + char* buffer, + size_t* size) { + struct sockaddr_un sa; + socklen_t addrlen; + int err; + + addrlen = sizeof(sa); + memset(&sa, 0, addrlen); - err = func(uv__stream_fd(handle), (struct sockaddr*) &sa, &addrlen); ++ err = uv__getsockpeername((const uv_handle_t*) handle, ++ func, ++ (struct sockaddr*) &sa, ++ (int*) &addrlen); + if (err < 0) { + *size = 0; - return UV__ERR(errno); ++ return err; + } + +#if defined(__linux__) + if (sa.sun_path[0] == 0) + /* Linux abstract namespace */ + addrlen -= offsetof(struct sockaddr_un, sun_path); + else +#endif + addrlen = strlen(sa.sun_path); + + + if (addrlen >= *size) { + *size = addrlen + 1; + return UV_ENOBUFS; + } + + memcpy(buffer, sa.sun_path, addrlen); + *size = addrlen; + + /* only null-terminate if it's not an abstract socket */ + if (buffer[0] != '\0') + buffer[addrlen] = '\0'; + + return 0; +} + + +int uv_pipe_getsockname(const uv_pipe_t* handle, char* buffer, size_t* size) { + return uv__pipe_getsockpeername(handle, getsockname, buffer, size); +} + + +int uv_pipe_getpeername(const uv_pipe_t* handle, char* buffer, size_t* size) { + return uv__pipe_getsockpeername(handle, getpeername, buffer, size); +} + + +void uv_pipe_pending_instances(uv_pipe_t* handle, int count) { +} + + +int uv_pipe_pending_count(uv_pipe_t* handle) { + uv__stream_queued_fds_t* queued_fds; + + if (!handle->ipc) + return 0; + + if (handle->accepted_fd == -1) + return 0; + + if (handle->queued_fds == NULL) + return 1; + + queued_fds = handle->queued_fds; + return queued_fds->offset + 1; +} + + +uv_handle_type uv_pipe_pending_type(uv_pipe_t* handle) { + if (!handle->ipc) + return UV_UNKNOWN_HANDLE; + + if (handle->accepted_fd == -1) + return UV_UNKNOWN_HANDLE; + else + return uv__handle_type(handle->accepted_fd); +} + + +int uv_pipe_chmod(uv_pipe_t* handle, int mode) { + unsigned desired_mode; + struct stat pipe_stat; + char* name_buffer; + size_t name_len; + int r; + + if (handle == NULL || uv__stream_fd(handle) == -1) + return UV_EBADF; + + if (mode != UV_READABLE && + mode != UV_WRITABLE && + mode != (UV_WRITABLE | UV_READABLE)) + return UV_EINVAL; + + /* Unfortunately fchmod does not work on all platforms, we will use chmod. */ + name_len = 0; + r = uv_pipe_getsockname(handle, NULL, &name_len); + if (r != UV_ENOBUFS) + return r; + + name_buffer = uv__malloc(name_len); + if (name_buffer == NULL) + return UV_ENOMEM; + + r = uv_pipe_getsockname(handle, name_buffer, &name_len); + if (r != 0) { + uv__free(name_buffer); + return r; + } + + /* stat must be used as fstat has a bug on Darwin */ + if (stat(name_buffer, &pipe_stat) == -1) { + uv__free(name_buffer); + return -errno; + } + + desired_mode = 0; + if (mode & UV_READABLE) + desired_mode |= S_IRUSR | S_IRGRP | S_IROTH; + if (mode & UV_WRITABLE) + desired_mode |= S_IWUSR | S_IWGRP | S_IWOTH; + + /* Exit early if pipe already has desired mode. */ + if ((pipe_stat.st_mode & desired_mode) == desired_mode) { + uv__free(name_buffer); + return 0; + } + + pipe_stat.st_mode |= desired_mode; + + r = chmod(name_buffer, pipe_stat.st_mode); + uv__free(name_buffer); + + return r != -1 ? 0 : UV__ERR(errno); +} diff --cc Utilities/cmlibuv/src/unix/process.c index e9579f5,0000000..f4826bf mode 100644,000000..100644 --- a/Utilities/cmlibuv/src/unix/process.c +++ b/Utilities/cmlibuv/src/unix/process.c @@@ -1,651 -1,0 +1,658 @@@ +/* Copyright Joyent, Inc. and other Node contributors. All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +#include "uv.h" +#include "internal.h" + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#if defined(__APPLE__) && !TARGET_OS_IPHONE +# include +# define environ (*_NSGetEnviron()) +#else +extern char **environ; +#endif + +#if defined(__linux__) || defined(__GLIBC__) +# include +#endif + +#ifndef CMAKE_BOOTSTRAP +#if defined(__linux__) +# define uv__cpu_set_t cpu_set_t +#elif defined(__FreeBSD__) +# include +# include +# include +# define uv__cpu_set_t cpuset_t +#endif +#endif + +static void uv__chld(uv_signal_t* handle, int signum) { + uv_process_t* process; + uv_loop_t* loop; + int exit_status; + int term_signal; + int status; + pid_t pid; + QUEUE pending; + QUEUE* q; + QUEUE* h; + + assert(signum == SIGCHLD); + + QUEUE_INIT(&pending); + loop = handle->loop; + + h = &loop->process_handles; + q = QUEUE_HEAD(h); + while (q != h) { + process = QUEUE_DATA(q, uv_process_t, queue); + q = QUEUE_NEXT(q); + + do + pid = waitpid(process->pid, &status, WNOHANG); + while (pid == -1 && errno == EINTR); + + if (pid == 0) + continue; + + if (pid == -1) { + if (errno != ECHILD) + abort(); + continue; + } + + process->status = status; + QUEUE_REMOVE(&process->queue); + QUEUE_INSERT_TAIL(&pending, &process->queue); + } + + h = &pending; + q = QUEUE_HEAD(h); + while (q != h) { + process = QUEUE_DATA(q, uv_process_t, queue); + q = QUEUE_NEXT(q); + + QUEUE_REMOVE(&process->queue); + QUEUE_INIT(&process->queue); + uv__handle_stop(process); + + if (process->exit_cb == NULL) + continue; + + exit_status = 0; + if (WIFEXITED(process->status)) + exit_status = WEXITSTATUS(process->status); + + term_signal = 0; + if (WIFSIGNALED(process->status)) + term_signal = WTERMSIG(process->status); + + process->exit_cb(process, exit_status, term_signal); + } + assert(QUEUE_EMPTY(&pending)); +} + + +int uv__make_socketpair(int fds[2], int flags) { +#if defined(__linux__) + static int no_cloexec; + + if (no_cloexec) + goto skip; + + if (socketpair(AF_UNIX, SOCK_STREAM | UV__SOCK_CLOEXEC | flags, 0, fds) == 0) + return 0; + + /* Retry on EINVAL, it means SOCK_CLOEXEC is not supported. + * Anything else is a genuine error. + */ + if (errno != EINVAL) + return UV__ERR(errno); + + no_cloexec = 1; + +skip: +#endif + + if (socketpair(AF_UNIX, SOCK_STREAM, 0, fds)) + return UV__ERR(errno); + + uv__cloexec(fds[0], 1); + uv__cloexec(fds[1], 1); + + if (flags & UV__F_NONBLOCK) { + uv__nonblock(fds[0], 1); + uv__nonblock(fds[1], 1); + } + + return 0; +} + + +int uv__make_pipe(int fds[2], int flags) { +#if defined(__linux__) + static int no_pipe2; + + if (no_pipe2) + goto skip; + + if (uv__pipe2(fds, flags | UV__O_CLOEXEC) == 0) + return 0; + + if (errno != ENOSYS) + return UV__ERR(errno); + + no_pipe2 = 1; + +skip: +#endif + + if (pipe(fds)) + return UV__ERR(errno); + + uv__cloexec(fds[0], 1); + uv__cloexec(fds[1], 1); + + if (flags & UV__F_NONBLOCK) { + uv__nonblock(fds[0], 1); + uv__nonblock(fds[1], 1); + } + + return 0; +} + + +/* + * Used for initializing stdio streams like options.stdin_stream. Returns + * zero on success. See also the cleanup section in uv_spawn(). + */ +static int uv__process_init_stdio(uv_stdio_container_t* container, int fds[2]) { + int mask; + int fd; + + mask = UV_IGNORE | UV_CREATE_PIPE | UV_INHERIT_FD | UV_INHERIT_STREAM; + + switch (container->flags & mask) { + case UV_IGNORE: + return 0; + + case UV_CREATE_PIPE: + assert(container->data.stream != NULL); + if (container->data.stream->type != UV_NAMED_PIPE) + return UV_EINVAL; + else + return uv__make_socketpair(fds, 0); + + case UV_INHERIT_FD: + case UV_INHERIT_STREAM: + if (container->flags & UV_INHERIT_FD) + fd = container->data.fd; + else + fd = uv__stream_fd(container->data.stream); + + if (fd == -1) + return UV_EINVAL; + + fds[1] = fd; + return 0; + + default: + assert(0 && "Unexpected flags"); + return UV_EINVAL; + } +} + + +static int uv__process_open_stream(uv_stdio_container_t* container, + int pipefds[2]) { + int flags; + int err; + + if (!(container->flags & UV_CREATE_PIPE) || pipefds[0] < 0) + return 0; + + err = uv__close(pipefds[1]); + if (err != 0) + abort(); + + pipefds[1] = -1; + uv__nonblock(pipefds[0], 1); + + flags = 0; + if (container->flags & UV_WRITABLE_PIPE) + flags |= UV_HANDLE_READABLE; + if (container->flags & UV_READABLE_PIPE) + flags |= UV_HANDLE_WRITABLE; + + return uv__stream_open(container->data.stream, pipefds[0], flags); +} + + +static void uv__process_close_stream(uv_stdio_container_t* container) { + if (!(container->flags & UV_CREATE_PIPE)) return; + uv__stream_close((uv_stream_t*)container->data.stream); +} + + +static void uv__write_int(int fd, int val) { + ssize_t n; + + do + n = write(fd, &val, sizeof(val)); + while (n == -1 && errno == EINTR); + + if (n == -1 && errno == EPIPE) + return; /* parent process has quit */ + + assert(n == sizeof(val)); +} + + +#if !(defined(__APPLE__) && (TARGET_OS_TV || TARGET_OS_WATCH)) +/* execvp is marked __WATCHOS_PROHIBITED __TVOS_PROHIBITED, so must be + * avoided. Since this isn't called on those targets, the function + * doesn't even need to be defined for them. + */ +static void uv__process_child_init(const uv_process_options_t* options, + int stdio_count, + int (*pipes)[2], + int error_fd) { + sigset_t set; + int close_fd; + int use_fd; + int err; + int fd; + int n; +#ifndef CMAKE_BOOTSTRAP +#if defined(__linux__) || defined(__FreeBSD__) + int r; + int i; + int cpumask_size; + uv__cpu_set_t cpuset; +#endif +#endif + + if (options->flags & UV_PROCESS_DETACHED) + setsid(); + + /* First duplicate low numbered fds, since it's not safe to duplicate them, + * they could get replaced. Example: swapping stdout and stderr; without + * this fd 2 (stderr) would be duplicated into fd 1, thus making both + * stdout and stderr go to the same fd, which was not the intention. */ + for (fd = 0; fd < stdio_count; fd++) { + use_fd = pipes[fd][1]; + if (use_fd < 0 || use_fd >= fd) + continue; + pipes[fd][1] = fcntl(use_fd, F_DUPFD, stdio_count); + if (pipes[fd][1] == -1) { + uv__write_int(error_fd, UV__ERR(errno)); + _exit(127); + } + } + + for (fd = 0; fd < stdio_count; fd++) { + close_fd = pipes[fd][0]; + use_fd = pipes[fd][1]; + + if (use_fd < 0) { + if (fd >= 3) + continue; + else { + /* redirect stdin, stdout and stderr to /dev/null even if UV_IGNORE is + * set + */ + use_fd = open("/dev/null", fd == 0 ? O_RDONLY : O_RDWR); + close_fd = use_fd; + + if (use_fd < 0) { + uv__write_int(error_fd, UV__ERR(errno)); + _exit(127); + } + } + } + + if (fd == use_fd) + uv__cloexec_fcntl(use_fd, 0); + else + fd = dup2(use_fd, fd); + + if (fd == -1) { + uv__write_int(error_fd, UV__ERR(errno)); + _exit(127); + } + + if (fd <= 2) + uv__nonblock_fcntl(fd, 0); + + if (close_fd >= stdio_count) + uv__close(close_fd); + } + + for (fd = 0; fd < stdio_count; fd++) { + use_fd = pipes[fd][1]; + + if (use_fd >= stdio_count) + uv__close(use_fd); + } + + if (options->cwd != NULL && chdir(options->cwd)) { + uv__write_int(error_fd, UV__ERR(errno)); + _exit(127); + } + + if (options->flags & (UV_PROCESS_SETUID | UV_PROCESS_SETGID)) { + /* When dropping privileges from root, the `setgroups` call will + * remove any extraneous groups. If we don't call this, then + * even though our uid has dropped, we may still have groups + * that enable us to do super-user things. This will fail if we + * aren't root, so don't bother checking the return value, this + * is just done as an optimistic privilege dropping function. + */ + SAVE_ERRNO(setgroups(0, NULL)); + } + + if ((options->flags & UV_PROCESS_SETGID) && setgid(options->gid)) { + uv__write_int(error_fd, UV__ERR(errno)); + _exit(127); + } + + if ((options->flags & UV_PROCESS_SETUID) && setuid(options->uid)) { + uv__write_int(error_fd, UV__ERR(errno)); + _exit(127); + } + +#ifndef CMAKE_BOOTSTRAP +#if defined(__linux__) || defined(__FreeBSD__) + if (options->cpumask != NULL) { + cpumask_size = uv_cpumask_size(); + assert(options->cpumask_size >= (size_t)cpumask_size); + + CPU_ZERO(&cpuset); + for (i = 0; i < cpumask_size; ++i) { + if (options->cpumask[i]) { + CPU_SET(i, &cpuset); + } + } + + r = -pthread_setaffinity_np(pthread_self(), sizeof(cpuset), &cpuset); + if (r != 0) { + uv__write_int(error_fd, r); + _exit(127); + } + } +#endif +#endif + + if (options->env != NULL) { + environ = options->env; + } + + /* Reset signal disposition. Use a hard-coded limit because NSIG + * is not fixed on Linux: it's either 32, 34 or 64, depending on + * whether RT signals are enabled. We are not allowed to touch + * RT signal handlers, glibc uses them internally. + */ + for (n = 1; n < 32; n += 1) { + if (n == SIGKILL || n == SIGSTOP) + continue; /* Can't be changed. */ + ++#if defined(__HAIKU__) ++ if (n == SIGKILLTHR) ++ continue; /* Can't be changed. */ ++#endif ++ + if (SIG_ERR != signal(n, SIG_DFL)) + continue; + + uv__write_int(error_fd, UV__ERR(errno)); + _exit(127); + } + + /* Reset signal mask. */ + sigemptyset(&set); + err = pthread_sigmask(SIG_SETMASK, &set, NULL); + + if (err != 0) { + uv__write_int(error_fd, UV__ERR(err)); + _exit(127); + } + + execvp(options->file, options->args); + uv__write_int(error_fd, UV__ERR(errno)); + _exit(127); +} +#endif + + +int uv_spawn(uv_loop_t* loop, + uv_process_t* process, + const uv_process_options_t* options) { +#if defined(__APPLE__) && (TARGET_OS_TV || TARGET_OS_WATCH) + /* fork is marked __WATCHOS_PROHIBITED __TVOS_PROHIBITED. */ + return UV_ENOSYS; +#else + int signal_pipe[2] = { -1, -1 }; + int pipes_storage[8][2]; + int (*pipes)[2]; + int stdio_count; + ssize_t r; + pid_t pid; + int err; + int exec_errorno; + int i; + int status; + + if (options->cpumask != NULL) { +#ifndef CMAKE_BOOTSTRAP +#if defined(__linux__) || defined(__FreeBSD__) + if (options->cpumask_size < (size_t)uv_cpumask_size()) { + return UV_EINVAL; + } +#else + return UV_ENOTSUP; +#endif +#else + return UV_ENOTSUP; +#endif + } + + assert(options->file != NULL); + assert(!(options->flags & ~(UV_PROCESS_DETACHED | + UV_PROCESS_SETGID | + UV_PROCESS_SETUID | + UV_PROCESS_WINDOWS_HIDE | ++ UV_PROCESS_WINDOWS_HIDE_CONSOLE | ++ UV_PROCESS_WINDOWS_HIDE_GUI | + UV_PROCESS_WINDOWS_VERBATIM_ARGUMENTS))); + + uv__handle_init(loop, (uv_handle_t*)process, UV_PROCESS); + QUEUE_INIT(&process->queue); + + stdio_count = options->stdio_count; + if (stdio_count < 3) + stdio_count = 3; + + err = UV_ENOMEM; + pipes = pipes_storage; + if (stdio_count > (int) ARRAY_SIZE(pipes_storage)) + pipes = uv__malloc(stdio_count * sizeof(*pipes)); + + if (pipes == NULL) + goto error; + + for (i = 0; i < stdio_count; i++) { + pipes[i][0] = -1; + pipes[i][1] = -1; + } + + for (i = 0; i < options->stdio_count; i++) { + err = uv__process_init_stdio(options->stdio + i, pipes[i]); + if (err) + goto error; + } + + /* This pipe is used by the parent to wait until + * the child has called `execve()`. We need this + * to avoid the following race condition: + * + * if ((pid = fork()) > 0) { + * kill(pid, SIGTERM); + * } + * else if (pid == 0) { + * execve("/bin/cat", argp, envp); + * } + * + * The parent sends a signal immediately after forking. + * Since the child may not have called `execve()` yet, + * there is no telling what process receives the signal, + * our fork or /bin/cat. + * + * To avoid ambiguity, we create a pipe with both ends + * marked close-on-exec. Then, after the call to `fork()`, + * the parent polls the read end until it EOFs or errors with EPIPE. + */ + err = uv__make_pipe(signal_pipe, 0); + if (err) + goto error; + + uv_signal_start(&loop->child_watcher, uv__chld, SIGCHLD); + + /* Acquire write lock to prevent opening new fds in worker threads */ + uv_rwlock_wrlock(&loop->cloexec_lock); + pid = fork(); + + if (pid == -1) { + err = UV__ERR(errno); + uv_rwlock_wrunlock(&loop->cloexec_lock); + uv__close(signal_pipe[0]); + uv__close(signal_pipe[1]); + goto error; + } + + if (pid == 0) { + uv__process_child_init(options, stdio_count, pipes, signal_pipe[1]); + abort(); + } + + /* Release lock in parent process */ + uv_rwlock_wrunlock(&loop->cloexec_lock); + uv__close(signal_pipe[1]); + + process->status = 0; + exec_errorno = 0; + do + r = read(signal_pipe[0], &exec_errorno, sizeof(exec_errorno)); + while (r == -1 && errno == EINTR); + + if (r == 0) + ; /* okay, EOF */ + else if (r == sizeof(exec_errorno)) { + do + err = waitpid(pid, &status, 0); /* okay, read errorno */ + while (err == -1 && errno == EINTR); + assert(err == pid); + } else if (r == -1 && errno == EPIPE) { + do + err = waitpid(pid, &status, 0); /* okay, got EPIPE */ + while (err == -1 && errno == EINTR); + assert(err == pid); + } else + abort(); + + uv__close_nocheckstdio(signal_pipe[0]); + + for (i = 0; i < options->stdio_count; i++) { + err = uv__process_open_stream(options->stdio + i, pipes[i]); + if (err == 0) + continue; + + while (i--) + uv__process_close_stream(options->stdio + i); + + goto error; + } + + /* Only activate this handle if exec() happened successfully */ + if (exec_errorno == 0) { + QUEUE_INSERT_TAIL(&loop->process_handles, &process->queue); + uv__handle_start(process); + } + + process->pid = pid; + process->exit_cb = options->exit_cb; + + if (pipes != pipes_storage) + uv__free(pipes); + + return exec_errorno; + +error: + if (pipes != NULL) { + for (i = 0; i < stdio_count; i++) { + if (i < options->stdio_count) + if (options->stdio[i].flags & (UV_INHERIT_FD | UV_INHERIT_STREAM)) + continue; + if (pipes[i][0] != -1) + uv__close_nocheckstdio(pipes[i][0]); + if (pipes[i][1] != -1) + uv__close_nocheckstdio(pipes[i][1]); + } + + if (pipes != pipes_storage) + uv__free(pipes); + } + + return err; +#endif +} + + +int uv_process_kill(uv_process_t* process, int signum) { + return uv_kill(process->pid, signum); +} + + +int uv_kill(int pid, int signum) { + if (kill(pid, signum)) + return UV__ERR(errno); + else + return 0; +} + + +void uv__process_close(uv_process_t* handle) { + QUEUE_REMOVE(&handle->queue); + uv__handle_stop(handle); + if (QUEUE_EMPTY(&handle->loop->process_handles)) + uv_signal_stop(&handle->loop->child_watcher); +} diff --cc Utilities/cmlibuv/src/unix/stream.c index 4b9123f,0000000..8121f64 mode 100644,000000..100644 --- a/Utilities/cmlibuv/src/unix/stream.c +++ b/Utilities/cmlibuv/src/unix/stream.c @@@ -1,1688 -1,0 +1,1688 @@@ +/* Copyright Joyent, Inc. and other Node contributors. All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +#include "uv.h" +#include "internal.h" + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include /* IOV_MAX */ + +#if defined(__APPLE__) +# include +# include +# include + +/* Forward declaration */ +typedef struct uv__stream_select_s uv__stream_select_t; + +struct uv__stream_select_s { + uv_stream_t* stream; + uv_thread_t thread; + uv_sem_t close_sem; + uv_sem_t async_sem; + uv_async_t async; + int events; + int fake_fd; + int int_fd; + int fd; + fd_set* sread; + size_t sread_sz; + fd_set* swrite; + size_t swrite_sz; +}; + +/* Due to a possible kernel bug at least in OS X 10.10 "Yosemite", + * EPROTOTYPE can be returned while trying to write to a socket that is + * shutting down. If we retry the write, we should get the expected EPIPE + * instead. + */ +# define RETRY_ON_WRITE_ERROR(errno) (errno == EINTR || errno == EPROTOTYPE) +# define IS_TRANSIENT_WRITE_ERROR(errno, send_handle) \ + (errno == EAGAIN || errno == EWOULDBLOCK || errno == ENOBUFS || \ + (errno == EMSGSIZE && send_handle != NULL)) +#else +# define RETRY_ON_WRITE_ERROR(errno) (errno == EINTR) +# define IS_TRANSIENT_WRITE_ERROR(errno, send_handle) \ + (errno == EAGAIN || errno == EWOULDBLOCK || errno == ENOBUFS) +#endif /* defined(__APPLE__) */ + +static void uv__stream_connect(uv_stream_t*); +static void uv__write(uv_stream_t* stream); +static void uv__read(uv_stream_t* stream); +static void uv__stream_io(uv_loop_t* loop, uv__io_t* w, unsigned int events); +static void uv__write_callbacks(uv_stream_t* stream); +static size_t uv__write_req_size(uv_write_t* req); + + +void uv__stream_init(uv_loop_t* loop, + uv_stream_t* stream, + uv_handle_type type) { + int err; + + uv__handle_init(loop, (uv_handle_t*)stream, type); + stream->read_cb = NULL; + stream->alloc_cb = NULL; + stream->close_cb = NULL; + stream->connection_cb = NULL; + stream->connect_req = NULL; + stream->shutdown_req = NULL; + stream->accepted_fd = -1; + stream->queued_fds = NULL; + stream->delayed_error = 0; + QUEUE_INIT(&stream->write_queue); + QUEUE_INIT(&stream->write_completed_queue); + stream->write_queue_size = 0; + + if (loop->emfile_fd == -1) { + err = uv__open_cloexec("/dev/null", O_RDONLY); + if (err < 0) + /* In the rare case that "/dev/null" isn't mounted open "/" + * instead. + */ + err = uv__open_cloexec("/", O_RDONLY); + if (err >= 0) + loop->emfile_fd = err; + } + +#if defined(__APPLE__) && !defined(CMAKE_BOOTSTRAP) + stream->select = NULL; +#endif /* defined(__APPLE_) */ + + uv__io_init(&stream->io_watcher, uv__stream_io, -1); +} + + +static void uv__stream_osx_interrupt_select(uv_stream_t* stream) { +#if defined(__APPLE__) && !defined(CMAKE_BOOTSTRAP) + /* Notify select() thread about state change */ + uv__stream_select_t* s; + int r; + + s = stream->select; + if (s == NULL) + return; + + /* Interrupt select() loop + * NOTE: fake_fd and int_fd are socketpair(), thus writing to one will + * emit read event on other side + */ + do + r = write(s->fake_fd, "x", 1); + while (r == -1 && errno == EINTR); + + assert(r == 1); +#else /* !defined(__APPLE__) */ + /* No-op on any other platform */ +#endif /* !defined(__APPLE__) */ +} + + +#if defined(__APPLE__) && !defined(CMAKE_BOOTSTRAP) +static void uv__stream_osx_select(void* arg) { + uv_stream_t* stream; + uv__stream_select_t* s; + char buf[1024]; + int events; + int fd; + int r; + int max_fd; + + stream = arg; + s = stream->select; + fd = s->fd; + + if (fd > s->int_fd) + max_fd = fd; + else + max_fd = s->int_fd; + + while (1) { + /* Terminate on semaphore */ + if (uv_sem_trywait(&s->close_sem) == 0) + break; + + /* Watch fd using select(2) */ + memset(s->sread, 0, s->sread_sz); + memset(s->swrite, 0, s->swrite_sz); + + if (uv__io_active(&stream->io_watcher, POLLIN)) + FD_SET(fd, s->sread); + if (uv__io_active(&stream->io_watcher, POLLOUT)) + FD_SET(fd, s->swrite); + FD_SET(s->int_fd, s->sread); + + /* Wait indefinitely for fd events */ + r = select(max_fd + 1, s->sread, s->swrite, NULL, NULL); + if (r == -1) { + if (errno == EINTR) + continue; + + /* XXX: Possible?! */ + abort(); + } + + /* Ignore timeouts */ + if (r == 0) + continue; + + /* Empty socketpair's buffer in case of interruption */ + if (FD_ISSET(s->int_fd, s->sread)) + while (1) { + r = read(s->int_fd, buf, sizeof(buf)); + + if (r == sizeof(buf)) + continue; + + if (r != -1) + break; + + if (errno == EAGAIN || errno == EWOULDBLOCK) + break; + + if (errno == EINTR) + continue; + + abort(); + } + + /* Handle events */ + events = 0; + if (FD_ISSET(fd, s->sread)) + events |= POLLIN; + if (FD_ISSET(fd, s->swrite)) + events |= POLLOUT; + + assert(events != 0 || FD_ISSET(s->int_fd, s->sread)); + if (events != 0) { + ACCESS_ONCE(int, s->events) = events; + + uv_async_send(&s->async); + uv_sem_wait(&s->async_sem); + + /* Should be processed at this stage */ + assert((s->events == 0) || (stream->flags & UV_HANDLE_CLOSING)); + } + } +} + + +static void uv__stream_osx_select_cb(uv_async_t* handle) { + uv__stream_select_t* s; + uv_stream_t* stream; + int events; + + s = container_of(handle, uv__stream_select_t, async); + stream = s->stream; + + /* Get and reset stream's events */ + events = s->events; + ACCESS_ONCE(int, s->events) = 0; + + assert(events != 0); + assert(events == (events & (POLLIN | POLLOUT))); + + /* Invoke callback on event-loop */ + if ((events & POLLIN) && uv__io_active(&stream->io_watcher, POLLIN)) + uv__stream_io(stream->loop, &stream->io_watcher, POLLIN); + + if ((events & POLLOUT) && uv__io_active(&stream->io_watcher, POLLOUT)) + uv__stream_io(stream->loop, &stream->io_watcher, POLLOUT); + + if (stream->flags & UV_HANDLE_CLOSING) + return; + + /* NOTE: It is important to do it here, otherwise `select()` might be called + * before the actual `uv__read()`, leading to the blocking syscall + */ + uv_sem_post(&s->async_sem); +} + + +static void uv__stream_osx_cb_close(uv_handle_t* async) { + uv__stream_select_t* s; + + s = container_of(async, uv__stream_select_t, async); + uv__free(s); +} + + +int uv__stream_try_select(uv_stream_t* stream, int* fd) { + /* + * kqueue doesn't work with some files from /dev mount on osx. + * select(2) in separate thread for those fds + */ + + struct kevent filter[1]; + struct kevent events[1]; + struct timespec timeout; + uv__stream_select_t* s; + int fds[2]; + int err; + int ret; + int kq; + int old_fd; + int max_fd; + size_t sread_sz; + size_t swrite_sz; + + kq = kqueue(); + if (kq == -1) { + perror("(libuv) kqueue()"); + return UV__ERR(errno); + } + + EV_SET(&filter[0], *fd, EVFILT_READ, EV_ADD | EV_ENABLE, 0, 0, 0); + + /* Use small timeout, because we only want to capture EINVALs */ + timeout.tv_sec = 0; + timeout.tv_nsec = 1; + + do + ret = kevent(kq, filter, 1, events, 1, &timeout); + while (ret == -1 && errno == EINTR); + + uv__close(kq); + + if (ret == -1) + return UV__ERR(errno); + + if (ret == 0 || (events[0].flags & EV_ERROR) == 0 || events[0].data != EINVAL) + return 0; + + /* At this point we definitely know that this fd won't work with kqueue */ + + /* + * Create fds for io watcher and to interrupt the select() loop. + * NOTE: do it ahead of malloc below to allocate enough space for fd_sets + */ + if (socketpair(AF_UNIX, SOCK_STREAM, 0, fds)) + return UV__ERR(errno); + + max_fd = *fd; + if (fds[1] > max_fd) + max_fd = fds[1]; + + sread_sz = ROUND_UP(max_fd + 1, sizeof(uint32_t) * NBBY) / NBBY; + swrite_sz = sread_sz; + + s = uv__malloc(sizeof(*s) + sread_sz + swrite_sz); + if (s == NULL) { + err = UV_ENOMEM; + goto failed_malloc; + } + + s->events = 0; + s->fd = *fd; + s->sread = (fd_set*) ((char*) s + sizeof(*s)); + s->sread_sz = sread_sz; + s->swrite = (fd_set*) ((char*) s->sread + sread_sz); + s->swrite_sz = swrite_sz; + + err = uv_async_init(stream->loop, &s->async, uv__stream_osx_select_cb); + if (err) + goto failed_async_init; + + s->async.flags |= UV_HANDLE_INTERNAL; + uv__handle_unref(&s->async); + + err = uv_sem_init(&s->close_sem, 0); + if (err != 0) + goto failed_close_sem_init; + + err = uv_sem_init(&s->async_sem, 0); + if (err != 0) + goto failed_async_sem_init; + + s->fake_fd = fds[0]; + s->int_fd = fds[1]; + + old_fd = *fd; + s->stream = stream; + stream->select = s; + *fd = s->fake_fd; + + err = uv_thread_create(&s->thread, uv__stream_osx_select, stream); + if (err != 0) + goto failed_thread_create; + + return 0; + +failed_thread_create: + s->stream = NULL; + stream->select = NULL; + *fd = old_fd; + + uv_sem_destroy(&s->async_sem); + +failed_async_sem_init: + uv_sem_destroy(&s->close_sem); + +failed_close_sem_init: + uv__close(fds[0]); + uv__close(fds[1]); + uv_close((uv_handle_t*) &s->async, uv__stream_osx_cb_close); + return err; + +failed_async_init: + uv__free(s); + +failed_malloc: + uv__close(fds[0]); + uv__close(fds[1]); + + return err; +} +#endif /* defined(__APPLE__) */ + + +int uv__stream_open(uv_stream_t* stream, int fd, int flags) { +#if defined(__APPLE__) + int enable; +#endif + + if (!(stream->io_watcher.fd == -1 || stream->io_watcher.fd == fd)) + return UV_EBUSY; + + assert(fd >= 0); + stream->flags |= flags; + + if (stream->type == UV_TCP) { + if ((stream->flags & UV_HANDLE_TCP_NODELAY) && uv__tcp_nodelay(fd, 1)) + return UV__ERR(errno); + + /* TODO Use delay the user passed in. */ + if ((stream->flags & UV_HANDLE_TCP_KEEPALIVE) && + uv__tcp_keepalive(fd, 1, 60)) { + return UV__ERR(errno); + } + } + +#if defined(__APPLE__) + enable = 1; + if (setsockopt(fd, SOL_SOCKET, SO_OOBINLINE, &enable, sizeof(enable)) && + errno != ENOTSOCK && + errno != EINVAL) { + return UV__ERR(errno); + } +#endif + + stream->io_watcher.fd = fd; + + return 0; +} + + +void uv__stream_flush_write_queue(uv_stream_t* stream, int error) { + uv_write_t* req; + QUEUE* q; + while (!QUEUE_EMPTY(&stream->write_queue)) { + q = QUEUE_HEAD(&stream->write_queue); + QUEUE_REMOVE(q); + + req = QUEUE_DATA(q, uv_write_t, queue); + req->error = error; + + QUEUE_INSERT_TAIL(&stream->write_completed_queue, &req->queue); + } +} + + +void uv__stream_destroy(uv_stream_t* stream) { + assert(!uv__io_active(&stream->io_watcher, POLLIN | POLLOUT)); + assert(stream->flags & UV_HANDLE_CLOSED); + + if (stream->connect_req) { + uv__req_unregister(stream->loop, stream->connect_req); + stream->connect_req->cb(stream->connect_req, UV_ECANCELED); + stream->connect_req = NULL; + } + + uv__stream_flush_write_queue(stream, UV_ECANCELED); + uv__write_callbacks(stream); + + if (stream->shutdown_req) { + /* The ECANCELED error code is a lie, the shutdown(2) syscall is a + * fait accompli at this point. Maybe we should revisit this in v0.11. + * A possible reason for leaving it unchanged is that it informs the + * callee that the handle has been destroyed. + */ + uv__req_unregister(stream->loop, stream->shutdown_req); + stream->shutdown_req->cb(stream->shutdown_req, UV_ECANCELED); + stream->shutdown_req = NULL; + } + + assert(stream->write_queue_size == 0); +} + + +/* Implements a best effort approach to mitigating accept() EMFILE errors. + * We have a spare file descriptor stashed away that we close to get below + * the EMFILE limit. Next, we accept all pending connections and close them + * immediately to signal the clients that we're overloaded - and we are, but + * we still keep on trucking. + * + * There is one caveat: it's not reliable in a multi-threaded environment. + * The file descriptor limit is per process. Our party trick fails if another + * thread opens a file or creates a socket in the time window between us + * calling close() and accept(). + */ +static int uv__emfile_trick(uv_loop_t* loop, int accept_fd) { + int err; + int emfile_fd; + + if (loop->emfile_fd == -1) + return UV_EMFILE; + + uv__close(loop->emfile_fd); + loop->emfile_fd = -1; + + do { + err = uv__accept(accept_fd); + if (err >= 0) + uv__close(err); + } while (err >= 0 || err == UV_EINTR); + + emfile_fd = uv__open_cloexec("/", O_RDONLY); + if (emfile_fd >= 0) + loop->emfile_fd = emfile_fd; + + return err; +} + + +#if defined(UV_HAVE_KQUEUE) +# define UV_DEC_BACKLOG(w) w->rcount--; +#else +# define UV_DEC_BACKLOG(w) /* no-op */ +#endif /* defined(UV_HAVE_KQUEUE) */ + + +void uv__server_io(uv_loop_t* loop, uv__io_t* w, unsigned int events) { + uv_stream_t* stream; + int err; + + stream = container_of(w, uv_stream_t, io_watcher); + assert(events & POLLIN); + assert(stream->accepted_fd == -1); + assert(!(stream->flags & UV_HANDLE_CLOSING)); + + uv__io_start(stream->loop, &stream->io_watcher, POLLIN); + + /* connection_cb can close the server socket while we're + * in the loop so check it on each iteration. + */ + while (uv__stream_fd(stream) != -1) { + assert(stream->accepted_fd == -1); + +#if defined(UV_HAVE_KQUEUE) + if (w->rcount <= 0) + return; +#endif /* defined(UV_HAVE_KQUEUE) */ + + err = uv__accept(uv__stream_fd(stream)); + if (err < 0) { + if (err == UV_EAGAIN || err == UV__ERR(EWOULDBLOCK)) + return; /* Not an error. */ + + if (err == UV_ECONNABORTED) + continue; /* Ignore. Nothing we can do about that. */ + + if (err == UV_EMFILE || err == UV_ENFILE) { + err = uv__emfile_trick(loop, uv__stream_fd(stream)); + if (err == UV_EAGAIN || err == UV__ERR(EWOULDBLOCK)) + break; + } + + stream->connection_cb(stream, err); + continue; + } + + UV_DEC_BACKLOG(w) + stream->accepted_fd = err; + stream->connection_cb(stream, 0); + + if (stream->accepted_fd != -1) { + /* The user hasn't yet accepted called uv_accept() */ + uv__io_stop(loop, &stream->io_watcher, POLLIN); + return; + } + + if (stream->type == UV_TCP && + (stream->flags & UV_HANDLE_TCP_SINGLE_ACCEPT)) { + /* Give other processes a chance to accept connections. */ + struct timespec timeout = { 0, 1 }; + nanosleep(&timeout, NULL); + } + } +} + + +#undef UV_DEC_BACKLOG + + +int uv_accept(uv_stream_t* server, uv_stream_t* client) { + int err; + + assert(server->loop == client->loop); + + if (server->accepted_fd == -1) + return UV_EAGAIN; + + switch (client->type) { + case UV_NAMED_PIPE: + case UV_TCP: + err = uv__stream_open(client, + server->accepted_fd, + UV_HANDLE_READABLE | UV_HANDLE_WRITABLE); + if (err) { + /* TODO handle error */ + uv__close(server->accepted_fd); + goto done; + } + break; + + case UV_UDP: + err = uv_udp_open((uv_udp_t*) client, server->accepted_fd); + if (err) { + uv__close(server->accepted_fd); + goto done; + } + break; + + default: + return UV_EINVAL; + } + + client->flags |= UV_HANDLE_BOUND; + +done: + /* Process queued fds */ + if (server->queued_fds != NULL) { + uv__stream_queued_fds_t* queued_fds; + + queued_fds = server->queued_fds; + + /* Read first */ + server->accepted_fd = queued_fds->fds[0]; + + /* All read, free */ + assert(queued_fds->offset > 0); + if (--queued_fds->offset == 0) { + uv__free(queued_fds); + server->queued_fds = NULL; + } else { + /* Shift rest */ + memmove(queued_fds->fds, + queued_fds->fds + 1, + queued_fds->offset * sizeof(*queued_fds->fds)); + } + } else { + server->accepted_fd = -1; + if (err == 0) + uv__io_start(server->loop, &server->io_watcher, POLLIN); + } + return err; +} + + +int uv_listen(uv_stream_t* stream, int backlog, uv_connection_cb cb) { + int err; + + switch (stream->type) { + case UV_TCP: + err = uv_tcp_listen((uv_tcp_t*)stream, backlog, cb); + break; + + case UV_NAMED_PIPE: + err = uv_pipe_listen((uv_pipe_t*)stream, backlog, cb); + break; + + default: + err = UV_EINVAL; + } + + if (err == 0) + uv__handle_start(stream); + + return err; +} + + +static void uv__drain(uv_stream_t* stream) { + uv_shutdown_t* req; + int err; + + assert(QUEUE_EMPTY(&stream->write_queue)); + uv__io_stop(stream->loop, &stream->io_watcher, POLLOUT); + uv__stream_osx_interrupt_select(stream); + + /* Shutdown? */ + if ((stream->flags & UV_HANDLE_SHUTTING) && + !(stream->flags & UV_HANDLE_CLOSING) && + !(stream->flags & UV_HANDLE_SHUT)) { + assert(stream->shutdown_req); + + req = stream->shutdown_req; + stream->shutdown_req = NULL; + stream->flags &= ~UV_HANDLE_SHUTTING; + uv__req_unregister(stream->loop, req); + + err = 0; + if (shutdown(uv__stream_fd(stream), SHUT_WR)) + err = UV__ERR(errno); + + if (err == 0) + stream->flags |= UV_HANDLE_SHUT; + + if (req->cb != NULL) + req->cb(req, err); + } +} + + +static ssize_t uv__writev(int fd, struct iovec* vec, size_t n) { + if (n == 1) + return write(fd, vec->iov_base, vec->iov_len); + else + return writev(fd, vec, n); +} + + +static size_t uv__write_req_size(uv_write_t* req) { + size_t size; + + assert(req->bufs != NULL); + size = uv__count_bufs(req->bufs + req->write_index, + req->nbufs - req->write_index); + assert(req->handle->write_queue_size >= size); + + return size; +} + + +/* Returns 1 if all write request data has been written, or 0 if there is still + * more data to write. + * + * Note: the return value only says something about the *current* request. + * There may still be other write requests sitting in the queue. + */ +static int uv__write_req_update(uv_stream_t* stream, + uv_write_t* req, + size_t n) { + uv_buf_t* buf; + size_t len; + + assert(n <= stream->write_queue_size); + stream->write_queue_size -= n; + + buf = req->bufs + req->write_index; + - while (n > 0) { ++ do { + len = n < buf->len ? n : buf->len; + buf->base += len; + buf->len -= len; + buf += (buf->len == 0); /* Advance to next buffer if this one is empty. */ + n -= len; - } ++ } while (n > 0); + + req->write_index = buf - req->bufs; + + return req->write_index == req->nbufs; +} + + +static void uv__write_req_finish(uv_write_t* req) { + uv_stream_t* stream = req->handle; + + /* Pop the req off tcp->write_queue. */ + QUEUE_REMOVE(&req->queue); + + /* Only free when there was no error. On error, we touch up write_queue_size + * right before making the callback. The reason we don't do that right away + * is that a write_queue_size > 0 is our only way to signal to the user that + * they should stop writing - which they should if we got an error. Something + * to revisit in future revisions of the libuv API. + */ + if (req->error == 0) { + if (req->bufs != req->bufsml) + uv__free(req->bufs); + req->bufs = NULL; + } + + /* Add it to the write_completed_queue where it will have its + * callback called in the near future. + */ + QUEUE_INSERT_TAIL(&stream->write_completed_queue, &req->queue); + uv__io_feed(stream->loop, &stream->io_watcher); +} + + +static int uv__handle_fd(uv_handle_t* handle) { + switch (handle->type) { + case UV_NAMED_PIPE: + case UV_TCP: + return ((uv_stream_t*) handle)->io_watcher.fd; + + case UV_UDP: + return ((uv_udp_t*) handle)->io_watcher.fd; + + default: + return -1; + } +} + +static void uv__write(uv_stream_t* stream) { + struct iovec* iov; + QUEUE* q; + uv_write_t* req; + int iovmax; + int iovcnt; + ssize_t n; + int err; + +start: + + assert(uv__stream_fd(stream) >= 0); + + if (QUEUE_EMPTY(&stream->write_queue)) + return; + + q = QUEUE_HEAD(&stream->write_queue); + req = QUEUE_DATA(q, uv_write_t, queue); + assert(req->handle == stream); + + /* + * Cast to iovec. We had to have our own uv_buf_t instead of iovec + * because Windows's WSABUF is not an iovec. + */ + assert(sizeof(uv_buf_t) == sizeof(struct iovec)); + iov = (struct iovec*) &(req->bufs[req->write_index]); + iovcnt = req->nbufs - req->write_index; + + iovmax = uv__getiovmax(); + + /* Limit iov count to avoid EINVALs from writev() */ + if (iovcnt > iovmax) + iovcnt = iovmax; + + /* + * Now do the actual writev. Note that we've been updating the pointers + * inside the iov each time we write. So there is no need to offset it. + */ + + if (req->send_handle) { + int fd_to_send; + struct msghdr msg; + struct cmsghdr *cmsg; + union { + char data[64]; + struct cmsghdr alias; + } scratch; + + if (uv__is_closing(req->send_handle)) { + err = UV_EBADF; + goto error; + } + + fd_to_send = uv__handle_fd((uv_handle_t*) req->send_handle); + + memset(&scratch, 0, sizeof(scratch)); + + assert(fd_to_send >= 0); + + msg.msg_name = NULL; + msg.msg_namelen = 0; + msg.msg_iov = iov; + msg.msg_iovlen = iovcnt; + msg.msg_flags = 0; + + msg.msg_control = &scratch.alias; + msg.msg_controllen = CMSG_SPACE(sizeof(fd_to_send)); + + cmsg = CMSG_FIRSTHDR(&msg); + cmsg->cmsg_level = SOL_SOCKET; + cmsg->cmsg_type = SCM_RIGHTS; + cmsg->cmsg_len = CMSG_LEN(sizeof(fd_to_send)); + + /* silence aliasing warning */ + { + void* pv = CMSG_DATA(cmsg); + int* pi = pv; + *pi = fd_to_send; + } + + do + n = sendmsg(uv__stream_fd(stream), &msg, 0); + while (n == -1 && RETRY_ON_WRITE_ERROR(errno)); + + /* Ensure the handle isn't sent again in case this is a partial write. */ + if (n >= 0) + req->send_handle = NULL; + } else { + do + n = uv__writev(uv__stream_fd(stream), iov, iovcnt); + while (n == -1 && RETRY_ON_WRITE_ERROR(errno)); + } + + if (n == -1 && !IS_TRANSIENT_WRITE_ERROR(errno, req->send_handle)) { + err = UV__ERR(errno); + goto error; + } + - if (n > 0 && uv__write_req_update(stream, req, n)) { ++ if (n >= 0 && uv__write_req_update(stream, req, n)) { + uv__write_req_finish(req); + return; /* TODO(bnoordhuis) Start trying to write the next request. */ + } + + /* If this is a blocking stream, try again. */ + if (stream->flags & UV_HANDLE_BLOCKING_WRITES) + goto start; + + /* We're not done. */ + uv__io_start(stream->loop, &stream->io_watcher, POLLOUT); + + /* Notify select() thread about state change */ + uv__stream_osx_interrupt_select(stream); + + return; + +error: + req->error = err; + uv__write_req_finish(req); + uv__io_stop(stream->loop, &stream->io_watcher, POLLOUT); + if (!uv__io_active(&stream->io_watcher, POLLIN)) + uv__handle_stop(stream); + uv__stream_osx_interrupt_select(stream); +} + + +static void uv__write_callbacks(uv_stream_t* stream) { + uv_write_t* req; + QUEUE* q; + QUEUE pq; + + if (QUEUE_EMPTY(&stream->write_completed_queue)) + return; + + QUEUE_MOVE(&stream->write_completed_queue, &pq); + + while (!QUEUE_EMPTY(&pq)) { + /* Pop a req off write_completed_queue. */ + q = QUEUE_HEAD(&pq); + req = QUEUE_DATA(q, uv_write_t, queue); + QUEUE_REMOVE(q); + uv__req_unregister(stream->loop, req); + + if (req->bufs != NULL) { + stream->write_queue_size -= uv__write_req_size(req); + if (req->bufs != req->bufsml) + uv__free(req->bufs); + req->bufs = NULL; + } + + /* NOTE: call callback AFTER freeing the request data. */ + if (req->cb) + req->cb(req, req->error); + } +} + + +uv_handle_type uv__handle_type(int fd) { + struct sockaddr_storage ss; + socklen_t sslen; + socklen_t len; + int type; + + memset(&ss, 0, sizeof(ss)); + sslen = sizeof(ss); + + if (getsockname(fd, (struct sockaddr*)&ss, &sslen)) + return UV_UNKNOWN_HANDLE; + + len = sizeof type; + + if (getsockopt(fd, SOL_SOCKET, SO_TYPE, &type, &len)) + return UV_UNKNOWN_HANDLE; + + if (type == SOCK_STREAM) { +#if defined(_AIX) || defined(__DragonFly__) + /* on AIX/DragonFly the getsockname call returns an empty sa structure + * for sockets of type AF_UNIX. For all other types it will + * return a properly filled in structure. + */ + if (sslen == 0) + return UV_NAMED_PIPE; +#endif + switch (ss.ss_family) { + case AF_UNIX: + return UV_NAMED_PIPE; + case AF_INET: + case AF_INET6: + return UV_TCP; + } + } + + if (type == SOCK_DGRAM && + (ss.ss_family == AF_INET || ss.ss_family == AF_INET6)) + return UV_UDP; + + return UV_UNKNOWN_HANDLE; +} + + +static void uv__stream_eof(uv_stream_t* stream, const uv_buf_t* buf) { + stream->flags |= UV_HANDLE_READ_EOF; + uv__io_stop(stream->loop, &stream->io_watcher, POLLIN); + if (!uv__io_active(&stream->io_watcher, POLLOUT)) + uv__handle_stop(stream); + uv__stream_osx_interrupt_select(stream); + stream->read_cb(stream, UV_EOF, buf); + stream->flags &= ~UV_HANDLE_READING; +} + + +static int uv__stream_queue_fd(uv_stream_t* stream, int fd) { + uv__stream_queued_fds_t* queued_fds; + unsigned int queue_size; + + queued_fds = stream->queued_fds; + if (queued_fds == NULL) { + queue_size = 8; + queued_fds = uv__malloc((queue_size - 1) * sizeof(*queued_fds->fds) + + sizeof(*queued_fds)); + if (queued_fds == NULL) + return UV_ENOMEM; + queued_fds->size = queue_size; + queued_fds->offset = 0; + stream->queued_fds = queued_fds; + + /* Grow */ + } else if (queued_fds->size == queued_fds->offset) { + queue_size = queued_fds->size + 8; + queued_fds = uv__realloc(queued_fds, + (queue_size - 1) * sizeof(*queued_fds->fds) + + sizeof(*queued_fds)); + + /* + * Allocation failure, report back. + * NOTE: if it is fatal - sockets will be closed in uv__stream_close + */ + if (queued_fds == NULL) + return UV_ENOMEM; + queued_fds->size = queue_size; + stream->queued_fds = queued_fds; + } + + /* Put fd in a queue */ + queued_fds->fds[queued_fds->offset++] = fd; + + return 0; +} + + +#define UV__CMSG_FD_COUNT 64 +#define UV__CMSG_FD_SIZE (UV__CMSG_FD_COUNT * sizeof(int)) + + +static int uv__stream_recv_cmsg(uv_stream_t* stream, struct msghdr* msg) { + struct cmsghdr* cmsg; + + for (cmsg = CMSG_FIRSTHDR(msg); cmsg != NULL; cmsg = CMSG_NXTHDR(msg, cmsg)) { + char* start; + char* end; + int err; + void* pv; + int* pi; + unsigned int i; + unsigned int count; + + if (cmsg->cmsg_type != SCM_RIGHTS) { + fprintf(stderr, "ignoring non-SCM_RIGHTS ancillary data: %d\n", + cmsg->cmsg_type); + continue; + } + + /* silence aliasing warning */ + pv = CMSG_DATA(cmsg); + pi = pv; + + /* Count available fds */ + start = (char*) cmsg; + end = (char*) cmsg + cmsg->cmsg_len; + count = 0; + while (start + CMSG_LEN(count * sizeof(*pi)) < end) + count++; + assert(start + CMSG_LEN(count * sizeof(*pi)) == end); + + for (i = 0; i < count; i++) { + /* Already has accepted fd, queue now */ + if (stream->accepted_fd != -1) { + err = uv__stream_queue_fd(stream, pi[i]); + if (err != 0) { + /* Close rest */ + for (; i < count; i++) + uv__close(pi[i]); + return err; + } + } else { + stream->accepted_fd = pi[i]; + } + } + } + + return 0; +} + + +#ifdef __clang__ +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wgnu-folding-constant" +# pragma clang diagnostic ignored "-Wvla-extension" +#endif + +static void uv__read(uv_stream_t* stream) { + uv_buf_t buf; + ssize_t nread; + struct msghdr msg; + char cmsg_space[CMSG_SPACE(UV__CMSG_FD_SIZE)]; + int count; + int err; + int is_ipc; + + stream->flags &= ~UV_HANDLE_READ_PARTIAL; + + /* Prevent loop starvation when the data comes in as fast as (or faster than) + * we can read it. XXX Need to rearm fd if we switch to edge-triggered I/O. + */ + count = 32; + + is_ipc = stream->type == UV_NAMED_PIPE && ((uv_pipe_t*) stream)->ipc; + + /* XXX: Maybe instead of having UV_HANDLE_READING we just test if + * tcp->read_cb is NULL or not? + */ + while (stream->read_cb + && (stream->flags & UV_HANDLE_READING) + && (count-- > 0)) { + assert(stream->alloc_cb != NULL); + + buf = uv_buf_init(NULL, 0); + stream->alloc_cb((uv_handle_t*)stream, 64 * 1024, &buf); + if (buf.base == NULL || buf.len == 0) { + /* User indicates it can't or won't handle the read. */ + stream->read_cb(stream, UV_ENOBUFS, &buf); + return; + } + + assert(buf.base != NULL); + assert(uv__stream_fd(stream) >= 0); + + if (!is_ipc) { + do { + nread = read(uv__stream_fd(stream), buf.base, buf.len); + } + while (nread < 0 && errno == EINTR); + } else { + /* ipc uses recvmsg */ + msg.msg_flags = 0; + msg.msg_iov = (struct iovec*) &buf; + msg.msg_iovlen = 1; + msg.msg_name = NULL; + msg.msg_namelen = 0; + /* Set up to receive a descriptor even if one isn't in the message */ + msg.msg_controllen = sizeof(cmsg_space); + msg.msg_control = cmsg_space; + + do { + nread = uv__recvmsg(uv__stream_fd(stream), &msg, 0); + } + while (nread < 0 && errno == EINTR); + } + + if (nread < 0) { + /* Error */ + if (errno == EAGAIN || errno == EWOULDBLOCK) { + /* Wait for the next one. */ + if (stream->flags & UV_HANDLE_READING) { + uv__io_start(stream->loop, &stream->io_watcher, POLLIN); + uv__stream_osx_interrupt_select(stream); + } + stream->read_cb(stream, 0, &buf); +#if defined(__CYGWIN__) || defined(__MSYS__) + } else if (errno == ECONNRESET && stream->type == UV_NAMED_PIPE) { + uv__stream_eof(stream, &buf); + return; +#endif + } else { + /* Error. User should call uv_close(). */ + stream->read_cb(stream, UV__ERR(errno), &buf); + if (stream->flags & UV_HANDLE_READING) { + stream->flags &= ~UV_HANDLE_READING; + uv__io_stop(stream->loop, &stream->io_watcher, POLLIN); + if (!uv__io_active(&stream->io_watcher, POLLOUT)) + uv__handle_stop(stream); + uv__stream_osx_interrupt_select(stream); + } + } + return; + } else if (nread == 0) { + uv__stream_eof(stream, &buf); + return; + } else { + /* Successful read */ + ssize_t buflen = buf.len; + + if (is_ipc) { + err = uv__stream_recv_cmsg(stream, &msg); + if (err != 0) { + stream->read_cb(stream, err, &buf); + return; + } + } + +#if defined(__MVS__) + if (is_ipc && msg.msg_controllen > 0) { + uv_buf_t blankbuf; + int nread; + struct iovec *old; + + blankbuf.base = 0; + blankbuf.len = 0; + old = msg.msg_iov; + msg.msg_iov = (struct iovec*) &blankbuf; + nread = 0; + do { + nread = uv__recvmsg(uv__stream_fd(stream), &msg, 0); + err = uv__stream_recv_cmsg(stream, &msg); + if (err != 0) { + stream->read_cb(stream, err, &buf); + msg.msg_iov = old; + return; + } + } while (nread == 0 && msg.msg_controllen > 0); + msg.msg_iov = old; + } +#endif + stream->read_cb(stream, nread, &buf); + + /* Return if we didn't fill the buffer, there is no more data to read. */ + if (nread < buflen) { + stream->flags |= UV_HANDLE_READ_PARTIAL; + return; + } + } + } +} + + +#ifdef __clang__ +# pragma clang diagnostic pop +#endif + +#undef UV__CMSG_FD_COUNT +#undef UV__CMSG_FD_SIZE + + +int uv_shutdown(uv_shutdown_t* req, uv_stream_t* stream, uv_shutdown_cb cb) { + assert(stream->type == UV_TCP || + stream->type == UV_TTY || + stream->type == UV_NAMED_PIPE); + + if (!(stream->flags & UV_HANDLE_WRITABLE) || + stream->flags & UV_HANDLE_SHUT || + stream->flags & UV_HANDLE_SHUTTING || + uv__is_closing(stream)) { + return UV_ENOTCONN; + } + + assert(uv__stream_fd(stream) >= 0); + + /* Initialize request */ + uv__req_init(stream->loop, req, UV_SHUTDOWN); + req->handle = stream; + req->cb = cb; + stream->shutdown_req = req; + stream->flags |= UV_HANDLE_SHUTTING; + + uv__io_start(stream->loop, &stream->io_watcher, POLLOUT); + uv__stream_osx_interrupt_select(stream); + + return 0; +} + + +static void uv__stream_io(uv_loop_t* loop, uv__io_t* w, unsigned int events) { + uv_stream_t* stream; + + stream = container_of(w, uv_stream_t, io_watcher); + + assert(stream->type == UV_TCP || + stream->type == UV_NAMED_PIPE || + stream->type == UV_TTY); + assert(!(stream->flags & UV_HANDLE_CLOSING)); + + if (stream->connect_req) { + uv__stream_connect(stream); + return; + } + + assert(uv__stream_fd(stream) >= 0); + + /* Ignore POLLHUP here. Even if it's set, there may still be data to read. */ + if (events & (POLLIN | POLLERR | POLLHUP)) + uv__read(stream); + + if (uv__stream_fd(stream) == -1) + return; /* read_cb closed stream. */ + + /* Short-circuit iff POLLHUP is set, the user is still interested in read + * events and uv__read() reported a partial read but not EOF. If the EOF + * flag is set, uv__read() called read_cb with err=UV_EOF and we don't + * have to do anything. If the partial read flag is not set, we can't + * report the EOF yet because there is still data to read. + */ + if ((events & POLLHUP) && + (stream->flags & UV_HANDLE_READING) && + (stream->flags & UV_HANDLE_READ_PARTIAL) && + !(stream->flags & UV_HANDLE_READ_EOF)) { + uv_buf_t buf = { NULL, 0 }; + uv__stream_eof(stream, &buf); + } + + if (uv__stream_fd(stream) == -1) + return; /* read_cb closed stream. */ + + if (events & (POLLOUT | POLLERR | POLLHUP)) { + uv__write(stream); + uv__write_callbacks(stream); + + /* Write queue drained. */ + if (QUEUE_EMPTY(&stream->write_queue)) + uv__drain(stream); + } +} + + +/** + * We get called here from directly following a call to connect(2). + * In order to determine if we've errored out or succeeded must call + * getsockopt. + */ +static void uv__stream_connect(uv_stream_t* stream) { + int error; + uv_connect_t* req = stream->connect_req; + socklen_t errorsize = sizeof(int); + + assert(stream->type == UV_TCP || stream->type == UV_NAMED_PIPE); + assert(req); + + if (stream->delayed_error) { + /* To smooth over the differences between unixes errors that + * were reported synchronously on the first connect can be delayed + * until the next tick--which is now. + */ + error = stream->delayed_error; + stream->delayed_error = 0; + } else { + /* Normal situation: we need to get the socket error from the kernel. */ + assert(uv__stream_fd(stream) >= 0); + getsockopt(uv__stream_fd(stream), + SOL_SOCKET, + SO_ERROR, + &error, + &errorsize); + error = UV__ERR(error); + } + + if (error == UV__ERR(EINPROGRESS)) + return; + + stream->connect_req = NULL; + uv__req_unregister(stream->loop, req); + + if (error < 0 || QUEUE_EMPTY(&stream->write_queue)) { + uv__io_stop(stream->loop, &stream->io_watcher, POLLOUT); + } + + if (req->cb) + req->cb(req, error); + + if (uv__stream_fd(stream) == -1) + return; + + if (error < 0) { + uv__stream_flush_write_queue(stream, UV_ECANCELED); + uv__write_callbacks(stream); + } +} + + +int uv_write2(uv_write_t* req, + uv_stream_t* stream, + const uv_buf_t bufs[], + unsigned int nbufs, + uv_stream_t* send_handle, + uv_write_cb cb) { + int empty_queue; + + assert(nbufs > 0); + assert((stream->type == UV_TCP || + stream->type == UV_NAMED_PIPE || + stream->type == UV_TTY) && + "uv_write (unix) does not yet support other types of streams"); + + if (uv__stream_fd(stream) < 0) + return UV_EBADF; + + if (!(stream->flags & UV_HANDLE_WRITABLE)) + return -EPIPE; + + if (send_handle) { + if (stream->type != UV_NAMED_PIPE || !((uv_pipe_t*)stream)->ipc) + return UV_EINVAL; + + /* XXX We abuse uv_write2() to send over UDP handles to child processes. + * Don't call uv__stream_fd() on those handles, it's a macro that on OS X + * evaluates to a function that operates on a uv_stream_t with a couple of + * OS X specific fields. On other Unices it does (handle)->io_watcher.fd, + * which works but only by accident. + */ + if (uv__handle_fd((uv_handle_t*) send_handle) < 0) + return UV_EBADF; + +#if defined(__CYGWIN__) || defined(__MSYS__) + /* Cygwin recvmsg always sets msg_controllen to zero, so we cannot send it. + See https://github.com/mirror/newlib-cygwin/blob/86fc4bf0/winsup/cygwin/fhandler_socket.cc#L1736-L1743 */ + return UV_ENOSYS; +#endif + } + + /* It's legal for write_queue_size > 0 even when the write_queue is empty; + * it means there are error-state requests in the write_completed_queue that + * will touch up write_queue_size later, see also uv__write_req_finish(). + * We could check that write_queue is empty instead but that implies making + * a write() syscall when we know that the handle is in error mode. + */ + empty_queue = (stream->write_queue_size == 0); + + /* Initialize the req */ + uv__req_init(stream->loop, req, UV_WRITE); + req->cb = cb; + req->handle = stream; + req->error = 0; + req->send_handle = send_handle; + QUEUE_INIT(&req->queue); + + req->bufs = req->bufsml; + if (nbufs > ARRAY_SIZE(req->bufsml)) + req->bufs = uv__malloc(nbufs * sizeof(bufs[0])); + + if (req->bufs == NULL) + return UV_ENOMEM; + + memcpy(req->bufs, bufs, nbufs * sizeof(bufs[0])); + req->nbufs = nbufs; + req->write_index = 0; + stream->write_queue_size += uv__count_bufs(bufs, nbufs); + + /* Append the request to write_queue. */ + QUEUE_INSERT_TAIL(&stream->write_queue, &req->queue); + + /* If the queue was empty when this function began, we should attempt to + * do the write immediately. Otherwise start the write_watcher and wait + * for the fd to become writable. + */ + if (stream->connect_req) { + /* Still connecting, do nothing. */ + } + else if (empty_queue) { + uv__write(stream); + } + else { + /* + * blocking streams should never have anything in the queue. + * if this assert fires then somehow the blocking stream isn't being + * sufficiently flushed in uv__write. + */ + assert(!(stream->flags & UV_HANDLE_BLOCKING_WRITES)); + uv__io_start(stream->loop, &stream->io_watcher, POLLOUT); + uv__stream_osx_interrupt_select(stream); + } + + return 0; +} + + +/* The buffers to be written must remain valid until the callback is called. + * This is not required for the uv_buf_t array. + */ +int uv_write(uv_write_t* req, + uv_stream_t* handle, + const uv_buf_t bufs[], + unsigned int nbufs, + uv_write_cb cb) { + return uv_write2(req, handle, bufs, nbufs, NULL, cb); +} + + +void uv_try_write_cb(uv_write_t* req, int status) { + /* Should not be called */ + abort(); +} + + +int uv_try_write(uv_stream_t* stream, + const uv_buf_t bufs[], + unsigned int nbufs) { + int r; + int has_pollout; + size_t written; + size_t req_size; + uv_write_t req; + + /* Connecting or already writing some data */ + if (stream->connect_req != NULL || stream->write_queue_size != 0) + return UV_EAGAIN; + + has_pollout = uv__io_active(&stream->io_watcher, POLLOUT); + + r = uv_write(&req, stream, bufs, nbufs, uv_try_write_cb); + if (r != 0) + return r; + + /* Remove not written bytes from write queue size */ + written = uv__count_bufs(bufs, nbufs); + if (req.bufs != NULL) + req_size = uv__write_req_size(&req); + else + req_size = 0; + written -= req_size; + stream->write_queue_size -= req_size; + + /* Unqueue request, regardless of immediateness */ + QUEUE_REMOVE(&req.queue); + uv__req_unregister(stream->loop, &req); + if (req.bufs != req.bufsml) + uv__free(req.bufs); + req.bufs = NULL; + + /* Do not poll for writable, if we wasn't before calling this */ + if (!has_pollout) { + uv__io_stop(stream->loop, &stream->io_watcher, POLLOUT); + uv__stream_osx_interrupt_select(stream); + } + + if (written == 0 && req_size != 0) - return UV_EAGAIN; ++ return req.error < 0 ? req.error : UV_EAGAIN; + else + return written; +} + + +int uv_read_start(uv_stream_t* stream, + uv_alloc_cb alloc_cb, + uv_read_cb read_cb) { + assert(stream->type == UV_TCP || stream->type == UV_NAMED_PIPE || + stream->type == UV_TTY); + + if (stream->flags & UV_HANDLE_CLOSING) + return UV_EINVAL; + + if (!(stream->flags & UV_HANDLE_READABLE)) + return -ENOTCONN; + + /* The UV_HANDLE_READING flag is irrelevant of the state of the tcp - it just + * expresses the desired state of the user. + */ + stream->flags |= UV_HANDLE_READING; + + /* TODO: try to do the read inline? */ + /* TODO: keep track of tcp state. If we've gotten a EOF then we should + * not start the IO watcher. + */ + assert(uv__stream_fd(stream) >= 0); + assert(alloc_cb); + + stream->read_cb = read_cb; + stream->alloc_cb = alloc_cb; + + uv__io_start(stream->loop, &stream->io_watcher, POLLIN); + uv__handle_start(stream); + uv__stream_osx_interrupt_select(stream); + + return 0; +} + + +int uv_read_stop(uv_stream_t* stream) { + if (!(stream->flags & UV_HANDLE_READING)) + return 0; + + stream->flags &= ~UV_HANDLE_READING; + uv__io_stop(stream->loop, &stream->io_watcher, POLLIN); + if (!uv__io_active(&stream->io_watcher, POLLOUT)) + uv__handle_stop(stream); + uv__stream_osx_interrupt_select(stream); + + stream->read_cb = NULL; + stream->alloc_cb = NULL; + return 0; +} + + +int uv_is_readable(const uv_stream_t* stream) { + return !!(stream->flags & UV_HANDLE_READABLE); +} + + +int uv_is_writable(const uv_stream_t* stream) { + return !!(stream->flags & UV_HANDLE_WRITABLE); +} + + +#if defined(__APPLE__) && !defined(CMAKE_BOOTSTRAP) +int uv___stream_fd(const uv_stream_t* handle) { + const uv__stream_select_t* s; + + assert(handle->type == UV_TCP || + handle->type == UV_TTY || + handle->type == UV_NAMED_PIPE); + + s = handle->select; + if (s != NULL) + return s->fd; + + return handle->io_watcher.fd; +} +#endif /* defined(__APPLE__) */ + + +void uv__stream_close(uv_stream_t* handle) { + unsigned int i; + uv__stream_queued_fds_t* queued_fds; + +#if defined(__APPLE__) && !defined(CMAKE_BOOTSTRAP) + /* Terminate select loop first */ + if (handle->select != NULL) { + uv__stream_select_t* s; + + s = handle->select; + + uv_sem_post(&s->close_sem); + uv_sem_post(&s->async_sem); + uv__stream_osx_interrupt_select(handle); + uv_thread_join(&s->thread); + uv_sem_destroy(&s->close_sem); + uv_sem_destroy(&s->async_sem); + uv__close(s->fake_fd); + uv__close(s->int_fd); + uv_close((uv_handle_t*) &s->async, uv__stream_osx_cb_close); + + handle->select = NULL; + } +#endif /* defined(__APPLE__) */ + + uv__io_close(handle->loop, &handle->io_watcher); + uv_read_stop(handle); + uv__handle_stop(handle); + handle->flags &= ~(UV_HANDLE_READABLE | UV_HANDLE_WRITABLE); + + if (handle->io_watcher.fd != -1) { + /* Don't close stdio file descriptors. Nothing good comes from it. */ + if (handle->io_watcher.fd > STDERR_FILENO) + uv__close(handle->io_watcher.fd); + handle->io_watcher.fd = -1; + } + + if (handle->accepted_fd != -1) { + uv__close(handle->accepted_fd); + handle->accepted_fd = -1; + } + + /* Close all queued fds */ + if (handle->queued_fds != NULL) { + queued_fds = handle->queued_fds; + for (i = 0; i < queued_fds->offset; i++) + uv__close(queued_fds->fds[i]); + uv__free(handle->queued_fds); + handle->queued_fds = NULL; + } + + assert(!uv__io_active(&handle->io_watcher, POLLIN | POLLOUT)); +} + + +int uv_stream_set_blocking(uv_stream_t* handle, int blocking) { + /* Don't need to check the file descriptor, uv__nonblock() + * will fail with EBADF if it's not valid. + */ + return uv__nonblock(uv__stream_fd(handle), !blocking); +} diff --cc Utilities/cmlibuv/src/unix/sunos.c index aac6504,0000000..0cd25c1 mode 100644,000000..100644 --- a/Utilities/cmlibuv/src/unix/sunos.c +++ b/Utilities/cmlibuv/src/unix/sunos.c @@@ -1,834 -1,0 +1,850 @@@ +/* Copyright Joyent, Inc. and other Node contributors. All rights reserved. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +#include "uv.h" +#include "internal.h" + +#include +#include +#include +#include +#include +#include + +#if !defined(SUNOS_NO_IFADDRS) && _XOPEN_SOURCE < 600 +#define SUNOS_NO_IFADDRS +#endif + +#ifndef SUNOS_NO_IFADDRS +# include +#endif +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include + +#define PORT_FIRED 0x69 +#define PORT_UNUSED 0x0 +#define PORT_LOADED 0x99 +#define PORT_DELETED -1 + +#if (!defined(_LP64)) && (_FILE_OFFSET_BITS - 0 == 64) +#define PROCFS_FILE_OFFSET_BITS_HACK 1 +#undef _FILE_OFFSET_BITS +#else +#define PROCFS_FILE_OFFSET_BITS_HACK 0 +#endif + +#include + +#if (PROCFS_FILE_OFFSET_BITS_HACK - 0 == 1) +#define _FILE_OFFSET_BITS 64 +#endif + + +int uv__platform_loop_init(uv_loop_t* loop) { + int err; + int fd; + + loop->fs_fd = -1; + loop->backend_fd = -1; + + fd = port_create(); + if (fd == -1) + return UV__ERR(errno); + + err = uv__cloexec(fd, 1); + if (err) { + uv__close(fd); + return err; + } + loop->backend_fd = fd; + + return 0; +} + + +void uv__platform_loop_delete(uv_loop_t* loop) { + if (loop->fs_fd != -1) { + uv__close(loop->fs_fd); + loop->fs_fd = -1; + } + + if (loop->backend_fd != -1) { + uv__close(loop->backend_fd); + loop->backend_fd = -1; + } +} + + +int uv__io_fork(uv_loop_t* loop) { +#if defined(PORT_SOURCE_FILE) + if (loop->fs_fd != -1) { + /* stop the watcher before we blow away its fileno */ + uv__io_stop(loop, &loop->fs_event_watcher, POLLIN); + } +#endif + uv__platform_loop_delete(loop); + return uv__platform_loop_init(loop); +} + + +void uv__platform_invalidate_fd(uv_loop_t* loop, int fd) { + struct port_event* events; + uintptr_t i; + uintptr_t nfds; + + assert(loop->watchers != NULL); ++ assert(fd >= 0); + + events = (struct port_event*) loop->watchers[loop->nwatchers]; + nfds = (uintptr_t) loop->watchers[loop->nwatchers + 1]; + if (events == NULL) + return; + + /* Invalidate events with same file descriptor */ + for (i = 0; i < nfds; i++) + if ((int) events[i].portev_object == fd) + events[i].portev_object = -1; +} + + +int uv__io_check_fd(uv_loop_t* loop, int fd) { + if (port_associate(loop->backend_fd, PORT_SOURCE_FD, fd, POLLIN, 0)) + return UV__ERR(errno); + - if (port_dissociate(loop->backend_fd, PORT_SOURCE_FD, fd)) ++ if (port_dissociate(loop->backend_fd, PORT_SOURCE_FD, fd)) { ++ perror("(libuv) port_dissociate()"); + abort(); ++ } + + return 0; +} + + +void uv__io_poll(uv_loop_t* loop, int timeout) { + struct port_event events[1024]; + struct port_event* pe; + struct timespec spec; + QUEUE* q; + uv__io_t* w; + sigset_t* pset; + sigset_t set; + uint64_t base; + uint64_t diff; + unsigned int nfds; + unsigned int i; + int saved_errno; + int have_signals; + int nevents; + int count; + int err; + int fd; + + if (loop->nfds == 0) { + assert(QUEUE_EMPTY(&loop->watcher_queue)); + return; + } + + while (!QUEUE_EMPTY(&loop->watcher_queue)) { + q = QUEUE_HEAD(&loop->watcher_queue); + QUEUE_REMOVE(q); + QUEUE_INIT(q); + + w = QUEUE_DATA(q, uv__io_t, watcher_queue); + assert(w->pevents != 0); + - if (port_associate(loop->backend_fd, PORT_SOURCE_FD, w->fd, w->pevents, 0)) ++ if (port_associate(loop->backend_fd, ++ PORT_SOURCE_FD, ++ w->fd, ++ w->pevents, ++ 0)) { ++ perror("(libuv) port_associate()"); + abort(); ++ } + + w->events = w->pevents; + } + + pset = NULL; + if (loop->flags & UV_LOOP_BLOCK_SIGPROF) { + pset = &set; + sigemptyset(pset); + sigaddset(pset, SIGPROF); + } + + assert(timeout >= -1); + base = loop->time; + count = 48; /* Benchmarks suggest this gives the best throughput. */ + + for (;;) { + if (timeout != -1) { + spec.tv_sec = timeout / 1000; + spec.tv_nsec = (timeout % 1000) * 1000000; + } + + /* Work around a kernel bug where nfds is not updated. */ + events[0].portev_source = 0; + + nfds = 1; + saved_errno = 0; + + if (pset != NULL) + pthread_sigmask(SIG_BLOCK, pset, NULL); + + err = port_getn(loop->backend_fd, + events, + ARRAY_SIZE(events), + &nfds, + timeout == -1 ? NULL : &spec); + + if (pset != NULL) + pthread_sigmask(SIG_UNBLOCK, pset, NULL); + + if (err) { + /* Work around another kernel bug: port_getn() may return events even + * on error. + */ - if (errno == EINTR || errno == ETIME) ++ if (errno == EINTR || errno == ETIME) { + saved_errno = errno; - else ++ } else { ++ perror("(libuv) port_getn()"); + abort(); ++ } + } + + /* Update loop->time unconditionally. It's tempting to skip the update when + * timeout == 0 (i.e. non-blocking poll) but there is no guarantee that the + * operating system didn't reschedule our process while in the syscall. + */ + SAVE_ERRNO(uv__update_time(loop)); + + if (events[0].portev_source == 0) { + if (timeout == 0) + return; + + if (timeout == -1) + continue; + + goto update_timeout; + } + + if (nfds == 0) { + assert(timeout != -1); + return; + } + + have_signals = 0; + nevents = 0; + + assert(loop->watchers != NULL); + loop->watchers[loop->nwatchers] = (void*) events; + loop->watchers[loop->nwatchers + 1] = (void*) (uintptr_t) nfds; + for (i = 0; i < nfds; i++) { + pe = events + i; + fd = pe->portev_object; + + /* Skip invalidated events, see uv__platform_invalidate_fd */ + if (fd == -1) + continue; + + assert(fd >= 0); + assert((unsigned) fd < loop->nwatchers); + + w = loop->watchers[fd]; + + /* File descriptor that we've stopped watching, ignore. */ + if (w == NULL) + continue; + + /* Run signal watchers last. This also affects child process watchers + * because those are implemented in terms of signal watchers. + */ + if (w == &loop->signal_io_watcher) + have_signals = 1; + else + w->cb(loop, w, pe->portev_events); + + nevents++; + + if (w != loop->watchers[fd]) + continue; /* Disabled by callback. */ + + /* Events Ports operates in oneshot mode, rearm timer on next run. */ + if (w->pevents != 0 && QUEUE_EMPTY(&w->watcher_queue)) + QUEUE_INSERT_TAIL(&loop->watcher_queue, &w->watcher_queue); + } + + if (have_signals != 0) + loop->signal_io_watcher.cb(loop, &loop->signal_io_watcher, POLLIN); + + loop->watchers[loop->nwatchers] = NULL; + loop->watchers[loop->nwatchers + 1] = NULL; + + if (have_signals != 0) + return; /* Event loop should cycle now so don't poll again. */ + + if (nevents != 0) { + if (nfds == ARRAY_SIZE(events) && --count != 0) { + /* Poll for more events but don't block this time. */ + timeout = 0; + continue; + } + return; + } + + if (saved_errno == ETIME) { + assert(timeout != -1); + return; + } + + if (timeout == 0) + return; + + if (timeout == -1) + continue; + +update_timeout: + assert(timeout > 0); + + diff = loop->time - base; + if (diff >= (uint64_t) timeout) + return; + + timeout -= diff; + } +} + + +uint64_t uv__hrtime(uv_clocktype_t type) { + return gethrtime(); +} + + +/* + * We could use a static buffer for the path manipulations that we need outside + * of the function, but this function could be called by multiple consumers and + * we don't want to potentially create a race condition in the use of snprintf. + */ +int uv_exepath(char* buffer, size_t* size) { + ssize_t res; + char buf[128]; + + if (buffer == NULL || size == NULL || *size == 0) + return UV_EINVAL; + + snprintf(buf, sizeof(buf), "/proc/%lu/path/a.out", (unsigned long) getpid()); + + res = *size - 1; + if (res > 0) + res = readlink(buf, buffer, res); + + if (res == -1) + return UV__ERR(errno); + + buffer[res] = '\0'; + *size = res; + return 0; +} + + +uint64_t uv_get_free_memory(void) { + return (uint64_t) sysconf(_SC_PAGESIZE) * sysconf(_SC_AVPHYS_PAGES); +} + + +uint64_t uv_get_total_memory(void) { + return (uint64_t) sysconf(_SC_PAGESIZE) * sysconf(_SC_PHYS_PAGES); +} + + ++uint64_t uv_get_constrained_memory(void) { ++ return 0; /* Memory constraints are unknown. */ ++} ++ ++ +void uv_loadavg(double avg[3]) { + (void) getloadavg(avg, 3); +} + + +#if defined(PORT_SOURCE_FILE) + +static int uv__fs_event_rearm(uv_fs_event_t *handle) { + if (handle->fd == -1) + return UV_EBADF; + + if (port_associate(handle->loop->fs_fd, + PORT_SOURCE_FILE, + (uintptr_t) &handle->fo, + FILE_ATTRIB | FILE_MODIFIED, + handle) == -1) { + return UV__ERR(errno); + } + handle->fd = PORT_LOADED; + + return 0; +} + + +static void uv__fs_event_read(uv_loop_t* loop, + uv__io_t* w, + unsigned int revents) { + uv_fs_event_t *handle = NULL; + timespec_t timeout; + port_event_t pe; + int events; + int r; + + (void) w; + (void) revents; + + do { + uint_t n = 1; + + /* + * Note that our use of port_getn() here (and not port_get()) is deliberate: + * there is a bug in event ports (Sun bug 6456558) whereby a zeroed timeout + * causes port_get() to return success instead of ETIME when there aren't + * actually any events (!); by using port_getn() in lieu of port_get(), + * we can at least workaround the bug by checking for zero returned events + * and treating it as we would ETIME. + */ + do { + memset(&timeout, 0, sizeof timeout); + r = port_getn(loop->fs_fd, &pe, 1, &n, &timeout); + } + while (r == -1 && errno == EINTR); + + if ((r == -1 && errno == ETIME) || n == 0) + break; + + handle = (uv_fs_event_t*) pe.portev_user; + assert((r == 0) && "unexpected port_get() error"); + + events = 0; + if (pe.portev_events & (FILE_ATTRIB | FILE_MODIFIED)) + events |= UV_CHANGE; + if (pe.portev_events & ~(FILE_ATTRIB | FILE_MODIFIED)) + events |= UV_RENAME; + assert(events != 0); + handle->fd = PORT_FIRED; + handle->cb(handle, NULL, events, 0); + + if (handle->fd != PORT_DELETED) { + r = uv__fs_event_rearm(handle); + if (r != 0) + handle->cb(handle, NULL, 0, r); + } + } + while (handle->fd != PORT_DELETED); +} + + +int uv_fs_event_init(uv_loop_t* loop, uv_fs_event_t* handle) { + uv__handle_init(loop, (uv_handle_t*)handle, UV_FS_EVENT); + return 0; +} + + +int uv_fs_event_start(uv_fs_event_t* handle, + uv_fs_event_cb cb, + const char* path, + unsigned int flags) { + int portfd; + int first_run; + int err; + + if (uv__is_active(handle)) + return UV_EINVAL; + + first_run = 0; + if (handle->loop->fs_fd == -1) { + portfd = port_create(); + if (portfd == -1) + return UV__ERR(errno); + handle->loop->fs_fd = portfd; + first_run = 1; + } + + uv__handle_start(handle); + handle->path = uv__strdup(path); + handle->fd = PORT_UNUSED; + handle->cb = cb; + + memset(&handle->fo, 0, sizeof handle->fo); + handle->fo.fo_name = handle->path; + err = uv__fs_event_rearm(handle); + if (err != 0) { + uv_fs_event_stop(handle); + return err; + } + + if (first_run) { + uv__io_init(&handle->loop->fs_event_watcher, uv__fs_event_read, portfd); + uv__io_start(handle->loop, &handle->loop->fs_event_watcher, POLLIN); + } + + return 0; +} + + +int uv_fs_event_stop(uv_fs_event_t* handle) { + if (!uv__is_active(handle)) + return 0; + + if (handle->fd == PORT_FIRED || handle->fd == PORT_LOADED) { + port_dissociate(handle->loop->fs_fd, + PORT_SOURCE_FILE, + (uintptr_t) &handle->fo); + } + + handle->fd = PORT_DELETED; + uv__free(handle->path); + handle->path = NULL; + handle->fo.fo_name = NULL; + uv__handle_stop(handle); + + return 0; +} + +void uv__fs_event_close(uv_fs_event_t* handle) { + uv_fs_event_stop(handle); +} + +#else /* !defined(PORT_SOURCE_FILE) */ + +int uv_fs_event_init(uv_loop_t* loop, uv_fs_event_t* handle) { + return UV_ENOSYS; +} + + +int uv_fs_event_start(uv_fs_event_t* handle, + uv_fs_event_cb cb, + const char* filename, + unsigned int flags) { + return UV_ENOSYS; +} + + +int uv_fs_event_stop(uv_fs_event_t* handle) { + return UV_ENOSYS; +} + + +void uv__fs_event_close(uv_fs_event_t* handle) { + UNREACHABLE(); +} + +#endif /* defined(PORT_SOURCE_FILE) */ + + +int uv_resident_set_memory(size_t* rss) { + psinfo_t psinfo; + int err; + int fd; + + fd = open("/proc/self/psinfo", O_RDONLY); + if (fd == -1) + return UV__ERR(errno); + + /* FIXME(bnoordhuis) Handle EINTR. */ + err = UV_EINVAL; + if (read(fd, &psinfo, sizeof(psinfo)) == sizeof(psinfo)) { + *rss = (size_t)psinfo.pr_rssize * 1024; + err = 0; + } + uv__close(fd); + + return err; +} + + +int uv_uptime(double* uptime) { + kstat_ctl_t *kc; + kstat_t *ksp; + kstat_named_t *knp; + + long hz = sysconf(_SC_CLK_TCK); + + kc = kstat_open(); + if (kc == NULL) + return UV_EPERM; + + ksp = kstat_lookup(kc, (char*) "unix", 0, (char*) "system_misc"); + if (kstat_read(kc, ksp, NULL) == -1) { + *uptime = -1; + } else { + knp = (kstat_named_t*) kstat_data_lookup(ksp, (char*) "clk_intr"); + *uptime = knp->value.ul / hz; + } + kstat_close(kc); + + return 0; +} + + +int uv_cpu_info(uv_cpu_info_t** cpu_infos, int* count) { + int lookup_instance; + kstat_ctl_t *kc; + kstat_t *ksp; + kstat_named_t *knp; + uv_cpu_info_t* cpu_info; + + kc = kstat_open(); + if (kc == NULL) + return UV_EPERM; + + /* Get count of cpus */ + lookup_instance = 0; + while ((ksp = kstat_lookup(kc, (char*) "cpu_info", lookup_instance, NULL))) { + lookup_instance++; + } + + *cpu_infos = uv__malloc(lookup_instance * sizeof(**cpu_infos)); + if (!(*cpu_infos)) { + kstat_close(kc); + return UV_ENOMEM; + } + + *count = lookup_instance; + + cpu_info = *cpu_infos; + lookup_instance = 0; + while ((ksp = kstat_lookup(kc, (char*) "cpu_info", lookup_instance, NULL))) { + if (kstat_read(kc, ksp, NULL) == -1) { + cpu_info->speed = 0; + cpu_info->model = NULL; + } else { + knp = kstat_data_lookup(ksp, (char*) "clock_MHz"); + assert(knp->data_type == KSTAT_DATA_INT32 || + knp->data_type == KSTAT_DATA_INT64); + cpu_info->speed = (knp->data_type == KSTAT_DATA_INT32) ? knp->value.i32 + : knp->value.i64; + + knp = kstat_data_lookup(ksp, (char*) "brand"); + assert(knp->data_type == KSTAT_DATA_STRING); + cpu_info->model = uv__strdup(KSTAT_NAMED_STR_PTR(knp)); + } + + lookup_instance++; + cpu_info++; + } + + cpu_info = *cpu_infos; + lookup_instance = 0; + for (;;) { + ksp = kstat_lookup(kc, (char*) "cpu", lookup_instance, (char*) "sys"); + + if (ksp == NULL) + break; + + if (kstat_read(kc, ksp, NULL) == -1) { + cpu_info->cpu_times.user = 0; + cpu_info->cpu_times.nice = 0; + cpu_info->cpu_times.sys = 0; + cpu_info->cpu_times.idle = 0; + cpu_info->cpu_times.irq = 0; + } else { + knp = kstat_data_lookup(ksp, (char*) "cpu_ticks_user"); + assert(knp->data_type == KSTAT_DATA_UINT64); + cpu_info->cpu_times.user = knp->value.ui64; + + knp = kstat_data_lookup(ksp, (char*) "cpu_ticks_kernel"); + assert(knp->data_type == KSTAT_DATA_UINT64); + cpu_info->cpu_times.sys = knp->value.ui64; + + knp = kstat_data_lookup(ksp, (char*) "cpu_ticks_idle"); + assert(knp->data_type == KSTAT_DATA_UINT64); + cpu_info->cpu_times.idle = knp->value.ui64; + + knp = kstat_data_lookup(ksp, (char*) "intr"); + assert(knp->data_type == KSTAT_DATA_UINT64); + cpu_info->cpu_times.irq = knp->value.ui64; + cpu_info->cpu_times.nice = 0; + } + + lookup_instance++; + cpu_info++; + } + + kstat_close(kc); + + return 0; +} + + +void uv_free_cpu_info(uv_cpu_info_t* cpu_infos, int count) { + int i; + + for (i = 0; i < count; i++) { + uv__free(cpu_infos[i].model); + } + + uv__free(cpu_infos); +} + +#ifdef SUNOS_NO_IFADDRS +int uv_interface_addresses(uv_interface_address_t** addresses, int* count) { + *count = 0; + *addresses = NULL; + return UV_ENOSYS; +} +#else /* SUNOS_NO_IFADDRS */ +/* + * Inspired By: + * https://blogs.oracle.com/paulie/entry/retrieving_mac_address_in_solaris + * http://www.pauliesworld.org/project/getmac.c + */ +static int uv__set_phys_addr(uv_interface_address_t* address, + struct ifaddrs* ent) { + + struct sockaddr_dl* sa_addr; + int sockfd; + size_t i; + struct arpreq arpreq; + + /* This appears to only work as root */ + sa_addr = (struct sockaddr_dl*)(ent->ifa_addr); + memcpy(address->phys_addr, LLADDR(sa_addr), sizeof(address->phys_addr)); + for (i = 0; i < sizeof(address->phys_addr); i++) { + /* Check that all bytes of phys_addr are zero. */ + if (address->phys_addr[i] != 0) + return 0; + } + memset(&arpreq, 0, sizeof(arpreq)); + if (address->address.address4.sin_family == AF_INET) { + struct sockaddr_in* sin = ((struct sockaddr_in*)&arpreq.arp_pa); + sin->sin_addr.s_addr = address->address.address4.sin_addr.s_addr; + } else if (address->address.address4.sin_family == AF_INET6) { + struct sockaddr_in6* sin = ((struct sockaddr_in6*)&arpreq.arp_pa); + memcpy(sin->sin6_addr.s6_addr, + address->address.address6.sin6_addr.s6_addr, + sizeof(address->address.address6.sin6_addr.s6_addr)); + } else { + return 0; + } + + sockfd = socket(AF_INET, SOCK_DGRAM, 0); + if (sockfd < 0) + return UV__ERR(errno); + + if (ioctl(sockfd, SIOCGARP, (char*)&arpreq) == -1) { + uv__close(sockfd); + return UV__ERR(errno); + } + memcpy(address->phys_addr, arpreq.arp_ha.sa_data, sizeof(address->phys_addr)); + uv__close(sockfd); + return 0; +} + + +static int uv__ifaddr_exclude(struct ifaddrs *ent) { + if (!((ent->ifa_flags & IFF_UP) && (ent->ifa_flags & IFF_RUNNING))) + return 1; + if (ent->ifa_addr == NULL) + return 1; + if (ent->ifa_addr->sa_family != AF_INET && + ent->ifa_addr->sa_family != AF_INET6) + return 1; + return 0; +} + +int uv_interface_addresses(uv_interface_address_t** addresses, int* count) { + uv_interface_address_t* address; + struct ifaddrs* addrs; + struct ifaddrs* ent; + + *count = 0; + *addresses = NULL; + + if (getifaddrs(&addrs)) + return UV__ERR(errno); + + /* Count the number of interfaces */ + for (ent = addrs; ent != NULL; ent = ent->ifa_next) { + if (uv__ifaddr_exclude(ent)) + continue; + (*count)++; + } + + if (*count == 0) { + freeifaddrs(addrs); + return 0; + } + + *addresses = uv__malloc(*count * sizeof(**addresses)); + if (!(*addresses)) { + freeifaddrs(addrs); + return UV_ENOMEM; + } + + address = *addresses; + + for (ent = addrs; ent != NULL; ent = ent->ifa_next) { + if (uv__ifaddr_exclude(ent)) + continue; + + address->name = uv__strdup(ent->ifa_name); + + if (ent->ifa_addr->sa_family == AF_INET6) { + address->address.address6 = *((struct sockaddr_in6*) ent->ifa_addr); + } else { + address->address.address4 = *((struct sockaddr_in*) ent->ifa_addr); + } + + if (ent->ifa_netmask->sa_family == AF_INET6) { + address->netmask.netmask6 = *((struct sockaddr_in6*) ent->ifa_netmask); + } else { + address->netmask.netmask4 = *((struct sockaddr_in*) ent->ifa_netmask); + } + + address->is_internal = !!((ent->ifa_flags & IFF_PRIVATE) || + (ent->ifa_flags & IFF_LOOPBACK)); + + uv__set_phys_addr(address, ent); + address++; + } + + freeifaddrs(addrs); + + return 0; +} +#endif /* SUNOS_NO_IFADDRS */ + +void uv_free_interface_addresses(uv_interface_address_t* addresses, + int count) { + int i; + + for (i = 0; i < count; i++) { + uv__free(addresses[i].name); + } + + uv__free(addresses); +} diff --cc Utilities/cmlibuv/src/uv-common.c index 907ebf2,0000000..f4853d6 mode 100644,000000..100644 --- a/Utilities/cmlibuv/src/uv-common.c +++ b/Utilities/cmlibuv/src/uv-common.c @@@ -1,696 -1,0 +1,790 @@@ +/* Copyright Joyent, Inc. and other Node contributors. All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +#include "uv.h" +#include "uv-common.h" + +#include +#include +#include +#include /* NULL */ +#include +#include /* malloc */ +#include /* memset */ + +#if defined(_WIN32) +# include /* malloc */ +#else +# include /* if_nametoindex */ ++# include /* AF_UNIX, sockaddr_un */ +#endif + + +typedef struct { + uv_malloc_func local_malloc; + uv_realloc_func local_realloc; + uv_calloc_func local_calloc; + uv_free_func local_free; +} uv__allocator_t; + +static uv__allocator_t uv__allocator = { + malloc, + realloc, + calloc, + free, +}; + +char* uv__strdup(const char* s) { + size_t len = strlen(s) + 1; + char* m = uv__malloc(len); + if (m == NULL) + return NULL; + return memcpy(m, s, len); +} + +char* uv__strndup(const char* s, size_t n) { + char* m; + size_t len = strlen(s); + if (n < len) + len = n; + m = uv__malloc(len + 1); + if (m == NULL) + return NULL; + m[len] = '\0'; + return memcpy(m, s, len); +} + +void* uv__malloc(size_t size) { + if (size > 0) + return uv__allocator.local_malloc(size); + return NULL; +} + +void uv__free(void* ptr) { + int saved_errno; + + /* Libuv expects that free() does not clobber errno. The system allocator + * honors that assumption but custom allocators may not be so careful. + */ + saved_errno = errno; + uv__allocator.local_free(ptr); + errno = saved_errno; +} + +void* uv__calloc(size_t count, size_t size) { + return uv__allocator.local_calloc(count, size); +} + +void* uv__realloc(void* ptr, size_t size) { + if (size > 0) + return uv__allocator.local_realloc(ptr, size); + uv__free(ptr); + return NULL; +} + +int uv_replace_allocator(uv_malloc_func malloc_func, + uv_realloc_func realloc_func, + uv_calloc_func calloc_func, + uv_free_func free_func) { + if (malloc_func == NULL || realloc_func == NULL || + calloc_func == NULL || free_func == NULL) { + return UV_EINVAL; + } + + uv__allocator.local_malloc = malloc_func; + uv__allocator.local_realloc = realloc_func; + uv__allocator.local_calloc = calloc_func; + uv__allocator.local_free = free_func; + + return 0; +} + +#define XX(uc, lc) case UV_##uc: return sizeof(uv_##lc##_t); + +size_t uv_handle_size(uv_handle_type type) { + switch (type) { + UV_HANDLE_TYPE_MAP(XX) + default: + return -1; + } +} + +size_t uv_req_size(uv_req_type type) { + switch(type) { + UV_REQ_TYPE_MAP(XX) + default: + return -1; + } +} + +#undef XX + + +size_t uv_loop_size(void) { + return sizeof(uv_loop_t); +} + + +uv_buf_t uv_buf_init(char* base, unsigned int len) { + uv_buf_t buf; + buf.base = base; + buf.len = len; + return buf; +} + + +static const char* uv__unknown_err_code(int err) { + char buf[32]; + char* copy; + + snprintf(buf, sizeof(buf), "Unknown system error %d", err); + copy = uv__strdup(buf); + + return copy != NULL ? copy : "Unknown system error"; +} + +#define UV_ERR_NAME_GEN_R(name, _) \ +case UV_## name: \ + uv__strscpy(buf, #name, buflen); break; +char* uv_err_name_r(int err, char* buf, size_t buflen) { + switch (err) { + UV_ERRNO_MAP(UV_ERR_NAME_GEN_R) + default: snprintf(buf, buflen, "Unknown system error %d", err); + } + return buf; +} +#undef UV_ERR_NAME_GEN_R + + +#define UV_ERR_NAME_GEN(name, _) case UV_ ## name: return #name; +const char* uv_err_name(int err) { + switch (err) { + UV_ERRNO_MAP(UV_ERR_NAME_GEN) + } + return uv__unknown_err_code(err); +} +#undef UV_ERR_NAME_GEN + + +#define UV_STRERROR_GEN_R(name, msg) \ +case UV_ ## name: \ + snprintf(buf, buflen, "%s", msg); break; +char* uv_strerror_r(int err, char* buf, size_t buflen) { + switch (err) { + UV_ERRNO_MAP(UV_STRERROR_GEN_R) + default: snprintf(buf, buflen, "Unknown system error %d", err); + } + return buf; +} +#undef UV_STRERROR_GEN_R + + +#define UV_STRERROR_GEN(name, msg) case UV_ ## name: return msg; +const char* uv_strerror(int err) { + switch (err) { + UV_ERRNO_MAP(UV_STRERROR_GEN) + } + return uv__unknown_err_code(err); +} +#undef UV_STRERROR_GEN + +#if !defined(CMAKE_BOOTSTRAP) || defined(_WIN32) + +int uv_ip4_addr(const char* ip, int port, struct sockaddr_in* addr) { + memset(addr, 0, sizeof(*addr)); + addr->sin_family = AF_INET; + addr->sin_port = htons(port); + return uv_inet_pton(AF_INET, ip, &(addr->sin_addr.s_addr)); +} + + +int uv_ip6_addr(const char* ip, int port, struct sockaddr_in6* addr) { + char address_part[40]; + size_t address_part_size; + const char* zone_index; + + memset(addr, 0, sizeof(*addr)); + addr->sin6_family = AF_INET6; + addr->sin6_port = htons(port); ++#ifdef SIN6_LEN ++ addr->sin6_len = sizeof(*addr); ++#endif + + zone_index = strchr(ip, '%'); + if (zone_index != NULL) { + address_part_size = zone_index - ip; + if (address_part_size >= sizeof(address_part)) + address_part_size = sizeof(address_part) - 1; + + memcpy(address_part, ip, address_part_size); + address_part[address_part_size] = '\0'; + ip = address_part; + + zone_index++; /* skip '%' */ + /* NOTE: unknown interface (id=0) is silently ignored */ +#ifdef _WIN32 + addr->sin6_scope_id = atoi(zone_index); +#else + addr->sin6_scope_id = if_nametoindex(zone_index); +#endif + } + + return uv_inet_pton(AF_INET6, ip, &addr->sin6_addr); +} + + +int uv_ip4_name(const struct sockaddr_in* src, char* dst, size_t size) { + return uv_inet_ntop(AF_INET, &src->sin_addr, dst, size); +} + + +int uv_ip6_name(const struct sockaddr_in6* src, char* dst, size_t size) { + return uv_inet_ntop(AF_INET6, &src->sin6_addr, dst, size); +} + + +int uv_tcp_bind(uv_tcp_t* handle, + const struct sockaddr* addr, + unsigned int flags) { + unsigned int addrlen; + + if (handle->type != UV_TCP) + return UV_EINVAL; + + if (addr->sa_family == AF_INET) + addrlen = sizeof(struct sockaddr_in); + else if (addr->sa_family == AF_INET6) + addrlen = sizeof(struct sockaddr_in6); + else + return UV_EINVAL; + + return uv__tcp_bind(handle, addr, addrlen, flags); +} + + +int uv_udp_bind(uv_udp_t* handle, + const struct sockaddr* addr, + unsigned int flags) { + unsigned int addrlen; + + if (handle->type != UV_UDP) + return UV_EINVAL; + + if (addr->sa_family == AF_INET) + addrlen = sizeof(struct sockaddr_in); + else if (addr->sa_family == AF_INET6) + addrlen = sizeof(struct sockaddr_in6); + else + return UV_EINVAL; + + return uv__udp_bind(handle, addr, addrlen, flags); +} + + +int uv_tcp_connect(uv_connect_t* req, + uv_tcp_t* handle, + const struct sockaddr* addr, + uv_connect_cb cb) { + unsigned int addrlen; + + if (handle->type != UV_TCP) + return UV_EINVAL; + + if (addr->sa_family == AF_INET) + addrlen = sizeof(struct sockaddr_in); + else if (addr->sa_family == AF_INET6) + addrlen = sizeof(struct sockaddr_in6); + else + return UV_EINVAL; + + return uv__tcp_connect(req, handle, addr, addrlen, cb); +} + + - int uv_udp_send(uv_udp_send_t* req, - uv_udp_t* handle, - const uv_buf_t bufs[], - unsigned int nbufs, - const struct sockaddr* addr, - uv_udp_send_cb send_cb) { ++int uv_udp_connect(uv_udp_t* handle, const struct sockaddr* addr) { + unsigned int addrlen; + + if (handle->type != UV_UDP) + return UV_EINVAL; + ++ /* Disconnect the handle */ ++ if (addr == NULL) { ++ if (!(handle->flags & UV_HANDLE_UDP_CONNECTED)) ++ return UV_ENOTCONN; ++ ++ return uv__udp_disconnect(handle); ++ } ++ + if (addr->sa_family == AF_INET) + addrlen = sizeof(struct sockaddr_in); + else if (addr->sa_family == AF_INET6) + addrlen = sizeof(struct sockaddr_in6); + else + return UV_EINVAL; + ++ if (handle->flags & UV_HANDLE_UDP_CONNECTED) ++ return UV_EISCONN; ++ ++ return uv__udp_connect(handle, addr, addrlen); ++} ++ ++ ++int uv__udp_is_connected(uv_udp_t* handle) { ++ struct sockaddr_storage addr; ++ int addrlen; ++ if (handle->type != UV_UDP) ++ return 0; ++ ++ addrlen = sizeof(addr); ++ if (uv_udp_getpeername(handle, (struct sockaddr*) &addr, &addrlen) != 0) ++ return 0; ++ ++ return addrlen > 0; ++} ++ ++ ++int uv__udp_check_before_send(uv_udp_t* handle, const struct sockaddr* addr) { ++ unsigned int addrlen; ++ ++ if (handle->type != UV_UDP) ++ return UV_EINVAL; ++ ++ if (addr != NULL && (handle->flags & UV_HANDLE_UDP_CONNECTED)) ++ return UV_EISCONN; ++ ++ if (addr == NULL && !(handle->flags & UV_HANDLE_UDP_CONNECTED)) ++ return UV_EDESTADDRREQ; ++ ++ if (addr != NULL) { ++ if (addr->sa_family == AF_INET) ++ addrlen = sizeof(struct sockaddr_in); ++ else if (addr->sa_family == AF_INET6) ++ addrlen = sizeof(struct sockaddr_in6); ++#if defined(AF_UNIX) && !defined(_WIN32) ++ else if (addr->sa_family == AF_UNIX) ++ addrlen = sizeof(struct sockaddr_un); ++#endif ++ else ++ return UV_EINVAL; ++ } else { ++ addrlen = 0; ++ } ++ ++ return addrlen; ++} ++ ++ ++int uv_udp_send(uv_udp_send_t* req, ++ uv_udp_t* handle, ++ const uv_buf_t bufs[], ++ unsigned int nbufs, ++ const struct sockaddr* addr, ++ uv_udp_send_cb send_cb) { ++ int addrlen; ++ ++ addrlen = uv__udp_check_before_send(handle, addr); ++ if (addrlen < 0) ++ return addrlen; ++ + return uv__udp_send(req, handle, bufs, nbufs, addr, addrlen, send_cb); +} + + +int uv_udp_try_send(uv_udp_t* handle, + const uv_buf_t bufs[], + unsigned int nbufs, + const struct sockaddr* addr) { - unsigned int addrlen; - - if (handle->type != UV_UDP) - return UV_EINVAL; ++ int addrlen; + - if (addr->sa_family == AF_INET) - addrlen = sizeof(struct sockaddr_in); - else if (addr->sa_family == AF_INET6) - addrlen = sizeof(struct sockaddr_in6); - else - return UV_EINVAL; ++ addrlen = uv__udp_check_before_send(handle, addr); ++ if (addrlen < 0) ++ return addrlen; + + return uv__udp_try_send(handle, bufs, nbufs, addr, addrlen); +} + + +int uv_udp_recv_start(uv_udp_t* handle, + uv_alloc_cb alloc_cb, + uv_udp_recv_cb recv_cb) { + if (handle->type != UV_UDP || alloc_cb == NULL || recv_cb == NULL) + return UV_EINVAL; + else + return uv__udp_recv_start(handle, alloc_cb, recv_cb); +} + + +int uv_udp_recv_stop(uv_udp_t* handle) { + if (handle->type != UV_UDP) + return UV_EINVAL; + else + return uv__udp_recv_stop(handle); +} + +#endif + +void uv_walk(uv_loop_t* loop, uv_walk_cb walk_cb, void* arg) { + QUEUE queue; + QUEUE* q; + uv_handle_t* h; + + QUEUE_MOVE(&loop->handle_queue, &queue); + while (!QUEUE_EMPTY(&queue)) { + q = QUEUE_HEAD(&queue); + h = QUEUE_DATA(q, uv_handle_t, handle_queue); + + QUEUE_REMOVE(q); + QUEUE_INSERT_TAIL(&loop->handle_queue, q); + + if (h->flags & UV_HANDLE_INTERNAL) continue; + walk_cb(h, arg); + } +} + + +static void uv__print_handles(uv_loop_t* loop, int only_active, FILE* stream) { + const char* type; + QUEUE* q; + uv_handle_t* h; + + if (loop == NULL) + loop = uv_default_loop(); + + QUEUE_FOREACH(q, &loop->handle_queue) { + h = QUEUE_DATA(q, uv_handle_t, handle_queue); + + if (only_active && !uv__is_active(h)) + continue; + + switch (h->type) { +#define X(uc, lc) case UV_##uc: type = #lc; break; + UV_HANDLE_TYPE_MAP(X) +#undef X + default: type = ""; + } + + fprintf(stream, + "[%c%c%c] %-8s %p\n", + "R-"[!(h->flags & UV_HANDLE_REF)], + "A-"[!(h->flags & UV_HANDLE_ACTIVE)], + "I-"[!(h->flags & UV_HANDLE_INTERNAL)], + type, + (void*)h); + } +} + + +void uv_print_all_handles(uv_loop_t* loop, FILE* stream) { + uv__print_handles(loop, 0, stream); +} + + +void uv_print_active_handles(uv_loop_t* loop, FILE* stream) { + uv__print_handles(loop, 1, stream); +} + + +void uv_ref(uv_handle_t* handle) { + uv__handle_ref(handle); +} + + +void uv_unref(uv_handle_t* handle) { + uv__handle_unref(handle); +} + + +int uv_has_ref(const uv_handle_t* handle) { + return uv__has_ref(handle); +} + + +void uv_stop(uv_loop_t* loop) { + loop->stop_flag = 1; +} + + +uint64_t uv_now(const uv_loop_t* loop) { + return loop->time; +} + + + +size_t uv__count_bufs(const uv_buf_t bufs[], unsigned int nbufs) { + unsigned int i; + size_t bytes; + + bytes = 0; + for (i = 0; i < nbufs; i++) + bytes += (size_t) bufs[i].len; + + return bytes; +} + +int uv_recv_buffer_size(uv_handle_t* handle, int* value) { + return uv__socket_sockopt(handle, SO_RCVBUF, value); +} + +int uv_send_buffer_size(uv_handle_t* handle, int *value) { + return uv__socket_sockopt(handle, SO_SNDBUF, value); +} + +int uv_fs_event_getpath(uv_fs_event_t* handle, char* buffer, size_t* size) { + size_t required_len; + + if (!uv__is_active(handle)) { + *size = 0; + return UV_EINVAL; + } + + required_len = strlen(handle->path); + if (required_len >= *size) { + *size = required_len + 1; + return UV_ENOBUFS; + } + + memcpy(buffer, handle->path, required_len); + *size = required_len; + buffer[required_len] = '\0'; + + return 0; +} + +/* The windows implementation does not have the same structure layout as + * the unix implementation (nbufs is not directly inside req but is + * contained in a nested union/struct) so this function locates it. +*/ +static unsigned int* uv__get_nbufs(uv_fs_t* req) { +#ifdef _WIN32 + return &req->fs.info.nbufs; +#else + return &req->nbufs; +#endif +} + +/* uv_fs_scandir() uses the system allocator to allocate memory on non-Windows + * systems. So, the memory should be released using free(). On Windows, + * uv__malloc() is used, so use uv__free() to free memory. +*/ +#ifdef _WIN32 +# define uv__fs_scandir_free uv__free +#else +# define uv__fs_scandir_free free +#endif + +void uv__fs_scandir_cleanup(uv_fs_t* req) { + uv__dirent_t** dents; + + unsigned int* nbufs = uv__get_nbufs(req); + + dents = req->ptr; + if (*nbufs > 0 && *nbufs != (unsigned int) req->result) + (*nbufs)--; + for (; *nbufs < (unsigned int) req->result; (*nbufs)++) + uv__fs_scandir_free(dents[*nbufs]); + + uv__fs_scandir_free(req->ptr); + req->ptr = NULL; +} + + +int uv_fs_scandir_next(uv_fs_t* req, uv_dirent_t* ent) { + uv__dirent_t** dents; + uv__dirent_t* dent; + unsigned int* nbufs; + + /* Check to see if req passed */ + if (req->result < 0) + return req->result; + + /* Ptr will be null if req was canceled or no files found */ + if (!req->ptr) + return UV_EOF; + + nbufs = uv__get_nbufs(req); + assert(nbufs); + + dents = req->ptr; + + /* Free previous entity */ + if (*nbufs > 0) + uv__fs_scandir_free(dents[*nbufs - 1]); + + /* End was already reached */ + if (*nbufs == (unsigned int) req->result) { + uv__fs_scandir_free(dents); + req->ptr = NULL; + return UV_EOF; + } + + dent = dents[(*nbufs)++]; + + ent->name = dent->d_name; ++ ent->type = uv__fs_get_dirent_type(dent); ++ ++ return 0; ++} ++ ++uv_dirent_type_t uv__fs_get_dirent_type(uv__dirent_t* dent) { ++ uv_dirent_type_t type; ++ +#ifdef HAVE_DIRENT_TYPES + switch (dent->d_type) { + case UV__DT_DIR: - ent->type = UV_DIRENT_DIR; ++ type = UV_DIRENT_DIR; + break; + case UV__DT_FILE: - ent->type = UV_DIRENT_FILE; ++ type = UV_DIRENT_FILE; + break; + case UV__DT_LINK: - ent->type = UV_DIRENT_LINK; ++ type = UV_DIRENT_LINK; + break; + case UV__DT_FIFO: - ent->type = UV_DIRENT_FIFO; ++ type = UV_DIRENT_FIFO; + break; + case UV__DT_SOCKET: - ent->type = UV_DIRENT_SOCKET; ++ type = UV_DIRENT_SOCKET; + break; + case UV__DT_CHAR: - ent->type = UV_DIRENT_CHAR; ++ type = UV_DIRENT_CHAR; + break; + case UV__DT_BLOCK: - ent->type = UV_DIRENT_BLOCK; ++ type = UV_DIRENT_BLOCK; + break; + default: - ent->type = UV_DIRENT_UNKNOWN; ++ type = UV_DIRENT_UNKNOWN; + } +#else - ent->type = UV_DIRENT_UNKNOWN; ++ type = UV_DIRENT_UNKNOWN; +#endif + - return 0; ++ return type; ++} ++ ++void uv__fs_readdir_cleanup(uv_fs_t* req) { ++ uv_dir_t* dir; ++ uv_dirent_t* dirents; ++ int i; ++ ++ if (req->ptr == NULL) ++ return; ++ ++ dir = req->ptr; ++ dirents = dir->dirents; ++ req->ptr = NULL; ++ ++ if (dirents == NULL) ++ return; ++ ++ for (i = 0; i < req->result; ++i) { ++ uv__free((char*) dirents[i].name); ++ dirents[i].name = NULL; ++ } +} + + +int uv_loop_configure(uv_loop_t* loop, uv_loop_option option, ...) { + va_list ap; + int err; + + va_start(ap, option); + /* Any platform-agnostic options should be handled here. */ + err = uv__loop_configure(loop, option, ap); + va_end(ap); + + return err; +} + + +static uv_loop_t default_loop_struct; +static uv_loop_t* default_loop_ptr; + + +uv_loop_t* uv_default_loop(void) { + if (default_loop_ptr != NULL) + return default_loop_ptr; + + if (uv_loop_init(&default_loop_struct)) + return NULL; + + default_loop_ptr = &default_loop_struct; + return default_loop_ptr; +} + + +uv_loop_t* uv_loop_new(void) { + uv_loop_t* loop; + + loop = uv__malloc(sizeof(*loop)); + if (loop == NULL) + return NULL; + + if (uv_loop_init(loop)) { + uv__free(loop); + return NULL; + } + + return loop; +} + + +int uv_loop_close(uv_loop_t* loop) { + QUEUE* q; + uv_handle_t* h; +#ifndef NDEBUG + void* saved_data; +#endif + + if (uv__has_active_reqs(loop)) + return UV_EBUSY; + + QUEUE_FOREACH(q, &loop->handle_queue) { + h = QUEUE_DATA(q, uv_handle_t, handle_queue); + if (!(h->flags & UV_HANDLE_INTERNAL)) + return UV_EBUSY; + } + + uv__loop_close(loop); + +#ifndef NDEBUG + saved_data = loop->data; + memset(loop, -1, sizeof(*loop)); + loop->data = saved_data; +#endif + if (loop == default_loop_ptr) + default_loop_ptr = NULL; + + return 0; +} + + +void uv_loop_delete(uv_loop_t* loop) { + uv_loop_t* default_loop; + int err; + + default_loop = default_loop_ptr; + + err = uv_loop_close(loop); + (void) err; /* Squelch compiler warnings. */ + assert(err == 0); + if (loop != default_loop) + uv__free(loop); +} diff --cc Utilities/cmlibuv/src/win/internal.h index 206ab5f,0000000..f7d8ccf mode 100644,000000..100644 --- a/Utilities/cmlibuv/src/win/internal.h +++ b/Utilities/cmlibuv/src/win/internal.h @@@ -1,338 -1,0 +1,346 @@@ +/* Copyright Joyent, Inc. and other Node contributors. All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +#ifndef UV_WIN_INTERNAL_H_ +#define UV_WIN_INTERNAL_H_ + +#if defined(_MSC_VER) +# pragma warning(push,1) +#endif + +#include "uv.h" +#include "../uv-common.h" + +#include "uv/tree.h" +#include "winapi.h" +#include "winsock.h" + +#ifdef _MSC_VER +# define INLINE __inline +# define UV_THREAD_LOCAL __declspec( thread ) +#else +# define INLINE inline +# define UV_THREAD_LOCAL __thread +#endif + + +#ifdef _DEBUG + +extern UV_THREAD_LOCAL int uv__crt_assert_enabled; + +#define UV_BEGIN_DISABLE_CRT_ASSERT() \ + { \ + int uv__saved_crt_assert_enabled = uv__crt_assert_enabled; \ + uv__crt_assert_enabled = FALSE; + + +#define UV_END_DISABLE_CRT_ASSERT() \ + uv__crt_assert_enabled = uv__saved_crt_assert_enabled; \ + } + +#else +#define UV_BEGIN_DISABLE_CRT_ASSERT() +#define UV_END_DISABLE_CRT_ASSERT() +#endif + +/* + * TCP + */ + +typedef enum { + UV__IPC_SOCKET_XFER_NONE = 0, + UV__IPC_SOCKET_XFER_TCP_CONNECTION, + UV__IPC_SOCKET_XFER_TCP_SERVER +} uv__ipc_socket_xfer_type_t; + +typedef struct { + WSAPROTOCOL_INFOW socket_info; + uint32_t delayed_error; +} uv__ipc_socket_xfer_info_t; + +int uv_tcp_listen(uv_tcp_t* handle, int backlog, uv_connection_cb cb); +int uv_tcp_accept(uv_tcp_t* server, uv_tcp_t* client); +int uv_tcp_read_start(uv_tcp_t* handle, uv_alloc_cb alloc_cb, + uv_read_cb read_cb); +int uv_tcp_write(uv_loop_t* loop, uv_write_t* req, uv_tcp_t* handle, + const uv_buf_t bufs[], unsigned int nbufs, uv_write_cb cb); +int uv__tcp_try_write(uv_tcp_t* handle, const uv_buf_t bufs[], + unsigned int nbufs); + +void uv_process_tcp_read_req(uv_loop_t* loop, uv_tcp_t* handle, uv_req_t* req); +void uv_process_tcp_write_req(uv_loop_t* loop, uv_tcp_t* handle, + uv_write_t* req); +void uv_process_tcp_accept_req(uv_loop_t* loop, uv_tcp_t* handle, + uv_req_t* req); +void uv_process_tcp_connect_req(uv_loop_t* loop, uv_tcp_t* handle, + uv_connect_t* req); + +void uv_tcp_close(uv_loop_t* loop, uv_tcp_t* tcp); +void uv_tcp_endgame(uv_loop_t* loop, uv_tcp_t* handle); + +int uv__tcp_xfer_export(uv_tcp_t* handle, + int pid, + uv__ipc_socket_xfer_type_t* xfer_type, + uv__ipc_socket_xfer_info_t* xfer_info); +int uv__tcp_xfer_import(uv_tcp_t* tcp, + uv__ipc_socket_xfer_type_t xfer_type, + uv__ipc_socket_xfer_info_t* xfer_info); + + +/* + * UDP + */ +void uv_process_udp_recv_req(uv_loop_t* loop, uv_udp_t* handle, uv_req_t* req); +void uv_process_udp_send_req(uv_loop_t* loop, uv_udp_t* handle, + uv_udp_send_t* req); + +void uv_udp_close(uv_loop_t* loop, uv_udp_t* handle); +void uv_udp_endgame(uv_loop_t* loop, uv_udp_t* handle); + + +/* + * Pipes + */ +int uv_stdio_pipe_server(uv_loop_t* loop, uv_pipe_t* handle, DWORD access, + char* name, size_t nameSize); + +int uv_pipe_listen(uv_pipe_t* handle, int backlog, uv_connection_cb cb); +int uv_pipe_accept(uv_pipe_t* server, uv_stream_t* client); +int uv_pipe_read_start(uv_pipe_t* handle, uv_alloc_cb alloc_cb, + uv_read_cb read_cb); +void uv__pipe_read_stop(uv_pipe_t* handle); +int uv__pipe_write(uv_loop_t* loop, + uv_write_t* req, + uv_pipe_t* handle, + const uv_buf_t bufs[], + size_t nbufs, + uv_stream_t* send_handle, + uv_write_cb cb); + +void uv_process_pipe_read_req(uv_loop_t* loop, uv_pipe_t* handle, + uv_req_t* req); +void uv_process_pipe_write_req(uv_loop_t* loop, uv_pipe_t* handle, + uv_write_t* req); +void uv_process_pipe_accept_req(uv_loop_t* loop, uv_pipe_t* handle, + uv_req_t* raw_req); +void uv_process_pipe_connect_req(uv_loop_t* loop, uv_pipe_t* handle, + uv_connect_t* req); +void uv_process_pipe_shutdown_req(uv_loop_t* loop, uv_pipe_t* handle, + uv_shutdown_t* req); + +void uv_pipe_close(uv_loop_t* loop, uv_pipe_t* handle); +void uv_pipe_cleanup(uv_loop_t* loop, uv_pipe_t* handle); +void uv_pipe_endgame(uv_loop_t* loop, uv_pipe_t* handle); + + +/* + * TTY + */ +void uv_console_init(void); + +int uv_tty_read_start(uv_tty_t* handle, uv_alloc_cb alloc_cb, + uv_read_cb read_cb); +int uv_tty_read_stop(uv_tty_t* handle); +int uv_tty_write(uv_loop_t* loop, uv_write_t* req, uv_tty_t* handle, + const uv_buf_t bufs[], unsigned int nbufs, uv_write_cb cb); +int uv__tty_try_write(uv_tty_t* handle, const uv_buf_t bufs[], + unsigned int nbufs); +void uv_tty_close(uv_tty_t* handle); + +void uv_process_tty_read_req(uv_loop_t* loop, uv_tty_t* handle, + uv_req_t* req); +void uv_process_tty_write_req(uv_loop_t* loop, uv_tty_t* handle, + uv_write_t* req); +/* + * uv_process_tty_accept_req() is a stub to keep DELEGATE_STREAM_REQ working + * TODO: find a way to remove it + */ +void uv_process_tty_accept_req(uv_loop_t* loop, uv_tty_t* handle, + uv_req_t* raw_req); +/* + * uv_process_tty_connect_req() is a stub to keep DELEGATE_STREAM_REQ working + * TODO: find a way to remove it + */ +void uv_process_tty_connect_req(uv_loop_t* loop, uv_tty_t* handle, + uv_connect_t* req); + +void uv_tty_endgame(uv_loop_t* loop, uv_tty_t* handle); + + +/* + * Poll watchers + */ +void uv_process_poll_req(uv_loop_t* loop, uv_poll_t* handle, + uv_req_t* req); + +int uv_poll_close(uv_loop_t* loop, uv_poll_t* handle); +void uv_poll_endgame(uv_loop_t* loop, uv_poll_t* handle); + + +/* + * Loop watchers + */ +void uv_loop_watcher_endgame(uv_loop_t* loop, uv_handle_t* handle); + +void uv_prepare_invoke(uv_loop_t* loop); +void uv_check_invoke(uv_loop_t* loop); +void uv_idle_invoke(uv_loop_t* loop); + +void uv__once_init(void); + + +/* + * Async watcher + */ +void uv_async_close(uv_loop_t* loop, uv_async_t* handle); +void uv_async_endgame(uv_loop_t* loop, uv_async_t* handle); + +void uv_process_async_wakeup_req(uv_loop_t* loop, uv_async_t* handle, + uv_req_t* req); + + +/* + * Signal watcher + */ +void uv_signals_init(void); +int uv__signal_dispatch(int signum); + +void uv_signal_close(uv_loop_t* loop, uv_signal_t* handle); +void uv_signal_endgame(uv_loop_t* loop, uv_signal_t* handle); + +void uv_process_signal_req(uv_loop_t* loop, uv_signal_t* handle, + uv_req_t* req); + + +/* + * Spawn + */ +void uv_process_proc_exit(uv_loop_t* loop, uv_process_t* handle); +void uv_process_close(uv_loop_t* loop, uv_process_t* handle); +void uv_process_endgame(uv_loop_t* loop, uv_process_t* handle); + + +/* + * Error + */ +int uv_translate_sys_error(int sys_errno); + + +/* + * FS + */ +void uv_fs_init(void); + + +/* + * FS Event + */ +void uv_process_fs_event_req(uv_loop_t* loop, uv_req_t* req, + uv_fs_event_t* handle); +void uv_fs_event_close(uv_loop_t* loop, uv_fs_event_t* handle); +void uv_fs_event_endgame(uv_loop_t* loop, uv_fs_event_t* handle); + + +/* + * Stat poller. + */ +void uv__fs_poll_endgame(uv_loop_t* loop, uv_fs_poll_t* handle); + + +/* + * Utilities. + */ +void uv__util_init(void); + +uint64_t uv__hrtime(double scale); +__declspec(noreturn) void uv_fatal_error(const int errorno, const char* syscall); +int uv__getpwuid_r(uv_passwd_t* pwd); +int uv__convert_utf16_to_utf8(const WCHAR* utf16, int utf16len, char** utf8); +int uv__convert_utf8_to_utf16(const char* utf8, int utf8len, WCHAR** utf16); + ++typedef int (WINAPI *uv__peersockfunc)(SOCKET, struct sockaddr*, int*); ++ ++int uv__getsockpeername(const uv_handle_t* handle, ++ uv__peersockfunc func, ++ struct sockaddr* name, ++ int* namelen, ++ int delayed_error); ++ + +/* + * Process stdio handles. + */ +int uv__stdio_create(uv_loop_t* loop, + const uv_process_options_t* options, + BYTE** buffer_ptr); +void uv__stdio_destroy(BYTE* buffer); +void uv__stdio_noinherit(BYTE* buffer); +int uv__stdio_verify(BYTE* buffer, WORD size); +WORD uv__stdio_size(BYTE* buffer); +HANDLE uv__stdio_handle(BYTE* buffer, int fd); + + +/* + * Winapi and ntapi utility functions + */ +void uv_winapi_init(void); + + +/* + * Winsock utility functions + */ +void uv_winsock_init(void); + +int uv_ntstatus_to_winsock_error(NTSTATUS status); + +BOOL uv_get_acceptex_function(SOCKET socket, LPFN_ACCEPTEX* target); +BOOL uv_get_connectex_function(SOCKET socket, LPFN_CONNECTEX* target); + +int WSAAPI uv_wsarecv_workaround(SOCKET socket, WSABUF* buffers, + DWORD buffer_count, DWORD* bytes, DWORD* flags, WSAOVERLAPPED *overlapped, + LPWSAOVERLAPPED_COMPLETION_ROUTINE completion_routine); +int WSAAPI uv_wsarecvfrom_workaround(SOCKET socket, WSABUF* buffers, + DWORD buffer_count, DWORD* bytes, DWORD* flags, struct sockaddr* addr, + int* addr_len, WSAOVERLAPPED *overlapped, + LPWSAOVERLAPPED_COMPLETION_ROUTINE completion_routine); + +int WSAAPI uv_msafd_poll(SOCKET socket, AFD_POLL_INFO* info_in, + AFD_POLL_INFO* info_out, OVERLAPPED* overlapped); + +/* Whether there are any non-IFS LSPs stacked on TCP */ +extern int uv_tcp_non_ifs_lsp_ipv4; +extern int uv_tcp_non_ifs_lsp_ipv6; + +/* Ip address used to bind to any port at any interface */ +extern struct sockaddr_in uv_addr_ip4_any_; +extern struct sockaddr_in6 uv_addr_ip6_any_; + +/* + * Wake all loops with fake message + */ +void uv__wake_all_loops(void); + +/* + * Init system wake-up detection + */ +void uv__init_detect_system_wakeup(void); + +#endif /* UV_WIN_INTERNAL_H_ */ https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b4069b04ff63b327ff4881282200c3c73fded34d commit b4069b04ff63b327ff4881282200c3c73fded34d Author: libuv upstream AuthorDate: Mon Jun 10 15:17:21 2019 +0200 Commit: Brad King CommitDate: Tue Jun 18 07:45:34 2019 -0400 libuv 2019-06-10 (ee24ce90) Code extracted from: https://github.com/libuv/libuv.git at commit ee24ce900e5714c950b248da2bdd311b01c983be (v1.x). diff --git a/include/uv.h b/include/uv.h index a46b229..f97801c 100644 --- a/include/uv.h +++ b/include/uv.h @@ -202,6 +202,7 @@ typedef enum { /* Handle types. */ typedef struct uv_loop_s uv_loop_t; typedef struct uv_handle_s uv_handle_t; +typedef struct uv_dir_s uv_dir_t; typedef struct uv_stream_s uv_stream_t; typedef struct uv_tcp_s uv_tcp_t; typedef struct uv_udp_s uv_udp_t; @@ -630,7 +631,11 @@ UV_EXTERN int uv_udp_open(uv_udp_t* handle, uv_os_sock_t sock); UV_EXTERN int uv_udp_bind(uv_udp_t* handle, const struct sockaddr* addr, unsigned int flags); +UV_EXTERN int uv_udp_connect(uv_udp_t* handle, const struct sockaddr* addr); +UV_EXTERN int uv_udp_getpeername(const uv_udp_t* handle, + struct sockaddr* name, + int* namelen); UV_EXTERN int uv_udp_getsockname(const uv_udp_t* handle, struct sockaddr* name, int* namelen); @@ -1095,6 +1100,11 @@ typedef struct { } uv_timeval_t; typedef struct { + int64_t tv_sec; + int32_t tv_usec; +} uv_timeval64_t; + +typedef struct { uv_timeval_t ru_utime; /* user CPU time used */ uv_timeval_t ru_stime; /* system CPU time used */ uint64_t ru_maxrss; /* maximum resident set size */ @@ -1144,6 +1154,17 @@ UV_EXTERN int uv_os_getenv(const char* name, char* buffer, size_t* size); UV_EXTERN int uv_os_setenv(const char* name, const char* value); UV_EXTERN int uv_os_unsetenv(const char* name); +#ifdef MAXHOSTNAMELEN +# define UV_MAXHOSTNAMESIZE (MAXHOSTNAMELEN + 1) +#else + /* + Fallback for the maximum hostname size, including the null terminator. The + Windows gethostname() documentation states that 256 bytes will always be + large enough to hold the null-terminated hostname. + */ +# define UV_MAXHOSTNAMESIZE 256 +#endif + UV_EXTERN int uv_os_gethostname(char* buffer, size_t* size); UV_EXTERN int uv_os_uname(uv_utsname_t* buffer); @@ -1181,9 +1202,19 @@ typedef enum { UV_FS_FCHOWN, UV_FS_REALPATH, UV_FS_COPYFILE, - UV_FS_LCHOWN + UV_FS_LCHOWN, + UV_FS_OPENDIR, + UV_FS_READDIR, + UV_FS_CLOSEDIR } uv_fs_type; +struct uv_dir_s { + uv_dirent_t* dirents; + size_t nentries; + void* reserved[4]; + UV_DIR_PRIVATE_FIELDS +}; + /* uv_fs_t is a subclass of uv_req_t. */ struct uv_fs_s { UV_REQ_FIELDS @@ -1276,6 +1307,18 @@ UV_EXTERN int uv_fs_scandir(uv_loop_t* loop, uv_fs_cb cb); UV_EXTERN int uv_fs_scandir_next(uv_fs_t* req, uv_dirent_t* ent); +UV_EXTERN int uv_fs_opendir(uv_loop_t* loop, + uv_fs_t* req, + const char* path, + uv_fs_cb cb); +UV_EXTERN int uv_fs_readdir(uv_loop_t* loop, + uv_fs_t* req, + uv_dir_t* dir, + uv_fs_cb cb); +UV_EXTERN int uv_fs_closedir(uv_loop_t* loop, + uv_fs_t* req, + uv_dir_t* dir, + uv_fs_cb cb); UV_EXTERN int uv_fs_stat(uv_loop_t* loop, uv_fs_t* req, const char* path, @@ -1518,6 +1561,7 @@ UV_EXTERN int uv_chdir(const char* dir); UV_EXTERN uint64_t uv_get_free_memory(void); UV_EXTERN uint64_t uv_get_total_memory(void); +UV_EXTERN uint64_t uv_get_constrained_memory(void); UV_EXTERN uint64_t uv_hrtime(void); @@ -1571,9 +1615,29 @@ UV_EXTERN void uv_key_delete(uv_key_t* key); UV_EXTERN void* uv_key_get(uv_key_t* key); UV_EXTERN void uv_key_set(uv_key_t* key, void* value); +UV_EXTERN int uv_gettimeofday(uv_timeval64_t* tv); + typedef void (*uv_thread_cb)(void* arg); UV_EXTERN int uv_thread_create(uv_thread_t* tid, uv_thread_cb entry, void* arg); + +typedef enum { + UV_THREAD_NO_FLAGS = 0x00, + UV_THREAD_HAS_STACK_SIZE = 0x01 +} uv_thread_create_flags; + +struct uv_thread_options_s { + unsigned int flags; + size_t stack_size; + /* More fields may be added at any time. */ +}; + +typedef struct uv_thread_options_s uv_thread_options_t; + +UV_EXTERN int uv_thread_create_ex(uv_thread_t* tid, + const uv_thread_options_t* params, + uv_thread_cb entry, + void* arg); UV_EXTERN uv_thread_t uv_thread_self(void); UV_EXTERN int uv_thread_join(uv_thread_t *tid); UV_EXTERN int uv_thread_equal(const uv_thread_t* t1, const uv_thread_t* t2); diff --git a/include/uv/unix.h b/include/uv/unix.h index 9de9efe..6c93ee9 100644 --- a/include/uv/unix.h +++ b/include/uv/unix.h @@ -31,13 +31,14 @@ #include #include #include -#include +#include /* MAXHOSTNAMELEN on Solaris */ #include #include #if !defined(__MVS__) #include +#include /* MAXHOSTNAMELEN on Linux and the BSDs */ #endif #include #include @@ -48,8 +49,6 @@ # include "uv/linux.h" #elif defined (__MVS__) # include "uv/os390.h" -#elif defined(__PASE__) -# include "uv/posix.h" #elif defined(_AIX) # include "uv/aix.h" #elif defined(__sun) @@ -62,9 +61,12 @@ defined(__OpenBSD__) || \ defined(__NetBSD__) # include "uv/bsd.h" -#elif defined(__CYGWIN__) || defined(__MSYS__) +#elif defined(__PASE__) || \ + defined(__CYGWIN__) || \ + defined(__MSYS__) || \ + defined(__GNU__) # include "uv/posix.h" -#elif defined(__GNU__) +#elif defined(__HAIKU__) # include "uv/posix.h" #endif @@ -136,7 +138,9 @@ typedef pthread_cond_t uv_cond_t; typedef pthread_key_t uv_key_t; /* Note: guard clauses should match uv_barrier_init's in src/unix/thread.c. */ -#if defined(_AIX) || !defined(PTHREAD_BARRIER_SERIAL_THREAD) +#if defined(_AIX) || \ + defined(__OpenBSD__) || \ + !defined(PTHREAD_BARRIER_SERIAL_THREAD) /* TODO(bnoordhuis) Merge into uv_barrier_t in v2. */ struct _uv_barrier { uv_mutex_t mutex; @@ -163,6 +167,9 @@ typedef uid_t uv_uid_t; typedef struct dirent uv__dirent_t; +#define UV_DIR_PRIVATE_FIELDS \ + DIR* dir; + #if defined(DT_UNKNOWN) # define HAVE_DIRENT_TYPES # if defined(DT_REG) diff --git a/include/uv/version.h b/include/uv/version.h index abc140a..97f0bc2 100644 --- a/include/uv/version.h +++ b/include/uv/version.h @@ -31,7 +31,7 @@ */ #define UV_VERSION_MAJOR 1 -#define UV_VERSION_MINOR 24 +#define UV_VERSION_MINOR 29 #define UV_VERSION_PATCH 2 #define UV_VERSION_IS_RELEASE 0 #define UV_VERSION_SUFFIX "dev" diff --git a/include/uv/win.h b/include/uv/win.h index edd2cc6..acbd958 100644 --- a/include/uv/win.h +++ b/include/uv/win.h @@ -301,6 +301,11 @@ typedef struct uv__dirent_s { char d_name[1]; } uv__dirent_t; +#define UV_DIR_PRIVATE_FIELDS \ + HANDLE dir_handle; \ + WIN32_FIND_DATAW find_data; \ + BOOL need_find_call; + #define HAVE_DIRENT_TYPES #define UV__DT_DIR UV_DIRENT_DIR #define UV__DT_FILE UV_DIRENT_FILE diff --git a/src/fs-poll.c b/src/fs-poll.c index 6c82dfc..89864e2 100644 --- a/src/fs-poll.c +++ b/src/fs-poll.c @@ -22,12 +22,20 @@ #include "uv.h" #include "uv-common.h" +#ifdef _WIN32 +#include "win/internal.h" +#include "win/handle-inl.h" +#define uv__make_close_pending(h) uv_want_endgame((h)->loop, (h)) +#else +#include "unix/internal.h" +#endif + #include #include #include struct poll_ctx { - uv_fs_poll_t* parent_handle; /* NULL if parent has been stopped or closed */ + uv_fs_poll_t* parent_handle; int busy_polling; unsigned int interval; uint64_t start_time; @@ -36,6 +44,7 @@ struct poll_ctx { uv_timer_t timer_handle; uv_fs_t fs_req; /* TODO(bnoordhuis) mark fs_req internal */ uv_stat_t statbuf; + struct poll_ctx* previous; /* context from previous start()..stop() period */ char path[1]; /* variable length */ }; @@ -49,6 +58,7 @@ static uv_stat_t zero_statbuf; int uv_fs_poll_init(uv_loop_t* loop, uv_fs_poll_t* handle) { uv__handle_init(loop, (uv_handle_t*)handle, UV_FS_POLL); + handle->poll_ctx = NULL; return 0; } @@ -62,7 +72,7 @@ int uv_fs_poll_start(uv_fs_poll_t* handle, size_t len; int err; - if (uv__is_active(handle)) + if (uv_is_active((uv_handle_t*)handle)) return 0; loop = handle->loop; @@ -90,6 +100,8 @@ int uv_fs_poll_start(uv_fs_poll_t* handle, if (err < 0) goto error; + if (handle->poll_ctx != NULL) + ctx->previous = handle->poll_ctx; handle->poll_ctx = ctx; uv__handle_start(handle); @@ -104,19 +116,17 @@ error: int uv_fs_poll_stop(uv_fs_poll_t* handle) { struct poll_ctx* ctx; - if (!uv__is_active(handle)) + if (!uv_is_active((uv_handle_t*)handle)) return 0; ctx = handle->poll_ctx; assert(ctx != NULL); - assert(ctx->parent_handle != NULL); - ctx->parent_handle = NULL; - handle->poll_ctx = NULL; + assert(ctx->parent_handle == handle); /* Close the timer if it's active. If it's inactive, there's a stat request * in progress and poll_cb will take care of the cleanup. */ - if (uv__is_active(&ctx->timer_handle)) + if (uv_is_active((uv_handle_t*)&ctx->timer_handle)) uv_close((uv_handle_t*)&ctx->timer_handle, timer_close_cb); uv__handle_stop(handle); @@ -129,7 +139,7 @@ int uv_fs_poll_getpath(uv_fs_poll_t* handle, char* buffer, size_t* size) { struct poll_ctx* ctx; size_t required_len; - if (!uv__is_active(handle)) { + if (!uv_is_active((uv_handle_t*)handle)) { *size = 0; return UV_EINVAL; } @@ -153,6 +163,9 @@ int uv_fs_poll_getpath(uv_fs_poll_t* handle, char* buffer, size_t* size) { void uv__fs_poll_close(uv_fs_poll_t* handle) { uv_fs_poll_stop(handle); + + if (handle->poll_ctx == NULL) + uv__make_close_pending((uv_handle_t*)handle); } @@ -173,14 +186,13 @@ static void poll_cb(uv_fs_t* req) { uv_stat_t* statbuf; struct poll_ctx* ctx; uint64_t interval; + uv_fs_poll_t* handle; ctx = container_of(req, struct poll_ctx, fs_req); + handle = ctx->parent_handle; - if (ctx->parent_handle == NULL) { /* handle has been stopped or closed */ - uv_close((uv_handle_t*)&ctx->timer_handle, timer_close_cb); - uv_fs_req_cleanup(req); - return; - } + if (!uv_is_active((uv_handle_t*)handle) || uv__is_closing(handle)) + goto out; if (req->result != 0) { if (ctx->busy_polling != req->result) { @@ -205,7 +217,7 @@ static void poll_cb(uv_fs_t* req) { out: uv_fs_req_cleanup(req); - if (ctx->parent_handle == NULL) { /* handle has been stopped by callback */ + if (!uv_is_active((uv_handle_t*)handle) || uv__is_closing(handle)) { uv_close((uv_handle_t*)&ctx->timer_handle, timer_close_cb); return; } @@ -219,8 +231,27 @@ out: } -static void timer_close_cb(uv_handle_t* handle) { - uv__free(container_of(handle, struct poll_ctx, timer_handle)); +static void timer_close_cb(uv_handle_t* timer) { + struct poll_ctx* ctx; + struct poll_ctx* it; + struct poll_ctx* last; + uv_fs_poll_t* handle; + + ctx = container_of(timer, struct poll_ctx, timer_handle); + handle = ctx->parent_handle; + if (ctx == handle->poll_ctx) { + handle->poll_ctx = ctx->previous; + if (handle->poll_ctx == NULL && uv__is_closing(handle)) + uv__make_close_pending((uv_handle_t*)handle); + } else { + for (last = handle->poll_ctx, it = last->previous; + it != ctx; + last = it, it = it->previous) { + assert(last->previous != NULL); + } + last->previous = ctx->previous; + } + uv__free(ctx); } diff --git a/src/threadpool.c b/src/threadpool.c index 4258933..7aa5755 100644 --- a/src/threadpool.c +++ b/src/threadpool.c @@ -27,7 +27,7 @@ #include -#define MAX_THREADPOOL_SIZE 128 +#define MAX_THREADPOOL_SIZE 1024 static uv_once_t once = UV_ONCE_INIT; static uv_cond_t cond; diff --git a/src/unix/aix.c b/src/unix/aix.c index 337e58e..1f36926 100644 --- a/src/unix/aix.c +++ b/src/unix/aix.c @@ -344,6 +344,11 @@ uint64_t uv_get_total_memory(void) { } +uint64_t uv_get_constrained_memory(void) { + return 0; /* Memory constraints are unknown. */ +} + + void uv_loadavg(double avg[3]) { perfstat_cpu_total_t ps_total; int result = perfstat_cpu_total(NULL, &ps_total, sizeof(ps_total), 1); @@ -1041,6 +1046,7 @@ void uv__platform_invalidate_fd(uv_loop_t* loop, int fd) { struct poll_ctl pc; assert(loop->watchers != NULL); + assert(fd >= 0); events = (struct pollfd*) loop->watchers[loop->nwatchers]; nfds = (uintptr_t) loop->watchers[loop->nwatchers + 1]; diff --git a/src/unix/async.c b/src/unix/async.c index 0b450ae..a5c47bc 100644 --- a/src/unix/async.c +++ b/src/unix/async.c @@ -61,14 +61,43 @@ int uv_async_send(uv_async_t* handle) { if (ACCESS_ONCE(int, handle->pending) != 0) return 0; - if (cmpxchgi(&handle->pending, 0, 1) == 0) - uv__async_send(handle->loop); + /* Tell the other thread we're busy with the handle. */ + if (cmpxchgi(&handle->pending, 0, 1) != 0) + return 0; + + /* Wake up the other thread's event loop. */ + uv__async_send(handle->loop); + + /* Tell the other thread we're done. */ + if (cmpxchgi(&handle->pending, 1, 2) != 1) + abort(); return 0; } +/* Only call this from the event loop thread. */ +static int uv__async_spin(uv_async_t* handle) { + int rc; + + for (;;) { + /* rc=0 -- handle is not pending. + * rc=1 -- handle is pending, other thread is still working with it. + * rc=2 -- handle is pending, other thread is done. + */ + rc = cmpxchgi(&handle->pending, 2, 0); + + if (rc != 1) + return rc; + + /* Other thread is busy with this handle, spin until it's done. */ + cpu_relax(); + } +} + + void uv__async_close(uv_async_t* handle) { + uv__async_spin(handle); QUEUE_REMOVE(&handle->queue); uv__handle_stop(handle); } @@ -109,8 +138,8 @@ static void uv__async_io(uv_loop_t* loop, uv__io_t* w, unsigned int events) { QUEUE_REMOVE(q); QUEUE_INSERT_TAIL(&loop->async_handles, q); - if (cmpxchgi(&h->pending, 1, 0) == 0) - continue; + if (0 == uv__async_spin(h)) + continue; /* Not pending. */ if (h->async_cb == NULL) continue; diff --git a/src/unix/atomic-ops.h b/src/unix/atomic-ops.h index 7cac1f9..541a6c8 100644 --- a/src/unix/atomic-ops.h +++ b/src/unix/atomic-ops.h @@ -23,7 +23,6 @@ #endif UV_UNUSED(static int cmpxchgi(int* ptr, int oldval, int newval)); -UV_UNUSED(static long cmpxchgl(long* ptr, long oldval, long newval)); UV_UNUSED(static void cpu_relax(void)); /* Prefer hand-rolled assembly over the gcc builtins because the latter also @@ -49,43 +48,7 @@ UV_UNUSED(static int cmpxchgi(int* ptr, int oldval, int newval)) { else return op4; #elif defined(__SUNPRO_C) || defined(__SUNPRO_CC) - return atomic_cas_uint(ptr, oldval, newval); -#else - return __sync_val_compare_and_swap(ptr, oldval, newval); -#endif -} - -UV_UNUSED(static long cmpxchgl(long* ptr, long oldval, long newval)) { -#if defined(__i386__) || defined(__x86_64__) - long out; - __asm__ __volatile__ ("lock; cmpxchg %2, %1;" - : "=a" (out), "+m" (*(volatile long*) ptr) - : "r" (newval), "0" (oldval) - : "memory"); - return out; -#elif defined(_AIX) && defined(__xlC__) - const long out = (*(volatile int*) ptr); -# if defined(__64BIT__) - __compare_and_swaplp(ptr, &oldval, newval); -# else - __compare_and_swap(ptr, &oldval, newval); -# endif /* if defined(__64BIT__) */ - return out; -#elif defined (__MVS__) -#ifdef _LP64 - unsigned long long op4; - if (__plo_CSSTGR(ptr, (unsigned long long*) &oldval, newval, - (unsigned long long*) ptr, *ptr, &op4)) -#else - unsigned long op4; - if (__plo_CSST(ptr, (unsigned int*) &oldval, newval, - (unsigned int*) ptr, *ptr, &op4)) -#endif - return oldval; - else - return op4; -#elif defined(__SUNPRO_C) || defined(__SUNPRO_CC) - return atomic_cas_ulong(ptr, oldval, newval); + return atomic_cas_uint((uint_t *)ptr, (uint_t)oldval, (uint_t)newval); #else return __sync_val_compare_and_swap(ptr, oldval, newval); #endif diff --git a/src/unix/bsd-ifaddrs.c b/src/unix/bsd-ifaddrs.c index 3c2253f..0d7bbe6 100644 --- a/src/unix/bsd-ifaddrs.c +++ b/src/unix/bsd-ifaddrs.c @@ -31,6 +31,10 @@ #include #endif +#if defined(__HAIKU__) +#define IFF_RUNNING IFF_LINK +#endif + static int uv__ifaddr_exclude(struct ifaddrs *ent, int exclude_type) { if (!((ent->ifa_flags & IFF_UP) && (ent->ifa_flags & IFF_RUNNING))) return 1; @@ -45,7 +49,8 @@ static int uv__ifaddr_exclude(struct ifaddrs *ent, int exclude_type) { if (exclude_type == UV__EXCLUDE_IFPHYS) return (ent->ifa_addr->sa_family != AF_LINK); #endif -#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__DragonFly__) +#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__DragonFly__) || \ + defined(__HAIKU__) /* * On BSD getifaddrs returns information related to the raw underlying * devices. We're not interested in this information. @@ -84,7 +89,8 @@ int uv_interface_addresses(uv_interface_address_t** addresses, int* count) { return 0; } - *addresses = uv__malloc(*count * sizeof(**addresses)); + /* Make sure the memory is initiallized to zero using calloc() */ + *addresses = uv__calloc(*count, sizeof(**addresses)); if (*addresses == NULL) { freeifaddrs(addrs); @@ -116,6 +122,7 @@ int uv_interface_addresses(uv_interface_address_t** addresses, int* count) { address++; } +#if !(defined(__CYGWIN__) || defined(__MSYS__)) /* Fill in physical addresses for each interface */ for (ent = addrs; ent != NULL; ent = ent->ifa_next) { if (uv__ifaddr_exclude(ent, UV__EXCLUDE_IFPHYS)) @@ -124,20 +131,15 @@ int uv_interface_addresses(uv_interface_address_t** addresses, int* count) { address = *addresses; for (i = 0; i < *count; i++) { -#if defined(__CYGWIN__) || defined(__MSYS__) - memset(address->phys_addr, 0, sizeof(address->phys_addr)); -#else if (strcmp(address->name, ent->ifa_name) == 0) { struct sockaddr_dl* sa_addr; sa_addr = (struct sockaddr_dl*)(ent->ifa_addr); memcpy(address->phys_addr, LLADDR(sa_addr), sizeof(address->phys_addr)); - } else { - memset(address->phys_addr, 0, sizeof(address->phys_addr)); } -#endif address++; } } +#endif freeifaddrs(addrs); diff --git a/src/unix/core.c b/src/unix/core.c index cd57ce2..52896f9 100644 --- a/src/unix/core.c +++ b/src/unix/core.c @@ -41,9 +41,9 @@ #include /* getrusage */ #include #include +#include #ifdef __sun -# include /* MAXHOSTNAMELEN on Solaris */ # include # include # include @@ -88,13 +88,8 @@ #include #endif -#if !defined(__MVS__) -#include /* MAXHOSTNAMELEN on Linux and the BSDs */ -#endif - -/* Fallback for the maximum hostname length */ -#ifndef MAXHOSTNAMELEN -# define MAXHOSTNAMELEN 256 +#if defined(__linux__) +#include #endif static int uv__run_pending(uv_loop_t* loop); @@ -171,7 +166,9 @@ void uv_close(uv_handle_t* handle, uv_close_cb close_cb) { case UV_FS_POLL: uv__fs_poll_close((uv_fs_poll_t*)handle); - break; + /* Poll handles use file system requests, and one of them may still be + * running. The poll code will call uv__make_close_pending() for us. */ + return; case UV_SIGNAL: uv__signal_close((uv_signal_t*) handle); @@ -517,6 +514,34 @@ skip: } +/* close() on macos has the "interesting" quirk that it fails with EINTR + * without closing the file descriptor when a thread is in the cancel state. + * That's why libuv calls close$NOCANCEL() instead. + * + * glibc on linux has a similar issue: close() is a cancellation point and + * will unwind the thread when it's in the cancel state. Work around that + * by making the system call directly. Musl libc is unaffected. + */ +int uv__close_nocancel(int fd) { +#if defined(__APPLE__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdollar-in-identifier-extension" +#if defined(__LP64__) + extern int close$NOCANCEL(int); + return close$NOCANCEL(fd); +#else + extern int close$NOCANCEL$UNIX2003(int); + return close$NOCANCEL$UNIX2003(fd); +#endif +#pragma GCC diagnostic pop +#elif defined(__linux__) + return syscall(SYS_close, fd); +#else + return close(fd); +#endif +} + + int uv__close_nocheckstdio(int fd) { int saved_errno; int rc; @@ -524,7 +549,7 @@ int uv__close_nocheckstdio(int fd) { assert(fd > -1); /* Catch uninitialized io_watcher.fd bugs. */ saved_errno = errno; - rc = close(fd); + rc = uv__close_nocancel(fd); if (rc == -1) { rc = UV__ERR(errno); if (rc == UV_EINTR || rc == UV__ERR(EINPROGRESS)) @@ -559,7 +584,7 @@ int uv__nonblock_ioctl(int fd, int set) { } -#if !defined(__CYGWIN__) && !defined(__MSYS__) +#if !defined(__CYGWIN__) && !defined(__MSYS__) && !defined(__HAIKU__) int uv__cloexec_ioctl(int fd, int set) { int r; @@ -892,7 +917,8 @@ void uv__io_close(uv_loop_t* loop, uv__io_t* w) { QUEUE_REMOVE(&w->pending_queue); /* Remove stale events for this file descriptor */ - uv__platform_invalidate_fd(loop, w->fd); + if (w->fd != -1) + uv__platform_invalidate_fd(loop, w->fd); } @@ -926,7 +952,7 @@ int uv_getrusage(uv_rusage_t* rusage) { rusage->ru_stime.tv_sec = usage.ru_stime.tv_sec; rusage->ru_stime.tv_usec = usage.ru_stime.tv_usec; -#if !defined(__MVS__) +#if !defined(__MVS__) && !defined(__HAIKU__) rusage->ru_maxrss = usage.ru_maxrss; rusage->ru_ixrss = usage.ru_ixrss; rusage->ru_idrss = usage.ru_idrss; @@ -1291,7 +1317,7 @@ int uv_os_gethostname(char* buffer, size_t* size) { instead by creating a large enough buffer and comparing the hostname length to the size input. */ - char buf[MAXHOSTNAMELEN + 1]; + char buf[UV_MAXHOSTNAMESIZE]; size_t len; if (buffer == NULL || size == NULL || *size == 0) @@ -1414,3 +1440,39 @@ error: buffer->machine[0] = '\0'; return r; } + +int uv__getsockpeername(const uv_handle_t* handle, + uv__peersockfunc func, + struct sockaddr* name, + int* namelen) { + socklen_t socklen; + uv_os_fd_t fd; + int r; + + r = uv_fileno(handle, &fd); + if (r < 0) + return r; + + /* sizeof(socklen_t) != sizeof(int) on some systems. */ + socklen = (socklen_t) *namelen; + + if (func(fd, name, &socklen)) + return UV__ERR(errno); + + *namelen = (int) socklen; + return 0; +} + +int uv_gettimeofday(uv_timeval64_t* tv) { + struct timeval time; + + if (tv == NULL) + return UV_EINVAL; + + if (gettimeofday(&time, NULL) != 0) + return UV__ERR(errno); + + tv->tv_sec = (int64_t) time.tv_sec; + tv->tv_usec = (int32_t) time.tv_usec; + return 0; +} diff --git a/src/unix/darwin.c b/src/unix/darwin.c index 31ad8a9..e4cd8ff 100644 --- a/src/unix/darwin.c +++ b/src/unix/darwin.c @@ -117,6 +117,11 @@ uint64_t uv_get_total_memory(void) { } +uint64_t uv_get_constrained_memory(void) { + return 0; /* Memory constraints are unknown. */ +} + + void uv_loadavg(double avg[3]) { struct loadavg info; size_t size = sizeof(info); diff --git a/src/unix/freebsd.c b/src/unix/freebsd.c index 0f729cf..7de88d6 100644 --- a/src/unix/freebsd.c +++ b/src/unix/freebsd.c @@ -137,6 +137,11 @@ uint64_t uv_get_total_memory(void) { } +uint64_t uv_get_constrained_memory(void) { + return 0; /* Memory constraints are unknown. */ +} + + void uv_loadavg(double avg[3]) { struct loadavg info; size_t size = sizeof(info); diff --git a/src/unix/fs.c b/src/unix/fs.c index a0bd70d..0d6bfc6 100644 --- a/src/unix/fs.c +++ b/src/unix/fs.c @@ -47,7 +47,7 @@ #if defined(__DragonFly__) || \ defined(__FreeBSD__) || \ - defined(__FreeBSD_kernel_) || \ + defined(__FreeBSD_kernel__) || \ defined(__OpenBSD__) || \ defined(__NetBSD__) # define HAVE_PREADV 1 @@ -60,7 +60,6 @@ #endif #if defined(__APPLE__) -# include # include #elif defined(__linux__) && !defined(FICLONE) # include @@ -143,19 +142,34 @@ extern char *mkdtemp(char *template); /* See issue #740 on AIX < 7 */ while (0) +static int uv__fs_close(int fd) { + int rc; + + rc = uv__close_nocancel(fd); + if (rc == -1) + if (errno == EINTR || errno == EINPROGRESS) + rc = 0; /* The close is in progress, not an error. */ + + return rc; +} + + static ssize_t uv__fs_fsync(uv_fs_t* req) { #if defined(__APPLE__) /* Apple's fdatasync and fsync explicitly do NOT flush the drive write cache * to the drive platters. This is in contrast to Linux's fdatasync and fsync * which do, according to recent man pages. F_FULLFSYNC is Apple's equivalent * for flushing buffered data to permanent storage. If F_FULLFSYNC is not - * supported by the file system we should fall back to fsync(). This is the - * same approach taken by sqlite. + * supported by the file system we fall back to F_BARRIERFSYNC or fsync(). + * This is the same approach taken by sqlite, except sqlite does not issue + * an F_BARRIERFSYNC call. */ int r; r = fcntl(req->file, F_FULLFSYNC); if (r != 0) + r = fcntl(req->file, F_BARRIERFSYNC); /* fsync + barrier */ + if (r != 0) r = fsync(req->file); return r; #else @@ -178,7 +192,8 @@ static ssize_t uv__fs_fdatasync(uv_fs_t* req) { static ssize_t uv__fs_futime(uv_fs_t* req) { #if defined(__linux__) \ - || defined(_AIX71) + || defined(_AIX71) \ + || defined(__HAIKU__) /* utimesat() has nanosecond resolution but we stick to microseconds * for the sake of consistency with other platforms. */ @@ -317,6 +332,18 @@ done: req->bufs = NULL; req->nbufs = 0; +#ifdef __PASE__ + /* PASE returns EOPNOTSUPP when reading a directory, convert to EISDIR */ + if (result == -1 && errno == EOPNOTSUPP) { + struct stat buf; + ssize_t rc; + rc = fstat(req->file, &buf); + if (rc == 0 && S_ISDIR(buf.st_mode)) { + errno = EISDIR; + } + } +#endif + return result; } @@ -339,7 +366,7 @@ static int uv__fs_scandir_sort(UV_CONST_DIRENT** a, UV_CONST_DIRENT** b) { static ssize_t uv__fs_scandir(uv_fs_t* req) { - uv__dirent_t **dents; + uv__dirent_t** dents; int n; dents = NULL; @@ -363,6 +390,87 @@ static ssize_t uv__fs_scandir(uv_fs_t* req) { return n; } +static int uv__fs_opendir(uv_fs_t* req) { + uv_dir_t* dir; + + dir = uv__malloc(sizeof(*dir)); + if (dir == NULL) + goto error; + + dir->dir = opendir(req->path); + if (dir->dir == NULL) + goto error; + + req->ptr = dir; + return 0; + +error: + uv__free(dir); + req->ptr = NULL; + return -1; +} + +static int uv__fs_readdir(uv_fs_t* req) { + uv_dir_t* dir; + uv_dirent_t* dirent; + struct dirent* res; + unsigned int dirent_idx; + unsigned int i; + + dir = req->ptr; + dirent_idx = 0; + + while (dirent_idx < dir->nentries) { + /* readdir() returns NULL on end of directory, as well as on error. errno + is used to differentiate between the two conditions. */ + errno = 0; + res = readdir(dir->dir); + + if (res == NULL) { + if (errno != 0) + goto error; + break; + } + + if (strcmp(res->d_name, ".") == 0 || strcmp(res->d_name, "..") == 0) + continue; + + dirent = &dir->dirents[dirent_idx]; + dirent->name = uv__strdup(res->d_name); + + if (dirent->name == NULL) + goto error; + + dirent->type = uv__fs_get_dirent_type(res); + ++dirent_idx; + } + + return dirent_idx; + +error: + for (i = 0; i < dirent_idx; ++i) { + uv__free((char*) dir->dirents[i].name); + dir->dirents[i].name = NULL; + } + + return -1; +} + +static int uv__fs_closedir(uv_fs_t* req) { + uv_dir_t* dir; + + dir = req->ptr; + + if (dir->dir != NULL) { + closedir(dir->dir); + dir->dir = NULL; + } + + uv__free(req->ptr); + req->ptr = NULL; + return 0; +} + #if defined(_POSIX_PATH_MAX) # define UV__FS_PATH_MAX _POSIX_PATH_MAX #elif defined(PATH_MAX) @@ -692,7 +800,8 @@ static ssize_t uv__fs_sendfile(uv_fs_t* req) { static ssize_t uv__fs_utime(uv_fs_t* req) { #if defined(__linux__) \ || defined(_AIX71) \ - || defined(__sun) + || defined(__sun) \ + || defined(__HAIKU__) /* utimesat() has nanosecond resolution but we stick to microseconds * for the sake of consistency with other platforms. */ @@ -796,45 +905,6 @@ done: } static ssize_t uv__fs_copyfile(uv_fs_t* req) { -#if defined(__APPLE__) && !TARGET_OS_IPHONE - /* On macOS, use the native copyfile(3). */ - static int can_clone; - copyfile_flags_t flags; - char buf[64]; - size_t len; - int major; - - flags = COPYFILE_ALL; - - if (req->flags & UV_FS_COPYFILE_EXCL) - flags |= COPYFILE_EXCL; - - /* Check OS version. Cloning is only supported on macOS >= 10.12. */ - if (req->flags & UV_FS_COPYFILE_FICLONE_FORCE) { - if (can_clone == 0) { - len = sizeof(buf); - if (sysctlbyname("kern.osrelease", buf, &len, NULL, 0)) - return UV__ERR(errno); - - if (1 != sscanf(buf, "%d", &major)) - abort(); - - can_clone = -1 + 2 * (major >= 16); /* macOS >= 10.12 */ - } - - if (can_clone < 0) - return UV_ENOSYS; - } - - /* copyfile() simply ignores COPYFILE_CLONE if it's not supported. */ - if (req->flags & UV_FS_COPYFILE_FICLONE) - flags |= 1 << 24; /* COPYFILE_CLONE */ - - if (req->flags & UV_FS_COPYFILE_FICLONE_FORCE) - flags |= 1 << 25; /* COPYFILE_CLONE_FORCE */ - - return copyfile(req->path, req->new_path, NULL, flags); -#else uv_fs_t fs_req; uv_file srcfd; uv_file dstfd; @@ -961,7 +1031,6 @@ out: errno = UV__ERR(result); return -1; -#endif } static void uv__to_stat(struct stat* src, uv_stat_t* dst) { @@ -1041,10 +1110,84 @@ static void uv__to_stat(struct stat* src, uv_stat_t* dst) { } +static int uv__fs_statx(int fd, + const char* path, + int is_fstat, + int is_lstat, + uv_stat_t* buf) { + STATIC_ASSERT(UV_ENOSYS != -1); +#ifdef __linux__ + static int no_statx; + struct uv__statx statxbuf; + int dirfd; + int flags; + int mode; + int rc; + + if (no_statx) + return UV_ENOSYS; + + dirfd = AT_FDCWD; + flags = 0; /* AT_STATX_SYNC_AS_STAT */ + mode = 0xFFF; /* STATX_BASIC_STATS + STATX_BTIME */ + + if (is_fstat) { + dirfd = fd; + flags |= 0x1000; /* AT_EMPTY_PATH */ + } + + if (is_lstat) + flags |= AT_SYMLINK_NOFOLLOW; + + rc = uv__statx(dirfd, path, flags, mode, &statxbuf); + + if (rc == -1) { + /* EPERM happens when a seccomp filter rejects the system call. + * Has been observed with libseccomp < 2.3.3 and docker < 18.04. + */ + if (errno != EINVAL && errno != EPERM && errno != ENOSYS) + return -1; + + no_statx = 1; + return UV_ENOSYS; + } + + buf->st_dev = 256 * statxbuf.stx_dev_major + statxbuf.stx_dev_minor; + buf->st_mode = statxbuf.stx_mode; + buf->st_nlink = statxbuf.stx_nlink; + buf->st_uid = statxbuf.stx_uid; + buf->st_gid = statxbuf.stx_gid; + buf->st_rdev = statxbuf.stx_rdev_major; + buf->st_ino = statxbuf.stx_ino; + buf->st_size = statxbuf.stx_size; + buf->st_blksize = statxbuf.stx_blksize; + buf->st_blocks = statxbuf.stx_blocks; + buf->st_atim.tv_sec = statxbuf.stx_atime.tv_sec; + buf->st_atim.tv_nsec = statxbuf.stx_atime.tv_nsec; + buf->st_mtim.tv_sec = statxbuf.stx_mtime.tv_sec; + buf->st_mtim.tv_nsec = statxbuf.stx_mtime.tv_nsec; + buf->st_ctim.tv_sec = statxbuf.stx_ctime.tv_sec; + buf->st_ctim.tv_nsec = statxbuf.stx_ctime.tv_nsec; + buf->st_birthtim.tv_sec = statxbuf.stx_btime.tv_sec; + buf->st_birthtim.tv_nsec = statxbuf.stx_btime.tv_nsec; + buf->st_flags = 0; + buf->st_gen = 0; + + return 0; +#else + return UV_ENOSYS; +#endif /* __linux__ */ +} + + static int uv__fs_stat(const char *path, uv_stat_t *buf) { struct stat pbuf; int ret; + ret = uv__fs_statx(-1, path, /* is_fstat */ 0, /* is_lstat */ 0, buf); + if (ret != UV_ENOSYS) + return ret; + ret = stat(path, &pbuf); if (ret == 0) uv__to_stat(&pbuf, buf); @@ -1057,6 +1200,10 @@ static int uv__fs_lstat(const char *path, uv_stat_t *buf) { struct stat pbuf; int ret; + ret = uv__fs_statx(-1, path, /* is_fstat */ 0, /* is_lstat */ 1, buf); + if (ret != UV_ENOSYS) + return ret; + ret = lstat(path, &pbuf); if (ret == 0) uv__to_stat(&pbuf, buf); @@ -1069,6 +1216,10 @@ static int uv__fs_fstat(int fd, uv_stat_t *buf) { struct stat pbuf; int ret; + ret = uv__fs_statx(fd, "", /* is_fstat */ 1, /* is_lstat */ 0, buf); + if (ret != UV_ENOSYS) + return ret; + ret = fstat(fd, &pbuf); if (ret == 0) uv__to_stat(&pbuf, buf); @@ -1157,7 +1308,7 @@ static void uv__fs_work(struct uv__work* w) { X(ACCESS, access(req->path, req->flags)); X(CHMOD, chmod(req->path, req->mode)); X(CHOWN, chown(req->path, req->uid, req->gid)); - X(CLOSE, close(req->file)); + X(CLOSE, uv__fs_close(req->file)); X(COPYFILE, uv__fs_copyfile(req)); X(FCHMOD, fchmod(req->file, req->mode)); X(FCHOWN, fchown(req->file, req->uid, req->gid)); @@ -1174,6 +1325,9 @@ static void uv__fs_work(struct uv__work* w) { X(OPEN, uv__fs_open(req)); X(READ, uv__fs_read(req)); X(SCANDIR, uv__fs_scandir(req)); + X(OPENDIR, uv__fs_opendir(req)); + X(READDIR, uv__fs_readdir(req)); + X(CLOSEDIR, uv__fs_closedir(req)); X(READLINK, uv__fs_readlink(req)); X(REALPATH, uv__fs_realpath(req)); X(RENAME, rename(req->path, req->new_path)); @@ -1444,6 +1598,40 @@ int uv_fs_scandir(uv_loop_t* loop, POST; } +int uv_fs_opendir(uv_loop_t* loop, + uv_fs_t* req, + const char* path, + uv_fs_cb cb) { + INIT(OPENDIR); + PATH; + POST; +} + +int uv_fs_readdir(uv_loop_t* loop, + uv_fs_t* req, + uv_dir_t* dir, + uv_fs_cb cb) { + INIT(READDIR); + + if (dir == NULL || dir->dir == NULL || dir->dirents == NULL) + return UV_EINVAL; + + req->ptr = dir; + POST; +} + +int uv_fs_closedir(uv_loop_t* loop, + uv_fs_t* req, + uv_dir_t* dir, + uv_fs_cb cb) { + INIT(CLOSEDIR); + + if (dir == NULL) + return UV_EINVAL; + + req->ptr = dir; + POST; +} int uv_fs_readlink(uv_loop_t* loop, uv_fs_t* req, @@ -1584,6 +1772,9 @@ void uv_fs_req_cleanup(uv_fs_t* req) { req->path = NULL; req->new_path = NULL; + if (req->fs_type == UV_FS_READDIR && req->ptr != NULL) + uv__fs_readdir_cleanup(req); + if (req->fs_type == UV_FS_SCANDIR && req->ptr != NULL) uv__fs_scandir_cleanup(req); @@ -1591,7 +1782,7 @@ void uv_fs_req_cleanup(uv_fs_t* req) { uv__free(req->bufs); req->bufs = NULL; - if (req->ptr != &req->statbuf) + if (req->fs_type != UV_FS_OPENDIR && req->ptr != &req->statbuf) uv__free(req->ptr); req->ptr = NULL; } diff --git a/src/unix/fsevents.c b/src/unix/fsevents.c index c430562..ddacda3 100644 --- a/src/unix/fsevents.c +++ b/src/unix/fsevents.c @@ -21,9 +21,10 @@ #include "uv.h" #include "internal.h" -#if TARGET_OS_IPHONE +#if TARGET_OS_IPHONE || MAC_OS_X_VERSION_MAX_ALLOWED < 1070 /* iOS (currently) doesn't provide the FSEvents-API (nor CoreServices) */ +/* macOS prior to 10.7 doesn't provide the full FSEvents API so use kqueue */ int uv__fsevents_init(uv_fs_event_t* handle) { return 0; diff --git a/src/unix/getaddrinfo.c b/src/unix/getaddrinfo.c index 6d23fbe..d7ca7d1 100644 --- a/src/unix/getaddrinfo.c +++ b/src/unix/getaddrinfo.c @@ -92,7 +92,9 @@ int uv__getaddrinfo_translate_error(int sys_err) { } assert(!"unknown EAI_* error code"); abort(); +#ifndef __SUNPRO_C return 0; /* Pacify compiler. */ +#endif } diff --git a/src/unix/haiku.c b/src/unix/haiku.c new file mode 100644 index 0000000..7708851 --- /dev/null +++ b/src/unix/haiku.c @@ -0,0 +1,176 @@ +/* Copyright libuv project contributors. All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +#include "uv.h" +#include "internal.h" + +#include /* find_path() */ +#include + + +void uv_loadavg(double avg[3]) { + avg[0] = 0; + avg[1] = 0; + avg[2] = 0; +} + + +int uv_exepath(char* buffer, size_t* size) { + char abspath[B_PATH_NAME_LENGTH]; + status_t status; + ssize_t abspath_len; + + if (buffer == NULL || size == NULL || *size == 0) + return UV_EINVAL; + + status = find_path(B_APP_IMAGE_SYMBOL, B_FIND_PATH_IMAGE_PATH, NULL, abspath, + sizeof(abspath)); + if (status != B_OK) + return UV__ERR(status); + + abspath_len = uv__strscpy(buffer, abspath, *size); + *size -= 1; + if (abspath_len >= 0 && *size > (size_t)abspath_len) + *size = (size_t)abspath_len; + + return 0; +} + + +uint64_t uv_get_free_memory(void) { + status_t status; + system_info sinfo; + + status = get_system_info(&sinfo); + if (status != B_OK) + return 0; + + return (sinfo.max_pages - sinfo.used_pages) * B_PAGE_SIZE; +} + + +uint64_t uv_get_total_memory(void) { + status_t status; + system_info sinfo; + + status = get_system_info(&sinfo); + if (status != B_OK) + return 0; + + return sinfo.max_pages * B_PAGE_SIZE; +} + + +uint64_t uv_get_constrained_memory(void) { + return 0; /* Memory constraints are unknown. */ +} + + +int uv_resident_set_memory(size_t* rss) { + area_info area; + ssize_t cookie; + status_t status; + thread_info thread; + + status = get_thread_info(find_thread(NULL), &thread); + if (status != B_OK) + return UV__ERR(status); + + cookie = 0; + *rss = 0; + while (get_next_area_info(thread.team, &cookie, &area) == B_OK) + *rss += area.ram_size; + + return 0; +} + + +int uv_uptime(double* uptime) { + /* system_time() returns time since booting in microseconds */ + *uptime = (double)system_time() / 1000000; + return 0; +} + + +int uv_cpu_info(uv_cpu_info_t** cpu_infos, int* count) { + cpu_topology_node_info* topology_infos; + int i; + status_t status; + system_info system; + uint32_t topology_count; + uint64_t cpuspeed; + uv_cpu_info_t* cpu_info; + + if (cpu_infos == NULL || count == NULL) + return UV_EINVAL; + + status = get_cpu_topology_info(NULL, &topology_count); + if (status != B_OK) + return UV__ERR(status); + + topology_infos = uv__malloc(topology_count * sizeof(*topology_infos)); + if (topology_infos == NULL) + return UV_ENOMEM; + + status = get_cpu_topology_info(topology_infos, &topology_count); + if (status != B_OK) { + uv__free(topology_infos); + return UV__ERR(status); + } + + cpuspeed = 0; + for (i = 0; i < (int)topology_count; i++) { + if (topology_infos[i].type == B_TOPOLOGY_CORE) { + cpuspeed = topology_infos[i].data.core.default_frequency; + break; + } + } + + uv__free(topology_infos); + + status = get_system_info(&system); + if (status != B_OK) + return UV__ERR(status); + + *cpu_infos = uv__calloc(system.cpu_count, sizeof(**cpu_infos)); + if (*cpu_infos == NULL) + return UV_ENOMEM; + + /* CPU time and model are not exposed by Haiku. */ + cpu_info = *cpu_infos; + for (i = 0; i < (int)system.cpu_count; i++) { + cpu_info->model = uv__strdup("unknown"); + cpu_info->speed = (int)(cpuspeed / 1000000); + cpu_info++; + } + *count = system.cpu_count; + + return 0; +} + +void uv_free_cpu_info(uv_cpu_info_t* cpu_infos, int count) { + int i; + + for (i = 0; i < count; i++) + uv__free(cpu_infos[i].model); + + uv__free(cpu_infos); +} diff --git a/src/unix/ibmi.c b/src/unix/ibmi.c index 13fed6c..c7e1051 100644 --- a/src/unix/ibmi.c +++ b/src/unix/ibmi.c @@ -55,19 +55,155 @@ #include #include +#include + + +typedef struct { + int bytes_available; + int bytes_returned; + char current_date_and_time[8]; + char system_name[8]; + char elapsed_time[6]; + char restricted_state_flag; + char reserved; + int percent_processing_unit_used; + int jobs_in_system; + int percent_permanent_addresses; + int percent_temporary_addresses; + int system_asp; + int percent_system_asp_used; + int total_auxiliary_storage; + int current_unprotected_storage_used; + int maximum_unprotected_storage_used; + int percent_db_capability; + int main_storage_size; + int number_of_partitions; + int partition_identifier; + int reserved1; + int current_processing_capacity; + char processor_sharing_attribute; + char reserved2[3]; + int number_of_processors; + int active_jobs_in_system; + int active_threads_in_system; + int maximum_jobs_in_system; + int percent_temporary_256mb_segments_used; + int percent_temporary_4gb_segments_used; + int percent_permanent_256mb_segments_used; + int percent_permanent_4gb_segments_used; + int percent_current_interactive_performance; + int percent_uncapped_cpu_capacity_used; + int percent_shared_processor_pool_used; + long main_storage_size_long; +} SSTS0200; + + +static int get_ibmi_system_status(SSTS0200* rcvr) { + /* rcvrlen is input parameter 2 to QWCRSSTS */ + unsigned int rcvrlen = sizeof(*rcvr); + + /* format is input parameter 3 to QWCRSSTS ("SSTS0200" in EBCDIC) */ + unsigned char format[] = {0xE2, 0xE2, 0xE3, 0xE2, 0xF0, 0xF2, 0xF0, 0xF0}; + + /* reset_status is input parameter 4 to QWCRSSTS ("*NO " in EBCDIC) */ + unsigned char reset_status[] = { + 0x5C, 0xD5, 0xD6, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 + }; + + /* errcode is input parameter 5 to QWCRSSTS */ + struct _errcode { + int bytes_provided; + int bytes_available; + char msgid[7]; + } errcode; + + /* qwcrssts_pointer is the 16-byte tagged system pointer to QWCRSSTS */ + ILEpointer __attribute__((aligned(16))) qwcrssts_pointer; + + /* qwcrssts_argv is the array of argument pointers to QWCRSSTS */ + void* qwcrssts_argv[6]; + + /* Set the IBM i pointer to the QSYS/QWCRSSTS *PGM object */ + int rc = _RSLOBJ2(&qwcrssts_pointer, RSLOBJ_TS_PGM, "QWCRSSTS", "QSYS"); + + if (rc != 0) + return rc; + + /* initialize the QWCRSSTS returned info structure */ + memset(rcvr, 0, sizeof(*rcvr)); + + /* initialize the QWCRSSTS error code structure */ + memset(&errcode, 0, sizeof(errcode)); + errcode.bytes_provided = sizeof(errcode); + + /* initialize the array of argument pointers for the QWCRSSTS API */ + qwcrssts_argv[0] = rcvr; + qwcrssts_argv[1] = &rcvrlen; + qwcrssts_argv[2] = &format; + qwcrssts_argv[3] = &reset_status; + qwcrssts_argv[4] = &errcode; + qwcrssts_argv[5] = NULL; + + /* Call the IBM i QWCRSSTS API from PASE */ + rc = _PGMCALL(&qwcrssts_pointer, (void**)&qwcrssts_argv, 0); + + return rc; +} + + uint64_t uv_get_free_memory(void) { - return (uint64_t) sysconf(_SC_PAGESIZE) * sysconf(_SC_AVPHYS_PAGES); + SSTS0200 rcvr; + + if (get_ibmi_system_status(&rcvr)) + return 0; + + /* The amount of main storage, in kilobytes, in the system. */ + uint64_t main_storage_size = rcvr.main_storage_size; + + /* The current amount of storage in use for temporary objects. + * in millions (M) of bytes. + */ + uint64_t current_unprotected_storage_used = + rcvr.current_unprotected_storage_used * 1024ULL; + + uint64_t free_storage_size = + (main_storage_size - current_unprotected_storage_used) * 1024ULL; + + return free_storage_size < 0 ? 0 : free_storage_size; } uint64_t uv_get_total_memory(void) { - return (uint64_t) sysconf(_SC_PAGESIZE) * sysconf(_SC_PHYS_PAGES); + SSTS0200 rcvr; + + if (get_ibmi_system_status(&rcvr)) + return 0; + + return (uint64_t)rcvr.main_storage_size * 1024ULL; +} + + +uint64_t uv_get_constrained_memory(void) { + return 0; /* Memory constraints are unknown. */ } void uv_loadavg(double avg[3]) { + SSTS0200 rcvr; + + if (get_ibmi_system_status(&rcvr)) { avg[0] = avg[1] = avg[2] = 0; return; + } + + /* The average (in tenths) of the elapsed time during which the processing + * units were in use. For example, a value of 411 in binary would be 41.1%. + * This percentage could be greater than 100% for an uncapped partition. + */ + double processing_unit_used_percent = + rcvr.percent_processing_unit_used / 1000.0; + + avg[0] = avg[1] = avg[2] = processing_unit_used_percent; } @@ -111,3 +247,4 @@ int uv_cpu_info(uv_cpu_info_t** cpu_infos, int* count) { return 0; } + diff --git a/src/unix/internal.h b/src/unix/internal.h index c059893..8c8ddc8 100644 --- a/src/unix/internal.h +++ b/src/unix/internal.h @@ -95,8 +95,7 @@ int uv__pthread_sigmask(int how, const sigset_t* set, sigset_t* oset); */ #if defined(__clang__) || \ defined(__GNUC__) || \ - defined(__INTEL_COMPILER) || \ - defined(__SUNPRO_C) + defined(__INTEL_COMPILER) # define UV_DESTRUCTOR(declaration) __attribute__((destructor)) declaration # define UV_UNUSED(declaration) __attribute__((unused)) declaration #else @@ -184,6 +183,7 @@ int uv__nonblock_ioctl(int fd, int set); int uv__nonblock_fcntl(int fd, int set); int uv__close(int fd); /* preserves errno */ int uv__close_nocheckstdio(int fd); +int uv__close_nocancel(int fd); int uv__socket(int domain, int type, int protocol); ssize_t uv__recvmsg(int fd, struct msghdr *msg, int flags); void uv__make_close_pending(uv_handle_t* handle); @@ -306,4 +306,11 @@ UV_UNUSED(static char* uv__basename_r(const char* path)) { int uv__inotify_fork(uv_loop_t* loop, void* old_watchers); #endif +typedef int (*uv__peersockfunc)(int, struct sockaddr*, socklen_t*); + +int uv__getsockpeername(const uv_handle_t* handle, + uv__peersockfunc func, + struct sockaddr* name, + int* namelen); + #endif /* UV_UNIX_INTERNAL_H_ */ diff --git a/src/unix/kqueue.c b/src/unix/kqueue.c index c24f96e..c04e7a4 100644 --- a/src/unix/kqueue.c +++ b/src/unix/kqueue.c @@ -59,7 +59,7 @@ int uv__kqueue_init(uv_loop_t* loop) { } -#if defined(__APPLE__) +#if defined(__APPLE__) && MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 static int uv__has_forked_with_cfrunloop; #endif @@ -70,7 +70,7 @@ int uv__io_fork(uv_loop_t* loop) { if (err) return err; -#if defined(__APPLE__) +#if defined(__APPLE__) && MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 if (loop->cf_state != NULL) { /* We cannot start another CFRunloop and/or thread in the child process; CF aborts if you try or if you try to touch the thread @@ -86,7 +86,7 @@ int uv__io_fork(uv_loop_t* loop) { uv__free(loop->cf_state); loop->cf_state = NULL; } -#endif +#endif /* #if defined(__APPLE__) && MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 */ return err; } @@ -387,6 +387,7 @@ void uv__platform_invalidate_fd(uv_loop_t* loop, int fd) { uintptr_t nfds; assert(loop->watchers != NULL); + assert(fd >= 0); events = (struct kevent*) loop->watchers[loop->nwatchers]; nfds = (uintptr_t) loop->watchers[loop->nwatchers + 1]; @@ -457,7 +458,7 @@ int uv_fs_event_start(uv_fs_event_t* handle, if (uv__is_active(handle)) return UV_EINVAL; -#if defined(__APPLE__) +#if defined(__APPLE__) && MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 /* Nullify field to perform checks later */ handle->cf_cb = NULL; handle->realpath = NULL; @@ -481,7 +482,7 @@ int uv_fs_event_start(uv_fs_event_t* handle, } return r; } -#endif /* defined(__APPLE__) */ +#endif /* #if defined(__APPLE__) && MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 */ /* TODO open asynchronously - but how do we report back errors? */ fd = open(path, O_RDONLY); @@ -489,8 +490,11 @@ int uv_fs_event_start(uv_fs_event_t* handle, return UV__ERR(errno); handle->path = uv__strdup(path); - if (handle->path == NULL) + if (handle->path == NULL) { + uv__close_nocheckstdio(fd); return UV_ENOMEM; + } + handle->cb = cb; uv__handle_start(handle); uv__io_init(&handle->event_watcher, uv__fs_event, fd); @@ -509,7 +513,7 @@ int uv_fs_event_stop(uv_fs_event_t* handle) { uv__handle_stop(handle); -#if defined(__APPLE__) +#if defined(__APPLE__) && MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 if (!uv__has_forked_with_cfrunloop) r = uv__fsevents_close(handle); #endif diff --git a/src/unix/linux-core.c b/src/unix/linux-core.c index 3341b94..b539beb 100644 --- a/src/unix/linux-core.c +++ b/src/unix/linux-core.c @@ -26,6 +26,7 @@ #include "uv.h" #include "internal.h" +#include #include #include #include @@ -79,16 +80,20 @@ static int read_times(FILE* statfile_fp, unsigned int numcpus, uv_cpu_info_t* ci); static void read_speeds(unsigned int numcpus, uv_cpu_info_t* ci); -static unsigned long read_cpufreq(unsigned int cpunum); +static uint64_t read_cpufreq(unsigned int cpunum); int uv__platform_loop_init(uv_loop_t* loop) { int fd; - fd = epoll_create1(EPOLL_CLOEXEC); + /* It was reported that EPOLL_CLOEXEC is not defined on Android API < 21, + * a.k.a. Lollipop. Since EPOLL_CLOEXEC is an alias for O_CLOEXEC on all + * architectures, we just use that instead. + */ + fd = epoll_create1(O_CLOEXEC); /* epoll_create1() can fail either because it's not implemented (old kernel) - * or because it doesn't understand the EPOLL_CLOEXEC flag. + * or because it doesn't understand the O_CLOEXEC flag. */ if (fd == -1 && (errno == ENOSYS || errno == EINVAL)) { fd = epoll_create(256); @@ -141,6 +146,7 @@ void uv__platform_invalidate_fd(uv_loop_t* loop, int fd) { uintptr_t nfds; assert(loop->watchers != NULL); + assert(fd >= 0); events = (struct epoll_event*) loop->watchers[loop->nwatchers]; nfds = (uintptr_t) loop->watchers[loop->nwatchers + 1]; @@ -714,20 +720,20 @@ static int read_models(unsigned int numcpus, uv_cpu_info_t* ci) { static int read_times(FILE* statfile_fp, unsigned int numcpus, uv_cpu_info_t* ci) { - unsigned long clock_ticks; struct uv_cpu_times_s ts; - unsigned long user; - unsigned long nice; - unsigned long sys; - unsigned long idle; - unsigned long dummy; - unsigned long irq; - unsigned int num; - unsigned int len; + uint64_t clock_ticks; + uint64_t user; + uint64_t nice; + uint64_t sys; + uint64_t idle; + uint64_t dummy; + uint64_t irq; + uint64_t num; + uint64_t len; char buf[1024]; clock_ticks = sysconf(_SC_CLK_TCK); - assert(clock_ticks != (unsigned long) -1); + assert(clock_ticks != (uint64_t) -1); assert(clock_ticks != 0); rewind(statfile_fp); @@ -760,7 +766,8 @@ static int read_times(FILE* statfile_fp, * fields, they're not allowed in C89 mode. */ if (6 != sscanf(buf + len, - "%lu %lu %lu %lu %lu %lu", + "%" PRIu64 " %" PRIu64 " %" PRIu64 + "%" PRIu64 " %" PRIu64 " %" PRIu64, &user, &nice, &sys, @@ -782,8 +789,8 @@ static int read_times(FILE* statfile_fp, } -static unsigned long read_cpufreq(unsigned int cpunum) { - unsigned long val; +static uint64_t read_cpufreq(unsigned int cpunum) { + uint64_t val; char buf[1024]; FILE* fp; @@ -796,7 +803,7 @@ static unsigned long read_cpufreq(unsigned int cpunum) { if (fp == NULL) return 0; - if (fscanf(fp, "%lu", &val) != 1) + if (fscanf(fp, "%" PRIu64, &val) != 1) val = 0; fclose(fp); @@ -859,7 +866,8 @@ int uv_interface_addresses(uv_interface_address_t** addresses, int* count) { return 0; } - *addresses = uv__malloc(*count * sizeof(**addresses)); + /* Make sure the memory is initiallized to zero using calloc() */ + *addresses = uv__calloc(*count, sizeof(**addresses)); if (!(*addresses)) { freeifaddrs(addrs); return UV_ENOMEM; @@ -898,11 +906,12 @@ int uv_interface_addresses(uv_interface_address_t** addresses, int* count) { address = *addresses; for (i = 0; i < (*count); i++) { - if (strcmp(address->name, ent->ifa_name) == 0) { + size_t namelen = strlen(ent->ifa_name); + /* Alias interface share the same physical address */ + if (strncmp(address->name, ent->ifa_name, namelen) == 0 && + (address->name[namelen] == 0 || address->name[namelen] == ':')) { sll = (struct sockaddr_ll*)ent->ifa_addr; memcpy(address->phys_addr, sll->sll_addr, sizeof(address->phys_addr)); - } else { - memset(address->phys_addr, 0, sizeof(address->phys_addr)); } address++; } @@ -932,3 +941,114 @@ void uv__set_process_title(const char* title) { prctl(PR_SET_NAME, title); /* Only copies first 16 characters. */ #endif } + + +static uint64_t uv__read_proc_meminfo(const char* what) { + uint64_t rc; + ssize_t n; + char* p; + int fd; + char buf[4096]; /* Large enough to hold all of /proc/meminfo. */ + + rc = 0; + fd = uv__open_cloexec("/proc/meminfo", O_RDONLY); + + if (fd == -1) + return 0; + + n = read(fd, buf, sizeof(buf) - 1); + + if (n <= 0) + goto out; + + buf[n] = '\0'; + p = strstr(buf, what); + + if (p == NULL) + goto out; + + p += strlen(what); + + if (1 != sscanf(p, "%" PRIu64 " kB", &rc)) + goto out; + + rc *= 1024; + +out: + + if (uv__close_nocheckstdio(fd)) + abort(); + + return rc; +} + + +uint64_t uv_get_free_memory(void) { + struct sysinfo info; + uint64_t rc; + + rc = uv__read_proc_meminfo("MemFree:"); + + if (rc != 0) + return rc; + + if (0 == sysinfo(&info)) + return (uint64_t) info.freeram * info.mem_unit; + + return 0; +} + + +uint64_t uv_get_total_memory(void) { + struct sysinfo info; + uint64_t rc; + + rc = uv__read_proc_meminfo("MemTotal:"); + + if (rc != 0) + return rc; + + if (0 == sysinfo(&info)) + return (uint64_t) info.totalram * info.mem_unit; + + return 0; +} + + +static uint64_t uv__read_cgroups_uint64(const char* cgroup, const char* param) { + char filename[256]; + uint64_t rc; + int fd; + ssize_t n; + char buf[32]; /* Large enough to hold an encoded uint64_t. */ + + snprintf(filename, 256, "/sys/fs/cgroup/%s/%s", cgroup, param); + + rc = 0; + fd = uv__open_cloexec(filename, O_RDONLY); + + if (fd < 0) + return 0; + + n = read(fd, buf, sizeof(buf) - 1); + + if (n > 0) { + buf[n] = '\0'; + sscanf(buf, "%" PRIu64, &rc); + } + + if (uv__close_nocheckstdio(fd)) + abort(); + + return rc; +} + + +uint64_t uv_get_constrained_memory(void) { + /* + * This might return 0 if there was a problem getting the memory limit from + * cgroups. This is OK because a return value of 0 signifies that the memory + * limit is unknown. + */ + return uv__read_cgroups_uint64("memory", "memory.limit_in_bytes"); +} diff --git a/src/unix/linux-syscalls.c b/src/unix/linux-syscalls.c index bfd7544..5637cf9 100644 --- a/src/unix/linux-syscalls.c +++ b/src/unix/linux-syscalls.c @@ -187,6 +187,21 @@ # endif #endif /* __NR_pwritev */ +#ifndef __NR_statx +# if defined(__x86_64__) +# define __NR_statx 332 +# elif defined(__i386__) +# define __NR_statx 383 +# elif defined(__aarch64__) +# define __NR_statx 397 +# elif defined(__arm__) +# define __NR_statx (UV_SYSCALL_BASE + 397) +# elif defined(__ppc__) +# define __NR_statx 383 +# elif defined(__s390__) +# define __NR_statx 379 +# endif +#endif /* __NR_statx */ int uv__accept4(int fd, struct sockaddr* addr, socklen_t* addrlen, int flags) { #if defined(__i386__) @@ -336,3 +351,19 @@ int uv__dup3(int oldfd, int newfd, int flags) { return errno = ENOSYS, -1; #endif } + + +int uv__statx(int dirfd, + const char* path, + int flags, + unsigned int mask, + struct uv__statx* statxbuf) { + /* __NR_statx make Android box killed by SIGSYS. + * That looks like a seccomp2 sandbox filter rejecting the system call. + */ +#if defined(__NR_statx) && !defined(__ANDROID__) + return syscall(__NR_statx, dirfd, path, flags, mask, statxbuf); +#else + return errno = ENOSYS, -1; +#endif +} diff --git a/src/unix/linux-syscalls.h b/src/unix/linux-syscalls.h index 3dfd329..7e58bfa 100644 --- a/src/unix/linux-syscalls.h +++ b/src/unix/linux-syscalls.h @@ -80,6 +80,36 @@ #define UV__IN_DELETE_SELF 0x400 #define UV__IN_MOVE_SELF 0x800 +struct uv__statx_timestamp { + int64_t tv_sec; + uint32_t tv_nsec; + int32_t unused0; +}; + +struct uv__statx { + uint32_t stx_mask; + uint32_t stx_blksize; + uint64_t stx_attributes; + uint32_t stx_nlink; + uint32_t stx_uid; + uint32_t stx_gid; + uint16_t stx_mode; + uint16_t unused0; + uint64_t stx_ino; + uint64_t stx_size; + uint64_t stx_blocks; + uint64_t stx_attributes_mask; + struct uv__statx_timestamp stx_atime; + struct uv__statx_timestamp stx_btime; + struct uv__statx_timestamp stx_ctime; + struct uv__statx_timestamp stx_mtime; + uint32_t stx_rdev_major; + uint32_t stx_rdev_minor; + uint32_t stx_dev_major; + uint32_t stx_dev_minor; + uint64_t unused1[14]; +}; + struct uv__inotify_event { int32_t wd; uint32_t mask; @@ -113,5 +143,10 @@ int uv__sendmmsg(int fd, ssize_t uv__preadv(int fd, const struct iovec *iov, int iovcnt, int64_t offset); ssize_t uv__pwritev(int fd, const struct iovec *iov, int iovcnt, int64_t offset); int uv__dup3(int oldfd, int newfd, int flags); +int uv__statx(int dirfd, + const char* path, + int flags, + unsigned int mask, + struct uv__statx* statxbuf); #endif /* UV_LINUX_SYSCALL_H_ */ diff --git a/src/unix/netbsd.c b/src/unix/netbsd.c index a2a4e52..c649bb3 100644 --- a/src/unix/netbsd.c +++ b/src/unix/netbsd.c @@ -126,6 +126,11 @@ uint64_t uv_get_total_memory(void) { } +uint64_t uv_get_constrained_memory(void) { + return 0; /* Memory constraints are unknown. */ +} + + int uv_resident_set_memory(size_t* rss) { kvm_t *kd = NULL; struct kinfo_proc2 *kinfo = NULL; diff --git a/src/unix/openbsd.c b/src/unix/openbsd.c index bffb58b..ffae768 100644 --- a/src/unix/openbsd.c +++ b/src/unix/openbsd.c @@ -136,6 +136,11 @@ uint64_t uv_get_total_memory(void) { } +uint64_t uv_get_constrained_memory(void) { + return 0; /* Memory constraints are unknown. */ +} + + int uv_resident_set_memory(size_t* rss) { struct kinfo_proc kinfo; size_t page_size = getpagesize(); diff --git a/src/unix/os390.c b/src/unix/os390.c index dc146e3..273ded7 100644 --- a/src/unix/os390.c +++ b/src/unix/os390.c @@ -356,6 +356,11 @@ uint64_t uv_get_total_memory(void) { } +uint64_t uv_get_constrained_memory(void) { + return 0; /* Memory constraints are unknown. */ +} + + int uv_resident_set_memory(size_t* rss) { char* ascb; char* rax; @@ -657,6 +662,7 @@ void uv__platform_invalidate_fd(uv_loop_t* loop, int fd) { uintptr_t nfds; assert(loop->watchers != NULL); + assert(fd >= 0); events = (struct epoll_event*) loop->watchers[loop->nwatchers]; nfds = (uintptr_t) loop->watchers[loop->nwatchers + 1]; diff --git a/src/unix/pipe.c b/src/unix/pipe.c index d3b554c..8347668 100644 --- a/src/unix/pipe.c +++ b/src/unix/pipe.c @@ -215,7 +215,7 @@ void uv_pipe_connect(uv_connect_t* req, } if (err == 0) - uv__io_start(handle->loop, &handle->io_watcher, POLLIN | POLLOUT); + uv__io_start(handle->loop, &handle->io_watcher, POLLOUT); out: handle->delayed_error = err; @@ -233,9 +233,6 @@ out: } -typedef int (*uv__peersockfunc)(int, struct sockaddr*, socklen_t*); - - static int uv__pipe_getsockpeername(const uv_pipe_t* handle, uv__peersockfunc func, char* buffer, @@ -246,10 +243,13 @@ static int uv__pipe_getsockpeername(const uv_pipe_t* handle, addrlen = sizeof(sa); memset(&sa, 0, addrlen); - err = func(uv__stream_fd(handle), (struct sockaddr*) &sa, &addrlen); + err = uv__getsockpeername((const uv_handle_t*) handle, + func, + (struct sockaddr*) &sa, + (int*) &addrlen); if (err < 0) { *size = 0; - return UV__ERR(errno); + return err; } #if defined(__linux__) diff --git a/src/unix/posix-poll.c b/src/unix/posix-poll.c index f3181f9..a3b9f21 100644 --- a/src/unix/posix-poll.c +++ b/src/unix/posix-poll.c @@ -298,6 +298,8 @@ update_timeout: void uv__platform_invalidate_fd(uv_loop_t* loop, int fd) { size_t i; + assert(fd >= 0); + if (loop->poll_fds_iterating) { /* uv__io_poll is currently iterating. Just invalidate fd. */ for (i = 0; i < loop->poll_fds_used; i++) diff --git a/src/unix/process.c b/src/unix/process.c index 101c9c5..e29bf15 100644 --- a/src/unix/process.c +++ b/src/unix/process.c @@ -315,7 +315,7 @@ static void uv__process_child_init(const uv_process_options_t* options, use_fd = open("/dev/null", fd == 0 ? O_RDONLY : O_RDWR); close_fd = use_fd; - if (use_fd == -1) { + if (use_fd < 0) { uv__write_int(error_fd, UV__ERR(errno)); _exit(127); } @@ -385,6 +385,11 @@ static void uv__process_child_init(const uv_process_options_t* options, if (n == SIGKILL || n == SIGSTOP) continue; /* Can't be changed. */ +#if defined(__HAIKU__) + if (n == SIGKILLTHR) + continue; /* Can't be changed. */ +#endif + if (SIG_ERR != signal(n, SIG_DFL)) continue; @@ -431,6 +436,8 @@ int uv_spawn(uv_loop_t* loop, UV_PROCESS_SETGID | UV_PROCESS_SETUID | UV_PROCESS_WINDOWS_HIDE | + UV_PROCESS_WINDOWS_HIDE_CONSOLE | + UV_PROCESS_WINDOWS_HIDE_GUI | UV_PROCESS_WINDOWS_VERBATIM_ARGUMENTS))); uv__handle_init(loop, (uv_handle_t*)process, UV_PROCESS); diff --git a/src/unix/stream.c b/src/unix/stream.c index a75ba15..17b06a3 100644 --- a/src/unix/stream.c +++ b/src/unix/stream.c @@ -745,13 +745,13 @@ static int uv__write_req_update(uv_stream_t* stream, buf = req->bufs + req->write_index; - while (n > 0) { + do { len = n < buf->len ? n : buf->len; buf->base += len; buf->len -= len; buf += (buf->len == 0); /* Advance to next buffer if this one is empty. */ n -= len; - } + } while (n > 0); req->write_index = buf - req->bufs; @@ -897,7 +897,7 @@ start: goto error; } - if (n > 0 && uv__write_req_update(stream, req, n)) { + if (n >= 0 && uv__write_req_update(stream, req, n)) { uv__write_req_finish(req); return; /* TODO(bnoordhuis) Start trying to write the next request. */ } @@ -1541,7 +1541,7 @@ int uv_try_write(uv_stream_t* stream, } if (written == 0 && req_size != 0) - return UV_EAGAIN; + return req.error < 0 ? req.error : UV_EAGAIN; else return written; } diff --git a/src/unix/sunos.c b/src/unix/sunos.c index 2552a01..f323d1d 100644 --- a/src/unix/sunos.c +++ b/src/unix/sunos.c @@ -117,6 +117,7 @@ void uv__platform_invalidate_fd(uv_loop_t* loop, int fd) { uintptr_t nfds; assert(loop->watchers != NULL); + assert(fd >= 0); events = (struct port_event*) loop->watchers[loop->nwatchers]; nfds = (uintptr_t) loop->watchers[loop->nwatchers + 1]; @@ -134,8 +135,10 @@ int uv__io_check_fd(uv_loop_t* loop, int fd) { if (port_associate(loop->backend_fd, PORT_SOURCE_FD, fd, POLLIN, 0)) return UV__ERR(errno); - if (port_dissociate(loop->backend_fd, PORT_SOURCE_FD, fd)) + if (port_dissociate(loop->backend_fd, PORT_SOURCE_FD, fd)) { + perror("(libuv) port_dissociate()"); abort(); + } return 0; } @@ -173,8 +176,14 @@ void uv__io_poll(uv_loop_t* loop, int timeout) { w = QUEUE_DATA(q, uv__io_t, watcher_queue); assert(w->pevents != 0); - if (port_associate(loop->backend_fd, PORT_SOURCE_FD, w->fd, w->pevents, 0)) + if (port_associate(loop->backend_fd, + PORT_SOURCE_FD, + w->fd, + w->pevents, + 0)) { + perror("(libuv) port_associate()"); abort(); + } w->events = w->pevents; } @@ -218,10 +227,12 @@ void uv__io_poll(uv_loop_t* loop, int timeout) { /* Work around another kernel bug: port_getn() may return events even * on error. */ - if (errno == EINTR || errno == ETIME) + if (errno == EINTR || errno == ETIME) { saved_errno = errno; - else + } else { + perror("(libuv) port_getn()"); abort(); + } } /* Update loop->time unconditionally. It's tempting to skip the update when @@ -369,6 +380,11 @@ uint64_t uv_get_total_memory(void) { } +uint64_t uv_get_constrained_memory(void) { + return 0; /* Memory constraints are unknown. */ +} + + void uv_loadavg(double avg[3]) { (void) getloadavg(avg, 3); } diff --git a/src/unix/tcp.c b/src/unix/tcp.c index 2982851..8cedcd6 100644 --- a/src/unix/tcp.c +++ b/src/unix/tcp.c @@ -82,7 +82,7 @@ static int maybe_new_socket(uv_tcp_t* handle, int domain, unsigned long flags) { handle->flags |= flags; return 0; } - + /* Query to see if tcp socket is bound. */ slen = sizeof(saddr); memset(&saddr, 0, sizeof(saddr)); @@ -235,12 +235,16 @@ int uv__tcp_connect(uv_connect_t* req, if (r == -1 && errno != 0) { if (errno == EINPROGRESS) ; /* not an error */ - else if (errno == ECONNREFUSED) - /* If we get a ECONNREFUSED wait until the next tick to report the - * error. Solaris wants to report immediately--other unixes want to - * wait. + else if (errno == ECONNREFUSED +#if defined(__OpenBSD__) + || errno == EINVAL +#endif + ) + /* If we get ECONNREFUSED (Solaris) or EINVAL (OpenBSD) wait until the + * next tick to report the error. Solaris and OpenBSD wants to report + * immediately -- other unixes want to wait. */ - handle->delayed_error = UV__ERR(errno); + handle->delayed_error = UV__ERR(ECONNREFUSED); else return UV__ERR(errno); } @@ -279,44 +283,28 @@ int uv_tcp_open(uv_tcp_t* handle, uv_os_sock_t sock) { int uv_tcp_getsockname(const uv_tcp_t* handle, struct sockaddr* name, int* namelen) { - socklen_t socklen; if (handle->delayed_error) return handle->delayed_error; - if (uv__stream_fd(handle) < 0) - return UV_EINVAL; /* FIXME(bnoordhuis) UV_EBADF */ - - /* sizeof(socklen_t) != sizeof(int) on some systems. */ - socklen = (socklen_t) *namelen; - - if (getsockname(uv__stream_fd(handle), name, &socklen)) - return UV__ERR(errno); - - *namelen = (int) socklen; - return 0; + return uv__getsockpeername((const uv_handle_t*) handle, + getsockname, + name, + namelen); } int uv_tcp_getpeername(const uv_tcp_t* handle, struct sockaddr* name, int* namelen) { - socklen_t socklen; if (handle->delayed_error) return handle->delayed_error; - if (uv__stream_fd(handle) < 0) - return UV_EINVAL; /* FIXME(bnoordhuis) UV_EBADF */ - - /* sizeof(socklen_t) != sizeof(int) on some systems. */ - socklen = (socklen_t) *namelen; - - if (getpeername(uv__stream_fd(handle), name, &socklen)) - return UV__ERR(errno); - - *namelen = (int) socklen; - return 0; + return uv__getsockpeername((const uv_handle_t*) handle, + getpeername, + name, + namelen); } diff --git a/src/unix/thread.c b/src/unix/thread.c index 2900470..cd0b7aa 100644 --- a/src/unix/thread.c +++ b/src/unix/thread.c @@ -48,8 +48,10 @@ STATIC_ASSERT(sizeof(uv_barrier_t) == sizeof(pthread_barrier_t)); #endif -/* Note: guard clauses should match uv_barrier_t's in include/uv/uv-unix.h. */ -#if defined(_AIX) || !defined(PTHREAD_BARRIER_SERIAL_THREAD) +/* Note: guard clauses should match uv_barrier_t's in include/uv/unix.h. */ +#if defined(_AIX) || \ + defined(__OpenBSD__) || \ + !defined(PTHREAD_BARRIER_SERIAL_THREAD) int uv_barrier_init(uv_barrier_t* barrier, unsigned int count) { struct _uv_barrier* b; int rc; @@ -176,8 +178,21 @@ static size_t thread_stack_size(void) { if (lim.rlim_cur != RLIM_INFINITY) { /* pthread_attr_setstacksize() expects page-aligned values. */ lim.rlim_cur -= lim.rlim_cur % (rlim_t) getpagesize(); - if (lim.rlim_cur >= PTHREAD_STACK_MIN) - return lim.rlim_cur; + + /* Musl's PTHREAD_STACK_MIN is 2 KB on all architectures, which is + * too small to safely receive signals on. + * + * Musl's PTHREAD_STACK_MIN + MINSIGSTKSZ == 8192 on arm64 (which has + * the largest MINSIGSTKSZ of the architectures that musl supports) so + * let's use that as a lower bound. + * + * We use a hardcoded value because PTHREAD_STACK_MIN + MINSIGSTKSZ + * is between 28 and 133 KB when compiling against glibc, depending + * on the architecture. + */ + if (lim.rlim_cur >= 8192) + if (lim.rlim_cur >= PTHREAD_STACK_MIN) + return lim.rlim_cur; } #endif @@ -192,13 +207,36 @@ static size_t thread_stack_size(void) { int uv_thread_create(uv_thread_t *tid, void (*entry)(void *arg), void *arg) { + uv_thread_options_t params; + params.flags = UV_THREAD_NO_FLAGS; + return uv_thread_create_ex(tid, ¶ms, entry, arg); +} + +int uv_thread_create_ex(uv_thread_t* tid, + const uv_thread_options_t* params, + void (*entry)(void *arg), + void *arg) { int err; - size_t stack_size; pthread_attr_t* attr; pthread_attr_t attr_storage; + size_t pagesize; + size_t stack_size; + + stack_size = + params->flags & UV_THREAD_HAS_STACK_SIZE ? params->stack_size : 0; attr = NULL; - stack_size = thread_stack_size(); + if (stack_size == 0) { + stack_size = thread_stack_size(); + } else { + pagesize = (size_t)getpagesize(); + /* Round up to the nearest page boundary. */ + stack_size = (stack_size + pagesize - 1) &~ (pagesize - 1); +#ifdef PTHREAD_STACK_MIN + if (stack_size < PTHREAD_STACK_MIN) + stack_size = PTHREAD_STACK_MIN; +#endif + } if (stack_size > 0) { attr = &attr_storage; @@ -778,7 +816,9 @@ int uv_cond_timedwait(uv_cond_t* cond, uv_mutex_t* mutex, uint64_t timeout) { return UV_ETIMEDOUT; abort(); +#ifndef __SUNPRO_C return UV_EINVAL; /* Satisfy the compiler. */ +#endif } diff --git a/src/unix/udp.c b/src/unix/udp.c index ec337ec..b578e7b 100644 --- a/src/unix/udp.c +++ b/src/unix/udp.c @@ -30,6 +30,7 @@ #if defined(__MVS__) #include #endif +#include #if defined(IPV6_JOIN_GROUP) && !defined(IPV6_ADD_MEMBERSHIP) # define IPV6_ADD_MEMBERSHIP IPV6_JOIN_GROUP @@ -227,9 +228,22 @@ static void uv__udp_sendmsg(uv_udp_t* handle) { assert(req != NULL); memset(&h, 0, sizeof h); - h.msg_name = &req->addr; - h.msg_namelen = (req->addr.ss_family == AF_INET6 ? - sizeof(struct sockaddr_in6) : sizeof(struct sockaddr_in)); + if (req->addr.ss_family == AF_UNSPEC) { + h.msg_name = NULL; + h.msg_namelen = 0; + } else { + h.msg_name = &req->addr; + if (req->addr.ss_family == AF_INET6) + h.msg_namelen = sizeof(struct sockaddr_in6); + else if (req->addr.ss_family == AF_INET) + h.msg_namelen = sizeof(struct sockaddr_in); + else if (req->addr.ss_family == AF_UNIX) + h.msg_namelen = sizeof(struct sockaddr_un); + else { + assert(0 && "unsupported address family"); + abort(); + } + } h.msg_iov = (struct iovec*) req->bufs; h.msg_iovlen = req->nbufs; @@ -263,16 +277,30 @@ static void uv__udp_sendmsg(uv_udp_t* handle) { * are different from the BSDs: it _shares_ the port rather than steal it * from the current listener. While useful, it's not something we can emulate * on other platforms so we don't enable it. + * + * zOS does not support getsockname with SO_REUSEPORT option when using + * AF_UNIX. */ static int uv__set_reuse(int fd) { int yes; - -#if defined(SO_REUSEPORT) && !defined(__linux__) yes = 1; + +#if defined(SO_REUSEPORT) && defined(__MVS__) + struct sockaddr_in sockfd; + unsigned int sockfd_len = sizeof(sockfd); + if (getsockname(fd, (struct sockaddr*) &sockfd, &sockfd_len) == -1) + return UV__ERR(errno); + if (sockfd.sin_family == AF_UNIX) { + if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(yes))) + return UV__ERR(errno); + } else { + if (setsockopt(fd, SOL_SOCKET, SO_REUSEPORT, &yes, sizeof(yes))) + return UV__ERR(errno); + } +#elif defined(SO_REUSEPORT) && !defined(__linux__) if (setsockopt(fd, SOL_SOCKET, SO_REUSEPORT, &yes, sizeof(yes))) return UV__ERR(errno); #else - yes = 1; if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(yes))) return UV__ERR(errno); #endif @@ -383,6 +411,50 @@ static int uv__udp_maybe_deferred_bind(uv_udp_t* handle, } +int uv__udp_connect(uv_udp_t* handle, + const struct sockaddr* addr, + unsigned int addrlen) { + int err; + + err = uv__udp_maybe_deferred_bind(handle, addr->sa_family, 0); + if (err) + return err; + + do { + errno = 0; + err = connect(handle->io_watcher.fd, addr, addrlen); + } while (err == -1 && errno == EINTR); + + if (err) + return UV__ERR(errno); + + handle->flags |= UV_HANDLE_UDP_CONNECTED; + + return 0; +} + + +int uv__udp_disconnect(uv_udp_t* handle) { + int r; + struct sockaddr addr; + + memset(&addr, 0, sizeof(addr)); + + addr.sa_family = AF_UNSPEC; + + do { + errno = 0; + r = connect(handle->io_watcher.fd, &addr, sizeof(addr)); + } while (r == -1 && errno == EINTR); + + if (r == -1 && errno != EAFNOSUPPORT) + return UV__ERR(errno); + + handle->flags &= ~UV_HANDLE_UDP_CONNECTED; + return 0; +} + + int uv__udp_send(uv_udp_send_t* req, uv_udp_t* handle, const uv_buf_t bufs[], @@ -395,9 +467,11 @@ int uv__udp_send(uv_udp_send_t* req, assert(nbufs > 0); - err = uv__udp_maybe_deferred_bind(handle, addr->sa_family, 0); - if (err) - return err; + if (addr) { + err = uv__udp_maybe_deferred_bind(handle, addr->sa_family, 0); + if (err) + return err; + } /* It's legal for send_queue_count > 0 even when the write_queue is empty; * it means there are error-state requests in the write_completed_queue that @@ -407,7 +481,10 @@ int uv__udp_send(uv_udp_send_t* req, uv__req_init(handle->loop, req, UV_UDP_SEND); assert(addrlen <= sizeof(req->addr)); - memcpy(&req->addr, addr, addrlen); + if (addr == NULL) + req->addr.ss_family = AF_UNSPEC; + else + memcpy(&req->addr, addr, addrlen); req->send_cb = send_cb; req->handle = handle; req->nbufs = nbufs; @@ -459,9 +536,13 @@ int uv__udp_try_send(uv_udp_t* handle, if (handle->send_queue_count != 0) return UV_EAGAIN; - err = uv__udp_maybe_deferred_bind(handle, addr->sa_family, 0); - if (err) - return err; + if (addr) { + err = uv__udp_maybe_deferred_bind(handle, addr->sa_family, 0); + if (err) + return err; + } else { + assert(handle->flags & UV_HANDLE_UDP_CONNECTED); + } memset(&h, 0, sizeof h); h.msg_name = (struct sockaddr*) addr; @@ -608,6 +689,7 @@ int uv_udp_init_ex(uv_loop_t* loop, uv_udp_t* handle, unsigned int flags) { uv__io_init(&handle->io_watcher, uv__udp_io, fd); QUEUE_INIT(&handle->write_queue); QUEUE_INIT(&handle->write_completed_queue); + return 0; } @@ -636,6 +718,9 @@ int uv_udp_open(uv_udp_t* handle, uv_os_sock_t sock) { return err; handle->io_watcher.fd = sock; + if (uv__udp_is_connected(handle)) + handle->flags |= UV_HANDLE_UDP_CONNECTED; + return 0; } @@ -743,13 +828,17 @@ int uv_udp_set_ttl(uv_udp_t* handle, int ttl) { IPV6_UNICAST_HOPS, &ttl, sizeof(ttl)); -#endif /* defined(__sun) || defined(_AIX) || defined (__OpenBSD__) || - defined(__MVS__) */ + +#else /* !(defined(__sun) || defined(_AIX) || defined (__OpenBSD__) || + defined(__MVS__)) */ return uv__setsockopt_maybe_char(handle, IP_TTL, IPV6_UNICAST_HOPS, ttl); + +#endif /* defined(__sun) || defined(_AIX) || defined (__OpenBSD__) || + defined(__MVS__) */ } @@ -851,23 +940,24 @@ int uv_udp_set_multicast_interface(uv_udp_t* handle, const char* interface_addr) return 0; } - -int uv_udp_getsockname(const uv_udp_t* handle, +int uv_udp_getpeername(const uv_udp_t* handle, struct sockaddr* name, int* namelen) { - socklen_t socklen; - - if (handle->io_watcher.fd == -1) - return UV_EINVAL; /* FIXME(bnoordhuis) UV_EBADF */ - /* sizeof(socklen_t) != sizeof(int) on some systems. */ - socklen = (socklen_t) *namelen; + return uv__getsockpeername((const uv_handle_t*) handle, + getpeername, + name, + namelen); +} - if (getsockname(handle->io_watcher.fd, name, &socklen)) - return UV__ERR(errno); +int uv_udp_getsockname(const uv_udp_t* handle, + struct sockaddr* name, + int* namelen) { - *namelen = (int) socklen; - return 0; + return uv__getsockpeername((const uv_handle_t*) handle, + getsockname, + name, + namelen); } diff --git a/src/uv-common.c b/src/uv-common.c index 952bde0..066eb31 100644 --- a/src/uv-common.c +++ b/src/uv-common.c @@ -34,6 +34,7 @@ # include /* malloc */ #else # include /* if_nametoindex */ +# include /* AF_UNIX, sockaddr_un */ #endif @@ -222,6 +223,9 @@ int uv_ip6_addr(const char* ip, int port, struct sockaddr_in6* addr) { memset(addr, 0, sizeof(*addr)); addr->sin6_family = AF_INET6; addr->sin6_port = htons(port); +#ifdef SIN6_LEN + addr->sin6_len = sizeof(*addr); +#endif zone_index = strchr(ip, '%'); if (zone_index != NULL) { @@ -314,17 +318,20 @@ int uv_tcp_connect(uv_connect_t* req, } -int uv_udp_send(uv_udp_send_t* req, - uv_udp_t* handle, - const uv_buf_t bufs[], - unsigned int nbufs, - const struct sockaddr* addr, - uv_udp_send_cb send_cb) { +int uv_udp_connect(uv_udp_t* handle, const struct sockaddr* addr) { unsigned int addrlen; if (handle->type != UV_UDP) return UV_EINVAL; + /* Disconnect the handle */ + if (addr == NULL) { + if (!(handle->flags & UV_HANDLE_UDP_CONNECTED)) + return UV_ENOTCONN; + + return uv__udp_disconnect(handle); + } + if (addr->sa_family == AF_INET) addrlen = sizeof(struct sockaddr_in); else if (addr->sa_family == AF_INET6) @@ -332,6 +339,70 @@ int uv_udp_send(uv_udp_send_t* req, else return UV_EINVAL; + if (handle->flags & UV_HANDLE_UDP_CONNECTED) + return UV_EISCONN; + + return uv__udp_connect(handle, addr, addrlen); +} + + +int uv__udp_is_connected(uv_udp_t* handle) { + struct sockaddr_storage addr; + int addrlen; + if (handle->type != UV_UDP) + return 0; + + addrlen = sizeof(addr); + if (uv_udp_getpeername(handle, (struct sockaddr*) &addr, &addrlen) != 0) + return 0; + + return addrlen > 0; +} + + +int uv__udp_check_before_send(uv_udp_t* handle, const struct sockaddr* addr) { + unsigned int addrlen; + + if (handle->type != UV_UDP) + return UV_EINVAL; + + if (addr != NULL && (handle->flags & UV_HANDLE_UDP_CONNECTED)) + return UV_EISCONN; + + if (addr == NULL && !(handle->flags & UV_HANDLE_UDP_CONNECTED)) + return UV_EDESTADDRREQ; + + if (addr != NULL) { + if (addr->sa_family == AF_INET) + addrlen = sizeof(struct sockaddr_in); + else if (addr->sa_family == AF_INET6) + addrlen = sizeof(struct sockaddr_in6); +#if defined(AF_UNIX) && !defined(_WIN32) + else if (addr->sa_family == AF_UNIX) + addrlen = sizeof(struct sockaddr_un); +#endif + else + return UV_EINVAL; + } else { + addrlen = 0; + } + + return addrlen; +} + + +int uv_udp_send(uv_udp_send_t* req, + uv_udp_t* handle, + const uv_buf_t bufs[], + unsigned int nbufs, + const struct sockaddr* addr, + uv_udp_send_cb send_cb) { + int addrlen; + + addrlen = uv__udp_check_before_send(handle, addr); + if (addrlen < 0) + return addrlen; + return uv__udp_send(req, handle, bufs, nbufs, addr, addrlen, send_cb); } @@ -340,17 +411,11 @@ int uv_udp_try_send(uv_udp_t* handle, const uv_buf_t bufs[], unsigned int nbufs, const struct sockaddr* addr) { - unsigned int addrlen; - - if (handle->type != UV_UDP) - return UV_EINVAL; + int addrlen; - if (addr->sa_family == AF_INET) - addrlen = sizeof(struct sockaddr_in); - else if (addr->sa_family == AF_INET6) - addrlen = sizeof(struct sockaddr_in6); - else - return UV_EINVAL; + addrlen = uv__udp_check_before_send(handle, addr); + if (addrlen < 0) + return addrlen; return uv__udp_try_send(handle, bufs, nbufs, addr, addrlen); } @@ -571,37 +636,66 @@ int uv_fs_scandir_next(uv_fs_t* req, uv_dirent_t* ent) { dent = dents[(*nbufs)++]; ent->name = dent->d_name; + ent->type = uv__fs_get_dirent_type(dent); + + return 0; +} + +uv_dirent_type_t uv__fs_get_dirent_type(uv__dirent_t* dent) { + uv_dirent_type_t type; + #ifdef HAVE_DIRENT_TYPES switch (dent->d_type) { case UV__DT_DIR: - ent->type = UV_DIRENT_DIR; + type = UV_DIRENT_DIR; break; case UV__DT_FILE: - ent->type = UV_DIRENT_FILE; + type = UV_DIRENT_FILE; break; case UV__DT_LINK: - ent->type = UV_DIRENT_LINK; + type = UV_DIRENT_LINK; break; case UV__DT_FIFO: - ent->type = UV_DIRENT_FIFO; + type = UV_DIRENT_FIFO; break; case UV__DT_SOCKET: - ent->type = UV_DIRENT_SOCKET; + type = UV_DIRENT_SOCKET; break; case UV__DT_CHAR: - ent->type = UV_DIRENT_CHAR; + type = UV_DIRENT_CHAR; break; case UV__DT_BLOCK: - ent->type = UV_DIRENT_BLOCK; + type = UV_DIRENT_BLOCK; break; default: - ent->type = UV_DIRENT_UNKNOWN; + type = UV_DIRENT_UNKNOWN; } #else - ent->type = UV_DIRENT_UNKNOWN; + type = UV_DIRENT_UNKNOWN; #endif - return 0; + return type; +} + +void uv__fs_readdir_cleanup(uv_fs_t* req) { + uv_dir_t* dir; + uv_dirent_t* dirents; + int i; + + if (req->ptr == NULL) + return; + + dir = req->ptr; + dirents = dir->dirents; + req->ptr = NULL; + + if (dirents == NULL) + return; + + for (i = 0; i < req->result; ++i) { + uv__free((char*) dirents[i].name); + dirents[i].name = NULL; + } } diff --git a/src/uv-common.h b/src/uv-common.h index 15ac4d0..f788161 100644 --- a/src/uv-common.h +++ b/src/uv-common.h @@ -103,6 +103,7 @@ enum { /* Only used by uv_udp_t handles. */ UV_HANDLE_UDP_PROCESSING = 0x01000000, + UV_HANDLE_UDP_CONNECTED = 0x02000000, /* Only used by uv_pipe_t handles. */ UV_HANDLE_NON_OVERLAPPED_PIPE = 0x01000000, @@ -142,6 +143,14 @@ int uv__udp_bind(uv_udp_t* handle, unsigned int addrlen, unsigned int flags); +int uv__udp_connect(uv_udp_t* handle, + const struct sockaddr* addr, + unsigned int addrlen); + +int uv__udp_disconnect(uv_udp_t* handle); + +int uv__udp_is_connected(uv_udp_t* handle); + int uv__udp_send(uv_udp_send_t* req, uv_udp_t* handle, const uv_buf_t bufs[], @@ -184,6 +193,8 @@ size_t uv__count_bufs(const uv_buf_t bufs[], unsigned int nbufs); int uv__socket_sockopt(uv_handle_t* handle, int optname, int* value); void uv__fs_scandir_cleanup(uv_fs_t* req); +void uv__fs_readdir_cleanup(uv_fs_t* req); +uv_dirent_type_t uv__fs_get_dirent_type(uv__dirent_t* dent); int uv__next_timeout(const uv_loop_t* loop); void uv__run_timers(uv_loop_t* loop); diff --git a/src/uv-data-getter-setters.c b/src/uv-data-getter-setters.c index b7fcd4a..c302566 100644 --- a/src/uv-data-getter-setters.c +++ b/src/uv-data-getter-setters.c @@ -36,7 +36,7 @@ const char* uv_req_type_name(uv_req_type type) { case UV_REQ_TYPE_MAX: case UV_UNKNOWN_REQ: default: /* UV_REQ_TYPE_PRIVATE */ - return NULL; + break; } return NULL; } diff --git a/src/win/core.c b/src/win/core.c index bf80d77..e9d0a58 100644 --- a/src/win/core.c +++ b/src/win/core.c @@ -623,3 +623,30 @@ int uv__socket_sockopt(uv_handle_t* handle, int optname, int* value) { return 0; } + +int uv_cpumask_size(void) { + return (int)(sizeof(DWORD_PTR) * 8); +} + +int uv__getsockpeername(const uv_handle_t* handle, + uv__peersockfunc func, + struct sockaddr* name, + int* namelen, + int delayed_error) { + + int result; + uv_os_fd_t fd; + + result = uv_fileno(handle, &fd); + if (result != 0) + return result; + + if (delayed_error) + return uv_translate_sys_error(delayed_error); + + result = func((SOCKET) fd, name, namelen); + if (result != 0) + return uv_translate_sys_error(WSAGetLastError()); + + return 0; +} diff --git a/src/win/fs.c b/src/win/fs.c index 65d936b..9e2f084 100644 --- a/src/win/fs.c +++ b/src/win/fs.c @@ -1125,6 +1125,137 @@ cleanup: uv__free(dirents); } +void fs__opendir(uv_fs_t* req) { + WCHAR* pathw; + size_t len; + const WCHAR* fmt; + WCHAR* find_path; + uv_dir_t* dir; + + pathw = req->file.pathw; + dir = NULL; + find_path = NULL; + + /* Figure out whether path is a file or a directory. */ + if (!(GetFileAttributesW(pathw) & FILE_ATTRIBUTE_DIRECTORY)) { + SET_REQ_UV_ERROR(req, UV_ENOTDIR, ERROR_DIRECTORY); + goto error; + } + + dir = uv__malloc(sizeof(*dir)); + if (dir == NULL) { + SET_REQ_UV_ERROR(req, UV_ENOMEM, ERROR_OUTOFMEMORY); + goto error; + } + + len = wcslen(pathw); + + if (len == 0) + fmt = L"./*"; + else if (IS_SLASH(pathw[len - 1])) + fmt = L"%s*"; + else + fmt = L"%s\\*"; + + find_path = uv__malloc(sizeof(WCHAR) * (len + 4)); + if (find_path == NULL) { + SET_REQ_UV_ERROR(req, UV_ENOMEM, ERROR_OUTOFMEMORY); + goto error; + } + + _snwprintf(find_path, len + 3, fmt, pathw); + dir->dir_handle = FindFirstFileW(find_path, &dir->find_data); + uv__free(find_path); + find_path = NULL; + if (dir->dir_handle == INVALID_HANDLE_VALUE && + GetLastError() != ERROR_FILE_NOT_FOUND) { + SET_REQ_WIN32_ERROR(req, GetLastError()); + goto error; + } + + dir->need_find_call = FALSE; + req->ptr = dir; + SET_REQ_RESULT(req, 0); + return; + +error: + uv__free(dir); + uv__free(find_path); + req->ptr = NULL; +} + +void fs__readdir(uv_fs_t* req) { + uv_dir_t* dir; + uv_dirent_t* dirents; + uv__dirent_t dent; + unsigned int dirent_idx; + PWIN32_FIND_DATAW find_data; + unsigned int i; + int r; + + req->flags |= UV_FS_FREE_PTR; + dir = req->ptr; + dirents = dir->dirents; + memset(dirents, 0, dir->nentries * sizeof(*dir->dirents)); + find_data = &dir->find_data; + dirent_idx = 0; + + while (dirent_idx < dir->nentries) { + if (dir->need_find_call && FindNextFileW(dir->dir_handle, find_data) == 0) { + if (GetLastError() == ERROR_NO_MORE_FILES) + break; + goto error; + } + + /* Skip "." and ".." entries. */ + if (find_data->cFileName[0] == L'.' && + (find_data->cFileName[1] == L'\0' || + (find_data->cFileName[1] == L'.' && + find_data->cFileName[2] == L'\0'))) { + dir->need_find_call = TRUE; + continue; + } + + r = uv__convert_utf16_to_utf8((const WCHAR*) &find_data->cFileName, + -1, + (char**) &dirents[dirent_idx].name); + if (r != 0) + goto error; + + /* Copy file type. */ + if ((find_data->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0) + dent.d_type = UV__DT_DIR; + else if ((find_data->dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) != 0) + dent.d_type = UV__DT_LINK; + else if ((find_data->dwFileAttributes & FILE_ATTRIBUTE_DEVICE) != 0) + dent.d_type = UV__DT_CHAR; + else + dent.d_type = UV__DT_FILE; + + dirents[dirent_idx].type = uv__fs_get_dirent_type(&dent); + dir->need_find_call = TRUE; + ++dirent_idx; + } + + SET_REQ_RESULT(req, dirent_idx); + return; + +error: + SET_REQ_WIN32_ERROR(req, GetLastError()); + for (i = 0; i < dirent_idx; ++i) { + uv__free((char*) dirents[i].name); + dirents[i].name = NULL; + } +} + +void fs__closedir(uv_fs_t* req) { + uv_dir_t* dir; + + dir = req->ptr; + FindClose(dir->dir_handle); + uv__free(req->ptr); + SET_REQ_RESULT(req, 0); +} INLINE static int fs__stat_handle(HANDLE handle, uv_stat_t* statbuf, int do_lstat) { @@ -2039,6 +2170,9 @@ static void uv__fs_work(struct uv__work* w) { XX(MKDTEMP, mkdtemp) XX(RENAME, rename) XX(SCANDIR, scandir) + XX(READDIR, readdir) + XX(OPENDIR, opendir) + XX(CLOSEDIR, closedir) XX(LINK, link) XX(SYMLINK, symlink) XX(READLINK, readlink) @@ -2080,6 +2214,8 @@ void uv_fs_req_cleanup(uv_fs_t* req) { if (req->flags & UV_FS_FREE_PTR) { if (req->fs_type == UV_FS_SCANDIR && req->ptr != NULL) uv__fs_scandir_cleanup(req); + else if (req->fs_type == UV_FS_READDIR) + uv__fs_readdir_cleanup(req); else uv__free(req->ptr); } @@ -2247,6 +2383,45 @@ int uv_fs_scandir(uv_loop_t* loop, uv_fs_t* req, const char* path, int flags, POST; } +int uv_fs_opendir(uv_loop_t* loop, + uv_fs_t* req, + const char* path, + uv_fs_cb cb) { + int err; + + INIT(UV_FS_OPENDIR); + err = fs__capture_path(req, path, NULL, cb != NULL); + if (err) + return uv_translate_sys_error(err); + POST; +} + +int uv_fs_readdir(uv_loop_t* loop, + uv_fs_t* req, + uv_dir_t* dir, + uv_fs_cb cb) { + INIT(UV_FS_READDIR); + + if (dir == NULL || + dir->dirents == NULL || + dir->dir_handle == INVALID_HANDLE_VALUE) { + return UV_EINVAL; + } + + req->ptr = dir; + POST; +} + +int uv_fs_closedir(uv_loop_t* loop, + uv_fs_t* req, + uv_dir_t* dir, + uv_fs_cb cb) { + INIT(UV_FS_CLOSEDIR); + if (dir == NULL) + return UV_EINVAL; + req->ptr = dir; + POST; +} int uv_fs_link(uv_loop_t* loop, uv_fs_t* req, const char* path, const char* new_path, uv_fs_cb cb) { diff --git a/src/win/handle.c b/src/win/handle.c index 9d76c3f..61e4df6 100644 --- a/src/win/handle.c +++ b/src/win/handle.c @@ -139,7 +139,6 @@ void uv_close(uv_handle_t* handle, uv_close_cb cb) { case UV_FS_POLL: uv__fs_poll_close((uv_fs_poll_t*) handle); uv__handle_closing(handle); - uv_want_endgame(loop, handle); return; default: diff --git a/src/win/internal.h b/src/win/internal.h index 634b9f7..70ddaa5 100644 --- a/src/win/internal.h +++ b/src/win/internal.h @@ -272,6 +272,14 @@ int uv__getpwuid_r(uv_passwd_t* pwd); int uv__convert_utf16_to_utf8(const WCHAR* utf16, int utf16len, char** utf8); int uv__convert_utf8_to_utf16(const char* utf8, int utf8len, WCHAR** utf16); +typedef int (WINAPI *uv__peersockfunc)(SOCKET, struct sockaddr*, int*); + +int uv__getsockpeername(const uv_handle_t* handle, + uv__peersockfunc func, + struct sockaddr* name, + int* namelen, + int delayed_error); + /* * Process stdio handles. diff --git a/src/win/tcp.c b/src/win/tcp.c index 3ce5548..f2cb527 100644 --- a/src/win/tcp.c +++ b/src/win/tcp.c @@ -809,44 +809,24 @@ static int uv_tcp_try_connect(uv_connect_t* req, int uv_tcp_getsockname(const uv_tcp_t* handle, struct sockaddr* name, int* namelen) { - int result; - - if (handle->socket == INVALID_SOCKET) { - return UV_EINVAL; - } - - if (handle->delayed_error) { - return uv_translate_sys_error(handle->delayed_error); - } - - result = getsockname(handle->socket, name, namelen); - if (result != 0) { - return uv_translate_sys_error(WSAGetLastError()); - } - return 0; + return uv__getsockpeername((const uv_handle_t*) handle, + getsockname, + name, + namelen, + handle->delayed_error); } int uv_tcp_getpeername(const uv_tcp_t* handle, struct sockaddr* name, int* namelen) { - int result; - - if (handle->socket == INVALID_SOCKET) { - return UV_EINVAL; - } - - if (handle->delayed_error) { - return uv_translate_sys_error(handle->delayed_error); - } - - result = getpeername(handle->socket, name, namelen); - if (result != 0) { - return uv_translate_sys_error(WSAGetLastError()); - } - return 0; + return uv__getsockpeername((const uv_handle_t*) handle, + getpeername, + name, + namelen, + handle->delayed_error); } diff --git a/src/win/thread.c b/src/win/thread.c index fd4b7c9..89c53ad 100644 --- a/src/win/thread.c +++ b/src/win/thread.c @@ -112,9 +112,34 @@ static UINT __stdcall uv__thread_start(void* arg) { int uv_thread_create(uv_thread_t *tid, void (*entry)(void *arg), void *arg) { + uv_thread_options_t params; + params.flags = UV_THREAD_NO_FLAGS; + return uv_thread_create_ex(tid, ¶ms, entry, arg); +} + +int uv_thread_create_ex(uv_thread_t* tid, + const uv_thread_options_t* params, + void (*entry)(void *arg), + void *arg) { struct thread_ctx* ctx; int err; HANDLE thread; + SYSTEM_INFO sysinfo; + size_t stack_size; + size_t pagesize; + + stack_size = + params->flags & UV_THREAD_HAS_STACK_SIZE ? params->stack_size : 0; + + if (stack_size != 0) { + GetNativeSystemInfo(&sysinfo); + pagesize = (size_t)sysinfo.dwPageSize; + /* Round up to the nearest page boundary. */ + stack_size = (stack_size + pagesize - 1) &~ (pagesize - 1); + + if ((unsigned)stack_size != stack_size) + return UV_EINVAL; + } ctx = uv__malloc(sizeof(*ctx)); if (ctx == NULL) @@ -126,7 +151,7 @@ int uv_thread_create(uv_thread_t *tid, void (*entry)(void *arg), void *arg) { /* Create the thread in suspended state so we have a chance to pass * its own creation handle to it */ thread = (HANDLE) _beginthreadex(NULL, - 0, + (unsigned)stack_size, uv__thread_start, ctx, CREATE_SUSPENDED, diff --git a/src/win/tty.c b/src/win/tty.c index f38e9a8..a98fe26 100644 --- a/src/win/tty.c +++ b/src/win/tty.c @@ -736,8 +736,8 @@ void uv_process_tty_read_raw_req(uv_loop_t* loop, uv_tty_t* handle, /* Ignore keyup events, unless the left alt key was held and a valid * unicode character was emitted. */ if (!KEV.bKeyDown && - KEV.wVirtualKeyCode != VK_MENU && - KEV.uChar.UnicodeChar != 0) { + (KEV.wVirtualKeyCode != VK_MENU || + KEV.uChar.UnicodeChar == 0)) { continue; } diff --git a/src/win/udp.c b/src/win/udp.c index 37df849..8aeeab3 100644 --- a/src/win/udp.c +++ b/src/win/udp.c @@ -36,22 +36,27 @@ const unsigned int uv_active_udp_streams_threshold = 0; /* A zero-size buffer for use by uv_udp_read */ static char uv_zero_[] = ""; - -int uv_udp_getsockname(const uv_udp_t* handle, +int uv_udp_getpeername(const uv_udp_t* handle, struct sockaddr* name, int* namelen) { - int result; - if (handle->socket == INVALID_SOCKET) { - return UV_EINVAL; - } + return uv__getsockpeername((const uv_handle_t*) handle, + getpeername, + name, + namelen, + 0); +} - result = getsockname(handle->socket, name, namelen); - if (result != 0) { - return uv_translate_sys_error(WSAGetLastError()); - } - return 0; +int uv_udp_getsockname(const uv_udp_t* handle, + struct sockaddr* name, + int* namelen) { + + return uv__getsockpeername((const uv_handle_t*) handle, + getsockname, + name, + namelen, + 0); } @@ -784,6 +789,18 @@ int uv_udp_set_broadcast(uv_udp_t* handle, int value) { } +int uv__udp_is_bound(uv_udp_t* handle) { + struct sockaddr_storage addr; + int addrlen; + + addrlen = sizeof(addr); + if (uv_udp_getsockname(handle, (struct sockaddr*) &addr, &addrlen) != 0) + return 0; + + return addrlen > 0; +} + + int uv_udp_open(uv_udp_t* handle, uv_os_sock_t sock) { WSAPROTOCOL_INFOW protocol_info; int opt_len; @@ -803,7 +820,16 @@ int uv_udp_open(uv_udp_t* handle, uv_os_sock_t sock) { handle, sock, protocol_info.iAddressFamily); - return uv_translate_sys_error(err); + if (err) + return uv_translate_sys_error(err); + + if (uv__udp_is_bound(handle)) + handle->flags |= UV_HANDLE_BOUND; + + if (uv__udp_is_connected(handle)) + handle->flags |= UV_HANDLE_UDP_CONNECTED; + + return 0; } @@ -880,6 +906,50 @@ int uv__udp_bind(uv_udp_t* handle, } +int uv__udp_connect(uv_udp_t* handle, + const struct sockaddr* addr, + unsigned int addrlen) { + const struct sockaddr* bind_addr; + int err; + + if (!(handle->flags & UV_HANDLE_BOUND)) { + if (addrlen == sizeof(uv_addr_ip4_any_)) + bind_addr = (const struct sockaddr*) &uv_addr_ip4_any_; + else if (addrlen == sizeof(uv_addr_ip6_any_)) + bind_addr = (const struct sockaddr*) &uv_addr_ip6_any_; + else + return UV_EINVAL; + + err = uv_udp_maybe_bind(handle, bind_addr, addrlen, 0); + if (err) + return uv_translate_sys_error(err); + } + + err = connect(handle->socket, addr, addrlen); + if (err) + return uv_translate_sys_error(err); + + handle->flags |= UV_HANDLE_UDP_CONNECTED; + + return 0; +} + + +int uv__udp_disconnect(uv_udp_t* handle) { + int err; + struct sockaddr addr; + + memset(&addr, 0, sizeof(addr)); + + err = connect(handle->socket, &addr, sizeof(addr)); + if (err) + return uv_translate_sys_error(err); + + handle->flags &= ~UV_HANDLE_UDP_CONNECTED; + return 0; +} + + /* This function is an egress point, i.e. it returns libuv errors rather than * system errors. */ @@ -900,6 +970,7 @@ int uv__udp_send(uv_udp_send_t* req, bind_addr = (const struct sockaddr*) &uv_addr_ip6_any_; else return UV_EINVAL; + err = uv_udp_maybe_bind(handle, bind_addr, addrlen, 0); if (err) return uv_translate_sys_error(err); @@ -925,9 +996,11 @@ int uv__udp_try_send(uv_udp_t* handle, assert(nbufs > 0); - err = uv__convert_to_localhost_if_unspecified(addr, &converted); - if (err) - return err; + if (addr != NULL) { + err = uv__convert_to_localhost_if_unspecified(addr, &converted); + if (err) + return err; + } /* Already sending a message.*/ if (handle->send_queue_count != 0) diff --git a/src/win/util.c b/src/win/util.c index 9237891..7ca8321 100644 --- a/src/win/util.c +++ b/src/win/util.c @@ -59,13 +59,6 @@ # define UNLEN 256 #endif -/* - Max hostname length. The Windows gethostname() documentation states that 256 - bytes will always be large enough to hold the null-terminated hostname. -*/ -#ifndef MAXHOSTNAMELEN -# define MAXHOSTNAMELEN 256 -#endif /* Maximum environment variable size, including the terminating null */ #define MAX_ENV_VAR_LENGTH 32767 @@ -327,6 +320,11 @@ uint64_t uv_get_total_memory(void) { } +uint64_t uv_get_constrained_memory(void) { + return 0; /* Memory constraints are unknown. */ +} + + uv_pid_t uv_os_getpid(void) { return GetCurrentProcessId(); } @@ -684,12 +682,9 @@ int uv_cpu_info(uv_cpu_info_t** cpu_infos_ptr, int* cpu_count_ptr) { NULL, (BYTE*)&cpu_brand, &cpu_brand_size); - if (err != ERROR_SUCCESS) { - RegCloseKey(processor_key); - goto error; - } - RegCloseKey(processor_key); + if (err != ERROR_SUCCESS) + goto error; cpu_info = &cpu_infos[i]; cpu_info->speed = cpu_speed; @@ -713,9 +708,11 @@ int uv_cpu_info(uv_cpu_info_t** cpu_infos_ptr, int* cpu_count_ptr) { return 0; error: - /* This is safe because the cpu_infos array is zeroed on allocation. */ - for (i = 0; i < cpu_count; i++) - uv__free(cpu_infos[i].model); + if (cpu_infos != NULL) { + /* This is safe because the cpu_infos array is zeroed on allocation. */ + for (i = 0; i < cpu_count; i++) + uv__free(cpu_infos[i].model); + } uv__free(cpu_infos); uv__free(sppi); @@ -1510,7 +1507,7 @@ int uv_os_unsetenv(const char* name) { int uv_os_gethostname(char* buffer, size_t* size) { - char buf[MAXHOSTNAMELEN + 1]; + char buf[UV_MAXHOSTNAMESIZE]; size_t len; if (buffer == NULL || size == NULL || *size == 0) @@ -1634,6 +1631,10 @@ int uv_os_uname(uv_utsname_t* buffer) { https://github.com/gagern/gnulib/blob/master/lib/uname.c */ OSVERSIONINFOW os_info; SYSTEM_INFO system_info; + HKEY registry_key; + WCHAR product_name_w[256]; + DWORD product_name_w_size; + int version_size; int processor_level; int r; @@ -1658,16 +1659,56 @@ int uv_os_uname(uv_utsname_t* buffer) { } /* Populate the version field. */ - if (WideCharToMultiByte(CP_UTF8, - 0, - os_info.szCSDVersion, - -1, - buffer->version, - sizeof(buffer->version), - NULL, - NULL) == 0) { - r = uv_translate_sys_error(GetLastError()); - goto error; + version_size = 0; + r = RegOpenKeyExW(HKEY_LOCAL_MACHINE, + L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", + 0, + KEY_QUERY_VALUE, + ®istry_key); + + if (r == ERROR_SUCCESS) { + product_name_w_size = sizeof(product_name_w); + r = RegGetValueW(registry_key, + NULL, + L"ProductName", + RRF_RT_REG_SZ, + NULL, + (PVOID) product_name_w, + &product_name_w_size); + RegCloseKey(registry_key); + + if (r == ERROR_SUCCESS) { + version_size = WideCharToMultiByte(CP_UTF8, + 0, + product_name_w, + -1, + buffer->version, + sizeof(buffer->version), + NULL, + NULL); + if (version_size == 0) { + r = uv_translate_sys_error(GetLastError()); + goto error; + } + } + } + + /* Append service pack information to the version if present. */ + if (os_info.szCSDVersion[0] != L'\0') { + if (version_size > 0) + buffer->version[version_size - 1] = ' '; + + if (WideCharToMultiByte(CP_UTF8, + 0, + os_info.szCSDVersion, + -1, + buffer->version + version_size, + sizeof(buffer->version) - version_size, + NULL, + NULL) == 0) { + r = uv_translate_sys_error(GetLastError()); + goto error; + } } /* Populate the sysname field. */ @@ -1744,3 +1785,20 @@ error: buffer->machine[0] = '\0'; return r; } + +int uv_gettimeofday(uv_timeval64_t* tv) { + /* Based on https://doxygen.postgresql.org/gettimeofday_8c_source.html */ + const uint64_t epoch = (uint64_t) 116444736000000000ULL; + FILETIME file_time; + ULARGE_INTEGER ularge; + + if (tv == NULL) + return UV_EINVAL; + + GetSystemTimeAsFileTime(&file_time); + ularge.LowPart = file_time.dwLowDateTime; + ularge.HighPart = file_time.dwHighDateTime; + tv->tv_sec = (int64_t) ((ularge.QuadPart - epoch) / 10000000L); + tv->tv_usec = (int32_t) (((ularge.QuadPart - epoch) % 10000000L) / 10); + return 0; +} diff --git a/src/win/winsock.c b/src/win/winsock.c index 5e7da2a..5820ba9 100644 --- a/src/win/winsock.c +++ b/src/win/winsock.c @@ -87,12 +87,6 @@ void uv_winsock_init(void) { WSAPROTOCOL_INFOW protocol_info; int opt_len; - /* Initialize winsock */ - errorno = WSAStartup(MAKEWORD(2, 2), &wsa_data); - if (errorno != 0) { - uv_fatal_error(errorno, "WSAStartup"); - } - /* Set implicit binding address used by connectEx */ if (uv_ip4_addr("0.0.0.0", 0, &uv_addr_ip4_any_)) { abort(); @@ -102,6 +96,15 @@ void uv_winsock_init(void) { abort(); } + /* Skip initialization in safe mode without network support */ + if (1 == GetSystemMetrics(SM_CLEANBOOT)) return; + + /* Initialize winsock */ + errorno = WSAStartup(MAKEWORD(2, 2), &wsa_data); + if (errorno != 0) { + uv_fatal_error(errorno, "WSAStartup"); + } + /* Detect non-IFS LSPs */ dummy = socket(AF_INET, SOCK_STREAM, IPPROTO_IP); ----------------------------------------------------------------------- Summary of changes: Utilities/cmlibuv/include/uv.h | 66 +++++- Utilities/cmlibuv/include/uv/unix.h | 19 +- Utilities/cmlibuv/include/uv/version.h | 2 +- Utilities/cmlibuv/include/uv/win.h | 5 + Utilities/cmlibuv/src/fs-poll.c | 63 ++++-- Utilities/cmlibuv/src/threadpool.c | 2 +- Utilities/cmlibuv/src/unix/aix.c | 6 + Utilities/cmlibuv/src/unix/async.c | 37 +++- Utilities/cmlibuv/src/unix/atomic-ops.h | 39 +--- Utilities/cmlibuv/src/unix/bsd-ifaddrs.c | 18 +- Utilities/cmlibuv/src/unix/cmake-bootstrap.c | 9 + Utilities/cmlibuv/src/unix/core.c | 90 ++++++-- Utilities/cmlibuv/src/unix/darwin.c | 5 + Utilities/cmlibuv/src/unix/freebsd.c | 5 + Utilities/cmlibuv/src/unix/fs.c | 289 ++++++++++++++++++++----- Utilities/cmlibuv/src/unix/fsevents.c | 3 +- Utilities/cmlibuv/src/unix/getaddrinfo.c | 2 + Utilities/cmlibuv/src/unix/haiku.c | 176 +++++++++++++++ Utilities/cmlibuv/src/unix/ibmi.c | 141 +++++++++++- Utilities/cmlibuv/src/unix/internal.h | 11 +- Utilities/cmlibuv/src/unix/kqueue.c | 18 +- Utilities/cmlibuv/src/unix/linux-core.c | 162 ++++++++++++-- Utilities/cmlibuv/src/unix/linux-syscalls.c | 31 +++ Utilities/cmlibuv/src/unix/linux-syscalls.h | 35 +++ Utilities/cmlibuv/src/unix/netbsd.c | 5 + Utilities/cmlibuv/src/unix/openbsd.c | 5 + Utilities/cmlibuv/src/unix/os390.c | 6 + Utilities/cmlibuv/src/unix/pipe.c | 12 +- Utilities/cmlibuv/src/unix/posix-poll.c | 2 + Utilities/cmlibuv/src/unix/process.c | 7 + Utilities/cmlibuv/src/unix/stream.c | 8 +- Utilities/cmlibuv/src/unix/sunos.c | 24 +- Utilities/cmlibuv/src/unix/tcp.c | 48 ++-- Utilities/cmlibuv/src/unix/thread.c | 52 ++++- Utilities/cmlibuv/src/unix/udp.c | 144 +++++++++--- Utilities/cmlibuv/src/uv-common.c | 146 ++++++++++--- Utilities/cmlibuv/src/uv-common.h | 11 + Utilities/cmlibuv/src/uv-data-getter-setters.c | 2 +- Utilities/cmlibuv/src/win/core.c | 23 ++ Utilities/cmlibuv/src/win/fs.c | 175 +++++++++++++++ Utilities/cmlibuv/src/win/handle.c | 1 - Utilities/cmlibuv/src/win/internal.h | 8 + Utilities/cmlibuv/src/win/tcp.c | 40 +--- Utilities/cmlibuv/src/win/thread.c | 27 ++- Utilities/cmlibuv/src/win/tty.c | 4 +- Utilities/cmlibuv/src/win/udp.c | 103 +++++++-- Utilities/cmlibuv/src/win/util.c | 110 +++++++--- Utilities/cmlibuv/src/win/winsock.c | 15 +- 48 files changed, 1856 insertions(+), 356 deletions(-) create mode 100644 Utilities/cmlibuv/src/unix/haiku.c hooks/post-receive -- CMake From kwrobot at kitware.com Thu Jun 20 11:43:06 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Thu, 20 Jun 2019 11:43:06 -0400 (EDT) Subject: [Cmake-commits] CMake branch, release, updated. v3.15.0-rc2-4-g036752c Message-ID: <20190620154306.65A50FEBF1@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, release has been updated via 036752cc0e5f98a611c23c044e3bc1b484b02f53 (commit) via b55e5d6641b6233eeb85926bb3abf39336051d90 (commit) via fdab21f30b48021a6ecad2307b092b4d55561ae9 (commit) via d08548c62424437909a6b7f0198733cbff22296f (commit) from 5c7880956f9b3daea561c7bf817b27aa47b53dd0 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- ----------------------------------------------------------------------- Summary of changes: Help/prop_tgt/AUTOMOC.rst | 274 +++++++++++++++++++++++++++++++++++----------- Help/prop_tgt/AUTORCC.rst | 51 ++++++--- Help/prop_tgt/AUTOUIC.rst | 87 ++++++++++----- 3 files changed, 306 insertions(+), 106 deletions(-) hooks/post-receive -- CMake From kwrobot at kitware.com Thu Jun 20 11:53:04 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Thu, 20 Jun 2019 11:53:04 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc2-108-gcecf7e6 Message-ID: <20190620155304.AC9BEF50E8@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via cecf7e61c4816e4a3bb55df243c6bf84f6df6e58 (commit) via 8d59ebb7049f30f2c56f6d89b8e6c8db907c0324 (commit) via e33f4cb0cb18a03aa12b308ba654ec5f305365f8 (commit) via 6695383dd5a7855321dc011158e30ec24a7cf902 (commit) via d5333c0923b80f211bd7be1ec3a2a935d70481e8 (commit) from fe11593d3075c6bd7f425c55c7bfbb12b25f8b1f (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=cecf7e61c4816e4a3bb55df243c6bf84f6df6e58 commit cecf7e61c4816e4a3bb55df243c6bf84f6df6e58 Merge: fe11593 8d59ebb Author: Brad King AuthorDate: Thu Jun 20 15:42:53 2019 +0000 Commit: Kitware Robot CommitDate: Thu Jun 20 11:43:51 2019 -0400 Merge topic 'BundleUtilities-cleanup' 8d59ebb704 GetPrerequisites: use CMAKE_OBJDUMP if it is set e33f4cb0cb BundleUtilities: use if(... IN_LIST ...) 6695383dd5 BundleUtilities: remove needless variable expansions in if() arguments d5333c0923 BundleUtilities: simplify inclusion of GetPrerequisites Acked-by: Kitware Robot Merge-request: !3447 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8d59ebb7049f30f2c56f6d89b8e6c8db907c0324 commit 8d59ebb7049f30f2c56f6d89b8e6c8db907c0324 Author: Rolf Eike Beer AuthorDate: Fri Jun 14 08:38:24 2019 +0200 Commit: Rolf Eike Beer CommitDate: Wed Jun 19 07:14:31 2019 +0200 GetPrerequisites: use CMAKE_OBJDUMP if it is set diff --git a/Modules/GetPrerequisites.cmake b/Modules/GetPrerequisites.cmake index 41d9dc1..2beea00 100644 --- a/Modules/GetPrerequisites.cmake +++ b/Modules/GetPrerequisites.cmake @@ -710,7 +710,9 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa find_program(gp_dumpbin "dumpbin" PATHS ${gp_cmd_paths}) if(gp_dumpbin) set(gp_tool "dumpbin") - else() # Try harder. Maybe we're on MinGW + elseif(CMAKE_OBJDUMP) # Try harder. Maybe we're on MinGW + set(gp_tool "${CMAKE_OBJDUMP}") + else() set(gp_tool "objdump") endif() endif() https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e33f4cb0cb18a03aa12b308ba654ec5f305365f8 commit e33f4cb0cb18a03aa12b308ba654ec5f305365f8 Author: Rolf Eike Beer AuthorDate: Fri Jun 14 08:33:27 2019 +0200 Commit: Rolf Eike Beer CommitDate: Wed Jun 19 07:14:25 2019 +0200 BundleUtilities: use if(... IN_LIST ...) diff --git a/Modules/BundleUtilities.cmake b/Modules/BundleUtilities.cmake index 182720b..2f3b9e1 100644 --- a/Modules/BundleUtilities.cmake +++ b/Modules/BundleUtilities.cmake @@ -243,6 +243,9 @@ if(DEFINED CMAKE_GENERATOR) endif() endif() +cmake_policy(PUSH) +cmake_policy(SET CMP0057 NEW) # if IN_LIST + # The functions defined in this file depend on the get_prerequisites function # (and possibly others) found in: # @@ -599,17 +602,9 @@ function(get_bundle_keys app libs dirs keys_var) set_bundle_key_values(${keys_var} "${lib}" "${lib}" "${exepath}" "${dirs}" 0 "${main_rpaths}") set(prereqs "") - set(ignoreFile FALSE) get_filename_component(prereq_filename ${lib} NAME) - if(NOT CFG_IGNORE_ITEM STREQUAL "") - foreach(item ${CFG_IGNORE_ITEM}) - if(item STREQUAL prereq_filename) - set(ignoreFile TRUE) - endif() - endforeach() - endif() - if(NOT ignoreFile) + if(NOT prereq_filename IN_LIST CFG_IGNORE_ITEM) get_prerequisites("${lib}" prereqs 1 1 "${exepath}" "${dirs}" "${main_rpaths}") foreach(pr ${prereqs}) set_bundle_key_values(${keys_var} "${lib}" "${pr}" "${exepath}" "${dirs}" 1 "${main_rpaths}") @@ -642,17 +637,9 @@ function(get_bundle_keys app libs dirs keys_var) # Add each prerequisite to the keys: # set(prereqs "") - set(ignoreFile FALSE) get_filename_component(prereq_filename ${exe} NAME) - if(NOT CFG_IGNORE_ITEM STREQUAL "" ) - foreach(item ${CFG_IGNORE_ITEM}) - if(item STREQUAL prereq_filename) - set(ignoreFile TRUE) - endif() - endforeach() - endif() - if(NOT ignoreFile) + if(NOT prereq_filename IN_LIST CFG_IGNORE_ITEM) get_prerequisites("${exe}" prereqs 1 1 "${exepath}" "${dirs}" "${exe_rpaths}") foreach(pr ${prereqs}) set_bundle_key_values(${keys_var} "${exe}" "${pr}" "${exepath}" "${dirs}" 1 "${exe_rpaths}") @@ -1031,18 +1018,9 @@ function(verify_bundle_prerequisites bundle result_var info_var) message(STATUS "executable file ${count}: ${f}") set(prereqs "") - set(ignoreFile FALSE) get_filename_component(prereq_filename ${f} NAME) - if(NOT CFG_IGNORE_ITEM STREQUAL "" ) - foreach(item ${CFG_IGNORE_ITEM}) - if(item STREQUAL prereq_filename) - set(ignoreFile TRUE) - endif() - endforeach() - endif() - - if(NOT ignoreFile) + if(NOT prereq_filename IN_LIST CFG_IGNORE_ITEM) get_item_rpaths(${f} _main_exe_rpaths) get_prerequisites("${f}" prereqs 1 1 "${exepath}" "${_main_exe_rpaths}") @@ -1141,3 +1119,5 @@ function(verify_app app) message(FATAL_ERROR "error: verify_app failed") endif() endfunction() + +cmake_policy(POP) https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6695383dd5a7855321dc011158e30ec24a7cf902 commit 6695383dd5a7855321dc011158e30ec24a7cf902 Author: Rolf Eike Beer AuthorDate: Fri Jun 14 08:30:34 2019 +0200 Commit: Rolf Eike Beer CommitDate: Mon Jun 17 17:49:31 2019 +0200 BundleUtilities: remove needless variable expansions in if() arguments diff --git a/Modules/BundleUtilities.cmake b/Modules/BundleUtilities.cmake index ca92f85..182720b 100644 --- a/Modules/BundleUtilities.cmake +++ b/Modules/BundleUtilities.cmake @@ -279,7 +279,7 @@ function(get_bundle_main_executable bundle result_var) endif() endforeach() - if(NOT "${bundle_executable}" STREQUAL "") + if(NOT bundle_executable STREQUAL "") if(EXISTS "${bundle}/Contents/MacOS/${bundle_executable}") set(result "${bundle}/Contents/MacOS/${bundle_executable}") else() @@ -601,9 +601,9 @@ function(get_bundle_keys app libs dirs keys_var) set(prereqs "") set(ignoreFile FALSE) get_filename_component(prereq_filename ${lib} NAME) - if(NOT "${CFG_IGNORE_ITEM}" STREQUAL "" ) + if(NOT CFG_IGNORE_ITEM STREQUAL "") foreach(item ${CFG_IGNORE_ITEM}) - if("${item}" STREQUAL "${prereq_filename}") + if(item STREQUAL prereq_filename) set(ignoreFile TRUE) endif() endforeach() @@ -626,7 +626,7 @@ function(get_bundle_keys app libs dirs keys_var) foreach(exe ${exes}) # Main executable is scanned first above: # - if(NOT "${exe}" STREQUAL "${executable}") + if(NOT exe STREQUAL executable) # Add the exe itself to the keys: # set_bundle_key_values(${keys_var} "${exe}" "${exe}" "${exepath}" "${dirs}" 0 "${main_rpaths}") @@ -644,9 +644,9 @@ function(get_bundle_keys app libs dirs keys_var) set(prereqs "") set(ignoreFile FALSE) get_filename_component(prereq_filename ${exe} NAME) - if(NOT "${CFG_IGNORE_ITEM}" STREQUAL "" ) + if(NOT CFG_IGNORE_ITEM STREQUAL "" ) foreach(item ${CFG_IGNORE_ITEM}) - if("${item}" STREQUAL "${prereq_filename}") + if(item STREQUAL prereq_filename) set(ignoreFile TRUE) endif() endforeach() @@ -664,7 +664,7 @@ function(get_bundle_keys app libs dirs keys_var) # preserve library symlink structure foreach(key ${${keys_var}}) - if("${${key}_COPYFLAG}" STREQUAL 1) + if("${${key}_COPYFLAG}" STREQUAL "1") if(IS_SYMLINK "${${key}_RESOLVED_ITEM}") get_filename_component(target "${${key}_RESOLVED_ITEM}" REALPATH) set_bundle_key_values(${keys_var} "${exe}" "${target}" "${exepath}" "${dirs}" 1 "${exe_rpaths}") @@ -681,7 +681,7 @@ function(get_bundle_keys app libs dirs keys_var) get_filename_component(resolved_item_compare "${resolved_item_compare}" NAME) get_filename_component(resolved_embedded_item_compare "${resolved_embedded_item_compare}" NAME) - if(NOT "${resolved_item_compare}" STREQUAL "${resolved_embedded_item_compare}") + if(NOT resolved_item_compare STREQUAL resolved_embedded_item_compare) set(${key}_COPYFLAG "2") set(${key}_RESOLVED_ITEM "${${targetkey}_RESOLVED_EMBEDDED_ITEM}") endif() @@ -715,7 +715,7 @@ function(link_resolved_item_into_bundle resolved_item resolved_embedded_item) set(resolved_embedded_item_compare "${resolved_embedded_item}") endif() - if("${resolved_item_compare}" STREQUAL "${resolved_embedded_item_compare}") + if(resolved_item_compare STREQUAL resolved_embedded_item_compare) message(STATUS "warning: resolved_item == resolved_embedded_item - not linking...") else() get_filename_component(target_dir "${resolved_embedded_item}" DIRECTORY) @@ -737,7 +737,7 @@ function(copy_resolved_item_into_bundle resolved_item resolved_embedded_item) set(resolved_embedded_item_compare "${resolved_embedded_item}") endif() - if("${resolved_item_compare}" STREQUAL "${resolved_embedded_item_compare}") + if(resolved_item_compare STREQUAL resolved_embedded_item_compare) message(STATUS "warning: resolved_item == resolved_embedded_item - not copying...") else() #message(STATUS "copying COMMAND ${CMAKE_COMMAND} -E copy ${resolved_item} ${resolved_embedded_item}") @@ -760,7 +760,7 @@ function(copy_resolved_framework_into_bundle resolved_item resolved_embedded_ite set(resolved_embedded_item_compare "${resolved_embedded_item}") endif() - if("${resolved_item_compare}" STREQUAL "${resolved_embedded_item_compare}") + if(resolved_item_compare STREQUAL resolved_embedded_item_compare) message(STATUS "warning: resolved_item == resolved_embedded_item - not copying...") else() if(BU_COPY_FULL_FRAMEWORK_CONTENTS) @@ -840,12 +840,12 @@ function(fixup_bundle_item resolved_embedded_item exepath dirs) string(LENGTH "${resolved_embedded_item}" resolved_embedded_item_length) set(path_too_short 0) set(is_embedded 0) - if(${resolved_embedded_item_length} LESS ${exe_dotapp_dir_length}) + if(resolved_embedded_item_length LESS exe_dotapp_dir_length) set(path_too_short 1) endif() if(NOT path_too_short) string(SUBSTRING "${resolved_embedded_item}" 0 ${exe_dotapp_dir_length} item_substring) - if("${exe_dotapp_dir}/" STREQUAL "${item_substring}") + if("${exe_dotapp_dir}/" STREQUAL item_substring) set(is_embedded 1) endif() endif() @@ -1034,9 +1034,9 @@ function(verify_bundle_prerequisites bundle result_var info_var) set(ignoreFile FALSE) get_filename_component(prereq_filename ${f} NAME) - if(NOT "${CFG_IGNORE_ITEM}" STREQUAL "" ) + if(NOT CFG_IGNORE_ITEM STREQUAL "" ) foreach(item ${CFG_IGNORE_ITEM}) - if("${item}" STREQUAL "${prereq_filename}") + if(item STREQUAL prereq_filename) set(ignoreFile TRUE) endif() endforeach() @@ -1062,11 +1062,11 @@ function(verify_bundle_prerequisites bundle result_var info_var) gp_file_type("${f}" "${p}" p_type) if(APPLE) - if(NOT "${p_type}" STREQUAL "embedded" AND NOT "${p_type}" STREQUAL "system") + if(NOT p_type STREQUAL "embedded" AND NOT p_type STREQUAL "system") set(external_prereqs ${external_prereqs} "${p}") endif() else() - if(NOT "${p_type}" STREQUAL "local" AND NOT "${p_type}" STREQUAL "system") + if(NOT p_type STREQUAL "local" AND NOT p_type STREQUAL "system") set(external_prereqs ${external_prereqs} "${p}") endif() endif() https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d5333c0923b80f211bd7be1ec3a2a935d70481e8 commit d5333c0923b80f211bd7be1ec3a2a935d70481e8 Author: Rolf Eike Beer AuthorDate: Fri Jun 14 08:17:33 2019 +0200 Commit: Rolf Eike Beer CommitDate: Mon Jun 17 17:49:31 2019 +0200 BundleUtilities: simplify inclusion of GetPrerequisites diff --git a/Modules/BundleUtilities.cmake b/Modules/BundleUtilities.cmake index f94fc5c..ca92f85 100644 --- a/Modules/BundleUtilities.cmake +++ b/Modules/BundleUtilities.cmake @@ -246,8 +246,7 @@ endif() # The functions defined in this file depend on the get_prerequisites function # (and possibly others) found in: # -get_filename_component(BundleUtilities_cmake_dir "${CMAKE_CURRENT_LIST_FILE}" PATH) -include("${BundleUtilities_cmake_dir}/GetPrerequisites.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/GetPrerequisites.cmake") function(get_bundle_main_executable bundle result_var) ----------------------------------------------------------------------- Summary of changes: Modules/BundleUtilities.cmake | 61 ++++++++++++++---------------------------- Modules/GetPrerequisites.cmake | 4 ++- 2 files changed, 23 insertions(+), 42 deletions(-) hooks/post-receive -- CMake From kwrobot at kitware.com Fri Jun 21 00:03:06 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Fri, 21 Jun 2019 00:03:06 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc2-109-g512013e Message-ID: <20190621040306.22A011035DA@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 512013e276e66551c19c12af01336f96c26965a5 (commit) from cecf7e61c4816e4a3bb55df243c6bf84f6df6e58 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=512013e276e66551c19c12af01336f96c26965a5 commit 512013e276e66551c19c12af01336f96c26965a5 Author: Kitware Robot AuthorDate: Fri Jun 21 00:01:07 2019 -0400 Commit: Kitware Robot CommitDate: Fri Jun 21 00:01:07 2019 -0400 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 39d6e36..ad0386e 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 15) -set(CMake_VERSION_PATCH 20190620) +set(CMake_VERSION_PATCH 20190621) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From kwrobot at kitware.com Fri Jun 21 11:13:09 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Fri, 21 Jun 2019 11:13:09 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc2-112-g12c65a5 Message-ID: <20190621151309.A16E1FE787@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 12c65a52bd3c8eee564cf766a260b98602942a5f (commit) via 02f527c66a6f9f0fa0d3fd4a816ea2bd9e3ba35f (commit) via f0a89149bc569020e281c5908733bf4b7eeddf15 (commit) from 512013e276e66551c19c12af01336f96c26965a5 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=12c65a52bd3c8eee564cf766a260b98602942a5f commit 12c65a52bd3c8eee564cf766a260b98602942a5f Merge: 512013e 02f527c Author: Brad King AuthorDate: Fri Jun 21 15:06:56 2019 +0000 Commit: Kitware Robot CommitDate: Fri Jun 21 11:07:56 2019 -0400 Merge topic 'find-control-vars' 02f527c66a Find: Provide global controls for the `NO_[]_PATH` call options f0a89149bc RunCMake: Automatically support platform out override files Acked-by: Kitware Robot Merge-request: !3444 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=02f527c66a6f9f0fa0d3fd4a816ea2bd9e3ba35f commit 02f527c66a6f9f0fa0d3fd4a816ea2bd9e3ba35f Author: Robert Maynard AuthorDate: Wed Jun 12 16:04:22 2019 -0400 Commit: Brad King CommitDate: Fri Jun 21 11:06:39 2019 -0400 Find: Provide global controls for the `NO_[]_PATH` call options diff --git a/Help/command/FIND_XXX.txt b/Help/command/FIND_XXX.txt index dde4dbb..fc8c55e 100644 --- a/Help/command/FIND_XXX.txt +++ b/Help/command/FIND_XXX.txt @@ -89,7 +89,8 @@ If ``NO_DEFAULT_PATH`` is not specified, the search process is as follows: searched after paths from the current module, i.e. ``_ROOT``, ``ENV{_ROOT}``, ``_ROOT``, ``ENV{_ROOT}``, etc. - This can be skipped if ``NO_PACKAGE_ROOT_PATH`` is passed. + This can be skipped if ``NO_PACKAGE_ROOT_PATH`` is passed or by setting + the :variable:`CMAKE_FIND_USE_PACAKGE_ROOT_PATH` to ``FALSE``. See policy :policy:`CMP0074`. * |FIND_PACKAGE_ROOT_PREFIX_PATH_XXX| @@ -97,7 +98,8 @@ If ``NO_DEFAULT_PATH`` is not specified, the search process is as follows: 2. Search paths specified in cmake-specific cache variables. These are intended to be used on the command line with a ``-DVAR=value``. The values are interpreted as :ref:`semicolon-separated lists `. - This can be skipped if ``NO_CMAKE_PATH`` is passed. + This can be skipped if ``NO_CMAKE_PATH`` is passed or by setting the + :variable:`CMAKE_FIND_USE_CMAKE_PATH` to ``FALSE``. * |CMAKE_PREFIX_PATH_XXX| * |CMAKE_XXX_PATH| @@ -107,7 +109,8 @@ If ``NO_DEFAULT_PATH`` is not specified, the search process is as follows: These are intended to be set in the user's shell configuration, and therefore use the host's native path separator (``;`` on Windows and ``:`` on UNIX). - This can be skipped if ``NO_CMAKE_ENVIRONMENT_PATH`` is passed. + This can be skipped if ``NO_CMAKE_ENVIRONMENT_PATH`` is passed or + by setting the :variable:`CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH` to ``FALSE``. * |CMAKE_PREFIX_PATH_XXX| * |CMAKE_XXX_PATH| @@ -119,13 +122,16 @@ If ``NO_DEFAULT_PATH`` is not specified, the search process is as follows: Hard-coded guesses should be specified with the ``PATHS`` option. 5. Search the standard system environment variables. - This can be skipped if ``NO_SYSTEM_ENVIRONMENT_PATH`` is an argument. + This can be skipped if ``NO_SYSTEM_ENVIRONMENT_PATH`` is passed or by + setting the :variable:`CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH` to ``FALSE``. * |SYSTEM_ENVIRONMENT_PATH_XXX| + * |SYSTEM_ENVIRONMENT_PATH_WINDOWS_XXX| 6. Search cmake variables defined in the Platform files for the current system. This can be skipped if ``NO_CMAKE_SYSTEM_PATH`` - is passed. + is passed or by setting the :variable:`CMAKE_FIND_USE_CMAKE_SYSTEM_PATH` + to ``FALSE``. * |CMAKE_SYSTEM_PREFIX_PATH_XXX| * |CMAKE_SYSTEM_XXX_PATH| diff --git a/Help/command/find_file.rst b/Help/command/find_file.rst index 2a14ad7..3f03f37 100644 --- a/Help/command/find_file.rst +++ b/Help/command/find_file.rst @@ -17,11 +17,10 @@ find_file .. |CMAKE_XXX_PATH| replace:: :variable:`CMAKE_INCLUDE_PATH` .. |CMAKE_XXX_MAC_PATH| replace:: :variable:`CMAKE_FRAMEWORK_PATH` -.. |SYSTEM_ENVIRONMENT_PATH_XXX| replace:: Directories in ``INCLUDE``. - On Windows hosts: - ``/include/`` if :variable:`CMAKE_LIBRARY_ARCHITECTURE` - is set, and |SYSTEM_ENVIRONMENT_PREFIX_PATH_XXX_SUBDIR|, and the - directories in ``PATH`` itself. +.. |SYSTEM_ENVIRONMENT_PATH_XXX| replace:: The directories in ``PATH`` and ``INCLUDE``. +.. |SYSTEM_ENVIRONMENT_PATH_WINDOWS_XXX| replace:: On Windows hosts: + ``/include/`` if :variable:`CMAKE_LIBRARY_ARCHITECTURE` + is set, and |SYSTEM_ENVIRONMENT_PREFIX_PATH_XXX_SUBDIR|. .. |CMAKE_SYSTEM_PREFIX_PATH_XXX| replace:: ``/include/`` if :variable:`CMAKE_LIBRARY_ARCHITECTURE` diff --git a/Help/command/find_library.rst b/Help/command/find_library.rst index 0861d67..8a55aca 100644 --- a/Help/command/find_library.rst +++ b/Help/command/find_library.rst @@ -17,11 +17,10 @@ find_library .. |CMAKE_XXX_PATH| replace:: :variable:`CMAKE_LIBRARY_PATH` .. |CMAKE_XXX_MAC_PATH| replace:: :variable:`CMAKE_FRAMEWORK_PATH` -.. |SYSTEM_ENVIRONMENT_PATH_XXX| replace:: Directories in ``LIB``. - On Windows hosts: - ``/lib/`` if :variable:`CMAKE_LIBRARY_ARCHITECTURE` is set, - and |SYSTEM_ENVIRONMENT_PREFIX_PATH_XXX_SUBDIR|, - and the directories in ``PATH`` itself. +.. |SYSTEM_ENVIRONMENT_PATH_XXX| replace:: The directories in ``PATH`` and ``INCLUDE``. +.. |SYSTEM_ENVIRONMENT_PATH_WINDOWS_XXX| replace:: On Windows hosts: + ``/lib/`` if :variable:`CMAKE_LIBRARY_ARCHITECTURE` + is set, and |SYSTEM_ENVIRONMENT_PREFIX_PATH_XXX_SUBDIR|. .. |CMAKE_SYSTEM_PREFIX_PATH_XXX| replace:: ``/lib/`` if :variable:`CMAKE_LIBRARY_ARCHITECTURE` is set, diff --git a/Help/command/find_path.rst b/Help/command/find_path.rst index 988a3fa..52ffe3c 100644 --- a/Help/command/find_path.rst +++ b/Help/command/find_path.rst @@ -17,11 +17,10 @@ find_path .. |CMAKE_XXX_PATH| replace:: :variable:`CMAKE_INCLUDE_PATH` .. |CMAKE_XXX_MAC_PATH| replace:: :variable:`CMAKE_FRAMEWORK_PATH` -.. |SYSTEM_ENVIRONMENT_PATH_XXX| replace:: Directories in ``INCLUDE``. - On Windows hosts: - ``/include/`` if :variable:`CMAKE_LIBRARY_ARCHITECTURE` - is set, and |SYSTEM_ENVIRONMENT_PREFIX_PATH_XXX_SUBDIR|, and the - directories in ``PATH`` itself. +.. |SYSTEM_ENVIRONMENT_PATH_XXX| replace:: The directories in ``PATH`` and ``INCLUDE``. +.. |SYSTEM_ENVIRONMENT_PATH_WINDOWS_XXX| replace:: On Windows hosts: + ``/include/`` if :variable:`CMAKE_LIBRARY_ARCHITECTURE` + is set, and |SYSTEM_ENVIRONMENT_PREFIX_PATH_XXX_SUBDIR|. .. |CMAKE_SYSTEM_PREFIX_PATH_XXX| replace:: ``/include/`` if :variable:`CMAKE_LIBRARY_ARCHITECTURE` diff --git a/Help/command/find_program.rst b/Help/command/find_program.rst index 4f00773..e2ff693 100644 --- a/Help/command/find_program.rst +++ b/Help/command/find_program.rst @@ -15,7 +15,8 @@ find_program .. |CMAKE_XXX_PATH| replace:: :variable:`CMAKE_PROGRAM_PATH` .. |CMAKE_XXX_MAC_PATH| replace:: :variable:`CMAKE_APPBUNDLE_PATH` -.. |SYSTEM_ENVIRONMENT_PATH_XXX| replace:: ``PATH`` +.. |SYSTEM_ENVIRONMENT_PATH_XXX| replace:: The directories in ``PATH`` itself. +.. |SYSTEM_ENVIRONMENT_PATH_WINDOWS_XXX| replace:: On Windows hosts no extra search paths are included .. |CMAKE_SYSTEM_PREFIX_PATH_XXX| replace:: |CMAKE_SYSTEM_PREFIX_PATH_XXX_SUBDIR| diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst index 75ddd5d..cc6a7d2 100644 --- a/Help/manual/cmake-variables.7.rst +++ b/Help/manual/cmake-variables.7.rst @@ -180,6 +180,11 @@ Variables that Change Behavior /variable/CMAKE_FIND_ROOT_PATH_MODE_LIBRARY /variable/CMAKE_FIND_ROOT_PATH_MODE_PACKAGE /variable/CMAKE_FIND_ROOT_PATH_MODE_PROGRAM + /variable/CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH + /variable/CMAKE_FIND_USE_CMAKE_PATH + /variable/CMAKE_FIND_USE_CMAKE_SYSTEM_PATH + /variable/CMAKE_FIND_USE_PACAKGE_ROOT_PATH + /variable/CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH /variable/CMAKE_FRAMEWORK_PATH /variable/CMAKE_IGNORE_PATH /variable/CMAKE_INCLUDE_DIRECTORIES_BEFORE diff --git a/Help/release/dev/global-controls-over-find-locations.rst b/Help/release/dev/global-controls-over-find-locations.rst new file mode 100644 index 0000000..d915fbb --- /dev/null +++ b/Help/release/dev/global-controls-over-find-locations.rst @@ -0,0 +1,11 @@ +global-controls-over-find-locations +----------------------------------- + +* The :command:`find_file`, :command:`find_library`, :command:`find_path`, + and :command:`find_program` commands have learned to check the following + variables to control searching + * :variable:`CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH` - Controls the searching the cmake-specific environment variables. + * :variable:`CMAKE_FIND_USE_CMAKE_PATH` - Controls the searching the cmake-specific cache variables. + * :variable:`CMAKE_FIND_USE_CMAKE_SYSTEM_PATH` - Controls the searching cmake platform specific variables. + * :variable:`CMAKE_FIND_USE_PACAKGE_ROOT_PATH` - Controls the searching of :variable:`_ROOT` variables. + * :variable:`CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH` - Controls the searching the standard system environment variables. diff --git a/Help/variable/CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH.rst b/Help/variable/CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH.rst new file mode 100644 index 0000000..3db510f --- /dev/null +++ b/Help/variable/CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH.rst @@ -0,0 +1,11 @@ +CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH +------------------------------------- + +Controls the searching the cmake-specific environment variables by the :command:`find_program`, +:command:`find_library`, :command:`find_file`, :command:`find_package`, and :command:`find_path`. +This is useful in cross-compiling environments. + +By default this this is set to ``TRUE``. + +See also the :variable:`CMAKE_FIND_USE_CMAKE_PATH`, :variable:`CMAKE_FIND_USE_CMAKE_SYSTEM_PATH`, +:variable:`CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH`, and :variable:`CMAKE_FIND_USE_PACAKGE_ROOT_PATH` variables. diff --git a/Help/variable/CMAKE_FIND_USE_CMAKE_PATH.rst b/Help/variable/CMAKE_FIND_USE_CMAKE_PATH.rst new file mode 100644 index 0000000..86a6186 --- /dev/null +++ b/Help/variable/CMAKE_FIND_USE_CMAKE_PATH.rst @@ -0,0 +1,11 @@ +CMAKE_FIND_USE_CMAKE_PATH +------------------------- + +Controls the searching the cmake-specific cache variables by the :command:`find_program`, +:command:`find_library`, :command:`find_file`, :command:`find_package`, and :command:`find_path`. +This is useful in cross-compiling environments. + +By default this this is set to ``TRUE``. + +See also the :variable:`CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH`, :variable:`CMAKE_FIND_USE_CMAKE_SYSTEM_PATH`, +:variable:`CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH`, and :variable:`CMAKE_FIND_USE_PACAKGE_ROOT_PATH` variables. diff --git a/Help/variable/CMAKE_FIND_USE_CMAKE_SYSTEM_PATH.rst b/Help/variable/CMAKE_FIND_USE_CMAKE_SYSTEM_PATH.rst new file mode 100644 index 0000000..b4171c0 --- /dev/null +++ b/Help/variable/CMAKE_FIND_USE_CMAKE_SYSTEM_PATH.rst @@ -0,0 +1,11 @@ +CMAKE_FIND_USE_CMAKE_SYSTEM_PATH +-------------------------------- + +Controls the searching cmake platform specific variables by the :command:`find_program`, +:command:`find_library`, :command:`find_file`, :command:`find_package`, and :command:`find_path`. +This is useful in cross-compiling environments. + +By default this this is set to ``TRUE``. + +See also the :variable:`CMAKE_FIND_USE_CMAKE_PATH`, :variable:`CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH`, +:variable:`CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH`, and :variable:`CMAKE_FIND_USE_PACAKGE_ROOT_PATH` variables. diff --git a/Help/variable/CMAKE_FIND_USE_PACAKGE_ROOT_PATH.rst b/Help/variable/CMAKE_FIND_USE_PACAKGE_ROOT_PATH.rst new file mode 100644 index 0000000..ac25ec9 --- /dev/null +++ b/Help/variable/CMAKE_FIND_USE_PACAKGE_ROOT_PATH.rst @@ -0,0 +1,11 @@ +CMAKE_FIND_USE_PACAKGE_ROOT_PATH +-------------------------------- + +Controls the searching of :variable:`_ROOT` variables by the :command:`find_program`, +:command:`find_library`, :command:`find_file`, :command:`find_package`, and :command:`find_path`. +This is useful in cross-compiling environments. + +By default this this is set to ``TRUE``. + +See also the :variable:`CMAKE_FIND_USE_CMAKE_PATH`, :variable:`CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH`, +:variable:`CMAKE_FIND_USE_CMAKE_SYSTEM_PATH`, and :variable:`CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH` variables. diff --git a/Help/variable/CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH.rst b/Help/variable/CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH.rst new file mode 100644 index 0000000..fd0582f --- /dev/null +++ b/Help/variable/CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH.rst @@ -0,0 +1,11 @@ +CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH +-------------------------------------- + +Controls the searching the standard system environment variables by the :command:`find_program`, +:command:`find_library`, :command:`find_file`, :command:`find_package`, and :command:`find_path`. +This is useful in cross-compiling environments. + +By default this this is set to ``TRUE``. + +See also the :variable:`CMAKE_FIND_USE_CMAKE_PATH`, :variable:`CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH`, +:variable:`CMAKE_FIND_USE_CMAKE_SYSTEM_PATH`, and :variable:`CMAKE_FIND_USE_PACAKGE_ROOT_PATH` variables. diff --git a/Source/cmFindBase.cxx b/Source/cmFindBase.cxx index e590802..be7964a 100644 --- a/Source/cmFindBase.cxx +++ b/Source/cmFindBase.cxx @@ -67,6 +67,9 @@ bool cmFindBase::ParseArguments(std::vector const& argsIn) } this->AlreadyInCache = false; + // Find what search path locations have been enabled/disable + this->SelectDefaultSearchModes(); + // Find the current root path mode. this->SelectDefaultRootPathMode(); diff --git a/Source/cmFindCommon.cxx b/Source/cmFindCommon.cxx index 954558f..c6b9049 100644 --- a/Source/cmFindCommon.cxx +++ b/Source/cmFindCommon.cxx @@ -3,6 +3,7 @@ #include "cmFindCommon.h" #include +#include #include #include @@ -144,6 +145,26 @@ void cmFindCommon::SelectDefaultMacMode() } } +void cmFindCommon::SelectDefaultSearchModes() +{ + const std::array, 5> search_paths = { + { { this->NoPackageRootPath, "CMAKE_FIND_USE_PACAKGE_ROOT_PATH" }, + { this->NoCMakePath, "CMAKE_FIND_USE_CMAKE_PATH" }, + { this->NoCMakeEnvironmentPath, + "CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH" }, + { this->NoSystemEnvironmentPath, + "CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH" }, + { this->NoCMakeSystemPath, "CMAKE_FIND_USE_CMAKE_SYSTEM_PATH" } } + }; + + for (auto& path : search_paths) { + const char* def = this->Makefile->GetDefinition(path.second); + if (def) { + path.first = !cmSystemTools::IsOn(def); + } + } +} + void cmFindCommon::RerootPaths(std::vector& paths) { #if 0 diff --git a/Source/cmFindCommon.h b/Source/cmFindCommon.h index 89ff174..d95eeb1 100644 --- a/Source/cmFindCommon.h +++ b/Source/cmFindCommon.h @@ -90,6 +90,9 @@ protected: /** Compute the current default bundle/framework search policy. */ void SelectDefaultMacMode(); + /** Compute the current default search modes based on global variables. */ + void SelectDefaultSearchModes(); + // Path arguments prior to path manipulation routines std::vector UserHintsArgs; std::vector UserGuessArgs; diff --git a/Tests/RunCMake/find_file/FromPATHEnv-stdout-cygwin.txt b/Tests/RunCMake/find_file/FromPATHEnv-stdout-cygwin.txt new file mode 100644 index 0000000..6912bdf --- /dev/null +++ b/Tests/RunCMake/find_file/FromPATHEnv-stdout-cygwin.txt @@ -0,0 +1,9 @@ +-- PrefixInPATH_File='PrefixInPATH_File-NOTFOUND' +-- PrefixInPATH_File='.*/Tests/RunCMake/find_file/include/PrefixInPATH.h' +-- PrefixInPATH_File='.*/Tests/RunCMake/find_file/include/PrefixInPATH.h' +-- PrefixInPATH_File='PrefixInPATH_File-NOTFOUND' +-- PrefixInPATH_File='PrefixInPATH_File-NOTFOUND' +-- PrefixInPATH_File='PrefixInPATH_File-NOTFOUND' +-- PrefixInPATH_File='PrefixInPATH_File-NOTFOUND' +-- PrefixInPATH_File='PrefixInPATH_File-NOTFOUND' +-- PrefixInPATH_File='PrefixInPATH_File-NOTFOUND' diff --git a/Tests/RunCMake/find_file/FromPATHEnv-stdout-windows.txt b/Tests/RunCMake/find_file/FromPATHEnv-stdout-windows.txt new file mode 100644 index 0000000..6912bdf --- /dev/null +++ b/Tests/RunCMake/find_file/FromPATHEnv-stdout-windows.txt @@ -0,0 +1,9 @@ +-- PrefixInPATH_File='PrefixInPATH_File-NOTFOUND' +-- PrefixInPATH_File='.*/Tests/RunCMake/find_file/include/PrefixInPATH.h' +-- PrefixInPATH_File='.*/Tests/RunCMake/find_file/include/PrefixInPATH.h' +-- PrefixInPATH_File='PrefixInPATH_File-NOTFOUND' +-- PrefixInPATH_File='PrefixInPATH_File-NOTFOUND' +-- PrefixInPATH_File='PrefixInPATH_File-NOTFOUND' +-- PrefixInPATH_File='PrefixInPATH_File-NOTFOUND' +-- PrefixInPATH_File='PrefixInPATH_File-NOTFOUND' +-- PrefixInPATH_File='PrefixInPATH_File-NOTFOUND' diff --git a/Tests/RunCMake/find_file/FromPATHEnv-stdout.txt b/Tests/RunCMake/find_file/FromPATHEnv-stdout.txt new file mode 100644 index 0000000..27a83ad --- /dev/null +++ b/Tests/RunCMake/find_file/FromPATHEnv-stdout.txt @@ -0,0 +1,9 @@ +-- PrefixInPATH_File='PrefixInPATH_File-NOTFOUND' +-- PrefixInPATH_File='.*/Tests/RunCMake/find_file/include/PrefixInPATH.h' +-- PrefixInPATH_File='PrefixInPATH_File-NOTFOUND' +-- PrefixInPATH_File='PrefixInPATH_File-NOTFOUND' +-- PrefixInPATH_File='PrefixInPATH_File-NOTFOUND' +-- PrefixInPATH_File='PrefixInPATH_File-NOTFOUND' +-- PrefixInPATH_File='PrefixInPATH_File-NOTFOUND' +-- PrefixInPATH_File='PrefixInPATH_File-NOTFOUND' +-- PrefixInPATH_File='PrefixInPATH_File-NOTFOUND' diff --git a/Tests/RunCMake/find_file/FromPATHEnv.cmake b/Tests/RunCMake/find_file/FromPATHEnv.cmake new file mode 100644 index 0000000..9f058dd --- /dev/null +++ b/Tests/RunCMake/find_file/FromPATHEnv.cmake @@ -0,0 +1,24 @@ +set(ENV_PATH "$ENV{PATH}") +foreach(path "/does_not_exist" "/include" "") + unset(PrefixInPATH_File CACHE) + set(ENV{PATH} "${CMAKE_CURRENT_SOURCE_DIR}${path}") + find_file(PrefixInPATH_File NAMES PrefixInPATH.h) + message(STATUS "PrefixInPATH_File='${PrefixInPATH_File}'") +endforeach() + +set(CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH OFF) +foreach(path "/does_not_exist" "/include" "") + unset(PrefixInPATH_File CACHE) + set(ENV{PATH} "${CMAKE_CURRENT_SOURCE_DIR}${path}") + find_file(PrefixInPATH_File NAMES PrefixInPATH.h) + message(STATUS "PrefixInPATH_File='${PrefixInPATH_File}'") +endforeach() + +set(CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH ON) +foreach(path "/does_not_exist" "/include" "") + unset(PrefixInPATH_File CACHE) + set(ENV{PATH} "${CMAKE_CURRENT_SOURCE_DIR}${path}") + find_file(PrefixInPATH_File NAMES PrefixInPATH.h NO_SYSTEM_ENVIRONMENT_PATH) + message(STATUS "PrefixInPATH_File='${PrefixInPATH_File}'") +endforeach() +set(ENV{PATH} "${ENV_PATH}") diff --git a/Tests/RunCMake/find_file/FromPrefixPath-stdout.txt b/Tests/RunCMake/find_file/FromPrefixPath-stdout.txt new file mode 100644 index 0000000..4bd24aa --- /dev/null +++ b/Tests/RunCMake/find_file/FromPrefixPath-stdout.txt @@ -0,0 +1,6 @@ +-- PrefixInPATH_File='PrefixInPATH_File-NOTFOUND' +-- PrefixInPATH_File='.*/Tests/RunCMake/find_file/include/PrefixInPATH.h' +-- PrefixInPATH_File='.*/Tests/RunCMake/find_file/include/PrefixInPATH.h' +-- PrefixInPATH_File='PrefixInPATH_File-NOTFOUND' +-- PrefixInPATH_File='PrefixInPATH_File-NOTFOUND' +-- PrefixInPATH_File='PrefixInPATH_File-NOTFOUND' diff --git a/Tests/RunCMake/find_file/FromPrefixPath.cmake b/Tests/RunCMake/find_file/FromPrefixPath.cmake new file mode 100644 index 0000000..1bf8409 --- /dev/null +++ b/Tests/RunCMake/find_file/FromPrefixPath.cmake @@ -0,0 +1,17 @@ +set(ENV{PATH} "") +foreach(path "/does_not_exist" "/include" "") + unset(PrefixInPATH_File CACHE) + set(CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR}${path}") + find_file(PrefixInPATH_File NAMES PrefixInPATH.h) + message(STATUS "PrefixInPATH_File='${PrefixInPATH_File}'") +endforeach() + +set(CMAKE_FIND_USE_CMAKE_PATH OFF) +set(CMAKE_PREFIX_PATH ) +foreach(path "/does_not_exist" "/include" "") + unset(PrefixInPATH_File CACHE) + set(CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR}${path}") + find_file(PrefixInPATH_File NAMES PrefixInPATH.h) + message(STATUS "PrefixInPATH_File='${PrefixInPATH_File}'") +endforeach() +set(CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH ON) diff --git a/Tests/RunCMake/find_file/RunCMakeTest.cmake b/Tests/RunCMake/find_file/RunCMakeTest.cmake index 014f397..9f56a57 100644 --- a/Tests/RunCMake/find_file/RunCMakeTest.cmake +++ b/Tests/RunCMake/find_file/RunCMakeTest.cmake @@ -1,3 +1,5 @@ include(RunCMake) +run_cmake(FromPATHEnv) +run_cmake(FromPrefixPath) run_cmake(PrefixInPATH) diff --git a/Tests/RunCMake/find_library/FromPATHEnv-stdout-cygwin.txt b/Tests/RunCMake/find_library/FromPATHEnv-stdout-cygwin.txt new file mode 100644 index 0000000..01e2720 --- /dev/null +++ b/Tests/RunCMake/find_library/FromPATHEnv-stdout-cygwin.txt @@ -0,0 +1,6 @@ +-- CREATED_LIBRARY='CREATED_LIBRARY-NOTFOUND' +-- CREATED_LIBRARY='[^']*/Tests/RunCMake/find_library/FromPATHEnv-build/lib/libcreated.a' +-- CREATED_LIBRARY='[^']*/Tests/RunCMake/find_library/FromPATHEnv-build/lib/libcreated.a' +-- CREATED_LIBRARY='CREATED_LIBRARY-NOTFOUND' +-- CREATED_LIBRARY='CREATED_LIBRARY-NOTFOUND' +-- CREATED_LIBRARY='CREATED_LIBRARY-NOTFOUND' diff --git a/Tests/RunCMake/find_library/FromPATHEnv-stdout-windows.txt b/Tests/RunCMake/find_library/FromPATHEnv-stdout-windows.txt new file mode 100644 index 0000000..01e2720 --- /dev/null +++ b/Tests/RunCMake/find_library/FromPATHEnv-stdout-windows.txt @@ -0,0 +1,6 @@ +-- CREATED_LIBRARY='CREATED_LIBRARY-NOTFOUND' +-- CREATED_LIBRARY='[^']*/Tests/RunCMake/find_library/FromPATHEnv-build/lib/libcreated.a' +-- CREATED_LIBRARY='[^']*/Tests/RunCMake/find_library/FromPATHEnv-build/lib/libcreated.a' +-- CREATED_LIBRARY='CREATED_LIBRARY-NOTFOUND' +-- CREATED_LIBRARY='CREATED_LIBRARY-NOTFOUND' +-- CREATED_LIBRARY='CREATED_LIBRARY-NOTFOUND' diff --git a/Tests/RunCMake/find_library/FromPATHEnv-stdout.txt b/Tests/RunCMake/find_library/FromPATHEnv-stdout.txt new file mode 100644 index 0000000..4e570a6 --- /dev/null +++ b/Tests/RunCMake/find_library/FromPATHEnv-stdout.txt @@ -0,0 +1,6 @@ +-- CREATED_LIBRARY='CREATED_LIBRARY-NOTFOUND' +-- CREATED_LIBRARY='[^']*/Tests/RunCMake/find_library/FromPATHEnv-build/lib/libcreated.a' +-- CREATED_LIBRARY='CREATED_LIBRARY-NOTFOUND' +-- CREATED_LIBRARY='CREATED_LIBRARY-NOTFOUND' +-- CREATED_LIBRARY='CREATED_LIBRARY-NOTFOUND' +-- CREATED_LIBRARY='CREATED_LIBRARY-NOTFOUND' diff --git a/Tests/RunCMake/find_library/FromPATHEnv.cmake b/Tests/RunCMake/find_library/FromPATHEnv.cmake new file mode 100644 index 0000000..fec041d --- /dev/null +++ b/Tests/RunCMake/find_library/FromPATHEnv.cmake @@ -0,0 +1,22 @@ +list(APPEND CMAKE_FIND_LIBRARY_PREFIXES lib) +list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES .a) +set(ENV_PATH "$ENV{PATH}") +file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib) +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/lib/libcreated.a" "created") + +foreach(path "/does_not_exist" "/lib" "") + unset(CREATED_LIBRARY CACHE) + set(ENV{PATH} "${CMAKE_CURRENT_BINARY_DIR}${path}") + find_library(CREATED_LIBRARY NAMES created) + message(STATUS "CREATED_LIBRARY='${CREATED_LIBRARY}'") +endforeach() + +set(CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH OFF) +foreach(path "/does_not_exist" "/lib" "") + unset(CREATED_LIBRARY CACHE) + set(ENV{PATH} "${CMAKE_CURRENT_BINARY_DIR}${path}") + find_library(CREATED_LIBRARY NAMES created) + message(STATUS "CREATED_LIBRARY='${CREATED_LIBRARY}'") +endforeach() +set(CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH ON) +set(ENV{PATH} "${ENV_PATH}") diff --git a/Tests/RunCMake/find_library/FromPrefixPath-stdout.txt b/Tests/RunCMake/find_library/FromPrefixPath-stdout.txt new file mode 100644 index 0000000..de3df1a --- /dev/null +++ b/Tests/RunCMake/find_library/FromPrefixPath-stdout.txt @@ -0,0 +1,6 @@ +-- CREATED_LIBRARY='CREATED_LIBRARY-NOTFOUND' +-- CREATED_LIBRARY='[^']*/Tests/RunCMake/find_library/FromPrefixPath-build/lib/libcreated.a' +-- CREATED_LIBRARY='[^']*/Tests/RunCMake/find_library/FromPrefixPath-build/lib/libcreated.a' +-- CREATED_LIBRARY='CREATED_LIBRARY-NOTFOUND' +-- CREATED_LIBRARY='CREATED_LIBRARY-NOTFOUND' +-- CREATED_LIBRARY='CREATED_LIBRARY-NOTFOUND' diff --git a/Tests/RunCMake/find_library/FromPrefixPath.cmake b/Tests/RunCMake/find_library/FromPrefixPath.cmake new file mode 100644 index 0000000..04763a9 --- /dev/null +++ b/Tests/RunCMake/find_library/FromPrefixPath.cmake @@ -0,0 +1,24 @@ +list(APPEND CMAKE_FIND_LIBRARY_PREFIXES lib) +list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES .a) +set(ENV_PATH "$ENV{PATH}") +set(ENV{PATH} "") +file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib) +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/lib/libcreated.a" "created") + +foreach(path "/does_not_exist" "/lib" "") + unset(CREATED_LIBRARY CACHE) + set(CMAKE_PREFIX_PATH "${CMAKE_CURRENT_BINARY_DIR}${path}") + find_library(CREATED_LIBRARY NAMES created) + message(STATUS "CREATED_LIBRARY='${CREATED_LIBRARY}'") +endforeach() + +set(CMAKE_FIND_USE_CMAKE_PATH OFF) +set(CMAKE_PREFIX_PATH ) +foreach(path "/does_not_exist" "/lib" "") + unset(CREATED_LIBRARY CACHE) + set(CMAKE_PREFIX_PATH "${CMAKE_CURRENT_BINARY_DIR}${path}") + find_library(CREATED_LIBRARY NAMES created) + message(STATUS "CREATED_LIBRARY='${CREATED_LIBRARY}'") +endforeach() +set(CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH ON) +set(ENV{PATH} "${ENV_PATH}") diff --git a/Tests/RunCMake/find_library/RunCMakeTest.cmake b/Tests/RunCMake/find_library/RunCMakeTest.cmake index ecfa0fe..643a5b9 100644 --- a/Tests/RunCMake/find_library/RunCMakeTest.cmake +++ b/Tests/RunCMake/find_library/RunCMakeTest.cmake @@ -1,6 +1,8 @@ include(RunCMake) run_cmake(Created) +run_cmake(FromPrefixPath) +run_cmake(FromPATHEnv) if(CMAKE_HOST_UNIX) run_cmake(LibArchLink) endif() diff --git a/Tests/RunCMake/find_path/FromPATHEnv-stdout-cygwin.txt b/Tests/RunCMake/find_path/FromPATHEnv-stdout-cygwin.txt new file mode 100644 index 0000000..8f3e7ca --- /dev/null +++ b/Tests/RunCMake/find_path/FromPATHEnv-stdout-cygwin.txt @@ -0,0 +1,9 @@ +-- PATH_IN_ENV_PATH='PATH_IN_ENV_PATH-NOTFOUND' +-- PATH_IN_ENV_PATH='.*/Tests/RunCMake/find_path/include' +-- PATH_IN_ENV_PATH='.*/Tests/RunCMake/find_path/include' +-- PATH_IN_ENV_PATH='PATH_IN_ENV_PATH-NOTFOUND' +-- PATH_IN_ENV_PATH='PATH_IN_ENV_PATH-NOTFOUND' +-- PATH_IN_ENV_PATH='PATH_IN_ENV_PATH-NOTFOUND' +-- PATH_IN_ENV_PATH='PATH_IN_ENV_PATH-NOTFOUND' +-- PATH_IN_ENV_PATH='PATH_IN_ENV_PATH-NOTFOUND' +-- PATH_IN_ENV_PATH='PATH_IN_ENV_PATH-NOTFOUND' diff --git a/Tests/RunCMake/find_path/FromPATHEnv-stdout-windows.txt b/Tests/RunCMake/find_path/FromPATHEnv-stdout-windows.txt new file mode 100644 index 0000000..8f3e7ca --- /dev/null +++ b/Tests/RunCMake/find_path/FromPATHEnv-stdout-windows.txt @@ -0,0 +1,9 @@ +-- PATH_IN_ENV_PATH='PATH_IN_ENV_PATH-NOTFOUND' +-- PATH_IN_ENV_PATH='.*/Tests/RunCMake/find_path/include' +-- PATH_IN_ENV_PATH='.*/Tests/RunCMake/find_path/include' +-- PATH_IN_ENV_PATH='PATH_IN_ENV_PATH-NOTFOUND' +-- PATH_IN_ENV_PATH='PATH_IN_ENV_PATH-NOTFOUND' +-- PATH_IN_ENV_PATH='PATH_IN_ENV_PATH-NOTFOUND' +-- PATH_IN_ENV_PATH='PATH_IN_ENV_PATH-NOTFOUND' +-- PATH_IN_ENV_PATH='PATH_IN_ENV_PATH-NOTFOUND' +-- PATH_IN_ENV_PATH='PATH_IN_ENV_PATH-NOTFOUND' diff --git a/Tests/RunCMake/find_path/FromPATHEnv-stdout.txt b/Tests/RunCMake/find_path/FromPATHEnv-stdout.txt new file mode 100644 index 0000000..fd41bf4 --- /dev/null +++ b/Tests/RunCMake/find_path/FromPATHEnv-stdout.txt @@ -0,0 +1,9 @@ +-- PATH_IN_ENV_PATH='PATH_IN_ENV_PATH-NOTFOUND' +-- PATH_IN_ENV_PATH='.*/Tests/RunCMake/find_path/include' +-- PATH_IN_ENV_PATH='PATH_IN_ENV_PATH-NOTFOUND' +-- PATH_IN_ENV_PATH='PATH_IN_ENV_PATH-NOTFOUND' +-- PATH_IN_ENV_PATH='PATH_IN_ENV_PATH-NOTFOUND' +-- PATH_IN_ENV_PATH='PATH_IN_ENV_PATH-NOTFOUND' +-- PATH_IN_ENV_PATH='PATH_IN_ENV_PATH-NOTFOUND' +-- PATH_IN_ENV_PATH='PATH_IN_ENV_PATH-NOTFOUND' +-- PATH_IN_ENV_PATH='PATH_IN_ENV_PATH-NOTFOUND' diff --git a/Tests/RunCMake/find_path/FromPATHEnv.cmake b/Tests/RunCMake/find_path/FromPATHEnv.cmake new file mode 100644 index 0000000..af13d09 --- /dev/null +++ b/Tests/RunCMake/find_path/FromPATHEnv.cmake @@ -0,0 +1,25 @@ +set(ENV_PATH "$ENV{PATH}") +foreach(path "/does_not_exist" "/include" "") + unset(PATH_IN_ENV_PATH CACHE) + set(ENV{PATH} "${CMAKE_CURRENT_SOURCE_DIR}${path}") + find_path(PATH_IN_ENV_PATH NAMES PrefixInPATH.h) + message(STATUS "PATH_IN_ENV_PATH='${PATH_IN_ENV_PATH}'") +endforeach() + +set(CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH OFF) +foreach(path "/does_not_exist" "/include" "") + unset(PATH_IN_ENV_PATH CACHE) + set(ENV{PATH} "${CMAKE_CURRENT_SOURCE_DIR}${path}") + find_path(PATH_IN_ENV_PATH NAMES PrefixInPATH.h) + message(STATUS "PATH_IN_ENV_PATH='${PATH_IN_ENV_PATH}'") +endforeach() + +set(CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH ON) +foreach(path "/does_not_exist" "/include" "") + unset(PATH_IN_ENV_PATH CACHE) + set(ENV{PATH} "${CMAKE_CURRENT_SOURCE_DIR}${path}") + find_path(PATH_IN_ENV_PATH NAMES PrefixInPATH.h NO_SYSTEM_ENVIRONMENT_PATH) + message(STATUS "PATH_IN_ENV_PATH='${PATH_IN_ENV_PATH}'") +endforeach() + +set(ENV{PATH} "${ENV_PATH}") diff --git a/Tests/RunCMake/find_path/RunCMakeTest.cmake b/Tests/RunCMake/find_path/RunCMakeTest.cmake index 6d22124..8b5b5b7 100644 --- a/Tests/RunCMake/find_path/RunCMakeTest.cmake +++ b/Tests/RunCMake/find_path/RunCMakeTest.cmake @@ -1,5 +1,6 @@ include(RunCMake) +run_cmake(FromPATHEnv) run_cmake(PrefixInPATH) if(APPLE) diff --git a/Tests/RunCMake/find_program/EnvAndHints-stdout.txt b/Tests/RunCMake/find_program/EnvAndHints-stdout.txt index 39329b2..0051636 100644 --- a/Tests/RunCMake/find_program/EnvAndHints-stdout.txt +++ b/Tests/RunCMake/find_program/EnvAndHints-stdout.txt @@ -1 +1,4 @@ -- PROG='[^']*/Tests/RunCMake/find_program/A/testAandB' +-- PROG='PROG-NOTFOUND' +-- PROG='[^']*/Tests/RunCMake/find_program/B/testAandB' +-- PROG='[^']*/Tests/RunCMake/find_program/A/testAandB' diff --git a/Tests/RunCMake/find_program/EnvAndHints.cmake b/Tests/RunCMake/find_program/EnvAndHints.cmake index 14ebd6e..0f12eff 100644 --- a/Tests/RunCMake/find_program/EnvAndHints.cmake +++ b/Tests/RunCMake/find_program/EnvAndHints.cmake @@ -1,8 +1,31 @@ + set(ENV_PATH "$ENV{PATH}") set(ENV{PATH} ${CMAKE_CURRENT_SOURCE_DIR}/A) find_program(PROG NAMES testAandB + ) +message(STATUS "PROG='${PROG}'") +unset(PROG CACHE) + +set(CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH OFF) +find_program(PROG + NAMES testAandB + ) +message(STATUS "PROG='${PROG}'") +unset(PROG CACHE) + +find_program(PROG + NAMES testAandB + HINTS ${CMAKE_CURRENT_SOURCE_DIR}/B ${CMAKE_CURRENT_SOURCE_DIR}/A + ) +message(STATUS "PROG='${PROG}'") +unset(PROG CACHE) +set(ENV{PATH} "${ENV_PATH}") + +find_program(PROG + NAMES testAandB HINTS ${CMAKE_CURRENT_SOURCE_DIR}/A ${CMAKE_CURRENT_SOURCE_DIR}/B ) message(STATUS "PROG='${PROG}'") +unset(PROG CACHE) set(ENV{PATH} "${ENV_PATH}") diff --git a/Tests/RunCMake/find_program/RelAndAbsPath-stdout.txt b/Tests/RunCMake/find_program/RelAndAbsPath-stdout.txt index cb3c99f..d2312e7 100644 --- a/Tests/RunCMake/find_program/RelAndAbsPath-stdout.txt +++ b/Tests/RunCMake/find_program/RelAndAbsPath-stdout.txt @@ -1,6 +1,8 @@ -- PROG_ABS='PROG_ABS-NOTFOUND' -- PROG_ABS_NPD='PROG_ABS_NPD-NOTFOUND' -- PROG_CWD='PROG_CWD-NOTFOUND' +-- PROG_CWD='PROG_CWD-NOTFOUND' +-- PROG_CWD='[^']*/Tests/RunCMake/find_program/testCWD' -- PROG_CWD_NPD='PROG_CWD_NPD-NOTFOUND' -- PROG_CWD_DOT='[^']*/Tests/RunCMake/find_program/testCWD' -- PROG_CWD_DOT_NPD='[^']*/Tests/RunCMake/find_program/testCWD' diff --git a/Tests/RunCMake/find_program/RelAndAbsPath.cmake b/Tests/RunCMake/find_program/RelAndAbsPath.cmake index 9a42c5e..e6bdef7 100644 --- a/Tests/RunCMake/find_program/RelAndAbsPath.cmake +++ b/Tests/RunCMake/find_program/RelAndAbsPath.cmake @@ -38,6 +38,28 @@ find_program(PROG_CWD ) message(STATUS "PROG_CWD='${PROG_CWD}'") + +set(CMAKE_PREFIX_PATH ".") +# On some platforms / dashboards the current working +# directory can be in PATH or other search locations +# so disable all searching to make sure this fails +set(CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH OFF) +set(CMAKE_FIND_USE_CMAKE_PATH OFF) +set(CMAKE_FIND_USE_CMAKE_SYSTEM_PATH OFF) +set(CMAKE_FIND_USE_PACAKGE_ROOT_PATH OFF) +set(CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH OFF) +find_program(PROG_CWD + NAMES testCWD + ) +message(STATUS "PROG_CWD='${PROG_CWD}'") + +set(CMAKE_PREFIX_PATH ".") +set(CMAKE_FIND_USE_CMAKE_PATH ON) +find_program(PROG_CWD + NAMES testCWD + ) +message(STATUS "PROG_CWD='${PROG_CWD}'") + find_program(PROG_CWD_NPD NAMES testCWD NAMES_PER_DIR https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f0a89149bc569020e281c5908733bf4b7eeddf15 commit f0a89149bc569020e281c5908733bf4b7eeddf15 Author: Robert Maynard AuthorDate: Mon Jun 17 14:31:24 2019 -0400 Commit: Brad King CommitDate: Fri Jun 21 11:06:39 2019 -0400 RunCMake: Automatically support platform out override files diff --git a/Tests/RunCMake/README.rst b/Tests/RunCMake/README.rst index d8b43fe..ebe40cf 100644 --- a/Tests/RunCMake/README.rst +++ b/Tests/RunCMake/README.rst @@ -55,6 +55,12 @@ but do not actually build anything. To add a test: ``-check.cmake`` Custom result check. + Note that when a specific platform expects differing stdout or stderr that + can be done by adding a platform specific output file. These follow the + naming convention of: + ``-stdout-.txt`` + ``-stderr-.txt`` + Note that trailing newlines will be stripped from actual and expected test output before matching against the stdout and stderr expressions. The code in ``-check.cmake`` may use variables diff --git a/Tests/RunCMake/RunCMake.cmake b/Tests/RunCMake/RunCMake.cmake index ad3f8f6..e730d6e 100644 --- a/Tests/RunCMake/RunCMake.cmake +++ b/Tests/RunCMake/RunCMake.cmake @@ -21,10 +21,20 @@ function(run_cmake test) else() set(expect_result 0) endif() + + string(TOLOWER ${CMAKE_HOST_SYSTEM_NAME} platform_name) + if(platform_name MATCHES cygwin) + #remove all additional bits from cygwin name + set(platform_name cygwin) + endif() + foreach(o out err) if(RunCMake-std${o}-file AND EXISTS ${top_src}/${RunCMake-std${o}-file}) file(READ ${top_src}/${RunCMake-std${o}-file} expect_std${o}) string(REGEX REPLACE "\n+$" "" expect_std${o} "${expect_std${o}}") + elseif(EXISTS ${top_src}/${test}-std${o}-${platform_name}.txt) + file(READ ${top_src}/${test}-std${o}-${platform_name}.txt expect_std${o}) + string(REGEX REPLACE "\n+$" "" expect_std${o} "${expect_std${o}}") elseif(EXISTS ${top_src}/${test}-std${o}.txt) file(READ ${top_src}/${test}-std${o}.txt expect_std${o}) string(REGEX REPLACE "\n+$" "" expect_std${o} "${expect_std${o}}") diff --git a/Tests/RunCMake/find_file/PrefixInPATH-stdout.txt b/Tests/RunCMake/find_file/PrefixInPATH-stdout-cygwin.txt similarity index 100% copy from Tests/RunCMake/find_file/PrefixInPATH-stdout.txt copy to Tests/RunCMake/find_file/PrefixInPATH-stdout-cygwin.txt diff --git a/Tests/RunCMake/find_file/PrefixInPATH-stdout.txt b/Tests/RunCMake/find_file/PrefixInPATH-stdout-windows.txt similarity index 100% copy from Tests/RunCMake/find_file/PrefixInPATH-stdout.txt copy to Tests/RunCMake/find_file/PrefixInPATH-stdout-windows.txt diff --git a/Tests/RunCMake/find_file/PrefixInPATH-stdout.txt b/Tests/RunCMake/find_file/PrefixInPATH-stdout.txt index d73bc1d..947a900 100644 --- a/Tests/RunCMake/find_file/PrefixInPATH-stdout.txt +++ b/Tests/RunCMake/find_file/PrefixInPATH-stdout.txt @@ -1,4 +1,4 @@ -- PrefixInPATH_INCLUDE_DIR='PrefixInPATH_INCLUDE_DIR-NOTFOUND' --- PrefixInPATH_INCLUDE_DIR='.*/Tests/RunCMake/find_file/include/PrefixInPATH.h' --- PrefixInPATH_INCLUDE_DIR='.*/Tests/RunCMake/find_file/include/PrefixInPATH.h' --- PrefixInPATH_INCLUDE_DIR='.*/Tests/RunCMake/find_file/include/PrefixInPATH.h' +-- PrefixInPATH_INCLUDE_DIR='PrefixInPATH_INCLUDE_DIR-NOTFOUND' +-- PrefixInPATH_INCLUDE_DIR='PrefixInPATH_INCLUDE_DIR-NOTFOUND' +-- PrefixInPATH_INCLUDE_DIR='PrefixInPATH_INCLUDE_DIR-NOTFOUND' diff --git a/Tests/RunCMake/find_file/RunCMakeTest.cmake b/Tests/RunCMake/find_file/RunCMakeTest.cmake index 5ce96e0..014f397 100644 --- a/Tests/RunCMake/find_file/RunCMakeTest.cmake +++ b/Tests/RunCMake/find_file/RunCMakeTest.cmake @@ -1,5 +1,3 @@ include(RunCMake) -if(WIN32 OR CYGWIN) - run_cmake(PrefixInPATH) -endif() +run_cmake(PrefixInPATH) diff --git a/Tests/RunCMake/find_library/PrefixInPATH-stdout.txt b/Tests/RunCMake/find_library/PrefixInPATH-stdout-cygwin.txt similarity index 100% copy from Tests/RunCMake/find_library/PrefixInPATH-stdout.txt copy to Tests/RunCMake/find_library/PrefixInPATH-stdout-cygwin.txt diff --git a/Tests/RunCMake/find_library/PrefixInPATH-stdout.txt b/Tests/RunCMake/find_library/PrefixInPATH-stdout-windows.txt similarity index 100% copy from Tests/RunCMake/find_library/PrefixInPATH-stdout.txt copy to Tests/RunCMake/find_library/PrefixInPATH-stdout-windows.txt diff --git a/Tests/RunCMake/find_library/PrefixInPATH-stdout.txt b/Tests/RunCMake/find_library/PrefixInPATH-stdout.txt index 1ab884c..c6ff513 100644 --- a/Tests/RunCMake/find_library/PrefixInPATH-stdout.txt +++ b/Tests/RunCMake/find_library/PrefixInPATH-stdout.txt @@ -1,4 +1,4 @@ -- PrefixInPATH_LIBRARY='PrefixInPATH_LIBRARY-NOTFOUND' --- PrefixInPATH_LIBRARY='.*/Tests/RunCMake/find_library/lib/libPrefixInPATH.a' --- PrefixInPATH_LIBRARY='.*/Tests/RunCMake/find_library/lib/libPrefixInPATH.a' --- PrefixInPATH_LIBRARY='.*/Tests/RunCMake/find_library/lib/libPrefixInPATH.a' +-- PrefixInPATH_LIBRARY='PrefixInPATH_LIBRARY-NOTFOUND' +-- PrefixInPATH_LIBRARY='PrefixInPATH_LIBRARY-NOTFOUND' +-- PrefixInPATH_LIBRARY='PrefixInPATH_LIBRARY-NOTFOUND' diff --git a/Tests/RunCMake/find_library/RunCMakeTest.cmake b/Tests/RunCMake/find_library/RunCMakeTest.cmake index e7e8db3..ecfa0fe 100644 --- a/Tests/RunCMake/find_library/RunCMakeTest.cmake +++ b/Tests/RunCMake/find_library/RunCMakeTest.cmake @@ -4,6 +4,4 @@ run_cmake(Created) if(CMAKE_HOST_UNIX) run_cmake(LibArchLink) endif() -if(WIN32 OR CYGWIN) - run_cmake(PrefixInPATH) -endif() +run_cmake(PrefixInPATH) diff --git a/Tests/RunCMake/find_path/PrefixInPATH-stdout.txt b/Tests/RunCMake/find_path/PrefixInPATH-stdout-cygwin.txt similarity index 100% copy from Tests/RunCMake/find_path/PrefixInPATH-stdout.txt copy to Tests/RunCMake/find_path/PrefixInPATH-stdout-cygwin.txt diff --git a/Tests/RunCMake/find_path/PrefixInPATH-stdout.txt b/Tests/RunCMake/find_path/PrefixInPATH-stdout-windows.txt similarity index 100% copy from Tests/RunCMake/find_path/PrefixInPATH-stdout.txt copy to Tests/RunCMake/find_path/PrefixInPATH-stdout-windows.txt diff --git a/Tests/RunCMake/find_path/PrefixInPATH-stdout.txt b/Tests/RunCMake/find_path/PrefixInPATH-stdout.txt index bb2ceb7..947a900 100644 --- a/Tests/RunCMake/find_path/PrefixInPATH-stdout.txt +++ b/Tests/RunCMake/find_path/PrefixInPATH-stdout.txt @@ -1,4 +1,4 @@ -- PrefixInPATH_INCLUDE_DIR='PrefixInPATH_INCLUDE_DIR-NOTFOUND' --- PrefixInPATH_INCLUDE_DIR='.*/Tests/RunCMake/find_path/include' --- PrefixInPATH_INCLUDE_DIR='.*/Tests/RunCMake/find_path/include' --- PrefixInPATH_INCLUDE_DIR='.*/Tests/RunCMake/find_path/include' +-- PrefixInPATH_INCLUDE_DIR='PrefixInPATH_INCLUDE_DIR-NOTFOUND' +-- PrefixInPATH_INCLUDE_DIR='PrefixInPATH_INCLUDE_DIR-NOTFOUND' +-- PrefixInPATH_INCLUDE_DIR='PrefixInPATH_INCLUDE_DIR-NOTFOUND' diff --git a/Tests/RunCMake/find_path/RunCMakeTest.cmake b/Tests/RunCMake/find_path/RunCMakeTest.cmake index bf0fa89..6d22124 100644 --- a/Tests/RunCMake/find_path/RunCMakeTest.cmake +++ b/Tests/RunCMake/find_path/RunCMakeTest.cmake @@ -1,8 +1,6 @@ include(RunCMake) -if(WIN32 OR CYGWIN) - run_cmake(PrefixInPATH) -endif() +run_cmake(PrefixInPATH) if(APPLE) run_cmake(FrameworksWithSubdirs) ----------------------------------------------------------------------- Summary of changes: Help/command/FIND_XXX.txt | 16 +++++++++----- Help/command/find_file.rst | 9 ++++---- Help/command/find_library.rst | 9 ++++---- Help/command/find_path.rst | 9 ++++---- Help/command/find_program.rst | 3 ++- Help/manual/cmake-variables.7.rst | 5 +++++ .../dev/global-controls-over-find-locations.rst | 11 ++++++++++ .../CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH.rst | 11 ++++++++++ Help/variable/CMAKE_FIND_USE_CMAKE_PATH.rst | 11 ++++++++++ Help/variable/CMAKE_FIND_USE_CMAKE_SYSTEM_PATH.rst | 11 ++++++++++ Help/variable/CMAKE_FIND_USE_PACAKGE_ROOT_PATH.rst | 11 ++++++++++ .../CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH.rst | 11 ++++++++++ Source/cmFindBase.cxx | 3 +++ Source/cmFindCommon.cxx | 21 ++++++++++++++++++ Source/cmFindCommon.h | 3 +++ Tests/RunCMake/README.rst | 6 ++++++ Tests/RunCMake/RunCMake.cmake | 10 +++++++++ .../find_file/FromPATHEnv-stdout-cygwin.txt | 9 ++++++++ .../find_file/FromPATHEnv-stdout-windows.txt | 9 ++++++++ Tests/RunCMake/find_file/FromPATHEnv-stdout.txt | 9 ++++++++ Tests/RunCMake/find_file/FromPATHEnv.cmake | 24 +++++++++++++++++++++ Tests/RunCMake/find_file/FromPrefixPath-stdout.txt | 6 ++++++ Tests/RunCMake/find_file/FromPrefixPath.cmake | 17 +++++++++++++++ ...H-stdout.txt => PrefixInPATH-stdout-cygwin.txt} | 0 ...-stdout.txt => PrefixInPATH-stdout-windows.txt} | 0 Tests/RunCMake/find_file/PrefixInPATH-stdout.txt | 6 +++--- Tests/RunCMake/find_file/RunCMakeTest.cmake | 6 +++--- .../find_library/FromPATHEnv-stdout-cygwin.txt | 6 ++++++ .../find_library/FromPATHEnv-stdout-windows.txt | 6 ++++++ Tests/RunCMake/find_library/FromPATHEnv-stdout.txt | 6 ++++++ Tests/RunCMake/find_library/FromPATHEnv.cmake | 22 +++++++++++++++++++ .../find_library/FromPrefixPath-stdout.txt | 6 ++++++ Tests/RunCMake/find_library/FromPrefixPath.cmake | 24 +++++++++++++++++++++ ...H-stdout.txt => PrefixInPATH-stdout-cygwin.txt} | 0 ...-stdout.txt => PrefixInPATH-stdout-windows.txt} | 0 .../RunCMake/find_library/PrefixInPATH-stdout.txt | 6 +++--- Tests/RunCMake/find_library/RunCMakeTest.cmake | 6 +++--- .../find_path/FromPATHEnv-stdout-cygwin.txt | 9 ++++++++ .../find_path/FromPATHEnv-stdout-windows.txt | 9 ++++++++ Tests/RunCMake/find_path/FromPATHEnv-stdout.txt | 9 ++++++++ Tests/RunCMake/find_path/FromPATHEnv.cmake | 25 ++++++++++++++++++++++ ...H-stdout.txt => PrefixInPATH-stdout-cygwin.txt} | 0 ...-stdout.txt => PrefixInPATH-stdout-windows.txt} | 0 Tests/RunCMake/find_path/PrefixInPATH-stdout.txt | 6 +++--- Tests/RunCMake/find_path/RunCMakeTest.cmake | 5 ++--- Tests/RunCMake/find_program/EnvAndHints-stdout.txt | 3 +++ Tests/RunCMake/find_program/EnvAndHints.cmake | 23 ++++++++++++++++++++ .../RunCMake/find_program/RelAndAbsPath-stdout.txt | 2 ++ Tests/RunCMake/find_program/RelAndAbsPath.cmake | 22 +++++++++++++++++++ 49 files changed, 402 insertions(+), 39 deletions(-) create mode 100644 Help/release/dev/global-controls-over-find-locations.rst create mode 100644 Help/variable/CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH.rst create mode 100644 Help/variable/CMAKE_FIND_USE_CMAKE_PATH.rst create mode 100644 Help/variable/CMAKE_FIND_USE_CMAKE_SYSTEM_PATH.rst create mode 100644 Help/variable/CMAKE_FIND_USE_PACAKGE_ROOT_PATH.rst create mode 100644 Help/variable/CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH.rst create mode 100644 Tests/RunCMake/find_file/FromPATHEnv-stdout-cygwin.txt create mode 100644 Tests/RunCMake/find_file/FromPATHEnv-stdout-windows.txt create mode 100644 Tests/RunCMake/find_file/FromPATHEnv-stdout.txt create mode 100644 Tests/RunCMake/find_file/FromPATHEnv.cmake create mode 100644 Tests/RunCMake/find_file/FromPrefixPath-stdout.txt create mode 100644 Tests/RunCMake/find_file/FromPrefixPath.cmake copy Tests/RunCMake/find_file/{PrefixInPATH-stdout.txt => PrefixInPATH-stdout-cygwin.txt} (100%) copy Tests/RunCMake/find_file/{PrefixInPATH-stdout.txt => PrefixInPATH-stdout-windows.txt} (100%) create mode 100644 Tests/RunCMake/find_library/FromPATHEnv-stdout-cygwin.txt create mode 100644 Tests/RunCMake/find_library/FromPATHEnv-stdout-windows.txt create mode 100644 Tests/RunCMake/find_library/FromPATHEnv-stdout.txt create mode 100644 Tests/RunCMake/find_library/FromPATHEnv.cmake create mode 100644 Tests/RunCMake/find_library/FromPrefixPath-stdout.txt create mode 100644 Tests/RunCMake/find_library/FromPrefixPath.cmake copy Tests/RunCMake/find_library/{PrefixInPATH-stdout.txt => PrefixInPATH-stdout-cygwin.txt} (100%) copy Tests/RunCMake/find_library/{PrefixInPATH-stdout.txt => PrefixInPATH-stdout-windows.txt} (100%) create mode 100644 Tests/RunCMake/find_path/FromPATHEnv-stdout-cygwin.txt create mode 100644 Tests/RunCMake/find_path/FromPATHEnv-stdout-windows.txt create mode 100644 Tests/RunCMake/find_path/FromPATHEnv-stdout.txt create mode 100644 Tests/RunCMake/find_path/FromPATHEnv.cmake copy Tests/RunCMake/find_path/{PrefixInPATH-stdout.txt => PrefixInPATH-stdout-cygwin.txt} (100%) copy Tests/RunCMake/find_path/{PrefixInPATH-stdout.txt => PrefixInPATH-stdout-windows.txt} (100%) hooks/post-receive -- CMake From kwrobot at kitware.com Sat Jun 22 00:03:08 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Sat, 22 Jun 2019 00:03:08 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc2-113-gf2bce26 Message-ID: <20190622040308.3260F10EB02@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via f2bce265b7dd64f5c7ae7f62a962ceea367bd0f6 (commit) from 12c65a52bd3c8eee564cf766a260b98602942a5f (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f2bce265b7dd64f5c7ae7f62a962ceea367bd0f6 commit f2bce265b7dd64f5c7ae7f62a962ceea367bd0f6 Author: Kitware Robot AuthorDate: Sat Jun 22 00:01:08 2019 -0400 Commit: Kitware Robot CommitDate: Sat Jun 22 00:01:08 2019 -0400 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index ad0386e..8494d39 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 15) -set(CMake_VERSION_PATCH 20190621) +set(CMake_VERSION_PATCH 20190622) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From kwrobot at kitware.com Sun Jun 23 00:03:04 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Sun, 23 Jun 2019 00:03:04 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc2-114-g0ecf3ef Message-ID: <20190623040304.1F831FCD1A@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 0ecf3ef9e8ac4900f2e824cd331d5667142307ab (commit) from f2bce265b7dd64f5c7ae7f62a962ceea367bd0f6 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0ecf3ef9e8ac4900f2e824cd331d5667142307ab commit 0ecf3ef9e8ac4900f2e824cd331d5667142307ab Author: Kitware Robot AuthorDate: Sun Jun 23 00:01:06 2019 -0400 Commit: Kitware Robot CommitDate: Sun Jun 23 00:01:06 2019 -0400 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 8494d39..01a0ad1 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 15) -set(CMake_VERSION_PATCH 20190622) +set(CMake_VERSION_PATCH 20190623) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From kwrobot at kitware.com Mon Jun 24 00:03:04 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Mon, 24 Jun 2019 00:03:04 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc2-115-ga639464 Message-ID: <20190624040304.1EBF51138D9@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via a63946469130818992d23632b6e821127d641bd5 (commit) from 0ecf3ef9e8ac4900f2e824cd331d5667142307ab (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a63946469130818992d23632b6e821127d641bd5 commit a63946469130818992d23632b6e821127d641bd5 Author: Kitware Robot AuthorDate: Mon Jun 24 00:01:05 2019 -0400 Commit: Kitware Robot CommitDate: Mon Jun 24 00:01:05 2019 -0400 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 01a0ad1..78f236f 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 15) -set(CMake_VERSION_PATCH 20190623) +set(CMake_VERSION_PATCH 20190624) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From kwrobot at kitware.com Mon Jun 24 08:33:04 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Mon, 24 Jun 2019 08:33:04 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc2-121-ge8fe1d3 Message-ID: <20190624123304.A8575C0C6A@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via e8fe1d34f822fe0d7bb6e289e04e266671b28d38 (commit) via 2225c8a1dd762b561b2fba07e0215b71390a31b1 (commit) via 1ba0cd29677ad077a646f55d705c8f45433cd21d (commit) via 7dbd21fcf4a48917486a3f02fa9d70037fe0e854 (commit) via 96c6bc25845c31da4031f667b583baf6f121a1c2 (commit) via 7035bdeb523a304e619bf53b3c491287c45521e9 (commit) from a63946469130818992d23632b6e821127d641bd5 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e8fe1d34f822fe0d7bb6e289e04e266671b28d38 commit e8fe1d34f822fe0d7bb6e289e04e266671b28d38 Merge: 2225c8a 7dbd21f Author: Brad King AuthorDate: Mon Jun 24 08:28:13 2019 -0400 Commit: Brad King CommitDate: Mon Jun 24 08:28:13 2019 -0400 Merge branch 'release-3.15' https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2225c8a1dd762b561b2fba07e0215b71390a31b1 commit 2225c8a1dd762b561b2fba07e0215b71390a31b1 Merge: 1ba0cd2 96c6bc2 Author: Brad King AuthorDate: Mon Jun 24 12:26:19 2019 +0000 Commit: Kitware Robot CommitDate: Mon Jun 24 08:26:46 2019 -0400 Merge topic 'doc-IMPORTED_LOCATION' 96c6bc2584 Help: Improve documentation of IMPORTED_LOCATION property Acked-by: Kitware Robot Acked-by: Alex Turbov Merge-request: !3466 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1ba0cd29677ad077a646f55d705c8f45433cd21d commit 1ba0cd29677ad077a646f55d705c8f45433cd21d Merge: a639464 7035bde Author: Brad King AuthorDate: Mon Jun 24 12:25:32 2019 +0000 Commit: Kitware Robot CommitDate: Mon Jun 24 08:25:41 2019 -0400 Merge topic 'vs-ce-deploy' 7035bdeb52 VS10Generator: add project properties to enable WindowsCE deployment. Acked-by: Kitware Robot Merge-request: !3462 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7035bdeb523a304e619bf53b3c491287c45521e9 commit 7035bdeb523a304e619bf53b3c491287c45521e9 Author: Wil Stark AuthorDate: Wed Jun 19 15:11:57 2019 -0700 Commit: Wil Stark CommitDate: Wed Jun 19 15:11:57 2019 -0700 VS10Generator: add project properties to enable WindowsCE deployment. Fixes: #19408 diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 634c990..8b9a41f 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -505,6 +505,11 @@ void cmVisualStudio10TargetGenerator::Generate() if (targetFrameworkVersion) { e1.Element("TargetFrameworkVersion", targetFrameworkVersion); } + if (this->ProjectType == vcxproj && + this->GlobalGenerator->TargetsWindowsCE()) { + e1.Element("EnableRedirectPlatform", "true"); + e1.Element("RedirectPlatformValue", this->Platform); + } if (this->ProjectType == csproj && this->GlobalGenerator->TargetsWindowsCE()) { const char* targetFrameworkId = this->GeneratorTarget->GetProperty( diff --git a/Tests/RunCMake/VS10ProjectWinCE/VsCEDebuggerDeploy-check.cmake b/Tests/RunCMake/VS10ProjectWinCE/VsCEDebuggerDeploy-check.cmake index dab1c33..b1deb99 100644 --- a/Tests/RunCMake/VS10ProjectWinCE/VsCEDebuggerDeploy-check.cmake +++ b/Tests/RunCMake/VS10ProjectWinCE/VsCEDebuggerDeploy-check.cmake @@ -14,6 +14,9 @@ endif() set(FoundCEAdditionalFiles FALSE) set(FoundRemoteDirectory FALSE) set(FoundToolsVersion4 FALSE) +set(FoundEnableRedirectPlatform FALSE) +set(FoundRedirectPlatformValue FALSE) + file(STRINGS "${vcProjectFile}" lines) foreach(line IN LISTS lines) @@ -23,6 +26,10 @@ foreach(line IN LISTS lines) set(FoundRemoteDirectory TRUE) elseif(line MATCHES " * *$") set(FoundToolsVersion4 TRUE) + elseif(line MATCHES "^ *true *$") + set(FoundEnableRedirectPlatform TRUE) + elseif(line MATCHES "^ *.+ *$") + set(FoundRedirectPlatformValue TRUE) endif() endforeach() @@ -41,6 +48,16 @@ if(NOT FoundToolsVersion4) return() endif() +if(NOT FoundEnableRedirectPlatform) + set(RunCMake_TEST_FAILED "Failed to find EnableRedirectPlatform true property.") + return() +endif() + +if(NOT FoundRedirectPlatformValue) + set(RunCMake_TEST_FAILED "Failed to find RedirectPlatformValue property.") + return() +endif() + # # Test solution file deployment items. # ----------------------------------------------------------------------- Summary of changes: Help/prop_tgt/IMPORTED_LOCATION.rst | 15 +++++++++++---- Source/cmVisualStudio10TargetGenerator.cxx | 5 +++++ .../VS10ProjectWinCE/VsCEDebuggerDeploy-check.cmake | 17 +++++++++++++++++ 3 files changed, 33 insertions(+), 4 deletions(-) hooks/post-receive -- CMake From kwrobot at kitware.com Mon Jun 24 08:33:04 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Mon, 24 Jun 2019 08:33:04 -0400 (EDT) Subject: [Cmake-commits] CMake branch, release, updated. v3.15.0-rc2-6-g7dbd21f Message-ID: <20190624123304.BBEF4C216A@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, release has been updated via 7dbd21fcf4a48917486a3f02fa9d70037fe0e854 (commit) via 96c6bc25845c31da4031f667b583baf6f121a1c2 (commit) from 036752cc0e5f98a611c23c044e3bc1b484b02f53 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- ----------------------------------------------------------------------- Summary of changes: Help/prop_tgt/IMPORTED_LOCATION.rst | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) hooks/post-receive -- CMake From kwrobot at kitware.com Mon Jun 24 09:53:05 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Mon, 24 Jun 2019 09:53:05 -0400 (EDT) Subject: [Cmake-commits] CMake branch, release, updated. v3.15.0-rc2-8-g154d25f Message-ID: <20190624135305.7ED6C113886@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, release has been updated via 154d25f5bac70e0537578eee75e0d898446c14cc (commit) via 264612c0135cdd6dbab7dcbe979bc0bbe22191d9 (commit) from 7dbd21fcf4a48917486a3f02fa9d70037fe0e854 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- ----------------------------------------------------------------------- Summary of changes: Help/command/cmake_parse_arguments.rst | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) hooks/post-receive -- CMake From kwrobot at kitware.com Mon Jun 24 09:53:05 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Mon, 24 Jun 2019 09:53:05 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc2-125-g5835f55 Message-ID: <20190624135305.5A73A113663@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 5835f553be5c159d9e3075ccb19c26be64e9cad5 (commit) via 154d25f5bac70e0537578eee75e0d898446c14cc (commit) via 394adf63c605327aaf969d662b26168d2b688229 (commit) via 264612c0135cdd6dbab7dcbe979bc0bbe22191d9 (commit) from e8fe1d34f822fe0d7bb6e289e04e266671b28d38 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5835f553be5c159d9e3075ccb19c26be64e9cad5 commit 5835f553be5c159d9e3075ccb19c26be64e9cad5 Merge: 394adf6 154d25f Author: Brad King AuthorDate: Mon Jun 24 09:44:46 2019 -0400 Commit: Brad King CommitDate: Mon Jun 24 09:44:46 2019 -0400 Merge branch 'release-3.15' https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=394adf63c605327aaf969d662b26168d2b688229 commit 394adf63c605327aaf969d662b26168d2b688229 Merge: e8fe1d3 264612c Author: Brad King AuthorDate: Mon Jun 24 13:43:43 2019 +0000 Commit: Kitware Robot CommitDate: Mon Jun 24 09:43:50 2019 -0400 Merge topic 'doc-typos-cmake_parse_arguments' 264612c013 Help: Typo and grammar fixes in cmake_parse_arguments() docs Acked-by: Kitware Robot Acked-by: Brad King Merge-request: !3468 ----------------------------------------------------------------------- Summary of changes: Help/command/cmake_parse_arguments.rst | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) hooks/post-receive -- CMake From kwrobot at kitware.com Tue Jun 25 00:03:02 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Tue, 25 Jun 2019 00:03:02 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc2-126-gedf232d Message-ID: <20190625040302.F061710339B@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via edf232dbe487e36cec2843c9495df9914b41ae28 (commit) from 5835f553be5c159d9e3075ccb19c26be64e9cad5 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=edf232dbe487e36cec2843c9495df9914b41ae28 commit edf232dbe487e36cec2843c9495df9914b41ae28 Author: Kitware Robot AuthorDate: Tue Jun 25 00:01:07 2019 -0400 Commit: Kitware Robot CommitDate: Tue Jun 25 00:01:07 2019 -0400 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 78f236f..4517bdf 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 15) -set(CMake_VERSION_PATCH 20190624) +set(CMake_VERSION_PATCH 20190625) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From kwrobot at kitware.com Tue Jun 25 07:13:03 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Tue, 25 Jun 2019 07:13:03 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc2-138-g92351fe Message-ID: <20190625111303.C23E9112F0A@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 92351fe7cd73a756effd5a42ff7f04c2d9beaf88 (commit) via b4a882cf10874fbd04bda81d9dfeeea29dcf3f8b (commit) via 2e8b8eb857037a4c0f08a1c7c0ce5a778ebfbc54 (commit) via 9201908ca5c10a6142c0558401445320773f1f1e (commit) via 2454fe84f599abc55fe61eee45d22b45d6d2b7f2 (commit) via 8ab8563533e57f4f4af769daf4590c6d262e5c41 (commit) via 0a6c9c417a5a5a254cf43eea77b2e8ac64dfcbb7 (commit) via eef3e020c21d2fdba19aab0daf1b99f8de0a16fe (commit) via 862cfc0e6c3f275db73281f3b9b989704251ab6a (commit) via d2fde9480955cf2246519357e01ab5142a067efc (commit) via f067af8e385d17cc5b14e43475ded4d9d38317a2 (commit) via d5a81ef7473734a9a886de4ff64246614ec0bb1a (commit) from edf232dbe487e36cec2843c9495df9914b41ae28 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=92351fe7cd73a756effd5a42ff7f04c2d9beaf88 commit 92351fe7cd73a756effd5a42ff7f04c2d9beaf88 Merge: b4a882c 2454fe8 Author: Brad King AuthorDate: Tue Jun 25 11:07:19 2019 +0000 Commit: Kitware Robot CommitDate: Tue Jun 25 07:07:29 2019 -0400 Merge topic 'find_matlab_exact' 2454fe84f5 FindMatlab: Support EXACT versions Acked-by: Kitware Robot Reviewed-by: Raffi Enficiaud Merge-request: !3460 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b4a882cf10874fbd04bda81d9dfeeea29dcf3f8b commit b4a882cf10874fbd04bda81d9dfeeea29dcf3f8b Merge: 2e8b8eb 9201908 Author: Brad King AuthorDate: Tue Jun 25 11:06:14 2019 +0000 Commit: Kitware Robot CommitDate: Tue Jun 25 07:06:35 2019 -0400 Merge topic 'FindPython-FIND_ABI' 9201908ca5 FindPython: add Python_FIND_ABI hint. Acked-by: Kitware Robot Merge-request: !3463 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2e8b8eb857037a4c0f08a1c7c0ce5a778ebfbc54 commit 2e8b8eb857037a4c0f08a1c7c0ce5a778ebfbc54 Merge: edf232d 8ab8563 Author: Brad King AuthorDate: Tue Jun 25 11:05:18 2019 +0000 Commit: Kitware Robot CommitDate: Tue Jun 25 07:05:35 2019 -0400 Merge topic 'help-guide-tutorial' 8ab8563533 Help: Add tutorial guide table of contents 0a6c9c417a Help: Update tutorial to include text from CMake book eef3e020c2 Help: Populate tutorial guide text 862cfc0e6c Help/guide/tutorial: Adopt tutorial code d2fde94809 Help: Add infrastructure for guide-level documentation f067af8e38 Tests/Tutorial: Remove trailing blank lines d5a81ef747 Tests/Tutorial: Remove unused file Acked-by: Kitware Robot Merge-request: !3439 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9201908ca5c10a6142c0558401445320773f1f1e commit 9201908ca5c10a6142c0558401445320773f1f1e Author: Marc Chevrier AuthorDate: Wed Jun 5 13:08:52 2019 +0200 Commit: Marc Chevrier CommitDate: Mon Jun 24 12:00:21 2019 +0200 FindPython: add Python_FIND_ABI hint. This variable will enable to specify will ABIs will be searched. diff --git a/Help/release/dev/FindPython-FIND_ABI.rst b/Help/release/dev/FindPython-FIND_ABI.rst new file mode 100644 index 0000000..19e3f71 --- /dev/null +++ b/Help/release/dev/FindPython-FIND_ABI.rst @@ -0,0 +1,5 @@ +FindPython-FIND_ABI +------------------- + +* Modules :module:`FindPython3` and :module:`FindPython` gain the capability + to control which ``ABIs`` will be searched. diff --git a/Modules/FindPython.cmake b/Modules/FindPython.cmake index e2f3bf3..6a9decb 100644 --- a/Modules/FindPython.cmake +++ b/Modules/FindPython.cmake @@ -137,6 +137,51 @@ Hints * If set to TRUE, search **only** for static libraries. * If set to FALSE, search **only** for shared libraries. +``Python_FIND_ABI`` + This variable defines which ABIs, as defined in + `PEP 3149 `_, should be searched. + + .. note:: + + This hint will be honored only when searched for ``Python`` version 3. + + .. note:: + + If ``Python_FIND_ABI`` is not defined, any ABI will be searched. + + The ``Python_FIND_ABI`` variable is a 3-tuple specifying, in that order, + ``pydebug`` (``d``), ``pymalloc`` (``m``) and ``unicode`` (``u``) flags. + Each element can be set to one of the following: + + * ``ON``: Corresponding flag is selected. + * ``OFF``: Corresponding flag is not selected. + * ``ANY``: The two posibilties (``ON`` and ``OFF``) will be searched. + + From this 3-tuple, various ABIs will be searched starting from the most + specialized to the most general. Moreover, ``debug`` versions will be + searched **after** ``non-debug`` ones. + + For example, if we have:: + + set (Python_FIND_ABI "ON" "ANY" "ANY") + + The following flags combinations will be appended, in that order, to the + artifact names: ``dmu``, ``dm``, ``du``, and ``d``. + + And to search any possible ABIs:: + + set (Python_FIND_ABI "ANY" "ANY" "ANY") + + The following combinations, in that order, will be used: ``mu``, ``m``, + ``u``, ````, ``dmu``, ``dm``, ``du`` and ``d``. + + .. note:: + + This hint is useful only on ``POSIX`` systems. So, on ``Windows`` systems, + when ``Python_FIND_ABI`` is defined, ``Python`` distributions from + `python.org `_ will be found only if value for + each flag is ``OFF`` or ``ANY``. + ``Python_FIND_STRATEGY`` This variable defines how lookup will be done. The ``Python_FIND_STRATEGY`` variable can be set to empty or one of the diff --git a/Modules/FindPython/Support.cmake b/Modules/FindPython/Support.cmake index 49d8e26..c0e843a 100644 --- a/Modules/FindPython/Support.cmake +++ b/Modules/FindPython/Support.cmake @@ -96,51 +96,149 @@ function (_PYTHON_GET_REGISTRIES _PYTHON_PGR_REGISTRY_PATHS _PYTHON_VERSION) PARENT_SCOPE) endfunction() -function (_PYTHON_GET_PATH_SUFFIXES _PYTHON_PGPS_PATH_SUFFIXES _PYTHON_VERSION _PYTHON_TYPE) - set (path_suffixes) - if (_PYTHON_TYPE STREQUAL "LIBRARY") +function (_PYTHON_GET_ABIFLAGS _PGABIFLAGS) + set (abiflags) + list (GET _${_PYTHON_PREFIX}_FIND_ABI 0 pydebug) + list (GET _${_PYTHON_PREFIX}_FIND_ABI 1 pymalloc) + list (GET _${_PYTHON_PREFIX}_FIND_ABI 2 unicode) + + if (pymalloc STREQUAL "ANY" AND unicode STREQUAL "ANY") + set (abiflags "mu" "m" "u" "") + elseif (pymalloc STREQUAL "ANY" AND unicode STREQUAL "ON") + set (abiflags "mu" "u") + elseif (pymalloc STREQUAL "ANY" AND unicode STREQUAL "OFF") + set (abiflags "m" "") + elseif (pymalloc STREQUAL "ON" AND unicode STREQUAL "ANY") + set (abiflags "mu" "m") + elseif (pymalloc STREQUAL "ON" AND unicode STREQUAL "ON") + set (abiflags "mu") + elseif (pymalloc STREQUAL "ON" AND unicode STREQUAL "OFF") + set (abiflags "m") + elseif (pymalloc STREQUAL "ON" AND unicode STREQUAL "ANY") + set (abiflags "u" "") + elseif (pymalloc STREQUAL "OFF" AND unicode STREQUAL "ON") + set (abiflags "u") + endif() + + if (pydebug STREQUAL "ON") + if (abiflags) + list (TRANSFORM abiflags PREPEND "d") + else() + set (abiflags "d") + endif() + elseif (pydebug STREQUAL "ANY") + if (abiflags) + set (flags "${abiflags}") + list (TRANSFORM flags PREPEND "d") + list (APPEND abiflags "${flags}") + else() + set (abiflags "" "d") + endif() + endif() + + set (${_PGABIFLAGS} "${abiflags}" PARENT_SCOPE) +endfunction() + +function (_PYTHON_GET_PATH_SUFFIXES _PYTHON_PGPS_PATH_SUFFIXES) + cmake_parse_arguments (PARSE_ARGV 1 _PGPS "LIBRARY;INCLUDE" "VERSION" "") + + if (DEFINED _${_PYTHON_PREFIX}_ABIFLAGS) + set (abi "${_${_PYTHON_PREFIX}_ABIFLAGS}") + else() + set (abi "mu" "m" "u" "") + endif() + + set (path_suffixes) + if (_PGPS_LIBRARY) if (CMAKE_LIBRARY_ARCHITECTURE) list (APPEND path_suffixes lib/${CMAKE_LIBRARY_ARCHITECTURE}) endif() list (APPEND path_suffixes lib libs) if (CMAKE_LIBRARY_ARCHITECTURE) - list (APPEND path_suffixes lib/python${_PYTHON_VERSION}/config-${_PYTHON_VERSION}mu-${CMAKE_LIBRARY_ARCHITECTURE} - lib/python${_PYTHON_VERSION}/config-${_PYTHON_VERSION}m-${CMAKE_LIBRARY_ARCHITECTURE} - lib/python${_PYTHON_VERSION}/config-${CMAKE_MATCH_1}u-${CMAKE_LIBRARY_ARCHITECTURE} - lib/python${_PYTHON_VERSION}/config-${CMAKE_MATCH_1}-${CMAKE_LIBRARY_ARCHITECTURE}) + set (suffixes "${abi}") + if (suffixes) + list (TRANSFORM suffixes PREPEND "lib/python${_PGPS_VERSION}/config-${_PGPS_VERSION}") + list (TRANSFORM suffixes APPEND "-${CMAKE_LIBRARY_ARCHITECTURE}") + else() + set (suffixes "lib/python${_PGPS_VERSION}/config-${_PGPS_VERSION}-${CMAKE_LIBRARY_ARCHITECTURE}") + endif() + list (APPEND path_suffixes ${suffixes}) + endif() + set (suffixes "${abi}") + if (suffixes) + list (TRANSFORM suffixes PREPEND "lib/python${_PGPS_VERSION}/config-${_PGPS_VERSION}") + else() + set (suffixes "lib/python${_PGPS_VERSION}/config-${_PGPS_VERSION}") + endif() + list (APPEND path_suffixes ${suffixes}) + elseif (_PGPS_INCLUDE) + set (suffixes "${abi}") + if (suffixes) + list (TRANSFORM suffixes PREPEND "include/python${_PGPS_VERSION}") + else() + set (suffixes "include/python${_PGPS_VERSION}") endif() - list (APPEND path_suffixes lib/python${_PYTHON_VERSION}/config-${_PYTHON_VERSION}mu - lib/python${_PYTHON_VERSION}/config-${_PYTHON_VERSION}m - lib/python${_PYTHON_VERSION}/config-${_PYTHON_VERSION}u - lib/python${_PYTHON_VERSION}/config-${_PYTHON_VERSION} - lib/python${_PYTHON_VERSION}/config) - - elseif (_PYTHON_TYPE STREQUAL "INCLUDE") - list (APPEND path_suffixes include/python${_PYTHON_VERSION}mu - include/python${_PYTHON_VERSION}m - include/python${_PYTHON_VERSION}u - include/python${_PYTHON_VERSION} - include) + list (APPEND path_suffixes ${suffixes} include) endif() set (${_PYTHON_PGPS_PATH_SUFFIXES} ${path_suffixes} PARENT_SCOPE) endfunction() -function (_PYTHON_GET_LIB_NAMES _PYTHON_PGLN_NAMES _PYTHON_VERSION) - string (REPLACE "." "" _PYTHON_VERSION_NO_DOTS ${_PYTHON_VERSION}) +function (_PYTHON_GET_NAMES _PYTHON_PGN_NAMES) + cmake_parse_arguments (PARSE_ARGV 1 _PGN "POSIX;EXECUTABLE;CONFIG;LIBRARY;WIN32;DEBUG" "VERSION" "") - if (ARGC EQUAL 3 AND ARGV2 STREQUAL "DEBUG") - set (${_PYTHON_PGLN_NAMES} python${_PYTHON_VERSION_NO_DOTS}_d PARENT_SCOPE) - else() - set (${_PYTHON_PGLN_NAMES} python${_PYTHON_VERSION_NO_DOTS} - python${_PYTHON_VERSION}mu - python${_PYTHON_VERSION}m - python${_PYTHON_VERSION}u - python${_PYTHON_VERSION} - PARENT_SCOPE) + set (names) + + if (_PGN_WIN32) + string (REPLACE "." "" _PYTHON_VERSION_NO_DOTS ${_PGN_VERSION}) + + set (name python${_PYTHON_VERSION_NO_DOTS}) + if (_PGN_DEBUG) + string (APPEND name "_d") + endif() + + list (APPEND names "${name}") endif() + + if (_PGN_POSIX) + if (DEFINED _${_PYTHON_PREFIX}_ABIFLAGS) + set (abi "${_${_PYTHON_PREFIX}_ABIFLAGS}") + else() + if (_PGN_EXECUTABLE OR _PGN_CONFIG) + set (abi "") + else() + set (abi "mu" "m" "u" "") + endif() + endif() + + if (abi) + if (_PGN_CONFIG AND DEFINED CMAKE_LIBRARY_ARCHITECTURE) + set (abinames "${abi}") + list (TRANSFORM abinames PREPEND "${CMAKE_LIBRARY_ARCHITECTURE}-python${_PGN_VERSION}") + list (TRANSFORM abinames APPEND "-config") + list (APPEND names ${abinames}) + endif() + set (abinames "${abi}") + list (TRANSFORM abinames PREPEND "python${_PGN_VERSION}") + if (_PGN_CONFIG) + list (TRANSFORM abinames APPEND "-config") + endif() + list (APPEND names ${abinames}) + else() + if (_PGN_CONFIG AND DEFINED CMAKE_LIBRARY_ARCHITECTURE) + set (abinames "${CMAKE_LIBRARY_ARCHITECTURE}-python${_PGN_VERSION}") + endif() + list (APPEND abinames "python${_PGN_VERSION}") + if (_PGN_CONFIG) + list (TRANSFORM abinames APPEND "-config") + endif() + list (APPEND names ${abinames}) + endif() + endif() + + set (${_PYTHON_PGN_NAMES} ${names} PARENT_SCOPE) endfunction() @@ -149,16 +247,35 @@ function (_PYTHON_VALIDATE_INTERPRETER) return() endif() - cmake_parse_arguments (_PVI "EXACT" "" "" ${ARGN}) + cmake_parse_arguments (PARSE_ARGV 0 _PVI "EXACT" "" "") if (_PVI_UNPARSED_ARGUMENTS) set (expected_version ${_PVI_UNPARSED_ARGUMENTS}) else() unset (expected_version) endif() + # validate ABI compatibility + if (DEFINED _${_PYTHON_PREFIX}_FIND_ABI) + execute_process (COMMAND "${${_PYTHON_PREFIX}_EXECUTABLE}" -c + "import sys; sys.stdout.write(sys.abiflags)" + RESULT_VARIABLE result + OUTPUT_VARIABLE abi + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE) + if (result) + # assume ABI is not supported + set (abi "") + endif() + if (NOT abi IN_LIST _${_PYTHON_PREFIX}_ABIFLAGS) + # incompatible ABI + set_property (CACHE ${_PYTHON_PREFIX}_EXECUTABLE PROPERTY VALUE "${_PYTHON_PREFIX}_EXECUTABLE-NOTFOUND") + return() + endif() + endif() + get_filename_component (python_name "${${_PYTHON_PREFIX}_EXECUTABLE}" NAME) - if (expected_version AND NOT python_name STREQUAL "python${expected_version}${CMAKE_EXECUTABLE_SUFFIX}") + if (expected_version AND NOT python_name STREQUAL "python${expected_version}${abi}${CMAKE_EXECUTABLE_SUFFIX}") # executable found must have a specific version execute_process (COMMAND "${${_PYTHON_PREFIX}_EXECUTABLE}" -c "import sys; sys.stdout.write('.'.join([str(x) for x in sys.version_info[:2]]))" @@ -168,7 +285,7 @@ function (_PYTHON_VALIDATE_INTERPRETER) OUTPUT_STRIP_TRAILING_WHITESPACE) if (result OR (_PVI_EXACT AND NOT version VERSION_EQUAL expected_version) OR (version VERSION_LESS expected_version)) # interpreter not usable or has wrong major version - set (${_PYTHON_PREFIX}_EXECUTABLE ${_PYTHON_PREFIX}_EXECUTABLE-NOTFOUND CACHE INTERNAL "" FORCE) + set_property (CACHE ${_PYTHON_PREFIX}_EXECUTABLE PROPERTY VALUE "${_PYTHON_PREFIX}_EXECUTABLE-NOTFOUND") return() endif() else() @@ -183,7 +300,7 @@ function (_PYTHON_VALIDATE_INTERPRETER) OUTPUT_STRIP_TRAILING_WHITESPACE) if (result OR NOT version EQUAL _${_PYTHON_PREFIX}_REQUIRED_VERSION_MAJOR) # interpreter not usable or has wrong major version - set (${_PYTHON_PREFIX}_EXECUTABLE ${_PYTHON_PREFIX}_EXECUTABLE-NOTFOUND CACHE INTERNAL "" FORCE) + set_property (CACHE ${_PYTHON_PREFIX}_EXECUTABLE PROPERTY VALUE "${_PYTHON_PREFIX}_EXECUTABLE-NOTFOUND") return() endif() endif() @@ -200,7 +317,7 @@ function (_PYTHON_VALIDATE_INTERPRETER) OUTPUT_STRIP_TRAILING_WHITESPACE) if (result OR NOT size EQUAL CMAKE_SIZEOF_VOID_P) # interpreter not usable or has wrong architecture - set (${_PYTHON_PREFIX}_EXECUTABLE ${_PYTHON_PREFIX}_EXECUTABLE-NOTFOUND CACHE INTERNAL "" FORCE) + set_property (CACHE ${_PYTHON_PREFIX}_EXECUTABLE PROPERTY VALUE "${_PYTHON_PREFIX}_EXECUTABLE-NOTFOUND") return() endif() endif() @@ -244,7 +361,7 @@ function (_PYTHON_VALIDATE_COMPILER expected_version) if (result OR (_PVC_EXACT AND NOT version VERSION_EQUAL expected_version) OR (version VERSION_LESS expected_version)) # Compiler not usable or has wrong version - set (${_PYTHON_PREFIX}_COMPILER ${_PYTHON_PREFIX}_COMPILER-NOTFOUND CACHE INTERNAL "" FORCE) + set_property (CACHE ${_PYTHON_PREFIX}_COMPILER PROPERTY VALUE "${_PYTHON_PREFIX}_COMPILER-NOTFOUND") endif() endfunction() @@ -321,6 +438,28 @@ if (${_PYTHON_PREFIX}_FIND_VERSION_COUNT GREATER 1) endif() endif() +# Set ABIs to search +## default: search any ABI +if (_${_PYTHON_PREFIX}_REQUIRED_VERSION_MAJOR VERSION_LESS 3) + # ABI not supported + unset (_${_PYTHON_PREFIX}_FIND_ABI) + set (_${_PYTHON_PREFIX}_ABIFLAGS "") +else() + unset (_${_PYTHON_PREFIX}_FIND_ABI) + unset (_${_PYTHON_PREFIX}_ABIFLAGS) + if (DEFINED ${_PYTHON_PREFIX}_FIND_ABI) + # normalization + string (TOUPPER "${${_PYTHON_PREFIX}_FIND_ABI}" _${_PYTHON_PREFIX}_FIND_ABI) + list (TRANSFORM _${_PYTHON_PREFIX}_FIND_ABI REPLACE "^(TRUE|Y(ES)?|1)$" "ON") + list (TRANSFORM _${_PYTHON_PREFIX}_FIND_ABI REPLACE "^(FALSE|N(O)?|0)$" "OFF") + if (NOT _${_PYTHON_PREFIX}_FIND_ABI MATCHES "^(ON|OFF|ANY);(ON|OFF|ANY);(ON|OFF|ANY)$") + message (AUTHOR_WARNING "Find${_PYTHON_PREFIX}: ${${_PYTHON_PREFIX}_FIND_ABI}: invalid value for '${_PYTHON_PREFIX}_FIND_ABI'. Ignore it") + unset (_${_PYTHON_PREFIX}_FIND_ABI) + endif() + _python_get_abiflags (_${_PYTHON_PREFIX}_ABIFLAGS) + endif() +endif() + # Define lookup strategy if (_${_PYTHON_PREFIX}_LOOKUP_POLICY STREQUAL "NEW") set (_${_PYTHON_PREFIX}_FIND_STRATEGY "LOCATION") @@ -446,7 +585,8 @@ if ("Interpreter" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS) foreach (_${_PYTHON_PREFIX}_VERSION IN LISTS _${_PYTHON_PREFIX}_FIND_VERSIONS) # build all executable names - list (APPEND _${_PYTHON_PREFIX}_NAMES python${_${_PYTHON_PREFIX}_VERSION}) + _python_get_names (_${_PYTHON_PREFIX}_VERSION_NAMES VERSION ${_${_PYTHON_PREFIX}_VERSION} POSIX EXECUTABLE) + list (APPEND _${_PYTHON_PREFIX}_NAMES ${_${_PYTHON_PREFIX}_VERSION_NAMES}) # Framework Paths _python_get_frameworks (_${_PYTHON_PREFIX}_VERSION_PATHS ${_${_PYTHON_PREFIX}_VERSION}) @@ -516,12 +656,24 @@ if ("Interpreter" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS) endif() endif() - # try using HINTS and standard paths + # try using HINTS find_program (${_PYTHON_PREFIX}_EXECUTABLE NAMES ${_${_PYTHON_PREFIX}_NAMES} ${_${_PYTHON_PREFIX}_IRON_PYTHON_NAMES} NAMES_PER_DIR HINTS ${_${_PYTHON_PREFIX}_HINTS} + PATH_SUFFIXES bin ${_${_PYTHON_PREFIX}_IRON_PYTHON_PATH_SUFFIXES} + NO_SYSTEM_ENVIRONMENT_PATH + NO_CMAKE_SYSTEM_PATH) + _python_validate_interpreter (${${_PYTHON_PREFIX}_FIND_VERSION}) + if (${_PYTHON_PREFIX}_EXECUTABLE) + break() + endif() + # try using standard paths + find_program (${_PYTHON_PREFIX}_EXECUTABLE + NAMES ${_${_PYTHON_PREFIX}_NAMES} + ${_${_PYTHON_PREFIX}_IRON_PYTHON_NAMES} + NAMES_PER_DIR PATH_SUFFIXES bin ${_${_PYTHON_PREFIX}_IRON_PYTHON_PATH_SUFFIXES}) _python_validate_interpreter (${${_PYTHON_PREFIX}_FIND_VERSION}) if (${_PYTHON_PREFIX}_EXECUTABLE) @@ -561,9 +713,9 @@ if ("Interpreter" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS) else() # look-up for various versions and locations foreach (_${_PYTHON_PREFIX}_VERSION IN LISTS _${_PYTHON_PREFIX}_FIND_VERSIONS) - set (_${_PYTHON_PREFIX}_NAMES python${_${_PYTHON_PREFIX}_VERSION} - python${_${_PYTHON_PREFIX}_REQUIRED_VERSION_MAJOR} - python) + _python_get_names (_${_PYTHON_PREFIX}_NAMES VERSION ${_${_PYTHON_PREFIX}_VERSION} POSIX EXECUTABLE) + list (APPEND _${_PYTHON_PREFIX}_NAMES python${_${_PYTHON_PREFIX}_REQUIRED_VERSION_MAJOR} + python) _python_get_frameworks (_${_PYTHON_PREFIX}_FRAMEWORK_PATHS ${_${_PYTHON_PREFIX}_VERSION}) _python_get_registries (_${_PYTHON_PREFIX}_REGISTRY_PATHS ${_${_PYTHON_PREFIX}_VERSION}) @@ -643,12 +795,12 @@ if ("Interpreter" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS) # systematically 'python' (i.e. version 2) even if version 3 is searched. if (WIN32) find_program (${_PYTHON_PREFIX}_EXECUTABLE - NAMES python${_${_PYTHON_PREFIX}_VERSION} + NAMES ${_${_PYTHON_PREFIX}_NAMES} python ${_${_PYTHON_PREFIX}_IRON_PYTHON_NAMES}) else() find_program (${_PYTHON_PREFIX}_EXECUTABLE - NAMES python${_${_PYTHON_PREFIX}_VERSION}) + NAMES ${_${_PYTHON_PREFIX}_NAMES}) endif() _python_validate_interpreter (${_${_PYTHON_PREFIX}_VERSION} EXACT) if (${_PYTHON_PREFIX}_EXECUTABLE) @@ -715,7 +867,7 @@ if ("Interpreter" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS) list (GET _${_PYTHON_PREFIX}_VERSIONS 2 ${_PYTHON_PREFIX}_VERSION_PATCH) else() # Interpreter is not usable - set (${_PYTHON_PREFIX}_EXECUTABLE ${_PYTHON_PREFIX}_EXECUTABLE-NOTFOUND CACHE INTERNAL "" FORCE) + set_property (CACHE ${_PYTHON_PREFIX}_EXECUTABLE PROPERTY VALUE "${_PYTHON_PREFIX}_EXECUTABLE-NOTFOUND") unset (${_PYTHON_PREFIX}_VERSION) endif() endif() @@ -723,8 +875,17 @@ if ("Interpreter" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS) if (${_PYTHON_PREFIX}_EXECUTABLE AND ${_PYTHON_PREFIX}_VERSION_MAJOR VERSION_EQUAL _${_PYTHON_PREFIX}_REQUIRED_VERSION_MAJOR) set (${_PYTHON_PREFIX}_Interpreter_FOUND TRUE) - # Use interpreter version for future searches to ensure consistency + # Use interpreter version and ABI for future searches to ensure consistency set (_${_PYTHON_PREFIX}_FIND_VERSIONS ${${_PYTHON_PREFIX}_VERSION_MAJOR}.${${_PYTHON_PREFIX}_VERSION_MINOR}) + execute_process (COMMAND "${${_PYTHON_PREFIX}_EXECUTABLE}" -c "import sys; sys.stdout.write(sys.abiflags)" + RESULT_VARIABLE _${_PYTHON_PREFIX}_RESULT + OUTPUT_VARIABLE _${_PYTHON_PREFIX}_ABIFLAGS + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE) + if (_${_PYTHON_PREFIX}_RESULT) + # assunme ABI is not supported + set (_${_PYTHON_PREFIX}_ABIFLAGS "") + endif() endif() if (${_PYTHON_PREFIX}_Interpreter_FOUND) @@ -932,7 +1093,7 @@ if ("Compiler" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS) endif() else() # compiler not usable - set (${_PYTHON_PREFIX}_COMPILER ${_PYTHON_PREFIX}_COMPILER-NOTFOUND CACHE INTERNAL "" FORCE) + set_property (CACHE ${_PYTHON_PREFIX}_COMPILER PROPERTY VALUE "${_PYTHON_PREFIX}_COMPILER-NOTFOUND") endif() file (REMOVE_RECURSE "${_${_PYTHON_PREFIX}_VERSION_DIR}") endif() @@ -1015,16 +1176,15 @@ if ("Development" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS endif() endif() endif() - set (_${_PYTHON_PREFIX}_HINTS "${_${_PYTHON_PREFIX}_EXEC_PREFIX}" "${_${_PYTHON_PREFIX}_BASE_EXEC_PREFIX}" "${${_PYTHON_PREFIX}_ROOT_DIR}" ENV ${_PYTHON_PREFIX}_ROOT_DIR) + set (_${_PYTHON_PREFIX}_BASE_HINTS "${_${_PYTHON_PREFIX}_EXEC_PREFIX}" "${_${_PYTHON_PREFIX}_BASE_EXEC_PREFIX}" "${${_PYTHON_PREFIX}_ROOT_DIR}" ENV ${_PYTHON_PREFIX}_ROOT_DIR) + set (_${_PYTHON_PREFIX}_HINTS ${_${_PYTHON_PREFIX}_BASE_HINTS}) if (_${_PYTHON_PREFIX}_FIND_STRATEGY STREQUAL "LOCATION") set (_${_PYTHON_PREFIX}_CONFIG_NAMES) foreach (_${_PYTHON_PREFIX}_VERSION IN LISTS _${_PYTHON_PREFIX}_FIND_VERSIONS) - if (DEFINED CMAKE_LIBRARY_ARCHITECTURE) - list (APPEND _${_PYTHON_PREFIX}_CONFIG_NAMES "${CMAKE_LIBRARY_ARCHITECTURE}-python${_${_PYTHON_PREFIX}_VERSION}-config") - endif() - list (APPEND _${_PYTHON_PREFIX}_CONFIG_NAMES "python${_${_PYTHON_PREFIX}_VERSION}-config") + _python_get_names (_${_PYTHON_PREFIX}_VERSION_NAMES VERSION ${_${_PYTHON_PREFIX}_VERSION} POSIX CONFIG) + list (APPEND _${_PYTHON_PREFIX}_CONFIG_NAMES ${_${_PYTHON_PREFIX}_VERSION_NAMES}) endforeach() find_program (_${_PYTHON_PREFIX}_CONFIG @@ -1033,6 +1193,22 @@ if ("Development" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS HINTS ${_${_PYTHON_PREFIX}_HINTS} PATH_SUFFIXES bin) + if (_${_PYTHON_PREFIX}_CONFIG) + execute_process (COMMAND "${_${_PYTHON_PREFIX}_CONFIG}" --abiflags + RESULT_VARIABLE _${_PYTHON_PREFIX}_RESULT + OUTPUT_VARIABLE __${_PYTHON_PREFIX}_ABIFLAGS + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE) + if (_${_PYTHON_PREFIX}_RESULT) + # assume ABI is not supported + set (__${_PYTHON_PREFIX}_ABIFLAGS "") + endif() + if (DEFINED _${_PYTHON_PREFIX}_FIND_ABI AND NOT __${_PYTHON_PREFIX}_ABIFLAGS IN_LIST _${_PYTHON_PREFIX}_ABIFLAGS) + # Wrong ABI + unset (_${_PYTHON_PREFIX}_CONFIG CACHE) + endif() + endif() + if (_${_PYTHON_PREFIX}_CONFIG AND DEFINED CMAKE_LIBRARY_ARCHITECTURE) # check that config tool match library architecture execute_process (COMMAND "${_${_PYTHON_PREFIX}_CONFIG}" --configdir @@ -1052,11 +1228,7 @@ if ("Development" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS else() foreach (_${_PYTHON_PREFIX}_VERSION IN LISTS _${_PYTHON_PREFIX}_FIND_VERSIONS) # try to use pythonX.Y-config tool - set (_${_PYTHON_PREFIX}_CONFIG_NAMES) - if (DEFINED CMAKE_LIBRARY_ARCHITECTURE) - set (_${_PYTHON_PREFIX}_CONFIG_NAMES "${CMAKE_LIBRARY_ARCHITECTURE}-python${_${_PYTHON_PREFIX}_VERSION}-config") - endif() - list (APPEND _${_PYTHON_PREFIX}_CONFIG_NAMES "python${_${_PYTHON_PREFIX}_VERSION}-config") + _python_get_names (_${_PYTHON_PREFIX}_CONFIG_NAMES VERSION ${_${_PYTHON_PREFIX}_VERSION} POSIX CONFIG) find_program (_${_PYTHON_PREFIX}_CONFIG NAMES ${_${_PYTHON_PREFIX}_CONFIG_NAMES} NAMES_PER_DIR @@ -1067,6 +1239,22 @@ if ("Development" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS if (NOT _${_PYTHON_PREFIX}_CONFIG) continue() endif() + + execute_process (COMMAND "${_${_PYTHON_PREFIX}_CONFIG}" --abiflags + RESULT_VARIABLE _${_PYTHON_PREFIX}_RESULT + OUTPUT_VARIABLE __${_PYTHON_PREFIX}_ABIFLAGS + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE) + if (_${_PYTHON_PREFIX}_RESULT) + # assume ABI is not supported + set (__${_PYTHON_PREFIX}_ABIFLAGS "") + endif() + if (DEFINED _${_PYTHON_PREFIX}_FIND_ABI AND NOT __${_PYTHON_PREFIX}_ABIFLAGS IN_LIST _${_PYTHON_PREFIX}_ABIFLAGS) + # Wrong ABI + unset (_${_PYTHON_PREFIX}_CONFIG CACHE) + continue() + endif() + if (DEFINED CMAKE_LIBRARY_ARCHITECTURE) # check that config tool match library architecture execute_process (COMMAND "${_${_PYTHON_PREFIX}_CONFIG}" --configdir @@ -1105,49 +1293,32 @@ if ("Development" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS endif() if (_${_PYTHON_PREFIX}_CONFIG) - set (_${_PYTHON_PREFIX}_HINTS "${_${_PYTHON_PREFIX}_PREFIX}") - - unset (_${_PYTHON_PREFIX}_LIB_DIRS) - unset (_${_PYTHON_PREFIX}_PATH_SUFFIXES) - unset (_${_PYTHON_PREFIX}_LIB_NAMES) - - # retrieve library - execute_process (COMMAND "${_${_PYTHON_PREFIX}_CONFIG}" --ldflags + # enforce current ABI + execute_process (COMMAND "${_${_PYTHON_PREFIX}_CONFIG}" --abiflags RESULT_VARIABLE _${_PYTHON_PREFIX}_RESULT - OUTPUT_VARIABLE _${_PYTHON_PREFIX}_FLAGS + OUTPUT_VARIABLE _${_PYTHON_PREFIX}_ABIFLAGS ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE) - if (NOT _${_PYTHON_PREFIX}_RESULT) - # retrieve library directory - string (REGEX MATCHALL "-L[^ ]+" _${_PYTHON_PREFIX}_LIB_DIRS "${_${_PYTHON_PREFIX}_FLAGS}") - string (REPLACE "-L" "" _${_PYTHON_PREFIX}_LIB_DIRS "${_${_PYTHON_PREFIX}_LIB_DIRS}") - if (_${_PYTHON_PREFIX}_CONFIG MATCHES "python([0-9.]+)-config") - _python_get_path_suffixes (_${_PYTHON_PREFIX}_PATH_SUFFIXES ${CMAKE_MATCH_1} LIBRARY) - endif() - - # retrieve library name - string (REGEX MATCHALL "-lpython[^ ]+" _${_PYTHON_PREFIX}_LIB_NAMES "${_${_PYTHON_PREFIX}_FLAGS}") - string (REPLACE "-l" "" _${_PYTHON_PREFIX}_LIB_NAMES "${_${_PYTHON_PREFIX}_LIB_NAMES}") - list (REMOVE_DUPLICATES _${_PYTHON_PREFIX}_LIB_NAMES) + if (_${_PYTHON_PREFIX}_RESULT) + # assume ABI is not supported + set (_${_PYTHON_PREFIX}_ABIFLAGS "") endif() + set (_${_PYTHON_PREFIX}_HINTS "${_${_PYTHON_PREFIX}_PREFIX}") + + # retrieve library + ## compute some paths and artifact names + string (REGEX REPLACE "^.+python([0-9.]+)[a-z]*-config" "\\1" _${_PYTHON_PREFIX}_CONFIG_VERSION "${_${_PYTHON_PREFIX}_CONFIG}") + _python_get_path_suffixes (_${_PYTHON_PREFIX}_PATH_SUFFIXES VERSION ${_${_PYTHON_PREFIX}_CONFIG_VERSION} LIBRARY) + _python_get_names (_${_PYTHON_PREFIX}_LIB_NAMES VERSION ${_${_PYTHON_PREFIX}_CONFIG_VERSION} POSIX LIBRARY) + execute_process (COMMAND "${_${_PYTHON_PREFIX}_CONFIG}" --configdir RESULT_VARIABLE _${_PYTHON_PREFIX}_RESULT OUTPUT_VARIABLE _${_PYTHON_PREFIX}_CONFIGDIR ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE) if (NOT _${_PYTHON_PREFIX}_RESULT) - list (APPEND _${_PYTHON_PREFIX}_LIB_DIRS "${_${_PYTHON_PREFIX}_CONFIGDIR}") - endif() - list (REMOVE_DUPLICATES _${_PYTHON_PREFIX}_LIB_DIRS) - list (APPEND _${_PYTHON_PREFIX}_HINTS ${_${_PYTHON_PREFIX}_LIB_DIRS}) - - if (NOT _${_PYTHON_PREFIX}_LIB_NAMES) - # config tool do not specify "-l" option (it is the case starting with 3.8) - # extract version from the config tool name and list all possible lib names - if (_${_PYTHON_PREFIX}_CONFIG MATCHES "python([0-9.]+)-config") - _python_get_lib_names (_${_PYTHON_PREFIX}_LIB_NAMES ${CMAKE_MATCH_1}) - endif() + list (APPEND _${_PYTHON_PREFIX}_HINTS "${_${_PYTHON_PREFIX}_CONFIGDIR}") endif() list (APPEND _${_PYTHON_PREFIX}_HINTS "${${_PYTHON_PREFIX}_ROOT_DIR}" ENV ${_PYTHON_PREFIX}_ROOT_DIR) @@ -1195,7 +1366,7 @@ if ("Development" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS # Rely on HINTS and standard paths if config tool failed to locate artifacts if (NOT ${_PYTHON_PREFIX}_LIBRARY_RELEASE OR NOT ${_PYTHON_PREFIX}_INCLUDE_DIR) - set (_${_PYTHON_PREFIX}_HINTS "${${_PYTHON_PREFIX}_ROOT_DIR}" ENV ${_PYTHON_PREFIX}_ROOT_DIR) + set (_${_PYTHON_PREFIX}_HINTS ${_${_PYTHON_PREFIX}_BASE_HINTS}) if (_${_PYTHON_PREFIX}_FIND_STRATEGY STREQUAL "LOCATION") unset (_${_PYTHON_PREFIX}_LIB_NAMES) @@ -1206,9 +1377,9 @@ if ("Development" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS foreach (_${_PYTHON_PREFIX}_LIB_VERSION IN LISTS _${_PYTHON_PREFIX}_FIND_VERSIONS) # library names - _python_get_lib_names (_${_PYTHON_PREFIX}_VERSION_NAMES ${_${_PYTHON_PREFIX}_LIB_VERSION}) + _python_get_names (_${_PYTHON_PREFIX}_VERSION_NAMES VERSION ${_${_PYTHON_PREFIX}_LIB_VERSION} WIN32 POSIX LIBRARY) list (APPEND _${_PYTHON_PREFIX}_LIB_NAMES ${_${_PYTHON_PREFIX}_VERSION_NAMES}) - _python_get_lib_names (_${_PYTHON_PREFIX}_VERSION_NAMES ${_${_PYTHON_PREFIX}_LIB_VERSION} DEBUG) + _python_get_names (_${_PYTHON_PREFIX}_VERSION_NAMES VERSION ${_${_PYTHON_PREFIX}_LIB_VERSION} WIN32 DEBUG) list (APPEND _${_PYTHON_PREFIX}_LIB_NAMES_DEBUG ${_${_PYTHON_PREFIX}_VERSION_NAMES}) # Framework Paths @@ -1220,7 +1391,7 @@ if ("Development" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS list (APPEND _${_PYTHON_PREFIX}_REGISTRY_PATHS ${_${_PYTHON_PREFIX}_VERSION_PATHS}) # Paths suffixes - _python_get_path_suffixes (_${_PYTHON_PREFIX}_VERSION_PATHS ${_${_PYTHON_PREFIX}_LIB_VERSION} LIBRARY) + _python_get_path_suffixes (_${_PYTHON_PREFIX}_VERSION_PATHS VERSION ${_${_PYTHON_PREFIX}_LIB_VERSION} LIBRARY) list (APPEND _${_PYTHON_PREFIX}_PATH_SUFFIXES ${_${_PYTHON_PREFIX}_VERSION_PATHS}) endforeach() @@ -1290,7 +1461,7 @@ if ("Development" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS # search for debug library if (${_PYTHON_PREFIX}_LIBRARY_RELEASE) # use library location as a hint - _python_get_lib_names (_${_PYTHON_PREFIX}_LIB_NAMES_DEBUG ${_${_PYTHON_PREFIX}_VERSION} DEBUG) + _python_get_names (_${_PYTHON_PREFIX}_LIB_NAMES_DEBUG VERSION ${_${_PYTHON_PREFIX}_VERSION} WIN32 DEBUG) get_filename_component (_${_PYTHON_PREFIX}_PATH "${${_PYTHON_PREFIX}_LIBRARY_RELEASE}" DIRECTORY) find_library (${_PYTHON_PREFIX}_LIBRARY_DEBUG NAMES ${_${_PYTHON_PREFIX}_LIB_NAMES_DEBUG} @@ -1327,13 +1498,13 @@ if ("Development" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS endif() else() foreach (_${_PYTHON_PREFIX}_LIB_VERSION IN LISTS _${_PYTHON_PREFIX}_FIND_VERSIONS) - _python_get_lib_names (_${_PYTHON_PREFIX}_LIB_NAMES ${_${_PYTHON_PREFIX}_LIB_VERSION}) - _python_get_lib_names (_${_PYTHON_PREFIX}_LIB_NAMES_DEBUG ${_${_PYTHON_PREFIX}_LIB_VERSION} DEBUG) + _python_get_names (_${_PYTHON_PREFIX}_LIB_NAMES VERSION ${_${_PYTHON_PREFIX}_LIB_VERSION} WIN32 POSIX LIBRARY) + _python_get_names (_${_PYTHON_PREFIX}_LIB_NAMES_DEBUG VERSION ${_${_PYTHON_PREFIX}_LIB_VERSION} WIN32 DEBUG) _python_get_frameworks (_${_PYTHON_PREFIX}_FRAMEWORK_PATHS ${_${_PYTHON_PREFIX}_LIB_VERSION}) _python_get_registries (_${_PYTHON_PREFIX}_REGISTRY_PATHS ${_${_PYTHON_PREFIX}_LIB_VERSION}) - _python_get_path_suffixes (_${_PYTHON_PREFIX}_PATH_SUFFIXES ${_${_PYTHON_PREFIX}_LIB_VERSION} LIBRARY) + _python_get_path_suffixes (_${_PYTHON_PREFIX}_PATH_SUFFIXES VERSION ${_${_PYTHON_PREFIX}_LIB_VERSION} LIBRARY) if (APPLE AND _${_PYTHON_PREFIX}_FIND_FRAMEWORK STREQUAL "FIRST") find_library (${_PYTHON_PREFIX}_LIBRARY_RELEASE @@ -1429,7 +1600,7 @@ if ("Development" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS # retrieve runtime libraries if (${_PYTHON_PREFIX}_LIBRARY_RELEASE) - _python_get_lib_names (_${_PYTHON_PREFIX}_LIB_NAMES ${_${_PYTHON_PREFIX}_VERSION}) + _python_get_names (_${_PYTHON_PREFIX}_LIB_NAMES VERSION ${_${_PYTHON_PREFIX}_VERSION} WIN32 POSIX LIBRARY) get_filename_component (_${_PYTHON_PREFIX}_PATH "${${_PYTHON_PREFIX}_LIBRARY_RELEASE}" DIRECTORY) get_filename_component (_${_PYTHON_PREFIX}_PATH2 "${_${_PYTHON_PREFIX}_PATH}" DIRECTORY) _python_find_runtime_library (${_PYTHON_PREFIX}_RUNTIME_LIBRARY_RELEASE @@ -1439,7 +1610,7 @@ if ("Development" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS PATH_SUFFIXES bin) endif() if (${_PYTHON_PREFIX}_LIBRARY_DEBUG) - _python_get_lib_names (_${_PYTHON_PREFIX}_LIB_NAMES_DEBUG ${_${_PYTHON_PREFIX}_VERSION} DEBUG) + _python_get_names (_${_PYTHON_PREFIX}_LIB_NAMES_DEBUG VERSION ${_${_PYTHON_PREFIX}_VERSION} WIN32 DEBUG) get_filename_component (_${_PYTHON_PREFIX}_PATH "${${_PYTHON_PREFIX}_LIBRARY_DEBUG}" DIRECTORY) get_filename_component (_${_PYTHON_PREFIX}_PATH2 "${_${_PYTHON_PREFIX}_PATH}" DIRECTORY) _python_find_runtime_library (${_PYTHON_PREFIX}_RUNTIME_LIBRARY_DEBUG @@ -1488,7 +1659,7 @@ if ("Development" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS _python_get_frameworks (_${_PYTHON_PREFIX}_FRAMEWORK_PATHS ${_${_PYTHON_PREFIX}_VERSION}) _python_get_registries (_${_PYTHON_PREFIX}_REGISTRY_PATHS ${_${_PYTHON_PREFIX}_VERSION}) - _python_get_path_suffixes (_${_PYTHON_PREFIX}_PATH_SUFFIXES ${_${_PYTHON_PREFIX}_VERSION} INCLUDE) + _python_get_path_suffixes (_${_PYTHON_PREFIX}_PATH_SUFFIXES VERSION ${_${_PYTHON_PREFIX}_VERSION} INCLUDE) if (APPLE AND _${_PYTHON_PREFIX}_FIND_FRAMEWORK STREQUAL "FIRST") find_path (${_PYTHON_PREFIX}_INCLUDE_DIR diff --git a/Modules/FindPython3.cmake b/Modules/FindPython3.cmake index 2ead5b6..c8d9f24 100644 --- a/Modules/FindPython3.cmake +++ b/Modules/FindPython3.cmake @@ -138,6 +138,47 @@ Hints * If set to TRUE, search **only** for static libraries. * If set to FALSE, search **only** for shared libraries. +``Python3_FIND_ABI`` + This variable defines which ABIs, as defined in + `PEP 3149 `_, should be searched. + + .. note:: + + If ``Python3_FIND_ABI`` is not defined, any ABI will be searched. + + The ``Python3_FIND_ABI`` variable is a 3-tuple specifying, in that order, + ``pydebug`` (``d``), ``pymalloc`` (``m``) and ``unicode`` (``u``) flags. + Each element can be set to one of the following: + + * ``ON``: Corresponding flag is selected. + * ``OFF``: Corresponding flag is not selected. + * ``ANY``: The two posibilties (``ON`` and ``OFF``) will be searched. + + From this 3-tuple, various ABIs will be searched starting from the most + specialized to the most general. Moreover, ``debug`` versions will be + searched **after** ``non-debug`` ones. + + For example, if we have:: + + set (Python3_FIND_ABI "ON" "ANY" "ANY") + + The following flags combinations will be appended, in that order, to the + artifact names: ``dmu``, ``dm``, ``du``, and ``d``. + + And to search any possible ABIs:: + + set (Python3_FIND_ABI "ANY" "ANY" "ANY") + + The following combinations, in that order, will be used: ``mu``, ``m``, + ``u``, ````, ``dmu``, ``dm``, ``du`` and ``d``. + + .. note:: + + This hint is useful only on ``POSIX`` systems. So, on ``Windows`` systems, + when ``Python3_FIND_ABI`` is defined, ``Python`` distributions from + `python.org `_ will be found only if value for + each flag is ``OFF`` or ``ANY``. + ``Python3_FIND_STRATEGY`` This variable defines how lookup will be done. The ``Python3_FIND_STRATEGY`` variable can be set to empty or one of the diff --git a/Tests/FindPython/FindPythonScript.cmake b/Tests/FindPython/FindPythonScript.cmake index 9450092..bc7e0d1 100644 --- a/Tests/FindPython/FindPythonScript.cmake +++ b/Tests/FindPython/FindPythonScript.cmake @@ -1 +1,9 @@ -find_package(${PYTHON_PACKAGE_NAME} REQUIRED QUIET) + +if (PYTHON_MUST_NOT_BE_FOUND) + find_package(${PYTHON_PACKAGE_NAME} QUIET) + if (${PYTHON_PACKAGE_NAME}_FOUND) + message(FATAL_ERROR "${PYTHON_PACKAGE_NAME}: unexpectedly founded.") + endif() +else() + find_package(${PYTHON_PACKAGE_NAME} REQUIRED QUIET) +endif() diff --git a/Tests/FindPython/Python2/CMakeLists.txt b/Tests/FindPython/Python2/CMakeLists.txt index 274745a..cf77ca2 100644 --- a/Tests/FindPython/Python2/CMakeLists.txt +++ b/Tests/FindPython/Python2/CMakeLists.txt @@ -34,4 +34,5 @@ add_test (NAME python2_spam2 add_test(NAME findpython2_script COMMAND "${CMAKE_COMMAND}" -DPYTHON_PACKAGE_NAME=Python2 + -DPython2_FIND_STRATEGY=${Python2_FIND_STRATEGY} -P "${CMAKE_CURRENT_LIST_DIR}/../FindPythonScript.cmake") diff --git a/Tests/FindPython/Python3/CMakeLists.txt b/Tests/FindPython/Python3/CMakeLists.txt index b21a15b..6691a48 100644 --- a/Tests/FindPython/Python3/CMakeLists.txt +++ b/Tests/FindPython/Python3/CMakeLists.txt @@ -34,4 +34,57 @@ add_test (NAME python3_spam3 add_test(NAME findpython3_script COMMAND "${CMAKE_COMMAND}" -DPYTHON_PACKAGE_NAME=Python3 + -DPython3_FIND_STRATEGY=${Python3_FIND_STRATEGY} + -P "${CMAKE_CURRENT_LIST_DIR}/../FindPythonScript.cmake") + + +## Try a new search specifying only expected ABI +# retrieve ABI of python interpreter +execute_process (COMMAND "${Python3_EXECUTABLE}" -c + "import sys; sys.stdout.write(sys.abiflags)" + RESULT_VARIABLE result + OUTPUT_VARIABLE abi + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE) +if (result) + # assume ABI is not supported + set (abi "") +endif() + +# define FIND_ABI variable +if (abi MATCHES "d") + set (Python3_VALID_ABI "ON") +else() + set (Python3_VALID_ABI "OFF") +endif() +if (abi MATCHES "m") + list (APPEND Python3_VALID_ABI "ON") +else() + list (APPEND Python3_VALID_ABI "OFF") +endif() +if (abi MATCHES "u") + list (APPEND Python3_VALID_ABI "ON") +else() + list (APPEND Python3_VALID_ABI "OFF") +endif() +# build an invalid pattern for ABI +set (Python3_INVALID_ABI) +foreach (abi IN LISTS Python3_VALID_ABI) + if (abi) + list (APPEND Python3_INVALID_ABI "OFF") + else() + list (APPEND Python3_INVALID_ABI "ON") + endif() +endforeach() + +add_test(NAME python3_find_valid_abi + COMMAND "${CMAKE_COMMAND}" -DPYTHON_PACKAGE_NAME=Python3 + -DPython3_FIND_STRATEGY=${Python3_FIND_STRATEGY} + "-DPython3_FIND_ABI=${Python3_VALID_ABI}" + -P "${CMAKE_CURRENT_LIST_DIR}/../FindPythonScript.cmake") +add_test(NAME python3_find_invalid_abi + COMMAND "${CMAKE_COMMAND}" -DPYTHON_PACKAGE_NAME=Python3 + -DPYTHON_MUST_NOT_BE_FOUND=ON + -DPython3_FIND_STRATEGY=${Python3_FIND_STRATEGY} + "-DPython3_FIND_ABI=${Python3_INVALID_ABI}" -P "${CMAKE_CURRENT_LIST_DIR}/../FindPythonScript.cmake") https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2454fe84f599abc55fe61eee45d22b45d6d2b7f2 commit 2454fe84f599abc55fe61eee45d22b45d6d2b7f2 Author: Stefan Lietzau AuthorDate: Tue Jun 18 18:21:56 2019 +0200 Commit: Stefan Lietzau CommitDate: Mon Jun 24 09:27:39 2019 +0200 FindMatlab: Support EXACT versions If an exact version is requested, don't pick the latest matlab version but the one matching the requested version. Fixes: #19155 diff --git a/Modules/FindMatlab.cmake b/Modules/FindMatlab.cmake index 3547642..ce46870 100644 --- a/Modules/FindMatlab.cmake +++ b/Modules/FindMatlab.cmake @@ -1442,14 +1442,28 @@ list(LENGTH _matlab_possible_roots _numbers_of_matlab_roots) set(Matlab_VERSION_STRING "NOTFOUND") set(Matlab_Or_MCR "UNKNOWN") if(_numbers_of_matlab_roots GREATER 0) - list(GET _matlab_possible_roots 0 Matlab_Or_MCR) - list(GET _matlab_possible_roots 1 Matlab_VERSION_STRING) - list(GET _matlab_possible_roots 2 Matlab_ROOT_DIR) - - # adding a warning in case of ambiguity - if(_numbers_of_matlab_roots GREATER 3 AND MATLAB_FIND_DEBUG) - message(WARNING "[MATLAB] Found several distributions of Matlab. Setting the current version to ${Matlab_VERSION_STRING} (located ${Matlab_ROOT_DIR})." - " If this is not the desired behaviour, provide the -DMatlab_ROOT_DIR=... on the command line") + if(Matlab_FIND_VERSION_EXACT) + list(FIND _matlab_possible_roots ${Matlab_FIND_VERSION} _list_index) + if(_list_index LESS 0) + set(_list_index 1) + endif() + + math(EXPR _matlab_or_mcr_index "${_list_index} - 1") + math(EXPR _matlab_root_dir_index "${_list_index} + 1") + + list(GET _matlab_possible_roots ${_matlab_or_mcr_index} Matlab_Or_MCR) + list(GET _matlab_possible_roots ${_list_index} Matlab_VERSION_STRING) + list(GET _matlab_possible_roots ${_matlab_root_dir_index} Matlab_ROOT_DIR) + else() + list(GET _matlab_possible_roots 0 Matlab_Or_MCR) + list(GET _matlab_possible_roots 1 Matlab_VERSION_STRING) + list(GET _matlab_possible_roots 2 Matlab_ROOT_DIR) + + # adding a warning in case of ambiguity + if(_numbers_of_matlab_roots GREATER 3 AND MATLAB_FIND_DEBUG) + message(WARNING "[MATLAB] Found several distributions of Matlab. Setting the current version to ${Matlab_VERSION_STRING} (located ${Matlab_ROOT_DIR})." + " If this is not the desired behaviour, use the EXACT keyword or provide the -DMatlab_ROOT_DIR=... on the command line") + endif() endif() endif() https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8ab8563533e57f4f4af769daf4590c6d262e5c41 commit 8ab8563533e57f4f4af769daf4590c6d262e5c41 Author: Brad King AuthorDate: Wed Jun 19 09:00:19 2019 -0400 Commit: Brad King CommitDate: Wed Jun 19 09:00:19 2019 -0400 Help: Add tutorial guide table of contents diff --git a/Help/guide/tutorial/index.rst b/Help/guide/tutorial/index.rst index 3265645..db8e7a0 100644 --- a/Help/guide/tutorial/index.rst +++ b/Help/guide/tutorial/index.rst @@ -1,6 +1,10 @@ CMake Tutorial ************** +.. only:: html + + .. contents:: + This tutorial provides a step-by-step guide that covers common build system issues that CMake helps address. Seeing how various topics all work together in an example project can be very helpful. This tutorial https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0a6c9c417a5a5a254cf43eea77b2e8ac64dfcbb7 commit 0a6c9c417a5a5a254cf43eea77b2e8ac64dfcbb7 Author: Betsy McPhail AuthorDate: Wed Jun 12 15:12:39 2019 -0400 Commit: Brad King CommitDate: Wed Jun 19 08:59:31 2019 -0400 Help: Update tutorial to include text from CMake book diff --git a/Help/guide/tutorial/index.rst b/Help/guide/tutorial/index.rst index 673f284..3265645 100644 --- a/Help/guide/tutorial/index.rst +++ b/Help/guide/tutorial/index.rst @@ -1,9 +1,34 @@ CMake Tutorial ************** +This tutorial provides a step-by-step guide that covers common build +system issues that CMake helps address. Seeing how various topics all +work together in an example project can be very helpful. This tutorial +can be found in the ``Help/guide/tutorial`` directory of the CMake +source code tree. Each topic has its own subdirectory containing code +that may be used as a starting point for that step. The tutorial +examples are progressive so that each step provides the complete +solution for the previous step. + A Basic Starting Point (Step 1) =============================== +The most basic project is an executable built from source code files. +For simple projects, a two line CMakeLists file is all that is required. +This will be the starting point for our tutorial. The CMakeLists file +looks like: + +.. literalinclude:: Step1/CMakeLists.txt + :language: cmake + +Note that this example uses lower case commands in the CMakeLists file. +Upper, lower, and mixed case commands are supported by CMake. The source +code for ``tutorial.cxx`` will compute the square root of a number and +the first version of it is very simple, as follows: + +.. literalinclude:: Step1/tutorial.cxx + :language: c++ + Adding a Version Number and Configured Header File -------------------------------------------------- @@ -18,6 +43,14 @@ To add a version number we modify the CMakeLists file as follows: :start-after: # set the version number :end-before: # configure a header file +Since the configured file will be written into the binary tree, we +must add that directory to the list of paths to search for include +files. + +.. literalinclude:: Step2/CMakeLists.txt + :language: cmake + :start-after: # so that we will find TutorialConfig.h + We then create a ``TutorialConfig.h.in`` file in the source tree with the following contents: @@ -35,6 +68,8 @@ version numbers. The updated source code is listed below. :start-after: // report version :end-before: return 1; +The main changes are the inclusion of the ``TutorialConfig.h`` header +file and printing out a version number as part of the usage message. Specify the C++ Standard ------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=eef3e020c21d2fdba19aab0daf1b99f8de0a16fe commit eef3e020c21d2fdba19aab0daf1b99f8de0a16fe Author: Betsy McPhail AuthorDate: Tue Jun 18 10:49:40 2019 -0400 Commit: Brad King CommitDate: Wed Jun 19 08:57:12 2019 -0400 Help: Populate tutorial guide text Migrate tutorial text from individual `directions.txt` files to the main tutorial document. Add some comments to source code to provide anchors for inclusion. diff --git a/Help/guide/tutorial/Complete/CMakeLists.txt b/Help/guide/tutorial/Complete/CMakeLists.txt index 1c97545..e84f932 100644 --- a/Help/guide/tutorial/Complete/CMakeLists.txt +++ b/Help/guide/tutorial/Complete/CMakeLists.txt @@ -1,20 +1,20 @@ cmake_minimum_required(VERSION 3.3) project(Tutorial) +set(CMAKE_CXX_STANDARD 14) + +# set the version number +set(Tutorial_VERSION_MAJOR 1) +set(Tutorial_VERSION_MINOR 0) + # control where the static and shared libraries are built so that on windows # we don't need to tinker with the path to run the executable set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}") set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}") set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}") -set(CMAKE_CXX_STANDARD 14) - option(BUILD_SHARED_LIBS "Build using shared libraries" ON) -# the version number. -set(Tutorial_VERSION_MAJOR 1) -set(Tutorial_VERSION_MINOR 0) - if(APPLE) set(CMAKE_INSTALL_RPATH "@executable_path/../lib") elseif(UNIX) diff --git a/Help/guide/tutorial/Complete/MathFunctions/CMakeLists.txt b/Help/guide/tutorial/Complete/MathFunctions/CMakeLists.txt index 161ad64..63c0f5f 100644 --- a/Help/guide/tutorial/Complete/MathFunctions/CMakeLists.txt +++ b/Help/guide/tutorial/Complete/MathFunctions/CMakeLists.txt @@ -1,4 +1,3 @@ - # add the library that runs add_library(MathFunctions MathFunctions.cxx) @@ -62,6 +61,7 @@ target_compile_definitions(MathFunctions PRIVATE "EXPORTING_MYMATH") set_property(TARGET MathFunctions PROPERTY VERSION "1.0.0") set_property(TARGET MathFunctions PROPERTY SOVERSION "1") +# install rules install(TARGETS MathFunctions DESTINATION lib EXPORT MathFunctionsTargets) diff --git a/Help/guide/tutorial/Consumer/directions.txt b/Help/guide/tutorial/Consumer/directions.txt deleted file mode 100644 index 6a70aab..0000000 --- a/Help/guide/tutorial/Consumer/directions.txt +++ /dev/null @@ -1,6 +0,0 @@ -# Import a CMake Project# - -This examples shows how a project can find other CMake packages that -generated Config.cmake files. - -It also shows how to state a projects external dependencies when generating a Config.cmake. diff --git a/Help/guide/tutorial/MultiPackage/directions.txt b/Help/guide/tutorial/MultiPackage/directions.txt deleted file mode 100644 index c3102bb..0000000 --- a/Help/guide/tutorial/MultiPackage/directions.txt +++ /dev/null @@ -1,34 +0,0 @@ -# Packaging Debug and Release # - -By default CMake is model is that a build directory only contains a single -configuration, be it Debug, Release, MinSizeRel, or RelWithDebInfo. - -But it is possible to setup CPack to bundle multiple build directories at the same -time to build a package that contains multiple configurations of the same project. - -First we need to ahead and construct a directory called 'multi_config' this -will contain all the builds that we want to package together. - -Second create a 'debug' and 'release' directory underneath 'multi_config'. At -the end you should have a layout that looks like: - -? multi_config - ??? debug - ??? release - -Now we need to setup debug and release builds, which would roughly entail -the following: - - cd debug - cmake -DCMAKE_BUILD_TYPE=Debug ../../MultiPackage/ - cmake --build . - cd ../release - cmake -DCMAKE_BUILD_TYPE=Release ../../MultiPackage/ - cmake --build . - cd .. - - -Now that both the debug and release builds are complete we can now use -the custom MultiCPackConfig to package both builds into a single release. - - cpack --config ../../MultiPackage/MultiCPackConfig.cmake diff --git a/Help/guide/tutorial/Readme.txt b/Help/guide/tutorial/Readme.txt deleted file mode 100644 index 74eb01a..0000000 --- a/Help/guide/tutorial/Readme.txt +++ /dev/null @@ -1,16 +0,0 @@ - -Step 0: A Starting Point -Step 1: Configure a File and C++11 Controls -Step 2: Adding a Library -Step 3: Usage Requirements for Library -Step 4: Installing and Testing -Step 5: System Introspection -Step 6: Custom Command and Generated File -Step 7: Building an Installer -Step 8: CDash submission -Step 9: Mixing Static and Shared -Step 10: Generator Expressions -Step 11: Adding Export Configuration -Complete: End result of Step 11 -Consumer: Example of Import Packages -MultiPackage: How to package Debug and Release versions diff --git a/Help/guide/tutorial/Step1/directions.txt b/Help/guide/tutorial/Step1/directions.txt deleted file mode 100644 index 827d775..0000000 --- a/Help/guide/tutorial/Step1/directions.txt +++ /dev/null @@ -1,95 +0,0 @@ -# Adding a Version Number and Configured Header File # - -The first feature we will add is to provide our executable and project with a -version number. While we could do this exclusively in the source code, using -CMakeLists provides more flexibility. - -To add a version number we modify the CMakeLists file as follows: - - cmake_minimum_required(VERSION 3.3) - project(Tutorial) - - # the version number. - set(Tutorial_VERSION_MAJOR 1) - set(Tutorial_VERSION_MINOR 0) - - # configure a header file to pass some of the CMake settings - # to the source code - configure_file( - "${PROJECT_SOURCE_DIR}/TutorialConfig.h.in" - "${PROJECT_BINARY_DIR}/TutorialConfig.h" - ) - - # add the executable - add_executable(Tutorial tutorial.cxx) - - # add the binary tree to the search path for include files - # so that we will find TutorialConfig.h - target_include_directories(Tutorial PUBLIC - "${PROJECT_BINARY_DIR}" - ) - - -We then create a TutorialConfig.h.in file in the source tree with the -following contents: - - // the configured options and settings for Tutorial - #define Tutorial_VERSION_MAJOR @Tutorial_VERSION_MAJOR@ - #define Tutorial_VERSION_MINOR @Tutorial_VERSION_MINOR@ - -When CMake configures this header file the values for @Tutorial_VERSION_MAJOR@ -and @Tutorial_VERSION_MINOR@ will be replaced by the values from the CMakeLists -file. Next we modify tutorial.cxx to include the configured header file and to -make use of the version numbers. The resulting source code is listed below. - - // A simple program that computes the square root of a number - #include - #include - #include - #include - - #include "TutorialConfig.h" - - int main (int argc, char *argv[]) - { - if (argc < 2) { - std::cout << argv[0] << " Version " - << Tutorial_VERSION_MAJOR << "." << Tutorial_VERSION_MINOR - << std::endl; - std::cout << "Usage: " << argv[0] << " number" << std::endl; - return 1; - } - - double inputValue = atof(argv[1]); - - double outputValue = sqrt(inputValue); - std::cout << "The square root of " - << inputValue << " is " << outputValue << std::endl; - return 0; - } - -# Adding C++11 support # - -Let's add some C++11 features to our project. We will need to explicitly state -in the CMake code that it should use the correct flags. The easiest way to -enable C++11 support for CMake is by using the CMAKE_CXX_STANDARD -and CMAKE_CXX_STANDARD_REQUIRED variables. - -First, replace `atof` with `std::stod` in tutorial.cxx. - -Then, add the CMAKE_CXX_STANDARD and CMAKE_CXX_STANDARD_REQUIRED variables to -the CMakeLists file. The STANADARD value should be set to 11, and REQUIRED -should be set to True. - - -# Build and Test # - -Run cmake or cmake-gui to configure the project and then build it with your -chosen build tool - -cd to the directory where Tutorial was built (likely the make directory or -a Debug or Release build configuration subdirectory) and run these commands: - - Tutorial 4294967296 - Tutorial 10 - Tutorial diff --git a/Help/guide/tutorial/Step10/CMakeLists.txt b/Help/guide/tutorial/Step10/CMakeLists.txt index 79aadd5..5819272 100644 --- a/Help/guide/tutorial/Step10/CMakeLists.txt +++ b/Help/guide/tutorial/Step10/CMakeLists.txt @@ -1,20 +1,20 @@ cmake_minimum_required(VERSION 3.3) project(Tutorial) +set(CMAKE_CXX_STANDARD 14) + +# Set the version number +set(Tutorial_VERSION_MAJOR 1) +set(Tutorial_VERSION_MINOR 0) + # control where the static and shared libraries are built so that on windows # we don't need to tinker with the path to run the executable set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}") set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}") set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}") -set(CMAKE_CXX_STANDARD 14) - option(BUILD_SHARED_LIBS "Build using shared libraries" ON) -# the version number. -set(Tutorial_VERSION_MAJOR 1) -set(Tutorial_VERSION_MINOR 0) - # configure a header file to pass the version number only configure_file( "${PROJECT_SOURCE_DIR}/TutorialConfig.h.in" diff --git a/Help/guide/tutorial/Step10/MathFunctions/CMakeLists.txt b/Help/guide/tutorial/Step10/MathFunctions/CMakeLists.txt index 7a23505..aafd090 100644 --- a/Help/guide/tutorial/Step10/MathFunctions/CMakeLists.txt +++ b/Help/guide/tutorial/Step10/MathFunctions/CMakeLists.txt @@ -1,4 +1,3 @@ - # add the library that runs add_library(MathFunctions MathFunctions.cxx) @@ -57,5 +56,6 @@ endif() # building on windows target_compile_definitions(MathFunctions PRIVATE "EXPORTING_MYMATH") +# install rules install(TARGETS MathFunctions DESTINATION lib) install(FILES MathFunctions.h DESTINATION include) diff --git a/Help/guide/tutorial/Step10/directions.txt b/Help/guide/tutorial/Step10/directions.txt deleted file mode 100644 index 5317b54..0000000 --- a/Help/guide/tutorial/Step10/directions.txt +++ /dev/null @@ -1,38 +0,0 @@ -# Adding Generator Expressions # - -Generator expressions are evaluated during build system generation to produce -information specific to each build configuration. - -Generator expressions are allowed in the context of many target properties, such -as LINK_LIBRARIES, INCLUDE_DIRECTORIES, COMPILE_DEFINITIONS and others. They may -also be used when using commands to populate those properties, such as -target_link_libraries(), target_include_directories(), -target_compile_definitions() and others. - -Generator expressions may to used to enable conditional linking, conditional -definitions used when compiling, and conditional include directories and more. -The conditions may be based on the build configuration, target properties, -platform information or any other queryable information. - -There are different types of generator expressions including Logical, -Informational, and Output expressions. - -Logical expressions are used to create conditional output. The basic expressions -are the 0 and 1 expressions. A "$<0:...>" results in the empty string, and -"$<1:...>" results in the content of "...". They can also be nested. -For example: - - if(HAVE_LOG AND HAVE_EXP) - target_compile_definitions(SqrtLibrary - PRIVATE "HAVE_LOG" "HAVE_EXP") - endif() - -Can be rewritten with generator expressions: - - target_compile_definitions(SqrtLibrary PRIVATE - "$<$:HAVE_LOG>" - "$<$:HAVE_EXP>" - ) - -Note that "${HAVE_LOG}" is evaluated at CMake configure time while -"$<$:HAVE_LOG>" is evaluated at build system generation time. diff --git a/Help/guide/tutorial/Step10/tutorial.cxx b/Help/guide/tutorial/Step10/tutorial.cxx index 4451cbd..42eaab9 100644 --- a/Help/guide/tutorial/Step10/tutorial.cxx +++ b/Help/guide/tutorial/Step10/tutorial.cxx @@ -9,6 +9,7 @@ int main(int argc, char* argv[]) { if (argc < 2) { + // report version std::cout << argv[0] << " Version " << Tutorial_VERSION_MAJOR << "." << Tutorial_VERSION_MINOR << std::endl; std::cout << "Usage: " << argv[0] << " number" << std::endl; diff --git a/Help/guide/tutorial/Step11/CMakeLists.txt b/Help/guide/tutorial/Step11/CMakeLists.txt index 79aadd5..2e5cb15 100644 --- a/Help/guide/tutorial/Step11/CMakeLists.txt +++ b/Help/guide/tutorial/Step11/CMakeLists.txt @@ -1,20 +1,20 @@ cmake_minimum_required(VERSION 3.3) project(Tutorial) +set(CMAKE_CXX_STANDARD 14) + +# set the version number +set(Tutorial_VERSION_MAJOR 1) +set(Tutorial_VERSION_MINOR 0) + # control where the static and shared libraries are built so that on windows # we don't need to tinker with the path to run the executable set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}") set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}") set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}") -set(CMAKE_CXX_STANDARD 14) - option(BUILD_SHARED_LIBS "Build using shared libraries" ON) -# the version number. -set(Tutorial_VERSION_MAJOR 1) -set(Tutorial_VERSION_MINOR 0) - # configure a header file to pass the version number only configure_file( "${PROJECT_SOURCE_DIR}/TutorialConfig.h.in" diff --git a/Help/guide/tutorial/Step11/MathFunctions/CMakeLists.txt b/Help/guide/tutorial/Step11/MathFunctions/CMakeLists.txt index 760d6a5..ea42770 100644 --- a/Help/guide/tutorial/Step11/MathFunctions/CMakeLists.txt +++ b/Help/guide/tutorial/Step11/MathFunctions/CMakeLists.txt @@ -1,4 +1,3 @@ - # add the library that runs add_library(MathFunctions MathFunctions.cxx) @@ -56,5 +55,6 @@ target_compile_definitions(MathFunctions PRIVATE "$<$:USE_MY #building on windows target_compile_definitions(MathFunctions PRIVATE "EXPORTING_MYMATH") +# install rules install(TARGETS MathFunctions DESTINATION lib) install(FILES MathFunctions.h DESTINATION include) diff --git a/Help/guide/tutorial/Step11/directions.txt b/Help/guide/tutorial/Step11/directions.txt deleted file mode 100644 index ebb5def..0000000 --- a/Help/guide/tutorial/Step11/directions.txt +++ /dev/null @@ -1,104 +0,0 @@ -# Adding Export Configuration # - -During Step 4 of the tutorial we added the ability for CMake to install the -library and headers of the project. During Step 7 we added the ability -to package up this information so it could be distributed to other people. - -The next step is to add the necessary information so that other CMake projects -can use our project, be it from a build directory, a local install or when -packaged. - -The first step is to update our install(TARGETS) commands to not only specify -a DESTINATION but also an EXPORT. The EXPORT keyword generates and installs a -CMake file containing code to import all targets listed in the install command -from the installation tree. So let's go ahead and explicitly EXPORT the -MathFunctions library by updating the install command in -MathFunctions/CMakeLists.txt to look like: - - install(TARGETS MathFunctions DESTINATION lib EXPORT MathFunctionsTargets) - -Now that we have MathFunctions being exported, we also need to explicitly install -the generated MathFunctionsTargets.cmake file. This is done by adding -the following to the bottom of the top-level CMakeLists.txt: - - # install the configuration targets - install(EXPORT MathFunctionsTargets - FILE MathFunctionsTargets.cmake - DESTINATION lib/cmake/MathFunctions - ) - -At this point you should try and run CMake. If everything is setup properly -you will see that CMake will generate an error that looks like: - - Target "MathFunctions" INTERFACE_INCLUDE_DIRECTORIES property contains - path: - - "/Users/robert/Documents/CMakeClass/Tutorial/Step11/MathFunctions" - - which is prefixed in the source directory. - -What CMake is trying to say is that during generating the export information -it will export a path that is intrinsically tied to the current machine and -will not be valid on other machines. The solution to this is to update the -MathFunctions target_include_directories to understand that it needs different -INTERFACE locations when being used from within the build directory and from an -install / package. This means converting the target_include_directories -call for MathFunctions to look like: - - target_include_directories(MathFunctions - INTERFACE - $ - $ - ) - -Once this has been updated, we can re-run CMake and see verify that it doesn't -warn anymore. - -At this point, we have CMake properly packaging the target information that is -required but we will still need to generate a MathFunctionsConfig.cmake, so -that the CMake find_package command can find our project. So let's go ahead and -add a new file to the top-level of the project called Config.cmake.in with the -following contents: - - @PACKAGE_INIT@ - - include ( "${CMAKE_CURRENT_LIST_DIR}/MathFunctionsTargets.cmake" ) - -Then, to properly configure and install that file, add the following to the -bottom of the top-level CMakeLists: - - include(CMakePackageConfigHelpers) - # generate the config file that is includes the exports - configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in - "${CMAKE_CURRENT_BINARY_DIR}/MathFunctionsConfig.cmake" - INSTALL_DESTINATION "lib/cmake/example" - NO_SET_AND_CHECK_MACRO - NO_CHECK_REQUIRED_COMPONENTS_MACRO - ) - # generate the version file for the config file - write_basic_package_version_file( - "${CMAKE_CURRENT_BINARY_DIR}/MathFunctionsConfigVersion.cmake" - VERSION "${Tutorial_VERSION_MAJOR}.${Tutorial_VERSION_MINOR}" - COMPATIBILITY AnyNewerVersion - ) - - # install the configuration file - install(FILES - ${CMAKE_CURRENT_BINARY_DIR}/MathFunctionsConfig.cmake - DESTINATION lib/cmake/MathFunctions - ) - -At this point, we have generated a relocatable CMake Configuration for our project -that can be used after the project has been installed or packaged. If we want -our project to also be used from a build directory we only have to add -the following to the bottom of the top level CMakeLists: - - # generate the export targets for the build tree - # needs to be after the install(TARGETS ) command - export(EXPORT MathFunctionsTargets - FILE "${CMAKE_CURRENT_BINARY_DIR}/MathFunctionsTargets.cmake" - ) - -With this export call we now generate a Targets.cmake, allowing the configured -MathFunctionsConfig.cmake in the build directory to be used by other projects, -without needing it to be installed. diff --git a/Help/guide/tutorial/Step11/tutorial.cxx b/Help/guide/tutorial/Step11/tutorial.cxx index 38d4a79..6acafd2 100644 --- a/Help/guide/tutorial/Step11/tutorial.cxx +++ b/Help/guide/tutorial/Step11/tutorial.cxx @@ -9,6 +9,7 @@ int main(int argc, char* argv[]) { if (argc < 2) { + // report version std::cout << argv[0] << " Version " << Tutorial_VERSION_MAJOR << "." << Tutorial_VERSION_MINOR << std::endl; std::cout << "Usage: " << argv[0] << " number" << std::endl; diff --git a/Help/guide/tutorial/Step2/CMakeLists.txt b/Help/guide/tutorial/Step2/CMakeLists.txt index 8e50e7c..1f43b2b 100644 --- a/Help/guide/tutorial/Step2/CMakeLists.txt +++ b/Help/guide/tutorial/Step2/CMakeLists.txt @@ -2,7 +2,8 @@ cmake_minimum_required(VERSION 3.3) project(Tutorial) set(CMAKE_CXX_STANDARD 14) -# the version number. + +# set the version number set(Tutorial_VERSION_MAJOR 1) set(Tutorial_VERSION_MINOR 0) diff --git a/Help/guide/tutorial/Step2/directions.txt b/Help/guide/tutorial/Step2/directions.txt deleted file mode 100644 index 48de7a2..0000000 --- a/Help/guide/tutorial/Step2/directions.txt +++ /dev/null @@ -1,101 +0,0 @@ -# Adding a Library # - -Now we will add a library to our project. This library will contain our own -implementation for computing the square root of a number. The executable can -then use this library instead of the standard square root function provided by -the compiler. - -For this tutorial we will put the library into a subdirectory -called MathFunctions. It will have the following one line CMakeLists file: - - add_library(MathFunctions mysqrt.cxx) - -The source file mysqrt.cxx has one function called mysqrt that provides similar -functionality to the compiler?s sqrt function. To make use of the new library -we add an add_subdirectory call in the top-level CMakeLists file so that the -library will get built. We add the new library to the executable, and add the -MathFunctions as an include directory so that mqsqrt.h header file can be -found. The last few lines of the top-level CMakeLists file now look like: - - - add_subdirectory(MathFunctions) - - #add the executable - add_executable(Tutorial tutorial.cxx) - - target_link_libraries(Tutorial ${EXTRA_LIBS}) - - -Now let us make the MathFunctions library optional. While for the tutorial -there really isn?t any need to do so, but with larger projects this is a common -occurrence. The first step is to add an option to the top-level CMakeLists file. - - option (USE_MYMATH - "Use tutorial provided math implementation" ON) - -This will show up in CMake GUI and ccmake with a default value of ON that can -be changed by the user. This setting will be stored so that the user does not -need to set the value each time they run CMake on this build directory. - -The next change is to make building and linking the MathFunctions library -conditional. To do this we change the top-level CMakeLists file to look like -the following: - - cmake_minimum_required(VERSION 3.3) - project(Tutorial) - - set(CMAKE_CXX_STANDARD 14) - - # the version number. - set(Tutorial_VERSION_MAJOR 1) - set(Tutorial_VERSION_MINOR 0) - - # configure a header file to pass some of the CMake settings - # to the source code - configure_file( - "${PROJECT_SOURCE_DIR}/TutorialConfig.h.in" - "${PROJECT_BINARY_DIR}/TutorialConfig.h" - ) - - # should we use our own math functions - option(USE_MYMATH "Use tutorial provided math implementation" ON) - - # add the MathFunctions library? - if(USE_MYMATH) - add_subdirectory(MathFunctions) - list(APPEND EXTRA_LIBS MathFunctions) - list(APPEND EXTRA_INCLUDES "${PROJECT_SOURCE_DIR}/MathFunctions") - endif(USE_MYMATH) - - # add the executable - add_executable(Tutorial tutorial.cxx) - - target_link_libraries(Tutorial ${EXTRA_LIBS}) - - # add the binary tree to the search path for include files - # so that we will find TutorialConfig.h - target_include_directories(Tutorial PUBLIC - "${PROJECT_BINARY_DIR}" - ${EXTRA_INCLUDES} - ) - -Note the use of the variables EXTRA_LIBS, and EXTRA_INCLUDES to collect -up any optional libraries to later be linked into the executable. This is a -classic approach when dealing with many optional components, we will cover the -modern approach in the next step. For now the corresponding changes to the -source code are fairly straightforward and leave us with: - - #ifdef USE_MYMATH - double outputValue = mysqrt(inputValue); - #else - double outputValue = sqrt(inputValue); - #endif - -Since the source code now requires USE_MYMATH we can add it to the -TutorialConfig.h.in. Simply add the following line: - #cmakedefine USE_MYMATH - -Run cmake or cmake-gui to configure the project and then build it with your -chosen build tool and then run the built Tutorial executable. - -Which function gives better results, Step1?s sqrt or Step2?s mysqrt? diff --git a/Help/guide/tutorial/Step2/tutorial.cxx b/Help/guide/tutorial/Step2/tutorial.cxx index 5ba34e8..f2ab446 100644 --- a/Help/guide/tutorial/Step2/tutorial.cxx +++ b/Help/guide/tutorial/Step2/tutorial.cxx @@ -8,6 +8,7 @@ int main(int argc, char* argv[]) { if (argc < 2) { + // report version std::cout << argv[0] << " Version " << Tutorial_VERSION_MAJOR << "." << Tutorial_VERSION_MINOR << std::endl; std::cout << "Usage: " << argv[0] << " number" << std::endl; diff --git a/Help/guide/tutorial/Step3/CMakeLists.txt b/Help/guide/tutorial/Step3/CMakeLists.txt index baa0a44..966c38a 100644 --- a/Help/guide/tutorial/Step3/CMakeLists.txt +++ b/Help/guide/tutorial/Step3/CMakeLists.txt @@ -6,7 +6,7 @@ set(CMAKE_CXX_STANDARD 14) # should we use our own math functions option(USE_MYMATH "Use tutorial provided math implementation" ON) -# the version number. +# set the version number set(Tutorial_VERSION_MAJOR 1) set(Tutorial_VERSION_MINOR 0) diff --git a/Help/guide/tutorial/Step3/directions.txt b/Help/guide/tutorial/Step3/directions.txt deleted file mode 100644 index 54d0318..0000000 --- a/Help/guide/tutorial/Step3/directions.txt +++ /dev/null @@ -1,26 +0,0 @@ -# Adding Usage Requirements for Library # - -Usage requirements allow for far better control over a library / executable's -link and include line. While also giving more control over the transitive -property of targets inside CMake. The primary commands that leverage usage -requirements are: - - - target_compile_definitions - - target_compile_options - - target_include_directories - - target_link_libraries - -First up is MathFunctions. We first state that anybody linking to MathFunctions -needs to include the current source directory, while MathFunctions itself -doesn't. So this can become an INTERFACE usage requirement. - -Remember INTERFACE means things that consumers require but the producer doesn't. - - target_include_directories(MathFunctions - INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) - -Now that we've specified usage requirements for MathFunctions we can safely remove -our uses of the EXTRA_INCLUDES variable. - -Run cmake or cmake-gui to configure the project and then build it with your -chosen build tool. diff --git a/Help/guide/tutorial/Step3/tutorial.cxx b/Help/guide/tutorial/Step3/tutorial.cxx index c2b89df..8156a9c 100644 --- a/Help/guide/tutorial/Step3/tutorial.cxx +++ b/Help/guide/tutorial/Step3/tutorial.cxx @@ -5,6 +5,7 @@ #include "TutorialConfig.h" +// should we include the MathFunctions header? #ifdef USE_MYMATH # include "MathFunctions.h" #endif @@ -12,6 +13,7 @@ int main(int argc, char* argv[]) { if (argc < 2) { + // report version std::cout << argv[0] << " Version " << Tutorial_VERSION_MAJOR << "." << Tutorial_VERSION_MINOR << std::endl; std::cout << "Usage: " << argv[0] << " number" << std::endl; @@ -20,6 +22,7 @@ int main(int argc, char* argv[]) double inputValue = std::stod(argv[1]); + // which square root function should we use? #ifdef USE_MYMATH double outputValue = mysqrt(inputValue); #else diff --git a/Help/guide/tutorial/Step4/CMakeLists.txt b/Help/guide/tutorial/Step4/CMakeLists.txt index 9ce60b9..a157bda 100644 --- a/Help/guide/tutorial/Step4/CMakeLists.txt +++ b/Help/guide/tutorial/Step4/CMakeLists.txt @@ -6,7 +6,7 @@ set(CMAKE_CXX_STANDARD 14) # should we use our own math functions option(USE_MYMATH "Use tutorial provided math implementation" ON) -# the version number. +# set the version number set(Tutorial_VERSION_MAJOR 1) set(Tutorial_VERSION_MINOR 0) diff --git a/Help/guide/tutorial/Step4/directions.txt b/Help/guide/tutorial/Step4/directions.txt deleted file mode 100644 index 91e4043..0000000 --- a/Help/guide/tutorial/Step4/directions.txt +++ /dev/null @@ -1,72 +0,0 @@ -# Installing and Testing # - -Now we can start adding testing support and install rules to our project. - -The install rules are fairly simple; for MathFunctions we install the library -and header file, for the application we install the executable and configured -header. - -So to MathFunctions/CMakeLists.txt we add: - - install (TARGETS MathFunctions DESTINATION bin) - install (FILES MathFunctions.h DESTINATION include) - -And the to top-level CMakeLists.txt we add: - - install(TARGETS Tutorial DESTINATION bin) - install(FILES "${PROJECT_BINARY_DIR}/TutorialConfig.h" - DESTINATION include - ) - -That is all that is needed to create a basic local install of the tutorial. - -Run cmake or cmake-gui to configure the project and then build it with your -chosen build tool. Then build the ?install? target by typing 'make install' -from the command line or build the INSTALL target from an IDE. This will -install the appropriate header files, libraries, and executables. - -Verify that the installed Tutorial runs. Note: The CMake variable -CMAKE_INSTALL_PREFIX is used to determine the root of where the files will -be installed. - -Next let's test our application. Adding testing is an easy process. At the -end of the top-level CMakeLists file we can add a number of basic tests to -verify that the application is working correctly. - - # enable testing - enable_testing() - - # does the application run - add_test(NAME Runs COMMAND Tutorial 25) - - # does the usage message work? - add_test(NAME Usage COMMAND Tutorial) - set_tests_properties(Usage - PROPERTIES PASS_REGULAR_EXPRESSION "Usage:.*number" - ) - - # define a function to simplify adding tests - function(do_test target arg result) - add_test(NAME Comp${arg} COMMAND ${target} ${arg}) - set_tests_properties(Comp${arg} - PROPERTIES PASS_REGULAR_EXPRESSION ${result} - ) - endfunction(do_test) - - # do a bunch of result based tests - do_test(Tutorial 25 "25 is 5") - do_test(Tutorial -25 "-25 is [-nan|nan|0]") - do_test(Tutorial 0.0001 "0.0001 is 0.01") - -The first test simply verifies that the application runs, does not segfault or -otherwise crash, and has a zero return value. This is the basic form of a CTest -test. - -The Usage test uses a regular expression to verify that the usage message -is printed when an incorrect number of arguments are provided. - -Lastly, we have a function called do_test that simplifies running the -application and verifying that the computed square root is correct for given -input. - -To run tests, cd to the binary directory and run ?ctest -N? and ?ctest -VV?. diff --git a/Help/guide/tutorial/Step4/tutorial.cxx b/Help/guide/tutorial/Step4/tutorial.cxx index c2b89df..8156a9c 100644 --- a/Help/guide/tutorial/Step4/tutorial.cxx +++ b/Help/guide/tutorial/Step4/tutorial.cxx @@ -5,6 +5,7 @@ #include "TutorialConfig.h" +// should we include the MathFunctions header? #ifdef USE_MYMATH # include "MathFunctions.h" #endif @@ -12,6 +13,7 @@ int main(int argc, char* argv[]) { if (argc < 2) { + // report version std::cout << argv[0] << " Version " << Tutorial_VERSION_MAJOR << "." << Tutorial_VERSION_MINOR << std::endl; std::cout << "Usage: " << argv[0] << " number" << std::endl; @@ -20,6 +22,7 @@ int main(int argc, char* argv[]) double inputValue = std::stod(argv[1]); + // which square root function should we use? #ifdef USE_MYMATH double outputValue = mysqrt(inputValue); #else diff --git a/Help/guide/tutorial/Step5/CMakeLists.txt b/Help/guide/tutorial/Step5/CMakeLists.txt index 828b9fc..76b9179 100644 --- a/Help/guide/tutorial/Step5/CMakeLists.txt +++ b/Help/guide/tutorial/Step5/CMakeLists.txt @@ -6,7 +6,7 @@ set(CMAKE_CXX_STANDARD 14) # should we use our own math functions option(USE_MYMATH "Use tutorial provided math implementation" ON) -# the version number. +# set the version number set(Tutorial_VERSION_MAJOR 1) set(Tutorial_VERSION_MINOR 0) diff --git a/Help/guide/tutorial/Step5/MathFunctions/CMakeLists.txt b/Help/guide/tutorial/Step5/MathFunctions/CMakeLists.txt index 11cf412..b12f27d 100644 --- a/Help/guide/tutorial/Step5/MathFunctions/CMakeLists.txt +++ b/Help/guide/tutorial/Step5/MathFunctions/CMakeLists.txt @@ -6,5 +6,6 @@ target_include_directories(MathFunctions INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} ) +# install rules install(TARGETS MathFunctions DESTINATION lib) install(FILES MathFunctions.h DESTINATION include) diff --git a/Help/guide/tutorial/Step5/directions.txt b/Help/guide/tutorial/Step5/directions.txt deleted file mode 100644 index e6f5197..0000000 --- a/Help/guide/tutorial/Step5/directions.txt +++ /dev/null @@ -1,69 +0,0 @@ -# Adding System Introspection # - -Let us consider adding some code to our project that depends on features the -target platform may not have. For this example, we will add some code that -depends on whether or not the target platform has the log and exp functions. Of -course almost every platform has these functions but for this tutorial assume -that they are not common. - -If the platform has log and exp then we will use them to compute the square -root in the mysqrt function. We first test for the availability of these -functions using the CheckSymbolExists.cmake macro in the top-level CMakeLists -file as follows: - - # does this system provide the log and exp functions? - include(CheckSymbolExists) - set(CMAKE_REQUIRED_LIBRARIES "m") - check_symbol_exists(log "math.h" HAVE_LOG) - check_symbol_exists(exp "math.h" HAVE_EXP) - -Now let's add these defines to TutorialConfig.h.in so that we can use them -from mysqrt.cxx: - - // does the platform provide exp and log functions? - #cmakedefine HAVE_LOG - #cmakedefine HAVE_EXP - -Modify mysqrt.cxx to include math.h. Next, in the mysqrt function we can -provide an alternate implementation based on log and exp if they are available -on the system using the following code: - - // if we have both log and exp then use them - #if defined(HAVE_LOG) && defined (HAVE_EXP) - double result = exp(log(x)*0.5); - std::cout << "Computing sqrt of " << x << " to be " << result << " using log" << std::endl; - #else - ... - -Run cmake or cmake-gui to configure the project and then build it with your -chosen build tool. - -You will notice that even though HAVE_LOG and HAVE_EXP are both defined mysqrt -isn't using them. We should realize quickly that we have forgotten to include -TutorialConfig.h in mysqrt.cxx. We will also need to update -MathFunctions/CMakeLists.txt with where it is located. - -So let's go ahead and update MathFunctions/CMakeLists.txt to look like: - - add_library(MathFunctions mysqrt.cxx) - - target_include_directories(MathFunctions - INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} - PRIVATE ${Tutorial_BINARY_DIR} - ) - - install(TARGETS MathFunctions DESTINATION lib) - install(FILES MathFunctions.h DESTINATION include) - -Now all we need to do is include TutorialConfig.h in mysqrt.cxx - -At this point you should go ahead and build the project again. - -Run the built Tutorial executable. Which function gives better results now, -Step1?s sqrt or Step5?s mysqrt? - -Exercise: Why is it important that we configure TutorialConfig.h.in after the -checks for HAVE_LOG and HAVE_EXP? What would happen if we inverted the two? - -Exercise: Is there a better place for us to save the HAVE_LOG and HAVE_EXP -values other than in TutorialConfig.h? diff --git a/Help/guide/tutorial/Step5/tutorial.cxx b/Help/guide/tutorial/Step5/tutorial.cxx index c2b89df..8156a9c 100644 --- a/Help/guide/tutorial/Step5/tutorial.cxx +++ b/Help/guide/tutorial/Step5/tutorial.cxx @@ -5,6 +5,7 @@ #include "TutorialConfig.h" +// should we include the MathFunctions header? #ifdef USE_MYMATH # include "MathFunctions.h" #endif @@ -12,6 +13,7 @@ int main(int argc, char* argv[]) { if (argc < 2) { + // report version std::cout << argv[0] << " Version " << Tutorial_VERSION_MAJOR << "." << Tutorial_VERSION_MINOR << std::endl; std::cout << "Usage: " << argv[0] << " number" << std::endl; @@ -20,6 +22,7 @@ int main(int argc, char* argv[]) double inputValue = std::stod(argv[1]); + // which square root function should we use? #ifdef USE_MYMATH double outputValue = mysqrt(inputValue); #else diff --git a/Help/guide/tutorial/Step6/CMakeLists.txt b/Help/guide/tutorial/Step6/CMakeLists.txt index a78b0ff..5829891 100644 --- a/Help/guide/tutorial/Step6/CMakeLists.txt +++ b/Help/guide/tutorial/Step6/CMakeLists.txt @@ -3,7 +3,7 @@ project(Tutorial) set(CMAKE_CXX_STANDARD 14) -# the version number. +# set the version number set(Tutorial_VERSION_MAJOR 1) set(Tutorial_VERSION_MINOR 0) diff --git a/Help/guide/tutorial/Step6/MathFunctions/CMakeLists.txt b/Help/guide/tutorial/Step6/MathFunctions/CMakeLists.txt index 2946075..def1140 100644 --- a/Help/guide/tutorial/Step6/MathFunctions/CMakeLists.txt +++ b/Help/guide/tutorial/Step6/MathFunctions/CMakeLists.txt @@ -4,11 +4,11 @@ add_library(MathFunctions mysqrt.cxx) # to find MathFunctions.h, while we don't. # state that we depend on Tutorial_BINARY_DIR but consumers don't, as the # TutorialConfig.h include is an implementation detail - target_include_directories(MathFunctions INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${Tutorial_BINARY_DIR} ) +# install rules install(TARGETS MathFunctions DESTINATION lib) install(FILES MathFunctions.h DESTINATION include) diff --git a/Help/guide/tutorial/Step6/directions.txt b/Help/guide/tutorial/Step6/directions.txt deleted file mode 100644 index 42b9f06..0000000 --- a/Help/guide/tutorial/Step6/directions.txt +++ /dev/null @@ -1,104 +0,0 @@ -# Adding a Custom Command and Generated File # - -In this section we will show how you can add a generated source file into the -build process of an application. For this example, we will create a table of -precomputed square roots as part of the build process, and then compile that -table into our application. - -To accomplish this, we first need a program that will generate the table. In the -MathFunctions subdirectory a new source file named MakeTable.cxx will do just that. - - // A simple program that builds a sqrt table - #include - #include - #include - - int main (int argc, char *argv[]) - { - // make sure we have enough arguments - if (argc < 2) { - return 1; - } - - std::ofstream fout(argv[1],std::ios_base::out); - const bool fileOpen = fout.is_open(); - if(fileOpen) { - fout << "double sqrtTable[] = {" << std::endl; - for (int i = 0; i < 10; ++i) { - fout << sqrt(static_cast(i)) << "," << std::endl; - } - // close the table with a zero - fout << "0};" << std::endl; - fout.close(); - } - return fileOpen ? 0 : 1; // return 0 if wrote the file - } - -Note that the table is produced as valid C++ code and that the output filename -is passed in as an argument. - -The next step is to add the appropriate commands to MathFunctions? CMakeLists -file to build the MakeTable executable and then run it as part of the build -process. A few commands are needed to accomplish this, as shown below: - - # first we add the executable that generates the table - add_executable(MakeTable MakeTable.cxx) - - # add the command to generate the source code - add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/Table.h - COMMAND MakeTable ${CMAKE_CURRENT_BINARY_DIR}/Table.h - DEPENDS MakeTable - ) - - # add the main library - add_library(MathFunctions - mysqrt.cxx - ${CMAKE_CURRENT_BINARY_DIR}/Table.h - ) - - target_include_directories(MathFunctions - INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} - PUBLIC ${Tutorial_BINARY_DIR} - # add the binary tree directory to the search path for include files - ${CMAKE_CURRENT_BINARY_DIR} - ) - - install(TARGETS MathFunctions DESTINATION lib) - install(FILES MathFunctions.h DESTINATION include) - -First, the executable for MakeTable is added as any other executable would be -added. Then we add a custom command that specifies how to produce Table.h by -running MakeTable. Next we have to let CMake know that mysqrt.cxx depends on -the generated file Table.h. This is done by adding the generated Table.h to the -list of sources for the library MathFunctions. We also have to add the current -binary directory to the list of include directories so that Table.h can be -found and included by mysqrt.cxx. - -Now let's use the generated table. First, modify mysqrt.cxx to include Table.h. -Next, we can rewrite the mysqrt function to use the table: - - if (x <= 0) { - return 0; - } - - // use the table to help find an initial value - double result = x; - if (x >= 1 && x < 10) { - result = sqrtTable[static_cast(x)]; - } - - // do ten iterations - for (int i = 0; i < 10; ++i) { - if (result <= 0) { - result = 0.1; - } - double delta = x - (result*result); - result = result + 0.5*delta/result; - std::cout << "Computing sqrt of " << x << " to be " << result << std::endl; - } - -Run cmake or cmake-gui to configure the project and then build it with your -chosen build tool. When this project is built it will first build the MakeTable -executable. It will then run MakeTable to produce Table.h. Finally, it will -compile mysqrt.cxx which includes Table.h to produce the MathFunctions library. diff --git a/Help/guide/tutorial/Step6/tutorial.cxx b/Help/guide/tutorial/Step6/tutorial.cxx index c2b89df..8156a9c 100644 --- a/Help/guide/tutorial/Step6/tutorial.cxx +++ b/Help/guide/tutorial/Step6/tutorial.cxx @@ -5,6 +5,7 @@ #include "TutorialConfig.h" +// should we include the MathFunctions header? #ifdef USE_MYMATH # include "MathFunctions.h" #endif @@ -12,6 +13,7 @@ int main(int argc, char* argv[]) { if (argc < 2) { + // report version std::cout << argv[0] << " Version " << Tutorial_VERSION_MAJOR << "." << Tutorial_VERSION_MINOR << std::endl; std::cout << "Usage: " << argv[0] << " number" << std::endl; @@ -20,6 +22,7 @@ int main(int argc, char* argv[]) double inputValue = std::stod(argv[1]); + // which square root function should we use? #ifdef USE_MYMATH double outputValue = mysqrt(inputValue); #else diff --git a/Help/guide/tutorial/Step7/CMakeLists.txt b/Help/guide/tutorial/Step7/CMakeLists.txt index 33aa039..17e6a60 100644 --- a/Help/guide/tutorial/Step7/CMakeLists.txt +++ b/Help/guide/tutorial/Step7/CMakeLists.txt @@ -3,7 +3,7 @@ project(Tutorial) set(CMAKE_CXX_STANDARD 14) -# the version number. +# set the version number set(Tutorial_VERSION_MAJOR 1) set(Tutorial_VERSION_MINOR 0) diff --git a/Help/guide/tutorial/Step7/MathFunctions/CMakeLists.txt b/Help/guide/tutorial/Step7/MathFunctions/CMakeLists.txt index dc3eb98..3c3a816 100644 --- a/Help/guide/tutorial/Step7/MathFunctions/CMakeLists.txt +++ b/Help/guide/tutorial/Step7/MathFunctions/CMakeLists.txt @@ -25,5 +25,6 @@ target_include_directories(MathFunctions ${CMAKE_CURRENT_BINARY_DIR} ) +# install rules install(TARGETS MathFunctions DESTINATION lib) install(FILES MathFunctions.h DESTINATION include) diff --git a/Help/guide/tutorial/Step7/directions.txt b/Help/guide/tutorial/Step7/directions.txt deleted file mode 100644 index 7d7c2ea..0000000 --- a/Help/guide/tutorial/Step7/directions.txt +++ /dev/null @@ -1,40 +0,0 @@ -# Building an Installer # - -Next suppose that we want to distribute our project to other people so that they -can use it. We want to provide both binary and source distributions on a variety -of platforms. This is a little different from the install we did previously in -the Installing and Testing section (Step 4), where we were installing the -binaries that we had built from the source code. In this example we will be -building installation packages that support binary installations and package -management features. To accomplish this we will use CPack to create platform -specific installers. Specifically we need to add a few lines to the bottom of -our top-level CMakeLists.txt file. - - include(InstallRequiredSystemLibraries) - set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/License.txt") - set(CPACK_PACKAGE_VERSION_MAJOR "${Tutorial_VERSION_MAJOR}") - set(CPACK_PACKAGE_VERSION_MINOR "${Tutorial_VERSION_MINOR}") - include(CPack) - -That is all there is to it. We start by including InstallRequiredSystemLibraries. -This module will include any runtime libraries that are needed by the project -for the current platform. Next we set some CPack variables to where we have -stored the license and version information for this project. The version -information makes use of the variables we set earlier in this tutorial. Finally -we include the CPack module which will use these variables and some other -properties of the system you are on to setup an installer. - -The next step is to build the project in the usual manner and then run CPack -on it. To build a binary distribution you would run: - - cpack - -To create a source distribution you would type: - - cpack -C CPackSourceConfig.cmake - -Alternatively, run ?make package? or right click the Package target and -?Build Project? from an IDE. - -Run the installer executable found in the binary directory. Then run the -installed executable and verify that it works. diff --git a/Help/guide/tutorial/Step7/tutorial.cxx b/Help/guide/tutorial/Step7/tutorial.cxx index c2b89df..8156a9c 100644 --- a/Help/guide/tutorial/Step7/tutorial.cxx +++ b/Help/guide/tutorial/Step7/tutorial.cxx @@ -5,6 +5,7 @@ #include "TutorialConfig.h" +// should we include the MathFunctions header? #ifdef USE_MYMATH # include "MathFunctions.h" #endif @@ -12,6 +13,7 @@ int main(int argc, char* argv[]) { if (argc < 2) { + // report version std::cout << argv[0] << " Version " << Tutorial_VERSION_MAJOR << "." << Tutorial_VERSION_MINOR << std::endl; std::cout << "Usage: " << argv[0] << " number" << std::endl; @@ -20,6 +22,7 @@ int main(int argc, char* argv[]) double inputValue = std::stod(argv[1]); + // which square root function should we use? #ifdef USE_MYMATH double outputValue = mysqrt(inputValue); #else diff --git a/Help/guide/tutorial/Step8/CMakeLists.txt b/Help/guide/tutorial/Step8/CMakeLists.txt index 03dc7c0..86725e8 100644 --- a/Help/guide/tutorial/Step8/CMakeLists.txt +++ b/Help/guide/tutorial/Step8/CMakeLists.txt @@ -3,7 +3,7 @@ project(Tutorial) set(CMAKE_CXX_STANDARD 14) -# the version number. +# set the version number set(Tutorial_VERSION_MAJOR 1) set(Tutorial_VERSION_MINOR 0) @@ -74,6 +74,7 @@ do_test(Tutorial 25 "25 is 5") do_test(Tutorial -25 "-25 is [-nan|nan|0]") do_test(Tutorial 0.0001 "0.0001 is 0.01") +# setup installer include(InstallRequiredSystemLibraries) set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/License.txt") set(CPACK_PACKAGE_VERSION_MAJOR "${Tutorial_VERSION_MAJOR}") diff --git a/Help/guide/tutorial/Step8/MathFunctions/CMakeLists.txt b/Help/guide/tutorial/Step8/MathFunctions/CMakeLists.txt index dc3eb98..3c3a816 100644 --- a/Help/guide/tutorial/Step8/MathFunctions/CMakeLists.txt +++ b/Help/guide/tutorial/Step8/MathFunctions/CMakeLists.txt @@ -25,5 +25,6 @@ target_include_directories(MathFunctions ${CMAKE_CURRENT_BINARY_DIR} ) +# install rules install(TARGETS MathFunctions DESTINATION lib) install(FILES MathFunctions.h DESTINATION include) diff --git a/Help/guide/tutorial/Step8/directions.txt b/Help/guide/tutorial/Step8/directions.txt deleted file mode 100644 index 588d9c6..0000000 --- a/Help/guide/tutorial/Step8/directions.txt +++ /dev/null @@ -1,38 +0,0 @@ -# Adding Support for a Dashboard # - -Adding support for submitting our test results to a dashboard is very easy. We -already defined a number of tests for our project in the earlier steps of this -tutorial. We just have to run those tests and submit them to a dashboard. To -include support for dashboards we include the CTest module in our top-level -CMakeLists.txt. - -Replace: - # enable testing - enable_testing() - -With: - # enable dashboard scripting - include(CTest) - -The CTest module will automatically call enable_testing(), so -we can remove it from our CMake files. - -We will also need to create a CTestConfig.cmake file where we can specify the -name of the project and where to submit the dashboard. - - set(CTEST_PROJECT_NAME "CMakeTutorial") - set(CTEST_NIGHTLY_START_TIME "01:00:00 UTC") - - set(CTEST_DROP_METHOD "http") - set(CTEST_DROP_SITE "my.cdash.org/") - set(CTEST_DROP_LOCATION "/submit.php?project=CMakeTutorial") - set(CTEST_DROP_SITE_CDASH TRUE) - -CTest will read in this file when it runs. To create a simple dashboard you can -run cmake or cmake-gui to configure the project, but do not build it yet. -Instead, change directory to the binary tree, and then run: - 'ctest [-VV] ?D Experimental'. On Windows, build the EXPERIMENTAL target. - -Ctest will build and test the project and submit results to the Kitware public -dashboard. The results of your dashboard will be uploaded to Kitware's public -dashboard here: https://my.cdash.org/index.php?project=CMakeTutorial. diff --git a/Help/guide/tutorial/Step8/tutorial.cxx b/Help/guide/tutorial/Step8/tutorial.cxx index c2b89df..8156a9c 100644 --- a/Help/guide/tutorial/Step8/tutorial.cxx +++ b/Help/guide/tutorial/Step8/tutorial.cxx @@ -5,6 +5,7 @@ #include "TutorialConfig.h" +// should we include the MathFunctions header? #ifdef USE_MYMATH # include "MathFunctions.h" #endif @@ -12,6 +13,7 @@ int main(int argc, char* argv[]) { if (argc < 2) { + // report version std::cout << argv[0] << " Version " << Tutorial_VERSION_MAJOR << "." << Tutorial_VERSION_MINOR << std::endl; std::cout << "Usage: " << argv[0] << " number" << std::endl; @@ -20,6 +22,7 @@ int main(int argc, char* argv[]) double inputValue = std::stod(argv[1]); + // which square root function should we use? #ifdef USE_MYMATH double outputValue = mysqrt(inputValue); #else diff --git a/Help/guide/tutorial/Step9/CMakeLists.txt b/Help/guide/tutorial/Step9/CMakeLists.txt index 4981fe2..07ab90a 100644 --- a/Help/guide/tutorial/Step9/CMakeLists.txt +++ b/Help/guide/tutorial/Step9/CMakeLists.txt @@ -3,7 +3,7 @@ project(Tutorial) set(CMAKE_CXX_STANDARD 14) -# the version number. +# set the version number set(Tutorial_VERSION_MAJOR 1) set(Tutorial_VERSION_MINOR 0) diff --git a/Help/guide/tutorial/Step9/MathFunctions/CMakeLists.txt b/Help/guide/tutorial/Step9/MathFunctions/CMakeLists.txt index e651a57..c8cd1dd 100644 --- a/Help/guide/tutorial/Step9/MathFunctions/CMakeLists.txt +++ b/Help/guide/tutorial/Step9/MathFunctions/CMakeLists.txt @@ -31,5 +31,6 @@ if(HAVE_LOG AND HAVE_EXP) PRIVATE "HAVE_LOG" "HAVE_EXP") endif() +# install rules install(TARGETS MathFunctions DESTINATION lib) install(FILES MathFunctions.h DESTINATION include) diff --git a/Help/guide/tutorial/Step9/directions.txt b/Help/guide/tutorial/Step9/directions.txt deleted file mode 100644 index 8771637..0000000 --- a/Help/guide/tutorial/Step9/directions.txt +++ /dev/null @@ -1,166 +0,0 @@ -# Mixing Static and Shared # - -In this section we will show how by using the BUILD_SHARED_LIBS variable we can -control the default behavior of add_library, and allow control over how -libraries without an explicit type ( STATIC/SHARED/MODULE/OBJECT ) are built. - -To accomplish this we need to add BUILD_SHARED_LIBS to the top level -CMakeLists.txt. We use the option command as it allows users to optionally -select if the value should be On or Off. - -Next we are going to refactor MathFunctions to become a real library that -encapsulates using mysqrt or sqrt, instead of requiring the calling code -to do this logic. This will also mean that USE_MYMATH will not control building -MathFuctions, but instead will control the behavior of this library. - -The first step is to update the starting section of the top level CMakeLists.txt -to look like: - - cmake_minimum_required(VERSION 3.3) - project(Tutorial) - - # control where the static and shared libraries are built so that on windows - # we don't need to tinker with the path to run the executable - set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}") - set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}") - - set(CMAKE_CXX_STANDARD 11) - set(CMAKE_CXX_STANDARD_REQUIRED True) - - option(BUILD_SHARED_LIBS "Build using shared libraries" ON) - - # the version number. - set(Tutorial_VERSION_MAJOR 1) - set(Tutorial_VERSION_MINOR 0) - - # configure a header file to pass the version number only - configure_file( - "${PROJECT_SOURCE_DIR}/TutorialConfig.h.in" - "${PROJECT_BINARY_DIR}/TutorialConfig.h" - ) - - # add the MathFunctions library - add_subdirectory(MathFunctions) - - # add the executable - add_executable(Tutorial tutorial.cxx) - target_link_libraries(Tutorial PUBLIC MathFunctions) - -Now that we have made MathFunctions always be used, we will need to update -the logic of that library. So, in MathFunctions/CMakeLists.txt we need to -create a SqrtLibrary that will conditionally be built when USE_MYMATH is -enabled. Now, since this is a tutorial, we are going to explicitly require -that SqrtLibrary is built statically. - -The end result is that MathFunctions/CMakeLists.txt should look like: - - # add the library that runs - add_library(MathFunctions MathFunctions.cxx) - - # state that anybody linking to us needs to include the current source dir - # to find MathFunctions.h, while we don't. - target_include_directories(MathFunctions - INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} - ) - - # should we use our own math functions - option(USE_MYMATH "Use tutorial provided math implementation" ON) - if(USE_MYMATH) - - # does this system provide the log and exp functions? - include(CheckSymbolExists) - set(CMAKE_REQUIRED_LIBRARIES "m") - check_symbol_exists(log "math.h" HAVE_LOG) - check_symbol_exists(exp "math.h" HAVE_EXP) - - # first we add the executable that generates the table - add_executable(MakeTable MakeTable.cxx) - - # add the command to generate the source code - add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/Table.h - COMMAND MakeTable ${CMAKE_CURRENT_BINARY_DIR}/Table.h - DEPENDS MakeTable - ) - - # library that just does sqrt - add_library(SqrtLibrary STATIC - mysqrt.cxx - ${CMAKE_CURRENT_BINARY_DIR}/Table.h - ) - - # state that we depend on our binary dir to find Table.h - target_include_directories(SqrtLibrary PRIVATE - ${CMAKE_CURRENT_BINARY_DIR} - ) - - target_compile_definitions(MathFunctions PRIVATE "USE_MYMATH") - if(HAVE_LOG AND HAVE_EXP) - target_compile_definitions(SqrtLibrary - PRIVATE "HAVE_LOG" "HAVE_EXP") - endif() - - target_link_libraries(MathFunctions PRIVATE SqrtLibrary) - endif() - - # define the symbol stating we are using the declspec(dllexport) when - # building on windows - target_compile_definitions(MathFunctions PRIVATE "EXPORTING_MYMATH") - - install(TARGETS MathFunctions DESTINATION lib) - install(FILES MathFunctions.h DESTINATION include) - -Next, update MathFunctions/mysqrt.cxx to use the mathfunctions and detail namespaces: - - #include - #include "MathFunctions.h" - - // include the generated table - #include "Table.h" - - #include - - namespace mathfunctions { - namespace detail { - // a hack square root calculation using simple operations - double mysqrt(double x) - { - ... - - return result; - } - } - } - -We also need to make some changes in tutorial.cxx, so that it no longer uses USE_MYMATH: -1. Always include MathFunctions.h -2. Always use mathfunctions::sqrt - -Finally, update MathFunctions/MathFunctions.h to use dll export defines: - - #if defined(_WIN32) - #if defined(EXPORTING_MYMATH) - #define DECLSPEC __declspec(dllexport) - #else - #define DECLSPEC __declspec(dllimport) - #endif - #else //non windows - #define DECLSPEC - #endif - - namespace mathfunctions - { - double DECLSPEC sqrt(double x); - } - -At this point, if you build everything, you will notice that linking fails -as we are combining a static library without position enabled code with a -library that has position enabled code. This solution to this is to explicitly -set the POSITION_INDEPENDENT_CODE target property of SqrtLibrary to be True no -matter the build type. - -Exercise: We modified MathFunctions.h to use dll export defines. Using CMake -documentation can you find a helper module to simplify this? - -Exercise: Determine what command is enabling PIC for SqrtLibrary. -What happens if we remove said command? diff --git a/Help/guide/tutorial/Step9/tutorial.cxx b/Help/guide/tutorial/Step9/tutorial.cxx index 6c41859..3286bc8 100644 --- a/Help/guide/tutorial/Step9/tutorial.cxx +++ b/Help/guide/tutorial/Step9/tutorial.cxx @@ -6,6 +6,7 @@ #include "TutorialConfig.h" +// should we include the MathFunctions header? #ifdef USE_MYMATH # include "MathFunctions.h" #endif @@ -13,6 +14,7 @@ int main(int argc, char* argv[]) { if (argc < 2) { + // report version std::cout << argv[0] << " Version " << Tutorial_VERSION_MAJOR << "." << Tutorial_VERSION_MINOR << std::endl; std::cout << "Usage: " << argv[0] << " number" << std::endl; @@ -21,6 +23,7 @@ int main(int argc, char* argv[]) double inputValue = std::stod(argv[1]); + // which square root function should we use? #ifdef USE_MYMATH double outputValue = mysqrt(inputValue); #else diff --git a/Help/guide/tutorial/index.rst b/Help/guide/tutorial/index.rst index be906af..673f284 100644 --- a/Help/guide/tutorial/index.rst +++ b/Help/guide/tutorial/index.rst @@ -1,2 +1,719 @@ CMake Tutorial ************** + +A Basic Starting Point (Step 1) +=============================== + +Adding a Version Number and Configured Header File +-------------------------------------------------- + +The first feature we will add is to provide our executable and project with a +version number. While we could do this exclusively in the source code, using +CMakeLists provides more flexibility. + +To add a version number we modify the CMakeLists file as follows: + +.. literalinclude:: Step2/CMakeLists.txt + :language: cmake + :start-after: # set the version number + :end-before: # configure a header file + +We then create a ``TutorialConfig.h.in`` file in the source tree with the +following contents: + +.. literalinclude:: Step1/TutorialConfig.h.in + :language: cmake + +When CMake configures this header file the values for +``@Tutorial_VERSION_MAJOR@`` and ``@Tutorial_VERSION_MINOR@`` will be +replaced by the values from the CMakeLists file. Next we modify +``tutorial.cxx`` to include the configured header file and to make use of the +version numbers. The updated source code is listed below. + +.. literalinclude:: Step2/tutorial.cxx + :language: c++ + :start-after: // report version + :end-before: return 1; + + +Specify the C++ Standard +------------------------- + +Next let's add some C++11 features to our project. We will need to explicitly +state in the CMake code that it should use the correct flags. The easiest way +to enable C++11 support for CMake is by using the ``CMAKE_CXX_STANDARD`` +variable. + +First, replace ``atof`` with ``std::stod`` in ``tutorial.cxx``. + +Then, set the ``CMAKE_CXX_STANDARD`` variable in the CMakeLists file. + +Which variable can we set in the CMakeLists file to treat the +``CMAKE_CXX_STANDARD`` value as a requirement? + +Build and Test +-------------- + +Run **cmake** or **cmake-gui** to configure the project and then build it +with your chosen build tool. + +cd to the directory where Tutorial was built (likely the make directory or +a Debug or Release build configuration subdirectory) and run these commands: + +.. code-block:: console + + Tutorial 4294967296 + Tutorial 10 + Tutorial + +Adding a Library (Step 2) +========================= + +Now we will add a library to our project. This library will contain our own +implementation for computing the square root of a number. The executable can +then use this library instead of the standard square root function provided by +the compiler. + +For this tutorial we will put the library into a subdirectory +called MathFunctions. It will have the following one line CMakeLists file: + +.. literalinclude:: Step2/MathFunctions/CMakeLists.txt + :language: cmake + +The source file ``mysqrt.cxx`` has one function called ``mysqrt`` that +provides similar functionality to the compiler?s ``sqrt`` function. To make use +of the new library we add an ``add_subdirectory`` call in the top-level +CMakeLists file so that the library will get built. We add the new library to +the executable, and add MathFunctions as an include directory so that the +``mqsqrt.h`` header file can be found. The last few lines of the top-level +CMakeLists file now look like: + +.. code-block:: cmake + + # add the MathFunctions library + add_subdirectory(MathFunctions) + + # add the executable + add_executable(Tutorial tutorial.cxx) + + target_link_libraries(Tutorial MathFunctions) + + # add the binary tree to the search path for include files + # so that we will find TutorialConfig.h + target_include_directories(Tutorial PUBLIC + "${PROJECT_BINARY_DIR}" + "${PROJECT_SOURCE_DIR}/MathFunctions" + ) + +Now let us make the MathFunctions library optional. While for the tutorial +there really isn?t any need to do so, for larger projects this is a common +occurrence. The first step is to add an option to the top-level CMakeLists +file. + +.. literalinclude:: Step3/CMakeLists.txt + :language: cmake + :start-after: # should we use our own math functions + :end-before: # set the version number + +This will show up in the CMake GUI and ccmake with a default value of ON +that can be changed by the user. This setting will be stored in the cache so +that the user does not need to set the value each time they run CMake on this +build directory. + +The next change is to make building and linking the MathFunctions library +conditional. To do this we change the end of the top-level CMakeLists file to +look like the following: + +.. literalinclude:: Step3/CMakeLists.txt + :language: cmake + :start-after: # add the MathFunctions library? + +Note the use of the variables ``EXTRA_LIBS`` and ``EXTRA_INCLUDES`` to collect +up any optional libraries to later be linked into the executable. This is a +classic approach when dealing with many optional components, we will cover the +modern approach in the next step. + +The corresponding changes to the source code are fairly straightforward. First, +include the MathFunctions header if we need it: + +.. literalinclude:: Step3/tutorial.cxx + :language: c++ + :start-after: // should we include the MathFunctions header + :end-before: int main + +Then make which square root function is used dependent on ``USE_MYMATH``: + +.. literalinclude:: Step3/tutorial.cxx + :language: c++ + :start-after: // which square root function should we use? + :end-before: std::cout << "The square root of + +Since the source code now requires ``USE_MYMATH`` we can add it to +``TutorialConfig.h.in`` with the following line: + +.. literalinclude:: Step3/TutorialConfig.h.in + :language: c + :lines: 4 + +Run **cmake** or **cmake-gui** to configure the project and then build it +with your chosen build tool. Then run the built Tutorial executable. + +Which function gives better results, Step1?s sqrt or Step2?s mysqrt? + +Adding Usage Requirements for Library (Step 3) +============================================== + +Usage requirements allow for far better control over a library or executable's +link and include line while also giving more control over the transitive +property of targets inside CMake. The primary commands that leverage usage +requirements are: + + - ``target_compile_definitions`` + - ``target_compile_options`` + - ``target_include_directories`` + - ``target_link_libraries`` + +First up is MathFunctions. We first state that anybody linking to MathFunctions +needs to include the current source directory, while MathFunctions itself +doesn't. So this can become an ``INTERFACE`` usage requirement. + +Remember ``INTERFACE`` means things that consumers require but the producer +doesn't. Update ``MathFunctions/CMakeLists.txt`` with: + +.. literalinclude:: Step4/MathFunctions/CMakeLists.txt + :language: cmake + :start-after: # to find MathFunctions.h + +Now that we've specified usage requirements for MathFunctions we can safely +remove our uses of the ``EXTRA_INCLUDES`` variable from the top-level +CMakeLists. + +Once this is done, run **cmake** or **cmake-gui** to configure the project +and then build it with your chosen build tool. + +Installing and Testing (Step 4) +=============================== + +Now we can start adding install rules and testing support to our project. + +Install Rules +------------- + +The install rules are fairly simple for MathFunctions we want to install the +library and header file and for the application we want to install the +executable and configured header. + +So to ``MathFunctions/CMakeLists.txt`` we add: + +.. literalinclude:: Step5/MathFunctions/CMakeLists.txt + :language: cmake + :start-after: # install rules + +And the to top-level ``CMakeLists.txt`` we add: + +.. literalinclude:: Step5/CMakeLists.txt + :language: cmake + :start-after: # add the install targets + :end-before: # enable testing + +That is all that is needed to create a basic local install of the tutorial. + +Run **cmake** or **cmake-gui** to configure the project and then build it +with your chosen build tool. Build the ``install`` target by typing +``make install`` from the command line or build the ``INSTALL`` target from +an IDE. This will install the appropriate header files, libraries, and +executables. + +Verify that the installed Tutorial runs. Note: The CMake variable +``CMAKE_INSTALL_PREFIX`` is used to determine the root of where the files will +be installed. + +Testing Support +--------------- + +Next let's test our application. At the end of the top-level CMakeLists file we +can add a number of basic tests to verify that the application is +working correctly. + +.. literalinclude:: Step5/CMakeLists.txt + :language: cmake + :start-after: # enable testing + +The first test simply verifies that the application runs, does not segfault or +otherwise crash, and has a zero return value. This is the basic form of a CTest +test. + +The next test makes use of the ``PASS_REGULAR_EXPRESSION`` test property to +verify that the output of the test contains certain strings, in this case: +verifying that the the usage message is printed when an incorrect number of +arguments are provided. + +Lastly, we have a function called ``do_test`` that runs the application and +verifies that the computed square root is correct for given input. For each +invocation of ``do_test``, another test is added to the project with a name, +input, and expected results based on the passed arguments. + +Rebuild the application and then cd to the binary directory and run +``ctest -N`` and ``ctest -VV``. + +Adding System Introspection (Step 5) +==================================== + +Let us consider adding some code to our project that depends on features the +target platform may not have. For this example, we will add some code that +depends on whether or not the target platform has the ``log`` and ``exp`` +functions. Of course almost every platform has these functions but for this +tutorial assume that they are not common. + +If the platform has ``log`` and ``exp`` then we will use them to compute the +square root in the ``mysqrt`` function. We first test for the availability of +these functions using the ``CheckSymbolExists.cmake`` macro in the top-level +CMakeLists file as follows: + +.. literalinclude:: Step6/CMakeLists.txt + :language: cmake + :start-after: # does this system provide the log and exp functions? + :end-before: # should we use our own math functions + +Now let's add these defines to ``TutorialConfig.h.in`` so that we can use them +from ``mysqrt.cxx``: + +.. literalinclude:: Step6/TutorialConfig.h.in + :language: c + :start-after: // does the platform provide exp and log functions? + +Finally, in the ``mysqrt`` function we can provide an alternate implementation +based on ``log`` and ``exp`` if they are available on the system using the +following code: + +.. literalinclude:: Step6/MathFunctions/mysqrt.cxx + :language: c++ + :start-after: // if we have both log and exp then use them + :end-before: #else + +Run **cmake** or **cmake-gui** to configure the project and then build it +with your chosen build tool. + +You will notice that even though ``HAVE_LOG`` and ``HAVE_EXP`` are both +defined ``mysqrt`` isn't using them. We should realize quickly that we have +forgotten to include ``TutorialConfig.h`` in ``mysqrt.cxx``. + +After making this update, go ahead and build the project again. + +Run the built Tutorial executable. Which function gives better results now, +Step1?s sqrt or Step5?s mysqrt? + +**Exercise**: Why is it important that we configure ``TutorialConfig.h.in`` +after the checks for ``HAVE_LOG`` and ``HAVE_EXP``? What would happen if we +inverted the two? + +**Exercise**: Is there a better place for us to save the ``HAVE_LOG`` and +``HAVE_EXP`` values other than in ``TutorialConfig.h``? + +Adding a Custom Command and Generated File (Step 6) +=================================================== + +In this section, we will add a generated source file into the build process +of an application. For this example, we will create a table of precomputed +square roots as part of the build process, and then compile that +table into our application. + +To accomplish this, we first need a program that will generate the table. In +the MathFunctions subdirectory a new source file named ``MakeTable.cxx`` will +do just that. + +.. literalinclude:: Step7/MathFunctions/MakeTable.cxx + :language: c++ + +Note that the table is produced as valid C++ code and that the output filename +is passed in as an argument. + +The next step is to add the appropriate commands to MathFunctions' CMakeLists +file to build the MakeTable executable and then run it as part of the build +process. A few commands are needed to accomplish this. + +First, the executable for ``MakeTable`` is added as any other executable would +be added. + +.. literalinclude:: Step7/MathFunctions/CMakeLists.txt + :language: cmake + :start-after: # first we add the executable that generates the table + :end-before: # add the command to generate the source code + +Then we add a custom command that specifies how to produce ``Table.h`` +by running MakeTable. + +.. literalinclude:: Step7/MathFunctions/CMakeLists.txt + :language: cmake + :start-after: # add the command to generate the source code + :end-before: # add the main library + +Next we have to let CMake know that ``mysqrt.cxx`` depends on the generated +file ``Table.h``. This is done by adding the generated ``Table.h`` to the list +of sources for the library MathFunctions. + +.. literalinclude:: Step7/MathFunctions/CMakeLists.txt + :language: cmake + :start-after: # add the main library + :end-before: # state that anybody linking + +We also have to add the current binary directory to the list of include +directories so that ``Table.h`` can be found and included by ``mysqrt.cxx``. + +.. literalinclude:: Step7/MathFunctions/CMakeLists.txt + :start-after: # state that we depend on our bin + :end-before: # install rules + +Now let's use the generated table. First, modify ``mysqrt.cxx`` to include +``Table.h``. Next, we can rewrite the mysqrt function to use the table: + +.. literalinclude:: Step7/MathFunctions/mysqrt.cxx + :language: c++ + :start-after: // a hack square root calculation using simple operations + +Run **cmake** or **cmake-gui** to configure the project and then build it +with your chosen build tool. When this project is built it will first build +the ``MakeTable`` executable. It will then run ``MakeTable`` to produce +``Table.h``. Finally, it will compile ``mysqrt.cxx`` which includes +``Table.h`` to produce the MathFunctions library. + +Building an Installer (Step 7) +============================== + +Next suppose that we want to distribute our project to other people so that +they can use it. We want to provide both binary and source distributions on a +variety of platforms. This is a little different from the install we did +previously in `Installing and Testing (Step 4)`_ , where we were +installing the binaries that we had built from the source code. In this +example we will be building installation packages that support binary +installations and package management features. To accomplish this we will use +CPack to create platform specific installers. Specifically we need to add +a few lines to the bottom of our top-level ``CMakeLists.txt`` file. + +.. literalinclude:: Step8/CMakeLists.txt + :language: cmake + :start-after: # setup installer + +That is all there is to it. We start by including +``InstallRequiredSystemLibraries``. This module will include any runtime +libraries that are needed by the project for the current platform. Next we +set some CPack variables to where we have stored the license and version +information for this project. The version information makes use of the +variables we set earlier in this tutorial. Finally we include the CPack +module which will use these variables and some other properties of the system +you are on to setup an installer. + +The next step is to build the project in the usual manner and then run +CPack on it. To build a binary distribution you would run: + +.. code-block:: console + + cpack + +To create a source distribution you would type: + +.. code-block:: console + + cpack -C CPackSourceConfig.cmake + +Alternatively, run ``make package`` or right click the ``Package`` target and +``Build Project`` from an IDE. + +Run the installer executable found in the binary directory. Then run the +installed executable and verify that it works. + +Adding Support for a Dashboard (Step 8) +======================================= + +Adding support for submitting our test results to a dashboard is very easy. We +already defined a number of tests for our project in the earlier steps of this +tutorial. We just have to run those tests and submit them to a dashboard. To +include support for dashboards we include the CTest module in our top-level +``CMakeLists.txt``. + +Replace: + +.. code-block:: cmake + + # enable testing + enable_testing() + +With: + +.. code-block:: cmake + + # enable dashboard scripting + include(CTest) + +The CTest module will automatically call ``enable_testing()``, so +we can remove it from our CMake files. + +We will also need to create a ``CTestConfig.cmake`` file where we can specify +the name of the project and where to submit the dashboard. + +.. literalinclude:: Step9/CTestConfig.cmake + :language: cmake + +CTest will read in this file when it runs. To create a simple dashboard you can +run **cmake** or **cmake-gui** to configure the project, but do not build it +yet. Instead, change directory to the binary tree, and then run: + +.. code-block:: console + + 'ctest [-VV] ?D Experimental' + +On Windows, build the EXPERIMENTAL target. + +Ctest will build and test the project and submit the results to the Kitware +public dashboard. The results of your dashboard will be uploaded to Kitware's +public dashboard here: https://my.cdash.org/index.php?project=CMakeTutorial. + +Mixing Static and Shared (Step 9) +================================= + +In this section we will show how by using the ``BUILD_SHARED_LIBS`` variable +we can control the default behavior of ``add_library``, and allow control +over how libraries without an explicit type (STATIC/SHARED/MODULE/OBJECT) are +built. + +To accomplish this we need to add ``BUILD_SHARED_LIBS`` to the top-level +``CMakeLists.txt``. We use the ``option`` command as it allows users to +optionally select if the value should be On or Off. + +Next we are going to refactor MathFunctions to become a real library that +encapsulates using ``mysqrt`` or ``sqrt``, instead of requiring the calling +code to do this logic. This will also mean that ``USE_MYMATH`` will not control +building MathFuctions, but instead will control the behavior of this library. + +The first step is to update the starting section of the top-level +``CMakeLists.txt`` to look like: + +.. literalinclude:: Step10/CMakeLists.txt + :language: cmake + :start-after: set(Tutorial_VERSION_MINOR + :end-before: # add the binary tree + +Now that we have made MathFunctions always be used, we will need to update +the logic of that library. So, in ``MathFunctions/CMakeLists.txt`` we need to +create a SqrtLibrary that will conditionally be built when ``USE_MYMATH`` is +enabled. Now, since this is a tutorial, we are going to explicitly require +that SqrtLibrary is built statically. + +The end result is that ``MathFunctions/CMakeLists.txt`` should look like: + +.. literalinclude:: Step10/MathFunctions/CMakeLists.txt + :language: cmake + :lines: 1-40,46- + +Next, update ``MathFunctions/mysqrt.cxx`` to use the ``mathfunctions`` and +``detail`` namespaces: + +.. literalinclude:: Step10/MathFunctions/mysqrt.cxx + :language: c++ + +We also need to make some changes in ``tutorial.cxx``, so that it no longer +uses ``USE_MYMATH``: + +#. Always include ``MathFunctions.h`` +#. Always use ``mathfunctions::sqrt`` + +Finally, update ``MathFunctions/MathFunctions.h`` to use dll export defines: + +.. literalinclude:: Step10/MathFunctions/MathFunctions.h + :language: c++ + +At this point, if you build everything, you will notice that linking fails +as we are combining a static library without position enabled code with a +library that has position enabled code. The solution to this is to explicitly +set the ``POSITION_INDEPENDENT_CODE`` target property of SqrtLibrary to be +True no matter the build type. + +**Exercise**: We modified ``MathFunctions.h`` to use dll export defines. +Using CMake documentation can you find a helper module to simplify this? + +Adding Generator Expressions (Step 10) +====================================== + +Generator expressions are evaluated during build system generation to produce +information specific to each build configuration. + +Generator expressions are allowed in the context of many target properties, +such as ``LINK_LIBRARIES``, ``INCLUDE_DIRECTORIES``, ``COMPILE_DEFINITIONS`` +and others. They may also be used when using commands to populate those +properties, such as ``target_link_libraries()``, +``target_include_directories()``, +``target_compile_definitions()`` and others. + +Generator expressions may be used to enable conditional linking, conditional +definitions used when compiling, conditional include directories and more. +The conditions may be based on the build configuration, target properties, +platform information or any other queryable information. + +There are different types of generator expressions including Logical, +Informational, and Output expressions. + +Logical expressions are used to create conditional output. The basic +expressions are the 0 and 1 expressions. A ``$<0:...>`` results in the empty +string, and ``<1:...>`` results in the content of "...". They can also be +nested. + +For example: + +.. code-block:: cmake + + if(HAVE_LOG AND HAVE_EXP) + target_compile_definitions(SqrtLibrary + PRIVATE "HAVE_LOG" "HAVE_EXP") + endif() + +Can be rewritten with generator expressions: + +.. code-block:: cmake + + target_compile_definitions(SqrtLibrary PRIVATE + "$<$:HAVE_LOG>" + "$<$:HAVE_EXP>" + ) + +Note that ``${HAVE_LOG}`` is evaluated at CMake configure time while +``$<$:HAVE_LOG>`` is evaluated at build system generation +time. + +Adding Export Configuration (Step 11) +===================================== + +During `Installing and Testing (Step 4)`_ of the tutorial we added the ability +for CMake to install the library and headers of the project. During +`Building an Installer (Step 7)`_ we added the ability to package up this +information so it could be distributed to other people. + +The next step is to add the necessary information so that other CMake projects +can use our project, be it from a build directory, a local install or when +packaged. + +The first step is to update our ``install(TARGETS)`` commands to not only +specify a ``DESTINATION`` but also an ``EXPORT``. The ``EXPORT`` keyword +generates and installs a CMake file containing code to import all targets +listed in the install command from the installation tree. So let's go ahead +and explicitly ``EXPORT`` the MathFunctions library by updating the +``install`` command in ``MathFunctions/CMakeLists.txt`` to look like: + +.. literalinclude:: Complete/MathFunctions/CMakeLists.txt + :language: cmake + :start-after: # install rules + +Now that we have MathFunctions being exported, we also need to explicitly +install the generated ``MathFunctionsTargets.cmake`` file. This is done by +adding the following to the bottom of the top-level ``CMakeLists.txt``: + +.. literalinclude:: Complete/CMakeLists.txt + :language: cmake + :start-after: # install the configuration targets + :end-before: include(CMakePackageConfigHelpers) + +At this point you should try and run CMake. If everything is setup properly +you will see that CMake will generate an error that looks like: + +.. code-block:: console + + Target "MathFunctions" INTERFACE_INCLUDE_DIRECTORIES property contains + path: + + "/Users/robert/Documents/CMakeClass/Tutorial/Step11/MathFunctions" + + which is prefixed in the source directory. + +What CMake is trying to say is that during generating the export information +it will export a path that is intrinsically tied to the current machine and +will not be valid on other machines. The solution to this is to update the +MathFunctions ``target_include_directories`` to understand that it needs +different ``INTERFACE`` locations when being used from within the build +directory and from an install / package. This means converting the +``target_include_directories`` call for MathFunctions to look like: + +.. literalinclude:: Complete/MathFunctions/CMakeLists.txt + :language: cmake + :start-after: # to find MathFunctions.h, while we don't. + :end-before: # should we use our own math functions + +Once this has been updated, we can re-run CMake and see verify that it doesn't +warn anymore. + +At this point, we have CMake properly packaging the target information that is +required but we will still need to generate a ``MathFunctionsConfig.cmake`` so +that the CMake ``find_package command`` can find our project. So let's go +ahead and add a new file to the top-level of the project called +``Config.cmake.in`` with the following contents: + +.. literalinclude:: Complete/Config.cmake.in + +Then, to properly configure and install that file, add the following to the +bottom of the top-level CMakeLists: + +.. literalinclude:: Complete/CMakeLists.txt + :language: cmake + :start-after: # install the configuration targets + :end-before: # generate the export + +At this point, we have generated a relocatable CMake Configuration for our +project that can be used after the project has been installed or packaged. If +we want our project to also be used from a build directory we only have to add +the following to the bottom of the top level CMakeLists: + +.. literalinclude:: Complete/CMakeLists.txt + :language: cmake + :start-after: # needs to be after the install(TARGETS ) command + +With this export call we now generate a ``Targets.cmake``, allowing the +configured ``MathFunctionsConfig.cmake`` in the build directory to be used by +other projects, without needing it to be installed. + +Import a CMake Project (Consumer) +================================= + +This examples shows how a project can find other CMake packages that +generate ``Config.cmake`` files. + +It also shows how to state a project's external dependencies when generating +a ``Config.cmake``. + +Packaging Debug and Release (MultiPackage) +========================================== + +By default CMake is model is that a build directory only contains a single +configuration, be it Debug, Release, MinSizeRel, or RelWithDebInfo. + +But it is possible to setup CPack to bundle multiple build directories at the +same time to build a package that contains multiple configurations of the +same project. + +First we need to ahead and construct a directory called ``multi_config`` this +will contain all the builds that we want to package together. + +Second create a ``debug`` and ``release`` directory underneath +``multi_config``. At the end you should have a layout that looks like: + +? multi_config + ??? debug + ??? release + +Now we need to setup debug and release builds, which would roughly entail +the following: + +.. code-block:: console + + cd debug + cmake -DCMAKE_BUILD_TYPE=Debug ../../MultiPackage/ + cmake --build . + cd ../release + cmake -DCMAKE_BUILD_TYPE=Release ../../MultiPackage/ + cmake --build . + cd .. + + +Now that both the debug and release builds are complete we can now use +the custom MultiCPackConfig to package both builds into a single release. + +.. code-block:: console + + cpack --config ../../MultiPackage/MultiCPackConfig.cmake https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=862cfc0e6c3f275db73281f3b9b989704251ab6a commit 862cfc0e6c3f275db73281f3b9b989704251ab6a Author: Kitware Robot AuthorDate: Thu May 30 12:41:21 2019 -0400 Commit: Betsy McPhail CommitDate: Tue Jun 18 10:36:16 2019 -0400 Help/guide/tutorial: Adopt tutorial code diff --git a/Tests/Tutorial/Complete/CMakeLists.txt b/Help/guide/tutorial/Complete/CMakeLists.txt similarity index 100% rename from Tests/Tutorial/Complete/CMakeLists.txt rename to Help/guide/tutorial/Complete/CMakeLists.txt diff --git a/Tests/Tutorial/MultiPackage/Config.cmake.in b/Help/guide/tutorial/Complete/Config.cmake.in similarity index 100% rename from Tests/Tutorial/MultiPackage/Config.cmake.in rename to Help/guide/tutorial/Complete/Config.cmake.in diff --git a/Tests/Tutorial/Step9/License.txt b/Help/guide/tutorial/Complete/License.txt similarity index 100% rename from Tests/Tutorial/Step9/License.txt rename to Help/guide/tutorial/Complete/License.txt diff --git a/Tests/Tutorial/MultiPackage/MathFunctions/CMakeLists.txt b/Help/guide/tutorial/Complete/MathFunctions/CMakeLists.txt similarity index 100% rename from Tests/Tutorial/MultiPackage/MathFunctions/CMakeLists.txt rename to Help/guide/tutorial/Complete/MathFunctions/CMakeLists.txt diff --git a/Tests/Tutorial/Step9/MathFunctions/MakeTable.cxx b/Help/guide/tutorial/Complete/MathFunctions/MakeTable.cxx similarity index 100% rename from Tests/Tutorial/Step9/MathFunctions/MakeTable.cxx rename to Help/guide/tutorial/Complete/MathFunctions/MakeTable.cxx diff --git a/Tests/Tutorial/Step9/MathFunctions/MathFunctions.cxx b/Help/guide/tutorial/Complete/MathFunctions/MathFunctions.cxx similarity index 100% rename from Tests/Tutorial/Step9/MathFunctions/MathFunctions.cxx rename to Help/guide/tutorial/Complete/MathFunctions/MathFunctions.cxx diff --git a/Tests/Tutorial/Step11/MathFunctions/MathFunctions.h b/Help/guide/tutorial/Complete/MathFunctions/MathFunctions.h similarity index 100% rename from Tests/Tutorial/Step11/MathFunctions/MathFunctions.h rename to Help/guide/tutorial/Complete/MathFunctions/MathFunctions.h diff --git a/Tests/Tutorial/Step11/MathFunctions/mysqrt.cxx b/Help/guide/tutorial/Complete/MathFunctions/mysqrt.cxx similarity index 100% rename from Tests/Tutorial/Step11/MathFunctions/mysqrt.cxx rename to Help/guide/tutorial/Complete/MathFunctions/mysqrt.cxx diff --git a/Tests/Tutorial/Step9/MathFunctions/mysqrt.h b/Help/guide/tutorial/Complete/MathFunctions/mysqrt.h similarity index 100% rename from Tests/Tutorial/Step9/MathFunctions/mysqrt.h rename to Help/guide/tutorial/Complete/MathFunctions/mysqrt.h diff --git a/Tests/Tutorial/Step9/TutorialConfig.h.in b/Help/guide/tutorial/Complete/TutorialConfig.h.in similarity index 100% rename from Tests/Tutorial/Step9/TutorialConfig.h.in rename to Help/guide/tutorial/Complete/TutorialConfig.h.in diff --git a/Tests/Tutorial/Step10/tutorial.cxx b/Help/guide/tutorial/Complete/tutorial.cxx similarity index 100% rename from Tests/Tutorial/Step10/tutorial.cxx rename to Help/guide/tutorial/Complete/tutorial.cxx diff --git a/Tests/Tutorial/Consumer/CMakeLists.txt b/Help/guide/tutorial/Consumer/CMakeLists.txt similarity index 100% rename from Tests/Tutorial/Consumer/CMakeLists.txt rename to Help/guide/tutorial/Consumer/CMakeLists.txt diff --git a/Tests/Tutorial/Consumer/Config.cmake.in b/Help/guide/tutorial/Consumer/Config.cmake.in similarity index 100% rename from Tests/Tutorial/Consumer/Config.cmake.in rename to Help/guide/tutorial/Consumer/Config.cmake.in diff --git a/Tests/Tutorial/Consumer/consumer.cxx b/Help/guide/tutorial/Consumer/consumer.cxx similarity index 100% rename from Tests/Tutorial/Consumer/consumer.cxx rename to Help/guide/tutorial/Consumer/consumer.cxx diff --git a/Tests/Tutorial/Consumer/directions.txt b/Help/guide/tutorial/Consumer/directions.txt similarity index 100% rename from Tests/Tutorial/Consumer/directions.txt rename to Help/guide/tutorial/Consumer/directions.txt diff --git a/Tests/Tutorial/MultiPackage/CMakeLists.txt b/Help/guide/tutorial/MultiPackage/CMakeLists.txt similarity index 100% rename from Tests/Tutorial/MultiPackage/CMakeLists.txt rename to Help/guide/tutorial/MultiPackage/CMakeLists.txt diff --git a/Tests/Tutorial/Complete/Config.cmake.in b/Help/guide/tutorial/MultiPackage/Config.cmake.in similarity index 100% rename from Tests/Tutorial/Complete/Config.cmake.in rename to Help/guide/tutorial/MultiPackage/Config.cmake.in diff --git a/Tests/Tutorial/Step8/License.txt b/Help/guide/tutorial/MultiPackage/License.txt similarity index 100% rename from Tests/Tutorial/Step8/License.txt rename to Help/guide/tutorial/MultiPackage/License.txt diff --git a/Tests/Tutorial/Complete/MathFunctions/CMakeLists.txt b/Help/guide/tutorial/MultiPackage/MathFunctions/CMakeLists.txt similarity index 100% rename from Tests/Tutorial/Complete/MathFunctions/CMakeLists.txt rename to Help/guide/tutorial/MultiPackage/MathFunctions/CMakeLists.txt diff --git a/Tests/Tutorial/Step8/MathFunctions/MakeTable.cxx b/Help/guide/tutorial/MultiPackage/MathFunctions/MakeTable.cxx similarity index 100% rename from Tests/Tutorial/Step8/MathFunctions/MakeTable.cxx rename to Help/guide/tutorial/MultiPackage/MathFunctions/MakeTable.cxx diff --git a/Tests/Tutorial/Step11/MathFunctions/MathFunctions.cxx b/Help/guide/tutorial/MultiPackage/MathFunctions/MathFunctions.cxx similarity index 100% rename from Tests/Tutorial/Step11/MathFunctions/MathFunctions.cxx rename to Help/guide/tutorial/MultiPackage/MathFunctions/MathFunctions.cxx diff --git a/Tests/Tutorial/Step10/MathFunctions/MathFunctions.h b/Help/guide/tutorial/MultiPackage/MathFunctions/MathFunctions.h similarity index 100% rename from Tests/Tutorial/Step10/MathFunctions/MathFunctions.h rename to Help/guide/tutorial/MultiPackage/MathFunctions/MathFunctions.h diff --git a/Tests/Tutorial/Step10/MathFunctions/mysqrt.cxx b/Help/guide/tutorial/MultiPackage/MathFunctions/mysqrt.cxx similarity index 100% rename from Tests/Tutorial/Step10/MathFunctions/mysqrt.cxx rename to Help/guide/tutorial/MultiPackage/MathFunctions/mysqrt.cxx diff --git a/Tests/Tutorial/Step11/MathFunctions/mysqrt.h b/Help/guide/tutorial/MultiPackage/MathFunctions/mysqrt.h similarity index 100% rename from Tests/Tutorial/Step11/MathFunctions/mysqrt.h rename to Help/guide/tutorial/MultiPackage/MathFunctions/mysqrt.h diff --git a/Tests/Tutorial/MultiPackage/MultiCPackConfig.cmake b/Help/guide/tutorial/MultiPackage/MultiCPackConfig.cmake similarity index 100% rename from Tests/Tutorial/MultiPackage/MultiCPackConfig.cmake rename to Help/guide/tutorial/MultiPackage/MultiCPackConfig.cmake diff --git a/Tests/Tutorial/Step11/TutorialConfig.h.in b/Help/guide/tutorial/MultiPackage/TutorialConfig.h.in similarity index 100% rename from Tests/Tutorial/Step11/TutorialConfig.h.in rename to Help/guide/tutorial/MultiPackage/TutorialConfig.h.in diff --git a/Tests/Tutorial/MultiPackage/directions.txt b/Help/guide/tutorial/MultiPackage/directions.txt similarity index 100% rename from Tests/Tutorial/MultiPackage/directions.txt rename to Help/guide/tutorial/MultiPackage/directions.txt diff --git a/Tests/Tutorial/MultiPackage/tutorial.cxx b/Help/guide/tutorial/MultiPackage/tutorial.cxx similarity index 100% rename from Tests/Tutorial/MultiPackage/tutorial.cxx rename to Help/guide/tutorial/MultiPackage/tutorial.cxx diff --git a/Tests/Tutorial/Readme.txt b/Help/guide/tutorial/Readme.txt similarity index 100% rename from Tests/Tutorial/Readme.txt rename to Help/guide/tutorial/Readme.txt diff --git a/Tests/Tutorial/Step1/CMakeLists.txt b/Help/guide/tutorial/Step1/CMakeLists.txt similarity index 100% rename from Tests/Tutorial/Step1/CMakeLists.txt rename to Help/guide/tutorial/Step1/CMakeLists.txt diff --git a/Tests/Tutorial/Step2/TutorialConfig.h.in b/Help/guide/tutorial/Step1/TutorialConfig.h.in similarity index 100% rename from Tests/Tutorial/Step2/TutorialConfig.h.in rename to Help/guide/tutorial/Step1/TutorialConfig.h.in diff --git a/Tests/Tutorial/Step1/directions.txt b/Help/guide/tutorial/Step1/directions.txt similarity index 100% rename from Tests/Tutorial/Step1/directions.txt rename to Help/guide/tutorial/Step1/directions.txt diff --git a/Tests/Tutorial/Step1/tutorial.cxx b/Help/guide/tutorial/Step1/tutorial.cxx similarity index 100% rename from Tests/Tutorial/Step1/tutorial.cxx rename to Help/guide/tutorial/Step1/tutorial.cxx diff --git a/Tests/Tutorial/Step11/CMakeLists.txt b/Help/guide/tutorial/Step10/CMakeLists.txt similarity index 100% rename from Tests/Tutorial/Step11/CMakeLists.txt rename to Help/guide/tutorial/Step10/CMakeLists.txt diff --git a/Tests/Tutorial/Step7/License.txt b/Help/guide/tutorial/Step10/License.txt similarity index 100% rename from Tests/Tutorial/Step7/License.txt rename to Help/guide/tutorial/Step10/License.txt diff --git a/Tests/Tutorial/Step10/MathFunctions/CMakeLists.txt b/Help/guide/tutorial/Step10/MathFunctions/CMakeLists.txt similarity index 100% rename from Tests/Tutorial/Step10/MathFunctions/CMakeLists.txt rename to Help/guide/tutorial/Step10/MathFunctions/CMakeLists.txt diff --git a/Tests/Tutorial/Step7/MathFunctions/MakeTable.cxx b/Help/guide/tutorial/Step10/MathFunctions/MakeTable.cxx similarity index 100% rename from Tests/Tutorial/Step7/MathFunctions/MakeTable.cxx rename to Help/guide/tutorial/Step10/MathFunctions/MakeTable.cxx diff --git a/Tests/Tutorial/Step10/MathFunctions/MathFunctions.cxx b/Help/guide/tutorial/Step10/MathFunctions/MathFunctions.cxx similarity index 100% rename from Tests/Tutorial/Step10/MathFunctions/MathFunctions.cxx rename to Help/guide/tutorial/Step10/MathFunctions/MathFunctions.cxx diff --git a/Tests/Tutorial/MultiPackage/MathFunctions/MathFunctions.h b/Help/guide/tutorial/Step10/MathFunctions/MathFunctions.h similarity index 100% rename from Tests/Tutorial/MultiPackage/MathFunctions/MathFunctions.h rename to Help/guide/tutorial/Step10/MathFunctions/MathFunctions.h diff --git a/Tests/Tutorial/MultiPackage/MathFunctions/mysqrt.cxx b/Help/guide/tutorial/Step10/MathFunctions/mysqrt.cxx similarity index 100% rename from Tests/Tutorial/MultiPackage/MathFunctions/mysqrt.cxx rename to Help/guide/tutorial/Step10/MathFunctions/mysqrt.cxx diff --git a/Tests/Tutorial/Step10/MathFunctions/mysqrt.h b/Help/guide/tutorial/Step10/MathFunctions/mysqrt.h similarity index 100% rename from Tests/Tutorial/Step10/MathFunctions/mysqrt.h rename to Help/guide/tutorial/Step10/MathFunctions/mysqrt.h diff --git a/Tests/Tutorial/Step10/TutorialConfig.h.in b/Help/guide/tutorial/Step10/TutorialConfig.h.in similarity index 100% rename from Tests/Tutorial/Step10/TutorialConfig.h.in rename to Help/guide/tutorial/Step10/TutorialConfig.h.in diff --git a/Tests/Tutorial/Step10/directions.txt b/Help/guide/tutorial/Step10/directions.txt similarity index 100% rename from Tests/Tutorial/Step10/directions.txt rename to Help/guide/tutorial/Step10/directions.txt diff --git a/Tests/Tutorial/Complete/tutorial.cxx b/Help/guide/tutorial/Step10/tutorial.cxx similarity index 100% rename from Tests/Tutorial/Complete/tutorial.cxx rename to Help/guide/tutorial/Step10/tutorial.cxx diff --git a/Tests/Tutorial/Step10/CMakeLists.txt b/Help/guide/tutorial/Step11/CMakeLists.txt similarity index 100% rename from Tests/Tutorial/Step10/CMakeLists.txt rename to Help/guide/tutorial/Step11/CMakeLists.txt diff --git a/Tests/Tutorial/Step11/License.txt b/Help/guide/tutorial/Step11/License.txt similarity index 100% rename from Tests/Tutorial/Step11/License.txt rename to Help/guide/tutorial/Step11/License.txt diff --git a/Tests/Tutorial/Step11/MathFunctions/CMakeLists.txt b/Help/guide/tutorial/Step11/MathFunctions/CMakeLists.txt similarity index 100% rename from Tests/Tutorial/Step11/MathFunctions/CMakeLists.txt rename to Help/guide/tutorial/Step11/MathFunctions/CMakeLists.txt diff --git a/Tests/Tutorial/Step6/MathFunctions/MakeTable.cxx b/Help/guide/tutorial/Step11/MathFunctions/MakeTable.cxx similarity index 100% rename from Tests/Tutorial/Step6/MathFunctions/MakeTable.cxx rename to Help/guide/tutorial/Step11/MathFunctions/MakeTable.cxx diff --git a/Tests/Tutorial/MultiPackage/MathFunctions/MathFunctions.cxx b/Help/guide/tutorial/Step11/MathFunctions/MathFunctions.cxx similarity index 100% rename from Tests/Tutorial/MultiPackage/MathFunctions/MathFunctions.cxx rename to Help/guide/tutorial/Step11/MathFunctions/MathFunctions.cxx diff --git a/Tests/Tutorial/Complete/MathFunctions/MathFunctions.h b/Help/guide/tutorial/Step11/MathFunctions/MathFunctions.h similarity index 100% rename from Tests/Tutorial/Complete/MathFunctions/MathFunctions.h rename to Help/guide/tutorial/Step11/MathFunctions/MathFunctions.h diff --git a/Tests/Tutorial/Complete/MathFunctions/mysqrt.cxx b/Help/guide/tutorial/Step11/MathFunctions/mysqrt.cxx similarity index 100% rename from Tests/Tutorial/Complete/MathFunctions/mysqrt.cxx rename to Help/guide/tutorial/Step11/MathFunctions/mysqrt.cxx diff --git a/Tests/Tutorial/MultiPackage/MathFunctions/mysqrt.h b/Help/guide/tutorial/Step11/MathFunctions/mysqrt.h similarity index 100% rename from Tests/Tutorial/MultiPackage/MathFunctions/mysqrt.h rename to Help/guide/tutorial/Step11/MathFunctions/mysqrt.h diff --git a/Tests/Tutorial/MultiPackage/TutorialConfig.h.in b/Help/guide/tutorial/Step11/TutorialConfig.h.in similarity index 100% rename from Tests/Tutorial/MultiPackage/TutorialConfig.h.in rename to Help/guide/tutorial/Step11/TutorialConfig.h.in diff --git a/Tests/Tutorial/Step11/directions.txt b/Help/guide/tutorial/Step11/directions.txt similarity index 100% rename from Tests/Tutorial/Step11/directions.txt rename to Help/guide/tutorial/Step11/directions.txt diff --git a/Tests/Tutorial/Step11/tutorial.cxx b/Help/guide/tutorial/Step11/tutorial.cxx similarity index 100% rename from Tests/Tutorial/Step11/tutorial.cxx rename to Help/guide/tutorial/Step11/tutorial.cxx diff --git a/Tests/Tutorial/Step2/CMakeLists.txt b/Help/guide/tutorial/Step2/CMakeLists.txt similarity index 100% rename from Tests/Tutorial/Step2/CMakeLists.txt rename to Help/guide/tutorial/Step2/CMakeLists.txt diff --git a/Tests/Tutorial/Step3/MathFunctions/CMakeLists.txt b/Help/guide/tutorial/Step2/MathFunctions/CMakeLists.txt similarity index 100% rename from Tests/Tutorial/Step3/MathFunctions/CMakeLists.txt rename to Help/guide/tutorial/Step2/MathFunctions/CMakeLists.txt diff --git a/Tests/Tutorial/Step9/MathFunctions/MathFunctions.h b/Help/guide/tutorial/Step2/MathFunctions/MathFunctions.h similarity index 100% rename from Tests/Tutorial/Step9/MathFunctions/MathFunctions.h rename to Help/guide/tutorial/Step2/MathFunctions/MathFunctions.h diff --git a/Tests/Tutorial/Step5/MathFunctions/mysqrt.cxx b/Help/guide/tutorial/Step2/MathFunctions/mysqrt.cxx similarity index 100% rename from Tests/Tutorial/Step5/MathFunctions/mysqrt.cxx rename to Help/guide/tutorial/Step2/MathFunctions/mysqrt.cxx diff --git a/Tests/Tutorial/Step1/TutorialConfig.h.in b/Help/guide/tutorial/Step2/TutorialConfig.h.in similarity index 100% rename from Tests/Tutorial/Step1/TutorialConfig.h.in rename to Help/guide/tutorial/Step2/TutorialConfig.h.in diff --git a/Tests/Tutorial/Step2/directions.txt b/Help/guide/tutorial/Step2/directions.txt similarity index 100% rename from Tests/Tutorial/Step2/directions.txt rename to Help/guide/tutorial/Step2/directions.txt diff --git a/Tests/Tutorial/Step2/tutorial.cxx b/Help/guide/tutorial/Step2/tutorial.cxx similarity index 100% rename from Tests/Tutorial/Step2/tutorial.cxx rename to Help/guide/tutorial/Step2/tutorial.cxx diff --git a/Tests/Tutorial/Step3/CMakeLists.txt b/Help/guide/tutorial/Step3/CMakeLists.txt similarity index 100% rename from Tests/Tutorial/Step3/CMakeLists.txt rename to Help/guide/tutorial/Step3/CMakeLists.txt diff --git a/Tests/Tutorial/Step2/MathFunctions/CMakeLists.txt b/Help/guide/tutorial/Step3/MathFunctions/CMakeLists.txt similarity index 100% rename from Tests/Tutorial/Step2/MathFunctions/CMakeLists.txt rename to Help/guide/tutorial/Step3/MathFunctions/CMakeLists.txt diff --git a/Tests/Tutorial/Step8/MathFunctions/MathFunctions.h b/Help/guide/tutorial/Step3/MathFunctions/MathFunctions.h similarity index 100% rename from Tests/Tutorial/Step8/MathFunctions/MathFunctions.h rename to Help/guide/tutorial/Step3/MathFunctions/MathFunctions.h diff --git a/Tests/Tutorial/Step4/MathFunctions/mysqrt.cxx b/Help/guide/tutorial/Step3/MathFunctions/mysqrt.cxx similarity index 100% rename from Tests/Tutorial/Step4/MathFunctions/mysqrt.cxx rename to Help/guide/tutorial/Step3/MathFunctions/mysqrt.cxx diff --git a/Tests/Tutorial/Step5/TutorialConfig.h.in b/Help/guide/tutorial/Step3/TutorialConfig.h.in similarity index 100% rename from Tests/Tutorial/Step5/TutorialConfig.h.in rename to Help/guide/tutorial/Step3/TutorialConfig.h.in diff --git a/Tests/Tutorial/Step3/directions.txt b/Help/guide/tutorial/Step3/directions.txt similarity index 100% rename from Tests/Tutorial/Step3/directions.txt rename to Help/guide/tutorial/Step3/directions.txt diff --git a/Tests/Tutorial/Step8/tutorial.cxx b/Help/guide/tutorial/Step3/tutorial.cxx similarity index 100% rename from Tests/Tutorial/Step8/tutorial.cxx rename to Help/guide/tutorial/Step3/tutorial.cxx diff --git a/Tests/Tutorial/Step4/CMakeLists.txt b/Help/guide/tutorial/Step4/CMakeLists.txt similarity index 100% rename from Tests/Tutorial/Step4/CMakeLists.txt rename to Help/guide/tutorial/Step4/CMakeLists.txt diff --git a/Tests/Tutorial/Step4/MathFunctions/CMakeLists.txt b/Help/guide/tutorial/Step4/MathFunctions/CMakeLists.txt similarity index 100% rename from Tests/Tutorial/Step4/MathFunctions/CMakeLists.txt rename to Help/guide/tutorial/Step4/MathFunctions/CMakeLists.txt diff --git a/Tests/Tutorial/Step7/MathFunctions/MathFunctions.h b/Help/guide/tutorial/Step4/MathFunctions/MathFunctions.h similarity index 100% rename from Tests/Tutorial/Step7/MathFunctions/MathFunctions.h rename to Help/guide/tutorial/Step4/MathFunctions/MathFunctions.h diff --git a/Tests/Tutorial/Step3/MathFunctions/mysqrt.cxx b/Help/guide/tutorial/Step4/MathFunctions/mysqrt.cxx similarity index 100% rename from Tests/Tutorial/Step3/MathFunctions/mysqrt.cxx rename to Help/guide/tutorial/Step4/MathFunctions/mysqrt.cxx diff --git a/Tests/Tutorial/Step4/TutorialConfig.h.in b/Help/guide/tutorial/Step4/TutorialConfig.h.in similarity index 100% rename from Tests/Tutorial/Step4/TutorialConfig.h.in rename to Help/guide/tutorial/Step4/TutorialConfig.h.in diff --git a/Tests/Tutorial/Step4/directions.txt b/Help/guide/tutorial/Step4/directions.txt similarity index 100% rename from Tests/Tutorial/Step4/directions.txt rename to Help/guide/tutorial/Step4/directions.txt diff --git a/Tests/Tutorial/Step7/tutorial.cxx b/Help/guide/tutorial/Step4/tutorial.cxx similarity index 100% rename from Tests/Tutorial/Step7/tutorial.cxx rename to Help/guide/tutorial/Step4/tutorial.cxx diff --git a/Tests/Tutorial/Step5/CMakeLists.txt b/Help/guide/tutorial/Step5/CMakeLists.txt similarity index 100% rename from Tests/Tutorial/Step5/CMakeLists.txt rename to Help/guide/tutorial/Step5/CMakeLists.txt diff --git a/Tests/Tutorial/Step5/MathFunctions/CMakeLists.txt b/Help/guide/tutorial/Step5/MathFunctions/CMakeLists.txt similarity index 100% rename from Tests/Tutorial/Step5/MathFunctions/CMakeLists.txt rename to Help/guide/tutorial/Step5/MathFunctions/CMakeLists.txt diff --git a/Tests/Tutorial/Step5/MathFunctions/MakeTable.cxx b/Help/guide/tutorial/Step5/MathFunctions/MakeTable.cxx similarity index 100% rename from Tests/Tutorial/Step5/MathFunctions/MakeTable.cxx rename to Help/guide/tutorial/Step5/MathFunctions/MakeTable.cxx diff --git a/Tests/Tutorial/Step6/MathFunctions/MathFunctions.h b/Help/guide/tutorial/Step5/MathFunctions/MathFunctions.h similarity index 100% rename from Tests/Tutorial/Step6/MathFunctions/MathFunctions.h rename to Help/guide/tutorial/Step5/MathFunctions/MathFunctions.h diff --git a/Tests/Tutorial/Step2/MathFunctions/mysqrt.cxx b/Help/guide/tutorial/Step5/MathFunctions/mysqrt.cxx similarity index 100% rename from Tests/Tutorial/Step2/MathFunctions/mysqrt.cxx rename to Help/guide/tutorial/Step5/MathFunctions/mysqrt.cxx diff --git a/Tests/Tutorial/Step3/TutorialConfig.h.in b/Help/guide/tutorial/Step5/TutorialConfig.h.in similarity index 100% rename from Tests/Tutorial/Step3/TutorialConfig.h.in rename to Help/guide/tutorial/Step5/TutorialConfig.h.in diff --git a/Tests/Tutorial/Step5/directions.txt b/Help/guide/tutorial/Step5/directions.txt similarity index 100% rename from Tests/Tutorial/Step5/directions.txt rename to Help/guide/tutorial/Step5/directions.txt diff --git a/Tests/Tutorial/Step6/tutorial.cxx b/Help/guide/tutorial/Step5/tutorial.cxx similarity index 100% rename from Tests/Tutorial/Step6/tutorial.cxx rename to Help/guide/tutorial/Step5/tutorial.cxx diff --git a/Tests/Tutorial/Step6/CMakeLists.txt b/Help/guide/tutorial/Step6/CMakeLists.txt similarity index 100% rename from Tests/Tutorial/Step6/CMakeLists.txt rename to Help/guide/tutorial/Step6/CMakeLists.txt diff --git a/Tests/Tutorial/Step6/MathFunctions/CMakeLists.txt b/Help/guide/tutorial/Step6/MathFunctions/CMakeLists.txt similarity index 100% rename from Tests/Tutorial/Step6/MathFunctions/CMakeLists.txt rename to Help/guide/tutorial/Step6/MathFunctions/CMakeLists.txt diff --git a/Tests/Tutorial/Step11/MathFunctions/MakeTable.cxx b/Help/guide/tutorial/Step6/MathFunctions/MakeTable.cxx similarity index 100% rename from Tests/Tutorial/Step11/MathFunctions/MakeTable.cxx rename to Help/guide/tutorial/Step6/MathFunctions/MakeTable.cxx diff --git a/Tests/Tutorial/Step5/MathFunctions/MathFunctions.h b/Help/guide/tutorial/Step6/MathFunctions/MathFunctions.h similarity index 100% rename from Tests/Tutorial/Step5/MathFunctions/MathFunctions.h rename to Help/guide/tutorial/Step6/MathFunctions/MathFunctions.h diff --git a/Tests/Tutorial/Step6/MathFunctions/mysqrt.cxx b/Help/guide/tutorial/Step6/MathFunctions/mysqrt.cxx similarity index 100% rename from Tests/Tutorial/Step6/MathFunctions/mysqrt.cxx rename to Help/guide/tutorial/Step6/MathFunctions/mysqrt.cxx diff --git a/Tests/Tutorial/Step8/TutorialConfig.h.in b/Help/guide/tutorial/Step6/TutorialConfig.h.in similarity index 100% rename from Tests/Tutorial/Step8/TutorialConfig.h.in rename to Help/guide/tutorial/Step6/TutorialConfig.h.in diff --git a/Tests/Tutorial/Step6/directions.txt b/Help/guide/tutorial/Step6/directions.txt similarity index 100% rename from Tests/Tutorial/Step6/directions.txt rename to Help/guide/tutorial/Step6/directions.txt diff --git a/Tests/Tutorial/Step5/tutorial.cxx b/Help/guide/tutorial/Step6/tutorial.cxx similarity index 100% rename from Tests/Tutorial/Step5/tutorial.cxx rename to Help/guide/tutorial/Step6/tutorial.cxx diff --git a/Tests/Tutorial/Step7/CMakeLists.txt b/Help/guide/tutorial/Step7/CMakeLists.txt similarity index 100% rename from Tests/Tutorial/Step7/CMakeLists.txt rename to Help/guide/tutorial/Step7/CMakeLists.txt diff --git a/Tests/Tutorial/Step10/License.txt b/Help/guide/tutorial/Step7/License.txt similarity index 100% rename from Tests/Tutorial/Step10/License.txt rename to Help/guide/tutorial/Step7/License.txt diff --git a/Tests/Tutorial/Step8/MathFunctions/CMakeLists.txt b/Help/guide/tutorial/Step7/MathFunctions/CMakeLists.txt similarity index 100% rename from Tests/Tutorial/Step8/MathFunctions/CMakeLists.txt rename to Help/guide/tutorial/Step7/MathFunctions/CMakeLists.txt diff --git a/Tests/Tutorial/Step10/MathFunctions/MakeTable.cxx b/Help/guide/tutorial/Step7/MathFunctions/MakeTable.cxx similarity index 100% rename from Tests/Tutorial/Step10/MathFunctions/MakeTable.cxx rename to Help/guide/tutorial/Step7/MathFunctions/MakeTable.cxx diff --git a/Tests/Tutorial/Step4/MathFunctions/MathFunctions.h b/Help/guide/tutorial/Step7/MathFunctions/MathFunctions.h similarity index 100% rename from Tests/Tutorial/Step4/MathFunctions/MathFunctions.h rename to Help/guide/tutorial/Step7/MathFunctions/MathFunctions.h diff --git a/Tests/Tutorial/Step7/MathFunctions/mysqrt.cxx b/Help/guide/tutorial/Step7/MathFunctions/mysqrt.cxx similarity index 100% rename from Tests/Tutorial/Step7/MathFunctions/mysqrt.cxx rename to Help/guide/tutorial/Step7/MathFunctions/mysqrt.cxx diff --git a/Tests/Tutorial/Step7/TutorialConfig.h.in b/Help/guide/tutorial/Step7/TutorialConfig.h.in similarity index 100% rename from Tests/Tutorial/Step7/TutorialConfig.h.in rename to Help/guide/tutorial/Step7/TutorialConfig.h.in diff --git a/Tests/Tutorial/Step7/directions.txt b/Help/guide/tutorial/Step7/directions.txt similarity index 100% rename from Tests/Tutorial/Step7/directions.txt rename to Help/guide/tutorial/Step7/directions.txt diff --git a/Tests/Tutorial/Step4/tutorial.cxx b/Help/guide/tutorial/Step7/tutorial.cxx similarity index 100% rename from Tests/Tutorial/Step4/tutorial.cxx rename to Help/guide/tutorial/Step7/tutorial.cxx diff --git a/Tests/Tutorial/Step8/CMakeLists.txt b/Help/guide/tutorial/Step8/CMakeLists.txt similarity index 100% rename from Tests/Tutorial/Step8/CMakeLists.txt rename to Help/guide/tutorial/Step8/CMakeLists.txt diff --git a/Tests/Tutorial/MultiPackage/License.txt b/Help/guide/tutorial/Step8/License.txt similarity index 100% rename from Tests/Tutorial/MultiPackage/License.txt rename to Help/guide/tutorial/Step8/License.txt diff --git a/Tests/Tutorial/Step7/MathFunctions/CMakeLists.txt b/Help/guide/tutorial/Step8/MathFunctions/CMakeLists.txt similarity index 100% rename from Tests/Tutorial/Step7/MathFunctions/CMakeLists.txt rename to Help/guide/tutorial/Step8/MathFunctions/CMakeLists.txt diff --git a/Tests/Tutorial/MultiPackage/MathFunctions/MakeTable.cxx b/Help/guide/tutorial/Step8/MathFunctions/MakeTable.cxx similarity index 100% rename from Tests/Tutorial/MultiPackage/MathFunctions/MakeTable.cxx rename to Help/guide/tutorial/Step8/MathFunctions/MakeTable.cxx diff --git a/Tests/Tutorial/Step3/MathFunctions/MathFunctions.h b/Help/guide/tutorial/Step8/MathFunctions/MathFunctions.h similarity index 100% rename from Tests/Tutorial/Step3/MathFunctions/MathFunctions.h rename to Help/guide/tutorial/Step8/MathFunctions/MathFunctions.h diff --git a/Tests/Tutorial/Step8/MathFunctions/mysqrt.cxx b/Help/guide/tutorial/Step8/MathFunctions/mysqrt.cxx similarity index 100% rename from Tests/Tutorial/Step8/MathFunctions/mysqrt.cxx rename to Help/guide/tutorial/Step8/MathFunctions/mysqrt.cxx diff --git a/Tests/Tutorial/Step6/TutorialConfig.h.in b/Help/guide/tutorial/Step8/TutorialConfig.h.in similarity index 100% rename from Tests/Tutorial/Step6/TutorialConfig.h.in rename to Help/guide/tutorial/Step8/TutorialConfig.h.in diff --git a/Tests/Tutorial/Step8/directions.txt b/Help/guide/tutorial/Step8/directions.txt similarity index 100% rename from Tests/Tutorial/Step8/directions.txt rename to Help/guide/tutorial/Step8/directions.txt diff --git a/Tests/Tutorial/Step3/tutorial.cxx b/Help/guide/tutorial/Step8/tutorial.cxx similarity index 100% rename from Tests/Tutorial/Step3/tutorial.cxx rename to Help/guide/tutorial/Step8/tutorial.cxx diff --git a/Tests/Tutorial/Step9/CMakeLists.txt b/Help/guide/tutorial/Step9/CMakeLists.txt similarity index 100% rename from Tests/Tutorial/Step9/CMakeLists.txt rename to Help/guide/tutorial/Step9/CMakeLists.txt diff --git a/Tests/Tutorial/Step9/CTestConfig.cmake b/Help/guide/tutorial/Step9/CTestConfig.cmake similarity index 100% rename from Tests/Tutorial/Step9/CTestConfig.cmake rename to Help/guide/tutorial/Step9/CTestConfig.cmake diff --git a/Tests/Tutorial/Complete/License.txt b/Help/guide/tutorial/Step9/License.txt similarity index 100% rename from Tests/Tutorial/Complete/License.txt rename to Help/guide/tutorial/Step9/License.txt diff --git a/Tests/Tutorial/Step9/MathFunctions/CMakeLists.txt b/Help/guide/tutorial/Step9/MathFunctions/CMakeLists.txt similarity index 100% rename from Tests/Tutorial/Step9/MathFunctions/CMakeLists.txt rename to Help/guide/tutorial/Step9/MathFunctions/CMakeLists.txt diff --git a/Tests/Tutorial/Complete/MathFunctions/MakeTable.cxx b/Help/guide/tutorial/Step9/MathFunctions/MakeTable.cxx similarity index 100% rename from Tests/Tutorial/Complete/MathFunctions/MakeTable.cxx rename to Help/guide/tutorial/Step9/MathFunctions/MakeTable.cxx diff --git a/Tests/Tutorial/Complete/MathFunctions/MathFunctions.cxx b/Help/guide/tutorial/Step9/MathFunctions/MathFunctions.cxx similarity index 100% rename from Tests/Tutorial/Complete/MathFunctions/MathFunctions.cxx rename to Help/guide/tutorial/Step9/MathFunctions/MathFunctions.cxx diff --git a/Tests/Tutorial/Step2/MathFunctions/MathFunctions.h b/Help/guide/tutorial/Step9/MathFunctions/MathFunctions.h similarity index 100% rename from Tests/Tutorial/Step2/MathFunctions/MathFunctions.h rename to Help/guide/tutorial/Step9/MathFunctions/MathFunctions.h diff --git a/Tests/Tutorial/Step9/MathFunctions/mysqrt.cxx b/Help/guide/tutorial/Step9/MathFunctions/mysqrt.cxx similarity index 100% rename from Tests/Tutorial/Step9/MathFunctions/mysqrt.cxx rename to Help/guide/tutorial/Step9/MathFunctions/mysqrt.cxx diff --git a/Tests/Tutorial/Complete/MathFunctions/mysqrt.h b/Help/guide/tutorial/Step9/MathFunctions/mysqrt.h similarity index 100% rename from Tests/Tutorial/Complete/MathFunctions/mysqrt.h rename to Help/guide/tutorial/Step9/MathFunctions/mysqrt.h diff --git a/Tests/Tutorial/Complete/TutorialConfig.h.in b/Help/guide/tutorial/Step9/TutorialConfig.h.in similarity index 100% rename from Tests/Tutorial/Complete/TutorialConfig.h.in rename to Help/guide/tutorial/Step9/TutorialConfig.h.in diff --git a/Tests/Tutorial/Step9/directions.txt b/Help/guide/tutorial/Step9/directions.txt similarity index 100% rename from Tests/Tutorial/Step9/directions.txt rename to Help/guide/tutorial/Step9/directions.txt diff --git a/Tests/Tutorial/Step9/tutorial.cxx b/Help/guide/tutorial/Step9/tutorial.cxx similarity index 100% rename from Tests/Tutorial/Step9/tutorial.cxx rename to Help/guide/tutorial/Step9/tutorial.cxx diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 920af04..b5557ad 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -1729,7 +1729,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH endif() add_test(${tutorial_test_name} ${CMAKE_CTEST_COMMAND} --build-and-test - "${CMake_SOURCE_DIR}/Tests/Tutorial/${step_name}" + "${CMake_SOURCE_DIR}/Help/guide/tutorial/${step_name}" ${tutorial_build_dir}_Build ${build_generator_args} --build-project Tutorial @@ -2290,7 +2290,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH foreach(STP RANGE 1 4) add_test(NAME "TutorialStep${STP}.${name}" COMMAND ${CMAKE_CTEST_COMMAND} --build-and-test - "${CMake_SOURCE_DIR}/Tests/Tutorial/Step${STP}" + "${CMake_SOURCE_DIR}/Help/guide/tutorial/Step${STP}" "${CMake_BINARY_DIR}/Tests/Tutorial/Step${STP}_${name}" --build-generator "${generator}" --build-project Tutorial https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d2fde9480955cf2246519357e01ab5142a067efc commit d2fde9480955cf2246519357e01ab5142a067efc Author: Brad King AuthorDate: Thu May 30 12:25:39 2019 -0400 Commit: Betsy McPhail CommitDate: Tue Jun 18 10:36:16 2019 -0400 Help: Add infrastructure for guide-level documentation Create a `Help/guide/` directory to hold guide-level documents. Build them in most documentation formats, but not as man pages. Initialize the guide directory with a placeholder for the tutorial. diff --git a/CMakeLists.txt b/CMakeLists.txt index 51a1d8b..399e79c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -817,7 +817,7 @@ if(NOT CMake_TEST_EXTERNAL_CMAKE) PATTERN "*.sh*" PERMISSIONS OWNER_READ OWNER_EXECUTE OWNER_WRITE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE - REGEX "Help/dev($|/)" EXCLUDE + REGEX "Help/(dev|guide|index.rst)($|/)" EXCLUDE ) # Install auxiliary files integrating with other tools. diff --git a/Help/guide/tutorial/index.rst b/Help/guide/tutorial/index.rst new file mode 100644 index 0000000..be906af --- /dev/null +++ b/Help/guide/tutorial/index.rst @@ -0,0 +1,2 @@ +CMake Tutorial +************** diff --git a/Help/index.rst b/Help/index.rst index a948939..cf1d2f1 100644 --- a/Help/index.rst +++ b/Help/index.rst @@ -44,6 +44,14 @@ Reference Manuals /manual/cmake-variables.7 /manual/cpack-generators.7 +Guides +###### + +.. toctree:: + :maxdepth: 1 + + /guide/tutorial/index + .. only:: html or text Release Notes https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f067af8e385d17cc5b14e43475ded4d9d38317a2 commit f067af8e385d17cc5b14e43475ded4d9d38317a2 Author: Brad King AuthorDate: Thu May 30 12:42:27 2019 -0400 Commit: Betsy McPhail CommitDate: Tue Jun 18 10:36:16 2019 -0400 Tests/Tutorial: Remove trailing blank lines diff --git a/Tests/Tutorial/Step1/TutorialConfig.h.in b/Tests/Tutorial/Step1/TutorialConfig.h.in index 5395a06..7e4d7fa 100644 --- a/Tests/Tutorial/Step1/TutorialConfig.h.in +++ b/Tests/Tutorial/Step1/TutorialConfig.h.in @@ -1,4 +1,3 @@ // the configured options and settings for Tutorial #define Tutorial_VERSION_MAJOR @Tutorial_VERSION_MAJOR@ #define Tutorial_VERSION_MINOR @Tutorial_VERSION_MINOR@ - diff --git a/Tests/Tutorial/Step2/TutorialConfig.h.in b/Tests/Tutorial/Step2/TutorialConfig.h.in index 5395a06..7e4d7fa 100644 --- a/Tests/Tutorial/Step2/TutorialConfig.h.in +++ b/Tests/Tutorial/Step2/TutorialConfig.h.in @@ -1,4 +1,3 @@ // the configured options and settings for Tutorial #define Tutorial_VERSION_MAJOR @Tutorial_VERSION_MAJOR@ #define Tutorial_VERSION_MINOR @Tutorial_VERSION_MINOR@ - diff --git a/Tests/Tutorial/Step3/TutorialConfig.h.in b/Tests/Tutorial/Step3/TutorialConfig.h.in index 25a0602..e23f521 100644 --- a/Tests/Tutorial/Step3/TutorialConfig.h.in +++ b/Tests/Tutorial/Step3/TutorialConfig.h.in @@ -2,4 +2,3 @@ #define Tutorial_VERSION_MAJOR @Tutorial_VERSION_MAJOR@ #define Tutorial_VERSION_MINOR @Tutorial_VERSION_MINOR@ #cmakedefine USE_MYMATH - diff --git a/Tests/Tutorial/Step4/TutorialConfig.h.in b/Tests/Tutorial/Step4/TutorialConfig.h.in index 25a0602..e23f521 100644 --- a/Tests/Tutorial/Step4/TutorialConfig.h.in +++ b/Tests/Tutorial/Step4/TutorialConfig.h.in @@ -2,4 +2,3 @@ #define Tutorial_VERSION_MAJOR @Tutorial_VERSION_MAJOR@ #define Tutorial_VERSION_MINOR @Tutorial_VERSION_MINOR@ #cmakedefine USE_MYMATH - diff --git a/Tests/Tutorial/Step5/TutorialConfig.h.in b/Tests/Tutorial/Step5/TutorialConfig.h.in index 25a0602..e23f521 100644 --- a/Tests/Tutorial/Step5/TutorialConfig.h.in +++ b/Tests/Tutorial/Step5/TutorialConfig.h.in @@ -2,4 +2,3 @@ #define Tutorial_VERSION_MAJOR @Tutorial_VERSION_MAJOR@ #define Tutorial_VERSION_MINOR @Tutorial_VERSION_MINOR@ #cmakedefine USE_MYMATH - diff --git a/Tests/Tutorial/Step6/TutorialConfig.h.in b/Tests/Tutorial/Step6/TutorialConfig.h.in index a091265..e97ce24 100644 --- a/Tests/Tutorial/Step6/TutorialConfig.h.in +++ b/Tests/Tutorial/Step6/TutorialConfig.h.in @@ -6,4 +6,3 @@ // does the platform provide exp and log functions? #cmakedefine HAVE_LOG #cmakedefine HAVE_EXP - diff --git a/Tests/Tutorial/Step7/TutorialConfig.h.in b/Tests/Tutorial/Step7/TutorialConfig.h.in index a091265..e97ce24 100644 --- a/Tests/Tutorial/Step7/TutorialConfig.h.in +++ b/Tests/Tutorial/Step7/TutorialConfig.h.in @@ -6,4 +6,3 @@ // does the platform provide exp and log functions? #cmakedefine HAVE_LOG #cmakedefine HAVE_EXP - https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d5a81ef7473734a9a886de4ff64246614ec0bb1a commit d5a81ef7473734a9a886de4ff64246614ec0bb1a Author: Brad King AuthorDate: Thu May 30 12:41:04 2019 -0400 Commit: Betsy McPhail CommitDate: Tue Jun 18 10:36:16 2019 -0400 Tests/Tutorial: Remove unused file diff --git a/Tests/Tutorial/Step7/build1.cmake b/Tests/Tutorial/Step7/build1.cmake deleted file mode 100644 index baa475f..0000000 --- a/Tests/Tutorial/Step7/build1.cmake +++ /dev/null @@ -1,5 +0,0 @@ -set(CTEST_SOURCE_DIRECTORY "$ENV{HOME}/Dashboards/My Tests/CMake/Tests/Tutorial/Step7") -set(CTEST_BINARY_DIRECTORY "${CTEST_SOURCE_DIRECTORY}-build1") - -set(CTEST_CMAKE_COMMAND "cmake") -set(CTEST_COMMAND "ctest -D Experimental") ----------------------------------------------------------------------- Summary of changes: CMakeLists.txt | 2 +- .../guide/tutorial}/Complete/CMakeLists.txt | 12 +- .../guide/tutorial/Complete}/Config.cmake.in | 0 .../guide/tutorial/Complete}/License.txt | 0 .../Complete/MathFunctions/CMakeLists.txt | 2 +- .../tutorial/Complete}/MathFunctions/MakeTable.cxx | 0 .../Complete}/MathFunctions/MathFunctions.cxx | 0 .../Complete}/MathFunctions/MathFunctions.h | 0 .../tutorial/Complete}/MathFunctions/mysqrt.cxx | 0 .../tutorial/Complete}/MathFunctions/mysqrt.h | 0 .../guide/tutorial/Complete}/TutorialConfig.h.in | 0 .../guide/tutorial/Complete}/tutorial.cxx | 0 .../guide/tutorial}/Consumer/CMakeLists.txt | 0 .../guide/tutorial}/Consumer/Config.cmake.in | 0 .../guide/tutorial}/Consumer/consumer.cxx | 0 .../guide/tutorial}/MultiPackage/CMakeLists.txt | 0 .../guide/tutorial/MultiPackage}/Config.cmake.in | 0 .../guide/tutorial/MultiPackage}/License.txt | 0 .../MultiPackage/MathFunctions/CMakeLists.txt | 0 .../MultiPackage}/MathFunctions/MakeTable.cxx | 0 .../MultiPackage}/MathFunctions/MathFunctions.cxx | 0 .../MultiPackage}/MathFunctions/MathFunctions.h | 0 .../MultiPackage}/MathFunctions/mysqrt.cxx | 0 .../tutorial/MultiPackage}/MathFunctions/mysqrt.h | 0 .../tutorial}/MultiPackage/MultiCPackConfig.cmake | 0 .../tutorial/MultiPackage}/TutorialConfig.h.in | 0 .../guide/tutorial}/MultiPackage/tutorial.cxx | 0 .../guide/tutorial}/Step1/CMakeLists.txt | 0 .../guide/tutorial/Step1}/TutorialConfig.h.in | 1 - .../guide/tutorial}/Step1/tutorial.cxx | 0 .../guide/tutorial}/Step10/CMakeLists.txt | 12 +- .../guide/tutorial/Step10}/License.txt | 0 .../tutorial}/Step10/MathFunctions/CMakeLists.txt | 2 +- .../tutorial/Step10}/MathFunctions/MakeTable.cxx | 0 .../Step10/MathFunctions/MathFunctions.cxx | 0 .../tutorial/Step10}/MathFunctions/MathFunctions.h | 0 .../tutorial/Step10}/MathFunctions/mysqrt.cxx | 0 .../guide/tutorial}/Step10/MathFunctions/mysqrt.h | 0 .../guide/tutorial}/Step10/TutorialConfig.h.in | 0 .../guide/tutorial/Step10}/tutorial.cxx | 1 + .../guide/tutorial}/Step11/CMakeLists.txt | 12 +- .../guide/tutorial}/Step11/License.txt | 0 .../tutorial}/Step11/MathFunctions/CMakeLists.txt | 2 +- .../tutorial/Step11}/MathFunctions/MakeTable.cxx | 0 .../Step11}/MathFunctions/MathFunctions.cxx | 0 .../tutorial/Step11}/MathFunctions/MathFunctions.h | 0 .../tutorial/Step11}/MathFunctions/mysqrt.cxx | 0 .../guide/tutorial/Step11}/MathFunctions/mysqrt.h | 0 .../guide/tutorial/Step11}/TutorialConfig.h.in | 0 .../guide/tutorial}/Step11/tutorial.cxx | 1 + .../guide/tutorial}/Step2/CMakeLists.txt | 3 +- .../tutorial/Step2}/MathFunctions/CMakeLists.txt | 0 .../tutorial/Step2}/MathFunctions/MathFunctions.h | 0 .../guide/tutorial/Step2}/MathFunctions/mysqrt.cxx | 0 .../guide/tutorial/Step2}/TutorialConfig.h.in | 1 - .../guide/tutorial}/Step2/tutorial.cxx | 1 + .../guide/tutorial}/Step3/CMakeLists.txt | 2 +- .../tutorial/Step3}/MathFunctions/CMakeLists.txt | 0 .../tutorial/Step3}/MathFunctions/MathFunctions.h | 0 .../guide/tutorial/Step3}/MathFunctions/mysqrt.cxx | 0 .../guide/tutorial/Step3}/TutorialConfig.h.in | 1 - .../guide/tutorial/Step3}/tutorial.cxx | 3 + .../guide/tutorial}/Step4/CMakeLists.txt | 2 +- .../tutorial}/Step4/MathFunctions/CMakeLists.txt | 0 .../tutorial/Step4}/MathFunctions/MathFunctions.h | 0 .../guide/tutorial/Step4}/MathFunctions/mysqrt.cxx | 0 .../guide/tutorial/Step4}/TutorialConfig.h.in | 1 - .../guide/tutorial/Step4}/tutorial.cxx | 3 + .../guide/tutorial}/Step5/CMakeLists.txt | 2 +- .../tutorial}/Step5/MathFunctions/CMakeLists.txt | 1 + .../tutorial}/Step5/MathFunctions/MakeTable.cxx | 0 .../tutorial/Step5}/MathFunctions/MathFunctions.h | 0 .../guide/tutorial/Step5}/MathFunctions/mysqrt.cxx | 0 .../guide/tutorial/Step5}/TutorialConfig.h.in | 1 - .../guide/tutorial/Step5}/tutorial.cxx | 3 + .../guide/tutorial}/Step6/CMakeLists.txt | 2 +- .../tutorial}/Step6/MathFunctions/CMakeLists.txt | 2 +- .../tutorial/Step6}/MathFunctions/MakeTable.cxx | 0 .../tutorial/Step6}/MathFunctions/MathFunctions.h | 0 .../guide/tutorial}/Step6/MathFunctions/mysqrt.cxx | 0 .../guide/tutorial/Step6}/TutorialConfig.h.in | 0 .../guide/tutorial/Step6}/tutorial.cxx | 3 + .../guide/tutorial}/Step7/CMakeLists.txt | 2 +- .../guide/tutorial/Step7}/License.txt | 0 .../tutorial/Step7}/MathFunctions/CMakeLists.txt | 1 + .../tutorial/Step7}/MathFunctions/MakeTable.cxx | 0 .../tutorial/Step7}/MathFunctions/MathFunctions.h | 0 .../guide/tutorial}/Step7/MathFunctions/mysqrt.cxx | 0 .../guide/tutorial/Step7}/TutorialConfig.h.in | 0 .../guide/tutorial/Step7}/tutorial.cxx | 3 + .../guide/tutorial}/Step8/CMakeLists.txt | 3 +- .../guide/tutorial/Step8}/License.txt | 0 .../tutorial/Step8}/MathFunctions/CMakeLists.txt | 1 + .../tutorial/Step8}/MathFunctions/MakeTable.cxx | 0 .../tutorial/Step8}/MathFunctions/MathFunctions.h | 0 .../guide/tutorial}/Step8/MathFunctions/mysqrt.cxx | 0 .../guide/tutorial}/Step8/TutorialConfig.h.in | 0 .../guide/tutorial/Step8}/tutorial.cxx | 3 + .../guide/tutorial}/Step9/CMakeLists.txt | 2 +- .../guide/tutorial}/Step9/CTestConfig.cmake | 0 .../guide/tutorial/Step9}/License.txt | 0 .../tutorial}/Step9/MathFunctions/CMakeLists.txt | 1 + .../tutorial/Step9}/MathFunctions/MakeTable.cxx | 0 .../Step9}/MathFunctions/MathFunctions.cxx | 0 .../tutorial/Step9}/MathFunctions/MathFunctions.h | 0 .../guide/tutorial}/Step9/MathFunctions/mysqrt.cxx | 0 .../guide/tutorial/Step9}/MathFunctions/mysqrt.h | 0 .../guide/tutorial/Step9}/TutorialConfig.h.in | 0 .../guide/tutorial}/Step9/tutorial.cxx | 3 + Help/guide/tutorial/index.rst | 758 +++++++++++++++++++++ Help/index.rst | 8 + Help/release/dev/FindPython-FIND_ABI.rst | 5 + Modules/FindMatlab.cmake | 30 +- Modules/FindPython.cmake | 45 ++ Modules/FindPython/Support.cmake | 369 +++++++--- Modules/FindPython3.cmake | 41 ++ Tests/CMakeLists.txt | 4 +- Tests/FindPython/FindPythonScript.cmake | 10 +- Tests/FindPython/Python2/CMakeLists.txt | 1 + Tests/FindPython/Python3/CMakeLists.txt | 53 ++ Tests/Tutorial/Consumer/directions.txt | 6 - Tests/Tutorial/MultiPackage/directions.txt | 34 - Tests/Tutorial/Readme.txt | 16 - Tests/Tutorial/Step1/directions.txt | 95 --- Tests/Tutorial/Step10/directions.txt | 38 -- Tests/Tutorial/Step11/directions.txt | 104 --- Tests/Tutorial/Step2/directions.txt | 101 --- Tests/Tutorial/Step3/directions.txt | 26 - Tests/Tutorial/Step4/directions.txt | 72 -- Tests/Tutorial/Step5/directions.txt | 69 -- Tests/Tutorial/Step6/TutorialConfig.h.in | 9 - Tests/Tutorial/Step6/directions.txt | 104 --- Tests/Tutorial/Step7/TutorialConfig.h.in | 9 - Tests/Tutorial/Step7/build1.cmake | 5 - Tests/Tutorial/Step7/directions.txt | 40 -- Tests/Tutorial/Step7/tutorial.cxx | 32 - Tests/Tutorial/Step8/directions.txt | 38 -- Tests/Tutorial/Step8/tutorial.cxx | 32 - Tests/Tutorial/Step9/directions.txt | 166 ----- 139 files changed, 1275 insertions(+), 1142 deletions(-) rename {Tests/Tutorial => Help/guide/tutorial}/Complete/CMakeLists.txt (99%) rename {Tests/Tutorial/MultiPackage => Help/guide/tutorial/Complete}/Config.cmake.in (100%) rename {Tests/Tutorial/Step9 => Help/guide/tutorial/Complete}/License.txt (100%) rename {Tests/Tutorial => Help/guide/tutorial}/Complete/MathFunctions/CMakeLists.txt (99%) rename {Tests/Tutorial/Step9 => Help/guide/tutorial/Complete}/MathFunctions/MakeTable.cxx (100%) rename {Tests/Tutorial/Step9 => Help/guide/tutorial/Complete}/MathFunctions/MathFunctions.cxx (100%) rename {Tests/Tutorial/Step11 => Help/guide/tutorial/Complete}/MathFunctions/MathFunctions.h (100%) rename {Tests/Tutorial/Step11 => Help/guide/tutorial/Complete}/MathFunctions/mysqrt.cxx (100%) rename {Tests/Tutorial/Step9 => Help/guide/tutorial/Complete}/MathFunctions/mysqrt.h (100%) rename {Tests/Tutorial/Step9 => Help/guide/tutorial/Complete}/TutorialConfig.h.in (100%) rename {Tests/Tutorial/Step10 => Help/guide/tutorial/Complete}/tutorial.cxx (100%) rename {Tests/Tutorial => Help/guide/tutorial}/Consumer/CMakeLists.txt (100%) rename {Tests/Tutorial => Help/guide/tutorial}/Consumer/Config.cmake.in (100%) rename {Tests/Tutorial => Help/guide/tutorial}/Consumer/consumer.cxx (100%) rename {Tests/Tutorial => Help/guide/tutorial}/MultiPackage/CMakeLists.txt (100%) rename {Tests/Tutorial/Complete => Help/guide/tutorial/MultiPackage}/Config.cmake.in (100%) rename {Tests/Tutorial/Step8 => Help/guide/tutorial/MultiPackage}/License.txt (100%) rename {Tests/Tutorial => Help/guide/tutorial}/MultiPackage/MathFunctions/CMakeLists.txt (100%) rename {Tests/Tutorial/Step8 => Help/guide/tutorial/MultiPackage}/MathFunctions/MakeTable.cxx (100%) rename {Tests/Tutorial/Step11 => Help/guide/tutorial/MultiPackage}/MathFunctions/MathFunctions.cxx (100%) rename {Tests/Tutorial/Step10 => Help/guide/tutorial/MultiPackage}/MathFunctions/MathFunctions.h (100%) rename {Tests/Tutorial/Step10 => Help/guide/tutorial/MultiPackage}/MathFunctions/mysqrt.cxx (100%) rename {Tests/Tutorial/Step11 => Help/guide/tutorial/MultiPackage}/MathFunctions/mysqrt.h (100%) rename {Tests/Tutorial => Help/guide/tutorial}/MultiPackage/MultiCPackConfig.cmake (100%) rename {Tests/Tutorial/Step11 => Help/guide/tutorial/MultiPackage}/TutorialConfig.h.in (100%) rename {Tests/Tutorial => Help/guide/tutorial}/MultiPackage/tutorial.cxx (100%) rename {Tests/Tutorial => Help/guide/tutorial}/Step1/CMakeLists.txt (100%) rename {Tests/Tutorial/Step2 => Help/guide/tutorial/Step1}/TutorialConfig.h.in (99%) rename {Tests/Tutorial => Help/guide/tutorial}/Step1/tutorial.cxx (100%) rename {Tests/Tutorial => Help/guide/tutorial}/Step10/CMakeLists.txt (98%) rename {Tests/Tutorial/Step7 => Help/guide/tutorial/Step10}/License.txt (100%) rename {Tests/Tutorial => Help/guide/tutorial}/Step10/MathFunctions/CMakeLists.txt (99%) rename {Tests/Tutorial/Step7 => Help/guide/tutorial/Step10}/MathFunctions/MakeTable.cxx (100%) rename {Tests/Tutorial => Help/guide/tutorial}/Step10/MathFunctions/MathFunctions.cxx (100%) rename {Tests/Tutorial/MultiPackage => Help/guide/tutorial/Step10}/MathFunctions/MathFunctions.h (100%) rename {Tests/Tutorial/MultiPackage => Help/guide/tutorial/Step10}/MathFunctions/mysqrt.cxx (100%) rename {Tests/Tutorial => Help/guide/tutorial}/Step10/MathFunctions/mysqrt.h (100%) rename {Tests/Tutorial => Help/guide/tutorial}/Step10/TutorialConfig.h.in (100%) rename {Tests/Tutorial/Complete => Help/guide/tutorial/Step10}/tutorial.cxx (96%) rename {Tests/Tutorial => Help/guide/tutorial}/Step11/CMakeLists.txt (98%) rename {Tests/Tutorial => Help/guide/tutorial}/Step11/License.txt (100%) rename {Tests/Tutorial => Help/guide/tutorial}/Step11/MathFunctions/CMakeLists.txt (99%) rename {Tests/Tutorial/Step6 => Help/guide/tutorial/Step11}/MathFunctions/MakeTable.cxx (100%) rename {Tests/Tutorial/MultiPackage => Help/guide/tutorial/Step11}/MathFunctions/MathFunctions.cxx (100%) rename {Tests/Tutorial/Complete => Help/guide/tutorial/Step11}/MathFunctions/MathFunctions.h (100%) rename {Tests/Tutorial/Complete => Help/guide/tutorial/Step11}/MathFunctions/mysqrt.cxx (100%) rename {Tests/Tutorial/MultiPackage => Help/guide/tutorial/Step11}/MathFunctions/mysqrt.h (100%) rename {Tests/Tutorial/MultiPackage => Help/guide/tutorial/Step11}/TutorialConfig.h.in (100%) rename {Tests/Tutorial => Help/guide/tutorial}/Step11/tutorial.cxx (96%) rename {Tests/Tutorial => Help/guide/tutorial}/Step2/CMakeLists.txt (95%) rename {Tests/Tutorial/Step3 => Help/guide/tutorial/Step2}/MathFunctions/CMakeLists.txt (100%) rename {Tests/Tutorial/Step9 => Help/guide/tutorial/Step2}/MathFunctions/MathFunctions.h (100%) rename {Tests/Tutorial/Step5 => Help/guide/tutorial/Step2}/MathFunctions/mysqrt.cxx (100%) rename {Tests/Tutorial/Step1 => Help/guide/tutorial/Step2}/TutorialConfig.h.in (99%) rename {Tests/Tutorial => Help/guide/tutorial}/Step2/tutorial.cxx (96%) rename {Tests/Tutorial => Help/guide/tutorial}/Step3/CMakeLists.txt (97%) rename {Tests/Tutorial/Step2 => Help/guide/tutorial/Step3}/MathFunctions/CMakeLists.txt (100%) rename {Tests/Tutorial/Step8 => Help/guide/tutorial/Step3}/MathFunctions/MathFunctions.h (100%) rename {Tests/Tutorial/Step4 => Help/guide/tutorial/Step3}/MathFunctions/mysqrt.cxx (100%) rename {Tests/Tutorial/Step5 => Help/guide/tutorial/Step3}/TutorialConfig.h.in (99%) copy {Tests/Tutorial/Step6 => Help/guide/tutorial/Step3}/tutorial.cxx (86%) rename {Tests/Tutorial => Help/guide/tutorial}/Step4/CMakeLists.txt (97%) rename {Tests/Tutorial => Help/guide/tutorial}/Step4/MathFunctions/CMakeLists.txt (100%) rename {Tests/Tutorial/Step7 => Help/guide/tutorial/Step4}/MathFunctions/MathFunctions.h (100%) rename {Tests/Tutorial/Step3 => Help/guide/tutorial/Step4}/MathFunctions/mysqrt.cxx (100%) rename {Tests/Tutorial/Step3 => Help/guide/tutorial/Step4}/TutorialConfig.h.in (99%) rename {Tests/Tutorial/Step5 => Help/guide/tutorial/Step4}/tutorial.cxx (86%) rename {Tests/Tutorial => Help/guide/tutorial}/Step5/CMakeLists.txt (98%) rename {Tests/Tutorial => Help/guide/tutorial}/Step5/MathFunctions/CMakeLists.txt (95%) rename {Tests/Tutorial => Help/guide/tutorial}/Step5/MathFunctions/MakeTable.cxx (100%) rename {Tests/Tutorial/Step6 => Help/guide/tutorial/Step5}/MathFunctions/MathFunctions.h (100%) rename {Tests/Tutorial/Step2 => Help/guide/tutorial/Step5}/MathFunctions/mysqrt.cxx (100%) rename {Tests/Tutorial/Step4 => Help/guide/tutorial/Step5}/TutorialConfig.h.in (99%) rename {Tests/Tutorial/Step3 => Help/guide/tutorial/Step5}/tutorial.cxx (86%) rename {Tests/Tutorial => Help/guide/tutorial}/Step6/CMakeLists.txt (98%) rename {Tests/Tutorial => Help/guide/tutorial}/Step6/MathFunctions/CMakeLists.txt (97%) rename {Tests/Tutorial/Step11 => Help/guide/tutorial/Step6}/MathFunctions/MakeTable.cxx (100%) rename {Tests/Tutorial/Step5 => Help/guide/tutorial/Step6}/MathFunctions/MathFunctions.h (100%) rename {Tests/Tutorial => Help/guide/tutorial}/Step6/MathFunctions/mysqrt.cxx (100%) copy {Tests/Tutorial/Step8 => Help/guide/tutorial/Step6}/TutorialConfig.h.in (100%) rename {Tests/Tutorial/Step4 => Help/guide/tutorial/Step6}/tutorial.cxx (86%) rename {Tests/Tutorial => Help/guide/tutorial}/Step7/CMakeLists.txt (98%) rename {Tests/Tutorial/Step10 => Help/guide/tutorial/Step7}/License.txt (100%) rename {Tests/Tutorial/Step8 => Help/guide/tutorial/Step7}/MathFunctions/CMakeLists.txt (98%) rename {Tests/Tutorial/Step10 => Help/guide/tutorial/Step7}/MathFunctions/MakeTable.cxx (100%) rename {Tests/Tutorial/Step4 => Help/guide/tutorial/Step7}/MathFunctions/MathFunctions.h (100%) rename {Tests/Tutorial => Help/guide/tutorial}/Step7/MathFunctions/mysqrt.cxx (100%) copy {Tests/Tutorial/Step8 => Help/guide/tutorial/Step7}/TutorialConfig.h.in (100%) copy {Tests/Tutorial/Step6 => Help/guide/tutorial/Step7}/tutorial.cxx (86%) rename {Tests/Tutorial => Help/guide/tutorial}/Step8/CMakeLists.txt (98%) rename {Tests/Tutorial/MultiPackage => Help/guide/tutorial/Step8}/License.txt (100%) rename {Tests/Tutorial/Step7 => Help/guide/tutorial/Step8}/MathFunctions/CMakeLists.txt (98%) rename {Tests/Tutorial/MultiPackage => Help/guide/tutorial/Step8}/MathFunctions/MakeTable.cxx (100%) rename {Tests/Tutorial/Step3 => Help/guide/tutorial/Step8}/MathFunctions/MathFunctions.h (100%) rename {Tests/Tutorial => Help/guide/tutorial}/Step8/MathFunctions/mysqrt.cxx (100%) rename {Tests/Tutorial => Help/guide/tutorial}/Step8/TutorialConfig.h.in (100%) rename {Tests/Tutorial/Step6 => Help/guide/tutorial/Step8}/tutorial.cxx (86%) rename {Tests/Tutorial => Help/guide/tutorial}/Step9/CMakeLists.txt (98%) rename {Tests/Tutorial => Help/guide/tutorial}/Step9/CTestConfig.cmake (100%) rename {Tests/Tutorial/Complete => Help/guide/tutorial/Step9}/License.txt (100%) rename {Tests/Tutorial => Help/guide/tutorial}/Step9/MathFunctions/CMakeLists.txt (98%) rename {Tests/Tutorial/Complete => Help/guide/tutorial/Step9}/MathFunctions/MakeTable.cxx (100%) rename {Tests/Tutorial/Complete => Help/guide/tutorial/Step9}/MathFunctions/MathFunctions.cxx (100%) rename {Tests/Tutorial/Step2 => Help/guide/tutorial/Step9}/MathFunctions/MathFunctions.h (100%) rename {Tests/Tutorial => Help/guide/tutorial}/Step9/MathFunctions/mysqrt.cxx (100%) rename {Tests/Tutorial/Complete => Help/guide/tutorial/Step9}/MathFunctions/mysqrt.h (100%) rename {Tests/Tutorial/Complete => Help/guide/tutorial/Step9}/TutorialConfig.h.in (100%) rename {Tests/Tutorial => Help/guide/tutorial}/Step9/tutorial.cxx (86%) create mode 100644 Help/guide/tutorial/index.rst create mode 100644 Help/release/dev/FindPython-FIND_ABI.rst delete mode 100644 Tests/Tutorial/Consumer/directions.txt delete mode 100644 Tests/Tutorial/MultiPackage/directions.txt delete mode 100644 Tests/Tutorial/Readme.txt delete mode 100644 Tests/Tutorial/Step1/directions.txt delete mode 100644 Tests/Tutorial/Step10/directions.txt delete mode 100644 Tests/Tutorial/Step11/directions.txt delete mode 100644 Tests/Tutorial/Step2/directions.txt delete mode 100644 Tests/Tutorial/Step3/directions.txt delete mode 100644 Tests/Tutorial/Step4/directions.txt delete mode 100644 Tests/Tutorial/Step5/directions.txt delete mode 100644 Tests/Tutorial/Step6/TutorialConfig.h.in delete mode 100644 Tests/Tutorial/Step6/directions.txt delete mode 100644 Tests/Tutorial/Step7/TutorialConfig.h.in delete mode 100644 Tests/Tutorial/Step7/build1.cmake delete mode 100644 Tests/Tutorial/Step7/directions.txt delete mode 100644 Tests/Tutorial/Step7/tutorial.cxx delete mode 100644 Tests/Tutorial/Step8/directions.txt delete mode 100644 Tests/Tutorial/Step8/tutorial.cxx delete mode 100644 Tests/Tutorial/Step9/directions.txt hooks/post-receive -- CMake From kwrobot at kitware.com Tue Jun 25 07:23:03 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Tue, 25 Jun 2019 07:23:03 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc2-143-g1009fd1 Message-ID: <20190625112303.A9F0311E312@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 1009fd18604e7670838ed28798b83312eff1b0f0 (commit) via dba8086f58484f545c053a3c5175ec75df8a817f (commit) via 56e89e50d3dc4a971ed9d7195834e1233658c08e (commit) via 51bcdeb17fc2bde72850507a2ee7b35493c2067b (commit) via 5e52de7d5708c5d2faf00837bf5f10ed024cced1 (commit) from 92351fe7cd73a756effd5a42ff7f04c2d9beaf88 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1009fd18604e7670838ed28798b83312eff1b0f0 commit 1009fd18604e7670838ed28798b83312eff1b0f0 Merge: dba8086 56e89e5 Author: Brad King AuthorDate: Tue Jun 25 11:15:25 2019 +0000 Commit: Kitware Robot CommitDate: Tue Jun 25 07:15:33 2019 -0400 Merge topic 'matlab-if' 56e89e50d3 FindMatlab: simplify several if()-constructs 51bcdeb17f Tests: simplify checks for Matlab variables being set Acked-by: Kitware Robot Merge-request: !3472 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=dba8086f58484f545c053a3c5175ec75df8a817f commit dba8086f58484f545c053a3c5175ec75df8a817f Merge: 92351fe 5e52de7 Author: Brad King AuthorDate: Tue Jun 25 11:13:29 2019 +0000 Commit: Kitware Robot CommitDate: Tue Jun 25 07:13:38 2019 -0400 Merge topic 'refactor/use-unique_ptr' 5e52de7d57 modermize: replace some raw pointers w/ `unique_ptr` Acked-by: Kitware Robot Merge-request: !3465 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=56e89e50d3dc4a971ed9d7195834e1233658c08e commit 56e89e50d3dc4a971ed9d7195834e1233658c08e Author: Rolf Eike Beer AuthorDate: Mon Jun 24 16:24:47 2019 +0200 Commit: Rolf Eike Beer CommitDate: Mon Jun 24 18:33:48 2019 +0200 FindMatlab: simplify several if()-constructs diff --git a/Modules/FindMatlab.cmake b/Modules/FindMatlab.cmake index 3547642..c95a512 100644 --- a/Modules/FindMatlab.cmake +++ b/Modules/FindMatlab.cmake @@ -224,6 +224,9 @@ Reference this list. #]=======================================================================] +cmake_policy(PUSH) +cmake_policy(SET CMP0057 NEW) # if IN_LIST + set(_FindMatlab_SELF_DIR "${CMAKE_CURRENT_LIST_DIR}") include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) @@ -395,7 +398,7 @@ function(matlab_extract_all_installed_versions_from_registry win64 matlab_versio ) - if(${resultMatlab} EQUAL 0) + if(resultMatlab EQUAL 0) string( REGEX MATCHALL "MATLAB\\\\([0-9]+(\\.[0-9]+)?)" @@ -612,9 +615,10 @@ function(matlab_get_mex_suffix matlab_root mex_suffix) OUTPUT_VARIABLE _matlab_mex_extension #RESULT_VARIABLE _matlab_mex_extension_call ERROR_VARIABLE _matlab_mex_extension_error + OUTPUT_STRIP_TRAILING_WHITESPACE ${devnull}) - if(NOT "${_matlab_mex_extension_error}" STREQUAL "") + if(_matlab_mex_extension_error) if(WIN32) # this is only for intel architecture if(CMAKE_SIZEOF_VOID_P EQUAL 8) @@ -700,7 +704,7 @@ function(matlab_get_version_from_matlab_run matlab_binary_program matlab_list_ve ${devnull} ) - if("${_matlab_result_version_call}" MATCHES "timeout") + if(_matlab_result_version_call MATCHES "timeout") if(MATLAB_FIND_DEBUG) message(WARNING "[MATLAB] Unable to determine the version of Matlab." " Matlab call timed out after 120 seconds.") @@ -955,14 +959,14 @@ function(matlab_add_mex) set(${prefix}_OUTPUT_NAME ${${prefix}_NAME}) endif() - if(NOT ${Matlab_VERSION_STRING} VERSION_LESS "9.1") # For 9.1 (R2016b) and newer, add version source file + if(NOT Matlab_VERSION_STRING VERSION_LESS "9.1") # For 9.1 (R2016b) and newer, add version source file # TODO: check the file extensions in ${${prefix}_SRC} to see if they're C or C++ files # Currently, the C and C++ versions of the version files are identical, so this doesn't matter. set(MEX_VERSION_FILE "${Matlab_ROOT_DIR}/extern/version/c_mexapi_version.c") #set(MEX_VERSION_FILE "${Matlab_ROOT_DIR}/extern/version/cpp_mexapi_version.cpp") endif() - if(NOT ${Matlab_VERSION_STRING} VERSION_LESS "9.4") # For 9.4 (R2018a) and newer, add API macro + if(NOT Matlab_VERSION_STRING VERSION_LESS "9.4") # For 9.4 (R2018a) and newer, add API macro if(${${prefix}_R2018a}) set(MEX_API_MACRO "MATLAB_DEFAULT_RELEASE=R2018a") else() @@ -1023,7 +1027,7 @@ function(matlab_add_mex) if (MSVC) set(_link_flags "${_link_flags} /EXPORT:mexFunction") - if(NOT ${Matlab_VERSION_STRING} VERSION_LESS "9.1") # For 9.1 (R2016b) and newer, export version + if(NOT Matlab_VERSION_STRING VERSION_LESS "9.1") # For 9.1 (R2016b) and newer, export version set(_link_flags "${_link_flags} /EXPORT:mexfilerequiredapiversion") endif() @@ -1042,13 +1046,13 @@ function(matlab_add_mex) else() - if(${Matlab_VERSION_STRING} VERSION_LESS "9.1") # For versions prior to 9.1 (R2016b) + if(Matlab_VERSION_STRING VERSION_LESS "9.1") # For versions prior to 9.1 (R2016b) set(_ver_map_files ${Matlab_EXTERN_LIBRARY_DIR}/mexFunction.map) else() # For 9.1 (R2016b) and newer set(_ver_map_files ${Matlab_EXTERN_LIBRARY_DIR}/c_exportsmexfileversion.map) endif() - if(NOT ${Matlab_VERSION_STRING} VERSION_LESS "9.5") # For 9.5 (R2018b) (and newer?) + if(NOT Matlab_VERSION_STRING VERSION_LESS "9.5") # For 9.5 (R2018b) (and newer?) target_compile_options(${${prefix}_NAME} PRIVATE "-fvisibility=default") # This one is weird, it might be a bug in for R2018b. When compiling with # -fvisibility=hidden, the symbol `mexFunction` cannot be exported. Reading the @@ -1112,14 +1116,14 @@ function(_Matlab_get_version_from_root matlab_root matlab_or_mcr matlab_known_ve # set(Matlab_PROG_VERSION_STRING_AUTO_DETECT "" CACHE INTERNAL "internal matlab location for the discovered version") #endif() - if(NOT ${matlab_known_version} STREQUAL "NOTFOUND") + if(NOT matlab_known_version STREQUAL "NOTFOUND") # the version is known, we just return it set(${matlab_final_version} ${matlab_known_version} PARENT_SCOPE) set(Matlab_VERSION_STRING_INTERNAL ${matlab_known_version} CACHE INTERNAL "Matlab version (automatically determined)" FORCE) return() endif() - if("${matlab_or_mcr}" STREQUAL "UNKNOWN") + if(matlab_or_mcr STREQUAL "UNKNOWN") if(MATLAB_FIND_DEBUG) message(WARNING "[MATLAB] Determining Matlab or MCR") endif() @@ -1134,10 +1138,10 @@ function(_Matlab_get_version_from_root matlab_root matlab_or_mcr matlab_known_ve # default fallback to Matlab set(matlab_or_mcr "MATLAB") - if(NOT "${CMAKE_MATCH_1}" STREQUAL "") + if(NOT CMAKE_MATCH_1 STREQUAL "") string(TOLOWER "${CMAKE_MATCH_1}" product_reg_match) - if("${product_reg_match}" STREQUAL "matlab runtime") + if(product_reg_match STREQUAL "matlab runtime") set(matlab_or_mcr "MCR") endif() endif() @@ -1151,7 +1155,7 @@ function(_Matlab_get_version_from_root matlab_root matlab_or_mcr matlab_known_ve # UNKNOWN is the default behaviour in case we # - have an erroneous matlab_root # - have an initial 'UNKNOWN' - if("${matlab_or_mcr}" STREQUAL "MATLAB" OR "${matlab_or_mcr}" STREQUAL "UNKNOWN") + if(matlab_or_mcr STREQUAL "MATLAB" OR matlab_or_mcr STREQUAL "UNKNOWN") # MATLAB versions set(_matlab_current_program ${Matlab_MAIN_PROGRAM}) @@ -1203,7 +1207,7 @@ function(_Matlab_get_version_from_root matlab_root matlab_or_mcr matlab_known_ve matlab_get_version_from_matlab_run("${Matlab_PROG_VERSION_STRING_AUTO_DETECT}" matlab_list_of_all_versions) list(LENGTH matlab_list_of_all_versions list_of_all_versions_length) - if(${list_of_all_versions_length} GREATER 0) + if(list_of_all_versions_length GREATER 0) list(GET matlab_list_of_all_versions 0 _matlab_version_tmp) else() set(_matlab_version_tmp "unknown") @@ -1213,7 +1217,7 @@ function(_Matlab_get_version_from_root matlab_root matlab_or_mcr matlab_known_ve set(Matlab_VERSION_STRING_INTERNAL ${_matlab_version_tmp} CACHE INTERNAL "Matlab version (automatically determined)" FORCE) # warning, just in case several versions found (should not happen) - if((${list_of_all_versions_length} GREATER 1) AND MATLAB_FIND_DEBUG) + if((list_of_all_versions_length GREATER 1) AND MATLAB_FIND_DEBUG) message(WARNING "[MATLAB] Found several versions, taking the first one (versions found ${matlab_list_of_all_versions})") endif() @@ -1233,10 +1237,8 @@ function(_Matlab_get_version_from_root matlab_root matlab_or_mcr matlab_known_ve ${versioninfo_string} ) - if(NOT "${version_reg_match}" STREQUAL "") - if("${CMAKE_MATCH_1}" MATCHES "(([0-9])\\.([0-9]))[\\.0-9]*") - set(_matlab_version_tmp "${CMAKE_MATCH_1}") - endif() + if(CMAKE_MATCH_1 MATCHES "(([0-9])\\.([0-9]))[\\.0-9]*") + set(_matlab_version_tmp "${CMAKE_MATCH_1}") endif() endif() set(${matlab_final_version} "${_matlab_version_tmp}" PARENT_SCOPE) @@ -1615,8 +1617,7 @@ list(APPEND _matlab_required_variables Matlab_MEX_EXTENSION) list(APPEND _matlab_required_variables Matlab_ROOT_DIR) # component Mex Compiler -list(FIND Matlab_FIND_COMPONENTS MEX_COMPILER _matlab_find_mex_compiler) -if(_matlab_find_mex_compiler GREATER -1) +if("MEX_COMPILER" IN_LIST Matlab_FIND_COMPONENTS) find_program( Matlab_MEX_COMPILER "mex" @@ -1628,11 +1629,9 @@ if(_matlab_find_mex_compiler GREATER -1) set(Matlab_MEX_COMPILER_FOUND TRUE) endif() endif() -unset(_matlab_find_mex_compiler) # component Matlab program -list(FIND Matlab_FIND_COMPONENTS MAIN_PROGRAM _matlab_find_matlab_program) -if(_matlab_find_matlab_program GREATER -1) +if("MAIN_PROGRAM" IN_LIST Matlab_FIND_COMPONENTS) find_program( Matlab_MAIN_PROGRAM matlab @@ -1644,7 +1643,6 @@ if(_matlab_find_matlab_program GREATER -1) set(Matlab_MAIN_PROGRAM_FOUND TRUE) endif() endif() -unset(_matlab_find_matlab_program) # The MX library is required _Matlab_find_library( @@ -1792,3 +1790,5 @@ if(Matlab_INCLUDE_DIRS AND Matlab_LIBRARIES) Matlab_MEX_EXTENSION ) endif() + +cmake_policy(POP) https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=51bcdeb17fc2bde72850507a2ee7b35493c2067b commit 51bcdeb17fc2bde72850507a2ee7b35493c2067b Author: Rolf Eike Beer AuthorDate: Mon Jun 24 16:07:38 2019 +0200 Commit: Rolf Eike Beer CommitDate: Mon Jun 24 18:33:43 2019 +0200 Tests: simplify checks for Matlab variables being set diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 920af04..4fab127 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -1591,16 +1591,16 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH # CMake_TEST_FindMatlab_ROOT_DIR: indicates an optional root directory for Matlab, allows to select a version. # CMake_TEST_FindMatlab_MCR: indicates the MCR is installed # CMake_TEST_FindMatlab_MCR_ROOT_DIR: indicates an optional root directory for the MCR, required on Linux - if(CMake_TEST_FindMatlab OR (NOT "${CMake_TEST_FindMatlab_ROOT_DIR}" STREQUAL "") OR - CMake_TEST_FindMatlab_MCR OR (NOT "${CMake_TEST_FindMatlab_MCR_ROOT_DIR}" STREQUAL "")) + if(CMake_TEST_FindMatlab OR CMake_TEST_FindMatlab_ROOT_DIR OR + CMake_TEST_FindMatlab_MCR OR CMake_TEST_FindMatlab_MCR_ROOT_DIR) set(FindMatlab_additional_test_options ) - if(CMake_TEST_FindMatlab_MCR OR NOT "${CMake_TEST_FindMatlab_MCR_ROOT_DIR}" STREQUAL "") + if(CMake_TEST_FindMatlab_MCR OR CMake_TEST_FindMatlab_MCR_ROOT_DIR) set(FindMatlab_additional_test_options -DIS_MCR=TRUE) endif() - if(NOT "${CMake_TEST_FindMatlab_ROOT_DIR}" STREQUAL "") + if(CMake_TEST_FindMatlab_ROOT_DIR) set(FindMatlab_additional_test_options ${FindMatlab_additional_test_options} "-DMatlab_ROOT_DIR=${CMake_TEST_FindMatlab_ROOT_DIR}") endif() - if(NOT "${CMake_TEST_FindMatlab_MCR_ROOT_DIR}" STREQUAL "") + if(CMake_TEST_FindMatlab_MCR_ROOT_DIR) set(FindMatlab_additional_test_options ${FindMatlab_additional_test_options} "-DMCR_ROOT:FILEPATH=${CMake_TEST_FindMatlab_MCR_ROOT_DIR}") endif() set(FindMatlab.basic_checks_BUILD_OPTIONS ${FindMatlab_additional_test_options}) https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5e52de7d5708c5d2faf00837bf5f10ed024cced1 commit 5e52de7d5708c5d2faf00837bf5f10ed024cced1 Author: Alex Turbov AuthorDate: Fri Jun 21 03:41:48 2019 +0300 Commit: Brad King CommitDate: Mon Jun 24 09:36:09 2019 -0400 modermize: replace some raw pointers w/ `unique_ptr` diff --git a/Source/cmComputeLinkDepends.cxx b/Source/cmComputeLinkDepends.cxx index 186deb6..a7618c7 100644 --- a/Source/cmComputeLinkDepends.cxx +++ b/Source/cmComputeLinkDepends.cxx @@ -202,7 +202,6 @@ cmComputeLinkDepends::cmComputeLinkDepends(const cmGeneratorTarget* target, cmComputeLinkDepends::~cmComputeLinkDepends() { cmDeleteAll(this->InferredDependSets); - delete this->CCG; } void cmComputeLinkDepends::SetOldLinkDirMode(bool b) @@ -632,7 +631,8 @@ void cmComputeLinkDepends::OrderLinkEntires() // the same order in which the items were originally discovered in // the BFS. This should preserve the original order when no // constraints disallow it. - this->CCG = new cmComputeComponentGraph(this->EntryConstraintGraph); + this->CCG = + cm::make_unique(this->EntryConstraintGraph); // The component graph is guaranteed to be acyclic. Start a DFS // from every entry to compute a topological order for the diff --git a/Source/cmComputeLinkDepends.h b/Source/cmComputeLinkDepends.h index dfaaf8b..0b1f00c 100644 --- a/Source/cmComputeLinkDepends.h +++ b/Source/cmComputeLinkDepends.h @@ -137,7 +137,7 @@ private: std::set Entries; }; std::map PendingComponents; - cmComputeComponentGraph* CCG; + std::unique_ptr CCG; std::vector FinalLinkOrder; void DisplayComponents(); void VisitComponent(unsigned int c); diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index df0f33f..b250dd7 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -92,7 +92,6 @@ cmGlobalGenerator::cmGlobalGenerator(cmake* cm) // how long to let try compiles run this->TryCompileTimeout = cmDuration::zero(); - this->ExtraGenerator = nullptr; this->CurrentConfigureMakefile = nullptr; this->TryCompileOuterMakefile = nullptr; @@ -113,7 +112,6 @@ cmGlobalGenerator::cmGlobalGenerator(cmake* cm) cmGlobalGenerator::~cmGlobalGenerator() { this->ClearGeneratorMembers(); - delete this->ExtraGenerator; } #if defined(CMAKE_BUILD_WITH_CMAKE) @@ -1499,7 +1497,7 @@ void cmGlobalGenerator::Generate() this->WriteSummary(); - if (this->ExtraGenerator != nullptr) { + if (this->ExtraGenerator) { this->ExtraGenerator->Generate(); } @@ -2720,8 +2718,8 @@ bool cmGlobalGenerator::IsReservedTarget(std::string const& name) void cmGlobalGenerator::SetExternalMakefileProjectGenerator( cmExternalMakefileProjectGenerator* extraGenerator) { - this->ExtraGenerator = extraGenerator; - if (this->ExtraGenerator != nullptr) { + this->ExtraGenerator.reset(extraGenerator); + if (this->ExtraGenerator) { this->ExtraGenerator->SetGlobalGenerator(this); } } diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index db96489..7fd5433 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -618,7 +618,7 @@ private: void ComputeBuildFileGenerators(); - cmExternalMakefileProjectGenerator* ExtraGenerator; + std::unique_ptr ExtraGenerator; // track files replaced during a Generate std::vector FilesReplacedDuringGenerate; diff --git a/Source/cmMachO.cxx b/Source/cmMachO.cxx index d4af1e0..ac6dce9 100644 --- a/Source/cmMachO.cxx +++ b/Source/cmMachO.cxx @@ -2,9 +2,9 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmMachO.h" +#include "cmAlgorithms.h" #include "cmsys/FStream.hxx" -#include -#include +#include #include #include @@ -120,7 +120,7 @@ protected: // Implementation for reading Mach-O header and load commands. // This is 32 or 64 bit arch specific. -template +template class cmMachOHeaderAndLoadCommandsImpl : public cmMachOHeaderAndLoadCommands { public: @@ -306,15 +306,11 @@ bool cmMachOInternal::read_mach_o(uint32_t file_offset) // External class implementation. cmMachO::cmMachO(const char* fname) - : Internal(nullptr) + : Internal(cm::make_unique(fname)) { - this->Internal = new cmMachOInternal(fname); } -cmMachO::~cmMachO() -{ - delete this->Internal; -} +cmMachO::~cmMachO() = default; std::string const& cmMachO::GetErrorMessage() const { diff --git a/Source/cmMachO.h b/Source/cmMachO.h index 5482465..0c44b55 100644 --- a/Source/cmMachO.h +++ b/Source/cmMachO.h @@ -41,7 +41,7 @@ public: private: friend class cmMachOInternal; bool Valid() const; - cmMachOInternal* Internal; + std::unique_ptr Internal; }; #endif diff --git a/Source/cmState.cxx b/Source/cmState.cxx index 091c2e0..587cda5 100644 --- a/Source/cmState.cxx +++ b/Source/cmState.cxx @@ -23,14 +23,12 @@ cmState::cmState() { - this->CacheManager = new cmCacheManager; - this->GlobVerificationManager = new cmGlobVerificationManager; + this->CacheManager = cm::make_unique(); + this->GlobVerificationManager = cm::make_unique(); } cmState::~cmState() { - delete this->CacheManager; - delete this->GlobVerificationManager; cmDeleteAll(this->BuiltinCommands); cmDeleteAll(this->ScriptedCommands); } diff --git a/Source/cmState.h b/Source/cmState.h index 6abe71c..accd838 100644 --- a/Source/cmState.h +++ b/Source/cmState.h @@ -211,8 +211,8 @@ private: std::map BuiltinCommands; std::map ScriptedCommands; cmPropertyMap GlobalProperties; - cmCacheManager* CacheManager; - cmGlobVerificationManager* GlobVerificationManager; + std::unique_ptr CacheManager; + std::unique_ptr GlobVerificationManager; cmLinkedTree BuildsystemDirectory; diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 3772f09..8f2f86d 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -141,12 +141,12 @@ cmake::cmake(Role role, cmState::Mode mode) this->DebugOutput = false; this->DebugTryCompile = false; this->ClearBuildSystem = false; - this->FileTimeCache = new cmFileTimeCache; + this->FileTimeCache = cm::make_unique(); - this->State = new cmState; + this->State = cm::make_unique(); this->State->SetMode(mode); this->CurrentSnapshot = this->State->CreateBaseSnapshot(); - this->Messenger = new cmMessenger; + this->Messenger = cm::make_unique(); #ifdef __APPLE__ struct rlimit rlp; @@ -165,7 +165,7 @@ cmake::cmake(Role role, cmState::Mode mode) this->CurrentWorkingMode = NORMAL_MODE; #ifdef CMAKE_BUILD_WITH_CMAKE - this->VariableWatch = new cmVariableWatch; + this->VariableWatch = cm::make_unique(); #endif this->AddDefaultGenerators(); @@ -222,17 +222,11 @@ cmake::cmake(Role role, cmState::Mode mode) cmake::~cmake() { - delete this->State; - delete this->Messenger; if (this->GlobalGenerator) { delete this->GlobalGenerator; this->GlobalGenerator = nullptr; } cmDeleteAll(this->Generators); -#ifdef CMAKE_BUILD_WITH_CMAKE - delete this->VariableWatch; -#endif - delete this->FileTimeCache; } #if defined(CMAKE_BUILD_WITH_CMAKE) @@ -460,7 +454,7 @@ bool cmake::SetCacheArgs(const std::vector& args) return false; } // Register fake project commands that hint misuse in script mode. - GetProjectCommandsInScriptMode(this->State); + GetProjectCommandsInScriptMode(this->GetState()); this->ReadListFile(args, path); } else if (arg.find("--find-package", 0) == 0) { findPackageMode = true; @@ -1898,12 +1892,12 @@ const char* cmake::GetCacheDefinition(const std::string& name) const void cmake::AddScriptingCommands() { - GetScriptingCommands(this->State); + GetScriptingCommands(this->GetState()); } void cmake::AddProjectCommands() { - GetProjectCommands(this->State); + GetProjectCommands(this->GetState()); } void cmake::AddDefaultGenerators() @@ -2607,11 +2601,6 @@ std::vector cmake::GetDebugConfigs() return configs; } -cmMessenger* cmake::GetMessenger() const -{ - return this->Messenger; -} - int cmake::Build(int jobs, const std::string& dir, const std::vector& targets, const std::string& config, diff --git a/Source/cmake.h b/Source/cmake.h index fa4409a..e14a081 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -307,7 +307,7 @@ public: #if defined(CMAKE_BUILD_WITH_CMAKE) //! Get the variable watch object - cmVariableWatch* GetVariableWatch() { return this->VariableWatch; } + cmVariableWatch* GetVariableWatch() { return this->VariableWatch.get(); } #endif std::vector GetGeneratorsDocumentation(); @@ -348,18 +348,18 @@ public: /** * Get the file comparison class */ - cmFileTimeCache* GetFileTimeCache() { return this->FileTimeCache; } + cmFileTimeCache* GetFileTimeCache() { return this->FileTimeCache.get(); } - // Get the selected log level for `message()` commands during the cmake run. + //! Get the selected log level for `message()` commands during the cmake run. LogLevel GetLogLevel() const { return this->MessageLogLevel; } void SetLogLevel(LogLevel level) { this->MessageLogLevel = level; } static LogLevel StringToLogLevel(const std::string& levelStr); - // Do we want debug output during the cmake run. + //! Do we want debug output during the cmake run. bool GetDebugOutput() { return this->DebugOutput; } void SetDebugOutputOn(bool b) { this->DebugOutput = b; } - // Do we want trace output during the cmake run. + //! Do we want trace output during the cmake run. bool GetTrace() { return this->Trace; } void SetTrace(bool b) { this->Trace = b; } bool GetTraceExpand() { return this->TraceExpand; } @@ -396,31 +396,31 @@ public: return this->CMakeEditCommand; } - cmMessenger* GetMessenger() const; + cmMessenger* GetMessenger() const { return this->Messenger.get(); } - /* + /** * Get the state of the suppression of developer (author) warnings. * Returns false, by default, if developer warnings should be shown, true * otherwise. */ bool GetSuppressDevWarnings() const; - /* + /** * Set the state of the suppression of developer (author) warnings. */ void SetSuppressDevWarnings(bool v); - /* + /** * Get the state of the suppression of deprecated warnings. * Returns false, by default, if deprecated warnings should be shown, true * otherwise. */ bool GetSuppressDeprecatedWarnings() const; - /* + /** * Set the state of the suppression of deprecated warnings. */ void SetSuppressDeprecatedWarnings(bool v); - /* + /** * Get the state of treating developer (author) warnings as errors. * Returns false, by default, if warnings should not be treated as errors, * true otherwise. @@ -431,7 +431,7 @@ public: */ void SetDevWarningsAsErrors(bool v); - /* + /** * Get the state of treating deprecated warnings as errors. * Returns false, by default, if warnings should not be treated as errors, * true otherwise. @@ -459,7 +459,7 @@ public: void UnwatchUnusedCli(const std::string& var); void WatchUnusedCli(const std::string& var); - cmState* GetState() const { return this->State; } + cmState* GetState() const { return this->State.get(); } void SetCurrentSnapshot(cmStateSnapshot const& snapshot) { this->CurrentSnapshot = snapshot; @@ -537,18 +537,18 @@ private: std::unordered_set HeaderFileExtensionsSet; bool ClearBuildSystem; bool DebugTryCompile; - cmFileTimeCache* FileTimeCache; + std::unique_ptr FileTimeCache; std::string GraphVizFile; InstalledFilesMap InstalledFiles; #if defined(CMAKE_BUILD_WITH_CMAKE) - cmVariableWatch* VariableWatch; + std::unique_ptr VariableWatch; std::unique_ptr FileAPI; #endif - cmState* State; + std::unique_ptr State; cmStateSnapshot CurrentSnapshot; - cmMessenger* Messenger; + std::unique_ptr Messenger; std::vector TraceOnlyThisSources; @@ -556,7 +556,7 @@ private: void UpdateConversionPathTable(); - // Print a list of valid generators to stderr. + //! Print a list of valid generators to stderr. void PrintGeneratorList(); std::unique_ptr EvaluateDefaultGlobalGenerator(); ----------------------------------------------------------------------- Summary of changes: Modules/FindMatlab.cmake | 50 ++++++++++++++++++++--------------------- Source/cmComputeLinkDepends.cxx | 4 ++-- Source/cmComputeLinkDepends.h | 2 +- Source/cmGlobalGenerator.cxx | 8 +++---- Source/cmGlobalGenerator.h | 2 +- Source/cmMachO.cxx | 14 +++++------- Source/cmMachO.h | 2 +- Source/cmState.cxx | 6 ++--- Source/cmState.h | 4 ++-- Source/cmake.cxx | 25 ++++++--------------- Source/cmake.h | 36 ++++++++++++++--------------- Tests/CMakeLists.txt | 10 ++++----- 12 files changed, 72 insertions(+), 91 deletions(-) hooks/post-receive -- CMake From kwrobot at kitware.com Tue Jun 25 11:03:02 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Tue, 25 Jun 2019 11:03:02 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc2-145-gd2ac3e3 Message-ID: <20190625150302.5BF7C1032DD@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via d2ac3e3e59c8bb9955e65b3964857c58f4ef208a (commit) via dc764bd80d809ff1fe70324bf5c1ac2da27e5177 (commit) from 1009fd18604e7670838ed28798b83312eff1b0f0 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d2ac3e3e59c8bb9955e65b3964857c58f4ef208a commit d2ac3e3e59c8bb9955e65b3964857c58f4ef208a Merge: 1009fd1 dc764bd Author: Kyle Edwards AuthorDate: Tue Jun 25 15:02:04 2019 +0000 Commit: Kitware Robot CommitDate: Tue Jun 25 11:02:13 2019 -0400 Merge topic 'fix-cmp0095-notes' dc764bd80d Help: Move CMP0095 into CMake 3.16 section Acked-by: Kitware Robot Merge-request: !3479 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=dc764bd80d809ff1fe70324bf5c1ac2da27e5177 commit dc764bd80d809ff1fe70324bf5c1ac2da27e5177 Author: Kyle Edwards AuthorDate: Tue Jun 25 09:56:20 2019 -0400 Commit: Kyle Edwards CommitDate: Tue Jun 25 09:56:20 2019 -0400 Help: Move CMP0095 into CMake 3.16 section CMP0095 was introduced in 3.16, but was mistakenly put in the notes for 3.15. This error was not caught during review. Move it into the notes for 3.16. diff --git a/Help/manual/cmake-policies.7.rst b/Help/manual/cmake-policies.7.rst index bac1c6c..d7207e1 100644 --- a/Help/manual/cmake-policies.7.rst +++ b/Help/manual/cmake-policies.7.rst @@ -51,13 +51,20 @@ The :variable:`CMAKE_MINIMUM_REQUIRED_VERSION` variable may also be used to determine whether to report an error on use of deprecated macros or functions. -Policies Introduced by CMake 3.15 +Policies Introduced by CMake 3.16 ================================= .. toctree:: :maxdepth: 1 CMP0095: RPATH entries are properly escaped in the intermediary CMake install script. + +Policies Introduced by CMake 3.15 +================================= + +.. toctree:: + :maxdepth: 1 + CMP0094: FindPython3, FindPython2 and FindPython use LOCATION for lookup strategy. CMP0093: FindBoost reports Boost_VERSION in x.y.z format. CMP0092: MSVC warning flags are not in CMAKE_{C,CXX}_FLAGS by default. ----------------------------------------------------------------------- Summary of changes: Help/manual/cmake-policies.7.rst | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) hooks/post-receive -- CMake From kwrobot at kitware.com Wed Jun 26 00:03:04 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Wed, 26 Jun 2019 00:03:04 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc2-146-gb598c64 Message-ID: <20190626040304.5F429FACA5@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via b598c64954ac33cc590ab99a3561ed0e806c3536 (commit) from d2ac3e3e59c8bb9955e65b3964857c58f4ef208a (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b598c64954ac33cc590ab99a3561ed0e806c3536 commit b598c64954ac33cc590ab99a3561ed0e806c3536 Author: Kitware Robot AuthorDate: Wed Jun 26 00:01:07 2019 -0400 Commit: Kitware Robot CommitDate: Wed Jun 26 00:01:07 2019 -0400 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 4517bdf..a054b11 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 15) -set(CMake_VERSION_PATCH 20190625) +set(CMake_VERSION_PATCH 20190626) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From kwrobot at kitware.com Wed Jun 26 07:03:03 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Wed, 26 Jun 2019 07:03:03 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc2-152-gc864765 Message-ID: <20190626110303.B125210AB63@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via c86476549653f9915a4b9f4cc32d3e569f959d38 (commit) via b51b6cc5721779db6bcd9273db6ad2bf40e40c94 (commit) via d7d282cd89d0da0a9f192868eb5028c4a3f72587 (commit) via eda4c43879522438622ad75a5204666011198203 (commit) via 736f38ff3434e168a5548d3d2a0897934fa5de9a (commit) via f57a53d43e1ec693fdbb749fc279fc79f33a8866 (commit) from b598c64954ac33cc590ab99a3561ed0e806c3536 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c86476549653f9915a4b9f4cc32d3e569f959d38 commit c86476549653f9915a4b9f4cc32d3e569f959d38 Merge: b51b6cc eda4c43 Author: Brad King AuthorDate: Wed Jun 26 11:00:55 2019 +0000 Commit: Kitware Robot CommitDate: Wed Jun 26 07:02:11 2019 -0400 Merge topic 'ninja-nvcc-rsp' eda4c43879 Ninja: Fix CUDA device linking when using response files Acked-by: Kitware Robot Merge-request: !3482 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b51b6cc5721779db6bcd9273db6ad2bf40e40c94 commit b51b6cc5721779db6bcd9273db6ad2bf40e40c94 Merge: d7d282c 736f38f Author: Brad King AuthorDate: Wed Jun 26 10:59:38 2019 +0000 Commit: Kitware Robot CommitDate: Wed Jun 26 07:00:41 2019 -0400 Merge topic 'iconv-c++11' 736f38ff34 FindIconv test: request C++11 Acked-by: Kitware Robot Merge-request: !3469 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d7d282cd89d0da0a9f192868eb5028c4a3f72587 commit d7d282cd89d0da0a9f192868eb5028c4a3f72587 Merge: b598c64 f57a53d Author: Brad King AuthorDate: Wed Jun 26 10:59:10 2019 +0000 Commit: Kitware Robot CommitDate: Wed Jun 26 06:59:33 2019 -0400 Merge topic 'doc-CMAKE_FRAMEWORK-crossref' f57a53d43e Help: Document that CMAKE_FRAMEWORK initializes FRAMEWORK target prop Acked-by: Kitware Robot Merge-request: !3478 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=eda4c43879522438622ad75a5204666011198203 commit eda4c43879522438622ad75a5204666011198203 Author: Francisco Facioni AuthorDate: Tue Jun 25 17:59:08 2019 +0100 Commit: Brad King CommitDate: Tue Jun 25 14:30:36 2019 -0400 Ninja: Fix CUDA device linking when using response files Fix the logic added by commit d91b5a72cd (Ninja: Add support for CUDA nvcc response files, 2019-05-30, v3.15.0-rc1~8^2) to always use the CUDA compiler response file flag for response files during device linking. diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index 7ad8ab3..f65abc8 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -171,20 +171,9 @@ void cmNinjaNormalTargetGenerator::WriteDeviceLinkRule(bool useResponseFile) vars.Language = "CUDA"; - std::string responseFlag; - - std::string cmakeVarLang = "CMAKE_"; - cmakeVarLang += this->TargetLinkLanguage; - // build response file name - std::string cmakeLinkVar = cmakeVarLang + "_RESPONSE_FILE_LINK_FLAG"; - const char* flag = GetMakefile()->GetDefinition(cmakeLinkVar); - - if (flag) { - responseFlag = flag; - } else if (this->TargetLinkLanguage != "CUDA") { - responseFlag = "@"; - } + std::string responseFlag = this->GetMakefile()->GetSafeDefinition( + "CMAKE_CUDA_RESPONSE_FILE_LINK_FLAG"); if (!useResponseFile || responseFlag.empty()) { vars.Objects = "$in"; https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=736f38ff3434e168a5548d3d2a0897934fa5de9a commit 736f38ff3434e168a5548d3d2a0897934fa5de9a Author: Rolf Eike Beer AuthorDate: Mon Jun 24 13:18:31 2019 +0200 Commit: Rolf Eike Beer CommitDate: Tue Jun 25 15:14:02 2019 +0200 FindIconv test: request C++11 diff --git a/Tests/FindIconv/Test/CMakeLists.txt b/Tests/FindIconv/Test/CMakeLists.txt index c59adb3..a6243f5 100644 --- a/Tests/FindIconv/Test/CMakeLists.txt +++ b/Tests/FindIconv/Test/CMakeLists.txt @@ -6,9 +6,11 @@ find_package(Iconv REQUIRED) add_executable(test_iconv_tgt main.cxx) target_link_libraries(test_iconv_tgt Iconv::Iconv) +target_compile_features(test_iconv_tgt PRIVATE cxx_std_11) add_test(NAME test_iconv_tgt COMMAND test_iconv_tgt) add_executable(test_iconv_var main.cxx) target_include_directories(test_iconv_var PRIVATE ${Iconv_INCLUDE_DIRS}) target_link_libraries(test_iconv_var PRIVATE ${Iconv_LIBRARIES}) +target_compile_features(test_iconv_var PRIVATE cxx_std_11) add_test(NAME test_iconv_var COMMAND test_iconv_var) https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f57a53d43e1ec693fdbb749fc279fc79f33a8866 commit f57a53d43e1ec693fdbb749fc279fc79f33a8866 Author: Craig Scott AuthorDate: Tue Jun 25 21:57:31 2019 +1000 Commit: Craig Scott CommitDate: Tue Jun 25 21:57:31 2019 +1000 Help: Document that CMAKE_FRAMEWORK initializes FRAMEWORK target prop diff --git a/Help/prop_tgt/FRAMEWORK.rst b/Help/prop_tgt/FRAMEWORK.rst index 9dad060..3dff1be 100644 --- a/Help/prop_tgt/FRAMEWORK.rst +++ b/Help/prop_tgt/FRAMEWORK.rst @@ -6,7 +6,9 @@ Build ``SHARED`` or ``STATIC`` library as Framework Bundle on the macOS and iOS. If such a library target has this property set to ``TRUE`` it will be built as a framework when built on the macOS and iOS. It will have the directory structure required for a framework and will be suitable to -be used with the ``-framework`` option +be used with the ``-framework`` option. This property is initialized by the +value of the :variable:`CMAKE_FRAMEWORK` variable if it is set when a target is +created. To customize ``Info.plist`` file in the framework, use :prop_tgt:`MACOSX_FRAMEWORK_INFO_PLIST` target property. ----------------------------------------------------------------------- Summary of changes: Help/prop_tgt/FRAMEWORK.rst | 4 +++- Source/cmNinjaNormalTargetGenerator.cxx | 15 ++------------- Tests/FindIconv/Test/CMakeLists.txt | 2 ++ 3 files changed, 7 insertions(+), 14 deletions(-) hooks/post-receive -- CMake From kwrobot at kitware.com Wed Jun 26 07:13:07 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Wed, 26 Jun 2019 07:13:07 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc2-169-g1e26306 Message-ID: <20190626111307.11C4B112098@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 1e263065e12435ade250d83ab04e61c4453b12fe (commit) via c92f5f6a7325c8a6c3b07d7a36a94c474d7ea977 (commit) via d770b9521292a9dbb6a2d20e4779afa379b79699 (commit) via 119643f630a4f5b710b6c88abab9f85490bc6286 (commit) via 2919f65c2463c168c5a054e48a99a51dcdb86f60 (commit) via b39d240f5dbb3e7bcc07ad1b158a8ef8172bfe78 (commit) via 30eee7702f5fdd331fec80539b6c33ba36652aaa (commit) via 2bbbc4ce1ff7d7d0cbbdc1d89cff023b754cc35f (commit) via edec1c261519525acd01ad67192f777fa071c50b (commit) via 2ba5c37b3fed00ecc307b1d93780acd4a57695eb (commit) via 7113b943463d4a9c9df7d7385856394cbcfe8de7 (commit) via 1ff1f757182139914aa2d3d4e51509ef89f48241 (commit) via 9334a4b472234e24969555f191e09302cf725265 (commit) via e28240ea1f2d296f99474bb6a709a6d4d7bb1cfa (commit) via c2595a4958963e3cdd5276420a15a7735176c50d (commit) via 39c572c9c932802595eb50594e24c961cfa1151b (commit) via f68492912c11f10724518896d87555b82fec894a (commit) from c86476549653f9915a4b9f4cc32d3e569f959d38 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1e263065e12435ade250d83ab04e61c4453b12fe commit 1e263065e12435ade250d83ab04e61c4453b12fe Merge: c92f5f6 39c572c Author: Brad King AuthorDate: Wed Jun 26 11:12:01 2019 +0000 Commit: Kitware Robot CommitDate: Wed Jun 26 07:12:24 2019 -0400 Merge topic 'findmpi_use_interface_link_options' 39c572c9c9 FindMPI: Updated to use INTERFACE_LINK_OPTIONS Acked-by: Kitware Robot Merge-request: !3476 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c92f5f6a7325c8a6c3b07d7a36a94c474d7ea977 commit c92f5f6a7325c8a6c3b07d7a36a94c474d7ea977 Merge: d770b95 c2595a4 Author: Brad King AuthorDate: Wed Jun 26 11:11:27 2019 +0000 Commit: Kitware Robot CommitDate: Wed Jun 26 07:11:34 2019 -0400 Merge topic 'FindMatlab/issue-19279-mex-compilation-error-on-attribute' c2595a4958 FindMatlab: removing spaces in compiler define Acked-by: Kitware Robot Merge-request: !3473 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d770b9521292a9dbb6a2d20e4779afa379b79699 commit d770b9521292a9dbb6a2d20e4779afa379b79699 Merge: 119643f e28240e Author: Brad King AuthorDate: Wed Jun 26 11:09:20 2019 +0000 Commit: Kitware Robot CommitDate: Wed Jun 26 07:10:43 2019 -0400 Merge topic 'protobuf-c++11' e28240ea1f FindProtobuf: C++11 support is required since version 3.6.0 Acked-by: Kitware Robot Merge-request: !3470 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=119643f630a4f5b710b6c88abab9f85490bc6286 commit 119643f630a4f5b710b6c88abab9f85490bc6286 Merge: 2919f65 f684929 Author: Brad King AuthorDate: Wed Jun 26 11:09:05 2019 +0000 Commit: Kitware Robot CommitDate: Wed Jun 26 07:09:34 2019 -0400 Merge topic 'find-testlist' f68492912c Tests: reduce code duplication for CMake_TEST_Find* Acked-by: Kitware Robot Merge-request: !3471 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2919f65c2463c168c5a054e48a99a51dcdb86f60 commit 2919f65c2463c168c5a054e48a99a51dcdb86f60 Merge: b39d240 1ff1f75 Author: Brad King AuthorDate: Wed Jun 26 11:08:27 2019 +0000 Commit: Kitware Robot CommitDate: Wed Jun 26 07:08:36 2019 -0400 Merge topic 'fix-xcode6-compilation' 1ff1f75718 Fix Xcode 6.1.1 compilation issue Acked-by: Kitware Robot Merge-request: !3480 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b39d240f5dbb3e7bcc07ad1b158a8ef8172bfe78 commit b39d240f5dbb3e7bcc07ad1b158a8ef8172bfe78 Merge: 30eee77 2bbbc4c Author: Brad King AuthorDate: Wed Jun 26 07:06:30 2019 -0400 Commit: Brad King CommitDate: Wed Jun 26 07:06:30 2019 -0400 Merge branch 'release-3.15' https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=30eee7702f5fdd331fec80539b6c33ba36652aaa commit 30eee7702f5fdd331fec80539b6c33ba36652aaa Merge: c864765 2ba5c37 Author: Brad King AuthorDate: Wed Jun 26 11:00:14 2019 +0000 Commit: Kitware Robot CommitDate: Wed Jun 26 07:03:25 2019 -0400 Merge topic 'export-targets-empty' 2ba5c37b3f export: Restore support for empty TARGETS list Acked-by: Kitware Robot Merge-request: !3484 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1ff1f757182139914aa2d3d4e51509ef89f48241 commit 1ff1f757182139914aa2d3d4e51509ef89f48241 Author: Raffi Enficiaud AuthorDate: Tue Jun 25 17:13:45 2019 +0200 Commit: Raffi Enficiaud CommitDate: Tue Jun 25 17:34:56 2019 +0200 Fix Xcode 6.1.1 compilation issue diff --git a/Source/cmRuntimeDependencyArchive.cxx b/Source/cmRuntimeDependencyArchive.cxx index b4c6c32..a1d1f95 100644 --- a/Source/cmRuntimeDependencyArchive.cxx +++ b/Source/cmRuntimeDependencyArchive.cxx @@ -342,10 +342,7 @@ void cmRuntimeDependencyArchive::AddResolvedPath(const std::string& name, const std::string& path, bool& unique) { - auto it = - this->ResolvedPaths - .insert(std::pair>{ name, {} }) - .first; + auto it = this->ResolvedPaths.emplace(name, std::set{}).first; unique = true; for (auto const& other : it->second) { if (cmSystemTools::SameFile(path, other)) { https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e28240ea1f2d296f99474bb6a709a6d4d7bb1cfa commit e28240ea1f2d296f99474bb6a709a6d4d7bb1cfa Author: Rolf Eike Beer AuthorDate: Mon Jun 24 13:30:18 2019 +0200 Commit: Rolf Eike Beer CommitDate: Tue Jun 25 15:22:01 2019 +0200 FindProtobuf: C++11 support is required since version 3.6.0 diff --git a/Modules/FindProtobuf.cmake b/Modules/FindProtobuf.cmake index 76bc873..085e96c 100644 --- a/Modules/FindProtobuf.cmake +++ b/Modules/FindProtobuf.cmake @@ -521,6 +521,11 @@ if(Protobuf_INCLUDE_DIR) set_target_properties(protobuf::libprotobuf PROPERTIES IMPORTED_LOCATION_DEBUG "${Protobuf_LIBRARY_DEBUG}") endif() + if (Protobuf_VERSION VERSION_GREATER_EQUAL "3.6") + set_property(TARGET protobuf::libprotobuf APPEND PROPERTY + INTERFACE_COMPILE_FEATURES cxx_std_11 + ) + endif() if(UNIX AND TARGET Threads::Threads) set_property(TARGET protobuf::libprotobuf APPEND PROPERTY INTERFACE_LINK_LIBRARIES Threads::Threads) https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c2595a4958963e3cdd5276420a15a7735176c50d commit c2595a4958963e3cdd5276420a15a7735176c50d Author: Raffi Enficiaud AuthorDate: Mon Jun 24 20:17:47 2019 +0200 Commit: Brad King CommitDate: Tue Jun 25 07:24:01 2019 -0400 FindMatlab: removing spaces in compiler define Spaces in `DLL_EXPORT_SYM=__attribute__ ((visibility (\"default\")))` are causing a compilation error. Fixes: #19279 diff --git a/Modules/FindMatlab.cmake b/Modules/FindMatlab.cmake index 3547642..bcc7f67 100644 --- a/Modules/FindMatlab.cmake +++ b/Modules/FindMatlab.cmake @@ -1053,7 +1053,7 @@ function(matlab_add_mex) # This one is weird, it might be a bug in for R2018b. When compiling with # -fvisibility=hidden, the symbol `mexFunction` cannot be exported. Reading the # source code for , it seems that the preprocessor macro `MW_NEEDS_VERSION_H` - # needs to be defined for `__attribute__ ((visibility("default")))` to be added + # needs to be defined for `__attribute__((visibility("default")))` to be added # in front of the declaration of `mexFunction`. In previous versions of MATLAB this # was not the case, there `DLL_EXPORT_SYM` needed to be defined. # Adding `-fvisibility=hidden` to the `mex` command causes the build to fail. @@ -1089,11 +1089,13 @@ function(matlab_add_mex) set(_link_flags "${_link_flags} -Wl,${_export_flag_name},${_file}") endforeach() + # The `mex` command doesn't add this define. It is specified here in order + # to export the symbol in case the client code decides to hide its symbols set_target_properties(${${prefix}_NAME} PROPERTIES - DEFINE_SYMBOL "DLL_EXPORT_SYM=__attribute__ ((visibility (\"default\")))" + DEFINE_SYMBOL "DLL_EXPORT_SYM=__attribute__((visibility(\"default\")))" LINK_FLAGS "${_link_flags}" - ) # The `mex` command doesn't add this define. Is it necessary? + ) endif() https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=39c572c9c932802595eb50594e24c961cfa1151b commit 39c572c9c932802595eb50594e24c961cfa1151b Author: Robert Maynard AuthorDate: Mon Jun 24 16:45:44 2019 -0400 Commit: Robert Maynard CommitDate: Mon Jun 24 16:45:44 2019 -0400 FindMPI: Updated to use INTERFACE_LINK_OPTIONS diff --git a/Modules/FindMPI.cmake b/Modules/FindMPI.cmake index a80f799..fc9810c 100644 --- a/Modules/FindMPI.cmake +++ b/Modules/FindMPI.cmake @@ -1142,16 +1142,15 @@ macro(_MPI_create_imported_target LANG) set_property(TARGET MPI::MPI_${LANG} PROPERTY INTERFACE_COMPILE_DEFINITIONS "${MPI_${LANG}_COMPILE_DEFINITIONS}") - set_property(TARGET MPI::MPI_${LANG} PROPERTY INTERFACE_LINK_LIBRARIES "") if(MPI_${LANG}_LINK_FLAGS) separate_arguments(_MPI_${LANG}_LINK_FLAGS NATIVE_COMMAND "${MPI_${LANG}_LINK_FLAGS}") - set_property(TARGET MPI::MPI_${LANG} APPEND PROPERTY INTERFACE_LINK_LIBRARIES "${_MPI_${LANG}_LINK_FLAGS}") + set_property(TARGET MPI::MPI_${LANG} PROPERTY INTERFACE_LINK_OPTIONS "${_MPI_${LANG}_LINK_FLAGS}") unset(_MPI_${LANG}_LINK_FLAGS) endif() # If the compiler links MPI implicitly, no libraries will be found as they're contained within # CMAKE__IMPLICIT_LINK_LIBRARIES already. if(MPI_${LANG}_LIBRARIES) - set_property(TARGET MPI::MPI_${LANG} APPEND PROPERTY INTERFACE_LINK_LIBRARIES "${MPI_${LANG}_LIBRARIES}") + set_property(TARGET MPI::MPI_${LANG} PROPERTY INTERFACE_LINK_LIBRARIES "${MPI_${LANG}_LIBRARIES}") endif() # Given the new design of FindMPI, INCLUDE_DIRS will always be located, even under implicit linking. set_property(TARGET MPI::MPI_${LANG} PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${MPI_${LANG}_INCLUDE_DIRS}") https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f68492912c11f10724518896d87555b82fec894a commit f68492912c11f10724518896d87555b82fec894a Author: Rolf Eike Beer AuthorDate: Mon Jun 24 13:47:31 2019 +0200 Commit: Rolf Eike Beer CommitDate: Mon Jun 24 18:31:53 2019 +0200 Tests: reduce code duplication for CMake_TEST_Find* diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 920af04..50aff8b 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -1398,184 +1398,66 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH endif() endif() - if(CMake_TEST_FindALSA) - add_subdirectory(FindALSA) - endif() + # test for Find modules, simple cases + foreach(_mod IN ITEMS + ALSA + Boost + BZip2 + CURL + Cups + Doxygen + EnvModules + EXPAT + Fontconfig + Freetype + GDAL + GIF + Git + GLEW + GSL + GTK2 + Iconv + ICU + JPEG + JsonCpp + LibLZMA + LibRHash + Libinput + LibUV + LibXml2 + LTTngUST + ODBC + OpenCL + OpenGL + OpenMP + OpenSSL + MPI + PNG + Patch + PostgreSQL + Protobuf + SQLite3 + TIFF + Vulkan + X11 + XalanC + XercesC + ) + if(CMake_TEST_Find${_mod}) + add_subdirectory(Find${_mod}) + endif() + endforeach() if(CMake_TEST_CUDA) add_subdirectory(Cuda) add_subdirectory(CudaOnly) endif() - if(CMake_TEST_FindBoost) - add_subdirectory(FindBoost) - endif() - - if(CMake_TEST_FindBZip2) - add_subdirectory(FindBZip2) - endif() - - if(CMake_TEST_FindCURL) - add_subdirectory(FindCURL) - endif() - - if(CMake_TEST_FindCups) - add_subdirectory(FindCups) - endif() - - if(CMake_TEST_FindDoxygen) - add_subdirectory(FindDoxygen) - endif() - - if(CMake_TEST_FindEnvModules) - add_subdirectory(FindEnvModules) - endif() - - if(CMake_TEST_FindEXPAT) - add_subdirectory(FindEXPAT) - endif() - - if(CMake_TEST_FindFontconfig) - add_subdirectory(FindFontconfig) - endif() - - if(CMake_TEST_FindFreetype) - add_subdirectory(FindFreetype) - endif() - - if(CMake_TEST_FindGDAL) - add_subdirectory(FindGDAL) - endif() - - if(CMake_TEST_FindGIF) - add_subdirectory(FindGIF) - endif() - - if(CMake_TEST_FindGit) - add_subdirectory(FindGit) - endif() - - if(CMake_TEST_FindGLEW) - add_subdirectory(FindGLEW) - endif() - - if(CMake_TEST_FindGSL) - add_subdirectory(FindGSL) - endif() - if(CMake_TEST_FindGTest) add_subdirectory(FindGTest) add_subdirectory(GoogleTest) endif() - if(CMake_TEST_FindGTK2) - add_subdirectory(FindGTK2) - endif() - - if(CMake_TEST_FindIconv) - add_subdirectory(FindIconv) - endif() - - if(CMake_TEST_FindICU) - add_subdirectory(FindICU) - endif() - - if(CMake_TEST_FindJPEG) - add_subdirectory(FindJPEG) - endif() - - if(CMake_TEST_FindJsonCpp) - add_subdirectory(FindJsonCpp) - endif() - - if(CMake_TEST_FindLibLZMA) - add_subdirectory(FindLibLZMA) - endif() - - if(CMake_TEST_FindLibRHash) - add_subdirectory(FindLibRHash) - endif() - - if(CMake_TEST_FindLibinput) - add_subdirectory(FindLibinput) - endif() - - if(CMake_TEST_FindLibUV) - add_subdirectory(FindLibUV) - endif() - - if(CMake_TEST_FindLibXml2) - add_subdirectory(FindLibXml2) - endif() - - if(CMake_TEST_FindLTTngUST) - add_subdirectory(FindLTTngUST) - endif() - - if(CMake_TEST_FindODBC) - add_subdirectory(FindODBC) - endif() - - if(CMake_TEST_FindOpenCL) - add_subdirectory(FindOpenCL) - endif() - - if(CMake_TEST_FindOpenGL) - add_subdirectory(FindOpenGL) - endif() - - if(CMake_TEST_FindOpenMP) - add_subdirectory(FindOpenMP) - endif() - - if(CMake_TEST_FindOpenSSL) - add_subdirectory(FindOpenSSL) - endif() - - if(CMake_TEST_FindMPI) - add_subdirectory(FindMPI) - endif() - - if(CMake_TEST_FindPNG) - add_subdirectory(FindPNG) - endif() - - if(CMake_TEST_FindPatch) - add_subdirectory(FindPatch) - endif() - - if(CMake_TEST_FindPostgreSQL) - add_subdirectory(FindPostgreSQL) - endif() - - if(CMake_TEST_FindProtobuf) - add_subdirectory(FindProtobuf) - endif() - - if(CMake_TEST_FindSQLite3) - add_subdirectory(FindSQLite3) - endif() - - if(CMake_TEST_FindTIFF) - add_subdirectory(FindTIFF) - endif() - - if(CMake_TEST_FindVulkan) - add_subdirectory(FindVulkan) - endif() - - if(CMake_TEST_FindX11) - add_subdirectory(FindX11) - endif() - - if(CMake_TEST_FindXalanC) - add_subdirectory(FindXalanC) - endif() - - if(CMake_TEST_FindXercesC) - add_subdirectory(FindXercesC) - endif() - if(CMake_TEST_FindPython OR CMake_TEST_FindPython_NumPy) add_subdirectory(FindPython) endif() ----------------------------------------------------------------------- Summary of changes: Modules/FindMPI.cmake | 5 +- Modules/FindMatlab.cmake | 8 +- Modules/FindProtobuf.cmake | 5 + Source/cmExportCommand.cxx | 11 +- Source/cmRuntimeDependencyArchive.cxx | 5 +- Tests/CMakeLists.txt | 216 +++++++------------------------ Tests/RunCMake/export/Empty.cmake | 1 + Tests/RunCMake/export/RunCMakeTest.cmake | 1 + 8 files changed, 73 insertions(+), 179 deletions(-) create mode 100644 Tests/RunCMake/export/Empty.cmake hooks/post-receive -- CMake From kwrobot at kitware.com Wed Jun 26 07:13:07 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Wed, 26 Jun 2019 07:13:07 -0400 (EDT) Subject: [Cmake-commits] CMake branch, release, updated. v3.15.0-rc2-16-g2bbbc4c Message-ID: <20190626111307.55C3A112131@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, release has been updated via 2bbbc4ce1ff7d7d0cbbdc1d89cff023b754cc35f (commit) via edec1c261519525acd01ad67192f777fa071c50b (commit) via 2ba5c37b3fed00ecc307b1d93780acd4a57695eb (commit) via 7113b943463d4a9c9df7d7385856394cbcfe8de7 (commit) via eda4c43879522438622ad75a5204666011198203 (commit) via 9334a4b472234e24969555f191e09302cf725265 (commit) via 736f38ff3434e168a5548d3d2a0897934fa5de9a (commit) via f57a53d43e1ec693fdbb749fc279fc79f33a8866 (commit) from 154d25f5bac70e0537578eee75e0d898446c14cc (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- ----------------------------------------------------------------------- Summary of changes: Help/prop_tgt/FRAMEWORK.rst | 4 +++- Source/cmExportCommand.cxx | 11 +++++++++-- Source/cmNinjaNormalTargetGenerator.cxx | 15 ++------------- Tests/FindIconv/Test/CMakeLists.txt | 2 ++ Tests/RunCMake/export/Empty.cmake | 1 + Tests/RunCMake/export/RunCMakeTest.cmake | 1 + 6 files changed, 18 insertions(+), 16 deletions(-) create mode 100644 Tests/RunCMake/export/Empty.cmake hooks/post-receive -- CMake From kwrobot at kitware.com Wed Jun 26 07:23:02 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Wed, 26 Jun 2019 07:23:02 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc2-173-g06f1560 Message-ID: <20190626112302.30931113C75@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 06f1560a58391d29b10697b2d5462966cd417b2f (commit) via 9b68e4b1836ff39043ebf34aec5d1e97cebbeabc (commit) via d29ed8a1148d317a5743c0210a3b97d42d41e0a0 (commit) via d88b38d05d5bc7528667ed4f86842ab8f7ff2ba2 (commit) from 1e263065e12435ade250d83ab04e61c4453b12fe (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=06f1560a58391d29b10697b2d5462966cd417b2f commit 06f1560a58391d29b10697b2d5462966cd417b2f Merge: 9b68e4b d29ed8a Author: Brad King AuthorDate: Wed Jun 26 11:13:37 2019 +0000 Commit: Kitware Robot CommitDate: Wed Jun 26 07:14:04 2019 -0400 Merge topic 'build-install-rpath-genex' d29ed8a114 BUILD_RPATH/INSTALL_RPATH: Add generator expression support Acked-by: Kitware Robot Merge-request: !3481 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9b68e4b1836ff39043ebf34aec5d1e97cebbeabc commit 9b68e4b1836ff39043ebf34aec5d1e97cebbeabc Merge: 1e26306 d88b38d Author: Brad King AuthorDate: Wed Jun 26 11:12:21 2019 +0000 Commit: Kitware Robot CommitDate: Wed Jun 26 07:13:24 2019 -0400 Merge topic 'implicit-includes-realpath' d88b38d05d Normalize paths when checking for implicit include dirs Acked-by: Kitware Robot Merge-request: !3467 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d29ed8a1148d317a5743c0210a3b97d42d41e0a0 commit d29ed8a1148d317a5743c0210a3b97d42d41e0a0 Author: Kyle Edwards AuthorDate: Mon Jun 24 18:30:38 2019 -0400 Commit: Kyle Edwards CommitDate: Tue Jun 25 10:55:03 2019 -0400 BUILD_RPATH/INSTALL_RPATH: Add generator expression support Fixes: #19423 diff --git a/Help/prop_tgt/BUILD_RPATH.rst b/Help/prop_tgt/BUILD_RPATH.rst index 13c9c1d..d978b94 100644 --- a/Help/prop_tgt/BUILD_RPATH.rst +++ b/Help/prop_tgt/BUILD_RPATH.rst @@ -8,3 +8,6 @@ tree. See also the :prop_tgt:`INSTALL_RPATH` target property. This property is initialized by the value of the variable :variable:`CMAKE_BUILD_RPATH` if it is set when a target is created. + +This property supports +:manual:`generator expressions `. diff --git a/Help/prop_tgt/INSTALL_RPATH.rst b/Help/prop_tgt/INSTALL_RPATH.rst index 6403f4c..93b4488 100644 --- a/Help/prop_tgt/INSTALL_RPATH.rst +++ b/Help/prop_tgt/INSTALL_RPATH.rst @@ -7,3 +7,6 @@ A semicolon-separated list specifying the rpath to use in installed targets (for platforms that support it). This property is initialized by the value of the variable :variable:`CMAKE_INSTALL_RPATH` if it is set when a target is created. + +This property supports +:manual:`generator expressions `. diff --git a/Help/release/dev/build-install-rpath-genex.rst b/Help/release/dev/build-install-rpath-genex.rst new file mode 100644 index 0000000..644b1b2 --- /dev/null +++ b/Help/release/dev/build-install-rpath-genex.rst @@ -0,0 +1,5 @@ +build-install-rpath-genex +------------------------- + +* :prop_tgt:`BUILD_RPATH` and :prop_tgt:`INSTALL_RPATH` now support + :manual:`generator expressions `. diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx index 44d8615..b366ebb 100644 --- a/Source/cmComputeLinkInformation.cxx +++ b/Source/cmComputeLinkInformation.cxx @@ -1695,7 +1695,7 @@ void cmComputeLinkInformation::GetRPath(std::vector& runtimeDirs, (for_install || this->Target->GetPropertyAsBool("BUILD_WITH_INSTALL_RPATH")); bool use_install_rpath = - (outputRuntime && this->Target->HaveInstallTreeRPATH() && + (outputRuntime && this->Target->HaveInstallTreeRPATH(this->Config) && linking_for_install); bool use_build_rpath = (outputRuntime && this->Target->HaveBuildTreeRPATH(this->Config) && @@ -1715,15 +1715,17 @@ void cmComputeLinkInformation::GetRPath(std::vector& runtimeDirs, // Construct the RPATH. std::set emitted; if (use_install_rpath) { - const char* install_rpath = this->Target->GetProperty("INSTALL_RPATH"); - cmCLI_ExpandListUnique(install_rpath, runtimeDirs, emitted); + std::string install_rpath; + this->Target->GetInstallRPATH(this->Config, install_rpath); + cmCLI_ExpandListUnique(install_rpath.c_str(), runtimeDirs, emitted); } if (use_build_rpath) { // Add directories explicitly specified by user - if (const char* build_rpath = this->Target->GetProperty("BUILD_RPATH")) { + std::string build_rpath; + if (this->Target->GetBuildRPATH(this->Config, build_rpath)) { // This will not resolve entries to use $ORIGIN, the user is expected to // do that if necessary. - cmCLI_ExpandListUnique(build_rpath, runtimeDirs, emitted); + cmCLI_ExpandListUnique(build_rpath.c_str(), runtimeDirs, emitted); } } if (use_build_rpath || use_link_rpath) { diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index de0f371..85a8dbb 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -1612,7 +1612,7 @@ bool cmGeneratorTarget::NeedRelinkBeforeInstall( // will likely change between the build tree and install tree and // this target must be relinked. bool have_rpath = - this->HaveBuildTreeRPATH(config) || this->HaveInstallTreeRPATH(); + this->HaveBuildTreeRPATH(config) || this->HaveInstallTreeRPATH(config); bool is_ninja = this->LocalGenerator->GetGlobalGenerator()->GetName() == "Ninja"; @@ -5479,13 +5479,41 @@ bool cmGeneratorTarget::ComputePDBOutputDir(const std::string& kind, return true; } -bool cmGeneratorTarget::HaveInstallTreeRPATH() const +bool cmGeneratorTarget::HaveInstallTreeRPATH(const std::string& config) const { - const char* install_rpath = this->GetProperty("INSTALL_RPATH"); - return (install_rpath && *install_rpath) && + std::string install_rpath; + this->GetInstallRPATH(config, install_rpath); + return !install_rpath.empty() && !this->Makefile->IsOn("CMAKE_SKIP_INSTALL_RPATH"); } +bool cmGeneratorTarget::GetBuildRPATH(const std::string& config, + std::string& rpath) const +{ + return this->GetRPATH(config, "BUILD_RPATH", rpath); +} + +bool cmGeneratorTarget::GetInstallRPATH(const std::string& config, + std::string& rpath) const +{ + return this->GetRPATH(config, "INSTALL_RPATH", rpath); +} + +bool cmGeneratorTarget::GetRPATH(const std::string& config, + const std::string& prop, + std::string& rpath) const +{ + const char* value = this->GetProperty(prop); + if (!value) { + return false; + } + + cmGeneratorExpression ge; + rpath = ge.Parse(value)->Evaluate(this->LocalGenerator, config); + + return true; +} + void cmGeneratorTarget::ComputeLinkInterfaceLibraries( const std::string& config, cmOptionalLinkInterface& iface, cmGeneratorTarget const* headTarget, bool usage_requirements_only) const @@ -6085,7 +6113,8 @@ bool cmGeneratorTarget::HaveBuildTreeRPATH(const std::string& config) const if (this->GetPropertyAsBool("SKIP_BUILD_RPATH")) { return false; } - if (this->GetProperty("BUILD_RPATH")) { + std::string build_rpath; + if (this->GetBuildRPATH(config, build_rpath)) { return true; } if (cmLinkImplementationLibraries const* impl = diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h index 0e0ee6a..627a055 100644 --- a/Source/cmGeneratorTarget.h +++ b/Source/cmGeneratorTarget.h @@ -674,7 +674,10 @@ public: class TargetPropertyEntry; - bool HaveInstallTreeRPATH() const; + bool HaveInstallTreeRPATH(const std::string& config) const; + + bool GetBuildRPATH(const std::string& config, std::string& rpath) const; + bool GetInstallRPATH(const std::string& config, std::string& rpath) const; /** Whether this library has \@rpath and platform supports it. */ bool HasMacOSXRpathInstallNameDir(const std::string& config) const; @@ -913,6 +916,9 @@ private: ManagedType CheckManagedType(std::string const& propval) const; + bool GetRPATH(const std::string& config, const std::string& prop, + std::string& rpath) const; + public: const std::vector& GetLinkImplementationClosure( const std::string& config) const; diff --git a/Tests/RunCMake/RuntimePath/Genex.cmake b/Tests/RunCMake/RuntimePath/Genex.cmake new file mode 100644 index 0000000..152238a --- /dev/null +++ b/Tests/RunCMake/RuntimePath/Genex.cmake @@ -0,0 +1,29 @@ +enable_language(C) + +add_library(A STATIC A.c) + +add_executable(buildge main.c) +target_link_libraries(buildge A) +set_target_properties(buildge PROPERTIES + BUILD_RPATH $<1:/opt/foo/lib> + ) + +add_executable(buildnoge main.c) +target_link_libraries(buildnoge A) +set_target_properties(buildnoge PROPERTIES + BUILD_RPATH /opt/foo/lib + ) + +add_executable(installge main.c) +target_link_libraries(installge A) +set_target_properties(installge PROPERTIES + INSTALL_RPATH $<1:/opt/foo/lib> + BUILD_WITH_INSTALL_RPATH 1 + ) + +add_executable(installnoge main.c) +target_link_libraries(installnoge A) +set_target_properties(installnoge PROPERTIES + INSTALL_RPATH /opt/foo/lib + BUILD_WITH_INSTALL_RPATH 1 + ) diff --git a/Tests/RunCMake/RuntimePath/GenexCheck.cmake b/Tests/RunCMake/RuntimePath/GenexCheck.cmake new file mode 100644 index 0000000..07dc496 --- /dev/null +++ b/Tests/RunCMake/RuntimePath/GenexCheck.cmake @@ -0,0 +1,7 @@ +file(GLOB_RECURSE files "${dir}/*") + +foreach(file IN LISTS files) + if(file MATCHES "/(build|install)(no)?ge$") + file(RPATH_CHANGE FILE "${file}" OLD_RPATH "/opt/foo/lib" NEW_RPATH "/opt/bar/lib") + endif() +endforeach() diff --git a/Tests/RunCMake/RuntimePath/RunCMakeTest.cmake b/Tests/RunCMake/RuntimePath/RunCMakeTest.cmake index 6f1baa1..4c9ddcd 100644 --- a/Tests/RunCMake/RuntimePath/RunCMakeTest.cmake +++ b/Tests/RunCMake/RuntimePath/RunCMakeTest.cmake @@ -1,32 +1,26 @@ include(RunCMake) -function(run_SymlinkImplicit) +function(run_RuntimePath name) # Use a single build tree for a few tests without cleaning. - set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/SymlinkImplicit-build) + set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${name}-build) set(RunCMake_TEST_NO_CLEAN 1) if(NOT RunCMake_GENERATOR_IS_MULTI_CONFIG) set(RunCMake_TEST_OPTIONS -DCMAKE_BUILD_TYPE=Debug) endif() file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}") file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}") - run_cmake(SymlinkImplicit) - run_cmake_command(SymlinkImplicit-build ${CMAKE_COMMAND} --build . --config Debug) - run_cmake_command(SymlinkImplicitCheck - ${CMAKE_COMMAND} -Ddir=${RunCMake_TEST_BINARY_DIR} -P ${RunCMake_SOURCE_DIR}/SymlinkImplicitCheck.cmake) + run_cmake(${name}) + run_cmake_command(${name}-build ${CMAKE_COMMAND} --build . --config Debug) endfunction() -run_SymlinkImplicit() -function(run_Relative) - # Use a single build tree for a few tests without cleaning. - set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/Relative-build) - set(RunCMake_TEST_NO_CLEAN 1) - if(NOT RunCMake_GENERATOR_IS_MULTI_CONFIG) - set(RunCMake_TEST_OPTIONS -DCMAKE_BUILD_TYPE=Debug) - endif() - file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}") - file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}") - run_cmake(Relative) - run_cmake_command(Relative-build ${CMAKE_COMMAND} --build . --config Debug) -endfunction() -run_Relative() +run_RuntimePath(SymlinkImplicit) +run_cmake_command(SymlinkImplicitCheck + ${CMAKE_COMMAND} -Ddir=${RunCMake_BINARY_DIR}/SymlinkImplicit-build -P ${RunCMake_SOURCE_DIR}/SymlinkImplicitCheck.cmake) + +run_RuntimePath(Relative) +# FIXME: Run RelativeCheck (appears to be broken currently) + +run_RuntimePath(Genex) +run_cmake_command(GenexCheck + ${CMAKE_COMMAND} -Ddir=${RunCMake_BINARY_DIR}/Genex-build -P ${RunCMake_SOURCE_DIR}/GenexCheck.cmake) https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d88b38d05d5bc7528667ed4f86842ab8f7ff2ba2 commit d88b38d05d5bc7528667ed4f86842ab8f7ff2ba2 Author: Daniel Scharrer AuthorDate: Sat Jun 22 22:22:39 2019 +0200 Commit: Daniel Scharrer CommitDate: Sat Jun 22 23:09:17 2019 +0200 Normalize paths when checking for implicit include dirs GCC replaces implicit include directories with user-supplied ones if they point to the same directory, even if the path strings differ. diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 3abf2dd..801f0e8 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -1017,7 +1017,7 @@ std::vector> cmLocalGenerator::GetIncludeDirectoriesImplicit( } for (std::string const& i : impDirVec) { - if (implicitSet.insert(i).second) { + if (implicitSet.insert(cmSystemTools::GetRealPath(i)).second) { implicitDirs.emplace_back(i); } } @@ -1028,7 +1028,8 @@ std::vector> cmLocalGenerator::GetIncludeDirectoriesImplicit( &lang](std::string const& dir) { return ( // Do not exclude directories that are not in an excluded set. - ((implicitSet.find(dir) == implicitSet.end()) && + ((implicitSet.find(cmSystemTools::GetRealPath(dir)) == + implicitSet.end()) && (implicitExclude.find(dir) == implicitExclude.end())) // Do not exclude entries of the CPATH environment variable even though // they are implicitly searched by the compiler. They are meant to be @@ -1082,7 +1083,8 @@ std::vector> cmLocalGenerator::GetIncludeDirectoriesImplicit( if (!stripImplicitDirs) { // Append implicit directories that were requested by the user only for (BT const& udr : userDirs) { - if (implicitSet.find(udr.Value) != implicitSet.end()) { + if (implicitSet.find(cmSystemTools::GetRealPath(udr.Value)) != + implicitSet.end()) { emitBT(udr); } } ----------------------------------------------------------------------- Summary of changes: Help/prop_tgt/BUILD_RPATH.rst | 3 ++ Help/prop_tgt/INSTALL_RPATH.rst | 3 ++ Help/release/dev/build-install-rpath-genex.rst | 5 ++++ Source/cmComputeLinkInformation.cxx | 12 ++++---- Source/cmGeneratorTarget.cxx | 39 ++++++++++++++++++++++---- Source/cmGeneratorTarget.h | 8 +++++- Source/cmLocalGenerator.cxx | 8 ++++-- Tests/RunCMake/RuntimePath/Genex.cmake | 29 +++++++++++++++++++ Tests/RunCMake/RuntimePath/GenexCheck.cmake | 7 +++++ Tests/RunCMake/RuntimePath/RunCMakeTest.cmake | 34 +++++++++------------- 10 files changed, 114 insertions(+), 34 deletions(-) create mode 100644 Help/release/dev/build-install-rpath-genex.rst create mode 100644 Tests/RunCMake/RuntimePath/Genex.cmake create mode 100644 Tests/RunCMake/RuntimePath/GenexCheck.cmake hooks/post-receive -- CMake From kwrobot at kitware.com Thu Jun 27 00:03:02 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Thu, 27 Jun 2019 00:03:02 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc2-174-g454a625 Message-ID: <20190627040302.C67E310340B@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 454a6250cafd7857d444f393791a239863afb12b (commit) from 06f1560a58391d29b10697b2d5462966cd417b2f (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=454a6250cafd7857d444f393791a239863afb12b commit 454a6250cafd7857d444f393791a239863afb12b Author: Kitware Robot AuthorDate: Thu Jun 27 00:01:06 2019 -0400 Commit: Kitware Robot CommitDate: Thu Jun 27 00:01:06 2019 -0400 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index a054b11..f771759 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 15) -set(CMake_VERSION_PATCH 20190626) +set(CMake_VERSION_PATCH 20190627) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From kwrobot at kitware.com Thu Jun 27 07:33:12 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Thu, 27 Jun 2019 07:33:12 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc2-179-g79d27c0 Message-ID: <20190627113312.94D91125A29@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 79d27c06bc58b6a67d84636d8b96648052d93dfa (commit) via 6ddc0b443896e3be1c9e2ba5a67cf5231ab1249e (commit) via d9a9150351212348c0fc663b0f31fcb0e1b5c42e (commit) via 8fbd25772f7db4c6f152a28b0050e6b263951049 (commit) via 07807a20060b4e9561239d8b26ebbb4f38b7c7f3 (commit) from 454a6250cafd7857d444f393791a239863afb12b (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=79d27c06bc58b6a67d84636d8b96648052d93dfa commit 79d27c06bc58b6a67d84636d8b96648052d93dfa Merge: 6ddc0b4 d9a9150 Author: Brad King AuthorDate: Thu Jun 27 07:31:25 2019 -0400 Commit: Brad King CommitDate: Thu Jun 27 07:31:25 2019 -0400 Merge branch 'release-3.15' https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6ddc0b443896e3be1c9e2ba5a67cf5231ab1249e commit 6ddc0b443896e3be1c9e2ba5a67cf5231ab1249e Merge: 454a625 8fbd257 Author: Brad King AuthorDate: Thu Jun 27 11:29:50 2019 +0000 Commit: Kitware Robot CommitDate: Thu Jun 27 07:30:01 2019 -0400 Merge topic 'cuda-msvc-runtime-library' 8fbd25772f CUDA: Implement MSVC runtime library abstraction 07807a2006 VS: Use AddLanguageFlags to de-duplicate CMAKE_{CUDA,ASM*}_FLAGS lookup Acked-by: Kitware Robot Merge-request: !3485 ----------------------------------------------------------------------- Summary of changes: Modules/Platform/Windows-NVIDIA-CUDA.cmake | 23 +++++++++++++++---- Source/cmVisualStudio10TargetGenerator.cxx | 26 +++++++++------------- Tests/CMakeLists.txt | 1 + Tests/MSVCRuntimeLibrary/CMakeLists.txt | 7 ++++++ Tests/MSVCRuntimeLibrary/{verify.cxx => verify.cu} | 0 5 files changed, 38 insertions(+), 19 deletions(-) copy Tests/MSVCRuntimeLibrary/{verify.cxx => verify.cu} (100%) hooks/post-receive -- CMake From kwrobot at kitware.com Thu Jun 27 07:33:12 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Thu, 27 Jun 2019 07:33:12 -0400 (EDT) Subject: [Cmake-commits] CMake branch, release, updated. v3.15.0-rc2-19-gd9a9150 Message-ID: <20190627113312.EA6AF125A19@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, release has been updated via d9a9150351212348c0fc663b0f31fcb0e1b5c42e (commit) via 8fbd25772f7db4c6f152a28b0050e6b263951049 (commit) via 07807a20060b4e9561239d8b26ebbb4f38b7c7f3 (commit) from 2bbbc4ce1ff7d7d0cbbdc1d89cff023b754cc35f (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- ----------------------------------------------------------------------- Summary of changes: Modules/Platform/Windows-NVIDIA-CUDA.cmake | 23 +++++++++++++++---- Source/cmVisualStudio10TargetGenerator.cxx | 26 +++++++++------------- Tests/CMakeLists.txt | 1 + Tests/MSVCRuntimeLibrary/CMakeLists.txt | 7 ++++++ Tests/MSVCRuntimeLibrary/{verify.cxx => verify.cu} | 0 5 files changed, 38 insertions(+), 19 deletions(-) copy Tests/MSVCRuntimeLibrary/{verify.cxx => verify.cu} (100%) hooks/post-receive -- CMake From kwrobot at kitware.com Thu Jun 27 08:53:00 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Thu, 27 Jun 2019 08:53:00 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc3-161-g50b2e74 Message-ID: <20190627125300.F2950F9503@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 50b2e74396fe09e928bf5d2b4c747257394aa138 (commit) via 753373579e3dd8cf19f0fc18f4d9bec43a2d82e8 (commit) from 79d27c06bc58b6a67d84636d8b96648052d93dfa (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=50b2e74396fe09e928bf5d2b4c747257394aa138 commit 50b2e74396fe09e928bf5d2b4c747257394aa138 Merge: 79d27c0 7533735 Author: Brad King AuthorDate: Thu Jun 27 08:39:09 2019 -0400 Commit: Brad King CommitDate: Thu Jun 27 08:39:09 2019 -0400 Merge branch 'release-3.15' ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From kwrobot at kitware.com Thu Jun 27 08:53:01 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Thu, 27 Jun 2019 08:53:01 -0400 (EDT) Subject: [Cmake-commits] CMake branch, release, updated. v3.15.0-rc3 Message-ID: <20190627125301.28105F9A5F@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, release has been updated via 753373579e3dd8cf19f0fc18f4d9bec43a2d82e8 (commit) from d9a9150351212348c0fc663b0f31fcb0e1b5c42e (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From kwrobot at kitware.com Thu Jun 27 08:53:01 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Thu, 27 Jun 2019 08:53:01 -0400 (EDT) Subject: [Cmake-commits] CMake annotated tag, v3.15.0-rc3, created. v3.15.0-rc3 Message-ID: <20190627125301.3FFCDF8F44@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The annotated tag, v3.15.0-rc3 has been created at 8fb8ed8cdae332ebf3786276c0ac2d6a64f34237 (tag) tagging 753373579e3dd8cf19f0fc18f4d9bec43a2d82e8 (commit) replaces v3.15.0-rc2 tagged by Brad King on Thu Jun 27 08:34:41 2019 -0400 - Log ----------------------------------------------------------------- CMake 3.15.0-rc3 -----BEGIN PGP SIGNATURE----- iQJKBAABCgA0FiEExsJlMku+vcNQtRPQLSzvEDSSFoQFAl0Ut+EWHGJyYWQua2lu Z0BraXR3YXJlLmNvbQAKCRAtLO8QNJIWhGe2D/9xLMR7uzYfXAVtmTymTHZjMwYF 1VR/GWcb9rj91Jz/rPGMXEEFMAjgv2O6KVt+iBD8Csm36hNSc9tv2oRVGxAX9uxw 99ikO2t0KHyxgzL8gssauEMPzYYeQAsEEhHqclXPBVZA7cSwjjf2Ui9E44Bj7GJG AYYtKR480JMa/dtbz4G2ONRtmMnzk+Vt5EJM/4LVvsv6Fblv8yhkqRjE/eMUxCXj k5BBl+ICp4CNsgeXXiNfGgfovS6AMDj3OkPyEx6fTTsOLwyrsRcJIFowAEivQff2 cysCYyKSPRrpAfjRirDlLRQi8i+YwuAgCQbIyX+UxZ7aR1036KhO5nIM/NsNteJe jUAMQMzp62BCbY4Dg8wP5LT/P8G2Qxxf2CWGsFmDYuxi5ayEmupSSY6U2nX9dNmq lVNa1eYDbLLiOpOXj3baLe9CN4HXuzS1Rd3Hh3ZGsT6/JD+hCNbNuefkBZOwemHd 0CXXqDCNnTxSQ2BboGwKHU4a8XNRNGk+J0FW63VaD7IIZMcTz6HduUmxR6b7xWEn +V92wm7rSePN47TKuHU/IQpe0VkqISyLlwjHnXzP3W/I5VLHiMlEkcFoW2+Cl61g EYDwUma2uLr7meU33xf9E9qV4qWETpIuLg6PwXth2ZwRZBzI5kPXhkrnDQCsYm8L f1VBVRj4JOwFmjYObA== =otT8 -----END PGP SIGNATURE----- Alexandru Croitor (1): Help: Improve documentation of IMPORTED_LOCATION property Brad King (12): Merge branch 'autogen_documentation' into release-3.15 Merge branch 'doc-IMPORTED_LOCATION' into release-3.15 Merge branch 'doc-typos-cmake_parse_arguments' into release-3.15 Merge branch 'iconv-c++11' into release-3.15 Merge branch 'ninja-nvcc-rsp' into release-3.15 export: Restore support for empty TARGETS list Merge branch 'export-targets-empty' into release-3.15 Merge branch 'doc-CMAKE_FRAMEWORK-crossref' into release-3.15 VS: Use AddLanguageFlags to de-duplicate CMAKE_{CUDA,ASM*}_FLAGS lookup CUDA: Implement MSVC runtime library abstraction Merge branch 'cuda-msvc-runtime-library' into release-3.15 CMake 3.15.0-rc3 Craig Scott (2): Help: Typo and grammar fixes in cmake_parse_arguments() docs Help: Document that CMAKE_FRAMEWORK initializes FRAMEWORK target prop Francisco Facioni (1): Ninja: Fix CUDA device linking when using response files Rolf Eike Beer (1): FindIconv test: request C++11 Sebastian Holtermann (3): Help: Autogen: Overhaul AUTORCC target property documentation Help: Autogen: Overhaul AUTOUIC target property documentation Help: Autogen: Overhaul AUTOMOC target property documentation ----------------------------------------------------------------------- hooks/post-receive -- CMake From kwrobot at kitware.com Thu Jun 27 09:03:00 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Thu, 27 Jun 2019 09:03:00 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc3-163-g3327fe9 Message-ID: <20190627130300.2B3CC10E3F6@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 3327fe948ef61ec907b1d0c056d8933f65c18214 (commit) via cd92f8f8bf9d3312f195ac5c27c129ff7868fa7e (commit) from 50b2e74396fe09e928bf5d2b4c747257394aa138 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3327fe948ef61ec907b1d0c056d8933f65c18214 commit 3327fe948ef61ec907b1d0c056d8933f65c18214 Merge: 50b2e74 cd92f8f Author: Brad King AuthorDate: Thu Jun 27 12:56:31 2019 +0000 Commit: Kitware Robot CommitDate: Thu Jun 27 08:56:41 2019 -0400 Merge topic 'vs-dpi-aware' cd92f8f8bf VS: Add VS_DPI_AWARE target property Acked-by: Kitware Robot Merge-request: !3418 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=cd92f8f8bf9d3312f195ac5c27c129ff7868fa7e commit cd92f8f8bf9d3312f195ac5c27c129ff7868fa7e Author: Matt Weir AuthorDate: Sun Jun 16 12:27:13 2019 +1200 Commit: Brad King CommitDate: Wed Jun 26 09:55:49 2019 -0400 VS: Add VS_DPI_AWARE target property Enables setting the visual studio project property for Manifests, controlling the DPI Aware setting. diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst index 77b1ae8..0beca82 100644 --- a/Help/manual/cmake-properties.7.rst +++ b/Help/manual/cmake-properties.7.rst @@ -331,6 +331,7 @@ Properties on Targets /prop_tgt/VS_DOTNET_REFERENCES /prop_tgt/VS_DOTNET_REFERENCES_COPY_LOCAL /prop_tgt/VS_DOTNET_TARGET_FRAMEWORK_VERSION + /prop_tgt/VS_DPI_AWARE /prop_tgt/VS_GLOBAL_KEYWORD /prop_tgt/VS_GLOBAL_PROJECT_TYPES /prop_tgt/VS_GLOBAL_ROOTNAMESPACE diff --git a/Help/prop_tgt/VS_DPI_AWARE.rst b/Help/prop_tgt/VS_DPI_AWARE.rst new file mode 100644 index 0000000..82640cc --- /dev/null +++ b/Help/prop_tgt/VS_DPI_AWARE.rst @@ -0,0 +1,14 @@ +VS_DPI_AWARE +------------ + +Set the Manifest Tool -> Input and Output -> DPI Awareness in the Visual Studio +target project properties. + +Valid values are ``PerMonitor``, ``ON``, or ``OFF``. + +For example: + +.. code-block:: cmake + + add_executable(myproject myproject.cpp) + set_property(TARGET myproject PROPERTY VS_DPI_AWARE "PerMonitor") diff --git a/Help/release/dev/vs-dpi-aware.rst b/Help/release/dev/vs-dpi-aware.rst new file mode 100644 index 0000000..f76f26c --- /dev/null +++ b/Help/release/dev/vs-dpi-aware.rst @@ -0,0 +1,6 @@ +vs-dpi-aware +------------ + +* The :prop_tgt:`VS_DPI_AWARE` target property was added to tell + :ref:`Visual Studio Generators` to set the ``EnableDpiAwareness`` + property in ``.vcxproj`` files. diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 634c990..85feacd 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -3252,15 +3252,32 @@ void cmVisualStudio10TargetGenerator::WriteManifestOptions( std::vector manifest_srcs; this->GeneratorTarget->GetManifests(manifest_srcs, config); - if (!manifest_srcs.empty()) { - std::ostringstream oss; - for (cmSourceFile const* mi : manifest_srcs) { - std::string m = this->ConvertPath(mi->GetFullPath(), false); - ConvertToWindowsSlash(m); - oss << m << ";"; - } + + const char* dpiAware = this->GeneratorTarget->GetProperty("VS_DPI_AWARE"); + + if (!manifest_srcs.empty() || dpiAware) { Elem e2(e1, "Manifest"); - e2.Element("AdditionalManifestFiles", oss.str()); + if (!manifest_srcs.empty()) { + std::ostringstream oss; + for (cmSourceFile const* mi : manifest_srcs) { + std::string m = this->ConvertPath(mi->GetFullPath(), false); + ConvertToWindowsSlash(m); + oss << m << ";"; + } + e2.Element("AdditionalManifestFiles", oss.str()); + } + if (dpiAware) { + if (!strcmp(dpiAware, "PerMonitor")) { + e2.Element("EnableDpiAwareness", "PerMonitorHighDPIAware"); + } else if (cmSystemTools::IsOn(dpiAware)) { + e2.Element("EnableDpiAwareness", "true"); + } else if (cmSystemTools::IsOff(dpiAware)) { + e2.Element("EnableDpiAwareness", "false"); + } else { + cmSystemTools::Error("Bad parameter for VS_DPI_AWARE: " + + std::string(dpiAware)); + } + } } } diff --git a/Tests/RunCMake/VS10Project/RunCMakeTest.cmake b/Tests/RunCMake/VS10Project/RunCMakeTest.cmake index 55ca9ea..5b2c7cb 100644 --- a/Tests/RunCMake/VS10Project/RunCMakeTest.cmake +++ b/Tests/RunCMake/VS10Project/RunCMakeTest.cmake @@ -22,6 +22,8 @@ run_cmake(VsSdkDirectories) run_cmake(VsGlobals) run_cmake(VsProjectImport) run_cmake(VsPackageReferences) +run_cmake(VsDpiAware) +run_cmake(VsDpiAwareBadParam) if(CMAKE_C_COMPILER_ID STREQUAL "MSVC" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 19.05) run_cmake(VsJustMyCode) diff --git a/Tests/RunCMake/VS10Project/VsDpiAware-check.cmake b/Tests/RunCMake/VS10Project/VsDpiAware-check.cmake new file mode 100644 index 0000000..fbb64f0 --- /dev/null +++ b/Tests/RunCMake/VS10Project/VsDpiAware-check.cmake @@ -0,0 +1,41 @@ +macro(VSDpiAware_check tgt dpiaware_match_expect) + set(vcProjectFile "${RunCMake_TEST_BINARY_DIR}/${tgt}.vcxproj") + if(NOT EXISTS "${vcProjectFile}") + set(RunCMake_TEST_FAILED "Project file ${tgt}.vcxproj does not exist.") + return() + endif() + + set(HAVE_DPIAWARE_MATCH 0) + set(IN_MANIFEST_SETTINGS 0) + + file(STRINGS "${vcProjectFile}" lines) + foreach(line IN LISTS lines) + if(line MATCHES "^ *") + set(IN_MANIFEST_SETTINGS 1) + elseif(line MATCHES "^ *") + set(IN_MANIFEST_SETTINGS 0) + elseif(IN_MANIFEST_SETTINGS AND (line MATCHES "^ *([^<>]+)")) + set(dpiaware_match_actual "${CMAKE_MATCH_1}") + if(NOT "${dpiaware_match_actual}" STREQUAL "${dpiaware_match_expect}") + set(RunCMake_TEST_FAILED "Project file ${tgt}.vcxproj has '${dpiaware_match_actual}', not '${dpiaware_match_expect}'.") + return() + endif() + set(HAVE_DPIAWARE_MATCH 1) + break() + endif() + endforeach() + + if(NOT HAVE_DPIAWARE_MATCH AND NOT "${dpiaware_match_expect}" STREQUAL "") + set(RunCMake_TEST_FAILED "Project file ${tgt}.vcxproj does not have a property group.") + return() + endif() +endmacro() + +VSDpiAware_check(DPIAWARE-default-C "") +VSDpiAware_check(DPIAWARE-default-CXX "") +VSDpiAware_check(DPIAWARE-TGT-PERMONITOR-C "PerMonitorHighDPIAware") +VSDpiAware_check(DPIAWARE-TGT-PERMONITOR-CXX "PerMonitorHighDPIAware") +VSDpiAware_check(DPIAWARE-TGT-ON-C "true") +VSDpiAware_check(DPIAWARE-TGT-ON-CXX "true") +VSDpiAware_check(DPIAWARE-TGT-OFF-C "false") +VSDpiAware_check(DPIAWARE-TGT-OFF-CXX "false") diff --git a/Tests/RunCMake/VS10Project/VsDpiAware.cmake b/Tests/RunCMake/VS10Project/VsDpiAware.cmake new file mode 100644 index 0000000..74e3d21 --- /dev/null +++ b/Tests/RunCMake/VS10Project/VsDpiAware.cmake @@ -0,0 +1,19 @@ +set(CMAKE_CONFIGURATION_TYPES Debug) +enable_language(C) +enable_language(CXX) + +add_executable(DPIAWARE-default-C empty.c) +add_executable(DPIAWARE-default-CXX empty.cxx) + +add_executable(DPIAWARE-TGT-PERMONITOR-C empty.c) +set_property(TARGET DPIAWARE-TGT-PERMONITOR-C PROPERTY VS_DPI_AWARE "PerMonitor") +add_executable(DPIAWARE-TGT-PERMONITOR-CXX empty.cxx) +set_property(TARGET DPIAWARE-TGT-PERMONITOR-CXX PROPERTY VS_DPI_AWARE "PerMonitor") +add_executable(DPIAWARE-TGT-ON-C empty.c) +set_property(TARGET DPIAWARE-TGT-ON-C PROPERTY VS_DPI_AWARE ON) +add_executable(DPIAWARE-TGT-ON-CXX empty.cxx) +set_property(TARGET DPIAWARE-TGT-ON-CXX PROPERTY VS_DPI_AWARE ON) +add_executable(DPIAWARE-TGT-OFF-C empty.c) +set_property(TARGET DPIAWARE-TGT-OFF-C PROPERTY VS_DPI_AWARE OFF) +add_executable(DPIAWARE-TGT-OFF-CXX empty.cxx) +set_property(TARGET DPIAWARE-TGT-OFF-CXX PROPERTY VS_DPI_AWARE OFF) diff --git a/Tests/RunCMake/VS10Project/VsDpiAwareBadParam-result.txt b/Tests/RunCMake/VS10Project/VsDpiAwareBadParam-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/VS10Project/VsDpiAwareBadParam-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/VS10Project/VsDpiAwareBadParam-stderr.txt b/Tests/RunCMake/VS10Project/VsDpiAwareBadParam-stderr.txt new file mode 100644 index 0000000..95fc5ca --- /dev/null +++ b/Tests/RunCMake/VS10Project/VsDpiAwareBadParam-stderr.txt @@ -0,0 +1,3 @@ +CMake Error: Bad parameter for VS_DPI_AWARE: Bar +CMake Error: Bad parameter for VS_DPI_AWARE: Foo +CMake Generate step failed. Build files cannot be regenerated correctly. diff --git a/Tests/RunCMake/VS10Project/VsDpiAwareBadParam.cmake b/Tests/RunCMake/VS10Project/VsDpiAwareBadParam.cmake new file mode 100644 index 0000000..e05452b --- /dev/null +++ b/Tests/RunCMake/VS10Project/VsDpiAwareBadParam.cmake @@ -0,0 +1,8 @@ +set(CMAKE_CONFIGURATION_TYPES Debug) +enable_language(C) +enable_language(CXX) + +add_executable(DPIAWARE-TGT-BADPARAM-C empty.c) +set_property(TARGET DPIAWARE-TGT-BADPARAM-C PROPERTY VS_DPI_AWARE "Foo") +add_executable(DPIAWARE-TGT-BADPARAM-CXX empty.cxx) +set_property(TARGET DPIAWARE-TGT-BADPARAM-CXX PROPERTY VS_DPI_AWARE "Bar") ----------------------------------------------------------------------- Summary of changes: Help/manual/cmake-properties.7.rst | 1 + Help/prop_tgt/VS_DPI_AWARE.rst | 14 ++++++++ Help/release/dev/vs-dpi-aware.rst | 6 ++++ Source/cmVisualStudio10TargetGenerator.cxx | 33 ++++++++++++----- Tests/RunCMake/VS10Project/RunCMakeTest.cmake | 2 ++ Tests/RunCMake/VS10Project/VsDpiAware-check.cmake | 41 ++++++++++++++++++++++ Tests/RunCMake/VS10Project/VsDpiAware.cmake | 19 ++++++++++ .../VsDpiAwareBadParam-result.txt} | 0 .../VS10Project/VsDpiAwareBadParam-stderr.txt | 3 ++ .../RunCMake/VS10Project/VsDpiAwareBadParam.cmake | 8 +++++ 10 files changed, 119 insertions(+), 8 deletions(-) create mode 100644 Help/prop_tgt/VS_DPI_AWARE.rst create mode 100644 Help/release/dev/vs-dpi-aware.rst create mode 100644 Tests/RunCMake/VS10Project/VsDpiAware-check.cmake create mode 100644 Tests/RunCMake/VS10Project/VsDpiAware.cmake copy Tests/RunCMake/{while/MissingArgument-result.txt => VS10Project/VsDpiAwareBadParam-result.txt} (100%) create mode 100644 Tests/RunCMake/VS10Project/VsDpiAwareBadParam-stderr.txt create mode 100644 Tests/RunCMake/VS10Project/VsDpiAwareBadParam.cmake hooks/post-receive -- CMake From kwrobot at kitware.com Fri Jun 28 00:03:02 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Fri, 28 Jun 2019 00:03:02 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc3-164-g3b90096 Message-ID: <20190628040302.EEAB0110421@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 3b9009683884593e879191fde5448b12e970d56e (commit) from 3327fe948ef61ec907b1d0c056d8933f65c18214 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3b9009683884593e879191fde5448b12e970d56e commit 3b9009683884593e879191fde5448b12e970d56e Author: Kitware Robot AuthorDate: Fri Jun 28 00:01:07 2019 -0400 Commit: Kitware Robot CommitDate: Fri Jun 28 00:01:07 2019 -0400 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index f771759..0672638 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 15) -set(CMake_VERSION_PATCH 20190627) +set(CMake_VERSION_PATCH 20190628) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From kwrobot at kitware.com Sat Jun 29 00:03:01 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Sat, 29 Jun 2019 00:03:01 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc3-165-g2b1d9e5 Message-ID: <20190629040301.390CF110A75@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 2b1d9e51c2e47a3b8c193770eb222c0713f8a5e6 (commit) from 3b9009683884593e879191fde5448b12e970d56e (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2b1d9e51c2e47a3b8c193770eb222c0713f8a5e6 commit 2b1d9e51c2e47a3b8c193770eb222c0713f8a5e6 Author: Kitware Robot AuthorDate: Sat Jun 29 00:01:05 2019 -0400 Commit: Kitware Robot CommitDate: Sat Jun 29 00:01:05 2019 -0400 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 0672638..48026fb 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 15) -set(CMake_VERSION_PATCH 20190628) +set(CMake_VERSION_PATCH 20190629) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From kwrobot at kitware.com Sun Jun 30 00:02:59 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Sun, 30 Jun 2019 00:02:59 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc3-166-gdae77e0 Message-ID: <20190630040259.7AEA911D444@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via dae77e069e924c3b85565d602df0419c66a4a586 (commit) from 2b1d9e51c2e47a3b8c193770eb222c0713f8a5e6 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=dae77e069e924c3b85565d602df0419c66a4a586 commit dae77e069e924c3b85565d602df0419c66a4a586 Author: Kitware Robot AuthorDate: Sun Jun 30 00:01:06 2019 -0400 Commit: Kitware Robot CommitDate: Sun Jun 30 00:01:06 2019 -0400 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 48026fb..6de850d 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 15) -set(CMake_VERSION_PATCH 20190629) +set(CMake_VERSION_PATCH 20190630) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake