From kwrobot at kitware.com Tue Nov 1 00:01:06 2016 From: kwrobot at kitware.com (Kitware Robot) Date: Tue, 1 Nov 2016 00:01:06 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.7.0-rc2-378-gb9fcd34 Message-ID: <20161101040106.99C35F84CD@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 b9fcd348a703a0fb60d9b2443cd55f96956a5765 (commit) from 098a18c476b5e60b3bacc0e47f23359fc4a3ea2c (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=b9fcd348a703a0fb60d9b2443cd55f96956a5765 commit b9fcd348a703a0fb60d9b2443cd55f96956a5765 Author: Kitware Robot AuthorDate: Tue Nov 1 00:01:03 2016 -0400 Commit: Kitware Robot CommitDate: Tue Nov 1 00:01:03 2016 -0400 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 3eef512..69b4afd 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 7) -set(CMake_VERSION_PATCH 20161031) +set(CMake_VERSION_PATCH 20161101) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Tue Nov 1 09:14:14 2016 From: brad.king at kitware.com (Brad King) Date: Tue, 1 Nov 2016 09:14:14 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.7.0-rc2-380-ge27716b Message-ID: <20161101131414.F3D18F7C33@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 e27716bd420679e2958602f43a21be26eb94ffcb (commit) via 353f6362baffbcc8750b9ff9649552bf9d555a63 (commit) from b9fcd348a703a0fb60d9b2443cd55f96956a5765 (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=e27716bd420679e2958602f43a21be26eb94ffcb commit e27716bd420679e2958602f43a21be26eb94ffcb Merge: b9fcd34 353f636 Author: Brad King AuthorDate: Tue Nov 1 09:14:12 2016 -0400 Commit: CMake Topic Stage CommitDate: Tue Nov 1 09:14:12 2016 -0400 Merge topic 'ninja-windows-POST_BUILD-noop' 353f6362 Ninja: Fix POST_BUILD noop on Windows ----------------------------------------------------------------------- Summary of changes: Source/cmGlobalNinjaGenerator.cxx | 5 +++++ Source/cmGlobalNinjaGenerator.h | 3 +++ Source/cmLocalNinjaGenerator.cxx | 8 ++------ Source/cmNinjaNormalTargetGenerator.cxx | 2 +- 4 files changed, 11 insertions(+), 7 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Tue Nov 1 09:14:18 2016 From: brad.king at kitware.com (Brad King) Date: Tue, 1 Nov 2016 09:14:18 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.7.0-rc2-385-g9ceef25 Message-ID: <20161101131418.1C753F7C39@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 9ceef25ee2ebf6315e4c13dfc7102850c2807228 (commit) via 369d580937b49c1c5672ba3512c2a736581d545c (commit) via a5a3642f9292bb697176aaf1077fc98302f286b7 (commit) via d34ac22fec975a9f5b6b6b37134e1722ffa06025 (commit) via 967dcf36d07ba9b7e40383834906fe1d657456b3 (commit) from e27716bd420679e2958602f43a21be26eb94ffcb (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=9ceef25ee2ebf6315e4c13dfc7102850c2807228 commit 9ceef25ee2ebf6315e4c13dfc7102850c2807228 Merge: e27716b 369d580 Author: Brad King AuthorDate: Tue Nov 1 09:14:15 2016 -0400 Commit: CMake Topic Stage CommitDate: Tue Nov 1 09:14:15 2016 -0400 Merge topic 'intel-compile-features-windows' 369d5809 Features: Record features for Intel Compiler on Windows a5a3642f Features: Port Intel CXX features to test macros where possible d34ac22f Features: Unset Intel CXX feature temporaries 967dcf36 Intel: Remove incorrect C++98 standard compiler flag on Windows ----------------------------------------------------------------------- Summary of changes: Help/manual/cmake-compile-features.7.rst | 2 +- .../release/dev/intel-compile-features-windows.rst | 6 ++ Modules/Compiler/Intel-C-FeatureTests.cmake | 9 +-- Modules/Compiler/Intel-C.cmake | 3 +- Modules/Compiler/Intel-CXX-FeatureTests.cmake | 67 ++++++++++++-------- Modules/Compiler/Intel-CXX.cmake | 14 ++-- 6 files changed, 60 insertions(+), 41 deletions(-) create mode 100644 Help/release/dev/intel-compile-features-windows.rst hooks/post-receive -- CMake From brad.king at kitware.com Tue Nov 1 09:14:21 2016 From: brad.king at kitware.com (Brad King) Date: Tue, 1 Nov 2016 09:14:21 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.7.0-rc2-389-gba28e04 Message-ID: <20161101131421.27A6EF7C4D@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 ba28e0405e4a41158395323ace1dd0075934233e (commit) via 5214bb354b508cafc859b4a05b4e5f8ed44767e0 (commit) via 602b78aa79f6d99e775fa0a84fb441156d192833 (commit) via c58c739da7287a1cb33558f4e121ecdb23cfadd9 (commit) from 9ceef25ee2ebf6315e4c13dfc7102850c2807228 (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=ba28e0405e4a41158395323ace1dd0075934233e commit ba28e0405e4a41158395323ace1dd0075934233e Merge: 9ceef25 5214bb3 Author: Brad King AuthorDate: Tue Nov 1 09:14:19 2016 -0400 Commit: CMake Topic Stage CommitDate: Tue Nov 1 09:14:19 2016 -0400 Merge topic 'clang-tidy' 5214bb35 Avoid some copies 602b78aa Remove redundant c_str() calls c58c739d Use the empty method to check for emptiness ----------------------------------------------------------------------- Summary of changes: Source/cmAuxSourceDirectoryCommand.cxx | 2 +- Source/cmBuildCommand.cxx | 3 +-- Source/cmCoreTryCompile.cxx | 10 +++++----- Source/cmExportInstallAndroidMKGenerator.cxx | 2 +- Source/cmFLTKWrapUICommand.cxx | 4 ++-- Source/cmFileCommand.cxx | 4 ++-- Source/cmFileMonitor.cxx | 7 +++++-- Source/cmFileMonitor.h | 2 +- Source/cmGlobalUnixMakefileGenerator3.cxx | 2 +- Source/cmIncludeCommand.cxx | 4 ++-- Source/cmInstallCommand.cxx | 2 +- Source/cmLoadCommandCommand.cxx | 8 ++++---- Source/cmOutputRequiredFilesCommand.cxx | 19 ++++++++----------- Source/cmServerProtocol.cxx | 6 +++--- Source/cmSetPropertyCommand.cxx | 2 +- Source/cmSourceGroupCommand.cxx | 2 +- Source/cmSubdirCommand.cxx | 6 ++---- Source/cmTryRunCommand.cxx | 5 +++-- Source/cmUseMangledMesaCommand.cxx | 2 +- Source/cmWriteFileCommand.cxx | 2 +- 20 files changed, 46 insertions(+), 48 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Tue Nov 1 09:14:24 2016 From: brad.king at kitware.com (Brad King) Date: Tue, 1 Nov 2016 09:14:24 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.7.0-rc2-391-g9c6cf7f Message-ID: <20161101131424.4A234F7C39@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 9c6cf7fcac1f4f23ec21aeb322026d4f422760cc (commit) via 95805d725d49af665c2254f97effbe8b812239ea (commit) from ba28e0405e4a41158395323ace1dd0075934233e (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=9c6cf7fcac1f4f23ec21aeb322026d4f422760cc commit 9c6cf7fcac1f4f23ec21aeb322026d4f422760cc Merge: ba28e04 95805d7 Author: Brad King AuthorDate: Tue Nov 1 09:14:21 2016 -0400 Commit: CMake Topic Stage CommitDate: Tue Nov 1 09:14:21 2016 -0400 Merge topic 'st2-env-vars-variable' 95805d72 Sublime: Add option to specify env vars for the .sublime-project ----------------------------------------------------------------------- Summary of changes: Help/manual/cmake-variables.7.rst | 1 + Help/release/dev/st2-env-settings.rst | 6 ++++ .../variable/CMAKE_SUBLIME_TEXT_2_ENV_SETTINGS.rst | 25 ++++++++++++++ Source/cmExtraSublimeTextGenerator.cxx | 34 +++++++++++++++++++- Source/cmExtraSublimeTextGenerator.h | 1 + 5 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 Help/release/dev/st2-env-settings.rst create mode 100644 Help/variable/CMAKE_SUBLIME_TEXT_2_ENV_SETTINGS.rst hooks/post-receive -- CMake From brad.king at kitware.com Tue Nov 1 09:14:27 2016 From: brad.king at kitware.com (Brad King) Date: Tue, 1 Nov 2016 09:14:27 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.7.0-rc2-394-g01567fd Message-ID: <20161101131427.6EB1AF7C4E@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 01567fd74f1426ebab2499e5e08d33eff5435f99 (commit) via 9a58517df4168a5d928b715fcaa96fc24df9b40c (commit) via 1e4bb358946a100ea04bbc97f8195b90b44a5e9c (commit) from 9c6cf7fcac1f4f23ec21aeb322026d4f422760cc (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=01567fd74f1426ebab2499e5e08d33eff5435f99 commit 01567fd74f1426ebab2499e5e08d33eff5435f99 Merge: 9c6cf7f 9a58517 Author: Brad King AuthorDate: Tue Nov 1 09:14:25 2016 -0400 Commit: CMake Topic Stage CommitDate: Tue Nov 1 09:14:25 2016 -0400 Merge topic 'src-COMPILE_FLAGS-genex' 9a58517d Tests: Add case for Xcode per-config per-source COMPILE_FLAGS diagnostic 1e4bb358 Add generator expression support to per-source COMPILE_FLAGS ----------------------------------------------------------------------- Summary of changes: Help/prop_sf/COMPILE_FLAGS.rst | 7 +++++++ Help/release/dev/src-COMPILE_FLAGS-genex.rst | 5 +++++ Source/cmExtraSublimeTextGenerator.cxx | 6 +++++- Source/cmGlobalXCodeGenerator.cxx | 19 ++++++++++++++++++- Source/cmLocalVisualStudio7Generator.cxx | 4 +++- Source/cmMakefileTargetGenerator.cxx | 16 +++++++++------- Source/cmNinjaTargetGenerator.cxx | 10 ++++++++-- Source/cmServerProtocol.cxx | 7 ++++++- Source/cmVisualStudio10TargetGenerator.cxx | 18 ++++++++++++++++-- Tests/GeneratorExpression/CMakeLists.txt | 1 + Tests/GeneratorExpression/echo.c | 3 +++ .../PerConfigPerSourceFlags-result.txt} | 0 .../XcodeProject/PerConfigPerSourceFlags-stderr.txt | 8 ++++++++ .../XcodeProject/PerConfigPerSourceFlags.cmake | 3 +++ Tests/RunCMake/XcodeProject/RunCMakeTest.cmake | 2 ++ 15 files changed, 94 insertions(+), 15 deletions(-) create mode 100644 Help/release/dev/src-COMPILE_FLAGS-genex.rst copy Tests/RunCMake/{Android/BadSYSROOT-result.txt => XcodeProject/PerConfigPerSourceFlags-result.txt} (100%) create mode 100644 Tests/RunCMake/XcodeProject/PerConfigPerSourceFlags-stderr.txt create mode 100644 Tests/RunCMake/XcodeProject/PerConfigPerSourceFlags.cmake hooks/post-receive -- CMake From brad.king at kitware.com Tue Nov 1 09:14:30 2016 From: brad.king at kitware.com (Brad King) Date: Tue, 1 Nov 2016 09:14:30 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.7.0-rc2-396-gfa4b2e7 Message-ID: <20161101131430.787CCF7C4F@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 fa4b2e7dc3293510427fa9f9fd96c98209ebfea5 (commit) via e29f33cd20520d216a478348fcae456ec47e68be (commit) from 01567fd74f1426ebab2499e5e08d33eff5435f99 (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=fa4b2e7dc3293510427fa9f9fd96c98209ebfea5 commit fa4b2e7dc3293510427fa9f9fd96c98209ebfea5 Merge: 01567fd e29f33c Author: Brad King AuthorDate: Tue Nov 1 09:14:28 2016 -0400 Commit: CMake Topic Stage CommitDate: Tue Nov 1 09:14:28 2016 -0400 Merge topic 'FindMatlab-9.1' e29f33cd FindMatlab: Add support for Matlab 2016b (9.1) ----------------------------------------------------------------------- Summary of changes: Modules/FindMatlab.cmake | 1 + 1 file changed, 1 insertion(+) hooks/post-receive -- CMake From brad.king at kitware.com Tue Nov 1 09:14:33 2016 From: brad.king at kitware.com (Brad King) Date: Tue, 1 Nov 2016 09:14:33 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.7.0-rc2-398-gb8c5258 Message-ID: <20161101131433.90B62F7C4E@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 b8c5258b005f5dd677dc324164dbda1be4e403db (commit) via f2de70799c91924a5185a9a85ed4f5dabc47ca51 (commit) from fa4b2e7dc3293510427fa9f9fd96c98209ebfea5 (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=b8c5258b005f5dd677dc324164dbda1be4e403db commit b8c5258b005f5dd677dc324164dbda1be4e403db Merge: fa4b2e7 f2de707 Author: Brad King AuthorDate: Tue Nov 1 09:14:31 2016 -0400 Commit: CMake Topic Stage CommitDate: Tue Nov 1 09:14:31 2016 -0400 Merge topic 'FindMatlab-fix-typo' f2de7079 FindMatlab: Fix typo in matlab_add_unit_test implementation ----------------------------------------------------------------------- Summary of changes: Modules/FindMatlab.cmake | 2 +- Modules/MatlabTestsRedirect.cmake | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Tue Nov 1 09:14:36 2016 From: brad.king at kitware.com (Brad King) Date: Tue, 1 Nov 2016 09:14:36 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.7.0-rc2-400-g3573059 Message-ID: <20161101131436.5FBFDF7C51@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 357305953600b0de49f0373888c8fe5eb1e7eef4 (commit) via f2ff94958f22e36976854ebf97029614e4c460bf (commit) from b8c5258b005f5dd677dc324164dbda1be4e403db (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=357305953600b0de49f0373888c8fe5eb1e7eef4 commit 357305953600b0de49f0373888c8fe5eb1e7eef4 Merge: b8c5258 f2ff949 Author: Brad King AuthorDate: Tue Nov 1 09:14:34 2016 -0400 Commit: CMake Topic Stage CommitDate: Tue Nov 1 09:14:34 2016 -0400 Merge topic 'FindSDL-sound-fix' f2ff9495 FindSDL_sound: Fix SDL_SOUND_LIBRARIES result value ----------------------------------------------------------------------- Summary of changes: Modules/FindSDL_sound.cmake | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Tue Nov 1 09:14:39 2016 From: brad.king at kitware.com (Brad King) Date: Tue, 1 Nov 2016 09:14:39 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.7.0-rc2-403-g505f56d Message-ID: <20161101131439.7384FF7C3A@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 505f56dc91a94446b907620881f9156c9a9dfc92 (commit) via f648b9be6347046583ee795f42e39713f248a608 (commit) via e7480d670b9a20bc5d8b17db5a9427fafb212e85 (commit) from 357305953600b0de49f0373888c8fe5eb1e7eef4 (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=505f56dc91a94446b907620881f9156c9a9dfc92 commit 505f56dc91a94446b907620881f9156c9a9dfc92 Merge: 3573059 f648b9b Author: Brad King AuthorDate: Tue Nov 1 09:14:37 2016 -0400 Commit: CMake Topic Stage CommitDate: Tue Nov 1 09:14:37 2016 -0400 Merge topic 'custom-command-CROSSCOMPILING_EMULATOR' f648b9be Tests: Check that CROSSCOMPILING_EMULATOR is not used on imported targets e7480d67 Fix custom command target substitution with CROSSCOMPILING_EMULATOR ----------------------------------------------------------------------- Summary of changes: Source/cmCustomCommandGenerator.cxx | 45 ++++++++++++++------ Source/cmCustomCommandGenerator.h | 4 +- .../CrosscompilingEmulator/AddCustomCommand.cmake | 17 +++++++- .../CrosscompilingEmulator/AddCustomTarget.cmake | 16 ++++++- .../generated_exe_emulator_unexpected.cxx | 9 ++++ .../simple_src_exitsuccess.cxx | 4 -- Tests/RunCMake/pseudo_emulator_custom_command.c | 3 +- 7 files changed, 77 insertions(+), 21 deletions(-) create mode 100644 Tests/RunCMake/CrosscompilingEmulator/generated_exe_emulator_unexpected.cxx delete mode 100644 Tests/RunCMake/CrosscompilingEmulator/simple_src_exitsuccess.cxx hooks/post-receive -- CMake From brad.king at kitware.com Tue Nov 1 09:15:14 2016 From: brad.king at kitware.com (Brad King) Date: Tue, 1 Nov 2016 09:15:14 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.7.0-rc2-839-g1d3c41f Message-ID: <20161101131514.F0098F7C84@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, next has been updated via 1d3c41f925db306c60c390be89e32ddcfc81d62b (commit) via 505f56dc91a94446b907620881f9156c9a9dfc92 (commit) via 357305953600b0de49f0373888c8fe5eb1e7eef4 (commit) via b8c5258b005f5dd677dc324164dbda1be4e403db (commit) via fa4b2e7dc3293510427fa9f9fd96c98209ebfea5 (commit) via 01567fd74f1426ebab2499e5e08d33eff5435f99 (commit) via 9c6cf7fcac1f4f23ec21aeb322026d4f422760cc (commit) via ba28e0405e4a41158395323ace1dd0075934233e (commit) via 9ceef25ee2ebf6315e4c13dfc7102850c2807228 (commit) via e27716bd420679e2958602f43a21be26eb94ffcb (commit) via b9fcd348a703a0fb60d9b2443cd55f96956a5765 (commit) from d3c45a83f489137874715c4a7d0c4f6f50a9cc13 (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=1d3c41f925db306c60c390be89e32ddcfc81d62b commit 1d3c41f925db306c60c390be89e32ddcfc81d62b Merge: d3c45a8 505f56d Author: Brad King AuthorDate: Tue Nov 1 09:14:44 2016 -0400 Commit: Brad King CommitDate: Tue Nov 1 09:14:44 2016 -0400 Merge branch 'master' into next ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Tue Nov 1 09:19:46 2016 From: brad.king at kitware.com (Brad King) Date: Tue, 1 Nov 2016 09:19:46 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.7.0-rc2-406-g4c7de5d Message-ID: <20161101131946.26E73F7EDD@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 4c7de5d3940cdf7b648d89642968c95168949182 (commit) via 77413bc5db8884f36fe7c6e162507ca5a0fa8fee (commit) via 1e574618b2d2df931b41795bd0471dd0e4fc1688 (commit) from 505f56dc91a94446b907620881f9156c9a9dfc92 (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: hooks/post-receive -- CMake From brad.king at kitware.com Tue Nov 1 09:19:46 2016 From: brad.king at kitware.com (Brad King) Date: Tue, 1 Nov 2016 09:19:46 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.7.0-rc2-843-g95f5bf3 Message-ID: <20161101131946.4301EF7EE7@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, next has been updated via 95f5bf3a71a6fdb1e516e1a6e5a0cadf968337f3 (commit) via 4c7de5d3940cdf7b648d89642968c95168949182 (commit) via 77413bc5db8884f36fe7c6e162507ca5a0fa8fee (commit) via 1e574618b2d2df931b41795bd0471dd0e4fc1688 (commit) from 1d3c41f925db306c60c390be89e32ddcfc81d62b (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=95f5bf3a71a6fdb1e516e1a6e5a0cadf968337f3 commit 95f5bf3a71a6fdb1e516e1a6e5a0cadf968337f3 Merge: 1d3c41f 4c7de5d Author: Brad King AuthorDate: Tue Nov 1 09:19:35 2016 -0400 Commit: Brad King CommitDate: Tue Nov 1 09:19:35 2016 -0400 Merge branch 'master' into next ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Tue Nov 1 09:19:46 2016 From: brad.king at kitware.com (Brad King) Date: Tue, 1 Nov 2016 09:19:46 -0400 (EDT) Subject: [Cmake-commits] CMake branch, release, updated. v3.7.0-rc2-24-g77413bc Message-ID: <20161101131946.5589AF7EE8@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 77413bc5db8884f36fe7c6e162507ca5a0fa8fee (commit) via f2de70799c91924a5185a9a85ed4f5dabc47ca51 (commit) via 1e574618b2d2df931b41795bd0471dd0e4fc1688 (commit) via e29f33cd20520d216a478348fcae456ec47e68be (commit) from a316f5fd6d01ce0ba452671eb0b41812db9bf81b (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/FindMatlab.cmake | 3 ++- Modules/MatlabTestsRedirect.cmake | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Tue Nov 1 09:39:19 2016 From: brad.king at kitware.com (Brad King) Date: Tue, 1 Nov 2016 09:39:19 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.7.0-rc2-846-g15da528 Message-ID: <20161101133919.AE54DF598B@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, next has been updated via 15da528a4f90e497d8ecd3592e0c19e6aed4307f (commit) via 935041908db878163ab03f175b992981fc4b8ff3 (commit) via 542d52f95e3540953113fc66dc7a7958b9c184de (commit) from 95f5bf3a71a6fdb1e516e1a6e5a0cadf968337f3 (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=15da528a4f90e497d8ecd3592e0c19e6aed4307f commit 15da528a4f90e497d8ecd3592e0c19e6aed4307f Merge: 95f5bf3 9350419 Author: Brad King AuthorDate: Tue Nov 1 09:39:18 2016 -0400 Commit: CMake Topic Stage CommitDate: Tue Nov 1 09:39:18 2016 -0400 Merge topic 'fix-macos-sysroot' into next 93504190 Darwin: Remove deployment target version check 542d52f9 Revert "Xcode: Convert maybe unversioned OSX sysroot into versioned SDK path" https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=935041908db878163ab03f175b992981fc4b8ff3 commit 935041908db878163ab03f175b992981fc4b8ff3 Author: Gregor Jasny AuthorDate: Mon Oct 31 10:29:44 2016 +0100 Commit: Brad King CommitDate: Tue Nov 1 09:37:49 2016 -0400 Darwin: Remove deployment target version check Starting with Xcode 8 the SDK folder also contains an unversioned entry: MacOSX.sdk MacOSX10.12.sdk -> MacOSX.sdk If this unversioned path is used CMake cannot detect the SDK version. Furthermore, querying the SDK version via xcodebuild -sdk -version Path gives bogus results for the Command Line Tools installed into `/`. The OS X deployment target version and SDK version are not as tied as they once were, so this check is now more trouble than it is worth. Simply remove it. Closes: #16323 diff --git a/Modules/Platform/Darwin-Initialize.cmake b/Modules/Platform/Darwin-Initialize.cmake index 3606144..b539e45 100644 --- a/Modules/Platform/Darwin-Initialize.cmake +++ b/Modules/Platform/Darwin-Initialize.cmake @@ -113,7 +113,6 @@ set(CMAKE_OSX_SYSROOT "${_CMAKE_OSX_SYSROOT_DEFAULT}" CACHE ${_CMAKE_OSX_SYSROOT "The product will be built against the headers and libraries located inside the indicated SDK.") # Transform the cached value to something we can use. -set(_CMAKE_OSX_SYSROOT_ORIG "${CMAKE_OSX_SYSROOT}") set(_CMAKE_OSX_SYSROOT_PATH "") if(CMAKE_OSX_SYSROOT) if("x${CMAKE_OSX_SYSROOT}" MATCHES "/") @@ -122,7 +121,6 @@ if(CMAKE_OSX_SYSROOT) message(WARNING "Ignoring CMAKE_OSX_SYSROOT value:\n ${CMAKE_OSX_SYSROOT}\n" "because the directory does not exist.") set(CMAKE_OSX_SYSROOT "") - set(_CMAKE_OSX_SYSROOT_ORIG "") endif() set(_CMAKE_OSX_SYSROOT_PATH "${CMAKE_OSX_SYSROOT}") else() diff --git a/Modules/Platform/Darwin.cmake b/Modules/Platform/Darwin.cmake index bb085ac..26b12a1 100644 --- a/Modules/Platform/Darwin.cmake +++ b/Modules/Platform/Darwin.cmake @@ -64,30 +64,6 @@ if(NOT DEFINED CMAKE_INSTALL_NAME_TOOL) mark_as_advanced(CMAKE_INSTALL_NAME_TOOL) endif() -# Make sure the combination of SDK and Deployment Target are allowed -if(CMAKE_OSX_DEPLOYMENT_TARGET) - if("${_CMAKE_OSX_SYSROOT_PATH}" MATCHES "/MacOSX([0-9]+\\.[0-9]+)[^/]*\\.sdk") - set(_sdk_ver "${CMAKE_MATCH_1}") - elseif("${_CMAKE_OSX_SYSROOT_ORIG}" MATCHES "^macosx([0-9]+\\.[0-9]+)$") - set(_sdk_ver "${CMAKE_MATCH_1}") - elseif("${_CMAKE_OSX_SYSROOT_ORIG}" STREQUAL "/") - set(_sdk_ver "${_CURRENT_OSX_VERSION}") - else() - message(FATAL_ERROR - "CMAKE_OSX_DEPLOYMENT_TARGET is '${CMAKE_OSX_DEPLOYMENT_TARGET}' " - "but CMAKE_OSX_SYSROOT:\n \"${_CMAKE_OSX_SYSROOT_ORIG}\"\n" - "is not set to a MacOSX SDK with a recognized version. " - "Either set CMAKE_OSX_SYSROOT to a valid SDK or set " - "CMAKE_OSX_DEPLOYMENT_TARGET to empty.") - endif() - if(CMAKE_OSX_DEPLOYMENT_TARGET VERSION_GREATER "${_sdk_ver}") - message(FATAL_ERROR - "CMAKE_OSX_DEPLOYMENT_TARGET (${CMAKE_OSX_DEPLOYMENT_TARGET}) " - "is greater than CMAKE_OSX_SYSROOT SDK:\n ${_CMAKE_OSX_SYSROOT_ORIG}\n" - "Please set CMAKE_OSX_DEPLOYMENT_TARGET to ${_sdk_ver} or lower.") - endif() -endif() - # Enable shared library versioning. set(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-install_name") https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=542d52f95e3540953113fc66dc7a7958b9c184de commit 542d52f95e3540953113fc66dc7a7958b9c184de Author: Gregor Jasny AuthorDate: Mon Oct 31 10:25:38 2016 +0100 Commit: Brad King CommitDate: Tue Nov 1 09:31:08 2016 -0400 Revert "Xcode: Convert maybe unversioned OSX sysroot into versioned SDK path" Revert commit v3.7.0-rc1~48^2 (Xcode: Convert maybe unversioned OSX sysroot into versioned SDK path, 2016-09-25). The replacement of `else()` with `if(CMAKE_OSX_SYSROOT)` defeats the prior handling of `if("x${CMAKE_OSX_SYSROOT}" MATCHES "/")`. This causes the combination -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING="" -DCMAKE_OSX_SYSROOT:STRING=/ to not be honored and `-isysroot` to be emitted as a compiler flag universally. We will need another solution to the problem the now-reverted commit was meant to address. Closes: #16394 diff --git a/Modules/Platform/Darwin-Initialize.cmake b/Modules/Platform/Darwin-Initialize.cmake index 39374e1..3606144 100644 --- a/Modules/Platform/Darwin-Initialize.cmake +++ b/Modules/Platform/Darwin-Initialize.cmake @@ -125,10 +125,8 @@ if(CMAKE_OSX_SYSROOT) set(_CMAKE_OSX_SYSROOT_ORIG "") endif() set(_CMAKE_OSX_SYSROOT_PATH "${CMAKE_OSX_SYSROOT}") - endif() - - if(CMAKE_OSX_SYSROOT) - # Transform the (maybe unversioned) sysroot into a versioned path. + else() + # Transform the sdk name into a path. execute_process( COMMAND xcodebuild -sdk ${CMAKE_OSX_SYSROOT} -version Path OUTPUT_VARIABLE _stdout ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Tue Nov 1 09:55:44 2016 From: brad.king at kitware.com (Brad King) Date: Tue, 1 Nov 2016 09:55:44 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.7.0-rc2-852-g3a0b88c Message-ID: <20161101135544.95445F8385@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, next has been updated via 3a0b88c121e39bf66e55c5e0e5f126fd0290ab4f (commit) via bb290d80b397e2eba99982548b790c127bbcf4f5 (commit) via 468f1d46ea0b184c13589dbddd2c48709696fa51 (commit) via f2e4518a2794b278c8a3308a0f708f3977564589 (commit) via 79d1906aefd527c10e488523aaf5a7ebc38463f4 (commit) via 916c507c53546f4bacb236749934d2f53d85e48d (commit) from 15da528a4f90e497d8ecd3592e0c19e6aed4307f (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=3a0b88c121e39bf66e55c5e0e5f126fd0290ab4f commit 3a0b88c121e39bf66e55c5e0e5f126fd0290ab4f Merge: 15da528 bb290d8 Author: Brad King AuthorDate: Tue Nov 1 09:55:43 2016 -0400 Commit: CMake Topic Stage CommitDate: Tue Nov 1 09:55:43 2016 -0400 Merge topic 'compile-features-for-language-standards' into next bb290d80 Help: Document language standard meta-features 468f1d46 Features: Test cycle diagnostic with language standard meta-feature f2e4518a Features: Test feature propagation with language standard meta-feature 79d1906a WCDH: Ignore language standard meta-features 916c507c Features: Add meta-features requesting awareness of a particular standard https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bb290d80b397e2eba99982548b790c127bbcf4f5 commit bb290d80b397e2eba99982548b790c127bbcf4f5 Author: Brad King AuthorDate: Fri Oct 28 09:31:48 2016 -0400 Commit: Brad King CommitDate: Fri Oct 28 10:01:56 2016 -0400 Help: Document language standard meta-features diff --git a/Help/manual/cmake-compile-features.7.rst b/Help/manual/cmake-compile-features.7.rst index 7289e61..6018f6c 100644 --- a/Help/manual/cmake-compile-features.7.rst +++ b/Help/manual/cmake-compile-features.7.rst @@ -84,6 +84,33 @@ Feature requirements are evaluated transitively by consuming the link implementation. See :manual:`cmake-buildsystem(7)` for more on transitive behavior of build properties and usage requirements. +Requiring Language Standards +---------------------------- + +In projects that use a large number of commonly available features from +a particular language standard (e.g. C++ 11) one may specify a +meta-feature (e.g. ``cxx_std_11``) that requires use of a compiler mode +aware of that standard. This is simpler than specifying all the +features individually, but does not guarantee the existence of any +particular feature. Diagnosis of use of unsupported features will be +delayed until compile time. + +For example, if C++ 11 features are used extensively in a project's +header files, then clients must use a compiler mode aware of C++ 11 +or above. This can be requested with the code: + +.. code-block:: cmake + + target_compile_features(mylib PUBLIC cxx_std_11) + +In this example, CMake will ensure the compiler is invoked in a mode +that is aware of C++ 11 (or above), adding flags such as +``-std=gnu++11`` if necessary. This applies to sources within ``mylib`` +as well as any dependents (that may include headers from ``mylib``). + +Availability of Compiler Extensions +----------------------------------- + Because the :prop_tgt:`CXX_EXTENSIONS` target property is ``ON`` by default, CMake uses extended variants of language dialects by default, such as ``-std=gnu++11`` instead of ``-std=c++11``. That target property may be diff --git a/Help/release/dev/compile-features-for-language-standards.rst b/Help/release/dev/compile-features-for-language-standards.rst new file mode 100644 index 0000000..20473b7 --- /dev/null +++ b/Help/release/dev/compile-features-for-language-standards.rst @@ -0,0 +1,7 @@ +compile-features-for-language-standards +--------------------------------------- + +* The :manual:`Compile Features ` functionality + now offers meta-features that request compiler modes for specific language + standard levels. See :prop_gbl:`CMAKE_C_KNOWN_FEATURES` and + :prop_gbl:`CMAKE_CXX_KNOWN_FEATURES`. https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=468f1d46ea0b184c13589dbddd2c48709696fa51 commit 468f1d46ea0b184c13589dbddd2c48709696fa51 Author: Brad King AuthorDate: Fri Oct 28 09:43:34 2016 -0400 Commit: Brad King CommitDate: Fri Oct 28 10:01:55 2016 -0400 Features: Test cycle diagnostic with language standard meta-feature The `cxx_static_assert` feature may be available in C++ 98 mode of some compilers or not available at all in others. Intstead of using an individual feature to test cyclic requirement of a feature requiring C++ 11, use the `std_cxx_11` meta-feature that has exactly this meaning. diff --git a/Tests/RunCMake/CompileFeatures/LinkImplementationFeatureCycle.cmake b/Tests/RunCMake/CompileFeatures/LinkImplementationFeatureCycle.cmake index 09594bd..2d14a9e 100644 --- a/Tests/RunCMake/CompileFeatures/LinkImplementationFeatureCycle.cmake +++ b/Tests/RunCMake/CompileFeatures/LinkImplementationFeatureCycle.cmake @@ -3,13 +3,13 @@ add_library(empty1 empty.cpp) add_library(empty2 INTERFACE) add_library(empty3 INTERFACE) -target_compile_features(empty3 INTERFACE cxx_static_assert) +target_compile_features(empty3 INTERFACE cxx_std_11) target_link_libraries(empty1 # When starting, $ is '0', so 'freeze' the # CXX_STANDARD at 98 during computation. $<$:empty2> - # This would add cxx_static_assert, but that would require CXX_STANDARD = 11, + # This would add cxx_std_11, but that would require CXX_STANDARD = 11, # which is not allowed after freeze. Report an error. empty3 ) diff --git a/Tests/RunCMake/CompileFeatures/LinkImplementationFeatureCycleSolved.cmake b/Tests/RunCMake/CompileFeatures/LinkImplementationFeatureCycleSolved.cmake index bbcf4e0..a04dcec 100644 --- a/Tests/RunCMake/CompileFeatures/LinkImplementationFeatureCycleSolved.cmake +++ b/Tests/RunCMake/CompileFeatures/LinkImplementationFeatureCycleSolved.cmake @@ -3,7 +3,7 @@ add_library(empty1 empty.cpp) add_library(empty2 INTERFACE) add_library(empty3 INTERFACE) -target_compile_features(empty3 INTERFACE cxx_static_assert) +target_compile_features(empty3 INTERFACE cxx_std_11) target_link_libraries(empty1 $<$:empty2> https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f2e4518a2794b278c8a3308a0f708f3977564589 commit f2e4518a2794b278c8a3308a0f708f3977564589 Author: Brad King AuthorDate: Fri Oct 28 09:41:30 2016 -0400 Commit: Brad King CommitDate: Fri Oct 28 10:01:55 2016 -0400 Features: Test feature propagation with language standard meta-feature The `cxx_static_assert` feature may be available in C++ 98 mode of some compilers or not available at all in others. Intstead of using an individual feature to test propagation of a feature requiring C++ 11, use the `std_cxx_11` meta-feature that has exactly this meaning. diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt index 9986de0..9f61186 100644 --- a/Tests/CompileFeatures/CMakeLists.txt +++ b/Tests/CompileFeatures/CMakeLists.txt @@ -398,7 +398,7 @@ if (CMAKE_CXX_COMPILE_FEATURES) ) add_executable(CompileFeaturesGenex2 genex_test.cpp) - target_compile_features(CompileFeaturesGenex2 PRIVATE cxx_static_assert) + target_compile_features(CompileFeaturesGenex2 PRIVATE cxx_std_11) target_compile_definitions(CompileFeaturesGenex2 PRIVATE HAVE_OVERRIDE_CONTROL=$ HAVE_AUTO_TYPE=$ @@ -407,10 +407,10 @@ if (CMAKE_CXX_COMPILE_FEATURES) HAVE_INHERITING_CONSTRUCTORS_AND_FINAL=$ ) - add_library(static_assert_iface INTERFACE) - target_compile_features(static_assert_iface INTERFACE cxx_static_assert) + add_library(std_11_iface INTERFACE) + target_compile_features(std_11_iface INTERFACE cxx_std_11) add_executable(CompileFeaturesGenex3 genex_test.cpp) - target_link_libraries(CompileFeaturesGenex3 PRIVATE static_assert_iface) + target_link_libraries(CompileFeaturesGenex3 PRIVATE std_11_iface) target_compile_definitions(CompileFeaturesGenex3 PRIVATE HAVE_OVERRIDE_CONTROL=$ HAVE_AUTO_TYPE=$ https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=79d1906aefd527c10e488523aaf5a7ebc38463f4 commit 79d1906aefd527c10e488523aaf5a7ebc38463f4 Author: Brad King AuthorDate: Wed Oct 26 16:26:22 2016 -0400 Commit: Brad King CommitDate: Fri Oct 28 10:01:54 2016 -0400 WCDH: Ignore language standard meta-features The `{c,cxx}_std_*` features are meant for use with `target_compile_features` but do not make sense for use with WriteCompilerDetectionHeader. Filter them out of any requested list. diff --git a/Modules/WriteCompilerDetectionHeader.cmake b/Modules/WriteCompilerDetectionHeader.cmake index 82e8fba..a390f4b 100644 --- a/Modules/WriteCompilerDetectionHeader.cmake +++ b/Modules/WriteCompilerDetectionHeader.cmake @@ -76,6 +76,7 @@ # Available features in this version of CMake are listed in the # :prop_gbl:`CMAKE_C_KNOWN_FEATURES` and # :prop_gbl:`CMAKE_CXX_KNOWN_FEATURES` global properties. +# The ``{c,cxx}_std_*`` meta-features are ignored if requested. # # See the :manual:`cmake-compile-features(7)` manual for information on # compile features. @@ -358,7 +359,11 @@ function(write_compiler_detection_header endif() foreach(feature ${_WCD_FEATURES}) - if (feature MATCHES "^cxx_") + if (feature MATCHES "^c_std_") + # ignored + elseif (feature MATCHES "^cxx_std_") + # ignored + elseif (feature MATCHES "^cxx_") list(APPEND _langs CXX) list(APPEND CXX_features ${feature}) elseif (feature MATCHES "^c_") https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=916c507c53546f4bacb236749934d2f53d85e48d commit 916c507c53546f4bacb236749934d2f53d85e48d Author: Brad King AuthorDate: Wed Oct 26 16:11:01 2016 -0400 Commit: Brad King CommitDate: Fri Oct 28 10:01:54 2016 -0400 Features: Add meta-features requesting awareness of a particular standard A common use case of `target_compile_features` is simply to specify that the compiler should be run in a mode that is aware of e.g. C++11. Some projects simply specify a particular C++11-only feature to request this. Provide a first-class way to do this by naming features after the corresponding language standard. Record them as always available in exactly the corresponding standard level so that requesting them always ensures that standard (or higher) is used. diff --git a/Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst b/Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst index e8f4d2a..00a5104 100644 --- a/Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst +++ b/Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst @@ -14,6 +14,15 @@ compile features and a list of supported compilers. The features known to this version of CMake are: +``cxx_std_98`` + Compiler mode is aware of C++ 98. + +``cxx_std_11`` + Compiler mode is aware of C++ 11. + +``cxx_std_14`` + Compiler mode is aware of C++ 14. + ``cxx_aggregate_default_initializers`` Aggregate default initializers, as defined in N3605_. diff --git a/Help/prop_gbl/CMAKE_C_KNOWN_FEATURES.rst b/Help/prop_gbl/CMAKE_C_KNOWN_FEATURES.rst index a08af00..3707fef 100644 --- a/Help/prop_gbl/CMAKE_C_KNOWN_FEATURES.rst +++ b/Help/prop_gbl/CMAKE_C_KNOWN_FEATURES.rst @@ -13,6 +13,15 @@ compile features and a list of supported compilers. The features known to this version of CMake are: +``c_std_90`` + Compiler mode is aware of C 90. + +``c_std_99`` + Compiler mode is aware of C 99. + +``c_std_11`` + Compiler mode is aware of C 11. + ``c_function_prototypes`` Function prototypes, as defined in ``ISO/IEC 9899:1990``. diff --git a/Modules/CMakeDetermineCompileFeatures.cmake b/Modules/CMakeDetermineCompileFeatures.cmake index 5ca72cc..ea51847 100644 --- a/Modules/CMakeDetermineCompileFeatures.cmake +++ b/Modules/CMakeDetermineCompileFeatures.cmake @@ -7,9 +7,9 @@ function(cmake_determine_compile_features lang) if(lang STREQUAL C AND COMMAND cmake_record_c_compile_features) message(STATUS "Detecting ${lang} compile features") - set(CMAKE_C90_COMPILE_FEATURES) - set(CMAKE_C99_COMPILE_FEATURES) - set(CMAKE_C11_COMPILE_FEATURES) + set(CMAKE_C90_COMPILE_FEATURES c_std_90) + set(CMAKE_C99_COMPILE_FEATURES c_std_99) + set(CMAKE_C11_COMPILE_FEATURES c_std_11) include("${CMAKE_ROOT}/Modules/Internal/FeatureTesting.cmake") @@ -27,7 +27,13 @@ function(cmake_determine_compile_features lang) list(REMOVE_ITEM CMAKE_C99_COMPILE_FEATURES ${CMAKE_C90_COMPILE_FEATURES}) endif() - if(NOT CMAKE_C_COMPILE_FEATURES) + if(CMAKE_C_COMPILE_FEATURES) + list(INSERT CMAKE_C_COMPILE_FEATURES 0 + c_std_90 + c_std_99 + c_std_11 + ) + else() set(CMAKE_C_COMPILE_FEATURES ${CMAKE_C90_COMPILE_FEATURES} ${CMAKE_C99_COMPILE_FEATURES} @@ -45,9 +51,9 @@ function(cmake_determine_compile_features lang) elseif(lang STREQUAL CXX AND COMMAND cmake_record_cxx_compile_features) message(STATUS "Detecting ${lang} compile features") - set(CMAKE_CXX98_COMPILE_FEATURES) - set(CMAKE_CXX11_COMPILE_FEATURES) - set(CMAKE_CXX14_COMPILE_FEATURES) + set(CMAKE_CXX98_COMPILE_FEATURES cxx_std_98) + set(CMAKE_CXX11_COMPILE_FEATURES cxx_std_11) + set(CMAKE_CXX14_COMPILE_FEATURES cxx_std_14) include("${CMAKE_ROOT}/Modules/Internal/FeatureTesting.cmake") @@ -65,7 +71,13 @@ function(cmake_determine_compile_features lang) list(REMOVE_ITEM CMAKE_CXX11_COMPILE_FEATURES ${CMAKE_CXX98_COMPILE_FEATURES}) endif() - if(NOT CMAKE_CXX_COMPILE_FEATURES) + if(CMAKE_CXX_COMPILE_FEATURES) + list(INSERT CMAKE_CXX_COMPILE_FEATURES 0 + cxx_std_98 + cxx_std_11 + cxx_std_14 + ) + else() set(CMAKE_CXX_COMPILE_FEATURES ${CMAKE_CXX98_COMPILE_FEATURES} ${CMAKE_CXX11_COMPILE_FEATURES} diff --git a/Source/cmake.h b/Source/cmake.h index cd00c61..6e8d9c8 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -535,12 +535,18 @@ private: } #define FOR_EACH_C_FEATURE(F) \ + F(c_std_90) \ + F(c_std_99) \ + F(c_std_11) \ F(c_function_prototypes) \ F(c_restrict) \ F(c_static_assert) \ F(c_variadic_macros) #define FOR_EACH_CXX_FEATURE(F) \ + F(cxx_std_98) \ + F(cxx_std_11) \ + F(cxx_std_14) \ F(cxx_aggregate_default_initializers) \ F(cxx_alias_templates) \ F(cxx_alignas) \ diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt index 9f08523..9986de0 100644 --- a/Tests/CompileFeatures/CMakeLists.txt +++ b/Tests/CompileFeatures/CMakeLists.txt @@ -23,10 +23,12 @@ macro(run_test feature lang) endmacro() get_property(c_features GLOBAL PROPERTY CMAKE_C_KNOWN_FEATURES) +list(REMOVE_ITEM c_features c_std_90 c_std_99 c_std_11) foreach(feature ${c_features}) run_test(${feature} C) endforeach() get_property(cxx_features GLOBAL PROPERTY CMAKE_CXX_KNOWN_FEATURES) +list(REMOVE_ITEM cxx_features cxx_std_98 cxx_std_11 cxx_std_14) foreach(feature ${cxx_features}) run_test(${feature} CXX) endforeach() ----------------------------------------------------------------------- Summary of changes: Help/manual/cmake-compile-features.7.rst | 27 +++++++++++++++++++ Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst | 9 +++++++ Help/prop_gbl/CMAKE_C_KNOWN_FEATURES.rst | 9 +++++++ .../compile-features-for-language-standards.rst | 7 +++++ Modules/CMakeDetermineCompileFeatures.cmake | 28 ++++++++++++++------ Modules/WriteCompilerDetectionHeader.cmake | 7 ++++- Source/cmake.h | 6 +++++ Tests/CompileFeatures/CMakeLists.txt | 10 ++++--- .../LinkImplementationFeatureCycle.cmake | 4 +-- .../LinkImplementationFeatureCycleSolved.cmake | 2 +- 10 files changed, 93 insertions(+), 16 deletions(-) create mode 100644 Help/release/dev/compile-features-for-language-standards.rst hooks/post-receive -- CMake From brad.king at kitware.com Tue Nov 1 10:01:02 2016 From: brad.king at kitware.com (Brad King) Date: Tue, 1 Nov 2016 10:01:02 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.7.0-rc2-854-g9759978 Message-ID: <20161101140102.124CDF8448@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, next has been updated via 97599787929fd197241dc3e4adcbf852bdf9f76d (commit) via cfbf857b22540059e6d5a6c271af4aa0314aad7e (commit) from 3a0b88c121e39bf66e55c5e0e5f126fd0290ab4f (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=97599787929fd197241dc3e4adcbf852bdf9f76d commit 97599787929fd197241dc3e4adcbf852bdf9f76d Merge: 3a0b88c cfbf857 Author: Brad King AuthorDate: Tue Nov 1 10:01:01 2016 -0400 Commit: CMake Topic Stage CommitDate: Tue Nov 1 10:01:01 2016 -0400 Merge topic 'fix_compiler_arg1' into next cfbf857b cmRulePlaceholderExpander: Fix CMAKE__COMPILER_ARG1 replacement https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=cfbf857b22540059e6d5a6c271af4aa0314aad7e commit cfbf857b22540059e6d5a6c271af4aa0314aad7e Author: Zack Galbreath AuthorDate: Mon Oct 31 15:58:08 2016 -0400 Commit: Brad King CommitDate: Tue Nov 1 10:00:24 2016 -0400 cmRulePlaceholderExpander: Fix CMAKE__COMPILER_ARG1 replacement Refactoring in commit b29425f7 (cmLocalGenerator: Populate a container of mappings for replacements, 2016-10-09) broke substitution of this placeholder by storing the wrong key in the new replacement map. Use the proper key, `CMAKE__COMPILER_ARG1`. diff --git a/Source/cmRulePlaceholderExpander.cxx b/Source/cmRulePlaceholderExpander.cxx index 361321e..75ac54d 100644 --- a/Source/cmRulePlaceholderExpander.cxx +++ b/Source/cmRulePlaceholderExpander.cxx @@ -212,7 +212,7 @@ std::string cmRulePlaceholderExpander::ExpandRuleVariable( std::string ret = outputConverter->ConvertToOutputForExisting( this->VariableMappings["CMAKE_" + compIt->second + "_COMPILER"]); std::string const& compilerArg1 = - this->VariableMappings[compIt->first + "_COMPILER_ARG1"]; + this->VariableMappings["CMAKE_" + compIt->second + "_COMPILER_ARG1"]; std::string const& compilerTarget = this->VariableMappings["CMAKE_" + compIt->second + "_COMPILER_TARGET"]; std::string const& compilerOptionTarget = ----------------------------------------------------------------------- Summary of changes: Source/cmRulePlaceholderExpander.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Tue Nov 1 10:18:30 2016 From: brad.king at kitware.com (Brad King) Date: Tue, 1 Nov 2016 10:18:30 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.7.0-rc2-856-g2b40bc2 Message-ID: <20161101141830.D86EBF7F54@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, next has been updated via 2b40bc240e51585f5184d057146d2e4da2fbed84 (commit) via 8444b984a29392c32a13521cc0e3d40788cc9530 (commit) from 97599787929fd197241dc3e4adcbf852bdf9f76d (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=2b40bc240e51585f5184d057146d2e4da2fbed84 commit 2b40bc240e51585f5184d057146d2e4da2fbed84 Merge: 9759978 8444b98 Author: Brad King AuthorDate: Tue Nov 1 10:18:30 2016 -0400 Commit: CMake Topic Stage CommitDate: Tue Nov 1 10:18:30 2016 -0400 Merge topic 'UseSWIG-SWIG_OUTFILE_DIR' into next 8444b984 UseSWIG: Add option to specify swig output file directory https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8444b984a29392c32a13521cc0e3d40788cc9530 commit 8444b984a29392c32a13521cc0e3d40788cc9530 Author: Cong Zhang AuthorDate: Sun Oct 30 23:56:37 2016 +0800 Commit: Brad King CommitDate: Tue Nov 1 10:10:08 2016 -0400 UseSWIG: Add option to specify swig output file directory `swig` has two output-related options: * `-o `: Set name of C/C++ output file to * `-outdir `: Set language-specific files output directory to We already have `CMAKE_SWIG_OUTDIR` for the latter. Add a new `SWIG_OUTFILE_DIR` option for the former. diff --git a/Help/release/dev/UseSWIG-SWIG_OUTFILE_DIR.rst b/Help/release/dev/UseSWIG-SWIG_OUTFILE_DIR.rst new file mode 100644 index 0000000..c001a88 --- /dev/null +++ b/Help/release/dev/UseSWIG-SWIG_OUTFILE_DIR.rst @@ -0,0 +1,6 @@ +UseSWIG-SWIG_OUTFILE_DIR +------------------------ + +* The :module:`UseSWIG` module ``swig_add_source_to_module`` command + learned a new ``SWIG_OUTFILE_DIR`` option to control the output + file location (``swig -o``). diff --git a/Modules/UseSWIG.cmake b/Modules/UseSWIG.cmake index d242f87..2df0011 100644 --- a/Modules/UseSWIG.cmake +++ b/Modules/UseSWIG.cmake @@ -36,8 +36,11 @@ # # CMAKE_SWIG_FLAGS can be used to add special flags to all swig calls. # -# Another special variable is CMAKE_SWIG_OUTDIR, it allows one to specify -# where to write all the swig generated module (swig -outdir option) +# CMAKE_SWIG_OUTDIR allows one to specify where to write +# the language specific files (swig -outdir option). +# +# SWIG_OUTFILE_DIR allows one to specify where to write the output file +# (swig -o option). If not specified, CMAKE_SWIG_OUTDIR is used. # # The name-specific variable SWIG_MODULE__EXTRA_DEPS may be used to specify extra # dependencies for the generated modules. @@ -142,6 +145,13 @@ macro(SWIG_ADD_SOURCE_TO_MODULE name outfiles infile) else() set(swig_outdir ${CMAKE_CURRENT_BINARY_DIR}) endif() + + if(SWIG_OUTFILE_DIR) + set(swig_outfile_dir ${SWIG_OUTFILE_DIR}) + else() + set(swig_outfile_dir ${swig_outdir}) + endif() + if (NOT SWIG_MODULE_${name}_NOPROXY) SWIG_GET_EXTRA_OUTPUT_FILES(${SWIG_MODULE_${name}_LANGUAGE} swig_extra_generated_files @@ -149,7 +159,7 @@ macro(SWIG_ADD_SOURCE_TO_MODULE name outfiles infile) "${swig_source_file_fullname}") endif() set(swig_generated_file_fullname - "${swig_outdir}/${swig_source_file_name_we}") + "${swig_outfile_dir}/${swig_source_file_name_we}") # add the language into the name of the file (i.e. TCL_wrap) # this allows for the same .i file to be wrapped into different languages string(APPEND swig_generated_file_fullname ----------------------------------------------------------------------- Summary of changes: Help/release/dev/UseSWIG-SWIG_OUTFILE_DIR.rst | 6 ++++++ Modules/UseSWIG.cmake | 16 +++++++++++++--- 2 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 Help/release/dev/UseSWIG-SWIG_OUTFILE_DIR.rst hooks/post-receive -- CMake From brad.king at kitware.com Tue Nov 1 10:19:28 2016 From: brad.king at kitware.com (Brad King) Date: Tue, 1 Nov 2016 10:19:28 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.7.0-rc2-858-gbbfdde3 Message-ID: <20161101141928.E9E4DF7FAC@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, next has been updated via bbfdde3378281d2764025aef0ee965b1806397ae (commit) via c75b8910a440f538c3595a7a738b50b71a6636d6 (commit) from 2b40bc240e51585f5184d057146d2e4da2fbed84 (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=bbfdde3378281d2764025aef0ee965b1806397ae commit bbfdde3378281d2764025aef0ee965b1806397ae Merge: 2b40bc2 c75b891 Author: Brad King AuthorDate: Tue Nov 1 10:19:28 2016 -0400 Commit: CMake Topic Stage CommitDate: Tue Nov 1 10:19:28 2016 -0400 Merge topic 'CPackDeb-doc-typos' into next c75b8910 CPackDeb: fix copy-n-paste typos in documentation https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c75b8910a440f538c3595a7a738b50b71a6636d6 commit c75b8910a440f538c3595a7a738b50b71a6636d6 Author: Alex Turbov AuthorDate: Tue Nov 1 22:07:22 2016 +0800 Commit: Brad King CommitDate: Tue Nov 1 10:13:20 2016 -0400 CPackDeb: fix copy-n-paste typos in documentation diff --git a/Modules/CPackDeb.cmake b/Modules/CPackDeb.cmake index 653283c..4a7a6b8 100644 --- a/Modules/CPackDeb.cmake +++ b/Modules/CPackDeb.cmake @@ -32,11 +32,11 @@ # - https://cmake.org/Wiki/CMake:CPackConfiguration # - https://cmake.org/Wiki/CMake:CPackPackageGenerators#DEB_.28UNIX_only.29 # -# List of CPackRPM specific variables: +# List of CPackDEB specific variables: # # .. variable:: CPACK_DEB_PACKAGE_COMPONENT # -# Enable component packaging for CPackRPM +# Enable component packaging for CPackDEB # # * Mandatory : NO # * Default : OFF @@ -616,7 +616,7 @@ function(cpack_deb_prepare_package_vars) find_program(SHLIBDEPS_EXECUTABLE dpkg-shlibdeps) if(SHLIBDEPS_EXECUTABLE) - # Check version of the dpkg-shlibdeps tool using CPackRPM method + # Check version of the dpkg-shlibdeps tool using CPackDEB method execute_process(COMMAND env LC_ALL=C ${SHLIBDEPS_EXECUTABLE} --version OUTPUT_VARIABLE _TMP_VERSION ERROR_QUIET ----------------------------------------------------------------------- Summary of changes: Modules/CPackDeb.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Tue Nov 1 10:54:22 2016 From: brad.king at kitware.com (Brad King) Date: Tue, 1 Nov 2016 10:54:22 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.7.0-rc2-861-gee0ce4c Message-ID: <20161101145422.C840FF8430@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, next has been updated via ee0ce4c1dc907edd93716ff21b631c544680dca2 (commit) via 311d0376e2312d3539bd997160f880cf58743834 (commit) via 77e78af1a2f10d5ec349d0a46118cddd8ec7a539 (commit) from bbfdde3378281d2764025aef0ee965b1806397ae (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=ee0ce4c1dc907edd93716ff21b631c544680dca2 commit ee0ce4c1dc907edd93716ff21b631c544680dca2 Merge: bbfdde3 311d037 Author: Brad King AuthorDate: Tue Nov 1 10:54:22 2016 -0400 Commit: CMake Topic Stage CommitDate: Tue Nov 1 10:54:22 2016 -0400 Merge topic 'doc-tweaks' into next 311d0376 Help: Document error behavior of file(REMOVE/REMOVE_RECURSE) 77e78af1 Help: Clarify how to run sequential commands in execute_process https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=311d0376e2312d3539bd997160f880cf58743834 commit 311d0376e2312d3539bd997160f880cf58743834 Author: Christian Fetzer AuthorDate: Tue Nov 1 10:23:15 2016 +0100 Commit: Christian Fetzer CommitDate: Tue Nov 1 10:25:18 2016 +0100 Help: Document error behavior of file(REMOVE/REMOVE_RECURSE) Clarifies that there is no need to surround file(REMOVE/REMOVE_RECURSE) calls by `if(EXISTS)` as non existent files are silently ignored. diff --git a/Help/command/file.rst b/Help/command/file.rst index 77e9f62..8da46cb 100644 --- a/Help/command/file.rst +++ b/Help/command/file.rst @@ -153,7 +153,8 @@ Move a file or directory within a filesystem from ```` to file(REMOVE_RECURSE [...]) Remove the given files. The ``REMOVE_RECURSE`` mode will remove the given -files and directories, also non-empty directories +files and directories, also non-empty directories. No error is emitted if a +given file does not exist. ------------------------------------------------------------------------------ https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=77e78af1a2f10d5ec349d0a46118cddd8ec7a539 commit 77e78af1a2f10d5ec349d0a46118cddd8ec7a539 Author: Christian Fetzer AuthorDate: Tue Nov 1 10:19:00 2016 +0100 Commit: Christian Fetzer CommitDate: Tue Nov 1 10:25:18 2016 +0100 Help: Clarify how to run sequential commands in execute_process The execute_process command starts all commands in parallel (in order for the piping to work). Mention this explicitly and also add a note about how to execute commands sequentially. diff --git a/Help/command/execute_process.rst b/Help/command/execute_process.rst index ca44b53..e9a5eb0 100644 --- a/Help/command/execute_process.rst +++ b/Help/command/execute_process.rst @@ -20,7 +20,7 @@ Execute one or more child processes. [OUTPUT_STRIP_TRAILING_WHITESPACE] [ERROR_STRIP_TRAILING_WHITESPACE]) -Runs the given sequence of one or more commands with the standard +Runs the given sequence of one or more commands in parallel with the standard output of each process piped to the standard input of the next. A single standard error pipe is used for all processes. @@ -36,6 +36,9 @@ Options: (Use the ``INPUT_*``, ``OUTPUT_*``, and ``ERROR_*`` options to redirect stdin, stdout, and stderr.) + If a sequential execution of multiple commands is required, use multiple + :command:`execute_process` calls with a single ``COMMAND`` argument. + ``WORKING_DIRECTORY`` The named directory will be set as the current working directory of the child processes. ----------------------------------------------------------------------- Summary of changes: Help/command/execute_process.rst | 5 ++++- Help/command/file.rst | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Tue Nov 1 10:58:40 2016 From: brad.king at kitware.com (Brad King) Date: Tue, 1 Nov 2016 10:58:40 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.7.0-rc2-408-g2fb83cc Message-ID: <20161101145840.28C8AF84E6@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 2fb83cc8710898e1fc802b68c9d55c456913719a (commit) via c75b8910a440f538c3595a7a738b50b71a6636d6 (commit) from 4c7de5d3940cdf7b648d89642968c95168949182 (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=2fb83cc8710898e1fc802b68c9d55c456913719a commit 2fb83cc8710898e1fc802b68c9d55c456913719a Merge: 4c7de5d c75b891 Author: Brad King AuthorDate: Tue Nov 1 10:58:37 2016 -0400 Commit: CMake Topic Stage CommitDate: Tue Nov 1 10:58:37 2016 -0400 Merge topic 'CPackDeb-doc-typos' c75b8910 CPackDeb: fix copy-n-paste typos in documentation ----------------------------------------------------------------------- Summary of changes: Modules/CPackDeb.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Tue Nov 1 10:58:42 2016 From: brad.king at kitware.com (Brad King) Date: Tue, 1 Nov 2016 10:58:42 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.7.0-rc2-411-gc88a078 Message-ID: <20161101145842.EA49AF84E5@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 c88a078d690f72caea53b0723e8393b83f1b0b6f (commit) via 311d0376e2312d3539bd997160f880cf58743834 (commit) via 77e78af1a2f10d5ec349d0a46118cddd8ec7a539 (commit) from 2fb83cc8710898e1fc802b68c9d55c456913719a (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=c88a078d690f72caea53b0723e8393b83f1b0b6f commit c88a078d690f72caea53b0723e8393b83f1b0b6f Merge: 2fb83cc 311d037 Author: Brad King AuthorDate: Tue Nov 1 10:58:40 2016 -0400 Commit: CMake Topic Stage CommitDate: Tue Nov 1 10:58:40 2016 -0400 Merge topic 'doc-tweaks' 311d0376 Help: Document error behavior of file(REMOVE/REMOVE_RECURSE) 77e78af1 Help: Clarify how to run sequential commands in execute_process ----------------------------------------------------------------------- Summary of changes: Help/command/execute_process.rst | 5 ++++- Help/command/file.rst | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Tue Nov 1 10:59:14 2016 From: brad.king at kitware.com (Brad King) Date: Tue, 1 Nov 2016 10:59:14 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.7.0-rc2-864-ge0af67b Message-ID: <20161101145914.A7BA4F84F2@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, next has been updated via e0af67b4fc05970cea3007f0ae4b97d5e3f512d4 (commit) via c88a078d690f72caea53b0723e8393b83f1b0b6f (commit) via 2fb83cc8710898e1fc802b68c9d55c456913719a (commit) from ee0ce4c1dc907edd93716ff21b631c544680dca2 (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=e0af67b4fc05970cea3007f0ae4b97d5e3f512d4 commit e0af67b4fc05970cea3007f0ae4b97d5e3f512d4 Merge: ee0ce4c c88a078 Author: Brad King AuthorDate: Tue Nov 1 10:58:55 2016 -0400 Commit: Brad King CommitDate: Tue Nov 1 10:58:55 2016 -0400 Merge branch 'master' into next ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From marcus.hanwell at kitware.com Tue Nov 1 13:41:25 2016 From: marcus.hanwell at kitware.com (Marcus D. Hanwell) Date: Tue, 1 Nov 2016 13:41:25 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.7.0-rc2-866-g23378e8 Message-ID: <20161101174126.05A84F79DA@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, next has been updated via 23378e88aca447aacce995fb6433cb25ba958c9a (commit) via ecc74c41abd21ef2c0c8d34124a29f9201f06927 (commit) from e0af67b4fc05970cea3007f0ae4b97d5e3f512d4 (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=23378e88aca447aacce995fb6433cb25ba958c9a commit 23378e88aca447aacce995fb6433cb25ba958c9a Merge: e0af67b ecc74c4 Author: Marcus D. Hanwell AuthorDate: Tue Nov 1 13:41:25 2016 -0400 Commit: CMake Topic Stage CommitDate: Tue Nov 1 13:41:25 2016 -0400 Merge topic 'find-qt5-docs' into next ecc74c41 Update Qt 5 find_package call to use COMPONENTS https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ecc74c41abd21ef2c0c8d34124a29f9201f06927 commit ecc74c41abd21ef2c0c8d34124a29f9201f06927 Author: Marcus D. Hanwell AuthorDate: Tue Nov 1 12:44:34 2016 -0400 Commit: Marcus D. Hanwell CommitDate: Tue Nov 1 12:44:34 2016 -0400 Update Qt 5 find_package call to use COMPONENTS diff --git a/Help/manual/cmake-qt.7.rst b/Help/manual/cmake-qt.7.rst index e8a2c1e..bd0a984 100644 --- a/Help/manual/cmake-qt.7.rst +++ b/Help/manual/cmake-qt.7.rst @@ -29,7 +29,7 @@ Qt 4 and Qt 5 may be used together in the same set(CMAKE_AUTOMOC ON) set(CMAKE_INCLUDE_CURRENT_DIR ON) - find_package(Qt5Widgets REQUIRED) + find_package(Qt5 COMPONENTS Widgets REQUIRED) add_executable(publisher publisher.cpp) target_link_libraries(publisher Qt5::Widgets Qt5::DBus) ----------------------------------------------------------------------- Summary of changes: Help/manual/cmake-qt.7.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Tue Nov 1 14:08:13 2016 From: brad.king at kitware.com (Brad King) Date: Tue, 1 Nov 2016 14:08:13 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.7.0-rc2-868-g64f718b Message-ID: <20161101180815.6B869F89E0@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, next has been updated via 64f718b310bbf299959b5b91949ade424e68ee1b (commit) via ff11989cc3f11ebaf0584ac4fba44c67222ffbcc (commit) from 23378e88aca447aacce995fb6433cb25ba958c9a (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=64f718b310bbf299959b5b91949ade424e68ee1b commit 64f718b310bbf299959b5b91949ade424e68ee1b Merge: 23378e8 ff11989 Author: Brad King AuthorDate: Tue Nov 1 14:08:11 2016 -0400 Commit: CMake Topic Stage CommitDate: Tue Nov 1 14:08:11 2016 -0400 Merge topic 'find-qt5-docs' into next ff11989c Help: Update example Qt 5 find_package call to use COMPONENTS https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ff11989cc3f11ebaf0584ac4fba44c67222ffbcc commit ff11989cc3f11ebaf0584ac4fba44c67222ffbcc Author: Marcus D. Hanwell AuthorDate: Tue Nov 1 12:44:34 2016 -0400 Commit: Brad King CommitDate: Tue Nov 1 14:06:49 2016 -0400 Help: Update example Qt 5 find_package call to use COMPONENTS diff --git a/Help/manual/cmake-qt.7.rst b/Help/manual/cmake-qt.7.rst index e8a2c1e..bd0a984 100644 --- a/Help/manual/cmake-qt.7.rst +++ b/Help/manual/cmake-qt.7.rst @@ -29,7 +29,7 @@ Qt 4 and Qt 5 may be used together in the same set(CMAKE_AUTOMOC ON) set(CMAKE_INCLUDE_CURRENT_DIR ON) - find_package(Qt5Widgets REQUIRED) + find_package(Qt5 COMPONENTS Widgets REQUIRED) add_executable(publisher publisher.cpp) target_link_libraries(publisher Qt5::Widgets Qt5::DBus) ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Tue Nov 1 14:10:07 2016 From: brad.king at kitware.com (Brad King) Date: Tue, 1 Nov 2016 14:10:07 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.7.0-rc2-413-g713424a Message-ID: <20161101181007.C5FEFF7535@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 713424ad207aa0f5e01f8c16b2ee1c442a91893a (commit) via ff11989cc3f11ebaf0584ac4fba44c67222ffbcc (commit) from c88a078d690f72caea53b0723e8393b83f1b0b6f (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=713424ad207aa0f5e01f8c16b2ee1c442a91893a commit 713424ad207aa0f5e01f8c16b2ee1c442a91893a Merge: c88a078 ff11989 Author: Brad King AuthorDate: Tue Nov 1 14:10:05 2016 -0400 Commit: CMake Topic Stage CommitDate: Tue Nov 1 14:10:05 2016 -0400 Merge topic 'find-qt5-docs' ff11989c Help: Update example Qt 5 find_package call to use COMPONENTS ----------------------------------------------------------------------- Summary of changes: Help/manual/cmake-qt.7.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Tue Nov 1 14:10:20 2016 From: brad.king at kitware.com (Brad King) Date: Tue, 1 Nov 2016 14:10:20 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.7.0-rc2-870-g4008f1f Message-ID: <20161101181020.CCCC4F769C@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, next has been updated via 4008f1f1d1ee1ae9f1f16d555aee3ea40b4f7cc8 (commit) via 713424ad207aa0f5e01f8c16b2ee1c442a91893a (commit) from 64f718b310bbf299959b5b91949ade424e68ee1b (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=4008f1f1d1ee1ae9f1f16d555aee3ea40b4f7cc8 commit 4008f1f1d1ee1ae9f1f16d555aee3ea40b4f7cc8 Merge: 64f718b 713424a Author: Brad King AuthorDate: Tue Nov 1 14:10:13 2016 -0400 Commit: Brad King CommitDate: Tue Nov 1 14:10:13 2016 -0400 Merge branch 'master' into next ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From kwrobot at kitware.com Wed Nov 2 00:01:07 2016 From: kwrobot at kitware.com (Kitware Robot) Date: Wed, 2 Nov 2016 00:01:07 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.7.0-rc2-414-gff957bc Message-ID: <20161102040107.BBE45F8135@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 ff957bc1e11278b3152c4f4b0732fc9667dc42e3 (commit) from 713424ad207aa0f5e01f8c16b2ee1c442a91893a (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=ff957bc1e11278b3152c4f4b0732fc9667dc42e3 commit ff957bc1e11278b3152c4f4b0732fc9667dc42e3 Author: Kitware Robot AuthorDate: Wed Nov 2 00:01:04 2016 -0400 Commit: Kitware Robot CommitDate: Wed Nov 2 00:01:04 2016 -0400 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 69b4afd..891a011 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 7) -set(CMake_VERSION_PATCH 20161101) +set(CMake_VERSION_PATCH 20161102) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Wed Nov 2 08:26:37 2016 From: brad.king at kitware.com (Brad King) Date: Wed, 2 Nov 2016 08:26:37 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.7.0-rc2-872-g7cb0f78 Message-ID: <20161102122637.EC038F852F@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, next has been updated via 7cb0f785fcffb32141a4e643fd354d2f86596534 (commit) via 0fb4869a78bad0c529bbf8d59ef91d47ac19384f (commit) from 4008f1f1d1ee1ae9f1f16d555aee3ea40b4f7cc8 (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=7cb0f785fcffb32141a4e643fd354d2f86596534 commit 7cb0f785fcffb32141a4e643fd354d2f86596534 Merge: 4008f1f 0fb4869 Author: Brad King AuthorDate: Wed Nov 2 08:26:36 2016 -0400 Commit: CMake Topic Stage CommitDate: Wed Nov 2 08:26:36 2016 -0400 Merge topic 'compile-features-for-language-standards' into next 0fb4869a Revert topic 'compile-features-for-language-standards' https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0fb4869a78bad0c529bbf8d59ef91d47ac19384f commit 0fb4869a78bad0c529bbf8d59ef91d47ac19384f Author: Brad King AuthorDate: Wed Nov 2 08:26:02 2016 -0400 Commit: Brad King CommitDate: Wed Nov 2 08:26:02 2016 -0400 Revert topic 'compile-features-for-language-standards' It needs to be revised and restored later. diff --git a/Help/manual/cmake-compile-features.7.rst b/Help/manual/cmake-compile-features.7.rst index 6018f6c..7289e61 100644 --- a/Help/manual/cmake-compile-features.7.rst +++ b/Help/manual/cmake-compile-features.7.rst @@ -84,33 +84,6 @@ Feature requirements are evaluated transitively by consuming the link implementation. See :manual:`cmake-buildsystem(7)` for more on transitive behavior of build properties and usage requirements. -Requiring Language Standards ----------------------------- - -In projects that use a large number of commonly available features from -a particular language standard (e.g. C++ 11) one may specify a -meta-feature (e.g. ``cxx_std_11``) that requires use of a compiler mode -aware of that standard. This is simpler than specifying all the -features individually, but does not guarantee the existence of any -particular feature. Diagnosis of use of unsupported features will be -delayed until compile time. - -For example, if C++ 11 features are used extensively in a project's -header files, then clients must use a compiler mode aware of C++ 11 -or above. This can be requested with the code: - -.. code-block:: cmake - - target_compile_features(mylib PUBLIC cxx_std_11) - -In this example, CMake will ensure the compiler is invoked in a mode -that is aware of C++ 11 (or above), adding flags such as -``-std=gnu++11`` if necessary. This applies to sources within ``mylib`` -as well as any dependents (that may include headers from ``mylib``). - -Availability of Compiler Extensions ------------------------------------ - Because the :prop_tgt:`CXX_EXTENSIONS` target property is ``ON`` by default, CMake uses extended variants of language dialects by default, such as ``-std=gnu++11`` instead of ``-std=c++11``. That target property may be diff --git a/Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst b/Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst index 00a5104..e8f4d2a 100644 --- a/Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst +++ b/Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst @@ -14,15 +14,6 @@ compile features and a list of supported compilers. The features known to this version of CMake are: -``cxx_std_98`` - Compiler mode is aware of C++ 98. - -``cxx_std_11`` - Compiler mode is aware of C++ 11. - -``cxx_std_14`` - Compiler mode is aware of C++ 14. - ``cxx_aggregate_default_initializers`` Aggregate default initializers, as defined in N3605_. diff --git a/Help/prop_gbl/CMAKE_C_KNOWN_FEATURES.rst b/Help/prop_gbl/CMAKE_C_KNOWN_FEATURES.rst index 3707fef..a08af00 100644 --- a/Help/prop_gbl/CMAKE_C_KNOWN_FEATURES.rst +++ b/Help/prop_gbl/CMAKE_C_KNOWN_FEATURES.rst @@ -13,15 +13,6 @@ compile features and a list of supported compilers. The features known to this version of CMake are: -``c_std_90`` - Compiler mode is aware of C 90. - -``c_std_99`` - Compiler mode is aware of C 99. - -``c_std_11`` - Compiler mode is aware of C 11. - ``c_function_prototypes`` Function prototypes, as defined in ``ISO/IEC 9899:1990``. diff --git a/Help/release/dev/compile-features-for-language-standards.rst b/Help/release/dev/compile-features-for-language-standards.rst deleted file mode 100644 index 20473b7..0000000 --- a/Help/release/dev/compile-features-for-language-standards.rst +++ /dev/null @@ -1,7 +0,0 @@ -compile-features-for-language-standards ---------------------------------------- - -* The :manual:`Compile Features ` functionality - now offers meta-features that request compiler modes for specific language - standard levels. See :prop_gbl:`CMAKE_C_KNOWN_FEATURES` and - :prop_gbl:`CMAKE_CXX_KNOWN_FEATURES`. diff --git a/Modules/CMakeDetermineCompileFeatures.cmake b/Modules/CMakeDetermineCompileFeatures.cmake index ea51847..5ca72cc 100644 --- a/Modules/CMakeDetermineCompileFeatures.cmake +++ b/Modules/CMakeDetermineCompileFeatures.cmake @@ -7,9 +7,9 @@ function(cmake_determine_compile_features lang) if(lang STREQUAL C AND COMMAND cmake_record_c_compile_features) message(STATUS "Detecting ${lang} compile features") - set(CMAKE_C90_COMPILE_FEATURES c_std_90) - set(CMAKE_C99_COMPILE_FEATURES c_std_99) - set(CMAKE_C11_COMPILE_FEATURES c_std_11) + set(CMAKE_C90_COMPILE_FEATURES) + set(CMAKE_C99_COMPILE_FEATURES) + set(CMAKE_C11_COMPILE_FEATURES) include("${CMAKE_ROOT}/Modules/Internal/FeatureTesting.cmake") @@ -27,13 +27,7 @@ function(cmake_determine_compile_features lang) list(REMOVE_ITEM CMAKE_C99_COMPILE_FEATURES ${CMAKE_C90_COMPILE_FEATURES}) endif() - if(CMAKE_C_COMPILE_FEATURES) - list(INSERT CMAKE_C_COMPILE_FEATURES 0 - c_std_90 - c_std_99 - c_std_11 - ) - else() + if(NOT CMAKE_C_COMPILE_FEATURES) set(CMAKE_C_COMPILE_FEATURES ${CMAKE_C90_COMPILE_FEATURES} ${CMAKE_C99_COMPILE_FEATURES} @@ -51,9 +45,9 @@ function(cmake_determine_compile_features lang) elseif(lang STREQUAL CXX AND COMMAND cmake_record_cxx_compile_features) message(STATUS "Detecting ${lang} compile features") - set(CMAKE_CXX98_COMPILE_FEATURES cxx_std_98) - set(CMAKE_CXX11_COMPILE_FEATURES cxx_std_11) - set(CMAKE_CXX14_COMPILE_FEATURES cxx_std_14) + set(CMAKE_CXX98_COMPILE_FEATURES) + set(CMAKE_CXX11_COMPILE_FEATURES) + set(CMAKE_CXX14_COMPILE_FEATURES) include("${CMAKE_ROOT}/Modules/Internal/FeatureTesting.cmake") @@ -71,13 +65,7 @@ function(cmake_determine_compile_features lang) list(REMOVE_ITEM CMAKE_CXX11_COMPILE_FEATURES ${CMAKE_CXX98_COMPILE_FEATURES}) endif() - if(CMAKE_CXX_COMPILE_FEATURES) - list(INSERT CMAKE_CXX_COMPILE_FEATURES 0 - cxx_std_98 - cxx_std_11 - cxx_std_14 - ) - else() + if(NOT CMAKE_CXX_COMPILE_FEATURES) set(CMAKE_CXX_COMPILE_FEATURES ${CMAKE_CXX98_COMPILE_FEATURES} ${CMAKE_CXX11_COMPILE_FEATURES} diff --git a/Modules/WriteCompilerDetectionHeader.cmake b/Modules/WriteCompilerDetectionHeader.cmake index a390f4b..82e8fba 100644 --- a/Modules/WriteCompilerDetectionHeader.cmake +++ b/Modules/WriteCompilerDetectionHeader.cmake @@ -76,7 +76,6 @@ # Available features in this version of CMake are listed in the # :prop_gbl:`CMAKE_C_KNOWN_FEATURES` and # :prop_gbl:`CMAKE_CXX_KNOWN_FEATURES` global properties. -# The ``{c,cxx}_std_*`` meta-features are ignored if requested. # # See the :manual:`cmake-compile-features(7)` manual for information on # compile features. @@ -359,11 +358,7 @@ function(write_compiler_detection_header endif() foreach(feature ${_WCD_FEATURES}) - if (feature MATCHES "^c_std_") - # ignored - elseif (feature MATCHES "^cxx_std_") - # ignored - elseif (feature MATCHES "^cxx_") + if (feature MATCHES "^cxx_") list(APPEND _langs CXX) list(APPEND CXX_features ${feature}) elseif (feature MATCHES "^c_") diff --git a/Source/cmake.h b/Source/cmake.h index 6e8d9c8..cd00c61 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -535,18 +535,12 @@ private: } #define FOR_EACH_C_FEATURE(F) \ - F(c_std_90) \ - F(c_std_99) \ - F(c_std_11) \ F(c_function_prototypes) \ F(c_restrict) \ F(c_static_assert) \ F(c_variadic_macros) #define FOR_EACH_CXX_FEATURE(F) \ - F(cxx_std_98) \ - F(cxx_std_11) \ - F(cxx_std_14) \ F(cxx_aggregate_default_initializers) \ F(cxx_alias_templates) \ F(cxx_alignas) \ diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt index 9f61186..9f08523 100644 --- a/Tests/CompileFeatures/CMakeLists.txt +++ b/Tests/CompileFeatures/CMakeLists.txt @@ -23,12 +23,10 @@ macro(run_test feature lang) endmacro() get_property(c_features GLOBAL PROPERTY CMAKE_C_KNOWN_FEATURES) -list(REMOVE_ITEM c_features c_std_90 c_std_99 c_std_11) foreach(feature ${c_features}) run_test(${feature} C) endforeach() get_property(cxx_features GLOBAL PROPERTY CMAKE_CXX_KNOWN_FEATURES) -list(REMOVE_ITEM cxx_features cxx_std_98 cxx_std_11 cxx_std_14) foreach(feature ${cxx_features}) run_test(${feature} CXX) endforeach() @@ -398,7 +396,7 @@ if (CMAKE_CXX_COMPILE_FEATURES) ) add_executable(CompileFeaturesGenex2 genex_test.cpp) - target_compile_features(CompileFeaturesGenex2 PRIVATE cxx_std_11) + target_compile_features(CompileFeaturesGenex2 PRIVATE cxx_static_assert) target_compile_definitions(CompileFeaturesGenex2 PRIVATE HAVE_OVERRIDE_CONTROL=$ HAVE_AUTO_TYPE=$ @@ -407,10 +405,10 @@ if (CMAKE_CXX_COMPILE_FEATURES) HAVE_INHERITING_CONSTRUCTORS_AND_FINAL=$ ) - add_library(std_11_iface INTERFACE) - target_compile_features(std_11_iface INTERFACE cxx_std_11) + add_library(static_assert_iface INTERFACE) + target_compile_features(static_assert_iface INTERFACE cxx_static_assert) add_executable(CompileFeaturesGenex3 genex_test.cpp) - target_link_libraries(CompileFeaturesGenex3 PRIVATE std_11_iface) + target_link_libraries(CompileFeaturesGenex3 PRIVATE static_assert_iface) target_compile_definitions(CompileFeaturesGenex3 PRIVATE HAVE_OVERRIDE_CONTROL=$ HAVE_AUTO_TYPE=$ diff --git a/Tests/RunCMake/CompileFeatures/LinkImplementationFeatureCycle.cmake b/Tests/RunCMake/CompileFeatures/LinkImplementationFeatureCycle.cmake index 2d14a9e..09594bd 100644 --- a/Tests/RunCMake/CompileFeatures/LinkImplementationFeatureCycle.cmake +++ b/Tests/RunCMake/CompileFeatures/LinkImplementationFeatureCycle.cmake @@ -3,13 +3,13 @@ add_library(empty1 empty.cpp) add_library(empty2 INTERFACE) add_library(empty3 INTERFACE) -target_compile_features(empty3 INTERFACE cxx_std_11) +target_compile_features(empty3 INTERFACE cxx_static_assert) target_link_libraries(empty1 # When starting, $ is '0', so 'freeze' the # CXX_STANDARD at 98 during computation. $<$:empty2> - # This would add cxx_std_11, but that would require CXX_STANDARD = 11, + # This would add cxx_static_assert, but that would require CXX_STANDARD = 11, # which is not allowed after freeze. Report an error. empty3 ) diff --git a/Tests/RunCMake/CompileFeatures/LinkImplementationFeatureCycleSolved.cmake b/Tests/RunCMake/CompileFeatures/LinkImplementationFeatureCycleSolved.cmake index a04dcec..bbcf4e0 100644 --- a/Tests/RunCMake/CompileFeatures/LinkImplementationFeatureCycleSolved.cmake +++ b/Tests/RunCMake/CompileFeatures/LinkImplementationFeatureCycleSolved.cmake @@ -3,7 +3,7 @@ add_library(empty1 empty.cpp) add_library(empty2 INTERFACE) add_library(empty3 INTERFACE) -target_compile_features(empty3 INTERFACE cxx_std_11) +target_compile_features(empty3 INTERFACE cxx_static_assert) target_link_libraries(empty1 $<$:empty2> ----------------------------------------------------------------------- Summary of changes: Help/manual/cmake-compile-features.7.rst | 27 ------------------- Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst | 9 ------- Help/prop_gbl/CMAKE_C_KNOWN_FEATURES.rst | 9 ------- .../compile-features-for-language-standards.rst | 7 ----- Modules/CMakeDetermineCompileFeatures.cmake | 28 ++++++-------------- Modules/WriteCompilerDetectionHeader.cmake | 7 +---- Source/cmake.h | 6 ----- Tests/CompileFeatures/CMakeLists.txt | 10 +++---- .../LinkImplementationFeatureCycle.cmake | 4 +-- .../LinkImplementationFeatureCycleSolved.cmake | 2 +- 10 files changed, 16 insertions(+), 93 deletions(-) delete mode 100644 Help/release/dev/compile-features-for-language-standards.rst hooks/post-receive -- CMake From brad.king at kitware.com Wed Nov 2 08:35:25 2016 From: brad.king at kitware.com (Brad King) Date: Wed, 2 Nov 2016 08:35:25 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.7.0-rc2-416-g93f0251 Message-ID: <20161102123525.B0B17F855B@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 93f025118d3ecb132658502625707307135535e8 (commit) via 8444b984a29392c32a13521cc0e3d40788cc9530 (commit) from ff957bc1e11278b3152c4f4b0732fc9667dc42e3 (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=93f025118d3ecb132658502625707307135535e8 commit 93f025118d3ecb132658502625707307135535e8 Merge: ff957bc 8444b98 Author: Brad King AuthorDate: Wed Nov 2 08:35:23 2016 -0400 Commit: CMake Topic Stage CommitDate: Wed Nov 2 08:35:23 2016 -0400 Merge topic 'UseSWIG-SWIG_OUTFILE_DIR' 8444b984 UseSWIG: Add option to specify swig output file directory ----------------------------------------------------------------------- Summary of changes: Help/release/dev/UseSWIG-SWIG_OUTFILE_DIR.rst | 6 ++++++ Modules/UseSWIG.cmake | 16 +++++++++++++--- 2 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 Help/release/dev/UseSWIG-SWIG_OUTFILE_DIR.rst hooks/post-receive -- CMake From brad.king at kitware.com Wed Nov 2 08:35:28 2016 From: brad.king at kitware.com (Brad King) Date: Wed, 2 Nov 2016 08:35:28 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.7.0-rc2-419-g6a65f05 Message-ID: <20161102123528.A0BFBF885B@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 6a65f0534b7f62ba6fece4b422eaffcdeb3cc535 (commit) via 935041908db878163ab03f175b992981fc4b8ff3 (commit) via 542d52f95e3540953113fc66dc7a7958b9c184de (commit) from 93f025118d3ecb132658502625707307135535e8 (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=6a65f0534b7f62ba6fece4b422eaffcdeb3cc535 commit 6a65f0534b7f62ba6fece4b422eaffcdeb3cc535 Merge: 93f0251 9350419 Author: Brad King AuthorDate: Wed Nov 2 08:35:26 2016 -0400 Commit: CMake Topic Stage CommitDate: Wed Nov 2 08:35:26 2016 -0400 Merge topic 'fix-macos-sysroot' 93504190 Darwin: Remove deployment target version check 542d52f9 Revert "Xcode: Convert maybe unversioned OSX sysroot into versioned SDK path" ----------------------------------------------------------------------- Summary of changes: Modules/Platform/Darwin-Initialize.cmake | 8 ++------ Modules/Platform/Darwin.cmake | 24 ------------------------ 2 files changed, 2 insertions(+), 30 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Wed Nov 2 08:35:31 2016 From: brad.king at kitware.com (Brad King) Date: Wed, 2 Nov 2016 08:35:31 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.7.0-rc2-421-gf6b93fb Message-ID: <20161102123531.579FCF885D@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 f6b93fbf3ae00a9157af2f6497bed074d585cea9 (commit) via cfbf857b22540059e6d5a6c271af4aa0314aad7e (commit) from 6a65f0534b7f62ba6fece4b422eaffcdeb3cc535 (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=f6b93fbf3ae00a9157af2f6497bed074d585cea9 commit f6b93fbf3ae00a9157af2f6497bed074d585cea9 Merge: 6a65f05 cfbf857 Author: Brad King AuthorDate: Wed Nov 2 08:35:29 2016 -0400 Commit: CMake Topic Stage CommitDate: Wed Nov 2 08:35:29 2016 -0400 Merge topic 'fix_compiler_arg1' cfbf857b cmRulePlaceholderExpander: Fix CMAKE__COMPILER_ARG1 replacement ----------------------------------------------------------------------- Summary of changes: Source/cmRulePlaceholderExpander.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Wed Nov 2 08:36:08 2016 From: brad.king at kitware.com (Brad King) Date: Wed, 2 Nov 2016 08:36:08 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.7.0-rc2-877-g3b3b596 Message-ID: <20161102123608.F3FF0F8864@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, next has been updated via 3b3b59681cfeea332fb0f48f796f222586e2ee99 (commit) via f6b93fbf3ae00a9157af2f6497bed074d585cea9 (commit) via 6a65f0534b7f62ba6fece4b422eaffcdeb3cc535 (commit) via 93f025118d3ecb132658502625707307135535e8 (commit) via ff957bc1e11278b3152c4f4b0732fc9667dc42e3 (commit) from 7cb0f785fcffb32141a4e643fd354d2f86596534 (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=3b3b59681cfeea332fb0f48f796f222586e2ee99 commit 3b3b59681cfeea332fb0f48f796f222586e2ee99 Merge: 7cb0f78 f6b93fb Author: Brad King AuthorDate: Wed Nov 2 08:35:43 2016 -0400 Commit: Brad King CommitDate: Wed Nov 2 08:35:43 2016 -0400 Merge branch 'master' into next ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Wed Nov 2 08:43:35 2016 From: brad.king at kitware.com (Brad King) Date: Wed, 2 Nov 2016 08:43:35 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.7.0-rc2-880-g66b673c Message-ID: <20161102124335.A486EF7BC4@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, next has been updated via 66b673c375019df62a1bbbd1a4e8c068fbae9449 (commit) via 4ab3b0c462d45080ec31e5e1e7dbfa1c0ab886bf (commit) via e6460e7d40a0146d6580d41da17f64370ce9a092 (commit) from 3b3b59681cfeea332fb0f48f796f222586e2ee99 (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=66b673c375019df62a1bbbd1a4e8c068fbae9449 commit 66b673c375019df62a1bbbd1a4e8c068fbae9449 Merge: 3b3b596 4ab3b0c Author: Brad King AuthorDate: Wed Nov 2 08:43:34 2016 -0400 Commit: CMake Topic Stage CommitDate: Wed Nov 2 08:43:34 2016 -0400 Merge topic 'cpack-doc-typos' into next 4ab3b0c4 CPackRPM: Fix incorrect variable name in documentation e6460e7d CPackDeb: Fix incorrect variable name in documentation https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4ab3b0c462d45080ec31e5e1e7dbfa1c0ab886bf commit 4ab3b0c462d45080ec31e5e1e7dbfa1c0ab886bf Author: Alex Turbov AuthorDate: Wed Nov 2 16:53:55 2016 +0800 Commit: Brad King CommitDate: Wed Nov 2 08:42:56 2016 -0400 CPackRPM: Fix incorrect variable name in documentation `CPACK_RPM_COMPONENT_INSTALL` is the correct variable to set to enable component packaging. `CPACK_RPM_PACKAGE_COMPONENT` is just set to a component name when CPack calls corresponding installer. diff --git a/Modules/CPackRPM.cmake b/Modules/CPackRPM.cmake index 15b62c7..0640630 100644 --- a/Modules/CPackRPM.cmake +++ b/Modules/CPackRPM.cmake @@ -45,7 +45,7 @@ # # List of CPackRPM specific variables: # -# .. variable:: CPACK_RPM_PACKAGE_COMPONENT +# .. variable:: CPACK_RPM_COMPONENT_INSTALL # # Enable component packaging for CPackRPM # @@ -461,7 +461,7 @@ # May be used to embed a pre (un)installation script in the spec file. # The referred script file (or both) will be read and directly # put after the ``%pre`` or ``%preun`` section -# If :variable:`CPACK_RPM_PACKAGE_COMPONENT` is set to ON the (un)install +# If :variable:`CPACK_RPM_COMPONENT_INSTALL` is set to ON the (un)install # script for each component can be overridden with # ``CPACK_RPM__PRE_INSTALL_SCRIPT_FILE`` and # ``CPACK_RPM__PRE_UNINSTALL_SCRIPT_FILE``. @@ -480,7 +480,7 @@ # May be used to embed a post (un)installation script in the spec file. # The referred script file (or both) will be read and directly # put after the ``%post`` or ``%postun`` section. -# If :variable:`CPACK_RPM_PACKAGE_COMPONENT` is set to ON the (un)install +# If :variable:`CPACK_RPM_COMPONENT_INSTALL` is set to ON the (un)install # script for each component can be overridden with # ``CPACK_RPM__POST_INSTALL_SCRIPT_FILE`` and # ``CPACK_RPM__POST_UNINSTALL_SCRIPT_FILE``. https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e6460e7d40a0146d6580d41da17f64370ce9a092 commit e6460e7d40a0146d6580d41da17f64370ce9a092 Author: Alex Turbov AuthorDate: Wed Nov 2 16:53:55 2016 +0800 Commit: Brad King CommitDate: Wed Nov 2 08:42:44 2016 -0400 CPackDeb: Fix incorrect variable name in documentation `CPACK_DEB_COMPONENT_INSTALL` is the correct variable to set to enable component packaging. `CPACK_DEB_PACKAGE_COMPONENT` is just set to a component name when CPack calls corresponding installer. diff --git a/Modules/CPackDeb.cmake b/Modules/CPackDeb.cmake index 4a7a6b8..909a12b 100644 --- a/Modules/CPackDeb.cmake +++ b/Modules/CPackDeb.cmake @@ -34,7 +34,7 @@ # # List of CPackDEB specific variables: # -# .. variable:: CPACK_DEB_PACKAGE_COMPONENT +# .. variable:: CPACK_DEB_COMPONENT_INSTALL # # Enable component packaging for CPackDEB # ----------------------------------------------------------------------- Summary of changes: Modules/CPackDeb.cmake | 2 +- Modules/CPackRPM.cmake | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Wed Nov 2 08:51:32 2016 From: brad.king at kitware.com (Brad King) Date: Wed, 2 Nov 2016 08:51:32 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.7.0-rc2-882-gc7d27ed Message-ID: <20161102125132.EDD96F7FF4@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, next has been updated via c7d27ed8ffa6d486b0e91654c1a6b14de73ab673 (commit) via 13bc31aab5c51667369acce3a5ca9d1df57a1611 (commit) from 66b673c375019df62a1bbbd1a4e8c068fbae9449 (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=c7d27ed8ffa6d486b0e91654c1a6b14de73ab673 commit c7d27ed8ffa6d486b0e91654c1a6b14de73ab673 Merge: 66b673c 13bc31a Author: Brad King AuthorDate: Wed Nov 2 08:51:32 2016 -0400 Commit: CMake Topic Stage CommitDate: Wed Nov 2 08:51:32 2016 -0400 Merge topic 'doc-cmake-qt-missing-dbus' into next 13bc31aa Help: Update example Qt 5 find_package call to add missing component https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=13bc31aab5c51667369acce3a5ca9d1df57a1611 commit 13bc31aab5c51667369acce3a5ca9d1df57a1611 Author: Thiago M. de C. Marques AuthorDate: Tue Nov 1 17:04:13 2016 -0400 Commit: Brad King CommitDate: Wed Nov 2 08:50:03 2016 -0400 Help: Update example Qt 5 find_package call to add missing component Running CMake on it caused the following error: error: Target "publisher" links to target "Qt5::DBus" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing? Add the missing DBus component. diff --git a/Help/manual/cmake-qt.7.rst b/Help/manual/cmake-qt.7.rst index bd0a984..7827065 100644 --- a/Help/manual/cmake-qt.7.rst +++ b/Help/manual/cmake-qt.7.rst @@ -29,7 +29,7 @@ Qt 4 and Qt 5 may be used together in the same set(CMAKE_AUTOMOC ON) set(CMAKE_INCLUDE_CURRENT_DIR ON) - find_package(Qt5 COMPONENTS Widgets REQUIRED) + find_package(Qt5 COMPONENTS Widgets DBus REQUIRED) add_executable(publisher publisher.cpp) target_link_libraries(publisher Qt5::Widgets Qt5::DBus) ----------------------------------------------------------------------- Summary of changes: Help/manual/cmake-qt.7.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Wed Nov 2 08:54:26 2016 From: brad.king at kitware.com (Brad King) Date: Wed, 2 Nov 2016 08:54:26 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.7.0-rc2-424-gb5ad094 Message-ID: <20161102125426.0D4F5F8058@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 b5ad094e3b4496b84b6326b09521c86e9b753385 (commit) via 4ab3b0c462d45080ec31e5e1e7dbfa1c0ab886bf (commit) via e6460e7d40a0146d6580d41da17f64370ce9a092 (commit) from f6b93fbf3ae00a9157af2f6497bed074d585cea9 (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=b5ad094e3b4496b84b6326b09521c86e9b753385 commit b5ad094e3b4496b84b6326b09521c86e9b753385 Merge: f6b93fb 4ab3b0c Author: Brad King AuthorDate: Wed Nov 2 08:54:23 2016 -0400 Commit: CMake Topic Stage CommitDate: Wed Nov 2 08:54:23 2016 -0400 Merge topic 'cpack-doc-typos' 4ab3b0c4 CPackRPM: Fix incorrect variable name in documentation e6460e7d CPackDeb: Fix incorrect variable name in documentation ----------------------------------------------------------------------- Summary of changes: Modules/CPackDeb.cmake | 2 +- Modules/CPackRPM.cmake | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Wed Nov 2 08:54:28 2016 From: brad.king at kitware.com (Brad King) Date: Wed, 2 Nov 2016 08:54:28 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.7.0-rc2-426-gcea2678 Message-ID: <20161102125428.B5A7CF8059@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 cea26782c9f626dfe24ef8eed0a65d31d461301b (commit) via 13bc31aab5c51667369acce3a5ca9d1df57a1611 (commit) from b5ad094e3b4496b84b6326b09521c86e9b753385 (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=cea26782c9f626dfe24ef8eed0a65d31d461301b commit cea26782c9f626dfe24ef8eed0a65d31d461301b Merge: b5ad094 13bc31a Author: Brad King AuthorDate: Wed Nov 2 08:54:26 2016 -0400 Commit: CMake Topic Stage CommitDate: Wed Nov 2 08:54:26 2016 -0400 Merge topic 'doc-cmake-qt-missing-dbus' 13bc31aa Help: Update example Qt 5 find_package call to add missing component ----------------------------------------------------------------------- Summary of changes: Help/manual/cmake-qt.7.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Wed Nov 2 08:54:38 2016 From: brad.king at kitware.com (Brad King) Date: Wed, 2 Nov 2016 08:54:38 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.7.0-rc2-885-gcd060d3 Message-ID: <20161102125438.4A6BAF8054@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, next has been updated via cd060d3aa1a0d2f5bf86301251d2e64650b9f50d (commit) via 1c52e6511fe3b73c640862f76884dcfed46186dc (commit) via 4c802a326b76d776c895ebbe3c0ebf2a0e223ba2 (commit) from c7d27ed8ffa6d486b0e91654c1a6b14de73ab673 (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=cd060d3aa1a0d2f5bf86301251d2e64650b9f50d commit cd060d3aa1a0d2f5bf86301251d2e64650b9f50d Merge: c7d27ed 1c52e65 Author: Brad King AuthorDate: Wed Nov 2 08:54:37 2016 -0400 Commit: CMake Topic Stage CommitDate: Wed Nov 2 08:54:37 2016 -0400 Merge topic 'doc-cmake-qt-fixes' into next 1c52e651 Help: Update example Qt 5 find_package call to add missing component 4c802a32 Help: Update example Qt 5 find_package call to use COMPONENTS https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1c52e6511fe3b73c640862f76884dcfed46186dc commit 1c52e6511fe3b73c640862f76884dcfed46186dc Author: Thiago M. de C. Marques AuthorDate: Tue Nov 1 17:04:13 2016 -0400 Commit: Brad King CommitDate: Wed Nov 2 08:51:57 2016 -0400 Help: Update example Qt 5 find_package call to add missing component Running CMake on it caused the following error: error: Target "publisher" links to target "Qt5::DBus" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing? Add the missing DBus component. diff --git a/Help/manual/cmake-qt.7.rst b/Help/manual/cmake-qt.7.rst index bd0a984..7827065 100644 --- a/Help/manual/cmake-qt.7.rst +++ b/Help/manual/cmake-qt.7.rst @@ -29,7 +29,7 @@ Qt 4 and Qt 5 may be used together in the same set(CMAKE_AUTOMOC ON) set(CMAKE_INCLUDE_CURRENT_DIR ON) - find_package(Qt5 COMPONENTS Widgets REQUIRED) + find_package(Qt5 COMPONENTS Widgets DBus REQUIRED) add_executable(publisher publisher.cpp) target_link_libraries(publisher Qt5::Widgets Qt5::DBus) https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4c802a326b76d776c895ebbe3c0ebf2a0e223ba2 commit 4c802a326b76d776c895ebbe3c0ebf2a0e223ba2 Author: Marcus D. Hanwell AuthorDate: Tue Nov 1 12:44:34 2016 -0400 Commit: Brad King CommitDate: Wed Nov 2 08:51:53 2016 -0400 Help: Update example Qt 5 find_package call to use COMPONENTS diff --git a/Help/manual/cmake-qt.7.rst b/Help/manual/cmake-qt.7.rst index e8a2c1e..bd0a984 100644 --- a/Help/manual/cmake-qt.7.rst +++ b/Help/manual/cmake-qt.7.rst @@ -29,7 +29,7 @@ Qt 4 and Qt 5 may be used together in the same set(CMAKE_AUTOMOC ON) set(CMAKE_INCLUDE_CURRENT_DIR ON) - find_package(Qt5Widgets REQUIRED) + find_package(Qt5 COMPONENTS Widgets REQUIRED) add_executable(publisher publisher.cpp) target_link_libraries(publisher Qt5::Widgets Qt5::DBus) ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Wed Nov 2 08:54:49 2016 From: brad.king at kitware.com (Brad King) Date: Wed, 2 Nov 2016 08:54:49 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.7.0-rc2-429-g316206e Message-ID: <20161102125449.60E0AF8054@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 316206e2678b64a2c986bcc889e5fbf2fcefad18 (commit) via 1c52e6511fe3b73c640862f76884dcfed46186dc (commit) via 4c802a326b76d776c895ebbe3c0ebf2a0e223ba2 (commit) from cea26782c9f626dfe24ef8eed0a65d31d461301b (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=316206e2678b64a2c986bcc889e5fbf2fcefad18 commit 316206e2678b64a2c986bcc889e5fbf2fcefad18 Merge: cea2678 1c52e65 Author: Brad King AuthorDate: Wed Nov 2 08:54:47 2016 -0400 Commit: CMake Topic Stage CommitDate: Wed Nov 2 08:54:47 2016 -0400 Merge topic 'doc-cmake-qt-fixes' 1c52e651 Help: Update example Qt 5 find_package call to add missing component 4c802a32 Help: Update example Qt 5 find_package call to use COMPONENTS ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Wed Nov 2 08:55:09 2016 From: brad.king at kitware.com (Brad King) Date: Wed, 2 Nov 2016 08:55:09 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.7.0-rc2-889-g619df3f Message-ID: <20161102125509.C43FEF8062@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, next has been updated via 619df3f7c867fceea05c7a7957090627d528b8e8 (commit) via 316206e2678b64a2c986bcc889e5fbf2fcefad18 (commit) via cea26782c9f626dfe24ef8eed0a65d31d461301b (commit) via b5ad094e3b4496b84b6326b09521c86e9b753385 (commit) from cd060d3aa1a0d2f5bf86301251d2e64650b9f50d (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=619df3f7c867fceea05c7a7957090627d528b8e8 commit 619df3f7c867fceea05c7a7957090627d528b8e8 Merge: cd060d3 316206e Author: Brad King AuthorDate: Wed Nov 2 08:54:55 2016 -0400 Commit: Brad King CommitDate: Wed Nov 2 08:54:55 2016 -0400 Merge branch 'master' into next ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Wed Nov 2 09:12:24 2016 From: brad.king at kitware.com (Brad King) Date: Wed, 2 Nov 2016 09:12:24 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.7.0-rc2-891-gbc58351 Message-ID: <20161102131224.50C1DF7694@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, next has been updated via bc583514658b81631b6d345c25cfb5d1531a44b1 (commit) via ff3ccc1f2315d3de91ee6a90c8754ea554965c1d (commit) from 619df3f7c867fceea05c7a7957090627d528b8e8 (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=bc583514658b81631b6d345c25cfb5d1531a44b1 commit bc583514658b81631b6d345c25cfb5d1531a44b1 Merge: 619df3f ff3ccc1 Author: Brad King AuthorDate: Wed Nov 2 09:12:23 2016 -0400 Commit: CMake Topic Stage CommitDate: Wed Nov 2 09:12:23 2016 -0400 Merge topic 'FindHDF5-restore-default-C' into next ff3ccc1f FindHDF5: Restore pre-3.6 behavior of finding only C by default https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ff3ccc1f2315d3de91ee6a90c8754ea554965c1d commit ff3ccc1f2315d3de91ee6a90c8754ea554965c1d Author: Brad King AuthorDate: Wed Nov 2 09:03:56 2016 -0400 Commit: Brad King CommitDate: Wed Nov 2 09:06:56 2016 -0400 FindHDF5: Restore pre-3.6 behavior of finding only C by default Refactoring in commit v3.6.0-rc1~72^2 (HDF5: Rework component searching to correctly find HL for all bindings, 2016-05-12) changed the default behavior from finding only the C bindings to finding everything for the enabled languages. Restore the original behavior for compatibility and because many projects need only the C bindings. Closes: #16397 diff --git a/Modules/FindHDF5.cmake b/Modules/FindHDF5.cmake index ab046e3..7e1b352 100644 --- a/Modules/FindHDF5.cmake +++ b/Modules/FindHDF5.cmake @@ -111,18 +111,10 @@ include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) set(HDF5_VALID_LANGUAGE_BINDINGS C CXX Fortran) # Validate the list of find components. -set(HDF5_LANGUAGE_BINDINGS) if(NOT HDF5_FIND_COMPONENTS) - get_property(__langs GLOBAL PROPERTY ENABLED_LANGUAGES) - foreach(__lang IN LISTS __langs) - if(__lang MATCHES "^(C|CXX|Fortran)$") - list(APPEND HDF5_LANGUAGE_BINDINGS ${__lang}) - set(HDF5_FIND_REQUIRED_${__lang} True) - endif() - endforeach() - set(FIND_HL ON) - set(HDF5_FIND_REQUIRED_HL True) + set(HDF5_LANGUAGE_BINDINGS "C") else() + set(HDF5_LANGUAGE_BINDINGS) # add the extra specified components, ensuring that they are valid. set(FIND_HL OFF) foreach(component IN LISTS HDF5_FIND_COMPONENTS) ----------------------------------------------------------------------- Summary of changes: Modules/FindHDF5.cmake | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Wed Nov 2 09:13:59 2016 From: brad.king at kitware.com (Brad King) Date: Wed, 2 Nov 2016 09:13:59 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.7.0-rc2-433-gab2ae48 Message-ID: <20161102131359.40218F7B04@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 ab2ae4823c3b60347825da4b851cd4e676f8bed1 (commit) via c555eca9ba8e518dd8f91159d94a2a2bf58916b0 (commit) via 2857ca89a2aa0561f814ae925c0bd96262fd4509 (commit) via 503766fa0e3ce87b60d4b55ff044c58242816873 (commit) from 316206e2678b64a2c986bcc889e5fbf2fcefad18 (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: hooks/post-receive -- CMake From brad.king at kitware.com Wed Nov 2 09:13:59 2016 From: brad.king at kitware.com (Brad King) Date: Wed, 2 Nov 2016 09:13:59 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.7.0-rc2-896-g88ee873 Message-ID: <20161102131359.60609F7B11@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, next has been updated via 88ee8733112b16d9ab122f25fd4c67eecee7b07e (commit) via ab2ae4823c3b60347825da4b851cd4e676f8bed1 (commit) via c555eca9ba8e518dd8f91159d94a2a2bf58916b0 (commit) via 2857ca89a2aa0561f814ae925c0bd96262fd4509 (commit) via 503766fa0e3ce87b60d4b55ff044c58242816873 (commit) from bc583514658b81631b6d345c25cfb5d1531a44b1 (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=88ee8733112b16d9ab122f25fd4c67eecee7b07e commit 88ee8733112b16d9ab122f25fd4c67eecee7b07e Merge: bc58351 ab2ae48 Author: Brad King AuthorDate: Wed Nov 2 09:13:38 2016 -0400 Commit: Brad King CommitDate: Wed Nov 2 09:13:38 2016 -0400 Merge branch 'master' into next ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Wed Nov 2 09:13:59 2016 From: brad.king at kitware.com (Brad King) Date: Wed, 2 Nov 2016 09:13:59 -0400 (EDT) Subject: [Cmake-commits] CMake branch, release, updated. v3.7.0-rc2-34-gc555eca Message-ID: <20161102131359.7D6BFF7B2D@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 c555eca9ba8e518dd8f91159d94a2a2bf58916b0 (commit) via 1c52e6511fe3b73c640862f76884dcfed46186dc (commit) via 4c802a326b76d776c895ebbe3c0ebf2a0e223ba2 (commit) via 2857ca89a2aa0561f814ae925c0bd96262fd4509 (commit) via 503766fa0e3ce87b60d4b55ff044c58242816873 (commit) via 4ab3b0c462d45080ec31e5e1e7dbfa1c0ab886bf (commit) via e6460e7d40a0146d6580d41da17f64370ce9a092 (commit) via c75b8910a440f538c3595a7a738b50b71a6636d6 (commit) via 935041908db878163ab03f175b992981fc4b8ff3 (commit) via 542d52f95e3540953113fc66dc7a7958b9c184de (commit) from 77413bc5db8884f36fe7c6e162507ca5a0fa8fee (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-qt.7.rst | 2 +- Modules/CPackDeb.cmake | 8 ++++---- Modules/CPackRPM.cmake | 6 +++--- Modules/Platform/Darwin-Initialize.cmake | 8 ++------ Modules/Platform/Darwin.cmake | 24 ------------------------ 5 files changed, 10 insertions(+), 38 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Wed Nov 2 09:25:05 2016 From: brad.king at kitware.com (Brad King) Date: Wed, 2 Nov 2016 09:25:05 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.7.0-rc2-898-g612bb57 Message-ID: <20161102132505.288F7F83EA@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, next has been updated via 612bb575cbaf3ed9f6acad58a25e54bad09edd18 (commit) via 6b74669d508572429314e9522c53374faa0666b8 (commit) from 88ee8733112b16d9ab122f25fd4c67eecee7b07e (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=612bb575cbaf3ed9f6acad58a25e54bad09edd18 commit 612bb575cbaf3ed9f6acad58a25e54bad09edd18 Merge: 88ee873 6b74669 Author: Brad King AuthorDate: Wed Nov 2 09:25:04 2016 -0400 Commit: CMake Topic Stage CommitDate: Wed Nov 2 09:25:04 2016 -0400 Merge topic 'remove-utf8-option' into next 6b74669d Encoding: Remove option to use ANSI code page internally https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6b74669d508572429314e9522c53374faa0666b8 commit 6b74669d508572429314e9522c53374faa0666b8 Author: Clinton Stimpson AuthorDate: Tue Nov 1 16:35:23 2016 -0600 Commit: Brad King CommitDate: Wed Nov 2 09:23:41 2016 -0400 Encoding: Remove option to use ANSI code page internally The switch to use UTF-8 encoding has been defaulted to on for quite some time since commit v3.2.0-rc1~116^2 (Encoding: Switch to use UTF-8 internally by default on Windows, 2014-12-26). diff --git a/CMakeLists.txt b/CMakeLists.txt index 1bc4b4e..a5702e1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -66,12 +66,8 @@ if(NOT CMake_TEST_EXTERNAL_CMAKE) include(${CMake_SOURCE_DIR}/Source/Checks/cm_cxx_features.cmake) endif() -# option to set the internal encoding of CMake to UTF-8 -option(CMAKE_ENCODING_UTF8 "Use UTF-8 encoding internally." ON) -mark_as_advanced(CMAKE_ENCODING_UTF8) -if(CMAKE_ENCODING_UTF8) - set(KWSYS_ENCODING_DEFAULT_CODEPAGE CP_UTF8) -endif() +# set the internal encoding of CMake to UTF-8 +set(KWSYS_ENCODING_DEFAULT_CODEPAGE CP_UTF8) # option to use COMPONENT with install command option(CMake_INSTALL_COMPONENTS "Using components when installing" OFF) diff --git a/Source/CPack/WiX/cmWIXSourceWriter.cxx b/Source/CPack/WiX/cmWIXSourceWriter.cxx index a8b0d7c..b434334 100644 --- a/Source/CPack/WiX/cmWIXSourceWriter.cxx +++ b/Source/CPack/WiX/cmWIXSourceWriter.cxx @@ -117,9 +117,7 @@ void cmWIXSourceWriter::AddProcessingInstruction(std::string const& target, void cmWIXSourceWriter::AddAttribute(std::string const& key, std::string const& value) { - std::string utf8 = CMakeEncodingToUtf8(value); - - File << " " << key << "=\"" << EscapeAttributeValue(utf8) << '"'; + File << " " << key << "=\"" << EscapeAttributeValue(value) << '"'; } void cmWIXSourceWriter::AddAttributeUnlessEmpty(std::string const& key, @@ -130,43 +128,6 @@ void cmWIXSourceWriter::AddAttributeUnlessEmpty(std::string const& key, } } -std::string cmWIXSourceWriter::CMakeEncodingToUtf8(std::string const& value) -{ -#ifdef CMAKE_ENCODING_UTF8 - return value; -#else - if (value.empty()) { - return std::string(); - } - - int characterCount = MultiByteToWideChar( - CP_ACP, 0, value.c_str(), static_cast(value.size()), 0, 0); - - if (characterCount == 0) { - return std::string(); - } - - std::vector utf16(characterCount); - - MultiByteToWideChar(CP_ACP, 0, value.c_str(), static_cast(value.size()), - &utf16[0], static_cast(utf16.size())); - - int utf8ByteCount = WideCharToMultiByte( - CP_UTF8, 0, &utf16[0], static_cast(utf16.size()), 0, 0, 0, 0); - - if (utf8ByteCount == 0) { - return std::string(); - } - - std::vector utf8(utf8ByteCount); - - WideCharToMultiByte(CP_UTF8, 0, &utf16[0], static_cast(utf16.size()), - &utf8[0], static_cast(utf8.size()), 0, 0); - - return std::string(&utf8[0], utf8.size()); -#endif -} - std::string cmWIXSourceWriter::CreateGuidFromComponentId( std::string const& componentId) { diff --git a/Source/CPack/WiX/cmWIXSourceWriter.h b/Source/CPack/WiX/cmWIXSourceWriter.h index b5c06ab..45aefe5 100644 --- a/Source/CPack/WiX/cmWIXSourceWriter.h +++ b/Source/CPack/WiX/cmWIXSourceWriter.h @@ -50,8 +50,6 @@ public: std::string CreateGuidFromComponentId(std::string const& componentId); - static std::string CMakeEncodingToUtf8(std::string const& value); - protected: cmCPackLog* Logger; diff --git a/Source/QtDialog/CMakeSetup.cxx b/Source/QtDialog/CMakeSetup.cxx index fad8075..9038469 100644 --- a/Source/QtDialog/CMakeSetup.cxx +++ b/Source/QtDialog/CMakeSetup.cxx @@ -95,10 +95,8 @@ int main(int argc, char** argv) setlocale(LC_NUMERIC, "C"); -#if defined(CMAKE_ENCODING_UTF8) QTextCodec* utf8_codec = QTextCodec::codecForName("UTF-8"); QTextCodec::setCodecForLocale(utf8_codec); -#endif #if QT_VERSION < 0x050000 // clean out standard Qt paths for plugins, which we don't use anyway diff --git a/Source/cmConfigure.cmake.h.in b/Source/cmConfigure.cmake.h.in index 057c6c0..26f1df2 100644 --- a/Source/cmConfigure.cmake.h.in +++ b/Source/cmConfigure.cmake.h.in @@ -20,7 +20,6 @@ #cmakedefine CMAKE_USE_ELF_PARSER #cmakedefine CMAKE_USE_MACH_PARSER #cmakedefine CMAKE_USE_LIBUV -#cmakedefine CMAKE_ENCODING_UTF8 #cmakedefine CMake_HAVE_CXX_AUTO_PTR #cmakedefine CMake_HAVE_CXX_MAKE_UNIQUE #cmakedefine CMake_HAVE_CXX_NULLPTR diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index ac76191..1bade57 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -59,7 +59,7 @@ static mode_t mode_setuid = S_ISUID; static mode_t mode_setgid = S_ISGID; #endif -#if defined(_WIN32) && defined(CMAKE_ENCODING_UTF8) +#if defined(_WIN32) // libcurl doesn't support file:// urls for unicode filenames on Windows. // Convert string from UTF-8 to ACP if this is a file:// URL. static std::string fix_file_url_windows(const std::string& url) @@ -2642,7 +2642,7 @@ bool cmFileCommand::HandleDownloadCommand(std::vector const& args) return false; } -#if defined(_WIN32) && defined(CMAKE_ENCODING_UTF8) +#if defined(_WIN32) url = fix_file_url_windows(url); #endif @@ -2902,7 +2902,7 @@ bool cmFileCommand::HandleUploadCommand(std::vector const& args) unsigned long file_size = cmsys::SystemTools::FileLength(filename); -#if defined(_WIN32) && defined(CMAKE_ENCODING_UTF8) +#if defined(_WIN32) url = fix_file_url_windows(url); #endif diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx index 773f8a0..c60a1ff 100644 --- a/Source/cmGlobalVisualStudio7Generator.cxx +++ b/Source/cmGlobalVisualStudio7Generator.cxx @@ -731,11 +731,5 @@ bool cmGlobalVisualStudio7Generator::IsDependedOn( std::string cmGlobalVisualStudio7Generator::Encoding() { - std::ostringstream encoding; -#ifdef CMAKE_ENCODING_UTF8 - encoding << "UTF-8"; -#else - encoding << "Windows-1252"; -#endif - return encoding.str(); + return "UTF-8"; } ----------------------------------------------------------------------- Summary of changes: CMakeLists.txt | 8 ++---- Source/CPack/WiX/cmWIXSourceWriter.cxx | 41 +---------------------------- Source/CPack/WiX/cmWIXSourceWriter.h | 2 -- Source/QtDialog/CMakeSetup.cxx | 2 -- Source/cmConfigure.cmake.h.in | 1 - Source/cmFileCommand.cxx | 6 ++--- Source/cmGlobalVisualStudio7Generator.cxx | 8 +----- 7 files changed, 7 insertions(+), 61 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Wed Nov 2 10:30:12 2016 From: brad.king at kitware.com (Brad King) Date: Wed, 2 Nov 2016 10:30:12 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.7.0-rc2-900-g77b88ee Message-ID: <20161102143012.43DEBF8478@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, next has been updated via 77b88ee5b8fa9560310b6b4c6975639809caf451 (commit) via fa635edaa121cfa688615ca7c07432f5c3e686d7 (commit) from 612bb575cbaf3ed9f6acad58a25e54bad09edd18 (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=77b88ee5b8fa9560310b6b4c6975639809caf451 commit 77b88ee5b8fa9560310b6b4c6975639809caf451 Merge: 612bb57 fa635ed Author: Brad King AuthorDate: Wed Nov 2 10:30:11 2016 -0400 Commit: CMake Topic Stage CommitDate: Wed Nov 2 10:30:11 2016 -0400 Merge topic 'remove-utf8-option' into next fa635eda fixup! Encoding: Remove option to use ANSI code page internally https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fa635edaa121cfa688615ca7c07432f5c3e686d7 commit fa635edaa121cfa688615ca7c07432f5c3e686d7 Author: Brad King AuthorDate: Wed Nov 2 10:29:33 2016 -0400 Commit: Brad King CommitDate: Wed Nov 2 10:29:33 2016 -0400 fixup! Encoding: Remove option to use ANSI code page internally diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.cxx b/Source/CPack/WiX/cmCPackWIXGenerator.cxx index 5320449..4c8abd9 100644 --- a/Source/CPack/WiX/cmCPackWIXGenerator.cxx +++ b/Source/CPack/WiX/cmCPackWIXGenerator.cxx @@ -410,8 +410,7 @@ void cmCPackWIXGenerator::AddDefinition(cmWIXSourceWriter& source, std::ostringstream tmp; tmp << name << "=\"" << value << '"'; - source.AddProcessingInstruction( - "define", cmWIXSourceWriter::CMakeEncodingToUtf8(tmp.str())); + source.AddProcessingInstruction("define", tmp.str()); } bool cmCPackWIXGenerator::CreateWiXSourceFiles() ----------------------------------------------------------------------- Summary of changes: Source/CPack/WiX/cmCPackWIXGenerator.cxx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Wed Nov 2 10:52:17 2016 From: brad.king at kitware.com (Brad King) Date: Wed, 2 Nov 2016 10:52:17 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.7.0-rc2-902-g39ec090 Message-ID: <20161102145217.DB4CDF8005@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, next has been updated via 39ec090ac4c4389a761fda0ff913e3267c2839e3 (commit) via baead1e2a8ff7938f6be9c5fc01762edddd2ace9 (commit) from 77b88ee5b8fa9560310b6b4c6975639809caf451 (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=39ec090ac4c4389a761fda0ff913e3267c2839e3 commit 39ec090ac4c4389a761fda0ff913e3267c2839e3 Merge: 77b88ee baead1e Author: Brad King AuthorDate: Wed Nov 2 10:52:17 2016 -0400 Commit: CMake Topic Stage CommitDate: Wed Nov 2 10:52:17 2016 -0400 Merge topic 'remove-utf8-option' into next baead1e2 Encoding: Remove option to use ANSI code page internally https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=baead1e2a8ff7938f6be9c5fc01762edddd2ace9 commit baead1e2a8ff7938f6be9c5fc01762edddd2ace9 Author: Clinton Stimpson AuthorDate: Tue Nov 1 16:35:23 2016 -0600 Commit: Clinton Stimpson CommitDate: Wed Nov 2 08:48:34 2016 -0600 Encoding: Remove option to use ANSI code page internally The switch to use UTF-8 encoding has been defaulted to on for quite some time since commit v3.2.0-rc1~116^2 (Encoding: Switch to use UTF-8 internally by default on Windows, 2014-12-26). diff --git a/CMakeLists.txt b/CMakeLists.txt index 1bc4b4e..a5702e1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -66,12 +66,8 @@ if(NOT CMake_TEST_EXTERNAL_CMAKE) include(${CMake_SOURCE_DIR}/Source/Checks/cm_cxx_features.cmake) endif() -# option to set the internal encoding of CMake to UTF-8 -option(CMAKE_ENCODING_UTF8 "Use UTF-8 encoding internally." ON) -mark_as_advanced(CMAKE_ENCODING_UTF8) -if(CMAKE_ENCODING_UTF8) - set(KWSYS_ENCODING_DEFAULT_CODEPAGE CP_UTF8) -endif() +# set the internal encoding of CMake to UTF-8 +set(KWSYS_ENCODING_DEFAULT_CODEPAGE CP_UTF8) # option to use COMPONENT with install command option(CMake_INSTALL_COMPONENTS "Using components when installing" OFF) diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.cxx b/Source/CPack/WiX/cmCPackWIXGenerator.cxx index 5320449..4c8abd9 100644 --- a/Source/CPack/WiX/cmCPackWIXGenerator.cxx +++ b/Source/CPack/WiX/cmCPackWIXGenerator.cxx @@ -410,8 +410,7 @@ void cmCPackWIXGenerator::AddDefinition(cmWIXSourceWriter& source, std::ostringstream tmp; tmp << name << "=\"" << value << '"'; - source.AddProcessingInstruction( - "define", cmWIXSourceWriter::CMakeEncodingToUtf8(tmp.str())); + source.AddProcessingInstruction("define", tmp.str()); } bool cmCPackWIXGenerator::CreateWiXSourceFiles() diff --git a/Source/CPack/WiX/cmWIXSourceWriter.cxx b/Source/CPack/WiX/cmWIXSourceWriter.cxx index a8b0d7c..b434334 100644 --- a/Source/CPack/WiX/cmWIXSourceWriter.cxx +++ b/Source/CPack/WiX/cmWIXSourceWriter.cxx @@ -117,9 +117,7 @@ void cmWIXSourceWriter::AddProcessingInstruction(std::string const& target, void cmWIXSourceWriter::AddAttribute(std::string const& key, std::string const& value) { - std::string utf8 = CMakeEncodingToUtf8(value); - - File << " " << key << "=\"" << EscapeAttributeValue(utf8) << '"'; + File << " " << key << "=\"" << EscapeAttributeValue(value) << '"'; } void cmWIXSourceWriter::AddAttributeUnlessEmpty(std::string const& key, @@ -130,43 +128,6 @@ void cmWIXSourceWriter::AddAttributeUnlessEmpty(std::string const& key, } } -std::string cmWIXSourceWriter::CMakeEncodingToUtf8(std::string const& value) -{ -#ifdef CMAKE_ENCODING_UTF8 - return value; -#else - if (value.empty()) { - return std::string(); - } - - int characterCount = MultiByteToWideChar( - CP_ACP, 0, value.c_str(), static_cast(value.size()), 0, 0); - - if (characterCount == 0) { - return std::string(); - } - - std::vector utf16(characterCount); - - MultiByteToWideChar(CP_ACP, 0, value.c_str(), static_cast(value.size()), - &utf16[0], static_cast(utf16.size())); - - int utf8ByteCount = WideCharToMultiByte( - CP_UTF8, 0, &utf16[0], static_cast(utf16.size()), 0, 0, 0, 0); - - if (utf8ByteCount == 0) { - return std::string(); - } - - std::vector utf8(utf8ByteCount); - - WideCharToMultiByte(CP_UTF8, 0, &utf16[0], static_cast(utf16.size()), - &utf8[0], static_cast(utf8.size()), 0, 0); - - return std::string(&utf8[0], utf8.size()); -#endif -} - std::string cmWIXSourceWriter::CreateGuidFromComponentId( std::string const& componentId) { diff --git a/Source/CPack/WiX/cmWIXSourceWriter.h b/Source/CPack/WiX/cmWIXSourceWriter.h index b5c06ab..45aefe5 100644 --- a/Source/CPack/WiX/cmWIXSourceWriter.h +++ b/Source/CPack/WiX/cmWIXSourceWriter.h @@ -50,8 +50,6 @@ public: std::string CreateGuidFromComponentId(std::string const& componentId); - static std::string CMakeEncodingToUtf8(std::string const& value); - protected: cmCPackLog* Logger; diff --git a/Source/QtDialog/CMakeSetup.cxx b/Source/QtDialog/CMakeSetup.cxx index fad8075..9038469 100644 --- a/Source/QtDialog/CMakeSetup.cxx +++ b/Source/QtDialog/CMakeSetup.cxx @@ -95,10 +95,8 @@ int main(int argc, char** argv) setlocale(LC_NUMERIC, "C"); -#if defined(CMAKE_ENCODING_UTF8) QTextCodec* utf8_codec = QTextCodec::codecForName("UTF-8"); QTextCodec::setCodecForLocale(utf8_codec); -#endif #if QT_VERSION < 0x050000 // clean out standard Qt paths for plugins, which we don't use anyway diff --git a/Source/cmConfigure.cmake.h.in b/Source/cmConfigure.cmake.h.in index 057c6c0..26f1df2 100644 --- a/Source/cmConfigure.cmake.h.in +++ b/Source/cmConfigure.cmake.h.in @@ -20,7 +20,6 @@ #cmakedefine CMAKE_USE_ELF_PARSER #cmakedefine CMAKE_USE_MACH_PARSER #cmakedefine CMAKE_USE_LIBUV -#cmakedefine CMAKE_ENCODING_UTF8 #cmakedefine CMake_HAVE_CXX_AUTO_PTR #cmakedefine CMake_HAVE_CXX_MAKE_UNIQUE #cmakedefine CMake_HAVE_CXX_NULLPTR diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index ac76191..1bade57 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -59,7 +59,7 @@ static mode_t mode_setuid = S_ISUID; static mode_t mode_setgid = S_ISGID; #endif -#if defined(_WIN32) && defined(CMAKE_ENCODING_UTF8) +#if defined(_WIN32) // libcurl doesn't support file:// urls for unicode filenames on Windows. // Convert string from UTF-8 to ACP if this is a file:// URL. static std::string fix_file_url_windows(const std::string& url) @@ -2642,7 +2642,7 @@ bool cmFileCommand::HandleDownloadCommand(std::vector const& args) return false; } -#if defined(_WIN32) && defined(CMAKE_ENCODING_UTF8) +#if defined(_WIN32) url = fix_file_url_windows(url); #endif @@ -2902,7 +2902,7 @@ bool cmFileCommand::HandleUploadCommand(std::vector const& args) unsigned long file_size = cmsys::SystemTools::FileLength(filename); -#if defined(_WIN32) && defined(CMAKE_ENCODING_UTF8) +#if defined(_WIN32) url = fix_file_url_windows(url); #endif diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx index 773f8a0..c60a1ff 100644 --- a/Source/cmGlobalVisualStudio7Generator.cxx +++ b/Source/cmGlobalVisualStudio7Generator.cxx @@ -731,11 +731,5 @@ bool cmGlobalVisualStudio7Generator::IsDependedOn( std::string cmGlobalVisualStudio7Generator::Encoding() { - std::ostringstream encoding; -#ifdef CMAKE_ENCODING_UTF8 - encoding << "UTF-8"; -#else - encoding << "Windows-1252"; -#endif - return encoding.str(); + return "UTF-8"; } ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Wed Nov 2 12:48:26 2016 From: brad.king at kitware.com (Brad King) Date: Wed, 2 Nov 2016 12:48:26 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.7.0-rc2-910-gd44f192 Message-ID: <20161102164826.A8BD3F7DD3@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, next has been updated via d44f19273550c193ef643db5fc9ac6aff13ce85b (commit) via 9a8d758c3a27833dccf21102ae753de314684b0d (commit) via df252db15a0e539be255536417f36045301db02c (commit) via 6d5fb0e0d0464d50ae58673bf5543b0d052dc681 (commit) via a34b98a834bf6ac044e8590c3fe644c9307124e9 (commit) via b0996a3fa223370edcdb40a1d8b66d1a3a734daf (commit) via 8b6cc2518a8019314af43a32702a09bff318b777 (commit) via 2d23f7b206c908e55999143487548e2d6a92bc79 (commit) from 39ec090ac4c4389a761fda0ff913e3267c2839e3 (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=d44f19273550c193ef643db5fc9ac6aff13ce85b commit d44f19273550c193ef643db5fc9ac6aff13ce85b Merge: 39ec090 9a8d758 Author: Brad King AuthorDate: Wed Nov 2 12:48:24 2016 -0400 Commit: CMake Topic Stage CommitDate: Wed Nov 2 12:48:24 2016 -0400 Merge topic 'compile-features-for-language-standards' into next 9a8d758c Help: Document language standard meta-features df252db1 Features: Test cycle diagnostic with language standard meta-feature 6d5fb0e0 Features: Test feature propagation with language standard meta-feature a34b98a8 WCDH: Ignore language standard meta-features b0996a3f Features: Add meta-features requesting awareness of a particular standard 8b6cc251 Features: Centralize per-compiler recording macros 2d23f7b2 Features: Do not record features on MSVC < 2010 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9a8d758c3a27833dccf21102ae753de314684b0d commit 9a8d758c3a27833dccf21102ae753de314684b0d Author: Brad King AuthorDate: Fri Oct 28 09:31:48 2016 -0400 Commit: Brad King CommitDate: Wed Nov 2 10:01:24 2016 -0400 Help: Document language standard meta-features diff --git a/Help/manual/cmake-compile-features.7.rst b/Help/manual/cmake-compile-features.7.rst index 9862d4a..13f7d16 100644 --- a/Help/manual/cmake-compile-features.7.rst +++ b/Help/manual/cmake-compile-features.7.rst @@ -84,6 +84,33 @@ Feature requirements are evaluated transitively by consuming the link implementation. See :manual:`cmake-buildsystem(7)` for more on transitive behavior of build properties and usage requirements. +Requiring Language Standards +---------------------------- + +In projects that use a large number of commonly available features from +a particular language standard (e.g. C++ 11) one may specify a +meta-feature (e.g. ``cxx_std_11``) that requires use of a compiler mode +aware of that standard. This is simpler than specifying all the +features individually, but does not guarantee the existence of any +particular feature. Diagnosis of use of unsupported features will be +delayed until compile time. + +For example, if C++ 11 features are used extensively in a project's +header files, then clients must use a compiler mode aware of C++ 11 +or above. This can be requested with the code: + +.. code-block:: cmake + + target_compile_features(mylib PUBLIC cxx_std_11) + +In this example, CMake will ensure the compiler is invoked in a mode +that is aware of C++ 11 (or above), adding flags such as +``-std=gnu++11`` if necessary. This applies to sources within ``mylib`` +as well as any dependents (that may include headers from ``mylib``). + +Availability of Compiler Extensions +----------------------------------- + Because the :prop_tgt:`CXX_EXTENSIONS` target property is ``ON`` by default, CMake uses extended variants of language dialects by default, such as ``-std=gnu++11`` instead of ``-std=c++11``. That target property may be diff --git a/Help/release/dev/compile-features-for-language-standards.rst b/Help/release/dev/compile-features-for-language-standards.rst new file mode 100644 index 0000000..20473b7 --- /dev/null +++ b/Help/release/dev/compile-features-for-language-standards.rst @@ -0,0 +1,7 @@ +compile-features-for-language-standards +--------------------------------------- + +* The :manual:`Compile Features ` functionality + now offers meta-features that request compiler modes for specific language + standard levels. See :prop_gbl:`CMAKE_C_KNOWN_FEATURES` and + :prop_gbl:`CMAKE_CXX_KNOWN_FEATURES`. https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=df252db15a0e539be255536417f36045301db02c commit df252db15a0e539be255536417f36045301db02c Author: Brad King AuthorDate: Fri Oct 28 09:43:34 2016 -0400 Commit: Brad King CommitDate: Wed Nov 2 10:01:24 2016 -0400 Features: Test cycle diagnostic with language standard meta-feature The `cxx_static_assert` feature may be available in C++ 98 mode of some compilers or not available at all in others. Intstead of using an individual feature to test cyclic requirement of a feature requiring C++ 11, use the `std_cxx_11` meta-feature that has exactly this meaning. diff --git a/Tests/RunCMake/CompileFeatures/LinkImplementationFeatureCycle.cmake b/Tests/RunCMake/CompileFeatures/LinkImplementationFeatureCycle.cmake index 09594bd..2d14a9e 100644 --- a/Tests/RunCMake/CompileFeatures/LinkImplementationFeatureCycle.cmake +++ b/Tests/RunCMake/CompileFeatures/LinkImplementationFeatureCycle.cmake @@ -3,13 +3,13 @@ add_library(empty1 empty.cpp) add_library(empty2 INTERFACE) add_library(empty3 INTERFACE) -target_compile_features(empty3 INTERFACE cxx_static_assert) +target_compile_features(empty3 INTERFACE cxx_std_11) target_link_libraries(empty1 # When starting, $ is '0', so 'freeze' the # CXX_STANDARD at 98 during computation. $<$:empty2> - # This would add cxx_static_assert, but that would require CXX_STANDARD = 11, + # This would add cxx_std_11, but that would require CXX_STANDARD = 11, # which is not allowed after freeze. Report an error. empty3 ) diff --git a/Tests/RunCMake/CompileFeatures/LinkImplementationFeatureCycleSolved.cmake b/Tests/RunCMake/CompileFeatures/LinkImplementationFeatureCycleSolved.cmake index bbcf4e0..a04dcec 100644 --- a/Tests/RunCMake/CompileFeatures/LinkImplementationFeatureCycleSolved.cmake +++ b/Tests/RunCMake/CompileFeatures/LinkImplementationFeatureCycleSolved.cmake @@ -3,7 +3,7 @@ add_library(empty1 empty.cpp) add_library(empty2 INTERFACE) add_library(empty3 INTERFACE) -target_compile_features(empty3 INTERFACE cxx_static_assert) +target_compile_features(empty3 INTERFACE cxx_std_11) target_link_libraries(empty1 $<$:empty2> https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6d5fb0e0d0464d50ae58673bf5543b0d052dc681 commit 6d5fb0e0d0464d50ae58673bf5543b0d052dc681 Author: Brad King AuthorDate: Fri Oct 28 09:41:30 2016 -0400 Commit: Brad King CommitDate: Wed Nov 2 10:01:23 2016 -0400 Features: Test feature propagation with language standard meta-feature The `cxx_static_assert` feature may be available in C++ 98 mode of some compilers or not available at all in others. Intstead of using an individual feature to test propagation of a feature requiring C++ 11, use the `std_cxx_11` meta-feature that has exactly this meaning. diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt index 9986de0..9f61186 100644 --- a/Tests/CompileFeatures/CMakeLists.txt +++ b/Tests/CompileFeatures/CMakeLists.txt @@ -398,7 +398,7 @@ if (CMAKE_CXX_COMPILE_FEATURES) ) add_executable(CompileFeaturesGenex2 genex_test.cpp) - target_compile_features(CompileFeaturesGenex2 PRIVATE cxx_static_assert) + target_compile_features(CompileFeaturesGenex2 PRIVATE cxx_std_11) target_compile_definitions(CompileFeaturesGenex2 PRIVATE HAVE_OVERRIDE_CONTROL=$ HAVE_AUTO_TYPE=$ @@ -407,10 +407,10 @@ if (CMAKE_CXX_COMPILE_FEATURES) HAVE_INHERITING_CONSTRUCTORS_AND_FINAL=$ ) - add_library(static_assert_iface INTERFACE) - target_compile_features(static_assert_iface INTERFACE cxx_static_assert) + add_library(std_11_iface INTERFACE) + target_compile_features(std_11_iface INTERFACE cxx_std_11) add_executable(CompileFeaturesGenex3 genex_test.cpp) - target_link_libraries(CompileFeaturesGenex3 PRIVATE static_assert_iface) + target_link_libraries(CompileFeaturesGenex3 PRIVATE std_11_iface) target_compile_definitions(CompileFeaturesGenex3 PRIVATE HAVE_OVERRIDE_CONTROL=$ HAVE_AUTO_TYPE=$ https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a34b98a834bf6ac044e8590c3fe644c9307124e9 commit a34b98a834bf6ac044e8590c3fe644c9307124e9 Author: Brad King AuthorDate: Wed Oct 26 16:26:22 2016 -0400 Commit: Brad King CommitDate: Wed Nov 2 10:01:23 2016 -0400 WCDH: Ignore language standard meta-features The `{c,cxx}_std_*` features are meant for use with `target_compile_features` but do not make sense for use with WriteCompilerDetectionHeader. Filter them out of any requested list. diff --git a/Modules/WriteCompilerDetectionHeader.cmake b/Modules/WriteCompilerDetectionHeader.cmake index 82e8fba..a390f4b 100644 --- a/Modules/WriteCompilerDetectionHeader.cmake +++ b/Modules/WriteCompilerDetectionHeader.cmake @@ -76,6 +76,7 @@ # Available features in this version of CMake are listed in the # :prop_gbl:`CMAKE_C_KNOWN_FEATURES` and # :prop_gbl:`CMAKE_CXX_KNOWN_FEATURES` global properties. +# The ``{c,cxx}_std_*`` meta-features are ignored if requested. # # See the :manual:`cmake-compile-features(7)` manual for information on # compile features. @@ -358,7 +359,11 @@ function(write_compiler_detection_header endif() foreach(feature ${_WCD_FEATURES}) - if (feature MATCHES "^cxx_") + if (feature MATCHES "^c_std_") + # ignored + elseif (feature MATCHES "^cxx_std_") + # ignored + elseif (feature MATCHES "^cxx_") list(APPEND _langs CXX) list(APPEND CXX_features ${feature}) elseif (feature MATCHES "^c_") https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b0996a3fa223370edcdb40a1d8b66d1a3a734daf commit b0996a3fa223370edcdb40a1d8b66d1a3a734daf Author: Brad King AuthorDate: Wed Oct 26 16:11:01 2016 -0400 Commit: Brad King CommitDate: Wed Nov 2 10:00:28 2016 -0400 Features: Add meta-features requesting awareness of a particular standard A common use case of `target_compile_features` is simply to specify that the compiler should be run in a mode that is aware of e.g. C++11. Some projects simply specify a particular C++11-only feature to request this. Provide a first-class way to do this by naming features after the corresponding language standard. Record them as always available in the corresponding standard level so that requesting them always ensures that standard (or higher) is used. diff --git a/Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst b/Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst index e8f4d2a..00a5104 100644 --- a/Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst +++ b/Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst @@ -14,6 +14,15 @@ compile features and a list of supported compilers. The features known to this version of CMake are: +``cxx_std_98`` + Compiler mode is aware of C++ 98. + +``cxx_std_11`` + Compiler mode is aware of C++ 11. + +``cxx_std_14`` + Compiler mode is aware of C++ 14. + ``cxx_aggregate_default_initializers`` Aggregate default initializers, as defined in N3605_. diff --git a/Help/prop_gbl/CMAKE_C_KNOWN_FEATURES.rst b/Help/prop_gbl/CMAKE_C_KNOWN_FEATURES.rst index a08af00..3707fef 100644 --- a/Help/prop_gbl/CMAKE_C_KNOWN_FEATURES.rst +++ b/Help/prop_gbl/CMAKE_C_KNOWN_FEATURES.rst @@ -13,6 +13,15 @@ compile features and a list of supported compilers. The features known to this version of CMake are: +``c_std_90`` + Compiler mode is aware of C 90. + +``c_std_99`` + Compiler mode is aware of C 99. + +``c_std_11`` + Compiler mode is aware of C 11. + ``c_function_prototypes`` Function prototypes, as defined in ``ISO/IEC 9899:1990``. diff --git a/Modules/Compiler/MSVC-CXX.cmake b/Modules/Compiler/MSVC-CXX.cmake index 82f15bd..f103832 100644 --- a/Modules/Compiler/MSVC-CXX.cmake +++ b/Modules/Compiler/MSVC-CXX.cmake @@ -6,6 +6,11 @@ endif() macro(cmake_record_cxx_compile_features) if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 16.0) + list(APPEND CMAKE_CXX_COMPILE_FEATURES + cxx_std_98 + cxx_std_11 + cxx_std_14 + ) _record_compiler_features(CXX "" CMAKE_CXX_COMPILE_FEATURES) endif() endmacro() diff --git a/Modules/Internal/FeatureTesting.cmake b/Modules/Internal/FeatureTesting.cmake index e94246e..50b8526 100644 --- a/Modules/Internal/FeatureTesting.cmake +++ b/Modules/Internal/FeatureTesting.cmake @@ -60,9 +60,11 @@ macro(_record_compiler_features lang compile_flags feature_list) endmacro() macro(_record_compiler_features_c std) + list(APPEND CMAKE_C${std}_COMPILE_FEATURES c_std_${std}) _record_compiler_features(C "${CMAKE_C${std}_STANDARD_COMPILE_OPTION}" CMAKE_C${std}_COMPILE_FEATURES) endmacro() macro(_record_compiler_features_cxx std) + list(APPEND CMAKE_CXX${std}_COMPILE_FEATURES cxx_std_${std}) _record_compiler_features(CXX "${CMAKE_CXX${std}_STANDARD_COMPILE_OPTION}" CMAKE_CXX${std}_COMPILE_FEATURES) endmacro() diff --git a/Source/cmake.h b/Source/cmake.h index cd00c61..6e8d9c8 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -535,12 +535,18 @@ private: } #define FOR_EACH_C_FEATURE(F) \ + F(c_std_90) \ + F(c_std_99) \ + F(c_std_11) \ F(c_function_prototypes) \ F(c_restrict) \ F(c_static_assert) \ F(c_variadic_macros) #define FOR_EACH_CXX_FEATURE(F) \ + F(cxx_std_98) \ + F(cxx_std_11) \ + F(cxx_std_14) \ F(cxx_aggregate_default_initializers) \ F(cxx_alias_templates) \ F(cxx_alignas) \ diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt index 9f08523..9986de0 100644 --- a/Tests/CompileFeatures/CMakeLists.txt +++ b/Tests/CompileFeatures/CMakeLists.txt @@ -23,10 +23,12 @@ macro(run_test feature lang) endmacro() get_property(c_features GLOBAL PROPERTY CMAKE_C_KNOWN_FEATURES) +list(REMOVE_ITEM c_features c_std_90 c_std_99 c_std_11) foreach(feature ${c_features}) run_test(${feature} C) endforeach() get_property(cxx_features GLOBAL PROPERTY CMAKE_CXX_KNOWN_FEATURES) +list(REMOVE_ITEM cxx_features cxx_std_98 cxx_std_11 cxx_std_14) foreach(feature ${cxx_features}) run_test(${feature} CXX) endforeach() https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8b6cc2518a8019314af43a32702a09bff318b777 commit 8b6cc2518a8019314af43a32702a09bff318b777 Author: Brad King AuthorDate: Wed Nov 2 09:42:39 2016 -0400 Commit: Brad King CommitDate: Wed Nov 2 09:51:48 2016 -0400 Features: Centralize per-compiler recording macros Simplify and de-duplicate per-compiler feature recording macros and convert to a centralized per-language macro. diff --git a/Modules/Compiler/AppleClang-C.cmake b/Modules/Compiler/AppleClang-C.cmake index 1cc72c0..fe39b3b 100644 --- a/Modules/Compiler/AppleClang-C.cmake +++ b/Modules/Compiler/AppleClang-C.cmake @@ -25,18 +25,14 @@ if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.0) endif() macro(cmake_record_c_compile_features) - macro(_get_appleclang_features std_version list) - record_compiler_features(C "${std_version}" ${list}) - endmacro() - set(_result 0) if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.0) - _get_appleclang_features(${CMAKE_C11_STANDARD_COMPILE_OPTION} CMAKE_C11_COMPILE_FEATURES) + _record_compiler_features_c(11) if (_result EQUAL 0) - _get_appleclang_features(${CMAKE_C99_STANDARD_COMPILE_OPTION} CMAKE_C99_COMPILE_FEATURES) + _record_compiler_features_c(99) endif() if (_result EQUAL 0) - _get_appleclang_features(${CMAKE_C90_STANDARD_COMPILE_OPTION} CMAKE_C90_COMPILE_FEATURES) + _record_compiler_features_c(90) endif() endif() endmacro() diff --git a/Modules/Compiler/AppleClang-CXX.cmake b/Modules/Compiler/AppleClang-CXX.cmake index 95bc79a..8dd6278 100644 --- a/Modules/Compiler/AppleClang-CXX.cmake +++ b/Modules/Compiler/AppleClang-CXX.cmake @@ -36,21 +36,17 @@ endif() macro(cmake_record_cxx_compile_features) - macro(_get_appleclang_features std_version list) - record_compiler_features(CXX "${std_version}" ${list}) - endmacro() - set(_result 0) if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.0) set(_result 0) if(CMAKE_CXX14_STANDARD_COMPILE_OPTION) - _get_appleclang_features(${CMAKE_CXX14_STANDARD_COMPILE_OPTION} CMAKE_CXX14_COMPILE_FEATURES) + _record_compiler_features_cxx(14) endif() if (_result EQUAL 0) - _get_appleclang_features(${CMAKE_CXX11_STANDARD_COMPILE_OPTION} CMAKE_CXX11_COMPILE_FEATURES) + _record_compiler_features_cxx(11) endif() if (_result EQUAL 0) - _get_appleclang_features(${CMAKE_CXX98_STANDARD_COMPILE_OPTION} CMAKE_CXX98_COMPILE_FEATURES) + _record_compiler_features_cxx(98) endif() endif() endmacro() diff --git a/Modules/Compiler/Clang-C.cmake b/Modules/Compiler/Clang-C.cmake index d8b7743..b3f3805 100644 --- a/Modules/Compiler/Clang-C.cmake +++ b/Modules/Compiler/Clang-C.cmake @@ -34,18 +34,14 @@ if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 3.4) endif() macro(cmake_record_c_compile_features) - macro(_get_clang_features std_version list) - record_compiler_features(C "${std_version}" ${list}) - endmacro() - set(_result 0) if (UNIX AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 3.4) - _get_clang_features(${CMAKE_C11_STANDARD_COMPILE_OPTION} CMAKE_C11_COMPILE_FEATURES) + _record_compiler_features_c(11) if (_result EQUAL 0) - _get_clang_features(${CMAKE_C99_STANDARD_COMPILE_OPTION} CMAKE_C99_COMPILE_FEATURES) + _record_compiler_features_c(99) endif() if (_result EQUAL 0) - _get_clang_features(${CMAKE_C90_STANDARD_COMPILE_OPTION} CMAKE_C90_COMPILE_FEATURES) + _record_compiler_features_c(90) endif() endif() endmacro() diff --git a/Modules/Compiler/Clang-CXX.cmake b/Modules/Compiler/Clang-CXX.cmake index dc62711..dfe0628 100644 --- a/Modules/Compiler/Clang-CXX.cmake +++ b/Modules/Compiler/Clang-CXX.cmake @@ -44,18 +44,14 @@ if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.4) endif() macro(cmake_record_cxx_compile_features) - macro(_get_clang_features std_version list) - record_compiler_features(CXX "${std_version}" ${list}) - endmacro() - set(_result 0) if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.4) - _get_clang_features(${CMAKE_CXX14_STANDARD_COMPILE_OPTION} CMAKE_CXX14_COMPILE_FEATURES) + _record_compiler_features_cxx(14) if (_result EQUAL 0) - _get_clang_features(${CMAKE_CXX11_STANDARD_COMPILE_OPTION} CMAKE_CXX11_COMPILE_FEATURES) + _record_compiler_features_cxx(11) endif() if (_result EQUAL 0) - _get_clang_features(${CMAKE_CXX98_STANDARD_COMPILE_OPTION} CMAKE_CXX98_COMPILE_FEATURES) + _record_compiler_features_cxx(98) endif() endif() endmacro() diff --git a/Modules/Compiler/GNU-C.cmake b/Modules/Compiler/GNU-C.cmake index 2c478da..4dbf6ef 100644 --- a/Modules/Compiler/GNU-C.cmake +++ b/Modules/Compiler/GNU-C.cmake @@ -40,20 +40,16 @@ endif() macro(cmake_record_c_compile_features) - macro(_get_gcc_features std_version list) - record_compiler_features(C "${std_version}" ${list}) - endmacro() - set(_result 0) if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.6) - _get_gcc_features(${CMAKE_C11_STANDARD_COMPILE_OPTION} CMAKE_C11_COMPILE_FEATURES) + _record_compiler_features_c(11) endif() if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.4) if (_result EQUAL 0) - _get_gcc_features(${CMAKE_C99_STANDARD_COMPILE_OPTION} CMAKE_C99_COMPILE_FEATURES) + _record_compiler_features_c(99) endif() if (_result EQUAL 0) - _get_gcc_features(${CMAKE_C90_STANDARD_COMPILE_OPTION} CMAKE_C90_COMPILE_FEATURES) + _record_compiler_features_c(90) endif() endif() endmacro() diff --git a/Modules/Compiler/GNU-CXX.cmake b/Modules/Compiler/GNU-CXX.cmake index e1c555b..936f62b 100644 --- a/Modules/Compiler/GNU-CXX.cmake +++ b/Modules/Compiler/GNU-CXX.cmake @@ -47,20 +47,16 @@ if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.4) endif() macro(cmake_record_cxx_compile_features) - macro(_get_gcc_features std_version list) - record_compiler_features(CXX "${std_version}" ${list}) - endmacro() - set(_result 0) if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8) - _get_gcc_features(${CMAKE_CXX14_STANDARD_COMPILE_OPTION} CMAKE_CXX14_COMPILE_FEATURES) + _record_compiler_features_cxx(14) endif() if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.4) if (_result EQUAL 0) - _get_gcc_features(${CMAKE_CXX11_STANDARD_COMPILE_OPTION} CMAKE_CXX11_COMPILE_FEATURES) + _record_compiler_features_cxx(11) endif() if (_result EQUAL 0) - _get_gcc_features(${CMAKE_CXX98_STANDARD_COMPILE_OPTION} CMAKE_CXX98_COMPILE_FEATURES) + _record_compiler_features_cxx(98) endif() endif() endmacro() diff --git a/Modules/Compiler/Intel-C.cmake b/Modules/Compiler/Intel-C.cmake index 5815857..5a79452 100644 --- a/Modules/Compiler/Intel-C.cmake +++ b/Modules/Compiler/Intel-C.cmake @@ -47,20 +47,16 @@ unset(_std) unset(_ext) macro(cmake_record_c_compile_features) - macro(_get_intel_c_features std_version list) - record_compiler_features(C "${std_version}" ${list}) - endmacro() - set(_result 0) if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 12.1) if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 15.0.0) - _get_intel_c_features(${CMAKE_C11_STANDARD_COMPILE_OPTION} CMAKE_C11_COMPILE_FEATURES) + _record_compiler_features_C(11) endif() if (_result EQUAL 0) - _get_intel_c_features(${CMAKE_C99_STANDARD_COMPILE_OPTION} CMAKE_C99_COMPILE_FEATURES) + _record_compiler_features_C(99) endif() if (_result EQUAL 0) - _get_intel_c_features(${CMAKE_C90_STANDARD_COMPILE_OPTION} CMAKE_C90_COMPILE_FEATURES) + _record_compiler_features_C(90) endif() endif() endmacro() diff --git a/Modules/Compiler/Intel-CXX.cmake b/Modules/Compiler/Intel-CXX.cmake index b6bc2ee..6673a2d 100644 --- a/Modules/Compiler/Intel-CXX.cmake +++ b/Modules/Compiler/Intel-CXX.cmake @@ -60,20 +60,16 @@ unset(_std) unset(_ext) macro(cmake_record_cxx_compile_features) - macro(_get_intel_features std_version list) - record_compiler_features(CXX "${std_version}" ${list}) - endmacro() - set(_result 0) if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 12.1) if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 15.0) - _get_intel_features("${CMAKE_CXX14_STANDARD_COMPILE_OPTION}" CMAKE_CXX14_COMPILE_FEATURES) + _record_compiler_features_cxx(14) endif() if (_result EQUAL 0) - _get_intel_features("${CMAKE_CXX11_STANDARD_COMPILE_OPTION}" CMAKE_CXX11_COMPILE_FEATURES) + _record_compiler_features_cxx(11) endif() if (_result EQUAL 0) - _get_intel_features("${CMAKE_CXX98_STANDARD_COMPILE_OPTION}" CMAKE_CXX98_COMPILE_FEATURES) + _record_compiler_features_cxx(98) endif() endif() endmacro() diff --git a/Modules/Compiler/MSVC-CXX.cmake b/Modules/Compiler/MSVC-CXX.cmake index 681ee70..82f15bd 100644 --- a/Modules/Compiler/MSVC-CXX.cmake +++ b/Modules/Compiler/MSVC-CXX.cmake @@ -6,6 +6,6 @@ endif() macro(cmake_record_cxx_compile_features) if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 16.0) - record_compiler_features(CXX "" CMAKE_CXX_COMPILE_FEATURES) + _record_compiler_features(CXX "" CMAKE_CXX_COMPILE_FEATURES) endif() endmacro() diff --git a/Modules/Compiler/SunPro-CXX.cmake b/Modules/Compiler/SunPro-CXX.cmake index ce01cdd..e83c896 100644 --- a/Modules/Compiler/SunPro-CXX.cmake +++ b/Modules/Compiler/SunPro-CXX.cmake @@ -32,6 +32,8 @@ set(CMAKE_CXX_CREATE_STATIC_LIBRARY " ") if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.13) + set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "") + set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "") set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-std=c++11") set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-std=c++11") endif() @@ -49,15 +51,11 @@ if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.13) endif() macro(cmake_record_cxx_compile_features) - macro(_get_solaris_studio_features std_version list) - record_compiler_features(CXX "${std_version}" ${list}) - endmacro() - set(_result 0) if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.13) - _get_solaris_studio_features(${CMAKE_CXX11_STANDARD_COMPILE_OPTION} CMAKE_CXX11_COMPILE_FEATURES) + _record_compiler_features_cxx(11) if (_result EQUAL 0) - _get_solaris_studio_features("" CMAKE_CXX98_COMPILE_FEATURES) + _record_compiler_features_cxx(98) endif() endif() endmacro() diff --git a/Modules/Internal/FeatureTesting.cmake b/Modules/Internal/FeatureTesting.cmake index 86b89b2..e94246e 100644 --- a/Modules/Internal/FeatureTesting.cmake +++ b/Modules/Internal/FeatureTesting.cmake @@ -1,5 +1,5 @@ -macro(record_compiler_features lang compile_flags feature_list) +macro(_record_compiler_features lang compile_flags feature_list) include("${CMAKE_ROOT}/Modules/Compiler/${CMAKE_${lang}_COMPILER_ID}-${lang}-FeatureTests.cmake" OPTIONAL) string(TOLOWER ${lang} lang_lc) @@ -58,3 +58,11 @@ macro(record_compiler_features lang compile_flags feature_list) "Detecting ${lang} [${compile_flags}] compiler features failed to compile with the following output:\n${_output}\n${_copy_error}\n\n") endif() endmacro() + +macro(_record_compiler_features_c std) + _record_compiler_features(C "${CMAKE_C${std}_STANDARD_COMPILE_OPTION}" CMAKE_C${std}_COMPILE_FEATURES) +endmacro() + +macro(_record_compiler_features_cxx std) + _record_compiler_features(CXX "${CMAKE_CXX${std}_STANDARD_COMPILE_OPTION}" CMAKE_CXX${std}_COMPILE_FEATURES) +endmacro() https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2d23f7b206c908e55999143487548e2d6a92bc79 commit 2d23f7b206c908e55999143487548e2d6a92bc79 Author: Brad King AuthorDate: Wed Nov 2 09:41:13 2016 -0400 Commit: Brad King CommitDate: Wed Nov 2 09:42:18 2016 -0400 Features: Do not record features on MSVC < 2010 We have no feature tests for versions of VS older than 2010, so do not even call `record_compiler_features` for such versions. This is consistent with other compilers where we call this macro only for versions for which we have recorded features. diff --git a/Modules/Compiler/MSVC-CXX.cmake b/Modules/Compiler/MSVC-CXX.cmake index 82ce069..681ee70 100644 --- a/Modules/Compiler/MSVC-CXX.cmake +++ b/Modules/Compiler/MSVC-CXX.cmake @@ -5,5 +5,7 @@ if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 16.0) endif() macro(cmake_record_cxx_compile_features) - record_compiler_features(CXX "" CMAKE_CXX_COMPILE_FEATURES) + if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 16.0) + record_compiler_features(CXX "" CMAKE_CXX_COMPILE_FEATURES) + endif() endmacro() ----------------------------------------------------------------------- Summary of changes: Help/manual/cmake-compile-features.7.rst | 27 ++++++++++++++++++++ Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst | 9 +++++++ Help/prop_gbl/CMAKE_C_KNOWN_FEATURES.rst | 9 +++++++ .../compile-features-for-language-standards.rst | 7 +++++ Modules/Compiler/AppleClang-C.cmake | 10 +++----- Modules/Compiler/AppleClang-CXX.cmake | 10 +++----- Modules/Compiler/Clang-C.cmake | 10 +++----- Modules/Compiler/Clang-CXX.cmake | 10 +++----- Modules/Compiler/GNU-C.cmake | 10 +++----- Modules/Compiler/GNU-CXX.cmake | 10 +++----- Modules/Compiler/Intel-C.cmake | 10 +++----- Modules/Compiler/Intel-CXX.cmake | 10 +++----- Modules/Compiler/MSVC-CXX.cmake | 9 ++++++- Modules/Compiler/SunPro-CXX.cmake | 10 +++----- Modules/Internal/FeatureTesting.cmake | 12 ++++++++- Modules/WriteCompilerDetectionHeader.cmake | 7 ++++- Source/cmake.h | 6 +++++ Tests/CompileFeatures/CMakeLists.txt | 10 +++++--- .../LinkImplementationFeatureCycle.cmake | 4 +-- .../LinkImplementationFeatureCycleSolved.cmake | 2 +- 20 files changed, 120 insertions(+), 72 deletions(-) create mode 100644 Help/release/dev/compile-features-for-language-standards.rst hooks/post-receive -- CMake From kwrobot at kitware.com Thu Nov 3 00:01:07 2016 From: kwrobot at kitware.com (Kitware Robot) Date: Thu, 3 Nov 2016 00:01:07 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.7.0-rc2-434-gffe7896 Message-ID: <20161103040107.8097EF8546@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 ffe78961ada28f3777066228b4e5870889b42f70 (commit) from ab2ae4823c3b60347825da4b851cd4e676f8bed1 (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=ffe78961ada28f3777066228b4e5870889b42f70 commit ffe78961ada28f3777066228b4e5870889b42f70 Author: Kitware Robot AuthorDate: Thu Nov 3 00:01:04 2016 -0400 Commit: Kitware Robot CommitDate: Thu Nov 3 00:01:04 2016 -0400 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 891a011..141d2a9 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 7) -set(CMake_VERSION_PATCH 20161102) +set(CMake_VERSION_PATCH 20161103) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Thu Nov 3 08:14:26 2016 From: brad.king at kitware.com (Brad King) Date: Thu, 3 Nov 2016 08:14:26 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.7.0-rc2-912-gefb4160 Message-ID: <20161103121426.81A2EF7AC8@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, next has been updated via efb416046626b3c9332dde3a2e20ace755d58b9a (commit) via 47392375887e09e6e69ce178f870f9ca9e639298 (commit) from d44f19273550c193ef643db5fc9ac6aff13ce85b (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=efb416046626b3c9332dde3a2e20ace755d58b9a commit efb416046626b3c9332dde3a2e20ace755d58b9a Merge: d44f192 4739237 Author: Brad King AuthorDate: Thu Nov 3 08:14:23 2016 -0400 Commit: CMake Topic Stage CommitDate: Thu Nov 3 08:14:23 2016 -0400 Merge topic 'cpackifw-search-algorithm' into next 47392375 CPackIFW: Updated search algorithm https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=47392375887e09e6e69ce178f870f9ca9e639298 commit 47392375887e09e6e69ce178f870f9ca9e639298 Author: Konstantin Podsvirov AuthorDate: Wed Nov 2 23:15:07 2016 +0300 Commit: Konstantin Podsvirov CommitDate: Wed Nov 2 23:15:07 2016 +0300 CPackIFW: Updated search algorithm Improviments: - Look for QtIFW distributed with QtSDK; - Do not give a reason for the CMP0007 warning. diff --git a/Modules/CPackIFW.cmake b/Modules/CPackIFW.cmake index 6c93ddb..08078cb 100644 --- a/Modules/CPackIFW.cmake +++ b/Modules/CPackIFW.cmake @@ -433,11 +433,15 @@ # Default path -set(_CPACK_IFW_PATHS - "${QTIFWDIR}" - "$ENV{QTIFWDIR}" - "${QTDIR}" - "$ENV{QTIFWDIR}") +foreach(_CPACK_IFW_PATH_VAR "QTIFWDIR" "QTDIR") + if(DEFINED ${_CPACK_IFW_PATH_VAR} + AND NOT "${${_CPACK_IFW_PATH_VAR}}" STREQUAL "") + list(APPEND _CPACK_IFW_PATHS "${${_CPACK_IFW_PATH_VAR}}") + endif() + if(NOT "$ENV{${_CPACK_IFW_PATH_VAR}}" STREQUAL "") + list(APPEND _CPACK_IFW_PATHS "$ENV{${_CPACK_IFW_PATH_VAR}}") + endif() +endforeach() if(WIN32) list(APPEND _CPACK_IFW_PATHS "$ENV{HOMEDRIVE}/Qt" @@ -447,22 +451,44 @@ else() "$ENV{HOME}/Qt" "/opt/Qt") endif() - -set(_CPACK_IFW_SUFFIXES -# Common - "bin" -# Second branch - "QtIFW2.3.0/bin" - "QtIFW2.2.0/bin" - "QtIFW2.1.0/bin" - "QtIFW2.0.3/bin" - "QtIFW2.0.1/bin" - "QtIFW2.0.0/bin" -# First branch - "QtIFW-1.6.0/bin" - "QtIFW-1.5.0/bin" - "QtIFW-1.4.0/bin" - "QtIFW-1.3.0/bin") +list(REMOVE_DUPLICATES _CPACK_IFW_PATHS) + +set(_CPACK_IFW_PREFIXES + # QtSDK + "Tools/QtInstallerFramework/" + # Second branch + "QtIFW" + # First branch + "QtIFW-") + +set(_CPACK_IFW_VERSIONS + "2.3" + "2.3.0" + "2.2" + "2.2.0" + "2.1" + "2.1.0" + "2.0" + "2.0.3" + "2.0.2" + "2.0.1" + "2.0.0" + "1.6" + "1.6.0" + "1.5" + "1.5.0" + "1.4" + "1.4.0" + "1.3" + "1.3.0") + +set(_CPACK_IFW_SUFFIXES "bin") +foreach(_CPACK_IFW_PREFIX ${_CPACK_IFW_PREFIXES}) + foreach(_CPACK_IFW_VERSION ${_CPACK_IFW_VERSIONS}) + list(APPEND + _CPACK_IFW_SUFFIXES "${_CPACK_IFW_PREFIX}${_CPACK_IFW_VERSION}/bin") + endforeach() +endforeach() # Look for 'binarycreator' ----------------------------------------------------------------------- Summary of changes: Modules/CPackIFW.cmake | 68 +++++++++++++++++++++++++++++++++--------------- 1 file changed, 47 insertions(+), 21 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Thu Nov 3 08:51:03 2016 From: brad.king at kitware.com (Brad King) Date: Thu, 3 Nov 2016 08:51:03 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.7.0-rc2-914-g17c1cb1 Message-ID: <20161103125104.4F917F80AF@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, next has been updated via 17c1cb103036976fed9b4b476654821629c177a0 (commit) via b902f2a98a6764857f74608250219186f262a207 (commit) from efb416046626b3c9332dde3a2e20ace755d58b9a (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=17c1cb103036976fed9b4b476654821629c177a0 commit 17c1cb103036976fed9b4b476654821629c177a0 Merge: efb4160 b902f2a Author: Brad King AuthorDate: Thu Nov 3 08:51:01 2016 -0400 Commit: CMake Topic Stage CommitDate: Thu Nov 3 08:51:01 2016 -0400 Merge topic 'intel-compile-features-windows' into next b902f2a9 Features: Fix Intel cxx_attributes existence condition https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b902f2a98a6764857f74608250219186f262a207 commit b902f2a98a6764857f74608250219186f262a207 Author: Brad King AuthorDate: Thu Nov 3 08:38:23 2016 -0400 Commit: Brad King CommitDate: Thu Nov 3 08:38:23 2016 -0400 Features: Fix Intel cxx_attributes existence condition This condition needs to follow the same pattern added in note `[1]` by commit a5a3642f (Features: Port Intel CXX features to test macros where possible, 2016-10-26). It was accidentally left out of that commit. diff --git a/Modules/Compiler/Intel-CXX-FeatureTests.cmake b/Modules/Compiler/Intel-CXX-FeatureTests.cmake index 5b74fab..d1a3433 100644 --- a/Modules/Compiler/Intel-CXX-FeatureTests.cmake +++ b/Modules/Compiler/Intel-CXX-FeatureTests.cmake @@ -88,7 +88,7 @@ set(_cmake_feature_test_cxx_variadic_templates "(__cpp_variadic_templates >= 200 set(_cmake_feature_test_cxx_alias_templates "${Intel121_CXX11}") set(_cmake_feature_test_cxx_nullptr "${Intel121_CXX11}") set(_cmake_feature_test_cxx_trailing_return_types "${Intel121_CXX11}") -set(_cmake_feature_test_cxx_attributes "__cpp_attributes >= 200809 || ${Intel121}") +set(_cmake_feature_test_cxx_attributes "(__cpp_attributes >= 200809 || ${Intel121}) && ${DETECT_CXX11}") # [1] set(_cmake_feature_test_cxx_default_function_template_args "${Intel121_CXX11}") set(_cmake_feature_test_cxx_extended_friend_declarations "${Intel121_CXX11}") set(_cmake_feature_test_cxx_rvalue_references "(__cpp_rvalue_references >= 200610 || ${Intel121}) && ${DETECT_CXX11}") # [1] ----------------------------------------------------------------------- Summary of changes: Modules/Compiler/Intel-CXX-FeatureTests.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Thu Nov 3 08:54:31 2016 From: brad.king at kitware.com (Brad King) Date: Thu, 3 Nov 2016 08:54:31 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.7.0-rc2-436-g90e09fb Message-ID: <20161103125432.01D47F823C@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 90e09fb958e761b416863052ca5408ed4280443b (commit) via b902f2a98a6764857f74608250219186f262a207 (commit) from ffe78961ada28f3777066228b4e5870889b42f70 (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=90e09fb958e761b416863052ca5408ed4280443b commit 90e09fb958e761b416863052ca5408ed4280443b Merge: ffe7896 b902f2a Author: Brad King AuthorDate: Thu Nov 3 08:54:28 2016 -0400 Commit: CMake Topic Stage CommitDate: Thu Nov 3 08:54:28 2016 -0400 Merge topic 'intel-compile-features-windows' b902f2a9 Features: Fix Intel cxx_attributes existence condition ----------------------------------------------------------------------- Summary of changes: Modules/Compiler/Intel-CXX-FeatureTests.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Thu Nov 3 08:54:36 2016 From: brad.king at kitware.com (Brad King) Date: Thu, 3 Nov 2016 08:54:36 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.7.0-rc2-444-ge106a6e Message-ID: <20161103125436.A078EF826B@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 e106a6eafb42dd3c6557e964e04339dcd5787ad4 (commit) via 9a8d758c3a27833dccf21102ae753de314684b0d (commit) via df252db15a0e539be255536417f36045301db02c (commit) via 6d5fb0e0d0464d50ae58673bf5543b0d052dc681 (commit) via a34b98a834bf6ac044e8590c3fe644c9307124e9 (commit) via b0996a3fa223370edcdb40a1d8b66d1a3a734daf (commit) via 8b6cc2518a8019314af43a32702a09bff318b777 (commit) via 2d23f7b206c908e55999143487548e2d6a92bc79 (commit) from 90e09fb958e761b416863052ca5408ed4280443b (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=e106a6eafb42dd3c6557e964e04339dcd5787ad4 commit e106a6eafb42dd3c6557e964e04339dcd5787ad4 Merge: 90e09fb 9a8d758 Author: Brad King AuthorDate: Thu Nov 3 08:54:33 2016 -0400 Commit: CMake Topic Stage CommitDate: Thu Nov 3 08:54:33 2016 -0400 Merge topic 'compile-features-for-language-standards' 9a8d758c Help: Document language standard meta-features df252db1 Features: Test cycle diagnostic with language standard meta-feature 6d5fb0e0 Features: Test feature propagation with language standard meta-feature a34b98a8 WCDH: Ignore language standard meta-features b0996a3f Features: Add meta-features requesting awareness of a particular standard 8b6cc251 Features: Centralize per-compiler recording macros 2d23f7b2 Features: Do not record features on MSVC < 2010 ----------------------------------------------------------------------- Summary of changes: Help/manual/cmake-compile-features.7.rst | 27 ++++++++++++++++++++ Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst | 9 +++++++ Help/prop_gbl/CMAKE_C_KNOWN_FEATURES.rst | 9 +++++++ .../compile-features-for-language-standards.rst | 7 +++++ Modules/Compiler/AppleClang-C.cmake | 10 +++----- Modules/Compiler/AppleClang-CXX.cmake | 10 +++----- Modules/Compiler/Clang-C.cmake | 10 +++----- Modules/Compiler/Clang-CXX.cmake | 10 +++----- Modules/Compiler/GNU-C.cmake | 10 +++----- Modules/Compiler/GNU-CXX.cmake | 10 +++----- Modules/Compiler/Intel-C.cmake | 10 +++----- Modules/Compiler/Intel-CXX.cmake | 10 +++----- Modules/Compiler/MSVC-CXX.cmake | 9 ++++++- Modules/Compiler/SunPro-CXX.cmake | 10 +++----- Modules/Internal/FeatureTesting.cmake | 12 ++++++++- Modules/WriteCompilerDetectionHeader.cmake | 7 ++++- Source/cmake.h | 6 +++++ Tests/CompileFeatures/CMakeLists.txt | 10 +++++--- .../LinkImplementationFeatureCycle.cmake | 4 +-- .../LinkImplementationFeatureCycleSolved.cmake | 2 +- 20 files changed, 120 insertions(+), 72 deletions(-) create mode 100644 Help/release/dev/compile-features-for-language-standards.rst hooks/post-receive -- CMake From brad.king at kitware.com Thu Nov 3 08:54:40 2016 From: brad.king at kitware.com (Brad King) Date: Thu, 3 Nov 2016 08:54:40 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.7.0-rc2-446-g3dd9975 Message-ID: <20161103125440.A88A3F826C@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 3dd99758d1f912d0edc2df05b6d2cfabd5005efe (commit) via baead1e2a8ff7938f6be9c5fc01762edddd2ace9 (commit) from e106a6eafb42dd3c6557e964e04339dcd5787ad4 (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=3dd99758d1f912d0edc2df05b6d2cfabd5005efe commit 3dd99758d1f912d0edc2df05b6d2cfabd5005efe Merge: e106a6e baead1e Author: Brad King AuthorDate: Thu Nov 3 08:54:37 2016 -0400 Commit: CMake Topic Stage CommitDate: Thu Nov 3 08:54:37 2016 -0400 Merge topic 'remove-utf8-option' baead1e2 Encoding: Remove option to use ANSI code page internally ----------------------------------------------------------------------- Summary of changes: CMakeLists.txt | 8 ++---- Source/CPack/WiX/cmCPackWIXGenerator.cxx | 3 +-- Source/CPack/WiX/cmWIXSourceWriter.cxx | 41 +---------------------------- Source/CPack/WiX/cmWIXSourceWriter.h | 2 -- Source/QtDialog/CMakeSetup.cxx | 2 -- Source/cmConfigure.cmake.h.in | 1 - Source/cmFileCommand.cxx | 6 ++--- Source/cmGlobalVisualStudio7Generator.cxx | 8 +----- 8 files changed, 8 insertions(+), 63 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Thu Nov 3 08:54:45 2016 From: brad.king at kitware.com (Brad King) Date: Thu, 3 Nov 2016 08:54:45 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.7.0-rc2-448-gacc2e03 Message-ID: <20161103125446.2767EF82DD@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 acc2e03d798eeebdecd8198ae8eba495f8ccc5e7 (commit) via ff3ccc1f2315d3de91ee6a90c8754ea554965c1d (commit) from 3dd99758d1f912d0edc2df05b6d2cfabd5005efe (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=acc2e03d798eeebdecd8198ae8eba495f8ccc5e7 commit acc2e03d798eeebdecd8198ae8eba495f8ccc5e7 Merge: 3dd9975 ff3ccc1 Author: Brad King AuthorDate: Thu Nov 3 08:54:43 2016 -0400 Commit: CMake Topic Stage CommitDate: Thu Nov 3 08:54:43 2016 -0400 Merge topic 'FindHDF5-restore-default-C' ff3ccc1f FindHDF5: Restore pre-3.6 behavior of finding only C by default ----------------------------------------------------------------------- Summary of changes: Modules/FindHDF5.cmake | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Thu Nov 3 08:55:12 2016 From: brad.king at kitware.com (Brad King) Date: Thu, 3 Nov 2016 08:55:12 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.7.0-rc2-920-g5b24b80 Message-ID: <20161103125512.7AD36F834B@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, next has been updated via 5b24b80fd4b77b5078d2a6f49c988ba6c937c901 (commit) via acc2e03d798eeebdecd8198ae8eba495f8ccc5e7 (commit) via 3dd99758d1f912d0edc2df05b6d2cfabd5005efe (commit) via e106a6eafb42dd3c6557e964e04339dcd5787ad4 (commit) via 90e09fb958e761b416863052ca5408ed4280443b (commit) via ffe78961ada28f3777066228b4e5870889b42f70 (commit) from 17c1cb103036976fed9b4b476654821629c177a0 (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=5b24b80fd4b77b5078d2a6f49c988ba6c937c901 commit 5b24b80fd4b77b5078d2a6f49c988ba6c937c901 Merge: 17c1cb1 acc2e03 Author: Brad King AuthorDate: Thu Nov 3 08:54:56 2016 -0400 Commit: Brad King CommitDate: Thu Nov 3 08:54:56 2016 -0400 Merge branch 'master' into next ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Thu Nov 3 08:58:56 2016 From: brad.king at kitware.com (Brad King) Date: Thu, 3 Nov 2016 08:58:56 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.7.0-rc2-453-gdec0cfc Message-ID: <20161103125856.4335AF84E9@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 dec0cfcef012ca762a731d6e096012fa1c072f14 (commit) via a12e148b8a7611d097158bc2acf4ae19ed2c9d18 (commit) via 967e9aafda9054a3e963923d14514075225f7792 (commit) via de25d988bccc2d81ce137d763246aadafda336ea (commit) via 5f7f0ab517d9f4fbc11292a1bada37a74ba69b97 (commit) from acc2e03d798eeebdecd8198ae8eba495f8ccc5e7 (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: hooks/post-receive -- CMake From brad.king at kitware.com Thu Nov 3 08:58:56 2016 From: brad.king at kitware.com (Brad King) Date: Thu, 3 Nov 2016 08:58:56 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.7.0-rc2-926-ga279f93 Message-ID: <20161103125856.97096F84EA@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, next has been updated via a279f9378ad9b8692230ddb9d74d8825d19c2a27 (commit) via dec0cfcef012ca762a731d6e096012fa1c072f14 (commit) via a12e148b8a7611d097158bc2acf4ae19ed2c9d18 (commit) via 967e9aafda9054a3e963923d14514075225f7792 (commit) via de25d988bccc2d81ce137d763246aadafda336ea (commit) via 5f7f0ab517d9f4fbc11292a1bada37a74ba69b97 (commit) from 5b24b80fd4b77b5078d2a6f49c988ba6c937c901 (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=a279f9378ad9b8692230ddb9d74d8825d19c2a27 commit a279f9378ad9b8692230ddb9d74d8825d19c2a27 Merge: 5b24b80 dec0cfc Author: Brad King AuthorDate: Thu Nov 3 08:58:44 2016 -0400 Commit: Brad King CommitDate: Thu Nov 3 08:58:44 2016 -0400 Merge branch 'master' into next ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Thu Nov 3 08:58:56 2016 From: brad.king at kitware.com (Brad King) Date: Thu, 3 Nov 2016 08:58:56 -0400 (EDT) Subject: [Cmake-commits] CMake branch, release, updated. v3.7.0-rc2-36-g5f7f0ab Message-ID: <20161103125857.5B2C6F8507@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 5f7f0ab517d9f4fbc11292a1bada37a74ba69b97 (commit) via ff3ccc1f2315d3de91ee6a90c8754ea554965c1d (commit) from c555eca9ba8e518dd8f91159d94a2a2bf58916b0 (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/FindHDF5.cmake | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Thu Nov 3 09:01:43 2016 From: brad.king at kitware.com (Brad King) Date: Thu, 3 Nov 2016 09:01:43 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.7.0-rc2-928-g54eed9a Message-ID: <20161103130143.7B639F85B8@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, next has been updated via 54eed9ada656ea5f43d55d4e7b03945889365689 (commit) via 4cb5d3353f488ee7bf3943619e67a5664dbae8df (commit) from a279f9378ad9b8692230ddb9d74d8825d19c2a27 (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=54eed9ada656ea5f43d55d4e7b03945889365689 commit 54eed9ada656ea5f43d55d4e7b03945889365689 Merge: a279f93 4cb5d33 Author: Brad King AuthorDate: Thu Nov 3 09:01:41 2016 -0400 Commit: CMake Topic Stage CommitDate: Thu Nov 3 09:01:41 2016 -0400 Merge topic 'vs-flag-order' into next 4cb5d335 VS: Place source-specific AdditionalOptions after target-wide flags https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4cb5d3353f488ee7bf3943619e67a5664dbae8df commit 4cb5d3353f488ee7bf3943619e67a5664dbae8df Author: Brad King AuthorDate: Wed Nov 2 13:08:14 2016 -0400 Commit: Brad King CommitDate: Wed Nov 2 13:11:08 2016 -0400 VS: Place source-specific AdditionalOptions after target-wide flags Flags specified in the `COMPILE_FLAGS` source-file property should be placed after those in target-wide properties so that those on individual source files can override those on the whole target. This is already done by most generators but was not implemented correctly for VS 2010 and above. Closes: #16400 diff --git a/Help/release/dev/vs-flag-order.rst b/Help/release/dev/vs-flag-order.rst new file mode 100644 index 0000000..21cea37 --- /dev/null +++ b/Help/release/dev/vs-flag-order.rst @@ -0,0 +1,9 @@ +vs-flag-order +------------- + +* The :ref:`Visual Studio Generators` for VS 2010 and above now place + per-source file flags after target-wide flags when they are classified + as raw flags with no project file setting (``AdditionalOptions``). + This behavior is more consistent with the ordering of flags produced + by other generators, and allows flags on more-specific properties + (per-source) to override those on more general ones (per-target). diff --git a/Source/cmVisualStudioGeneratorOptions.cxx b/Source/cmVisualStudioGeneratorOptions.cxx index 4be183d..e751bfc 100644 --- a/Source/cmVisualStudioGeneratorOptions.cxx +++ b/Source/cmVisualStudioGeneratorOptions.cxx @@ -334,8 +334,9 @@ void cmVisualStudioGeneratorOptions::OutputAdditionalOptions( } else { fout << ""; } - fout << cmVisualStudio10GeneratorOptionsEscapeForXML(this->FlagString) - << " %(AdditionalOptions)\n"; + fout << "%(AdditionalOptions) " + << cmVisualStudio10GeneratorOptionsEscapeForXML(this->FlagString) + << "\n"; } else { fout << prefix << "AdditionalOptions=\""; fout << cmVisualStudioGeneratorOptionsEscapeForXML(this->FlagString); ----------------------------------------------------------------------- Summary of changes: Help/release/dev/vs-flag-order.rst | 9 +++++++++ Source/cmVisualStudioGeneratorOptions.cxx | 5 +++-- 2 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 Help/release/dev/vs-flag-order.rst hooks/post-receive -- CMake From brad.king at kitware.com Thu Nov 3 09:28:53 2016 From: brad.king at kitware.com (Brad King) Date: Thu, 3 Nov 2016 09:28:53 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.7.0-rc2-930-gf4570ad Message-ID: <20161103132853.6F578F88D7@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, next has been updated via f4570ad0d275896fa14d09bfa871b938b4a3b894 (commit) via 20cc76c93a7f7ba1dd8a38e8311c0e9702395b27 (commit) from 54eed9ada656ea5f43d55d4e7b03945889365689 (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=f4570ad0d275896fa14d09bfa871b938b4a3b894 commit f4570ad0d275896fa14d09bfa871b938b4a3b894 Merge: 54eed9a 20cc76c Author: Brad King AuthorDate: Thu Nov 3 09:28:50 2016 -0400 Commit: CMake Topic Stage CommitDate: Thu Nov 3 09:28:50 2016 -0400 Merge topic 'cpackifw-search-algorithm' into next 20cc76c9 CPackIFW: Update search to find QtIFW distributed with QtSDK https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=20cc76c93a7f7ba1dd8a38e8311c0e9702395b27 commit 20cc76c93a7f7ba1dd8a38e8311c0e9702395b27 Author: Konstantin Podsvirov AuthorDate: Wed Nov 2 23:15:07 2016 +0300 Commit: Brad King CommitDate: Thu Nov 3 09:28:15 2016 -0400 CPackIFW: Update search to find QtIFW distributed with QtSDK Also avoid CMP0007 warnings. diff --git a/Modules/CPackIFW.cmake b/Modules/CPackIFW.cmake index 6c93ddb..08078cb 100644 --- a/Modules/CPackIFW.cmake +++ b/Modules/CPackIFW.cmake @@ -433,11 +433,15 @@ # Default path -set(_CPACK_IFW_PATHS - "${QTIFWDIR}" - "$ENV{QTIFWDIR}" - "${QTDIR}" - "$ENV{QTIFWDIR}") +foreach(_CPACK_IFW_PATH_VAR "QTIFWDIR" "QTDIR") + if(DEFINED ${_CPACK_IFW_PATH_VAR} + AND NOT "${${_CPACK_IFW_PATH_VAR}}" STREQUAL "") + list(APPEND _CPACK_IFW_PATHS "${${_CPACK_IFW_PATH_VAR}}") + endif() + if(NOT "$ENV{${_CPACK_IFW_PATH_VAR}}" STREQUAL "") + list(APPEND _CPACK_IFW_PATHS "$ENV{${_CPACK_IFW_PATH_VAR}}") + endif() +endforeach() if(WIN32) list(APPEND _CPACK_IFW_PATHS "$ENV{HOMEDRIVE}/Qt" @@ -447,22 +451,44 @@ else() "$ENV{HOME}/Qt" "/opt/Qt") endif() - -set(_CPACK_IFW_SUFFIXES -# Common - "bin" -# Second branch - "QtIFW2.3.0/bin" - "QtIFW2.2.0/bin" - "QtIFW2.1.0/bin" - "QtIFW2.0.3/bin" - "QtIFW2.0.1/bin" - "QtIFW2.0.0/bin" -# First branch - "QtIFW-1.6.0/bin" - "QtIFW-1.5.0/bin" - "QtIFW-1.4.0/bin" - "QtIFW-1.3.0/bin") +list(REMOVE_DUPLICATES _CPACK_IFW_PATHS) + +set(_CPACK_IFW_PREFIXES + # QtSDK + "Tools/QtInstallerFramework/" + # Second branch + "QtIFW" + # First branch + "QtIFW-") + +set(_CPACK_IFW_VERSIONS + "2.3" + "2.3.0" + "2.2" + "2.2.0" + "2.1" + "2.1.0" + "2.0" + "2.0.3" + "2.0.2" + "2.0.1" + "2.0.0" + "1.6" + "1.6.0" + "1.5" + "1.5.0" + "1.4" + "1.4.0" + "1.3" + "1.3.0") + +set(_CPACK_IFW_SUFFIXES "bin") +foreach(_CPACK_IFW_PREFIX ${_CPACK_IFW_PREFIXES}) + foreach(_CPACK_IFW_VERSION ${_CPACK_IFW_VERSIONS}) + list(APPEND + _CPACK_IFW_SUFFIXES "${_CPACK_IFW_PREFIX}${_CPACK_IFW_VERSION}/bin") + endforeach() +endforeach() # Look for 'binarycreator' ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Thu Nov 3 09:36:42 2016 From: brad.king at kitware.com (Brad King) Date: Thu, 3 Nov 2016 09:36:42 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.7.0-rc2-933-g0e78a19 Message-ID: <20161103133642.9BC58F8B30@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, next has been updated via 0e78a19123015e727c82b06f84859194a7ee7571 (commit) via 6db1846a898e7651720ac03f5d4c869f95729f0c (commit) via 9c507c13a0cffb163a1d56f34c020b5474a3e100 (commit) from f4570ad0d275896fa14d09bfa871b938b4a3b894 (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=0e78a19123015e727c82b06f84859194a7ee7571 commit 0e78a19123015e727c82b06f84859194a7ee7571 Merge: f4570ad 6db1846 Author: Brad King AuthorDate: Thu Nov 3 09:36:41 2016 -0400 Commit: CMake Topic Stage CommitDate: Thu Nov 3 09:36:41 2016 -0400 Merge topic 'test-release' into next 6db1846a Merge branch 'release-3.6' into test-release 9c507c13 CMake 3.6.3 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6db1846a898e7651720ac03f5d4c869f95729f0c commit 6db1846a898e7651720ac03f5d4c869f95729f0c Merge: dec0cfc 9c507c1 Author: Brad King AuthorDate: Thu Nov 3 09:36:26 2016 -0400 Commit: Brad King CommitDate: Thu Nov 3 09:36:26 2016 -0400 Merge branch 'release-3.6' into test-release https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9c507c13a0cffb163a1d56f34c020b5474a3e100 commit 9c507c13a0cffb163a1d56f34c020b5474a3e100 Author: Brad King AuthorDate: Wed Nov 2 11:46:41 2016 -0400 Commit: Brad King CommitDate: Wed Nov 2 11:46:41 2016 -0400 CMake 3.6.3 diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 241cc8d..7d71044 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 6) -set(CMake_VERSION_PATCH 2) +set(CMake_VERSION_PATCH 3) #set(CMake_VERSION_RC 0) ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Thu Nov 3 10:43:25 2016 From: brad.king at kitware.com (Brad King) Date: Thu, 3 Nov 2016 10:43:25 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.7.0-rc2-455-g60d80bc Message-ID: <20161103144325.8E4B2F7B5E@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 60d80bca4afcfb3a38b588a5a2060cc275b4afbc (commit) via 9c507c13a0cffb163a1d56f34c020b5474a3e100 (commit) from dec0cfcef012ca762a731d6e096012fa1c072f14 (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: hooks/post-receive -- CMake From brad.king at kitware.com Thu Nov 3 10:43:25 2016 From: brad.king at kitware.com (Brad King) Date: Thu, 3 Nov 2016 10:43:25 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.7.0-rc2-935-gcec11d1 Message-ID: <20161103144325.DD067F7B5D@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, next has been updated via cec11d1d4731389dda229442da834dddf5bdb56c (commit) via 60d80bca4afcfb3a38b588a5a2060cc275b4afbc (commit) from 0e78a19123015e727c82b06f84859194a7ee7571 (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=cec11d1d4731389dda229442da834dddf5bdb56c commit cec11d1d4731389dda229442da834dddf5bdb56c Merge: 0e78a19 60d80bc Author: Brad King AuthorDate: Thu Nov 3 10:43:05 2016 -0400 Commit: Brad King CommitDate: Thu Nov 3 10:43:05 2016 -0400 Merge branch 'master' into next ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Thu Nov 3 10:43:41 2016 From: brad.king at kitware.com (Brad King) Date: Thu, 3 Nov 2016 10:43:41 -0400 (EDT) Subject: [Cmake-commits] CMake annotated tag, v3.6.3, created. v3.6.3 Message-ID: <20161103144341.CA42CF7C4E@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.6.3 has been created at a2f08cbcf890eddf45e3de50a05b97764d841ae3 (tag) tagging 9c507c13a0cffb163a1d56f34c020b5474a3e100 (commit) replaces v3.6.2 tagged by Brad King on Thu Nov 3 10:39:28 2016 -0400 - Log ----------------------------------------------------------------- CMake 3.6.3 -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdBQJYG0wgFhxicmFkLmtpbmdAa2l0d2FyZS5jb20ACgkQLSzvEDSS FoRwHg//SSOmihE4QSmEGHgswtSapYO024uxYLpV8yYLlx4m8asQNjpQz+dbnSgh 3s64f4/cYQH5KDsqwK7VBfGOJFYFO6D7g8ruZ7AlWYW0wiMPL3QAiy0zsKEp9S0f 0eOXWFlgAADepq+WauseTWCmTe49BCOT6DpwWsSjJIz1QxIfKAOlwbZ7UpNPUBii u2ZT8cWlMonP9LE7bJyTzlMtuN93+yjUBOVTi4B6NZ76rG7p3Nm1Y7WptX2HAz/X FrU9hXtFPWiGf7Chq+f+5/bagbjOrc1lqZxMGouVe1r4t+GJFz5eqCCZXAAfisN2 UacCmsLxadbmFVeJkd23fywKHnUq6k8JRDYN9Lgu99F/smkDeTjbZoHBErrrfjYb 22+chwDsVIGclRZ2l7evuKAn1OFIEIcnT+WjXOGKSxLsTwTEQ1p3QPrbAoFDIM9N FNMfidP0mui7O05iouiqCMsPptRqoHwfP03NsZ7b6VLliC6QQ7EAXyWnCVRlYG9B IN/Ep0Y1U7sNXHhOPnfBy2x0j6Q2vsc6R0nU4jVrWlUkJc0+aFheu0pgWn1X9IAp R89EDMP9tdMoaXbWpaFyZ4jPkBU5mHPIPn/4uo73FB4+/uQvrCnOkwzUST/ks7BK +LzzsE4sVmzRnB/gUu4h88et4dqq3JdUDRW2nhMsSsIzpb8vtmQ= =dp8r -----END PGP SIGNATURE----- Brad King (4): FindHDF5: Restore pre-3.6 behavior of finding only C by default Merge branch 'qtdialog-lib-paths' into release-3.6 Merge branch 'FindHDF5-restore-default-C' into release-3.6 CMake 3.6.3 Clinton Stimpson (1): cmake-gui: Do not remove library paths for Qt5 plugins. ----------------------------------------------------------------------- hooks/post-receive -- CMake From kwrobot at kitware.com Fri Nov 4 00:01:16 2016 From: kwrobot at kitware.com (Kitware Robot) Date: Fri, 4 Nov 2016 00:01:16 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.7.0-rc2-456-gd6ef59f Message-ID: <20161104040118.9FEDEF847E@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 d6ef59f5a39f9748f44abdba80f596c16b6984a3 (commit) from 60d80bca4afcfb3a38b588a5a2060cc275b4afbc (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=d6ef59f5a39f9748f44abdba80f596c16b6984a3 commit d6ef59f5a39f9748f44abdba80f596c16b6984a3 Author: Kitware Robot AuthorDate: Fri Nov 4 00:01:11 2016 -0400 Commit: Kitware Robot CommitDate: Fri Nov 4 00:01:11 2016 -0400 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 141d2a9..b3cff47 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 7) -set(CMake_VERSION_PATCH 20161103) +set(CMake_VERSION_PATCH 20161104) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Fri Nov 4 08:26:07 2016 From: brad.king at kitware.com (Brad King) Date: Fri, 4 Nov 2016 08:26:07 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.7.0-rc2-458-g28a9e71 Message-ID: <20161104122607.E6756F8A45@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 28a9e71c527dd4d9159af2a1e83bdd4ff0925cdc (commit) via 20cc76c93a7f7ba1dd8a38e8311c0e9702395b27 (commit) from d6ef59f5a39f9748f44abdba80f596c16b6984a3 (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=28a9e71c527dd4d9159af2a1e83bdd4ff0925cdc commit 28a9e71c527dd4d9159af2a1e83bdd4ff0925cdc Merge: d6ef59f 20cc76c Author: Brad King AuthorDate: Fri Nov 4 08:26:05 2016 -0400 Commit: CMake Topic Stage CommitDate: Fri Nov 4 08:26:05 2016 -0400 Merge topic 'cpackifw-search-algorithm' 20cc76c9 CPackIFW: Update search to find QtIFW distributed with QtSDK ----------------------------------------------------------------------- Summary of changes: Modules/CPackIFW.cmake | 68 +++++++++++++++++++++++++++++++++--------------- 1 file changed, 47 insertions(+), 21 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Fri Nov 4 08:26:11 2016 From: brad.king at kitware.com (Brad King) Date: Fri, 4 Nov 2016 08:26:11 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.7.0-rc2-460-g926a22b Message-ID: <20161104122611.83A4DF8A47@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 926a22b8b8131347a61681252f9b27644607cb89 (commit) via 4cb5d3353f488ee7bf3943619e67a5664dbae8df (commit) from 28a9e71c527dd4d9159af2a1e83bdd4ff0925cdc (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=926a22b8b8131347a61681252f9b27644607cb89 commit 926a22b8b8131347a61681252f9b27644607cb89 Merge: 28a9e71 4cb5d33 Author: Brad King AuthorDate: Fri Nov 4 08:26:09 2016 -0400 Commit: CMake Topic Stage CommitDate: Fri Nov 4 08:26:09 2016 -0400 Merge topic 'vs-flag-order' 4cb5d335 VS: Place source-specific AdditionalOptions after target-wide flags ----------------------------------------------------------------------- Summary of changes: Help/release/dev/vs-flag-order.rst | 9 +++++++++ Source/cmVisualStudioGeneratorOptions.cxx | 5 +++-- 2 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 Help/release/dev/vs-flag-order.rst hooks/post-receive -- CMake From brad.king at kitware.com Fri Nov 4 08:26:54 2016 From: brad.king at kitware.com (Brad King) Date: Fri, 4 Nov 2016 08:26:54 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.7.0-rc2-939-g8ce68d9 Message-ID: <20161104122654.6A3C8F8A6B@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, next has been updated via 8ce68d9ca0d35c45af6a349facd589b3e68f70ed (commit) via 926a22b8b8131347a61681252f9b27644607cb89 (commit) via 28a9e71c527dd4d9159af2a1e83bdd4ff0925cdc (commit) via d6ef59f5a39f9748f44abdba80f596c16b6984a3 (commit) from cec11d1d4731389dda229442da834dddf5bdb56c (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=8ce68d9ca0d35c45af6a349facd589b3e68f70ed commit 8ce68d9ca0d35c45af6a349facd589b3e68f70ed Merge: cec11d1 926a22b Author: Brad King AuthorDate: Fri Nov 4 08:26:20 2016 -0400 Commit: Brad King CommitDate: Fri Nov 4 08:26:20 2016 -0400 Merge branch 'master' into next ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Fri Nov 4 08:28:13 2016 From: brad.king at kitware.com (Brad King) Date: Fri, 4 Nov 2016 08:28:13 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.7.0-rc2-462-g7c0e67e Message-ID: <20161104122813.A5723F8AA9@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 7c0e67ee220a5fb7806cb5ef4c80df31f3e34a13 (commit) via 8b75290f13399ba1b32458c5f0090e69efe1eb8c (commit) from 926a22b8b8131347a61681252f9b27644607cb89 (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: hooks/post-receive -- CMake From brad.king at kitware.com Fri Nov 4 08:28:13 2016 From: brad.king at kitware.com (Brad King) Date: Fri, 4 Nov 2016 08:28:13 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.7.0-rc2-942-g044d08a Message-ID: <20161104122813.C8D9FF8AAA@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, next has been updated via 044d08aa2544ddc072071de5004ffabdef6f771d (commit) via 7c0e67ee220a5fb7806cb5ef4c80df31f3e34a13 (commit) via 8b75290f13399ba1b32458c5f0090e69efe1eb8c (commit) from 8ce68d9ca0d35c45af6a349facd589b3e68f70ed (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=044d08aa2544ddc072071de5004ffabdef6f771d commit 044d08aa2544ddc072071de5004ffabdef6f771d Merge: 8ce68d9 7c0e67e Author: Brad King AuthorDate: Fri Nov 4 08:28:03 2016 -0400 Commit: Brad King CommitDate: Fri Nov 4 08:28:03 2016 -0400 Merge branch 'master' into next ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Fri Nov 4 08:28:13 2016 From: brad.king at kitware.com (Brad King) Date: Fri, 4 Nov 2016 08:28:13 -0400 (EDT) Subject: [Cmake-commits] CMake branch, release, updated. v3.7.0-rc2-38-g8b75290 Message-ID: <20161104122813.E299AF8AAC@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 8b75290f13399ba1b32458c5f0090e69efe1eb8c (commit) via 20cc76c93a7f7ba1dd8a38e8311c0e9702395b27 (commit) from 5f7f0ab517d9f4fbc11292a1bada37a74ba69b97 (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/CPackIFW.cmake | 68 +++++++++++++++++++++++++++++++++--------------- 1 file changed, 47 insertions(+), 21 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Fri Nov 4 08:31:20 2016 From: brad.king at kitware.com (Brad King) Date: Fri, 4 Nov 2016 08:31:20 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.7.0-rc2-945-g471d00b Message-ID: <20161104123120.4419DF8AF6@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, next has been updated via 471d00b9b946082724d2d7b1b8ed29d54275adb2 (commit) via 13750d275c73e83b2e6a0535127305a51fc478ea (commit) via adf5f253ec029aec4ee7aadb95c6f908030fb98b (commit) from 044d08aa2544ddc072071de5004ffabdef6f771d (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=471d00b9b946082724d2d7b1b8ed29d54275adb2 commit 471d00b9b946082724d2d7b1b8ed29d54275adb2 Merge: 044d08a 13750d2 Author: Brad King AuthorDate: Fri Nov 4 08:31:19 2016 -0400 Commit: CMake Topic Stage CommitDate: Fri Nov 4 08:31:19 2016 -0400 Merge topic 'test-release' into next 13750d27 Merge branch 'release' into test-release adf5f253 CMake 3.7.0-rc3 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=13750d275c73e83b2e6a0535127305a51fc478ea commit 13750d275c73e83b2e6a0535127305a51fc478ea Merge: 7c0e67e adf5f25 Author: Brad King AuthorDate: Fri Nov 4 08:30:54 2016 -0400 Commit: Brad King CommitDate: Fri Nov 4 08:30:54 2016 -0400 Merge branch 'release' into test-release https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=adf5f253ec029aec4ee7aadb95c6f908030fb98b commit adf5f253ec029aec4ee7aadb95c6f908030fb98b Author: Brad King AuthorDate: Fri Nov 4 08:30:22 2016 -0400 Commit: Brad King CommitDate: Fri Nov 4 08:30:22 2016 -0400 CMake 3.7.0-rc3 diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index d8c77fc..eecbe92 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -2,4 +2,4 @@ set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 7) set(CMake_VERSION_PATCH 0) -set(CMake_VERSION_RC 2) +set(CMake_VERSION_RC 3) ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Fri Nov 4 08:55:42 2016 From: brad.king at kitware.com (Brad King) Date: Fri, 4 Nov 2016 08:55:42 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.7.0-rc2-960-g16df580 Message-ID: <20161104125542.55C01F8110@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, next has been updated via 16df58045f9cc1b553fe1607177f91e23fb45b43 (commit) via 906934fae85a07ae489a636d2681082a2face69f (commit) via 33e25b1dedcda14fbcccd14281edb412a0c14cac (commit) via c4cd1d2f5b8ab579c620ff7eb24ceab2b7830644 (commit) via dfff0d5c4af796e2e5869bc2bb65d7d23cfbdd78 (commit) via 032312e95d5f799d77789faa57c657b6be409f6a (commit) via 72b9bf5cf8e2df6fb5290afb7c2825ec54c59640 (commit) via 56481623c6e615b2c90482dd8b6f880cd571561c (commit) via 956d93a5f04bebe404b228771c87059fa1efe261 (commit) via 5aebc4aa1bab731194948721301a3ed69daeaa1f (commit) via 77a96b0cb74c0d040be232370356fea0a1257578 (commit) via b5ae698e7aea15321ee94436cdbec9747e422209 (commit) via 5cb1b345d932d3e0dc34a2d423894a59a6c8db35 (commit) via 1367fccc330b0ff314845aeb3547bbc38486913a (commit) via 798b0adc628ab16dbb4d04ef444b8e7db4f5cffa (commit) from 471d00b9b946082724d2d7b1b8ed29d54275adb2 (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=16df58045f9cc1b553fe1607177f91e23fb45b43 commit 16df58045f9cc1b553fe1607177f91e23fb45b43 Merge: 471d00b 906934f Author: Brad King AuthorDate: Fri Nov 4 08:55:40 2016 -0400 Commit: CMake Topic Stage CommitDate: Fri Nov 4 08:55:40 2016 -0400 Merge topic 'import-librhash' into next 906934fa Add option to build CMake against a system librhash 33e25b1d FindLibRHash: Add module to find the librhash package c4cd1d2f Remove unused cm_sha2 infrastructure dfff0d5c Port hash computation to cmCryptoHash 032312e9 cmCryptoHash: Re-implement in terms of librhash 72b9bf5c cmCryptoHash: Avoid using subclasses at client sites 56481623 librhash: Port to KWIML for ABI and integer type information 956d93a5 librhash: Install COPYING file with CMake documentation 5aebc4aa librhash: Disable warnings to avoid changing 3rd party code 77a96b0c librhash: Build the library within CMake b5ae698e librhash: Remove source fragments not needed for CMake 5cb1b345 Merge branch 'upstream-librhash' into import-librhash 1367fccc librhash 2016-11-01 (d839a1a8) 798b0adc Add script to update librhash from upstream https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=906934fae85a07ae489a636d2681082a2face69f commit 906934fae85a07ae489a636d2681082a2face69f Author: Brad King AuthorDate: Thu Nov 3 13:31:33 2016 -0400 Commit: Brad King CommitDate: Thu Nov 3 14:07:49 2016 -0400 Add option to build CMake against a system librhash Create a CMAKE_USE_SYSTEM_LIBRHASH option. diff --git a/CMakeLists.txt b/CMakeLists.txt index 82a34d3..7aa8010 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -104,7 +104,7 @@ macro(CMAKE_HANDLE_SYSTEM_LIBRARIES) # Allow the user to enable/disable all system utility library options by # defining CMAKE_USE_SYSTEM_LIBRARIES or CMAKE_USE_SYSTEM_LIBRARY_${util}. - set(UTILITIES BZIP2 CURL EXPAT FORM JSONCPP LIBARCHIVE LIBLZMA LIBUV ZLIB) + set(UTILITIES BZIP2 CURL EXPAT FORM JSONCPP LIBARCHIVE LIBLZMA LIBRHASH LIBUV ZLIB) foreach(util ${UTILITIES}) if(NOT DEFINED CMAKE_USE_SYSTEM_LIBRARY_${util} AND DEFINED CMAKE_USE_SYSTEM_LIBRARIES) @@ -144,6 +144,7 @@ macro(CMAKE_HANDLE_SYSTEM_LIBRARIES) "${CMAKE_USE_SYSTEM_LIBRARY_LIBLZMA}" "NOT CMAKE_USE_SYSTEM_LIBARCHIVE" ON) option(CMAKE_USE_SYSTEM_FORM "Use system-installed libform" "${CMAKE_USE_SYSTEM_LIBRARY_FORM}") option(CMAKE_USE_SYSTEM_JSONCPP "Use system-installed jsoncpp" "${CMAKE_USE_SYSTEM_LIBRARY_JSONCPP}") + option(CMAKE_USE_SYSTEM_LIBRHASH "Use system-installed librhash" "${CMAKE_USE_SYSTEM_LIBRARY_LIBRHASH}") option(CMAKE_USE_SYSTEM_LIBUV "Use system-installed libuv" "${CMAKE_USE_SYSTEM_LIBRARY_LIBUV}") # For now use system KWIML only if explicitly requested rather @@ -298,9 +299,22 @@ macro (CMAKE_BUILD_UTILITIES) add_subdirectory(Utilities/KWIML) endif() - set(CMAKE_LIBRHASH_LIBRARIES cmlibrhash) - add_subdirectory(Utilities/cmlibrhash) - CMAKE_SET_TARGET_FOLDER(cmlibrhash "Utilities/3rdParty") + if(CMAKE_USE_SYSTEM_LIBRHASH) + if(NOT CMAKE_VERSION VERSION_LESS 3.0) + find_package(LibRHash) + else() + message(FATAL_ERROR "CMAKE_USE_SYSTEM_LIBRHASH requires CMake >= 3.0") + endif() + if(NOT LibRHash_FOUND) + message(FATAL_ERROR + "CMAKE_USE_SYSTEM_LIBRHASH is ON but LibRHash is not found!") + endif() + set(CMAKE_LIBRHASH_LIBRARIES LibRHash::LibRHash) + else() + set(CMAKE_LIBRHASH_LIBRARIES cmlibrhash) + add_subdirectory(Utilities/cmlibrhash) + CMAKE_SET_TARGET_FOLDER(cmlibrhash "Utilities/3rdParty") + endif() #--------------------------------------------------------------------- # Build zlib library for Curl, CMake, and CTest. diff --git a/Utilities/cmThirdParty.h.in b/Utilities/cmThirdParty.h.in index 210e727..a547f0d 100644 --- a/Utilities/cmThirdParty.h.in +++ b/Utilities/cmThirdParty.h.in @@ -13,6 +13,7 @@ #cmakedefine CMAKE_USE_SYSTEM_LIBLZMA #cmakedefine CMAKE_USE_SYSTEM_FORM #cmakedefine CMAKE_USE_SYSTEM_JSONCPP +#cmakedefine CMAKE_USE_SYSTEM_LIBRHASH #cmakedefine CMAKE_USE_SYSTEM_LIBUV #cmakedefine CTEST_USE_XMLRPC diff --git a/Utilities/cm_rhash.h b/Utilities/cm_rhash.h index 23d5409..c793627 100644 --- a/Utilities/cm_rhash.h +++ b/Utilities/cm_rhash.h @@ -3,6 +3,12 @@ #ifndef cm_rhash_h #define cm_rhash_h +/* Use the LibRHash library configured for CMake. */ +#include "cmThirdParty.h" +#ifdef CMAKE_USE_SYSTEM_LIBRHASH +#include +#else #include +#endif #endif diff --git a/bootstrap b/bootstrap index 4ce0dee..d54380a 100755 --- a/bootstrap +++ b/bootstrap @@ -493,6 +493,8 @@ Configuration: --no-system-liblzma use cmake-provided liblzma library (default) --system-libarchive use system-installed libarchive library --no-system-libarchive use cmake-provided libarchive library (default) + --system-librhash use system-installed librhash library + --no-system-librhash use cmake-provided librhash library (default) --qt-gui build the Qt-based GUI (requires Qt >= 4.2) --no-qt-gui do not build the Qt-based GUI (default) @@ -726,10 +728,10 @@ while test $# != 0; do --init=*) cmake_init_file=`cmake_arg "$1"` ;; --system-libs) cmake_bootstrap_system_libs="${cmake_bootstrap_system_libs} -DCMAKE_USE_SYSTEM_LIBRARIES=1" ;; --no-system-libs) cmake_bootstrap_system_libs="${cmake_bootstrap_system_libs} -DCMAKE_USE_SYSTEM_LIBRARIES=0" ;; - --system-bzip2|--system-curl|--system-expat|--system-jsoncpp|--system-libarchive|--system-zlib|--system-liblzma) + --system-bzip2|--system-curl|--system-expat|--system-jsoncpp|--system-libarchive|--system-librhash|--system-zlib|--system-liblzma) lib=`cmake_arg "$1" "--system-"` cmake_bootstrap_system_libs="${cmake_bootstrap_system_libs} -DCMAKE_USE_SYSTEM_LIBRARY_`cmake_toupper $lib`=1" ;; - --no-system-bzip2|--no-system-curl|--no-system-expat|--no-system-jsoncpp|--no-system-libarchive|--no-system-zlib|--no-system-liblzma) + --no-system-bzip2|--no-system-curl|--no-system-expat|--no-system-jsoncpp|--no-system-libarchive|--no-system-librhash|--no-system-zlib|--no-system-liblzma) lib=`cmake_arg "$1" "--no-system-"` cmake_bootstrap_system_libs="${cmake_bootstrap_system_libs} -DCMAKE_USE_SYSTEM_LIBRARY_`cmake_toupper $lib`=0" ;; --qt-gui) cmake_bootstrap_qt_gui="1" ;; https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=33e25b1dedcda14fbcccd14281edb412a0c14cac commit 33e25b1dedcda14fbcccd14281edb412a0c14cac Author: Brad King AuthorDate: Thu Nov 3 13:29:31 2016 -0400 Commit: Brad King CommitDate: Thu Nov 3 14:07:49 2016 -0400 FindLibRHash: Add module to find the librhash package Add it to a private source directory that is not installed so that we can use it for building CMake itself. This will allow it to mature before being distributed publicly. diff --git a/Source/Modules/FindLibRHash.cmake b/Source/Modules/FindLibRHash.cmake new file mode 100644 index 0000000..86c6189 --- /dev/null +++ b/Source/Modules/FindLibRHash.cmake @@ -0,0 +1,73 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +#[=======================================================================[.rst: +FindLibRHash +------------ + +Find LibRHash include directory and library. + +Imported Targets +^^^^^^^^^^^^^^^^ + +An :ref:`imported target ` named +``LibRHash::LibRHash`` is provided if LibRHash has been found. + +Result Variables +^^^^^^^^^^^^^^^^ + +This module defines the following variables: + +``LibRHash_FOUND`` + True if LibRHash was found, false otherwise. +``LibRHash_INCLUDE_DIRS`` + Include directories needed to include LibRHash headers. +``LibRHash_LIBRARIES`` + Libraries needed to link to LibRHash. + +Cache Variables +^^^^^^^^^^^^^^^ + +This module uses the following cache variables: + +``LibRHash_LIBRARY`` + The location of the LibRHash library file. +``LibRHash_INCLUDE_DIR`` + The location of the LibRHash include directory containing ``rhash.h``. + +The cache variables should not be used by project code. +They may be set by end users to point at LibRHash components. +#]=======================================================================] + +#----------------------------------------------------------------------------- +find_library(LibRHash_LIBRARY + NAMES rhash + ) +mark_as_advanced(LibRHash_LIBRARY) + +find_path(LibRHash_INCLUDE_DIR + NAMES rhash.h + ) +mark_as_advanced(LibRHash_INCLUDE_DIR) + +#----------------------------------------------------------------------------- +include(${CMAKE_CURRENT_LIST_DIR}/../../Modules/FindPackageHandleStandardArgs.cmake) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibRHash + FOUND_VAR LibRHash_FOUND + REQUIRED_VARS LibRHash_LIBRARY LibRHash_INCLUDE_DIR + ) +set(LIBRHASH_FOUND ${LibRHash_FOUND}) + +#----------------------------------------------------------------------------- +# Provide documented result variables and targets. +if(LibRHash_FOUND) + set(LibRHash_INCLUDE_DIRS ${LibRHash_INCLUDE_DIR}) + set(LibRHash_LIBRARIES ${LibRHash_LIBRARY}) + if(NOT TARGET LibRHash::LibRHash) + add_library(LibRHash::LibRHash UNKNOWN IMPORTED) + set_target_properties(LibRHash::LibRHash PROPERTIES + IMPORTED_LOCATION "${LibRHash_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${LibRHash_INCLUDE_DIRS}" + ) + endif() +endif() diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 5d72e5c..3a3c76c 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -1377,6 +1377,10 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release add_subdirectory(FindJsonCpp) endif() + if(CMake_TEST_FindLibRHash) + add_subdirectory(FindLibRHash) + endif() + if(CMake_TEST_FindLibUV) add_subdirectory(FindLibUV) endif() diff --git a/Tests/FindLibRHash/CMakeLists.txt b/Tests/FindLibRHash/CMakeLists.txt new file mode 100644 index 0000000..4d3954d --- /dev/null +++ b/Tests/FindLibRHash/CMakeLists.txt @@ -0,0 +1,10 @@ +add_test(NAME FindLibRHash.Test COMMAND + ${CMAKE_CTEST_COMMAND} -C $ + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindLibRHash/Test" + "${CMake_BINARY_DIR}/Tests/FindLibRHash/Test" + ${build_generator_args} + --build-project TestFindLibRHash + --build-options ${build_options} + --test-command ${CMAKE_CTEST_COMMAND} -V -C $ + ) diff --git a/Tests/FindLibRHash/Test/CMakeLists.txt b/Tests/FindLibRHash/Test/CMakeLists.txt new file mode 100644 index 0000000..37e062a --- /dev/null +++ b/Tests/FindLibRHash/Test/CMakeLists.txt @@ -0,0 +1,17 @@ +cmake_minimum_required(VERSION 3.7) +project(TestFindLibRHash C) +include(CTest) + +# CMake does not actually provide FindLibRHash publicly. +set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../../Source/Modules) + +find_package(LibRHash REQUIRED) + +add_executable(test_librhash_tgt main.c) +target_link_libraries(test_librhash_tgt LibRHash::LibRHash) +add_test(NAME test_librhash_tgt COMMAND test_librhash_tgt) + +add_executable(test_librhash_var main.c) +target_include_directories(test_librhash_var PRIVATE ${LibRHash_INCLUDE_DIRS}) +target_link_libraries(test_librhash_var PRIVATE ${LibRHash_LIBRARIES}) +add_test(NAME test_librhash_var COMMAND test_librhash_var) diff --git a/Tests/FindLibRHash/Test/main.c b/Tests/FindLibRHash/Test/main.c new file mode 100644 index 0000000..201dced --- /dev/null +++ b/Tests/FindLibRHash/Test/main.c @@ -0,0 +1,7 @@ +#include + +int main() +{ + rhash_library_init(); + return 0; +} https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c4cd1d2f5b8ab579c620ff7eb24ceab2b7830644 commit c4cd1d2f5b8ab579c620ff7eb24ceab2b7830644 Author: Brad King AuthorDate: Thu Nov 3 13:28:03 2016 -0400 Commit: Brad King CommitDate: Thu Nov 3 14:07:49 2016 -0400 Remove unused cm_sha2 infrastructure All clients of `cm_sha2` have been ported to `cmCryptoHash`, which now uses librhash internally. diff --git a/CTestCustom.cmake.in b/CTestCustom.cmake.in index 48dd3de..07a9fdb 100644 --- a/CTestCustom.cmake.in +++ b/CTestCustom.cmake.in @@ -17,7 +17,6 @@ list(APPEND CTEST_CUSTOM_WARNING_EXCEPTION "Utilities.cmbzip2." "Source.CTest.Curl" "Source.CursesDialog.form" - "Source.cm_sha2.*warning.*cast increases required alignment of target type" "Utilities.cmcurl" "Utilities.cmexpat." "Utilities.cmlibarchive" @@ -84,7 +83,6 @@ list(APPEND CTEST_CUSTOM_WARNING_EXCEPTION "warning: Value stored to 'yytoken' is never read" "index_encoder.c.241.2. warning: Value stored to .out_start. is never read" "index.c.*warning: Access to field.*results in a dereference of a null pointer.*loaded from variable.*" - "cm_sha2.*warning: Value stored to.*is never read" "cmFortranLexer.cxx:[0-9]+:[0-9]+: warning: Call to 'realloc' has an allocation size of 0 bytes" "testProcess.*warning: Dereference of null pointer .loaded from variable .invalidAddress.." "liblzma/simple/x86.c:[0-9]+:[0-9]+: warning: The result of the '<<' expression is undefined" diff --git a/Source/.gitattributes b/Source/.gitattributes index 5002b2a..e9e35bd 100644 --- a/Source/.gitattributes +++ b/Source/.gitattributes @@ -1,6 +1,3 @@ -# Preserve upstream indentation style. -cm_sha2.* whitespace=indent-with-non-tab - # Preserve indentation style in generated code. cmListFileLexer.c whitespace=-tab-in-indent,-indent-with-non-tab cmFortranLexer.cxx whitespace=-tab-in-indent,-indent-with-non-tab diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 879272c..718b022 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -626,8 +626,6 @@ set(SRCS cm_auto_ptr.hxx cm_get_date.h cm_get_date.c - cm_sha2.h - cm_sha2.c cm_utf8.h cm_utf8.c cm_codecvt.hxx diff --git a/Source/cm_sha2.c b/Source/cm_sha2.c deleted file mode 100644 index 649c39a..0000000 --- a/Source/cm_sha2.c +++ /dev/null @@ -1,1613 +0,0 @@ -/* - * FILE: sha2.c - * AUTHOR: Aaron D. Gifford - * http://www.aarongifford.com/computers/sha.html - * - * Copyright (c) 2000-2003, Aaron D. Gifford - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holder nor the names of contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTOR(S) ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTOR(S) BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $Id: sha2.c,v 1.4 2004/01/07 22:58:18 adg Exp $ - */ - -#include /* memcpy()/memset() or bcopy()/bzero() */ -#include /* assert() */ -#include "cm_sha2.h" /* "sha2.h" -> "cm_sha2.h" renamed for CMake */ - -/* - * ASSERT NOTE: - * Some sanity checking code is included using assert(). On my FreeBSD - * system, this additional code can be removed by compiling with NDEBUG - * defined. Check your own systems manpage on assert() to see how to - * compile WITHOUT the sanity checking code on your system. - * - * UNROLLED TRANSFORM LOOP NOTE: - * You can define SHA2_UNROLL_TRANSFORM to use the unrolled transform - * loop version for the hash transform rounds (defined using macros - * later in this file). Either define on the command line, for example: - * - * cc -DSHA2_UNROLL_TRANSFORM -o sha2 sha2.c sha2prog.c - * - * or define below: - * - * #define SHA2_UNROLL_TRANSFORM - * - */ - - -/*** SHA-224/256/384/512 Machine Architecture Definitions *************/ -/* - * BYTE_ORDER NOTE: - * - * Please make sure that your system defines BYTE_ORDER. If your - * architecture is little-endian, make sure it also defines - * LITTLE_ENDIAN and that the two (BYTE_ORDER and LITTLE_ENDIAN) are - * equivilent. - * - * If your system does not define the above, then you can do so by - * hand like this: - * - * #define LITTLE_ENDIAN 1234 - * #define BIG_ENDIAN 4321 - * - * And for little-endian machines, add: - * - * #define BYTE_ORDER LITTLE_ENDIAN - * - * Or for big-endian machines: - * - * #define BYTE_ORDER BIG_ENDIAN - * - * The FreeBSD machine this was written on defines BYTE_ORDER - * appropriately by including (which in turn includes - * where the appropriate definitions are actually - * made). - */ -#if !defined(BYTE_ORDER) || (BYTE_ORDER != LITTLE_ENDIAN && BYTE_ORDER != BIG_ENDIAN) -/* CMake modification: use byte order from KWIML. */ -# undef BYTE_ORDER -# undef BIG_ENDIAN -# undef LITTLE_ENDIAN -# define BYTE_ORDER KWIML_ABI_ENDIAN_ID -# define BIG_ENDIAN KWIML_ABI_ENDIAN_ID_BIG -# define LITTLE_ENDIAN KWIML_ABI_ENDIAN_ID_LITTLE -#endif - -/* CMake modification: use types computed in header. */ -typedef cm_sha2_uint8_t sha_byte; /* Exactly 1 byte */ -typedef cm_sha2_uint32_t sha_word32; /* Exactly 4 bytes */ -typedef cm_sha2_uint64_t sha_word64; /* Exactly 8 bytes */ -#define SHA_UINT32_C(x) KWIML_INT_UINT32_C(x) -#define SHA_UINT64_C(x) KWIML_INT_UINT64_C(x) -#if defined(__clang__) -# pragma clang diagnostic ignored "-Wcast-align" -#endif - -/*** ENDIAN REVERSAL MACROS *******************************************/ -#if BYTE_ORDER == LITTLE_ENDIAN -#define REVERSE32(w,x) { \ - sha_word32 tmp = (w); \ - tmp = (tmp >> 16) | (tmp << 16); \ - (x) = ((tmp & SHA_UINT32_C(0xff00ff00)) >> 8) | \ - ((tmp & SHA_UINT32_C(0x00ff00ff)) << 8); \ -} -#define REVERSE64(w,x) { \ - sha_word64 tmp = (w); \ - tmp = (tmp >> 32) | (tmp << 32); \ - tmp = ((tmp & SHA_UINT64_C(0xff00ff00ff00ff00)) >> 8) | \ - ((tmp & SHA_UINT64_C(0x00ff00ff00ff00ff)) << 8); \ - (x) = ((tmp & SHA_UINT64_C(0xffff0000ffff0000)) >> 16) | \ - ((tmp & SHA_UINT64_C(0x0000ffff0000ffff)) << 16); \ -} -#endif /* BYTE_ORDER == LITTLE_ENDIAN */ - -/* - * Macro for incrementally adding the unsigned 64-bit integer n to the - * unsigned 128-bit integer (represented using a two-element array of - * 64-bit words): - */ -#define ADDINC128(w,n) { \ - (w)[0] += (sha_word64)(n); \ - if ((w)[0] < (n)) { \ - (w)[1]++; \ - } \ -} - -/* - * Macros for copying blocks of memory and for zeroing out ranges - * of memory. Using these macros makes it easy to switch from - * using memset()/memcpy() and using bzero()/bcopy(). - * - * Please define either SHA2_USE_MEMSET_MEMCPY or define - * SHA2_USE_BZERO_BCOPY depending on which function set you - * choose to use: - */ -#if !defined(SHA2_USE_MEMSET_MEMCPY) && !defined(SHA2_USE_BZERO_BCOPY) -/* Default to memset()/memcpy() if no option is specified */ -#define SHA2_USE_MEMSET_MEMCPY 1 -#endif -#if defined(SHA2_USE_MEMSET_MEMCPY) && defined(SHA2_USE_BZERO_BCOPY) -/* Abort with an error if BOTH options are defined */ -#error Define either SHA2_USE_MEMSET_MEMCPY or SHA2_USE_BZERO_BCOPY, not both! -#endif - -#ifdef SHA2_USE_MEMSET_MEMCPY -#define MEMSET_BZERO(p,l) memset((p), 0, (l)) -#define MEMCPY_BCOPY(d,s,l) memcpy((d), (s), (l)) -#endif -#ifdef SHA2_USE_BZERO_BCOPY -#define MEMSET_BZERO(p,l) bzero((p), (l)) -#define MEMCPY_BCOPY(d,s,l) bcopy((s), (d), (l)) -#endif - - -/*** THE SIX LOGICAL FUNCTIONS ****************************************/ -/* - * Bit shifting and rotation (used by the six SHA-XYZ logical functions: - * - * NOTE: In the original SHA-256/384/512 document, the shift-right - * function was named R and the rotate-right function was called S. - * (See: http://csrc.nist.gov/cryptval/shs/sha256-384-512.pdf on the - * web.) - * - * The newer NIST FIPS 180-2 document uses a much clearer naming - * scheme, SHR for shift-right, ROTR for rotate-right, and ROTL for - * rotate-left. (See: - * http://csrc.nist.gov/publications/fips/fips180-2/fips180-2.pdf - * on the web.) - * - * WARNING: These macros must be used cautiously, since they reference - * supplied parameters sometimes more than once, and thus could have - * unexpected side-effects if used without taking this into account. - */ -/* Shift-right (used in SHA-256, SHA-384, and SHA-512): */ -#define SHR(b,x) ((x) >> (b)) -/* 32-bit Rotate-right (used in SHA-256): */ -#define ROTR32(b,x) (((x) >> (b)) | ((x) << (32 - (b)))) -/* 64-bit Rotate-right (used in SHA-384 and SHA-512): */ -#define ROTR64(b,x) (((x) >> (b)) | ((x) << (64 - (b)))) -/* 32-bit Rotate-left (used in SHA-1): */ -#define ROTL32(b,x) (((x) << (b)) | ((x) >> (32 - (b)))) - -/* Two logical functions used in SHA-1, SHA-254, SHA-256, SHA-384, and SHA-512: */ -#define Ch(x,y,z) (((x) & (y)) ^ ((~(x)) & (z))) -#define Maj(x,y,z) (((x) & (y)) ^ ((x) & (z)) ^ ((y) & (z))) - -/* Function used in SHA-1: */ -#define Parity(x,y,z) ((x) ^ (y) ^ (z)) - -/* Four logical functions used in SHA-256: */ -#define Sigma0_256(x) (ROTR32(2, (x)) ^ ROTR32(13, (x)) ^ ROTR32(22, (x))) -#define Sigma1_256(x) (ROTR32(6, (x)) ^ ROTR32(11, (x)) ^ ROTR32(25, (x))) -#define sigma0_256(x) (ROTR32(7, (x)) ^ ROTR32(18, (x)) ^ SHR( 3 , (x))) -#define sigma1_256(x) (ROTR32(17, (x)) ^ ROTR32(19, (x)) ^ SHR( 10, (x))) - -/* Four of six logical functions used in SHA-384 and SHA-512: */ -#define Sigma0_512(x) (ROTR64(28, (x)) ^ ROTR64(34, (x)) ^ ROTR64(39, (x))) -#define Sigma1_512(x) (ROTR64(14, (x)) ^ ROTR64(18, (x)) ^ ROTR64(41, (x))) -#define sigma0_512(x) (ROTR64( 1, (x)) ^ ROTR64( 8, (x)) ^ SHR( 7, (x))) -#define sigma1_512(x) (ROTR64(19, (x)) ^ ROTR64(61, (x)) ^ SHR( 6, (x))) - -/*** INTERNAL FUNCTION PROTOTYPES *************************************/ - -/* SHA-224 and SHA-256: */ -void SHA256_Internal_Init(SHA_CTX*, const sha_word32*); -void SHA256_Internal_Last(SHA_CTX*); -void SHA256_Internal_Transform(SHA_CTX*, const sha_word32*); - -/* SHA-384 and SHA-512: */ -void SHA512_Internal_Init(SHA_CTX*, const sha_word64*); -void SHA512_Internal_Last(SHA_CTX*); -void SHA512_Internal_Transform(SHA_CTX*, const sha_word64*); - - -/*** SHA2 INITIAL HASH VALUES AND CONSTANTS ***************************/ - -/* Hash constant words K for SHA-1: */ -#define K1_0_TO_19 SHA_UINT32_C(0x5a827999) -#define K1_20_TO_39 SHA_UINT32_C(0x6ed9eba1) -#define K1_40_TO_59 SHA_UINT32_C(0x8f1bbcdc) -#define K1_60_TO_79 SHA_UINT32_C(0xca62c1d6) - -/* Initial hash value H for SHA-1: */ -static const sha_word32 sha1_initial_hash_value[5] = { - SHA_UINT32_C(0x67452301), - SHA_UINT32_C(0xefcdab89), - SHA_UINT32_C(0x98badcfe), - SHA_UINT32_C(0x10325476), - SHA_UINT32_C(0xc3d2e1f0) -}; - -/* Hash constant words K for SHA-224 and SHA-256: */ -static const sha_word32 K256[64] = { - SHA_UINT32_C(0x428a2f98), SHA_UINT32_C(0x71374491), - SHA_UINT32_C(0xb5c0fbcf), SHA_UINT32_C(0xe9b5dba5), - SHA_UINT32_C(0x3956c25b), SHA_UINT32_C(0x59f111f1), - SHA_UINT32_C(0x923f82a4), SHA_UINT32_C(0xab1c5ed5), - SHA_UINT32_C(0xd807aa98), SHA_UINT32_C(0x12835b01), - SHA_UINT32_C(0x243185be), SHA_UINT32_C(0x550c7dc3), - SHA_UINT32_C(0x72be5d74), SHA_UINT32_C(0x80deb1fe), - SHA_UINT32_C(0x9bdc06a7), SHA_UINT32_C(0xc19bf174), - SHA_UINT32_C(0xe49b69c1), SHA_UINT32_C(0xefbe4786), - SHA_UINT32_C(0x0fc19dc6), SHA_UINT32_C(0x240ca1cc), - SHA_UINT32_C(0x2de92c6f), SHA_UINT32_C(0x4a7484aa), - SHA_UINT32_C(0x5cb0a9dc), SHA_UINT32_C(0x76f988da), - SHA_UINT32_C(0x983e5152), SHA_UINT32_C(0xa831c66d), - SHA_UINT32_C(0xb00327c8), SHA_UINT32_C(0xbf597fc7), - SHA_UINT32_C(0xc6e00bf3), SHA_UINT32_C(0xd5a79147), - SHA_UINT32_C(0x06ca6351), SHA_UINT32_C(0x14292967), - SHA_UINT32_C(0x27b70a85), SHA_UINT32_C(0x2e1b2138), - SHA_UINT32_C(0x4d2c6dfc), SHA_UINT32_C(0x53380d13), - SHA_UINT32_C(0x650a7354), SHA_UINT32_C(0x766a0abb), - SHA_UINT32_C(0x81c2c92e), SHA_UINT32_C(0x92722c85), - SHA_UINT32_C(0xa2bfe8a1), SHA_UINT32_C(0xa81a664b), - SHA_UINT32_C(0xc24b8b70), SHA_UINT32_C(0xc76c51a3), - SHA_UINT32_C(0xd192e819), SHA_UINT32_C(0xd6990624), - SHA_UINT32_C(0xf40e3585), SHA_UINT32_C(0x106aa070), - SHA_UINT32_C(0x19a4c116), SHA_UINT32_C(0x1e376c08), - SHA_UINT32_C(0x2748774c), SHA_UINT32_C(0x34b0bcb5), - SHA_UINT32_C(0x391c0cb3), SHA_UINT32_C(0x4ed8aa4a), - SHA_UINT32_C(0x5b9cca4f), SHA_UINT32_C(0x682e6ff3), - SHA_UINT32_C(0x748f82ee), SHA_UINT32_C(0x78a5636f), - SHA_UINT32_C(0x84c87814), SHA_UINT32_C(0x8cc70208), - SHA_UINT32_C(0x90befffa), SHA_UINT32_C(0xa4506ceb), - SHA_UINT32_C(0xbef9a3f7), SHA_UINT32_C(0xc67178f2) -}; - -/* Initial hash value H for SHA-224: */ -static const sha_word32 sha224_initial_hash_value[8] = { - SHA_UINT32_C(0xc1059ed8), - SHA_UINT32_C(0x367cd507), - SHA_UINT32_C(0x3070dd17), - SHA_UINT32_C(0xf70e5939), - SHA_UINT32_C(0xffc00b31), - SHA_UINT32_C(0x68581511), - SHA_UINT32_C(0x64f98fa7), - SHA_UINT32_C(0xbefa4fa4) -}; - -/* Initial hash value H for SHA-256: */ -static const sha_word32 sha256_initial_hash_value[8] = { - SHA_UINT32_C(0x6a09e667), - SHA_UINT32_C(0xbb67ae85), - SHA_UINT32_C(0x3c6ef372), - SHA_UINT32_C(0xa54ff53a), - SHA_UINT32_C(0x510e527f), - SHA_UINT32_C(0x9b05688c), - SHA_UINT32_C(0x1f83d9ab), - SHA_UINT32_C(0x5be0cd19) -}; - -/* Hash constant words K for SHA-384 and SHA-512: */ -static const sha_word64 K512[80] = { - SHA_UINT64_C(0x428a2f98d728ae22), SHA_UINT64_C(0x7137449123ef65cd), - SHA_UINT64_C(0xb5c0fbcfec4d3b2f), SHA_UINT64_C(0xe9b5dba58189dbbc), - SHA_UINT64_C(0x3956c25bf348b538), SHA_UINT64_C(0x59f111f1b605d019), - SHA_UINT64_C(0x923f82a4af194f9b), SHA_UINT64_C(0xab1c5ed5da6d8118), - SHA_UINT64_C(0xd807aa98a3030242), SHA_UINT64_C(0x12835b0145706fbe), - SHA_UINT64_C(0x243185be4ee4b28c), SHA_UINT64_C(0x550c7dc3d5ffb4e2), - SHA_UINT64_C(0x72be5d74f27b896f), SHA_UINT64_C(0x80deb1fe3b1696b1), - SHA_UINT64_C(0x9bdc06a725c71235), SHA_UINT64_C(0xc19bf174cf692694), - SHA_UINT64_C(0xe49b69c19ef14ad2), SHA_UINT64_C(0xefbe4786384f25e3), - SHA_UINT64_C(0x0fc19dc68b8cd5b5), SHA_UINT64_C(0x240ca1cc77ac9c65), - SHA_UINT64_C(0x2de92c6f592b0275), SHA_UINT64_C(0x4a7484aa6ea6e483), - SHA_UINT64_C(0x5cb0a9dcbd41fbd4), SHA_UINT64_C(0x76f988da831153b5), - SHA_UINT64_C(0x983e5152ee66dfab), SHA_UINT64_C(0xa831c66d2db43210), - SHA_UINT64_C(0xb00327c898fb213f), SHA_UINT64_C(0xbf597fc7beef0ee4), - SHA_UINT64_C(0xc6e00bf33da88fc2), SHA_UINT64_C(0xd5a79147930aa725), - SHA_UINT64_C(0x06ca6351e003826f), SHA_UINT64_C(0x142929670a0e6e70), - SHA_UINT64_C(0x27b70a8546d22ffc), SHA_UINT64_C(0x2e1b21385c26c926), - SHA_UINT64_C(0x4d2c6dfc5ac42aed), SHA_UINT64_C(0x53380d139d95b3df), - SHA_UINT64_C(0x650a73548baf63de), SHA_UINT64_C(0x766a0abb3c77b2a8), - SHA_UINT64_C(0x81c2c92e47edaee6), SHA_UINT64_C(0x92722c851482353b), - SHA_UINT64_C(0xa2bfe8a14cf10364), SHA_UINT64_C(0xa81a664bbc423001), - SHA_UINT64_C(0xc24b8b70d0f89791), SHA_UINT64_C(0xc76c51a30654be30), - SHA_UINT64_C(0xd192e819d6ef5218), SHA_UINT64_C(0xd69906245565a910), - SHA_UINT64_C(0xf40e35855771202a), SHA_UINT64_C(0x106aa07032bbd1b8), - SHA_UINT64_C(0x19a4c116b8d2d0c8), SHA_UINT64_C(0x1e376c085141ab53), - SHA_UINT64_C(0x2748774cdf8eeb99), SHA_UINT64_C(0x34b0bcb5e19b48a8), - SHA_UINT64_C(0x391c0cb3c5c95a63), SHA_UINT64_C(0x4ed8aa4ae3418acb), - SHA_UINT64_C(0x5b9cca4f7763e373), SHA_UINT64_C(0x682e6ff3d6b2b8a3), - SHA_UINT64_C(0x748f82ee5defb2fc), SHA_UINT64_C(0x78a5636f43172f60), - SHA_UINT64_C(0x84c87814a1f0ab72), SHA_UINT64_C(0x8cc702081a6439ec), - SHA_UINT64_C(0x90befffa23631e28), SHA_UINT64_C(0xa4506cebde82bde9), - SHA_UINT64_C(0xbef9a3f7b2c67915), SHA_UINT64_C(0xc67178f2e372532b), - SHA_UINT64_C(0xca273eceea26619c), SHA_UINT64_C(0xd186b8c721c0c207), - SHA_UINT64_C(0xeada7dd6cde0eb1e), SHA_UINT64_C(0xf57d4f7fee6ed178), - SHA_UINT64_C(0x06f067aa72176fba), SHA_UINT64_C(0x0a637dc5a2c898a6), - SHA_UINT64_C(0x113f9804bef90dae), SHA_UINT64_C(0x1b710b35131c471b), - SHA_UINT64_C(0x28db77f523047d84), SHA_UINT64_C(0x32caab7b40c72493), - SHA_UINT64_C(0x3c9ebe0a15c9bebc), SHA_UINT64_C(0x431d67c49c100d4c), - SHA_UINT64_C(0x4cc5d4becb3e42b6), SHA_UINT64_C(0x597f299cfc657e2a), - SHA_UINT64_C(0x5fcb6fab3ad6faec), SHA_UINT64_C(0x6c44198c4a475817) -}; - -/* Initial hash value H for SHA-384 */ -static const sha_word64 sha384_initial_hash_value[8] = { - SHA_UINT64_C(0xcbbb9d5dc1059ed8), - SHA_UINT64_C(0x629a292a367cd507), - SHA_UINT64_C(0x9159015a3070dd17), - SHA_UINT64_C(0x152fecd8f70e5939), - SHA_UINT64_C(0x67332667ffc00b31), - SHA_UINT64_C(0x8eb44a8768581511), - SHA_UINT64_C(0xdb0c2e0d64f98fa7), - SHA_UINT64_C(0x47b5481dbefa4fa4) -}; - -/* Initial hash value H for SHA-512 */ -static const sha_word64 sha512_initial_hash_value[8] = { - SHA_UINT64_C(0x6a09e667f3bcc908), - SHA_UINT64_C(0xbb67ae8584caa73b), - SHA_UINT64_C(0x3c6ef372fe94f82b), - SHA_UINT64_C(0xa54ff53a5f1d36f1), - SHA_UINT64_C(0x510e527fade682d1), - SHA_UINT64_C(0x9b05688c2b3e6c1f), - SHA_UINT64_C(0x1f83d9abfb41bd6b), - SHA_UINT64_C(0x5be0cd19137e2179) -}; - -/* - * Constant used by SHA224/256/384/512_End() functions for converting the - * digest to a readable hexadecimal character string: - */ -static const char *sha_hex_digits = "0123456789abcdef"; - - -/*** SHA-1: ***********************************************************/ -void SHA1_Init(SHA_CTX* context) { - /* Sanity check: */ - assert(context != (SHA_CTX*)0); - - MEMCPY_BCOPY(context->s1.state, sha1_initial_hash_value, sizeof(sha_word32) * 5); - MEMSET_BZERO(context->s1.buffer, 64); - context->s1.bitcount = 0; -} - -#ifdef SHA2_UNROLL_TRANSFORM - -/* Unrolled SHA-1 round macros: */ - -#if BYTE_ORDER == LITTLE_ENDIAN - -#define ROUND1_0_TO_15(a,b,c,d,e) \ - REVERSE32(*data++, W1[j]); \ - (e) = ROTL32(5, (a)) + Ch((b), (c), (d)) + (e) + \ - K1_0_TO_19 + W1[j]; \ - (b) = ROTL32(30, (b)); \ - j++; - -#else /* BYTE_ORDER == LITTLE_ENDIAN */ - -#define ROUND1_0_TO_15(a,b,c,d,e) \ - (e) = ROTL32(5, (a)) + Ch((b), (c), (d)) + (e) + \ - K1_0_TO_19 + ( W1[j] = *data++ ); \ - (b) = ROTL32(30, (b)); \ - j++; - -#endif /* BYTE_ORDER == LITTLE_ENDIAN */ - -#define ROUND1_16_TO_19(a,b,c,d,e) \ - T1 = W1[(j+13)&0x0f] ^ W1[(j+8)&0x0f] ^ W1[(j+2)&0x0f] ^ W1[j&0x0f]; \ - (e) = ROTL32(5, a) + Ch(b,c,d) + e + K1_0_TO_19 + ( W1[j&0x0f] = ROTL32(1, T1) ); \ - (b) = ROTL32(30, b); \ - j++; - -#define ROUND1_20_TO_39(a,b,c,d,e) \ - T1 = W1[(j+13)&0x0f] ^ W1[(j+8)&0x0f] ^ W1[(j+2)&0x0f] ^ W1[j&0x0f]; \ - (e) = ROTL32(5, a) + Parity(b,c,d) + e + K1_20_TO_39 + ( W1[j&0x0f] = ROTL32(1, T1) ); \ - (b) = ROTL32(30, b); \ - j++; - -#define ROUND1_40_TO_59(a,b,c,d,e) \ - T1 = W1[(j+13)&0x0f] ^ W1[(j+8)&0x0f] ^ W1[(j+2)&0x0f] ^ W1[j&0x0f]; \ - (e) = ROTL32(5, a) + Maj(b,c,d) + e + K1_40_TO_59 + ( W1[j&0x0f] = ROTL32(1, T1) ); \ - (b) = ROTL32(30, b); \ - j++; - -#define ROUND1_60_TO_79(a,b,c,d,e) \ - T1 = W1[(j+13)&0x0f] ^ W1[(j+8)&0x0f] ^ W1[(j+2)&0x0f] ^ W1[j&0x0f]; \ - (e) = ROTL32(5, a) + Parity(b,c,d) + e + K1_60_TO_79 + ( W1[j&0x0f] = ROTL32(1, T1) ); \ - (b) = ROTL32(30, b); \ - j++; - -void SHA1_Internal_Transform(SHA_CTX* context, const sha_word32* data) { - sha_word32 a, b, c, d, e; - sha_word32 T1, *W1; - int j; - - W1 = (sha_word32*)context->s1.buffer; - - /* Initialize registers with the prev. intermediate value */ - a = context->s1.state[0]; - b = context->s1.state[1]; - c = context->s1.state[2]; - d = context->s1.state[3]; - e = context->s1.state[4]; - - j = 0; - - /* Rounds 0 to 15 unrolled: */ - ROUND1_0_TO_15(a,b,c,d,e); - ROUND1_0_TO_15(e,a,b,c,d); - ROUND1_0_TO_15(d,e,a,b,c); - ROUND1_0_TO_15(c,d,e,a,b); - ROUND1_0_TO_15(b,c,d,e,a); - ROUND1_0_TO_15(a,b,c,d,e); - ROUND1_0_TO_15(e,a,b,c,d); - ROUND1_0_TO_15(d,e,a,b,c); - ROUND1_0_TO_15(c,d,e,a,b); - ROUND1_0_TO_15(b,c,d,e,a); - ROUND1_0_TO_15(a,b,c,d,e); - ROUND1_0_TO_15(e,a,b,c,d); - ROUND1_0_TO_15(d,e,a,b,c); - ROUND1_0_TO_15(c,d,e,a,b); - ROUND1_0_TO_15(b,c,d,e,a); - ROUND1_0_TO_15(a,b,c,d,e); - - /* Rounds 16 to 19 unrolled: */ - ROUND1_16_TO_19(e,a,b,c,d); - ROUND1_16_TO_19(d,e,a,b,c); - ROUND1_16_TO_19(c,d,e,a,b); - ROUND1_16_TO_19(b,c,d,e,a); - - /* Rounds 20 to 39 unrolled: */ - ROUND1_20_TO_39(a,b,c,d,e); - ROUND1_20_TO_39(e,a,b,c,d); - ROUND1_20_TO_39(d,e,a,b,c); - ROUND1_20_TO_39(c,d,e,a,b); - ROUND1_20_TO_39(b,c,d,e,a); - ROUND1_20_TO_39(a,b,c,d,e); - ROUND1_20_TO_39(e,a,b,c,d); - ROUND1_20_TO_39(d,e,a,b,c); - ROUND1_20_TO_39(c,d,e,a,b); - ROUND1_20_TO_39(b,c,d,e,a); - ROUND1_20_TO_39(a,b,c,d,e); - ROUND1_20_TO_39(e,a,b,c,d); - ROUND1_20_TO_39(d,e,a,b,c); - ROUND1_20_TO_39(c,d,e,a,b); - ROUND1_20_TO_39(b,c,d,e,a); - ROUND1_20_TO_39(a,b,c,d,e); - ROUND1_20_TO_39(e,a,b,c,d); - ROUND1_20_TO_39(d,e,a,b,c); - ROUND1_20_TO_39(c,d,e,a,b); - ROUND1_20_TO_39(b,c,d,e,a); - - /* Rounds 40 to 59 unrolled: */ - ROUND1_40_TO_59(a,b,c,d,e); - ROUND1_40_TO_59(e,a,b,c,d); - ROUND1_40_TO_59(d,e,a,b,c); - ROUND1_40_TO_59(c,d,e,a,b); - ROUND1_40_TO_59(b,c,d,e,a); - ROUND1_40_TO_59(a,b,c,d,e); - ROUND1_40_TO_59(e,a,b,c,d); - ROUND1_40_TO_59(d,e,a,b,c); - ROUND1_40_TO_59(c,d,e,a,b); - ROUND1_40_TO_59(b,c,d,e,a); - ROUND1_40_TO_59(a,b,c,d,e); - ROUND1_40_TO_59(e,a,b,c,d); - ROUND1_40_TO_59(d,e,a,b,c); - ROUND1_40_TO_59(c,d,e,a,b); - ROUND1_40_TO_59(b,c,d,e,a); - ROUND1_40_TO_59(a,b,c,d,e); - ROUND1_40_TO_59(e,a,b,c,d); - ROUND1_40_TO_59(d,e,a,b,c); - ROUND1_40_TO_59(c,d,e,a,b); - ROUND1_40_TO_59(b,c,d,e,a); - - /* Rounds 60 to 79 unrolled: */ - ROUND1_60_TO_79(a,b,c,d,e); - ROUND1_60_TO_79(e,a,b,c,d); - ROUND1_60_TO_79(d,e,a,b,c); - ROUND1_60_TO_79(c,d,e,a,b); - ROUND1_60_TO_79(b,c,d,e,a); - ROUND1_60_TO_79(a,b,c,d,e); - ROUND1_60_TO_79(e,a,b,c,d); - ROUND1_60_TO_79(d,e,a,b,c); - ROUND1_60_TO_79(c,d,e,a,b); - ROUND1_60_TO_79(b,c,d,e,a); - ROUND1_60_TO_79(a,b,c,d,e); - ROUND1_60_TO_79(e,a,b,c,d); - ROUND1_60_TO_79(d,e,a,b,c); - ROUND1_60_TO_79(c,d,e,a,b); - ROUND1_60_TO_79(b,c,d,e,a); - ROUND1_60_TO_79(a,b,c,d,e); - ROUND1_60_TO_79(e,a,b,c,d); - ROUND1_60_TO_79(d,e,a,b,c); - ROUND1_60_TO_79(c,d,e,a,b); - ROUND1_60_TO_79(b,c,d,e,a); - - /* Compute the current intermediate hash value */ - context->s1.state[0] += a; - context->s1.state[1] += b; - context->s1.state[2] += c; - context->s1.state[3] += d; - context->s1.state[4] += e; - - /* Clean up */ - a = b = c = d = e = T1 = 0; -} - -#else /* SHA2_UNROLL_TRANSFORM */ - -void SHA1_Internal_Transform(SHA_CTX* context, const sha_word32* data) { - sha_word32 a, b, c, d, e; - sha_word32 T1, *W1; - int j; - - W1 = (sha_word32*)context->s1.buffer; - - /* Initialize registers with the prev. intermediate value */ - a = context->s1.state[0]; - b = context->s1.state[1]; - c = context->s1.state[2]; - d = context->s1.state[3]; - e = context->s1.state[4]; - j = 0; - do { -#if BYTE_ORDER == LITTLE_ENDIAN - T1 = data[j]; - /* Copy data while converting to host byte order */ - REVERSE32(*data++, W1[j]); - T1 = ROTL32(5, a) + Ch(b, c, d) + e + K1_0_TO_19 + W1[j]; -#else /* BYTE_ORDER == LITTLE_ENDIAN */ - T1 = ROTL32(5, a) + Ch(b, c, d) + e + K1_0_TO_19 + (W1[j] = *data++); -#endif /* BYTE_ORDER == LITTLE_ENDIAN */ - e = d; - d = c; - c = ROTL32(30, b); - b = a; - a = T1; - j++; - } while (j < 16); - - do { - T1 = W1[(j+13)&0x0f] ^ W1[(j+8)&0x0f] ^ W1[(j+2)&0x0f] ^ W1[j&0x0f]; - T1 = ROTL32(5, a) + Ch(b,c,d) + e + K1_0_TO_19 + (W1[j&0x0f] = ROTL32(1, T1)); - e = d; - d = c; - c = ROTL32(30, b); - b = a; - a = T1; - j++; - } while (j < 20); - - do { - T1 = W1[(j+13)&0x0f] ^ W1[(j+8)&0x0f] ^ W1[(j+2)&0x0f] ^ W1[j&0x0f]; - T1 = ROTL32(5, a) + Parity(b,c,d) + e + K1_20_TO_39 + (W1[j&0x0f] = ROTL32(1, T1)); - e = d; - d = c; - c = ROTL32(30, b); - b = a; - a = T1; - j++; - } while (j < 40); - - do { - T1 = W1[(j+13)&0x0f] ^ W1[(j+8)&0x0f] ^ W1[(j+2)&0x0f] ^ W1[j&0x0f]; - T1 = ROTL32(5, a) + Maj(b,c,d) + e + K1_40_TO_59 + (W1[j&0x0f] = ROTL32(1, T1)); - e = d; - d = c; - c = ROTL32(30, b); - b = a; - a = T1; - j++; - } while (j < 60); - - do { - T1 = W1[(j+13)&0x0f] ^ W1[(j+8)&0x0f] ^ W1[(j+2)&0x0f] ^ W1[j&0x0f]; - T1 = ROTL32(5, a) + Parity(b,c,d) + e + K1_60_TO_79 + (W1[j&0x0f] = ROTL32(1, T1)); - e = d; - d = c; - c = ROTL32(30, b); - b = a; - a = T1; - j++; - } while (j < 80); - - - /* Compute the current intermediate hash value */ - context->s1.state[0] += a; - context->s1.state[1] += b; - context->s1.state[2] += c; - context->s1.state[3] += d; - context->s1.state[4] += e; - - /* Clean up */ - a = b = c = d = e = T1 = 0; -} - -#endif /* SHA2_UNROLL_TRANSFORM */ - -void SHA1_Update(SHA_CTX* context, const sha_byte *data, size_t len) { - unsigned int freespace, usedspace; - if (len == 0) { - /* Calling with no data is valid - we do nothing */ - return; - } - - /* Sanity check: */ - assert(context != (SHA_CTX*)0 && data != (sha_byte*)0); - - usedspace = (unsigned int)((context->s1.bitcount >> 3) % 64); - if (usedspace > 0) { - /* Calculate how much free space is available in the buffer */ - freespace = 64 - usedspace; - - if (len >= freespace) { - /* Fill the buffer completely and process it */ - MEMCPY_BCOPY(&context->s1.buffer[usedspace], data, freespace); - context->s1.bitcount += freespace << 3; - len -= freespace; - data += freespace; - SHA1_Internal_Transform(context, (const sha_word32*)context->s1.buffer); - } else { - /* The buffer is not yet full */ - MEMCPY_BCOPY(&context->s1.buffer[usedspace], data, len); - context->s1.bitcount += len << 3; - /* Clean up: */ - usedspace = freespace = 0; - return; - } - } - while (len >= 64) { - /* Process as many complete blocks as we can */ - SHA1_Internal_Transform(context, (const sha_word32*)data); - context->s1.bitcount += 512; - len -= 64; - data += 64; - } - if (len > 0) { - /* There's left-overs, so save 'em */ - MEMCPY_BCOPY(context->s1.buffer, data, len); - context->s1.bitcount += len << 3; - } - /* Clean up: */ - usedspace = freespace = 0; -} - -void SHA1_Final(sha_byte digest[], SHA_CTX* context) { - sha_word32 *d = (sha_word32*)digest; - unsigned int usedspace; - - /* Sanity check: */ - assert(context != (SHA_CTX*)0); - - if (digest == (sha_byte*)0) { - /* - * No digest buffer, so we can do nothing - * except clean up and go home - */ - MEMSET_BZERO(context, sizeof(*context)); - return; - } - - usedspace = (unsigned int)((context->s1.bitcount >> 3) % 64); - if (usedspace == 0) { - /* Set-up for the last transform: */ - MEMSET_BZERO(context->s1.buffer, 56); - - /* Begin padding with a 1 bit: */ - *context->s1.buffer = 0x80; - } else { - /* Begin padding with a 1 bit: */ - context->s1.buffer[usedspace++] = 0x80; - - if (usedspace <= 56) { - /* Set-up for the last transform: */ - MEMSET_BZERO(&context->s1.buffer[usedspace], 56 - usedspace); - } else { - if (usedspace < 64) { - MEMSET_BZERO(&context->s1.buffer[usedspace], 64 - usedspace); - } - /* Do second-to-last transform: */ - SHA1_Internal_Transform(context, (const sha_word32*)context->s1.buffer); - - /* And set-up for the last transform: */ - MEMSET_BZERO(context->s1.buffer, 56); - } - /* Clean up: */ - usedspace = 0; - } - /* Set the bit count: */ -#if BYTE_ORDER == LITTLE_ENDIAN - /* Convert FROM host byte order */ - REVERSE64(context->s1.bitcount,context->s1.bitcount); -#endif - MEMCPY_BCOPY(&context->s1.buffer[56], &context->s1.bitcount, - sizeof(sha_word64)); - - /* Final transform: */ - SHA1_Internal_Transform(context, (const sha_word32*)context->s1.buffer); - - /* Save the hash data for output: */ -#if BYTE_ORDER == LITTLE_ENDIAN - { - /* Convert TO host byte order */ - int j; - for (j = 0; j < (SHA1_DIGEST_LENGTH >> 2); j++) { - REVERSE32(context->s1.state[j],context->s1.state[j]); - *d++ = context->s1.state[j]; - } - } -#else - MEMCPY_BCOPY(d, context->s1.state, SHA1_DIGEST_LENGTH); -#endif - - /* Clean up: */ - MEMSET_BZERO(context, sizeof(*context)); -} - -char *SHA1_End(SHA_CTX* context, char buffer[]) { - sha_byte digest[SHA1_DIGEST_LENGTH], *d = digest; - int i; - - /* Sanity check: */ - assert(context != (SHA_CTX*)0); - - if (buffer != (char*)0) { - SHA1_Final(digest, context); - - for (i = 0; i < SHA1_DIGEST_LENGTH; i++) { - *buffer++ = sha_hex_digits[(*d & 0xf0) >> 4]; - *buffer++ = sha_hex_digits[*d & 0x0f]; - d++; - } - *buffer = (char)0; - } else { - MEMSET_BZERO(context, sizeof(*context)); - } - MEMSET_BZERO(digest, SHA1_DIGEST_LENGTH); - return buffer; -} - -char* SHA1_Data(const sha_byte* data, size_t len, char digest[SHA1_DIGEST_STRING_LENGTH]) { - SHA_CTX context; - - SHA1_Init(&context); - SHA1_Update(&context, data, len); - return SHA1_End(&context, digest); -} - - -/*** SHA-256: *********************************************************/ -void SHA256_Internal_Init(SHA_CTX* context, const sha_word32* ihv) { - /* Sanity check: */ - assert(context != (SHA_CTX*)0); - - MEMCPY_BCOPY(context->s256.state, ihv, sizeof(sha_word32) * 8); - MEMSET_BZERO(context->s256.buffer, 64); - context->s256.bitcount = 0; -} - -void SHA256_Init(SHA_CTX* context) { - SHA256_Internal_Init(context, sha256_initial_hash_value); -} - -#ifdef SHA2_UNROLL_TRANSFORM - -/* Unrolled SHA-256 round macros: */ - -#if BYTE_ORDER == LITTLE_ENDIAN - -#define ROUND256_0_TO_15(a,b,c,d,e,f,g,h) \ - REVERSE32(*data++, W256[j]); \ - T1 = (h) + Sigma1_256(e) + Ch((e), (f), (g)) + \ - K256[j] + W256[j]; \ - (d) += T1; \ - (h) = T1 + Sigma0_256(a) + Maj((a), (b), (c)); \ - j++ - - -#else /* BYTE_ORDER == LITTLE_ENDIAN */ - -#define ROUND256_0_TO_15(a,b,c,d,e,f,g,h) \ - T1 = (h) + Sigma1_256(e) + Ch((e), (f), (g)) + \ - K256[j] + (W256[j] = *data++); \ - (d) += T1; \ - (h) = T1 + Sigma0_256(a) + Maj((a), (b), (c)); \ - j++ - -#endif /* BYTE_ORDER == LITTLE_ENDIAN */ - -#define ROUND256(a,b,c,d,e,f,g,h) \ - s0 = W256[(j+1)&0x0f]; \ - s0 = sigma0_256(s0); \ - s1 = W256[(j+14)&0x0f]; \ - s1 = sigma1_256(s1); \ - T1 = (h) + Sigma1_256(e) + Ch((e), (f), (g)) + K256[j] + \ - (W256[j&0x0f] += s1 + W256[(j+9)&0x0f] + s0); \ - (d) += T1; \ - (h) = T1 + Sigma0_256(a) + Maj((a), (b), (c)); \ - j++ - -void SHA256_Internal_Transform(SHA_CTX* context, const sha_word32* data) { - sha_word32 a, b, c, d, e, f, g, h, s0, s1; - sha_word32 T1, *W256; - int j; - - W256 = (sha_word32*)context->s256.buffer; - - /* Initialize registers with the prev. intermediate value */ - a = context->s256.state[0]; - b = context->s256.state[1]; - c = context->s256.state[2]; - d = context->s256.state[3]; - e = context->s256.state[4]; - f = context->s256.state[5]; - g = context->s256.state[6]; - h = context->s256.state[7]; - - j = 0; - do { - /* Rounds 0 to 15 (unrolled): */ - ROUND256_0_TO_15(a,b,c,d,e,f,g,h); - ROUND256_0_TO_15(h,a,b,c,d,e,f,g); - ROUND256_0_TO_15(g,h,a,b,c,d,e,f); - ROUND256_0_TO_15(f,g,h,a,b,c,d,e); - ROUND256_0_TO_15(e,f,g,h,a,b,c,d); - ROUND256_0_TO_15(d,e,f,g,h,a,b,c); - ROUND256_0_TO_15(c,d,e,f,g,h,a,b); - ROUND256_0_TO_15(b,c,d,e,f,g,h,a); - } while (j < 16); - - /* Now for the remaining rounds to 64: */ - do { - ROUND256(a,b,c,d,e,f,g,h); - ROUND256(h,a,b,c,d,e,f,g); - ROUND256(g,h,a,b,c,d,e,f); - ROUND256(f,g,h,a,b,c,d,e); - ROUND256(e,f,g,h,a,b,c,d); - ROUND256(d,e,f,g,h,a,b,c); - ROUND256(c,d,e,f,g,h,a,b); - ROUND256(b,c,d,e,f,g,h,a); - } while (j < 64); - - /* Compute the current intermediate hash value */ - context->s256.state[0] += a; - context->s256.state[1] += b; - context->s256.state[2] += c; - context->s256.state[3] += d; - context->s256.state[4] += e; - context->s256.state[5] += f; - context->s256.state[6] += g; - context->s256.state[7] += h; - - /* Clean up */ - a = b = c = d = e = f = g = h = T1 = 0; -} - -#else /* SHA2_UNROLL_TRANSFORM */ - -void SHA256_Internal_Transform(SHA_CTX* context, const sha_word32* data) { - sha_word32 a, b, c, d, e, f, g, h, s0, s1; - sha_word32 T1, T2, *W256; - int j; - - W256 = (sha_word32*)context->s256.buffer; - - /* Initialize registers with the prev. intermediate value */ - a = context->s256.state[0]; - b = context->s256.state[1]; - c = context->s256.state[2]; - d = context->s256.state[3]; - e = context->s256.state[4]; - f = context->s256.state[5]; - g = context->s256.state[6]; - h = context->s256.state[7]; - - j = 0; - do { -#if BYTE_ORDER == LITTLE_ENDIAN - /* Copy data while converting to host byte order */ - REVERSE32(*data++,W256[j]); - /* Apply the SHA-256 compression function to update a..h */ - T1 = h + Sigma1_256(e) + Ch(e, f, g) + K256[j] + W256[j]; -#else /* BYTE_ORDER == LITTLE_ENDIAN */ - /* Apply the SHA-256 compression function to update a..h with copy */ - T1 = h + Sigma1_256(e) + Ch(e, f, g) + K256[j] + (W256[j] = *data++); -#endif /* BYTE_ORDER == LITTLE_ENDIAN */ - T2 = Sigma0_256(a) + Maj(a, b, c); - h = g; - g = f; - f = e; - e = d + T1; - d = c; - c = b; - b = a; - a = T1 + T2; - - j++; - } while (j < 16); - - do { - /* Part of the message block expansion: */ - s0 = W256[(j+1)&0x0f]; - s0 = sigma0_256(s0); - s1 = W256[(j+14)&0x0f]; - s1 = sigma1_256(s1); - - /* Apply the SHA-256 compression function to update a..h */ - T1 = h + Sigma1_256(e) + Ch(e, f, g) + K256[j] + - (W256[j&0x0f] += s1 + W256[(j+9)&0x0f] + s0); - T2 = Sigma0_256(a) + Maj(a, b, c); - h = g; - g = f; - f = e; - e = d + T1; - d = c; - c = b; - b = a; - a = T1 + T2; - - j++; - } while (j < 64); - - /* Compute the current intermediate hash value */ - context->s256.state[0] += a; - context->s256.state[1] += b; - context->s256.state[2] += c; - context->s256.state[3] += d; - context->s256.state[4] += e; - context->s256.state[5] += f; - context->s256.state[6] += g; - context->s256.state[7] += h; - - /* Clean up */ - a = b = c = d = e = f = g = h = T1 = T2 = 0; -} - -#endif /* SHA2_UNROLL_TRANSFORM */ - -void SHA256_Update(SHA_CTX* context, const sha_byte *data, size_t len) { - unsigned int freespace, usedspace; - - if (len == 0) { - /* Calling with no data is valid - we do nothing */ - return; - } - - /* Sanity check: */ - assert(context != (SHA_CTX*)0 && data != (sha_byte*)0); - - usedspace = (unsigned int)((context->s256.bitcount >> 3) % 64); - if (usedspace > 0) { - /* Calculate how much free space is available in the buffer */ - freespace = 64 - usedspace; - - if (len >= freespace) { - /* Fill the buffer completely and process it */ - MEMCPY_BCOPY(&context->s256.buffer[usedspace], data, freespace); - context->s256.bitcount += freespace << 3; - len -= freespace; - data += freespace; - SHA256_Internal_Transform(context, (const sha_word32*)context->s256.buffer); - } else { - /* The buffer is not yet full */ - MEMCPY_BCOPY(&context->s256.buffer[usedspace], data, len); - context->s256.bitcount += len << 3; - /* Clean up: */ - usedspace = freespace = 0; - return; - } - } - while (len >= 64) { - /* Process as many complete blocks as we can */ - SHA256_Internal_Transform(context, (const sha_word32*)data); - context->s256.bitcount += 512; - len -= 64; - data += 64; - } - if (len > 0) { - /* There's left-overs, so save 'em */ - MEMCPY_BCOPY(context->s256.buffer, data, len); - context->s256.bitcount += len << 3; - } - /* Clean up: */ - usedspace = freespace = 0; -} - -void SHA256_Internal_Last(SHA_CTX* context) { - unsigned int usedspace; - - usedspace = (unsigned int)((context->s256.bitcount >> 3) % 64); -#if BYTE_ORDER == LITTLE_ENDIAN - /* Convert FROM host byte order */ - REVERSE64(context->s256.bitcount,context->s256.bitcount); -#endif - if (usedspace > 0) { - /* Begin padding with a 1 bit: */ - context->s256.buffer[usedspace++] = 0x80; - - if (usedspace <= 56) { - /* Set-up for the last transform: */ - MEMSET_BZERO(&context->s256.buffer[usedspace], 56 - usedspace); - } else { - if (usedspace < 64) { - MEMSET_BZERO(&context->s256.buffer[usedspace], 64 - usedspace); - } - /* Do second-to-last transform: */ - SHA256_Internal_Transform(context, (const sha_word32*)context->s256.buffer); - - /* And set-up for the last transform: */ - MEMSET_BZERO(context->s256.buffer, 56); - } - /* Clean up: */ - usedspace = 0; - } else { - /* Set-up for the last transform: */ - MEMSET_BZERO(context->s256.buffer, 56); - - /* Begin padding with a 1 bit: */ - *context->s256.buffer = 0x80; - } - /* Set the bit count: */ - MEMCPY_BCOPY(&context->s256.buffer[56], &context->s256.bitcount, - sizeof(sha_word64)); - - /* Final transform: */ - SHA256_Internal_Transform(context, (const sha_word32*)context->s256.buffer); -} - -void SHA256_Final(sha_byte digest[], SHA_CTX* context) { - sha_word32 *d = (sha_word32*)digest; - - /* Sanity check: */ - assert(context != (SHA_CTX*)0); - - /* If no digest buffer is passed, we don't bother doing this: */ - if (digest != (sha_byte*)0) { - SHA256_Internal_Last(context); - - /* Save the hash data for output: */ -#if BYTE_ORDER == LITTLE_ENDIAN - { - /* Convert TO host byte order */ - int j; - for (j = 0; j < (SHA256_DIGEST_LENGTH >> 2); j++) { - REVERSE32(context->s256.state[j],context->s256.state[j]); - *d++ = context->s256.state[j]; - } - } -#else - MEMCPY_BCOPY(d, context->s256.state, SHA256_DIGEST_LENGTH); -#endif - } - - /* Clean up state data: */ - MEMSET_BZERO(context, sizeof(*context)); -} - -char *SHA256_End(SHA_CTX* context, char buffer[]) { - sha_byte digest[SHA256_DIGEST_LENGTH], *d = digest; - int i; - - /* Sanity check: */ - assert(context != (SHA_CTX*)0); - - if (buffer != (char*)0) { - SHA256_Final(digest, context); - - for (i = 0; i < SHA256_DIGEST_LENGTH; i++) { - *buffer++ = sha_hex_digits[(*d & 0xf0) >> 4]; - *buffer++ = sha_hex_digits[*d & 0x0f]; - d++; - } - *buffer = (char)0; - } else { - MEMSET_BZERO(context, sizeof(*context)); - } - MEMSET_BZERO(digest, SHA256_DIGEST_LENGTH); - return buffer; -} - -char* SHA256_Data(const sha_byte* data, size_t len, char digest[SHA256_DIGEST_STRING_LENGTH]) { - SHA_CTX context; - - SHA256_Init(&context); - SHA256_Update(&context, data, len); - return SHA256_End(&context, digest); -} - - -/*** SHA-224: *********************************************************/ -void SHA224_Init(SHA_CTX* context) { - SHA256_Internal_Init(context, sha224_initial_hash_value); -} - -void SHA224_Internal_Transform(SHA_CTX* context, const sha_word32* data) { - SHA256_Internal_Transform(context, data); -} - -void SHA224_Update(SHA_CTX* context, const sha_byte *data, size_t len) { - SHA256_Update(context, data, len); -} - -void SHA224_Final(sha_byte digest[], SHA_CTX* context) { - sha_word32 *d = (sha_word32*)digest; - - /* Sanity check: */ - assert(context != (SHA_CTX*)0); - - /* If no digest buffer is passed, we don't bother doing this: */ - if (digest != (sha_byte*)0) { - SHA256_Internal_Last(context); - - /* Save the hash data for output: */ -#if BYTE_ORDER == LITTLE_ENDIAN - { - /* Convert TO host byte order */ - int j; - for (j = 0; j < (SHA224_DIGEST_LENGTH >> 2); j++) { - REVERSE32(context->s256.state[j],context->s256.state[j]); - *d++ = context->s256.state[j]; - } - } -#else - MEMCPY_BCOPY(d, context->s256.state, SHA224_DIGEST_LENGTH); -#endif - } - - /* Clean up state data: */ - MEMSET_BZERO(context, sizeof(*context)); -} - -char *SHA224_End(SHA_CTX* context, char buffer[]) { - sha_byte digest[SHA224_DIGEST_LENGTH], *d = digest; - int i; - - /* Sanity check: */ - assert(context != (SHA_CTX*)0); - - if (buffer != (char*)0) { - SHA224_Final(digest, context); - - for (i = 0; i < SHA224_DIGEST_LENGTH; i++) { - *buffer++ = sha_hex_digits[(*d & 0xf0) >> 4]; - *buffer++ = sha_hex_digits[*d & 0x0f]; - d++; - } - *buffer = (char)0; - } else { - MEMSET_BZERO(context, sizeof(*context)); - } - MEMSET_BZERO(digest, SHA224_DIGEST_LENGTH); - return buffer; -} - -char* SHA224_Data(const sha_byte* data, size_t len, char digest[SHA224_DIGEST_STRING_LENGTH]) { - SHA_CTX context; - - SHA224_Init(&context); - SHA224_Update(&context, data, len); - return SHA224_End(&context, digest); -} - - -/*** SHA-512: *********************************************************/ -void SHA512_Internal_Init(SHA_CTX* context, const sha_word64* ihv) { - /* Sanity check: */ - assert(context != (SHA_CTX*)0); - - MEMCPY_BCOPY(context->s512.state, ihv, sizeof(sha_word64) * 8); - MEMSET_BZERO(context->s512.buffer, 128); - context->s512.bitcount[0] = context->s512.bitcount[1] = 0; -} - -void SHA512_Init(SHA_CTX* context) { - SHA512_Internal_Init(context, sha512_initial_hash_value); -} - -#ifdef SHA2_UNROLL_TRANSFORM - -/* Unrolled SHA-512 round macros: */ -#if BYTE_ORDER == LITTLE_ENDIAN - -#define ROUND512_0_TO_15(a,b,c,d,e,f,g,h) \ - REVERSE64(*data++, W512[j]); \ - T1 = (h) + Sigma1_512(e) + Ch((e), (f), (g)) + \ - K512[j] + W512[j]; \ - (d) += T1, \ - (h) = T1 + Sigma0_512(a) + Maj((a), (b), (c)), \ - j++ - - -#else /* BYTE_ORDER == LITTLE_ENDIAN */ - -#define ROUND512_0_TO_15(a,b,c,d,e,f,g,h) \ - T1 = (h) + Sigma1_512(e) + Ch((e), (f), (g)) + \ - K512[j] + (W512[j] = *data++); \ - (d) += T1; \ - (h) = T1 + Sigma0_512(a) + Maj((a), (b), (c)); \ - j++ - -#endif /* BYTE_ORDER == LITTLE_ENDIAN */ - -#define ROUND512(a,b,c,d,e,f,g,h) \ - s0 = W512[(j+1)&0x0f]; \ - s0 = sigma0_512(s0); \ - s1 = W512[(j+14)&0x0f]; \ - s1 = sigma1_512(s1); \ - T1 = (h) + Sigma1_512(e) + Ch((e), (f), (g)) + K512[j] + \ - (W512[j&0x0f] += s1 + W512[(j+9)&0x0f] + s0); \ - (d) += T1; \ - (h) = T1 + Sigma0_512(a) + Maj((a), (b), (c)); \ - j++ - -void SHA512_Internal_Transform(SHA_CTX* context, const sha_word64* data) { - sha_word64 a, b, c, d, e, f, g, h, s0, s1; - sha_word64 T1, *W512 = (sha_word64*)context->s512.buffer; - int j; - - /* Initialize registers with the prev. intermediate value */ - a = context->s512.state[0]; - b = context->s512.state[1]; - c = context->s512.state[2]; - d = context->s512.state[3]; - e = context->s512.state[4]; - f = context->s512.state[5]; - g = context->s512.state[6]; - h = context->s512.state[7]; - - j = 0; - do { - ROUND512_0_TO_15(a,b,c,d,e,f,g,h); - ROUND512_0_TO_15(h,a,b,c,d,e,f,g); - ROUND512_0_TO_15(g,h,a,b,c,d,e,f); - ROUND512_0_TO_15(f,g,h,a,b,c,d,e); - ROUND512_0_TO_15(e,f,g,h,a,b,c,d); - ROUND512_0_TO_15(d,e,f,g,h,a,b,c); - ROUND512_0_TO_15(c,d,e,f,g,h,a,b); - ROUND512_0_TO_15(b,c,d,e,f,g,h,a); - } while (j < 16); - - /* Now for the remaining rounds up to 79: */ - do { - ROUND512(a,b,c,d,e,f,g,h); - ROUND512(h,a,b,c,d,e,f,g); - ROUND512(g,h,a,b,c,d,e,f); - ROUND512(f,g,h,a,b,c,d,e); - ROUND512(e,f,g,h,a,b,c,d); - ROUND512(d,e,f,g,h,a,b,c); - ROUND512(c,d,e,f,g,h,a,b); - ROUND512(b,c,d,e,f,g,h,a); - } while (j < 80); - - /* Compute the current intermediate hash value */ - context->s512.state[0] += a; - context->s512.state[1] += b; - context->s512.state[2] += c; - context->s512.state[3] += d; - context->s512.state[4] += e; - context->s512.state[5] += f; - context->s512.state[6] += g; - context->s512.state[7] += h; - - /* Clean up */ - a = b = c = d = e = f = g = h = T1 = 0; -} - -#else /* SHA2_UNROLL_TRANSFORM */ - -void SHA512_Internal_Transform(SHA_CTX* context, const sha_word64* data) { - sha_word64 a, b, c, d, e, f, g, h, s0, s1; - sha_word64 T1, T2, *W512 = (sha_word64*)context->s512.buffer; - int j; - - /* Initialize registers with the prev. intermediate value */ - a = context->s512.state[0]; - b = context->s512.state[1]; - c = context->s512.state[2]; - d = context->s512.state[3]; - e = context->s512.state[4]; - f = context->s512.state[5]; - g = context->s512.state[6]; - h = context->s512.state[7]; - - j = 0; - do { -#if BYTE_ORDER == LITTLE_ENDIAN - /* Convert TO host byte order */ - REVERSE64(*data++, W512[j]); - /* Apply the SHA-512 compression function to update a..h */ - T1 = h + Sigma1_512(e) + Ch(e, f, g) + K512[j] + W512[j]; -#else /* BYTE_ORDER == LITTLE_ENDIAN */ - /* Apply the SHA-512 compression function to update a..h with copy */ - T1 = h + Sigma1_512(e) + Ch(e, f, g) + K512[j] + (W512[j] = *data++); -#endif /* BYTE_ORDER == LITTLE_ENDIAN */ - T2 = Sigma0_512(a) + Maj(a, b, c); - h = g; - g = f; - f = e; - e = d + T1; - d = c; - c = b; - b = a; - a = T1 + T2; - - j++; - } while (j < 16); - - do { - /* Part of the message block expansion: */ - s0 = W512[(j+1)&0x0f]; - s0 = sigma0_512(s0); - s1 = W512[(j+14)&0x0f]; - s1 = sigma1_512(s1); - - /* Apply the SHA-512 compression function to update a..h */ - T1 = h + Sigma1_512(e) + Ch(e, f, g) + K512[j] + - (W512[j&0x0f] += s1 + W512[(j+9)&0x0f] + s0); - T2 = Sigma0_512(a) + Maj(a, b, c); - h = g; - g = f; - f = e; - e = d + T1; - d = c; - c = b; - b = a; - a = T1 + T2; - - j++; - } while (j < 80); - - /* Compute the current intermediate hash value */ - context->s512.state[0] += a; - context->s512.state[1] += b; - context->s512.state[2] += c; - context->s512.state[3] += d; - context->s512.state[4] += e; - context->s512.state[5] += f; - context->s512.state[6] += g; - context->s512.state[7] += h; - - /* Clean up */ - a = b = c = d = e = f = g = h = T1 = T2 = 0; -} - -#endif /* SHA2_UNROLL_TRANSFORM */ - -void SHA512_Update(SHA_CTX* context, const sha_byte *data, size_t len) { - unsigned int freespace, usedspace; - - if (len == 0) { - /* Calling with no data is valid - we do nothing */ - return; - } - - /* Sanity check: */ - assert(context != (SHA_CTX*)0 && data != (sha_byte*)0); - - usedspace = (unsigned int)((context->s512.bitcount[0] >> 3) % 128); - if (usedspace > 0) { - /* Calculate how much free space is available in the buffer */ - freespace = 128 - usedspace; - - if (len >= freespace) { - /* Fill the buffer completely and process it */ - MEMCPY_BCOPY(&context->s512.buffer[usedspace], data, freespace); - ADDINC128(context->s512.bitcount, freespace << 3); - len -= freespace; - data += freespace; - SHA512_Internal_Transform(context, (const sha_word64*)context->s512.buffer); - } else { - /* The buffer is not yet full */ - MEMCPY_BCOPY(&context->s512.buffer[usedspace], data, len); - ADDINC128(context->s512.bitcount, len << 3); - /* Clean up: */ - usedspace = freespace = 0; - return; - } - } - while (len >= 128) { - /* Process as many complete blocks as we can */ - SHA512_Internal_Transform(context, (const sha_word64*)data); - ADDINC128(context->s512.bitcount, 1024); - len -= 128; - data += 128; - } - if (len > 0) { - /* There's left-overs, so save 'em */ - MEMCPY_BCOPY(context->s512.buffer, data, len); - ADDINC128(context->s512.bitcount, len << 3); - } - /* Clean up: */ - usedspace = freespace = 0; -} - -void SHA512_Internal_Last(SHA_CTX* context) { - unsigned int usedspace; - - usedspace = (unsigned int)((context->s512.bitcount[0] >> 3) % 128); -#if BYTE_ORDER == LITTLE_ENDIAN - /* Convert FROM host byte order */ - REVERSE64(context->s512.bitcount[0],context->s512.bitcount[0]); - REVERSE64(context->s512.bitcount[1],context->s512.bitcount[1]); -#endif - if (usedspace > 0) { - /* Begin padding with a 1 bit: */ - context->s512.buffer[usedspace++] = 0x80; - - if (usedspace <= 112) { - /* Set-up for the last transform: */ - MEMSET_BZERO(&context->s512.buffer[usedspace], 112 - usedspace); - } else { - if (usedspace < 128) { - MEMSET_BZERO(&context->s512.buffer[usedspace], 128 - usedspace); - } - /* Do second-to-last transform: */ - SHA512_Internal_Transform(context, (const sha_word64*)context->s512.buffer); - - /* And set-up for the last transform: */ - MEMSET_BZERO(context->s512.buffer, 112); - } - /* Clean up: */ - usedspace = 0; - } else { - /* Prepare for final transform: */ - MEMSET_BZERO(context->s512.buffer, 112); - - /* Begin padding with a 1 bit: */ - *context->s512.buffer = 0x80; - } - /* Store the length of input data (in bits): */ - MEMCPY_BCOPY(&context->s512.buffer[112], &context->s512.bitcount[1], - sizeof(sha_word64)); - MEMCPY_BCOPY(&context->s512.buffer[120], &context->s512.bitcount[0], - sizeof(sha_word64)); - - /* Final transform: */ - SHA512_Internal_Transform(context, (const sha_word64*)context->s512.buffer); -} - -void SHA512_Final(sha_byte digest[], SHA_CTX* context) { - sha_word64 *d = (sha_word64*)digest; - - /* Sanity check: */ - assert(context != (SHA_CTX*)0); - - /* If no digest buffer is passed, we don't bother doing this: */ - if (digest != (sha_byte*)0) { - SHA512_Internal_Last(context); - - /* Save the hash data for output: */ -#if BYTE_ORDER == LITTLE_ENDIAN - { - /* Convert TO host byte order */ - int j; - for (j = 0; j < (SHA512_DIGEST_LENGTH >> 3); j++) { - REVERSE64(context->s512.state[j],context->s512.state[j]); - *d++ = context->s512.state[j]; - } - } -#else - MEMCPY_BCOPY(d, context->s512.state, SHA512_DIGEST_LENGTH); -#endif - } - - /* Zero out state data */ - MEMSET_BZERO(context, sizeof(*context)); -} - -char *SHA512_End(SHA_CTX* context, char buffer[]) { - sha_byte digest[SHA512_DIGEST_LENGTH], *d = digest; - int i; - - /* Sanity check: */ - assert(context != (SHA_CTX*)0); - - if (buffer != (char*)0) { - SHA512_Final(digest, context); - - for (i = 0; i < SHA512_DIGEST_LENGTH; i++) { - *buffer++ = sha_hex_digits[(*d & 0xf0) >> 4]; - *buffer++ = sha_hex_digits[*d & 0x0f]; - d++; - } - *buffer = (char)0; - } else { - MEMSET_BZERO(context, sizeof(*context)); - } - MEMSET_BZERO(digest, SHA512_DIGEST_LENGTH); - return buffer; -} - -char* SHA512_Data(const sha_byte* data, size_t len, char digest[SHA512_DIGEST_STRING_LENGTH]) { - SHA_CTX context; - - SHA512_Init(&context); - SHA512_Update(&context, data, len); - return SHA512_End(&context, digest); -} - - -/*** SHA-384: *********************************************************/ -void SHA384_Init(SHA_CTX* context) { - SHA512_Internal_Init(context, sha384_initial_hash_value); -} - -void SHA384_Update(SHA_CTX* context, const sha_byte* data, size_t len) { - SHA512_Update(context, data, len); -} - -void SHA384_Final(sha_byte digest[], SHA_CTX* context) { - sha_word64 *d = (sha_word64*)digest; - - /* Sanity check: */ - assert(context != (SHA_CTX*)0); - - /* If no digest buffer is passed, we don't bother doing this: */ - if (digest != (sha_byte*)0) { - SHA512_Internal_Last(context); - - /* Save the hash data for output: */ -#if BYTE_ORDER == LITTLE_ENDIAN - { - /* Convert TO host byte order */ - int j; - for (j = 0; j < (SHA384_DIGEST_LENGTH >> 3); j++) { - REVERSE64(context->s512.state[j],context->s512.state[j]); - *d++ = context->s512.state[j]; - } - } -#else - MEMCPY_BCOPY(d, context->s512.state, SHA384_DIGEST_LENGTH); -#endif - } - - /* Zero out state data */ - MEMSET_BZERO(context, sizeof(*context)); -} - -char *SHA384_End(SHA_CTX* context, char buffer[]) { - sha_byte digest[SHA384_DIGEST_LENGTH], *d = digest; - int i; - - /* Sanity check: */ - assert(context != (SHA_CTX*)0); - - if (buffer != (char*)0) { - SHA384_Final(digest, context); - - for (i = 0; i < SHA384_DIGEST_LENGTH; i++) { - *buffer++ = sha_hex_digits[(*d & 0xf0) >> 4]; - *buffer++ = sha_hex_digits[*d & 0x0f]; - d++; - } - *buffer = (char)0; - } else { - MEMSET_BZERO(context, sizeof(*context)); - } - MEMSET_BZERO(digest, SHA384_DIGEST_LENGTH); - return buffer; -} - -char* SHA384_Data(const sha_byte* data, size_t len, char digest[SHA384_DIGEST_STRING_LENGTH]) { - SHA_CTX context; - - SHA384_Init(&context); - SHA384_Update(&context, data, len); - return SHA384_End(&context, digest); -} diff --git a/Source/cm_sha2.h b/Source/cm_sha2.h deleted file mode 100644 index f151031..0000000 --- a/Source/cm_sha2.h +++ /dev/null @@ -1,140 +0,0 @@ -/* - * FILE: sha2.h - * AUTHOR: Aaron D. Gifford - * http://www.aarongifford.com/computers/sha.html - * - * Copyright (c) 2000-2003, Aaron D. Gifford - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holder nor the names of contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTOR(S) ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTOR(S) BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $Id: sha2.h,v 1.4 2004/01/07 19:06:18 adg Exp $ - */ - -#ifndef __SHA2_H__ -#define __SHA2_H__ - -#include "cm_sha2_mangle.h" - -/* CMake modification: use integer types from KWIML. */ -#include -typedef KWIML_INT_uint8_t cm_sha2_uint8_t; -typedef KWIML_INT_uint32_t cm_sha2_uint32_t; -typedef KWIML_INT_uint64_t cm_sha2_uint64_t; - -#ifdef __cplusplus -extern "C" { -#endif - - -/* - * Import u_intXX_t size_t type definitions from system headers. You - * may need to change this, or define these things yourself in this - * file. - */ -#include - -/*** SHA-224/256/384/512 Various Length Definitions *******************/ - -/* Digest lengths for SHA-1/224/256/384/512 */ -#define SHA1_DIGEST_LENGTH 20 -#define SHA1_DIGEST_STRING_LENGTH (SHA1_DIGEST_LENGTH * 2 + 1) -#define SHA224_DIGEST_LENGTH 28 -#define SHA224_DIGEST_STRING_LENGTH (SHA224_DIGEST_LENGTH * 2 + 1) -#define SHA256_DIGEST_LENGTH 32 -#define SHA256_DIGEST_STRING_LENGTH (SHA256_DIGEST_LENGTH * 2 + 1) -#define SHA384_DIGEST_LENGTH 48 -#define SHA384_DIGEST_STRING_LENGTH (SHA384_DIGEST_LENGTH * 2 + 1) -#define SHA512_DIGEST_LENGTH 64 -#define SHA512_DIGEST_STRING_LENGTH (SHA512_DIGEST_LENGTH * 2 + 1) - - -/*** SHA-224/256/384/512 Context Structures ***************************/ - -typedef union _SHA_CTX { - /* SHA-1 uses this part of the union: */ - struct { - cm_sha2_uint32_t state[5]; - cm_sha2_uint64_t bitcount; - cm_sha2_uint8_t buffer[64]; - } s1; - - /* SHA-224 and SHA-256 use this part of the union: */ - struct { - cm_sha2_uint32_t state[8]; - cm_sha2_uint64_t bitcount; - cm_sha2_uint8_t buffer[64]; - } s256; - - /* SHA-384 and SHA-512 use this part of the union: */ - struct { - cm_sha2_uint64_t state[8]; - cm_sha2_uint64_t bitcount[2]; - cm_sha2_uint8_t buffer[128]; - } s512; -} SHA_CTX; - -/*** SHA-256/384/512 Function Prototypes ******************************/ - -void SHA1_Init(SHA_CTX*); -void SHA1_Update(SHA_CTX*, const cm_sha2_uint8_t*, size_t); -void SHA1_Final(cm_sha2_uint8_t[SHA1_DIGEST_LENGTH], SHA_CTX*); -char* SHA1_End(SHA_CTX*, char[SHA1_DIGEST_STRING_LENGTH]); -char* SHA1_Data(const cm_sha2_uint8_t*, size_t, - char[SHA1_DIGEST_STRING_LENGTH]); - -void SHA224_Init(SHA_CTX*); -void SHA224_Update(SHA_CTX*, const cm_sha2_uint8_t*, size_t); -void SHA224_Final(cm_sha2_uint8_t[SHA224_DIGEST_LENGTH], SHA_CTX*); -char* SHA224_End(SHA_CTX*, char[SHA224_DIGEST_STRING_LENGTH]); -char* SHA224_Data(const cm_sha2_uint8_t*, size_t, - char[SHA224_DIGEST_STRING_LENGTH]); - -void SHA256_Init(SHA_CTX*); -void SHA256_Update(SHA_CTX*, const cm_sha2_uint8_t*, size_t); -void SHA256_Final(cm_sha2_uint8_t[SHA256_DIGEST_LENGTH], SHA_CTX*); -char* SHA256_End(SHA_CTX*, char[SHA256_DIGEST_STRING_LENGTH]); -char* SHA256_Data(const cm_sha2_uint8_t*, size_t, - char[SHA256_DIGEST_STRING_LENGTH]); - -void SHA384_Init(SHA_CTX*); -void SHA384_Update(SHA_CTX*, const cm_sha2_uint8_t*, size_t); -void SHA384_Final(cm_sha2_uint8_t[SHA384_DIGEST_LENGTH], SHA_CTX*); -char* SHA384_End(SHA_CTX*, char[SHA384_DIGEST_STRING_LENGTH]); -char* SHA384_Data(const cm_sha2_uint8_t*, size_t, - char[SHA384_DIGEST_STRING_LENGTH]); - -void SHA512_Init(SHA_CTX*); -void SHA512_Update(SHA_CTX*, const cm_sha2_uint8_t*, size_t); -void SHA512_Final(cm_sha2_uint8_t[SHA512_DIGEST_LENGTH], SHA_CTX*); -char* SHA512_End(SHA_CTX*, char[SHA512_DIGEST_STRING_LENGTH]); -char* SHA512_Data(const cm_sha2_uint8_t*, size_t, - char[SHA512_DIGEST_STRING_LENGTH]); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __SHA2_H__ */ diff --git a/Source/cm_sha2_mangle.h b/Source/cm_sha2_mangle.h deleted file mode 100644 index 3dce819..0000000 --- a/Source/cm_sha2_mangle.h +++ /dev/null @@ -1,42 +0,0 @@ -/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying - file Copyright.txt or https://cmake.org/licensing for details. */ -#ifndef cm_sha2_mangle_h -#define cm_sha2_mangle_h - -/* Mangle sha2 symbol names to avoid possible conflict with - implementations in other libraries to which CMake links. */ -#define SHA1_Data cmSHA1_Data -#define SHA1_End cmSHA1_End -#define SHA1_Final cmSHA1_Final -#define SHA1_Init cmSHA1_Init -#define SHA1_Internal_Transform cmSHA1_Internal_Transform -#define SHA1_Update cmSHA1_Update -#define SHA224_Data cmSHA224_Data -#define SHA224_End cmSHA224_End -#define SHA224_Final cmSHA224_Final -#define SHA224_Init cmSHA224_Init -#define SHA224_Internal_Transform cmSHA224_Internal_Transform -#define SHA224_Update cmSHA224_Update -#define SHA256_Data cmSHA256_Data -#define SHA256_End cmSHA256_End -#define SHA256_Final cmSHA256_Final -#define SHA256_Init cmSHA256_Init -#define SHA256_Internal_Init cmSHA256_Internal_Init -#define SHA256_Internal_Last cmSHA256_Internal_Last -#define SHA256_Internal_Transform cmSHA256_Internal_Transform -#define SHA256_Update cmSHA256_Update -#define SHA384_Data cmSHA384_Data -#define SHA384_End cmSHA384_End -#define SHA384_Final cmSHA384_Final -#define SHA384_Init cmSHA384_Init -#define SHA384_Update cmSHA384_Update -#define SHA512_Data cmSHA512_Data -#define SHA512_End cmSHA512_End -#define SHA512_Final cmSHA512_Final -#define SHA512_Init cmSHA512_Init -#define SHA512_Internal_Init cmSHA512_Internal_Init -#define SHA512_Internal_Last cmSHA512_Internal_Last -#define SHA512_Internal_Transform cmSHA512_Internal_Transform -#define SHA512_Update cmSHA512_Update - -#endif diff --git a/Utilities/Scripts/clang-format.bash b/Utilities/Scripts/clang-format.bash index ad3b3a1..8e07c99 100755 --- a/Utilities/Scripts/clang-format.bash +++ b/Utilities/Scripts/clang-format.bash @@ -121,7 +121,7 @@ $git_ls -z -- '*.c' '*.cc' '*.cpp' '*.cxx' '*.h' '*.hh' '*.hpp' '*.hxx' | egrep -z -v '^Source/cmListFileLexer(\.in\.l|\.c)' | # Exclude third-party sources. - egrep -z -v '^Source/(cm_sha2|bindexplib)' | + egrep -z -v '^Source/bindexplib' | egrep -z -v '^Source/(kwsys|CursesDialog/form)/' | egrep -z -v '^Utilities/(KW|cm).*/' | https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=dfff0d5c4af796e2e5869bc2bb65d7d23cfbdd78 commit dfff0d5c4af796e2e5869bc2bb65d7d23cfbdd78 Author: Brad King AuthorDate: Thu Nov 3 13:21:41 2016 -0400 Commit: Brad King CommitDate: Thu Nov 3 14:07:48 2016 -0400 Port hash computation to cmCryptoHash Avoid using KWSys MD5 or `cm_sha2` and use the `cmCryptoHash` abstraction instead. diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.cxx b/Source/CPack/WiX/cmCPackWIXGenerator.cxx index 4c8abd9..0c4f573 100644 --- a/Source/CPack/WiX/cmCPackWIXGenerator.cxx +++ b/Source/CPack/WiX/cmCPackWIXGenerator.cxx @@ -1060,8 +1060,8 @@ std::string cmCPackWIXGenerator::CreateNewIdForPath(std::string const& path) std::string cmCPackWIXGenerator::CreateHashedId( std::string const& path, std::string const& normalizedFilename) { - CM_AUTO_PTR sha1 = cmCryptoHash::New("SHA1"); - std::string hash = sha1->HashString(path.c_str()); + cmCryptoHash sha1(cmCryptoHash::AlgoSHA1); + std::string const hash = sha1.HashString(path); std::string identifier; identifier += hash.substr(0, 7) + "_"; diff --git a/Source/CTest/cmCTestLaunch.cxx b/Source/CTest/cmCTestLaunch.cxx index 224681a..f7a6e0b 100644 --- a/Source/CTest/cmCTestLaunch.cxx +++ b/Source/CTest/cmCTestLaunch.cxx @@ -4,6 +4,7 @@ #include +#include "cmCryptoHash.h" #include "cmGeneratedFileStream.h" #include "cmGlobalGenerator.h" #include "cmMakefile.h" @@ -14,7 +15,6 @@ #include #include -#include #include #include #include @@ -167,17 +167,14 @@ void cmCTestLaunch::ComputeFileNames() // We hash the input command working dir and command line to obtain // a repeatable and (probably) unique name for log files. - char hash[32]; - cmsysMD5* md5 = cmsysMD5_New(); - cmsysMD5_Initialize(md5); - cmsysMD5_Append(md5, (unsigned char const*)(this->CWD.c_str()), -1); + cmCryptoHash md5(cmCryptoHash::AlgoMD5); + md5.Initialize(); + md5.Append(this->CWD); for (std::vector::const_iterator ai = this->RealArgs.begin(); ai != this->RealArgs.end(); ++ai) { - cmsysMD5_Append(md5, (unsigned char const*)ai->c_str(), -1); + md5.Append(*ai); } - cmsysMD5_FinalizeHex(md5, hash); - cmsysMD5_Delete(md5); - this->LogHash.assign(hash, 32); + this->LogHash = md5.FinalizeHex(); // We store stdout and stderr in temporary log files. this->LogOut = this->LogDir; diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index 1bade57..615bd23 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -2553,7 +2553,8 @@ bool cmFileCommand::HandleDownloadCommand(std::vector const& args) this->SetError("DOWNLOAD missing sum value for EXPECTED_MD5."); return false; } - hash = CM_AUTO_PTR(cmCryptoHash::New("MD5")); + hash = + CM_AUTO_PTR(new cmCryptoHash(cmCryptoHash::AlgoMD5)); hashMatchMSG = "MD5 sum"; expectedHash = cmSystemTools::LowerCase(*i); } else if (*i == "SHOW_PROGRESS") { diff --git a/Source/cmFilePathUuid.cxx b/Source/cmFilePathUuid.cxx index ad434e3..03d2524 100644 --- a/Source/cmFilePathUuid.cxx +++ b/Source/cmFilePathUuid.cxx @@ -107,8 +107,8 @@ std::string cmFilePathUuid::GetChecksumString( { // Calculate the file ( seed + relative path + name ) checksum std::vector hashBytes = - cmCryptoHash::New("SHA256")->ByteHashString( - sourceRelSeed + sourceRelPath + sourceFilename); + cmCryptoHash(cmCryptoHash::AlgoSHA256) + .ByteHashString(sourceRelSeed + sourceRelPath + sourceFilename); checksumBase32 = cmBase32Encoder().encodeString(&hashBytes[0], hashBytes.size(), false); diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index cf51c6a..42e9df1 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -44,9 +44,9 @@ #include #if defined(CMAKE_BUILD_WITH_CMAKE) +#include "cmCryptoHash.h" #include #include -#include #endif class cmInstalledFile; @@ -2616,14 +2616,9 @@ void cmGlobalGenerator::AddRuleHash(const std::vector& outputs, // Compute a hash of the rule. RuleHash hash; { - unsigned char const* data = - reinterpret_cast(content.c_str()); - int length = static_cast(content.length()); - cmsysMD5* sum = cmsysMD5_New(); - cmsysMD5_Initialize(sum); - cmsysMD5_Append(sum, data, length); - cmsysMD5_FinalizeHex(sum, hash.Data); - cmsysMD5_Delete(sum); + cmCryptoHash md5(cmCryptoHash::AlgoMD5); + std::string const md5_hex = md5.HashString(content); + memcpy(hash.Data, md5_hex.c_str(), 32); } // Shorten the output name (in expected use case). diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 4aecb1d..434cb10 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -26,7 +26,7 @@ #if defined(CMAKE_BUILD_WITH_CMAKE) #define CM_LG_ENCODE_OBJECT_NAMES -#include +#include "cmCryptoHash.h" #endif #include @@ -2001,17 +2001,6 @@ void cmLocalGenerator::GenerateTargetInstallRules( } #if defined(CM_LG_ENCODE_OBJECT_NAMES) -static std::string cmLocalGeneratorMD5(const char* input) -{ - char md5out[32]; - cmsysMD5* md5 = cmsysMD5_New(); - cmsysMD5_Initialize(md5); - cmsysMD5_Append(md5, reinterpret_cast(input), -1); - cmsysMD5_FinalizeHex(md5, md5out); - cmsysMD5_Delete(md5); - return std::string(md5out, 32); -} - static bool cmLocalGeneratorShortenObjectName(std::string& objName, std::string::size_type max_len) { @@ -2020,7 +2009,8 @@ static bool cmLocalGeneratorShortenObjectName(std::string& objName, std::string::size_type pos = objName.find('/', objName.size() - max_len + 32); if (pos != objName.npos) { - std::string md5name = cmLocalGeneratorMD5(objName.substr(0, pos).c_str()); + cmCryptoHash md5(cmCryptoHash::AlgoMD5); + std::string md5name = md5.HashString(objName.substr(0, pos)); md5name += objName.substr(pos); objName = md5name; diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 27fecdf..7738ab6 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -847,8 +847,8 @@ bool cmSystemTools::RenameFile(const char* oldname, const char* newname) bool cmSystemTools::ComputeFileMD5(const std::string& source, char* md5out) { #if defined(CMAKE_BUILD_WITH_CMAKE) - CM_AUTO_PTR md5 = cmCryptoHash::New("MD5"); - std::string str = md5->HashFile(source); + cmCryptoHash md5(cmCryptoHash::AlgoMD5); + std::string const str = md5.HashFile(source); strncpy(md5out, str.c_str(), 32); return !str.empty(); #else @@ -863,8 +863,8 @@ bool cmSystemTools::ComputeFileMD5(const std::string& source, char* md5out) std::string cmSystemTools::ComputeStringMD5(const std::string& input) { #if defined(CMAKE_BUILD_WITH_CMAKE) - CM_AUTO_PTR md5 = cmCryptoHash::New("MD5"); - return md5->HashString(input); + cmCryptoHash md5(cmCryptoHash::AlgoMD5); + return md5.HashString(input); #else (void)input; cmSystemTools::Message("md5sum not supported in bootstrapping mode", diff --git a/Source/cmUuid.cxx b/Source/cmUuid.cxx index 904bcbb..201e1cc 100644 --- a/Source/cmUuid.cxx +++ b/Source/cmUuid.cxx @@ -2,9 +2,8 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmUuid.h" -#include "cm_sha2.h" +#include "cmCryptoHash.h" -#include #include cmUuid::cmUuid() @@ -22,16 +21,12 @@ std::string cmUuid::FromMd5(std::vector const& uuidNamespace, std::vector hashInput; this->CreateHashInput(uuidNamespace, name, hashInput); - cmsysMD5_s* md5 = cmsysMD5_New(); - cmsysMD5_Initialize(md5); - cmsysMD5_Append(md5, &hashInput[0], int(hashInput.size())); + cmCryptoHash md5(cmCryptoHash::AlgoMD5); + md5.Initialize(); + md5.Append(&hashInput[0], hashInput.size()); + std::vector digest = md5.Finalize(); - unsigned char digest[16] = { 0 }; - cmsysMD5_Finalize(md5, digest); - - cmsysMD5_Delete(md5); - - return this->FromDigest(digest, 3); + return this->FromDigest(&digest[0], 3); } std::string cmUuid::FromSha1(std::vector const& uuidNamespace, @@ -40,16 +35,12 @@ std::string cmUuid::FromSha1(std::vector const& uuidNamespace, std::vector hashInput; this->CreateHashInput(uuidNamespace, name, hashInput); - SHA_CTX* sha = new SHA_CTX; - SHA1_Init(sha); - SHA1_Update(sha, &hashInput[0], hashInput.size()); - - unsigned char digest[SHA1_DIGEST_LENGTH] = { 0 }; - SHA1_Final(digest, sha); - - delete sha; + cmCryptoHash sha1(cmCryptoHash::AlgoSHA1); + sha1.Initialize(); + sha1.Append(&hashInput[0], hashInput.size()); + std::vector digest = sha1.Finalize(); - return this->FromDigest(digest, 5); + return this->FromDigest(&digest[0], 5); } void cmUuid::CreateHashInput(std::vector const& uuidNamespace, https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=032312e95d5f799d77789faa57c657b6be409f6a commit 032312e95d5f799d77789faa57c657b6be409f6a Author: Brad King AuthorDate: Thu Nov 3 11:33:43 2016 -0400 Commit: Brad King CommitDate: Thu Nov 3 14:07:48 2016 -0400 cmCryptoHash: Re-implement in terms of librhash Offer direct construction with an enumeration of supported algorithms. Also expose the Initialize/Append/Finalize steps publicly and add a FinalizeHex method. diff --git a/Source/cmCryptoHash.cxx b/Source/cmCryptoHash.cxx index 9b3f84a..f440999 100644 --- a/Source/cmCryptoHash.cxx +++ b/Source/cmCryptoHash.cxx @@ -2,31 +2,62 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCryptoHash.h" -#include "cm_sha2.h" - +#include +#include #include -#include #include +static unsigned int const cmCryptoHashAlgoToId[] = { + /* clang-format needs this comment to break after the opening brace */ + RHASH_MD5, // + RHASH_SHA1, // + RHASH_SHA224, // + RHASH_SHA256, // + RHASH_SHA384, // + RHASH_SHA512 +}; + +static int cmCryptoHash_rhash_library_initialized; + +static rhash cmCryptoHash_rhash_init(unsigned int id) +{ + if (!cmCryptoHash_rhash_library_initialized) { + cmCryptoHash_rhash_library_initialized = 1; + rhash_library_init(); + } + return rhash_init(id); +} + +cmCryptoHash::cmCryptoHash(Algo algo) + : Id(cmCryptoHashAlgoToId[algo]) + , CTX(cmCryptoHash_rhash_init(Id)) +{ +} + +cmCryptoHash::~cmCryptoHash() +{ + rhash_free(this->CTX); +} + CM_AUTO_PTR cmCryptoHash::New(const char* algo) { if (strcmp(algo, "MD5") == 0) { - return CM_AUTO_PTR(new cmCryptoHashMD5); + return CM_AUTO_PTR(new cmCryptoHash(AlgoMD5)); } if (strcmp(algo, "SHA1") == 0) { - return CM_AUTO_PTR(new cmCryptoHashSHA1); + return CM_AUTO_PTR(new cmCryptoHash(AlgoSHA1)); } if (strcmp(algo, "SHA224") == 0) { - return CM_AUTO_PTR(new cmCryptoHashSHA224); + return CM_AUTO_PTR(new cmCryptoHash(AlgoSHA224)); } if (strcmp(algo, "SHA256") == 0) { - return CM_AUTO_PTR(new cmCryptoHashSHA256); + return CM_AUTO_PTR(new cmCryptoHash(AlgoSHA256)); } if (strcmp(algo, "SHA384") == 0) { - return CM_AUTO_PTR(new cmCryptoHashSHA384); + return CM_AUTO_PTR(new cmCryptoHash(AlgoSHA384)); } if (strcmp(algo, "SHA512") == 0) { - return CM_AUTO_PTR(new cmCryptoHashSHA512); + return CM_AUTO_PTR(new cmCryptoHash(AlgoSHA512)); } return CM_AUTO_PTR(CM_NULLPTR); } @@ -80,7 +111,7 @@ std::vector cmCryptoHash::ByteHashFile(const std::string& file) this->Initialize(); { // Should be efficient enough on most system: - cm_sha2_uint64_t buffer[512]; + KWIML_INT_uint64_t buffer[512]; char* buffer_c = reinterpret_cast(buffer); unsigned char const* buffer_uc = reinterpret_cast(buffer); @@ -117,51 +148,29 @@ std::string cmCryptoHash::HashFile(const std::string& file) return ByteHashToString(this->ByteHashFile(file)); } -cmCryptoHashMD5::cmCryptoHashMD5() - : MD5(cmsysMD5_New()) +void cmCryptoHash::Initialize() { + rhash_reset(this->CTX); } -cmCryptoHashMD5::~cmCryptoHashMD5() +void cmCryptoHash::Append(void const* buf, size_t sz) { - cmsysMD5_Delete(this->MD5); + rhash_update(this->CTX, buf, sz); } -void cmCryptoHashMD5::Initialize() +void cmCryptoHash::Append(std::string const& str) { - cmsysMD5_Initialize(this->MD5); + this->Append(str.c_str(), str.size()); } -void cmCryptoHashMD5::Append(unsigned char const* buf, int sz) +std::vector cmCryptoHash::Finalize() { - cmsysMD5_Append(this->MD5, buf, sz); + std::vector hash(rhash_get_digest_size(this->Id), 0); + rhash_final(this->CTX, &hash[0]); + return hash; } -std::vector cmCryptoHashMD5::Finalize() +std::string cmCryptoHash::FinalizeHex() { - std::vector hash(16, 0); - cmsysMD5_Finalize(this->MD5, &hash[0]); - return hash; + return cmCryptoHash::ByteHashToString(this->Finalize()); } - -#define cmCryptoHash_SHA_CLASS_IMPL(SHA) \ - cmCryptoHash##SHA::cmCryptoHash##SHA() \ - : SHA(new SHA_CTX) \ - { \ - } \ - cmCryptoHash##SHA::~cmCryptoHash##SHA() { delete this->SHA; } \ - void cmCryptoHash##SHA::Initialize() { SHA##_Init(this->SHA); } \ - void cmCryptoHash##SHA::Append(unsigned char const* buf, int sz) \ - { \ - SHA##_Update(this->SHA, buf, sz); \ - } \ - std::vector cmCryptoHash##SHA::Finalize() \ - { \ - std::vector hash(SHA##_DIGEST_LENGTH, 0); \ - SHA##_Final(&hash[0], this->SHA); \ - return hash; \ - } - -cmCryptoHash_SHA_CLASS_IMPL(SHA1) cmCryptoHash_SHA_CLASS_IMPL(SHA224) - cmCryptoHash_SHA_CLASS_IMPL(SHA256) cmCryptoHash_SHA_CLASS_IMPL(SHA384) - cmCryptoHash_SHA_CLASS_IMPL(SHA512) diff --git a/Source/cmCryptoHash.h b/Source/cmCryptoHash.h index 5c2d3ca..95080ac 100644 --- a/Source/cmCryptoHash.h +++ b/Source/cmCryptoHash.h @@ -15,7 +15,18 @@ class cmCryptoHash { public: - virtual ~cmCryptoHash() {} + enum Algo + { + AlgoMD5, + AlgoSHA1, + AlgoSHA224, + AlgoSHA256, + AlgoSHA384, + AlgoSHA512 + }; + + cmCryptoHash(Algo algo); + ~cmCryptoHash(); /// @brief Returns a new hash generator of the requested type /// @arg algo Hash type name. Supported hash types are @@ -53,47 +64,15 @@ public: /// An empty string otherwise. std::string HashFile(const std::string& file); -protected: - virtual void Initialize() = 0; - virtual void Append(unsigned char const*, int) = 0; - virtual std::vector Finalize() = 0; -}; - -class cmCryptoHashMD5 : public cmCryptoHash -{ - struct cmsysMD5_s* MD5; - -public: - cmCryptoHashMD5(); - ~cmCryptoHashMD5() CM_OVERRIDE; + void Initialize(); + void Append(void const*, size_t); + void Append(std::string const& str); + std::vector Finalize(); + std::string FinalizeHex(); -protected: - void Initialize() CM_OVERRIDE; - void Append(unsigned char const* buf, int sz) CM_OVERRIDE; - std::vector Finalize() CM_OVERRIDE; +private: + unsigned int Id; + struct rhash_context* CTX; }; -#define cmCryptoHash_SHA_CLASS_DECL(SHA) \ - class cmCryptoHash##SHA : public cmCryptoHash \ - { \ - union _SHA_CTX* SHA; \ - \ - public: \ - cmCryptoHash##SHA(); \ - ~cmCryptoHash##SHA(); \ - \ - protected: \ - virtual void Initialize(); \ - virtual void Append(unsigned char const* buf, int sz); \ - virtual std::vector Finalize(); \ - } - -cmCryptoHash_SHA_CLASS_DECL(SHA1); -cmCryptoHash_SHA_CLASS_DECL(SHA224); -cmCryptoHash_SHA_CLASS_DECL(SHA256); -cmCryptoHash_SHA_CLASS_DECL(SHA384); -cmCryptoHash_SHA_CLASS_DECL(SHA512); - -#undef cmCryptoHash_SHA_CLASS_DECL - #endif https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=72b9bf5cf8e2df6fb5290afb7c2825ec54c59640 commit 72b9bf5cf8e2df6fb5290afb7c2825ec54c59640 Author: Brad King AuthorDate: Thu Nov 3 11:30:09 2016 -0400 Commit: Brad King CommitDate: Thu Nov 3 14:07:48 2016 -0400 cmCryptoHash: Avoid using subclasses at client sites Use only the main `cmCryptoHash` interface. diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 0a3a1ab..27fecdf 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -847,8 +847,8 @@ bool cmSystemTools::RenameFile(const char* oldname, const char* newname) bool cmSystemTools::ComputeFileMD5(const std::string& source, char* md5out) { #if defined(CMAKE_BUILD_WITH_CMAKE) - cmCryptoHashMD5 md5; - std::string str = md5.HashFile(source); + CM_AUTO_PTR md5 = cmCryptoHash::New("MD5"); + std::string str = md5->HashFile(source); strncpy(md5out, str.c_str(), 32); return !str.empty(); #else @@ -863,8 +863,8 @@ bool cmSystemTools::ComputeFileMD5(const std::string& source, char* md5out) std::string cmSystemTools::ComputeStringMD5(const std::string& input) { #if defined(CMAKE_BUILD_WITH_CMAKE) - cmCryptoHashMD5 md5; - return md5.HashString(input); + CM_AUTO_PTR md5 = cmCryptoHash::New("MD5"); + return md5->HashString(input); #else (void)input; cmSystemTools::Message("md5sum not supported in bootstrapping mode", https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=56481623c6e615b2c90482dd8b6f880cd571561c commit 56481623c6e615b2c90482dd8b6f880cd571561c Author: Brad King AuthorDate: Thu Nov 3 14:04:59 2016 -0400 Commit: Brad King CommitDate: Thu Nov 3 14:07:47 2016 -0400 librhash: Port to KWIML for ABI and integer type information diff --git a/Utilities/cmlibrhash/librhash/byte_order.h b/Utilities/cmlibrhash/librhash/byte_order.h index 59a6c23..f9a0fb8 100644 --- a/Utilities/cmlibrhash/librhash/byte_order.h +++ b/Utilities/cmlibrhash/librhash/byte_order.h @@ -4,10 +4,6 @@ #include "ustd.h" #include -#ifdef __GLIBC__ -# include -#endif - #ifdef __cplusplus extern "C" { #endif @@ -32,22 +28,12 @@ extern "C" { /* detect CPU endianness */ -#if (defined(__BYTE_ORDER) && defined(__LITTLE_ENDIAN) && \ - __BYTE_ORDER == __LITTLE_ENDIAN) || \ - defined(CPU_IA32) || defined(CPU_X64) || \ - defined(__ia64) || defined(__ia64__) || defined(__alpha__) || defined(_M_ALPHA) || \ - defined(vax) || defined(MIPSEL) || defined(_ARM_) || defined(__arm__) +#include +#if KWIML_ABI_ENDIAN_ID == KWIML_ABI_ENDIAN_ID_LITTLE # define CPU_LITTLE_ENDIAN # define IS_BIG_ENDIAN 0 # define IS_LITTLE_ENDIAN 1 -#elif (defined(__BYTE_ORDER) && defined(__BIG_ENDIAN) && \ - __BYTE_ORDER == __BIG_ENDIAN) || \ - defined(__sparc) || defined(__sparc__) || defined(sparc) || \ - defined(_ARCH_PPC) || defined(_ARCH_PPC64) || defined(_POWER) || \ - defined(__POWERPC__) || defined(POWERPC) || defined(__powerpc) || \ - defined(__powerpc__) || defined(__powerpc64__) || defined(__ppc__) || \ - defined(__hpux) || defined(_MIPSEB) || defined(mc68000) || \ - defined(__s390__) || defined(__s390x__) || defined(sel) +#elif KWIML_ABI_ENDIAN_ID == KWIML_ABI_ENDIAN_ID_BIG # define CPU_BIG_ENDIAN # define IS_BIG_ENDIAN 1 # define IS_LITTLE_ENDIAN 0 diff --git a/Utilities/cmlibrhash/librhash/ustd.h b/Utilities/cmlibrhash/librhash/ustd.h index 5bd9aac..019b931 100644 --- a/Utilities/cmlibrhash/librhash/ustd.h +++ b/Utilities/cmlibrhash/librhash/ustd.h @@ -9,29 +9,31 @@ # pragma warning(push,1) #endif -#if _MSC_VER >= 1300 +#include -# define int64_t __int64 -# define int32_t __int32 -# define int16_t __int16 -# define int8_t __int8 -# define uint64_t unsigned __int64 -# define uint32_t unsigned __int32 -# define uint16_t unsigned __int16 -# define uint8_t unsigned __int8 - -/* disable warnings: The POSIX name for this item is deprecated. Use the ISO C++ conformant name. */ -#pragma warning(disable : 4996) - -#else /* _MSC_VER >= 1300 */ - -# include -# include - -#endif /* _MSC_VER >= 1300 */ - -#if _MSC_VER <= 1300 -# include /* size_t for vc6.0 */ -#endif /* _MSC_VER <= 1300 */ +#ifndef KWIML_INT_HAVE_INT64_T +# define int64_t KWIML_INT_int64_t +#endif +#ifndef KWIML_INT_HAVE_INT32_T +# define int32_t KWIML_INT_int32_t +#endif +#ifndef KWIML_INT_HAVE_INT16_T +# define int16_t KWIML_INT_int16_t +#endif +#ifndef KWIML_INT_HAVE_INT8_T +# define int8_t KWIML_INT_int8_t +#endif +#ifndef KWIML_INT_HAVE_UINT64_T +# define uint64_t KWIML_INT_uint64_t +#endif +#ifndef KWIML_INT_HAVE_UINT32_T +# define uint32_t KWIML_INT_uint32_t +#endif +#ifndef KWIML_INT_HAVE_UINT16_T +# define uint16_t KWIML_INT_uint16_t +#endif +#ifndef KWIML_INT_HAVE_UINT8_T +# define uint8_t KWIML_INT_uint8_t +#endif #endif /* LIBRHASH_USTD_H */ https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=956d93a5f04bebe404b228771c87059fa1efe261 commit 956d93a5f04bebe404b228771c87059fa1efe261 Author: Brad King AuthorDate: Thu Nov 3 11:26:24 2016 -0400 Commit: Brad King CommitDate: Thu Nov 3 13:47:01 2016 -0400 librhash: Install COPYING file with CMake documentation When we install using the bundled librhash source, notify users of its license terms. diff --git a/Utilities/cmlibrhash/CMakeLists.txt b/Utilities/cmlibrhash/CMakeLists.txt index 968a792..340d946 100644 --- a/Utilities/cmlibrhash/CMakeLists.txt +++ b/Utilities/cmlibrhash/CMakeLists.txt @@ -34,3 +34,5 @@ include_directories( ) add_library(cmlibrhash ${librhash_sources}) + +install(FILES COPYING README DESTINATION ${CMAKE_DOC_DIR}/cmlibrhash) https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5aebc4aa1bab731194948721301a3ed69daeaa1f commit 5aebc4aa1bab731194948721301a3ed69daeaa1f Author: Brad King AuthorDate: Thu Nov 3 11:23:36 2016 -0400 Commit: Brad King CommitDate: Thu Nov 3 13:47:01 2016 -0400 librhash: Disable warnings to avoid changing 3rd party code Add '-w' or equivalent flag on compilers supporting it. Tell MSVC to use its lowest warning level inside librhash sources. diff --git a/Utilities/cmlibrhash/CMakeLists.txt b/Utilities/cmlibrhash/CMakeLists.txt index 47d069a..968a792 100644 --- a/Utilities/cmlibrhash/CMakeLists.txt +++ b/Utilities/cmlibrhash/CMakeLists.txt @@ -1,5 +1,13 @@ project(librhash C) +# Disable warnings to avoid changing 3rd party code. +if(CMAKE_C_COMPILER_ID MATCHES + "^(GNU|Clang|AppleClang|XL|VisualAge|SunPro|MIPSpro|HP|Intel)$") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w") +elseif(CMAKE_C_COMPILER_ID STREQUAL "PathScale") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -woffall") +endif() + set(librhash_sources librhash/algorithms.c librhash/algorithms.h diff --git a/Utilities/cmlibrhash/librhash/ustd.h b/Utilities/cmlibrhash/librhash/ustd.h index 38c4e3e..5bd9aac 100644 --- a/Utilities/cmlibrhash/librhash/ustd.h +++ b/Utilities/cmlibrhash/librhash/ustd.h @@ -5,6 +5,10 @@ /* Include KWSys Large File Support configuration. */ #include +#if defined(_MSC_VER) +# pragma warning(push,1) +#endif + #if _MSC_VER >= 1300 # define int64_t __int64 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=77a96b0cb74c0d040be232370356fea0a1257578 commit 77a96b0cb74c0d040be232370356fea0a1257578 Author: Brad King AuthorDate: Thu Nov 3 11:18:37 2016 -0400 Commit: Brad King CommitDate: Thu Nov 3 13:46:54 2016 -0400 librhash: Build the library within CMake Update `ustd.h` to include KWSys Large File Support configuration so that consistent stream libraries are used (on AIX with XL). Add a `cm_rhash.h` header to include the CMake-provided copy of the `rhash.h` header from CMake sources. diff --git a/CMakeLists.txt b/CMakeLists.txt index a5702e1..82a34d3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -298,6 +298,10 @@ macro (CMAKE_BUILD_UTILITIES) add_subdirectory(Utilities/KWIML) endif() + set(CMAKE_LIBRHASH_LIBRARIES cmlibrhash) + add_subdirectory(Utilities/cmlibrhash) + CMAKE_SET_TARGET_FOLDER(cmlibrhash "Utilities/3rdParty") + #--------------------------------------------------------------------- # Build zlib library for Curl, CMake, and CTest. set(CMAKE_ZLIB_HEADER "cm_zlib.h") diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index cf9dbb8..879272c 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -788,6 +788,7 @@ target_link_libraries(CMakeLib cmsys ${CMAKE_CURL_LIBRARIES} ${CMAKE_JSONCPP_LIBRARIES} ${CMAKE_LIBUV_LIBRARIES} + ${CMAKE_LIBRHASH_LIBRARIES} ${CMake_KWIML_LIBRARIES} ) diff --git a/Utilities/cm_rhash.h b/Utilities/cm_rhash.h new file mode 100644 index 0000000..23d5409 --- /dev/null +++ b/Utilities/cm_rhash.h @@ -0,0 +1,8 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ +#ifndef cm_rhash_h +#define cm_rhash_h + +#include + +#endif diff --git a/Utilities/cmlibrhash/CMakeLists.txt b/Utilities/cmlibrhash/CMakeLists.txt new file mode 100644 index 0000000..47d069a --- /dev/null +++ b/Utilities/cmlibrhash/CMakeLists.txt @@ -0,0 +1,28 @@ +project(librhash C) + +set(librhash_sources + librhash/algorithms.c + librhash/algorithms.h + librhash/byte_order.c + librhash/byte_order.h + librhash/hex.c + librhash/hex.h + librhash/md5.c + librhash/md5.h + librhash/rhash.c + librhash/rhash.h + librhash/sha1.c + librhash/sha1.h + librhash/sha256.c + librhash/sha256.h + librhash/sha512.c + librhash/sha512.h + librhash/ustd.h + librhash/util.h + ) + +include_directories( + ${KWSYS_HEADER_ROOT} + ) + +add_library(cmlibrhash ${librhash_sources}) diff --git a/Utilities/cmlibrhash/librhash/ustd.h b/Utilities/cmlibrhash/librhash/ustd.h index 94f1ae2..38c4e3e 100644 --- a/Utilities/cmlibrhash/librhash/ustd.h +++ b/Utilities/cmlibrhash/librhash/ustd.h @@ -2,6 +2,9 @@ #ifndef LIBRHASH_USTD_H #define LIBRHASH_USTD_H +/* Include KWSys Large File Support configuration. */ +#include + #if _MSC_VER >= 1300 # define int64_t __int64 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b5ae698e7aea15321ee94436cdbec9747e422209 commit b5ae698e7aea15321ee94436cdbec9747e422209 Author: Brad King AuthorDate: Thu Nov 3 11:15:19 2016 -0400 Commit: Brad King CommitDate: Thu Nov 3 13:46:07 2016 -0400 librhash: Remove source fragments not needed for CMake We only need a subset of the hash algorithms supported by librhash. Add preprocessor conditionals to remove source fragments that we do not need. Write an alternative algorithm enumeration that matches the indexing on our reduced array. Also remove a few fragments outright. diff --git a/Utilities/cmlibrhash/README b/Utilities/cmlibrhash/README index 1e51017..4ea492f 100644 --- a/Utilities/cmlibrhash/README +++ b/Utilities/cmlibrhash/README @@ -1,57 +1,3 @@ - === RHash program === - -RHash is a console utility for calculation and verification of magnet links -and a wide range of hash sums like CRC32, MD4, MD5, SHA1, SHA256, SHA512, -SHA3, AICH, ED2K, Tiger, DC++ TTH, BitTorrent BTIH, GOST R 34.11-94, -RIPEMD-160, HAS-160, EDON-R, Whirlpool and Snefru. - -Hash sums are used to ensure and verify integrity of large volumes of data -for a long-term storing or transferring. - -Features: - * Output in a predefined (SFV, BSD-like) or a user-defined format. - * Can calculate Magnet links. - * Updating hash files (adding hash sums of files missing in the hash file). - * Calculates several hash sums in one pass - * Ability to process directories recursively. - * Portability: the program works the same on Linux, *BSD or Windows. - - - === The LibRHash library === - -LibRHash is a professional, portable, thread-safe C library for computing -a wide variety of hash sums, such as CRC32, MD4, MD5, SHA1, SHA256, SHA512, -SHA3, AICH, ED2K, Tiger, DC++ TTH, BitTorrent BTIH, GOST R 34.11-94, -RIPEMD-160, HAS-160, EDON-R, Whirlpool and Snefru. -Hash sums are used to ensure and verify integrity of large volumes of data -for a long-term storing or transferring. - -Features: - * Small and easy to learn interface. - * Hi-level and Low-level API. - * Allows calculating of several hash functions simultaneously. - * Portability: the library works on Linux, *BSD and Windows. - - - === Links === - - * Project Home Page: http://rhash.sourceforge.net/ - * Official Releases: http://sf.net/projects/rhash/files/rhash/ - - * RHash hash functions descriptions http://rhash.anz.ru/hashes.php - * The table of the hash functions supported by RHash - http://sf.net/apps/mediawiki/rhash/index.php?title=Hash_sums - * ECRYPT: The Hash Function Zoo - http://ehash.iaik.tugraz.at/wiki/The_Hash_Function_Zoo - - - === Getting latest source code === - -The latest source code can be obtained from Git repository by command: - - git clone git://github.com/rhash/RHash.git - - === Notes on RHash License === The RHash program and LibRHash library are distributed under RHash License, diff --git a/Utilities/cmlibrhash/librhash/algorithms.c b/Utilities/cmlibrhash/librhash/algorithms.c index 1f343a1..56d20b8 100644 --- a/Utilities/cmlibrhash/librhash/algorithms.c +++ b/Utilities/cmlibrhash/librhash/algorithms.c @@ -22,6 +22,7 @@ #include "algorithms.h" /* header files of all supported hash sums */ +#if 0 #include "aich.h" #include "crc32.h" #include "ed2k.h" @@ -29,17 +30,21 @@ #include "gost.h" #include "has160.h" #include "md4.h" +#endif #include "md5.h" +#if 0 #include "ripemd-160.h" #include "snefru.h" +#endif #include "sha1.h" #include "sha256.h" #include "sha512.h" +#if 0 #include "sha3.h" #include "tiger.h" -#include "torrent.h" #include "tth.h" #include "whirlpool.h" +#endif #ifdef USE_OPENSSL /* note: BTIH and AICH depends on the used SHA1 algorithm */ @@ -66,14 +71,19 @@ unsigned rhash_uninitialized_algorithms = RHASH_NEED_INIT_ALG; rhash_hash_info* rhash_info_table = rhash_hash_info_default; int rhash_info_size = RHASH_HASH_COUNT; +#if 0 static void rhash_crc32_init(uint32_t* crc32); static void rhash_crc32_update(uint32_t* crc32, const unsigned char* msg, size_t size); static void rhash_crc32_final(uint32_t* crc32, unsigned char* result); +#endif +#if 0 rhash_info info_crc32 = { RHASH_CRC32, F_BE32, 4, "CRC32", "crc32" }; rhash_info info_md4 = { RHASH_MD4, F_LE32, 16, "MD4", "md4" }; +#endif rhash_info info_md5 = { RHASH_MD5, F_LE32, 16, "MD5", "md5" }; rhash_info info_sha1 = { RHASH_SHA1, F_BE32, 20, "SHA1", "sha1" }; +#if 0 rhash_info info_tiger = { RHASH_TIGER, F_LE64, 24, "TIGER", "tiger" }; rhash_info info_tth = { RHASH_TTH, F_BS32, 24, "TTH", "tree:tiger" }; rhash_info info_btih = { RHASH_BTIH, 0, 20, "BTIH", "btih" }; @@ -86,16 +96,19 @@ rhash_info info_gostpro = { RHASH_GOST_CRYPTOPRO, F_LE32, 32, "GOST-CRYPTOPRO", rhash_info info_has160 = { RHASH_HAS160, F_LE32, 20, "HAS-160", "has160" }; rhash_info info_snf128 = { RHASH_SNEFRU128, F_BE32, 16, "SNEFRU-128", "snefru128" }; rhash_info info_snf256 = { RHASH_SNEFRU256, F_BE32, 32, "SNEFRU-256", "snefru256" }; +#endif rhash_info info_sha224 = { RHASH_SHA224, F_BE32, 28, "SHA-224", "sha224" }; rhash_info info_sha256 = { RHASH_SHA256, F_BE32, 32, "SHA-256", "sha256" }; rhash_info info_sha384 = { RHASH_SHA384, F_BE64, 48, "SHA-384", "sha384" }; rhash_info info_sha512 = { RHASH_SHA512, F_BE64, 64, "SHA-512", "sha512" }; +#if 0 rhash_info info_edr256 = { RHASH_EDONR256, F_LE32, 32, "EDON-R256", "edon-r256" }; rhash_info info_edr512 = { RHASH_EDONR512, F_LE64, 64, "EDON-R512", "edon-r512" }; rhash_info info_sha3_224 = { RHASH_SHA3_224, F_LE64, 28, "SHA3-224", "sha3-224" }; rhash_info info_sha3_256 = { RHASH_SHA3_256, F_LE64, 32, "SHA3-256", "sha3-256" }; rhash_info info_sha3_384 = { RHASH_SHA3_384, F_LE64, 48, "SHA3-384", "sha3-384" }; rhash_info info_sha3_512 = { RHASH_SHA3_512, F_LE64, 64, "SHA3-512", "sha3-512" }; +#endif /* some helper macros */ #define dgshft(name) (((char*)&((name##_ctx*)0)->hash) - (char*)0) @@ -109,13 +122,15 @@ rhash_info info_sha3_512 = { RHASH_SHA3_512, F_LE64, 64, "SHA3-512", "sha3-512" /* information about all hashes */ rhash_hash_info rhash_hash_info_default[RHASH_HASH_COUNT] = { +#if 0 { &info_crc32, sizeof(uint32_t), 0, iuf(rhash_crc32), 0 }, /* 32 bit */ { &info_md4, sizeof(md4_ctx), dgshft(md4), iuf(rhash_md4), 0 }, /* 128 bit */ +#endif { &info_md5, sizeof(md5_ctx), dgshft(md5), iuf(rhash_md5), 0 }, /* 128 bit */ { &info_sha1, sizeof(sha1_ctx), dgshft(sha1), iuf(rhash_sha1), 0 }, /* 160 bit */ +#if 0 { &info_tiger, sizeof(tiger_ctx), dgshft(tiger), iuf(rhash_tiger), 0 }, /* 192 bit */ { &info_tth, sizeof(tth_ctx), dgshft2(tth, tiger.hash), iuf(rhash_tth), 0 }, /* 192 bit */ - { &info_btih, sizeof(torrent_ctx), dgshft2(torrent, btih), iuf(bt), (pcleanup_t)bt_cleanup }, /* 160 bit */ { &info_ed2k, sizeof(ed2k_ctx), dgshft2(ed2k, md4_context_inner.hash), iuf(rhash_ed2k), 0 }, /* 128 bit */ { &info_aich, sizeof(aich_ctx), dgshft2(aich, sha1_context.hash), iuf(rhash_aich), (pcleanup_t)rhash_aich_cleanup }, /* 160 bit */ { &info_whirlpool, sizeof(whirlpool_ctx), dgshft(whirlpool), iuf(rhash_whirlpool), 0 }, /* 512 bit */ @@ -125,16 +140,19 @@ rhash_hash_info rhash_hash_info_default[RHASH_HASH_COUNT] = { &info_has160, sizeof(has160_ctx), dgshft(has160), iuf(rhash_has160), 0 }, /* 160 bit */ { &info_snf128, sizeof(snefru_ctx), dgshft(snefru), ini(rhash_snefru128), upd(rhash_snefru), fin(rhash_snefru), 0 }, /* 128 bit */ { &info_snf256, sizeof(snefru_ctx), dgshft(snefru), ini(rhash_snefru256), upd(rhash_snefru), fin(rhash_snefru), 0 }, /* 256 bit */ +#endif { &info_sha224, sizeof(sha256_ctx), dgshft(sha256), ini(rhash_sha224), upd(rhash_sha256), fin(rhash_sha256), 0 }, /* 224 bit */ { &info_sha256, sizeof(sha256_ctx), dgshft(sha256), iuf(rhash_sha256), 0 }, /* 256 bit */ { &info_sha384, sizeof(sha512_ctx), dgshft(sha512), ini(rhash_sha384), upd(rhash_sha512), fin(rhash_sha512), 0 }, /* 384 bit */ { &info_sha512, sizeof(sha512_ctx), dgshft(sha512), iuf(rhash_sha512), 0 }, /* 512 bit */ +#if 0 { &info_edr256, sizeof(edonr_ctx), dgshft2(edonr, u.data256.hash) + 32, iuf(rhash_edonr256), 0 }, /* 256 bit */ { &info_edr512, sizeof(edonr_ctx), dgshft2(edonr, u.data512.hash) + 64, iuf(rhash_edonr512), 0 }, /* 512 bit */ { &info_sha3_224, sizeof(sha3_ctx), dgshft(sha3), ini(rhash_sha3_224), upd(rhash_sha3), fin(rhash_sha3), 0 }, /* 224 bit */ { &info_sha3_256, sizeof(sha3_ctx), dgshft(sha3), ini(rhash_sha3_256), upd(rhash_sha3), fin(rhash_sha3), 0 }, /* 256 bit */ { &info_sha3_384, sizeof(sha3_ctx), dgshft(sha3), ini(rhash_sha3_384), upd(rhash_sha3), fin(rhash_sha3), 0 }, /* 384 bit */ { &info_sha3_512, sizeof(sha3_ctx), dgshft(sha3), ini(rhash_sha3_512), upd(rhash_sha3), fin(rhash_sha3), 0 }, /* 512 bit */ +#endif }; /** @@ -156,6 +174,7 @@ void rhash_init_algorithms(unsigned mask) rhash_uninitialized_algorithms = 0; } +#if 0 /* CRC32 helper functions */ /** @@ -198,3 +217,4 @@ static void rhash_crc32_final(uint32_t* crc32, unsigned char* result) result[2] = (unsigned char)(*crc32 >> 8), result[3] = (unsigned char)(*crc32); #endif } +#endif diff --git a/Utilities/cmlibrhash/librhash/byte_order.h b/Utilities/cmlibrhash/librhash/byte_order.h index 77b8bb9..59a6c23 100644 --- a/Utilities/cmlibrhash/librhash/byte_order.h +++ b/Utilities/cmlibrhash/librhash/byte_order.h @@ -4,10 +4,6 @@ #include "ustd.h" #include -#ifdef IN_RHASH -#include "config.h" -#endif - #ifdef __GLIBC__ # include #endif diff --git a/Utilities/cmlibrhash/librhash/rhash.c b/Utilities/cmlibrhash/librhash/rhash.c index 98cf97e..06a5da6 100644 --- a/Utilities/cmlibrhash/librhash/rhash.c +++ b/Utilities/cmlibrhash/librhash/rhash.c @@ -32,8 +32,6 @@ #include "byte_order.h" #include "algorithms.h" -#include "torrent.h" -#include "plug_openssl.h" #include "util.h" #include "hex.h" #include "rhash.h" /* RHash library interface */ @@ -155,8 +153,10 @@ RHASH_API rhash rhash_init(unsigned hash_id) rctx->vector[i].hash_info = info; rctx->vector[i].context = phash_ctx; +#if 0 /* BTIH initialization is complex, save pointer for later */ if ((id & RHASH_BTIH) != 0) rctx->bt_ctx = phash_ctx; +#endif phash_ctx += (info->context_size + 7) & ~7; /* initialize the i-th hash context */ @@ -508,6 +508,7 @@ const rhash_info* rhash_info_by_id(unsigned hash_id) return rhash_info_table[rhash_ctz(hash_id)].info; } +#if 0 /** * Detect default digest output format for given hash algorithm. * @@ -519,6 +520,7 @@ RHASH_API int rhash_is_base32(unsigned hash_id) /* fast method is just to test a bit-mask */ return ((hash_id & (RHASH_TTH | RHASH_AICH)) != 0); } +#endif /** * Returns size of binary digest for given hash algorithm. @@ -572,6 +574,7 @@ RHASH_API const char* rhash_get_magnet_name(unsigned hash_id) return (info ? info->magnet_name : 0); } +#if 0 static size_t rhash_get_magnet_url_size(const char* filepath, rhash context, unsigned hash_mask, int flags) { @@ -682,6 +685,7 @@ RHASH_API size_t rhash_print_magnet(char* output, const char* filepath, return (output - begin); } +#endif /* hash sum output */ @@ -809,47 +813,6 @@ BOOL APIENTRY DllMain(HMODULE hModule, DWORD reason, LPVOID reserved) } #endif -/** - * Process a BitTorrent-related rhash message. - * - * @param msg_id message identifier - * @param bt BitTorrent context - * @param ldata data depending on message - * @param rdata data depending on message - * @return message-specific data - */ -static rhash_uptr_t process_bt_msg(unsigned msg_id, torrent_ctx* bt, rhash_uptr_t ldata, rhash_uptr_t rdata) -{ - if (bt == NULL) return RHASH_ERROR; - - switch (msg_id) { - case RMSG_BT_ADD_FILE: - bt_add_file(bt, (const char*)ldata, *(unsigned long long*)rdata); - break; - case RMSG_BT_SET_OPTIONS: - bt_set_options(bt, (unsigned)ldata); - break; - case RMSG_BT_SET_ANNOUNCE: - bt_add_announce(bt, (const char*)ldata); - break; - case RMSG_BT_SET_PIECE_LENGTH: - bt_set_piece_length(bt, (size_t)ldata); - break; - case RMSG_BT_SET_BATCH_SIZE: - bt_set_piece_length(bt, - bt_default_piece_length(*(unsigned long long*)ldata)); - break; - case RMSG_BT_SET_PROGRAM_NAME: - bt_set_program_name(bt, (const char*)ldata); - break; - case RMSG_BT_GET_TEXT: - return (rhash_uptr_t)bt_get_text(bt, (char**)ldata); - default: - return RHASH_ERROR; /* unknown message */ - } - return 0; -} - #define PVOID2UPTR(p) ((rhash_uptr_t)((char*)p - 0)) /** @@ -902,16 +865,6 @@ RHASH_API rhash_uptr_t rhash_transmit(unsigned msg_id, void* dst, rhash_uptr_t l return rhash_openssl_hash_mask; #endif - /* BitTorrent related messages */ - case RMSG_BT_ADD_FILE: - case RMSG_BT_SET_OPTIONS: - case RMSG_BT_SET_ANNOUNCE: - case RMSG_BT_SET_PIECE_LENGTH: - case RMSG_BT_SET_PROGRAM_NAME: - case RMSG_BT_GET_TEXT: - case RMSG_BT_SET_BATCH_SIZE: - return process_bt_msg(msg_id, (torrent_ctx*)(((rhash_context_ext*)dst)->bt_ctx), ldata, rdata); - default: return RHASH_ERROR; /* unknown message */ } diff --git a/Utilities/cmlibrhash/librhash/rhash.h b/Utilities/cmlibrhash/librhash/rhash.h index 73ee537..2437072 100644 --- a/Utilities/cmlibrhash/librhash/rhash.h +++ b/Utilities/cmlibrhash/librhash/rhash.h @@ -20,6 +20,7 @@ extern "C" { */ enum rhash_ids { +#if 0 RHASH_CRC32 = 0x01, RHASH_MD4 = 0x02, RHASH_MD5 = 0x04, @@ -58,6 +59,22 @@ enum rhash_ids /** The number of supported hash functions */ RHASH_HASH_COUNT = 26 +#else + RHASH_MD5 = 0x01, + RHASH_SHA1 = 0x02, + RHASH_SHA224 = 0x04, + RHASH_SHA256 = 0x08, + RHASH_SHA384 = 0x10, + RHASH_SHA512 = 0x20, + RHASH_ALL_HASHES = + RHASH_MD5 | + RHASH_SHA1 | + RHASH_SHA224 | + RHASH_SHA256 | + RHASH_SHA384 | + RHASH_SHA512, + RHASH_HASH_COUNT = 6 +#endif }; /** @@ -213,18 +230,6 @@ RHASH_API rhash_uptr_t rhash_transmit( #define RMSG_SET_OPENSSL_MASK 10 #define RMSG_GET_OPENSSL_MASK 11 -#define RMSG_BT_ADD_FILE 32 -#define RMSG_BT_SET_OPTIONS 33 -#define RMSG_BT_SET_ANNOUNCE 34 -#define RMSG_BT_SET_PIECE_LENGTH 35 -#define RMSG_BT_SET_PROGRAM_NAME 36 -#define RMSG_BT_GET_TEXT 37 -#define RMSG_BT_SET_BATCH_SIZE 38 - -/* possible BitTorrent options for the RMSG_BT_SET_OPTIONS message */ -#define RHASH_BT_OPT_PRIVATE 1 -#define RHASH_BT_OPT_INFOHASH_ONLY 2 - /* helper macros */ /** Get a pointer to context of the specified hash function */ https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5cb1b345d932d3e0dc34a2d423894a59a6c8db35 commit 5cb1b345d932d3e0dc34a2d423894a59a6c8db35 Merge: 798b0ad 1367fcc Author: Brad King AuthorDate: Thu Nov 3 13:45:29 2016 -0400 Commit: Brad King CommitDate: Thu Nov 3 13:45:29 2016 -0400 Merge branch 'upstream-librhash' into import-librhash * upstream-librhash: librhash 2016-11-01 (d839a1a8) diff --cc Utilities/cmlibrhash/.gitattributes index 0000000,562b12e..562b12e mode 000000,100644..100644 --- a/Utilities/cmlibrhash/.gitattributes +++ b/Utilities/cmlibrhash/.gitattributes diff --cc Utilities/cmlibrhash/COPYING index 0000000,bf65ee1..bf65ee1 mode 000000,100644..100644 --- a/Utilities/cmlibrhash/COPYING +++ b/Utilities/cmlibrhash/COPYING diff --cc Utilities/cmlibrhash/README index 0000000,1e51017..1e51017 mode 000000,100644..100644 --- a/Utilities/cmlibrhash/README +++ b/Utilities/cmlibrhash/README diff --cc Utilities/cmlibrhash/librhash/algorithms.c index 0000000,1f343a1..1f343a1 mode 000000,100644..100644 --- a/Utilities/cmlibrhash/librhash/algorithms.c +++ b/Utilities/cmlibrhash/librhash/algorithms.c diff --cc Utilities/cmlibrhash/librhash/algorithms.h index 0000000,4db2517..4db2517 mode 000000,100644..100644 --- a/Utilities/cmlibrhash/librhash/algorithms.h +++ b/Utilities/cmlibrhash/librhash/algorithms.h diff --cc Utilities/cmlibrhash/librhash/byte_order.c index 0000000,8ce6fc8..8ce6fc8 mode 000000,100644..100644 --- a/Utilities/cmlibrhash/librhash/byte_order.c +++ b/Utilities/cmlibrhash/librhash/byte_order.c diff --cc Utilities/cmlibrhash/librhash/byte_order.h index 0000000,77b8bb9..77b8bb9 mode 000000,100644..100644 --- a/Utilities/cmlibrhash/librhash/byte_order.h +++ b/Utilities/cmlibrhash/librhash/byte_order.h diff --cc Utilities/cmlibrhash/librhash/hex.c index 0000000,c941149..c941149 mode 000000,100644..100644 --- a/Utilities/cmlibrhash/librhash/hex.c +++ b/Utilities/cmlibrhash/librhash/hex.c diff --cc Utilities/cmlibrhash/librhash/hex.h index 0000000,2b365e2..2b365e2 mode 000000,100644..100644 --- a/Utilities/cmlibrhash/librhash/hex.h +++ b/Utilities/cmlibrhash/librhash/hex.h diff --cc Utilities/cmlibrhash/librhash/md5.c index 0000000,0feb090..0feb090 mode 000000,100644..100644 --- a/Utilities/cmlibrhash/librhash/md5.c +++ b/Utilities/cmlibrhash/librhash/md5.c diff --cc Utilities/cmlibrhash/librhash/md5.h index 0000000,1af6f13..1af6f13 mode 000000,100644..100644 --- a/Utilities/cmlibrhash/librhash/md5.h +++ b/Utilities/cmlibrhash/librhash/md5.h diff --cc Utilities/cmlibrhash/librhash/rhash.c index 0000000,98cf97e..98cf97e mode 000000,100644..100644 --- a/Utilities/cmlibrhash/librhash/rhash.c +++ b/Utilities/cmlibrhash/librhash/rhash.c diff --cc Utilities/cmlibrhash/librhash/rhash.h index 0000000,73ee537..73ee537 mode 000000,100644..100644 --- a/Utilities/cmlibrhash/librhash/rhash.h +++ b/Utilities/cmlibrhash/librhash/rhash.h diff --cc Utilities/cmlibrhash/librhash/sha1.c index 0000000,f5a053b..f5a053b mode 000000,100644..100644 --- a/Utilities/cmlibrhash/librhash/sha1.c +++ b/Utilities/cmlibrhash/librhash/sha1.c diff --cc Utilities/cmlibrhash/librhash/sha1.h index 0000000,74b2f94..74b2f94 mode 000000,100644..100644 --- a/Utilities/cmlibrhash/librhash/sha1.h +++ b/Utilities/cmlibrhash/librhash/sha1.h diff --cc Utilities/cmlibrhash/librhash/sha256.c index 0000000,064dfe2..064dfe2 mode 000000,100644..100644 --- a/Utilities/cmlibrhash/librhash/sha256.c +++ b/Utilities/cmlibrhash/librhash/sha256.c diff --cc Utilities/cmlibrhash/librhash/sha256.h index 0000000,f87ebaa..f87ebaa mode 000000,100644..100644 --- a/Utilities/cmlibrhash/librhash/sha256.h +++ b/Utilities/cmlibrhash/librhash/sha256.h diff --cc Utilities/cmlibrhash/librhash/sha512.c index 0000000,a3e681d..a3e681d mode 000000,100644..100644 --- a/Utilities/cmlibrhash/librhash/sha512.c +++ b/Utilities/cmlibrhash/librhash/sha512.c diff --cc Utilities/cmlibrhash/librhash/sha512.h index 0000000,7c689be..7c689be mode 000000,100644..100644 --- a/Utilities/cmlibrhash/librhash/sha512.h +++ b/Utilities/cmlibrhash/librhash/sha512.h diff --cc Utilities/cmlibrhash/librhash/ustd.h index 0000000,94f1ae2..94f1ae2 mode 000000,100644..100644 --- a/Utilities/cmlibrhash/librhash/ustd.h +++ b/Utilities/cmlibrhash/librhash/ustd.h diff --cc Utilities/cmlibrhash/librhash/util.h index 0000000,9f37157..9f37157 mode 000000,100644..100644 --- a/Utilities/cmlibrhash/librhash/util.h +++ b/Utilities/cmlibrhash/librhash/util.h https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1367fccc330b0ff314845aeb3547bbc38486913a commit 1367fccc330b0ff314845aeb3547bbc38486913a Author: librhash upstream AuthorDate: Tue Nov 1 18:21:09 2016 +0300 Commit: Brad King CommitDate: Thu Nov 3 13:45:28 2016 -0400 librhash 2016-11-01 (d839a1a8) Code extracted from: https://github.com/rhash/rhash.git at commit d839a1a853f22b8cfd26c2006ee5481739ea1114 (master). diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..562b12e --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +* -whitespace diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..bf65ee1 --- /dev/null +++ b/COPYING @@ -0,0 +1,15 @@ + + RHash License + +Copyright (c) 2005-2014 Aleksey Kravchenko + +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. + +The Software is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +FOR A PARTICULAR PURPOSE. Use this program at your own risk! diff --git a/README b/README new file mode 100644 index 0000000..1e51017 --- /dev/null +++ b/README @@ -0,0 +1,61 @@ + === RHash program === + +RHash is a console utility for calculation and verification of magnet links +and a wide range of hash sums like CRC32, MD4, MD5, SHA1, SHA256, SHA512, +SHA3, AICH, ED2K, Tiger, DC++ TTH, BitTorrent BTIH, GOST R 34.11-94, +RIPEMD-160, HAS-160, EDON-R, Whirlpool and Snefru. + +Hash sums are used to ensure and verify integrity of large volumes of data +for a long-term storing or transferring. + +Features: + * Output in a predefined (SFV, BSD-like) or a user-defined format. + * Can calculate Magnet links. + * Updating hash files (adding hash sums of files missing in the hash file). + * Calculates several hash sums in one pass + * Ability to process directories recursively. + * Portability: the program works the same on Linux, *BSD or Windows. + + + === The LibRHash library === + +LibRHash is a professional, portable, thread-safe C library for computing +a wide variety of hash sums, such as CRC32, MD4, MD5, SHA1, SHA256, SHA512, +SHA3, AICH, ED2K, Tiger, DC++ TTH, BitTorrent BTIH, GOST R 34.11-94, +RIPEMD-160, HAS-160, EDON-R, Whirlpool and Snefru. +Hash sums are used to ensure and verify integrity of large volumes of data +for a long-term storing or transferring. + +Features: + * Small and easy to learn interface. + * Hi-level and Low-level API. + * Allows calculating of several hash functions simultaneously. + * Portability: the library works on Linux, *BSD and Windows. + + + === Links === + + * Project Home Page: http://rhash.sourceforge.net/ + * Official Releases: http://sf.net/projects/rhash/files/rhash/ + + * RHash hash functions descriptions http://rhash.anz.ru/hashes.php + * The table of the hash functions supported by RHash + http://sf.net/apps/mediawiki/rhash/index.php?title=Hash_sums + * ECRYPT: The Hash Function Zoo + http://ehash.iaik.tugraz.at/wiki/The_Hash_Function_Zoo + + + === Getting latest source code === + +The latest source code can be obtained from Git repository by command: + + git clone git://github.com/rhash/RHash.git + + + === Notes on RHash License === + +The RHash program and LibRHash library are distributed under RHash License, +see the COPYING file for details. In particular, the program, the library +and source code can be used free of charge under the MIT, BSD, GPL, +commercial or freeware license without additional restrictions. In the case +the OSI-approved license is required the MIT license should be used. diff --git a/librhash/algorithms.c b/librhash/algorithms.c new file mode 100644 index 0000000..1f343a1 --- /dev/null +++ b/librhash/algorithms.c @@ -0,0 +1,200 @@ +/* algorithms.c - the algorithms supported by the rhash library + * + * Copyright: 2011-2012 Aleksey Kravchenko + * + * 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. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. Use this program at your own risk! + */ + +#include +#include + +#include "byte_order.h" +#include "rhash.h" +#include "algorithms.h" + +/* header files of all supported hash sums */ +#include "aich.h" +#include "crc32.h" +#include "ed2k.h" +#include "edonr.h" +#include "gost.h" +#include "has160.h" +#include "md4.h" +#include "md5.h" +#include "ripemd-160.h" +#include "snefru.h" +#include "sha1.h" +#include "sha256.h" +#include "sha512.h" +#include "sha3.h" +#include "tiger.h" +#include "torrent.h" +#include "tth.h" +#include "whirlpool.h" + +#ifdef USE_OPENSSL +/* note: BTIH and AICH depends on the used SHA1 algorithm */ +# define NEED_OPENSSL_INIT (RHASH_MD4 | RHASH_MD5 | \ + RHASH_SHA1 | RHASH_SHA224 | RHASH_SHA256 | RHASH_SHA384 | RHASH_SHA512 | \ + RHASH_BTIH | RHASH_AICH | RHASH_RIPEMD160 | RHASH_WHIRLPOOL) +#else +# define NEED_OPENSSL_INIT 0 +#endif /* USE_OPENSSL */ +#ifdef GENERATE_GOST_LOOKUP_TABLE +# define NEED_GOST_INIT (RHASH_GOST | RHASH_GOST_CRYPTOPRO) +#else +# define NEED_GOST_INIT 0 +#endif /* GENERATE_GOST_LOOKUP_TABLE */ +#ifdef GENERATE_CRC32_TABLE +# define NEED_CRC32_INIT RHASH_CRC32 +#else +# define NEED_CRC32_INIT 0 +#endif /* GENERATE_CRC32_TABLE */ + +#define RHASH_NEED_INIT_ALG (NEED_CRC32_INIT | NEED_GOST_INIT | NEED_OPENSSL_INIT) +unsigned rhash_uninitialized_algorithms = RHASH_NEED_INIT_ALG; + +rhash_hash_info* rhash_info_table = rhash_hash_info_default; +int rhash_info_size = RHASH_HASH_COUNT; + +static void rhash_crc32_init(uint32_t* crc32); +static void rhash_crc32_update(uint32_t* crc32, const unsigned char* msg, size_t size); +static void rhash_crc32_final(uint32_t* crc32, unsigned char* result); + +rhash_info info_crc32 = { RHASH_CRC32, F_BE32, 4, "CRC32", "crc32" }; +rhash_info info_md4 = { RHASH_MD4, F_LE32, 16, "MD4", "md4" }; +rhash_info info_md5 = { RHASH_MD5, F_LE32, 16, "MD5", "md5" }; +rhash_info info_sha1 = { RHASH_SHA1, F_BE32, 20, "SHA1", "sha1" }; +rhash_info info_tiger = { RHASH_TIGER, F_LE64, 24, "TIGER", "tiger" }; +rhash_info info_tth = { RHASH_TTH, F_BS32, 24, "TTH", "tree:tiger" }; +rhash_info info_btih = { RHASH_BTIH, 0, 20, "BTIH", "btih" }; +rhash_info info_ed2k = { RHASH_ED2K, F_LE32, 16, "ED2K", "ed2k" }; +rhash_info info_aich = { RHASH_AICH, F_BS32, 20, "AICH", "aich" }; +rhash_info info_whirlpool = { RHASH_WHIRLPOOL, F_BE64, 64, "WHIRLPOOL", "whirlpool" }; +rhash_info info_rmd160 = { RHASH_RIPEMD160, F_LE32, 20, "RIPEMD-160", "ripemd160" }; +rhash_info info_gost = { RHASH_GOST, F_LE32, 32, "GOST", "gost" }; +rhash_info info_gostpro = { RHASH_GOST_CRYPTOPRO, F_LE32, 32, "GOST-CRYPTOPRO", "gost-cryptopro" }; +rhash_info info_has160 = { RHASH_HAS160, F_LE32, 20, "HAS-160", "has160" }; +rhash_info info_snf128 = { RHASH_SNEFRU128, F_BE32, 16, "SNEFRU-128", "snefru128" }; +rhash_info info_snf256 = { RHASH_SNEFRU256, F_BE32, 32, "SNEFRU-256", "snefru256" }; +rhash_info info_sha224 = { RHASH_SHA224, F_BE32, 28, "SHA-224", "sha224" }; +rhash_info info_sha256 = { RHASH_SHA256, F_BE32, 32, "SHA-256", "sha256" }; +rhash_info info_sha384 = { RHASH_SHA384, F_BE64, 48, "SHA-384", "sha384" }; +rhash_info info_sha512 = { RHASH_SHA512, F_BE64, 64, "SHA-512", "sha512" }; +rhash_info info_edr256 = { RHASH_EDONR256, F_LE32, 32, "EDON-R256", "edon-r256" }; +rhash_info info_edr512 = { RHASH_EDONR512, F_LE64, 64, "EDON-R512", "edon-r512" }; +rhash_info info_sha3_224 = { RHASH_SHA3_224, F_LE64, 28, "SHA3-224", "sha3-224" }; +rhash_info info_sha3_256 = { RHASH_SHA3_256, F_LE64, 32, "SHA3-256", "sha3-256" }; +rhash_info info_sha3_384 = { RHASH_SHA3_384, F_LE64, 48, "SHA3-384", "sha3-384" }; +rhash_info info_sha3_512 = { RHASH_SHA3_512, F_LE64, 64, "SHA3-512", "sha3-512" }; + +/* some helper macros */ +#define dgshft(name) (((char*)&((name##_ctx*)0)->hash) - (char*)0) +#define dgshft2(name, field) (((char*)&((name##_ctx*)0)->field) - (char*)0) +#define ini(name) ((pinit_t)(name##_init)) +#define upd(name) ((pupdate_t)(name##_update)) +#define fin(name) ((pfinal_t)(name##_final)) +#define iuf(name) ini(name), upd(name), fin(name) +#define diuf(name) dgshft(name), ini(name), upd(name), fin(name) + +/* information about all hashes */ +rhash_hash_info rhash_hash_info_default[RHASH_HASH_COUNT] = +{ + { &info_crc32, sizeof(uint32_t), 0, iuf(rhash_crc32), 0 }, /* 32 bit */ + { &info_md4, sizeof(md4_ctx), dgshft(md4), iuf(rhash_md4), 0 }, /* 128 bit */ + { &info_md5, sizeof(md5_ctx), dgshft(md5), iuf(rhash_md5), 0 }, /* 128 bit */ + { &info_sha1, sizeof(sha1_ctx), dgshft(sha1), iuf(rhash_sha1), 0 }, /* 160 bit */ + { &info_tiger, sizeof(tiger_ctx), dgshft(tiger), iuf(rhash_tiger), 0 }, /* 192 bit */ + { &info_tth, sizeof(tth_ctx), dgshft2(tth, tiger.hash), iuf(rhash_tth), 0 }, /* 192 bit */ + { &info_btih, sizeof(torrent_ctx), dgshft2(torrent, btih), iuf(bt), (pcleanup_t)bt_cleanup }, /* 160 bit */ + { &info_ed2k, sizeof(ed2k_ctx), dgshft2(ed2k, md4_context_inner.hash), iuf(rhash_ed2k), 0 }, /* 128 bit */ + { &info_aich, sizeof(aich_ctx), dgshft2(aich, sha1_context.hash), iuf(rhash_aich), (pcleanup_t)rhash_aich_cleanup }, /* 160 bit */ + { &info_whirlpool, sizeof(whirlpool_ctx), dgshft(whirlpool), iuf(rhash_whirlpool), 0 }, /* 512 bit */ + { &info_rmd160, sizeof(ripemd160_ctx), dgshft(ripemd160), iuf(rhash_ripemd160), 0 }, /* 160 bit */ + { &info_gost, sizeof(gost_ctx), dgshft(gost), iuf(rhash_gost), 0 }, /* 256 bit */ + { &info_gostpro, sizeof(gost_ctx), dgshft(gost), ini(rhash_gost_cryptopro), upd(rhash_gost), fin(rhash_gost), 0 }, /* 256 bit */ + { &info_has160, sizeof(has160_ctx), dgshft(has160), iuf(rhash_has160), 0 }, /* 160 bit */ + { &info_snf128, sizeof(snefru_ctx), dgshft(snefru), ini(rhash_snefru128), upd(rhash_snefru), fin(rhash_snefru), 0 }, /* 128 bit */ + { &info_snf256, sizeof(snefru_ctx), dgshft(snefru), ini(rhash_snefru256), upd(rhash_snefru), fin(rhash_snefru), 0 }, /* 256 bit */ + { &info_sha224, sizeof(sha256_ctx), dgshft(sha256), ini(rhash_sha224), upd(rhash_sha256), fin(rhash_sha256), 0 }, /* 224 bit */ + { &info_sha256, sizeof(sha256_ctx), dgshft(sha256), iuf(rhash_sha256), 0 }, /* 256 bit */ + { &info_sha384, sizeof(sha512_ctx), dgshft(sha512), ini(rhash_sha384), upd(rhash_sha512), fin(rhash_sha512), 0 }, /* 384 bit */ + { &info_sha512, sizeof(sha512_ctx), dgshft(sha512), iuf(rhash_sha512), 0 }, /* 512 bit */ + { &info_edr256, sizeof(edonr_ctx), dgshft2(edonr, u.data256.hash) + 32, iuf(rhash_edonr256), 0 }, /* 256 bit */ + { &info_edr512, sizeof(edonr_ctx), dgshft2(edonr, u.data512.hash) + 64, iuf(rhash_edonr512), 0 }, /* 512 bit */ + { &info_sha3_224, sizeof(sha3_ctx), dgshft(sha3), ini(rhash_sha3_224), upd(rhash_sha3), fin(rhash_sha3), 0 }, /* 224 bit */ + { &info_sha3_256, sizeof(sha3_ctx), dgshft(sha3), ini(rhash_sha3_256), upd(rhash_sha3), fin(rhash_sha3), 0 }, /* 256 bit */ + { &info_sha3_384, sizeof(sha3_ctx), dgshft(sha3), ini(rhash_sha3_384), upd(rhash_sha3), fin(rhash_sha3), 0 }, /* 384 bit */ + { &info_sha3_512, sizeof(sha3_ctx), dgshft(sha3), ini(rhash_sha3_512), upd(rhash_sha3), fin(rhash_sha3), 0 }, /* 512 bit */ +}; + +/** + * Initialize requested algorithms. + */ +void rhash_init_algorithms(unsigned mask) +{ + (void)mask; /* unused now */ + + /* verify that RHASH_HASH_COUNT is the index of the major bit of RHASH_ALL_HASHES */ + assert(1 == (RHASH_ALL_HASHES >> (RHASH_HASH_COUNT - 1))); + +#ifdef GENERATE_CRC32_TABLE + rhash_crc32_init_table(); +#endif +#ifdef GENERATE_GOST_LOOKUP_TABLE + rhash_gost_init_table(); +#endif + rhash_uninitialized_algorithms = 0; +} + +/* CRC32 helper functions */ + +/** + * Initialize crc32 hash. + * + * @param crc32 pointer to the hash to initialize + */ +static void rhash_crc32_init(uint32_t* crc32) +{ + *crc32 = 0; /* note: context size is sizeof(uint32_t) */ +} + +/** + * Calculate message CRC32 hash. + * Can be called repeatedly with chunks of the message to be hashed. + * + * @param crc32 pointer to the hash + * @param msg message chunk + * @param size length of the message chunk + */ +static void rhash_crc32_update(uint32_t* crc32, const unsigned char* msg, size_t size) +{ + *crc32 = rhash_get_crc32(*crc32, msg, size); +} + +/** + * Store calculated hash into the given array. + * + * @param crc32 pointer to the current hash value + * @param result calculated hash in binary form + */ +static void rhash_crc32_final(uint32_t* crc32, unsigned char* result) +{ +#if defined(CPU_IA32) || defined(CPU_X64) + /* intel CPUs support assigment with non 32-bit aligned pointers */ + *(unsigned*)result = be2me_32(*crc32); +#else + /* correct saving BigEndian integer on all archs */ + result[0] = (unsigned char)(*crc32 >> 24), result[1] = (unsigned char)(*crc32 >> 16); + result[2] = (unsigned char)(*crc32 >> 8), result[3] = (unsigned char)(*crc32); +#endif +} diff --git a/librhash/algorithms.h b/librhash/algorithms.h new file mode 100644 index 0000000..4db2517 --- /dev/null +++ b/librhash/algorithms.h @@ -0,0 +1,120 @@ +/* algorithms.h - rhash library algorithms */ +#ifndef RHASH_ALGORITHMS_H +#define RHASH_ALGORITHMS_H + +#include /* for ptrdiff_t */ +#include "rhash.h" +#include "byte_order.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef RHASH_API +/* modifier for RHash library functions */ +# define RHASH_API +#endif + +typedef void (*pinit_t)(void*); +typedef void (*pupdate_t)(void *ctx, const void* msg, size_t size); +typedef void (*pfinal_t)(void*, unsigned char*); +typedef void (*pcleanup_t)(void*); + +/** + * Information about a hash function + */ +typedef struct rhash_hash_info +{ + rhash_info *info; + size_t context_size; + ptrdiff_t digest_diff; + pinit_t init; + pupdate_t update; + pfinal_t final; + pcleanup_t cleanup; +} rhash_hash_info; + +/** + * Information on a hash function and its context + */ +typedef struct rhash_vector_item +{ + struct rhash_hash_info* hash_info; + void *context; +} rhash_vector_item; + +/** + * The rhash context containing contexts for several hash functions + */ +typedef struct rhash_context_ext +{ + struct rhash_context rc; + unsigned hash_vector_size; /* number of contained hash sums */ + unsigned flags; + unsigned state; + void *callback, *callback_data; + void *bt_ctx; + rhash_vector_item vector[1]; /* contexts of contained hash sums */ +} rhash_context_ext; + +extern rhash_hash_info rhash_hash_info_default[RHASH_HASH_COUNT]; +extern rhash_hash_info* rhash_info_table; +extern int rhash_info_size; +extern unsigned rhash_uninitialized_algorithms; + +extern rhash_info info_crc32; +extern rhash_info info_md4; +extern rhash_info info_md5; +extern rhash_info info_sha1; +extern rhash_info info_tiger; +extern rhash_info info_tth ; +extern rhash_info info_btih; +extern rhash_info info_ed2k; +extern rhash_info info_aich; +extern rhash_info info_whirlpool; +extern rhash_info info_rmd160; +extern rhash_info info_gost; +extern rhash_info info_gostpro; +extern rhash_info info_has160; +extern rhash_info info_snf128; +extern rhash_info info_snf256; +extern rhash_info info_sha224; +extern rhash_info info_sha256; +extern rhash_info info_sha384; +extern rhash_info info_sha512; +extern rhash_info info_sha3_224; +extern rhash_info info_sha3_256; +extern rhash_info info_sha3_384; +extern rhash_info info_sha3_512; +extern rhash_info info_edr256; +extern rhash_info info_edr512; + +/* rhash_info flags */ +#define F_BS32 1 /* default output in base32 */ +#define F_SWAP32 2 /* Big endian flag */ +#define F_SWAP64 4 + +/* define endianness flags */ +#ifndef CPU_BIG_ENDIAN +#define F_LE32 0 +#define F_LE64 0 +#define F_BE32 F_SWAP32 +#define F_BE64 F_SWAP64 +#else +#define F_LE32 F_SWAP32 +#define F_LE64 F_SWAP64 +#define F_BE32 0 +#define F_BE64 0 +#endif + +void rhash_init_algorithms(unsigned mask); + +#if defined(OPENSSL_RUNTIME) && !defined(USE_OPENSSL) +# define USE_OPENSSL +#endif + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ + +#endif /* RHASH_ALGORITHMS_H */ diff --git a/librhash/byte_order.c b/librhash/byte_order.c new file mode 100644 index 0000000..8ce6fc8 --- /dev/null +++ b/librhash/byte_order.c @@ -0,0 +1,150 @@ +/* byte_order.c - byte order related platform dependent routines, + * + * Copyright: 2008-2012 Aleksey Kravchenko + * + * 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. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. Use this program at your own risk! + */ +#include "byte_order.h" + +#if !(__GNUC__ >= 4 || (__GNUC__ ==3 && __GNUC_MINOR__ >= 4)) /* if !GCC or GCC < 4.3 */ + +# if _MSC_VER >= 1300 && (_M_IX86 || _M_AMD64 || _M_IA64) /* if MSVC++ >= 2002 on x86/x64 */ +# include +# pragma intrinsic(_BitScanForward) + +/** + * Returns index of the trailing bit of x. + * + * @param x the number to process + * @return zero-based index of the trailing bit + */ +unsigned rhash_ctz(unsigned x) +{ + unsigned long index; + unsigned char isNonzero = _BitScanForward(&index, x); /* MSVC intrinsic */ + return (isNonzero ? (unsigned)index : 0); +} +# else /* _MSC_VER >= 1300... */ + +/** + * Returns index of the trailing bit of a 32-bit number. + * This is a plain C equivalent for GCC __builtin_ctz() bit scan. + * + * @param x the number to process + * @return zero-based index of the trailing bit + */ +unsigned rhash_ctz(unsigned x) +{ + /* array for conversion to bit position */ + static unsigned char bit_pos[32] = { + 0, 1, 28, 2, 29, 14, 24, 3, 30, 22, 20, 15, 25, 17, 4, 8, + 31, 27, 13, 23, 21, 19, 16, 7, 26, 12, 18, 6, 11, 5, 10, 9 + }; + + /* The De Bruijn bit-scan was devised in 1997, according to Donald Knuth + * by Martin Lauter. The constant 0x077CB531UL is a De Bruijn sequence, + * which produces a unique pattern of bits into the high 5 bits for each + * possible bit position that it is multiplied against. + * See http://graphics.stanford.edu/~seander/bithacks.html + * and http://chessprogramming.wikispaces.com/BitScan */ + return (unsigned)bit_pos[((uint32_t)((x & -x) * 0x077CB531U)) >> 27]; +} +# endif /* _MSC_VER >= 1300... */ +#endif /* !(GCC >= 4.3) */ + +/** + * Copy a memory block with simultaneous exchanging byte order. + * The byte order is changed from little-endian 32-bit integers + * to big-endian (or vice-versa). + * + * @param to the pointer where to copy memory block + * @param index the index to start writing from + * @param from the source block to copy + * @param length length of the memory block + */ +void rhash_swap_copy_str_to_u32(void* to, int index, const void* from, size_t length) +{ + /* if all pointers and length are 32-bits aligned */ + if ( 0 == (( (int)((char*)to - (char*)0) | ((char*)from - (char*)0) | index | length ) & 3) ) { + /* copy memory as 32-bit words */ + const uint32_t* src = (const uint32_t*)from; + const uint32_t* end = (const uint32_t*)((const char*)src + length); + uint32_t* dst = (uint32_t*)((char*)to + index); + while (src < end) *(dst++) = bswap_32( *(src++) ); + } else { + const char* src = (const char*)from; + for (length += index; (size_t)index < length; index++) ((char*)to)[index ^ 3] = *(src++); + } +} + +/** + * Copy a memory block with changed byte order. + * The byte order is changed from little-endian 64-bit integers + * to big-endian (or vice-versa). + * + * @param to the pointer where to copy memory block + * @param index the index to start writing from + * @param from the source block to copy + * @param length length of the memory block + */ +void rhash_swap_copy_str_to_u64(void* to, int index, const void* from, size_t length) +{ + /* if all pointers and length are 64-bits aligned */ + if ( 0 == (( (int)((char*)to - (char*)0) | ((char*)from - (char*)0) | index | length ) & 7) ) { + /* copy aligned memory block as 64-bit integers */ + const uint64_t* src = (const uint64_t*)from; + const uint64_t* end = (const uint64_t*)((const char*)src + length); + uint64_t* dst = (uint64_t*)((char*)to + index); + while (src < end) *(dst++) = bswap_64( *(src++) ); + } else { + const char* src = (const char*)from; + for (length += index; (size_t)index < length; index++) ((char*)to)[index ^ 7] = *(src++); + } +} + +/** + * Copy data from a sequence of 64-bit words to a binary string of given length, + * while changing byte order. + * + * @param to the binary string to receive data + * @param from the source sequence of 64-bit words + * @param length the size in bytes of the data being copied + */ +void rhash_swap_copy_u64_to_str(void* to, const void* from, size_t length) +{ + /* if all pointers and length are 64-bits aligned */ + if ( 0 == (( (int)((char*)to - (char*)0) | ((char*)from - (char*)0) | length ) & 7) ) { + /* copy aligned memory block as 64-bit integers */ + const uint64_t* src = (const uint64_t*)from; + const uint64_t* end = (const uint64_t*)((const char*)src + length); + uint64_t* dst = (uint64_t*)to; + while (src < end) *(dst++) = bswap_64( *(src++) ); + } else { + size_t index; + char* dst = (char*)to; + for (index = 0; index < length; index++) *(dst++) = ((char*)from)[index ^ 7]; + } +} + +/** + * Exchange byte order in the given array of 32-bit integers. + * + * @param arr the array to process + * @param length array length + */ +void rhash_u32_mem_swap(unsigned *arr, int length) +{ + unsigned* end = arr + length; + for (; arr < end; arr++) { + *arr = bswap_32(*arr); + } +} diff --git a/librhash/byte_order.h b/librhash/byte_order.h new file mode 100644 index 0000000..77b8bb9 --- /dev/null +++ b/librhash/byte_order.h @@ -0,0 +1,171 @@ +/* byte_order.h */ +#ifndef BYTE_ORDER_H +#define BYTE_ORDER_H +#include "ustd.h" +#include + +#ifdef IN_RHASH +#include "config.h" +#endif + +#ifdef __GLIBC__ +# include +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* if x86 compatible cpu */ +#if defined(i386) || defined(__i386__) || defined(__i486__) || \ + defined(__i586__) || defined(__i686__) || defined(__pentium__) || \ + defined(__pentiumpro__) || defined(__pentium4__) || \ + defined(__nocona__) || defined(prescott) || defined(__core2__) || \ + defined(__k6__) || defined(__k8__) || defined(__athlon__) || \ + defined(__amd64) || defined(__amd64__) || \ + defined(__x86_64) || defined(__x86_64__) || defined(_M_IX86) || \ + defined(_M_AMD64) || defined(_M_IA64) || defined(_M_X64) +/* detect if x86-64 instruction set is supported */ +# if defined(_LP64) || defined(__LP64__) || defined(__x86_64) || \ + defined(__x86_64__) || defined(_M_AMD64) || defined(_M_X64) +# define CPU_X64 +# else +# define CPU_IA32 +# endif +#endif + + +/* detect CPU endianness */ +#if (defined(__BYTE_ORDER) && defined(__LITTLE_ENDIAN) && \ + __BYTE_ORDER == __LITTLE_ENDIAN) || \ + defined(CPU_IA32) || defined(CPU_X64) || \ + defined(__ia64) || defined(__ia64__) || defined(__alpha__) || defined(_M_ALPHA) || \ + defined(vax) || defined(MIPSEL) || defined(_ARM_) || defined(__arm__) +# define CPU_LITTLE_ENDIAN +# define IS_BIG_ENDIAN 0 +# define IS_LITTLE_ENDIAN 1 +#elif (defined(__BYTE_ORDER) && defined(__BIG_ENDIAN) && \ + __BYTE_ORDER == __BIG_ENDIAN) || \ + defined(__sparc) || defined(__sparc__) || defined(sparc) || \ + defined(_ARCH_PPC) || defined(_ARCH_PPC64) || defined(_POWER) || \ + defined(__POWERPC__) || defined(POWERPC) || defined(__powerpc) || \ + defined(__powerpc__) || defined(__powerpc64__) || defined(__ppc__) || \ + defined(__hpux) || defined(_MIPSEB) || defined(mc68000) || \ + defined(__s390__) || defined(__s390x__) || defined(sel) +# define CPU_BIG_ENDIAN +# define IS_BIG_ENDIAN 1 +# define IS_LITTLE_ENDIAN 0 +#else +# error "Can't detect CPU architechture" +#endif + +#define IS_ALIGNED_32(p) (0 == (3 & ((const char*)(p) - (const char*)0))) +#define IS_ALIGNED_64(p) (0 == (7 & ((const char*)(p) - (const char*)0))) + +#if defined(_MSC_VER) +#define ALIGN_ATTR(n) __declspec(align(n)) +#elif defined(__GNUC__) +#define ALIGN_ATTR(n) __attribute__((aligned (n))) +#else +#define ALIGN_ATTR(n) /* nothing */ +#endif + + +#if defined(_MSC_VER) || defined(__BORLANDC__) +#define I64(x) x##ui64 +#else +#define I64(x) x##LL +#endif + +/* convert a hash flag to index */ +#if __GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) /* GCC < 3.4 */ +# define rhash_ctz(x) __builtin_ctz(x) +#else +unsigned rhash_ctz(unsigned); /* define as function */ +#endif + +void rhash_swap_copy_str_to_u32(void* to, int index, const void* from, size_t length); +void rhash_swap_copy_str_to_u64(void* to, int index, const void* from, size_t length); +void rhash_swap_copy_u64_to_str(void* to, const void* from, size_t length); +void rhash_u32_mem_swap(unsigned *p, int length_in_u32); + +/* define bswap_32 */ +#if defined(__GNUC__) && defined(CPU_IA32) && !defined(__i386__) +/* for intel x86 CPU */ +static inline uint32_t bswap_32(uint32_t x) { + __asm("bswap\t%0" : "=r" (x) : "0" (x)); + return x; +} +#elif defined(__GNUC__) && (__GNUC__ >= 4) && (__GNUC__ > 4 || __GNUC_MINOR__ >= 3) +/* for GCC >= 4.3 */ +# define bswap_32(x) __builtin_bswap32(x) +#elif (_MSC_VER > 1300) && (defined(CPU_IA32) || defined(CPU_X64)) /* MS VC */ +# define bswap_32(x) _byteswap_ulong((unsigned long)x) +#elif !defined(__STRICT_ANSI__) +/* general bswap_32 definition */ +static inline uint32_t bswap_32(uint32_t x) { + x = ((x << 8) & 0xFF00FF00) | ((x >> 8) & 0x00FF00FF); + return (x >> 16) | (x << 16); +} +#else +#define bswap_32(x) ((((x) & 0xff000000) >> 24) | (((x) & 0x00ff0000) >> 8) | \ + (((x) & 0x0000ff00) << 8) | (((x) & 0x000000ff) << 24)) +#endif /* bswap_32 */ + +#if defined(__GNUC__) && (__GNUC__ >= 4) && (__GNUC__ > 4 || __GNUC_MINOR__ >= 3) +# define bswap_64(x) __builtin_bswap64(x) +#elif (_MSC_VER > 1300) && (defined(CPU_IA32) || defined(CPU_X64)) /* MS VC */ +# define bswap_64(x) _byteswap_uint64((__int64)x) +#elif !defined(__STRICT_ANSI__) +static inline uint64_t bswap_64(uint64_t x) { + union { + uint64_t ll; + uint32_t l[2]; + } w, r; + w.ll = x; + r.l[0] = bswap_32(w.l[1]); + r.l[1] = bswap_32(w.l[0]); + return r.ll; +} +#else +#error "bswap_64 unsupported" +#endif + +#ifdef CPU_BIG_ENDIAN +# define be2me_32(x) (x) +# define be2me_64(x) (x) +# define le2me_32(x) bswap_32(x) +# define le2me_64(x) bswap_64(x) + +# define be32_copy(to, index, from, length) memcpy((to) + (index), (from), (length)) +# define le32_copy(to, index, from, length) rhash_swap_copy_str_to_u32((to), (index), (from), (length)) +# define be64_copy(to, index, from, length) memcpy((to) + (index), (from), (length)) +# define le64_copy(to, index, from, length) rhash_swap_copy_str_to_u64((to), (index), (from), (length)) +# define me64_to_be_str(to, from, length) memcpy((to), (from), (length)) +# define me64_to_le_str(to, from, length) rhash_swap_copy_u64_to_str((to), (from), (length)) + +#else /* CPU_BIG_ENDIAN */ +# define be2me_32(x) bswap_32(x) +# define be2me_64(x) bswap_64(x) +# define le2me_32(x) (x) +# define le2me_64(x) (x) + +# define be32_copy(to, index, from, length) rhash_swap_copy_str_to_u32((to), (index), (from), (length)) +# define le32_copy(to, index, from, length) memcpy((to) + (index), (from), (length)) +# define be64_copy(to, index, from, length) rhash_swap_copy_str_to_u64((to), (index), (from), (length)) +# define le64_copy(to, index, from, length) memcpy((to) + (index), (from), (length)) +# define me64_to_be_str(to, from, length) rhash_swap_copy_u64_to_str((to), (from), (length)) +# define me64_to_le_str(to, from, length) memcpy((to), (from), (length)) +#endif /* CPU_BIG_ENDIAN */ + +/* ROTL/ROTR macros rotate a 32/64-bit word left/right by n bits */ +#define ROTL32(dword, n) ((dword) << (n) ^ ((dword) >> (32 - (n)))) +#define ROTR32(dword, n) ((dword) >> (n) ^ ((dword) << (32 - (n)))) +#define ROTL64(qword, n) ((qword) << (n) ^ ((qword) >> (64 - (n)))) +#define ROTR64(qword, n) ((qword) >> (n) ^ ((qword) << (64 - (n)))) + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ + +#endif /* BYTE_ORDER_H */ diff --git a/librhash/hex.c b/librhash/hex.c new file mode 100644 index 0000000..c941149 --- /dev/null +++ b/librhash/hex.c @@ -0,0 +1,188 @@ +/* hex.c - conversion for hexadecimal and base32 strings. + * + * Copyright: 2008-2012 Aleksey Kravchenko + * + * 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. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. Use this program at your own risk! + */ +#include +#include +#include "hex.h" + +/** +* Convert a byte to a hexadecimal number. The result, consisting of two +* hexadecimal digits is stored into a buffer. + * + * @param dest the buffer to receive two symbols of hex representation + * @param byte the byte to decode + * @param upper_case flag to print string in uppercase + * @return pointer to the chararcter just after the written number (dest + 2) + */ +char* rhash_print_hex_byte(char *dest, const unsigned char byte, int upper_case) +{ + const char add = (upper_case ? 'A' - 10 : 'a' - 10); + unsigned char c = (byte >> 4) & 15; + *dest++ = (c > 9 ? c + add : c + '0'); + c = byte & 15; + *dest++ = (c > 9 ? c + add : c + '0'); + return dest; +} + +/** + * Store hexadecimal representation of a binary string to given buffer. + * + * @param dest the buffer to receive hexadecimal representation + * @param src binary string + * @param len string length + * @param upper_case flag to print string in uppercase + */ +void rhash_byte_to_hex(char *dest, const unsigned char *src, unsigned len, int upper_case) +{ + while (len-- > 0) { + dest = rhash_print_hex_byte(dest, *src++, upper_case); + } + *dest = '\0'; +} + +/** + * Encode a binary string to base32. + * + * @param dest the buffer to store result + * @param src binary string + * @param len string length + * @param upper_case flag to print string in uppercase + */ +void rhash_byte_to_base32(char* dest, const unsigned char* src, unsigned len, int upper_case) +{ + const char a = (upper_case ? 'A' : 'a'); + unsigned shift = 0; + unsigned char word; + const unsigned char* e = src + len; + while (src < e) { + if (shift > 3) { + word = (*src & (0xFF >> shift)); + shift = (shift + 5) % 8; + word <<= shift; + if (src + 1 < e) + word |= *(src + 1) >> (8 - shift); + ++src; + } else { + shift = (shift + 5) % 8; + word = ( *src >> ( (8 - shift) & 7 ) ) & 0x1F; + if (shift == 0) src++; + } + *dest++ = ( word < 26 ? word + a : word + '2' - 26 ); + } + *dest = '\0'; +} + +/** + * Encode a binary string to base64. + * Encoded output length is always a multiple of 4 bytes. + * + * @param dest the buffer to store result + * @param src binary string + * @param len string length + */ +void rhash_byte_to_base64(char* dest, const unsigned char* src, unsigned len) +{ + static const char* tail = "0123456789+/"; + unsigned shift = 0; + unsigned char word; + const unsigned char* e = src + len; + while (src < e) { + if (shift > 2) { + word = (*src & (0xFF >> shift)); + shift = (shift + 6) % 8; + word <<= shift; + if (src + 1 < e) + word |= *(src + 1) >> (8 - shift); + ++src; + } else { + shift = (shift + 6) % 8; + word = ( *src >> ( (8 - shift) & 7 ) ) & 0x3F; + if (shift == 0) src++; + } + *dest++ = ( word < 52 ? (word < 26 ? word + 'A' : word - 26 + 'a') : tail[word - 52]); + } + if (shift > 0) { + *dest++ = '='; + if (shift == 4) *dest++ = '='; + } + *dest = '\0'; +} + +/* unsafe characters are "<>{}[]%#/|\^~`@:;?=&+ */ +#define IS_GOOD_URL_CHAR(c) (isalnum((unsigned char)c) || strchr("$-_.!'(),", c)) + +/** + * URL-encode a string. + * + * @param dst buffer to receive result or NULL to calculate + * the lengths of encoded string + * @param filename the file name + * @return the length of the result string + */ +int rhash_urlencode(char *dst, const char *name) +{ + const char *start; + if (!dst) { + int len; + for (len = 0; *name; name++) len += (IS_GOOD_URL_CHAR(*name) ? 1 : 3); + return len; + } + /* encode URL as specified by RFC 1738 */ + for (start = dst; *name; name++) { + if ( IS_GOOD_URL_CHAR(*name) ) { + *dst++ = *name; + } else { + *dst++ = '%'; + dst = rhash_print_hex_byte(dst, *name, 'A'); + } + } + *dst = 0; + return (int)(dst - start); +} + +/** + * Print 64-bit number with trailing '\0' to a string buffer. + * if dst is NULL, then just return the length of the number. + * + * @param dst output buffer + * @param number the number to print + * @return length of the printed number (without trailing '\0') + */ +int rhash_sprintI64(char *dst, uint64_t number) +{ + /* The biggest number has 20 digits: 2^64 = 18 446 744 073 709 551 616 */ + char buf[24], *p; + size_t length; + + if (dst == NULL) { + /* just calculate the length of the number */ + if (number == 0) return 1; + for (length = 0; number != 0; number /= 10) length++; + return (int)length; + } + + p = buf + 23; + *p = '\0'; /* last symbol should be '\0' */ + if (number == 0) { + *(--p) = '0'; + } else { + for (; p >= buf && number != 0; number /= 10) { + *(--p) = '0' + (char)(number % 10); + } + } + length = buf + 23 - p; + memcpy(dst, p, length + 1); + return (int)length; +} diff --git a/librhash/hex.h b/librhash/hex.h new file mode 100644 index 0000000..2b365e2 --- /dev/null +++ b/librhash/hex.h @@ -0,0 +1,25 @@ +/* hex.h - conversion for hexadecimal and base32 strings. */ +#ifndef HEX_H +#define HEX_H + +#include "ustd.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void rhash_byte_to_hex(char *dest, const unsigned char *src, unsigned len, int upper_case); +void rhash_byte_to_base32(char* dest, const unsigned char* src, unsigned len, int upper_case); +void rhash_byte_to_base64(char* dest, const unsigned char* src, unsigned len); +char* rhash_print_hex_byte(char *dest, const unsigned char byte, int upper_case); +int rhash_urlencode(char *dst, const char *name); +int rhash_sprintI64(char *dst, uint64_t number); + +#define BASE32_LENGTH(bytes) (((bytes) * 8 + 4) / 5) +#define BASE64_LENGTH(bytes) ((((bytes) + 2) / 3) * 4) + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ + +#endif /* HEX_H */ diff --git a/librhash/md5.c b/librhash/md5.c new file mode 100644 index 0000000..0feb090 --- /dev/null +++ b/librhash/md5.c @@ -0,0 +1,236 @@ +/* md5.c - an implementation of the MD5 algorithm, based on RFC 1321. + * + * Copyright: 2007-2012 Aleksey Kravchenko + * + * 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. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. Use this program at your own risk! + */ + +#include +#include "byte_order.h" +#include "md5.h" + +/** + * Initialize context before calculaing hash. + * + * @param ctx context to initialize + */ +void rhash_md5_init(md5_ctx *ctx) +{ + ctx->length = 0; + + /* initialize state */ + ctx->hash[0] = 0x67452301; + ctx->hash[1] = 0xefcdab89; + ctx->hash[2] = 0x98badcfe; + ctx->hash[3] = 0x10325476; +} + +/* First, define four auxiliary functions that each take as input + * three 32-bit words and returns a 32-bit word.*/ + +/* F(x,y,z) = ((y XOR z) AND x) XOR z - is faster then original version */ +#define MD5_F(x, y, z) ((((y) ^ (z)) & (x)) ^ (z)) +#define MD5_G(x, y, z) (((x) & (z)) | ((y) & (~z))) +#define MD5_H(x, y, z) ((x) ^ (y) ^ (z)) +#define MD5_I(x, y, z) ((y) ^ ((x) | (~z))) + +/* transformations for rounds 1, 2, 3, and 4. */ +#define MD5_ROUND1(a, b, c, d, x, s, ac) { \ + (a) += MD5_F((b), (c), (d)) + (x) + (ac); \ + (a) = ROTL32((a), (s)); \ + (a) += (b); \ +} +#define MD5_ROUND2(a, b, c, d, x, s, ac) { \ + (a) += MD5_G((b), (c), (d)) + (x) + (ac); \ + (a) = ROTL32((a), (s)); \ + (a) += (b); \ +} +#define MD5_ROUND3(a, b, c, d, x, s, ac) { \ + (a) += MD5_H((b), (c), (d)) + (x) + (ac); \ + (a) = ROTL32((a), (s)); \ + (a) += (b); \ +} +#define MD5_ROUND4(a, b, c, d, x, s, ac) { \ + (a) += MD5_I((b), (c), (d)) + (x) + (ac); \ + (a) = ROTL32((a), (s)); \ + (a) += (b); \ +} + +/** + * The core transformation. Process a 512-bit block. + * The function has been taken from RFC 1321 with little changes. + * + * @param state algorithm state + * @param x the message block to process + */ +static void rhash_md5_process_block(unsigned state[4], const unsigned* x) +{ + register unsigned a, b, c, d; + a = state[0]; + b = state[1]; + c = state[2]; + d = state[3]; + + MD5_ROUND1(a, b, c, d, x[ 0], 7, 0xd76aa478); + MD5_ROUND1(d, a, b, c, x[ 1], 12, 0xe8c7b756); + MD5_ROUND1(c, d, a, b, x[ 2], 17, 0x242070db); + MD5_ROUND1(b, c, d, a, x[ 3], 22, 0xc1bdceee); + MD5_ROUND1(a, b, c, d, x[ 4], 7, 0xf57c0faf); + MD5_ROUND1(d, a, b, c, x[ 5], 12, 0x4787c62a); + MD5_ROUND1(c, d, a, b, x[ 6], 17, 0xa8304613); + MD5_ROUND1(b, c, d, a, x[ 7], 22, 0xfd469501); + MD5_ROUND1(a, b, c, d, x[ 8], 7, 0x698098d8); + MD5_ROUND1(d, a, b, c, x[ 9], 12, 0x8b44f7af); + MD5_ROUND1(c, d, a, b, x[10], 17, 0xffff5bb1); + MD5_ROUND1(b, c, d, a, x[11], 22, 0x895cd7be); + MD5_ROUND1(a, b, c, d, x[12], 7, 0x6b901122); + MD5_ROUND1(d, a, b, c, x[13], 12, 0xfd987193); + MD5_ROUND1(c, d, a, b, x[14], 17, 0xa679438e); + MD5_ROUND1(b, c, d, a, x[15], 22, 0x49b40821); + + MD5_ROUND2(a, b, c, d, x[ 1], 5, 0xf61e2562); + MD5_ROUND2(d, a, b, c, x[ 6], 9, 0xc040b340); + MD5_ROUND2(c, d, a, b, x[11], 14, 0x265e5a51); + MD5_ROUND2(b, c, d, a, x[ 0], 20, 0xe9b6c7aa); + MD5_ROUND2(a, b, c, d, x[ 5], 5, 0xd62f105d); + MD5_ROUND2(d, a, b, c, x[10], 9, 0x2441453); + MD5_ROUND2(c, d, a, b, x[15], 14, 0xd8a1e681); + MD5_ROUND2(b, c, d, a, x[ 4], 20, 0xe7d3fbc8); + MD5_ROUND2(a, b, c, d, x[ 9], 5, 0x21e1cde6); + MD5_ROUND2(d, a, b, c, x[14], 9, 0xc33707d6); + MD5_ROUND2(c, d, a, b, x[ 3], 14, 0xf4d50d87); + MD5_ROUND2(b, c, d, a, x[ 8], 20, 0x455a14ed); + MD5_ROUND2(a, b, c, d, x[13], 5, 0xa9e3e905); + MD5_ROUND2(d, a, b, c, x[ 2], 9, 0xfcefa3f8); + MD5_ROUND2(c, d, a, b, x[ 7], 14, 0x676f02d9); + MD5_ROUND2(b, c, d, a, x[12], 20, 0x8d2a4c8a); + + MD5_ROUND3(a, b, c, d, x[ 5], 4, 0xfffa3942); + MD5_ROUND3(d, a, b, c, x[ 8], 11, 0x8771f681); + MD5_ROUND3(c, d, a, b, x[11], 16, 0x6d9d6122); + MD5_ROUND3(b, c, d, a, x[14], 23, 0xfde5380c); + MD5_ROUND3(a, b, c, d, x[ 1], 4, 0xa4beea44); + MD5_ROUND3(d, a, b, c, x[ 4], 11, 0x4bdecfa9); + MD5_ROUND3(c, d, a, b, x[ 7], 16, 0xf6bb4b60); + MD5_ROUND3(b, c, d, a, x[10], 23, 0xbebfbc70); + MD5_ROUND3(a, b, c, d, x[13], 4, 0x289b7ec6); + MD5_ROUND3(d, a, b, c, x[ 0], 11, 0xeaa127fa); + MD5_ROUND3(c, d, a, b, x[ 3], 16, 0xd4ef3085); + MD5_ROUND3(b, c, d, a, x[ 6], 23, 0x4881d05); + MD5_ROUND3(a, b, c, d, x[ 9], 4, 0xd9d4d039); + MD5_ROUND3(d, a, b, c, x[12], 11, 0xe6db99e5); + MD5_ROUND3(c, d, a, b, x[15], 16, 0x1fa27cf8); + MD5_ROUND3(b, c, d, a, x[ 2], 23, 0xc4ac5665); + + MD5_ROUND4(a, b, c, d, x[ 0], 6, 0xf4292244); + MD5_ROUND4(d, a, b, c, x[ 7], 10, 0x432aff97); + MD5_ROUND4(c, d, a, b, x[14], 15, 0xab9423a7); + MD5_ROUND4(b, c, d, a, x[ 5], 21, 0xfc93a039); + MD5_ROUND4(a, b, c, d, x[12], 6, 0x655b59c3); + MD5_ROUND4(d, a, b, c, x[ 3], 10, 0x8f0ccc92); + MD5_ROUND4(c, d, a, b, x[10], 15, 0xffeff47d); + MD5_ROUND4(b, c, d, a, x[ 1], 21, 0x85845dd1); + MD5_ROUND4(a, b, c, d, x[ 8], 6, 0x6fa87e4f); + MD5_ROUND4(d, a, b, c, x[15], 10, 0xfe2ce6e0); + MD5_ROUND4(c, d, a, b, x[ 6], 15, 0xa3014314); + MD5_ROUND4(b, c, d, a, x[13], 21, 0x4e0811a1); + MD5_ROUND4(a, b, c, d, x[ 4], 6, 0xf7537e82); + MD5_ROUND4(d, a, b, c, x[11], 10, 0xbd3af235); + MD5_ROUND4(c, d, a, b, x[ 2], 15, 0x2ad7d2bb); + MD5_ROUND4(b, c, d, a, x[ 9], 21, 0xeb86d391); + + state[0] += a; + state[1] += b; + state[2] += c; + state[3] += d; +} + +/** + * Calculate message hash. + * Can be called repeatedly with chunks of the message to be hashed. + * + * @param ctx the algorithm context containing current hashing state + * @param msg message chunk + * @param size length of the message chunk + */ +void rhash_md5_update(md5_ctx *ctx, const unsigned char* msg, size_t size) +{ + unsigned index = (unsigned)ctx->length & 63; + ctx->length += size; + + /* fill partial block */ + if (index) { + unsigned left = md5_block_size - index; + le32_copy((char*)ctx->message, index, msg, (size < left ? size : left)); + if (size < left) return; + + /* process partial block */ + rhash_md5_process_block(ctx->hash, ctx->message); + msg += left; + size -= left; + } + while (size >= md5_block_size) { + unsigned* aligned_message_block; + if (IS_LITTLE_ENDIAN && IS_ALIGNED_32(msg)) { + /* the most common case is processing a 32-bit aligned message + on a little-endian CPU without copying it */ + aligned_message_block = (unsigned*)msg; + } else { + le32_copy(ctx->message, 0, msg, md5_block_size); + aligned_message_block = ctx->message; + } + + rhash_md5_process_block(ctx->hash, aligned_message_block); + msg += md5_block_size; + size -= md5_block_size; + } + if (size) { + /* save leftovers */ + le32_copy(ctx->message, 0, msg, size); + } +} + +/** + * Store calculated hash into the given array. + * + * @param ctx the algorithm context containing current hashing state + * @param result calculated hash in binary form + */ +void rhash_md5_final(md5_ctx *ctx, unsigned char* result) +{ + unsigned index = ((unsigned)ctx->length & 63) >> 2; + unsigned shift = ((unsigned)ctx->length & 3) * 8; + + /* pad message and run for last block */ + + /* append the byte 0x80 to the message */ + ctx->message[index] &= ~(0xFFFFFFFF << shift); + ctx->message[index++] ^= 0x80 << shift; + + /* if no room left in the message to store 64-bit message length */ + if (index > 14) { + /* then fill the rest with zeros and process it */ + while (index < 16) { + ctx->message[index++] = 0; + } + rhash_md5_process_block(ctx->hash, ctx->message); + index = 0; + } + while (index < 14) { + ctx->message[index++] = 0; + } + ctx->message[14] = (unsigned)(ctx->length << 3); + ctx->message[15] = (unsigned)(ctx->length >> 29); + rhash_md5_process_block(ctx->hash, ctx->message); + + if (result) le32_copy(result, 0, &ctx->hash, 16); +} diff --git a/librhash/md5.h b/librhash/md5.h new file mode 100644 index 0000000..1af6f13 --- /dev/null +++ b/librhash/md5.h @@ -0,0 +1,31 @@ +/* md5.h */ +#ifndef MD5_HIDER +#define MD5_HIDER +#include "ustd.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define md5_block_size 64 +#define md5_hash_size 16 + +/* algorithm context */ +typedef struct md5_ctx +{ + unsigned message[md5_block_size / 4]; /* 512-bit buffer for leftovers */ + uint64_t length; /* number of processed bytes */ + unsigned hash[4]; /* 128-bit algorithm internal hashing state */ +} md5_ctx; + +/* hash functions */ + +void rhash_md5_init(md5_ctx *ctx); +void rhash_md5_update(md5_ctx *ctx, const unsigned char* msg, size_t size); +void rhash_md5_final(md5_ctx *ctx, unsigned char result[16]); + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ + +#endif /* MD5_HIDER */ diff --git a/librhash/rhash.c b/librhash/rhash.c new file mode 100644 index 0000000..98cf97e --- /dev/null +++ b/librhash/rhash.c @@ -0,0 +1,919 @@ +/* rhash.c - implementation of LibRHash library calls + * + * Copyright: 2008-2012 Aleksey Kravchenko + * + * 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. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. Use this program at your own risk! + */ + +/* macros for large file support, must be defined before any include file */ +#define _LARGEFILE64_SOURCE +#define _FILE_OFFSET_BITS 64 + +#include /* memset() */ +#include /* free() */ +#include /* ptrdiff_t */ +#include +#include +#include + +/* modifier for Windows DLL */ +#if defined(_WIN32) && defined(RHASH_EXPORTS) +# define RHASH_API __declspec(dllexport) +#endif + +#include "byte_order.h" +#include "algorithms.h" +#include "torrent.h" +#include "plug_openssl.h" +#include "util.h" +#include "hex.h" +#include "rhash.h" /* RHash library interface */ + +#define STATE_ACTIVE 0xb01dbabe +#define STATE_STOPED 0xdeadbeef +#define STATE_DELETED 0xdecea5ed +#define RCTX_AUTO_FINAL 0x1 +#define RCTX_FINALIZED 0x2 +#define RCTX_FINALIZED_MASK (RCTX_AUTO_FINAL | RCTX_FINALIZED) +#define RHPR_FORMAT (RHPR_RAW | RHPR_HEX | RHPR_BASE32 | RHPR_BASE64) +#define RHPR_MODIFIER (RHPR_UPPERCASE | RHPR_REVERSE) + +/** + * Initialize static data of rhash algorithms + */ +void rhash_library_init(void) +{ + rhash_init_algorithms(RHASH_ALL_HASHES); +#ifdef USE_OPENSSL + rhash_plug_openssl(); +#endif +} + +/** + * Returns the number of supported hash algorithms. + * + * @return the number of supported hash functions + */ +int RHASH_API rhash_count(void) +{ + return rhash_info_size; +} + +/* Lo-level rhash library functions */ + +/** + * Allocate and initialize RHash context for calculating hash(es). + * After initializing rhash_update()/rhash_final() functions should be used. + * Then the context must be freed by calling rhash_free(). + * + * @param hash_id union of bit flags, containing ids of hashes to calculate. + * @return initialized rhash context, NULL on error and errno is set + */ +RHASH_API rhash rhash_init(unsigned hash_id) +{ + unsigned tail_bit_index; /* index of hash_id trailing bit */ + unsigned num = 0; /* number of hashes to compute */ + rhash_context_ext *rctx = NULL; /* allocated rhash context */ + size_t hash_size_sum = 0; /* size of hash contexts to store in rctx */ + + unsigned i, bit_index, id; + struct rhash_hash_info* info; + size_t aligned_size; + char* phash_ctx; + + hash_id &= RHASH_ALL_HASHES; + if (hash_id == 0) { + errno = EINVAL; + return NULL; + } + + tail_bit_index = rhash_ctz(hash_id); /* get trailing bit index */ + assert(tail_bit_index < RHASH_HASH_COUNT); + + id = 1 << tail_bit_index; + + if (hash_id == id) { + /* handle the most common case of only one hash */ + num = 1; + info = &rhash_info_table[tail_bit_index]; + hash_size_sum = info->context_size; + } else { + /* another case: hash_id contains several hashes */ + for (bit_index = tail_bit_index; id <= hash_id; bit_index++, id = id << 1) { + assert(id != 0); + assert(bit_index < RHASH_HASH_COUNT); + info = &rhash_info_table[bit_index]; + if (hash_id & id) { + /* align sizes by 8 bytes */ + aligned_size = (info->context_size + 7) & ~7; + hash_size_sum += aligned_size; + num++; + } + } + assert(num > 1); + } + + /* align the size of the rhash context common part */ + aligned_size = (offsetof(rhash_context_ext, vector[num]) + 7) & ~7; + assert(aligned_size >= sizeof(rhash_context_ext)); + + /* allocate rhash context with enough memory to store contexts of all used hashes */ + rctx = (rhash_context_ext*)malloc(aligned_size + hash_size_sum); + if (rctx == NULL) return NULL; + + /* initialize common fields of the rhash context */ + memset(rctx, 0, sizeof(rhash_context_ext)); + rctx->rc.hash_id = hash_id; + rctx->flags = RCTX_AUTO_FINAL; /* turn on auto-final by default */ + rctx->state = STATE_ACTIVE; + rctx->hash_vector_size = num; + + /* aligned hash contexts follows rctx->vector[num] in the same memory block */ + phash_ctx = (char*)rctx + aligned_size; + assert(phash_ctx >= (char*)&rctx->vector[num]); + + /* initialize context for every hash in a loop */ + for (bit_index = tail_bit_index, id = 1 << tail_bit_index, i = 0; + id <= hash_id; bit_index++, id = id << 1) + { + /* check if a hash function with given id shall be included into rctx */ + if ((hash_id & id) != 0) { + info = &rhash_info_table[bit_index]; + assert(info->context_size > 0); + assert(((phash_ctx - (char*)0) & 7) == 0); /* hash context is aligned */ + assert(info->init != NULL); + + rctx->vector[i].hash_info = info; + rctx->vector[i].context = phash_ctx; + + /* BTIH initialization is complex, save pointer for later */ + if ((id & RHASH_BTIH) != 0) rctx->bt_ctx = phash_ctx; + phash_ctx += (info->context_size + 7) & ~7; + + /* initialize the i-th hash context */ + info->init(rctx->vector[i].context); + i++; + } + } + + return &rctx->rc; /* return allocated and initialized rhash context */ +} + +/** + * Free RHash context memory. + * + * @param ctx the context to free. + */ +void rhash_free(rhash ctx) +{ + rhash_context_ext* const ectx = (rhash_context_ext*)ctx; + unsigned i; + + if (ctx == 0) return; + assert(ectx->hash_vector_size <= RHASH_HASH_COUNT); + ectx->state = STATE_DELETED; /* mark memory block as being removed */ + + /* clean the hash functions, which require additional clean up */ + for (i = 0; i < ectx->hash_vector_size; i++) { + struct rhash_hash_info* info = ectx->vector[i].hash_info; + if (info->cleanup != 0) { + info->cleanup(ectx->vector[i].context); + } + } + + free(ectx); +} + +/** + * Re-initialize RHash context to reuse it. + * Useful to speed up processing of many small messages. + * + * @param ctx context to reinitialize + */ +RHASH_API void rhash_reset(rhash ctx) +{ + rhash_context_ext* const ectx = (rhash_context_ext*)ctx; + unsigned i; + + assert(ectx->hash_vector_size > 0); + assert(ectx->hash_vector_size <= RHASH_HASH_COUNT); + ectx->state = STATE_ACTIVE; /* re-activate the structure */ + + /* re-initialize every hash in a loop */ + for (i = 0; i < ectx->hash_vector_size; i++) { + struct rhash_hash_info* info = ectx->vector[i].hash_info; + if (info->cleanup != 0) { + info->cleanup(ectx->vector[i].context); + } + + assert(info->init != NULL); + info->init(ectx->vector[i].context); + } + ectx->flags &= ~RCTX_FINALIZED; /* clear finalized state */ +} + +/** + * Calculate hashes of message. + * Can be called repeatedly with chunks of the message to be hashed. + * + * @param ctx the rhash context + * @param message message chunk + * @param length length of the message chunk + * @return 0 on success; On fail return -1 and set errno + */ +RHASH_API int rhash_update(rhash ctx, const void* message, size_t length) +{ + rhash_context_ext* const ectx = (rhash_context_ext*)ctx; + unsigned i; + + assert(ectx->hash_vector_size <= RHASH_HASH_COUNT); + if (ectx->state != STATE_ACTIVE) return 0; /* do nothing if canceled */ + + ctx->msg_size += length; + + /* call update method for every algorithm */ + for (i = 0; i < ectx->hash_vector_size; i++) { + struct rhash_hash_info* info = ectx->vector[i].hash_info; + assert(info->update != 0); + info->update(ectx->vector[i].context, message, length); + } + return 0; /* no error processing at the moment */ +} + +/** + * Finalize hash calculation and optionally store the first hash. + * + * @param ctx the rhash context + * @param first_result optional buffer to store a calculated hash with the lowest available id + * @return 0 on success; On fail return -1 and set errno + */ +RHASH_API int rhash_final(rhash ctx, unsigned char* first_result) +{ + unsigned i = 0; + unsigned char buffer[130]; + unsigned char* out = (first_result ? first_result : buffer); + rhash_context_ext* const ectx = (rhash_context_ext*)ctx; + assert(ectx->hash_vector_size <= RHASH_HASH_COUNT); + + /* skip final call if already finalized and auto-final is on */ + if ((ectx->flags & RCTX_FINALIZED_MASK) == + (RCTX_AUTO_FINAL | RCTX_FINALIZED)) return 0; + + /* call final method for every algorithm */ + for (i = 0; i < ectx->hash_vector_size; i++) { + struct rhash_hash_info* info = ectx->vector[i].hash_info; + assert(info->final != 0); + assert(info->info->digest_size < sizeof(buffer)); + info->final(ectx->vector[i].context, out); + out = buffer; + } + ectx->flags |= RCTX_FINALIZED; + return 0; /* no error processing at the moment */ +} + +/** + * Store digest for given hash_id. + * If hash_id is zero, function stores digest for a hash with the lowest id found in the context. + * For nonzero hash_id the context must contain it, otherwise function silently does nothing. + * + * @param ctx rhash context + * @param hash_id id of hash to retrieve or zero for hash with the lowest available id + * @param result buffer to put the hash into + */ +static void rhash_put_digest(rhash ctx, unsigned hash_id, unsigned char* result) +{ + rhash_context_ext* const ectx = (rhash_context_ext*)ctx; + unsigned i; + rhash_vector_item *item; + struct rhash_hash_info* info; + unsigned char* digest; + + assert(ectx); + assert(ectx->hash_vector_size > 0 && ectx->hash_vector_size <= RHASH_HASH_COUNT); + + /* finalize context if not yet finalized and auto-final is on */ + if ((ectx->flags & RCTX_FINALIZED_MASK) == RCTX_AUTO_FINAL) { + rhash_final(ctx, NULL); + } + + if (hash_id == 0) { + item = &ectx->vector[0]; /* get the first hash */ + info = item->hash_info; + } else { + for (i = 0;; i++) { + if (i >= ectx->hash_vector_size) { + return; /* hash_id not found, do nothing */ + } + item = &ectx->vector[i]; + info = item->hash_info; + if (info->info->hash_id == hash_id) break; + } + } + digest = ((unsigned char*)item->context + info->digest_diff); + if (info->info->flags & F_SWAP32) { + assert((info->info->digest_size & 3) == 0); + /* NB: the next call is correct only for multiple of 4 byte size */ + rhash_swap_copy_str_to_u32(result, 0, digest, info->info->digest_size); + } else if (info->info->flags & F_SWAP64) { + rhash_swap_copy_u64_to_str(result, digest, info->info->digest_size); + } else { + memcpy(result, digest, info->info->digest_size); + } +} + +/** + * Set the callback function to be called from the + * rhash_file() and rhash_file_update() functions + * on processing every file block. The file block + * size is set internally by rhash and now is 8 KiB. + * + * @param ctx rhash context + * @param callback pointer to the callback function + * @param callback_data pointer to data passed to the callback + */ +RHASH_API void rhash_set_callback(rhash ctx, rhash_callback_t callback, void* callback_data) +{ + ((rhash_context_ext*)ctx)->callback = callback; + ((rhash_context_ext*)ctx)->callback_data = callback_data; +} + + +/* hi-level message hashing interface */ + +/** + * Compute a hash of the given message. + * + * @param hash_id id of hash sum to compute + * @param message the message to process + * @param length message length + * @param result buffer to receive binary hash string + * @return 0 on success, -1 on error + */ +RHASH_API int rhash_msg(unsigned hash_id, const void* message, size_t length, unsigned char* result) +{ + rhash ctx; + hash_id &= RHASH_ALL_HASHES; + ctx = rhash_init(hash_id); + if (ctx == NULL) return -1; + rhash_update(ctx, message, length); + rhash_final(ctx, result); + rhash_free(ctx); + return 0; +} + +/** + * Hash a file or stream. Multiple hashes can be computed. + * First, inintialize ctx parameter with rhash_init() before calling + * rhash_file_update(). Then use rhash_final() and rhash_print() + * to retrive hash values. Finaly call rhash_free() on ctx + * to free allocated memory or call rhash_reset() to reuse ctx. + * + * @param ctx rhash context + * @param fd descriptor of the file to hash + * @return 0 on success, -1 on error and errno is set + */ +RHASH_API int rhash_file_update(rhash ctx, FILE* fd) +{ + rhash_context_ext* const ectx = (rhash_context_ext*)ctx; + const size_t block_size = 8192; + unsigned char *buffer, *pmem; + size_t length = 0, align8; + int res = 0; + if (ectx->state != STATE_ACTIVE) return 0; /* do nothing if canceled */ + + if (ctx == NULL) { + errno = EINVAL; + return -1; + } + + pmem = (unsigned char*)malloc(block_size + 8); + if (!pmem) return -1; /* errno is set to ENOMEM according to UNIX 98 */ + + align8 = ((unsigned char*)0 - pmem) & 7; + buffer = pmem + align8; + + while (!feof(fd)) { + /* stop if canceled */ + if (ectx->state != STATE_ACTIVE) break; + + length = fread(buffer, 1, block_size, fd); + + if (ferror(fd)) { + res = -1; /* note: errno contains error code */ + break; + } else if (length) { + rhash_update(ctx, buffer, length); + + if (ectx->callback) { + ((rhash_callback_t)ectx->callback)(ectx->callback_data, ectx->rc.msg_size); + } + } + } + + free(buffer); + return res; +} + +/** + * Compute a single hash for given file. + * + * @param hash_id id of hash sum to compute + * @param filepath path to the file to hash + * @param result buffer to receive hash value with the lowest requested id + * @return 0 on success, -1 on error and errno is set + */ +RHASH_API int rhash_file(unsigned hash_id, const char* filepath, unsigned char* result) +{ + FILE* fd; + rhash ctx; + int res; + + hash_id &= RHASH_ALL_HASHES; + if (hash_id == 0) { + errno = EINVAL; + return -1; + } + + if ((fd = fopen(filepath, "rb")) == NULL) return -1; + + if ((ctx = rhash_init(hash_id)) == NULL) return -1; + + res = rhash_file_update(ctx, fd); /* hash the file */ + fclose(fd); + + rhash_final(ctx, result); + rhash_free(ctx); + return res; +} + +#ifdef _WIN32 /* windows only function */ +#include + +/** + * Compute a single hash for given file. + * + * @param hash_id id of hash sum to compute + * @param filepath path to the file to hash + * @param result buffer to receive hash value with the lowest requested id + * @return 0 on success, -1 on error, -1 on error and errno is set + */ +RHASH_API int rhash_wfile(unsigned hash_id, const wchar_t* filepath, unsigned char* result) +{ + FILE* fd; + rhash ctx; + int res; + + hash_id &= RHASH_ALL_HASHES; + if (hash_id == 0) { + errno = EINVAL; + return -1; + } + + if ((fd = _wfsopen(filepath, L"rb", _SH_DENYWR)) == NULL) return -1; + + if ((ctx = rhash_init(hash_id)) == NULL) return -1; + + res = rhash_file_update(ctx, fd); /* hash the file */ + fclose(fd); + + rhash_final(ctx, result); + rhash_free(ctx); + return res; +} +#endif + +/* RHash information functions */ + +/** + * Returns information about a hash function by its hash_id. + * + * @param hash_id the id of hash algorithm + * @return pointer to the rhash_info structure containing the information + */ +const rhash_info* rhash_info_by_id(unsigned hash_id) +{ + hash_id &= RHASH_ALL_HASHES; + /* check that only one bit is set */ + if (hash_id != (hash_id & -(int)hash_id)) return NULL; + /* note: alternative condition is (hash_id == 0 || (hash_id & (hash_id - 1)) != 0) */ + return rhash_info_table[rhash_ctz(hash_id)].info; +} + +/** + * Detect default digest output format for given hash algorithm. + * + * @param hash_id the id of hash algorithm + * @return 1 for base32 format, 0 for hexadecimal + */ +RHASH_API int rhash_is_base32(unsigned hash_id) +{ + /* fast method is just to test a bit-mask */ + return ((hash_id & (RHASH_TTH | RHASH_AICH)) != 0); +} + +/** + * Returns size of binary digest for given hash algorithm. + * + * @param hash_id the id of hash algorithm + * @return digest size in bytes + */ +RHASH_API int rhash_get_digest_size(unsigned hash_id) +{ + hash_id &= RHASH_ALL_HASHES; + if (hash_id == 0 || (hash_id & (hash_id - 1)) != 0) return -1; + return (int)rhash_info_table[rhash_ctz(hash_id)].info->digest_size; +} + +/** + * Returns length of digest hash string in default output format. + * + * @param hash_id the id of hash algorithm + * @return the length of hash string + */ +RHASH_API int rhash_get_hash_length(unsigned hash_id) +{ + const rhash_info* info = rhash_info_by_id(hash_id); + return (int)(info ? (info->flags & F_BS32 ? + BASE32_LENGTH(info->digest_size) : info->digest_size * 2) : 0); +} + +/** + * Returns a name of given hash algorithm. + * + * @param hash_id the id of hash algorithm + * @return algorithm name + */ +RHASH_API const char* rhash_get_name(unsigned hash_id) +{ + const rhash_info* info = rhash_info_by_id(hash_id); + return (info ? info->name : 0); +} + +/** + * Returns a name part of magnet urn of the given hash algorithm. + * Such magnet_name is used to generate a magnet link of the form + * urn:<magnet_name>=<hash_value>. + * + * @param hash_id the id of hash algorithm + * @return name + */ +RHASH_API const char* rhash_get_magnet_name(unsigned hash_id) +{ + const rhash_info* info = rhash_info_by_id(hash_id); + return (info ? info->magnet_name : 0); +} + +static size_t rhash_get_magnet_url_size(const char* filepath, + rhash context, unsigned hash_mask, int flags) +{ + size_t size = 0; /* count terminating '\0' */ + unsigned bit, hash = context->hash_id & hash_mask; + + /* RHPR_NO_MAGNET, RHPR_FILESIZE */ + if ((flags & RHPR_NO_MAGNET) == 0) { + size += 8; + } + + if ((flags & RHPR_FILESIZE) != 0) { + uint64_t num = context->msg_size; + + size += 4; + if (num == 0) size++; + else { + for (; num; num /= 10, size++); + } + } + + if (filepath) { + size += 4 + rhash_urlencode(NULL, filepath); + } + + /* loop through hash values */ + for (bit = hash & -(int)hash; bit <= hash; bit <<= 1) { + const char* name; + if ((bit & hash) == 0) continue; + if ((name = rhash_get_magnet_name(bit)) == 0) continue; + + size += (7 + 2) + strlen(name); + size += rhash_print(NULL, context, bit, + (bit & (RHASH_SHA1 | RHASH_BTIH) ? RHPR_BASE32 : 0)); + } + + return size; +} + +/** + * Print magnet link with given filepath and calculated hash sums into the + * output buffer. The hash_mask can limit which hash values will be printed. + * The function returns the size of the required buffer. + * If output is NULL the . + * + * @param output a string buffer to receive the magnet link or NULL + * @param filepath the file path to be printed or NULL + * @param context algorithms state + * @param hash_mask bit mask of the hash sums to add to the link + * @param flags can be combination of bits RHPR_UPPERCASE, RHPR_NO_MAGNET, + * RHPR_FILESIZE + * @return number of written characters, including terminating '\0' on success, 0 on fail + */ +RHASH_API size_t rhash_print_magnet(char* output, const char* filepath, + rhash context, unsigned hash_mask, int flags) +{ + int i; + const char* begin = output; + + if (output == NULL) return rhash_get_magnet_url_size( + filepath, context, hash_mask, flags); + + /* RHPR_NO_MAGNET, RHPR_FILESIZE */ + if ((flags & RHPR_NO_MAGNET) == 0) { + strcpy(output, "magnet:?"); + output += 8; + } + + if ((flags & RHPR_FILESIZE) != 0) { + strcpy(output, "xl="); + output += 3; + output += rhash_sprintI64(output, context->msg_size); + *(output++) = '&'; + } + + if (filepath) { + strcpy(output, "dn="); + output += 3; + output += rhash_urlencode(output, filepath); + *(output++) = '&'; + } + flags &= RHPR_UPPERCASE; + + for (i = 0; i < 2; i++) { + unsigned bit; + unsigned hash = context->hash_id & hash_mask; + hash = (i == 0 ? hash & (RHASH_ED2K | RHASH_AICH) + : hash & ~(RHASH_ED2K | RHASH_AICH)); + if (!hash) continue; + + /* loop through hash values */ + for (bit = hash & -(int)hash; bit <= hash; bit <<= 1) { + const char* name; + if ((bit & hash) == 0) continue; + if (!(name = rhash_get_magnet_name(bit))) continue; + + strcpy(output, "xt=urn:"); + output += 7; + strcpy(output, name); + output += strlen(name); + *(output++) = ':'; + output += rhash_print(output, context, bit, + (bit & (RHASH_SHA1 | RHASH_BTIH) ? flags | RHPR_BASE32 : flags)); + *(output++) = '&'; + } + } + output[-1] = '\0'; /* terminate the line */ + + return (output - begin); +} + +/* hash sum output */ + +/** + * Print a text presentation of a given hash sum to the specified buffer, + * + * @param output a buffer to print the hash to + * @param bytes a hash sum to print + * @param size a size of hash sum in bytes + * @param flags a bit-mask controlling how to format the hash sum, + * can be a mix of the flags: RHPR_RAW, RHPR_HEX, RHPR_BASE32, + * RHPR_BASE64, RHPR_UPPERCASE, RHPR_REVERSE + * @return the number of written characters + */ +size_t rhash_print_bytes(char* output, const unsigned char* bytes, + size_t size, int flags) +{ + size_t str_len; + int upper_case = (flags & RHPR_UPPERCASE); + int format = (flags & ~RHPR_MODIFIER); + + switch (format) { + case RHPR_HEX: + str_len = size * 2; + rhash_byte_to_hex(output, bytes, (unsigned)size, upper_case); + break; + case RHPR_BASE32: + str_len = BASE32_LENGTH(size); + rhash_byte_to_base32(output, bytes, (unsigned)size, upper_case); + break; + case RHPR_BASE64: + str_len = BASE64_LENGTH(size); + rhash_byte_to_base64(output, bytes, (unsigned)size); + break; + default: + str_len = size; + memcpy(output, bytes, size); + break; + } + return str_len; +} + +/** + * Print text presentation of a hash sum with given hash_id to the specified + * output buffer. If the hash_id is zero, then print the hash sum with + * the lowest id stored in the hash context. + * The function call fails if the context doesn't include a hash with the + * given hash_id. + * + * @param output a buffer to print the hash to + * @param context algorithms state + * @param hash_id id of the hash sum to print or 0 to print the first hash + * saved in the context. + * @param flags a bitmask controlling how to print the hash. Can contain flags + * RHPR_UPPERCASE, RHPR_HEX, RHPR_BASE32, RHPR_BASE64, etc. + * @return the number of written characters on success or 0 on fail + */ +size_t RHASH_API rhash_print(char* output, rhash context, unsigned hash_id, int flags) +{ + const rhash_info* info; + unsigned char digest[80]; + size_t digest_size; + + info = (hash_id != 0 ? rhash_info_by_id(hash_id) : + ((rhash_context_ext*)context)->vector[0].hash_info->info); + + if (info == NULL) return 0; + digest_size = info->digest_size; + assert(digest_size <= 64); + + flags &= (RHPR_FORMAT | RHPR_MODIFIER); + if ((flags & RHPR_FORMAT) == 0) { + /* use default format if not specified by flags */ + flags |= (info->flags & RHASH_INFO_BASE32 ? RHPR_BASE32 : RHPR_HEX); + } + + if (output == NULL) { + switch (flags & RHPR_FORMAT) { + case RHPR_HEX: + return (digest_size * 2); + case RHPR_BASE32: + return BASE32_LENGTH(digest_size); + case RHPR_BASE64: + return BASE64_LENGTH(digest_size); + default: + return digest_size; + } + } + + /* note: use info->hash_id, cause hash_id can be 0 */ + rhash_put_digest(context, info->hash_id, digest); + + if ((flags & ~RHPR_UPPERCASE) == (RHPR_REVERSE | RHPR_HEX)) { + /* reverse the digest */ + unsigned char *p = digest, *r = digest + digest_size - 1; + char tmp; + for (; p < r; p++, r--) { + tmp = *p; + *p = *r; + *r = tmp; + } + } + + return rhash_print_bytes(output, digest, digest_size, flags); +} + +#if defined(_WIN32) && defined(RHASH_EXPORTS) +#include +BOOL APIENTRY DllMain(HMODULE hModule, DWORD reason, LPVOID reserved); +BOOL APIENTRY DllMain(HMODULE hModule, DWORD reason, LPVOID reserved) +{ + (void)hModule; + (void)reserved; + switch (reason) { + case DLL_PROCESS_ATTACH: + rhash_library_init(); + break; + case DLL_PROCESS_DETACH: + /*rhash_library_free();*/ + case DLL_THREAD_ATTACH: + case DLL_THREAD_DETACH: + break; + } + return TRUE; +} +#endif + +/** + * Process a BitTorrent-related rhash message. + * + * @param msg_id message identifier + * @param bt BitTorrent context + * @param ldata data depending on message + * @param rdata data depending on message + * @return message-specific data + */ +static rhash_uptr_t process_bt_msg(unsigned msg_id, torrent_ctx* bt, rhash_uptr_t ldata, rhash_uptr_t rdata) +{ + if (bt == NULL) return RHASH_ERROR; + + switch (msg_id) { + case RMSG_BT_ADD_FILE: + bt_add_file(bt, (const char*)ldata, *(unsigned long long*)rdata); + break; + case RMSG_BT_SET_OPTIONS: + bt_set_options(bt, (unsigned)ldata); + break; + case RMSG_BT_SET_ANNOUNCE: + bt_add_announce(bt, (const char*)ldata); + break; + case RMSG_BT_SET_PIECE_LENGTH: + bt_set_piece_length(bt, (size_t)ldata); + break; + case RMSG_BT_SET_BATCH_SIZE: + bt_set_piece_length(bt, + bt_default_piece_length(*(unsigned long long*)ldata)); + break; + case RMSG_BT_SET_PROGRAM_NAME: + bt_set_program_name(bt, (const char*)ldata); + break; + case RMSG_BT_GET_TEXT: + return (rhash_uptr_t)bt_get_text(bt, (char**)ldata); + default: + return RHASH_ERROR; /* unknown message */ + } + return 0; +} + +#define PVOID2UPTR(p) ((rhash_uptr_t)((char*)p - 0)) + +/** + * Process a rhash message. + * + * @param msg_id message identifier + * @param dst message destination (can be NULL for generic messages) + * @param ldata data depending on message + * @param rdata data depending on message + * @return message-specific data + */ +RHASH_API rhash_uptr_t rhash_transmit(unsigned msg_id, void* dst, rhash_uptr_t ldata, rhash_uptr_t rdata) +{ + /* for messages working with rhash context */ + rhash_context_ext* const ctx = (rhash_context_ext*)dst; + + switch (msg_id) { + case RMSG_GET_CONTEXT: + { + unsigned i; + for (i = 0; i < ctx->hash_vector_size; i++) { + struct rhash_hash_info* info = ctx->vector[i].hash_info; + if (info->info->hash_id == (unsigned)ldata) + return PVOID2UPTR(ctx->vector[i].context); + } + return (rhash_uptr_t)0; + } + + case RMSG_CANCEL: + /* mark rhash context as canceled, in a multithreaded program */ + atomic_compare_and_swap(&ctx->state, STATE_ACTIVE, STATE_STOPED); + return 0; + + case RMSG_IS_CANCELED: + return (ctx->state == STATE_STOPED); + + case RMSG_GET_FINALIZED: + return ((ctx->flags & RCTX_FINALIZED) != 0); + case RMSG_SET_AUTOFINAL: + ctx->flags &= ~RCTX_AUTO_FINAL; + if (ldata) ctx->flags |= RCTX_AUTO_FINAL; + break; + + /* OpenSSL related messages */ +#ifdef USE_OPENSSL + case RMSG_SET_OPENSSL_MASK: + rhash_openssl_hash_mask = (unsigned)ldata; + break; + case RMSG_GET_OPENSSL_MASK: + return rhash_openssl_hash_mask; +#endif + + /* BitTorrent related messages */ + case RMSG_BT_ADD_FILE: + case RMSG_BT_SET_OPTIONS: + case RMSG_BT_SET_ANNOUNCE: + case RMSG_BT_SET_PIECE_LENGTH: + case RMSG_BT_SET_PROGRAM_NAME: + case RMSG_BT_GET_TEXT: + case RMSG_BT_SET_BATCH_SIZE: + return process_bt_msg(msg_id, (torrent_ctx*)(((rhash_context_ext*)dst)->bt_ctx), ldata, rdata); + + default: + return RHASH_ERROR; /* unknown message */ + } + return 0; +} diff --git a/librhash/rhash.h b/librhash/rhash.h new file mode 100644 index 0000000..73ee537 --- /dev/null +++ b/librhash/rhash.h @@ -0,0 +1,273 @@ +/** @file rhash.h LibRHash interface */ +#ifndef RHASH_H +#define RHASH_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef RHASH_API +/* modifier for LibRHash functions */ +# define RHASH_API +#endif + +/** + * Identifiers of supported hash functions. + * The rhash_init() function allows mixing several ids using + * binary OR, to calculate several hash functions for one message. + */ +enum rhash_ids +{ + RHASH_CRC32 = 0x01, + RHASH_MD4 = 0x02, + RHASH_MD5 = 0x04, + RHASH_SHA1 = 0x08, + RHASH_TIGER = 0x10, + RHASH_TTH = 0x20, + RHASH_BTIH = 0x40, + RHASH_ED2K = 0x80, + RHASH_AICH = 0x100, + RHASH_WHIRLPOOL = 0x200, + RHASH_RIPEMD160 = 0x400, + RHASH_GOST = 0x800, + RHASH_GOST_CRYPTOPRO = 0x1000, + RHASH_HAS160 = 0x2000, + RHASH_SNEFRU128 = 0x4000, + RHASH_SNEFRU256 = 0x8000, + RHASH_SHA224 = 0x10000, + RHASH_SHA256 = 0x20000, + RHASH_SHA384 = 0x40000, + RHASH_SHA512 = 0x80000, + RHASH_EDONR256 = 0x0100000, + RHASH_EDONR512 = 0x0200000, + RHASH_SHA3_224 = 0x0400000, + RHASH_SHA3_256 = 0x0800000, + RHASH_SHA3_384 = 0x1000000, + RHASH_SHA3_512 = 0x2000000, + + /** The bit-mask containing all supported hashe functions */ + RHASH_ALL_HASHES = RHASH_CRC32 | RHASH_MD4 | RHASH_MD5 | RHASH_ED2K | RHASH_SHA1 | + RHASH_TIGER | RHASH_TTH | RHASH_GOST | RHASH_GOST_CRYPTOPRO | + RHASH_BTIH | RHASH_AICH | RHASH_WHIRLPOOL | RHASH_RIPEMD160 | + RHASH_HAS160 | RHASH_SNEFRU128 | RHASH_SNEFRU256 | + RHASH_SHA224 | RHASH_SHA256 | RHASH_SHA384 | RHASH_SHA512 | + RHASH_SHA3_224 | RHASH_SHA3_256 | RHASH_SHA3_384 | RHASH_SHA3_512 | + RHASH_EDONR256 | RHASH_EDONR512, + + /** The number of supported hash functions */ + RHASH_HASH_COUNT = 26 +}; + +/** + * The rhash context structure contains contexts for several hash functions + */ +typedef struct rhash_context +{ + /** The size of the hashed message */ + unsigned long long msg_size; + + /** + * The bit-mask containing identifiers of the hashes being calculated + */ + unsigned hash_id; +} rhash_context; + +#ifndef LIBRHASH_RHASH_CTX_DEFINED +#define LIBRHASH_RHASH_CTX_DEFINED +/** + * Hashing context. + */ +typedef struct rhash_context* rhash; +#endif /* LIBRHASH_RHASH_CTX_DEFINED */ + +/** type of a callback to be called periodically while hashing a file */ +typedef void (*rhash_callback_t)(void* data, unsigned long long offset); + +RHASH_API void rhash_library_init(void); /* initialize static data */ + +/* hi-level hashing functions */ +RHASH_API int rhash_msg(unsigned hash_id, const void* message, size_t length, unsigned char* result); +RHASH_API int rhash_file(unsigned hash_id, const char* filepath, unsigned char* result); +RHASH_API int rhash_file_update(rhash ctx, FILE* fd); + +#ifdef _WIN32 /* windows only function */ +RHASH_API int rhash_wfile(unsigned hash_id, const wchar_t* filepath, unsigned char* result); +#endif + +/* lo-level interface */ +RHASH_API rhash rhash_init(unsigned hash_id); +/*RHASH_API rhash rhash_init_by_ids(unsigned hash_ids[], unsigned count);*/ +RHASH_API int rhash_update(rhash ctx, const void* message, size_t length); +RHASH_API int rhash_final(rhash ctx, unsigned char* first_result); +RHASH_API void rhash_reset(rhash ctx); /* reinitialize the context */ +RHASH_API void rhash_free(rhash ctx); + +/* additional lo-level functions */ +RHASH_API void rhash_set_callback(rhash ctx, rhash_callback_t callback, void* callback_data); + +/** bit-flag: default hash output format is base32 */ +#define RHASH_INFO_BASE32 1 + +/** + * Information about a hash function. + */ +typedef struct rhash_info +{ + /** hash function indentifier */ + unsigned hash_id; + /** flags bit-mask, including RHASH_INFO_BASE32 bit */ + unsigned flags; + /** size of binary message digest in bytes */ + size_t digest_size; + const char* name; + const char* magnet_name; +} rhash_info; + +/* information functions */ +RHASH_API int rhash_count(void); /* number of supported hashes */ +RHASH_API int rhash_get_digest_size(unsigned hash_id); /* size of binary message digest */ +RHASH_API int rhash_get_hash_length(unsigned hash_id); /* length of formated hash string */ +RHASH_API int rhash_is_base32(unsigned hash_id); /* default digest output format */ +RHASH_API const char* rhash_get_name(unsigned hash_id); /* get hash function name */ +RHASH_API const char* rhash_get_magnet_name(unsigned hash_id); /* get name part of magnet urn */ + +/* note, that rhash_info_by_id() is not exported to a shared library or DLL */ +const rhash_info* rhash_info_by_id(unsigned hash_id); /* get hash sum info by hash id */ + +/** + * Flags for printing a hash sum + */ +enum rhash_print_sum_flags +{ + /** print in a default format */ + RHPR_DEFAULT = 0x0, + /** output as binary message digest */ + RHPR_RAW = 0x1, + /** print as a hexadecimal string */ + RHPR_HEX = 0x2, + /** print as a base32-encoded string */ + RHPR_BASE32 = 0x3, + /** print as a base64-encoded string */ + RHPR_BASE64 = 0x4, + + /** + * Print as an uppercase string. Can be used + * for base32 or hexadecimal format only. + */ + RHPR_UPPERCASE = 0x8, + + /** + * Reverse hash bytes. Can be used for GOST hash. + */ + RHPR_REVERSE = 0x10, + + /** don't print 'magnet:?' prefix in rhash_print_magnet */ + RHPR_NO_MAGNET = 0x20, + /** print file size in rhash_print_magnet */ + RHPR_FILESIZE = 0x40, +}; + +/* output hash into the given buffer */ +RHASH_API size_t rhash_print_bytes(char* output, + const unsigned char* bytes, size_t size, int flags); + +RHASH_API size_t rhash_print(char* output, rhash ctx, unsigned hash_id, + int flags); + +/* output magnet URL into the given buffer */ +RHASH_API size_t rhash_print_magnet(char* output, const char* filepath, + rhash context, unsigned hash_mask, int flags); + +/* macros for message API */ + +/** The type of an unsigned integer large enough to hold a pointer */ +#if defined(UINTPTR_MAX) +typedef uintptr_t rhash_uptr_t; +#elif defined(_LP64) || defined(__LP64__) || defined(__x86_64) || \ + defined(__x86_64__) || defined(_M_AMD64) || defined(_M_X64) +typedef unsigned long long rhash_uptr_t; +#else +typedef unsigned long rhash_uptr_t; +#endif + +/** The value returned by rhash_transmit on error */ +#define RHASH_ERROR ((rhash_uptr_t)-1) +/** Convert a pointer to rhash_uptr_t */ +#define RHASH_STR2UPTR(str) ((rhash_uptr_t)(char*)(str)) +/** Convert a rhash_uptr_t to a void* pointer */ +#define RHASH_UPTR2PVOID(u) ((void*)((char*)0 + (u))) + +/* rhash API to set/get data via messages */ +RHASH_API rhash_uptr_t rhash_transmit( + unsigned msg_id, void* dst, rhash_uptr_t ldata, rhash_uptr_t rdata); + +/* rhash message constants */ + +#define RMSG_GET_CONTEXT 1 +#define RMSG_CANCEL 2 +#define RMSG_IS_CANCELED 3 +#define RMSG_GET_FINALIZED 4 +#define RMSG_SET_AUTOFINAL 5 +#define RMSG_SET_OPENSSL_MASK 10 +#define RMSG_GET_OPENSSL_MASK 11 + +#define RMSG_BT_ADD_FILE 32 +#define RMSG_BT_SET_OPTIONS 33 +#define RMSG_BT_SET_ANNOUNCE 34 +#define RMSG_BT_SET_PIECE_LENGTH 35 +#define RMSG_BT_SET_PROGRAM_NAME 36 +#define RMSG_BT_GET_TEXT 37 +#define RMSG_BT_SET_BATCH_SIZE 38 + +/* possible BitTorrent options for the RMSG_BT_SET_OPTIONS message */ +#define RHASH_BT_OPT_PRIVATE 1 +#define RHASH_BT_OPT_INFOHASH_ONLY 2 + +/* helper macros */ + +/** Get a pointer to context of the specified hash function */ +#define rhash_get_context_ptr(ctx, hash_id) RHASH_UPTR2PVOID(rhash_transmit(RMSG_GET_CONTEXT, ctx, hash_id, 0)) +/** Cancel hash calculation of a file */ +#define rhash_cancel(ctx) rhash_transmit(RMSG_CANCEL, ctx, 0, 0) +/** Return non-zero if hash calculation was canceled, zero otherwise */ +#define rhash_is_canceled(ctx) rhash_transmit(RMSG_IS_CANCELED, ctx, 0, 0) +/** Return non-zero if rhash_final was called for rhash_context */ +#define rhash_get_finalized(ctx) rhash_transmit(RMSG_GET_FINALIZED, ctx, 0, 0) + +/** + * Turn on/off the auto-final flag for the given rhash_context. By default + * auto-final is on, which means rhash_final is called automatically, if + * needed when a hash value is retrived by rhash_print call. + */ +#define rhash_set_autofinal(ctx, on) rhash_transmit(RMSG_SET_AUTOFINAL, ctx, on, 0) + +/** + * Set the bit-mask of hash algorithms to be calculated by OpenSSL library. + * The call rhash_set_openssl_mask(0) made before rhash_library_init(), + * turns off loading of the OpenSSL dynamic library. + * This call works if the LibRHash was compiled with OpenSSL support. + */ +#define rhash_set_openssl_mask(mask) rhash_transmit(RMSG_SET_OPENSSL_MASK, NULL, mask, 0) + +/** + * Return current bit-mask of hash algorithms selected to be calculated + * by OpenSSL library. + */ +#define rhash_get_openssl_mask() rhash_transmit(RMSG_GET_OPENSSL_MASK, NULL, 0, 0) + +/** The bit mask of hash algorithms implemented by OpenSSL */ +#if defined(USE_OPENSSL) || defined(OPENSSL_RUNTIME) +# define RHASH_OPENSSL_SUPPORTED_HASHES (RHASH_MD4 | RHASH_MD5 | \ + RHASH_SHA1 | RHASH_SHA224 | RHASH_SHA256 | RHASH_SHA384 | \ + RHASH_SHA512 | RHASH_RIPEMD160 | RHASH_WHIRLPOOL) +#else +# define RHASH_OPENSSL_SUPPORTED_HASHES 0 +#endif + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ + +#endif /* RHASH_H */ diff --git a/librhash/sha1.c b/librhash/sha1.c new file mode 100644 index 0000000..f5a053b --- /dev/null +++ b/librhash/sha1.c @@ -0,0 +1,196 @@ +/* sha1.c - an implementation of Secure Hash Algorithm 1 (SHA1) + * based on RFC 3174. + * + * Copyright: 2008-2012 Aleksey Kravchenko + * + * 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. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. Use this program at your own risk! + */ + +#include +#include "byte_order.h" +#include "sha1.h" + +/** + * Initialize context before calculaing hash. + * + * @param ctx context to initialize + */ +void rhash_sha1_init(sha1_ctx *ctx) +{ + ctx->length = 0; + + /* initialize algorithm state */ + ctx->hash[0] = 0x67452301; + ctx->hash[1] = 0xefcdab89; + ctx->hash[2] = 0x98badcfe; + ctx->hash[3] = 0x10325476; + ctx->hash[4] = 0xc3d2e1f0; +} + +/** + * The core transformation. Process a 512-bit block. + * The function has been taken from RFC 3174 with little changes. + * + * @param hash algorithm state + * @param block the message block to process + */ +static void rhash_sha1_process_block(unsigned* hash, const unsigned* block) +{ + int t; /* Loop counter */ + uint32_t temp; /* Temporary word value */ + uint32_t W[80]; /* Word sequence */ + uint32_t A, B, C, D, E; /* Word buffers */ + + /* initialize the first 16 words in the array W */ + for (t = 0; t < 16; t++) { + /* note: it is much faster to apply be2me here, then using be32_copy */ + W[t] = be2me_32(block[t]); + } + + /* initialize the rest */ + for (t = 16; t < 80; t++) { + W[t] = ROTL32(W[t - 3] ^ W[t - 8] ^ W[t - 14] ^ W[t - 16], 1); + } + + A = hash[0]; + B = hash[1]; + C = hash[2]; + D = hash[3]; + E = hash[4]; + + for (t = 0; t < 20; t++) { + /* the following is faster than ((B & C) | ((~B) & D)) */ + temp = ROTL32(A, 5) + (((C ^ D) & B) ^ D) + + E + W[t] + 0x5A827999; + E = D; + D = C; + C = ROTL32(B, 30); + B = A; + A = temp; + } + + for (t = 20; t < 40; t++) { + temp = ROTL32(A, 5) + (B ^ C ^ D) + E + W[t] + 0x6ED9EBA1; + E = D; + D = C; + C = ROTL32(B, 30); + B = A; + A = temp; + } + + for (t = 40; t < 60; t++) { + temp = ROTL32(A, 5) + ((B & C) | (B & D) | (C & D)) + + E + W[t] + 0x8F1BBCDC; + E = D; + D = C; + C = ROTL32(B, 30); + B = A; + A = temp; + } + + for (t = 60; t < 80; t++) { + temp = ROTL32(A, 5) + (B ^ C ^ D) + E + W[t] + 0xCA62C1D6; + E = D; + D = C; + C = ROTL32(B, 30); + B = A; + A = temp; + } + + hash[0] += A; + hash[1] += B; + hash[2] += C; + hash[3] += D; + hash[4] += E; +} + +/** + * Calculate message hash. + * Can be called repeatedly with chunks of the message to be hashed. + * + * @param ctx the algorithm context containing current hashing state + * @param msg message chunk + * @param size length of the message chunk + */ +void rhash_sha1_update(sha1_ctx *ctx, const unsigned char* msg, size_t size) +{ + unsigned index = (unsigned)ctx->length & 63; + ctx->length += size; + + /* fill partial block */ + if (index) { + unsigned left = sha1_block_size - index; + memcpy(ctx->message + index, msg, (size < left ? size : left)); + if (size < left) return; + + /* process partial block */ + rhash_sha1_process_block(ctx->hash, (unsigned*)ctx->message); + msg += left; + size -= left; + } + while (size >= sha1_block_size) { + unsigned* aligned_message_block; + if (IS_ALIGNED_32(msg)) { + /* the most common case is processing of an already aligned message + without copying it */ + aligned_message_block = (unsigned*)msg; + } else { + memcpy(ctx->message, msg, sha1_block_size); + aligned_message_block = (unsigned*)ctx->message; + } + + rhash_sha1_process_block(ctx->hash, aligned_message_block); + msg += sha1_block_size; + size -= sha1_block_size; + } + if (size) { + /* save leftovers */ + memcpy(ctx->message, msg, size); + } +} + +/** + * Store calculated hash into the given array. + * + * @param ctx the algorithm context containing current hashing state + * @param result calculated hash in binary form + */ +void rhash_sha1_final(sha1_ctx *ctx, unsigned char* result) +{ + unsigned index = (unsigned)ctx->length & 63; + unsigned* msg32 = (unsigned*)ctx->message; + + /* pad message and run for last block */ + ctx->message[index++] = 0x80; + while ((index & 3) != 0) { + ctx->message[index++] = 0; + } + index >>= 2; + + /* if no room left in the message to store 64-bit message length */ + if (index > 14) { + /* then fill the rest with zeros and process it */ + while (index < 16) { + msg32[index++] = 0; + } + rhash_sha1_process_block(ctx->hash, msg32); + index = 0; + } + while (index < 14) { + msg32[index++] = 0; + } + msg32[14] = be2me_32( (unsigned)(ctx->length >> 29) ); + msg32[15] = be2me_32( (unsigned)(ctx->length << 3) ); + rhash_sha1_process_block(ctx->hash, msg32); + + if (result) be32_copy(result, 0, &ctx->hash, sha1_hash_size); +} diff --git a/librhash/sha1.h b/librhash/sha1.h new file mode 100644 index 0000000..74b2f94 --- /dev/null +++ b/librhash/sha1.h @@ -0,0 +1,31 @@ +/* sha1.h */ +#ifndef SHA1_H +#define SHA1_H +#include "ustd.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define sha1_block_size 64 +#define sha1_hash_size 20 + +/* algorithm context */ +typedef struct sha1_ctx +{ + unsigned char message[sha1_block_size]; /* 512-bit buffer for leftovers */ + uint64_t length; /* number of processed bytes */ + unsigned hash[5]; /* 160-bit algorithm internal hashing state */ +} sha1_ctx; + +/* hash functions */ + +void rhash_sha1_init(sha1_ctx *ctx); +void rhash_sha1_update(sha1_ctx *ctx, const unsigned char* msg, size_t size); +void rhash_sha1_final(sha1_ctx *ctx, unsigned char* result); + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ + +#endif /* SHA1_H */ diff --git a/librhash/sha256.c b/librhash/sha256.c new file mode 100644 index 0000000..064dfe2 --- /dev/null +++ b/librhash/sha256.c @@ -0,0 +1,241 @@ +/* sha256.c - an implementation of SHA-256/224 hash functions + * based on FIPS 180-3 (Federal Information Processing Standart). + * + * Copyright: 2010-2012 Aleksey Kravchenko + * + * 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. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. Use this program at your own risk! + */ + +#include +#include "byte_order.h" +#include "sha256.h" + +/* SHA-224 and SHA-256 constants for 64 rounds. These words represent + * the first 32 bits of the fractional parts of the cube + * roots of the first 64 prime numbers. */ +static const unsigned rhash_k256[64] = { + 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, + 0x923f82a4, 0xab1c5ed5, 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, + 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, 0xe49b69c1, 0xefbe4786, + 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, + 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, + 0x06ca6351, 0x14292967, 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, + 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, 0xa2bfe8a1, 0xa81a664b, + 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, + 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, + 0x5b9cca4f, 0x682e6ff3, 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, + 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2 +}; + +/* The SHA256/224 functions defined by FIPS 180-3, 4.1.2 */ +/* Optimized version of Ch(x,y,z)=((x & y) | (~x & z)) */ +#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z)))) +/* Optimized version of Maj(x,y,z)=((x & y) ^ (x & z) ^ (y & z)) */ +#define Maj(x,y,z) (((x) & (y)) ^ ((z) & ((x) ^ (y)))) + +#define Sigma0(x) (ROTR32((x), 2) ^ ROTR32((x), 13) ^ ROTR32((x), 22)) +#define Sigma1(x) (ROTR32((x), 6) ^ ROTR32((x), 11) ^ ROTR32((x), 25)) +#define sigma0(x) (ROTR32((x), 7) ^ ROTR32((x), 18) ^ ((x) >> 3)) +#define sigma1(x) (ROTR32((x),17) ^ ROTR32((x), 19) ^ ((x) >> 10)) + +/* Recalculate element n-th of circular buffer W using formula + * W[n] = sigma1(W[n - 2]) + W[n - 7] + sigma0(W[n - 15]) + W[n - 16]; */ +#define RECALCULATE_W(W,n) (W[n] += \ + (sigma1(W[(n - 2) & 15]) + W[(n - 7) & 15] + sigma0(W[(n - 15) & 15]))) + +#define ROUND(a,b,c,d,e,f,g,h,k,data) { \ + unsigned T1 = h + Sigma1(e) + Ch(e,f,g) + k + (data); \ + d += T1, h = T1 + Sigma0(a) + Maj(a,b,c); } +#define ROUND_1_16(a,b,c,d,e,f,g,h,n) \ + ROUND(a,b,c,d,e,f,g,h, rhash_k256[n], W[n] = be2me_32(block[n])) +#define ROUND_17_64(a,b,c,d,e,f,g,h,n) \ + ROUND(a,b,c,d,e,f,g,h, k[n], RECALCULATE_W(W, n)) + +/** + * Initialize context before calculaing hash. + * + * @param ctx context to initialize + */ +void rhash_sha256_init(sha256_ctx *ctx) +{ + /* Initial values. These words were obtained by taking the first 32 + * bits of the fractional parts of the square roots of the first + * eight prime numbers. */ + static const unsigned SHA256_H0[8] = { + 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, + 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19 + }; + + ctx->length = 0; + ctx->digest_length = sha256_hash_size; + + /* initialize algorithm state */ + memcpy(ctx->hash, SHA256_H0, sizeof(ctx->hash)); +} + +/** + * Initialize context before calculaing hash. + * + * @param ctx context to initialize + */ +void rhash_sha224_init(struct sha256_ctx *ctx) +{ + /* Initial values from FIPS 180-3. These words were obtained by taking + * bits from 33th to 64th of the fractional parts of the square + * roots of ninth through sixteenth prime numbers. */ + static const unsigned SHA224_H0[8] = { + 0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939, + 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4 + }; + + ctx->length = 0; + ctx->digest_length = sha224_hash_size; + + memcpy(ctx->hash, SHA224_H0, sizeof(ctx->hash)); +} + +/** + * The core transformation. Process a 512-bit block. + * + * @param hash algorithm state + * @param block the message block to process + */ +static void rhash_sha256_process_block(unsigned hash[8], unsigned block[16]) +{ + unsigned A, B, C, D, E, F, G, H; + unsigned W[16]; + const unsigned *k; + int i; + + A = hash[0], B = hash[1], C = hash[2], D = hash[3]; + E = hash[4], F = hash[5], G = hash[6], H = hash[7]; + + /* Compute SHA using alternate Method: FIPS 180-3 6.1.3 */ + ROUND_1_16(A, B, C, D, E, F, G, H, 0); + ROUND_1_16(H, A, B, C, D, E, F, G, 1); + ROUND_1_16(G, H, A, B, C, D, E, F, 2); + ROUND_1_16(F, G, H, A, B, C, D, E, 3); + ROUND_1_16(E, F, G, H, A, B, C, D, 4); + ROUND_1_16(D, E, F, G, H, A, B, C, 5); + ROUND_1_16(C, D, E, F, G, H, A, B, 6); + ROUND_1_16(B, C, D, E, F, G, H, A, 7); + ROUND_1_16(A, B, C, D, E, F, G, H, 8); + ROUND_1_16(H, A, B, C, D, E, F, G, 9); + ROUND_1_16(G, H, A, B, C, D, E, F, 10); + ROUND_1_16(F, G, H, A, B, C, D, E, 11); + ROUND_1_16(E, F, G, H, A, B, C, D, 12); + ROUND_1_16(D, E, F, G, H, A, B, C, 13); + ROUND_1_16(C, D, E, F, G, H, A, B, 14); + ROUND_1_16(B, C, D, E, F, G, H, A, 15); + + for (i = 16, k = &rhash_k256[16]; i < 64; i += 16, k += 16) { + ROUND_17_64(A, B, C, D, E, F, G, H, 0); + ROUND_17_64(H, A, B, C, D, E, F, G, 1); + ROUND_17_64(G, H, A, B, C, D, E, F, 2); + ROUND_17_64(F, G, H, A, B, C, D, E, 3); + ROUND_17_64(E, F, G, H, A, B, C, D, 4); + ROUND_17_64(D, E, F, G, H, A, B, C, 5); + ROUND_17_64(C, D, E, F, G, H, A, B, 6); + ROUND_17_64(B, C, D, E, F, G, H, A, 7); + ROUND_17_64(A, B, C, D, E, F, G, H, 8); + ROUND_17_64(H, A, B, C, D, E, F, G, 9); + ROUND_17_64(G, H, A, B, C, D, E, F, 10); + ROUND_17_64(F, G, H, A, B, C, D, E, 11); + ROUND_17_64(E, F, G, H, A, B, C, D, 12); + ROUND_17_64(D, E, F, G, H, A, B, C, 13); + ROUND_17_64(C, D, E, F, G, H, A, B, 14); + ROUND_17_64(B, C, D, E, F, G, H, A, 15); + } + + hash[0] += A, hash[1] += B, hash[2] += C, hash[3] += D; + hash[4] += E, hash[5] += F, hash[6] += G, hash[7] += H; +} + +/** + * Calculate message hash. + * Can be called repeatedly with chunks of the message to be hashed. + * + * @param ctx the algorithm context containing current hashing state + * @param msg message chunk + * @param size length of the message chunk + */ +void rhash_sha256_update(sha256_ctx *ctx, const unsigned char *msg, size_t size) +{ + size_t index = (size_t)ctx->length & 63; + ctx->length += size; + + /* fill partial block */ + if (index) { + size_t left = sha256_block_size - index; + memcpy((char*)ctx->message + index, msg, (size < left ? size : left)); + if (size < left) return; + + /* process partial block */ + rhash_sha256_process_block(ctx->hash, (unsigned*)ctx->message); + msg += left; + size -= left; + } + while (size >= sha256_block_size) { + unsigned* aligned_message_block; + if (IS_ALIGNED_32(msg)) { + /* the most common case is processing of an already aligned message + without copying it */ + aligned_message_block = (unsigned*)msg; + } else { + memcpy(ctx->message, msg, sha256_block_size); + aligned_message_block = (unsigned*)ctx->message; + } + + rhash_sha256_process_block(ctx->hash, aligned_message_block); + msg += sha256_block_size; + size -= sha256_block_size; + } + if (size) { + memcpy(ctx->message, msg, size); /* save leftovers */ + } +} + +/** + * Store calculated hash into the given array. + * + * @param ctx the algorithm context containing current hashing state + * @param result calculated hash in binary form + */ +void rhash_sha256_final(sha256_ctx *ctx, unsigned char* result) +{ + size_t index = ((unsigned)ctx->length & 63) >> 2; + unsigned shift = ((unsigned)ctx->length & 3) * 8; + + /* pad message and run for last block */ + + /* append the byte 0x80 to the message */ + ctx->message[index] &= le2me_32(~(0xFFFFFFFF << shift)); + ctx->message[index++] ^= le2me_32(0x80 << shift); + + /* if no room left in the message to store 64-bit message length */ + if (index > 14) { + /* then fill the rest with zeros and process it */ + while (index < 16) { + ctx->message[index++] = 0; + } + rhash_sha256_process_block(ctx->hash, ctx->message); + index = 0; + } + while (index < 14) { + ctx->message[index++] = 0; + } + ctx->message[14] = be2me_32( (unsigned)(ctx->length >> 29) ); + ctx->message[15] = be2me_32( (unsigned)(ctx->length << 3) ); + rhash_sha256_process_block(ctx->hash, ctx->message); + + if (result) be32_copy(result, 0, ctx->hash, ctx->digest_length); +} diff --git a/librhash/sha256.h b/librhash/sha256.h new file mode 100644 index 0000000..f87ebaa --- /dev/null +++ b/librhash/sha256.h @@ -0,0 +1,32 @@ +/* sha.h sha256 and sha224 hash functions */ +#ifndef SHA256_H +#define SHA256_H +#include "ustd.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define sha256_block_size 64 +#define sha256_hash_size 32 +#define sha224_hash_size 28 + +/* algorithm context */ +typedef struct sha256_ctx +{ + unsigned message[16]; /* 512-bit buffer for leftovers */ + uint64_t length; /* number of processed bytes */ + unsigned hash[8]; /* 256-bit algorithm internal hashing state */ + unsigned digest_length; /* length of the algorithm digest in bytes */ +} sha256_ctx; + +void rhash_sha224_init(sha256_ctx *ctx); +void rhash_sha256_init(sha256_ctx *ctx); +void rhash_sha256_update(sha256_ctx *ctx, const unsigned char* data, size_t length); +void rhash_sha256_final(sha256_ctx *ctx, unsigned char result[32]); + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ + +#endif /* SHA256_H */ diff --git a/librhash/sha512.c b/librhash/sha512.c new file mode 100644 index 0000000..a3e681d --- /dev/null +++ b/librhash/sha512.c @@ -0,0 +1,255 @@ +/* sha512.c - an implementation of SHA-384/512 hash functions + * based on FIPS 180-3 (Federal Information Processing Standart). + * + * Copyright: 2010-2012 Aleksey Kravchenko + * + * 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. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. Use this program at your own risk! + */ + +#include +#include "byte_order.h" +#include "sha512.h" + +/* SHA-384 and SHA-512 constants for 80 rounds. These qwords represent + * the first 64 bits of the fractional parts of the cube + * roots of the first 80 prime numbers. */ +static const uint64_t rhash_k512[80] = { + I64(0x428a2f98d728ae22), I64(0x7137449123ef65cd), I64(0xb5c0fbcfec4d3b2f), + I64(0xe9b5dba58189dbbc), I64(0x3956c25bf348b538), I64(0x59f111f1b605d019), + I64(0x923f82a4af194f9b), I64(0xab1c5ed5da6d8118), I64(0xd807aa98a3030242), + I64(0x12835b0145706fbe), I64(0x243185be4ee4b28c), I64(0x550c7dc3d5ffb4e2), + I64(0x72be5d74f27b896f), I64(0x80deb1fe3b1696b1), I64(0x9bdc06a725c71235), + I64(0xc19bf174cf692694), I64(0xe49b69c19ef14ad2), I64(0xefbe4786384f25e3), + I64(0x0fc19dc68b8cd5b5), I64(0x240ca1cc77ac9c65), I64(0x2de92c6f592b0275), + I64(0x4a7484aa6ea6e483), I64(0x5cb0a9dcbd41fbd4), I64(0x76f988da831153b5), + I64(0x983e5152ee66dfab), I64(0xa831c66d2db43210), I64(0xb00327c898fb213f), + I64(0xbf597fc7beef0ee4), I64(0xc6e00bf33da88fc2), I64(0xd5a79147930aa725), + I64(0x06ca6351e003826f), I64(0x142929670a0e6e70), I64(0x27b70a8546d22ffc), + I64(0x2e1b21385c26c926), I64(0x4d2c6dfc5ac42aed), I64(0x53380d139d95b3df), + I64(0x650a73548baf63de), I64(0x766a0abb3c77b2a8), I64(0x81c2c92e47edaee6), + I64(0x92722c851482353b), I64(0xa2bfe8a14cf10364), I64(0xa81a664bbc423001), + I64(0xc24b8b70d0f89791), I64(0xc76c51a30654be30), I64(0xd192e819d6ef5218), + I64(0xd69906245565a910), I64(0xf40e35855771202a), I64(0x106aa07032bbd1b8), + I64(0x19a4c116b8d2d0c8), I64(0x1e376c085141ab53), I64(0x2748774cdf8eeb99), + I64(0x34b0bcb5e19b48a8), I64(0x391c0cb3c5c95a63), I64(0x4ed8aa4ae3418acb), + I64(0x5b9cca4f7763e373), I64(0x682e6ff3d6b2b8a3), I64(0x748f82ee5defb2fc), + I64(0x78a5636f43172f60), I64(0x84c87814a1f0ab72), I64(0x8cc702081a6439ec), + I64(0x90befffa23631e28), I64(0xa4506cebde82bde9), I64(0xbef9a3f7b2c67915), + I64(0xc67178f2e372532b), I64(0xca273eceea26619c), I64(0xd186b8c721c0c207), + I64(0xeada7dd6cde0eb1e), I64(0xf57d4f7fee6ed178), I64(0x06f067aa72176fba), + I64(0x0a637dc5a2c898a6), I64(0x113f9804bef90dae), I64(0x1b710b35131c471b), + I64(0x28db77f523047d84), I64(0x32caab7b40c72493), I64(0x3c9ebe0a15c9bebc), + I64(0x431d67c49c100d4c), I64(0x4cc5d4becb3e42b6), I64(0x597f299cfc657e2a), + I64(0x5fcb6fab3ad6faec), I64(0x6c44198c4a475817) +}; + +/* The SHA512/384 functions defined by FIPS 180-3, 4.1.3 */ +/* Optimized version of Ch(x,y,z)=((x & y) | (~x & z)) */ +#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z)))) +/* Optimized version of Maj(x,y,z)=((x & y) ^ (x & z) ^ (y & z)) */ +#define Maj(x,y,z) (((x) & (y)) ^ ((z) & ((x) ^ (y)))) + +#define Sigma0(x) (ROTR64((x), 28) ^ ROTR64((x), 34) ^ ROTR64((x), 39)) +#define Sigma1(x) (ROTR64((x), 14) ^ ROTR64((x), 18) ^ ROTR64((x), 41)) +#define sigma0(x) (ROTR64((x), 1) ^ ROTR64((x), 8) ^ ((x) >> 7)) +#define sigma1(x) (ROTR64((x), 19) ^ ROTR64((x), 61) ^ ((x) >> 6)) + +/* Recalculate element n-th of circular buffer W using formula + * W[n] = sigma1(W[n - 2]) + W[n - 7] + sigma0(W[n - 15]) + W[n - 16]; */ +#define RECALCULATE_W(W,n) (W[n] += \ + (sigma1(W[(n - 2) & 15]) + W[(n - 7) & 15] + sigma0(W[(n - 15) & 15]))) + +#define ROUND(a,b,c,d,e,f,g,h,k,data) { \ + uint64_t T1 = h + Sigma1(e) + Ch(e,f,g) + k + (data); \ + d += T1, h = T1 + Sigma0(a) + Maj(a,b,c); } +#define ROUND_1_16(a,b,c,d,e,f,g,h,n) \ + ROUND(a,b,c,d,e,f,g,h, rhash_k512[n], W[n] = be2me_64(block[n])) +#define ROUND_17_80(a,b,c,d,e,f,g,h,n) \ + ROUND(a,b,c,d,e,f,g,h, k[n], RECALCULATE_W(W, n)) + +/** + * Initialize context before calculating hash. + * + * @param ctx context to initialize + */ +void rhash_sha512_init(sha512_ctx *ctx) +{ + /* Initial values. These words were obtained by taking the first 32 + * bits of the fractional parts of the square roots of the first + * eight prime numbers. */ + static const uint64_t SHA512_H0[8] = { + I64(0x6a09e667f3bcc908), I64(0xbb67ae8584caa73b), I64(0x3c6ef372fe94f82b), + I64(0xa54ff53a5f1d36f1), I64(0x510e527fade682d1), I64(0x9b05688c2b3e6c1f), + I64(0x1f83d9abfb41bd6b), I64(0x5be0cd19137e2179) + }; + + ctx->length = 0; + ctx->digest_length = sha512_hash_size; + + /* initialize algorithm state */ + memcpy(ctx->hash, SHA512_H0, sizeof(ctx->hash)); +} + +/** + * Initialize context before calculaing hash. + * + * @param ctx context to initialize + */ +void rhash_sha384_init(struct sha512_ctx *ctx) +{ + /* Initial values from FIPS 180-3. These words were obtained by taking + * the first sixty-four bits of the fractional parts of the square + * roots of ninth through sixteenth prime numbers. */ + static const uint64_t SHA384_H0[8] = { + I64(0xcbbb9d5dc1059ed8), I64(0x629a292a367cd507), I64(0x9159015a3070dd17), + I64(0x152fecd8f70e5939), I64(0x67332667ffc00b31), I64(0x8eb44a8768581511), + I64(0xdb0c2e0d64f98fa7), I64(0x47b5481dbefa4fa4) + }; + + ctx->length = 0; + ctx->digest_length = sha384_hash_size; + + memcpy(ctx->hash, SHA384_H0, sizeof(ctx->hash)); +} + +/** + * The core transformation. Process a 512-bit block. + * + * @param hash algorithm state + * @param block the message block to process + */ +static void rhash_sha512_process_block(uint64_t hash[8], uint64_t block[16]) +{ + uint64_t A, B, C, D, E, F, G, H; + uint64_t W[16]; + const uint64_t *k; + int i; + + A = hash[0], B = hash[1], C = hash[2], D = hash[3]; + E = hash[4], F = hash[5], G = hash[6], H = hash[7]; + + /* Compute SHA using alternate Method: FIPS 180-3 6.1.3 */ + ROUND_1_16(A, B, C, D, E, F, G, H, 0); + ROUND_1_16(H, A, B, C, D, E, F, G, 1); + ROUND_1_16(G, H, A, B, C, D, E, F, 2); + ROUND_1_16(F, G, H, A, B, C, D, E, 3); + ROUND_1_16(E, F, G, H, A, B, C, D, 4); + ROUND_1_16(D, E, F, G, H, A, B, C, 5); + ROUND_1_16(C, D, E, F, G, H, A, B, 6); + ROUND_1_16(B, C, D, E, F, G, H, A, 7); + ROUND_1_16(A, B, C, D, E, F, G, H, 8); + ROUND_1_16(H, A, B, C, D, E, F, G, 9); + ROUND_1_16(G, H, A, B, C, D, E, F, 10); + ROUND_1_16(F, G, H, A, B, C, D, E, 11); + ROUND_1_16(E, F, G, H, A, B, C, D, 12); + ROUND_1_16(D, E, F, G, H, A, B, C, 13); + ROUND_1_16(C, D, E, F, G, H, A, B, 14); + ROUND_1_16(B, C, D, E, F, G, H, A, 15); + + for (i = 16, k = &rhash_k512[16]; i < 80; i += 16, k += 16) { + ROUND_17_80(A, B, C, D, E, F, G, H, 0); + ROUND_17_80(H, A, B, C, D, E, F, G, 1); + ROUND_17_80(G, H, A, B, C, D, E, F, 2); + ROUND_17_80(F, G, H, A, B, C, D, E, 3); + ROUND_17_80(E, F, G, H, A, B, C, D, 4); + ROUND_17_80(D, E, F, G, H, A, B, C, 5); + ROUND_17_80(C, D, E, F, G, H, A, B, 6); + ROUND_17_80(B, C, D, E, F, G, H, A, 7); + ROUND_17_80(A, B, C, D, E, F, G, H, 8); + ROUND_17_80(H, A, B, C, D, E, F, G, 9); + ROUND_17_80(G, H, A, B, C, D, E, F, 10); + ROUND_17_80(F, G, H, A, B, C, D, E, 11); + ROUND_17_80(E, F, G, H, A, B, C, D, 12); + ROUND_17_80(D, E, F, G, H, A, B, C, 13); + ROUND_17_80(C, D, E, F, G, H, A, B, 14); + ROUND_17_80(B, C, D, E, F, G, H, A, 15); + } + + hash[0] += A, hash[1] += B, hash[2] += C, hash[3] += D; + hash[4] += E, hash[5] += F, hash[6] += G, hash[7] += H; +} + +/** + * Calculate message hash. + * Can be called repeatedly with chunks of the message to be hashed. + * + * @param ctx the algorithm context containing current hashing state + * @param msg message chunk + * @param size length of the message chunk + */ +void rhash_sha512_update(sha512_ctx *ctx, const unsigned char *msg, size_t size) +{ + size_t index = (size_t)ctx->length & 127; + ctx->length += size; + + /* fill partial block */ + if (index) { + size_t left = sha512_block_size - index; + memcpy((char*)ctx->message + index, msg, (size < left ? size : left)); + if (size < left) return; + + /* process partial block */ + rhash_sha512_process_block(ctx->hash, ctx->message); + msg += left; + size -= left; + } + while (size >= sha512_block_size) { + uint64_t* aligned_message_block; + if (IS_ALIGNED_64(msg)) { + /* the most common case is processing of an already aligned message + without copying it */ + aligned_message_block = (uint64_t*)msg; + } else { + memcpy(ctx->message, msg, sha512_block_size); + aligned_message_block = ctx->message; + } + + rhash_sha512_process_block(ctx->hash, aligned_message_block); + msg += sha512_block_size; + size -= sha512_block_size; + } + if (size) { + memcpy(ctx->message, msg, size); /* save leftovers */ + } +} + +/** + * Store calculated hash into the given array. + * + * @param ctx the algorithm context containing current hashing state + * @param result calculated hash in binary form + */ +void rhash_sha512_final(sha512_ctx *ctx, unsigned char* result) +{ + size_t index = ((unsigned)ctx->length & 127) >> 3; + unsigned shift = ((unsigned)ctx->length & 7) * 8; + + /* pad message and process the last block */ + + /* append the byte 0x80 to the message */ + ctx->message[index] &= le2me_64( ~(I64(0xFFFFFFFFFFFFFFFF) << shift) ); + ctx->message[index++] ^= le2me_64( I64(0x80) << shift ); + + /* if no room left in the message to store 128-bit message length */ + if (index >= 15) { + if (index == 15) ctx->message[index] = 0; + rhash_sha512_process_block(ctx->hash, ctx->message); + index = 0; + } + while (index < 15) { + ctx->message[index++] = 0; + } + ctx->message[15] = be2me_64(ctx->length << 3); + rhash_sha512_process_block(ctx->hash, ctx->message); + + if (result) be64_copy(result, 0, ctx->hash, ctx->digest_length); +} diff --git a/librhash/sha512.h b/librhash/sha512.h new file mode 100644 index 0000000..7c689be --- /dev/null +++ b/librhash/sha512.h @@ -0,0 +1,32 @@ +/* sha.h sha512 and sha384 hash functions */ +#ifndef SHA512_H +#define SHA512_H +#include "ustd.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define sha512_block_size 128 +#define sha512_hash_size 64 +#define sha384_hash_size 48 + +/* algorithm context */ +typedef struct sha512_ctx +{ + uint64_t message[16]; /* 1024-bit buffer for leftovers */ + uint64_t length; /* number of processed bytes */ + uint64_t hash[8]; /* 512-bit algorithm internal hashing state */ + unsigned digest_length; /* length of the algorithm digest in bytes */ +} sha512_ctx; + +void rhash_sha384_init(sha512_ctx *ctx); +void rhash_sha512_init(sha512_ctx *ctx); +void rhash_sha512_update(sha512_ctx *ctx, const unsigned char* data, size_t length); +void rhash_sha512_final(sha512_ctx *ctx, unsigned char* result); + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ + +#endif /* SHA512_H */ diff --git a/librhash/ustd.h b/librhash/ustd.h new file mode 100644 index 0000000..94f1ae2 --- /dev/null +++ b/librhash/ustd.h @@ -0,0 +1,30 @@ +/* ustd.h common macros and includes */ +#ifndef LIBRHASH_USTD_H +#define LIBRHASH_USTD_H + +#if _MSC_VER >= 1300 + +# define int64_t __int64 +# define int32_t __int32 +# define int16_t __int16 +# define int8_t __int8 +# define uint64_t unsigned __int64 +# define uint32_t unsigned __int32 +# define uint16_t unsigned __int16 +# define uint8_t unsigned __int8 + +/* disable warnings: The POSIX name for this item is deprecated. Use the ISO C++ conformant name. */ +#pragma warning(disable : 4996) + +#else /* _MSC_VER >= 1300 */ + +# include +# include + +#endif /* _MSC_VER >= 1300 */ + +#if _MSC_VER <= 1300 +# include /* size_t for vc6.0 */ +#endif /* _MSC_VER <= 1300 */ + +#endif /* LIBRHASH_USTD_H */ diff --git a/librhash/util.h b/librhash/util.h new file mode 100644 index 0000000..9f37157 --- /dev/null +++ b/librhash/util.h @@ -0,0 +1,31 @@ +/* util.h */ +#ifndef UTIL_H +#define UTIL_H + +#ifdef __cplusplus +extern "C" { +#endif + +#if (defined(__GNUC__) && __GNUC__ >= 4 && (__GNUC__ > 4 || __GNUC_MINOR__ >= 1) \ + && defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4)) \ + || (defined(__INTEL_COMPILER) && !defined(_WIN32)) +/* atomic operations are defined by ICC and GCC >= 4.1, but by the later one supposedly not for ARM */ +/* note: ICC on ia64 platform possibly require ia64intrin.h, need testing */ +# define atomic_compare_and_swap(ptr, oldval, newval) __sync_val_compare_and_swap(ptr, oldval, newval) +#elif defined(_MSC_VER) +# include +# define atomic_compare_and_swap(ptr, oldval, newval) InterlockedCompareExchange(ptr, newval, oldval) +#elif defined(__sun) +# include +# define atomic_compare_and_swap(ptr, oldval, newval) atomic_cas_32(ptr, oldval, newval) +#else +/* pray that it will work */ +# define atomic_compare_and_swap(ptr, oldval, newval) { if(*(ptr) == (oldval)) *(ptr) = (newval); } +# define NO_ATOMIC_BUILTINS +#endif + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ + +#endif /* UTIL_H */ https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=798b0adc628ab16dbb4d04ef444b8e7db4f5cffa commit 798b0adc628ab16dbb4d04ef444b8e7db4f5cffa Author: Brad King AuthorDate: Thu Nov 3 11:11:37 2016 -0400 Commit: Brad King CommitDate: Thu Nov 3 13:45:22 2016 -0400 Add script to update librhash from upstream diff --git a/Utilities/Scripts/update-librhash.bash b/Utilities/Scripts/update-librhash.bash new file mode 100755 index 0000000..2f67ea2 --- /dev/null +++ b/Utilities/Scripts/update-librhash.bash @@ -0,0 +1,43 @@ +#!/usr/bin/env bash + +set -e +set -x +shopt -s dotglob + +readonly name="librhash" +readonly ownership="librhash upstream " +readonly subtree="Utilities/cmlibrhash" +readonly repo="https://github.com/rhash/rhash.git" +readonly tag="master" +readonly shortlog=false +readonly paths=" + COPYING + README + librhash/algorithms.c + librhash/algorithms.h + librhash/byte_order.c + librhash/byte_order.h + librhash/hex.c + librhash/hex.h + librhash/md5.c + librhash/md5.h + librhash/rhash.c + librhash/rhash.h + librhash/sha1.c + librhash/sha1.h + librhash/sha256.c + librhash/sha256.h + librhash/sha512.c + librhash/sha512.h + librhash/ustd.h + librhash/util.h +" + +extract_source () { + git_archive + pushd "${extractdir}/${name}-reduced" + echo "* -whitespace" > .gitattributes + popd +} + +. "${BASH_SOURCE%/*}/update-third-party.bash" ----------------------------------------------------------------------- Summary of changes: CMakeLists.txt | 20 +- CTestCustom.cmake.in | 2 - Source/.gitattributes | 3 - Source/CMakeLists.txt | 3 +- Source/CPack/WiX/cmCPackWIXGenerator.cxx | 4 +- Source/CTest/cmCTestLaunch.cxx | 15 +- Source/Modules/FindLibRHash.cmake | 73 + Source/cmCryptoHash.cxx | 97 +- Source/cmCryptoHash.h | 61 +- Source/cmFileCommand.cxx | 3 +- Source/cmFilePathUuid.cxx | 4 +- Source/cmGlobalGenerator.cxx | 13 +- Source/cmLocalGenerator.cxx | 16 +- Source/cmSystemTools.cxx | 6 +- Source/cmUuid.cxx | 31 +- Source/cm_sha2.c | 1613 ----------------------- Source/cm_sha2.h | 140 -- Source/cm_sha2_mangle.h | 42 - Tests/CMakeLists.txt | 4 + Tests/FindLibRHash/CMakeLists.txt | 10 + Tests/FindLibRHash/Test/CMakeLists.txt | 17 + Tests/FindLibRHash/Test/main.c | 7 + Utilities/Scripts/clang-format.bash | 2 +- Utilities/Scripts/update-librhash.bash | 43 + Utilities/cmThirdParty.h.in | 1 + Utilities/cm_rhash.h | 14 + Utilities/{cmcurl => cmlibrhash}/.gitattributes | 0 Utilities/cmlibrhash/CMakeLists.txt | 38 + Utilities/cmlibrhash/COPYING | 15 + Utilities/cmlibrhash/README | 7 + Utilities/cmlibrhash/librhash/algorithms.c | 220 ++++ Utilities/cmlibrhash/librhash/algorithms.h | 120 ++ Utilities/cmlibrhash/librhash/byte_order.c | 150 +++ Utilities/cmlibrhash/librhash/byte_order.h | 153 +++ Utilities/cmlibrhash/librhash/hex.c | 188 +++ Utilities/cmlibrhash/librhash/hex.h | 25 + Utilities/cmlibrhash/librhash/md5.c | 236 ++++ Utilities/cmlibrhash/librhash/md5.h | 31 + Utilities/cmlibrhash/librhash/rhash.c | 872 ++++++++++++ Utilities/cmlibrhash/librhash/rhash.h | 278 ++++ Utilities/cmlibrhash/librhash/sha1.c | 196 +++ Utilities/cmlibrhash/librhash/sha1.h | 31 + Utilities/cmlibrhash/librhash/sha256.c | 241 ++++ Utilities/cmlibrhash/librhash/sha256.h | 32 + Utilities/cmlibrhash/librhash/sha512.c | 255 ++++ Utilities/cmlibrhash/librhash/sha512.h | 32 + Utilities/cmlibrhash/librhash/ustd.h | 39 + Utilities/cmlibrhash/librhash/util.h | 31 + bootstrap | 6 +- 49 files changed, 3490 insertions(+), 1950 deletions(-) create mode 100644 Source/Modules/FindLibRHash.cmake delete mode 100644 Source/cm_sha2.c delete mode 100644 Source/cm_sha2.h delete mode 100644 Source/cm_sha2_mangle.h create mode 100644 Tests/FindLibRHash/CMakeLists.txt create mode 100644 Tests/FindLibRHash/Test/CMakeLists.txt create mode 100644 Tests/FindLibRHash/Test/main.c create mode 100755 Utilities/Scripts/update-librhash.bash create mode 100644 Utilities/cm_rhash.h copy Utilities/{cmcurl => cmlibrhash}/.gitattributes (100%) create mode 100644 Utilities/cmlibrhash/CMakeLists.txt create mode 100644 Utilities/cmlibrhash/COPYING create mode 100644 Utilities/cmlibrhash/README create mode 100644 Utilities/cmlibrhash/librhash/algorithms.c create mode 100644 Utilities/cmlibrhash/librhash/algorithms.h create mode 100644 Utilities/cmlibrhash/librhash/byte_order.c create mode 100644 Utilities/cmlibrhash/librhash/byte_order.h create mode 100644 Utilities/cmlibrhash/librhash/hex.c create mode 100644 Utilities/cmlibrhash/librhash/hex.h create mode 100644 Utilities/cmlibrhash/librhash/md5.c create mode 100644 Utilities/cmlibrhash/librhash/md5.h create mode 100644 Utilities/cmlibrhash/librhash/rhash.c create mode 100644 Utilities/cmlibrhash/librhash/rhash.h create mode 100644 Utilities/cmlibrhash/librhash/sha1.c create mode 100644 Utilities/cmlibrhash/librhash/sha1.h create mode 100644 Utilities/cmlibrhash/librhash/sha256.c create mode 100644 Utilities/cmlibrhash/librhash/sha256.h create mode 100644 Utilities/cmlibrhash/librhash/sha512.c create mode 100644 Utilities/cmlibrhash/librhash/sha512.h create mode 100644 Utilities/cmlibrhash/librhash/ustd.h create mode 100644 Utilities/cmlibrhash/librhash/util.h hooks/post-receive -- CMake From brad.king at kitware.com Fri Nov 4 09:44:49 2016 From: brad.king at kitware.com (Brad King) Date: Fri, 4 Nov 2016 09:44:49 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.7.0-rc2-464-g800a11d Message-ID: <20161104134449.85C9CF7D54@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 800a11dc3633b3ec91223c4b53bcc7817e63ad02 (commit) via adf5f253ec029aec4ee7aadb95c6f908030fb98b (commit) from 7c0e67ee220a5fb7806cb5ef4c80df31f3e34a13 (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: hooks/post-receive -- CMake From brad.king at kitware.com Fri Nov 4 09:44:49 2016 From: brad.king at kitware.com (Brad King) Date: Fri, 4 Nov 2016 09:44:49 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.7.0-rc2-962-gd1de384 Message-ID: <20161104134449.A3DAFF7D55@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, next has been updated via d1de38461085cf6405f76130753d9f12bbeb9519 (commit) via 800a11dc3633b3ec91223c4b53bcc7817e63ad02 (commit) from 16df58045f9cc1b553fe1607177f91e23fb45b43 (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=d1de38461085cf6405f76130753d9f12bbeb9519 commit d1de38461085cf6405f76130753d9f12bbeb9519 Merge: 16df580 800a11d Author: Brad King AuthorDate: Fri Nov 4 09:44:29 2016 -0400 Commit: Brad King CommitDate: Fri Nov 4 09:44:29 2016 -0400 Merge branch 'master' into next ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Fri Nov 4 09:44:49 2016 From: brad.king at kitware.com (Brad King) Date: Fri, 4 Nov 2016 09:44:49 -0400 (EDT) Subject: [Cmake-commits] CMake branch, release, updated. v3.7.0-rc2-39-gadf5f25 Message-ID: <20161104134449.BB2BDF7D56@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 adf5f253ec029aec4ee7aadb95c6f908030fb98b (commit) from 8b75290f13399ba1b32458c5f0090e69efe1eb8c (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 brad.king at kitware.com Fri Nov 4 09:54:56 2016 From: brad.king at kitware.com (Brad King) Date: Fri, 4 Nov 2016 09:54:56 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.7.0-rc2-964-g996e95b Message-ID: <20161104135456.B68FDF8267@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, next has been updated via 996e95b07cd311e88c77d245d5f532d1b6c7fbd4 (commit) via 80e477239dc3a57f87f9efb7b1d78eb0f0e2b6a3 (commit) from d1de38461085cf6405f76130753d9f12bbeb9519 (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=996e95b07cd311e88c77d245d5f532d1b6c7fbd4 commit 996e95b07cd311e88c77d245d5f532d1b6c7fbd4 Merge: d1de384 80e4772 Author: Brad King AuthorDate: Fri Nov 4 09:54:56 2016 -0400 Commit: CMake Topic Stage CommitDate: Fri Nov 4 09:54:56 2016 -0400 Merge topic 'FortranCInterface-pic' into next 80e47723 FortranCInterface: Make mangling detection robust to PIC Fortran https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=80e477239dc3a57f87f9efb7b1d78eb0f0e2b6a3 commit 80e477239dc3a57f87f9efb7b1d78eb0f0e2b6a3 Author: Brad King AuthorDate: Fri Nov 4 09:52:03 2016 -0400 Commit: Brad King CommitDate: Fri Nov 4 09:54:12 2016 -0400 FortranCInterface: Make mangling detection robust to PIC Fortran When using a Fortran compiler that produces PIC executables by default with a C compiler that does not produce PIC by default then the mangling detection executable fails to link. Explicitly enable PIC for the C compiler just in case the Fortran compiler needs it to link. Issue: #16405 diff --git a/Modules/FortranCInterface/CMakeLists.txt b/Modules/FortranCInterface/CMakeLists.txt index dee57b5..3a66f68 100644 --- a/Modules/FortranCInterface/CMakeLists.txt +++ b/Modules/FortranCInterface/CMakeLists.txt @@ -94,6 +94,9 @@ add_library(myfort STATIC mysub.f my_sub.f ${myfort_modules}) # Provide symbols through C but fall back to Fortran. add_library(symbols STATIC ${symbol_sources}) target_link_libraries(symbols myfort) +# In case the Fortran compiler produces PIC by default make sure +# the C compiler produces PIC even if it is not its default. +set_property(TARGET symbols PROPERTY POSITION_INDEPENDENT_CODE 1) # Require symbols through Fortran. add_executable(FortranCInterface main.F call_sub.f ${call_mod}) ----------------------------------------------------------------------- Summary of changes: Modules/FortranCInterface/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) hooks/post-receive -- CMake From robert.maynard at kitware.com Fri Nov 4 15:36:25 2016 From: robert.maynard at kitware.com (Robert Maynard) Date: Fri, 4 Nov 2016 15:36:25 -0400 (EDT) Subject: [Cmake-commits] CMake annotated tag, v3.7.0-rc3, created. v3.7.0-rc3 Message-ID: <20161104193626.0888BF8695@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.7.0-rc3 has been created at b663e41ce3f8a4a831ec7d1363e9d7491069bace (tag) tagging adf5f253ec029aec4ee7aadb95c6f908030fb98b (commit) replaces v3.7.0-rc2 tagged by Brad King on Fri Nov 4 09:45:15 2016 -0400 - Log ----------------------------------------------------------------- CMake 3.7.0-rc3 -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdBQJYHJDrFhxicmFkLmtpbmdAa2l0d2FyZS5jb20ACgkQLSzvEDSS FoTCThAAhBEfFpCSBfdSNc5wQaZ2Ji1uDmIlQB5vuxVkLLRxXupGpYK2zEvaAWER KirAXUdyXdD0S8Gh6bsc8nHEVu10UClt6fSolG1XwRMogxV9oHJW9UQX1gTJAFWQ JLt2dsVAeEFIfRlJML0UcfPzLT1GNeNPnrV0x/ehDOEChnoilibY38/1qIT7ZrGz L71C223HYImtlClkV1KG2fHj8cOZ46BOjHIHU43AYRsNMzYtNi9L+fWaCGDKh+G0 48anhQv8u/Ky6qFK/sf4KNm4UxVI/u+lbsX0gnsLNO/WgWmUJDjyCIG+d/eKW92m oJXV7P1rYNDqfz0+ZD72hXxBoiVan8ttPhJotq5Q83d6PKRtXUZP4i5KS3hRT1aQ m3bxjIKctBSmRdsEpizdsgn8rCPEHktVFLHJk7/RAd33GHUYO2W0ex9OZKLPOAa/ CXnC7MjDj6t3jgY/yJsbTC/ovjZ+EUtVMb4Z1GJoALgC42M60MbIVvmYY37GGCUg fap1O/IDiJK7YilQw0s3O6/GObMNY4ooCKlkVRkJTMa6l9Ao5hbIaJIzc+8J61UM 67jsD8H1CkQjBa0AeAB9pZhXMnYXuznVBvOK83FsYc8d3vEV/D5CFbjdiadQ3h71 SBfso0UWskavW8vhHU/SsPt6b/jYqq0wjBO+B3y2gYod6MhXxkM= =MQtL -----END PGP SIGNATURE----- Alex Turbov (3): CPackDeb: fix copy-n-paste typos in documentation CPackDeb: Fix incorrect variable name in documentation CPackRPM: Fix incorrect variable name in documentation Alexis Murzeau (1): Ninja: Use binary dir for `$subdir/all` targets Brad King (25): Android: Fix support for armeabi with c++_static Merge branch 'android-armeabi-c++_static' into release Android: Add missing link flags for device executables Merge branch 'android-link-exe' into release Merge branch 'doc-cmake-server-typos' into release Merge branch 'backport-ninja-subdir-binary-dir' into release Android: Set CMAKE_POSITION_INDEPENDENT_CODE automatically Android: Link position-independent executables with proper flags Merge branch 'android-pic' into release Intel: Fix compiler extension flags on Windows cmake-server: Change message wrapper to avoid ambiguity with content Merge branch 'intel-compile-features-windows' into release Merge branch 'cmake-server-message-quoting' into release Features: Record features for Intel C++ 17 on UNIX Merge branch 'intel-17-features' into release Merge branch 'cmake-server-handshake-improvements' into release Merge branch 'FindMatlab-9.1' into release Merge branch 'FindMatlab-fix-typo' into release Merge branch 'fix-macos-sysroot' into release Merge branch 'cpack-doc-typos' into release Merge branch 'doc-cmake-qt-fixes' into release FindHDF5: Restore pre-3.6 behavior of finding only C by default Merge branch 'FindHDF5-restore-default-C' into release Merge branch 'cpackifw-search-algorithm' into release CMake 3.7.0-rc3 Francesco Romano (1): FindMatlab: Add support for Matlab 2016b (9.1) Gregor Jasny (2): Revert "Xcode: Convert maybe unversioned OSX sysroot into versioned SDK path" Darwin: Remove deployment target version check Konstantin Podsvirov (1): CPackIFW: Update search to find QtIFW distributed with QtSDK Marcus D. Hanwell (1): Help: Update example Qt 5 find_package call to use COMPONENTS Matthew Woehlke (1): FindMatlab: Fix typo in matlab_add_unit_test implementation Thiago M. de C. Marques (1): Help: Update example Qt 5 find_package call to add missing component Tobias Hunger (3): Help: Fix cmake-server documentation cmake-server: Better error reporting during handshake server-mode: Handle generator toolset and platform in handshake ----------------------------------------------------------------------- hooks/post-receive -- CMake From kwrobot at kitware.com Sat Nov 5 00:01:06 2016 From: kwrobot at kitware.com (Kitware Robot) Date: Sat, 5 Nov 2016 00:01:06 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.7.0-rc3-426-gf52bcc2 Message-ID: <20161105040106.DA435F8260@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 f52bcc2ac1b3dddeca2320d8320a9406101c732d (commit) from 800a11dc3633b3ec91223c4b53bcc7817e63ad02 (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=f52bcc2ac1b3dddeca2320d8320a9406101c732d commit f52bcc2ac1b3dddeca2320d8320a9406101c732d Author: Kitware Robot AuthorDate: Sat Nov 5 00:01:04 2016 -0400 Commit: Kitware Robot CommitDate: Sat Nov 5 00:01:04 2016 -0400 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index b3cff47..59e5c7e 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 7) -set(CMake_VERSION_PATCH 20161104) +set(CMake_VERSION_PATCH 20161105) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From domen.vrankar at gmail.com Sat Nov 5 07:00:42 2016 From: domen.vrankar at gmail.com (Domen Vrankar) Date: Sat, 5 Nov 2016 07:00:42 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.7.0-rc3-931-g838fd5c Message-ID: <20161105110043.35C20F8694@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, next has been updated via 838fd5c3ecc961323affd2a890ff3421edc82f08 (commit) via b34c045736384fc3ba8574b33211bd75082bc07b (commit) via cd0423300bea21a5c0747a6aeaefbae24c10ecd8 (commit) via 228280d8334f2bcac346e5f0d3ea802af7f22862 (commit) via d8e83ab979b0ccfc4887dbf48c088a72dffb2e96 (commit) via f52bcc2ac1b3dddeca2320d8320a9406101c732d (commit) from 996e95b07cd311e88c77d245d5f532d1b6c7fbd4 (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=838fd5c3ecc961323affd2a890ff3421edc82f08 commit 838fd5c3ecc961323affd2a890ff3421edc82f08 Merge: 996e95b b34c045 Author: Domen Vrankar AuthorDate: Sat Nov 5 07:00:35 2016 -0400 Commit: CMake Topic Stage CommitDate: Sat Nov 5 07:00:35 2016 -0400 Merge topic 'cpack-rpm-omit-unsupported-tags' into next b34c0457 Release text for omitting unsupported tags topic cd042330 CPack/RPM test for Suggests tag 228280d8 CPack/RPM prevent special tags from being removed d8e83ab9 CPack/RPM omit unsupported tags f52bcc2a CMake Nightly Date Stamp https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b34c045736384fc3ba8574b33211bd75082bc07b commit b34c045736384fc3ba8574b33211bd75082bc07b Author: Domen Vrankar AuthorDate: Sat Nov 5 11:52:30 2016 +0100 Commit: Domen Vrankar CommitDate: Sat Nov 5 11:53:30 2016 +0100 Release text for omitting unsupported tags topic diff --git a/Help/release/dev/cpack-rpm-omit-unsupported-tags.rst b/Help/release/dev/cpack-rpm-omit-unsupported-tags.rst new file mode 100644 index 0000000..abcb7a6 --- /dev/null +++ b/Help/release/dev/cpack-rpm-omit-unsupported-tags.rst @@ -0,0 +1,8 @@ +cpack-rpm-omit-unsupported-tags +------------------------------- + +* The :module:`CPackRPM` module learned to omit + tags that are not supported by provided + rpmbuild tool. If unsupported tags are set + they are ignored and a developer warning is + printed out. https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=cd0423300bea21a5c0747a6aeaefbae24c10ecd8 commit cd0423300bea21a5c0747a6aeaefbae24c10ecd8 Author: Alexander Adam AuthorDate: Sat Nov 5 11:36:12 2016 +0100 Commit: Domen Vrankar CommitDate: Sat Nov 5 11:44:32 2016 +0100 CPack/RPM test for Suggests tag Suggests tag was not present in older versions of rpmbuild so we test that the rpm package is always generated either with Suggests tag present or skipped if not supported. diff --git a/Tests/RunCMake/CPack/RPM/RPM_SUGGESTS-ExpectedFiles.cmake b/Tests/RunCMake/CPack/RPM/RPM_SUGGESTS-ExpectedFiles.cmake new file mode 100644 index 0000000..02ebb44 --- /dev/null +++ b/Tests/RunCMake/CPack/RPM/RPM_SUGGESTS-ExpectedFiles.cmake @@ -0,0 +1,5 @@ +set(whitespaces_ "[\t\n\r ]*") + +set(EXPECTED_FILES_COUNT "1") +set(EXPECTED_FILE_1 "rpm_suggests*.rpm") +set(EXPECTED_FILE_CONTENT_1 "^/usr/foo${whitespaces_}/usr/foo/CMakeLists.txt$") diff --git a/Tests/RunCMake/CPack/RPM/RPM_SUGGESTS-VerifyResult.cmake b/Tests/RunCMake/CPack/RPM/RPM_SUGGESTS-VerifyResult.cmake new file mode 100644 index 0000000..32cc6d1 --- /dev/null +++ b/Tests/RunCMake/CPack/RPM/RPM_SUGGESTS-VerifyResult.cmake @@ -0,0 +1,31 @@ +execute_process(COMMAND ${RPMBUILD_EXECUTABLE} --querytags + OUTPUT_VARIABLE RPMBUILD_CAPS + RESULT_VARIABLE RPMBUILD_CAPS_RESULT) + +if(NOT RPMBUILD_CAPS_RESULT) + string(REPLACE "\n" ";" RPMBUILD_CAPS "${RPMBUILD_CAPS}") + cmake_policy(PUSH) + cmake_policy(SET CMP0057 NEW) + if(SUGGESTS IN_LIST RPMBUILD_CAPS) + set(should_contain_suggests_tag_ true) + endif() + cmake_policy(POP) +endif() + +# Only verify that suggests tag is present only if that tag is supported. +# If it is not supported the rpm package was corretly generated by ignoring +# that tag and that was already checked by expected files test. +if(should_contain_suggests_tag_) + execute_process(COMMAND ${RPM_EXECUTABLE} -q --suggests -p "${FOUND_FILE_1}" + WORKING_DIRECTORY "${CPACK_TEMPORARY_DIRECTORY}" + RESULT_VARIABLE rpm_result_ + OUTPUT_VARIABLE rpm_output_ + ERROR_VARIABLE error_variable_ + OUTPUT_STRIP_TRAILING_WHITESPACE) + + if(rpm_result_ OR NOT rpm_output_ STREQUAL "libsuggested") + message(FATAL_ERROR "RPM_SUGGESTED package error: no suggested packages" + " (result: '${rpm_result_}'; output: '${rpm_output_}';" + " error: '${error_variable_}')") + endif() +endif() diff --git a/Tests/RunCMake/CPack/RPM_SUGGESTS.cmake b/Tests/RunCMake/CPack/RPM_SUGGESTS.cmake new file mode 100644 index 0000000..e6e0c1f --- /dev/null +++ b/Tests/RunCMake/CPack/RPM_SUGGESTS.cmake @@ -0,0 +1,4 @@ +install(FILES CMakeLists.txt DESTINATION foo) + +set(CPACK_RPM_PACKAGE_SUGGESTS "libsuggested") +set(CPACK_PACKAGE_NAME "rpm_suggests") diff --git a/Tests/RunCMake/CPack/RunCMakeTest.cmake b/Tests/RunCMake/CPack/RunCMakeTest.cmake index 474ee33..38bd0ea 100644 --- a/Tests/RunCMake/CPack/RunCMakeTest.cmake +++ b/Tests/RunCMake/CPack/RunCMakeTest.cmake @@ -15,6 +15,7 @@ run_cpack_test(CUSTOM_NAMES "RPM;DEB" true) run_cpack_test_subtests(MAIN_COMPONENT "invalid;found" "RPM" false) run_cpack_test(PER_COMPONENT_FIELDS "RPM;DEB" false) run_cpack_test(RPM_DIST "RPM" false) +run_cpack_test(RPM_SUGGESTS "RPM" false) run_cpack_test(INSTALL_SCRIPTS "RPM" false) run_cpack_test(DEB_GENERATE_SHLIBS "DEB" true) run_cpack_test(DEB_GENERATE_SHLIBS_LDCONFIG "DEB" true) https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=228280d8334f2bcac346e5f0d3ea802af7f22862 commit 228280d8334f2bcac346e5f0d3ea802af7f22862 Author: Domen Vrankar AuthorDate: Sat Nov 5 11:26:48 2016 +0100 Commit: Domen Vrankar CommitDate: Sat Nov 5 11:44:32 2016 +0100 CPack/RPM prevent special tags from being removed Some tags are not listed by rpmbuild querytags even though they are supported. Ignore those tags during the removal of unsupported tags. diff --git a/Modules/CPackRPM.cmake b/Modules/CPackRPM.cmake index 20005ed..39697f0 100644 --- a/Modules/CPackRPM.cmake +++ b/Modules/CPackRPM.cmake @@ -1868,7 +1868,11 @@ function(cpack_rpm_generate_package) if(DEFINED CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}) cmake_policy(PUSH) cmake_policy(SET CMP0057 NEW) - if(NOT _RPM_SPEC_HEADER IN_LIST RPMBUILD_TAG_LIST) + # Prefix can be replaced by Prefixes but the old version stil works so we'll ignore it for now + # Requires* is a special case because it gets transformed to Requires(pre/post/preun/postun) + # Auto* is a special case because the tags can not be queried by querytags rpmbuild flag + set(special_case_tags_ PREFIX REQUIRES_PRE REQUIRES_POST REQUIRES_PREUN REQUIRES_POSTUN AUTOPROV AUTOREQ AUTOREQPROV) + if(NOT _RPM_SPEC_HEADER IN_LIST RPMBUILD_TAG_LIST AND NOT _RPM_SPEC_HEADER IN_LIST special_case_tags_) cmake_policy(POP) message(AUTHOR_WARNING "CPackRPM:Warning: ${_RPM_SPEC_HEADER} not " "supported in provided rpmbuild. Tag will not be used.") https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d8e83ab979b0ccfc4887dbf48c088a72dffb2e96 commit d8e83ab979b0ccfc4887dbf48c088a72dffb2e96 Author: Alexander Adam AuthorDate: Sat Nov 5 11:08:52 2016 +0100 Commit: Domen Vrankar CommitDate: Sat Nov 5 11:42:08 2016 +0100 CPack/RPM omit unsupported tags Omit tags that are not supported by provided rpmbuild as some tags get added/removed in later versions of the tool. Closes: #13423 diff --git a/Modules/CPackRPM.cmake b/Modules/CPackRPM.cmake index 2483a13..20005ed 100644 --- a/Modules/CPackRPM.cmake +++ b/Modules/CPackRPM.cmake @@ -1844,6 +1844,12 @@ function(cpack_rpm_generate_package) set(CPACK_RPM_PACKAGE_RELOCATABLE FALSE) # disable relocatable option if building source RPM endif() + execute_process( + COMMAND "${RPMBUILD_EXECUTABLE}" --querytags + OUTPUT_VARIABLE RPMBUILD_TAG_LIST + OUTPUT_STRIP_TRAILING_WHITESPACE) + string(REPLACE "\n" ";" RPMBUILD_TAG_LIST "${RPMBUILD_TAG_LIST}") + # Check if additional fields for RPM spec header are given # There may be some COMPONENT specific variables as well # If component specific var is not provided we use the global one @@ -1852,6 +1858,7 @@ function(cpack_rpm_generate_package) if(CPACK_RPM_PACKAGE_DEBUG) message("CPackRPM:Debug: processing ${_RPM_SPEC_HEADER}") endif() + if(CPACK_RPM_PACKAGE_COMPONENT) cpack_rpm_variable_fallback("CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}" "CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_${_RPM_SPEC_HEADER}" @@ -1859,9 +1866,20 @@ function(cpack_rpm_generate_package) endif() if(DEFINED CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}) + cmake_policy(PUSH) + cmake_policy(SET CMP0057 NEW) + if(NOT _RPM_SPEC_HEADER IN_LIST RPMBUILD_TAG_LIST) + cmake_policy(POP) + message(AUTHOR_WARNING "CPackRPM:Warning: ${_RPM_SPEC_HEADER} not " + "supported in provided rpmbuild. Tag will not be used.") + continue() + endif() + cmake_policy(POP) + if(CPACK_RPM_PACKAGE_DEBUG) message("CPackRPM:Debug: using CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}") endif() + set(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP ${CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}}) endif() @@ -2416,6 +2434,7 @@ Vendor: \@CPACK_RPM_PACKAGE_VENDOR\@ \@TMP_RPM_PROVIDES\@ \@TMP_RPM_OBSOLETES\@ \@TMP_RPM_CONFLICTS\@ +\@TMP_RPM_SUGGESTS\@ \@TMP_RPM_AUTOPROV\@ \@TMP_RPM_AUTOREQ\@ \@TMP_RPM_AUTOREQPROV\@ @@ -2470,6 +2489,7 @@ Vendor: \@CPACK_RPM_PACKAGE_VENDOR\@ \@TMP_RPM_PROVIDES\@ \@TMP_RPM_OBSOLETES\@ \@TMP_RPM_CONFLICTS\@ +\@TMP_RPM_SUGGESTS\@ \@TMP_RPM_AUTOPROV\@ \@TMP_RPM_AUTOREQ\@ \@TMP_RPM_AUTOREQPROV\@ ----------------------------------------------------------------------- Summary of changes: .../dev/cpack-rpm-omit-unsupported-tags.rst | 8 +++++ Modules/CPackRPM.cmake | 24 +++++++++++++++ Source/CMakeVersion.cmake | 2 +- ...iles.cmake => RPM_SUGGESTS-ExpectedFiles.cmake} | 2 +- .../CPack/RPM/RPM_SUGGESTS-VerifyResult.cmake | 31 ++++++++++++++++++++ Tests/RunCMake/CPack/RPM_SUGGESTS.cmake | 4 +++ Tests/RunCMake/CPack/RunCMakeTest.cmake | 1 + 7 files changed, 70 insertions(+), 2 deletions(-) create mode 100644 Help/release/dev/cpack-rpm-omit-unsupported-tags.rst copy Tests/RunCMake/CPack/RPM/{MINIMAL-ExpectedFiles.cmake => RPM_SUGGESTS-ExpectedFiles.cmake} (77%) create mode 100644 Tests/RunCMake/CPack/RPM/RPM_SUGGESTS-VerifyResult.cmake create mode 100644 Tests/RunCMake/CPack/RPM_SUGGESTS.cmake hooks/post-receive -- CMake From daniel at pfeifer-mail.de Sat Nov 5 18:15:44 2016 From: daniel at pfeifer-mail.de (Daniel Pfeifer) Date: Sat, 5 Nov 2016 18:15:44 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.7.0-rc3-933-g166cd2c Message-ID: <20161105221544.88631F810E@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, next has been updated via 166cd2c80d14149698a3b9f39d2973defaa8af8f (commit) via 7e58067e3820cb79780adb0847bc90fb081e8206 (commit) from 838fd5c3ecc961323affd2a890ff3421edc82f08 (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=166cd2c80d14149698a3b9f39d2973defaa8af8f commit 166cd2c80d14149698a3b9f39d2973defaa8af8f Merge: 838fd5c 7e58067 Author: Daniel Pfeifer AuthorDate: Sat Nov 5 18:15:41 2016 -0400 Commit: CMake Topic Stage CommitDate: Sat Nov 5 18:15:41 2016 -0400 Merge topic 'include-what-you-use' into next 7e58067e Fix several include-what-you-use findings diff --cc Source/cmGlobalGenerator.cxx index 42e9df1,2d0767f..fa447ff --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@@ -33,20 -44,10 +44,10 @@@ #include "cmVersion.h" #include "cmake.h" - #include - #include - #include - #include - #include - #include - #include - #include - #include - #if defined(CMAKE_BUILD_WITH_CMAKE) +#include "cmCryptoHash.h" #include #include -#include #endif class cmInstalledFile; https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7e58067e3820cb79780adb0847bc90fb081e8206 commit 7e58067e3820cb79780adb0847bc90fb081e8206 Author: Daniel Pfeifer AuthorDate: Sat Nov 5 21:40:14 2016 +0100 Commit: Daniel Pfeifer CommitDate: Sat Nov 5 23:04:23 2016 +0100 Fix several include-what-you-use findings diff --git a/Source/CTest/cmCTestScriptHandler.cxx b/Source/CTest/cmCTestScriptHandler.cxx index 7ee0f75..08ea4ee 100644 --- a/Source/CTest/cmCTestScriptHandler.cxx +++ b/Source/CTest/cmCTestScriptHandler.cxx @@ -22,6 +22,7 @@ #include "cmGlobalGenerator.h" #include "cmMakefile.h" #include "cmState.h" +#include "cmStateDirectory.h" #include "cmStateTypes.h" #include "cmSystemTools.h" #include "cmake.h" diff --git a/Source/cmAlgorithms.h b/Source/cmAlgorithms.h index aa55379..22f69fa 100644 --- a/Source/cmAlgorithms.h +++ b/Source/cmAlgorithms.h @@ -3,9 +3,17 @@ #ifndef cmAlgorithms_h #define cmAlgorithms_h -#include - -#include "cmStandardIncludes.h" +#include // IWYU pragma: keep + +#include +#include +#include +#include +#include +#include +#include +#include +#include inline bool cmHasLiteralPrefixImpl(const std::string& str1, const char* str2, size_t N) diff --git a/Source/cmCMakeMinimumRequired.cxx b/Source/cmCMakeMinimumRequired.cxx index 655c42a..942688c 100644 --- a/Source/cmCMakeMinimumRequired.cxx +++ b/Source/cmCMakeMinimumRequired.cxx @@ -2,9 +2,15 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCMakeMinimumRequired.h" +#include +#include + #include "cmMakefile.h" #include "cmSystemTools.h" #include "cmVersion.h" +#include "cmake.h" + +class cmExecutionStatus; // cmCMakeMinimumRequired bool cmCMakeMinimumRequired::InitialPass(std::vector const& args, diff --git a/Source/cmCMakeMinimumRequired.h b/Source/cmCMakeMinimumRequired.h index 3acedd2..08a5c38 100644 --- a/Source/cmCMakeMinimumRequired.h +++ b/Source/cmCMakeMinimumRequired.h @@ -3,8 +3,14 @@ #ifndef cmCMakeMinimumRequired_h #define cmCMakeMinimumRequired_h +#include +#include +#include + #include "cmCommand.h" +class cmExecutionStatus; + /** \class cmCMakeMinimumRequired * \brief cmake_minimum_required command * diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 024260c..010fc4e 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -2,6 +2,27 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCTest.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + #include "cmAlgorithms.h" #include "cmCTestBuildAndTestHandler.h" #include "cmCTestBuildHandler.h" @@ -21,35 +42,15 @@ #include "cmGlobalGenerator.h" #include "cmMakefile.h" #include "cmState.h" +#include "cmStateSnapshot.h" #include "cmStateTypes.h" #include "cmSystemTools.h" #include "cmVersion.h" #include "cmVersionConfig.h" #include "cmXMLWriter.h" +#include "cm_auto_ptr.hxx" #include "cmake.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - #if defined(__BEOS__) || defined(__HAIKU__) #include /* disable_debugger() API. */ #endif diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx index e84012c..cb0ba63 100644 --- a/Source/cmCacheManager.cxx +++ b/Source/cmCacheManager.cxx @@ -2,11 +2,6 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCacheManager.h" -#include "cmGeneratedFileStream.h" -#include "cmSystemTools.h" -#include "cmVersion.h" -#include "cmake.h" - #include #include #include @@ -14,6 +9,12 @@ #include #include +#include "cmGeneratedFileStream.h" +#include "cmState.h" +#include "cmSystemTools.h" +#include "cmVersion.h" +#include "cmake.h" + cmCacheManager::cmCacheManager() { this->CacheMajorVersion = 0; diff --git a/Source/cmCacheManager.h b/Source/cmCacheManager.h index 90731f5..e82c9ef 100644 --- a/Source/cmCacheManager.h +++ b/Source/cmCacheManager.h @@ -5,9 +5,6 @@ #include // IWYU pragma: keep -#include "cmPropertyMap.h" -#include "cmState.h" - #include #include #include @@ -15,6 +12,9 @@ #include #include +#include "cmPropertyMap.h" +#include "cmStateTypes.h" + class cmake; /** \class cmCacheManager diff --git a/Source/cmCommandArgumentsHelper.h b/Source/cmCommandArgumentsHelper.h index 50af2e2..b19b0f9 100644 --- a/Source/cmCommandArgumentsHelper.h +++ b/Source/cmCommandArgumentsHelper.h @@ -5,10 +5,12 @@ #include -#include "cmStandardIncludes.h" +#include +#include +#include -class cmCommandArgumentsHelper; class cmCommandArgumentGroup; +class cmCommandArgumentsHelper; /* cmCommandArgumentsHelper, cmCommandArgumentGroup and cmCommandArgument (i.e. its derived classes cmCAXXX can be used to simplify the processing of diff --git a/Source/cmCommonTargetGenerator.cxx b/Source/cmCommonTargetGenerator.cxx index 95b95c1..c3a925f 100644 --- a/Source/cmCommonTargetGenerator.cxx +++ b/Source/cmCommonTargetGenerator.cxx @@ -2,7 +2,6 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCommonTargetGenerator.h" -#include #include #include #include @@ -16,8 +15,8 @@ #include "cmLocalCommonGenerator.h" #include "cmLocalGenerator.h" #include "cmMakefile.h" +#include "cmOutputConverter.h" #include "cmSourceFile.h" -#include "cmStateDirectory.h" #include "cmStateTypes.h" cmCommonTargetGenerator::cmCommonTargetGenerator(cmGeneratorTarget* gt) diff --git a/Source/cmCommonTargetGenerator.h b/Source/cmCommonTargetGenerator.h index fe27038..bdd6645 100644 --- a/Source/cmCommonTargetGenerator.h +++ b/Source/cmCommonTargetGenerator.h @@ -4,19 +4,16 @@ #define cmCommonTargetGenerator_h #include // IWYU pragma: keep - -#include "cmOutputConverter.h" - #include #include #include class cmGeneratorTarget; class cmGlobalCommonGenerator; +class cmLinkLineComputer; class cmLocalCommonGenerator; class cmMakefile; class cmSourceFile; -class cmLinkLineComputer; /** \class cmCommonTargetGenerator * \brief Common infrastructure for Makefile and Ninja per-target generators diff --git a/Source/cmConditionEvaluator.cxx b/Source/cmConditionEvaluator.cxx index 71d6c4e..f2eb601 100644 --- a/Source/cmConditionEvaluator.cxx +++ b/Source/cmConditionEvaluator.cxx @@ -2,12 +2,22 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmConditionEvaluator.h" +#include +#include +#include +#include +#include +#include +#include + #include "cmAlgorithms.h" #include "cmMakefile.h" -#include "cmOutputConverter.h" #include "cmState.h" #include "cmSystemTools.h" +class cmCommand; +class cmTest; + static std::string const keyAND = "AND"; static std::string const keyCOMMAND = "COMMAND"; static std::string const keyDEFINED = "DEFINED"; diff --git a/Source/cmConditionEvaluator.h b/Source/cmConditionEvaluator.h index 3c9d2cd..5815177 100644 --- a/Source/cmConditionEvaluator.h +++ b/Source/cmConditionEvaluator.h @@ -3,12 +3,18 @@ #ifndef cmConditionEvaluator_h #define cmConditionEvaluator_h -#include "cmCommand.h" +#include // IWYU pragma: keep + +#include +#include +#include + #include "cmExpandedCommandArgument.h" #include "cmListFileCache.h" +#include "cmPolicies.h" #include "cmake.h" -#include +class cmMakefile; class cmConditionEvaluator { diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx index b7d2196..3b46fc0 100644 --- a/Source/cmCoreTryCompile.cxx +++ b/Source/cmCoreTryCompile.cxx @@ -2,16 +2,24 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCoreTryCompile.h" +#include +#include +#include +#include +#include +#include + #include "cmAlgorithms.h" #include "cmExportTryCompileFileGenerator.h" #include "cmGlobalGenerator.h" #include "cmMakefile.h" #include "cmOutputConverter.h" +#include "cmPolicies.h" #include "cmState.h" +#include "cmSystemTools.h" +#include "cmTarget.h" +#include "cmVersion.h" #include "cmake.h" -#include - -#include static std::string const kCMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN = "CMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN"; diff --git a/Source/cmCoreTryCompile.h b/Source/cmCoreTryCompile.h index 0d9bb79..1c94f09 100644 --- a/Source/cmCoreTryCompile.h +++ b/Source/cmCoreTryCompile.h @@ -3,6 +3,11 @@ #ifndef cmCoreTryCompile_h #define cmCoreTryCompile_h +#include // IWYU pragma: keep + +#include +#include + #include "cmCommand.h" #include "cmStateTypes.h" diff --git a/Source/cmCreateTestSourceList.cxx b/Source/cmCreateTestSourceList.cxx index 14a6c88..69532e6 100644 --- a/Source/cmCreateTestSourceList.cxx +++ b/Source/cmCreateTestSourceList.cxx @@ -2,10 +2,14 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCreateTestSourceList.h" +#include + #include "cmMakefile.h" #include "cmSourceFile.h" #include "cmSystemTools.h" +class cmExecutionStatus; + // cmCreateTestSourceList bool cmCreateTestSourceList::InitialPass(std::vector const& args, cmExecutionStatus&) diff --git a/Source/cmCreateTestSourceList.h b/Source/cmCreateTestSourceList.h index 2f71a00..5e003cf 100644 --- a/Source/cmCreateTestSourceList.h +++ b/Source/cmCreateTestSourceList.h @@ -3,8 +3,15 @@ #ifndef cmCreateTestSourceList_h #define cmCreateTestSourceList_h +#include + +#include +#include + #include "cmCommand.h" +class cmExecutionStatus; + /** \class cmCreateTestSourceList * \brief Test driver generation command * diff --git a/Source/cmDefinitions.cxx b/Source/cmDefinitions.cxx index 0b459f9..47fe76a 100644 --- a/Source/cmDefinitions.cxx +++ b/Source/cmDefinitions.cxx @@ -3,6 +3,7 @@ #include "cmDefinitions.h" #include +#include #include #include diff --git a/Source/cmDefinitions.h b/Source/cmDefinitions.h index 8dfb9ea..ad40665 100644 --- a/Source/cmDefinitions.h +++ b/Source/cmDefinitions.h @@ -3,14 +3,14 @@ #ifndef cmDefinitions_h #define cmDefinitions_h -#include - -#include "cmLinkedTree.h" -#include "cm_unordered_map.hxx" +#include // IWYU pragma: keep #include #include +#include "cmLinkedTree.h" +#include "cm_unordered_map.hxx" + /** \class cmDefinitions * \brief Store a scope of variable definitions for CMake language. * diff --git a/Source/cmDependsC.cxx b/Source/cmDependsC.cxx index 84ab072..e6000db 100644 --- a/Source/cmDependsC.cxx +++ b/Source/cmDependsC.cxx @@ -2,16 +2,15 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmDependsC.h" +#include +#include + #include "cmAlgorithms.h" #include "cmFileTimeComparison.h" #include "cmLocalGenerator.h" #include "cmMakefile.h" -#include "cmOutputConverter.h" #include "cmSystemTools.h" -#include -#include - #define INCLUDE_REGEX_LINE \ "^[ \t]*#[ \t]*(include|import)[ \t]*[<\"]([^\">]+)([\">])" diff --git a/Source/cmDependsFortran.cxx b/Source/cmDependsFortran.cxx index c8723d0..7927402 100644 --- a/Source/cmDependsFortran.cxx +++ b/Source/cmDependsFortran.cxx @@ -2,14 +2,6 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmDependsFortran.h" -#include "cmFortranParser.h" /* Interface to parser object. */ -#include "cmGeneratedFileStream.h" -#include "cmLocalGenerator.h" -#include "cmMakefile.h" -#include "cmOutputConverter.h" -#include "cmStateDirectory.h" -#include "cmSystemTools.h" - #include #include #include @@ -18,6 +10,15 @@ #include #include +#include "cmFortranParser.h" /* Interface to parser object. */ +#include "cmGeneratedFileStream.h" +#include "cmLocalGenerator.h" +#include "cmMakefile.h" +#include "cmOutputConverter.h" +#include "cmStateDirectory.h" +#include "cmStateSnapshot.h" +#include "cmSystemTools.h" + // TODO: Test compiler for the case of the mod file. Some always // use lower case and some always use upper case. I do not know if any // use the case from the source code. diff --git a/Source/cmDependsJavaParserHelper.h b/Source/cmDependsJavaParserHelper.h index 1597ea7..71b939c 100644 --- a/Source/cmDependsJavaParserHelper.h +++ b/Source/cmDependsJavaParserHelper.h @@ -8,6 +8,8 @@ #include #include +class cmDependsJavaParserHelper; + #define YYSTYPE cmDependsJavaParserHelper::ParserType #define YYSTYPE_IS_DECLARED #define YY_EXTRA_TYPE cmDependsJavaParserHelper* diff --git a/Source/cmExecutionStatus.h b/Source/cmExecutionStatus.h index 7d4e97c..311c7f5 100644 --- a/Source/cmExecutionStatus.h +++ b/Source/cmExecutionStatus.h @@ -3,9 +3,7 @@ #ifndef cmExecutionStatus_h #define cmExecutionStatus_h -#include -#include "cmStandardIncludes.h" /** \class cmExecutionStatus * \brief Superclass for all command status classes diff --git a/Source/cmExpandedCommandArgument.h b/Source/cmExpandedCommandArgument.h index 39cffce..9770fe6 100644 --- a/Source/cmExpandedCommandArgument.h +++ b/Source/cmExpandedCommandArgument.h @@ -3,9 +3,9 @@ #ifndef cmExpandedCommandArgument_h #define cmExpandedCommandArgument_h -#include +#include // IWYU pragma: keep -#include "cmStandardIncludes.h" +#include /** \class cmExpandedCommandArgument * \brief Represents an expanded command argument diff --git a/Source/cmExportBuildAndroidMKGenerator.cxx b/Source/cmExportBuildAndroidMKGenerator.cxx index 38f95d2..dab0c2c 100644 --- a/Source/cmExportBuildAndroidMKGenerator.cxx +++ b/Source/cmExportBuildAndroidMKGenerator.cxx @@ -2,14 +2,22 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmExportBuildAndroidMKGenerator.h" -#include "cmExportSet.h" +#include +#include +#include +#include + +#include "cmGeneratorExpression.h" #include "cmGeneratorTarget.h" -#include "cmGlobalGenerator.h" +#include "cmLinkItem.h" #include "cmLocalGenerator.h" #include "cmMakefile.h" -#include "cmTargetExport.h" - -#include +#include "cmPolicies.h" +#include "cmStateTypes.h" +#include "cmSystemTools.h" +#include "cmTarget.h" +#include "cm_auto_ptr.hxx" +#include "cmake.h" cmExportBuildAndroidMKGenerator::cmExportBuildAndroidMKGenerator() { diff --git a/Source/cmExportBuildAndroidMKGenerator.h b/Source/cmExportBuildAndroidMKGenerator.h index c9e0145..2a5a42e 100644 --- a/Source/cmExportBuildAndroidMKGenerator.h +++ b/Source/cmExportBuildAndroidMKGenerator.h @@ -3,10 +3,16 @@ #ifndef cmExportBuildAndroidMKGenerator_h #define cmExportBuildAndroidMKGenerator_h +#include + +#include +#include +#include + #include "cmExportBuildFileGenerator.h" -#include "cmListFileCache.h" +#include "cmExportFileGenerator.h" -class cmExportSet; +class cmGeneratorTarget; /** \class cmExportBuildAndroidMKGenerator * \brief Generate a file exporting targets from a build tree. diff --git a/Source/cmExportInstallAndroidMKGenerator.cxx b/Source/cmExportInstallAndroidMKGenerator.cxx index 2069785..9772f49 100644 --- a/Source/cmExportInstallAndroidMKGenerator.cxx +++ b/Source/cmExportInstallAndroidMKGenerator.cxx @@ -2,16 +2,17 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmExportInstallAndroidMKGenerator.h" -#include "cmAlgorithms.h" +#include +#include + #include "cmExportBuildAndroidMKGenerator.h" #include "cmExportSet.h" -#include "cmExportSetMap.h" -#include "cmGeneratedFileStream.h" #include "cmGeneratorTarget.h" -#include "cmGlobalGenerator.h" #include "cmInstallExportGenerator.h" #include "cmInstallTargetGenerator.h" -#include "cmLocalGenerator.h" +#include "cmStateTypes.h" +#include "cmSystemTools.h" +#include "cmTarget.h" #include "cmTargetExport.h" cmExportInstallAndroidMKGenerator::cmExportInstallAndroidMKGenerator( diff --git a/Source/cmExportInstallAndroidMKGenerator.h b/Source/cmExportInstallAndroidMKGenerator.h index c713027..f2f8927 100644 --- a/Source/cmExportInstallAndroidMKGenerator.h +++ b/Source/cmExportInstallAndroidMKGenerator.h @@ -3,10 +3,18 @@ #ifndef cmExportInstallAndroidMKGenerator_h #define cmExportInstallAndroidMKGenerator_h +#include + +#include +#include +#include +#include + +#include "cmExportFileGenerator.h" #include "cmExportInstallFileGenerator.h" +class cmGeneratorTarget; class cmInstallExportGenerator; -class cmInstallTargetGenerator; /** \class cmExportInstallAndroidMKGenerator * \brief Generate a file exporting targets from an install tree. diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx index 41fc428..b0a4c47 100644 --- a/Source/cmExtraCodeBlocksGenerator.cxx +++ b/Source/cmExtraCodeBlocksGenerator.cxx @@ -2,6 +2,11 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmExtraCodeBlocksGenerator.h" +#include +#include +#include +#include + #include "cmAlgorithms.h" #include "cmGeneratedFileStream.h" #include "cmGeneratorTarget.h" @@ -14,12 +19,6 @@ #include "cmXMLWriter.h" #include "cmake.h" -#include -#include -#include -#include -#include - /* Some useful URLs: Homepage: http://www.codeblocks.org diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx index c4e86a9..ff2703e 100644 --- a/Source/cmExtraEclipseCDT4Generator.cxx +++ b/Source/cmExtraEclipseCDT4Generator.cxx @@ -2,13 +2,20 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmExtraEclipseCDT4Generator.h" +#include +#include +#include +#include +#include +#include +#include + #include "cmGeneratedFileStream.h" #include "cmGeneratorExpression.h" #include "cmGeneratorTarget.h" #include "cmGlobalGenerator.h" #include "cmLocalGenerator.h" #include "cmMakefile.h" -#include "cmOutputConverter.h" #include "cmSourceFile.h" #include "cmSourceGroup.h" #include "cmState.h" @@ -17,14 +24,6 @@ #include "cmXMLWriter.h" #include "cmake.h" -#include -#include -#include -#include -#include -#include -#include - static void AppendAttribute(cmXMLWriter& xml, const char* keyval) { xml.StartElement("attribute"); diff --git a/Source/cmExtraSublimeTextGenerator.cxx b/Source/cmExtraSublimeTextGenerator.cxx index 9ef684d..5712ab2 100644 --- a/Source/cmExtraSublimeTextGenerator.cxx +++ b/Source/cmExtraSublimeTextGenerator.cxx @@ -2,7 +2,14 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmExtraSublimeTextGenerator.h" +#include +#include +#include +#include +#include + #include "cmGeneratedFileStream.h" +#include "cmGeneratorExpression.h" #include "cmGeneratorTarget.h" #include "cmGlobalGenerator.h" #include "cmLocalGenerator.h" @@ -10,12 +17,7 @@ #include "cmSourceFile.h" #include "cmStateTypes.h" #include "cmSystemTools.h" - -#include -#include -#include -#include -#include +#include "cmake.h" /* Sublime Text 2 Generator diff --git a/Source/cmFileTimeComparison.cxx b/Source/cmFileTimeComparison.cxx index 55d8c2a..991ebb8 100644 --- a/Source/cmFileTimeComparison.cxx +++ b/Source/cmFileTimeComparison.cxx @@ -2,7 +2,6 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmFileTimeComparison.h" -#include #include #include #include diff --git a/Source/cmFindBase.cxx b/Source/cmFindBase.cxx index 3d67ac1..dce5021 100644 --- a/Source/cmFindBase.cxx +++ b/Source/cmFindBase.cxx @@ -2,8 +2,14 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmFindBase.h" +#include +#include +#include +#include + #include "cmAlgorithms.h" #include "cmMakefile.h" +#include "cmSearchPath.h" #include "cmState.h" #include "cmStateTypes.h" #include "cmSystemTools.h" diff --git a/Source/cmFindBase.h b/Source/cmFindBase.h index 2b8d4a2..423d453 100644 --- a/Source/cmFindBase.h +++ b/Source/cmFindBase.h @@ -3,6 +3,11 @@ #ifndef cmFindBase_h #define cmFindBase_h +#include // IWYU pragma: keep + +#include +#include + #include "cmFindCommon.h" /** \class cmFindBase diff --git a/Source/cmFindCommon.cxx b/Source/cmFindCommon.cxx index 75d1453..110195c 100644 --- a/Source/cmFindCommon.cxx +++ b/Source/cmFindCommon.cxx @@ -2,12 +2,13 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmFindCommon.h" +#include +#include +#include + #include "cmMakefile.h" #include "cmSystemTools.h" -#include -#include - cmFindCommon::PathGroup cmFindCommon::PathGroup::All("ALL"); cmFindCommon::PathLabel cmFindCommon::PathLabel::CMake("CMAKE"); cmFindCommon::PathLabel cmFindCommon::PathLabel::CMakeEnvironment( diff --git a/Source/cmFindCommon.h b/Source/cmFindCommon.h index 1809c0a..4d6d569 100644 --- a/Source/cmFindCommon.h +++ b/Source/cmFindCommon.h @@ -3,10 +3,19 @@ #ifndef cmFindCommon_h #define cmFindCommon_h +#include + +#include +#include +#include +#include + #include "cmCommand.h" #include "cmPathLabel.h" #include "cmSearchPath.h" +class cmMakefile; + /** \class cmFindCommon * \brief Base class for FIND_XXX implementations. * diff --git a/Source/cmFunctionBlocker.h b/Source/cmFunctionBlocker.h index 388115d..b3450b3 100644 --- a/Source/cmFunctionBlocker.h +++ b/Source/cmFunctionBlocker.h @@ -3,12 +3,9 @@ #ifndef cmFunctionBlocker_h #define cmFunctionBlocker_h -#include - -#include "cmStandardIncludes.h" - -#include "cmExecutionStatus.h" #include "cmListFileCache.h" + +class cmExecutionStatus; class cmMakefile; class cmFunctionBlocker diff --git a/Source/cmFunctionCommand.cxx b/Source/cmFunctionCommand.cxx index 0ba575a..31adcb7 100644 --- a/Source/cmFunctionCommand.cxx +++ b/Source/cmFunctionCommand.cxx @@ -2,7 +2,6 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmFunctionCommand.h" -#include #include #include "cmAlgorithms.h" diff --git a/Source/cmGeneratedFileStream.cxx b/Source/cmGeneratedFileStream.cxx index 6cdb7f5..4731493 100644 --- a/Source/cmGeneratedFileStream.cxx +++ b/Source/cmGeneratedFileStream.cxx @@ -2,11 +2,12 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmGeneratedFileStream.h" -#include "cmSystemTools.h" - #include +#include "cmSystemTools.h" + #if defined(CMAKE_BUILD_WITH_CMAKE) +#include "cm_codecvt.hxx" #include #endif diff --git a/Source/cmGeneratorExpression.cxx b/Source/cmGeneratorExpression.cxx index 34f763c..1f2d2b4 100644 --- a/Source/cmGeneratorExpression.cxx +++ b/Source/cmGeneratorExpression.cxx @@ -2,6 +2,9 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmGeneratorExpression.h" +#include +#include + #include "assert.h" #include "cmAlgorithms.h" #include "cmGeneratorExpressionContext.h" @@ -9,9 +12,7 @@ #include "cmGeneratorExpressionLexer.h" #include "cmGeneratorExpressionParser.h" #include "cmSystemTools.h" - -#include -#include +#include "cm_auto_ptr.hxx" cmGeneratorExpression::cmGeneratorExpression( const cmListFileBacktrace& backtrace) diff --git a/Source/cmGeneratorExpressionEvaluationFile.cxx b/Source/cmGeneratorExpressionEvaluationFile.cxx index c6c4c3a..aeb005fd 100644 --- a/Source/cmGeneratorExpressionEvaluationFile.cxx +++ b/Source/cmGeneratorExpressionEvaluationFile.cxx @@ -2,6 +2,11 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmGeneratorExpressionEvaluationFile.h" +#include +#include +#include +#include + #include "cmGeneratedFileStream.h" #include "cmGlobalGenerator.h" #include "cmListFileCache.h" @@ -9,13 +14,9 @@ #include "cmMakefile.h" #include "cmSourceFile.h" #include "cmSystemTools.h" +#include "cm_auto_ptr.hxx" #include "cmake.h" -#include -#include -#include -#include - cmGeneratorExpressionEvaluationFile::cmGeneratorExpressionEvaluationFile( const std::string& input, CM_AUTO_PTR outputFileExpr, diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index ca056c0..882de85 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -2,6 +2,17 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmGeneratorTarget.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + #include "cmAlgorithms.h" #include "cmComputeLinkInformation.h" #include "cmCustomCommand.h" @@ -24,16 +35,7 @@ #include "cm_unordered_set.hxx" #include "cmake.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +class cmMessenger; template <> const char* cmTargetPropertyComputer::GetSources( diff --git a/Source/cmGetCMakePropertyCommand.cxx b/Source/cmGetCMakePropertyCommand.cxx index c92ae21..7962da6 100644 --- a/Source/cmGetCMakePropertyCommand.cxx +++ b/Source/cmGetCMakePropertyCommand.cxx @@ -2,7 +2,6 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmGetCMakePropertyCommand.h" -#include #include #include "cmAlgorithms.h" diff --git a/Source/cmGlobalBorlandMakefileGenerator.cxx b/Source/cmGlobalBorlandMakefileGenerator.cxx index a0a33ea..d2372a7 100644 --- a/Source/cmGlobalBorlandMakefileGenerator.cxx +++ b/Source/cmGlobalBorlandMakefileGenerator.cxx @@ -2,6 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmGlobalBorlandMakefileGenerator.h" +#include "cmDocumentationEntry.h" #include "cmLocalUnixMakefileGenerator3.h" #include "cmMakefile.h" #include "cmState.h" diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index cf51c6a..2d0767f 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -9,6 +9,16 @@ #include "cmGlobalGenerator.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + #include "cmAlgorithms.h" #include "cmCPackPropertiesGenerator.h" #include "cmComputeTargetDepends.h" @@ -29,20 +39,11 @@ #include "cmQtAutoGeneratorInitializer.h" #include "cmSourceFile.h" #include "cmState.h" +#include "cmStateDirectory.h" #include "cmStateTypes.h" #include "cmVersion.h" #include "cmake.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include - #if defined(CMAKE_BUILD_WITH_CMAKE) #include #include diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index 4bf4bd1..88ef8da 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -5,8 +5,15 @@ #include +#include +#include +#include +#include +#include +#include + +#include "cmCustomCommandLines.h" #include "cmExportSetMap.h" -#include "cmStateDirectory.h" #include "cmStateSnapshot.h" #include "cmSystemTools.h" #include "cmTarget.h" @@ -14,26 +21,19 @@ #include "cm_codecvt.hxx" #include "cm_unordered_map.hxx" -#include -#include -#include -#include -#include -#include - #if defined(CMAKE_BUILD_WITH_CMAKE) #include "cmFileLockPool.h" #endif -class cmCustomCommandLines; -class cmSourceFile; class cmExportBuildFileGenerator; class cmExternalMakefileProjectGenerator; class cmGeneratorTarget; -class cmLocalGenerator; class cmLinkLineComputer; +class cmLocalGenerator; class cmMakefile; class cmOutputConverter; +class cmSourceFile; +class cmStateDirectory; class cmake; /** \class cmGlobalGenerator diff --git a/Source/cmGlobalGeneratorFactory.h b/Source/cmGlobalGeneratorFactory.h index 528e118..5e948f7 100644 --- a/Source/cmGlobalGeneratorFactory.h +++ b/Source/cmGlobalGeneratorFactory.h @@ -5,12 +5,11 @@ #include -#include - -#include "cmStandardIncludes.h" +#include +#include -class cmake; class cmGlobalGenerator; +class cmake; struct cmDocumentationEntry; /** \class cmGlobalGeneratorFactory diff --git a/Source/cmGlobalJOMMakefileGenerator.cxx b/Source/cmGlobalJOMMakefileGenerator.cxx index 78bf5bd..18c45e0 100644 --- a/Source/cmGlobalJOMMakefileGenerator.cxx +++ b/Source/cmGlobalJOMMakefileGenerator.cxx @@ -2,6 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmGlobalJOMMakefileGenerator.h" +#include "cmDocumentationEntry.h" #include "cmLocalUnixMakefileGenerator3.h" #include "cmMakefile.h" #include "cmState.h" diff --git a/Source/cmGlobalMSYSMakefileGenerator.cxx b/Source/cmGlobalMSYSMakefileGenerator.cxx index f17b915..7e0d0d4 100644 --- a/Source/cmGlobalMSYSMakefileGenerator.cxx +++ b/Source/cmGlobalMSYSMakefileGenerator.cxx @@ -2,11 +2,13 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmGlobalMSYSMakefileGenerator.h" +#include + +#include "cmDocumentationEntry.h" #include "cmLocalUnixMakefileGenerator3.h" #include "cmMakefile.h" #include "cmState.h" #include "cmake.h" -#include cmGlobalMSYSMakefileGenerator::cmGlobalMSYSMakefileGenerator(cmake* cm) : cmGlobalUnixMakefileGenerator3(cm) diff --git a/Source/cmGlobalMinGWMakefileGenerator.cxx b/Source/cmGlobalMinGWMakefileGenerator.cxx index 255c0f5..3c3a5d1 100644 --- a/Source/cmGlobalMinGWMakefileGenerator.cxx +++ b/Source/cmGlobalMinGWMakefileGenerator.cxx @@ -2,6 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmGlobalMinGWMakefileGenerator.h" +#include "cmDocumentationEntry.h" #include "cmLocalUnixMakefileGenerator3.h" #include "cmMakefile.h" #include "cmState.h" diff --git a/Source/cmGlobalNMakeMakefileGenerator.cxx b/Source/cmGlobalNMakeMakefileGenerator.cxx index 06aba73..da683fb 100644 --- a/Source/cmGlobalNMakeMakefileGenerator.cxx +++ b/Source/cmGlobalNMakeMakefileGenerator.cxx @@ -2,6 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmGlobalNMakeMakefileGenerator.h" +#include "cmDocumentationEntry.h" #include "cmLocalUnixMakefileGenerator3.h" #include "cmMakefile.h" #include "cmState.h" diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 830ab7f..f62c8ec 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -2,6 +2,17 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmGlobalNinjaGenerator.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + #include "cmAlgorithms.h" #include "cmDocumentationEntry.h" #include "cmFortranParser.h" @@ -13,6 +24,9 @@ #include "cmMakefile.h" #include "cmNinjaLinkLineComputer.h" #include "cmOutputConverter.h" +#include "cmState.h" +#include "cmStateDirectory.h" +#include "cmStateSnapshot.h" #include "cmStateTypes.h" #include "cmSystemTools.h" #include "cmTarget.h" @@ -21,15 +35,7 @@ #include "cm_auto_ptr.hxx" #include "cmake.h" -#include "cm_jsoncpp_reader.h" -#include "cm_jsoncpp_writer.h" - -#include -#include -#include -#include -#include -#include +class cmLinkLineComputer; const char* cmGlobalNinjaGenerator::NINJA_BUILD_FILE = "build.ninja"; const char* cmGlobalNinjaGenerator::NINJA_RULES_FILE = "rules.ninja"; diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h index 064ff0b..a51e919 100644 --- a/Source/cmGlobalNinjaGenerator.h +++ b/Source/cmGlobalNinjaGenerator.h @@ -5,12 +5,6 @@ #include -#include "cmGlobalCommonGenerator.h" -#include "cmGlobalGenerator.h" -#include "cmGlobalGeneratorFactory.h" -#include "cmNinjaTypes.h" -#include "cmPolicies.h" - #include #include #include @@ -18,13 +12,23 @@ #include #include +#include "cmGlobalCommonGenerator.h" +#include "cmGlobalGenerator.h" +#include "cmGlobalGeneratorFactory.h" +#include "cmNinjaTypes.h" +#include "cmPolicies.h" +#include "cm_codecvt.hxx" + class cmCustomCommand; -class cmMakefile; -class cmake; -struct cmDocumentationEntry; class cmGeneratedFileStream; class cmGeneratorTarget; +class cmLinkLineComputer; class cmLocalGenerator; +class cmMakefile; +class cmOutputConverter; +class cmStateDirectory; +class cmake; +struct cmDocumentationEntry; /** * \class cmGlobalNinjaGenerator diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx index 90caaf9..23b3718 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.cxx +++ b/Source/cmGlobalUnixMakefileGenerator3.cxx @@ -2,6 +2,11 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmGlobalUnixMakefileGenerator3.h" +#include +#include +#include +#include + #include "cmAlgorithms.h" #include "cmDocumentationEntry.h" #include "cmGeneratedFileStream.h" @@ -14,16 +19,12 @@ #include "cmOutputConverter.h" #include "cmState.h" #include "cmStateDirectory.h" +#include "cmStateTypes.h" #include "cmSystemTools.h" #include "cmTarget.h" #include "cmTargetDepend.h" #include "cmake.h" -#include -#include -#include -#include - cmGlobalUnixMakefileGenerator3::cmGlobalUnixMakefileGenerator3(cmake* cm) : cmGlobalCommonGenerator(cm) { diff --git a/Source/cmGlobalUnixMakefileGenerator3.h b/Source/cmGlobalUnixMakefileGenerator3.h index 843e5dc..67d7bc9 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.h +++ b/Source/cmGlobalUnixMakefileGenerator3.h @@ -5,11 +5,6 @@ #include -#include "cmGeneratorTarget.h" -#include "cmGlobalCommonGenerator.h" -#include "cmGlobalGeneratorFactory.h" -#include "cmStateTypes.h" - #include #include #include @@ -17,6 +12,11 @@ #include #include +#include "cmGeneratorTarget.h" +#include "cmGlobalCommonGenerator.h" +#include "cmGlobalGeneratorFactory.h" +#include "cmStateSnapshot.h" + class cmGeneratedFileStream; class cmLocalGenerator; class cmLocalUnixMakefileGenerator3; diff --git a/Source/cmGlobalWatcomWMakeGenerator.cxx b/Source/cmGlobalWatcomWMakeGenerator.cxx index 0900797..94cdb38 100644 --- a/Source/cmGlobalWatcomWMakeGenerator.cxx +++ b/Source/cmGlobalWatcomWMakeGenerator.cxx @@ -5,7 +5,6 @@ #include "cmDocumentationEntry.h" #include "cmMakefile.h" #include "cmState.h" -#include "cmStateTypes.h" #include "cmake.h" cmGlobalWatcomWMakeGenerator::cmGlobalWatcomWMakeGenerator(cmake* cm) diff --git a/Source/cmGraphAdjacencyList.h b/Source/cmGraphAdjacencyList.h index a154373..e6aec47 100644 --- a/Source/cmGraphAdjacencyList.h +++ b/Source/cmGraphAdjacencyList.h @@ -3,9 +3,9 @@ #ifndef cmGraphAdjacencyList_h #define cmGraphAdjacencyList_h -#include +#include // IWYU pragma: keep -#include "cmStandardIncludes.h" +#include /** * Graph edge representation. Most use cases just need the diff --git a/Source/cmGraphVizWriter.cxx b/Source/cmGraphVizWriter.cxx index 6b32f73..0f69aaa 100644 --- a/Source/cmGraphVizWriter.cxx +++ b/Source/cmGraphVizWriter.cxx @@ -2,21 +2,22 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmGraphVizWriter.h" +#include +#include +#include +#include + #include "cmGeneratedFileStream.h" #include "cmGeneratorTarget.h" #include "cmGlobalGenerator.h" #include "cmLocalGenerator.h" #include "cmMakefile.h" +#include "cmStateSnapshot.h" #include "cmSystemTools.h" #include "cmTarget.h" #include "cm_auto_ptr.hxx" #include "cmake.h" -#include -#include -#include -#include - static const char* getShapeForTarget(const cmGeneratorTarget* target) { if (!target) { diff --git a/Source/cmHexFileConverter.cxx b/Source/cmHexFileConverter.cxx index db855d2..d9d6598 100644 --- a/Source/cmHexFileConverter.cxx +++ b/Source/cmHexFileConverter.cxx @@ -2,11 +2,12 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmHexFileConverter.h" -#include "cmSystemTools.h" - +#include #include #include +#include "cmSystemTools.h" + #define INTEL_HEX_MIN_LINE_LENGTH (1 + 8 + 2) #define INTEL_HEX_MAX_LINE_LENGTH (1 + 8 + (256 * 2) + 2) #define MOTOROLA_SREC_MIN_LINE_LENGTH (2 + 2 + 4 + 2) diff --git a/Source/cmHexFileConverter.h b/Source/cmHexFileConverter.h index cb550bb..75c8028 100644 --- a/Source/cmHexFileConverter.h +++ b/Source/cmHexFileConverter.h @@ -3,9 +3,7 @@ #ifndef cmHexFileConverter_h #define cmHexFileConverter_h -#include -#include "cmStandardIncludes.h" /** \class cmHexFileConverter * \brief Can detects Intel Hex and Motorola S-record files and convert them diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx index bf59e88..fadebb4 100644 --- a/Source/cmInstallCommand.cxx +++ b/Source/cmInstallCommand.cxx @@ -2,7 +2,6 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmInstallCommand.h" -#include #include #include #include diff --git a/Source/cmInstallCommandArguments.cxx b/Source/cmInstallCommandArguments.cxx index de6919b..6b15468 100644 --- a/Source/cmInstallCommandArguments.cxx +++ b/Source/cmInstallCommandArguments.cxx @@ -2,6 +2,8 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmInstallCommandArguments.h" +#include + #include "cmSystemTools.h" // Table of valid permissions. diff --git a/Source/cmInstallCommandArguments.h b/Source/cmInstallCommandArguments.h index 82c2310..c1523b2 100644 --- a/Source/cmInstallCommandArguments.h +++ b/Source/cmInstallCommandArguments.h @@ -3,9 +3,10 @@ #ifndef cmInstallCommandArguments_h #define cmInstallCommandArguments_h -#include +#include // IWYU pragma: keep -#include "cmStandardIncludes.h" +#include +#include #include "cmCommandArgumentsHelper.h" diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx index f1df073..4dfa40f 100644 --- a/Source/cmInstallTargetGenerator.cxx +++ b/Source/cmInstallTargetGenerator.cxx @@ -2,6 +2,12 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmInstallTargetGenerator.h" +#include +#include +#include +#include +#include + #include "cmComputeLinkInformation.h" #include "cmGeneratorExpression.h" #include "cmGeneratorTarget.h" @@ -12,15 +18,8 @@ #include "cmStateTypes.h" #include "cmSystemTools.h" #include "cmTarget.h" -#include "cm_auto_ptr.hxx" #include "cmake.h" -#include -#include -#include -#include -#include - cmInstallTargetGenerator::cmInstallTargetGenerator( const std::string& targetName, const char* dest, bool implib, const char* file_permissions, std::vector const& configurations, diff --git a/Source/cmLinkItem.h b/Source/cmLinkItem.h index 74d6774..6fd6f50 100644 --- a/Source/cmLinkItem.h +++ b/Source/cmLinkItem.h @@ -3,8 +3,16 @@ #ifndef cmLinkItem_h #define cmLinkItem_h +#include + +#include +#include +#include +#include + #include "cmListFileCache.h" #include "cmSystemTools.h" +#include "cmTargetLinkLibraryType.h" class cmGeneratorTarget; diff --git a/Source/cmLinkLineComputer.cxx b/Source/cmLinkLineComputer.cxx index c271246..cf0cf88 100644 --- a/Source/cmLinkLineComputer.cxx +++ b/Source/cmLinkLineComputer.cxx @@ -2,10 +2,15 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmLinkLineComputer.h" + +#include +#include + #include "cmComputeLinkInformation.h" #include "cmGeneratorTarget.h" #include "cmOutputConverter.h" #include "cmStateDirectory.h" +#include "cmStateTypes.h" cmLinkLineComputer::cmLinkLineComputer(cmOutputConverter* outputConverter, cmStateDirectory stateDir) diff --git a/Source/cmLinkLineComputer.h b/Source/cmLinkLineComputer.h index 6bbb69e..97a5d1b 100644 --- a/Source/cmLinkLineComputer.h +++ b/Source/cmLinkLineComputer.h @@ -4,6 +4,10 @@ #ifndef cmLinkLineComputer_h #define cmLinkLineComputer_h +#include // IWYU pragma: keep + +#include + #include "cmStateDirectory.h" class cmComputeLinkInformation; diff --git a/Source/cmLinkedTree.h b/Source/cmLinkedTree.h index d2c6f33..4f95522 100644 --- a/Source/cmLinkedTree.h +++ b/Source/cmLinkedTree.h @@ -5,9 +5,9 @@ #include -#include "cmStandardIncludes.h" - #include +#include +#include /** @brief A adaptor for traversing a tree structure in a vector diff --git a/Source/cmLocalCommonGenerator.cxx b/Source/cmLocalCommonGenerator.cxx index 6b49f1e..d5f9d27 100644 --- a/Source/cmLocalCommonGenerator.cxx +++ b/Source/cmLocalCommonGenerator.cxx @@ -2,10 +2,11 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmLocalCommonGenerator.h" +#include + #include "cmGeneratorTarget.h" #include "cmMakefile.h" - -#include +#include "cmOutputConverter.h" class cmGlobalGenerator; diff --git a/Source/cmLocalCommonGenerator.h b/Source/cmLocalCommonGenerator.h index eb5f850..f83f371 100644 --- a/Source/cmLocalCommonGenerator.h +++ b/Source/cmLocalCommonGenerator.h @@ -5,11 +5,10 @@ #include -#include "cmLocalGenerator.h" -#include "cmOutputConverter.h" - #include +#include "cmLocalGenerator.h" + class cmGeneratorTarget; class cmGlobalGenerator; class cmMakefile; diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 4aecb1d..7d3a2f0 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -18,6 +18,7 @@ #include "cmSourceFile.h" #include "cmState.h" #include "cmStateDirectory.h" +#include "cmStateTypes.h" #include "cmSystemTools.h" #include "cmTarget.h" #include "cmTestGenerator.h" @@ -32,10 +33,10 @@ #include #include #include -#include #include #include #include +#include #include #if defined(__HAIKU__) diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h index 6314aff..fdca78a 100644 --- a/Source/cmLocalGenerator.h +++ b/Source/cmLocalGenerator.h @@ -5,29 +5,28 @@ #include -#include "cmListFileCache.h" -#include "cmOutputConverter.h" -#include "cmPolicies.h" -#include "cmRulePlaceholderExpander.h" -#include "cmStateTypes.h" -#include "cmake.h" - #include #include #include #include -#include #include #include +#include "cmListFileCache.h" +#include "cmOutputConverter.h" +#include "cmPolicies.h" +#include "cmStateSnapshot.h" +#include "cmake.h" + class cmComputeLinkInformation; class cmCustomCommandGenerator; class cmGeneratorTarget; class cmGlobalGenerator; -class cmRulePlaceholderExpander; +class cmLinkLineComputer; class cmMakefile; +class cmRulePlaceholderExpander; class cmSourceFile; -class cmLinkLineComputer; +class cmState; /** \class cmLocalGenerator * \brief Create required build files for a directory. diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx index c27ab09..c2d9d57 100644 --- a/Source/cmLocalNinjaGenerator.cxx +++ b/Source/cmLocalNinjaGenerator.cxx @@ -2,6 +2,13 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmLocalNinjaGenerator.h" +#include +#include +#include +#include +#include +#include + #include "cmCustomCommand.h" #include "cmCustomCommandGenerator.h" #include "cmGeneratedFileStream.h" @@ -15,15 +22,9 @@ #include "cmState.h" #include "cmStateTypes.h" #include "cmSystemTools.h" +#include "cm_auto_ptr.hxx" #include "cmake.h" -#include -#include -#include -#include -#include -#include - cmLocalNinjaGenerator::cmLocalNinjaGenerator(cmGlobalGenerator* gg, cmMakefile* mf) : cmLocalCommonGenerator(gg, mf, mf->GetState()->GetBinaryDirectory()) diff --git a/Source/cmLocalNinjaGenerator.h b/Source/cmLocalNinjaGenerator.h index 95d8eb8..1080319 100644 --- a/Source/cmLocalNinjaGenerator.h +++ b/Source/cmLocalNinjaGenerator.h @@ -5,17 +5,16 @@ #include -#include "cmLocalCommonGenerator.h" -#include "cmLocalGenerator.h" -#include "cmNinjaTypes.h" -#include "cmOutputConverter.h" - #include #include #include #include #include +#include "cmLocalCommonGenerator.h" +#include "cmNinjaTypes.h" +#include "cmOutputConverter.h" + class cmCustomCommand; class cmCustomCommandGenerator; class cmGeneratedFileStream; @@ -23,6 +22,7 @@ class cmGeneratorTarget; class cmGlobalGenerator; class cmGlobalNinjaGenerator; class cmMakefile; +class cmRulePlaceholderExpander; class cmSourceFile; class cmake; diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index 4f81ef1..8bb084a 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -2,6 +2,14 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmLocalUnixMakefileGenerator3.h" +#include +#include +#include +#include +#include +#include +#include + #include "cmAlgorithms.h" #include "cmCustomCommand.h" #include "cmCustomCommandGenerator.h" @@ -18,9 +26,11 @@ #include "cmSourceFile.h" #include "cmState.h" #include "cmStateDirectory.h" +#include "cmStateSnapshot.h" #include "cmStateTypes.h" #include "cmSystemTools.h" #include "cmVersion.h" +#include "cm_auto_ptr.hxx" #include "cmake.h" // Include dependency scanners for supported languages. Only the @@ -31,15 +41,6 @@ #include "cmDependsJava.h" #endif -#include -#include -#include -#include -#include -#include -#include -#include - // Escape special characters in Makefile dependency lines class cmMakeSafe { diff --git a/Source/cmLocale.h b/Source/cmLocale.h index f35e528..e8e751d 100644 --- a/Source/cmLocale.h +++ b/Source/cmLocale.h @@ -5,8 +5,6 @@ #include -#include "cmStandardIncludes.h" - #include class cmLocaleRAII diff --git a/Source/cmMSVC60LinkLineComputer.cxx b/Source/cmMSVC60LinkLineComputer.cxx index 9308d91..d761e7b 100644 --- a/Source/cmMSVC60LinkLineComputer.cxx +++ b/Source/cmMSVC60LinkLineComputer.cxx @@ -3,7 +3,13 @@ #include "cmMSVC60LinkLineComputer.h" +#include "cmStateDirectory.h" + +#if defined(_WIN32) && !defined(__CYGWIN__) #include "cmSystemTools.h" +#endif + +class cmOutputConverter; cmMSVC60LinkLineComputer::cmMSVC60LinkLineComputer( cmOutputConverter* outputConverter, cmStateDirectory stateDir) diff --git a/Source/cmMSVC60LinkLineComputer.h b/Source/cmMSVC60LinkLineComputer.h index 381b8a2..9a28dca 100644 --- a/Source/cmMSVC60LinkLineComputer.h +++ b/Source/cmMSVC60LinkLineComputer.h @@ -4,8 +4,15 @@ #ifndef cmMSVC60LinkLineComputer_h #define cmMSVC60LinkLineComputer_h +#include + +#include + #include "cmLinkLineComputer.h" +class cmOutputConverter; +class cmStateDirectory; + class cmMSVC60LinkLineComputer : public cmLinkLineComputer { public: diff --git a/Source/cmMacroCommand.cxx b/Source/cmMacroCommand.cxx index d777bd5..583f801 100644 --- a/Source/cmMacroCommand.cxx +++ b/Source/cmMacroCommand.cxx @@ -2,7 +2,6 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmMacroCommand.h" -#include #include #include diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 741ffb8..90182f9 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -2,6 +2,16 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmMakefile.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + #include "cmAlgorithms.h" #include "cmCommand.h" #include "cmCommandArgumentParserHelper.h" @@ -14,6 +24,7 @@ #include "cmGeneratorExpression.h" #include "cmGeneratorExpressionEvaluationFile.h" #include "cmGlobalGenerator.h" +#include "cmInstallGenerator.h" // IWYU pragma: keep #include "cmListFileCache.h" #include "cmSourceFile.h" #include "cmSourceFileLocation.h" @@ -21,28 +32,17 @@ #include "cmStateDirectory.h" #include "cmStateTypes.h" #include "cmSystemTools.h" +#include "cmTargetLinkLibraryType.h" #include "cmTest.h" +#include "cmTestGenerator.h" // IWYU pragma: keep #include "cmVersion.h" +#include "cm_auto_ptr.hxx" #include "cmake.h" -#include "cmInstallGenerator.h" // IWYU pragma: keep -#include "cmTestGenerator.h" // IWYU pragma: keep - #ifdef CMAKE_BUILD_WITH_CMAKE #include "cmVariableWatch.h" #endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - class cmMessenger; // default is not to be building executables diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 3067f2c..859b3c8 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -5,13 +5,21 @@ #include +#include +#include +#include +#include +#include +#include + #include "cmAlgorithms.h" #include "cmListFileCache.h" #include "cmNewLineStyle.h" #include "cmPolicies.h" #include "cmStateSnapshot.h" +#include "cmStateTypes.h" #include "cmTarget.h" -#include "cmTargetLinkLibraryType.h" +#include "cm_auto_ptr.hxx" #include "cm_unordered_map.hxx" #include "cmake.h" @@ -19,15 +27,6 @@ #include "cmSourceGroup.h" #endif -#include -#include - -#include -#include -#include -#include -#include - class cmCommand; class cmCompiledGeneratorExpression; class cmCustomCommandLines; @@ -40,6 +39,7 @@ class cmGlobalGenerator; class cmInstallGenerator; class cmMessenger; class cmSourceFile; +class cmState; class cmTest; class cmTestGenerator; class cmVariableWatch; diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx index cbbd2e6..358804e 100644 --- a/Source/cmMakefileExecutableTargetGenerator.cxx +++ b/Source/cmMakefileExecutableTargetGenerator.cxx @@ -2,6 +2,10 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmMakefileExecutableTargetGenerator.h" +#include +#include +#include + #include "cmGeneratedFileStream.h" #include "cmGeneratorTarget.h" #include "cmGlobalUnixMakefileGenerator3.h" @@ -13,13 +17,12 @@ #include "cmOutputConverter.h" #include "cmRulePlaceholderExpander.h" #include "cmState.h" +#include "cmStateDirectory.h" +#include "cmStateSnapshot.h" #include "cmSystemTools.h" +#include "cm_auto_ptr.hxx" #include "cmake.h" -#include -#include -#include - cmMakefileExecutableTargetGenerator::cmMakefileExecutableTargetGenerator( cmGeneratorTarget* target) : cmMakefileTargetGenerator(target) diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx index a249efd..c591bb3 100644 --- a/Source/cmMakefileLibraryTargetGenerator.cxx +++ b/Source/cmMakefileLibraryTargetGenerator.cxx @@ -2,6 +2,11 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmMakefileLibraryTargetGenerator.h" +#include // IWYU pragma: keep + +#include +#include + #include "cmGeneratedFileStream.h" #include "cmGeneratorTarget.h" #include "cmGlobalUnixMakefileGenerator3.h" @@ -13,13 +18,13 @@ #include "cmOutputConverter.h" #include "cmRulePlaceholderExpander.h" #include "cmState.h" +#include "cmStateDirectory.h" +#include "cmStateSnapshot.h" #include "cmStateTypes.h" #include "cmSystemTools.h" +#include "cm_auto_ptr.hxx" #include "cmake.h" -#include -#include - cmMakefileLibraryTargetGenerator::cmMakefileLibraryTargetGenerator( cmGeneratorTarget* target) : cmMakefileTargetGenerator(target) diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index 68aabef..5bec2bb 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -2,6 +2,10 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmMakefileTargetGenerator.h" +#include +#include +#include + #include "cmAlgorithms.h" #include "cmComputeLinkInformation.h" #include "cmCustomCommand.h" @@ -10,8 +14,6 @@ #include "cmGeneratorExpression.h" #include "cmGeneratorTarget.h" #include "cmGlobalUnixMakefileGenerator3.h" -#include "cmLinkLineComputer.h" -#include "cmLocalGenerator.h" #include "cmLocalUnixMakefileGenerator3.h" #include "cmMakefile.h" #include "cmMakefileExecutableTargetGenerator.h" @@ -21,17 +23,13 @@ #include "cmRulePlaceholderExpander.h" #include "cmSourceFile.h" #include "cmState.h" +#include "cmStateDirectory.h" +#include "cmStateSnapshot.h" #include "cmStateTypes.h" #include "cmSystemTools.h" #include "cm_auto_ptr.hxx" #include "cmake.h" -#include -#include -#include -#include -#include - #ifndef _WIN32 #include #endif diff --git a/Source/cmMakefileTargetGenerator.h b/Source/cmMakefileTargetGenerator.h index e44f64a..347f9f2 100644 --- a/Source/cmMakefileTargetGenerator.h +++ b/Source/cmMakefileTargetGenerator.h @@ -5,22 +5,24 @@ #include -#include "cmCommonTargetGenerator.h" -#include "cmLocalUnixMakefileGenerator3.h" -#include "cmOSXBundleGenerator.h" - #include #include #include #include #include +#include "cmCommonTargetGenerator.h" +#include "cmLocalUnixMakefileGenerator3.h" +#include "cmOSXBundleGenerator.h" + class cmCustomCommandGenerator; class cmGeneratedFileStream; class cmGeneratorTarget; class cmGlobalUnixMakefileGenerator3; -class cmSourceFile; class cmLinkLineComputer; +class cmOutputConverter; +class cmSourceFile; +class cmStateDirectory; /** \class cmMakefileTargetGenerator * \brief Support Routines for writing makefiles diff --git a/Source/cmMakefileUtilityTargetGenerator.cxx b/Source/cmMakefileUtilityTargetGenerator.cxx index ecb29cb..a7c5d27 100644 --- a/Source/cmMakefileUtilityTargetGenerator.cxx +++ b/Source/cmMakefileUtilityTargetGenerator.cxx @@ -2,17 +2,17 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmMakefileUtilityTargetGenerator.h" +#include +#include +#include + #include "cmGeneratedFileStream.h" #include "cmGeneratorTarget.h" #include "cmGlobalUnixMakefileGenerator3.h" #include "cmLocalUnixMakefileGenerator3.h" #include "cmMakefile.h" #include "cmOSXBundleGenerator.h" -#include "cmOutputConverter.h" - -#include -#include -#include +#include "cmSystemTools.h" cmMakefileUtilityTargetGenerator::cmMakefileUtilityTargetGenerator( cmGeneratorTarget* target) diff --git a/Source/cmMessageCommand.cxx b/Source/cmMessageCommand.cxx index 2e15720..43fb5f5 100644 --- a/Source/cmMessageCommand.cxx +++ b/Source/cmMessageCommand.cxx @@ -2,8 +2,6 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmMessageCommand.h" -#include - #include "cmAlgorithms.h" #include "cmMakefile.h" #include "cmMessenger.h" diff --git a/Source/cmNinjaLinkLineComputer.cxx b/Source/cmNinjaLinkLineComputer.cxx index fa9df6d..2546b55 100644 --- a/Source/cmNinjaLinkLineComputer.cxx +++ b/Source/cmNinjaLinkLineComputer.cxx @@ -2,7 +2,11 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmNinjaLinkLineComputer.h" + #include "cmGlobalNinjaGenerator.h" +#include "cmStateDirectory.h" + +class cmOutputConverter; cmNinjaLinkLineComputer::cmNinjaLinkLineComputer( cmOutputConverter* outputConverter, cmStateDirectory stateDir, diff --git a/Source/cmNinjaLinkLineComputer.h b/Source/cmNinjaLinkLineComputer.h index daecea4..ff0771b 100644 --- a/Source/cmNinjaLinkLineComputer.h +++ b/Source/cmNinjaLinkLineComputer.h @@ -4,10 +4,15 @@ #ifndef cmNinjaLinkLineComputer_h #define cmNinjaLinkLineComputer_h +#include + +#include + #include "cmLinkLineComputer.h" -#include "cmState.h" class cmGlobalNinjaGenerator; +class cmOutputConverter; +class cmStateDirectory; class cmNinjaLinkLineComputer : public cmLinkLineComputer { diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index d70bf8e..a23e0ad 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -2,6 +2,15 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmNinjaNormalTargetGenerator.h" +#include +#include +#include +#include +#include +#include +#include +#include + #include "cmAlgorithms.h" #include "cmCustomCommand.h" #include "cmCustomCommandGenerator.h" @@ -18,19 +27,13 @@ #include "cmRulePlaceholderExpander.h" #include "cmSourceFile.h" #include "cmState.h" +#include "cmStateDirectory.h" +#include "cmStateSnapshot.h" #include "cmStateTypes.h" #include "cmSystemTools.h" +#include "cm_auto_ptr.hxx" #include "cmake.h" -#include -#include -#include -#include -#include -#include -#include -#include - #ifndef _WIN32 #include #endif diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index cf60892..a220cd8 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -2,10 +2,20 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmNinjaTargetGenerator.h" +#include +#include +#include +#include +#include +#include +#include +#include + #include "cmAlgorithms.h" #include "cmComputeLinkInformation.h" #include "cmCustomCommandGenerator.h" #include "cmGeneratedFileStream.h" +#include "cmGeneratorExpression.h" #include "cmGeneratorTarget.h" #include "cmGlobalNinjaGenerator.h" #include "cmLocalGenerator.h" @@ -19,16 +29,9 @@ #include "cmState.h" #include "cmStateTypes.h" #include "cmSystemTools.h" +#include "cm_auto_ptr.hxx" #include "cmake.h" -#include "cm_jsoncpp_writer.h" - -#include -#include -#include -#include -#include - cmNinjaTargetGenerator* cmNinjaTargetGenerator::New(cmGeneratorTarget* target) { switch (target->GetType()) { diff --git a/Source/cmNinjaTypes.h b/Source/cmNinjaTypes.h index b4eaa59..3fd536a 100644 --- a/Source/cmNinjaTypes.h +++ b/Source/cmNinjaTypes.h @@ -3,9 +3,11 @@ #ifndef cmNinjaTypes_h #define cmNinjaTypes_h -#include +#include // IWYU pragma: keep -#include "cmStandardIncludes.h" +#include +#include +#include typedef std::vector cmNinjaDeps; typedef std::map cmNinjaVars; diff --git a/Source/cmOptionCommand.cxx b/Source/cmOptionCommand.cxx index bbd6090..00a2d2b 100644 --- a/Source/cmOptionCommand.cxx +++ b/Source/cmOptionCommand.cxx @@ -2,8 +2,6 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmOptionCommand.h" -#include - #include "cmAlgorithms.h" #include "cmMakefile.h" #include "cmState.h" diff --git a/Source/cmOutputConverter.cxx b/Source/cmOutputConverter.cxx index 445ad0b..d6864a6 100644 --- a/Source/cmOutputConverter.cxx +++ b/Source/cmOutputConverter.cxx @@ -2,16 +2,17 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmOutputConverter.h" -#include "cmAlgorithms.h" -#include "cmState.h" -#include "cmStateDirectory.h" -#include "cmSystemTools.h" - #include #include #include #include #include +#include + +#include "cmAlgorithms.h" +#include "cmState.h" +#include "cmStateDirectory.h" +#include "cmSystemTools.h" cmOutputConverter::cmOutputConverter(cmStateSnapshot snapshot) : StateSnapshot(snapshot) diff --git a/Source/cmOutputConverter.h b/Source/cmOutputConverter.h index dabb091..a3da4cd 100644 --- a/Source/cmOutputConverter.h +++ b/Source/cmOutputConverter.h @@ -5,10 +5,12 @@ #include // IWYU pragma: keep +#include + #include "cmStateSnapshot.h" -#include -#include +class cmState; +class cmStateDirectory; class cmOutputConverter { diff --git a/Source/cmParseArgumentsCommand.cxx b/Source/cmParseArgumentsCommand.cxx index 0a2dd12..d75ee8e 100644 --- a/Source/cmParseArgumentsCommand.cxx +++ b/Source/cmParseArgumentsCommand.cxx @@ -2,7 +2,6 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmParseArgumentsCommand.h" -#include #include #include #include diff --git a/Source/cmPathLabel.cxx b/Source/cmPathLabel.cxx index 19e6820..30ba081 100644 --- a/Source/cmPathLabel.cxx +++ b/Source/cmPathLabel.cxx @@ -2,6 +2,8 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmPathLabel.h" +#include + cmPathLabel::cmPathLabel(const std::string& label) : Label(label) , Hash(0) diff --git a/Source/cmPathLabel.h b/Source/cmPathLabel.h index 5e9e423..cd9743c 100644 --- a/Source/cmPathLabel.h +++ b/Source/cmPathLabel.h @@ -3,9 +3,9 @@ #ifndef cmPathLabel_h #define cmPathLabel_h -#include +#include // IWYU pragma: keep -#include "cmStandardIncludes.h" +#include /** \class cmPathLabel * \brief Helper class for text based labels diff --git a/Source/cmQtAutoGeneratorInitializer.cxx b/Source/cmQtAutoGeneratorInitializer.cxx index f0373a1..8afd532 100644 --- a/Source/cmQtAutoGeneratorInitializer.cxx +++ b/Source/cmQtAutoGeneratorInitializer.cxx @@ -13,7 +13,6 @@ #include "cmSourceFile.h" #include "cmSourceFileLocation.h" #include "cmState.h" -#include "cmStateTypes.h" #include "cmSystemTools.h" #include "cmTarget.h" #include "cmake.h" @@ -27,7 +26,6 @@ #include #include #include -#include #include #include #include diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx index f56f575..499da3a 100644 --- a/Source/cmQtAutoGenerators.cxx +++ b/Source/cmQtAutoGenerators.cxx @@ -2,18 +2,6 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmQtAutoGenerators.h" -#include "cmAlgorithms.h" -#include "cmFilePathUuid.h" -#include "cmGlobalGenerator.h" -#include "cmMakefile.h" -#include "cmOutputConverter.h" -#include "cmState.h" -#include "cmStateDirectory.h" -#include "cmStateTypes.h" -#include "cmSystemTools.h" -#include "cm_auto_ptr.hxx" -#include "cmake.h" - #include #include #include @@ -26,6 +14,17 @@ #include #include +#include "cmAlgorithms.h" +#include "cmFilePathUuid.h" +#include "cmGlobalGenerator.h" +#include "cmMakefile.h" +#include "cmOutputConverter.h" +#include "cmStateDirectory.h" +#include "cmStateSnapshot.h" +#include "cmSystemTools.h" +#include "cm_auto_ptr.hxx" +#include "cmake.h" + #if defined(__APPLE__) #include #endif diff --git a/Source/cmRulePlaceholderExpander.cxx b/Source/cmRulePlaceholderExpander.cxx index 75ac54d..f190a5c 100644 --- a/Source/cmRulePlaceholderExpander.cxx +++ b/Source/cmRulePlaceholderExpander.cxx @@ -2,6 +2,10 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmRulePlaceholderExpander.h" +#include +#include +#include + #include "cmOutputConverter.h" #include "cmSystemTools.h" diff --git a/Source/cmRulePlaceholderExpander.h b/Source/cmRulePlaceholderExpander.h index 444419c..5223ae9 100644 --- a/Source/cmRulePlaceholderExpander.h +++ b/Source/cmRulePlaceholderExpander.h @@ -9,7 +9,6 @@ #include #include -class cmGeneratorTarget; class cmOutputConverter; class cmRulePlaceholderExpander diff --git a/Source/cmSearchPath.cxx b/Source/cmSearchPath.cxx index ff0b836..0df6e0c 100644 --- a/Source/cmSearchPath.cxx +++ b/Source/cmSearchPath.cxx @@ -2,7 +2,9 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmSearchPath.h" +#include #include +#include #include "cmAlgorithms.h" #include "cmFindCommon.h" diff --git a/Source/cmSearchPath.h b/Source/cmSearchPath.h index 80815ed..9ffa871 100644 --- a/Source/cmSearchPath.h +++ b/Source/cmSearchPath.h @@ -5,7 +5,9 @@ #include -#include "cmStandardIncludes.h" +#include +#include +#include class cmFindCommon; diff --git a/Source/cmServer.cxx b/Source/cmServer.cxx index 51a363f..5a71dc0 100644 --- a/Source/cmServer.cxx +++ b/Source/cmServer.cxx @@ -14,6 +14,7 @@ #include "cm_jsoncpp_value.h" #endif +#include #include #include #include diff --git a/Source/cmServerConnection.cxx b/Source/cmServerConnection.cxx index b4af52b..008052b 100644 --- a/Source/cmServerConnection.cxx +++ b/Source/cmServerConnection.cxx @@ -8,6 +8,7 @@ #include "cmServer.h" #include +#include namespace { diff --git a/Source/cmSetCommand.cxx b/Source/cmSetCommand.cxx index e49f142..820e7f6 100644 --- a/Source/cmSetCommand.cxx +++ b/Source/cmSetCommand.cxx @@ -2,7 +2,6 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmSetCommand.h" -#include #include #include "cmAlgorithms.h" diff --git a/Source/cmSourceFile.cxx b/Source/cmSourceFile.cxx index 6f29b18..5c4f18b 100644 --- a/Source/cmSourceFile.cxx +++ b/Source/cmSourceFile.cxx @@ -2,17 +2,16 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmSourceFile.h" +#include + #include "cmCustomCommand.h" #include "cmGlobalGenerator.h" #include "cmMakefile.h" #include "cmProperty.h" #include "cmState.h" -#include "cmStateTypes.h" #include "cmSystemTools.h" #include "cmake.h" -#include - cmSourceFile::cmSourceFile(cmMakefile* mf, const std::string& name) : Location(mf, name) { diff --git a/Source/cmState.cxx b/Source/cmState.cxx index db1e542..6e934e2 100644 --- a/Source/cmState.cxx +++ b/Source/cmState.cxx @@ -2,24 +2,22 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmState.h" -#include "cmStatePrivate.h" +#include +#include +#include +#include +#include #include "cmAlgorithms.h" #include "cmCacheManager.h" #include "cmCommand.h" #include "cmDefinitions.h" #include "cmListFileCache.h" +#include "cmStatePrivate.h" +#include "cmStateSnapshot.h" #include "cmSystemTools.h" #include "cmake.h" -#include -#include -#include -#include -#include -#include -#include - cmState::cmState() : IsInTryCompile(false) , WindowsShell(false) diff --git a/Source/cmState.h b/Source/cmState.h index 6d74815..41ffcdc 100644 --- a/Source/cmState.h +++ b/Source/cmState.h @@ -5,25 +5,22 @@ #include // IWYU pragma: keep -#include "cmAlgorithms.h" +#include +#include +#include +#include + #include "cmDefinitions.h" #include "cmLinkedTree.h" #include "cmProperty.h" #include "cmPropertyDefinitionMap.h" #include "cmPropertyMap.h" +#include "cmStatePrivate.h" #include "cmStateTypes.h" -#include -#include -#include -#include - class cmCacheManager; class cmCommand; -class cmListFileBacktrace; class cmPropertyDefinition; - -class cmStateDirectory; class cmStateSnapshot; class cmState diff --git a/Source/cmStateDirectory.cxx b/Source/cmStateDirectory.cxx index 01e1e7e..46a1858 100644 --- a/Source/cmStateDirectory.cxx +++ b/Source/cmStateDirectory.cxx @@ -2,8 +2,18 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmStateDirectory.h" + +#include +#include +#include +#include +#include + +#include "cmProperty.h" +#include "cmPropertyMap.h" #include "cmState.h" #include "cmStatePrivate.h" +#include "cmStateTypes.h" #include "cmSystemTools.h" static std::string const kBINARY_DIR = "BINARY_DIR"; diff --git a/Source/cmStateDirectory.h b/Source/cmStateDirectory.h index 17a89d8..8accc8e 100644 --- a/Source/cmStateDirectory.h +++ b/Source/cmStateDirectory.h @@ -10,9 +10,10 @@ #include #include "cmAlgorithms.h" +#include "cmLinkedTree.h" #include "cmListFileCache.h" +#include "cmStatePrivate.h" #include "cmStateSnapshot.h" -#include "cmStateTypes.h" class cmStateDirectory { diff --git a/Source/cmStatePrivate.h b/Source/cmStatePrivate.h index 8daa3cf..20700f2 100644 --- a/Source/cmStatePrivate.h +++ b/Source/cmStatePrivate.h @@ -12,9 +12,16 @@ #include "cmDefinitions.h" #include "cmLinkedTree.h" #include "cmListFileCache.h" +#include "cmPolicies.h" #include "cmPropertyMap.h" +#include "cmStateSnapshot.h" #include "cmStateTypes.h" +namespace cmStateDetail { +struct BuildsystemDirectoryStateType; +struct PolicyStackEntry; +} // namespace cmStateDetail + static const std::string cmPropertySentinal = std::string(); struct cmStateDetail::SnapshotDataType diff --git a/Source/cmStateSnapshot.cxx b/Source/cmStateSnapshot.cxx index 7f86221..cf6cb1b 100644 --- a/Source/cmStateSnapshot.cxx +++ b/Source/cmStateSnapshot.cxx @@ -3,10 +3,18 @@ #include "cmStateSnapshot.h" +#include +#include +#include +#include + +#include "cmAlgorithms.h" +#include "cmDefinitions.h" +#include "cmListFileCache.h" +#include "cmPropertyMap.h" #include "cmState.h" #include "cmStateDirectory.h" #include "cmStatePrivate.h" -#include "cmSystemTools.h" #include "cmVersion.h" #include "cmake.h" diff --git a/Source/cmStateSnapshot.h b/Source/cmStateSnapshot.h index 63b581d..72d0349 100644 --- a/Source/cmStateSnapshot.h +++ b/Source/cmStateSnapshot.h @@ -6,10 +6,10 @@ #include // IWYU pragma: keep -#include #include #include +#include "cmLinkedTree.h" #include "cmPolicies.h" #include "cmStateTypes.h" diff --git a/Source/cmStateTypes.h b/Source/cmStateTypes.h index 75f9e60..2c974c1 100644 --- a/Source/cmStateTypes.h +++ b/Source/cmStateTypes.h @@ -4,12 +4,12 @@ #ifndef cmStateTypes_h #define cmStateTypes_h +#include // IWYU pragma: keep + #include "cmLinkedTree.h" namespace cmStateDetail { -struct BuildsystemDirectoryStateType; struct SnapshotDataType; -struct PolicyStackEntry; typedef cmLinkedTree::iterator PositionType; } diff --git a/Source/cmStringCommand.cxx b/Source/cmStringCommand.cxx index 512bc91..f835445 100644 --- a/Source/cmStringCommand.cxx +++ b/Source/cmStringCommand.cxx @@ -2,7 +2,6 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmStringCommand.h" -#include #include #include #include diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 25ae339..dabdda5 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -2,6 +2,14 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmTarget.h" +#include +#include +#include +#include +#include +#include +#include + #include "cmAlgorithms.h" #include "cmGeneratorExpression.h" #include "cmGeneratorTarget.h" @@ -14,19 +22,13 @@ #include "cmSourceFile.h" #include "cmSourceFileLocation.h" #include "cmState.h" +#include "cmStateDirectory.h" +#include "cmStateSnapshot.h" #include "cmSystemTools.h" #include "cmTargetPropertyComputer.h" #include "cm_unordered_set.hxx" #include "cmake.h" -#include -#include -#include -#include -#include -#include -#include - template <> const char* cmTargetPropertyComputer::ComputeLocationForBuild( cmTarget const* tgt) diff --git a/Source/cmTarget.h b/Source/cmTarget.h index 1f035a1..57ef8d2 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -5,6 +5,13 @@ #include // IWYU pragma: keep +#include +#include +#include +#include +#include +#include + #include "cmAlgorithms.h" #include "cmCustomCommand.h" #include "cmListFileCache.h" @@ -14,16 +21,10 @@ #include "cmTargetLinkLibraryType.h" #include "cm_unordered_map.hxx" -#include -#include -#include -#include -#include -#include - +class cmGlobalGenerator; class cmMakefile; +class cmMessenger; class cmSourceFile; -class cmGlobalGenerator; class cmTargetInternals; class cmTargetInternalPointer diff --git a/Source/cmTargetCompileFeaturesCommand.cxx b/Source/cmTargetCompileFeaturesCommand.cxx index a1c9b82..1b6c008 100644 --- a/Source/cmTargetCompileFeaturesCommand.cxx +++ b/Source/cmTargetCompileFeaturesCommand.cxx @@ -2,7 +2,6 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmTargetCompileFeaturesCommand.h" -#include #include #include "cmAlgorithms.h" diff --git a/Source/cmTargetCompileOptionsCommand.cxx b/Source/cmTargetCompileOptionsCommand.cxx index a4db55b..1b4056d 100644 --- a/Source/cmTargetCompileOptionsCommand.cxx +++ b/Source/cmTargetCompileOptionsCommand.cxx @@ -2,7 +2,6 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmTargetCompileOptionsCommand.h" -#include #include #include "cmAlgorithms.h" diff --git a/Source/cmTargetDepend.h b/Source/cmTargetDepend.h index acea6ea..a953efb 100644 --- a/Source/cmTargetDepend.h +++ b/Source/cmTargetDepend.h @@ -3,9 +3,9 @@ #ifndef cmTargetDepend_h #define cmTargetDepend_h -#include +#include // IWYU pragma: keep -#include "cmStandardIncludes.h" +#include class cmGeneratorTarget; diff --git a/Source/cmTargetExport.h b/Source/cmTargetExport.h index 634148b..b08ede2 100644 --- a/Source/cmTargetExport.h +++ b/Source/cmTargetExport.h @@ -3,13 +3,13 @@ #ifndef cmTargetExport_h #define cmTargetExport_h -#include +#include // IWYU pragma: keep -#include "cmStandardIncludes.h" +#include class cmGeneratorTarget; -class cmInstallTargetGenerator; class cmInstallFilesGenerator; +class cmInstallTargetGenerator; /** \brief A member of an ExportSet * diff --git a/Source/cmTargetPropCommandBase.cxx b/Source/cmTargetPropCommandBase.cxx index 7aba0f8..9a5c1da 100644 --- a/Source/cmTargetPropCommandBase.cxx +++ b/Source/cmTargetPropCommandBase.cxx @@ -4,6 +4,9 @@ #include "cmGlobalGenerator.h" #include "cmMakefile.h" +#include "cmStateTypes.h" +#include "cmTarget.h" +#include "cmake.h" bool cmTargetPropCommandBase::HandleArguments( std::vector const& args, const std::string& prop, diff --git a/Source/cmTargetPropCommandBase.h b/Source/cmTargetPropCommandBase.h index 485a7f3..8b49653 100644 --- a/Source/cmTargetPropCommandBase.h +++ b/Source/cmTargetPropCommandBase.h @@ -3,6 +3,11 @@ #ifndef cmTargetPropCommandBase_h #define cmTargetPropCommandBase_h +#include // IWYU pragma: keep + +#include +#include + #include "cmCommand.h" class cmTarget; diff --git a/Source/cmTargetPropertyComputer.cxx b/Source/cmTargetPropertyComputer.cxx index 7cf1fd8..04931af 100644 --- a/Source/cmTargetPropertyComputer.cxx +++ b/Source/cmTargetPropertyComputer.cxx @@ -3,14 +3,13 @@ #include "cmTargetPropertyComputer.h" -#include "cmGeneratorTarget.h" -#include "cmGlobalGenerator.h" -#include "cmMakefile.h" +#include + #include "cmMessenger.h" -#include "cmSourceFile.h" -#include "cmSourceFileLocation.h" -#include "cmTarget.h" +#include "cmPolicies.h" +#include "cmStateSnapshot.h" #include "cm_unordered_set.hxx" +#include "cmake.h" bool cmTargetPropertyComputer::HandleLocationPropertyPolicy( std::string const& tgtName, cmMessenger* messenger, diff --git a/Source/cmTargetPropertyComputer.h b/Source/cmTargetPropertyComputer.h index 7989589..45d31be 100644 --- a/Source/cmTargetPropertyComputer.h +++ b/Source/cmTargetPropertyComputer.h @@ -5,14 +5,13 @@ #include // IWYU pragma: keep +#include + #include "cmAlgorithms.h" #include "cmListFileCache.h" +#include "cmStateTypes.h" #include "cmSystemTools.h" -#include -#include - -class cmTarget; class cmMessenger; class cmTargetPropertyComputer diff --git a/Source/cmTargetSourcesCommand.cxx b/Source/cmTargetSourcesCommand.cxx index 13c9a8f..058659a 100644 --- a/Source/cmTargetSourcesCommand.cxx +++ b/Source/cmTargetSourcesCommand.cxx @@ -2,7 +2,6 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmTargetSourcesCommand.h" -#include #include #include "cmAlgorithms.h" diff --git a/Source/cmTest.cxx b/Source/cmTest.cxx index 1c36dc6..4d0cbaa 100644 --- a/Source/cmTest.cxx +++ b/Source/cmTest.cxx @@ -5,7 +5,6 @@ #include "cmMakefile.h" #include "cmProperty.h" #include "cmState.h" -#include "cmStateTypes.h" #include "cmSystemTools.h" cmTest::cmTest(cmMakefile* mf) diff --git a/Source/cmTestGenerator.cxx b/Source/cmTestGenerator.cxx index 843f7b1..4164f3a 100644 --- a/Source/cmTestGenerator.cxx +++ b/Source/cmTestGenerator.cxx @@ -2,6 +2,10 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmTestGenerator.h" +#include +#include +#include + #include "cmGeneratorExpression.h" #include "cmGeneratorTarget.h" #include "cmLocalGenerator.h" @@ -11,11 +15,6 @@ #include "cmStateTypes.h" #include "cmSystemTools.h" #include "cmTest.h" -#include "cm_auto_ptr.hxx" - -#include -#include -#include cmTestGenerator::cmTestGenerator( cmTest* test, std::vector const& configurations) diff --git a/Source/cmTimestamp.cxx b/Source/cmTimestamp.cxx index 9597e09..589f195 100644 --- a/Source/cmTimestamp.cxx +++ b/Source/cmTimestamp.cxx @@ -2,15 +2,11 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmTimestamp.h" -#include "cmSystemTools.h" - -#include +#include #include #include -#include -// include sys/stat.h after sys/types.h -#include +#include "cmSystemTools.h" std::string cmTimestamp::CurrentTime(const std::string& formatString, bool utcFlag) diff --git a/Source/cmTimestamp.h b/Source/cmTimestamp.h index 44e397b..fdee564 100644 --- a/Source/cmTimestamp.h +++ b/Source/cmTimestamp.h @@ -3,9 +3,7 @@ #ifndef cmTimestamp_h #define cmTimestamp_h -#include - -#include "cmStandardIncludes.h" +#include // IWYU pragma: keep #include #include diff --git a/Source/cm_codecvt.hxx b/Source/cm_codecvt.hxx index 5f16bd8..b9c1d62 100644 --- a/Source/cm_codecvt.hxx +++ b/Source/cm_codecvt.hxx @@ -3,8 +3,9 @@ #ifndef cm_codecvt_hxx #define cm_codecvt_hxx -#include // IWYU pragma: keep +#include +#include #include #include diff --git a/Source/cmake.cxx b/Source/cmake.cxx index eb76ca0..6c066c6 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -17,6 +17,7 @@ #include "cmMakefile.h" #include "cmMessenger.h" #include "cmState.h" +#include "cmStateDirectory.h" #include "cmSystemTools.h" #include "cmTarget.h" #include "cmTargetLinkLibraryType.h" @@ -25,11 +26,11 @@ #include "cm_auto_ptr.hxx" #if defined(CMAKE_BUILD_WITH_CMAKE) +#include + #include "cmGraphVizWriter.h" #include "cmVariableWatch.h" #include "cm_unordered_map.hxx" - -#include #endif // only build kdevelop generator on non-windows platforms diff --git a/Source/cmake.h b/Source/cmake.h index 6e8d9c8..0f1891d 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -5,17 +5,18 @@ #include -#include "cmInstalledFile.h" -#include "cmListFileCache.h" -#include "cmStateSnapshot.h" - #include #include #include #include +#include "cmInstalledFile.h" +#include "cmListFileCache.h" +#include "cmStateSnapshot.h" +#include "cmStateTypes.h" + #if defined(CMAKE_BUILD_WITH_CMAKE) -#include "cm_jsoncpp_value.h" +#include #endif class cmExternalMakefileProjectGeneratorFactory; @@ -24,6 +25,7 @@ class cmGlobalGenerator; class cmGlobalGeneratorFactory; class cmMakefile; class cmMessenger; +class cmState; class cmVariableWatch; struct cmDocumentationEntry; diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx index 44af966..a974061 100644 --- a/Source/cmakemain.cxx +++ b/Source/cmakemain.cxx @@ -12,6 +12,7 @@ #include "cmGlobalGenerator.h" #include "cmMakefile.h" #include "cmState.h" +#include "cmStateTypes.h" #include "cmSystemTools.h" #include "cmake.h" #include "cmcmd.h" diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx index c008791..1db147a 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -8,6 +8,7 @@ #include "cmMakefile.h" #include "cmQtAutoGenerators.h" #include "cmStateDirectory.h" +#include "cmStateSnapshot.h" #include "cmSystemTools.h" #include "cmUtils.hxx" #include "cmVersion.h" ----------------------------------------------------------------------- Summary of changes: Source/CTest/cmCTestScriptHandler.cxx | 1 + Source/cmAlgorithms.h | 14 ++++++-- Source/cmCMakeMinimumRequired.cxx | 6 ++++ Source/cmCMakeMinimumRequired.h | 6 ++++ Source/cmCTest.cxx | 45 ++++++++++++------------ Source/cmCacheManager.cxx | 11 +++--- Source/cmCacheManager.h | 6 ++-- Source/cmCommandArgumentsHelper.h | 6 ++-- Source/cmCommonTargetGenerator.cxx | 3 +- Source/cmCommonTargetGenerator.h | 5 +-- Source/cmConditionEvaluator.cxx | 12 ++++++- Source/cmConditionEvaluator.h | 10 ++++-- Source/cmCoreTryCompile.cxx | 14 ++++++-- Source/cmCoreTryCompile.h | 5 +++ Source/cmCreateTestSourceList.cxx | 4 +++ Source/cmCreateTestSourceList.h | 7 ++++ Source/cmDefinitions.cxx | 1 + Source/cmDefinitions.h | 8 ++--- Source/cmDependsC.cxx | 7 ++-- Source/cmDependsFortran.cxx | 17 ++++----- Source/cmDependsJavaParserHelper.h | 2 ++ Source/cmExecutionStatus.h | 2 -- Source/cmExpandedCommandArgument.h | 4 +-- Source/cmExportBuildAndroidMKGenerator.cxx | 18 +++++++--- Source/cmExportBuildAndroidMKGenerator.h | 10 ++++-- Source/cmExportInstallAndroidMKGenerator.cxx | 11 +++--- Source/cmExportInstallAndroidMKGenerator.h | 10 +++++- Source/cmExtraCodeBlocksGenerator.cxx | 11 +++--- Source/cmExtraEclipseCDT4Generator.cxx | 17 +++++---- Source/cmExtraSublimeTextGenerator.cxx | 14 ++++---- Source/cmFileTimeComparison.cxx | 1 - Source/cmFindBase.cxx | 6 ++++ Source/cmFindBase.h | 5 +++ Source/cmFindCommon.cxx | 7 ++-- Source/cmFindCommon.h | 9 +++++ Source/cmFunctionBlocker.h | 7 ++-- Source/cmFunctionCommand.cxx | 1 - Source/cmGeneratedFileStream.cxx | 5 +-- Source/cmGeneratorExpression.cxx | 7 ++-- Source/cmGeneratorExpressionEvaluationFile.cxx | 11 +++--- Source/cmGeneratorTarget.cxx | 22 ++++++------ Source/cmGetCMakePropertyCommand.cxx | 1 - Source/cmGlobalBorlandMakefileGenerator.cxx | 1 + Source/cmGlobalGenerator.cxx | 21 +++++------ Source/cmGlobalGenerator.h | 22 ++++++------ Source/cmGlobalGeneratorFactory.h | 7 ++-- Source/cmGlobalJOMMakefileGenerator.cxx | 1 + Source/cmGlobalMSYSMakefileGenerator.cxx | 4 ++- Source/cmGlobalMinGWMakefileGenerator.cxx | 1 + Source/cmGlobalNMakeMakefileGenerator.cxx | 1 + Source/cmGlobalNinjaGenerator.cxx | 24 ++++++++----- Source/cmGlobalNinjaGenerator.h | 22 +++++++----- Source/cmGlobalUnixMakefileGenerator3.cxx | 11 +++--- Source/cmGlobalUnixMakefileGenerator3.h | 10 +++--- Source/cmGlobalWatcomWMakeGenerator.cxx | 1 - Source/cmGraphAdjacencyList.h | 4 +-- Source/cmGraphVizWriter.cxx | 11 +++--- Source/cmHexFileConverter.cxx | 5 +-- Source/cmHexFileConverter.h | 2 -- Source/cmInstallCommand.cxx | 1 - Source/cmInstallCommandArguments.cxx | 2 ++ Source/cmInstallCommandArguments.h | 5 +-- Source/cmInstallTargetGenerator.cxx | 13 ++++--- Source/cmLinkItem.h | 8 +++++ Source/cmLinkLineComputer.cxx | 5 +++ Source/cmLinkLineComputer.h | 4 +++ Source/cmLinkedTree.h | 4 +-- Source/cmLocalCommonGenerator.cxx | 5 +-- Source/cmLocalCommonGenerator.h | 5 ++- Source/cmLocalGenerator.cxx | 3 +- Source/cmLocalGenerator.h | 19 +++++----- Source/cmLocalNinjaGenerator.cxx | 15 ++++---- Source/cmLocalNinjaGenerator.h | 10 +++--- Source/cmLocalUnixMakefileGenerator3.cxx | 19 +++++----- Source/cmLocale.h | 2 -- Source/cmMSVC60LinkLineComputer.cxx | 6 ++++ Source/cmMSVC60LinkLineComputer.h | 7 ++++ Source/cmMacroCommand.cxx | 1 - Source/cmMakefile.cxx | 28 +++++++-------- Source/cmMakefile.h | 20 +++++------ Source/cmMakefileExecutableTargetGenerator.cxx | 11 +++--- Source/cmMakefileLibraryTargetGenerator.cxx | 11 ++++-- Source/cmMakefileTargetGenerator.cxx | 14 ++++---- Source/cmMakefileTargetGenerator.h | 12 ++++--- Source/cmMakefileUtilityTargetGenerator.cxx | 10 +++--- Source/cmMessageCommand.cxx | 2 -- Source/cmNinjaLinkLineComputer.cxx | 4 +++ Source/cmNinjaLinkLineComputer.h | 7 +++- Source/cmNinjaNormalTargetGenerator.cxx | 21 ++++++----- Source/cmNinjaTargetGenerator.cxx | 19 +++++----- Source/cmNinjaTypes.h | 6 ++-- Source/cmOptionCommand.cxx | 2 -- Source/cmOutputConverter.cxx | 11 +++--- Source/cmOutputConverter.h | 6 ++-- Source/cmParseArgumentsCommand.cxx | 1 - Source/cmPathLabel.cxx | 2 ++ Source/cmPathLabel.h | 4 +-- Source/cmQtAutoGeneratorInitializer.cxx | 2 -- Source/cmQtAutoGenerators.cxx | 23 ++++++------ Source/cmRulePlaceholderExpander.cxx | 4 +++ Source/cmRulePlaceholderExpander.h | 1 - Source/cmSearchPath.cxx | 2 ++ Source/cmSearchPath.h | 4 ++- Source/cmServer.cxx | 1 + Source/cmServerConnection.cxx | 1 + Source/cmSetCommand.cxx | 1 - Source/cmSourceFile.cxx | 5 ++- Source/cmState.cxx | 16 ++++----- Source/cmState.h | 15 ++++---- Source/cmStateDirectory.cxx | 10 ++++++ Source/cmStateDirectory.h | 3 +- Source/cmStatePrivate.h | 7 ++++ Source/cmStateSnapshot.cxx | 10 +++++- Source/cmStateSnapshot.h | 2 +- Source/cmStateTypes.h | 4 +-- Source/cmStringCommand.cxx | 1 - Source/cmTarget.cxx | 18 +++++----- Source/cmTarget.h | 17 ++++----- Source/cmTargetCompileFeaturesCommand.cxx | 1 - Source/cmTargetCompileOptionsCommand.cxx | 1 - Source/cmTargetDepend.h | 4 +-- Source/cmTargetExport.h | 6 ++-- Source/cmTargetPropCommandBase.cxx | 3 ++ Source/cmTargetPropCommandBase.h | 5 +++ Source/cmTargetPropertyComputer.cxx | 11 +++--- Source/cmTargetPropertyComputer.h | 7 ++-- Source/cmTargetSourcesCommand.cxx | 1 - Source/cmTest.cxx | 1 - Source/cmTestGenerator.cxx | 9 +++-- Source/cmTimestamp.cxx | 8 ++--- Source/cmTimestamp.h | 4 +-- Source/cm_codecvt.hxx | 3 +- Source/cmake.cxx | 5 +-- Source/cmake.h | 12 ++++--- Source/cmakemain.cxx | 1 + Source/cmcmd.cxx | 1 + 136 files changed, 638 insertions(+), 434 deletions(-) hooks/post-receive -- CMake From daniel at pfeifer-mail.de Sat Nov 5 18:32:37 2016 From: daniel at pfeifer-mail.de (Daniel Pfeifer) Date: Sat, 5 Nov 2016 18:32:37 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.7.0-rc3-935-g6dacf55 Message-ID: <20161105223237.EEEEFF8720@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, next has been updated via 6dacf55a79b849ccefb468166d012686b1ed3a18 (commit) via 0ee7b4132a7ef9c2eca46a7268a718132fa31cb2 (commit) from 166cd2c80d14149698a3b9f39d2973defaa8af8f (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=6dacf55a79b849ccefb468166d012686b1ed3a18 commit 6dacf55a79b849ccefb468166d012686b1ed3a18 Merge: 166cd2c 0ee7b41 Author: Daniel Pfeifer AuthorDate: Sat Nov 5 18:32:37 2016 -0400 Commit: CMake Topic Stage CommitDate: Sat Nov 5 18:32:37 2016 -0400 Merge topic 'include-what-you-use' into next 0ee7b413 Fixup! Fix several include-what-you-use findings https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0ee7b4132a7ef9c2eca46a7268a718132fa31cb2 commit 0ee7b4132a7ef9c2eca46a7268a718132fa31cb2 Author: Daniel Pfeifer AuthorDate: Sat Nov 5 23:32:21 2016 +0100 Commit: Daniel Pfeifer CommitDate: Sat Nov 5 23:32:21 2016 +0100 Fixup! Fix several include-what-you-use findings diff --git a/Source/QtDialog/CMakeSetup.cxx b/Source/QtDialog/CMakeSetup.cxx index 9038469..5e03c39 100644 --- a/Source/QtDialog/CMakeSetup.cxx +++ b/Source/QtDialog/CMakeSetup.cxx @@ -5,6 +5,7 @@ #include "CMakeSetupDialog.h" #include "cmAlgorithms.h" #include "cmDocumentation.h" +#include "cmDocumentationEntry.h" #include "cmVersion.h" #include "cmake.h" #include @@ -17,6 +18,7 @@ #include #include #include +#include #include "cmSystemTools.h" // IWYU pragma: keep ----------------------------------------------------------------------- Summary of changes: Source/QtDialog/CMakeSetup.cxx | 2 ++ 1 file changed, 2 insertions(+) hooks/post-receive -- CMake From daniel at pfeifer-mail.de Sat Nov 5 18:56:14 2016 From: daniel at pfeifer-mail.de (Daniel Pfeifer) Date: Sat, 5 Nov 2016 18:56:14 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.7.0-rc3-940-g2c62af2 Message-ID: <20161105225614.1364BF8969@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, next has been updated via 2c62af2d4bc7c5f1d66869b49da138f76586c155 (commit) via bac93dcf192d8680cd72570682d6593da9818088 (commit) via 1e994985d83b09d71b4928a61a75d1cf3861aaec (commit) via 5ae3966d75593b05a9658af8d2fdd47c2bf48a4d (commit) via 443180fb9915eefe0b232875505632ffb9fabb95 (commit) from 6dacf55a79b849ccefb468166d012686b1ed3a18 (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=2c62af2d4bc7c5f1d66869b49da138f76586c155 commit 2c62af2d4bc7c5f1d66869b49da138f76586c155 Merge: 6dacf55 bac93dc Author: Daniel Pfeifer AuthorDate: Sat Nov 5 18:56:12 2016 -0400 Commit: CMake Topic Stage CommitDate: Sat Nov 5 18:56:12 2016 -0400 Merge topic 'clang-tidy' into next bac93dcf cmGeneratorTarget: Don't assing a bool to a string 1e994985 cmGlobalNinjaGenerator: Suppress clang-tidy warning 5ae3966d cmCTestSubmitHandler: Remove redundant c_str() 443180fb cmCPluginAPI: Fix clang-tidy findings https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bac93dcf192d8680cd72570682d6593da9818088 commit bac93dcf192d8680cd72570682d6593da9818088 Author: Daniel Pfeifer AuthorDate: Sat Nov 5 23:54:57 2016 +0100 Commit: Daniel Pfeifer CommitDate: Sat Nov 5 23:54:57 2016 +0100 cmGeneratorTarget: Don't assing a bool to a string diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index ca056c0..ca3e373 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -3945,7 +3945,6 @@ std::string cmGeneratorTarget::GetFortranModuleDirectory( std::string const& working_dir) const { if (!this->FortranModuleDirectoryCreated) { - this->FortranModuleDirectory = true; this->FortranModuleDirectory = this->CreateFortranModuleDirectory(working_dir); } https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1e994985d83b09d71b4928a61a75d1cf3861aaec commit 1e994985d83b09d71b4928a61a75d1cf3861aaec Author: Daniel Pfeifer AuthorDate: Sat Nov 5 23:51:30 2016 +0100 Commit: Daniel Pfeifer CommitDate: Sat Nov 5 23:51:30 2016 +0100 cmGlobalNinjaGenerator: Suppress clang-tidy warning diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 830ab7f..22de7c4 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -130,7 +130,7 @@ std::string cmGlobalNinjaGenerator::EncodeLiteral(const std::string& lit) std::string cmGlobalNinjaGenerator::EncodePath(const std::string& path) { - std::string result = path; + std::string result = path; // NOLINT(clang-tidy) #ifdef _WIN32 if (this->IsGCCOnWindows()) std::replace(result.begin(), result.end(), '\\', '/'); @@ -283,7 +283,7 @@ void cmGlobalNinjaGenerator::WriteCustomCommandBuild( bool restat, const cmNinjaDeps& outputs, const cmNinjaDeps& deps, const cmNinjaDeps& orderOnly) { - std::string cmd = command; + std::string cmd = command; // NOLINT(clang-tidy) #ifdef _WIN32 if (cmd.empty()) // TODO Shouldn't an empty command be handled by ninja? https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5ae3966d75593b05a9658af8d2fdd47c2bf48a4d commit 5ae3966d75593b05a9658af8d2fdd47c2bf48a4d Author: Daniel Pfeifer AuthorDate: Sat Nov 5 23:46:24 2016 +0100 Commit: Daniel Pfeifer CommitDate: Sat Nov 5 23:46:24 2016 +0100 cmCTestSubmitHandler: Remove redundant c_str() diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx index d21471d..d10f7ad 100644 --- a/Source/CTest/cmCTestSubmitHandler.cxx +++ b/Source/CTest/cmCTestSubmitHandler.cxx @@ -926,7 +926,7 @@ bool cmCTestSubmitHandler::SubmitUsingXMLRPC( return false; } size_t fileSize = static_cast(st.st_size); - FILE* fp = cmsys::SystemTools::Fopen(local_file.c_str(), "rb"); + FILE* fp = cmsys::SystemTools::Fopen(local_file, "rb"); if (!fp) { cmCTestLog(this->CTest, ERROR_MESSAGE, " Cannot open file: " << local_file << std::endl); https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=443180fb9915eefe0b232875505632ffb9fabb95 commit 443180fb9915eefe0b232875505632ffb9fabb95 Author: Daniel Pfeifer AuthorDate: Sat Nov 5 23:44:29 2016 +0100 Commit: Daniel Pfeifer CommitDate: Sat Nov 5 23:44:29 2016 +0100 cmCPluginAPI: Fix clang-tidy findings diff --git a/Source/cmCPluginAPI.cxx b/Source/cmCPluginAPI.cxx index b70074e..d1f8446 100644 --- a/Source/cmCPluginAPI.cxx +++ b/Source/cmCPluginAPI.cxx @@ -408,7 +408,7 @@ char CCONV* cmExpandVariablesInString(void* arg, const char* source, std::string result = mf->ExpandVariablesInString( barf, (escapeQuotes ? true : false), (atOnly ? true : false)); char* res = static_cast(malloc(result.size() + 1)); - if (result.size()) { + if (!result.empty()) { strcpy(res, result.c_str()); } res[result.size()] = '\0'; @@ -570,7 +570,7 @@ void* CCONV cmAddSource(void* arg, void* arg2) rsf->GetProperties() = osf->Properties; for (std::vector::iterator i = osf->Depends.begin(); i != osf->Depends.end(); ++i) { - rsf->AddDepend(i->c_str()); + rsf->AddDepend(*i); } // Create the proxy for the real source file. @@ -676,7 +676,7 @@ void CCONV cmSourceFileSetName(void* arg, const char* name, const char* dir, std::string hname = pathname; if (cmSystemTools::FileExists(hname.c_str())) { sf->SourceName = cmSystemTools::GetFilenamePath(name); - if (sf->SourceName.size() > 0) { + if (!sf->SourceName.empty()) { sf->SourceName += "/"; } sf->SourceName += cmSystemTools::GetFilenameWithoutLastExtension(name); @@ -756,7 +756,7 @@ void CCONV cmSourceFileSetName2(void* arg, const char* name, const char* dir, fname += "."; fname += ext; } - sf->FullPath = cmSystemTools::CollapseFullPath(fname.c_str(), dir); + sf->FullPath = cmSystemTools::CollapseFullPath(fname, dir); cmSystemTools::ConvertToUnixSlashes(sf->FullPath); sf->SourceExtension = ext; } ----------------------------------------------------------------------- Summary of changes: Source/CTest/cmCTestSubmitHandler.cxx | 2 +- Source/cmCPluginAPI.cxx | 8 ++++---- Source/cmGeneratorTarget.cxx | 1 - Source/cmGlobalNinjaGenerator.cxx | 4 ++-- 4 files changed, 7 insertions(+), 8 deletions(-) hooks/post-receive -- CMake From daniel at pfeifer-mail.de Sat Nov 5 19:12:04 2016 From: daniel at pfeifer-mail.de (Daniel Pfeifer) Date: Sat, 5 Nov 2016 19:12:04 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.7.0-rc3-942-g998cbca Message-ID: <20161105231204.4BF77F7CF0@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, next has been updated via 998cbca769bb7cedf28bd1d77c51b0de63f1913c (commit) via 0cd654c8e23b19311bae876ada4ad5b432c1ad1b (commit) from 2c62af2d4bc7c5f1d66869b49da138f76586c155 (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=998cbca769bb7cedf28bd1d77c51b0de63f1913c commit 998cbca769bb7cedf28bd1d77c51b0de63f1913c Merge: 2c62af2 0cd654c Author: Daniel Pfeifer AuthorDate: Sat Nov 5 19:12:03 2016 -0400 Commit: CMake Topic Stage CommitDate: Sat Nov 5 19:12:03 2016 -0400 Merge topic 'clang-tidy' into next 0cd654c8 cmGeneratorTarget: Correctly set FortranModuleDirectoryCreated https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0cd654c8e23b19311bae876ada4ad5b432c1ad1b commit 0cd654c8e23b19311bae876ada4ad5b432c1ad1b Author: Daniel Pfeifer AuthorDate: Sun Nov 6 00:11:03 2016 +0100 Commit: Daniel Pfeifer CommitDate: Sun Nov 6 00:11:03 2016 +0100 cmGeneratorTarget: Correctly set FortranModuleDirectoryCreated diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index ca3e373..f5db7f6 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -3947,6 +3947,7 @@ std::string cmGeneratorTarget::GetFortranModuleDirectory( if (!this->FortranModuleDirectoryCreated) { this->FortranModuleDirectory = this->CreateFortranModuleDirectory(working_dir); + this->FortranModuleDirectoryCreated = true; } return this->FortranModuleDirectory; ----------------------------------------------------------------------- Summary of changes: Source/cmGeneratorTarget.cxx | 1 + 1 file changed, 1 insertion(+) hooks/post-receive -- CMake From kwrobot at kitware.com Sun Nov 6 00:01:07 2016 From: kwrobot at kitware.com (Kitware Robot) Date: Sun, 6 Nov 2016 00:01:07 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.7.0-rc3-427-gd568cec Message-ID: <20161106040107.DA4A4F8A53@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 d568cecf38a6a4b399c925fd3553dd4a273d0af1 (commit) from f52bcc2ac1b3dddeca2320d8320a9406101c732d (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=d568cecf38a6a4b399c925fd3553dd4a273d0af1 commit d568cecf38a6a4b399c925fd3553dd4a273d0af1 Author: Kitware Robot AuthorDate: Sun Nov 6 00:01:05 2016 -0400 Commit: Kitware Robot CommitDate: Sun Nov 6 00:01:05 2016 -0400 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 59e5c7e..ac54c5d 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 7) -set(CMake_VERSION_PATCH 20161105) +set(CMake_VERSION_PATCH 20161106) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From daniel at pfeifer-mail.de Sun Nov 6 02:45:28 2016 From: daniel at pfeifer-mail.de (Daniel Pfeifer) Date: Sun, 6 Nov 2016 02:45:28 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.7.0-rc3-944-g0c32230 Message-ID: <20161106074528.C53C1F83B0@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, next has been updated via 0c32230ce5fd27d4a2515c7194df00b3c36b532d (commit) via 0721d07ec934eb7a6049c2fd9d3b7f5e25707772 (commit) from 998cbca769bb7cedf28bd1d77c51b0de63f1913c (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=0c32230ce5fd27d4a2515c7194df00b3c36b532d commit 0c32230ce5fd27d4a2515c7194df00b3c36b532d Merge: 998cbca 0721d07 Author: Daniel Pfeifer AuthorDate: Sun Nov 6 02:45:27 2016 -0500 Commit: CMake Topic Stage CommitDate: Sun Nov 6 02:45:27 2016 -0500 Merge topic 'include-what-you-use' into next 0721d07e Fixup! Fix several include-what-you-use findings https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0721d07ec934eb7a6049c2fd9d3b7f5e25707772 commit 0721d07ec934eb7a6049c2fd9d3b7f5e25707772 Author: Daniel Pfeifer AuthorDate: Sun Nov 6 08:45:03 2016 +0100 Commit: Daniel Pfeifer CommitDate: Sun Nov 6 08:45:03 2016 +0100 Fixup! Fix several include-what-you-use findings diff --git a/Source/cmGeneratorExpressionEvaluationFile.h b/Source/cmGeneratorExpressionEvaluationFile.h index d597270..26135df 100644 --- a/Source/cmGeneratorExpressionEvaluationFile.h +++ b/Source/cmGeneratorExpressionEvaluationFile.h @@ -5,14 +5,19 @@ #include // IWYU pragma: keep -#include "cmGeneratorExpression.h" - -#include #include #include -#include #include +#include "cmGeneratorExpression.h" +#include "cm_auto_ptr.hxx" + +#if defined(_MSC_VER) +typedef unsigned short mode_t; +#else +#include +#endif + class cmLocalGenerator; class cmGeneratorExpressionEvaluationFile diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h index 9817a3c..0801f26 100644 --- a/Source/cmSystemTools.h +++ b/Source/cmSystemTools.h @@ -11,6 +11,12 @@ #include #include +#if defined(_MSC_VER) +typedef unsigned short mode_t; +#else +#include +#endif + class cmSystemToolsFileTime; /** \class cmSystemTools ----------------------------------------------------------------------- Summary of changes: Source/cmGeneratorExpressionEvaluationFile.h | 13 +++++++++---- Source/cmSystemTools.h | 6 ++++++ 2 files changed, 15 insertions(+), 4 deletions(-) hooks/post-receive -- CMake From kwrobot at kitware.com Mon Nov 7 00:01:06 2016 From: kwrobot at kitware.com (Kitware Robot) Date: Mon, 7 Nov 2016 00:01:06 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.7.0-rc3-428-g9df1cb0 Message-ID: <20161107050106.CEAA7F8FD8@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 9df1cb0fa68869f8125025f20fa8c64467aab2e8 (commit) from d568cecf38a6a4b399c925fd3553dd4a273d0af1 (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=9df1cb0fa68869f8125025f20fa8c64467aab2e8 commit 9df1cb0fa68869f8125025f20fa8c64467aab2e8 Author: Kitware Robot AuthorDate: Mon Nov 7 00:01:03 2016 -0500 Commit: Kitware Robot CommitDate: Mon Nov 7 00:01:03 2016 -0500 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index ac54c5d..2af5821 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 7) -set(CMake_VERSION_PATCH 20161106) +set(CMake_VERSION_PATCH 20161107) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From daniel at pfeifer-mail.de Mon Nov 7 03:02:48 2016 From: daniel at pfeifer-mail.de (Daniel Pfeifer) Date: Mon, 7 Nov 2016 03:02:48 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.7.0-rc3-946-gf2f7d5a Message-ID: <20161107080248.927D9F8D00@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, next has been updated via f2f7d5af951cdca95bd245838d5f24fea85a92cf (commit) via 6086ab4f5cdfc87fa2bdac95ecf83c6d3677e5f2 (commit) from 0c32230ce5fd27d4a2515c7194df00b3c36b532d (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=f2f7d5af951cdca95bd245838d5f24fea85a92cf commit f2f7d5af951cdca95bd245838d5f24fea85a92cf Merge: 0c32230 6086ab4 Author: Daniel Pfeifer AuthorDate: Mon Nov 7 03:02:47 2016 -0500 Commit: CMake Topic Stage CommitDate: Mon Nov 7 03:02:47 2016 -0500 Merge topic 'include-what-you-use' into next 6086ab4f Fixup! Fix several include-what-you-use findings https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6086ab4f5cdfc87fa2bdac95ecf83c6d3677e5f2 commit 6086ab4f5cdfc87fa2bdac95ecf83c6d3677e5f2 Author: Daniel Pfeifer AuthorDate: Mon Nov 7 09:00:32 2016 +0100 Commit: Daniel Pfeifer CommitDate: Mon Nov 7 09:00:32 2016 +0100 Fixup! Fix several include-what-you-use findings diff --git a/Source/cmStateSnapshot.cxx b/Source/cmStateSnapshot.cxx index cf6cb1b..c6288a5 100644 --- a/Source/cmStateSnapshot.cxx +++ b/Source/cmStateSnapshot.cxx @@ -18,6 +18,10 @@ #include "cmVersion.h" #include "cmake.h" +#if defined(__CYGWIN__) +#include "cmSystemTools.h" +#endif + cmStateSnapshot::cmStateSnapshot(cmState* state) : State(state) , Position() ----------------------------------------------------------------------- Summary of changes: Source/cmStateSnapshot.cxx | 4 ++++ 1 file changed, 4 insertions(+) hooks/post-receive -- CMake From daniel at pfeifer-mail.de Mon Nov 7 14:07:11 2016 From: daniel at pfeifer-mail.de (Daniel Pfeifer) Date: Mon, 7 Nov 2016 14:07:11 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.7.0-rc3-948-g2a71480 Message-ID: <20161107190711.A465FF95AE@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, next has been updated via 2a71480fa93b4c8bdb6485c1a78a9cd01f050791 (commit) via 7719d01d2925429be2ee4f742cbce81c5c5e1044 (commit) from f2f7d5af951cdca95bd245838d5f24fea85a92cf (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=2a71480fa93b4c8bdb6485c1a78a9cd01f050791 commit 2a71480fa93b4c8bdb6485c1a78a9cd01f050791 Merge: f2f7d5a 7719d01 Author: Daniel Pfeifer AuthorDate: Mon Nov 7 14:07:05 2016 -0500 Commit: CMake Topic Stage CommitDate: Mon Nov 7 14:07:05 2016 -0500 Merge topic 'include-what-you-use' into next 7719d01d Fixup! Fix several include-what-you-use findings https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7719d01d2925429be2ee4f742cbce81c5c5e1044 commit 7719d01d2925429be2ee4f742cbce81c5c5e1044 Author: Daniel Pfeifer AuthorDate: Mon Nov 7 20:06:10 2016 +0100 Commit: Daniel Pfeifer CommitDate: Mon Nov 7 20:06:10 2016 +0100 Fixup! Fix several include-what-you-use findings diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index 1bade57..afff0f3 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -20,6 +20,7 @@ #undef GetCurrentDirectory #include +#include #include // include sys/stat.h after sys/types.h ----------------------------------------------------------------------- Summary of changes: Source/cmFileCommand.cxx | 1 + 1 file changed, 1 insertion(+) hooks/post-receive -- CMake From kwrobot at kitware.com Tue Nov 8 00:01:06 2016 From: kwrobot at kitware.com (Kitware Robot) Date: Tue, 8 Nov 2016 00:01:06 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.7.0-rc3-429-g48910cf Message-ID: <20161108050107.116C0F94B1@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 48910cf0968a4c5b4ffd9093972498920404685f (commit) from 9df1cb0fa68869f8125025f20fa8c64467aab2e8 (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=48910cf0968a4c5b4ffd9093972498920404685f commit 48910cf0968a4c5b4ffd9093972498920404685f Author: Kitware Robot AuthorDate: Tue Nov 8 00:01:03 2016 -0500 Commit: Kitware Robot CommitDate: Tue Nov 8 00:01:03 2016 -0500 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 2af5821..817af3b 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 7) -set(CMake_VERSION_PATCH 20161107) +set(CMake_VERSION_PATCH 20161108) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Tue Nov 8 09:41:49 2016 From: brad.king at kitware.com (Brad King) Date: Tue, 8 Nov 2016 09:41:49 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.7.0-rc3-950-g36bf6fd Message-ID: <20161108144149.D1EE1F7AC4@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, next has been updated via 36bf6fd1d42550c4c42e23d4816b1b1031efcf03 (commit) via c8a128147963eea8bf40125873c722370ab54b0c (commit) from 2a71480fa93b4c8bdb6485c1a78a9cd01f050791 (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=36bf6fd1d42550c4c42e23d4816b1b1031efcf03 commit 36bf6fd1d42550c4c42e23d4816b1b1031efcf03 Merge: 2a71480 c8a1281 Author: Brad King AuthorDate: Tue Nov 8 09:41:48 2016 -0500 Commit: CMake Topic Stage CommitDate: Tue Nov 8 09:41:48 2016 -0500 Merge topic 'include-what-you-use' into next c8a12814 fixup! Fix several include-what-you-use findings https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c8a128147963eea8bf40125873c722370ab54b0c commit c8a128147963eea8bf40125873c722370ab54b0c Author: Brad King AuthorDate: Tue Nov 8 09:41:28 2016 -0500 Commit: Brad King CommitDate: Tue Nov 8 09:41:28 2016 -0500 fixup! Fix several include-what-you-use findings diff --git a/Source/cmExecutionStatus.h b/Source/cmExecutionStatus.h index 311c7f5..fd3c416 100644 --- a/Source/cmExecutionStatus.h +++ b/Source/cmExecutionStatus.h @@ -3,8 +3,6 @@ #ifndef cmExecutionStatus_h #define cmExecutionStatus_h - - /** \class cmExecutionStatus * \brief Superclass for all command status classes * diff --git a/Source/cmHexFileConverter.h b/Source/cmHexFileConverter.h index 75c8028..1050bc1 100644 --- a/Source/cmHexFileConverter.h +++ b/Source/cmHexFileConverter.h @@ -3,8 +3,6 @@ #ifndef cmHexFileConverter_h #define cmHexFileConverter_h - - /** \class cmHexFileConverter * \brief Can detects Intel Hex and Motorola S-record files and convert them * to binary files. diff --git a/Source/cm_codecvt.hxx b/Source/cm_codecvt.hxx index b9c1d62..fcd9954 100644 --- a/Source/cm_codecvt.hxx +++ b/Source/cm_codecvt.hxx @@ -5,9 +5,9 @@ #include -#include #include #include +#include class codecvt : public std::codecvt { ----------------------------------------------------------------------- Summary of changes: Source/cmExecutionStatus.h | 2 -- Source/cmHexFileConverter.h | 2 -- Source/cm_codecvt.hxx | 2 +- 3 files changed, 1 insertion(+), 5 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Tue Nov 8 09:43:29 2016 From: brad.king at kitware.com (Brad King) Date: Tue, 8 Nov 2016 09:43:29 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.7.0-rc3-952-gddb04eb Message-ID: <20161108144329.036DFF88B9@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, next has been updated via ddb04ebae16819485e7c4150250bb17c47fd0358 (commit) via 2e620f0b3834e5a612a38d61b7e50a561d7f11e8 (commit) from 36bf6fd1d42550c4c42e23d4816b1b1031efcf03 (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=ddb04ebae16819485e7c4150250bb17c47fd0358 commit ddb04ebae16819485e7c4150250bb17c47fd0358 Merge: 36bf6fd 2e620f0 Author: Brad King AuthorDate: Tue Nov 8 09:43:26 2016 -0500 Commit: CMake Topic Stage CommitDate: Tue Nov 8 09:43:26 2016 -0500 Merge topic 'include-what-you-use' into next 2e620f0b Fix several include-what-you-use findings https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2e620f0b3834e5a612a38d61b7e50a561d7f11e8 commit 2e620f0b3834e5a612a38d61b7e50a561d7f11e8 Author: Daniel Pfeifer AuthorDate: Sat Nov 5 21:40:14 2016 +0100 Commit: Brad King CommitDate: Tue Nov 8 09:42:04 2016 -0500 Fix several include-what-you-use findings diff --git a/Source/CTest/cmCTestScriptHandler.cxx b/Source/CTest/cmCTestScriptHandler.cxx index 7ee0f75..08ea4ee 100644 --- a/Source/CTest/cmCTestScriptHandler.cxx +++ b/Source/CTest/cmCTestScriptHandler.cxx @@ -22,6 +22,7 @@ #include "cmGlobalGenerator.h" #include "cmMakefile.h" #include "cmState.h" +#include "cmStateDirectory.h" #include "cmStateTypes.h" #include "cmSystemTools.h" #include "cmake.h" diff --git a/Source/QtDialog/CMakeSetup.cxx b/Source/QtDialog/CMakeSetup.cxx index 9038469..5e03c39 100644 --- a/Source/QtDialog/CMakeSetup.cxx +++ b/Source/QtDialog/CMakeSetup.cxx @@ -5,6 +5,7 @@ #include "CMakeSetupDialog.h" #include "cmAlgorithms.h" #include "cmDocumentation.h" +#include "cmDocumentationEntry.h" #include "cmVersion.h" #include "cmake.h" #include @@ -17,6 +18,7 @@ #include #include #include +#include #include "cmSystemTools.h" // IWYU pragma: keep diff --git a/Source/cmAlgorithms.h b/Source/cmAlgorithms.h index aa55379..22f69fa 100644 --- a/Source/cmAlgorithms.h +++ b/Source/cmAlgorithms.h @@ -3,9 +3,17 @@ #ifndef cmAlgorithms_h #define cmAlgorithms_h -#include - -#include "cmStandardIncludes.h" +#include // IWYU pragma: keep + +#include +#include +#include +#include +#include +#include +#include +#include +#include inline bool cmHasLiteralPrefixImpl(const std::string& str1, const char* str2, size_t N) diff --git a/Source/cmCMakeMinimumRequired.cxx b/Source/cmCMakeMinimumRequired.cxx index 655c42a..942688c 100644 --- a/Source/cmCMakeMinimumRequired.cxx +++ b/Source/cmCMakeMinimumRequired.cxx @@ -2,9 +2,15 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCMakeMinimumRequired.h" +#include +#include + #include "cmMakefile.h" #include "cmSystemTools.h" #include "cmVersion.h" +#include "cmake.h" + +class cmExecutionStatus; // cmCMakeMinimumRequired bool cmCMakeMinimumRequired::InitialPass(std::vector const& args, diff --git a/Source/cmCMakeMinimumRequired.h b/Source/cmCMakeMinimumRequired.h index 3acedd2..08a5c38 100644 --- a/Source/cmCMakeMinimumRequired.h +++ b/Source/cmCMakeMinimumRequired.h @@ -3,8 +3,14 @@ #ifndef cmCMakeMinimumRequired_h #define cmCMakeMinimumRequired_h +#include +#include +#include + #include "cmCommand.h" +class cmExecutionStatus; + /** \class cmCMakeMinimumRequired * \brief cmake_minimum_required command * diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 024260c..010fc4e 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -2,6 +2,27 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCTest.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + #include "cmAlgorithms.h" #include "cmCTestBuildAndTestHandler.h" #include "cmCTestBuildHandler.h" @@ -21,35 +42,15 @@ #include "cmGlobalGenerator.h" #include "cmMakefile.h" #include "cmState.h" +#include "cmStateSnapshot.h" #include "cmStateTypes.h" #include "cmSystemTools.h" #include "cmVersion.h" #include "cmVersionConfig.h" #include "cmXMLWriter.h" +#include "cm_auto_ptr.hxx" #include "cmake.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - #if defined(__BEOS__) || defined(__HAIKU__) #include /* disable_debugger() API. */ #endif diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx index e84012c..cb0ba63 100644 --- a/Source/cmCacheManager.cxx +++ b/Source/cmCacheManager.cxx @@ -2,11 +2,6 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCacheManager.h" -#include "cmGeneratedFileStream.h" -#include "cmSystemTools.h" -#include "cmVersion.h" -#include "cmake.h" - #include #include #include @@ -14,6 +9,12 @@ #include #include +#include "cmGeneratedFileStream.h" +#include "cmState.h" +#include "cmSystemTools.h" +#include "cmVersion.h" +#include "cmake.h" + cmCacheManager::cmCacheManager() { this->CacheMajorVersion = 0; diff --git a/Source/cmCacheManager.h b/Source/cmCacheManager.h index 90731f5..e82c9ef 100644 --- a/Source/cmCacheManager.h +++ b/Source/cmCacheManager.h @@ -5,9 +5,6 @@ #include // IWYU pragma: keep -#include "cmPropertyMap.h" -#include "cmState.h" - #include #include #include @@ -15,6 +12,9 @@ #include #include +#include "cmPropertyMap.h" +#include "cmStateTypes.h" + class cmake; /** \class cmCacheManager diff --git a/Source/cmCommandArgumentsHelper.h b/Source/cmCommandArgumentsHelper.h index 50af2e2..b19b0f9 100644 --- a/Source/cmCommandArgumentsHelper.h +++ b/Source/cmCommandArgumentsHelper.h @@ -5,10 +5,12 @@ #include -#include "cmStandardIncludes.h" +#include +#include +#include -class cmCommandArgumentsHelper; class cmCommandArgumentGroup; +class cmCommandArgumentsHelper; /* cmCommandArgumentsHelper, cmCommandArgumentGroup and cmCommandArgument (i.e. its derived classes cmCAXXX can be used to simplify the processing of diff --git a/Source/cmCommonTargetGenerator.cxx b/Source/cmCommonTargetGenerator.cxx index 95b95c1..c3a925f 100644 --- a/Source/cmCommonTargetGenerator.cxx +++ b/Source/cmCommonTargetGenerator.cxx @@ -2,7 +2,6 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCommonTargetGenerator.h" -#include #include #include #include @@ -16,8 +15,8 @@ #include "cmLocalCommonGenerator.h" #include "cmLocalGenerator.h" #include "cmMakefile.h" +#include "cmOutputConverter.h" #include "cmSourceFile.h" -#include "cmStateDirectory.h" #include "cmStateTypes.h" cmCommonTargetGenerator::cmCommonTargetGenerator(cmGeneratorTarget* gt) diff --git a/Source/cmCommonTargetGenerator.h b/Source/cmCommonTargetGenerator.h index fe27038..bdd6645 100644 --- a/Source/cmCommonTargetGenerator.h +++ b/Source/cmCommonTargetGenerator.h @@ -4,19 +4,16 @@ #define cmCommonTargetGenerator_h #include // IWYU pragma: keep - -#include "cmOutputConverter.h" - #include #include #include class cmGeneratorTarget; class cmGlobalCommonGenerator; +class cmLinkLineComputer; class cmLocalCommonGenerator; class cmMakefile; class cmSourceFile; -class cmLinkLineComputer; /** \class cmCommonTargetGenerator * \brief Common infrastructure for Makefile and Ninja per-target generators diff --git a/Source/cmConditionEvaluator.cxx b/Source/cmConditionEvaluator.cxx index 71d6c4e..f2eb601 100644 --- a/Source/cmConditionEvaluator.cxx +++ b/Source/cmConditionEvaluator.cxx @@ -2,12 +2,22 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmConditionEvaluator.h" +#include +#include +#include +#include +#include +#include +#include + #include "cmAlgorithms.h" #include "cmMakefile.h" -#include "cmOutputConverter.h" #include "cmState.h" #include "cmSystemTools.h" +class cmCommand; +class cmTest; + static std::string const keyAND = "AND"; static std::string const keyCOMMAND = "COMMAND"; static std::string const keyDEFINED = "DEFINED"; diff --git a/Source/cmConditionEvaluator.h b/Source/cmConditionEvaluator.h index 3c9d2cd..5815177 100644 --- a/Source/cmConditionEvaluator.h +++ b/Source/cmConditionEvaluator.h @@ -3,12 +3,18 @@ #ifndef cmConditionEvaluator_h #define cmConditionEvaluator_h -#include "cmCommand.h" +#include // IWYU pragma: keep + +#include +#include +#include + #include "cmExpandedCommandArgument.h" #include "cmListFileCache.h" +#include "cmPolicies.h" #include "cmake.h" -#include +class cmMakefile; class cmConditionEvaluator { diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx index b7d2196..3b46fc0 100644 --- a/Source/cmCoreTryCompile.cxx +++ b/Source/cmCoreTryCompile.cxx @@ -2,16 +2,24 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCoreTryCompile.h" +#include +#include +#include +#include +#include +#include + #include "cmAlgorithms.h" #include "cmExportTryCompileFileGenerator.h" #include "cmGlobalGenerator.h" #include "cmMakefile.h" #include "cmOutputConverter.h" +#include "cmPolicies.h" #include "cmState.h" +#include "cmSystemTools.h" +#include "cmTarget.h" +#include "cmVersion.h" #include "cmake.h" -#include - -#include static std::string const kCMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN = "CMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN"; diff --git a/Source/cmCoreTryCompile.h b/Source/cmCoreTryCompile.h index 0d9bb79..1c94f09 100644 --- a/Source/cmCoreTryCompile.h +++ b/Source/cmCoreTryCompile.h @@ -3,6 +3,11 @@ #ifndef cmCoreTryCompile_h #define cmCoreTryCompile_h +#include // IWYU pragma: keep + +#include +#include + #include "cmCommand.h" #include "cmStateTypes.h" diff --git a/Source/cmCreateTestSourceList.cxx b/Source/cmCreateTestSourceList.cxx index 14a6c88..69532e6 100644 --- a/Source/cmCreateTestSourceList.cxx +++ b/Source/cmCreateTestSourceList.cxx @@ -2,10 +2,14 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCreateTestSourceList.h" +#include + #include "cmMakefile.h" #include "cmSourceFile.h" #include "cmSystemTools.h" +class cmExecutionStatus; + // cmCreateTestSourceList bool cmCreateTestSourceList::InitialPass(std::vector const& args, cmExecutionStatus&) diff --git a/Source/cmCreateTestSourceList.h b/Source/cmCreateTestSourceList.h index 2f71a00..5e003cf 100644 --- a/Source/cmCreateTestSourceList.h +++ b/Source/cmCreateTestSourceList.h @@ -3,8 +3,15 @@ #ifndef cmCreateTestSourceList_h #define cmCreateTestSourceList_h +#include + +#include +#include + #include "cmCommand.h" +class cmExecutionStatus; + /** \class cmCreateTestSourceList * \brief Test driver generation command * diff --git a/Source/cmDefinitions.cxx b/Source/cmDefinitions.cxx index 0b459f9..47fe76a 100644 --- a/Source/cmDefinitions.cxx +++ b/Source/cmDefinitions.cxx @@ -3,6 +3,7 @@ #include "cmDefinitions.h" #include +#include #include #include diff --git a/Source/cmDefinitions.h b/Source/cmDefinitions.h index 8dfb9ea..ad40665 100644 --- a/Source/cmDefinitions.h +++ b/Source/cmDefinitions.h @@ -3,14 +3,14 @@ #ifndef cmDefinitions_h #define cmDefinitions_h -#include - -#include "cmLinkedTree.h" -#include "cm_unordered_map.hxx" +#include // IWYU pragma: keep #include #include +#include "cmLinkedTree.h" +#include "cm_unordered_map.hxx" + /** \class cmDefinitions * \brief Store a scope of variable definitions for CMake language. * diff --git a/Source/cmDependsC.cxx b/Source/cmDependsC.cxx index 84ab072..e6000db 100644 --- a/Source/cmDependsC.cxx +++ b/Source/cmDependsC.cxx @@ -2,16 +2,15 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmDependsC.h" +#include +#include + #include "cmAlgorithms.h" #include "cmFileTimeComparison.h" #include "cmLocalGenerator.h" #include "cmMakefile.h" -#include "cmOutputConverter.h" #include "cmSystemTools.h" -#include -#include - #define INCLUDE_REGEX_LINE \ "^[ \t]*#[ \t]*(include|import)[ \t]*[<\"]([^\">]+)([\">])" diff --git a/Source/cmDependsFortran.cxx b/Source/cmDependsFortran.cxx index c8723d0..7927402 100644 --- a/Source/cmDependsFortran.cxx +++ b/Source/cmDependsFortran.cxx @@ -2,14 +2,6 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmDependsFortran.h" -#include "cmFortranParser.h" /* Interface to parser object. */ -#include "cmGeneratedFileStream.h" -#include "cmLocalGenerator.h" -#include "cmMakefile.h" -#include "cmOutputConverter.h" -#include "cmStateDirectory.h" -#include "cmSystemTools.h" - #include #include #include @@ -18,6 +10,15 @@ #include #include +#include "cmFortranParser.h" /* Interface to parser object. */ +#include "cmGeneratedFileStream.h" +#include "cmLocalGenerator.h" +#include "cmMakefile.h" +#include "cmOutputConverter.h" +#include "cmStateDirectory.h" +#include "cmStateSnapshot.h" +#include "cmSystemTools.h" + // TODO: Test compiler for the case of the mod file. Some always // use lower case and some always use upper case. I do not know if any // use the case from the source code. diff --git a/Source/cmDependsJavaParserHelper.h b/Source/cmDependsJavaParserHelper.h index 1597ea7..71b939c 100644 --- a/Source/cmDependsJavaParserHelper.h +++ b/Source/cmDependsJavaParserHelper.h @@ -8,6 +8,8 @@ #include #include +class cmDependsJavaParserHelper; + #define YYSTYPE cmDependsJavaParserHelper::ParserType #define YYSTYPE_IS_DECLARED #define YY_EXTRA_TYPE cmDependsJavaParserHelper* diff --git a/Source/cmExecutionStatus.h b/Source/cmExecutionStatus.h index 7d4e97c..fd3c416 100644 --- a/Source/cmExecutionStatus.h +++ b/Source/cmExecutionStatus.h @@ -3,10 +3,6 @@ #ifndef cmExecutionStatus_h #define cmExecutionStatus_h -#include - -#include "cmStandardIncludes.h" - /** \class cmExecutionStatus * \brief Superclass for all command status classes * diff --git a/Source/cmExpandedCommandArgument.h b/Source/cmExpandedCommandArgument.h index 39cffce..9770fe6 100644 --- a/Source/cmExpandedCommandArgument.h +++ b/Source/cmExpandedCommandArgument.h @@ -3,9 +3,9 @@ #ifndef cmExpandedCommandArgument_h #define cmExpandedCommandArgument_h -#include +#include // IWYU pragma: keep -#include "cmStandardIncludes.h" +#include /** \class cmExpandedCommandArgument * \brief Represents an expanded command argument diff --git a/Source/cmExportBuildAndroidMKGenerator.cxx b/Source/cmExportBuildAndroidMKGenerator.cxx index 38f95d2..dab0c2c 100644 --- a/Source/cmExportBuildAndroidMKGenerator.cxx +++ b/Source/cmExportBuildAndroidMKGenerator.cxx @@ -2,14 +2,22 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmExportBuildAndroidMKGenerator.h" -#include "cmExportSet.h" +#include +#include +#include +#include + +#include "cmGeneratorExpression.h" #include "cmGeneratorTarget.h" -#include "cmGlobalGenerator.h" +#include "cmLinkItem.h" #include "cmLocalGenerator.h" #include "cmMakefile.h" -#include "cmTargetExport.h" - -#include +#include "cmPolicies.h" +#include "cmStateTypes.h" +#include "cmSystemTools.h" +#include "cmTarget.h" +#include "cm_auto_ptr.hxx" +#include "cmake.h" cmExportBuildAndroidMKGenerator::cmExportBuildAndroidMKGenerator() { diff --git a/Source/cmExportBuildAndroidMKGenerator.h b/Source/cmExportBuildAndroidMKGenerator.h index c9e0145..2a5a42e 100644 --- a/Source/cmExportBuildAndroidMKGenerator.h +++ b/Source/cmExportBuildAndroidMKGenerator.h @@ -3,10 +3,16 @@ #ifndef cmExportBuildAndroidMKGenerator_h #define cmExportBuildAndroidMKGenerator_h +#include + +#include +#include +#include + #include "cmExportBuildFileGenerator.h" -#include "cmListFileCache.h" +#include "cmExportFileGenerator.h" -class cmExportSet; +class cmGeneratorTarget; /** \class cmExportBuildAndroidMKGenerator * \brief Generate a file exporting targets from a build tree. diff --git a/Source/cmExportInstallAndroidMKGenerator.cxx b/Source/cmExportInstallAndroidMKGenerator.cxx index 2069785..9772f49 100644 --- a/Source/cmExportInstallAndroidMKGenerator.cxx +++ b/Source/cmExportInstallAndroidMKGenerator.cxx @@ -2,16 +2,17 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmExportInstallAndroidMKGenerator.h" -#include "cmAlgorithms.h" +#include +#include + #include "cmExportBuildAndroidMKGenerator.h" #include "cmExportSet.h" -#include "cmExportSetMap.h" -#include "cmGeneratedFileStream.h" #include "cmGeneratorTarget.h" -#include "cmGlobalGenerator.h" #include "cmInstallExportGenerator.h" #include "cmInstallTargetGenerator.h" -#include "cmLocalGenerator.h" +#include "cmStateTypes.h" +#include "cmSystemTools.h" +#include "cmTarget.h" #include "cmTargetExport.h" cmExportInstallAndroidMKGenerator::cmExportInstallAndroidMKGenerator( diff --git a/Source/cmExportInstallAndroidMKGenerator.h b/Source/cmExportInstallAndroidMKGenerator.h index c713027..f2f8927 100644 --- a/Source/cmExportInstallAndroidMKGenerator.h +++ b/Source/cmExportInstallAndroidMKGenerator.h @@ -3,10 +3,18 @@ #ifndef cmExportInstallAndroidMKGenerator_h #define cmExportInstallAndroidMKGenerator_h +#include + +#include +#include +#include +#include + +#include "cmExportFileGenerator.h" #include "cmExportInstallFileGenerator.h" +class cmGeneratorTarget; class cmInstallExportGenerator; -class cmInstallTargetGenerator; /** \class cmExportInstallAndroidMKGenerator * \brief Generate a file exporting targets from an install tree. diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx index 41fc428..b0a4c47 100644 --- a/Source/cmExtraCodeBlocksGenerator.cxx +++ b/Source/cmExtraCodeBlocksGenerator.cxx @@ -2,6 +2,11 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmExtraCodeBlocksGenerator.h" +#include +#include +#include +#include + #include "cmAlgorithms.h" #include "cmGeneratedFileStream.h" #include "cmGeneratorTarget.h" @@ -14,12 +19,6 @@ #include "cmXMLWriter.h" #include "cmake.h" -#include -#include -#include -#include -#include - /* Some useful URLs: Homepage: http://www.codeblocks.org diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx index c4e86a9..ff2703e 100644 --- a/Source/cmExtraEclipseCDT4Generator.cxx +++ b/Source/cmExtraEclipseCDT4Generator.cxx @@ -2,13 +2,20 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmExtraEclipseCDT4Generator.h" +#include +#include +#include +#include +#include +#include +#include + #include "cmGeneratedFileStream.h" #include "cmGeneratorExpression.h" #include "cmGeneratorTarget.h" #include "cmGlobalGenerator.h" #include "cmLocalGenerator.h" #include "cmMakefile.h" -#include "cmOutputConverter.h" #include "cmSourceFile.h" #include "cmSourceGroup.h" #include "cmState.h" @@ -17,14 +24,6 @@ #include "cmXMLWriter.h" #include "cmake.h" -#include -#include -#include -#include -#include -#include -#include - static void AppendAttribute(cmXMLWriter& xml, const char* keyval) { xml.StartElement("attribute"); diff --git a/Source/cmExtraSublimeTextGenerator.cxx b/Source/cmExtraSublimeTextGenerator.cxx index 9ef684d..5712ab2 100644 --- a/Source/cmExtraSublimeTextGenerator.cxx +++ b/Source/cmExtraSublimeTextGenerator.cxx @@ -2,7 +2,14 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmExtraSublimeTextGenerator.h" +#include +#include +#include +#include +#include + #include "cmGeneratedFileStream.h" +#include "cmGeneratorExpression.h" #include "cmGeneratorTarget.h" #include "cmGlobalGenerator.h" #include "cmLocalGenerator.h" @@ -10,12 +17,7 @@ #include "cmSourceFile.h" #include "cmStateTypes.h" #include "cmSystemTools.h" - -#include -#include -#include -#include -#include +#include "cmake.h" /* Sublime Text 2 Generator diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index 1bade57..afff0f3 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -20,6 +20,7 @@ #undef GetCurrentDirectory #include +#include #include // include sys/stat.h after sys/types.h diff --git a/Source/cmFileTimeComparison.cxx b/Source/cmFileTimeComparison.cxx index 55d8c2a..991ebb8 100644 --- a/Source/cmFileTimeComparison.cxx +++ b/Source/cmFileTimeComparison.cxx @@ -2,7 +2,6 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmFileTimeComparison.h" -#include #include #include #include diff --git a/Source/cmFindBase.cxx b/Source/cmFindBase.cxx index 3d67ac1..dce5021 100644 --- a/Source/cmFindBase.cxx +++ b/Source/cmFindBase.cxx @@ -2,8 +2,14 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmFindBase.h" +#include +#include +#include +#include + #include "cmAlgorithms.h" #include "cmMakefile.h" +#include "cmSearchPath.h" #include "cmState.h" #include "cmStateTypes.h" #include "cmSystemTools.h" diff --git a/Source/cmFindBase.h b/Source/cmFindBase.h index 2b8d4a2..423d453 100644 --- a/Source/cmFindBase.h +++ b/Source/cmFindBase.h @@ -3,6 +3,11 @@ #ifndef cmFindBase_h #define cmFindBase_h +#include // IWYU pragma: keep + +#include +#include + #include "cmFindCommon.h" /** \class cmFindBase diff --git a/Source/cmFindCommon.cxx b/Source/cmFindCommon.cxx index 75d1453..110195c 100644 --- a/Source/cmFindCommon.cxx +++ b/Source/cmFindCommon.cxx @@ -2,12 +2,13 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmFindCommon.h" +#include +#include +#include + #include "cmMakefile.h" #include "cmSystemTools.h" -#include -#include - cmFindCommon::PathGroup cmFindCommon::PathGroup::All("ALL"); cmFindCommon::PathLabel cmFindCommon::PathLabel::CMake("CMAKE"); cmFindCommon::PathLabel cmFindCommon::PathLabel::CMakeEnvironment( diff --git a/Source/cmFindCommon.h b/Source/cmFindCommon.h index 1809c0a..4d6d569 100644 --- a/Source/cmFindCommon.h +++ b/Source/cmFindCommon.h @@ -3,10 +3,19 @@ #ifndef cmFindCommon_h #define cmFindCommon_h +#include + +#include +#include +#include +#include + #include "cmCommand.h" #include "cmPathLabel.h" #include "cmSearchPath.h" +class cmMakefile; + /** \class cmFindCommon * \brief Base class for FIND_XXX implementations. * diff --git a/Source/cmFunctionBlocker.h b/Source/cmFunctionBlocker.h index 388115d..b3450b3 100644 --- a/Source/cmFunctionBlocker.h +++ b/Source/cmFunctionBlocker.h @@ -3,12 +3,9 @@ #ifndef cmFunctionBlocker_h #define cmFunctionBlocker_h -#include - -#include "cmStandardIncludes.h" - -#include "cmExecutionStatus.h" #include "cmListFileCache.h" + +class cmExecutionStatus; class cmMakefile; class cmFunctionBlocker diff --git a/Source/cmFunctionCommand.cxx b/Source/cmFunctionCommand.cxx index 0ba575a..31adcb7 100644 --- a/Source/cmFunctionCommand.cxx +++ b/Source/cmFunctionCommand.cxx @@ -2,7 +2,6 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmFunctionCommand.h" -#include #include #include "cmAlgorithms.h" diff --git a/Source/cmGeneratedFileStream.cxx b/Source/cmGeneratedFileStream.cxx index 6cdb7f5..4731493 100644 --- a/Source/cmGeneratedFileStream.cxx +++ b/Source/cmGeneratedFileStream.cxx @@ -2,11 +2,12 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmGeneratedFileStream.h" -#include "cmSystemTools.h" - #include +#include "cmSystemTools.h" + #if defined(CMAKE_BUILD_WITH_CMAKE) +#include "cm_codecvt.hxx" #include #endif diff --git a/Source/cmGeneratorExpression.cxx b/Source/cmGeneratorExpression.cxx index 34f763c..1f2d2b4 100644 --- a/Source/cmGeneratorExpression.cxx +++ b/Source/cmGeneratorExpression.cxx @@ -2,6 +2,9 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmGeneratorExpression.h" +#include +#include + #include "assert.h" #include "cmAlgorithms.h" #include "cmGeneratorExpressionContext.h" @@ -9,9 +12,7 @@ #include "cmGeneratorExpressionLexer.h" #include "cmGeneratorExpressionParser.h" #include "cmSystemTools.h" - -#include -#include +#include "cm_auto_ptr.hxx" cmGeneratorExpression::cmGeneratorExpression( const cmListFileBacktrace& backtrace) diff --git a/Source/cmGeneratorExpressionEvaluationFile.cxx b/Source/cmGeneratorExpressionEvaluationFile.cxx index c6c4c3a..aeb005fd 100644 --- a/Source/cmGeneratorExpressionEvaluationFile.cxx +++ b/Source/cmGeneratorExpressionEvaluationFile.cxx @@ -2,6 +2,11 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmGeneratorExpressionEvaluationFile.h" +#include +#include +#include +#include + #include "cmGeneratedFileStream.h" #include "cmGlobalGenerator.h" #include "cmListFileCache.h" @@ -9,13 +14,9 @@ #include "cmMakefile.h" #include "cmSourceFile.h" #include "cmSystemTools.h" +#include "cm_auto_ptr.hxx" #include "cmake.h" -#include -#include -#include -#include - cmGeneratorExpressionEvaluationFile::cmGeneratorExpressionEvaluationFile( const std::string& input, CM_AUTO_PTR outputFileExpr, diff --git a/Source/cmGeneratorExpressionEvaluationFile.h b/Source/cmGeneratorExpressionEvaluationFile.h index d597270..26135df 100644 --- a/Source/cmGeneratorExpressionEvaluationFile.h +++ b/Source/cmGeneratorExpressionEvaluationFile.h @@ -5,14 +5,19 @@ #include // IWYU pragma: keep -#include "cmGeneratorExpression.h" - -#include #include #include -#include #include +#include "cmGeneratorExpression.h" +#include "cm_auto_ptr.hxx" + +#if defined(_MSC_VER) +typedef unsigned short mode_t; +#else +#include +#endif + class cmLocalGenerator; class cmGeneratorExpressionEvaluationFile diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index ca056c0..882de85 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -2,6 +2,17 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmGeneratorTarget.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + #include "cmAlgorithms.h" #include "cmComputeLinkInformation.h" #include "cmCustomCommand.h" @@ -24,16 +35,7 @@ #include "cm_unordered_set.hxx" #include "cmake.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +class cmMessenger; template <> const char* cmTargetPropertyComputer::GetSources( diff --git a/Source/cmGetCMakePropertyCommand.cxx b/Source/cmGetCMakePropertyCommand.cxx index c92ae21..7962da6 100644 --- a/Source/cmGetCMakePropertyCommand.cxx +++ b/Source/cmGetCMakePropertyCommand.cxx @@ -2,7 +2,6 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmGetCMakePropertyCommand.h" -#include #include #include "cmAlgorithms.h" diff --git a/Source/cmGlobalBorlandMakefileGenerator.cxx b/Source/cmGlobalBorlandMakefileGenerator.cxx index a0a33ea..d2372a7 100644 --- a/Source/cmGlobalBorlandMakefileGenerator.cxx +++ b/Source/cmGlobalBorlandMakefileGenerator.cxx @@ -2,6 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmGlobalBorlandMakefileGenerator.h" +#include "cmDocumentationEntry.h" #include "cmLocalUnixMakefileGenerator3.h" #include "cmMakefile.h" #include "cmState.h" diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index cf51c6a..2d0767f 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -9,6 +9,16 @@ #include "cmGlobalGenerator.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + #include "cmAlgorithms.h" #include "cmCPackPropertiesGenerator.h" #include "cmComputeTargetDepends.h" @@ -29,20 +39,11 @@ #include "cmQtAutoGeneratorInitializer.h" #include "cmSourceFile.h" #include "cmState.h" +#include "cmStateDirectory.h" #include "cmStateTypes.h" #include "cmVersion.h" #include "cmake.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include - #if defined(CMAKE_BUILD_WITH_CMAKE) #include #include diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index 4bf4bd1..88ef8da 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -5,8 +5,15 @@ #include +#include +#include +#include +#include +#include +#include + +#include "cmCustomCommandLines.h" #include "cmExportSetMap.h" -#include "cmStateDirectory.h" #include "cmStateSnapshot.h" #include "cmSystemTools.h" #include "cmTarget.h" @@ -14,26 +21,19 @@ #include "cm_codecvt.hxx" #include "cm_unordered_map.hxx" -#include -#include -#include -#include -#include -#include - #if defined(CMAKE_BUILD_WITH_CMAKE) #include "cmFileLockPool.h" #endif -class cmCustomCommandLines; -class cmSourceFile; class cmExportBuildFileGenerator; class cmExternalMakefileProjectGenerator; class cmGeneratorTarget; -class cmLocalGenerator; class cmLinkLineComputer; +class cmLocalGenerator; class cmMakefile; class cmOutputConverter; +class cmSourceFile; +class cmStateDirectory; class cmake; /** \class cmGlobalGenerator diff --git a/Source/cmGlobalGeneratorFactory.h b/Source/cmGlobalGeneratorFactory.h index 528e118..5e948f7 100644 --- a/Source/cmGlobalGeneratorFactory.h +++ b/Source/cmGlobalGeneratorFactory.h @@ -5,12 +5,11 @@ #include -#include - -#include "cmStandardIncludes.h" +#include +#include -class cmake; class cmGlobalGenerator; +class cmake; struct cmDocumentationEntry; /** \class cmGlobalGeneratorFactory diff --git a/Source/cmGlobalJOMMakefileGenerator.cxx b/Source/cmGlobalJOMMakefileGenerator.cxx index 78bf5bd..18c45e0 100644 --- a/Source/cmGlobalJOMMakefileGenerator.cxx +++ b/Source/cmGlobalJOMMakefileGenerator.cxx @@ -2,6 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmGlobalJOMMakefileGenerator.h" +#include "cmDocumentationEntry.h" #include "cmLocalUnixMakefileGenerator3.h" #include "cmMakefile.h" #include "cmState.h" diff --git a/Source/cmGlobalMSYSMakefileGenerator.cxx b/Source/cmGlobalMSYSMakefileGenerator.cxx index f17b915..7e0d0d4 100644 --- a/Source/cmGlobalMSYSMakefileGenerator.cxx +++ b/Source/cmGlobalMSYSMakefileGenerator.cxx @@ -2,11 +2,13 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmGlobalMSYSMakefileGenerator.h" +#include + +#include "cmDocumentationEntry.h" #include "cmLocalUnixMakefileGenerator3.h" #include "cmMakefile.h" #include "cmState.h" #include "cmake.h" -#include cmGlobalMSYSMakefileGenerator::cmGlobalMSYSMakefileGenerator(cmake* cm) : cmGlobalUnixMakefileGenerator3(cm) diff --git a/Source/cmGlobalMinGWMakefileGenerator.cxx b/Source/cmGlobalMinGWMakefileGenerator.cxx index 255c0f5..3c3a5d1 100644 --- a/Source/cmGlobalMinGWMakefileGenerator.cxx +++ b/Source/cmGlobalMinGWMakefileGenerator.cxx @@ -2,6 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmGlobalMinGWMakefileGenerator.h" +#include "cmDocumentationEntry.h" #include "cmLocalUnixMakefileGenerator3.h" #include "cmMakefile.h" #include "cmState.h" diff --git a/Source/cmGlobalNMakeMakefileGenerator.cxx b/Source/cmGlobalNMakeMakefileGenerator.cxx index 06aba73..da683fb 100644 --- a/Source/cmGlobalNMakeMakefileGenerator.cxx +++ b/Source/cmGlobalNMakeMakefileGenerator.cxx @@ -2,6 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmGlobalNMakeMakefileGenerator.h" +#include "cmDocumentationEntry.h" #include "cmLocalUnixMakefileGenerator3.h" #include "cmMakefile.h" #include "cmState.h" diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 830ab7f..f62c8ec 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -2,6 +2,17 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmGlobalNinjaGenerator.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + #include "cmAlgorithms.h" #include "cmDocumentationEntry.h" #include "cmFortranParser.h" @@ -13,6 +24,9 @@ #include "cmMakefile.h" #include "cmNinjaLinkLineComputer.h" #include "cmOutputConverter.h" +#include "cmState.h" +#include "cmStateDirectory.h" +#include "cmStateSnapshot.h" #include "cmStateTypes.h" #include "cmSystemTools.h" #include "cmTarget.h" @@ -21,15 +35,7 @@ #include "cm_auto_ptr.hxx" #include "cmake.h" -#include "cm_jsoncpp_reader.h" -#include "cm_jsoncpp_writer.h" - -#include -#include -#include -#include -#include -#include +class cmLinkLineComputer; const char* cmGlobalNinjaGenerator::NINJA_BUILD_FILE = "build.ninja"; const char* cmGlobalNinjaGenerator::NINJA_RULES_FILE = "rules.ninja"; diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h index 064ff0b..a51e919 100644 --- a/Source/cmGlobalNinjaGenerator.h +++ b/Source/cmGlobalNinjaGenerator.h @@ -5,12 +5,6 @@ #include -#include "cmGlobalCommonGenerator.h" -#include "cmGlobalGenerator.h" -#include "cmGlobalGeneratorFactory.h" -#include "cmNinjaTypes.h" -#include "cmPolicies.h" - #include #include #include @@ -18,13 +12,23 @@ #include #include +#include "cmGlobalCommonGenerator.h" +#include "cmGlobalGenerator.h" +#include "cmGlobalGeneratorFactory.h" +#include "cmNinjaTypes.h" +#include "cmPolicies.h" +#include "cm_codecvt.hxx" + class cmCustomCommand; -class cmMakefile; -class cmake; -struct cmDocumentationEntry; class cmGeneratedFileStream; class cmGeneratorTarget; +class cmLinkLineComputer; class cmLocalGenerator; +class cmMakefile; +class cmOutputConverter; +class cmStateDirectory; +class cmake; +struct cmDocumentationEntry; /** * \class cmGlobalNinjaGenerator diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx index 90caaf9..23b3718 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.cxx +++ b/Source/cmGlobalUnixMakefileGenerator3.cxx @@ -2,6 +2,11 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmGlobalUnixMakefileGenerator3.h" +#include +#include +#include +#include + #include "cmAlgorithms.h" #include "cmDocumentationEntry.h" #include "cmGeneratedFileStream.h" @@ -14,16 +19,12 @@ #include "cmOutputConverter.h" #include "cmState.h" #include "cmStateDirectory.h" +#include "cmStateTypes.h" #include "cmSystemTools.h" #include "cmTarget.h" #include "cmTargetDepend.h" #include "cmake.h" -#include -#include -#include -#include - cmGlobalUnixMakefileGenerator3::cmGlobalUnixMakefileGenerator3(cmake* cm) : cmGlobalCommonGenerator(cm) { diff --git a/Source/cmGlobalUnixMakefileGenerator3.h b/Source/cmGlobalUnixMakefileGenerator3.h index 843e5dc..67d7bc9 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.h +++ b/Source/cmGlobalUnixMakefileGenerator3.h @@ -5,11 +5,6 @@ #include -#include "cmGeneratorTarget.h" -#include "cmGlobalCommonGenerator.h" -#include "cmGlobalGeneratorFactory.h" -#include "cmStateTypes.h" - #include #include #include @@ -17,6 +12,11 @@ #include #include +#include "cmGeneratorTarget.h" +#include "cmGlobalCommonGenerator.h" +#include "cmGlobalGeneratorFactory.h" +#include "cmStateSnapshot.h" + class cmGeneratedFileStream; class cmLocalGenerator; class cmLocalUnixMakefileGenerator3; diff --git a/Source/cmGlobalWatcomWMakeGenerator.cxx b/Source/cmGlobalWatcomWMakeGenerator.cxx index 0900797..94cdb38 100644 --- a/Source/cmGlobalWatcomWMakeGenerator.cxx +++ b/Source/cmGlobalWatcomWMakeGenerator.cxx @@ -5,7 +5,6 @@ #include "cmDocumentationEntry.h" #include "cmMakefile.h" #include "cmState.h" -#include "cmStateTypes.h" #include "cmake.h" cmGlobalWatcomWMakeGenerator::cmGlobalWatcomWMakeGenerator(cmake* cm) diff --git a/Source/cmGraphAdjacencyList.h b/Source/cmGraphAdjacencyList.h index a154373..e6aec47 100644 --- a/Source/cmGraphAdjacencyList.h +++ b/Source/cmGraphAdjacencyList.h @@ -3,9 +3,9 @@ #ifndef cmGraphAdjacencyList_h #define cmGraphAdjacencyList_h -#include +#include // IWYU pragma: keep -#include "cmStandardIncludes.h" +#include /** * Graph edge representation. Most use cases just need the diff --git a/Source/cmGraphVizWriter.cxx b/Source/cmGraphVizWriter.cxx index 6b32f73..0f69aaa 100644 --- a/Source/cmGraphVizWriter.cxx +++ b/Source/cmGraphVizWriter.cxx @@ -2,21 +2,22 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmGraphVizWriter.h" +#include +#include +#include +#include + #include "cmGeneratedFileStream.h" #include "cmGeneratorTarget.h" #include "cmGlobalGenerator.h" #include "cmLocalGenerator.h" #include "cmMakefile.h" +#include "cmStateSnapshot.h" #include "cmSystemTools.h" #include "cmTarget.h" #include "cm_auto_ptr.hxx" #include "cmake.h" -#include -#include -#include -#include - static const char* getShapeForTarget(const cmGeneratorTarget* target) { if (!target) { diff --git a/Source/cmHexFileConverter.cxx b/Source/cmHexFileConverter.cxx index db855d2..d9d6598 100644 --- a/Source/cmHexFileConverter.cxx +++ b/Source/cmHexFileConverter.cxx @@ -2,11 +2,12 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmHexFileConverter.h" -#include "cmSystemTools.h" - +#include #include #include +#include "cmSystemTools.h" + #define INTEL_HEX_MIN_LINE_LENGTH (1 + 8 + 2) #define INTEL_HEX_MAX_LINE_LENGTH (1 + 8 + (256 * 2) + 2) #define MOTOROLA_SREC_MIN_LINE_LENGTH (2 + 2 + 4 + 2) diff --git a/Source/cmHexFileConverter.h b/Source/cmHexFileConverter.h index cb550bb..1050bc1 100644 --- a/Source/cmHexFileConverter.h +++ b/Source/cmHexFileConverter.h @@ -3,10 +3,6 @@ #ifndef cmHexFileConverter_h #define cmHexFileConverter_h -#include - -#include "cmStandardIncludes.h" - /** \class cmHexFileConverter * \brief Can detects Intel Hex and Motorola S-record files and convert them * to binary files. diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx index bf59e88..fadebb4 100644 --- a/Source/cmInstallCommand.cxx +++ b/Source/cmInstallCommand.cxx @@ -2,7 +2,6 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmInstallCommand.h" -#include #include #include #include diff --git a/Source/cmInstallCommandArguments.cxx b/Source/cmInstallCommandArguments.cxx index de6919b..6b15468 100644 --- a/Source/cmInstallCommandArguments.cxx +++ b/Source/cmInstallCommandArguments.cxx @@ -2,6 +2,8 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmInstallCommandArguments.h" +#include + #include "cmSystemTools.h" // Table of valid permissions. diff --git a/Source/cmInstallCommandArguments.h b/Source/cmInstallCommandArguments.h index 82c2310..c1523b2 100644 --- a/Source/cmInstallCommandArguments.h +++ b/Source/cmInstallCommandArguments.h @@ -3,9 +3,10 @@ #ifndef cmInstallCommandArguments_h #define cmInstallCommandArguments_h -#include +#include // IWYU pragma: keep -#include "cmStandardIncludes.h" +#include +#include #include "cmCommandArgumentsHelper.h" diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx index f1df073..4dfa40f 100644 --- a/Source/cmInstallTargetGenerator.cxx +++ b/Source/cmInstallTargetGenerator.cxx @@ -2,6 +2,12 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmInstallTargetGenerator.h" +#include +#include +#include +#include +#include + #include "cmComputeLinkInformation.h" #include "cmGeneratorExpression.h" #include "cmGeneratorTarget.h" @@ -12,15 +18,8 @@ #include "cmStateTypes.h" #include "cmSystemTools.h" #include "cmTarget.h" -#include "cm_auto_ptr.hxx" #include "cmake.h" -#include -#include -#include -#include -#include - cmInstallTargetGenerator::cmInstallTargetGenerator( const std::string& targetName, const char* dest, bool implib, const char* file_permissions, std::vector const& configurations, diff --git a/Source/cmLinkItem.h b/Source/cmLinkItem.h index 74d6774..6fd6f50 100644 --- a/Source/cmLinkItem.h +++ b/Source/cmLinkItem.h @@ -3,8 +3,16 @@ #ifndef cmLinkItem_h #define cmLinkItem_h +#include + +#include +#include +#include +#include + #include "cmListFileCache.h" #include "cmSystemTools.h" +#include "cmTargetLinkLibraryType.h" class cmGeneratorTarget; diff --git a/Source/cmLinkLineComputer.cxx b/Source/cmLinkLineComputer.cxx index c271246..cf0cf88 100644 --- a/Source/cmLinkLineComputer.cxx +++ b/Source/cmLinkLineComputer.cxx @@ -2,10 +2,15 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmLinkLineComputer.h" + +#include +#include + #include "cmComputeLinkInformation.h" #include "cmGeneratorTarget.h" #include "cmOutputConverter.h" #include "cmStateDirectory.h" +#include "cmStateTypes.h" cmLinkLineComputer::cmLinkLineComputer(cmOutputConverter* outputConverter, cmStateDirectory stateDir) diff --git a/Source/cmLinkLineComputer.h b/Source/cmLinkLineComputer.h index 6bbb69e..97a5d1b 100644 --- a/Source/cmLinkLineComputer.h +++ b/Source/cmLinkLineComputer.h @@ -4,6 +4,10 @@ #ifndef cmLinkLineComputer_h #define cmLinkLineComputer_h +#include // IWYU pragma: keep + +#include + #include "cmStateDirectory.h" class cmComputeLinkInformation; diff --git a/Source/cmLinkedTree.h b/Source/cmLinkedTree.h index d2c6f33..4f95522 100644 --- a/Source/cmLinkedTree.h +++ b/Source/cmLinkedTree.h @@ -5,9 +5,9 @@ #include -#include "cmStandardIncludes.h" - #include +#include +#include /** @brief A adaptor for traversing a tree structure in a vector diff --git a/Source/cmLocalCommonGenerator.cxx b/Source/cmLocalCommonGenerator.cxx index 6b49f1e..d5f9d27 100644 --- a/Source/cmLocalCommonGenerator.cxx +++ b/Source/cmLocalCommonGenerator.cxx @@ -2,10 +2,11 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmLocalCommonGenerator.h" +#include + #include "cmGeneratorTarget.h" #include "cmMakefile.h" - -#include +#include "cmOutputConverter.h" class cmGlobalGenerator; diff --git a/Source/cmLocalCommonGenerator.h b/Source/cmLocalCommonGenerator.h index eb5f850..f83f371 100644 --- a/Source/cmLocalCommonGenerator.h +++ b/Source/cmLocalCommonGenerator.h @@ -5,11 +5,10 @@ #include -#include "cmLocalGenerator.h" -#include "cmOutputConverter.h" - #include +#include "cmLocalGenerator.h" + class cmGeneratorTarget; class cmGlobalGenerator; class cmMakefile; diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 4aecb1d..7d3a2f0 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -18,6 +18,7 @@ #include "cmSourceFile.h" #include "cmState.h" #include "cmStateDirectory.h" +#include "cmStateTypes.h" #include "cmSystemTools.h" #include "cmTarget.h" #include "cmTestGenerator.h" @@ -32,10 +33,10 @@ #include #include #include -#include #include #include #include +#include #include #if defined(__HAIKU__) diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h index 6314aff..fdca78a 100644 --- a/Source/cmLocalGenerator.h +++ b/Source/cmLocalGenerator.h @@ -5,29 +5,28 @@ #include -#include "cmListFileCache.h" -#include "cmOutputConverter.h" -#include "cmPolicies.h" -#include "cmRulePlaceholderExpander.h" -#include "cmStateTypes.h" -#include "cmake.h" - #include #include #include #include -#include #include #include +#include "cmListFileCache.h" +#include "cmOutputConverter.h" +#include "cmPolicies.h" +#include "cmStateSnapshot.h" +#include "cmake.h" + class cmComputeLinkInformation; class cmCustomCommandGenerator; class cmGeneratorTarget; class cmGlobalGenerator; -class cmRulePlaceholderExpander; +class cmLinkLineComputer; class cmMakefile; +class cmRulePlaceholderExpander; class cmSourceFile; -class cmLinkLineComputer; +class cmState; /** \class cmLocalGenerator * \brief Create required build files for a directory. diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx index c27ab09..c2d9d57 100644 --- a/Source/cmLocalNinjaGenerator.cxx +++ b/Source/cmLocalNinjaGenerator.cxx @@ -2,6 +2,13 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmLocalNinjaGenerator.h" +#include +#include +#include +#include +#include +#include + #include "cmCustomCommand.h" #include "cmCustomCommandGenerator.h" #include "cmGeneratedFileStream.h" @@ -15,15 +22,9 @@ #include "cmState.h" #include "cmStateTypes.h" #include "cmSystemTools.h" +#include "cm_auto_ptr.hxx" #include "cmake.h" -#include -#include -#include -#include -#include -#include - cmLocalNinjaGenerator::cmLocalNinjaGenerator(cmGlobalGenerator* gg, cmMakefile* mf) : cmLocalCommonGenerator(gg, mf, mf->GetState()->GetBinaryDirectory()) diff --git a/Source/cmLocalNinjaGenerator.h b/Source/cmLocalNinjaGenerator.h index 95d8eb8..1080319 100644 --- a/Source/cmLocalNinjaGenerator.h +++ b/Source/cmLocalNinjaGenerator.h @@ -5,17 +5,16 @@ #include -#include "cmLocalCommonGenerator.h" -#include "cmLocalGenerator.h" -#include "cmNinjaTypes.h" -#include "cmOutputConverter.h" - #include #include #include #include #include +#include "cmLocalCommonGenerator.h" +#include "cmNinjaTypes.h" +#include "cmOutputConverter.h" + class cmCustomCommand; class cmCustomCommandGenerator; class cmGeneratedFileStream; @@ -23,6 +22,7 @@ class cmGeneratorTarget; class cmGlobalGenerator; class cmGlobalNinjaGenerator; class cmMakefile; +class cmRulePlaceholderExpander; class cmSourceFile; class cmake; diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index 4f81ef1..8bb084a 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -2,6 +2,14 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmLocalUnixMakefileGenerator3.h" +#include +#include +#include +#include +#include +#include +#include + #include "cmAlgorithms.h" #include "cmCustomCommand.h" #include "cmCustomCommandGenerator.h" @@ -18,9 +26,11 @@ #include "cmSourceFile.h" #include "cmState.h" #include "cmStateDirectory.h" +#include "cmStateSnapshot.h" #include "cmStateTypes.h" #include "cmSystemTools.h" #include "cmVersion.h" +#include "cm_auto_ptr.hxx" #include "cmake.h" // Include dependency scanners for supported languages. Only the @@ -31,15 +41,6 @@ #include "cmDependsJava.h" #endif -#include -#include -#include -#include -#include -#include -#include -#include - // Escape special characters in Makefile dependency lines class cmMakeSafe { diff --git a/Source/cmLocale.h b/Source/cmLocale.h index f35e528..e8e751d 100644 --- a/Source/cmLocale.h +++ b/Source/cmLocale.h @@ -5,8 +5,6 @@ #include -#include "cmStandardIncludes.h" - #include class cmLocaleRAII diff --git a/Source/cmMSVC60LinkLineComputer.cxx b/Source/cmMSVC60LinkLineComputer.cxx index 9308d91..d761e7b 100644 --- a/Source/cmMSVC60LinkLineComputer.cxx +++ b/Source/cmMSVC60LinkLineComputer.cxx @@ -3,7 +3,13 @@ #include "cmMSVC60LinkLineComputer.h" +#include "cmStateDirectory.h" + +#if defined(_WIN32) && !defined(__CYGWIN__) #include "cmSystemTools.h" +#endif + +class cmOutputConverter; cmMSVC60LinkLineComputer::cmMSVC60LinkLineComputer( cmOutputConverter* outputConverter, cmStateDirectory stateDir) diff --git a/Source/cmMSVC60LinkLineComputer.h b/Source/cmMSVC60LinkLineComputer.h index 381b8a2..9a28dca 100644 --- a/Source/cmMSVC60LinkLineComputer.h +++ b/Source/cmMSVC60LinkLineComputer.h @@ -4,8 +4,15 @@ #ifndef cmMSVC60LinkLineComputer_h #define cmMSVC60LinkLineComputer_h +#include + +#include + #include "cmLinkLineComputer.h" +class cmOutputConverter; +class cmStateDirectory; + class cmMSVC60LinkLineComputer : public cmLinkLineComputer { public: diff --git a/Source/cmMacroCommand.cxx b/Source/cmMacroCommand.cxx index d777bd5..583f801 100644 --- a/Source/cmMacroCommand.cxx +++ b/Source/cmMacroCommand.cxx @@ -2,7 +2,6 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmMacroCommand.h" -#include #include #include diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 741ffb8..90182f9 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -2,6 +2,16 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmMakefile.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + #include "cmAlgorithms.h" #include "cmCommand.h" #include "cmCommandArgumentParserHelper.h" @@ -14,6 +24,7 @@ #include "cmGeneratorExpression.h" #include "cmGeneratorExpressionEvaluationFile.h" #include "cmGlobalGenerator.h" +#include "cmInstallGenerator.h" // IWYU pragma: keep #include "cmListFileCache.h" #include "cmSourceFile.h" #include "cmSourceFileLocation.h" @@ -21,28 +32,17 @@ #include "cmStateDirectory.h" #include "cmStateTypes.h" #include "cmSystemTools.h" +#include "cmTargetLinkLibraryType.h" #include "cmTest.h" +#include "cmTestGenerator.h" // IWYU pragma: keep #include "cmVersion.h" +#include "cm_auto_ptr.hxx" #include "cmake.h" -#include "cmInstallGenerator.h" // IWYU pragma: keep -#include "cmTestGenerator.h" // IWYU pragma: keep - #ifdef CMAKE_BUILD_WITH_CMAKE #include "cmVariableWatch.h" #endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - class cmMessenger; // default is not to be building executables diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 3067f2c..859b3c8 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -5,13 +5,21 @@ #include +#include +#include +#include +#include +#include +#include + #include "cmAlgorithms.h" #include "cmListFileCache.h" #include "cmNewLineStyle.h" #include "cmPolicies.h" #include "cmStateSnapshot.h" +#include "cmStateTypes.h" #include "cmTarget.h" -#include "cmTargetLinkLibraryType.h" +#include "cm_auto_ptr.hxx" #include "cm_unordered_map.hxx" #include "cmake.h" @@ -19,15 +27,6 @@ #include "cmSourceGroup.h" #endif -#include -#include - -#include -#include -#include -#include -#include - class cmCommand; class cmCompiledGeneratorExpression; class cmCustomCommandLines; @@ -40,6 +39,7 @@ class cmGlobalGenerator; class cmInstallGenerator; class cmMessenger; class cmSourceFile; +class cmState; class cmTest; class cmTestGenerator; class cmVariableWatch; diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx index cbbd2e6..358804e 100644 --- a/Source/cmMakefileExecutableTargetGenerator.cxx +++ b/Source/cmMakefileExecutableTargetGenerator.cxx @@ -2,6 +2,10 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmMakefileExecutableTargetGenerator.h" +#include +#include +#include + #include "cmGeneratedFileStream.h" #include "cmGeneratorTarget.h" #include "cmGlobalUnixMakefileGenerator3.h" @@ -13,13 +17,12 @@ #include "cmOutputConverter.h" #include "cmRulePlaceholderExpander.h" #include "cmState.h" +#include "cmStateDirectory.h" +#include "cmStateSnapshot.h" #include "cmSystemTools.h" +#include "cm_auto_ptr.hxx" #include "cmake.h" -#include -#include -#include - cmMakefileExecutableTargetGenerator::cmMakefileExecutableTargetGenerator( cmGeneratorTarget* target) : cmMakefileTargetGenerator(target) diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx index a249efd..c591bb3 100644 --- a/Source/cmMakefileLibraryTargetGenerator.cxx +++ b/Source/cmMakefileLibraryTargetGenerator.cxx @@ -2,6 +2,11 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmMakefileLibraryTargetGenerator.h" +#include // IWYU pragma: keep + +#include +#include + #include "cmGeneratedFileStream.h" #include "cmGeneratorTarget.h" #include "cmGlobalUnixMakefileGenerator3.h" @@ -13,13 +18,13 @@ #include "cmOutputConverter.h" #include "cmRulePlaceholderExpander.h" #include "cmState.h" +#include "cmStateDirectory.h" +#include "cmStateSnapshot.h" #include "cmStateTypes.h" #include "cmSystemTools.h" +#include "cm_auto_ptr.hxx" #include "cmake.h" -#include -#include - cmMakefileLibraryTargetGenerator::cmMakefileLibraryTargetGenerator( cmGeneratorTarget* target) : cmMakefileTargetGenerator(target) diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index 68aabef..5bec2bb 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -2,6 +2,10 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmMakefileTargetGenerator.h" +#include +#include +#include + #include "cmAlgorithms.h" #include "cmComputeLinkInformation.h" #include "cmCustomCommand.h" @@ -10,8 +14,6 @@ #include "cmGeneratorExpression.h" #include "cmGeneratorTarget.h" #include "cmGlobalUnixMakefileGenerator3.h" -#include "cmLinkLineComputer.h" -#include "cmLocalGenerator.h" #include "cmLocalUnixMakefileGenerator3.h" #include "cmMakefile.h" #include "cmMakefileExecutableTargetGenerator.h" @@ -21,17 +23,13 @@ #include "cmRulePlaceholderExpander.h" #include "cmSourceFile.h" #include "cmState.h" +#include "cmStateDirectory.h" +#include "cmStateSnapshot.h" #include "cmStateTypes.h" #include "cmSystemTools.h" #include "cm_auto_ptr.hxx" #include "cmake.h" -#include -#include -#include -#include -#include - #ifndef _WIN32 #include #endif diff --git a/Source/cmMakefileTargetGenerator.h b/Source/cmMakefileTargetGenerator.h index e44f64a..347f9f2 100644 --- a/Source/cmMakefileTargetGenerator.h +++ b/Source/cmMakefileTargetGenerator.h @@ -5,22 +5,24 @@ #include -#include "cmCommonTargetGenerator.h" -#include "cmLocalUnixMakefileGenerator3.h" -#include "cmOSXBundleGenerator.h" - #include #include #include #include #include +#include "cmCommonTargetGenerator.h" +#include "cmLocalUnixMakefileGenerator3.h" +#include "cmOSXBundleGenerator.h" + class cmCustomCommandGenerator; class cmGeneratedFileStream; class cmGeneratorTarget; class cmGlobalUnixMakefileGenerator3; -class cmSourceFile; class cmLinkLineComputer; +class cmOutputConverter; +class cmSourceFile; +class cmStateDirectory; /** \class cmMakefileTargetGenerator * \brief Support Routines for writing makefiles diff --git a/Source/cmMakefileUtilityTargetGenerator.cxx b/Source/cmMakefileUtilityTargetGenerator.cxx index ecb29cb..a7c5d27 100644 --- a/Source/cmMakefileUtilityTargetGenerator.cxx +++ b/Source/cmMakefileUtilityTargetGenerator.cxx @@ -2,17 +2,17 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmMakefileUtilityTargetGenerator.h" +#include +#include +#include + #include "cmGeneratedFileStream.h" #include "cmGeneratorTarget.h" #include "cmGlobalUnixMakefileGenerator3.h" #include "cmLocalUnixMakefileGenerator3.h" #include "cmMakefile.h" #include "cmOSXBundleGenerator.h" -#include "cmOutputConverter.h" - -#include -#include -#include +#include "cmSystemTools.h" cmMakefileUtilityTargetGenerator::cmMakefileUtilityTargetGenerator( cmGeneratorTarget* target) diff --git a/Source/cmMessageCommand.cxx b/Source/cmMessageCommand.cxx index 2e15720..43fb5f5 100644 --- a/Source/cmMessageCommand.cxx +++ b/Source/cmMessageCommand.cxx @@ -2,8 +2,6 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmMessageCommand.h" -#include - #include "cmAlgorithms.h" #include "cmMakefile.h" #include "cmMessenger.h" diff --git a/Source/cmNinjaLinkLineComputer.cxx b/Source/cmNinjaLinkLineComputer.cxx index fa9df6d..2546b55 100644 --- a/Source/cmNinjaLinkLineComputer.cxx +++ b/Source/cmNinjaLinkLineComputer.cxx @@ -2,7 +2,11 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmNinjaLinkLineComputer.h" + #include "cmGlobalNinjaGenerator.h" +#include "cmStateDirectory.h" + +class cmOutputConverter; cmNinjaLinkLineComputer::cmNinjaLinkLineComputer( cmOutputConverter* outputConverter, cmStateDirectory stateDir, diff --git a/Source/cmNinjaLinkLineComputer.h b/Source/cmNinjaLinkLineComputer.h index daecea4..ff0771b 100644 --- a/Source/cmNinjaLinkLineComputer.h +++ b/Source/cmNinjaLinkLineComputer.h @@ -4,10 +4,15 @@ #ifndef cmNinjaLinkLineComputer_h #define cmNinjaLinkLineComputer_h +#include + +#include + #include "cmLinkLineComputer.h" -#include "cmState.h" class cmGlobalNinjaGenerator; +class cmOutputConverter; +class cmStateDirectory; class cmNinjaLinkLineComputer : public cmLinkLineComputer { diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index d70bf8e..a23e0ad 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -2,6 +2,15 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmNinjaNormalTargetGenerator.h" +#include +#include +#include +#include +#include +#include +#include +#include + #include "cmAlgorithms.h" #include "cmCustomCommand.h" #include "cmCustomCommandGenerator.h" @@ -18,19 +27,13 @@ #include "cmRulePlaceholderExpander.h" #include "cmSourceFile.h" #include "cmState.h" +#include "cmStateDirectory.h" +#include "cmStateSnapshot.h" #include "cmStateTypes.h" #include "cmSystemTools.h" +#include "cm_auto_ptr.hxx" #include "cmake.h" -#include -#include -#include -#include -#include -#include -#include -#include - #ifndef _WIN32 #include #endif diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index cf60892..a220cd8 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -2,10 +2,20 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmNinjaTargetGenerator.h" +#include +#include +#include +#include +#include +#include +#include +#include + #include "cmAlgorithms.h" #include "cmComputeLinkInformation.h" #include "cmCustomCommandGenerator.h" #include "cmGeneratedFileStream.h" +#include "cmGeneratorExpression.h" #include "cmGeneratorTarget.h" #include "cmGlobalNinjaGenerator.h" #include "cmLocalGenerator.h" @@ -19,16 +29,9 @@ #include "cmState.h" #include "cmStateTypes.h" #include "cmSystemTools.h" +#include "cm_auto_ptr.hxx" #include "cmake.h" -#include "cm_jsoncpp_writer.h" - -#include -#include -#include -#include -#include - cmNinjaTargetGenerator* cmNinjaTargetGenerator::New(cmGeneratorTarget* target) { switch (target->GetType()) { diff --git a/Source/cmNinjaTypes.h b/Source/cmNinjaTypes.h index b4eaa59..3fd536a 100644 --- a/Source/cmNinjaTypes.h +++ b/Source/cmNinjaTypes.h @@ -3,9 +3,11 @@ #ifndef cmNinjaTypes_h #define cmNinjaTypes_h -#include +#include // IWYU pragma: keep -#include "cmStandardIncludes.h" +#include +#include +#include typedef std::vector cmNinjaDeps; typedef std::map cmNinjaVars; diff --git a/Source/cmOptionCommand.cxx b/Source/cmOptionCommand.cxx index bbd6090..00a2d2b 100644 --- a/Source/cmOptionCommand.cxx +++ b/Source/cmOptionCommand.cxx @@ -2,8 +2,6 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmOptionCommand.h" -#include - #include "cmAlgorithms.h" #include "cmMakefile.h" #include "cmState.h" diff --git a/Source/cmOutputConverter.cxx b/Source/cmOutputConverter.cxx index 445ad0b..d6864a6 100644 --- a/Source/cmOutputConverter.cxx +++ b/Source/cmOutputConverter.cxx @@ -2,16 +2,17 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmOutputConverter.h" -#include "cmAlgorithms.h" -#include "cmState.h" -#include "cmStateDirectory.h" -#include "cmSystemTools.h" - #include #include #include #include #include +#include + +#include "cmAlgorithms.h" +#include "cmState.h" +#include "cmStateDirectory.h" +#include "cmSystemTools.h" cmOutputConverter::cmOutputConverter(cmStateSnapshot snapshot) : StateSnapshot(snapshot) diff --git a/Source/cmOutputConverter.h b/Source/cmOutputConverter.h index dabb091..a3da4cd 100644 --- a/Source/cmOutputConverter.h +++ b/Source/cmOutputConverter.h @@ -5,10 +5,12 @@ #include // IWYU pragma: keep +#include + #include "cmStateSnapshot.h" -#include -#include +class cmState; +class cmStateDirectory; class cmOutputConverter { diff --git a/Source/cmParseArgumentsCommand.cxx b/Source/cmParseArgumentsCommand.cxx index 0a2dd12..d75ee8e 100644 --- a/Source/cmParseArgumentsCommand.cxx +++ b/Source/cmParseArgumentsCommand.cxx @@ -2,7 +2,6 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmParseArgumentsCommand.h" -#include #include #include #include diff --git a/Source/cmPathLabel.cxx b/Source/cmPathLabel.cxx index 19e6820..30ba081 100644 --- a/Source/cmPathLabel.cxx +++ b/Source/cmPathLabel.cxx @@ -2,6 +2,8 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmPathLabel.h" +#include + cmPathLabel::cmPathLabel(const std::string& label) : Label(label) , Hash(0) diff --git a/Source/cmPathLabel.h b/Source/cmPathLabel.h index 5e9e423..cd9743c 100644 --- a/Source/cmPathLabel.h +++ b/Source/cmPathLabel.h @@ -3,9 +3,9 @@ #ifndef cmPathLabel_h #define cmPathLabel_h -#include +#include // IWYU pragma: keep -#include "cmStandardIncludes.h" +#include /** \class cmPathLabel * \brief Helper class for text based labels diff --git a/Source/cmQtAutoGeneratorInitializer.cxx b/Source/cmQtAutoGeneratorInitializer.cxx index f0373a1..8afd532 100644 --- a/Source/cmQtAutoGeneratorInitializer.cxx +++ b/Source/cmQtAutoGeneratorInitializer.cxx @@ -13,7 +13,6 @@ #include "cmSourceFile.h" #include "cmSourceFileLocation.h" #include "cmState.h" -#include "cmStateTypes.h" #include "cmSystemTools.h" #include "cmTarget.h" #include "cmake.h" @@ -27,7 +26,6 @@ #include #include #include -#include #include #include #include diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx index f56f575..499da3a 100644 --- a/Source/cmQtAutoGenerators.cxx +++ b/Source/cmQtAutoGenerators.cxx @@ -2,18 +2,6 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmQtAutoGenerators.h" -#include "cmAlgorithms.h" -#include "cmFilePathUuid.h" -#include "cmGlobalGenerator.h" -#include "cmMakefile.h" -#include "cmOutputConverter.h" -#include "cmState.h" -#include "cmStateDirectory.h" -#include "cmStateTypes.h" -#include "cmSystemTools.h" -#include "cm_auto_ptr.hxx" -#include "cmake.h" - #include #include #include @@ -26,6 +14,17 @@ #include #include +#include "cmAlgorithms.h" +#include "cmFilePathUuid.h" +#include "cmGlobalGenerator.h" +#include "cmMakefile.h" +#include "cmOutputConverter.h" +#include "cmStateDirectory.h" +#include "cmStateSnapshot.h" +#include "cmSystemTools.h" +#include "cm_auto_ptr.hxx" +#include "cmake.h" + #if defined(__APPLE__) #include #endif diff --git a/Source/cmRulePlaceholderExpander.cxx b/Source/cmRulePlaceholderExpander.cxx index 75ac54d..f190a5c 100644 --- a/Source/cmRulePlaceholderExpander.cxx +++ b/Source/cmRulePlaceholderExpander.cxx @@ -2,6 +2,10 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmRulePlaceholderExpander.h" +#include +#include +#include + #include "cmOutputConverter.h" #include "cmSystemTools.h" diff --git a/Source/cmRulePlaceholderExpander.h b/Source/cmRulePlaceholderExpander.h index 444419c..5223ae9 100644 --- a/Source/cmRulePlaceholderExpander.h +++ b/Source/cmRulePlaceholderExpander.h @@ -9,7 +9,6 @@ #include #include -class cmGeneratorTarget; class cmOutputConverter; class cmRulePlaceholderExpander diff --git a/Source/cmSearchPath.cxx b/Source/cmSearchPath.cxx index ff0b836..0df6e0c 100644 --- a/Source/cmSearchPath.cxx +++ b/Source/cmSearchPath.cxx @@ -2,7 +2,9 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmSearchPath.h" +#include #include +#include #include "cmAlgorithms.h" #include "cmFindCommon.h" diff --git a/Source/cmSearchPath.h b/Source/cmSearchPath.h index 80815ed..9ffa871 100644 --- a/Source/cmSearchPath.h +++ b/Source/cmSearchPath.h @@ -5,7 +5,9 @@ #include -#include "cmStandardIncludes.h" +#include +#include +#include class cmFindCommon; diff --git a/Source/cmServer.cxx b/Source/cmServer.cxx index 51a363f..5a71dc0 100644 --- a/Source/cmServer.cxx +++ b/Source/cmServer.cxx @@ -14,6 +14,7 @@ #include "cm_jsoncpp_value.h" #endif +#include #include #include #include diff --git a/Source/cmServerConnection.cxx b/Source/cmServerConnection.cxx index b4af52b..008052b 100644 --- a/Source/cmServerConnection.cxx +++ b/Source/cmServerConnection.cxx @@ -8,6 +8,7 @@ #include "cmServer.h" #include +#include namespace { diff --git a/Source/cmSetCommand.cxx b/Source/cmSetCommand.cxx index e49f142..820e7f6 100644 --- a/Source/cmSetCommand.cxx +++ b/Source/cmSetCommand.cxx @@ -2,7 +2,6 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmSetCommand.h" -#include #include #include "cmAlgorithms.h" diff --git a/Source/cmSourceFile.cxx b/Source/cmSourceFile.cxx index 6f29b18..5c4f18b 100644 --- a/Source/cmSourceFile.cxx +++ b/Source/cmSourceFile.cxx @@ -2,17 +2,16 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmSourceFile.h" +#include + #include "cmCustomCommand.h" #include "cmGlobalGenerator.h" #include "cmMakefile.h" #include "cmProperty.h" #include "cmState.h" -#include "cmStateTypes.h" #include "cmSystemTools.h" #include "cmake.h" -#include - cmSourceFile::cmSourceFile(cmMakefile* mf, const std::string& name) : Location(mf, name) { diff --git a/Source/cmState.cxx b/Source/cmState.cxx index db1e542..6e934e2 100644 --- a/Source/cmState.cxx +++ b/Source/cmState.cxx @@ -2,24 +2,22 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmState.h" -#include "cmStatePrivate.h" +#include +#include +#include +#include +#include #include "cmAlgorithms.h" #include "cmCacheManager.h" #include "cmCommand.h" #include "cmDefinitions.h" #include "cmListFileCache.h" +#include "cmStatePrivate.h" +#include "cmStateSnapshot.h" #include "cmSystemTools.h" #include "cmake.h" -#include -#include -#include -#include -#include -#include -#include - cmState::cmState() : IsInTryCompile(false) , WindowsShell(false) diff --git a/Source/cmState.h b/Source/cmState.h index 6d74815..41ffcdc 100644 --- a/Source/cmState.h +++ b/Source/cmState.h @@ -5,25 +5,22 @@ #include // IWYU pragma: keep -#include "cmAlgorithms.h" +#include +#include +#include +#include + #include "cmDefinitions.h" #include "cmLinkedTree.h" #include "cmProperty.h" #include "cmPropertyDefinitionMap.h" #include "cmPropertyMap.h" +#include "cmStatePrivate.h" #include "cmStateTypes.h" -#include -#include -#include -#include - class cmCacheManager; class cmCommand; -class cmListFileBacktrace; class cmPropertyDefinition; - -class cmStateDirectory; class cmStateSnapshot; class cmState diff --git a/Source/cmStateDirectory.cxx b/Source/cmStateDirectory.cxx index 01e1e7e..46a1858 100644 --- a/Source/cmStateDirectory.cxx +++ b/Source/cmStateDirectory.cxx @@ -2,8 +2,18 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmStateDirectory.h" + +#include +#include +#include +#include +#include + +#include "cmProperty.h" +#include "cmPropertyMap.h" #include "cmState.h" #include "cmStatePrivate.h" +#include "cmStateTypes.h" #include "cmSystemTools.h" static std::string const kBINARY_DIR = "BINARY_DIR"; diff --git a/Source/cmStateDirectory.h b/Source/cmStateDirectory.h index 17a89d8..8accc8e 100644 --- a/Source/cmStateDirectory.h +++ b/Source/cmStateDirectory.h @@ -10,9 +10,10 @@ #include #include "cmAlgorithms.h" +#include "cmLinkedTree.h" #include "cmListFileCache.h" +#include "cmStatePrivate.h" #include "cmStateSnapshot.h" -#include "cmStateTypes.h" class cmStateDirectory { diff --git a/Source/cmStatePrivate.h b/Source/cmStatePrivate.h index 8daa3cf..20700f2 100644 --- a/Source/cmStatePrivate.h +++ b/Source/cmStatePrivate.h @@ -12,9 +12,16 @@ #include "cmDefinitions.h" #include "cmLinkedTree.h" #include "cmListFileCache.h" +#include "cmPolicies.h" #include "cmPropertyMap.h" +#include "cmStateSnapshot.h" #include "cmStateTypes.h" +namespace cmStateDetail { +struct BuildsystemDirectoryStateType; +struct PolicyStackEntry; +} // namespace cmStateDetail + static const std::string cmPropertySentinal = std::string(); struct cmStateDetail::SnapshotDataType diff --git a/Source/cmStateSnapshot.cxx b/Source/cmStateSnapshot.cxx index 7f86221..c6288a5 100644 --- a/Source/cmStateSnapshot.cxx +++ b/Source/cmStateSnapshot.cxx @@ -3,13 +3,25 @@ #include "cmStateSnapshot.h" +#include +#include +#include +#include + +#include "cmAlgorithms.h" +#include "cmDefinitions.h" +#include "cmListFileCache.h" +#include "cmPropertyMap.h" #include "cmState.h" #include "cmStateDirectory.h" #include "cmStatePrivate.h" -#include "cmSystemTools.h" #include "cmVersion.h" #include "cmake.h" +#if defined(__CYGWIN__) +#include "cmSystemTools.h" +#endif + cmStateSnapshot::cmStateSnapshot(cmState* state) : State(state) , Position() diff --git a/Source/cmStateSnapshot.h b/Source/cmStateSnapshot.h index 63b581d..72d0349 100644 --- a/Source/cmStateSnapshot.h +++ b/Source/cmStateSnapshot.h @@ -6,10 +6,10 @@ #include // IWYU pragma: keep -#include #include #include +#include "cmLinkedTree.h" #include "cmPolicies.h" #include "cmStateTypes.h" diff --git a/Source/cmStateTypes.h b/Source/cmStateTypes.h index 75f9e60..2c974c1 100644 --- a/Source/cmStateTypes.h +++ b/Source/cmStateTypes.h @@ -4,12 +4,12 @@ #ifndef cmStateTypes_h #define cmStateTypes_h +#include // IWYU pragma: keep + #include "cmLinkedTree.h" namespace cmStateDetail { -struct BuildsystemDirectoryStateType; struct SnapshotDataType; -struct PolicyStackEntry; typedef cmLinkedTree::iterator PositionType; } diff --git a/Source/cmStringCommand.cxx b/Source/cmStringCommand.cxx index 512bc91..f835445 100644 --- a/Source/cmStringCommand.cxx +++ b/Source/cmStringCommand.cxx @@ -2,7 +2,6 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmStringCommand.h" -#include #include #include #include diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h index 9817a3c..0801f26 100644 --- a/Source/cmSystemTools.h +++ b/Source/cmSystemTools.h @@ -11,6 +11,12 @@ #include #include +#if defined(_MSC_VER) +typedef unsigned short mode_t; +#else +#include +#endif + class cmSystemToolsFileTime; /** \class cmSystemTools diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 25ae339..dabdda5 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -2,6 +2,14 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmTarget.h" +#include +#include +#include +#include +#include +#include +#include + #include "cmAlgorithms.h" #include "cmGeneratorExpression.h" #include "cmGeneratorTarget.h" @@ -14,19 +22,13 @@ #include "cmSourceFile.h" #include "cmSourceFileLocation.h" #include "cmState.h" +#include "cmStateDirectory.h" +#include "cmStateSnapshot.h" #include "cmSystemTools.h" #include "cmTargetPropertyComputer.h" #include "cm_unordered_set.hxx" #include "cmake.h" -#include -#include -#include -#include -#include -#include -#include - template <> const char* cmTargetPropertyComputer::ComputeLocationForBuild( cmTarget const* tgt) diff --git a/Source/cmTarget.h b/Source/cmTarget.h index 1f035a1..57ef8d2 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -5,6 +5,13 @@ #include // IWYU pragma: keep +#include +#include +#include +#include +#include +#include + #include "cmAlgorithms.h" #include "cmCustomCommand.h" #include "cmListFileCache.h" @@ -14,16 +21,10 @@ #include "cmTargetLinkLibraryType.h" #include "cm_unordered_map.hxx" -#include -#include -#include -#include -#include -#include - +class cmGlobalGenerator; class cmMakefile; +class cmMessenger; class cmSourceFile; -class cmGlobalGenerator; class cmTargetInternals; class cmTargetInternalPointer diff --git a/Source/cmTargetCompileFeaturesCommand.cxx b/Source/cmTargetCompileFeaturesCommand.cxx index a1c9b82..1b6c008 100644 --- a/Source/cmTargetCompileFeaturesCommand.cxx +++ b/Source/cmTargetCompileFeaturesCommand.cxx @@ -2,7 +2,6 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmTargetCompileFeaturesCommand.h" -#include #include #include "cmAlgorithms.h" diff --git a/Source/cmTargetCompileOptionsCommand.cxx b/Source/cmTargetCompileOptionsCommand.cxx index a4db55b..1b4056d 100644 --- a/Source/cmTargetCompileOptionsCommand.cxx +++ b/Source/cmTargetCompileOptionsCommand.cxx @@ -2,7 +2,6 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmTargetCompileOptionsCommand.h" -#include #include #include "cmAlgorithms.h" diff --git a/Source/cmTargetDepend.h b/Source/cmTargetDepend.h index acea6ea..a953efb 100644 --- a/Source/cmTargetDepend.h +++ b/Source/cmTargetDepend.h @@ -3,9 +3,9 @@ #ifndef cmTargetDepend_h #define cmTargetDepend_h -#include +#include // IWYU pragma: keep -#include "cmStandardIncludes.h" +#include class cmGeneratorTarget; diff --git a/Source/cmTargetExport.h b/Source/cmTargetExport.h index 634148b..b08ede2 100644 --- a/Source/cmTargetExport.h +++ b/Source/cmTargetExport.h @@ -3,13 +3,13 @@ #ifndef cmTargetExport_h #define cmTargetExport_h -#include +#include // IWYU pragma: keep -#include "cmStandardIncludes.h" +#include class cmGeneratorTarget; -class cmInstallTargetGenerator; class cmInstallFilesGenerator; +class cmInstallTargetGenerator; /** \brief A member of an ExportSet * diff --git a/Source/cmTargetPropCommandBase.cxx b/Source/cmTargetPropCommandBase.cxx index 7aba0f8..9a5c1da 100644 --- a/Source/cmTargetPropCommandBase.cxx +++ b/Source/cmTargetPropCommandBase.cxx @@ -4,6 +4,9 @@ #include "cmGlobalGenerator.h" #include "cmMakefile.h" +#include "cmStateTypes.h" +#include "cmTarget.h" +#include "cmake.h" bool cmTargetPropCommandBase::HandleArguments( std::vector const& args, const std::string& prop, diff --git a/Source/cmTargetPropCommandBase.h b/Source/cmTargetPropCommandBase.h index 485a7f3..8b49653 100644 --- a/Source/cmTargetPropCommandBase.h +++ b/Source/cmTargetPropCommandBase.h @@ -3,6 +3,11 @@ #ifndef cmTargetPropCommandBase_h #define cmTargetPropCommandBase_h +#include // IWYU pragma: keep + +#include +#include + #include "cmCommand.h" class cmTarget; diff --git a/Source/cmTargetPropertyComputer.cxx b/Source/cmTargetPropertyComputer.cxx index 7cf1fd8..04931af 100644 --- a/Source/cmTargetPropertyComputer.cxx +++ b/Source/cmTargetPropertyComputer.cxx @@ -3,14 +3,13 @@ #include "cmTargetPropertyComputer.h" -#include "cmGeneratorTarget.h" -#include "cmGlobalGenerator.h" -#include "cmMakefile.h" +#include + #include "cmMessenger.h" -#include "cmSourceFile.h" -#include "cmSourceFileLocation.h" -#include "cmTarget.h" +#include "cmPolicies.h" +#include "cmStateSnapshot.h" #include "cm_unordered_set.hxx" +#include "cmake.h" bool cmTargetPropertyComputer::HandleLocationPropertyPolicy( std::string const& tgtName, cmMessenger* messenger, diff --git a/Source/cmTargetPropertyComputer.h b/Source/cmTargetPropertyComputer.h index 7989589..45d31be 100644 --- a/Source/cmTargetPropertyComputer.h +++ b/Source/cmTargetPropertyComputer.h @@ -5,14 +5,13 @@ #include // IWYU pragma: keep +#include + #include "cmAlgorithms.h" #include "cmListFileCache.h" +#include "cmStateTypes.h" #include "cmSystemTools.h" -#include -#include - -class cmTarget; class cmMessenger; class cmTargetPropertyComputer diff --git a/Source/cmTargetSourcesCommand.cxx b/Source/cmTargetSourcesCommand.cxx index 13c9a8f..058659a 100644 --- a/Source/cmTargetSourcesCommand.cxx +++ b/Source/cmTargetSourcesCommand.cxx @@ -2,7 +2,6 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmTargetSourcesCommand.h" -#include #include #include "cmAlgorithms.h" diff --git a/Source/cmTest.cxx b/Source/cmTest.cxx index 1c36dc6..4d0cbaa 100644 --- a/Source/cmTest.cxx +++ b/Source/cmTest.cxx @@ -5,7 +5,6 @@ #include "cmMakefile.h" #include "cmProperty.h" #include "cmState.h" -#include "cmStateTypes.h" #include "cmSystemTools.h" cmTest::cmTest(cmMakefile* mf) diff --git a/Source/cmTestGenerator.cxx b/Source/cmTestGenerator.cxx index 843f7b1..4164f3a 100644 --- a/Source/cmTestGenerator.cxx +++ b/Source/cmTestGenerator.cxx @@ -2,6 +2,10 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmTestGenerator.h" +#include +#include +#include + #include "cmGeneratorExpression.h" #include "cmGeneratorTarget.h" #include "cmLocalGenerator.h" @@ -11,11 +15,6 @@ #include "cmStateTypes.h" #include "cmSystemTools.h" #include "cmTest.h" -#include "cm_auto_ptr.hxx" - -#include -#include -#include cmTestGenerator::cmTestGenerator( cmTest* test, std::vector const& configurations) diff --git a/Source/cmTimestamp.cxx b/Source/cmTimestamp.cxx index 9597e09..589f195 100644 --- a/Source/cmTimestamp.cxx +++ b/Source/cmTimestamp.cxx @@ -2,15 +2,11 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmTimestamp.h" -#include "cmSystemTools.h" - -#include +#include #include #include -#include -// include sys/stat.h after sys/types.h -#include +#include "cmSystemTools.h" std::string cmTimestamp::CurrentTime(const std::string& formatString, bool utcFlag) diff --git a/Source/cmTimestamp.h b/Source/cmTimestamp.h index 44e397b..fdee564 100644 --- a/Source/cmTimestamp.h +++ b/Source/cmTimestamp.h @@ -3,9 +3,7 @@ #ifndef cmTimestamp_h #define cmTimestamp_h -#include - -#include "cmStandardIncludes.h" +#include // IWYU pragma: keep #include #include diff --git a/Source/cm_codecvt.hxx b/Source/cm_codecvt.hxx index 5f16bd8..fcd9954 100644 --- a/Source/cm_codecvt.hxx +++ b/Source/cm_codecvt.hxx @@ -3,10 +3,11 @@ #ifndef cm_codecvt_hxx #define cm_codecvt_hxx -#include // IWYU pragma: keep +#include #include #include +#include class codecvt : public std::codecvt { diff --git a/Source/cmake.cxx b/Source/cmake.cxx index eb76ca0..6c066c6 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -17,6 +17,7 @@ #include "cmMakefile.h" #include "cmMessenger.h" #include "cmState.h" +#include "cmStateDirectory.h" #include "cmSystemTools.h" #include "cmTarget.h" #include "cmTargetLinkLibraryType.h" @@ -25,11 +26,11 @@ #include "cm_auto_ptr.hxx" #if defined(CMAKE_BUILD_WITH_CMAKE) +#include + #include "cmGraphVizWriter.h" #include "cmVariableWatch.h" #include "cm_unordered_map.hxx" - -#include #endif // only build kdevelop generator on non-windows platforms diff --git a/Source/cmake.h b/Source/cmake.h index 6e8d9c8..0f1891d 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -5,17 +5,18 @@ #include -#include "cmInstalledFile.h" -#include "cmListFileCache.h" -#include "cmStateSnapshot.h" - #include #include #include #include +#include "cmInstalledFile.h" +#include "cmListFileCache.h" +#include "cmStateSnapshot.h" +#include "cmStateTypes.h" + #if defined(CMAKE_BUILD_WITH_CMAKE) -#include "cm_jsoncpp_value.h" +#include #endif class cmExternalMakefileProjectGeneratorFactory; @@ -24,6 +25,7 @@ class cmGlobalGenerator; class cmGlobalGeneratorFactory; class cmMakefile; class cmMessenger; +class cmState; class cmVariableWatch; struct cmDocumentationEntry; diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx index 44af966..a974061 100644 --- a/Source/cmakemain.cxx +++ b/Source/cmakemain.cxx @@ -12,6 +12,7 @@ #include "cmGlobalGenerator.h" #include "cmMakefile.h" #include "cmState.h" +#include "cmStateTypes.h" #include "cmSystemTools.h" #include "cmake.h" #include "cmcmd.h" diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx index c008791..1db147a 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -8,6 +8,7 @@ #include "cmMakefile.h" #include "cmQtAutoGenerators.h" #include "cmStateDirectory.h" +#include "cmStateSnapshot.h" #include "cmSystemTools.h" #include "cmUtils.hxx" #include "cmVersion.h" ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Tue Nov 8 09:44:33 2016 From: brad.king at kitware.com (Brad King) Date: Tue, 8 Nov 2016 09:44:33 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.7.0-rc3-431-g69bb9f3 Message-ID: <20161108144433.7C4BBF8A8D@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 69bb9f37f9b71a109ef9547af25144e207f116e4 (commit) via 80e477239dc3a57f87f9efb7b1d78eb0f0e2b6a3 (commit) from 48910cf0968a4c5b4ffd9093972498920404685f (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=69bb9f37f9b71a109ef9547af25144e207f116e4 commit 69bb9f37f9b71a109ef9547af25144e207f116e4 Merge: 48910cf 80e4772 Author: Brad King AuthorDate: Tue Nov 8 09:44:31 2016 -0500 Commit: CMake Topic Stage CommitDate: Tue Nov 8 09:44:31 2016 -0500 Merge topic 'FortranCInterface-pic' 80e47723 FortranCInterface: Make mangling detection robust to PIC Fortran ----------------------------------------------------------------------- Summary of changes: Modules/FortranCInterface/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) hooks/post-receive -- CMake From brad.king at kitware.com Tue Nov 8 09:44:36 2016 From: brad.king at kitware.com (Brad King) Date: Tue, 8 Nov 2016 09:44:36 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.7.0-rc3-436-g049b10e Message-ID: <20161108144436.F3699F8A8D@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 049b10e2f621800f0b8da1918784dad7a049d6a8 (commit) via b34c045736384fc3ba8574b33211bd75082bc07b (commit) via cd0423300bea21a5c0747a6aeaefbae24c10ecd8 (commit) via 228280d8334f2bcac346e5f0d3ea802af7f22862 (commit) via d8e83ab979b0ccfc4887dbf48c088a72dffb2e96 (commit) from 69bb9f37f9b71a109ef9547af25144e207f116e4 (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=049b10e2f621800f0b8da1918784dad7a049d6a8 commit 049b10e2f621800f0b8da1918784dad7a049d6a8 Merge: 69bb9f3 b34c045 Author: Brad King AuthorDate: Tue Nov 8 09:44:34 2016 -0500 Commit: CMake Topic Stage CommitDate: Tue Nov 8 09:44:34 2016 -0500 Merge topic 'cpack-rpm-omit-unsupported-tags' b34c0457 Release text for omitting unsupported tags topic cd042330 CPack/RPM test for Suggests tag 228280d8 CPack/RPM prevent special tags from being removed d8e83ab9 CPack/RPM omit unsupported tags ----------------------------------------------------------------------- Summary of changes: .../dev/cpack-rpm-omit-unsupported-tags.rst | 8 +++++ Modules/CPackRPM.cmake | 24 +++++++++++++++ ...iles.cmake => RPM_SUGGESTS-ExpectedFiles.cmake} | 2 +- .../CPack/RPM/RPM_SUGGESTS-VerifyResult.cmake | 31 ++++++++++++++++++++ Tests/RunCMake/CPack/RPM_SUGGESTS.cmake | 4 +++ Tests/RunCMake/CPack/RunCMakeTest.cmake | 1 + 6 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 Help/release/dev/cpack-rpm-omit-unsupported-tags.rst copy Tests/RunCMake/CPack/RPM/{MINIMAL-ExpectedFiles.cmake => RPM_SUGGESTS-ExpectedFiles.cmake} (77%) create mode 100644 Tests/RunCMake/CPack/RPM/RPM_SUGGESTS-VerifyResult.cmake create mode 100644 Tests/RunCMake/CPack/RPM_SUGGESTS.cmake hooks/post-receive -- CMake From brad.king at kitware.com Tue Nov 8 09:44:39 2016 From: brad.king at kitware.com (Brad King) Date: Tue, 8 Nov 2016 09:44:39 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.7.0-rc3-442-g4ec359b Message-ID: <20161108144439.C0796F8B01@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 4ec359bd6256e870d9b233fd5cd105e452a62300 (commit) via 0cd654c8e23b19311bae876ada4ad5b432c1ad1b (commit) via bac93dcf192d8680cd72570682d6593da9818088 (commit) via 1e994985d83b09d71b4928a61a75d1cf3861aaec (commit) via 5ae3966d75593b05a9658af8d2fdd47c2bf48a4d (commit) via 443180fb9915eefe0b232875505632ffb9fabb95 (commit) from 049b10e2f621800f0b8da1918784dad7a049d6a8 (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=4ec359bd6256e870d9b233fd5cd105e452a62300 commit 4ec359bd6256e870d9b233fd5cd105e452a62300 Merge: 049b10e 0cd654c Author: Brad King AuthorDate: Tue Nov 8 09:44:37 2016 -0500 Commit: CMake Topic Stage CommitDate: Tue Nov 8 09:44:37 2016 -0500 Merge topic 'clang-tidy' 0cd654c8 cmGeneratorTarget: Correctly set FortranModuleDirectoryCreated bac93dcf cmGeneratorTarget: Don't assing a bool to a string 1e994985 cmGlobalNinjaGenerator: Suppress clang-tidy warning 5ae3966d cmCTestSubmitHandler: Remove redundant c_str() 443180fb cmCPluginAPI: Fix clang-tidy findings ----------------------------------------------------------------------- Summary of changes: Source/CTest/cmCTestSubmitHandler.cxx | 2 +- Source/cmCPluginAPI.cxx | 8 ++++---- Source/cmGeneratorTarget.cxx | 2 +- Source/cmGlobalNinjaGenerator.cxx | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Tue Nov 8 09:44:42 2016 From: brad.king at kitware.com (Brad King) Date: Tue, 8 Nov 2016 09:44:42 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.7.0-rc3-444-g666bb0e Message-ID: <20161108144442.B17B9F8B4E@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 666bb0e3fa0d212c03f785bd9f6bc05d29925e1f (commit) via 2e620f0b3834e5a612a38d61b7e50a561d7f11e8 (commit) from 4ec359bd6256e870d9b233fd5cd105e452a62300 (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=666bb0e3fa0d212c03f785bd9f6bc05d29925e1f commit 666bb0e3fa0d212c03f785bd9f6bc05d29925e1f Merge: 4ec359b 2e620f0 Author: Brad King AuthorDate: Tue Nov 8 09:44:40 2016 -0500 Commit: CMake Topic Stage CommitDate: Tue Nov 8 09:44:40 2016 -0500 Merge topic 'include-what-you-use' 2e620f0b Fix several include-what-you-use findings ----------------------------------------------------------------------- Summary of changes: Source/CTest/cmCTestScriptHandler.cxx | 1 + Source/QtDialog/CMakeSetup.cxx | 2 ++ Source/cmAlgorithms.h | 14 ++++++-- Source/cmCMakeMinimumRequired.cxx | 6 ++++ Source/cmCMakeMinimumRequired.h | 6 ++++ Source/cmCTest.cxx | 45 ++++++++++++------------ Source/cmCacheManager.cxx | 11 +++--- Source/cmCacheManager.h | 6 ++-- Source/cmCommandArgumentsHelper.h | 6 ++-- Source/cmCommonTargetGenerator.cxx | 3 +- Source/cmCommonTargetGenerator.h | 5 +-- Source/cmConditionEvaluator.cxx | 12 ++++++- Source/cmConditionEvaluator.h | 10 ++++-- Source/cmCoreTryCompile.cxx | 14 ++++++-- Source/cmCoreTryCompile.h | 5 +++ Source/cmCreateTestSourceList.cxx | 4 +++ Source/cmCreateTestSourceList.h | 7 ++++ Source/cmDefinitions.cxx | 1 + Source/cmDefinitions.h | 8 ++--- Source/cmDependsC.cxx | 7 ++-- Source/cmDependsFortran.cxx | 17 ++++----- Source/cmDependsJavaParserHelper.h | 2 ++ Source/cmExecutionStatus.h | 4 --- Source/cmExpandedCommandArgument.h | 4 +-- Source/cmExportBuildAndroidMKGenerator.cxx | 18 +++++++--- Source/cmExportBuildAndroidMKGenerator.h | 10 ++++-- Source/cmExportInstallAndroidMKGenerator.cxx | 11 +++--- Source/cmExportInstallAndroidMKGenerator.h | 10 +++++- Source/cmExtraCodeBlocksGenerator.cxx | 11 +++--- Source/cmExtraEclipseCDT4Generator.cxx | 17 +++++---- Source/cmExtraSublimeTextGenerator.cxx | 14 ++++---- Source/cmFileCommand.cxx | 1 + Source/cmFileTimeComparison.cxx | 1 - Source/cmFindBase.cxx | 6 ++++ Source/cmFindBase.h | 5 +++ Source/cmFindCommon.cxx | 7 ++-- Source/cmFindCommon.h | 9 +++++ Source/cmFunctionBlocker.h | 7 ++-- Source/cmFunctionCommand.cxx | 1 - Source/cmGeneratedFileStream.cxx | 5 +-- Source/cmGeneratorExpression.cxx | 7 ++-- Source/cmGeneratorExpressionEvaluationFile.cxx | 11 +++--- Source/cmGeneratorExpressionEvaluationFile.h | 13 ++++--- Source/cmGeneratorTarget.cxx | 22 ++++++------ Source/cmGetCMakePropertyCommand.cxx | 1 - Source/cmGlobalBorlandMakefileGenerator.cxx | 1 + Source/cmGlobalGenerator.cxx | 21 +++++------ Source/cmGlobalGenerator.h | 22 ++++++------ Source/cmGlobalGeneratorFactory.h | 7 ++-- Source/cmGlobalJOMMakefileGenerator.cxx | 1 + Source/cmGlobalMSYSMakefileGenerator.cxx | 4 ++- Source/cmGlobalMinGWMakefileGenerator.cxx | 1 + Source/cmGlobalNMakeMakefileGenerator.cxx | 1 + Source/cmGlobalNinjaGenerator.cxx | 24 ++++++++----- Source/cmGlobalNinjaGenerator.h | 22 +++++++----- Source/cmGlobalUnixMakefileGenerator3.cxx | 11 +++--- Source/cmGlobalUnixMakefileGenerator3.h | 10 +++--- Source/cmGlobalWatcomWMakeGenerator.cxx | 1 - Source/cmGraphAdjacencyList.h | 4 +-- Source/cmGraphVizWriter.cxx | 11 +++--- Source/cmHexFileConverter.cxx | 5 +-- Source/cmHexFileConverter.h | 4 --- Source/cmInstallCommand.cxx | 1 - Source/cmInstallCommandArguments.cxx | 2 ++ Source/cmInstallCommandArguments.h | 5 +-- Source/cmInstallTargetGenerator.cxx | 13 ++++--- Source/cmLinkItem.h | 8 +++++ Source/cmLinkLineComputer.cxx | 5 +++ Source/cmLinkLineComputer.h | 4 +++ Source/cmLinkedTree.h | 4 +-- Source/cmLocalCommonGenerator.cxx | 5 +-- Source/cmLocalCommonGenerator.h | 5 ++- Source/cmLocalGenerator.cxx | 3 +- Source/cmLocalGenerator.h | 19 +++++----- Source/cmLocalNinjaGenerator.cxx | 15 ++++---- Source/cmLocalNinjaGenerator.h | 10 +++--- Source/cmLocalUnixMakefileGenerator3.cxx | 19 +++++----- Source/cmLocale.h | 2 -- Source/cmMSVC60LinkLineComputer.cxx | 6 ++++ Source/cmMSVC60LinkLineComputer.h | 7 ++++ Source/cmMacroCommand.cxx | 1 - Source/cmMakefile.cxx | 28 +++++++-------- Source/cmMakefile.h | 20 +++++------ Source/cmMakefileExecutableTargetGenerator.cxx | 11 +++--- Source/cmMakefileLibraryTargetGenerator.cxx | 11 ++++-- Source/cmMakefileTargetGenerator.cxx | 14 ++++---- Source/cmMakefileTargetGenerator.h | 12 ++++--- Source/cmMakefileUtilityTargetGenerator.cxx | 10 +++--- Source/cmMessageCommand.cxx | 2 -- Source/cmNinjaLinkLineComputer.cxx | 4 +++ Source/cmNinjaLinkLineComputer.h | 7 +++- Source/cmNinjaNormalTargetGenerator.cxx | 21 ++++++----- Source/cmNinjaTargetGenerator.cxx | 19 +++++----- Source/cmNinjaTypes.h | 6 ++-- Source/cmOptionCommand.cxx | 2 -- Source/cmOutputConverter.cxx | 11 +++--- Source/cmOutputConverter.h | 6 ++-- Source/cmParseArgumentsCommand.cxx | 1 - Source/cmPathLabel.cxx | 2 ++ Source/cmPathLabel.h | 4 +-- Source/cmQtAutoGeneratorInitializer.cxx | 2 -- Source/cmQtAutoGenerators.cxx | 23 ++++++------ Source/cmRulePlaceholderExpander.cxx | 4 +++ Source/cmRulePlaceholderExpander.h | 1 - Source/cmSearchPath.cxx | 2 ++ Source/cmSearchPath.h | 4 ++- Source/cmServer.cxx | 1 + Source/cmServerConnection.cxx | 1 + Source/cmSetCommand.cxx | 1 - Source/cmSourceFile.cxx | 5 ++- Source/cmState.cxx | 16 ++++----- Source/cmState.h | 15 ++++---- Source/cmStateDirectory.cxx | 10 ++++++ Source/cmStateDirectory.h | 3 +- Source/cmStatePrivate.h | 7 ++++ Source/cmStateSnapshot.cxx | 14 +++++++- Source/cmStateSnapshot.h | 2 +- Source/cmStateTypes.h | 4 +-- Source/cmStringCommand.cxx | 1 - Source/cmSystemTools.h | 6 ++++ Source/cmTarget.cxx | 18 +++++----- Source/cmTarget.h | 17 ++++----- Source/cmTargetCompileFeaturesCommand.cxx | 1 - Source/cmTargetCompileOptionsCommand.cxx | 1 - Source/cmTargetDepend.h | 4 +-- Source/cmTargetExport.h | 6 ++-- Source/cmTargetPropCommandBase.cxx | 3 ++ Source/cmTargetPropCommandBase.h | 5 +++ Source/cmTargetPropertyComputer.cxx | 11 +++--- Source/cmTargetPropertyComputer.h | 7 ++-- Source/cmTargetSourcesCommand.cxx | 1 - Source/cmTest.cxx | 1 - Source/cmTestGenerator.cxx | 9 +++-- Source/cmTimestamp.cxx | 8 ++--- Source/cmTimestamp.h | 4 +-- Source/cm_codecvt.hxx | 3 +- Source/cmake.cxx | 5 +-- Source/cmake.h | 12 ++++--- Source/cmakemain.cxx | 1 + Source/cmcmd.cxx | 1 + 140 files changed, 660 insertions(+), 442 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Tue Nov 8 09:45:05 2016 From: brad.king at kitware.com (Brad King) Date: Tue, 8 Nov 2016 09:45:05 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.7.0-rc3-960-ga5b31cd Message-ID: <20161108144505.4DD87F8A8D@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, next has been updated via a5b31cdac6050fa034285a7aab63c1534c9b003e (commit) via 666bb0e3fa0d212c03f785bd9f6bc05d29925e1f (commit) via 4ec359bd6256e870d9b233fd5cd105e452a62300 (commit) via 049b10e2f621800f0b8da1918784dad7a049d6a8 (commit) via 69bb9f37f9b71a109ef9547af25144e207f116e4 (commit) via 48910cf0968a4c5b4ffd9093972498920404685f (commit) via 9df1cb0fa68869f8125025f20fa8c64467aab2e8 (commit) via d568cecf38a6a4b399c925fd3553dd4a273d0af1 (commit) from ddb04ebae16819485e7c4150250bb17c47fd0358 (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=a5b31cdac6050fa034285a7aab63c1534c9b003e commit a5b31cdac6050fa034285a7aab63c1534c9b003e Merge: ddb04eb 666bb0e Author: Brad King AuthorDate: Tue Nov 8 09:44:56 2016 -0500 Commit: Brad King CommitDate: Tue Nov 8 09:44:56 2016 -0500 Merge branch 'master' into next ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Tue Nov 8 09:48:20 2016 From: brad.king at kitware.com (Brad King) Date: Tue, 8 Nov 2016 09:48:20 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.7.0-rc3-962-gb40c0bb Message-ID: <20161108144820.5B80FF8FAC@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, next has been updated via b40c0bb7fa48d84edf00c1468b1ae17031d9e716 (commit) via 61898de64180ce8123219f5e6450cb8375840045 (commit) from a5b31cdac6050fa034285a7aab63c1534c9b003e (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=b40c0bb7fa48d84edf00c1468b1ae17031d9e716 commit b40c0bb7fa48d84edf00c1468b1ae17031d9e716 Merge: a5b31cd 61898de Author: Brad King AuthorDate: Tue Nov 8 09:48:19 2016 -0500 Commit: CMake Topic Stage CommitDate: Tue Nov 8 09:48:19 2016 -0500 Merge topic 'pkgconfig_imported_target' into next 61898de6 PkgConfig: Fix FindPkgConfig imported target feature https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=61898de64180ce8123219f5e6450cb8375840045 commit 61898de64180ce8123219f5e6450cb8375840045 Author: Florent Castelli AuthorDate: Fri Nov 4 23:35:27 2016 +0100 Commit: Florent Castelli CommitDate: Fri Nov 4 23:35:27 2016 +0100 PkgConfig: Fix FindPkgConfig imported target feature The options to the find_library call to create the imported target used a literal string "HINTS /path NO_DEFAULT_PATH" instead of a list of options. This resulted in never finding any library in my testing. diff --git a/Modules/FindPkgConfig.cmake b/Modules/FindPkgConfig.cmake index 072a27a..3f75b19 100644 --- a/Modules/FindPkgConfig.cmake +++ b/Modules/FindPkgConfig.cmake @@ -193,7 +193,7 @@ function(_pkg_create_imp_target _prefix _no_cmake_path _no_cmake_environment_pat foreach (flag IN LISTS ${_prefix}_LDFLAGS) if (flag MATCHES "^-L(.*)") # only look into the given paths from now on - set(_find_opts "HINTS ${${CMAKE_MATCH_1}} NO_DEFAULT_PATH") + set(_find_opts HINTS ${CMAKE_MATCH_1} NO_DEFAULT_PATH) continue() endif() if (flag MATCHES "^-l(.*)") ----------------------------------------------------------------------- Summary of changes: Modules/FindPkgConfig.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Tue Nov 8 09:53:31 2016 From: brad.king at kitware.com (Brad King) Date: Tue, 8 Nov 2016 09:53:31 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.7.0-rc3-964-gedca8b6 Message-ID: <20161108145331.50E8DF919E@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, next has been updated via edca8b6c81cee13aeb8bb2b14d4d3c4e79f11342 (commit) via f18b18b72b8f7f8dc21e350f4dd1c6931cdb389f (commit) from b40c0bb7fa48d84edf00c1468b1ae17031d9e716 (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=edca8b6c81cee13aeb8bb2b14d4d3c4e79f11342 commit edca8b6c81cee13aeb8bb2b14d4d3c4e79f11342 Merge: b40c0bb f18b18b Author: Brad King AuthorDate: Tue Nov 8 09:53:30 2016 -0500 Commit: CMake Topic Stage CommitDate: Tue Nov 8 09:53:30 2016 -0500 Merge topic 'FindSDL_preventGrowingCacheVar' into next f18b18b7 FindSDL: Prevent unbounded growth of SDL_LIBRARY_TEMP variable https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f18b18b72b8f7f8dc21e350f4dd1c6931cdb389f commit f18b18b72b8f7f8dc21e350f4dd1c6931cdb389f Author: Craig Scott AuthorDate: Sun Nov 6 17:37:54 2016 +1100 Commit: Brad King CommitDate: Tue Nov 8 09:52:55 2016 -0500 FindSDL: Prevent unbounded growth of SDL_LIBRARY_TEMP variable Just modify the cache var property rather than using set() to hide it. Otherwise the set() includes other values added to the temporary list. Closes: #16406 diff --git a/Modules/FindSDL.cmake b/Modules/FindSDL.cmake index 4e4411f..3410018 100644 --- a/Modules/FindSDL.cmake +++ b/Modules/FindSDL.cmake @@ -94,6 +94,11 @@ find_library(SDL_LIBRARY_TEMP PATH_SUFFIXES lib ${VC_LIB_PATH_SUFFIX} ) +# Hide this cache variable from the user, it's an internal implementation +# detail. The documented library variable for the user is SDL_LIBRARY +# which is derived from SDL_LIBRARY_TEMP further below. +set_property(CACHE SDL_LIBRARY_TEMP PROPERTY TYPE INTERNAL) + if(NOT SDL_BUILDING_LIBRARY) if(NOT SDL_INCLUDE_DIR MATCHES ".framework") # Non-OS X framework versions expect you to also dynamically link to @@ -162,8 +167,6 @@ if(SDL_LIBRARY_TEMP) # Set the final string here so the GUI reflects the final state. set(SDL_LIBRARY ${SDL_LIBRARY_TEMP} CACHE STRING "Where the SDL Library can be found") - # Set the temp variable to INTERNAL so it is not seen in the CMake GUI - set(SDL_LIBRARY_TEMP "${SDL_LIBRARY_TEMP}" CACHE INTERNAL "") endif() if(SDL_INCLUDE_DIR AND EXISTS "${SDL_INCLUDE_DIR}/SDL_version.h") ----------------------------------------------------------------------- Summary of changes: Modules/FindSDL.cmake | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Tue Nov 8 10:06:30 2016 From: brad.king at kitware.com (Brad King) Date: Tue, 8 Nov 2016 10:06:30 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.7.0-rc3-966-g38ec4b1 Message-ID: <20161108150630.750D6F9477@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, next has been updated via 38ec4b15d232f45124fe290accc773284b99a679 (commit) via 25cd3e21e86cefa0da6eac0ab54a3adc2d01fb72 (commit) from edca8b6c81cee13aeb8bb2b14d4d3c4e79f11342 (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=38ec4b15d232f45124fe290accc773284b99a679 commit 38ec4b15d232f45124fe290accc773284b99a679 Merge: edca8b6 25cd3e2 Author: Brad King AuthorDate: Tue Nov 8 10:06:29 2016 -0500 Commit: CMake Topic Stage CommitDate: Tue Nov 8 10:06:29 2016 -0500 Merge topic 'ExternalProject-GIT_CONFIG' into next 25cd3e21 ExternalProject: Allow passing config flags to git clone https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=25cd3e21e86cefa0da6eac0ab54a3adc2d01fb72 commit 25cd3e21e86cefa0da6eac0ab54a3adc2d01fb72 Author: Christian Fetzer AuthorDate: Mon Nov 7 21:53:23 2016 +0100 Commit: Brad King CommitDate: Tue Nov 8 09:57:32 2016 -0500 ExternalProject: Allow passing config flags to git clone Add a `GIT_CONFIG` parameter that allows to specify `--config` flags that are passed to the git clone command. This can be used to specify for example `core.autocrlf=true`. diff --git a/Help/release/dev/ExternalProject-GIT_CONFIG.rst b/Help/release/dev/ExternalProject-GIT_CONFIG.rst new file mode 100644 index 0000000..0702c55 --- /dev/null +++ b/Help/release/dev/ExternalProject-GIT_CONFIG.rst @@ -0,0 +1,5 @@ +ExternalProject-GIT_CONFIG +-------------------------- + +* The :module:`ExternalProject` module gained a ``GIT_CONFIG`` option + to pass ``git -c`` options when cloning. diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake index 1e0be09..84d5d1a 100644 --- a/Modules/ExternalProject.cmake +++ b/Modules/ExternalProject.cmake @@ -73,6 +73,10 @@ Create custom targets to build projects in external trees does not output anything which can make the build appear to have stalled. This option forces Git to output progress information during the clone step so that forward progress is indicated. + ``GIT_CONFIG