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 cb165b8b79c96a3ff6db12cb1821cfa2c0c4cce5 (commit) via a269c77edb7c9d55efa1fbac46ed84173a7dcbc9 (commit) via 13ea5f06fad9bd9645cf4fb768e476dd7a053dd1 (commit) via 3521e3d524447f0f3ac20f8e2df2435dd6de7aa2 (commit) via 153226a1471d38ecf54b807a0d6cfa30c436166a (commit) via 2e9feddf68a15e9f8909aedbd8b0f3e916273b94 (commit) via 53cd86ea7846b55b7cb21886ea77482e626bbeb4 (commit) via e992d62b7e15be28c8d560071bcf847f28d9fbb1 (commit) via 3c0ca5a9d9d538da41e99207da22f55496bdf553 (commit) via e331367a898c6e0afa386c52fc7bd4d84d75ec29 (commit) from 20fdf9a92b2c46937353a53949636131d3664fc7 (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=cb165b8b79c96a3ff6db12cb1821cfa2c0c4cce5 commit cb165b8b79c96a3ff6db12cb1821cfa2c0c4cce5 Merge: a269c77edb 3c0ca5a9d9 Author: Brad King <brad.k...@kitware.com> AuthorDate: Tue Nov 5 16:30:05 2019 +0000 Commit: Kitware Robot <kwro...@kitware.com> CommitDate: Tue Nov 5 11:30:27 2019 -0500 Merge topic 'source_group-tree' 3c0ca5a9d9 source_group: ensure that passed file is not a directory Acked-by: Kitware Robot <kwro...@kitware.com> Merge-request: !3979 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a269c77edb7c9d55efa1fbac46ed84173a7dcbc9 commit a269c77edb7c9d55efa1fbac46ed84173a7dcbc9 Merge: 13ea5f06fa 53cd86ea78 Author: Brad King <brad.k...@kitware.com> AuthorDate: Tue Nov 5 16:29:30 2019 +0000 Commit: Kitware Robot <kwro...@kitware.com> CommitDate: Tue Nov 5 11:29:39 2019 -0500 Merge topic 'clarify_compile_features_documentation' 53cd86ea78 Help: Clarify what 'aware' means as it relates to C++ standards Acked-by: Kitware Robot <kwro...@kitware.com> Merge-request: !3988 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=13ea5f06fad9bd9645cf4fb768e476dd7a053dd1 commit 13ea5f06fad9bd9645cf4fb768e476dd7a053dd1 Merge: 3521e3d524 e331367a89 Author: Brad King <brad.k...@kitware.com> AuthorDate: Tue Nov 5 16:24:10 2019 +0000 Commit: Kitware Robot <kwro...@kitware.com> CommitDate: Tue Nov 5 11:24:55 2019 -0500 Merge topic 'objc-pch' e331367a89 PCH: Add support for OBJC/OBJCXX languages Acked-by: Kitware Robot <kwro...@kitware.com> Merge-request: !3983 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3521e3d524447f0f3ac20f8e2df2435dd6de7aa2 commit 3521e3d524447f0f3ac20f8e2df2435dd6de7aa2 Merge: 153226a147 e992d62b7e Author: Brad King <brad.k...@kitware.com> AuthorDate: Tue Nov 5 16:23:39 2019 +0000 Commit: Kitware Robot <kwro...@kitware.com> CommitDate: Tue Nov 5 11:23:59 2019 -0500 Merge topic 'findpostgres-10-and-older' e992d62b7e FindPostgreSQL: support version encoding used in pre-10 releases Acked-by: Kitware Robot <kwro...@kitware.com> Merge-request: !3993 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=153226a1471d38ecf54b807a0d6cfa30c436166a commit 153226a1471d38ecf54b807a0d6cfa30c436166a Merge: 20fdf9a92b 2e9feddf68 Author: Brad King <brad.k...@kitware.com> AuthorDate: Tue Nov 5 16:22:42 2019 +0000 Commit: Kitware Robot <kwro...@kitware.com> CommitDate: Tue Nov 5 11:23:04 2019 -0500 Merge topic 'FindCUDA-find-nvcc' 2e9feddf68 FindCUDA: Use find_program instead of find_path when searching for nvcc. Acked-by: Kitware Robot <kwro...@kitware.com> Merge-request: !3990 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2e9feddf68a15e9f8909aedbd8b0f3e916273b94 commit 2e9feddf68a15e9f8909aedbd8b0f3e916273b94 Author: Hong Xu <h...@topbug.net> AuthorDate: Mon Nov 4 11:18:05 2019 -0800 Commit: Hong Xu <h...@topbug.net> CommitDate: Mon Nov 4 14:17:20 2019 -0800 FindCUDA: Use find_program instead of find_path when searching for nvcc. Before this commit, nvcc would not be found if it is in env PATH but a non-standard location. This commit fixes this issue. diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake index b6859aaf41..85d705c8d6 100644 --- a/Modules/FindCUDA.cmake +++ b/Modules/FindCUDA.cmake @@ -676,7 +676,7 @@ endif() # Search for the cuda distribution. if(NOT CUDA_TOOLKIT_ROOT_DIR AND NOT CMAKE_CROSSCOMPILING) # Search in the CUDA_BIN_PATH first. - find_path(CUDA_TOOLKIT_ROOT_DIR + find_program(CUDA_TOOLKIT_ROOT_DIR_NVCC NAMES nvcc nvcc.exe PATHS ENV CUDA_TOOLKIT_ROOT @@ -688,19 +688,22 @@ if(NOT CUDA_TOOLKIT_ROOT_DIR AND NOT CMAKE_CROSSCOMPILING) ) # Now search default paths - find_path(CUDA_TOOLKIT_ROOT_DIR + find_program(CUDA_TOOLKIT_ROOT_DIR_NVCC NAMES nvcc nvcc.exe PATHS /opt/cuda/bin PATH_SUFFIXES cuda/bin DOC "Toolkit location." ) - if (CUDA_TOOLKIT_ROOT_DIR) + if (CUDA_TOOLKIT_ROOT_DIR_NVCC) + get_filename_component(CUDA_TOOLKIT_ROOT_DIR_NVCC_PAR "${CUDA_TOOLKIT_ROOT_DIR_NVCC}" DIRECTORY) + get_filename_component(CUDA_TOOLKIT_ROOT_DIR "${CUDA_TOOLKIT_ROOT_DIR_NVCC_PAR}" DIRECTORY CACHE) string(REGEX REPLACE "[/\\\\]?bin[64]*[/\\\\]?$" "" CUDA_TOOLKIT_ROOT_DIR ${CUDA_TOOLKIT_ROOT_DIR}) # We need to force this back into the cache. set(CUDA_TOOLKIT_ROOT_DIR ${CUDA_TOOLKIT_ROOT_DIR} CACHE PATH "Toolkit location." FORCE) set(CUDA_TOOLKIT_TARGET_DIR ${CUDA_TOOLKIT_ROOT_DIR}) endif() + unset(CUDA_TOOLKIT_ROOT_DIR_NVCC CACHE) if (NOT EXISTS ${CUDA_TOOLKIT_ROOT_DIR}) if(CUDA_FIND_REQUIRED) https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=53cd86ea7846b55b7cb21886ea77482e626bbeb4 commit 53cd86ea7846b55b7cb21886ea77482e626bbeb4 Author: Robert Maynard <robert.mayn...@kitware.com> AuthorDate: Mon Nov 4 11:51:40 2019 -0500 Commit: Robert Maynard <robert.mayn...@kitware.com> CommitDate: Mon Nov 4 17:16:57 2019 -0500 Help: Clarify what 'aware' means as it relates to C++ standards diff --git a/Help/manual/cmake-compile-features.7.rst b/Help/manual/cmake-compile-features.7.rst index 658694a9d4..52f5652910 100644 --- a/Help/manual/cmake-compile-features.7.rst +++ b/Help/manual/cmake-compile-features.7.rst @@ -90,21 +90,21 @@ 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. +that is at minimum aware of that standard, but could be greater. +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: +header files, then clients must use a compiler mode that is no less +than C++ 11. 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 +of at-least C++ 11 (or C++ 14, C++ 17, ...), 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``). diff --git a/Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst b/Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst index 262a67c29d..b921c6b038 100644 --- a/Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst +++ b/Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst @@ -15,19 +15,19 @@ 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. + Compiler mode is at least C++ 98. ``cxx_std_11`` - Compiler mode is aware of C++ 11. + Compiler mode is at least C++ 11. ``cxx_std_14`` - Compiler mode is aware of C++ 14. + Compiler mode is at least C++ 14. ``cxx_std_17`` - Compiler mode is aware of C++ 17. + Compiler mode is at least C++ 17. ``cxx_std_20`` - Compiler mode is aware of C++ 20. + Compiler mode is at least C++ 20. ``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 3707fef1ef..e5f896ee00 100644 --- a/Help/prop_gbl/CMAKE_C_KNOWN_FEATURES.rst +++ b/Help/prop_gbl/CMAKE_C_KNOWN_FEATURES.rst @@ -14,13 +14,13 @@ 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. + Compiler mode is at least C 90. ``c_std_99`` - Compiler mode is aware of C 99. + Compiler mode is at least C 99. ``c_std_11`` - Compiler mode is aware of C 11. + Compiler mode is at least C 11. ``c_function_prototypes`` Function prototypes, as defined in ``ISO/IEC 9899:1990``. https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e992d62b7e15be28c8d560071bcf847f28d9fbb1 commit e992d62b7e15be28c8d560071bcf847f28d9fbb1 Author: Ben Boeckel <ben.boec...@kitware.com> AuthorDate: Mon Nov 4 16:37:06 2019 -0500 Commit: Ben Boeckel <ben.boec...@kitware.com> CommitDate: Mon Nov 4 16:38:52 2019 -0500 FindPostgreSQL: support version encoding used in pre-10 releases With the 10.x release, PostgreSQL upstream started encoding the version as `MMmmmm` where `M` is major and `m` is minor. Prior to that, `MMmmPP` was used where `P` was the patch number. Detect this difference and decode it based on the used encoding. Fixes: #19912 diff --git a/Modules/FindPostgreSQL.cmake b/Modules/FindPostgreSQL.cmake index cfa4ebce9f..4fcc79def8 100644 --- a/Modules/FindPostgreSQL.cmake +++ b/Modules/FindPostgreSQL.cmake @@ -208,11 +208,22 @@ if (PostgreSQL_INCLUDE_DIR) endif() endforeach() if (_PostgreSQL_VERSION_NUM) - math(EXPR _PostgreSQL_major_version "${_PostgreSQL_VERSION_NUM} / 10000") - math(EXPR _PostgreSQL_minor_version "${_PostgreSQL_VERSION_NUM} % 10000") - set(PostgreSQL_VERSION_STRING "${_PostgreSQL_major_version}.${_PostgreSQL_minor_version}") - unset(_PostgreSQL_major_version) - unset(_PostgreSQL_minor_version) + # 9.x and older encoding + if (_PostgreSQL_VERSION_NUM LESS 100000) + math(EXPR _PostgreSQL_major_version "${_PostgreSQL_VERSION_NUM} / 10000") + math(EXPR _PostgreSQL_minor_version "${_PostgreSQL_VERSION_NUM} % 10000 / 100") + math(EXPR _PostgreSQL_patch_version "${_PostgreSQL_VERSION_NUM} % 100") + set(PostgreSQL_VERSION_STRING "${_PostgreSQL_major_version}.${_PostgreSQL_minor_version}.${_PostgreSQL_patch_version}") + unset(_PostgreSQL_major_version) + unset(_PostgreSQL_minor_version) + unset(_PostgreSQL_patch_version) + else () + math(EXPR _PostgreSQL_major_version "${_PostgreSQL_VERSION_NUM} / 10000") + math(EXPR _PostgreSQL_minor_version "${_PostgreSQL_VERSION_NUM} % 10000") + set(PostgreSQL_VERSION_STRING "${_PostgreSQL_major_version}.${_PostgreSQL_minor_version}") + unset(_PostgreSQL_major_version) + unset(_PostgreSQL_minor_version) + endif () else () foreach(_PG_CONFIG_HEADER ${_PG_CONFIG_HEADERS}) if(EXISTS "${_PG_CONFIG_HEADER}") diff --git a/Tests/FindPostgreSQL/Test/main.c b/Tests/FindPostgreSQL/Test/main.c index 2cfeed0da2..a63377a256 100644 --- a/Tests/FindPostgreSQL/Test/main.c +++ b/Tests/FindPostgreSQL/Test/main.c @@ -5,10 +5,19 @@ int main() { int version = PQlibVersion(); - int major = version / 10000; - int minor = version % 10000; char version_string[100]; - snprintf(version_string, sizeof(version_string), "%d.%d", major, minor); + // 9.x and older encoding. + if (version < 100000) { + int major = version / 10000; + int minor = version % 10000 / 100; + int patch = version % 100; + snprintf(version_string, sizeof(version_string), "%d.%d.%d", major, minor, + patch); + } else { + int major = version / 10000; + int minor = version % 10000; + snprintf(version_string, sizeof(version_string), "%d.%d", major, minor); + } printf("Found PostgreSQL version %s, expected version %s\n", version_string, CMAKE_EXPECTED_POSTGRESQL_VERSION); return strcmp(version_string, CMAKE_EXPECTED_POSTGRESQL_VERSION); https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3c0ca5a9d9d538da41e99207da22f55496bdf553 commit 3c0ca5a9d9d538da41e99207da22f55496bdf553 Author: Mateusz Janek <stryku2...@gmail.com> AuthorDate: Sat Nov 2 18:16:58 2019 +0100 Commit: Brad King <brad.k...@kitware.com> CommitDate: Mon Nov 4 13:37:41 2019 -0500 source_group: ensure that passed file is not a directory Fixes: #19769 diff --git a/Source/cmSourceGroupCommand.cxx b/Source/cmSourceGroupCommand.cxx index 3a13e57a42..cc62952d8b 100644 --- a/Source/cmSourceGroupCommand.cxx +++ b/Source/cmSourceGroupCommand.cxx @@ -78,10 +78,18 @@ std::vector<std::string> prepareFilesPathsForTree( for (auto const& filePath : filesPaths) { std::string fullPath = cmSystemTools::CollapseFullPath(filePath, currentSourceDir); - // If provided file path is actually not a file, silently ignore it. - if (cmSystemTools::FileExists(fullPath, /*isFile=*/true)) { - prepared.emplace_back(std::move(fullPath)); + // If provided file path is actually not a directory, silently ignore it. + if (cmSystemTools::FileIsDirectory(fullPath)) { + continue; } + + // Handle directory that doesn't exist yet. + if (!fullPath.empty() && + (fullPath.back() == '/' || fullPath.back() == '\\')) { + continue; + } + + prepared.emplace_back(std::move(fullPath)); } return prepared; diff --git a/Tests/RunCMake/VS10Project/SourceGroupTreeCMakeLists-check.cmake b/Tests/RunCMake/VS10Project/SourceGroupTreeCMakeLists-check.cmake index 655120adfe..ee0c4120c0 100644 --- a/Tests/RunCMake/VS10Project/SourceGroupTreeCMakeLists-check.cmake +++ b/Tests/RunCMake/VS10Project/SourceGroupTreeCMakeLists-check.cmake @@ -13,6 +13,7 @@ include(${RunCMake_TEST_SOURCE_DIR}/SourceGroupHelpers.cmake) set(SOURCE_GROUPS_TO_FIND "Dir" "Dir\\DirNested" + "Generated" "SourcesPrefix" "SourcesPrefix\\PrefixedNested" ) diff --git a/Tests/RunCMake/VS10Project/SourceGroupTreeCMakeLists.cmake b/Tests/RunCMake/VS10Project/SourceGroupTreeCMakeLists.cmake index 83c87a9d8d..7655e60944 100644 --- a/Tests/RunCMake/VS10Project/SourceGroupTreeCMakeLists.cmake +++ b/Tests/RunCMake/VS10Project/SourceGroupTreeCMakeLists.cmake @@ -1,16 +1,45 @@ set(CMAKE_CONFIGURATION_TYPES Debug) +# Test regular tree grouping. set(SRC_FILES ${CMAKE_CURRENT_SOURCE_DIR}/Dir/foo.cpp ${CMAKE_CURRENT_SOURCE_DIR}/Dir/DirNested/foo_nested.cpp ) +source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${SRC_FILES}) + + +# Test files that are not present at configuration time. +set(GENERATED_SRC_FILES + ${CMAKE_CURRENT_BINARY_DIR}/Generated/generated.cpp +) + +file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/Generated) + +if(WIN32) + add_custom_command(OUTPUT ${GENERATED_SRC_FILES} + COMMAND echo. 2>${CMAKE_CURRENT_BINARY_DIR}\\Generated\\generated.cpp + ) +else() + add_custom_command(OUTPUT ${GENERATED_SRC_FILES} + COMMAND touch ${CMAKE_CURRENT_BINARY_DIR}/Generated/generated.cpp + ) +endif() + +source_group(TREE ${CMAKE_CURRENT_BINARY_DIR} FILES ${GENERATED_SRC_FILES}) + + +# Test prefixed tree grouping. set(PREFIXED_SRC_FILES ${CMAKE_CURRENT_SOURCE_DIR}/Prefixed/bar.cpp ${CMAKE_CURRENT_SOURCE_DIR}/Prefixed/PrefixedNested/bar_nested.cpp ) -add_custom_target(SourceGroupTree SOURCES ${SRC_FILES} ${PREFIXED_SRC_FILES}) +add_custom_target(SourceGroupTree + SOURCES + ${SRC_FILES} + ${GENERATED_SRC_FILES} + ${PREFIXED_SRC_FILES} +) -source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${SRC_FILES}) source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/Prefixed PREFIX SourcesPrefix FILES ${PREFIXED_SRC_FILES}) https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e331367a898c6e0afa386c52fc7bd4d84d75ec29 commit e331367a898c6e0afa386c52fc7bd4d84d75ec29 Author: Cristian Adam <cristian.a...@gmail.com> AuthorDate: Sun Nov 3 21:34:39 2019 +0100 Commit: Cristian Adam <cristian.a...@gmail.com> CommitDate: Sun Nov 3 21:34:39 2019 +0100 PCH: Add support for OBJC/OBJCXX languages diff --git a/Modules/Compiler/GNU.cmake b/Modules/Compiler/GNU.cmake index e0ff174ef8..6960571db8 100644 --- a/Modules/Compiler/GNU.cmake +++ b/Modules/Compiler/GNU.cmake @@ -13,6 +13,8 @@ include(Internal/CMakeCheckCompilerFlag) set(__pch_header_C "c-header") set(__pch_header_CXX "c++-header") +set(__pch_header_OBJC "objective-c-header") +set(__pch_header_OBJCXX "objective-c++-header") macro(__compiler_gnu lang) # Feature flags. diff --git a/Modules/Platform/Windows-Clang.cmake b/Modules/Platform/Windows-Clang.cmake index f2265534fd..02864c6b3e 100644 --- a/Modules/Platform/Windows-Clang.cmake +++ b/Modules/Platform/Windows-Clang.cmake @@ -8,9 +8,6 @@ if(__WINDOWS_CLANG) endif() set(__WINDOWS_CLANG 1) -set(__pch_header_C "c-header") -set(__pch_header_CXX "c++-header") - macro(__windows_compiler_clang_gnu lang) set(CMAKE_LIBRARY_PATH_FLAG "-L") set(CMAKE_LINK_LIBRARY_FLAG "-l") diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 949d9d9128..f235af9136 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -3334,9 +3334,11 @@ std::vector<BT<std::string>> cmGeneratorTarget::GetPrecompileHeaders( std::string cmGeneratorTarget::GetPchHeader(const std::string& config, const std::string& language) const { - if (language != "C" && language != "CXX") { + if (language != "C" && language != "CXX" && language != "OBJC" && + language != "OBJCXX") { return std::string(); } + if (this->GetPropertyAsBool("DISABLE_PRECOMPILE_HEADERS")) { return std::string(); } @@ -3367,8 +3369,15 @@ std::string cmGeneratorTarget::GetPchHeader(const std::string& config, filename = generatorTarget->ObjectDirectory; } + const std::map<std::string, std::string> languageToExtension = { + { "C", ".h" }, + { "CXX", ".hxx" }, + { "OBJC", ".objc.h" }, + { "OBJCXX", ".objcxx.hxx" } + }; + filename = cmStrCat(filename, "CMakeFiles/", generatorTarget->GetName(), - ".dir/cmake_pch", ((language == "C") ? ".h" : ".hxx")); + ".dir/cmake_pch", languageToExtension.at(language)); const std::string filename_tmp = cmStrCat(filename, ".tmp"); if (!pchReuseFrom) { @@ -3418,7 +3427,8 @@ std::string cmGeneratorTarget::GetPchHeader(const std::string& config, std::string cmGeneratorTarget::GetPchSource(const std::string& config, const std::string& language) const { - if (language != "C" && language != "CXX") { + if (language != "C" && language != "CXX" && language != "OBJC" && + language != "OBJCXX") { return std::string(); } const auto inserted = @@ -3444,9 +3454,20 @@ std::string cmGeneratorTarget::GetPchSource(const std::string& config, // For GCC the source extension will be tranformed into .h[xx].gch if (!this->Makefile->IsOn("CMAKE_LINK_PCH")) { - filename += ((language == "C") ? ".h.c" : ".hxx.cxx"); + const std::map<std::string, std::string> languageToExtension = { + { "C", ".h.c" }, + { "CXX", ".hxx.cxx" }, + { "OBJC", ".objc.h.m" }, + { "OBJCXX", ".objcxx.hxx.mm" } + }; + + filename += languageToExtension.at(language); } else { - filename += ((language == "C") ? ".c" : ".cxx"); + const std::map<std::string, std::string> languageToExtension = { + { "C", ".c" }, { "CXX", ".cxx" }, { "OBJC", ".m" }, { "OBJCXX", ".mm" } + }; + + filename += languageToExtension.at(language); } const std::string filename_tmp = cmStrCat(filename, ".tmp"); @@ -3464,7 +3485,8 @@ std::string cmGeneratorTarget::GetPchSource(const std::string& config, std::string cmGeneratorTarget::GetPchFileObject(const std::string& config, const std::string& language) { - if (language != "C" && language != "CXX") { + if (language != "C" && language != "CXX" && language != "OBJC" && + language != "OBJCXX") { return std::string(); } const auto inserted = diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index a2eb1b93e4..00bd8af99f 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -2266,7 +2266,7 @@ void cmLocalGenerator::AddPchDependencies(cmGeneratorTarget* target) std::vector<cmSourceFile*> sources; target->GetSourceFiles(sources, buildType); - for (const std::string& lang : { "C", "CXX" }) { + for (const std::string& lang : { "C", "CXX", "OBJC", "OBJCXX" }) { auto langSources = std::count_if(sources.begin(), sources.end(), [lang](cmSourceFile* sf) { return lang == sf->GetLanguage() && ----------------------------------------------------------------------- Summary of changes: Help/manual/cmake-compile-features.7.rst | 14 ++++----- Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst | 10 +++---- Help/prop_gbl/CMAKE_C_KNOWN_FEATURES.rst | 6 ++-- Modules/Compiler/GNU.cmake | 2 ++ Modules/FindCUDA.cmake | 9 ++++-- Modules/FindPostgreSQL.cmake | 21 +++++++++---- Modules/Platform/Windows-Clang.cmake | 3 -- Source/cmGeneratorTarget.cxx | 34 ++++++++++++++++++---- Source/cmLocalGenerator.cxx | 2 +- Source/cmSourceGroupCommand.cxx | 14 +++++++-- Tests/FindPostgreSQL/Test/main.c | 15 ++++++++-- .../SourceGroupTreeCMakeLists-check.cmake | 1 + .../VS10Project/SourceGroupTreeCMakeLists.cmake | 33 +++++++++++++++++++-- 13 files changed, 123 insertions(+), 41 deletions(-) hooks/post-receive -- CMake _______________________________________________ Cmake-commits mailing list Cmake-commits@cmake.org https://cmake.org/mailman/listinfo/cmake-commits