diff options
199 files changed, 1407 insertions, 441 deletions
diff --git a/.clang-tidy b/.clang-tidy index c790467..1b776e1 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -15,6 +15,7 @@ misc-*,\ -misc-no-recursion,\ -misc-non-private-member-variables-in-classes,\ -misc-static-assert,\ +-misc-use-anonymous-namespace,\ modernize-*,\ -modernize-avoid-c-arrays,\ -modernize-macro-to-enum,\ diff --git a/.codespellrc b/.codespellrc index 0abd94e..00c6c52 100644 --- a/.codespellrc +++ b/.codespellrc @@ -4,5 +4,5 @@ check-hidden = # Disable warnings about binary files quiet-level = 2 builtin = clear,rare,en-GB_to_en-US -skip = */.git,*/build,*/Copyright.txt,*/doxygen.config,*/Modules/Internal/CPack/NSIS.template.in,*/Source/CursesDialog/form/*,*/Source/kwsys/*,*/Tests/RunCMake/CPack/tests/DMG_SLA/German.*,*/Tests/RunCMake/ParseImplicitData/*.input,*/Utilities/cm* -ignore-words-list = aci,ake,ans,ba,cconfiguration,conly,dependees,dne,dum,earch,ect,filetest,fo,helpfull,hiden,isnt,keypair,nd,ned,nin,nknown,ot,pard,seh,ser,te,upto,varn,vas,wee +skip = */.git,*/build,*/Copyright.txt,*/CTestCustom.cmake.in,*/doxygen.config,*/Modules/Internal/CPack/NSIS.template.in,*/Source/CursesDialog/form/*,*/Source/kwsys/*,*/Tests/RunCMake/CPack/tests/DMG_SLA/German.*,*/Tests/RunCMake/ParseImplicitData/*.input,*/Tests/StringFileTest/test.utf8,*.pfx,*/Utilities/cm* +ignore-words-list = aci,ags,ake,ans,ba,ccompiler,cconfiguration,certi,conly,dependees,dne,dum,earch,ect,filetest,fo,helpfull,hiden,isnt,keypair,nd,ned,nin,nknown,ot,pard,seh,ser,te,upto,varn,vas,wee diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 305c8d2..6e0d01a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -55,7 +55,7 @@ p:source-package: p:doc-package: extends: - - .fedora37_sphinx_package + - .fedora38_sphinx_package - .cmake_prep_doc_linux - .linux_x86_64_tags - .cmake_doc_artifacts @@ -103,16 +103,16 @@ l:iwyu-debian10: - .linux_x86_64_tags - .run_automatically -l:tidy-fedora37: +l:tidy-fedora38: extends: - - .fedora37_tidy + - .fedora38_tidy - .cmake_build_linux - .linux_x86_64_tags - .run_automatically -l:sphinx-fedora37: +l:sphinx-fedora38: extends: - - .fedora37_sphinx + - .fedora38_sphinx - .cmake_build_linux - .cmake_sphinx_artifacts - .linux_x86_64_tags @@ -121,9 +121,9 @@ l:sphinx-fedora37: CMAKE_CI_JOB_CONTINUOUS: "true" CMAKE_CI_JOB_HELP: "true" -l:clang-analyzer-fedora37: +l:clang-analyzer-fedora38: extends: - - .fedora37_clang_analyzer + - .fedora38_clang_analyzer - .cmake_build_linux - .linux_x86_64_tags - .run_automatically @@ -195,9 +195,9 @@ t:debian10-makefiles-clang: variables: CMAKE_CI_JOB_NIGHTLY: "true" -t:fedora37-ninja-clang: +t:fedora38-ninja-clang: extends: - - .fedora37_ninja_clang + - .fedora38_ninja_clang - .cmake_test_linux_release - .linux_x86_64_tags - .run_dependent @@ -205,9 +205,9 @@ t:fedora37-ninja-clang: variables: CMAKE_CI_JOB_NIGHTLY: "true" -t:fedora37-makefiles-clang: +t:fedora38-ninja-multi-clang: extends: - - .fedora37_makefiles_clang + - .fedora38_ninja_multi_clang - .cmake_test_linux_release - .linux_x86_64_tags - .run_dependent @@ -215,17 +215,27 @@ t:fedora37-makefiles-clang: variables: CMAKE_CI_JOB_NIGHTLY: "true" -t:fedora37-makefiles: +t:fedora38-makefiles-clang: extends: - - .fedora37_makefiles + - .fedora38_makefiles_clang + - .cmake_test_linux_release + - .linux_x86_64_tags + - .run_dependent + - .needs_centos6_x86_64 + variables: + CMAKE_CI_JOB_NIGHTLY: "true" + +t:fedora38-makefiles: + extends: + - .fedora38_makefiles - .cmake_test_linux_release - .linux_x86_64_tags - .run_dependent - .needs_centos6_x86_64 -t:fedora37-makefiles-nospace: +t:fedora38-makefiles-nospace: extends: - - .fedora37_makefiles + - .fedora38_makefiles - .cmake_test_linux_release - .linux_x86_64_tags - .cmake_junit_artifacts @@ -233,7 +243,7 @@ t:fedora37-makefiles-nospace: - .needs_centos6_x86_64 variables: GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake-ci" - CMAKE_CI_BUILD_NAME: fedora37_makefiles_nospace + CMAKE_CI_BUILD_NAME: fedora38_makefiles_nospace CMAKE_CI_JOB_NIGHTLY: "true" t:nvhpc22.11-ninja: @@ -334,29 +344,9 @@ t:linux-gcc-cxx-modules-ninja-multi: variables: CMAKE_CI_JOB_NIGHTLY: "true" -t:linux-clang-cxx-modules-ninja: - extends: - - .clang_cxx_modules_ninja - - .cmake_test_linux_release - - .linux_x86_64_tags - - .run_dependent - - .needs_centos6_x86_64 - variables: - CMAKE_CI_JOB_NIGHTLY: "true" - -t:linux-clang-cxx-modules-ninja-multi: - extends: - - .clang_cxx_modules_ninja_multi - - .cmake_test_linux_release - - .linux_x86_64_tags - - .run_dependent - - .needs_centos6_x86_64 - variables: - CMAKE_CI_JOB_NIGHTLY: "true" - -b:fedora37-ninja: +b:fedora38-ninja: extends: - - .fedora37_ninja + - .fedora38_ninja - .cmake_build_linux - .cmake_build_artifacts - .linux_x86_64_tags @@ -391,40 +381,40 @@ b:debian10-aarch64-extdeps: variables: CMAKE_CI_JOB_NIGHTLY: "true" -b:fedora37-extdeps: +b:fedora38-extdeps: extends: - - .fedora37_extdeps + - .fedora38_extdeps - .cmake_build_linux_standalone - .linux_x86_64_tags - .run_manually variables: CMAKE_CI_JOB_NIGHTLY: "true" -t:fedora37-ninja: +t:fedora38-ninja: extends: - - .fedora37_ninja + - .fedora38_ninja - .cmake_test_linux - .linux_x86_64_tags_x11 - .cmake_test_artifacts - .run_dependent dependencies: - - b:fedora37-ninja + - b:fedora38-ninja needs: - - b:fedora37-ninja + - b:fedora38-ninja variables: CMAKE_CI_JOB_CONTINUOUS: "true" -t:fedora37-ninja-multi: +t:fedora38-ninja-multi: extends: - - .fedora37_ninja_multi + - .fedora38_ninja_multi - .cmake_test_linux_external - .linux_x86_64_tags - .cmake_junit_artifacts - .run_dependent dependencies: - - t:fedora37-ninja + - t:fedora38-ninja needs: - - t:fedora37-ninja + - t:fedora38-ninja t:intel2016-makefiles: extends: @@ -791,9 +781,9 @@ u:linux-aarch64-package: ## Sanitizer builds -b:fedora37-asan: +b:fedora38-asan: extends: - - .fedora37_asan + - .fedora38_asan - .cmake_build_linux - .cmake_build_artifacts - .linux_x86_64_tags @@ -801,16 +791,16 @@ b:fedora37-asan: variables: CMAKE_CI_JOB_NIGHTLY: "true" -t:fedora37-asan: +t:fedora38-asan: extends: - - .fedora37_asan + - .fedora38_asan - .cmake_memcheck_linux - .linux_x86_64_tags - .run_dependent dependencies: - - b:fedora37-asan + - b:fedora38-asan needs: - - b:fedora37-asan + - b:fedora38-asan variables: CMAKE_CI_JOB_NIGHTLY: "true" diff --git a/.gitlab/ci/configure_fedora37_clang_analyzer.cmake b/.gitlab/ci/configure_fedora37_clang_analyzer.cmake deleted file mode 100644 index f4c4cdd..0000000 --- a/.gitlab/ci/configure_fedora37_clang_analyzer.cmake +++ /dev/null @@ -1 +0,0 @@ -include("${CMAKE_CURRENT_LIST_DIR}/configure_fedora37_common.cmake") diff --git a/.gitlab/ci/configure_fedora37_makefiles_clang.cmake b/.gitlab/ci/configure_fedora37_makefiles_clang.cmake deleted file mode 100644 index 7b82a9a..0000000 --- a/.gitlab/ci/configure_fedora37_makefiles_clang.cmake +++ /dev/null @@ -1 +0,0 @@ -include("${CMAKE_CURRENT_LIST_DIR}/configure_fedora37_common_clang.cmake") diff --git a/.gitlab/ci/configure_fedora37_ninja_clang.cmake b/.gitlab/ci/configure_fedora37_ninja_clang.cmake deleted file mode 100644 index 7b82a9a..0000000 --- a/.gitlab/ci/configure_fedora37_ninja_clang.cmake +++ /dev/null @@ -1 +0,0 @@ -include("${CMAKE_CURRENT_LIST_DIR}/configure_fedora37_common_clang.cmake") diff --git a/.gitlab/ci/configure_fedora37_asan.cmake b/.gitlab/ci/configure_fedora38_asan.cmake index 363e953..8eae500 100644 --- a/.gitlab/ci/configure_fedora37_asan.cmake +++ b/.gitlab/ci/configure_fedora38_asan.cmake @@ -1,4 +1,4 @@ set(CMAKE_C_FLAGS "-fsanitize=address" CACHE STRING "") set(CMAKE_CXX_FLAGS "-fsanitize=address" CACHE STRING "") -include("${CMAKE_CURRENT_LIST_DIR}/configure_fedora37_common.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/configure_fedora38_common.cmake") diff --git a/.gitlab/ci/configure_fedora38_clang_analyzer.cmake b/.gitlab/ci/configure_fedora38_clang_analyzer.cmake new file mode 100644 index 0000000..c11eef1 --- /dev/null +++ b/.gitlab/ci/configure_fedora38_clang_analyzer.cmake @@ -0,0 +1,3 @@ +set(configure_no_sccache 1) + +include("${CMAKE_CURRENT_LIST_DIR}/configure_fedora38_common.cmake") diff --git a/.gitlab/ci/configure_fedora37_common.cmake b/.gitlab/ci/configure_fedora38_common.cmake index 4484e26..4484e26 100644 --- a/.gitlab/ci/configure_fedora37_common.cmake +++ b/.gitlab/ci/configure_fedora38_common.cmake diff --git a/.gitlab/ci/configure_fedora37_common_clang.cmake b/.gitlab/ci/configure_fedora38_common_clang.cmake index 70c9df9..70c9df9 100644 --- a/.gitlab/ci/configure_fedora37_common_clang.cmake +++ b/.gitlab/ci/configure_fedora38_common_clang.cmake diff --git a/.gitlab/ci/configure_fedora37_extdeps.cmake b/.gitlab/ci/configure_fedora38_extdeps.cmake index 8e545f5..8e545f5 100644 --- a/.gitlab/ci/configure_fedora37_extdeps.cmake +++ b/.gitlab/ci/configure_fedora38_extdeps.cmake diff --git a/.gitlab/ci/configure_fedora37_makefiles.cmake b/.gitlab/ci/configure_fedora38_makefiles.cmake index c2f9982..c2f9982 100644 --- a/.gitlab/ci/configure_fedora37_makefiles.cmake +++ b/.gitlab/ci/configure_fedora38_makefiles.cmake diff --git a/.gitlab/ci/configure_fedora38_makefiles_clang.cmake b/.gitlab/ci/configure_fedora38_makefiles_clang.cmake new file mode 100644 index 0000000..ff30ad9 --- /dev/null +++ b/.gitlab/ci/configure_fedora38_makefiles_clang.cmake @@ -0,0 +1 @@ +include("${CMAKE_CURRENT_LIST_DIR}/configure_fedora38_common_clang.cmake") diff --git a/.gitlab/ci/configure_fedora37_ninja.cmake b/.gitlab/ci/configure_fedora38_ninja.cmake index 5b40677..ac6b9f6 100644 --- a/.gitlab/ci/configure_fedora37_ninja.cmake +++ b/.gitlab/ci/configure_fedora38_ninja.cmake @@ -11,4 +11,4 @@ set(CMAKE_CXX_FLAGS_RELEASE "-O3" CACHE STRING "") # Cover compilation with C++11 only and not higher standards. set(CMAKE_CXX_STANDARD "11" CACHE STRING "") -include("${CMAKE_CURRENT_LIST_DIR}/configure_fedora37_common.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/configure_fedora38_common.cmake") diff --git a/.gitlab/ci/configure_linux_clang_cxx_modules_ninja.cmake b/.gitlab/ci/configure_fedora38_ninja_clang.cmake index 671c625..214a123 100644 --- a/.gitlab/ci/configure_linux_clang_cxx_modules_ninja.cmake +++ b/.gitlab/ci/configure_fedora38_ninja_clang.cmake @@ -1,4 +1,4 @@ set(CMake_TEST_MODULE_COMPILATION "named,collation,partitions,internal_partitions,export_bmi,install_bmi,shared" CACHE STRING "") set(CMake_TEST_MODULE_COMPILATION_RULES "${CMAKE_CURRENT_LIST_DIR}/cxx_modules_rules_clang.cmake" CACHE STRING "") -include("${CMAKE_CURRENT_LIST_DIR}/configure_external_test.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/configure_fedora38_common_clang.cmake") diff --git a/.gitlab/ci/configure_fedora37_ninja_multi.cmake b/.gitlab/ci/configure_fedora38_ninja_multi.cmake index 94af721..94af721 100644 --- a/.gitlab/ci/configure_fedora37_ninja_multi.cmake +++ b/.gitlab/ci/configure_fedora38_ninja_multi.cmake diff --git a/.gitlab/ci/configure_linux_clang_cxx_modules_ninja_multi.cmake b/.gitlab/ci/configure_fedora38_ninja_multi_clang.cmake index 671c625..214a123 100644 --- a/.gitlab/ci/configure_linux_clang_cxx_modules_ninja_multi.cmake +++ b/.gitlab/ci/configure_fedora38_ninja_multi_clang.cmake @@ -1,4 +1,4 @@ set(CMake_TEST_MODULE_COMPILATION "named,collation,partitions,internal_partitions,export_bmi,install_bmi,shared" CACHE STRING "") set(CMake_TEST_MODULE_COMPILATION_RULES "${CMAKE_CURRENT_LIST_DIR}/cxx_modules_rules_clang.cmake" CACHE STRING "") -include("${CMAKE_CURRENT_LIST_DIR}/configure_external_test.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/configure_fedora38_common_clang.cmake") diff --git a/.gitlab/ci/configure_fedora37_sphinx.cmake b/.gitlab/ci/configure_fedora38_sphinx.cmake index 90d159b..90d159b 100644 --- a/.gitlab/ci/configure_fedora37_sphinx.cmake +++ b/.gitlab/ci/configure_fedora38_sphinx.cmake diff --git a/.gitlab/ci/configure_fedora37_sphinx_package.cmake b/.gitlab/ci/configure_fedora38_sphinx_package.cmake index e839de8..e839de8 100644 --- a/.gitlab/ci/configure_fedora37_sphinx_package.cmake +++ b/.gitlab/ci/configure_fedora38_sphinx_package.cmake diff --git a/.gitlab/ci/configure_fedora37_tidy.cmake b/.gitlab/ci/configure_fedora38_tidy.cmake index f8eb9ab..5b062da 100644 --- a/.gitlab/ci/configure_fedora37_tidy.cmake +++ b/.gitlab/ci/configure_fedora38_tidy.cmake @@ -2,4 +2,4 @@ set(CMake_RUN_CLANG_TIDY ON CACHE BOOL "") set(CMake_USE_CLANG_TIDY_MODULE ON CACHE BOOL "") set(CMake_CLANG_TIDY_MODULE "$ENV{CI_PROJECT_DIR}/Utilities/ClangTidyModule/build/libcmake-clang-tidy-module.so" CACHE FILEPATH "") -include("${CMAKE_CURRENT_LIST_DIR}/configure_fedora37_common.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/configure_fedora38_common.cmake") diff --git a/.gitlab/ci/ctest_memcheck_fedora37_asan.lsan.supp b/.gitlab/ci/ctest_memcheck_fedora38_asan.lsan.supp index 8ec1a03..8ec1a03 100644 --- a/.gitlab/ci/ctest_memcheck_fedora37_asan.lsan.supp +++ b/.gitlab/ci/ctest_memcheck_fedora38_asan.lsan.supp diff --git a/.gitlab/ci/docker/clang_cxx_modules/Dockerfile b/.gitlab/ci/docker/clang_cxx_modules/Dockerfile deleted file mode 100644 index 4e58125..0000000 --- a/.gitlab/ci/docker/clang_cxx_modules/Dockerfile +++ /dev/null @@ -1,13 +0,0 @@ -FROM fedora:37 -MAINTAINER Ben Boeckel <ben.boeckel@kitware.com> - -# Install build dependencies for packages. -COPY install_deps.sh /root/install_deps.sh -RUN sh /root/install_deps.sh - -COPY install_llvm.sh /root/install_llvm.sh -RUN sh /root/install_llvm.sh - -# Install build dependencies for CMake's CI. -COPY install_cmake_deps.sh /root/install_cmake_deps.sh -RUN sh /root/install_cmake_deps.sh diff --git a/.gitlab/ci/docker/clang_cxx_modules/install_cmake_deps.sh b/.gitlab/ci/docker/clang_cxx_modules/install_cmake_deps.sh deleted file mode 100755 index 465e125..0000000 --- a/.gitlab/ci/docker/clang_cxx_modules/install_cmake_deps.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -set -e - -dnf install -y --setopt=install_weak_deps=False \ - file git-core -dnf clean all diff --git a/.gitlab/ci/docker/clang_cxx_modules/install_deps.sh b/.gitlab/ci/docker/clang_cxx_modules/install_deps.sh deleted file mode 100755 index c1957c3..0000000 --- a/.gitlab/ci/docker/clang_cxx_modules/install_deps.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -set -e - -dnf install -y --setopt=install_weak_deps=False \ - gcc-c++ cmake ninja-build -dnf clean all diff --git a/.gitlab/ci/docker/clang_cxx_modules/install_llvm.sh b/.gitlab/ci/docker/clang_cxx_modules/install_llvm.sh deleted file mode 100755 index 35f925e..0000000 --- a/.gitlab/ci/docker/clang_cxx_modules/install_llvm.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/sh - -set -e - -readonly revision="6d859df46e93e04bd7a4f90d9a9056763998f638" # llvmorg-16.0.0-rc2-31-g6d859df46e93 -readonly tarball="https://github.com/llvm/llvm-project/archive/$revision.tar.gz" - -readonly workdir="$HOME/llvm" -readonly srcdir="$workdir/llvm" -readonly builddir="$workdir/build" - -mkdir -p "$workdir" -cd "$workdir" -curl -L "$tarball" > "llvm-$revision.tar.gz" -tar xf "llvm-$revision.tar.gz" -mv "llvm-project-$revision" "$srcdir" -mkdir -p "$builddir" -cd "$builddir" -cmake -GNinja \ - -DCMAKE_BUILD_TYPE=Release \ - -DBUILD_SHARED_LIBS=ON \ - -DLLVM_ENABLE_BINDINGS=OFF \ - -DLLVM_INCLUDE_BENCHMARKS=OFF \ - -DLLVM_INCLUDE_DOCS=OFF \ - -DLLVM_INCLUDE_EXAMPLES=OFF \ - -DLLVM_INCLUDE_RUNTIMES=OFF \ - -DLLVM_INCLUDE_TESTS=OFF \ - -DLLVM_INCLUDE_UTILS=OFF \ - -DLLVM_TARGETS_TO_BUILD=X86 \ - -DLLVM_TOOL_CLANG_BUILD=ON \ - -DLLVM_USE_SYMLINKS=ON \ - "-DLLVM_EXTERNAL_CLANG_SOURCE_DIR=$srcdir/clang" \ - -DLLVM_PARALLEL_LINK_JOBS=1 \ - -DCLANG_BUILD_TOOLS=ON \ - "-DCMAKE_INSTALL_PREFIX=/opt/llvm-p1689" \ - "$srcdir/llvm" -ninja -ninja install/strip -rm -rf "$workdir" diff --git a/.gitlab/ci/docker/fedora37/Dockerfile b/.gitlab/ci/docker/fedora38/Dockerfile index 5439e9d..4918693 100644 --- a/.gitlab/ci/docker/fedora37/Dockerfile +++ b/.gitlab/ci/docker/fedora38/Dockerfile @@ -1,6 +1,6 @@ # syntax=docker/dockerfile:1 -ARG BASE_IMAGE=fedora:37 +ARG BASE_IMAGE=fedora:38 FROM ${BASE_IMAGE} AS dnf-cache # Populate DNF cache w/ the fresh metadata and prefetch packages. diff --git a/.gitlab/ci/docker/fedora37/deps_packages.lst b/.gitlab/ci/docker/fedora38/deps_packages.lst index 68777f0..c7c1385 100644 --- a/.gitlab/ci/docker/fedora37/deps_packages.lst +++ b/.gitlab/ci/docker/fedora38/deps_packages.lst @@ -19,7 +19,6 @@ make bzip2-devel expat-devel jsoncpp-devel -json-devel libarchive-devel libcurl-devel libuv-devel diff --git a/.gitlab/ci/docker/fedora37/install_deps.sh b/.gitlab/ci/docker/fedora38/install_deps.sh index cd2701e..cd2701e 100755 --- a/.gitlab/ci/docker/fedora37/install_deps.sh +++ b/.gitlab/ci/docker/fedora38/install_deps.sh diff --git a/.gitlab/ci/docker/fedora37/install_iwyu.sh b/.gitlab/ci/docker/fedora38/install_iwyu.sh index 684e355..684e355 100755 --- a/.gitlab/ci/docker/fedora37/install_iwyu.sh +++ b/.gitlab/ci/docker/fedora38/install_iwyu.sh diff --git a/.gitlab/ci/docker/fedora37/install_rvm.sh b/.gitlab/ci/docker/fedora38/install_rvm.sh index 10e7545..10e7545 100755 --- a/.gitlab/ci/docker/fedora37/install_rvm.sh +++ b/.gitlab/ci/docker/fedora38/install_rvm.sh diff --git a/.gitlab/ci/docker/fedora37/iwyu_packages.lst b/.gitlab/ci/docker/fedora38/iwyu_packages.lst index e3551bd..e3551bd 100644 --- a/.gitlab/ci/docker/fedora37/iwyu_packages.lst +++ b/.gitlab/ci/docker/fedora38/iwyu_packages.lst diff --git a/.gitlab/ci/docker/fedora37/rvm_packages.lst b/.gitlab/ci/docker/fedora38/rvm_packages.lst index 1dc852e..1dc852e 100644 --- a/.gitlab/ci/docker/fedora37/rvm_packages.lst +++ b/.gitlab/ci/docker/fedora38/rvm_packages.lst diff --git a/.gitlab/ci/env_fedora37_makefiles_clang.sh b/.gitlab/ci/env_fedora37_makefiles_clang.sh deleted file mode 100644 index 9ff1d84..0000000 --- a/.gitlab/ci/env_fedora37_makefiles_clang.sh +++ /dev/null @@ -1 +0,0 @@ -. .gitlab/ci/env_fedora37_common_clang.sh diff --git a/.gitlab/ci/env_fedora37_ninja_clang.sh b/.gitlab/ci/env_fedora37_ninja_clang.sh deleted file mode 100644 index 9ff1d84..0000000 --- a/.gitlab/ci/env_fedora37_ninja_clang.sh +++ /dev/null @@ -1 +0,0 @@ -. .gitlab/ci/env_fedora37_common_clang.sh diff --git a/.gitlab/ci/env_fedora37_asan.sh b/.gitlab/ci/env_fedora38_asan.sh index e976486..e976486 100644 --- a/.gitlab/ci/env_fedora37_asan.sh +++ b/.gitlab/ci/env_fedora38_asan.sh diff --git a/.gitlab/ci/env_fedora37_clang_analyzer.sh b/.gitlab/ci/env_fedora38_clang_analyzer.sh index d732c0b..d732c0b 100644 --- a/.gitlab/ci/env_fedora37_clang_analyzer.sh +++ b/.gitlab/ci/env_fedora38_clang_analyzer.sh diff --git a/.gitlab/ci/env_fedora37_common_clang.sh b/.gitlab/ci/env_fedora38_common_clang.sh index b03b757..fc9c041 100644 --- a/.gitlab/ci/env_fedora37_common_clang.sh +++ b/.gitlab/ci/env_fedora38_common_clang.sh @@ -1,4 +1,4 @@ -export CC=/usr/bin/clang-15 -export CXX=/usr/bin/clang++-15 +export CC=/usr/bin/clang-16 +export CXX=/usr/bin/clang++-16 export FC=/usr/bin/flang-new export FFLAGS=-flang-experimental-exec diff --git a/.gitlab/ci/env_fedora37_extdeps.sh b/.gitlab/ci/env_fedora38_extdeps.sh index 7076e18..7076e18 100644 --- a/.gitlab/ci/env_fedora37_extdeps.sh +++ b/.gitlab/ci/env_fedora38_extdeps.sh diff --git a/.gitlab/ci/env_fedora37_makefiles.cmake b/.gitlab/ci/env_fedora38_makefiles.cmake index ef13cda..ef13cda 100644 --- a/.gitlab/ci/env_fedora37_makefiles.cmake +++ b/.gitlab/ci/env_fedora38_makefiles.cmake diff --git a/.gitlab/ci/env_fedora37_makefiles.sh b/.gitlab/ci/env_fedora38_makefiles.sh index c482642..c482642 100644 --- a/.gitlab/ci/env_fedora37_makefiles.sh +++ b/.gitlab/ci/env_fedora38_makefiles.sh diff --git a/.gitlab/ci/env_fedora38_makefiles_clang.sh b/.gitlab/ci/env_fedora38_makefiles_clang.sh new file mode 100644 index 0000000..9f3edde --- /dev/null +++ b/.gitlab/ci/env_fedora38_makefiles_clang.sh @@ -0,0 +1 @@ +. .gitlab/ci/env_fedora38_common_clang.sh diff --git a/.gitlab/ci/env_fedora37_ninja_multi.sh b/.gitlab/ci/env_fedora38_ninja.sh index 217ff30..217ff30 100644 --- a/.gitlab/ci/env_fedora37_ninja_multi.sh +++ b/.gitlab/ci/env_fedora38_ninja.sh diff --git a/.gitlab/ci/env_fedora38_ninja_clang.sh b/.gitlab/ci/env_fedora38_ninja_clang.sh new file mode 100644 index 0000000..9f3edde --- /dev/null +++ b/.gitlab/ci/env_fedora38_ninja_clang.sh @@ -0,0 +1 @@ +. .gitlab/ci/env_fedora38_common_clang.sh diff --git a/.gitlab/ci/env_fedora37_ninja.sh b/.gitlab/ci/env_fedora38_ninja_multi.sh index 217ff30..217ff30 100644 --- a/.gitlab/ci/env_fedora37_ninja.sh +++ b/.gitlab/ci/env_fedora38_ninja_multi.sh diff --git a/.gitlab/ci/env_fedora38_ninja_multi_clang.sh b/.gitlab/ci/env_fedora38_ninja_multi_clang.sh new file mode 100644 index 0000000..9f3edde --- /dev/null +++ b/.gitlab/ci/env_fedora38_ninja_multi_clang.sh @@ -0,0 +1 @@ +. .gitlab/ci/env_fedora38_common_clang.sh diff --git a/.gitlab/ci/pre_build_fedora37_tidy.sh b/.gitlab/ci/pre_build_fedora38_tidy.sh index 7580ef1..7580ef1 100644 --- a/.gitlab/ci/pre_build_fedora37_tidy.sh +++ b/.gitlab/ci/pre_build_fedora38_tidy.sh diff --git a/.gitlab/os-linux.yml b/.gitlab/os-linux.yml index 4ac7772..f4cc401 100644 --- a/.gitlab/os-linux.yml +++ b/.gitlab/os-linux.yml @@ -5,7 +5,7 @@ ### Release .linux_prep_source: - image: "fedora:37" + image: "fedora:38" variables: GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci" @@ -68,8 +68,8 @@ ### Fedora -.fedora37: - image: "kitware/cmake:ci-fedora37-x86_64-2023-05-17" +.fedora38: + image: "kitware/cmake:ci-fedora38-x86_64-2023-05-22" variables: GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci/long file name for testing purposes" @@ -77,37 +77,37 @@ #### Lint builds -.fedora37_tidy: - extends: .fedora37 +.fedora38_tidy: + extends: .fedora38 variables: - CMAKE_CONFIGURATION: fedora37_tidy + CMAKE_CONFIGURATION: fedora38_tidy CTEST_NO_WARNINGS_ALLOWED: 1 CMAKE_CI_NO_INSTALL: 1 -.fedora37_clang_analyzer: - extends: .fedora37 +.fedora38_clang_analyzer: + extends: .fedora38 variables: - CMAKE_CONFIGURATION: fedora37_clang_analyzer + CMAKE_CONFIGURATION: fedora38_clang_analyzer CMAKE_CI_BUILD_TYPE: Debug CTEST_NO_WARNINGS_ALLOWED: 1 CMAKE_CI_NO_INSTALL: 1 -.fedora37_sphinx: - extends: .fedora37 +.fedora38_sphinx: + extends: .fedora38 variables: - CMAKE_CONFIGURATION: fedora37_sphinx + CMAKE_CONFIGURATION: fedora38_sphinx CTEST_NO_WARNINGS_ALLOWED: 1 CTEST_SOURCE_SUBDIRECTORY: "Utilities/Sphinx" CMAKE_CI_NO_INSTALL: 1 -.fedora37_sphinx_package: - extends: .fedora37 +.fedora38_sphinx_package: + extends: .fedora38 variables: - CMAKE_CONFIGURATION: fedora37_sphinx_package + CMAKE_CONFIGURATION: fedora38_sphinx_package CTEST_SOURCE_SUBDIRECTORY: "Utilities/Sphinx" #### Build and test @@ -153,35 +153,35 @@ CMAKE_CI_BUILD_TYPE: Release CTEST_NO_WARNINGS_ALLOWED: 1 -.fedora37_extdeps: - extends: .fedora37 +.fedora38_extdeps: + extends: .fedora38 variables: - CMAKE_CONFIGURATION: fedora37_extdeps + CMAKE_CONFIGURATION: fedora38_extdeps CMAKE_CI_BUILD_TYPE: Release CTEST_NO_WARNINGS_ALLOWED: 1 -.fedora37_ninja: - extends: .fedora37 +.fedora38_ninja: + extends: .fedora38 variables: - CMAKE_CONFIGURATION: fedora37_ninja + CMAKE_CONFIGURATION: fedora38_ninja CMAKE_CI_BUILD_TYPE: Release CTEST_NO_WARNINGS_ALLOWED: 1 -.fedora37_ninja_multi: - extends: .fedora37 +.fedora38_ninja_multi: + extends: .fedora38 variables: - CMAKE_CONFIGURATION: fedora37_ninja_multi + CMAKE_CONFIGURATION: fedora38_ninja_multi CTEST_NO_WARNINGS_ALLOWED: 1 CMAKE_GENERATOR: "Ninja Multi-Config" -.fedora37_makefiles: - extends: .fedora37 +.fedora38_makefiles: + extends: .fedora38 variables: - CMAKE_CONFIGURATION: fedora37_makefiles + CMAKE_CONFIGURATION: fedora38_makefiles CTEST_NO_WARNINGS_ALLOWED: 1 CMAKE_GENERATOR: "Unix Makefiles" @@ -200,18 +200,25 @@ variables: CMAKE_CONFIGURATION: debian10_ninja_clang -.fedora37_makefiles_clang: - extends: .fedora37 +.fedora38_makefiles_clang: + extends: .fedora38 variables: - CMAKE_CONFIGURATION: fedora37_makefiles_clang + CMAKE_CONFIGURATION: fedora38_makefiles_clang CMAKE_GENERATOR: "Unix Makefiles" -.fedora37_ninja_clang: - extends: .fedora37 +.fedora38_ninja_clang: + extends: .fedora38 variables: - CMAKE_CONFIGURATION: fedora37_ninja_clang + CMAKE_CONFIGURATION: fedora38_ninja_clang + +.fedora38_ninja_multi_clang: + extends: .fedora38 + + variables: + CMAKE_CONFIGURATION: fedora38_ninja_multi_clang + CMAKE_GENERATOR: "Ninja Multi-Config" ### Sanitizers @@ -226,13 +233,13 @@ CTEST_MEMORYCHECK_TYPE: AddressSanitizer CTEST_MEMORYCHECK_SANITIZER_OPTIONS: "" -.fedora37_asan: +.fedora38_asan: extends: - - .fedora37 + - .fedora38 - .fedora_asan_addon variables: - CMAKE_CONFIGURATION: fedora37_asan + CMAKE_CONFIGURATION: fedora38_asan ### Intel Compiler @@ -376,28 +383,6 @@ CMAKE_CONFIGURATION: linux_gcc_cxx_modules_ninja_multi CMAKE_GENERATOR: "Ninja Multi-Config" -.clang_cxx_modules_x86_64: - image: "kitware/cmake:ci-clang_cxx_modules-x86_64-2023-02-15" - - variables: - GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci" - CMAKE_ARCH: x86_64 - CC: "/opt/llvm-p1689/bin/clang" - CXX: "/opt/llvm-p1689/bin/clang++" - -.clang_cxx_modules_ninja: - extends: .clang_cxx_modules_x86_64 - - variables: - CMAKE_CONFIGURATION: linux_clang_cxx_modules_ninja - -.clang_cxx_modules_ninja_multi: - extends: .clang_cxx_modules_x86_64 - - variables: - CMAKE_CONFIGURATION: linux_clang_cxx_modules_ninja_multi - CMAKE_GENERATOR: "Ninja Multi-Config" - ## Tags .linux_x86_64_tags: @@ -478,7 +463,7 @@ .cmake_codespell_linux: stage: build - extends: .fedora37 + extends: .fedora38 script: - .gitlab/ci/codespell.sh interruptible: true @@ -623,7 +608,7 @@ .cmake_org_help: stage: build extends: - - .fedora37 + - .fedora38 - .linux_x86_64_tags - .cmake_org_help_artifacts script: diff --git a/.gitlab/upload.yml b/.gitlab/upload.yml index 114808f..caa2119 100644 --- a/.gitlab/upload.yml +++ b/.gitlab/upload.yml @@ -1,7 +1,7 @@ # Steps for uploading artifacts .rsync_upload_package: - image: "fedora:37" + image: "fedora:38" stage: upload tags: - cmake @@ -21,7 +21,7 @@ .rsync_upload_help: stage: upload - image: "fedora:37" + image: "fedora:38" tags: - cmake - docker diff --git a/Help/command/include_directories.rst b/Help/command/include_directories.rst index d2948ed..e68bb81 100644 --- a/Help/command/include_directories.rst +++ b/Help/command/include_directories.rst @@ -25,7 +25,7 @@ prepending, independent of the default. If the ``SYSTEM`` option is given, the compiler will be told the directories are meant as system include directories on some platforms. -Signalling this setting might achieve effects such as the compiler +Signaling this setting might achieve effects such as the compiler skipping warnings, or these fixed-install system files not being considered in dependency calculations - see compiler docs. diff --git a/Help/manual/cmake-file-api.7.rst b/Help/manual/cmake-file-api.7.rst index 7ff9728..0bdb419 100644 --- a/Help/manual/cmake-file-api.7.rst +++ b/Help/manual/cmake-file-api.7.rst @@ -425,7 +425,7 @@ Version 1 does not exist to avoid confusion with that from { "kind": "codemodel", - "version": { "major": 2, "minor": 5 }, + "version": { "major": 2, "minor": 6 }, "paths": { "source": "/path/to/top-level-source-dir", "build": "/path/to/top-level-build-dir" @@ -1211,6 +1211,28 @@ with members: an unsigned integer 0-based index into the ``backtraceGraph`` member's ``nodes`` array. + ``frameworks`` + Optional member that is present when, on Apple platforms, there are + frameworks. The value is a JSON array with an entry for each directory. + Each entry is a JSON object with members: + + ``path`` + A string specifying the path to the framework directory, + represented with forward slashes. + + ``isSystem`` + Optional member that is present with boolean value ``true`` if + the framework is marked as a system one. + + ``backtrace`` + Optional member that is present when a CMake language backtrace to + the :command:`target_link_libraries` or other command invocation + that added this framework is available. The value is + an unsigned integer 0-based index into the ``backtraceGraph`` + member's ``nodes`` array. + + This field was added in codemodel version 2.6. + ``precompileHeaders`` Optional member that is present when :command:`target_precompile_headers` or other command invocations set :prop_tgt:`PRECOMPILE_HEADERS` on the diff --git a/Help/release/dev/FileAPI-Frameworks.rst b/Help/release/dev/FileAPI-Frameworks.rst new file mode 100644 index 0000000..65cf043 --- /dev/null +++ b/Help/release/dev/FileAPI-Frameworks.rst @@ -0,0 +1,7 @@ +FileAPI-Frameworks +------------------ + +* The :manual:`cmake-file-api(7)` "codemodel" version 2 ``version`` field has + been updated to 2.6. +* The :manual:`cmake-file-api(7)` "codemodel" version 2 "target" object gained + a new "frameworks" field in the "compileGroups" objects. diff --git a/Help/variable/MINGW.rst b/Help/variable/MINGW.rst index 27c56ea..fc2af2d 100644 --- a/Help/variable/MINGW.rst +++ b/Help/variable/MINGW.rst @@ -3,6 +3,7 @@ MINGW .. versionadded:: 3.2 -``True`` when using MinGW +Set to a true value when at least one language is enabled +with a compiler targeting the GNU ABI on Windows (MinGW). -Set to ``true`` when the compiler is some version of MinGW. +Otherwise, this variable is not set by CMake. diff --git a/Modules/CMakePackageConfigHelpers.cmake b/Modules/CMakePackageConfigHelpers.cmake index 1dc850a..581e65c 100644 --- a/Modules/CMakePackageConfigHelpers.cmake +++ b/Modules/CMakePackageConfigHelpers.cmake @@ -188,7 +188,7 @@ resulting version file. Depending on the ``COMPATIBILITY``, the corresponding ``BasicConfigVersion-<COMPATIBILITY>.cmake.in`` file is used. Please note that these files are internal to CMake and you should not call :command:`configure_file()` on them yourself, but they can be used as starting -point to create more sophisticted custom ``ConfigVersion.cmake`` files. +point to create more sophisticated custom ``ConfigVersion.cmake`` files. Example Generating Package Files ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/Modules/CPackComponent.cmake b/Modules/CPackComponent.cmake index 529f4e7..3b23b9f 100644 --- a/Modules/CPackComponent.cmake +++ b/Modules/CPackComponent.cmake @@ -149,7 +149,7 @@ installed or not. REQUIRED indicates that this component is required, and therefore will always be installed. It will be visible in the graphical installer, but it cannot be unselected. (Typically, required components are -shown greyed out). +shown grayed out). DISABLED indicates that this component should be disabled (unselected) by default. The user is free to select this component for diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake index 220b9ab..0d7f1a4 100644 --- a/Modules/FindCUDA.cmake +++ b/Modules/FindCUDA.cmake @@ -1942,7 +1942,7 @@ function(CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS output_file cuda_target options list(APPEND flags -Xcompiler ${f}) endforeach() - # Add our general CUDA_NVCC_FLAGS with the configuration specifig flags + # Add our general CUDA_NVCC_FLAGS with the configuration specific flags set(nvcc_flags ${CUDA_NVCC_FLAGS} ${config_specific_flags} ${nvcc_flags}) file(RELATIVE_PATH output_file_relative_path "${CMAKE_BINARY_DIR}" "${output_file}") diff --git a/Modules/FindMPI.cmake b/Modules/FindMPI.cmake index 1fbb4f9..e3246c6 100644 --- a/Modules/FindMPI.cmake +++ b/Modules/FindMPI.cmake @@ -1554,7 +1554,7 @@ foreach(LANG IN ITEMS C CXX Fortran) endif() endif() - # We are on a Cray, environment identfier: PE_ENV is set (CRAY), and + # We are on a Cray, environment identifier: PE_ENV is set (CRAY), and # have NOT found an mpic++-like compiler wrapper (previous block), # and we do NOT use the Cray cc/CC compiler wrappers as CC/CXX CMake # compiler. diff --git a/Modules/FindMatlab.cmake b/Modules/FindMatlab.cmake index e111b79..3ab6bc1 100644 --- a/Modules/FindMatlab.cmake +++ b/Modules/FindMatlab.cmake @@ -951,7 +951,7 @@ function(matlab_add_unit_test) endif() # The option to run a batch program with MATLAB changes depending on the MATLAB version - # For MATLAB before R2019a (9.6), the only supported option is -r, afterwords the suggested option + # For MATLAB before R2019a (9.6), the only supported option is -r, afterwards the suggested option # is -batch as -r is deprecated set(maut_BATCH_OPTION "-r") if(NOT (Matlab_VERSION_STRING STREQUAL "")) diff --git a/Modules/FindOpenGL.cmake b/Modules/FindOpenGL.cmake index a773601..843f787 100644 --- a/Modules/FindOpenGL.cmake +++ b/Modules/FindOpenGL.cmake @@ -160,7 +160,7 @@ The value may be one of: .. versionchanged:: 3.11 This is the default, unless policy :policy:`CMP0072` is set to ``OLD`` - and no components are requeted (since components + and no components are requested (since components correspond to GLVND libraries). ``LEGACY`` diff --git a/Modules/FindOpenSSL.cmake b/Modules/FindOpenSSL.cmake index 45dc9ac..426d00d 100644 --- a/Modules/FindOpenSSL.cmake +++ b/Modules/FindOpenSSL.cmake @@ -107,13 +107,13 @@ The following variables may be set to control search behavior: ``ENV{PKG_CONFIG_PATH}`` On UNIX-like systems, ``pkg-config`` is used to locate the system OpenSSL. - Set the ``PKG_CONFIG_PATH`` environment varialbe to look in alternate + Set the ``PKG_CONFIG_PATH`` environment variable to look in alternate locations. Useful on multi-lib systems. #]=======================================================================] macro(_OpenSSL_test_and_find_dependencies ssl_library crypto_library) unset(_OpenSSL_extra_static_deps) - if((CMAKE_SYSTEM_NAME STREQUAL "Linux") AND + if(UNIX AND (("${ssl_library}" MATCHES "\\${CMAKE_STATIC_LIBRARY_SUFFIX}$") OR ("${crypto_library}" MATCHES "\\${CMAKE_STATIC_LIBRARY_SUFFIX}$"))) set(_OpenSSL_has_dependencies TRUE) @@ -140,7 +140,7 @@ macro(_OpenSSL_test_and_find_dependencies ssl_library crypto_library) endif() endforeach() unset(_OPENSSL_DEP_LIB) - else() + elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux") set(_OpenSSL_has_dependency_dl TRUE) endif() if(_OpenSSL_ldflags_other) @@ -152,7 +152,7 @@ macro(_OpenSSL_test_and_find_dependencies ssl_library crypto_library) endif() endforeach() unset(_OPENSSL_DEP_LDFLAG) - else() + elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux") set(_OpenSSL_has_dependency_threads TRUE) find_package(Threads) endif() @@ -230,13 +230,15 @@ else() set(_OPENSSL_FIND_PATH_SUFFIX "include") endif() -if (MSVC) +if ((DEFINED OPENSSL_ROOT_DIR) OR (DEFINED ENV{OPENSSL_ROOT_DIR})) + set(_OPENSSL_ROOT_HINTS HINTS ${OPENSSL_ROOT_DIR} ENV OPENSSL_ROOT_DIR) + set(_OPENSSL_ROOT_PATHS NO_DEFAULT_PATH) +elseif (MSVC) # http://www.slproweb.com/products/Win32OpenSSL.html set(_OPENSSL_ROOT_HINTS - ${OPENSSL_ROOT_DIR} + HINTS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (32-bit)_is1;Inno Setup: App Path]" "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (64-bit)_is1;Inno Setup: App Path]" - ENV OPENSSL_ROOT_DIR ) if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "8") @@ -255,6 +257,7 @@ if (MSVC) endif() set(_OPENSSL_ROOT_PATHS + PATHS "${_programfiles}/OpenSSL" "${_programfiles}/OpenSSL-${_arch}" "C:/OpenSSL/" @@ -262,16 +265,11 @@ if (MSVC) ) unset(_programfiles) unset(_arch) -else () - set(_OPENSSL_ROOT_HINTS - ${OPENSSL_ROOT_DIR} - ENV OPENSSL_ROOT_DIR - ) endif () set(_OPENSSL_ROOT_HINTS_AND_PATHS - HINTS ${_OPENSSL_ROOT_HINTS} - PATHS ${_OPENSSL_ROOT_PATHS} + ${_OPENSSL_ROOT_HINTS} + ${_OPENSSL_ROOT_PATHS} ) find_path(OPENSSL_INCLUDE_DIR diff --git a/Modules/FindwxWindows.cmake b/Modules/FindwxWindows.cmake index 15dacbb..6e4be91 100644 --- a/Modules/FindwxWindows.cmake +++ b/Modules/FindwxWindows.cmake @@ -613,7 +613,7 @@ else() option(WXWINDOWS_USE_SHARED_LIBS "Use shared versions (.so) of wxWindows libraries" ON) mark_as_advanced(WXWINDOWS_USE_SHARED_LIBS) - # JW removed option and force the develper th SET it. + # JW removed option and force the developer to SET it. # option(WXWINDOWS_USE_GL "use wxWindows with GL support (use additional # --gl-libs for wx-config)?" OFF) diff --git a/Modules/Internal/CPack/CPackRPM.cmake b/Modules/Internal/CPack/CPackRPM.cmake index 8ac1f6b..36c0a3f 100644 --- a/Modules/Internal/CPack/CPackRPM.cmake +++ b/Modules/Internal/CPack/CPackRPM.cmake @@ -1150,7 +1150,7 @@ function(cpack_rpm_generate_package) endforeach() # CPACK_RPM_SPEC_INSTALL_POST - # May be used to define a RPM post intallation script + # May be used to define a RPM post installation script # for example setting it to "/bin/true" may prevent # rpmbuild from stripping binaries. if(CPACK_RPM_SPEC_INSTALL_POST) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 1f28d4e..5c563c9 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,7 +1,7 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 26) -set(CMake_VERSION_PATCH 20230522) +set(CMake_VERSION_PATCH 20230523) #set(CMake_VERSION_RC 0) set(CMake_VERSION_IS_DIRTY 0) diff --git a/Source/CPack/cmCPackInnoSetupGenerator.cxx b/Source/CPack/cmCPackInnoSetupGenerator.cxx index d8825d4..5d2c208 100644 --- a/Source/CPack/cmCPackInnoSetupGenerator.cxx +++ b/Source/CPack/cmCPackInnoSetupGenerator.cxx @@ -277,7 +277,7 @@ bool cmCPackInnoSetupGenerator::ProcessSetupSection() return false; } - const std::string& architecture = GetOption("CPACK_INNOSETUP_ARCHITECTURE"); + cmValue const architecture = GetOption("CPACK_INNOSETUP_ARCHITECTURE"); if (architecture != "x86" && architecture != "x64" && architecture != "arm64" && architecture != "ia64") { cmCPackLogger(cmCPackLog::LOG_ERROR, diff --git a/Source/CursesDialog/form/frm_def.c b/Source/CursesDialog/form/frm_def.c index 645b3ba..569057b 100644 --- a/Source/CursesDialog/form/frm_def.c +++ b/Source/CursesDialog/form/frm_def.c @@ -220,6 +220,10 @@ static int Connect_Fields(FORM * form, FIELD ** fields) for(page_nr = 0;page_nr < form->maxpage; page_nr++) { FIELD *fld = (FIELD *)0; + #ifdef __clang_analyzer__ + /* Tell clang-analyzer the loop body runs at least once. */ + assert(form->page[page_nr].pmin <= form->page[page_nr].pmax); + #endif for(j = form->page[page_nr].pmin;j <= form->page[page_nr].pmax;j++) { fields[j]->index = j; diff --git a/Source/cmCPluginAPI.h b/Source/cmCPluginAPI.h index 13a93b7..92dff57 100644 --- a/Source/cmCPluginAPI.h +++ b/Source/cmCPluginAPI.h @@ -32,7 +32,7 @@ cmCPLuginAPI.cxx typedef struct { /*========================================================================= - Here we define the set of functions that a plugin may call. The first goup + Here we define the set of functions that a plugin may call. The first group of functions are utility functions that are specific to the plugin API =========================================================================*/ /* set/Get the ClientData in the cmLoadedCommandInfo structure, this is how diff --git a/Source/cmCommandArgumentParserHelper.cxx b/Source/cmCommandArgumentParserHelper.cxx index 2ed04e5..a20f5a5 100644 --- a/Source/cmCommandArgumentParserHelper.cxx +++ b/Source/cmCommandArgumentParserHelper.cxx @@ -96,7 +96,8 @@ const char* cmCommandArgumentParserHelper::ExpandVariable(const char* var) } if (this->FileLine >= 0 && strcmp(var, "CMAKE_CURRENT_LIST_LINE") == 0) { std::string line; - cmListFileContext const& top = this->Makefile->GetBacktrace().Top(); + cmListFileBacktrace bt = this->Makefile->GetBacktrace(); + cmListFileContext const& top = bt.Top(); if (top.DeferId) { line = cmStrCat("DEFERRED:"_s, *top.DeferId); } else { diff --git a/Source/cmCommonTargetGenerator.cxx b/Source/cmCommonTargetGenerator.cxx index 2615494..e635dd9 100644 --- a/Source/cmCommonTargetGenerator.cxx +++ b/Source/cmCommonTargetGenerator.cxx @@ -236,7 +236,7 @@ std::string cmCommonTargetGenerator::GetManifests(const std::string& config) manifests.reserve(manifest_srcs.size()); std::string lang = this->GeneratorTarget->GetLinkerLanguage(config); - std::string const& manifestFlag = + std::string manifestFlag = this->Makefile->GetDefinition("CMAKE_" + lang + "_LINKER_MANIFEST_FLAG"); for (cmSourceFile const* manifest_src : manifest_srcs) { manifests.push_back(manifestFlag + diff --git a/Source/cmConditionEvaluator.cxx b/Source/cmConditionEvaluator.cxx index 288e107..6f9f541 100644 --- a/Source/cmConditionEvaluator.cxx +++ b/Source/cmConditionEvaluator.cxx @@ -741,8 +741,8 @@ bool cmConditionEvaluator::HandleLevel2(cmArgumentList& newArgs, keyVERSION_LESS_EQUAL, keyVERSION_GREATER, keyVERSION_GREATER_EQUAL, keyVERSION_EQUAL))) { const auto op = MATCH2CMPOP[matchNo - 1]; - const std::string& lhs = this->GetVariableOrString(*args.current); - const std::string& rhs = this->GetVariableOrString(*args.nextnext); + const cmValue lhs = this->GetVariableOrString(*args.current); + const cmValue rhs = this->GetVariableOrString(*args.nextnext); const auto result = cmSystemTools::VersionCompare(op, lhs, rhs); newArgs.ReduceTwoArgs(result, args); } diff --git a/Source/cmCustomCommandGenerator.cxx b/Source/cmCustomCommandGenerator.cxx index 7623ccf..2c1480a 100644 --- a/Source/cmCustomCommandGenerator.cxx +++ b/Source/cmCustomCommandGenerator.cxx @@ -332,9 +332,9 @@ const char* cmCustomCommandGenerator::GetArgv0Location(unsigned int c) const bool cmCustomCommandGenerator::HasOnlyEmptyCommandLines() const { - for (size_t i = 0; i < this->CommandLines.size(); ++i) { - for (size_t j = 0; j < this->CommandLines[i].size(); ++j) { - if (!this->CommandLines[i][j].empty()) { + for (cmCustomCommandLine const& ccl : this->CommandLines) { + for (std::string const& cl : ccl) { + if (!cl.empty()) { return false; } } diff --git a/Source/cmDependsFortran.cxx b/Source/cmDependsFortran.cxx index aede3fe..d038db7 100644 --- a/Source/cmDependsFortran.cxx +++ b/Source/cmDependsFortran.cxx @@ -416,7 +416,7 @@ bool cmDependsFortran::WriteDependenciesReal(std::string const& obj, // file is not updated. In such case the stamp file will be always // older than its prerequisite and trigger cmake_copy_f90_mod // on each new build. This is expected behavior for incremental - // builds and can not be changed without preforming recursive make + // builds and can not be changed without performing recursive make // calls that would considerably slow down the building process. makeDepends << stampFileForMake << ": " << obj_m << '\n'; makeDepends << "\t$(CMAKE_COMMAND) -E cmake_copy_f90_mod " << modFile diff --git a/Source/cmDependsJavaParserHelper.cxx b/Source/cmDependsJavaParserHelper.cxx index 0c5d310..6e617f6 100644 --- a/Source/cmDependsJavaParserHelper.cxx +++ b/Source/cmDependsJavaParserHelper.cxx @@ -155,7 +155,7 @@ void cmDependsJavaParserHelper::CheckEmpty( void cmDependsJavaParserHelper::PrepareElement( cmDependsJavaParserHelper::ParserType* me) { - // Inititalize self + // Initialize self me->str = nullptr; } diff --git a/Source/cmExternalMakefileProjectGenerator.cxx b/Source/cmExternalMakefileProjectGenerator.cxx index 5895d66..5fecb35 100644 --- a/Source/cmExternalMakefileProjectGenerator.cxx +++ b/Source/cmExternalMakefileProjectGenerator.cxx @@ -17,14 +17,13 @@ void cmExternalMakefileProjectGenerator::EnableLanguage( std::string cmExternalMakefileProjectGenerator::CreateFullGeneratorName( const std::string& globalGenerator, const std::string& extraGenerator) { - std::string fullName; - if (!globalGenerator.empty()) { - if (!extraGenerator.empty()) { - fullName = cmStrCat(extraGenerator, " - "); - } - fullName += globalGenerator; + if (globalGenerator.empty()) { + return {}; } - return fullName; + if (extraGenerator.empty()) { + return globalGenerator; + } + return cmStrCat(extraGenerator, " - ", globalGenerator); } bool cmExternalMakefileProjectGenerator::Open( diff --git a/Source/cmFileAPI.cxx b/Source/cmFileAPI.cxx index d1d3d25..8b98916 100644 --- a/Source/cmFileAPI.cxx +++ b/Source/cmFileAPI.cxx @@ -728,7 +728,7 @@ std::string cmFileAPI::NoSupportedVersion( // The "codemodel" object kind. // Update Help/manual/cmake-file-api.7.rst when updating this constant. -static unsigned int const CodeModelV2Minor = 5; +static unsigned int const CodeModelV2Minor = 6; void cmFileAPI::BuildClientRequestCodeModel( ClientRequest& r, std::vector<RequestVersion> const& versions) diff --git a/Source/cmFileAPICodemodel.cxx b/Source/cmFileAPICodemodel.cxx index 4a8716f..280ebb0 100644 --- a/Source/cmFileAPICodemodel.cxx +++ b/Source/cmFileAPICodemodel.cxx @@ -328,6 +328,7 @@ struct CompileData std::vector<JBT<std::string>> Defines; std::vector<JBT<std::string>> PrecompileHeaders; std::vector<IncludeEntry> Includes; + std::vector<IncludeEntry> Frameworks; friend bool operator==(CompileData const& l, CompileData const& r) { @@ -335,7 +336,7 @@ struct CompileData l.Flags == r.Flags && l.Defines == r.Defines && l.PrecompileHeaders == r.PrecompileHeaders && l.LanguageStandard == r.LanguageStandard && - l.Includes == r.Includes); + l.Includes == r.Includes && l.Frameworks == r.Frameworks); } }; } @@ -356,6 +357,12 @@ struct hash<CompileData> hash<Json::ArrayIndex>()(i.Path.Backtrace.Index) ^ (i.IsSystem ? std::numeric_limits<size_t>::max() : 0)); } + for (auto const& i : in.Frameworks) { + result = result ^ + (hash<std::string>()(i.Path.Value) ^ + hash<Json::ArrayIndex>()(i.Path.Backtrace.Index) ^ + (i.IsSystem ? std::numeric_limits<size_t>::max() : 0)); + } for (auto const& i : in.Flags) { result = result ^ hash<std::string>()(i.Value) ^ hash<Json::ArrayIndex>()(i.Backtrace.Index); @@ -468,6 +475,7 @@ class Target Json::Value DumpPaths(); Json::Value DumpCompileData(CompileData const& cd); Json::Value DumpInclude(CompileData::IncludeEntry const& inc); + Json::Value DumpFramework(CompileData::IncludeEntry const& fw); Json::Value DumpPrecompileHeader(JBT<std::string> const& header); Json::Value DumpLanguageStandard(JBTs<std::string> const& standard); Json::Value DumpDefine(JBT<std::string> const& def); @@ -1294,9 +1302,15 @@ void Target::ProcessLanguage(std::string const& lang) std::vector<BT<std::string>> includePathList = lg->GetIncludeDirectories(this->GT, lang, this->Config); for (BT<std::string> const& i : includePathList) { - cd.Includes.emplace_back( - this->ToJBT(i), - this->GT->IsSystemIncludeDirectory(i.Value, this->Config, lang)); + if (this->GT->IsApple() && cmSystemTools::IsPathToFramework(i.Value)) { + cd.Frameworks.emplace_back( + this->ToJBT(i), + this->GT->IsSystemIncludeDirectory(i.Value, this->Config, lang)); + } else { + cd.Includes.emplace_back( + this->ToJBT(i), + this->GT->IsSystemIncludeDirectory(i.Value, this->Config, lang)); + } } std::vector<BT<std::string>> precompileHeaders = this->GT->GetPrecompileHeaders(this->Config, lang); @@ -1408,7 +1422,11 @@ CompileData Target::BuildCompileData(cmSourceFile* sf) bool const isSystemInclude = this->GT->IsSystemIncludeDirectory(i, this->Config, fd.Language); BT<std::string> include(i, tmpInclude.Backtrace); - fd.Includes.emplace_back(this->ToJBT(include), isSystemInclude); + if (this->GT->IsApple() && cmSystemTools::IsPathToFramework(i)) { + fd.Frameworks.emplace_back(this->ToJBT(include), isSystemInclude); + } else { + fd.Includes.emplace_back(this->ToJBT(include), isSystemInclude); + } } } } @@ -1481,6 +1499,13 @@ CompileData Target::MergeCompileData(CompileData const& fd) cd.Includes.insert(cd.Includes.end(), td.Includes.begin(), td.Includes.end()); + // Use source-specific frameworks followed by target-wide frameworks. + cd.Frameworks.reserve(fd.Frameworks.size() + td.Frameworks.size()); + cd.Frameworks.insert(cd.Frameworks.end(), fd.Frameworks.begin(), + fd.Frameworks.end()); + cd.Frameworks.insert(cd.Frameworks.end(), td.Frameworks.begin(), + td.Frameworks.end()); + // Use target-wide defines followed by source-specific defines. cd.Defines.reserve(td.Defines.size() + fd.Defines.size()); cd.Defines.insert(cd.Defines.end(), td.Defines.begin(), td.Defines.end()); @@ -1696,6 +1721,13 @@ Json::Value Target::DumpCompileData(CompileData const& cd) } result["includes"] = includes; } + if (!cd.Frameworks.empty()) { + Json::Value frameworks = Json::arrayValue; + for (auto const& i : cd.Frameworks) { + frameworks.append(this->DumpFramework(i)); + } + result["frameworks"] = frameworks; + } if (!cd.Defines.empty()) { Json::Value defines = Json::arrayValue; for (JBT<std::string> const& d : cd.Defines) { @@ -1729,6 +1761,12 @@ Json::Value Target::DumpInclude(CompileData::IncludeEntry const& inc) return include; } +Json::Value Target::DumpFramework(CompileData::IncludeEntry const& fw) +{ + // for now, idem as include + return this->DumpInclude(fw); +} + Json::Value Target::DumpPrecompileHeader(JBT<std::string> const& header) { Json::Value precompileHeader = Json::objectValue; diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 32f0cbd..f8455c8 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -59,8 +59,6 @@ namespace { using LinkInterfaceFor = cmGeneratorTarget::LinkInterfaceFor; -const cmsys::RegularExpression FrameworkRegularExpression( - "^(.*/)?([^/]*)\\.framework/(.*)$"); const std::string kINTERFACE_LINK_LIBRARIES = "INTERFACE_LINK_LIBRARIES"; const std::string kINTERFACE_LINK_LIBRARIES_DIRECT = "INTERFACE_LINK_LIBRARIES_DIRECT"; @@ -2434,11 +2432,10 @@ std::string cmGeneratorTarget::GetSOName( } // Use the soname given if any. if (this->IsFrameworkOnApple()) { - cmsys::RegularExpressionMatch match; - if (FrameworkRegularExpression.find(info->SOName.c_str(), match)) { - auto frameworkName = match.match(2); - auto fileName = match.match(3); - return cmStrCat(frameworkName, ".framework/", fileName); + auto fwDescriptor = this->GetGlobalGenerator()->SplitFrameworkPath( + info->SOName, cmGlobalGenerator::FrameworkFormat::Strict); + if (fwDescriptor) { + return fwDescriptor->GetVersionedName(); } } if (cmHasLiteralPrefix(info->SOName, "@rpath/")) { @@ -7036,13 +7033,10 @@ std::string cmGeneratorTarget::GetDirectory( if (this->IsImported()) { auto fullPath = this->Target->ImportedGetFullPath(config, artifact); if (this->IsFrameworkOnApple()) { - cmsys::RegularExpressionMatch match; - if (FrameworkRegularExpression.find(fullPath.c_str(), match)) { - auto path = match.match(1); - if (!path.empty()) { - path.erase(path.length() - 1); - } - return path; + auto fwDescriptor = this->GetGlobalGenerator()->SplitFrameworkPath( + fullPath, cmGlobalGenerator::FrameworkFormat::Strict); + if (fwDescriptor) { + return fwDescriptor->Directory; } } // Return the directory from which the target is imported. diff --git a/Source/cmGetTestPropertyCommand.cxx b/Source/cmGetTestPropertyCommand.cxx index a4ac9f6..36446c9 100644 --- a/Source/cmGetTestPropertyCommand.cxx +++ b/Source/cmGetTestPropertyCommand.cxx @@ -25,7 +25,7 @@ bool cmGetTestPropertyCommand(std::vector<std::string> const& args, prop = test->GetProperty(args[1]); } if (prop) { - mf.AddDefinition(var, prop->c_str()); + mf.AddDefinition(var, prop); return true; } } diff --git a/Source/cmGlobalCommonGenerator.cxx b/Source/cmGlobalCommonGenerator.cxx index 7a44452..513e3bf 100644 --- a/Source/cmGlobalCommonGenerator.cxx +++ b/Source/cmGlobalCommonGenerator.cxx @@ -34,8 +34,8 @@ cmGlobalCommonGenerator::ComputeDirectoryTargets() const { std::map<std::string, DirectoryTarget> dirTargets; for (const auto& lg : this->LocalGenerators) { - std::string const& currentBinaryDir( - lg->GetStateSnapshot().GetDirectory().GetCurrentBinary()); + std::string currentBinaryDir = + lg->GetStateSnapshot().GetDirectory().GetCurrentBinary(); DirectoryTarget& dirTarget = dirTargets[currentBinaryDir]; dirTarget.LG = lg.get(); const std::vector<std::string>& configs = @@ -68,7 +68,7 @@ cmGlobalCommonGenerator::ComputeDirectoryTargets() const for (cmStateSnapshot dir = lg->GetStateSnapshot().GetBuildsystemDirectoryParent(); dir.IsValid(); dir = dir.GetBuildsystemDirectoryParent()) { - std::string const& d = dir.GetDirectory().GetCurrentBinary(); + std::string d = dir.GetDirectory().GetCurrentBinary(); dirTargets[d].Targets.emplace_back(t); } } diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 040f500..5d0f8b2 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -2598,14 +2598,14 @@ cmGlobalGenerator::SplitFrameworkPath(const std::string& path, // or (/path/to/)?FwName.framework/FwName(.tbd)? // or (/path/to/)?FwName.framework/Versions/*/FwName(.tbd)? static cmsys::RegularExpression frameworkPath( - "((.+)/)?(.+)\\.framework(/Versions/[^/]+)?(/(.+))?$"); + "((.+)/)?([^/]+)\\.framework(/Versions/([^/]+))?(/(.+))?$"); auto ext = cmSystemTools::GetFilenameLastExtension(path); if ((ext.empty() || ext == ".tbd" || ext == ".framework") && frameworkPath.find(path)) { auto name = frameworkPath.match(3); auto libname = - cmSystemTools::GetFilenameWithoutExtension(frameworkPath.match(6)); + cmSystemTools::GetFilenameWithoutExtension(frameworkPath.match(7)); if (format == FrameworkFormat::Strict && libname.empty()) { return cm::nullopt; } @@ -2614,11 +2614,12 @@ cmGlobalGenerator::SplitFrameworkPath(const std::string& path, } if (libname.empty() || name.size() == libname.size()) { - return FrameworkDescriptor{ frameworkPath.match(2), name }; + return FrameworkDescriptor{ frameworkPath.match(2), + frameworkPath.match(5), name }; } - return FrameworkDescriptor{ frameworkPath.match(2), name, - libname.substr(name.size()) }; + return FrameworkDescriptor{ frameworkPath.match(2), frameworkPath.match(5), + name, libname.substr(name.size()) }; } if (format == FrameworkFormat::Extended) { diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index 79fe52c..d657fc8 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -384,9 +384,17 @@ public: , Name(std::move(name)) { } - FrameworkDescriptor(std::string directory, std::string name, - std::string suffix) + FrameworkDescriptor(std::string directory, std::string version, + std::string name) : Directory(std::move(directory)) + , Version(std::move(version)) + , Name(std::move(name)) + { + } + FrameworkDescriptor(std::string directory, std::string version, + std::string name, std::string suffix) + : Directory(std::move(directory)) + , Version(std::move(version)) , Name(std::move(name)) , Suffix(std::move(suffix)) { @@ -400,6 +408,13 @@ public: { return cmStrCat(this->Name, ".framework/"_s, this->Name, this->Suffix); } + std::string GetVersionedName() const + { + return this->Version.empty() + ? this->GetFullName() + : cmStrCat(this->Name, ".framework/Versions/"_s, this->Version, '/', + this->Name, this->Suffix); + } std::string GetFrameworkPath() const { return this->Directory.empty() @@ -412,8 +427,15 @@ public: ? this->GetFullName() : cmStrCat(this->Directory, '/', this->GetFullName()); } + std::string GetVersionedPath() const + { + return this->Directory.empty() + ? this->GetVersionedName() + : cmStrCat(this->Directory, '/', this->GetVersionedName()); + } const std::string Directory; + const std::string Version; const std::string Name; const std::string Suffix; }; diff --git a/Source/cmGlobalGhsMultiGenerator.cxx b/Source/cmGlobalGhsMultiGenerator.cxx index 578e805..2453bfc 100644 --- a/Source/cmGlobalGhsMultiGenerator.cxx +++ b/Source/cmGlobalGhsMultiGenerator.cxx @@ -101,11 +101,11 @@ bool cmGlobalGhsMultiGenerator::SetGeneratorToolset(std::string const& ts, /* check if the toolset changed from last generate */ if (cmNonempty(prevTool) && !cmSystemTools::ComparePath(gbuild, *prevTool)) { - std::string const& e = - cmStrCat("toolset build tool: ", gbuild, - "\nDoes not match the previously used build tool: ", *prevTool, - "\nEither remove the CMakeCache.txt file and CMakeFiles " - "directory or choose a different binary directory."); + std::string const& e = cmStrCat( + "toolset build tool: ", gbuild, '\n', + "Does not match the previously used build tool: ", *prevTool, '\n', + "Either remove the CMakeCache.txt file and CMakeFiles " + "directory or choose a different binary directory."); mf->IssueMessage(MessageType::FATAL_ERROR, e); return false; } diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx index 694698e..b254777 100644 --- a/Source/cmGlobalVisualStudio7Generator.cxx +++ b/Source/cmGlobalVisualStudio7Generator.cxx @@ -716,7 +716,7 @@ std::set<std::string> cmGlobalVisualStudio7Generator::IsPartOfDefaultBuild( cmGeneratorTarget const* target) { std::set<std::string> activeConfigs; - // if it is a utilitiy target then only make it part of the + // if it is a utility target then only make it part of the // default build if another target depends on it int type = target->GetType(); if (type == cmStateEnums::GLOBAL_TARGET) { diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx index b07a74b..fc3caa1 100644 --- a/Source/cmMakefileLibraryTargetGenerator.cxx +++ b/Source/cmMakefileLibraryTargetGenerator.cxx @@ -785,7 +785,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules( if (this->GeneratorTarget->HasSOName(this->GetConfigName())) { vars.SONameFlag = this->Makefile->GetSONameFlag(linkLanguage); targetOutSOName = this->LocalGenerator->ConvertToOutputFormat( - this->TargetNames.SharedObject.c_str(), cmOutputConverter::SHELL); + this->TargetNames.SharedObject, cmOutputConverter::SHELL); vars.TargetSOName = targetOutSOName.c_str(); } vars.LinkFlags = linkFlags.c_str(); diff --git a/Source/cmMessenger.cxx b/Source/cmMessenger.cxx index ff513be..7de8936 100644 --- a/Source/cmMessenger.cxx +++ b/Source/cmMessenger.cxx @@ -18,51 +18,38 @@ MessageType cmMessenger::ConvertMessageType(MessageType t) const { - bool warningsAsErrors; - if (t == MessageType::AUTHOR_WARNING || t == MessageType::AUTHOR_ERROR) { - warningsAsErrors = this->GetDevWarningsAsErrors(); - if (warningsAsErrors && t == MessageType::AUTHOR_WARNING) { - t = MessageType::AUTHOR_ERROR; - } else if (!warningsAsErrors && t == MessageType::AUTHOR_ERROR) { - t = MessageType::AUTHOR_WARNING; + if (this->GetDevWarningsAsErrors()) { + return MessageType::AUTHOR_ERROR; } - } else if (t == MessageType::DEPRECATION_WARNING || - t == MessageType::DEPRECATION_ERROR) { - warningsAsErrors = this->GetDeprecatedWarningsAsErrors(); - if (warningsAsErrors && t == MessageType::DEPRECATION_WARNING) { - t = MessageType::DEPRECATION_ERROR; - } else if (!warningsAsErrors && t == MessageType::DEPRECATION_ERROR) { - t = MessageType::DEPRECATION_WARNING; + return MessageType::AUTHOR_WARNING; + } + if (t == MessageType::DEPRECATION_WARNING || + t == MessageType::DEPRECATION_ERROR) { + if (this->GetDeprecatedWarningsAsErrors()) { + return MessageType::DEPRECATION_ERROR; } + return MessageType::DEPRECATION_WARNING; } - return t; } bool cmMessenger::IsMessageTypeVisible(MessageType t) const { - bool isVisible = true; - if (t == MessageType::DEPRECATION_ERROR) { - if (!this->GetDeprecatedWarningsAsErrors()) { - isVisible = false; - } - } else if (t == MessageType::DEPRECATION_WARNING) { - if (this->GetSuppressDeprecatedWarnings()) { - isVisible = false; - } - } else if (t == MessageType::AUTHOR_ERROR) { - if (!this->GetDevWarningsAsErrors()) { - isVisible = false; - } - } else if (t == MessageType::AUTHOR_WARNING) { - if (this->GetSuppressDevWarnings()) { - isVisible = false; - } + return this->GetDeprecatedWarningsAsErrors(); + } + if (t == MessageType::DEPRECATION_WARNING) { + return !this->GetSuppressDeprecatedWarnings(); + } + if (t == MessageType::AUTHOR_ERROR) { + return this->GetDevWarningsAsErrors(); + } + if (t == MessageType::AUTHOR_WARNING) { + return !this->GetSuppressDevWarnings(); } - return isVisible; + return true; } static bool printMessagePreamble(MessageType t, std::ostream& msg) diff --git a/Source/cmQtAutoMocUic.cxx b/Source/cmQtAutoMocUic.cxx index b7af859..a101a81 100644 --- a/Source/cmQtAutoMocUic.cxx +++ b/Source/cmQtAutoMocUic.cxx @@ -2272,10 +2272,9 @@ cmQtAutoMocUicT::JobDepFilesMergeT::initialDependencies() const void cmQtAutoMocUicT::JobDepFilesMergeT::Process() { if (this->Log().Verbose()) { - this->Log().Info( - GenT::MOC, - cmStrCat("Merging MOC dependencies into ", - this->MessagePath(this->BaseConst().DepFile.c_str()))); + this->Log().Info(GenT::MOC, + cmStrCat("Merging MOC dependencies into ", + this->MessagePath(this->BaseConst().DepFile))); } auto processDepFile = [this](const std::string& mocOutputFile) -> std::vector<std::string> { diff --git a/Source/cmState.cxx b/Source/cmState.cxx index f12f91f..bbafc92 100644 --- a/Source/cmState.cxx +++ b/Source/cmState.cxx @@ -101,11 +101,13 @@ cmStateEnums::CacheEntryType cmState::StringToCacheEntryType( bool cmState::StringToCacheEntryType(const std::string& s, cmStateEnums::CacheEntryType& type) { - for (size_t i = 0; i < cmCacheEntryTypes.size(); ++i) { - if (s == cmCacheEntryTypes[i]) { - type = static_cast<cmStateEnums::CacheEntryType>(i); - return true; - } + // NOLINTNEXTLINE(readability-qualified-auto) + auto const entry = + std::find(cmCacheEntryTypes.begin(), cmCacheEntryTypes.end(), s); + if (entry != cmCacheEntryTypes.end()) { + type = static_cast<cmStateEnums::CacheEntryType>( + entry - cmCacheEntryTypes.begin()); + return true; } return false; } diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 0fd7461..284c5e7 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -2138,12 +2138,10 @@ int cmake::DoPreConfigureChecks() std::string cacheStart = cmStrCat(*this->State->GetInitializedCacheValue("CMAKE_HOME_DIRECTORY"), "/CMakeLists.txt"); - std::string currentStart = - cmStrCat(this->GetHomeDirectory(), "/CMakeLists.txt"); - if (!cmSystemTools::SameFile(cacheStart, currentStart)) { + if (!cmSystemTools::SameFile(cacheStart, srcList)) { std::string message = - cmStrCat("The source \"", currentStart, - "\" does not match the source \"", cacheStart, + cmStrCat("The source \"", srcList, "\" does not match the source \"", + cacheStart, "\" used to generate cache. Re-run cmake with a different " "source directory."); cmSystemTools::Error(message); @@ -2371,16 +2369,16 @@ int cmake::ActualConfigure() cmValue genName = this->State->GetInitializedCacheValue("CMAKE_GENERATOR"); if (genName) { if (!this->GlobalGenerator->MatchesGeneratorName(*genName)) { - std::string message = - cmStrCat("Error: generator : ", this->GlobalGenerator->GetName(), - "\nDoes not match the generator used previously: ", *genName, - "\nEither remove the CMakeCache.txt file and CMakeFiles " - "directory or choose a different binary directory."); + std::string message = cmStrCat( + "Error: generator : ", this->GlobalGenerator->GetName(), '\n', + "Does not match the generator used previously: ", *genName, '\n', + "Either remove the CMakeCache.txt file and CMakeFiles " + "directory or choose a different binary directory."); cmSystemTools::Error(message); return -2; } } - if (!this->State->GetInitializedCacheValue("CMAKE_GENERATOR")) { + if (!genName) { this->AddCacheEntry("CMAKE_GENERATOR", this->GlobalGenerator->GetName(), "Name of generator.", cmStateEnums::INTERNAL); this->AddCacheEntry( @@ -2401,11 +2399,11 @@ int cmake::ActualConfigure() if (cmValue instance = this->State->GetInitializedCacheValue("CMAKE_GENERATOR_INSTANCE")) { if (this->GeneratorInstanceSet && this->GeneratorInstance != *instance) { - std::string message = - cmStrCat("Error: generator instance: ", this->GeneratorInstance, - "\nDoes not match the instance used previously: ", *instance, - "\nEither remove the CMakeCache.txt file and CMakeFiles " - "directory or choose a different binary directory."); + std::string message = cmStrCat( + "Error: generator instance: ", this->GeneratorInstance, '\n', + "Does not match the instance used previously: ", *instance, '\n', + "Either remove the CMakeCache.txt file and CMakeFiles " + "directory or choose a different binary directory."); cmSystemTools::Error(message); return -2; } @@ -2420,9 +2418,9 @@ int cmake::ActualConfigure() if (this->GeneratorPlatformSet && this->GeneratorPlatform != *platformName) { std::string message = cmStrCat( - "Error: generator platform: ", this->GeneratorPlatform, - "\nDoes not match the platform used previously: ", *platformName, - "\nEither remove the CMakeCache.txt file and CMakeFiles " + "Error: generator platform: ", this->GeneratorPlatform, '\n', + "Does not match the platform used previously: ", *platformName, '\n', + "Either remove the CMakeCache.txt file and CMakeFiles " "directory or choose a different binary directory."); cmSystemTools::Error(message); return -2; @@ -2436,9 +2434,9 @@ int cmake::ActualConfigure() this->State->GetInitializedCacheValue("CMAKE_GENERATOR_TOOLSET")) { if (this->GeneratorToolsetSet && this->GeneratorToolset != *tsName) { std::string message = - cmStrCat("Error: generator toolset: ", this->GeneratorToolset, - "\nDoes not match the toolset used previously: ", *tsName, - "\nEither remove the CMakeCache.txt file and CMakeFiles " + cmStrCat("Error: generator toolset: ", this->GeneratorToolset, '\n', + "Does not match the toolset used previously: ", *tsName, '\n', + "Either remove the CMakeCache.txt file and CMakeFiles " "directory or choose a different binary directory."); cmSystemTools::Error(message); return -2; diff --git a/Source/kwsys/RegularExpression.cxx b/Source/kwsys/RegularExpression.cxx index f2f5143..b51e16d 100644 --- a/Source/kwsys/RegularExpression.cxx +++ b/Source/kwsys/RegularExpression.cxx @@ -378,6 +378,10 @@ bool RegularExpression::compile(const char* exp) return false; } +#ifdef __clang_analyzer__ /* Convince it that the program is initialized. */ + memset(this->program, 0, comp.regsize); +#endif + // Second pass: emit code. comp.regparse = exp; comp.regnpar = 1; diff --git a/Tests/FindOpenAL/Test/main.cxx b/Tests/FindOpenAL/Test/main.cxx index 1396c60..27204fb 100644 --- a/Tests/FindOpenAL/Test/main.cxx +++ b/Tests/FindOpenAL/Test/main.cxx @@ -10,9 +10,10 @@ int main() { /* Reference an AL symbol without requiring a context at runtime. */ - printf("&alGetString = %p\n", &alGetString); + printf("AL_VERSION: %s\n", alGetString(AL_VERSION)); /* Reference an ALC symbol without requiring a context at runtime. */ - printf("&alcGetString = %p\n", &alcGetString); + printf("ALC_DEVICE_SPECIFIER: %s\n", + alcGetString(NULL, ALC_DEVICE_SPECIFIER)); return 0; } diff --git a/Tests/Module/ExternalData/Data1Check.cmake b/Tests/Module/ExternalData/Data1Check.cmake index f60c209..7fe4389 100644 --- a/Tests/Module/ExternalData/Data1Check.cmake +++ b/Tests/Module/ExternalData/Data1Check.cmake @@ -1,24 +1,24 @@ file(STRINGS "${Data}" lines LIMIT_INPUT 1024) if(NOT "x${lines}" STREQUAL "xInput file already transformed.") - message(SEND_ERROR "Input file:\n ${Data}\ndoes not have expected content, but [[${lines}]]") + message(SEND_ERROR "Input file:\n ${Data}\n" "does not have expected content, but [[${lines}]]") endif() if(DEFINED DataSpace) file(STRINGS "${DataSpace}" lines LIMIT_INPUT 1024) if(NOT "x${lines}" STREQUAL "xInput file already transformed.") - message(SEND_ERROR "Input file:\n ${DataSpace}\ndoes not have expected content, but [[${lines}]]") + message(SEND_ERROR "Input file:\n ${DataSpace}\n" "does not have expected content, but [[${lines}]]") endif() endif() file(STRINGS "${DataScript}" lines LIMIT_INPUT 1024) if(NOT "x${lines}" STREQUAL "xDataScript") - message(SEND_ERROR "Input file:\n ${DataScript}\ndoes not have expected content, but [[${lines}]]") + message(SEND_ERROR "Input file:\n ${DataScript}\n" "does not have expected content, but [[${lines}]]") endif() file(STRINGS "${DataAlgoMapA}" lines LIMIT_INPUT 1024) if(NOT "x${lines}" STREQUAL "xDataAlgoMap") - message(SEND_ERROR "Input file:\n ${DataAlgoMapA}\ndoes not have expected content, but [[${lines}]]") + message(SEND_ERROR "Input file:\n ${DataAlgoMapA}\n" "does not have expected content, but [[${lines}]]") endif() file(STRINGS "${DataAlgoMapB}" lines LIMIT_INPUT 1024) if(NOT "x${lines}" STREQUAL "xDataAlgoMap") - message(SEND_ERROR "Input file:\n ${DataAlgoMapB}\ndoes not have expected content, but [[${lines}]]") + message(SEND_ERROR "Input file:\n ${DataAlgoMapB}\n" "does not have expected content, but [[${lines}]]") endif() if(DataMissing) if(EXISTS "${DataMissing}") @@ -54,7 +54,7 @@ foreach(s A B C D) foreach(n "" ${Series${s}l}) string(REGEX REPLACE "\\.dat$" "${n}.dat" file "${Series${s}}") if(NOT EXISTS "${file}") - message(SEND_ERROR "Input file:\n ${file}\ndoes not exist!") + message(SEND_ERROR "Input file:\n ${file}\n" "does not exist!") endif() endforeach() endforeach() @@ -62,45 +62,45 @@ foreach(s A B C D) foreach(n ${Series${s}l}) string(REGEX REPLACE "${Series${s}n1}$" "${n}.dat" file "${Series${s}n}") if(NOT EXISTS "${file}") - message(SEND_ERROR "Input file:\n ${file}\ndoes not exist!") + message(SEND_ERROR "Input file:\n ${file}\n" "does not exist!") endif() endforeach() endforeach() foreach(n .1 .2 .3 .4) string(REGEX REPLACE "\\.1\\.dat$" "${n}.dat" file "${SeriesMixed}") if(NOT EXISTS "${file}") - message(SEND_ERROR "Input file:\n ${file}\ndoes not exist!") + message(SEND_ERROR "Input file:\n ${file}\n" "does not exist!") endif() endforeach() foreach(n A B) string(REGEX REPLACE "A\\.dat$" "${n}.dat" file "${Paired}") if(NOT EXISTS "${file}") - message(SEND_ERROR "Input file:\n ${file}\ndoes not exist!") + message(SEND_ERROR "Input file:\n ${file}\n" "does not exist!") endif() endforeach() foreach(n Top A B C) string(REGEX REPLACE "Top\\.dat$" "${n}.dat" file "${Meta}") if(NOT EXISTS "${file}") - message(SEND_ERROR "Input file:\n ${file}\ndoes not exist!") + message(SEND_ERROR "Input file:\n ${file}\n" "does not exist!") endif() endforeach() foreach(n A B C) set(file "${Directory}/${n}.dat") if(NOT EXISTS "${file}") - message(SEND_ERROR "Input file:\n ${file}\ndoes not exist!") + message(SEND_ERROR "Input file:\n ${file}\n" "does not exist!") endif() endforeach() foreach(n A Sub1/A Sub2/Dir/A B Sub1/B Sub2/Dir/B C Sub1/C Sub2/Dir/C) set(file "${DirRecurse}/${n}.dat") if(NOT EXISTS "${file}") - message(SEND_ERROR "Input file:\n ${file}\ndoes not exist!") + message(SEND_ERROR "Input file:\n ${file}\n" "does not exist!") endif() endforeach() list(LENGTH Semicolons len) if("${len}" EQUAL 2) foreach(file ${Semicolons}) if(NOT EXISTS "${file}") - message(SEND_ERROR "Input file:\n ${file}\ndoes not exist!") + message(SEND_ERROR "Input file:\n ${file}\n" "does not exist!") endif() endforeach() else() diff --git a/Tests/Module/ExternalData/Data2/Data2Check.cmake b/Tests/Module/ExternalData/Data2/Data2Check.cmake index d5b0c7b..412593c 100644 --- a/Tests/Module/ExternalData/Data2/Data2Check.cmake +++ b/Tests/Module/ExternalData/Data2/Data2Check.cmake @@ -1,12 +1,12 @@ foreach(d "${Data2}" "${Data2b}") file(STRINGS "${d}" lines LIMIT_INPUT 1024) if(NOT "x${lines}" STREQUAL "xInput file already transformed.") - message(SEND_ERROR "Input file:\n ${d}\ndoes not have expected content, but [[${lines}]]") + message(SEND_ERROR "Input file:\n ${d}\n" "does not have expected content, but [[${lines}]]") endif() endforeach() foreach(n 1 2 3) string(REGEX REPLACE "_1_\\.my\\.dat$" "_${n}_.my.dat" SeriesCFile "${SeriesC}") if(NOT EXISTS "${SeriesCFile}") - message(SEND_ERROR "Input file:\n ${SeriesCFile}\ndoes not exist!") + message(SEND_ERROR "Input file:\n ${SeriesCFile}\n" "does not exist!") endif() endforeach() diff --git a/Tests/Module/ExternalData/Data3/Data3Check.cmake b/Tests/Module/ExternalData/Data3/Data3Check.cmake index de98839..da79fdb 100644 --- a/Tests/Module/ExternalData/Data3/Data3Check.cmake +++ b/Tests/Module/ExternalData/Data3/Data3Check.cmake @@ -1,8 +1,8 @@ if(NOT EXISTS "${Data}") - message(SEND_ERROR "Input file:\n ${Data}\ndoes not exist!") + message(SEND_ERROR "Input file:\n ${Data}\n" "does not exist!") endif() if(NOT EXISTS "${Other}") - message(SEND_ERROR "Input file:\n ${Other}\ndoes not exist!") + message(SEND_ERROR "Input file:\n ${Other}\n" "does not exist!") endif() # Verify that the 'Data' object was found in the second store location left # from Data1 target downloads and that the 'Other' object was downloaded to diff --git a/Tests/Module/ExternalData/Data4/Data4Check.cmake b/Tests/Module/ExternalData/Data4/Data4Check.cmake index e614cc4..a1d82d5 100644 --- a/Tests/Module/ExternalData/Data4/Data4Check.cmake +++ b/Tests/Module/ExternalData/Data4/Data4Check.cmake @@ -1,8 +1,8 @@ if(NOT EXISTS "${Data}") - message(SEND_ERROR "Input file:\n ${Data}\ndoes not exist!") + message(SEND_ERROR "Input file:\n ${Data}\n" "does not exist!") endif() if(NOT EXISTS "${Other}") - message(SEND_ERROR "Input file:\n ${Other}\ndoes not exist!") + message(SEND_ERROR "Input file:\n ${Other}\n" "does not exist!") endif() # Verify that the 'Data' object was found in the second store location left # from Data1 target downloads and that the 'Other' object was found in the diff --git a/Tests/Module/ExternalData/Data5/Data5Check.cmake b/Tests/Module/ExternalData/Data5/Data5Check.cmake index 4dea9a4..79c2161 100644 --- a/Tests/Module/ExternalData/Data5/Data5Check.cmake +++ b/Tests/Module/ExternalData/Data5/Data5Check.cmake @@ -1,4 +1,4 @@ file(STRINGS "${Data5}" lines LIMIT_INPUT 1024) if(NOT "x${lines}" STREQUAL "xInput file already transformed.") - message(SEND_ERROR "Input file:\n ${Data5}\ndoes not have expected content, but [[${lines}]]") + message(SEND_ERROR "Input file:\n ${Data5}\n" "does not have expected content, but [[${lines}]]") endif() diff --git a/Tests/Module/ExternalData/DataNoSymlinks/DataNoSymlinksCheck.cmake b/Tests/Module/ExternalData/DataNoSymlinks/DataNoSymlinksCheck.cmake index 2be3571..a73668a 100644 --- a/Tests/Module/ExternalData/DataNoSymlinks/DataNoSymlinksCheck.cmake +++ b/Tests/Module/ExternalData/DataNoSymlinks/DataNoSymlinksCheck.cmake @@ -1,5 +1,5 @@ if(NOT EXISTS "${Data}") - message(SEND_ERROR "Input file:\n ${Data}\ndoes not exist!") + message(SEND_ERROR "Input file:\n ${Data}\n" "does not exist!") endif() if(IS_SYMLINK "${Data}") message(SEND_ERROR "Input file:\n ${Data}\nis a symlink but should not be!") diff --git a/Tests/QtAutogen/AutoMocGeneratedFile/CMakeLists.txt b/Tests/QtAutogen/AutoMocGeneratedFile/CMakeLists.txt new file mode 100644 index 0000000..ce129a9 --- /dev/null +++ b/Tests/QtAutogen/AutoMocGeneratedFile/CMakeLists.txt @@ -0,0 +1,23 @@ +cmake_minimum_required(VERSION 3.26) +project(AutoMocGeneratedFile) + +include("../AutogenCoreTest.cmake") + +file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/myConfig.h + CONTENT + " +#ifndef MYCONFIG_H +#define MYCONFIG_H + +inline void foo() {} + +#endif + +" +) + +add_executable(testTarget + main.cpp + ${CMAKE_CURRENT_BINARY_DIR}/myConfig.h) +target_include_directories(testTarget PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) +set_property(TARGET testTarget PROPERTY AUTOMOC ON) diff --git a/Tests/QtAutogen/AutoMocGeneratedFile/main.cpp b/Tests/QtAutogen/AutoMocGeneratedFile/main.cpp new file mode 100644 index 0000000..e30d889 --- /dev/null +++ b/Tests/QtAutogen/AutoMocGeneratedFile/main.cpp @@ -0,0 +1,7 @@ +#include "myConfig.h" + +int main() +{ + foo(); + return 0; +} diff --git a/Tests/QtAutogen/Tests.cmake b/Tests/QtAutogen/Tests.cmake index 3e4f04d..7dd9c84 100644 --- a/Tests/QtAutogen/Tests.cmake +++ b/Tests/QtAutogen/Tests.cmake @@ -2,6 +2,7 @@ ADD_AUTOGEN_TEST(AutogenOriginDependsOff autogenOriginDependsOff) ADD_AUTOGEN_TEST(AutogenOriginDependsOn) ADD_AUTOGEN_TEST(AutogenTargetDepends) +ADD_AUTOGEN_TEST(AutoMocGeneratedFile) ADD_AUTOGEN_TEST(Complex QtAutogen) ADD_AUTOGEN_TEST(GlobalAutogenSystemUseInclude) ADD_AUTOGEN_TEST(GlobalAutogenTarget) diff --git a/Tests/RunCMake/CheckModules/CheckStructHasMemberWrongKey-stderr.txt b/Tests/RunCMake/CheckModules/CheckStructHasMemberWrongKey-stderr.txt index b9fbd38..4a3f601 100644 --- a/Tests/RunCMake/CheckModules/CheckStructHasMemberWrongKey-stderr.txt +++ b/Tests/RunCMake/CheckModules/CheckStructHasMemberWrongKey-stderr.txt @@ -1,7 +1,7 @@ CMake Error at .*/Modules/CheckStructHasMember.cmake:[0-9]+. \(message\): Unknown arguments: - LANGUAG;C + LANGUAG_;C Call Stack \(most recent call first\): CheckStructHasMemberWrongKey.cmake:[0-9]+ \(check_struct_has_member\) diff --git a/Tests/RunCMake/CheckModules/CheckStructHasMemberWrongKey.cmake b/Tests/RunCMake/CheckModules/CheckStructHasMemberWrongKey.cmake index 900eb0a..fea0eb0 100644 --- a/Tests/RunCMake/CheckModules/CheckStructHasMemberWrongKey.cmake +++ b/Tests/RunCMake/CheckModules/CheckStructHasMemberWrongKey.cmake @@ -1,2 +1,2 @@ include(CheckStructHasMember) -check_struct_has_member("struct timeval" tv_sec sys/select.h HAVE_TIMEVAL_TV_SEC_K LANGUAG C) +check_struct_has_member("struct timeval" tv_sec sys/select.h HAVE_TIMEVAL_TV_SEC_K LANGUAG_ C) diff --git a/Tests/RunCMake/CheckModules/CheckTypeSizeUnknownArgument-stderr.txt b/Tests/RunCMake/CheckModules/CheckTypeSizeUnknownArgument-stderr.txt index 085488e..9227cc3 100644 --- a/Tests/RunCMake/CheckModules/CheckTypeSizeUnknownArgument-stderr.txt +++ b/Tests/RunCMake/CheckModules/CheckTypeSizeUnknownArgument-stderr.txt @@ -1,7 +1,7 @@ CMake Error at .*/Modules/CheckTypeSize.cmake:[0-9]+. \(message\): Unknown argument: - LANGUAG + LANGUAG_ Call Stack \(most recent call first\): CheckTypeSizeUnknownArgument.cmake:[0-9]+ \(check_type_size\) diff --git a/Tests/RunCMake/CheckModules/CheckTypeSizeUnknownArgument.cmake b/Tests/RunCMake/CheckModules/CheckTypeSizeUnknownArgument.cmake index 6f24ee1..cf6f0fc 100644 --- a/Tests/RunCMake/CheckModules/CheckTypeSizeUnknownArgument.cmake +++ b/Tests/RunCMake/CheckModules/CheckTypeSizeUnknownArgument.cmake @@ -1,2 +1,2 @@ include(CheckTypeSize) -check_type_size(int SIZEOF_INT BUILTIN_TYPES_ONLY LANGUAG CXX) +check_type_size(int SIZEOF_INT BUILTIN_TYPES_ONLY LANGUAG_ CXX) diff --git a/Tests/RunCMake/CommandLine/E_capabilities-stdout.txt b/Tests/RunCMake/CommandLine/E_capabilities-stdout.txt index 597dbd4..e2f63cd 100644 --- a/Tests/RunCMake/CommandLine/E_capabilities-stdout.txt +++ b/Tests/RunCMake/CommandLine/E_capabilities-stdout.txt @@ -1 +1 @@ -^{"fileApi":{"requests":\[{"kind":"codemodel","version":\[{"major":2,"minor":5}]},{"kind":"configureLog","version":\[{"major":1,"minor":0}]},{"kind":"cache","version":\[{"major":2,"minor":0}]},{"kind":"cmakeFiles","version":\[{"major":1,"minor":0}]},{"kind":"toolchains","version":\[{"major":1,"minor":0}]}]},"generators":\[.*\],"serverMode":false,"tls":(true|false),"version":{.*}}$ +^{"fileApi":{"requests":\[{"kind":"codemodel","version":\[{"major":2,"minor":6}]},{"kind":"configureLog","version":\[{"major":1,"minor":0}]},{"kind":"cache","version":\[{"major":2,"minor":0}]},{"kind":"cmakeFiles","version":\[{"major":1,"minor":0}]},{"kind":"toolchains","version":\[{"major":1,"minor":0}]}]},"generators":\[.*\],"serverMode":false,"tls":(true|false),"version":{.*}}$ diff --git a/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake b/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake index a001c5d..7b72ffe 100644 --- a/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake +++ b/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake @@ -130,7 +130,7 @@ endfunction() function(test_cmp0128_warn_unset) # For compilers that had CMAKE_<LANG>_EXTENSION_COMPILE_OPTION (only IAR) - # there is no behavioural change and thus no warning. + # there is no behavioral change and thus no warning. if(NOT "${${lang}_EXT_FLAG}" STREQUAL "") return() endif() diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-check.py b/Tests/RunCMake/FileAPI/codemodel-v2-check.py index eb52975..b669543 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-check.py +++ b/Tests/RunCMake/FileAPI/codemodel-v2-check.py @@ -12,7 +12,7 @@ def read_codemodel_json_data(filename): def check_objects(o, g): assert is_list(o) assert len(o) == 1 - check_index_object(o[0], "codemodel", 2, 5, check_object_codemodel(g)) + check_index_object(o[0], "codemodel", 2, 6, check_object_codemodel(g)) def check_backtrace(t, b, backtrace): btg = t["backtraceGraph"] @@ -578,6 +578,30 @@ def check_target(c): missing_exception=lambda e: "Include path: %s" % e["path"], extra_exception=lambda a: "Include path: %s" % a["path"]) + if expected["frameworks"] is not None: + expected_keys.append("frameworks") + + def check_include(actual, expected): + assert is_dict(actual) + expected_keys = ["path"] + + if expected["isSystem"] is not None: + expected_keys.append("isSystem") + assert is_bool(actual["isSystem"], expected["isSystem"]) + + if expected["backtrace"] is not None: + expected_keys.append("backtrace") + check_backtrace(obj, actual["backtrace"], expected["backtrace"]) + + assert sorted(actual.keys()) == sorted(expected_keys) + + check_list_match(lambda a, e: matches(a["path"], e["path"]), + actual["frameworks"], expected["frameworks"], + check=check_include, + check_exception=lambda a, e: "Framework path: %s" % a["path"], + missing_exception=lambda e: "Framework path: %s" % e["path"], + extra_exception=lambda a: "Framework path: %s" % a["path"]) + if "precompileHeaders" in expected: expected_keys.append("precompileHeaders") @@ -693,6 +717,7 @@ def gen_check_directories(c, g): read_codemodel_json_data("directories/external.json"), read_codemodel_json_data("directories/fileset.json"), read_codemodel_json_data("directories/subdir.json"), + read_codemodel_json_data("directories/framework.json"), ] if matches(g["name"], "^Visual Studio "): @@ -776,6 +801,12 @@ def gen_check_targets(c, g, inSource): read_codemodel_json_data("targets/cxx_object_lib.json"), read_codemodel_json_data("targets/cxx_object_exe.json"), + read_codemodel_json_data("targets/all_build_framework.json"), + read_codemodel_json_data("targets/zero_check_framework.json"), + read_codemodel_json_data("targets/static_framework.json"), + read_codemodel_json_data("targets/shared_framework.json"), + read_codemodel_json_data("targets/exe_framework.json"), + read_codemodel_json_data("targets/all_build_imported.json"), read_codemodel_json_data("targets/zero_check_imported.json"), read_codemodel_json_data("targets/link_imported_exe.json"), @@ -800,6 +831,21 @@ def gen_check_targets(c, g, inSource): read_codemodel_json_data("targets/c_headers_2.json"), ] + if sys.platform == "darwin": + for e in expected: + if e["name"] == "static_framework": + apple_static_framework = read_codemodel_json_data("targets/apple_static_framework.json") + e["artifacts"] = apple_static_framework["artifacts"] + e["nameOnDisk"] = apple_static_framework["nameOnDisk"] + elif e["name"] == "shared_framework": + apple_shared_framework = read_codemodel_json_data("targets/apple_shared_framework.json") + e["artifacts"] = apple_shared_framework["artifacts"] + e["nameOnDisk"] = apple_shared_framework["nameOnDisk"] + elif e["name"] == "exe_framework": + apple_exe_framework = read_codemodel_json_data("targets/apple_exe_framework.json") + e["compileGroups"] = apple_exe_framework["compileGroups"] + e["link"] = apple_exe_framework["link"] + if cxx_compiler_id in ['Clang', 'AppleClang', 'LCC', 'GNU', 'Intel', 'IntelLLVM', 'MSVC', 'Embarcadero', 'IBMClang'] and g["name"] != "Xcode": for e in expected: if e["name"] == "cxx_exe": @@ -926,6 +972,21 @@ def gen_check_targets(c, g, inSource): ], }, { + "path": "^framework/CMakeLists\\.txt$", + "isGenerated": None, + "fileSetName": None, + "sourceGroupName": "", + "compileGroupLanguage": None, + "backtrace": [ + { + "file": "^CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + { "path": "^dir/CMakeLists\\.txt$", "isGenerated": None, "fileSetName": None, @@ -1070,6 +1131,7 @@ def gen_check_targets(c, g, inSource): "^codemodel-v2\\.cmake$", "^custom/CMakeLists\\.txt$", "^cxx/CMakeLists\\.txt$", + "^framework/CMakeLists\\.txt$", "^dir/CMakeLists\\.txt$", "^dir/dir/CMakeLists\\.txt$", "^fileset/CMakeLists\\.txt$", @@ -1144,6 +1206,7 @@ def gen_check_projects(c, g): read_codemodel_json_data("projects/interface.json"), read_codemodel_json_data("projects/custom.json"), read_codemodel_json_data("projects/external.json"), + read_codemodel_json_data("projects/framework.json"), ] if matches(g["name"], "^Visual Studio "): diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/framework.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/framework.json new file mode 100644 index 0000000..3affc02 --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/framework.json @@ -0,0 +1,17 @@ +{ + "source": "^framework$", + "build": "^framework$", + "parentSource": "^\\.$", + "childSources": null, + "targetIds": [ + "^ALL_BUILD::@217a96c3a62328a73ef4$", + "^ZERO_CHECK::@217a96c3a62328a73ef4$", + "^shared_framework::@217a96c3a62328a73ef4$", + "^static_framework::@217a96c3a62328a73ef4$", + "^exe_framework::@217a96c3a62328a73ef4$" + ], + "projectName": "Framework", + "minimumCMakeVersion": "3.13", + "hasInstallRule": null, + "installers": [] +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/top.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/top.json index aed07e2..a35d5e2 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/top.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/top.json @@ -12,7 +12,8 @@ "^.*/Tests/RunCMake/FileAPIExternalSource$", "^dir$", "^fileset$", - "^subdir$" + "^subdir$", + "^framework$" ], "targetIds": [ "^ALL_BUILD::@6890427a1f51a3e7e1df$", @@ -50,7 +51,7 @@ "backtrace": [ { "file": "^codemodel-v2\\.cmake$", - "line": 42, + "line": 43, "command": "install", "hasParent": true }, @@ -95,7 +96,7 @@ "backtrace": [ { "file": "^codemodel-v2\\.cmake$", - "line": 45, + "line": 46, "command": "install", "hasParent": true }, @@ -143,7 +144,7 @@ "backtrace": [ { "file": "^codemodel-v2\\.cmake$", - "line": 45, + "line": 46, "command": "install", "hasParent": true }, @@ -188,7 +189,7 @@ "backtrace": [ { "file": "^codemodel-v2\\.cmake$", - "line": 45, + "line": 46, "command": "install", "hasParent": true }, @@ -232,7 +233,7 @@ "backtrace": [ { "file": "^codemodel-v2\\.cmake$", - "line": 45, + "line": 46, "command": "install", "hasParent": true }, @@ -276,7 +277,7 @@ "backtrace": [ { "file": "^codemodel-v2\\.cmake$", - "line": 50, + "line": 51, "command": "install", "hasParent": true }, @@ -323,7 +324,7 @@ "backtrace": [ { "file": "^codemodel-v2\\.cmake$", - "line": 52, + "line": 53, "command": "install", "hasParent": true }, @@ -368,7 +369,7 @@ "backtrace": [ { "file": "^codemodel-v2\\.cmake$", - "line": 53, + "line": 54, "command": "install", "hasParent": true }, @@ -417,7 +418,7 @@ "backtrace": [ { "file": "^codemodel-v2\\.cmake$", - "line": 54, + "line": 55, "command": "install", "hasParent": true }, @@ -469,7 +470,7 @@ "backtrace": [ { "file": "^codemodel-v2\\.cmake$", - "line": 55, + "line": 56, "command": "install", "hasParent": true }, @@ -518,7 +519,7 @@ "backtrace": [ { "file": "^codemodel-v2\\.cmake$", - "line": 56, + "line": 57, "command": "install", "hasParent": true }, @@ -560,7 +561,7 @@ "backtrace": [ { "file": "^codemodel-v2\\.cmake$", - "line": 57, + "line": 58, "command": "install", "hasParent": true }, @@ -602,7 +603,7 @@ "backtrace": [ { "file": "^codemodel-v2\\.cmake$", - "line": 58, + "line": 59, "command": "install", "hasParent": true }, diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/codemodel-v2.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/codemodel-v2.json index 151c0a8..8d2712d 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/codemodel-v2.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/codemodel-v2.json @@ -8,7 +8,8 @@ "Imported", "Interface", "Object", - "External" + "External", + "Framework" ], "directorySources": [ "^\\.$", diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/framework.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/framework.json new file mode 100644 index 0000000..259ead1 --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/framework.json @@ -0,0 +1,15 @@ +{ + "name": "Framework", + "parentName": "codemodel-v2", + "childNames": null, + "directorySources": [ + "^framework$" + ], + "targetIds": [ + "^ALL_BUILD::@217a96c3a62328a73ef4$", + "^ZERO_CHECK::@217a96c3a62328a73ef4$", + "^shared_framework::@217a96c3a62328a73ef4$", + "^static_framework::@217a96c3a62328a73ef4$", + "^exe_framework::@217a96c3a62328a73ef4$" + ] +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_framework.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_framework.json new file mode 100644 index 0000000..a4d806a --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_framework.json @@ -0,0 +1,90 @@ +{ + "name": "ALL_BUILD", + "id": "^ALL_BUILD::@217a96c3a62328a73ef4$", + "directorySource": "^framework$", + "projectName": "Framework", + "type": "UTILITY", + "isGeneratorProvided": true, + "fileSets": null, + "sources": [ + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/framework/CMakeFiles/ALL_BUILD$", + "isGenerated": true, + "fileSetName": null, + "sourceGroupName": "", + "compileGroupLanguage": null, + "backtrace": [ + { + "file": "^framework/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + }, + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/framework/CMakeFiles/ALL_BUILD\\.rule$", + "isGenerated": true, + "fileSetName": null, + "sourceGroupName": "CMake Rules", + "compileGroupLanguage": null, + "backtrace": [ + { + "file": "^framework/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + } + ], + "sourceGroups": [ + { + "name": "", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/framework/CMakeFiles/ALL_BUILD$" + ] + }, + { + "name": "CMake Rules", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/framework/CMakeFiles/ALL_BUILD\\.rule$" + ] + } + ], + "compileGroups": null, + "backtrace": [ + { + "file": "^framework/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ], + "folder": null, + "nameOnDisk": null, + "artifacts": null, + "build": "^framework$", + "source": "^framework$", + "install": null, + "link": null, + "archive": null, + "dependencies": [ + { + "id": "^ZERO_CHECK::@217a96c3a62328a73ef4$", + "backtrace": null + }, + { + "id": "^shared_framework::@217a96c3a62328a73ef4$", + "backtrace": null + }, + { + "id": "^static_framework::@217a96c3a62328a73ef4$", + "backtrace": null + }, + { + "id": "^exe_framework::@217a96c3a62328a73ef4$", + "backtrace": null + } + ] +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_top.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_top.json index 46495ac..9d0007f 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_top.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_top.json @@ -201,6 +201,18 @@ { "id": "^c_headers_2::@6b8db101d64c125f29fe$", "backtrace": null + }, + { + "id": "^static_framework::@217a96c3a62328a73ef4$", + "backtrace": null + }, + { + "id": "^shared_framework::@217a96c3a62328a73ef4$", + "backtrace": null + }, + { + "id": "^exe_framework::@217a96c3a62328a73ef4$", + "backtrace": null } ] } diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/apple_exe_framework.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/apple_exe_framework.json new file mode 100644 index 0000000..6d320f4 --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/apple_exe_framework.json @@ -0,0 +1,79 @@ +{ + "compileGroups": + [ + { + "language": "CXX", + "sourcePaths": [ + "^empty\\.cxx$" + ], + "includes": null, + "defines": null, + "frameworks": + [ + { + "isSystem": null, + "path": "^.*/framework/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?static_framework.framework", + "backtrace": null + }, + { + "isSystem": true, + "path": "^.+/framework/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?shared_framework.framework", + "backtrace": null + }, + { + "isSystem": true, + "path": "/usr/Frameworks/Foo.framework", + "backtrace": null + } + ], + "compileCommandFragments": [] + } + ], + "link": { + "language": "CXX", + "lto": null, + "commandFragments": [ + { + "fragment": "-iframework .+/framework(/(Debug|Release|RelWithDebInfo|MinSizeRel))?\"? -iframework /usr/Frameworks$", + "role": "frameworkPath", + "backtrace": null + }, + { + "fragment": ".*static_framework\\.framework/.+/static_framework", + "role": "libraries", + "backtrace": [ + { + "file": "^framework/CMakeLists\\.txt$", + "line": 17, + "command": "target_link_libraries", + "hasParent": true + }, + { + "file": "^framework/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + }, + { + "fragment": ".*shared_framework\\.framework/.+/shared_framework", + "role": "libraries", + "backtrace": [ + { + "file": "^framework/CMakeLists\\.txt$", + "line": 17, + "command": "target_link_libraries", + "hasParent": true + }, + { + "file": "^framework/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + } + ] + } +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/apple_shared_framework.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/apple_shared_framework.json new file mode 100644 index 0000000..31104cf --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/apple_shared_framework.json @@ -0,0 +1,9 @@ +{ + "nameOnDisk": "^shared_framework\\.framework/shared_framework$", + "artifacts": [ + { + "path": "^framework/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?shared_framework\\.framework/shared_framework$", + "_dllExtra": false + } + ] +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/apple_static_framework.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/apple_static_framework.json new file mode 100644 index 0000000..25ffd1a --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/apple_static_framework.json @@ -0,0 +1,9 @@ +{ + "nameOnDisk": "^static_framework\\.framework/static_framework$", + "artifacts": [ + { + "path": "^framework/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?static_framework\\.framework/static_framework$", + "_dllExtra": false + } + ] +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_alias_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_alias_exe.json index a27d328..74b3287 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_alias_exe.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_alias_exe.json @@ -45,6 +45,7 @@ ], "includes": null, "defines": null, + "frameworks": null, "compileCommandFragments": null } ], diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_exe.json index 7cfc0f2..c6ff37a 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_exe.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_exe.json @@ -57,6 +57,7 @@ ], "includes": null, "defines": null, + "frameworks": null, "compileCommandFragments": null } ], diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_headers_1.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_headers_1.json index 715514d..f6cfa9c 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_headers_1.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_headers_1.json @@ -199,6 +199,7 @@ ] } ], + "frameworks": null, "defines": null, "compileCommandFragments": null } diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_headers_2.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_headers_2.json index 4757a9c..591ba4f 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_headers_2.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_headers_2.json @@ -51,6 +51,7 @@ "^fileset/empty\\.c$" ], "includes": null, + "frameworks": null, "defines": null, "compileCommandFragments": null } diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_lib.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_lib.json index 2bfc63f..dc74fdf 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_lib.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_lib.json @@ -56,6 +56,7 @@ "^empty\\.c$" ], "includes": null, + "frameworks": null, "defines": null, "compileCommandFragments": null } diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_object_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_object_exe.json index 6342191..3034e98 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_object_exe.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_object_exe.json @@ -71,6 +71,7 @@ "^empty\\.c$" ], "includes": null, + "frameworks": null, "defines": null, "compileCommandFragments": null } diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_object_lib.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_object_lib.json index 3e1b03b..ec0fdc6 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_object_lib.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_object_lib.json @@ -44,6 +44,7 @@ "^empty\\.c$" ], "includes": null, + "frameworks": null, "defines": null, "compileCommandFragments": null } diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_shared_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_shared_exe.json index f7a8db4..5e92840 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_shared_exe.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_shared_exe.json @@ -56,6 +56,7 @@ "^empty\\.c$" ], "includes": null, + "frameworks": null, "defines": null, "compileCommandFragments": null } diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_shared_lib.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_shared_lib.json index 9066053..85b5108 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_shared_lib.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_shared_lib.json @@ -56,6 +56,7 @@ "^empty\\.c$" ], "includes": null, + "frameworks": null, "defines": [ { "define": "c_shared_lib_EXPORTS", @@ -117,7 +118,7 @@ "backtrace": [ { "file": "^codemodel-v2\\.cmake$", - "line": 45, + "line": 46, "command": "install", "hasParent": true }, @@ -147,7 +148,7 @@ "backtrace": [ { "file": "^codemodel-v2\\.cmake$", - "line": 45, + "line": 46, "command": "install", "hasParent": true }, @@ -177,7 +178,7 @@ "backtrace": [ { "file": "^codemodel-v2\\.cmake$", - "line": 50, + "line": 51, "command": "install", "hasParent": true }, diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_static_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_static_exe.json index 46c5bfe..df43319 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_static_exe.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_static_exe.json @@ -56,6 +56,7 @@ "^empty\\.c$" ], "includes": null, + "frameworks": null, "defines": null, "compileCommandFragments": null } diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_static_lib.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_static_lib.json index df28479..6a51295 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_static_lib.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_static_lib.json @@ -56,6 +56,7 @@ "^empty\\.c$" ], "includes": null, + "frameworks": null, "defines": null, "compileCommandFragments": null } diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_subdir.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_subdir.json index 4fa62e3..362caf9 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_subdir.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_subdir.json @@ -63,6 +63,7 @@ ] } ], + "frameworks": null, "defines": [ { "define": "SUBDIR", diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/custom_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/custom_exe.json index 8d52ab8..449c261 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/custom_exe.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/custom_exe.json @@ -44,6 +44,7 @@ "^empty\\.c$" ], "includes": null, + "frameworks": null, "defines": null, "compileCommandFragments": null } diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_alias_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_alias_exe.json index b27fc5b..a2d3ca4 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_alias_exe.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_alias_exe.json @@ -44,6 +44,7 @@ "^empty\\.cxx$" ], "includes": null, + "frameworks": null, "defines": null, "compileCommandFragments": null } diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe.json index 12b2551..73f9346 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe.json @@ -44,6 +44,7 @@ "^empty\\.cxx$" ], "includes": null, + "frameworks": null, "defines": null, "precompileHeaders": [ { @@ -138,7 +139,7 @@ "backtrace": [ { "file": "^codemodel-v2\\.cmake$", - "line": 42, + "line": 43, "command": "install", "hasParent": true }, diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_precompileheader.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_precompileheader.json index 3251777..ac6a1c0 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_precompileheader.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_precompileheader.json @@ -6,6 +6,7 @@ ".*cmake_pch(_[^.]+)?(\\.hxx)?\\.cxx$" ], "includes": null, + "frameworks": null, "defines": null, "precompileHeaders": [ { @@ -52,6 +53,7 @@ "^empty\\.cxx$" ], "includes": null, + "frameworks": null, "defines": null, "precompileHeaders": [ { diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_precompileheader_2arch.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_precompileheader_2arch.json index 0ac40c2..311fe7a 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_precompileheader_2arch.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_precompileheader_2arch.json @@ -6,6 +6,7 @@ ".*cmake_pch(_[^.]+)?(\\.hxx)?\\.cxx$" ], "includes": null, + "frameworks": null, "defines": null, "precompileHeaders": [ { @@ -52,6 +53,7 @@ ".*cmake_pch(_[^.]+)?(\\.hxx)?\\.cxx$" ], "includes": null, + "frameworks": null, "defines": null, "precompileHeaders": [ { @@ -98,6 +100,7 @@ "^empty\\.cxx$" ], "includes": null, + "frameworks": null, "defines": null, "precompileHeaders": [ { diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_precompileheader_multigen.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_precompileheader_multigen.json index 86168f1..adf979e 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_precompileheader_multigen.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_precompileheader_multigen.json @@ -6,6 +6,7 @@ ".*cmake_pch(_[^.]+)?(\\.hxx)?\\.cxx$" ], "includes": null, + "frameworks": null, "defines": null, "precompileHeaders": [ { @@ -52,6 +53,7 @@ "^empty\\.cxx$" ], "includes": null, + "frameworks": null, "defines": null, "precompileHeaders": [ { diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_lib.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_lib.json index f665004..725cad9 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_lib.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_lib.json @@ -44,6 +44,7 @@ "^empty\\.cxx$" ], "includes": null, + "frameworks": null, "defines": null, "compileCommandFragments": null } diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_object_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_object_exe.json index 68c5dcc..6655215 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_object_exe.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_object_exe.json @@ -71,6 +71,7 @@ "^empty\\.cxx$" ], "includes": null, + "frameworks": null, "defines": null, "compileCommandFragments": null } diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_object_lib.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_object_lib.json index 0438a49..cc2deeb 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_object_lib.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_object_lib.json @@ -44,6 +44,7 @@ "^empty\\.cxx$" ], "includes": null, + "frameworks": null, "defines": null, "compileCommandFragments": null } diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_shared_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_shared_exe.json index bb9989e..1858df7 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_shared_exe.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_shared_exe.json @@ -44,6 +44,7 @@ "^empty\\.cxx$" ], "includes": null, + "frameworks": null, "defines": null, "compileCommandFragments": null } diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_shared_lib.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_shared_lib.json index d6d59a4..c92e573 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_shared_lib.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_shared_lib.json @@ -44,6 +44,7 @@ "^empty\\.cxx$" ], "includes": null, + "frameworks": null, "defines": [ { "define": "cxx_shared_lib_EXPORTS", @@ -93,7 +94,7 @@ "backtrace": [ { "file": "^codemodel-v2\\.cmake$", - "line": 45, + "line": 46, "command": "install", "hasParent": true }, @@ -123,7 +124,7 @@ "backtrace": [ { "file": "^codemodel-v2\\.cmake$", - "line": 45, + "line": 46, "command": "install", "hasParent": true }, @@ -153,7 +154,7 @@ "backtrace": [ { "file": "^codemodel-v2\\.cmake$", - "line": 50, + "line": 51, "command": "install", "hasParent": true }, diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_standard_compile_feature_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_standard_compile_feature_exe.json index a6bacf7..5b07d5a 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_standard_compile_feature_exe.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_standard_compile_feature_exe.json @@ -64,6 +64,7 @@ "^empty\\.cxx$" ], "includes": null, + "frameworks": null, "defines": null, "compileCommandFragments": null } diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_standard_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_standard_exe.json index fe884e0..d9554f1 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_standard_exe.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_standard_exe.json @@ -64,6 +64,7 @@ "^empty\\.cxx$" ], "includes": null, + "frameworks": null, "defines": null, "compileCommandFragments": null } diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_static_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_static_exe.json index d904bd9..001eb8d 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_static_exe.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_static_exe.json @@ -44,6 +44,7 @@ "^empty\\.cxx$" ], "includes": null, + "frameworks": null, "defines": null, "compileCommandFragments": null } diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_static_lib.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_static_lib.json index bced68a..38790dd 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_static_lib.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_static_lib.json @@ -44,6 +44,7 @@ "^empty\\.cxx$" ], "includes": null, + "frameworks": null, "defines": null, "compileCommandFragments": null } diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/exe_framework.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/exe_framework.json new file mode 100644 index 0000000..d5d6522 --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/exe_framework.json @@ -0,0 +1,164 @@ +{ + "name": "exe_framework", + "id": "^exe_framework::@217a96c3a62328a73ef4$", + "directorySource": "^framework$", + "projectName": "Framework", + "type": "EXECUTABLE", + "isGeneratorProvided": null, + "fileSets": null, + "sources": [ + { + "path": "^empty\\.cxx$", + "isGenerated": null, + "fileSetName": null, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "CXX", + "backtrace": [ + { + "file": "^framework/CMakeLists\\.txt$", + "line": 16, + "command": "add_executable", + "hasParent": true + }, + { + "file": "^framework/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + } + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^empty\\.cxx$" + ] + } + ], + "compileGroups": [ + { + "language": "CXX", + "sourcePaths": [ + "^empty\\.cxx$" + ], + "includes": null, + "frameworks": null, + "defines": null, + "compileCommandFragments": null + } + ], + "backtrace": [ + { + "file": "^framework/CMakeLists\\.txt$", + "line": 16, + "command": "add_executable", + "hasParent": true + }, + { + "file": "^framework/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ], + "folder": null, + "nameOnDisk": "^exe_framework(\\.exe)?$", + "artifacts": [ + { + "path": "^framework/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?exe_framework(\\.exe)?$", + "_dllExtra": false + }, + { + "path": "^framework/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?exe_framework\\.pdb$", + "_dllExtra": true + } + ], + "build": "^framework$", + "source": "^framework$", + "install": null, + "link": { + "language": "CXX", + "lto": null, + "commandFragments": [ + { + "fragment": ".*static_framework.*", + "role": "libraries", + "backtrace": [ + { + "file": "^framework/CMakeLists\\.txt$", + "line": 17, + "command": "target_link_libraries", + "hasParent": true + }, + { + "file": "^framework/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + }, + { + "fragment": ".*shared_framework.*", + "role": "libraries", + "backtrace": [ + { + "file": "^framework/CMakeLists\\.txt$", + "line": 17, + "command": "target_link_libraries", + "hasParent": true + }, + { + "file": "^framework/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + } + ] + }, + "archive": null, + "dependencies": [ + { + "id": "^static_framework::@217a96c3a62328a73ef4$", + "backtrace": [ + { + "file": "^framework/CMakeLists\\.txt$", + "line": 17, + "command": "target_link_libraries", + "hasParent": true + }, + { + "file": "^framework/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + }, + { + "id": "^shared_framework::@217a96c3a62328a73ef4$", + "backtrace": [ + { + "file": "^framework/CMakeLists\\.txt$", + "line": 17, + "command": "target_link_libraries", + "hasParent": true + }, + { + "file": "^framework/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + }, + { + "id": "^ZERO_CHECK::@217a96c3a62328a73ef4$", + "backtrace": null + } + ] +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/generated_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/generated_exe.json index 4b69682..f1ef8dd 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/generated_exe.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/generated_exe.json @@ -108,6 +108,7 @@ ] } ], + "frameworks": null, "defines": [ { "define": "EMPTY_C=1", @@ -223,6 +224,7 @@ ] } ], + "frameworks": null, "defines": [ { "define": "GENERATED_EXE=1", diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/interface_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/interface_exe.json index c0c3e79..521e464 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/interface_exe.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/interface_exe.json @@ -68,6 +68,7 @@ "^empty\\.c$" ], "includes": null, + "frameworks": null, "defines": [ { "define": "interface_exe_EXPORTS", diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_exe.json index 45fb0a5..531d8dc 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_exe.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_exe.json @@ -44,6 +44,7 @@ "^empty\\.c$" ], "includes": null, + "frameworks": null, "defines": null, "compileCommandFragments": null } diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_interface_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_interface_exe.json index 74c179c..691edff 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_interface_exe.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_interface_exe.json @@ -44,6 +44,7 @@ "^empty\\.c$" ], "includes": null, + "frameworks": null, "defines": null, "compileCommandFragments": null } diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_object_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_object_exe.json index 6771747..555accc 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_object_exe.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_object_exe.json @@ -44,6 +44,7 @@ "^empty\\.c$" ], "includes": null, + "frameworks": null, "defines": null, "compileCommandFragments": null } diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_shared_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_shared_exe.json index 659e3fb..ead2362 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_shared_exe.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_shared_exe.json @@ -44,6 +44,7 @@ "^empty\\.c$" ], "includes": null, + "frameworks": null, "defines": null, "compileCommandFragments": null } diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_static_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_static_exe.json index 7bdaffb..26dc9db 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_static_exe.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_static_exe.json @@ -44,6 +44,7 @@ "^empty\\.c$" ], "includes": null, + "frameworks": null, "defines": null, "compileCommandFragments": null } diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/shared_framework.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/shared_framework.json new file mode 100644 index 0000000..41b5605 --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/shared_framework.json @@ -0,0 +1,102 @@ +{ + "name": "shared_framework", + "id": "^shared_framework::@217a96c3a62328a73ef4$", + "directorySource": "^framework$", + "projectName": "Framework", + "type": "SHARED_LIBRARY", + "isGeneratorProvided": null, + "fileSets": null, + "sources": [ + { + "path": "^empty\\.cxx$", + "isGenerated": null, + "fileSetName": null, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "CXX", + "backtrace": [ + { + "file": "^framework/CMakeLists\\.txt$", + "line": 7, + "command": "add_library", + "hasParent": true + }, + { + "file": "^framework/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + } + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^empty\\.cxx$" + ] + } + ], + "compileGroups": [ + { + "language": "CXX", + "sourcePaths": [ + "^empty\\.cxx$" + ], + "includes": null, + "frameworks": null, + "defines": [ + { + "define": "shared_framework_EXPORTS", + "backtrace": null + } + ], + "compileCommandFragments": null + } + ], + "backtrace": [ + { + "file": "^framework/CMakeLists\\.txt$", + "line": 7, + "command": "add_library", + "hasParent": true + }, + { + "file": "^framework/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ], + "folder": null, + "nameOnDisk": "^(lib|cyg|msys-)?shared_framework\\.(so|dylib|dll)$", + "artifacts": [ + { + "path": "^framework/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib|cyg|msys-)?shared_framework\\.(so|dylib|dll)$", + "_dllExtra": false + }, + { + "path": "^framework/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?shared_framework\\.(dll\\.a|lib)$", + "_dllExtra": true + }, + { + "path": "^framework/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib|cyg|msys-)?shared_framework\\.pdb$", + "_dllExtra": true + } + ], + "build": "^framework$", + "source": "^framework$", + "install": null, + "link": { + "language": "CXX", + "lto": null, + "commandFragments": null + }, + "archive": null, + "dependencies": [ + { + "id": "^ZERO_CHECK::@217a96c3a62328a73ef4$", + "backtrace": null + } + ] +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/static_framework.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/static_framework.json new file mode 100644 index 0000000..00dd11e --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/static_framework.json @@ -0,0 +1,87 @@ +{ + "name": "static_framework", + "id": "^static_framework::@217a96c3a62328a73ef4$", + "directorySource": "^framework$", + "projectName": "Framework", + "type": "STATIC_LIBRARY", + "isGeneratorProvided": null, + "fileSets": null, + "sources": [ + { + "path": "^empty\\.cxx$", + "isGenerated": null, + "fileSetName": null, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "CXX", + "backtrace": [ + { + "file": "^framework/CMakeLists\\.txt$", + "line": 4, + "command": "add_library", + "hasParent": true + }, + { + "file": "^framework/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + } + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^empty\\.cxx$" + ] + } + ], + "compileGroups": [ + { + "language": "CXX", + "sourcePaths": [ + "^empty\\.cxx$" + ], + "includes": null, + "frameworks": null, + "defines": null, + "compileCommandFragments": null + } + ], + "backtrace": [ + { + "file": "^framework/CMakeLists\\.txt$", + "line": 4, + "command": "add_library", + "hasParent": true + }, + { + "file": "^framework/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ], + "folder": null, + "nameOnDisk": "^(lib)?static_framework\\.(a|lib)$", + "artifacts": [ + { + "path": "^framework/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?static_framework\\.(a|lib)$", + "_dllExtra": false + } + ], + "build": "^framework$", + "source": "^framework$", + "install": null, + "link": null, + "archive": { + "lto": null + }, + "dependencies": [ + { + "id": "^ZERO_CHECK::@217a96c3a62328a73ef4$", + "backtrace": null + } + ] +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_framework.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_framework.json new file mode 100644 index 0000000..6206517 --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_framework.json @@ -0,0 +1,73 @@ +{ + "name": "ZERO_CHECK", + "id": "^ZERO_CHECK::@217a96c3a62328a73ef4$", + "directorySource": "^framework$", + "projectName": "Framework", + "type": "UTILITY", + "isGeneratorProvided": true, + "fileSets": null, + "sources": [ + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/framework/CMakeFiles/ZERO_CHECK$", + "isGenerated": true, + "fileSetName": null, + "sourceGroupName": "", + "compileGroupLanguage": null, + "backtrace": [ + { + "file": "^framework/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + }, + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/framework/CMakeFiles/ZERO_CHECK\\.rule$", + "isGenerated": true, + "fileSetName": null, + "sourceGroupName": "CMake Rules", + "compileGroupLanguage": null, + "backtrace": [ + { + "file": "^framework/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + } + ], + "sourceGroups": [ + { + "name": "", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/framework/CMakeFiles/ZERO_CHECK$" + ] + }, + { + "name": "CMake Rules", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/framework/CMakeFiles/ZERO_CHECK\\.rule$" + ] + } + ], + "compileGroups": null, + "backtrace": [ + { + "file": "^framework/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ], + "folder": null, + "nameOnDisk": null, + "artifacts": null, + "build": "^framework$", + "source": "^framework$", + "install": null, + "link": null, + "archive": null, + "dependencies": null +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2.cmake b/Tests/RunCMake/FileAPI/codemodel-v2.cmake index 09db216..5f4019d 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2.cmake +++ b/Tests/RunCMake/FileAPI/codemodel-v2.cmake @@ -26,6 +26,7 @@ add_subdirectory(custom) add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/../FileAPIExternalSource" "${CMAKE_CURRENT_BINARY_DIR}/../FileAPIExternalBuild") add_subdirectory(dir) add_subdirectory(fileset) +add_subdirectory(framework) set_property(TARGET c_shared_lib PROPERTY LIBRARY_OUTPUT_DIRECTORY lib) set_property(TARGET c_shared_lib PROPERTY RUNTIME_OUTPUT_DIRECTORY lib) diff --git a/Tests/RunCMake/FileAPI/framework/CMakeLists.txt b/Tests/RunCMake/FileAPI/framework/CMakeLists.txt new file mode 100644 index 0000000..d69efbb --- /dev/null +++ b/Tests/RunCMake/FileAPI/framework/CMakeLists.txt @@ -0,0 +1,17 @@ +project(Framework) +enable_language(CXX) + +add_library(static_framework STATIC ../empty.cxx) +set_property(TARGET static_framework PROPERTY FRAMEWORK ON) + +add_library(shared_framework SHARED ../empty.cxx) +set_property(TARGET shared_framework PROPERTY FRAMEWORK ON) +set_property(TARGET shared_framework PROPERTY SYSTEM ON) + +add_library(import_framework SHARED IMPORTED) +set_property(TARGET import_framework PROPERTY FRAMEWORK ON) +set_property(TARGET import_framework PROPERTY IMPORTED_LOCATION /usr/Frameworks/Foo.framework/Foo) +set_property(TARGET import_framework PROPERTY IMPORTED_IMPLIB /usr/Frameworks/Foo.framework/Foo.lib) + +add_executable(exe_framework ../empty.cxx) +target_link_libraries(exe_framework PRIVATE static_framework shared_framework import_framework) diff --git a/Tests/RunCMake/File_Generate/CMP0070-NEW-check.cmake b/Tests/RunCMake/File_Generate/CMP0070-NEW-check.cmake index 05ec26e..6183635 100644 --- a/Tests/RunCMake/File_Generate/CMP0070-NEW-check.cmake +++ b/Tests/RunCMake/File_Generate/CMP0070-NEW-check.cmake @@ -5,7 +5,7 @@ foreach(f if(EXISTS "${f}") file(READ "${f}" content) if(NOT content MATCHES "^relative-input-NEW[\r\n]*$") - string(APPEND RunCMake_TEST_FAILED "File\n ${f}\ndoes not have expected content.\n") + string(APPEND RunCMake_TEST_FAILED "File\n ${f}\n" "does not have expected content.\n") endif() else() string(APPEND RunCMake_TEST_FAILED "Missing\n ${f}\n") diff --git a/Tests/RunCMake/File_Generate/CMP0070-OLD-check.cmake b/Tests/RunCMake/File_Generate/CMP0070-OLD-check.cmake index a71d822..0f0fc09 100644 --- a/Tests/RunCMake/File_Generate/CMP0070-OLD-check.cmake +++ b/Tests/RunCMake/File_Generate/CMP0070-OLD-check.cmake @@ -5,7 +5,7 @@ foreach(f if(EXISTS "${f}") file(READ "${f}" content) if(NOT content MATCHES "^relative-input-OLD[\r\n]*$") - string(APPEND RunCMake_TEST_FAILED "File\n ${f}\ndoes not have expected content.\n") + string(APPEND RunCMake_TEST_FAILED "File\n ${f}\n" "does not have expected content.\n") endif() else() string(APPEND RunCMake_TEST_FAILED "Missing\n ${f}\n") diff --git a/Tests/RunCMake/File_Generate/CMP0070-WARN-check.cmake b/Tests/RunCMake/File_Generate/CMP0070-WARN-check.cmake index 1488df0..0ee4a82 100644 --- a/Tests/RunCMake/File_Generate/CMP0070-WARN-check.cmake +++ b/Tests/RunCMake/File_Generate/CMP0070-WARN-check.cmake @@ -5,7 +5,7 @@ foreach(f if(EXISTS "${f}") file(READ "${f}" content) if(NOT content MATCHES "^relative-input-WARN[\r\n]*$") - string(APPEND RunCMake_TEST_FAILED "File\n ${f}\ndoes not have expected content.\n") + string(APPEND RunCMake_TEST_FAILED "File\n ${f}\n" "does not have expected content.\n") endif() else() string(APPEND RunCMake_TEST_FAILED "Missing\n ${f}\n") diff --git a/Tests/RunCMake/GenEx-LINK_LIBRARY/RunCMakeTest.cmake b/Tests/RunCMake/GenEx-LINK_LIBRARY/RunCMakeTest.cmake index 7df0e80..2ad45ba 100644 --- a/Tests/RunCMake/GenEx-LINK_LIBRARY/RunCMakeTest.cmake +++ b/Tests/RunCMake/GenEx-LINK_LIBRARY/RunCMakeTest.cmake @@ -29,7 +29,7 @@ run_cmake(nested-compatible-features) run_cmake(nested-incompatible-features) run_cmake(only-targets) -# testing target propertes LINK_LIBRARY_OVERRIDE and LINK_LIBRARY_OVERRIDE_<LIBRARY> +# testing target properties LINK_LIBRARY_OVERRIDE and LINK_LIBRARY_OVERRIDE_<LIBRARY> run_cmake(override-features1) run_cmake(override-features2) run_cmake(override-features3) diff --git a/Tests/RunCMake/GeneratorToolset/TestToolsetCustomFlagTableDir-check.cmake b/Tests/RunCMake/GeneratorToolset/TestToolsetCustomFlagTableDir-check.cmake index 79752b1..f95173b 100644 --- a/Tests/RunCMake/GeneratorToolset/TestToolsetCustomFlagTableDir-check.cmake +++ b/Tests/RunCMake/GeneratorToolset/TestToolsetCustomFlagTableDir-check.cmake @@ -1,6 +1,6 @@ set(vcProjectFile "${RunCMake_TEST_BINARY_DIR}/main.vcxproj") if(NOT EXISTS "${vcProjectFile}") - set(RunCMake_TEST_FAILED "Project file\n ${vcProjectFile}\ndoes not exist.") + string(CONCAT RunCMake_TEST_FAILED "Project file\n ${vcProjectFile}\n" "does not exist.") return() endif() diff --git a/Tests/RunCMake/GoogleTest/GoogleTestXML.cmake b/Tests/RunCMake/GoogleTest/GoogleTestXML.cmake index 53eedc0..308bdbf 100644 --- a/Tests/RunCMake/GoogleTest/GoogleTestXML.cmake +++ b/Tests/RunCMake/GoogleTest/GoogleTestXML.cmake @@ -5,13 +5,13 @@ enable_testing() include(xcode_sign_adhoc.cmake) -# This creates the folder structure for the paramterized tests +# This creates the folder structure for the parameterized tests # to avoid handling missing folders in C++ # # This must match the match the name defined in xml_output.cpp # for every instance of tests with GetParam. # -# The folder name is created fom the test name (output of the line +# The folder name is created from the test name (output of the line # without leading spaces: "GoogleTestXMLSpecial/cases.") and # the parts until the last slash ("case/"). These parts are concatenated. file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/GoogleTestXMLSpecial/cases.case") diff --git a/Tests/RunCMake/MacOSVersions/MacOSVersions-build-check.cmake b/Tests/RunCMake/MacOSVersions/MacOSVersions-build-check.cmake index c4faa8b..3eff573 100644 --- a/Tests/RunCMake/MacOSVersions/MacOSVersions-build-check.cmake +++ b/Tests/RunCMake/MacOSVersions/MacOSVersions-build-check.cmake @@ -21,7 +21,7 @@ foreach(ver [[compatibility version 2\.1\.0]] ) if(NOT "${out}" MATCHES "( |\n)${ver}( |\n)") - set(RunCMake_TEST_FAILED "Library file:\n ${lib}\ndoes not contain '${ver}'") + string(CONCAT RunCMake_TEST_FAILED "Library file:\n ${lib}\n" "does not contain '${ver}'") return() endif() endforeach() diff --git a/Tests/RunCMake/Ninja/CustomCommandDepfile-check.cmake b/Tests/RunCMake/Ninja/CustomCommandDepfile-check.cmake index 51f4f52..edde0c0 100644 --- a/Tests/RunCMake/Ninja/CustomCommandDepfile-check.cmake +++ b/Tests/RunCMake/Ninja/CustomCommandDepfile-check.cmake @@ -3,8 +3,10 @@ file(READ "${log}" build_file) set(RunCMake_TEST_FAILED) if(NOT "${build_file}" MATCHES "depfile = test\\.d") - list(APPEND RunCMake_TEST_FAILED "Log file:\n ${log}\ndoes not have expected line: depfile = test.d") + string(CONCAT no_test_d "Log file:\n ${log}\n" "does not have expected line: depfile = test.d") + list(APPEND RunCMake_TEST_FAILED "${no_test_d}") endif() if(NOT "${build_file}" MATCHES "depfile = test_Debug\\.d") - list(APPEND RunCMake_TEST_FAILED "\nLog file:\n ${log}\ndoes not have expected line: depfile = test_Debug.d") + string(CONCAT no_test_Debug_d "\nLog file:\n ${log}\n" "does not have expected line: depfile = test_Debug.d") + list(APPEND RunCMake_TEST_FAILED "${no_test_Debug_d}") endif() diff --git a/Tests/RunCMake/Ninja/CustomCommandJobPool-check.cmake b/Tests/RunCMake/Ninja/CustomCommandJobPool-check.cmake index 7f7fa33..793b5d2 100644 --- a/Tests/RunCMake/Ninja/CustomCommandJobPool-check.cmake +++ b/Tests/RunCMake/Ninja/CustomCommandJobPool-check.cmake @@ -1,8 +1,8 @@ set(log "${RunCMake_BINARY_DIR}/CustomCommandJobPool-build/build.ninja") file(READ "${log}" build_file) if(NOT "${build_file}" MATCHES "pool = custom_command_pool") - set(RunCMake_TEST_FAILED "Log file:\n ${log}\ndoes not have expected line: pool = custom_command_pool") + string(CONCAT RunCMake_TEST_FAILED "Log file:\n ${log}\n" "does not have expected line: pool = custom_command_pool") endif() if(NOT "${build_file}" MATCHES "pool = custom_target_pool") - set(RunCMake_TEST_FAILED "Log file:\n ${log}\ndoes not have expected line: pool = custom_target_pool") + string(CONCAT RunCMake_TEST_FAILED "Log file:\n ${log}\n" "does not have expected line: pool = custom_target_pool") endif() diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandDepfile-check.cmake b/Tests/RunCMake/NinjaMultiConfig/CustomCommandDepfile-check.cmake index a7837ca..3674aba 100644 --- a/Tests/RunCMake/NinjaMultiConfig/CustomCommandDepfile-check.cmake +++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandDepfile-check.cmake @@ -3,8 +3,10 @@ file(READ "${log}" build_file) set(RunCMake_TEST_FAILED) if(NOT "${build_file}" MATCHES "depfile = test\\.d") - list(APPEND RunCMake_TEST_FAILED "Log file:\n ${log}\ndoes not have expected line: depfile = test.d") + string(CONCAT no_test_d "Log file:\n ${log}\n" "does not have expected line: depfile = test.d") + list(APPEND RunCMake_TEST_FAILED "${no_test_d}") endif() if(NOT "${build_file}" MATCHES "depfile = test_Debug\\.d") - list(APPEND RunCMake_TEST_FAILED "\nLog file:\n ${log}\ndoes not have expected line: depfile = test_Debug.d") + string(CONCAT no_test_Debug_d "\nLog file:\n ${log}\n" "does not have expected line: depfile = test_Debug.d") + list(APPEND RunCMake_TEST_FAILED "${no_test_Debug_d}") endif() diff --git a/Tests/RunCMake/ctest_memcheck/testAddressLeakSanitizer.cmake b/Tests/RunCMake/ctest_memcheck/testAddressLeakSanitizer.cmake index 58c94d7..2b49bbb 100644 --- a/Tests/RunCMake/ctest_memcheck/testAddressLeakSanitizer.cmake +++ b/Tests/RunCMake/ctest_memcheck/testAddressLeakSanitizer.cmake @@ -23,7 +23,7 @@ file(APPEND "${LOG_FILE}.2343" Direct leak of 4360 byte(s) in 1 object(s) allocated from: #0 0x46c669 in operator new[](unsigned long) (/home/kitware/msan/a.out+0x46c669) #1 0x4823b4 in main /home/kitware/msan/memcheck.cxx:12 - #2 0x7fa72bee476c in __libc_start_main /build/buildd/eglibc-2.15/csu/libc-start.c:226 + #2 0x7fa72bee476c in __libc_start_main /build/eglibc-2.15/csu/libc-start.c:226 SUMMARY: AddressSanitizer: 4436 byte(s) leaked in 2 allocation(s). ") @@ -35,13 +35,13 @@ Direct leak of 76 byte(s) in 1 object(s) allocated from: #0 0x46c669 in operator new[](unsigned long) (/home/kitware/msan/a.out+0x46c669) #1 0x4821b8 in foo() /home/kitware/msan/memcheck.cxx:4 #2 0x4823f2 in main /home/kitware/msan/memcheck.cxx:14 - #3 0x7fa72bee476c in __libc_start_main /build/buildd/eglibc-2.15/csu/libc-start.c:226 + #3 0x7fa72bee476c in __libc_start_main /build/eglibc-2.15/csu/libc-start.c:226 Indirect leak of 76 byte(s) in 1 object(s) allocated from: #0 0x46c669 in operator new[](unsigned long) (/home/kitware/msan/a.out+0x46c669) #1 0x4821b8 in foo() /home/kitware/msan/memcheck.cxx:4 #2 0x4823f2 in main /home/kitware/msan/memcheck.cxx:14 - #3 0x7fa72bee476c in __libc_start_main /build/buildd/eglibc-2.15/csu/libc-start.c:226 + #3 0x7fa72bee476c in __libc_start_main /build/eglibc-2.15/csu/libc-start.c:226 SUMMARY: AddressSanitizer: 4436 byte(s) leaked in 2 allocation(s). ") diff --git a/Tests/RunCMake/ctest_memcheck/testAddressSanitizer.cmake b/Tests/RunCMake/ctest_memcheck/testAddressSanitizer.cmake index 8f18cd0..6612375 100644 --- a/Tests/RunCMake/ctest_memcheck/testAddressSanitizer.cmake +++ b/Tests/RunCMake/ctest_memcheck/testAddressSanitizer.cmake @@ -42,7 +42,7 @@ Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa - Heap righ redzone: fb + Heap right redzone: fb Freed Heap region: fd Stack left redzone: f1 Stack mid redzone: f2 diff --git a/Tests/RunCMake/ctest_memcheck/testLeakSanitizer.cmake b/Tests/RunCMake/ctest_memcheck/testLeakSanitizer.cmake index 4990792..45f3c45 100644 --- a/Tests/RunCMake/ctest_memcheck/testLeakSanitizer.cmake +++ b/Tests/RunCMake/ctest_memcheck/testLeakSanitizer.cmake @@ -23,7 +23,7 @@ file(APPEND "${LOG_FILE}.2343" Direct leak of 4360 byte(s) in 1 object(s) allocated from: #0 0x46c669 in operator new[](unsigned long) (/home/kitware/msan/a.out+0x46c669) #1 0x4823b4 in main /home/kitware/msan/memcheck.cxx:12 - #2 0x7fa72bee476c in __libc_start_main /build/buildd/eglibc-2.15/csu/libc-start.c:226 + #2 0x7fa72bee476c in __libc_start_main /build/eglibc-2.15/csu/libc-start.c:226 SUMMARY: LeakSanitizer: 4436 byte(s) leaked in 2 allocation(s). ") @@ -35,13 +35,13 @@ Direct leak of 76 byte(s) in 1 object(s) allocated from: #0 0x46c669 in operator new[](unsigned long) (/home/kitware/msan/a.out+0x46c669) #1 0x4821b8 in foo() /home/kitware/msan/memcheck.cxx:4 #2 0x4823f2 in main /home/kitware/msan/memcheck.cxx:14 - #3 0x7fa72bee476c in __libc_start_main /build/buildd/eglibc-2.15/csu/libc-start.c:226 + #3 0x7fa72bee476c in __libc_start_main /build/eglibc-2.15/csu/libc-start.c:226 Indirect leak of 76 byte(s) in 1 object(s) allocated from: #0 0x46c669 in operator new[](unsigned long) (/home/kitware/msan/a.out+0x46c669) #1 0x4821b8 in foo() /home/kitware/msan/memcheck.cxx:4 #2 0x4823f2 in main /home/kitware/msan/memcheck.cxx:14 - #3 0x7fa72bee476c in __libc_start_main /build/buildd/eglibc-2.15/csu/libc-start.c:226 + #3 0x7fa72bee476c in __libc_start_main /build/eglibc-2.15/csu/libc-start.c:226 SUMMARY: LeakSanitizer: 4436 byte(s) leaked in 2 allocation(s). ") diff --git a/Tests/RunCMake/ctest_memcheck/testMemorySanitizer.cmake b/Tests/RunCMake/ctest_memcheck/testMemorySanitizer.cmake index 4a6adb1..4b5ef7e 100644 --- a/Tests/RunCMake/ctest_memcheck/testMemorySanitizer.cmake +++ b/Tests/RunCMake/ctest_memcheck/testMemorySanitizer.cmake @@ -19,7 +19,7 @@ file(APPEND "${LOG_FILE}.2343" "================================================================= ==28423== WARNING: MemorySanitizer: use-of-uninitialized-value #0 0x7f4364210dd9 in main (/home/kitware/msan/msan-bin/umr+0x7bdd9) - #1 0x7f4362d9376c in __libc_start_main /build/buildd/eglibc-2.15/csu/libc-start.c:226 + #1 0x7f4362d9376c in __libc_start_main /build/eglibc-2.15/csu/libc-start.c:226 #2 0x7f4364210b0c in _start (/home/kitware/msan/msan-bin/umr+0x7bb0c) SUMMARY: MemorySanitizer: use-of-uninitialized-value ??:0 main diff --git a/Tests/RunCMake/file/COPY_FILE-file-replace.cmake b/Tests/RunCMake/file/COPY_FILE-file-replace.cmake index 40e4290..cdb06fa 100644 --- a/Tests/RunCMake/file/COPY_FILE-file-replace.cmake +++ b/Tests/RunCMake/file/COPY_FILE-file-replace.cmake @@ -5,5 +5,5 @@ file(WRITE "${newname}" "b") file(COPY_FILE "${oldname}" "${newname}") file(READ "${newname}" new) if(NOT "${new}" STREQUAL "a") - message(FATAL_ERROR "New name:\n ${newname}\ndoes not contain expected content 'a'.") + message(FATAL_ERROR "New name:\n ${newname}\n" "does not contain expected content 'a'.") endif() diff --git a/Tests/RunCMake/file/COPY_FILE-link-to-file.cmake b/Tests/RunCMake/file/COPY_FILE-link-to-file.cmake index 93a0204..53a6b11 100644 --- a/Tests/RunCMake/file/COPY_FILE-link-to-file.cmake +++ b/Tests/RunCMake/file/COPY_FILE-link-to-file.cmake @@ -6,5 +6,5 @@ file(CREATE_LINK "${lnkname}" "${oldname}") file(COPY_FILE "${oldname}" "${newname}") file(READ "${newname}" new) if(NOT "${new}" STREQUAL "a") - message(FATAL_ERROR "New name:\n ${newname}\ndoes not contain expected content 'a'.") + message(FATAL_ERROR "New name:\n ${newname}\n" "does not contain expected content 'a'.") endif() diff --git a/Tests/RunCMake/file/LOCK-error-guard-incorrect-stderr.txt b/Tests/RunCMake/file/LOCK-error-guard-incorrect-stderr.txt index 85136b4..815ab5b 100644 --- a/Tests/RunCMake/file/LOCK-error-guard-incorrect-stderr.txt +++ b/Tests/RunCMake/file/LOCK-error-guard-incorrect-stderr.txt @@ -1,6 +1,6 @@ CMake Error at LOCK-error-guard-incorrect\.cmake:[0-9]+ \(file\): expected FUNCTION, FILE or PROCESS after GUARD, but got: - "FUNCTIO"\. + "FUNCTIO_"\. Call Stack \(most recent call first\): CMakeLists.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/file/LOCK-error-guard-incorrect.cmake b/Tests/RunCMake/file/LOCK-error-guard-incorrect.cmake index 51daa7c..dddd4c0 100644 --- a/Tests/RunCMake/file/LOCK-error-guard-incorrect.cmake +++ b/Tests/RunCMake/file/LOCK-error-guard-incorrect.cmake @@ -1 +1 @@ -file(LOCK "${CMAKE_CURRENT_BINARY_DIR}/file-to-lock" GUARD FUNCTIO) +file(LOCK "${CMAKE_CURRENT_BINARY_DIR}/file-to-lock" GUARD FUNCTIO_) diff --git a/Tests/RunCMake/file/RENAME-file-replace.cmake b/Tests/RunCMake/file/RENAME-file-replace.cmake index efbfaed..454e27e 100644 --- a/Tests/RunCMake/file/RENAME-file-replace.cmake +++ b/Tests/RunCMake/file/RENAME-file-replace.cmake @@ -5,5 +5,5 @@ file(WRITE "${newname}" "b") file(RENAME "${oldname}" "${newname}") file(READ "${newname}" new) if(NOT "${new}" STREQUAL "a") - message(FATAL_ERROR "New name:\n ${newname}\ndoes not contain expected content 'a'.") + message(FATAL_ERROR "New name:\n ${newname}\n" "does not contain expected content 'a'.") endif() diff --git a/Tests/RunCMake/message/RunCMakeTest.cmake b/Tests/RunCMake/message/RunCMakeTest.cmake index c54e8f2..786b49b 100644 --- a/Tests/RunCMake/message/RunCMakeTest.cmake +++ b/Tests/RunCMake/message/RunCMakeTest.cmake @@ -10,7 +10,7 @@ run_cmake(message-internal-warning) run_cmake(nomessage-internal-warning) run_cmake(warnmessage) -# Have to explicitly give the command for the working dir to be honoured +# Have to explicitly give the command for the working dir to be honored set(RunCMake_TEST_COMMAND_WORKING_DIRECTORY /) run_cmake_command( warnmessage-rootdir diff --git a/Utilities/ClangTidyModule/CMakeLists.txt b/Utilities/ClangTidyModule/CMakeLists.txt index 97c176f..582d54a 100644 --- a/Utilities/ClangTidyModule/CMakeLists.txt +++ b/Utilities/ClangTidyModule/CMakeLists.txt @@ -6,11 +6,15 @@ project(CMakeClangTidyModule C CXX) get_filename_component(tmp "${CMAKE_CURRENT_SOURCE_DIR}" PATH) get_filename_component(CMake_SOURCE_DIR "${tmp}" PATH) -set(CMAKE_CXX_STANDARD 14) -set(CMAKE_CXX_STANDARD_REQUIRED ON) - find_package(Clang REQUIRED) +if(LLVM_VERSION_MAJOR GREATER_EQUAL 16) + set(CMAKE_CXX_STANDARD 17) +else() + set(CMAKE_CXX_STANDARD 14) +endif() +set(CMAKE_CXX_STANDARD_REQUIRED ON) + add_library(cmake-clang-tidy-module MODULE Module.cxx diff --git a/Utilities/ClangTidyModule/UsePragmaOnceCheck.cxx b/Utilities/ClangTidyModule/UsePragmaOnceCheck.cxx index 7a42798..37ecd70 100644 --- a/Utilities/ClangTidyModule/UsePragmaOnceCheck.cxx +++ b/Utilities/ClangTidyModule/UsePragmaOnceCheck.cxx @@ -218,8 +218,6 @@ public: this ->EndIfs[this->Ifndefs[MacroEntry.first.getIdentifierInfo()].first]; - StringRef CurHeaderGuard = - MacroEntry.first.getIdentifierInfo()->getName(); std::vector<FixItHint> FixIts; HeaderSearch& HeaderInfo = this->PP->getHeaderSearchInfo(); diff --git a/Utilities/cmbzip2/bzlib.c b/Utilities/cmbzip2/bzlib.c index 2178655..af3673d 100644 --- a/Utilities/cmbzip2/bzlib.c +++ b/Utilities/cmbzip2/bzlib.c @@ -444,6 +444,10 @@ int BZ_API(BZ2_bzCompress) ( bz_stream *strm, int action ) if (s->avail_in_expect != s->strm->avail_in) return BZ_SEQUENCE_ERROR; progress = handle_compress ( strm ); + #ifdef __clang_analyzer__ + /* Tolerate deadcode.DeadStores to avoid modifying upstream. */ + (void)progress; + #endif if (s->avail_in_expect > 0 || !isempty_RL(s) || s->state_out_pos < s->numZ) return BZ_FLUSH_OK; s->mode = BZ_M_RUNNING; diff --git a/Utilities/cmbzip2/compress.c b/Utilities/cmbzip2/compress.c index 5dfa002..a044c16 100644 --- a/Utilities/cmbzip2/compress.c +++ b/Utilities/cmbzip2/compress.c @@ -151,6 +151,10 @@ void generateMTFValues ( EState* s ) UChar* block = s->block; UInt16* mtfv = s->mtfv; +#ifdef __clang_analyzer__ + memset(yy, 0, sizeof(yy)); +#endif + makeMaps_e ( s ); EOB = s->nInUse+1; @@ -223,6 +227,10 @@ void generateMTFValues ( EState* s ) zPend = (zPend - 2) / 2; }; zPend = 0; + #ifdef __clang_analyzer__ + /* Tolerate deadcode.DeadStores to avoid modifying upstream. */ + (void)zPend; + #endif } mtfv[wr] = EOB; wr++; s->mtfFreq[EOB]++; diff --git a/Utilities/cmcurl/curltest.c b/Utilities/cmcurl/curltest.c index f80e758..cb87fce 100644 --- a/Utilities/cmcurl/curltest.c +++ b/Utilities/cmcurl/curltest.c @@ -10,21 +10,24 @@ int test_curl(const char* url) CURLcode r; char proxy[1024]; int proxy_type = 0; + const char* env_HTTP_PROXY = getenv("HTTP_PROXY"); - if (getenv("HTTP_PROXY")) { + if (env_HTTP_PROXY) { + const char* env_HTTP_PROXY_PORT = getenv("HTTP_PROXY_PORT"); + const char* env_HTTP_PROXY_TYPE = getenv("HTTP_PROXY_TYPE"); proxy_type = 1; - if (getenv("HTTP_PROXY_PORT")) { - sprintf(proxy, "%s:%s", getenv("HTTP_PROXY"), getenv("HTTP_PROXY_PORT")); + if (env_HTTP_PROXY_PORT) { + sprintf(proxy, "%s:%s", env_HTTP_PROXY, env_HTTP_PROXY_PORT); } else { - sprintf(proxy, "%s", getenv("HTTP_PROXY")); + sprintf(proxy, "%s", env_HTTP_PROXY); } - if (getenv("HTTP_PROXY_TYPE")) { + if (env_HTTP_PROXY_TYPE) { /* HTTP/SOCKS4/SOCKS5 */ - if (strcmp(getenv("HTTP_PROXY_TYPE"), "HTTP") == 0) { + if (strcmp(env_HTTP_PROXY_TYPE, "HTTP") == 0) { proxy_type = 1; - } else if (strcmp(getenv("HTTP_PROXY_TYPE"), "SOCKS4") == 0) { + } else if (strcmp(env_HTTP_PROXY_TYPE, "SOCKS4") == 0) { proxy_type = 2; - } else if (strcmp(getenv("HTTP_PROXY_TYPE"), "SOCKS5") == 0) { + } else if (strcmp(env_HTTP_PROXY_TYPE, "SOCKS5") == 0) { proxy_type = 3; } } diff --git a/Utilities/cmlibarchive/libarchive/archive_acl.c b/Utilities/cmlibarchive/libarchive/archive_acl.c index ead7e36..da471a5 100644 --- a/Utilities/cmlibarchive/libarchive/archive_acl.c +++ b/Utilities/cmlibarchive/libarchive/archive_acl.c @@ -37,6 +37,10 @@ __FBSDID("$FreeBSD$"); #include <wchar.h> #endif +#ifdef __clang_analyzer__ +#include <assert.h> +#endif + #include "archive_acl_private.h" #include "archive_entry.h" #include "archive_private.h" @@ -1209,6 +1213,9 @@ archive_acl_from_text_w(struct archive_acl *acl, const wchar_t *text, * to "user::rwx", etc. valid only for first field */ s = field[0].start; + #ifdef __clang_analyzer__ + assert(s); + #endif len = field[0].end - field[0].start; if (*s == L'd' && (len == 1 || (len >= 7 && wmemcmp((s + 1), L"efault", 6) == 0))) { @@ -1692,6 +1699,9 @@ archive_acl_from_text_l(struct archive_acl *acl, const char *text, * to "user::rwx", etc. valid only for first field */ s = field[0].start; + #ifdef __clang_analyzer__ + assert(s); + #endif len = field[0].end - field[0].start; if (*s == 'd' && (len == 1 || (len >= 7 && memcmp((s + 1), "efault", 6) == 0))) { diff --git a/Utilities/cmlibarchive/libarchive/archive_match.c b/Utilities/cmlibarchive/libarchive/archive_match.c index 04747b1..2de0045 100644 --- a/Utilities/cmlibarchive/libarchive/archive_match.c +++ b/Utilities/cmlibarchive/libarchive/archive_match.c @@ -606,6 +606,10 @@ add_pattern_from_file(struct archive_match *a, struct match_list *mlist, return (ARCHIVE_FATAL); } r = archive_read_support_format_raw(ar); +#ifdef __clang_analyzer__ + /* Tolerate deadcode.DeadStores to avoid modifying upstream. */ + (void)r; +#endif r = archive_read_support_format_empty(ar); if (r != ARCHIVE_OK) { archive_copy_error(&(a->archive), ar); diff --git a/Utilities/cmlibarchive/libarchive/archive_ppmd8.c b/Utilities/cmlibarchive/libarchive/archive_ppmd8.c index d177939..272ca4c 100644 --- a/Utilities/cmlibarchive/libarchive/archive_ppmd8.c +++ b/Utilities/cmlibarchive/libarchive/archive_ppmd8.c @@ -4,6 +4,10 @@ This code is based on PPMd var.I (2002): Dmitry Shkarin : Public domain */ #include "archive_platform.h" +#ifdef __clang_analyzer__ +#include <assert.h> +#endif + #include <string.h> #include "archive_ppmd8_private.h" @@ -337,6 +341,9 @@ static void ExpandTextArea(CPpmd8 *p) static void SetSuccessor(CPpmd_State *p, CPpmd_Void_Ref v) { + #ifdef __clang_analyzer__ + assert(p); + #endif (p)->SuccessorLow = (UInt16)((UInt32)(v) & 0xFFFF); (p)->SuccessorHigh = (UInt16)(((UInt32)(v) >> 16) & 0xFFFF); } @@ -616,6 +623,11 @@ static CTX_PTR CreateSuccessors(CPpmd8 *p, Bool skip, CPpmd_State *s1, CTX_PTR c /* fixed over Shkarin's code. Maybe it could work without + 1 too. */ CPpmd_State *ps[PPMD8_MAX_ORDER + 1]; unsigned numPs = 0; + +#ifdef __clang_analyzer__ + memset(ps, 0, sizeof(ps)); +#endif + if (!skip) ps[numPs++] = p->FoundState; diff --git a/Utilities/cmlibarchive/libarchive/archive_read_disk_posix.c b/Utilities/cmlibarchive/libarchive/archive_read_disk_posix.c index 5a94ec5..c964d3f 100644 --- a/Utilities/cmlibarchive/libarchive/archive_read_disk_posix.c +++ b/Utilities/cmlibarchive/libarchive/archive_read_disk_posix.c @@ -92,6 +92,10 @@ __FBSDID("$FreeBSD$"); #include <sys/ioctl.h> #endif +#ifdef __clang_analyzer__ +#include <assert.h> +#endif + #include "archive.h" #include "archive_string.h" #include "archive_entry.h" @@ -742,6 +746,10 @@ _archive_read_data_block(struct archive *_a, const void **buff, else if (errno == EPERM) flags &= ~O_NOATIME; } +#ifdef __clang_analyzer__ + /* Tolerate deadcode.DeadStores to avoid modifying upstream. */ + (void)flags; +#endif #endif if (t->entry_fd < 0) { archive_set_error(&a->archive, errno, @@ -2347,6 +2355,9 @@ tree_pop(struct tree *t) if (t->stack == t->current && t->current != NULL) t->current = t->current->parent; te = t->stack; + #ifdef __clang_analyzer__ + assert(te); + #endif t->stack = te->next; t->dirname_length = te->dirname_length; t->basename = t->path.s + t->dirname_length; diff --git a/Utilities/cmlibarchive/libarchive/archive_read_support_filter_uu.c b/Utilities/cmlibarchive/libarchive/archive_read_support_filter_uu.c index 209b2a1..c66c247 100644 --- a/Utilities/cmlibarchive/libarchive/archive_read_support_filter_uu.c +++ b/Utilities/cmlibarchive/libarchive/archive_read_support_filter_uu.c @@ -36,6 +36,10 @@ __FBSDID("$FreeBSD$"); #include <string.h> #endif +#ifdef __clang_analyzer__ +#include <assert.h> +#endif + #include "archive.h" #include "archive_private.h" #include "archive_read_private.h" @@ -467,6 +471,9 @@ read_more: if (ensure_in_buff_size(self, uudecode, avail_in + uudecode->in_cnt) != ARCHIVE_OK) return (ARCHIVE_FATAL); + #ifdef __clang_analyzer__ + assert(d); + #endif memcpy(uudecode->in_buff + uudecode->in_cnt, d, avail_in); d = uudecode->in_buff; diff --git a/Utilities/cmlibarchive/libarchive/archive_read_support_format_7zip.c b/Utilities/cmlibarchive/libarchive/archive_read_support_format_7zip.c index 722edf1..a4d9dcf 100644 --- a/Utilities/cmlibarchive/libarchive/archive_read_support_format_7zip.c +++ b/Utilities/cmlibarchive/libarchive/archive_read_support_format_7zip.c @@ -42,6 +42,10 @@ __FBSDID("$FreeBSD$"); #include <cm3p/zlib.h> #endif +#ifdef __clang_analyzer__ +#include <assert.h> +#endif + #include "archive.h" #include "archive_entry.h" #include "archive_entry_locale.h" @@ -757,6 +761,9 @@ archive_read_format_7zip_read_header(struct archive_read *a, return (ARCHIVE_FATAL); } symname = mem; + #ifdef __clang_analyzer__ + assert(buff); + #endif memcpy(symname+symsize, buff, size); symsize += size; } @@ -2500,6 +2507,9 @@ read_Header(struct archive_read *a, struct _7z_header_info *h, if ((p = header_bytes(a, 1)) == NULL) return (-1); ll--; + #ifdef __clang_analyzer__ + (void)*p; + #endif if ((ll & 1) || ll < zip->numFiles * 4) return (-1); diff --git a/Utilities/cmlibarchive/libarchive/archive_read_support_format_iso9660.c b/Utilities/cmlibarchive/libarchive/archive_read_support_format_iso9660.c index 380cbb8..91b9187 100644 --- a/Utilities/cmlibarchive/libarchive/archive_read_support_format_iso9660.c +++ b/Utilities/cmlibarchive/libarchive/archive_read_support_format_iso9660.c @@ -3015,6 +3015,7 @@ heap_add_entry(struct archive_read *a, struct heap_queue *heap, uint64_t file_key, parent_key; int hole, parent; +#ifndef __clang_analyzer__ /* It cannot see heap->files remains populated. */ /* Expand our pending files list as necessary. */ if (heap->used >= heap->allocated) { struct file_info **new_pending_files; @@ -3042,6 +3043,7 @@ heap_add_entry(struct archive_read *a, struct heap_queue *heap, heap->files = new_pending_files; heap->allocated = new_size; } +#endif file_key = file->key = key; diff --git a/Utilities/cmlibarchive/libarchive/archive_read_support_format_rar.c b/Utilities/cmlibarchive/libarchive/archive_read_support_format_rar.c index 1c9a057..41d6cb2 100644 --- a/Utilities/cmlibarchive/libarchive/archive_read_support_format_rar.c +++ b/Utilities/cmlibarchive/libarchive/archive_read_support_format_rar.c @@ -35,6 +35,8 @@ #include <cm3p/zlib.h> /* crc32 */ #endif +#include <assert.h> + #include "archive.h" #ifndef HAVE_ZLIB_H #include "archive_crc32.h" @@ -3215,6 +3217,7 @@ parse_filter(struct archive_read *a, const uint8_t *bytes, uint16_t length, uint num = filters->lastfilternum; prog = filters->progs; + assert(num <= numprogs); for (i = 0; i < num; i++) prog = prog->next; if (prog) @@ -3320,8 +3323,10 @@ create_filter(struct rar_program_code *prog, const uint8_t *globaldata, uint32_t filter->prog = prog; filter->globaldatalen = globaldatalen > PROGRAM_SYSTEM_GLOBAL_SIZE ? globaldatalen : PROGRAM_SYSTEM_GLOBAL_SIZE; filter->globaldata = calloc(1, filter->globaldatalen); - if (!filter->globaldata) + if (!filter->globaldata) { + free(filter); return NULL; + } if (globaldata) memcpy(filter->globaldata, globaldata, globaldatalen); if (registers) diff --git a/Utilities/cmlibarchive/libarchive/archive_read_support_format_rar5.c b/Utilities/cmlibarchive/libarchive/archive_read_support_format_rar5.c index 548da4e..aa7b861 100644 --- a/Utilities/cmlibarchive/libarchive/archive_read_support_format_rar5.c +++ b/Utilities/cmlibarchive/libarchive/archive_read_support_format_rar5.c @@ -388,7 +388,7 @@ static int cdeque_init(struct cdeque* d, int max_capacity_power_of_2) { return CDE_PARAM; cdeque_clear(d); - d->arr = malloc(sizeof(void*) * max_capacity_power_of_2); + d->arr = malloc(sizeof(*d->arr) * max_capacity_power_of_2); return d->arr ? CDE_OK : CDE_ALLOC; } @@ -2942,12 +2942,23 @@ static int parse_filter(struct archive_read* ar, const uint8_t* p) { if(filter_type == FILTER_DELTA) { int channels; - if(ARCHIVE_OK != (ret = read_consume_bits(ar, rar, p, 5, &channels))) + if(ARCHIVE_OK != (ret = read_consume_bits(ar, rar, p, 5, &channels))) { + #ifdef __clang_analyzer__ + /* Tell clang-analyzer that 'filt' does not leak. + add_new_filter passes off ownership. */ + free(filt); + #endif return ret; + } filt->channels = channels + 1; } + #ifdef __clang_analyzer__ + /* Tell clang-analyzer that 'filt' does not leak. + add_new_filter passes off ownership. */ + free(filt); + #endif return ARCHIVE_OK; } diff --git a/Utilities/cmlibarchive/libarchive/archive_write_set_format_iso9660.c b/Utilities/cmlibarchive/libarchive/archive_write_set_format_iso9660.c index 3190b46..ebd33c5 100644 --- a/Utilities/cmlibarchive/libarchive/archive_write_set_format_iso9660.c +++ b/Utilities/cmlibarchive/libarchive/archive_write_set_format_iso9660.c @@ -50,6 +50,10 @@ #include <cm3p/zlib.h> #endif +#ifdef __clang_analyzer__ +#include <assert.h> +#endif + #include "archive.h" #include "archive_endian.h" #include "archive_entry.h" @@ -6626,6 +6630,11 @@ isoent_collect_dirs(struct vdd *vdd, struct isoent *rootent, int depth) rootent = vdd->rootent; np = rootent; do { + #ifdef __clang_analyzer__ + /* Tell clang-analyzer that pathtbl[depth] is in bounds. */ + assert(depth < vdd->max_depth); + #endif + /* Register current directory to pathtable. */ path_table_add_entry(&(vdd->pathtbl[depth]), np); diff --git a/Utilities/cmliblzma/liblzma/common/index.c b/Utilities/cmliblzma/liblzma/common/index.c index a41e8f3..4c463ec 100644 --- a/Utilities/cmliblzma/liblzma/common/index.c +++ b/Utilities/cmliblzma/liblzma/common/index.c @@ -263,6 +263,9 @@ index_tree_append(index_tree *tree, index_tree_node *node) up = ctz32(tree->count) + 2; do { node = node->parent; + #ifdef __clang_analyzer__ + assert(node); + #endif } while (--up > 0); // Rotate left using node as the rotation root. diff --git a/Utilities/cmliblzma/liblzma/common/index_encoder.c b/Utilities/cmliblzma/liblzma/common/index_encoder.c index ac97d0c..5e822cb 100644 --- a/Utilities/cmliblzma/liblzma/common/index_encoder.c +++ b/Utilities/cmliblzma/liblzma/common/index_encoder.c @@ -237,12 +237,15 @@ lzma_index_buffer_encode(const lzma_index *i, // Do the actual encoding. This should never fail, but store // the original *out_pos just in case. +#ifndef __clang_analyzer__ // Hide unreachable code from clang-analyzer. const size_t out_start = *out_pos; +#endif lzma_ret ret = index_encode(&coder, NULL, NULL, NULL, 0, out, out_pos, out_size, LZMA_RUN); if (ret == LZMA_STREAM_END) { ret = LZMA_OK; +#ifndef __clang_analyzer__ // Hide unreachable code from clang-analyzer. } else { // We should never get here, but just in case, restore the // output position and set the error accordingly if something @@ -250,6 +253,7 @@ lzma_index_buffer_encode(const lzma_index *i, assert(0); *out_pos = out_start; ret = LZMA_PROG_ERROR; +#endif } return ret; diff --git a/Utilities/cmlibrhash/librhash/hex.c b/Utilities/cmlibrhash/librhash/hex.c index f0bbf04..cfd5892 100644 --- a/Utilities/cmlibrhash/librhash/hex.c +++ b/Utilities/cmlibrhash/librhash/hex.c @@ -110,6 +110,9 @@ size_t rhash_base64_url_encoded_helper(char* dst, const unsigned char* src, size { #define B64_CHUNK_SIZE 120 char buffer[164]; + #ifdef __clang_analyzer__ + memset(buffer, 0, sizeof(buffer)); + #endif assert((BASE64_LENGTH(B64_CHUNK_SIZE) + 4) <= sizeof(buffer)); assert((B64_CHUNK_SIZE % 6) == 0); if (url_encode) { diff --git a/Utilities/cmlibuv/src/unix/tty.c b/Utilities/cmlibuv/src/unix/tty.c index 44fdb9c..d794bd5 100644 --- a/Utilities/cmlibuv/src/unix/tty.c +++ b/Utilities/cmlibuv/src/unix/tty.c @@ -354,6 +354,10 @@ uv_handle_type uv_guess_handle(uv_file file) { socklen_t len; int type; + #ifdef __clang_analyzer__ + memset(&ss, 0, sizeof(ss)); + #endif + if (file < 0) return UV_UNKNOWN_HANDLE; diff --git a/Utilities/cmlibuv/src/unix/udp.c b/Utilities/cmlibuv/src/unix/udp.c index 4d985b8..83acf13 100644 --- a/Utilities/cmlibuv/src/unix/udp.c +++ b/Utilities/cmlibuv/src/unix/udp.c @@ -194,6 +194,12 @@ static int uv__udp_recvmmsg(uv_udp_t* handle, uv_buf_t* buf) { int flags; size_t k; + #ifdef __clang_analyzer__ + /* Tell clang-analyzer the array is initialized. + The part we use is initialized below. */ + memset(iov, 0, sizeof(iov)); + #endif + /* prepare structures for recvmmsg */ chunks = buf->len / UV__UDP_DGRAM_MAXSIZE; if (chunks > ARRAY_SIZE(iov)) diff --git a/Utilities/cmnghttp2/lib/nghttp2_buf.c b/Utilities/cmnghttp2/lib/nghttp2_buf.c index a328447..ce51251 100644 --- a/Utilities/cmnghttp2/lib/nghttp2_buf.c +++ b/Utilities/cmnghttp2/lib/nghttp2_buf.c @@ -26,6 +26,10 @@ #include <stdio.h> +#ifdef __clang_analyzer__ +#include <assert.h> +#endif + #include "nghttp2_helper.h" #include "nghttp2_debug.h" @@ -386,6 +390,10 @@ int nghttp2_bufs_addb(nghttp2_bufs *bufs, uint8_t b) { return rv; } +#ifdef __clang_analyzer__ + assert(bufs->cur->buf.last); +#endif + *bufs->cur->buf.last++ = b; return 0; @@ -399,6 +407,10 @@ int nghttp2_bufs_addb_hold(nghttp2_bufs *bufs, uint8_t b) { return rv; } +#ifdef __clang_analyzer__ + assert(bufs->cur->buf.last); +#endif + *bufs->cur->buf.last = b; return 0; @@ -412,6 +424,10 @@ int nghttp2_bufs_orb(nghttp2_bufs *bufs, uint8_t b) { return rv; } +#ifdef __clang_analyzer__ + assert(bufs->cur->buf.last); +#endif + *bufs->cur->buf.last++ |= b; return 0; diff --git a/Utilities/cmzlib/gzread.c b/Utilities/cmzlib/gzread.c index 22052dd..e3519e6 100644 --- a/Utilities/cmzlib/gzread.c +++ b/Utilities/cmzlib/gzread.c @@ -434,6 +434,12 @@ z_size_t ZEXPORT gzfread(buf, size, nitems, file) return 0; } +#ifdef __clang_analyzer__ + /* clang-analyzer does not see size==0 through len==0 below. */ + if (!size) + return 0; +#endif + /* read len or fewer bytes to buf, return the number of full items read */ return len ? gz_read(state, buf, len) / size : 0; } diff --git a/Utilities/cmzlib/gzwrite.c b/Utilities/cmzlib/gzwrite.c index a8ffc8f..33f4949 100644 --- a/Utilities/cmzlib/gzwrite.c +++ b/Utilities/cmzlib/gzwrite.c @@ -305,6 +305,12 @@ z_size_t ZEXPORT gzfwrite(buf, size, nitems, file) return 0; } +#ifdef __clang_analyzer__ + /* clang-analyzer does not see size==0 through len==0 below. */ + if (!size) + return 0; +#endif + /* write len bytes to buf, return the number of full items written */ return len ? gz_write(state, buf, len) / size : 0; } diff --git a/Utilities/cmzstd/lib/common/bitstream.h b/Utilities/cmzstd/lib/common/bitstream.h index 2e5a933..136a188 100644 --- a/Utilities/cmzstd/lib/common/bitstream.h +++ b/Utilities/cmzstd/lib/common/bitstream.h @@ -14,6 +14,8 @@ #ifndef BITSTREAM_H_MODULE #define BITSTREAM_H_MODULE +#include <assert.h> + #if defined (__cplusplus) extern "C" { #endif diff --git a/Utilities/cmzstd/lib/compress/fse_compress.c b/Utilities/cmzstd/lib/compress/fse_compress.c index b4297ec..1b6a076 100644 --- a/Utilities/cmzstd/lib/compress/fse_compress.c +++ b/Utilities/cmzstd/lib/compress/fse_compress.c @@ -646,6 +646,10 @@ size_t FSE_compress_wksp (void* dst, size_t dstSize, const void* src, size_t src void* scratchBuffer = (void*)(CTable + CTableSize); size_t const scratchBufferSize = wkspSize - (CTableSize * sizeof(FSE_CTable)); +#ifdef __clang_analyzer__ + memset(norm, 0, sizeof(norm)); +#endif + /* init conditions */ if (wkspSize < FSE_COMPRESS_WKSP_SIZE_U32(tableLog, maxSymbolValue)) return ERROR(tableLog_tooLarge); if (srcSize <= 1) return 0; /* Not compressible */ diff --git a/Utilities/cmzstd/lib/dictBuilder/divsufsort.c b/Utilities/cmzstd/lib/dictBuilder/divsufsort.c index a2870fb..8d52b18 100644 --- a/Utilities/cmzstd/lib/dictBuilder/divsufsort.c +++ b/Utilities/cmzstd/lib/dictBuilder/divsufsort.c @@ -40,6 +40,10 @@ #include <stdio.h> #include <stdlib.h> +#ifdef __clang_analyzer__ +#include <string.h> +#endif + #include "divsufsort.h" /*- Constants -*/ @@ -1119,6 +1123,9 @@ tr_copy(int *ISA, const int *SA, v = b - SA - 1; for(c = first, d = a - 1; c <= d; ++c) { + #ifdef __clang_analyzer__ + assert(c); + #endif if((0 <= (s = *c - depth)) && (ISA[s] == v)) { *++d = s; ISA[s] = d - SA; @@ -1184,6 +1191,10 @@ tr_introsort(int *ISA, const int *ISAd, int limit, next; int ssize, trlink = -1; + #ifdef __clang_analyzer__ + memset(stack, 0, sizeof(stack)); + #endif + for(ssize = 0, limit = tr_ilg(last - first);;) { if(limit < 0) { |