diff options
607 files changed, 8328 insertions, 2940 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 297afda..864ee2e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -96,9 +96,9 @@ l:codespell: - .linux_x86_64_tags - .run_automatically -l:iwyu-debian10: +l:iwyu-debian12: extends: - - .debian10_iwyu + - .debian12_iwyu - .cmake_build_linux - .linux_x86_64_tags - .run_automatically @@ -153,9 +153,9 @@ b:centos7-aarch64: CMAKE_CI_ARTIFACTS_NAME: "artifacts-centos7-aarch64" CMAKE_CI_NO_MR: "true" -t:debian10-ninja: +t:debian12-ninja: extends: - - .debian10_ninja + - .debian12_ninja - .cmake_test_linux_release - .linux_x86_64_tags - .cmake_junit_artifacts @@ -164,9 +164,9 @@ t:debian10-ninja: variables: CMAKE_CI_JOB_NIGHTLY_NINJA: "true" -t:debian10-aarch64-ninja: +t:debian12-aarch64-ninja: extends: - - .debian10_aarch64_ninja + - .debian12_aarch64_ninja - .cmake_test_linux_release - .linux_aarch64_tags - .cmake_junit_artifacts @@ -175,9 +175,9 @@ t:debian10-aarch64-ninja: variables: CMAKE_CI_NO_MR: "true" -t:debian10-ninja-clang: +t:debian12-ninja-clang: extends: - - .debian10_ninja_clang + - .debian12_ninja_clang - .cmake_test_linux_release - .linux_x86_64_tags - .run_dependent @@ -185,9 +185,9 @@ t:debian10-ninja-clang: variables: CMAKE_CI_JOB_NIGHTLY: "true" -t:debian10-makefiles-clang: +t:debian12-makefiles-clang: extends: - - .debian10_makefiles_clang + - .debian12_makefiles_clang - .cmake_test_linux_release - .linux_x86_64_tags - .run_dependent @@ -354,27 +354,27 @@ b:fedora38-ninja: variables: CMAKE_CI_JOB_CONTINUOUS: "true" -b:debian10-makefiles-inplace: +b:debian12-makefiles-inplace: extends: - - .debian10_makefiles_inplace + - .debian12_makefiles_inplace - .cmake_build_linux_standalone - .linux_x86_64_tags - .run_manually variables: CMAKE_CI_JOB_NIGHTLY: "true" -b:debian10-extdeps: +b:debian12-extdeps: extends: - - .debian10_extdeps + - .debian12_extdeps - .cmake_build_linux_standalone - .linux_x86_64_tags - .run_manually variables: CMAKE_CI_JOB_NIGHTLY: "true" -b:debian10-aarch64-extdeps: +b:debian12-aarch64-extdeps: extends: - - .debian10_aarch64_extdeps + - .debian12_aarch64_extdeps - .cmake_build_linux_standalone - .linux_aarch64_tags - .run_manually @@ -826,6 +826,15 @@ b:macos-arm64-ninja: variables: CMAKE_CI_JOB_CONTINUOUS: "true" +b:macos-arm64-pch: + extends: + - .macos_arm64_pch + - .cmake_build_macos + - .macos_arm64_tags + - .run_manually + variables: + CMAKE_CI_JOB_NIGHTLY: "true" + t:macos-x86_64-ninja: extends: - .macos_x86_64_ninja @@ -998,6 +1007,15 @@ b:windows-vs2022-x64-ninja: - .windows_x86_64_tags_nonconcurrent_vs2022 - .run_manually +b:windows-vs2022-x64-pch: + extends: + - .windows_vs2022_x64_pch + - .cmake_build_windows + - .windows_x86_64_tags_nonconcurrent_vs2022 + - .run_manually + variables: + CMAKE_CI_JOB_NIGHTLY: "true" + t:windows-vs2022-x64-ninja: extends: - .windows_vs2022_x64_ninja diff --git a/.gitlab/ci/configure_common.cmake b/.gitlab/ci/configure_common.cmake index c207a74..f03c4b8 100644 --- a/.gitlab/ci/configure_common.cmake +++ b/.gitlab/ci/configure_common.cmake @@ -13,6 +13,10 @@ set(CMAKE_SKIP_INSTALL_ALL_DEPENDENCY "ON" CACHE BOOL "") set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install" CACHE PATH "") set(CMake_TEST_INSTALL "OFF" CACHE BOOL "") +set(CTEST_TEST_CTEST ON CACHE BOOL "") +set(CMAKE_RUN_LONG_TESTS ON CACHE BOOL "") +set(CMAKE_TESTS_CDASH_SERVER "NOTFOUND" CACHE STRING "") + if (NOT "$ENV{CMAKE_CI_BUILD_TYPE}" STREQUAL "") set(CMAKE_BUILD_TYPE "$ENV{CMAKE_CI_BUILD_TYPE}" CACHE STRING "") endif () diff --git a/.gitlab/ci/configure_debian10_extdeps.cmake b/.gitlab/ci/configure_debian12_aarch64_extdeps.cmake index 8e545f5..8e545f5 100644 --- a/.gitlab/ci/configure_debian10_extdeps.cmake +++ b/.gitlab/ci/configure_debian12_aarch64_extdeps.cmake diff --git a/.gitlab/ci/configure_debian10_aarch64_ninja.cmake b/.gitlab/ci/configure_debian12_aarch64_ninja.cmake index dff0db1..5b97e4f 100644 --- a/.gitlab/ci/configure_debian10_aarch64_ninja.cmake +++ b/.gitlab/ci/configure_debian12_aarch64_ninja.cmake @@ -28,14 +28,14 @@ set(CMake_TEST_FindGTK2 "ON" CACHE BOOL "") set(CMake_TEST_FindHDF5 "ON" CACHE BOOL "") set(CMake_TEST_FindHDF5_MPICH_C_COMPILER "/usr/bin/h5pcc.mpich" CACHE FILEPATH "") set(CMake_TEST_FindHDF5_MPICH_C_COMPILER_EXPLICIT "ON" CACHE BOOL "") -# set(CMake_TEST_FindHDF5_MPICH_CXX_COMPILER "/usr/bin/h5c++.mpich" CACHE FILEPATH "") # h5c++.mpich does not exist -# set(CMake_TEST_FindHDF5_MPICH_CXX_COMPILER_EXPLICIT "ON" CACHE BOOL "") +set(CMake_TEST_FindHDF5_MPICH_CXX_COMPILER "/usr/bin/h5c++.mpich" CACHE FILEPATH "") +set(CMake_TEST_FindHDF5_MPICH_CXX_COMPILER_EXPLICIT "ON" CACHE BOOL "") set(CMake_TEST_FindHDF5_MPICH_Fortran_COMPILER "/usr/bin/h5pfc.mpich" CACHE FILEPATH "") set(CMake_TEST_FindHDF5_MPICH_Fortran_COMPILER_EXPLICIT "ON" CACHE BOOL "") set(CMake_TEST_FindHDF5_OpenMPI_C_COMPILER "/usr/bin/h5pcc.openmpi" CACHE FILEPATH "") set(CMake_TEST_FindHDF5_OpenMPI_C_COMPILER_EXPLICIT "ON" CACHE BOOL "") -# set(CMake_TEST_FindHDF5_OpenMPI_CXX_COMPILER "/usr/bin/h5c++.openmpi" CACHE FILEPATH "") # h5c++.openmpi does not exist -# set(CMake_TEST_FindHDF5_OpenMPI_CXX_COMPILER_EXPLICIT "ON" CACHE BOOL "") +set(CMake_TEST_FindHDF5_OpenMPI_CXX_COMPILER "/usr/bin/h5c++.openmpi" CACHE FILEPATH "") +set(CMake_TEST_FindHDF5_OpenMPI_CXX_COMPILER_EXPLICIT "ON" CACHE BOOL "") set(CMake_TEST_FindHDF5_OpenMPI_Fortran_COMPILER "/usr/bin/h5pfc.openmpi" CACHE FILEPATH "") set(CMake_TEST_FindHDF5_OpenMPI_Fortran_COMPILER_EXPLICIT "ON" CACHE BOOL "") set(CMake_TEST_FindHDF5_Serial_C_COMPILER "/usr/bin/h5cc" CACHE FILEPATH "") @@ -74,9 +74,9 @@ set(CMake_TEST_FindPNG "ON" CACHE BOOL "") set(CMake_TEST_FindPostgreSQL "ON" CACHE BOOL "") set(CMake_TEST_FindProtobuf "ON" CACHE BOOL "") set(CMake_TEST_FindProtobuf_gRPC "ON" CACHE BOOL "") -set(CMake_TEST_FindPython "ON" CACHE BOOL "") -set(CMake_TEST_FindPython_NumPy "ON" CACHE BOOL "") -set(CMake_TEST_FindPython_PyPy "ON" CACHE BOOL "") +set(CMake_TEST_FindPython3 "ON" CACHE BOOL "") +set(CMake_TEST_FindPython3_NumPy "ON" CACHE BOOL "") +set(CMake_TEST_FindPython3_PyPy "ON" CACHE BOOL "") set(CMake_TEST_FindRuby "ON" CACHE BOOL "") set(CMake_TEST_FindSDL "ON" CACHE BOOL "") set(CMake_TEST_FindSQLite3 "ON" CACHE BOOL "") diff --git a/.gitlab/ci/configure_debian10_aarch64_extdeps.cmake b/.gitlab/ci/configure_debian12_extdeps.cmake index 8e545f5..8e545f5 100644 --- a/.gitlab/ci/configure_debian10_aarch64_extdeps.cmake +++ b/.gitlab/ci/configure_debian12_extdeps.cmake diff --git a/.gitlab/ci/configure_debian10_iwyu.cmake b/.gitlab/ci/configure_debian12_iwyu.cmake index abe750d..37ccbf4 100644 --- a/.gitlab/ci/configure_debian10_iwyu.cmake +++ b/.gitlab/ci/configure_debian12_iwyu.cmake @@ -1,6 +1,7 @@ set(CMake_RUN_IWYU ON CACHE BOOL "") +set(CMake_IWYU_OPTIONS "-DCMAKE_IWYU_FORWARD_STD_HASH" CACHE STRING "") # Uncomment to diagnose IWYU problems as needed. #set(CMake_IWYU_VERBOSE ON CACHE BOOL "") -set(IWYU_COMMAND "/usr/bin/include-what-you-use-6.0" CACHE FILEPATH "") +set(IWYU_COMMAND "/usr/bin/include-what-you-use-15" CACHE FILEPATH "") include("${CMAKE_CURRENT_LIST_DIR}/configure_common.cmake") diff --git a/.gitlab/ci/configure_debian10_ninja_clang.cmake b/.gitlab/ci/configure_debian12_makefiles_clang.cmake index 20863a2..20863a2 100644 --- a/.gitlab/ci/configure_debian10_ninja_clang.cmake +++ b/.gitlab/ci/configure_debian12_makefiles_clang.cmake diff --git a/.gitlab/ci/configure_debian10_makefiles_inplace.cmake b/.gitlab/ci/configure_debian12_makefiles_inplace.cmake index 33f0db0..33f0db0 100644 --- a/.gitlab/ci/configure_debian10_makefiles_inplace.cmake +++ b/.gitlab/ci/configure_debian12_makefiles_inplace.cmake diff --git a/.gitlab/ci/configure_debian10_ninja.cmake b/.gitlab/ci/configure_debian12_ninja.cmake index 211a2a7..f70e3d5 100644 --- a/.gitlab/ci/configure_debian10_ninja.cmake +++ b/.gitlab/ci/configure_debian12_ninja.cmake @@ -32,14 +32,14 @@ set(CMake_TEST_FindGTK2 "ON" CACHE BOOL "") set(CMake_TEST_FindHDF5 "ON" CACHE BOOL "") set(CMake_TEST_FindHDF5_MPICH_C_COMPILER "/usr/bin/h5pcc.mpich" CACHE FILEPATH "") set(CMake_TEST_FindHDF5_MPICH_C_COMPILER_EXPLICIT "ON" CACHE BOOL "") -# set(CMake_TEST_FindHDF5_MPICH_CXX_COMPILER "/usr/bin/h5c++.mpich" CACHE FILEPATH "") # h5c++.mpich does not exist -# set(CMake_TEST_FindHDF5_MPICH_CXX_COMPILER_EXPLICIT "ON" CACHE BOOL "") +set(CMake_TEST_FindHDF5_MPICH_CXX_COMPILER "/usr/bin/h5c++.mpich" CACHE FILEPATH "") +set(CMake_TEST_FindHDF5_MPICH_CXX_COMPILER_EXPLICIT "ON" CACHE BOOL "") set(CMake_TEST_FindHDF5_MPICH_Fortran_COMPILER "/usr/bin/h5pfc.mpich" CACHE FILEPATH "") set(CMake_TEST_FindHDF5_MPICH_Fortran_COMPILER_EXPLICIT "ON" CACHE BOOL "") set(CMake_TEST_FindHDF5_OpenMPI_C_COMPILER "/usr/bin/h5pcc.openmpi" CACHE FILEPATH "") set(CMake_TEST_FindHDF5_OpenMPI_C_COMPILER_EXPLICIT "ON" CACHE BOOL "") -# set(CMake_TEST_FindHDF5_OpenMPI_CXX_COMPILER "/usr/bin/h5c++.openmpi" CACHE FILEPATH "") # h5c++.openmpi does not exist -# set(CMake_TEST_FindHDF5_OpenMPI_CXX_COMPILER_EXPLICIT "ON" CACHE BOOL "") +set(CMake_TEST_FindHDF5_OpenMPI_CXX_COMPILER "/usr/bin/h5c++.openmpi" CACHE FILEPATH "") +set(CMake_TEST_FindHDF5_OpenMPI_CXX_COMPILER_EXPLICIT "ON" CACHE BOOL "") set(CMake_TEST_FindHDF5_OpenMPI_Fortran_COMPILER "/usr/bin/h5pfc.openmpi" CACHE FILEPATH "") set(CMake_TEST_FindHDF5_OpenMPI_Fortran_COMPILER_EXPLICIT "ON" CACHE BOOL "") set(CMake_TEST_FindHDF5_Serial_C_COMPILER "/usr/bin/h5cc" CACHE FILEPATH "") @@ -78,10 +78,9 @@ set(CMake_TEST_FindPNG "ON" CACHE BOOL "") set(CMake_TEST_FindPostgreSQL "ON" CACHE BOOL "") set(CMake_TEST_FindProtobuf "ON" CACHE BOOL "") set(CMake_TEST_FindProtobuf_gRPC "ON" CACHE BOOL "") -set(CMake_TEST_FindPython "ON" CACHE BOOL "") -set(CMake_TEST_FindPython_IronPython "ON" CACHE BOOL "") -set(CMake_TEST_FindPython_NumPy "ON" CACHE BOOL "") -set(CMake_TEST_FindPython_PyPy "ON" CACHE BOOL "") +set(CMake_TEST_FindPython3 "ON" CACHE BOOL "") +set(CMake_TEST_FindPython3_IronPython "ON" CACHE BOOL "") +set(CMake_TEST_FindPython3_PyPy "ON" CACHE BOOL "") set(CMake_TEST_FindRuby "ON" CACHE BOOL "") set(CMake_TEST_FindRuby_RVM "ON" CACHE BOOL "") set(CMake_TEST_FindSDL "ON" CACHE BOOL "") @@ -104,4 +103,8 @@ if (NOT "$ENV{SWIFTC}" STREQUAL "") set(CMAKE_Swift_COMPILER "$ENV{SWIFTC}" CACHE FILEPATH "") endif() +if (NOT "$ENV{CMAKE_CI_NIGHTLY}" STREQUAL "") + set(CMAKE_TESTS_CDASH_SERVER "https://open.cdash.org" CACHE STRING "") +endif() + include("${CMAKE_CURRENT_LIST_DIR}/configure_external_test.cmake") diff --git a/.gitlab/ci/configure_debian10_makefiles_clang.cmake b/.gitlab/ci/configure_debian12_ninja_clang.cmake index 20863a2..20863a2 100644 --- a/.gitlab/ci/configure_debian10_makefiles_clang.cmake +++ b/.gitlab/ci/configure_debian12_ninja_clang.cmake diff --git a/.gitlab/ci/configure_fedora38_makefiles.cmake b/.gitlab/ci/configure_fedora38_makefiles.cmake index c2f9982..a3881cf 100644 --- a/.gitlab/ci/configure_fedora38_makefiles.cmake +++ b/.gitlab/ci/configure_fedora38_makefiles.cmake @@ -74,9 +74,12 @@ set(CMake_TEST_FindPNG "ON" CACHE BOOL "") set(CMake_TEST_FindPostgreSQL "ON" CACHE BOOL "") set(CMake_TEST_FindProtobuf "ON" CACHE BOOL "") set(CMake_TEST_FindProtobuf_gRPC "ON" CACHE BOOL "") -set(CMake_TEST_FindPython "ON" CACHE BOOL "") -set(CMake_TEST_FindPython_NumPy "ON" CACHE BOOL "") -set(CMake_TEST_FindPython_PyPy "ON" CACHE BOOL "") +set(CMake_TEST_FindPython2 "ON" CACHE BOOL "") +set(CMake_TEST_FindPython3 "ON" CACHE BOOL "") +set(CMake_TEST_FindPython2_NumPy "ON" CACHE BOOL "") +set(CMake_TEST_FindPython3_NumPy "ON" CACHE BOOL "") +set(CMake_TEST_FindPython2_PyPy "ON" CACHE BOOL "") +set(CMake_TEST_FindPython3_PyPy "ON" CACHE BOOL "") set(CMake_TEST_FindRuby "ON" CACHE BOOL "") set(CMake_TEST_FindRuby_RVM "ON" CACHE BOOL "") set(CMake_TEST_FindSDL "ON" CACHE BOOL "") diff --git a/.gitlab/ci/configure_fedora38_makefiles_clang.cmake b/.gitlab/ci/configure_fedora38_makefiles_clang.cmake index ff30ad9..3ac23be 100644 --- a/.gitlab/ci/configure_fedora38_makefiles_clang.cmake +++ b/.gitlab/ci/configure_fedora38_makefiles_clang.cmake @@ -1 +1,5 @@ +if (NOT "$ENV{CMAKE_CI_NIGHTLY}" STREQUAL "") + set(CMAKE_TESTS_CDASH_SERVER "https://open.cdash.org" CACHE STRING "") +endif() + include("${CMAKE_CURRENT_LIST_DIR}/configure_fedora38_common_clang.cmake") diff --git a/.gitlab/ci/configure_macos_arm64_ninja_multi.cmake b/.gitlab/ci/configure_macos_arm64_ninja_multi.cmake index b22285c..5b19c60 100644 --- a/.gitlab/ci/configure_macos_arm64_ninja_multi.cmake +++ b/.gitlab/ci/configure_macos_arm64_ninja_multi.cmake @@ -1,6 +1,11 @@ if (NOT "$ENV{CMAKE_CI_NIGHTLY}" STREQUAL "") set(CMake_TEST_ISPC "ON" CACHE STRING "") + set(CMAKE_TESTS_CDASH_SERVER "https://open.cdash.org" CACHE STRING "") endif() +# FIXME: sccache sometimes fails with "Compiler killed by signal 9". +# This job does not compile much anyway, so suppress it for now. +set(configure_no_sccache 1) + include("${CMAKE_CURRENT_LIST_DIR}/configure_macos_common.cmake") include("${CMAKE_CURRENT_LIST_DIR}/configure_external_test.cmake") diff --git a/.gitlab/ci/configure_macos_arm64_pch.cmake b/.gitlab/ci/configure_macos_arm64_pch.cmake new file mode 100644 index 0000000..e2676ba --- /dev/null +++ b/.gitlab/ci/configure_macos_arm64_pch.cmake @@ -0,0 +1,7 @@ +set(CMake_BUILD_PCH "ON" CACHE BOOL "") + +# sccache does not forward the PCH '-Xarch_arm64 "-include/..."' flag correctly. +set(configure_no_sccache 1) + +include("${CMAKE_CURRENT_LIST_DIR}/configure_macos_common.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/configure_common.cmake") diff --git a/.gitlab/ci/configure_windows_vs2019_x64.cmake b/.gitlab/ci/configure_windows_vs2019_x64.cmake index c7d41ea..b859525 100644 --- a/.gitlab/ci/configure_windows_vs2019_x64.cmake +++ b/.gitlab/ci/configure_windows_vs2019_x64.cmake @@ -1 +1,5 @@ +if (NOT "$ENV{CMAKE_CI_NIGHTLY}" STREQUAL "") + set(CMAKE_TESTS_CDASH_SERVER "https://open.cdash.org" CACHE STRING "") +endif() + include("${CMAKE_CURRENT_LIST_DIR}/configure_windows_vs_common.cmake") diff --git a/.gitlab/ci/configure_windows_vs2022_x64_pch.cmake b/.gitlab/ci/configure_windows_vs2022_x64_pch.cmake new file mode 100644 index 0000000..2a2eed7 --- /dev/null +++ b/.gitlab/ci/configure_windows_vs2022_x64_pch.cmake @@ -0,0 +1,2 @@ +set(CMake_BUILD_PCH "ON" CACHE BOOL "") +include("${CMAKE_CURRENT_LIST_DIR}/configure_windows_common.cmake") diff --git a/.gitlab/ci/docker/debian10/install_deps.sh b/.gitlab/ci/docker/debian10/install_deps.sh deleted file mode 100755 index a00e322..0000000 --- a/.gitlab/ci/docker/debian10/install_deps.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh - -set -e - -apt-get install -y $(grep '^[^#]\+$' /root/deps_packages.lst) - -curl -L -O https://github.com/IronLanguages/ironpython2/releases/download/ipy-2.7.10/ironpython_2.7.10.deb -echo 'e1aceec1d49ffa66e9059a52168a734999dcccc50164a60e2936649cae698f3e ironpython_2.7.10.deb' > ironpython.sha256sum -sha256sum --check ironpython.sha256sum -dpkg -i ironpython_2.7.10.deb -rm ironpython_2.7.10.deb ironpython.sha256sum - -# Perforce -curl -L https://www.perforce.com/downloads/perforce/r21.2/bin.linux26x86_64/helix-core-server.tgz -o - \ - | tar -C /usr/local/bin -xvzf - -- p4 p4d diff --git a/.gitlab/ci/docker/debian10-aarch64/Dockerfile b/.gitlab/ci/docker/debian12-aarch64/Dockerfile index a0687e3..58b5e0e 100644 --- a/.gitlab/ci/docker/debian10-aarch64/Dockerfile +++ b/.gitlab/ci/docker/debian12-aarch64/Dockerfile @@ -1,6 +1,6 @@ # syntax=docker/dockerfile:1 -ARG BASE_IMAGE=arm64v8/debian:10 +ARG BASE_IMAGE=arm64v8/debian:12 FROM ${BASE_IMAGE} AS apt-cache # Populate APT cache w/ the fresh metadata and prefetch packages. diff --git a/.gitlab/ci/docker/debian10-aarch64/deps_packages.lst b/.gitlab/ci/docker/debian12-aarch64/deps_packages.lst index ca83323..c92c715 100644 --- a/.gitlab/ci/docker/debian10-aarch64/deps_packages.lst +++ b/.gitlab/ci/docker/debian12-aarch64/deps_packages.lst @@ -20,14 +20,14 @@ libzstd-dev zlib1g-dev # Install iwyu runtime deps. -clang-6.0 +clang-15 libncurses6 # Tools needed for the test suite. jq # Packages needed to test CTest. -bzr bzr-xmloutput +bzr cvs subversion mercurial @@ -73,20 +73,19 @@ libopenal-dev libopenmpi-dev openmpi-bin libosp-dev libpng-dev -libpq-dev postgresql-server-dev-11 +libpq-dev postgresql-server-dev-15 libprotobuf-dev libprotobuf-c-dev libprotoc-dev protobuf-compiler protobuf-compiler-grpc -libsdl-dev +libsdl1.2-dev libsqlite3-dev libtiff-dev libuv1-dev -libwxgtk3.0-dev +libwxgtk3.2-dev libx11-dev libxalan-c-dev libxerces-c-dev libxml2-dev libxml2-utils libxslt-dev xsltproc -openjdk-11-jdk -python2 python2-dev python-numpy pypy pypy-dev +openjdk-17-jdk python3 python3-dev python3-numpy pypy3 pypy3-dev python3-venv qtbase5-dev qtbase5-dev-tools ruby ruby-dev diff --git a/.gitlab/ci/docker/debian10/docker-clean b/.gitlab/ci/docker/debian12-aarch64/docker-clean index e69de29..e69de29 100644 --- a/.gitlab/ci/docker/debian10/docker-clean +++ b/.gitlab/ci/docker/debian12-aarch64/docker-clean diff --git a/.gitlab/ci/docker/debian10/dpkg-exclude b/.gitlab/ci/docker/debian12-aarch64/dpkg-exclude index 60b6565..60b6565 100644 --- a/.gitlab/ci/docker/debian10/dpkg-exclude +++ b/.gitlab/ci/docker/debian12-aarch64/dpkg-exclude diff --git a/.gitlab/ci/docker/debian10-aarch64/install_deps.sh b/.gitlab/ci/docker/debian12-aarch64/install_deps.sh index d1c8aed..d1c8aed 100755 --- a/.gitlab/ci/docker/debian10-aarch64/install_deps.sh +++ b/.gitlab/ci/docker/debian12-aarch64/install_deps.sh diff --git a/.gitlab/ci/docker/debian10/Dockerfile b/.gitlab/ci/docker/debian12-x86_64/Dockerfile index d866428..477e763 100644 --- a/.gitlab/ci/docker/debian10/Dockerfile +++ b/.gitlab/ci/docker/debian12-x86_64/Dockerfile @@ -1,6 +1,6 @@ # syntax=docker/dockerfile:1 -ARG BASE_IMAGE=debian:10 +ARG BASE_IMAGE=debian:12 FROM ${BASE_IMAGE} AS apt-cache # Populate APT cache w/ the fresh metadata and prefetch packages. @@ -56,7 +56,7 @@ RUN --mount=type=bind,source=install_deps.sh,target=/root/install_deps.sh \ RUN --mount=type=bind,from=iwyu-build,source=/root,target=/root \ tar -C / -xf /root/iwyu.tar \ - && ln -s /usr/lib/llvm-6.0/bin/include-what-you-use /usr/bin/include-what-you-use-6.0 + && ln -s /usr/lib/llvm-15/bin/include-what-you-use /usr/bin/include-what-you-use-15 RUN --mount=type=bind,from=rvm-build,source=/root,target=/root \ tar -C /usr/local -xf /root/rvm.tar diff --git a/.gitlab/ci/docker/debian10/deps_packages.lst b/.gitlab/ci/docker/debian12-x86_64/deps_packages.lst index 0b79675..a59f2c9 100644 --- a/.gitlab/ci/docker/debian10/deps_packages.lst +++ b/.gitlab/ci/docker/debian12-x86_64/deps_packages.lst @@ -20,18 +20,21 @@ libzstd-dev zlib1g-dev # Install iwyu runtime deps. -clang-6.0 +clang-15 libncurses6 # Tools needed for the test suite. jq # Packages needed to test CTest. -bzr bzr-xmloutput +bzr cvs subversion mercurial +# Install HIP language toolchain. +hipcc + # Install swift runtime deps. libncurses5 @@ -76,25 +79,24 @@ libopenal-dev libopenmpi-dev openmpi-bin libosp-dev libpng-dev -libpq-dev postgresql-server-dev-11 +libpq-dev postgresql-server-dev-15 libprotobuf-dev libprotobuf-c-dev libprotoc-dev protobuf-compiler protobuf-compiler-grpc -libsdl-dev +libsdl1.2-dev libsqlite3-dev libtiff-dev libuv1-dev -libwxgtk3.0-dev +libwxgtk3.2-dev libx11-dev libxalan-c-dev libxerces-c-dev libxml2-dev libxml2-utils libxslt-dev xsltproc -openjdk-11-jdk -python2 python2-dev python-numpy pypy pypy-dev +openjdk-17-jdk python3 python3-dev python3-numpy pypy3 pypy3-dev python3-venv qtbase5-dev qtbase5-dev-tools ruby ruby-dev swig unixodbc-dev -# CMake_TEST_FindPython_IronPython +# Packages needed to test ironpython. libmono-system-windows-forms4.0-cil diff --git a/.gitlab/ci/docker/debian10-aarch64/docker-clean b/.gitlab/ci/docker/debian12-x86_64/docker-clean index e69de29..e69de29 100644 --- a/.gitlab/ci/docker/debian10-aarch64/docker-clean +++ b/.gitlab/ci/docker/debian12-x86_64/docker-clean diff --git a/.gitlab/ci/docker/debian10-aarch64/dpkg-exclude b/.gitlab/ci/docker/debian12-x86_64/dpkg-exclude index 60b6565..60b6565 100644 --- a/.gitlab/ci/docker/debian10-aarch64/dpkg-exclude +++ b/.gitlab/ci/docker/debian12-x86_64/dpkg-exclude diff --git a/.gitlab/ci/docker/debian12-x86_64/install_deps.sh b/.gitlab/ci/docker/debian12-x86_64/install_deps.sh new file mode 100755 index 0000000..7bfcacd --- /dev/null +++ b/.gitlab/ci/docker/debian12-x86_64/install_deps.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +set -e + +apt-get install -y $(grep '^[^#]\+$' /root/deps_packages.lst) + +curl -L -O https://github.com/IronLanguages/ironpython3/releases/download/v3.4.0/ironpython_3.4.0.deb +echo '7dcd10b7a0ec0342bd7e20eebb597a96bb15267eb797d59358a3b1cfaa3e1adc ironpython_3.4.0.deb' > ironpython.sha256sum +sha256sum --check ironpython.sha256sum +dpkg -i ironpython_3.4.0.deb +rm ironpython_3.4.0.deb ironpython.sha256sum + +# Perforce +curl -L https://www.perforce.com/downloads/perforce/r21.2/bin.linux26x86_64/helix-core-server.tgz -o - \ + | tar -C /usr/local/bin -xvzf - -- p4 p4d diff --git a/.gitlab/ci/docker/debian10/install_iwyu.sh b/.gitlab/ci/docker/debian12-x86_64/install_iwyu.sh index 4814a71..bbeceb8 100755 --- a/.gitlab/ci/docker/debian10/install_iwyu.sh +++ b/.gitlab/ci/docker/debian12-x86_64/install_iwyu.sh @@ -8,7 +8,7 @@ apt-get install -y $(grep '^[^#]\+$' /root/iwyu_packages.lst) cd /root git clone "https://github.com/include-what-you-use/include-what-you-use.git" cd include-what-you-use -readonly llvm_version="$( clang-6.0 --version | head -n1 | cut -d' ' -f3 | cut -d. -f-2 )" +readonly llvm_version="$( clang-15 --version | head -n1 | cut -d' ' -f4 | cut -d. -f-1 )" git checkout "clang_$llvm_version" mkdir build cd build @@ -16,7 +16,6 @@ cd build cmake -GNinja \ -DCMAKE_BUILD_TYPE=Release \ "-DCMAKE_INSTALL_PREFIX=/usr/lib/llvm-$llvm_version" \ - "-DIWYU_LLVM_ROOT_PATH=/usr/lib/llvm-$llvm_version" \ .. ninja DESTDIR=/root/iwyu-destdir ninja install diff --git a/.gitlab/ci/docker/debian10/install_rvm.sh b/.gitlab/ci/docker/debian12-x86_64/install_rvm.sh index c6fff70..1ad42c4 100755 --- a/.gitlab/ci/docker/debian10/install_rvm.sh +++ b/.gitlab/ci/docker/debian12-x86_64/install_rvm.sh @@ -11,7 +11,7 @@ gpg2 --keyserver hkps://keyserver.ubuntu.com \ curl -sSL https://get.rvm.io | bash -s stable # keep version in sync with `env_debian*_ninja.sh` -/usr/local/rvm/bin/rvm install ruby-2.7.0 +/usr/local/rvm/bin/rvm install ruby-3.2.2 for p in archives examples gem-cache log src; do touch /usr/local/rvm/${p}/.tar_exclude diff --git a/.gitlab/ci/docker/debian10/iwyu_packages.lst b/.gitlab/ci/docker/debian12-x86_64/iwyu_packages.lst index 9e291c9..2dbddba 100644 --- a/.gitlab/ci/docker/debian10/iwyu_packages.lst +++ b/.gitlab/ci/docker/debian12-x86_64/iwyu_packages.lst @@ -1,7 +1,7 @@ # Install development tools. -clang-6.0 -libclang-6.0-dev -llvm-6.0-dev +clang-15 +libclang-15-dev +llvm-15-dev libz-dev g++ cmake diff --git a/.gitlab/ci/docker/debian10/rvm_packages.lst b/.gitlab/ci/docker/debian12-x86_64/rvm_packages.lst index 80f079c..80f079c 100644 --- a/.gitlab/ci/docker/debian10/rvm_packages.lst +++ b/.gitlab/ci/docker/debian12-x86_64/rvm_packages.lst diff --git a/.gitlab/ci/env_debian10_makefiles_clang.sh b/.gitlab/ci/env_debian10_makefiles_clang.sh deleted file mode 100644 index e0d5d61..0000000 --- a/.gitlab/ci/env_debian10_makefiles_clang.sh +++ /dev/null @@ -1,2 +0,0 @@ -export CC=/usr/bin/clang-7 -export CXX=/usr/bin/clang++-7 diff --git a/.gitlab/ci/env_debian10_ninja_clang.sh b/.gitlab/ci/env_debian10_ninja_clang.sh deleted file mode 100644 index e0d5d61..0000000 --- a/.gitlab/ci/env_debian10_ninja_clang.sh +++ /dev/null @@ -1,2 +0,0 @@ -export CC=/usr/bin/clang-7 -export CXX=/usr/bin/clang++-7 diff --git a/.gitlab/ci/env_debian10_extdeps.sh b/.gitlab/ci/env_debian12_aarch64_extdeps.sh index 7076e18..7076e18 100644 --- a/.gitlab/ci/env_debian10_extdeps.sh +++ b/.gitlab/ci/env_debian12_aarch64_extdeps.sh diff --git a/.gitlab/ci/env_debian10_aarch64_extdeps.sh b/.gitlab/ci/env_debian12_extdeps.sh index 7076e18..7076e18 100644 --- a/.gitlab/ci/env_debian10_aarch64_extdeps.sh +++ b/.gitlab/ci/env_debian12_extdeps.sh diff --git a/.gitlab/ci/env_debian12_makefiles_clang.sh b/.gitlab/ci/env_debian12_makefiles_clang.sh new file mode 100644 index 0000000..eda7c1f --- /dev/null +++ b/.gitlab/ci/env_debian12_makefiles_clang.sh @@ -0,0 +1,2 @@ +export CC=/usr/bin/clang-15 +export CXX=/usr/bin/clang++-15 diff --git a/.gitlab/ci/env_debian10_ninja.sh b/.gitlab/ci/env_debian12_ninja.sh index ba8ad47..b2b471d 100644 --- a/.gitlab/ci/env_debian10_ninja.sh +++ b/.gitlab/ci/env_debian12_ninja.sh @@ -1,4 +1,4 @@ -export MY_RUBY_HOME="/usr/local/rvm/rubies/ruby-2.7.0" +export MY_RUBY_HOME="/usr/local/rvm/rubies/ruby-3.2.2" if test -z "$CI_MERGE_REQUEST_ID"; then curl -L -O "https://download.swift.org/swift-5.7.1-release/ubuntu1804/swift-5.7.1-RELEASE/swift-5.7.1-RELEASE-ubuntu18.04.tar.gz" diff --git a/.gitlab/ci/env_debian12_ninja_clang.sh b/.gitlab/ci/env_debian12_ninja_clang.sh new file mode 100644 index 0000000..eda7c1f --- /dev/null +++ b/.gitlab/ci/env_debian12_ninja_clang.sh @@ -0,0 +1,2 @@ +export CC=/usr/bin/clang-15 +export CXX=/usr/bin/clang++-15 diff --git a/.gitlab/ci/ispc.sh b/.gitlab/ci/ispc.sh index 59ee200..c1e3793 100755 --- a/.gitlab/ci/ispc.sh +++ b/.gitlab/ci/ispc.sh @@ -12,12 +12,12 @@ case "$(uname -s)-$(uname -m)" in ;; Darwin-arm64) shatool="shasum -a 256" - sha256sum="62cee043a3a4dbff8c2f6d3885a7e573901bbc1325dd93d50f92904b7ea67fec" + sha256sum="c423a5a88d7a9a6ed667e41d025801c123fa0c5fd384d4ea138fa1fcf2bc24c9" platform="macOS.arm64" ;; Darwin-x86_64) shatool="shasum -a 256" - sha256sum="da0f11a048a316081a8ad8170d48b170b2ed7efc3b140fc88b8611238809c8e4" + sha256sum="e25222d2d6f4f8e3561556ac73f88721ceb5486439d6c2a566d37407ad9a5907" platform="macOS.x86_64" ;; *) diff --git a/.gitlab/os-linux.yml b/.gitlab/os-linux.yml index 79217ee..def66de 100644 --- a/.gitlab/os-linux.yml +++ b/.gitlab/os-linux.yml @@ -44,23 +44,23 @@ ### Debian -.debian10: - image: "kitware/cmake:ci-debian10-x86_64-2023-03-29" +.debian12: + image: "kitware/cmake:ci-debian12-x86_64-2023-07-27" variables: GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci" CMAKE_ARCH: x86_64 -.debian10_iwyu: - extends: .debian10 +.debian12_iwyu: + extends: .debian12 variables: - CMAKE_CONFIGURATION: debian10_iwyu + CMAKE_CONFIGURATION: debian12_iwyu CTEST_NO_WARNINGS_ALLOWED: 1 CMAKE_CI_NO_INSTALL: 1 -.debian10_aarch64: - image: "kitware/cmake:ci-debian10-aarch64-2023-03-29" +.debian12_aarch64: + image: "kitware/cmake:ci-debian12-aarch64-2023-07-27" variables: GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci" @@ -112,44 +112,44 @@ #### Build and test -.debian10_ninja: - extends: .debian10 +.debian12_ninja: + extends: .debian12 variables: - CMAKE_CONFIGURATION: debian10_ninja + CMAKE_CONFIGURATION: debian12_ninja CTEST_NO_WARNINGS_ALLOWED: 1 -.debian10_aarch64_ninja: - extends: .debian10_aarch64 +.debian12_aarch64_ninja: + extends: .debian12_aarch64 variables: - CMAKE_CONFIGURATION: debian10_aarch64_ninja + CMAKE_CONFIGURATION: debian12_aarch64_ninja CTEST_NO_WARNINGS_ALLOWED: 1 -.debian10_makefiles_inplace: - extends: .debian10 +.debian12_makefiles_inplace: + extends: .debian12 variables: - CMAKE_CONFIGURATION: debian10_makefiles_inplace + CMAKE_CONFIGURATION: debian12_makefiles_inplace CMAKE_GENERATOR: "Unix Makefiles" CMAKE_CI_BOOTSTRAP: 1 CMAKE_CI_INPLACE: 1 CMAKE_CI_NO_INSTALL: 1 CTEST_NO_WARNINGS_ALLOWED: 1 -.debian10_extdeps: - extends: .debian10 +.debian12_extdeps: + extends: .debian12 variables: - CMAKE_CONFIGURATION: debian10_extdeps + CMAKE_CONFIGURATION: debian12_extdeps CMAKE_CI_BUILD_TYPE: Release CTEST_NO_WARNINGS_ALLOWED: 1 -.debian10_aarch64_extdeps: - extends: .debian10_aarch64 +.debian12_aarch64_extdeps: + extends: .debian12_aarch64 variables: - CMAKE_CONFIGURATION: debian10_aarch64_extdeps + CMAKE_CONFIGURATION: debian12_aarch64_extdeps CMAKE_CI_BUILD_TYPE: Release CTEST_NO_WARNINGS_ALLOWED: 1 @@ -187,18 +187,18 @@ ### Clang Compiler -.debian10_makefiles_clang: - extends: .debian10 +.debian12_makefiles_clang: + extends: .debian12 variables: - CMAKE_CONFIGURATION: debian10_makefiles_clang + CMAKE_CONFIGURATION: debian12_makefiles_clang CMAKE_GENERATOR: "Unix Makefiles" -.debian10_ninja_clang: - extends: .debian10 +.debian12_ninja_clang: + extends: .debian12 variables: - CMAKE_CONFIGURATION: debian10_ninja_clang + CMAKE_CONFIGURATION: debian12_ninja_clang .fedora38_makefiles_clang: extends: .fedora38 diff --git a/.gitlab/os-macos.yml b/.gitlab/os-macos.yml index 09d7598..fbba288 100644 --- a/.gitlab/os-macos.yml +++ b/.gitlab/os-macos.yml @@ -38,6 +38,12 @@ CMAKE_CONFIGURATION: macos_arm64_ninja CTEST_NO_WARNINGS_ALLOWED: 1 +.macos_arm64_pch: + extends: .macos_arm64_ninja + + variables: + CMAKE_CONFIGURATION: macos_arm64_pch + .macos_x86_64_makefiles: extends: .macos_build diff --git a/.gitlab/os-windows.yml b/.gitlab/os-windows.yml index 026f2f4..422e147 100644 --- a/.gitlab/os-windows.yml +++ b/.gitlab/os-windows.yml @@ -55,6 +55,13 @@ VCVARSPLATFORM: "arm64" VCVARSVERSION: "14.36.32532" +.windows_vs2022_x64_pch: + extends: + - .windows_vs2022_x64_ninja + + variables: + CMAKE_CONFIGURATION: windows_vs2022_x64_pch + .windows_vs2022_x64_ninja: extends: - .windows_build_ninja diff --git a/Auxiliary/vim/cmake.vim.in b/Auxiliary/vim/cmake.vim.in index 6edc040..39d7193 100644 --- a/Auxiliary/vim/cmake.vim.in +++ b/Auxiliary/vim/cmake.vim.in @@ -22,20 +22,20 @@ set cpo&vim syn region cmakeBracketArgument start="\[\z(=\?\|=[0-9]*\)\[" end="\]\z1\]" contains=cmakeTodo,@Spell syn region cmakeComment start="#" end="$" contains=cmakeTodo,@Spell -syn region cmakeBracketComment start="#\[\z(=\?\|=[0-9]*\)\[" end="\]\z1\]" contains=cmakeTodo,@Spell +syn region cmakeBracketComment start="\[\z(=*\)\[" end="\]\z1\]" contains=cmakeTodo,@Spell syn match cmakeEscaped /\(\\\\\|\\"\|\\n\|\\t\)/ contained syn region cmakeRegistry start="\[" end="]" contained oneline contains=cmakeTodo,cmakeEscaped syn region cmakeGeneratorExpression start="$<" end=">" contained oneline contains=cmakeVariableValue,cmakeProperty,cmakeGeneratorExpressions,cmakeTodo -syn region cmakeString start='"' end='"' contained contains=cmakeTodo,cmakeVariableValue,cmakeEscaped +syn region cmakeString start='"' end='"' contained contains=cmakeTodo,cmakeVariableValue,cmakeEscaped,@Spell syn region cmakeVariableValue start="${" end="}" contained oneline contains=cmakeVariable,cmakeTodo,cmakeVariableValue syn region cmakeEnvironment start="$ENV{" end="}" contained oneline contains=cmakeTodo -syn region cmakeArguments start="(" end=")" contains=ALLBUT,cmakeGeneratorExpressions,cmakeCommand,cmakeCommandConditional,cmakeCommandRepeat,cmakeCommandDeprecated,cmakeCommandManuallyAdded,cmakeArguments,cmakeTodo +syn region cmakeArguments start="(" end=")" contains=ALLBUT,cmakeGeneratorExpressions,cmakeCommand,cmakeCommandConditional,cmakeCommandRepeat,cmakeCommandDeprecated,cmakeCommandManuallyAdded,cmakeArguments,cmakeTodo,@Spell syn case match diff --git a/Auxiliary/vim/extract-upper-case.pl b/Auxiliary/vim/extract-upper-case.pl index 1179199..7f40b74 100755 --- a/Auxiliary/vim/extract-upper-case.pl +++ b/Auxiliary/vim/extract-upper-case.pl @@ -16,10 +16,10 @@ my @modules; my %keywords; # command => keyword-list # find cmake/Modules/ | sed -rn 's/.*CMakeDetermine(.+)Compiler.cmake/\1/p' | sort -my @languages = qw(ASM ASM_MASM ASM_NASM C CSharp CUDA CXX Fortran Java RC Swift); +my @languages = qw(ASM ASM_MASM ASM_NASM C CSharp CUDA CXX Fortran Java RC Swift HIP); # unwanted upper-cases -my %unwanted = map { $_ => 1 } qw(VS CXX IDE NOTFOUND NO_ DFOO DBAR NEW); +my %unwanted = map { $_ => 1 } qw(VS CXX IDE NOTFOUND NO_ DFOO DBAR NEW GNU); # cannot remove ALL - exists for add_custom_command # control-statements @@ -30,7 +30,7 @@ my %loop = map { $_ => 1 } qw(foreach while endforeach endwhile); my %deprecated = map { $_ => 1 } qw(build_name exec_program export_library_dependencies install_files install_programs install_targets link_libraries make_directory output_required_files remove subdir_depends subdirs use_mangled_mesa utility_source variable_requires write_file); # add some (popular) modules -push @modules, "ExternalProject"; +push @modules, "ExternalProject", "FetchContent"; # variables open(CMAKE, "$cmake --help-variable-list|") or die "could not run cmake"; diff --git a/Auxiliary/vim/syntax/cmake.vim b/Auxiliary/vim/syntax/cmake.vim index 83f13d8..82dc563 100644 --- a/Auxiliary/vim/syntax/cmake.vim +++ b/Auxiliary/vim/syntax/cmake.vim @@ -1,13 +1,13 @@ " Vim syntax file " Program: CMake - Cross-Platform Makefile Generator -" Version: cmake version 3.19.20201028-gdab947f +" Version: cmake version 3.27.20230713-gdc88dd5 " Language: CMake " Author: Andy Cedilnik <andy.cedilnik@kitware.com>, " Nicholas Hutchinson <nshutchinson@gmail.com>, " Patrick Boettcher <patrick.boettcher@posteo.de> " Maintainer: Dimitri Merejkowsky <d.merej@gmail.com> " Former Maintainer: Karthik Krishnan <karthik.krishnan@kitware.com> -" Last Change: 2020 oct. 28 +" Last Change: 2023 Jul 13 " " License: The CMake license applies to this file. See " https://cmake.org/licensing @@ -22,20 +22,20 @@ set cpo&vim syn region cmakeBracketArgument start="\[\z(=\?\|=[0-9]*\)\[" end="\]\z1\]" contains=cmakeTodo,@Spell syn region cmakeComment start="#" end="$" contains=cmakeTodo,@Spell -syn region cmakeBracketComment start="#\[\z(=\?\|=[0-9]*\)\[" end="\]\z1\]" contains=cmakeTodo,@Spell +syn region cmakeBracketComment start="\[\z(=*\)\[" end="\]\z1\]" contains=cmakeTodo,@Spell syn match cmakeEscaped /\(\\\\\|\\"\|\\n\|\\t\)/ contained syn region cmakeRegistry start="\[" end="]" contained oneline contains=cmakeTodo,cmakeEscaped syn region cmakeGeneratorExpression start="$<" end=">" contained oneline contains=cmakeVariableValue,cmakeProperty,cmakeGeneratorExpressions,cmakeTodo -syn region cmakeString start='"' end='"' contained contains=cmakeTodo,cmakeVariableValue,cmakeEscaped +syn region cmakeString start='"' end='"' contained contains=cmakeTodo,cmakeVariableValue,cmakeEscaped,@Spell syn region cmakeVariableValue start="${" end="}" contained oneline contains=cmakeVariable,cmakeTodo,cmakeVariableValue syn region cmakeEnvironment start="$ENV{" end="}" contained oneline contains=cmakeTodo -syn region cmakeArguments start="(" end=")" contains=ALLBUT,cmakeGeneratorExpressions,cmakeCommand,cmakeCommandConditional,cmakeCommandRepeat,cmakeCommandDeprecated,cmakeCommandManuallyAdded,cmakeArguments,cmakeTodo +syn region cmakeArguments start="(" end=")" contains=ALLBUT,cmakeGeneratorExpressions,cmakeCommand,cmakeCommandConditional,cmakeCommandRepeat,cmakeCommandDeprecated,cmakeCommandManuallyAdded,cmakeArguments,cmakeTodo,@Spell syn case match @@ -76,6 +76,7 @@ syn keyword cmakeProperty contained \ AUTOGEN_USE_SYSTEM_INCLUDE \ AUTOGEN_TARGETS_FOLDER \ AUTOGEN_TARGET_DEPENDS + \ AUTOGEN_USE_SYSTEM_INCLUDE \ AUTOMOC \ AUTOMOC_COMPILER_PREDEFINES \ AUTOMOC_DEPEND_FILTERS @@ -120,6 +121,7 @@ syn keyword cmakeProperty contained \ COMPILE_OPTIONS \ COMPILE_PDB_NAME \ COMPILE_PDB_OUTPUT_DIRECTORY + \ COMPILE_WARNING_AS_ERROR \ COST \ CPACK_DESKTOP_SHORTCUTS \ CPACK_NEVER_OVERWRITE @@ -140,6 +142,10 @@ syn keyword cmakeProperty contained \ CUDA_STANDARD \ CUDA_STANDARD_REQUIRED \ CXX_EXTENSIONS + \ CXX_MODULE_DIRS + \ CXX_MODULE_SET + \ CXX_MODULE_SETS + \ CXX_SCAN_FOR_MODULES \ CXX_STANDARD \ CXX_STANDARD_REQUIRED \ C_EXTENSIONS @@ -156,6 +162,7 @@ syn keyword cmakeProperty contained \ DISABLED \ DISABLED_FEATURES \ DISABLE_PRECOMPILE_HEADERS + \ DLL_NAME_WITH_SOVERSION \ DOTNET_SDK \ DOTNET_TARGET_FRAMEWORK \ DOTNET_TARGET_FRAMEWORK_VERSION @@ -168,7 +175,9 @@ syn keyword cmakeProperty contained \ ENVIRONMENT_MODIFICATION \ EXCLUDE_FROM_ALL \ EXCLUDE_FROM_DEFAULT_BUILD + \ EXPORT_COMPILE_COMMANDS \ EXPORT_NAME + \ EXPORT_NO_SYSTEM \ EXPORT_PROPERTIES \ EXTERNAL_OBJECT \ EchoString @@ -183,6 +192,7 @@ syn keyword cmakeProperty contained \ FOLDER \ FRAMEWORK \ FRAMEWORK_VERSION + \ Fortran_BUILDING_INSTRINSIC_MODULES \ Fortran_FORMAT \ Fortran_MODULE_DIRECTORY \ Fortran_PREPROCESS @@ -195,7 +205,10 @@ syn keyword cmakeProperty contained \ GLOBAL_DEPENDS_NO_CYCLES \ GNUtoMS \ HAS_CXX + \ HEADER_DIRS \ HEADER_FILE_ONLY + \ HEADER_SET + \ HEADER_SETS \ HELPSTRING \ HIP_ARCHITECTURES \ HIP_EXTENSIONS @@ -214,8 +227,10 @@ syn keyword cmakeProperty contained \ IMPORTED_LINK_INTERFACE_MULTIPLICITY \ IMPORTED_LOCATION \ IMPORTED_NO_SONAME + \ IMPORTED_NO_SYSTEM \ IMPORTED_OBJECTS \ IMPORTED_SONAME + \ IMPORTED_TARGETS \ IMPORT_PREFIX \ IMPORT_SUFFIX \ INCLUDE_DIRECTORIES @@ -224,15 +239,21 @@ syn keyword cmakeProperty contained \ INSTALL_REMOVE_ENVIRONMENT_RPATH \ INSTALL_RPATH \ INSTALL_RPATH_USE_LINK_PATH + \ INTERFACE_AUTOMOC_MACRO_NAMES \ INTERFACE_AUTOUIC_OPTIONS \ INTERFACE_AUTOMOC_MACRO_NAMES \ INTERFACE_COMPILE_DEFINITIONS \ INTERFACE_COMPILE_FEATURES \ INTERFACE_COMPILE_OPTIONS + \ INTERFACE_CXX_MODULE_SETS + \ INTERFACE_HEADER_SETS + \ INTERFACE_HEADER_SETS_TO_VERIFY \ INTERFACE_INCLUDE_DIRECTORIES \ INTERFACE_LINK_DEPENDS \ INTERFACE_LINK_DIRECTORIES \ INTERFACE_LINK_LIBRARIES + \ INTERFACE_LINK_LIBRARIES_DIRECT + \ INTERFACE_LINK_LIBRARIES_DIRECT_EXCLUDE \ INTERFACE_LINK_OPTIONS \ INTERFACE_POSITION_INDEPENDENT_CODE \ INTERFACE_PRECOMPILE_HEADERS @@ -242,6 +263,7 @@ syn keyword cmakeProperty contained \ IN_TRY_COMPILE \ IOS_INSTALL_COMBINED \ ISPC_HEADER_DIRECTORY + \ ISPC_HEADER_SUFFIX \ ISPC_INSTRUCTION_SETS \ JOB_POOLS \ JOB_POOL_COMPILE @@ -260,6 +282,8 @@ syn keyword cmakeProperty contained \ LINK_INTERFACE_LIBRARIES \ LINK_INTERFACE_MULTIPLICITY \ LINK_LIBRARIES + \ LINK_LIBRARIES_ONLY_TARGETS + \ LINK_LIBRARY_OVERRIDE \ LINK_OPTIONS \ LINK_SEARCH_END_STATIC \ LINK_SEARCH_START_STATIC @@ -277,6 +301,7 @@ syn keyword cmakeProperty contained \ MANUALLY_ADDED_DEPENDENCIES \ MEASUREMENT \ MODIFIED + \ MSVC_DEBUG_INFORMATION_FORMAT \ MSVC_RUNTIME_LIBRARY \ NAME \ NO_SONAME @@ -343,6 +368,7 @@ syn keyword cmakeProperty contained \ SUBDIRECTORIES \ SUFFIX \ SYMBOLIC + \ SYSTEM \ Swift_DEPENDENCIES_FILE \ Swift_DIAGNOSTICS_FILE \ Swift_LANGUAGE_VERSION @@ -356,16 +382,20 @@ syn keyword cmakeProperty contained \ TEST_INCLUDE_FILES \ TIMEOUT \ TIMEOUT_AFTER_MATCH + \ TIMEOUT_SIGNAL_GRACE_PERIOD + \ TIMEOUT_SIGNAL_NAME \ TYPE \ UNITY_BUILD \ UNITY_BUILD_BATCH_SIZE \ UNITY_BUILD_CODE_AFTER_INCLUDE \ UNITY_BUILD_CODE_BEFORE_INCLUDE \ UNITY_BUILD_MODE + \ UNITY_BUILD_UNIQUE_ID \ UNITY_GROUP \ USE_FOLDERS \ VALUE \ VARIABLES + \ VERIFY_INTERFACE_HEADER_SETS \ VERSION \ VISIBILITY_INLINES_HIDDEN \ VS_CONFIGURATION_TYPE @@ -422,11 +452,14 @@ syn keyword cmakeProperty contained \ VS_WINRT_EXTENSIONS \ VS_WINRT_REFERENCES \ VS_XAML_TYPE + \ WATCOM_RUNTIME_LIBRARY \ WILL_FAIL \ WIN32_EXECUTABLE \ WINDOWS_EXPORT_ALL_SYMBOLS \ WORKING_DIRECTORY \ WRAP_EXCLUDE + \ XCODE_EMBED_FRAMEWORKS_CODE_SIGN_ON_COPY + \ XCODE_EMBED_FRAMEWORKS_REMOVE_HEADERS_ON_COPY \ XCODE_EMIT_EFFECTIVE_PLATFORM_NAME \ XCODE_EXPLICIT_FILE_TYPE \ XCODE_FILE_ATTRIBUTES @@ -443,9 +476,13 @@ syn keyword cmakeProperty contained \ XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER \ XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS \ XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE + \ XCODE_SCHEME_ENABLE_GPU_API_VALIDATION + \ XCODE_SCHEME_ENABLE_GPU_FRAME_CAPTURE_MODE + \ XCODE_SCHEME_ENABLE_GPU_SHADER_VALIDATION \ XCODE_SCHEME_ENVIRONMENT \ XCODE_SCHEME_EXECUTABLE \ XCODE_SCHEME_GUARD_MALLOC + \ XCODE_SCHEME_LAUNCH_CONFIGURATION \ XCODE_SCHEME_LAUNCH_MODE \ XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP \ XCODE_SCHEME_MALLOC_GUARD_EDGES @@ -460,16 +497,19 @@ syn keyword cmakeProperty contained \ XCODE_SCHEME_LAUNCH_CONFIGURATION \ XCODE_SCHEME_WORKING_DIRECTORY \ XCODE_SCHEME_ZOMBIE_OBJECTS + \ XCODE_XCCONFIG \ XCTEST syn keyword cmakeVariable contained \ ANDROID \ APPLE \ BORLAND + \ BSD \ BUILD_SHARED_LIBS \ CACHE \ CMAKE_ABSOLUTE_DESTINATION_FILES \ CMAKE_ADD_CUSTOM_COMMAND_DEPENDS_EXPLICIT_ONLY + \ CMAKE_ADSP_ROOT \ CMAKE_AIX_EXPORT_ALL_SYMBOLS \ CMAKE_ANDROID_ANT_ADDITIONAL_OPTIONS \ CMAKE_ANDROID_API @@ -479,6 +519,7 @@ syn keyword cmakeVariable contained \ CMAKE_ANDROID_ARM_MODE \ CMAKE_ANDROID_ARM_NEON \ CMAKE_ANDROID_ASSETS_DIRECTORIES + \ CMAKE_ANDROID_EXCEPTIONS \ CMAKE_ANDROID_GUI \ CMAKE_ANDROID_JAR_DEPENDENCIES \ CMAKE_ANDROID_JAR_DIRECTORIES @@ -489,14 +530,17 @@ syn keyword cmakeVariable contained \ CMAKE_ANDROID_NDK_DEPRECATED_HEADERS \ CMAKE_ANDROID_NDK_TOOLCHAIN_HOST_TAG \ CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION + \ CMAKE_ANDROID_NDK_VERSION \ CMAKE_ANDROID_PROCESS_MAX \ CMAKE_ANDROID_PROGUARD \ CMAKE_ANDROID_PROGUARD_CONFIG_PATH + \ CMAKE_ANDROID_RTTI \ CMAKE_ANDROID_SECURE_PROPS_PATH \ CMAKE_ANDROID_SKIP_ANT_STEP \ CMAKE_ANDROID_STANDALONE_TOOLCHAIN \ CMAKE_ANDROID_STL_TYPE \ CMAKE_APPBUNDLE_PATH + \ CMAKE_APPLE_SILICON_PROCESSOR \ CMAKE_AR \ CMAKE_ARCHIVE_OUTPUT_DIRECTORY \ CMAKE_ARGC @@ -508,12 +552,15 @@ syn keyword cmakeVariable contained \ CMAKE_ASM_ARCHIVE_APPEND \ CMAKE_ASM_ARCHIVE_CREATE \ CMAKE_ASM_ARCHIVE_FINISH + \ CMAKE_ASM_BYTE_ORDER \ CMAKE_ASM_CLANG_TIDY + \ CMAKE_ASM_CLANG_TIDY_EXPORT_FIXES_DIR \ CMAKE_ASM_COMPILER \ CMAKE_ASM_COMPILER_ABI \ CMAKE_ASM_COMPILER_AR \ CMAKE_ASM_COMPILER_ARCHITECTURE_ID \ CMAKE_ASM_COMPILER_EXTERNAL_TOOLCHAIN + \ CMAKE_ASM_COMPILER_FRONTEND_VARIANT \ CMAKE_ASM_COMPILER_ID \ CMAKE_ASM_COMPILER_LAUNCHER \ CMAKE_ASM_COMPILER_LOADED @@ -528,6 +575,8 @@ syn keyword cmakeVariable contained \ CMAKE_ASM_CREATE_SHARED_LIBRARY \ CMAKE_ASM_CREATE_SHARED_MODULE \ CMAKE_ASM_CREATE_STATIC_LIBRARY + \ CMAKE_ASM_EXTENSIONS + \ CMAKE_ASM_EXTENSIONS_DEFAULT \ CMAKE_ASM_FLAGS \ CMAKE_ASM_FLAGS_DEBUG \ CMAKE_ASM_FLAGS_DEBUG_INIT @@ -546,6 +595,7 @@ syn keyword cmakeVariable contained \ CMAKE_ASM_INCLUDE_WHAT_YOU_USE \ CMAKE_ASM_INIT \ CMAKE_ASM_LIBRARY_ARCHITECTURE + \ CMAKE_ASM_LINKER_LAUNCHER \ CMAKE_ASM_LINKER_PREFERENCE \ CMAKE_ASM_LINKER_PREFERENCE_PROPAGATES \ CMAKE_ASM_LINKER_WRAPPER_FLAG @@ -554,6 +604,7 @@ syn keyword cmakeVariable contained \ CMAKE_ASM_LINK_LIBRARY_FILE_FLAG \ CMAKE_ASM_LINK_LIBRARY_FLAG \ CMAKE_ASM_LINK_LIBRARY_SUFFIX + \ CMAKE_ASM_LINK_WHAT_YOU_USE_FLAG \ CMAKE_ASM_MASM \ CMAKE_ASM_MASM_ANDROID_TOOLCHAIN_MACHINE \ CMAKE_ASM_MASM_ANDROID_TOOLCHAIN_PREFIX @@ -561,12 +612,15 @@ syn keyword cmakeVariable contained \ CMAKE_ASM_MASM_ARCHIVE_APPEND \ CMAKE_ASM_MASM_ARCHIVE_CREATE \ CMAKE_ASM_MASM_ARCHIVE_FINISH + \ CMAKE_ASM_MASM_BYTE_ORDER \ CMAKE_ASM_MASM_CLANG_TIDY + \ CMAKE_ASM_MASM_CLANG_TIDY_EXPORT_FIXES_DIR \ CMAKE_ASM_MASM_COMPILER \ CMAKE_ASM_MASM_COMPILER_ABI \ CMAKE_ASM_MASM_COMPILER_AR \ CMAKE_ASM_MASM_COMPILER_ARCHITECTURE_ID \ CMAKE_ASM_MASM_COMPILER_EXTERNAL_TOOLCHAIN + \ CMAKE_ASM_MASM_COMPILER_FRONTEND_VARIANT \ CMAKE_ASM_MASM_COMPILER_ID \ CMAKE_ASM_MASM_COMPILER_LAUNCHER \ CMAKE_ASM_MASM_COMPILER_LOADED @@ -581,6 +635,8 @@ syn keyword cmakeVariable contained \ CMAKE_ASM_MASM_CREATE_SHARED_LIBRARY \ CMAKE_ASM_MASM_CREATE_SHARED_MODULE \ CMAKE_ASM_MASM_CREATE_STATIC_LIBRARY + \ CMAKE_ASM_MASM_EXTENSIONS + \ CMAKE_ASM_MASM_EXTENSIONS_DEFAULT \ CMAKE_ASM_MASM_FLAGS \ CMAKE_ASM_MASM_FLAGS_DEBUG \ CMAKE_ASM_MASM_FLAGS_DEBUG_INIT @@ -599,6 +655,7 @@ syn keyword cmakeVariable contained \ CMAKE_ASM_MASM_INCLUDE_WHAT_YOU_USE \ CMAKE_ASM_MASM_INIT \ CMAKE_ASM_MASM_LIBRARY_ARCHITECTURE + \ CMAKE_ASM_MASM_LINKER_LAUNCHER \ CMAKE_ASM_MASM_LINKER_PREFERENCE \ CMAKE_ASM_MASM_LINKER_PREFERENCE_PROPAGATES \ CMAKE_ASM_MASM_LINKER_WRAPPER_FLAG @@ -607,14 +664,19 @@ syn keyword cmakeVariable contained \ CMAKE_ASM_MASM_LINK_LIBRARY_FILE_FLAG \ CMAKE_ASM_MASM_LINK_LIBRARY_FLAG \ CMAKE_ASM_MASM_LINK_LIBRARY_SUFFIX + \ CMAKE_ASM_MASM_LINK_WHAT_YOU_USE_FLAG \ CMAKE_ASM_MASM_OUTPUT_EXTENSION \ CMAKE_ASM_MASM_PLATFORM_ID \ CMAKE_ASM_MASM_SIMULATE_ID \ CMAKE_ASM_MASM_SIMULATE_VERSION \ CMAKE_ASM_MASM_SIZEOF_DATA_PTR \ CMAKE_ASM_MASM_SOURCE_FILE_EXTENSIONS + \ CMAKE_ASM_MASM_STANDARD + \ CMAKE_ASM_MASM_STANDARD_DEFAULT \ CMAKE_ASM_MASM_STANDARD_INCLUDE_DIRECTORIES \ CMAKE_ASM_MASM_STANDARD_LIBRARIES + \ CMAKE_ASM_MASM_STANDARD_REQUIRED + \ CMAKE_ASM_MASM_SUPPORTED \ CMAKE_ASM_MASM_VISIBILITY_PRESET \ CMAKE_ASM_NASM \ CMAKE_ASM_NASM_ANDROID_TOOLCHAIN_MACHINE @@ -623,12 +685,15 @@ syn keyword cmakeVariable contained \ CMAKE_ASM_NASM_ARCHIVE_APPEND \ CMAKE_ASM_NASM_ARCHIVE_CREATE \ CMAKE_ASM_NASM_ARCHIVE_FINISH + \ CMAKE_ASM_NASM_BYTE_ORDER \ CMAKE_ASM_NASM_CLANG_TIDY + \ CMAKE_ASM_NASM_CLANG_TIDY_EXPORT_FIXES_DIR \ CMAKE_ASM_NASM_COMPILER \ CMAKE_ASM_NASM_COMPILER_ABI \ CMAKE_ASM_NASM_COMPILER_AR \ CMAKE_ASM_NASM_COMPILER_ARCHITECTURE_ID \ CMAKE_ASM_NASM_COMPILER_EXTERNAL_TOOLCHAIN + \ CMAKE_ASM_NASM_COMPILER_FRONTEND_VARIANT \ CMAKE_ASM_NASM_COMPILER_ID \ CMAKE_ASM_NASM_COMPILER_LAUNCHER \ CMAKE_ASM_NASM_COMPILER_LOADED @@ -643,6 +708,8 @@ syn keyword cmakeVariable contained \ CMAKE_ASM_NASM_CREATE_SHARED_LIBRARY \ CMAKE_ASM_NASM_CREATE_SHARED_MODULE \ CMAKE_ASM_NASM_CREATE_STATIC_LIBRARY + \ CMAKE_ASM_NASM_EXTENSIONS + \ CMAKE_ASM_NASM_EXTENSIONS_DEFAULT \ CMAKE_ASM_NASM_FLAGS \ CMAKE_ASM_NASM_FLAGS_DEBUG \ CMAKE_ASM_NASM_FLAGS_DEBUG_INIT @@ -661,6 +728,7 @@ syn keyword cmakeVariable contained \ CMAKE_ASM_NASM_INCLUDE_WHAT_YOU_USE \ CMAKE_ASM_NASM_INIT \ CMAKE_ASM_NASM_LIBRARY_ARCHITECTURE + \ CMAKE_ASM_NASM_LINKER_LAUNCHER \ CMAKE_ASM_NASM_LINKER_PREFERENCE \ CMAKE_ASM_NASM_LINKER_PREFERENCE_PROPAGATES \ CMAKE_ASM_NASM_LINKER_WRAPPER_FLAG @@ -669,14 +737,19 @@ syn keyword cmakeVariable contained \ CMAKE_ASM_NASM_LINK_LIBRARY_FILE_FLAG \ CMAKE_ASM_NASM_LINK_LIBRARY_FLAG \ CMAKE_ASM_NASM_LINK_LIBRARY_SUFFIX + \ CMAKE_ASM_NASM_LINK_WHAT_YOU_USE_FLAG \ CMAKE_ASM_NASM_OUTPUT_EXTENSION \ CMAKE_ASM_NASM_PLATFORM_ID \ CMAKE_ASM_NASM_SIMULATE_ID \ CMAKE_ASM_NASM_SIMULATE_VERSION \ CMAKE_ASM_NASM_SIZEOF_DATA_PTR \ CMAKE_ASM_NASM_SOURCE_FILE_EXTENSIONS + \ CMAKE_ASM_NASM_STANDARD + \ CMAKE_ASM_NASM_STANDARD_DEFAULT \ CMAKE_ASM_NASM_STANDARD_INCLUDE_DIRECTORIES \ CMAKE_ASM_NASM_STANDARD_LIBRARIES + \ CMAKE_ASM_NASM_STANDARD_REQUIRED + \ CMAKE_ASM_NASM_SUPPORTED \ CMAKE_ASM_NASM_VISIBILITY_PRESET \ CMAKE_ASM_OUTPUT_EXTENSION \ CMAKE_ASM_PLATFORM_ID @@ -684,8 +757,12 @@ syn keyword cmakeVariable contained \ CMAKE_ASM_SIMULATE_VERSION \ CMAKE_ASM_SIZEOF_DATA_PTR \ CMAKE_ASM_SOURCE_FILE_EXTENSIONS + \ CMAKE_ASM_STANDARD + \ CMAKE_ASM_STANDARD_DEFAULT \ CMAKE_ASM_STANDARD_INCLUDE_DIRECTORIES \ CMAKE_ASM_STANDARD_LIBRARIES + \ CMAKE_ASM_STANDARD_REQUIRED + \ CMAKE_ASM_SUPPORTED \ CMAKE_ASM_VISIBILITY_PRESET \ CMAKE_AUTOGEN_ORIGIN_DEPENDS \ CMAKE_AUTOGEN_PARALLEL @@ -694,15 +771,18 @@ syn keyword cmakeVariable contained \ CMAKE_AUTOMOC \ CMAKE_AUTOMOC_COMPILER_PREDEFINES \ CMAKE_AUTOMOC_DEPEND_FILTERS + \ CMAKE_AUTOMOC_EXECUTABLE \ CMAKE_AUTOMOC_MACRO_NAMES \ CMAKE_AUTOMOC_MOC_OPTIONS \ CMAKE_AUTOMOC_PATH_PREFIX \ CMAKE_AUTOMOC_RELAXED_MODE \ CMAKE_AUTOMOC_EXECUTABLE \ CMAKE_AUTORCC + \ CMAKE_AUTORCC_EXECUTABLE \ CMAKE_AUTORCC_OPTIONS \ CMAKE_AUTORCC_EXECUTABLE \ CMAKE_AUTOUIC + \ CMAKE_AUTOUIC_EXECUTABLE \ CMAKE_AUTOUIC_OPTIONS \ CMAKE_AUTOUIC_SEARCH_PATHS \ CMAKE_AUTOUIC_EXECUTABLE @@ -733,6 +813,7 @@ syn keyword cmakeVariable contained \ CMAKE_COMPILER_IS_GNUCXX \ CMAKE_COMPILER_IS_GNUG77 \ CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY + \ CMAKE_COMPILE_WARNING_AS_ERROR \ CMAKE_CONFIGURATION_TYPES \ CMAKE_CPACK_COMMAND \ CMAKE_CROSSCOMPILING @@ -745,12 +826,15 @@ syn keyword cmakeVariable contained \ CMAKE_CSharp_ARCHIVE_APPEND \ CMAKE_CSharp_ARCHIVE_CREATE \ CMAKE_CSharp_ARCHIVE_FINISH + \ CMAKE_CSharp_BYTE_ORDER \ CMAKE_CSharp_CLANG_TIDY + \ CMAKE_CSharp_CLANG_TIDY_EXPORT_FIXES_DIR \ CMAKE_CSharp_COMPILER \ CMAKE_CSharp_COMPILER_ABI \ CMAKE_CSharp_COMPILER_AR \ CMAKE_CSharp_COMPILER_ARCHITECTURE_ID \ CMAKE_CSharp_COMPILER_EXTERNAL_TOOLCHAIN + \ CMAKE_CSharp_COMPILER_FRONTEND_VARIANT \ CMAKE_CSharp_COMPILER_ID \ CMAKE_CSharp_COMPILER_LAUNCHER \ CMAKE_CSharp_COMPILER_LOADED @@ -765,6 +849,8 @@ syn keyword cmakeVariable contained \ CMAKE_CSharp_CREATE_SHARED_LIBRARY \ CMAKE_CSharp_CREATE_SHARED_MODULE \ CMAKE_CSharp_CREATE_STATIC_LIBRARY + \ CMAKE_CSharp_EXTENSIONS + \ CMAKE_CSharp_EXTENSIONS_DEFAULT \ CMAKE_CSharp_FLAGS \ CMAKE_CSharp_FLAGS_DEBUG \ CMAKE_CSharp_FLAGS_DEBUG_INIT @@ -783,6 +869,7 @@ syn keyword cmakeVariable contained \ CMAKE_CSharp_INCLUDE_WHAT_YOU_USE \ CMAKE_CSharp_INIT \ CMAKE_CSharp_LIBRARY_ARCHITECTURE + \ CMAKE_CSharp_LINKER_LAUNCHER \ CMAKE_CSharp_LINKER_PREFERENCE \ CMAKE_CSharp_LINKER_PREFERENCE_PROPAGATES \ CMAKE_CSharp_LINKER_WRAPPER_FLAG @@ -791,14 +878,19 @@ syn keyword cmakeVariable contained \ CMAKE_CSharp_LINK_LIBRARY_FILE_FLAG \ CMAKE_CSharp_LINK_LIBRARY_FLAG \ CMAKE_CSharp_LINK_LIBRARY_SUFFIX + \ CMAKE_CSharp_LINK_WHAT_YOU_USE_FLAG \ CMAKE_CSharp_OUTPUT_EXTENSION \ CMAKE_CSharp_PLATFORM_ID \ CMAKE_CSharp_SIMULATE_ID \ CMAKE_CSharp_SIMULATE_VERSION \ CMAKE_CSharp_SIZEOF_DATA_PTR \ CMAKE_CSharp_SOURCE_FILE_EXTENSIONS + \ CMAKE_CSharp_STANDARD + \ CMAKE_CSharp_STANDARD_DEFAULT \ CMAKE_CSharp_STANDARD_INCLUDE_DIRECTORIES \ CMAKE_CSharp_STANDARD_LIBRARIES + \ CMAKE_CSharp_STANDARD_REQUIRED + \ CMAKE_CSharp_SUPPORTED \ CMAKE_CSharp_VISIBILITY_PRESET \ CMAKE_CTEST_ARGUMENTS \ CMAKE_CTEST_COMMAND @@ -810,12 +902,15 @@ syn keyword cmakeVariable contained \ CMAKE_CUDA_ARCHIVE_APPEND \ CMAKE_CUDA_ARCHIVE_CREATE \ CMAKE_CUDA_ARCHIVE_FINISH + \ CMAKE_CUDA_BYTE_ORDER \ CMAKE_CUDA_CLANG_TIDY + \ CMAKE_CUDA_CLANG_TIDY_EXPORT_FIXES_DIR \ CMAKE_CUDA_COMPILER \ CMAKE_CUDA_COMPILER_ABI \ CMAKE_CUDA_COMPILER_AR \ CMAKE_CUDA_COMPILER_ARCHITECTURE_ID \ CMAKE_CUDA_COMPILER_EXTERNAL_TOOLCHAIN + \ CMAKE_CUDA_COMPILER_FRONTEND_VARIANT \ CMAKE_CUDA_COMPILER_ID \ CMAKE_CUDA_COMPILER_LAUNCHER \ CMAKE_CUDA_COMPILER_LOADED @@ -832,6 +927,7 @@ syn keyword cmakeVariable contained \ CMAKE_CUDA_CREATE_SHARED_MODULE \ CMAKE_CUDA_CREATE_STATIC_LIBRARY \ CMAKE_CUDA_EXTENSIONS + \ CMAKE_CUDA_EXTENSIONS_DEFAULT \ CMAKE_CUDA_FLAGS \ CMAKE_CUDA_FLAGS_DEBUG \ CMAKE_CUDA_FLAGS_DEBUG_INIT @@ -851,6 +947,7 @@ syn keyword cmakeVariable contained \ CMAKE_CUDA_INCLUDE_WHAT_YOU_USE \ CMAKE_CUDA_INIT \ CMAKE_CUDA_LIBRARY_ARCHITECTURE + \ CMAKE_CUDA_LINKER_LAUNCHER \ CMAKE_CUDA_LINKER_PREFERENCE \ CMAKE_CUDA_LINKER_PREFERENCE_PROPAGATES \ CMAKE_CUDA_LINKER_WRAPPER_FLAG @@ -859,6 +956,7 @@ syn keyword cmakeVariable contained \ CMAKE_CUDA_LINK_LIBRARY_FILE_FLAG \ CMAKE_CUDA_LINK_LIBRARY_FLAG \ CMAKE_CUDA_LINK_LIBRARY_SUFFIX + \ CMAKE_CUDA_LINK_WHAT_YOU_USE_FLAG \ CMAKE_CUDA_OUTPUT_EXTENSION \ CMAKE_CUDA_PLATFORM_ID \ CMAKE_CUDA_RESOLVE_DEVICE_SYMBOLS @@ -869,9 +967,11 @@ syn keyword cmakeVariable contained \ CMAKE_CUDA_SIZEOF_DATA_PTR \ CMAKE_CUDA_SOURCE_FILE_EXTENSIONS \ CMAKE_CUDA_STANDARD + \ CMAKE_CUDA_STANDARD_DEFAULT \ CMAKE_CUDA_STANDARD_INCLUDE_DIRECTORIES \ CMAKE_CUDA_STANDARD_LIBRARIES \ CMAKE_CUDA_STANDARD_REQUIRED + \ CMAKE_CUDA_SUPPORTED \ CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES \ CMAKE_CUDA_VISIBILITY_PRESET \ CMAKE_CURRENT_BINARY_DIR @@ -890,12 +990,15 @@ syn keyword cmakeVariable contained \ CMAKE_CXX_ARCHIVE_APPEND \ CMAKE_CXX_ARCHIVE_CREATE \ CMAKE_CXX_ARCHIVE_FINISH + \ CMAKE_CXX_BYTE_ORDER \ CMAKE_CXX_CLANG_TIDY + \ CMAKE_CXX_CLANG_TIDY_EXPORT_FIXES_DIR \ CMAKE_CXX_COMPILER \ CMAKE_CXX_COMPILER_ABI \ CMAKE_CXX_COMPILER_AR \ CMAKE_CXX_COMPILER_ARCHITECTURE_ID \ CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN + \ CMAKE_CXX_COMPILER_FRONTEND_VARIANT \ CMAKE_CXX_COMPILER_ID \ CMAKE_CXX_COMPILER_LAUNCHER \ CMAKE_CXX_COMPILER_LOADED @@ -912,6 +1015,7 @@ syn keyword cmakeVariable contained \ CMAKE_CXX_CREATE_SHARED_MODULE \ CMAKE_CXX_CREATE_STATIC_LIBRARY \ CMAKE_CXX_EXTENSIONS + \ CMAKE_CXX_EXTENSIONS_DEFAULT \ CMAKE_CXX_FLAGS \ CMAKE_CXX_FLAGS_DEBUG \ CMAKE_CXX_FLAGS_DEBUG_INIT @@ -939,16 +1043,20 @@ syn keyword cmakeVariable contained \ CMAKE_CXX_LINK_LIBRARY_FILE_FLAG \ CMAKE_CXX_LINK_LIBRARY_FLAG \ CMAKE_CXX_LINK_LIBRARY_SUFFIX + \ CMAKE_CXX_LINK_WHAT_YOU_USE_FLAG \ CMAKE_CXX_OUTPUT_EXTENSION \ CMAKE_CXX_PLATFORM_ID + \ CMAKE_CXX_SCAN_FOR_MODULES \ CMAKE_CXX_SIMULATE_ID \ CMAKE_CXX_SIMULATE_VERSION \ CMAKE_CXX_SIZEOF_DATA_PTR \ CMAKE_CXX_SOURCE_FILE_EXTENSIONS \ CMAKE_CXX_STANDARD + \ CMAKE_CXX_STANDARD_DEFAULT \ CMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES \ CMAKE_CXX_STANDARD_LIBRARIES \ CMAKE_CXX_STANDARD_REQUIRED + \ CMAKE_CXX_SUPPORTED \ CMAKE_CXX_VISIBILITY_PRESET \ CMAKE_C_ANDROID_TOOLCHAIN_MACHINE \ CMAKE_C_ANDROID_TOOLCHAIN_PREFIX @@ -956,12 +1064,15 @@ syn keyword cmakeVariable contained \ CMAKE_C_ARCHIVE_APPEND \ CMAKE_C_ARCHIVE_CREATE \ CMAKE_C_ARCHIVE_FINISH + \ CMAKE_C_BYTE_ORDER \ CMAKE_C_CLANG_TIDY + \ CMAKE_C_CLANG_TIDY_EXPORT_FIXES_DIR \ CMAKE_C_COMPILER \ CMAKE_C_COMPILER_ABI \ CMAKE_C_COMPILER_AR \ CMAKE_C_COMPILER_ARCHITECTURE_ID \ CMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN + \ CMAKE_C_COMPILER_FRONTEND_VARIANT \ CMAKE_C_COMPILER_ID \ CMAKE_C_COMPILER_LAUNCHER \ CMAKE_C_COMPILER_LOADED @@ -978,6 +1089,7 @@ syn keyword cmakeVariable contained \ CMAKE_C_CREATE_SHARED_MODULE \ CMAKE_C_CREATE_STATIC_LIBRARY \ CMAKE_C_EXTENSIONS + \ CMAKE_C_EXTENSIONS_DEFAULT \ CMAKE_C_FLAGS \ CMAKE_C_FLAGS_DEBUG \ CMAKE_C_FLAGS_DEBUG_INIT @@ -1005,6 +1117,7 @@ syn keyword cmakeVariable contained \ CMAKE_C_LINK_LIBRARY_FILE_FLAG \ CMAKE_C_LINK_LIBRARY_FLAG \ CMAKE_C_LINK_LIBRARY_SUFFIX + \ CMAKE_C_LINK_WHAT_YOU_USE_FLAG \ CMAKE_C_OUTPUT_EXTENSION \ CMAKE_C_PLATFORM_ID \ CMAKE_C_SIMULATE_ID @@ -1012,17 +1125,21 @@ syn keyword cmakeVariable contained \ CMAKE_C_SIZEOF_DATA_PTR \ CMAKE_C_SOURCE_FILE_EXTENSIONS \ CMAKE_C_STANDARD + \ CMAKE_C_STANDARD_DEFAULT \ CMAKE_C_STANDARD_INCLUDE_DIRECTORIES \ CMAKE_C_STANDARD_LIBRARIES \ CMAKE_C_STANDARD_REQUIRED + \ CMAKE_C_SUPPORTED \ CMAKE_C_VISIBILITY_PRESET \ CMAKE_DEBUG_POSTFIX \ CMAKE_DEBUG_TARGET_PROPERTIES \ CMAKE_DEFAULT_BUILD_TYPE \ CMAKE_DEFAULT_CONFIGS \ CMAKE_DEPENDS_IN_PROJECT_ONLY + \ CMAKE_DEPENDS_USE_COMPILER \ CMAKE_DIRECTORY_LABELS \ CMAKE_DISABLE_PRECOMPILE_HEADERS + \ CMAKE_DLL_NAME_WITH_SOVERSION \ CMAKE_DL_LIBS \ CMAKE_DOTNET_SDK \ CMAKE_DOTNET_TARGET_FRAMEWORK @@ -1036,7 +1153,20 @@ syn keyword cmakeVariable contained \ CMAKE_ENABLE_EXPORTS \ CMAKE_ERROR_DEPRECATED \ CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION + \ CMAKE_EXECUTABLE_ENABLE_EXPORTS \ CMAKE_EXECUTABLE_SUFFIX + \ CMAKE_EXECUTABLE_SUFFIX_ASM + \ CMAKE_EXECUTABLE_SUFFIX_ASM_MASM + \ CMAKE_EXECUTABLE_SUFFIX_ASM_NASM + \ CMAKE_EXECUTABLE_SUFFIX_C + \ CMAKE_EXECUTABLE_SUFFIX_CSharp + \ CMAKE_EXECUTABLE_SUFFIX_CUDA + \ CMAKE_EXECUTABLE_SUFFIX_CXX + \ CMAKE_EXECUTABLE_SUFFIX_Fortran + \ CMAKE_EXECUTABLE_SUFFIX_HIP + \ CMAKE_EXECUTABLE_SUFFIX_Java + \ CMAKE_EXECUTABLE_SUFFIX_RC + \ CMAKE_EXECUTABLE_SUFFIX_Swift \ CMAKE_EXECUTE_PROCESS_COMMAND_ECHO \ CMAKE_EXE_LINKER_FLAGS \ CMAKE_EXE_LINKER_FLAGS_INIT @@ -1056,9 +1186,11 @@ syn keyword cmakeVariable contained \ CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY \ CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY \ CMAKE_FIND_PACKAGE_PREFER_CONFIG + \ CMAKE_FIND_PACKAGE_REDIRECTS_DIR \ CMAKE_FIND_PACKAGE_RESOLVE_SYMLINKS \ CMAKE_FIND_PACKAGE_SORT_DIRECTION \ CMAKE_FIND_PACKAGE_SORT_ORDER + \ CMAKE_FIND_PACKAGE_TARGETS_GLOBAL \ CMAKE_FIND_PACKAGE_WARN_NO_MODULE \ CMAKE_FIND_ROOT_PATH \ CMAKE_FIND_ROOT_PATH_MODE_INCLUDE @@ -1069,6 +1201,7 @@ syn keyword cmakeVariable contained \ CMAKE_FIND_USE_INSTALL_PREFIX \ CMAKE_FIND_USE_CMAKE_PATH \ CMAKE_FIND_USE_CMAKE_SYSTEM_PATH + \ CMAKE_FIND_USE_INSTALL_PREFIX \ CMAKE_FIND_USE_PACKAGE_REGISTRY \ CMAKE_FIND_USE_PACKAGE_ROOT_PATH \ CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH @@ -1083,12 +1216,15 @@ syn keyword cmakeVariable contained \ CMAKE_Fortran_ARCHIVE_APPEND \ CMAKE_Fortran_ARCHIVE_CREATE \ CMAKE_Fortran_ARCHIVE_FINISH + \ CMAKE_Fortran_BYTE_ORDER \ CMAKE_Fortran_CLANG_TIDY + \ CMAKE_Fortran_CLANG_TIDY_EXPORT_FIXES_DIR \ CMAKE_Fortran_COMPILER \ CMAKE_Fortran_COMPILER_ABI \ CMAKE_Fortran_COMPILER_AR \ CMAKE_Fortran_COMPILER_ARCHITECTURE_ID \ CMAKE_Fortran_COMPILER_EXTERNAL_TOOLCHAIN + \ CMAKE_Fortran_COMPILER_FRONTEND_VARIANT \ CMAKE_Fortran_COMPILER_ID \ CMAKE_Fortran_COMPILER_LAUNCHER \ CMAKE_Fortran_COMPILER_LOADED @@ -1103,6 +1239,8 @@ syn keyword cmakeVariable contained \ CMAKE_Fortran_CREATE_SHARED_LIBRARY \ CMAKE_Fortran_CREATE_SHARED_MODULE \ CMAKE_Fortran_CREATE_STATIC_LIBRARY + \ CMAKE_Fortran_EXTENSIONS + \ CMAKE_Fortran_EXTENSIONS_DEFAULT \ CMAKE_Fortran_FLAGS \ CMAKE_Fortran_FLAGS_DEBUG \ CMAKE_Fortran_FLAGS_DEBUG_INIT @@ -1122,6 +1260,7 @@ syn keyword cmakeVariable contained \ CMAKE_Fortran_INCLUDE_WHAT_YOU_USE \ CMAKE_Fortran_INIT \ CMAKE_Fortran_LIBRARY_ARCHITECTURE + \ CMAKE_Fortran_LINKER_LAUNCHER \ CMAKE_Fortran_LINKER_PREFERENCE \ CMAKE_Fortran_LINKER_PREFERENCE_PROPAGATES \ CMAKE_Fortran_LINKER_WRAPPER_FLAG @@ -1130,6 +1269,7 @@ syn keyword cmakeVariable contained \ CMAKE_Fortran_LINK_LIBRARY_FILE_FLAG \ CMAKE_Fortran_LINK_LIBRARY_FLAG \ CMAKE_Fortran_LINK_LIBRARY_SUFFIX + \ CMAKE_Fortran_LINK_WHAT_YOU_USE_FLAG \ CMAKE_Fortran_MODDIR_DEFAULT \ CMAKE_Fortran_MODDIR_FLAG \ CMAKE_Fortran_MODOUT_FLAG @@ -1141,8 +1281,12 @@ syn keyword cmakeVariable contained \ CMAKE_Fortran_SIMULATE_VERSION \ CMAKE_Fortran_SIZEOF_DATA_PTR \ CMAKE_Fortran_SOURCE_FILE_EXTENSIONS + \ CMAKE_Fortran_STANDARD + \ CMAKE_Fortran_STANDARD_DEFAULT \ CMAKE_Fortran_STANDARD_INCLUDE_DIRECTORIES \ CMAKE_Fortran_STANDARD_LIBRARIES + \ CMAKE_Fortran_STANDARD_REQUIRED + \ CMAKE_Fortran_SUPPORTED \ CMAKE_Fortran_VISIBILITY_PRESET \ CMAKE_GENERATOR \ CMAKE_GENERATOR_INSTANCE @@ -1162,12 +1306,15 @@ syn keyword cmakeVariable contained \ CMAKE_HIP_ARCHIVE_APPEND \ CMAKE_HIP_ARCHIVE_CREATE \ CMAKE_HIP_ARCHIVE_FINISH + \ CMAKE_HIP_BYTE_ORDER \ CMAKE_HIP_CLANG_TIDY + \ CMAKE_HIP_CLANG_TIDY_EXPORT_FIXES_DIR \ CMAKE_HIP_COMPILER \ CMAKE_HIP_COMPILER_ABI \ CMAKE_HIP_COMPILER_AR \ CMAKE_HIP_COMPILER_ARCHITECTURE_ID \ CMAKE_HIP_COMPILER_EXTERNAL_TOOLCHAIN + \ CMAKE_HIP_COMPILER_FRONTEND_VARIANT \ CMAKE_HIP_COMPILER_ID \ CMAKE_HIP_COMPILER_LAUNCHER \ CMAKE_HIP_COMPILER_LOADED @@ -1184,6 +1331,7 @@ syn keyword cmakeVariable contained \ CMAKE_HIP_CREATE_SHARED_MODULE \ CMAKE_HIP_CREATE_STATIC_LIBRARY \ CMAKE_HIP_EXTENSIONS + \ CMAKE_HIP_EXTENSIONS_DEFAULT \ CMAKE_HIP_FLAGS \ CMAKE_HIP_FLAGS_DEBUG \ CMAKE_HIP_FLAGS_DEBUG_INIT @@ -1211,6 +1359,7 @@ syn keyword cmakeVariable contained \ CMAKE_HIP_LINK_LIBRARY_FILE_FLAG \ CMAKE_HIP_LINK_LIBRARY_FLAG \ CMAKE_HIP_LINK_LIBRARY_SUFFIX + \ CMAKE_HIP_LINK_WHAT_YOU_USE_FLAG \ CMAKE_HIP_OUTPUT_EXTENSION \ CMAKE_HIP_PLATFORM_ID \ CMAKE_HIP_SIMULATE_ID @@ -1218,12 +1367,16 @@ syn keyword cmakeVariable contained \ CMAKE_HIP_SIZEOF_DATA_PTR \ CMAKE_HIP_SOURCE_FILE_EXTENSIONS \ CMAKE_HIP_STANDARD + \ CMAKE_HIP_STANDARD_DEFAULT \ CMAKE_HIP_STANDARD_INCLUDE_DIRECTORIES \ CMAKE_HIP_STANDARD_LIBRARIES \ CMAKE_HIP_STANDARD_REQUIRED + \ CMAKE_HIP_SUPPORTED \ CMAKE_HIP_VISIBILITY_PRESET \ CMAKE_HOME_DIRECTORY \ CMAKE_HOST_APPLE + \ CMAKE_HOST_BSD + \ CMAKE_HOST_LINUX \ CMAKE_HOST_SOLARIS \ CMAKE_HOST_SYSTEM \ CMAKE_HOST_SYSTEM_NAME @@ -1232,6 +1385,7 @@ syn keyword cmakeVariable contained \ CMAKE_HOST_UNIX \ CMAKE_HOST_WIN32 \ CMAKE_IGNORE_PATH + \ CMAKE_IGNORE_PREFIX_PATH \ CMAKE_IMPORT_LIBRARY_PREFIX \ CMAKE_IMPORT_LIBRARY_SUFFIX \ CMAKE_INCLUDE_CURRENT_DIR @@ -1252,6 +1406,7 @@ syn keyword cmakeVariable contained \ CMAKE_INTERPROCEDURAL_OPTIMIZATION \ CMAKE_IOS_INSTALL_COMBINED \ CMAKE_ISPC_HEADER_DIRECTORY + \ CMAKE_ISPC_HEADER_SUFFIX \ CMAKE_ISPC_INSTRUCTION_SETS \ CMAKE_JOB_POOLS \ CMAKE_JOB_POOL_COMPILE @@ -1264,12 +1419,15 @@ syn keyword cmakeVariable contained \ CMAKE_Java_ARCHIVE_APPEND \ CMAKE_Java_ARCHIVE_CREATE \ CMAKE_Java_ARCHIVE_FINISH + \ CMAKE_Java_BYTE_ORDER \ CMAKE_Java_CLANG_TIDY + \ CMAKE_Java_CLANG_TIDY_EXPORT_FIXES_DIR \ CMAKE_Java_COMPILER \ CMAKE_Java_COMPILER_ABI \ CMAKE_Java_COMPILER_AR \ CMAKE_Java_COMPILER_ARCHITECTURE_ID \ CMAKE_Java_COMPILER_EXTERNAL_TOOLCHAIN + \ CMAKE_Java_COMPILER_FRONTEND_VARIANT \ CMAKE_Java_COMPILER_ID \ CMAKE_Java_COMPILER_LAUNCHER \ CMAKE_Java_COMPILER_LOADED @@ -1284,6 +1442,8 @@ syn keyword cmakeVariable contained \ CMAKE_Java_CREATE_SHARED_LIBRARY \ CMAKE_Java_CREATE_SHARED_MODULE \ CMAKE_Java_CREATE_STATIC_LIBRARY + \ CMAKE_Java_EXTENSIONS + \ CMAKE_Java_EXTENSIONS_DEFAULT \ CMAKE_Java_FLAGS \ CMAKE_Java_FLAGS_DEBUG \ CMAKE_Java_FLAGS_DEBUG_INIT @@ -1302,6 +1462,7 @@ syn keyword cmakeVariable contained \ CMAKE_Java_INCLUDE_WHAT_YOU_USE \ CMAKE_Java_INIT \ CMAKE_Java_LIBRARY_ARCHITECTURE + \ CMAKE_Java_LINKER_LAUNCHER \ CMAKE_Java_LINKER_PREFERENCE \ CMAKE_Java_LINKER_PREFERENCE_PROPAGATES \ CMAKE_Java_LINKER_WRAPPER_FLAG @@ -1310,15 +1471,22 @@ syn keyword cmakeVariable contained \ CMAKE_Java_LINK_LIBRARY_FILE_FLAG \ CMAKE_Java_LINK_LIBRARY_FLAG \ CMAKE_Java_LINK_LIBRARY_SUFFIX + \ CMAKE_Java_LINK_WHAT_YOU_USE_FLAG \ CMAKE_Java_OUTPUT_EXTENSION \ CMAKE_Java_PLATFORM_ID \ CMAKE_Java_SIMULATE_ID \ CMAKE_Java_SIMULATE_VERSION \ CMAKE_Java_SIZEOF_DATA_PTR \ CMAKE_Java_SOURCE_FILE_EXTENSIONS + \ CMAKE_Java_STANDARD + \ CMAKE_Java_STANDARD_DEFAULT \ CMAKE_Java_STANDARD_INCLUDE_DIRECTORIES \ CMAKE_Java_STANDARD_LIBRARIES + \ CMAKE_Java_STANDARD_REQUIRED + \ CMAKE_Java_SUPPORTED \ CMAKE_Java_VISIBILITY_PRESET + \ CMAKE_KATE_FILES_MODE + \ CMAKE_KATE_MAKE_ARGUMENTS \ CMAKE_LIBRARY_ARCHITECTURE \ CMAKE_LIBRARY_ARCHITECTURE_REGEX \ CMAKE_LIBRARY_OUTPUT_DIRECTORY @@ -1326,14 +1494,17 @@ syn keyword cmakeVariable contained \ CMAKE_LIBRARY_PATH_FLAG \ CMAKE_LINK_DEF_FILE_FLAG \ CMAKE_LINK_DEPENDS_NO_SHARED + \ CMAKE_LINK_DEPENDS_USE_LINKER \ CMAKE_LINK_DIRECTORIES_BEFORE \ CMAKE_LINK_INTERFACE_LIBRARIES + \ CMAKE_LINK_LIBRARIES_ONLY_TARGETS \ CMAKE_LINK_LIBRARY_FILE_FLAG \ CMAKE_LINK_LIBRARY_FLAG \ CMAKE_LINK_LIBRARY_SUFFIX \ CMAKE_LINK_SEARCH_END_STATIC \ CMAKE_LINK_SEARCH_START_STATIC \ CMAKE_LINK_WHAT_YOU_USE + \ CMAKE_LINK_WHAT_YOU_USE_CHECK \ CMAKE_MACOSX_BUNDLE \ CMAKE_MACOSX_RPATH \ CMAKE_MAJOR_VERSION @@ -1351,6 +1522,7 @@ syn keyword cmakeVariable contained \ CMAKE_MODULE_LINKER_FLAGS_INIT \ CMAKE_MODULE_PATH \ CMAKE_MSVCIDE_RUN_PATH + \ CMAKE_MSVC_DEBUG_INFORMATION_FORMAT \ CMAKE_MSVC_RUNTIME_LIBRARY \ CMAKE_NETRC \ CMAKE_NETRC_FILE @@ -1378,6 +1550,7 @@ syn keyword cmakeVariable contained \ CMAKE_PCH_INSTANTIATE_TEMPLATES \ CMAKE_PCH_WARN_INVALID \ CMAKE_PDB_OUTPUT_DIRECTORY + \ CMAKE_PLATFORM_NO_VERSIONED_SONAME \ CMAKE_POSITION_INDEPENDENT_CODE \ CMAKE_PREFIX_PATH \ CMAKE_PROGRAM_PATH @@ -1386,6 +1559,7 @@ syn keyword cmakeVariable contained \ CMAKE_PROJECT_INCLUDE \ CMAKE_PROJECT_INCLUDE_BEFORE \ CMAKE_PROJECT_NAME + \ CMAKE_PROJECT_TOP_LEVEL_INCLUDES \ CMAKE_PROJECT_VERSION \ CMAKE_PROJECT_VERSION_MAJOR \ CMAKE_PROJECT_VERSION_MINOR @@ -1399,12 +1573,15 @@ syn keyword cmakeVariable contained \ CMAKE_RC_ARCHIVE_APPEND \ CMAKE_RC_ARCHIVE_CREATE \ CMAKE_RC_ARCHIVE_FINISH + \ CMAKE_RC_BYTE_ORDER \ CMAKE_RC_CLANG_TIDY + \ CMAKE_RC_CLANG_TIDY_EXPORT_FIXES_DIR \ CMAKE_RC_COMPILER \ CMAKE_RC_COMPILER_ABI \ CMAKE_RC_COMPILER_AR \ CMAKE_RC_COMPILER_ARCHITECTURE_ID \ CMAKE_RC_COMPILER_EXTERNAL_TOOLCHAIN + \ CMAKE_RC_COMPILER_FRONTEND_VARIANT \ CMAKE_RC_COMPILER_ID \ CMAKE_RC_COMPILER_LAUNCHER \ CMAKE_RC_COMPILER_LOADED @@ -1419,6 +1596,8 @@ syn keyword cmakeVariable contained \ CMAKE_RC_CREATE_SHARED_LIBRARY \ CMAKE_RC_CREATE_SHARED_MODULE \ CMAKE_RC_CREATE_STATIC_LIBRARY + \ CMAKE_RC_EXTENSIONS + \ CMAKE_RC_EXTENSIONS_DEFAULT \ CMAKE_RC_FLAGS \ CMAKE_RC_FLAGS_DEBUG \ CMAKE_RC_FLAGS_DEBUG_INIT @@ -1437,6 +1616,7 @@ syn keyword cmakeVariable contained \ CMAKE_RC_INCLUDE_WHAT_YOU_USE \ CMAKE_RC_INIT \ CMAKE_RC_LIBRARY_ARCHITECTURE + \ CMAKE_RC_LINKER_LAUNCHER \ CMAKE_RC_LINKER_PREFERENCE \ CMAKE_RC_LINKER_PREFERENCE_PROPAGATES \ CMAKE_RC_LINKER_WRAPPER_FLAG @@ -1445,19 +1625,25 @@ syn keyword cmakeVariable contained \ CMAKE_RC_LINK_LIBRARY_FILE_FLAG \ CMAKE_RC_LINK_LIBRARY_FLAG \ CMAKE_RC_LINK_LIBRARY_SUFFIX + \ CMAKE_RC_LINK_WHAT_YOU_USE_FLAG \ CMAKE_RC_OUTPUT_EXTENSION \ CMAKE_RC_PLATFORM_ID \ CMAKE_RC_SIMULATE_ID \ CMAKE_RC_SIMULATE_VERSION \ CMAKE_RC_SIZEOF_DATA_PTR \ CMAKE_RC_SOURCE_FILE_EXTENSIONS + \ CMAKE_RC_STANDARD + \ CMAKE_RC_STANDARD_DEFAULT \ CMAKE_RC_STANDARD_INCLUDE_DIRECTORIES \ CMAKE_RC_STANDARD_LIBRARIES + \ CMAKE_RC_STANDARD_REQUIRED + \ CMAKE_RC_SUPPORTED \ CMAKE_RC_VISIBILITY_PRESET \ CMAKE_ROOT \ CMAKE_RULE_MESSAGES \ CMAKE_RUNTIME_OUTPUT_DIRECTORY \ CMAKE_SCRIPT_MODE_FILE + \ CMAKE_SHARED_LIBRARY_ENABLE_EXPORTS \ CMAKE_SHARED_LIBRARY_PREFIX \ CMAKE_SHARED_LIBRARY_SUFFIX \ CMAKE_SHARED_LINKER_FLAGS @@ -1486,6 +1672,7 @@ syn keyword cmakeVariable contained \ CMAKE_SYSTEM_APPBUNDLE_PATH \ CMAKE_SYSTEM_FRAMEWORK_PATH \ CMAKE_SYSTEM_IGNORE_PATH + \ CMAKE_SYSTEM_IGNORE_PREFIX_PATH \ CMAKE_SYSTEM_INCLUDE_PATH \ CMAKE_SYSTEM_LIBRARY_PATH \ CMAKE_SYSTEM_NAME @@ -1500,12 +1687,15 @@ syn keyword cmakeVariable contained \ CMAKE_Swift_ARCHIVE_APPEND \ CMAKE_Swift_ARCHIVE_CREATE \ CMAKE_Swift_ARCHIVE_FINISH + \ CMAKE_Swift_BYTE_ORDER \ CMAKE_Swift_CLANG_TIDY + \ CMAKE_Swift_CLANG_TIDY_EXPORT_FIXES_DIR \ CMAKE_Swift_COMPILER \ CMAKE_Swift_COMPILER_ABI \ CMAKE_Swift_COMPILER_AR \ CMAKE_Swift_COMPILER_ARCHITECTURE_ID \ CMAKE_Swift_COMPILER_EXTERNAL_TOOLCHAIN + \ CMAKE_Swift_COMPILER_FRONTEND_VARIANT \ CMAKE_Swift_COMPILER_ID \ CMAKE_Swift_COMPILER_LAUNCHER \ CMAKE_Swift_COMPILER_LOADED @@ -1520,6 +1710,8 @@ syn keyword cmakeVariable contained \ CMAKE_Swift_CREATE_SHARED_LIBRARY \ CMAKE_Swift_CREATE_SHARED_MODULE \ CMAKE_Swift_CREATE_STATIC_LIBRARY + \ CMAKE_Swift_EXTENSIONS + \ CMAKE_Swift_EXTENSIONS_DEFAULT \ CMAKE_Swift_FLAGS \ CMAKE_Swift_FLAGS_DEBUG \ CMAKE_Swift_FLAGS_DEBUG_INIT @@ -1539,6 +1731,7 @@ syn keyword cmakeVariable contained \ CMAKE_Swift_INIT \ CMAKE_Swift_LANGUAGE_VERSION \ CMAKE_Swift_LIBRARY_ARCHITECTURE + \ CMAKE_Swift_LINKER_LAUNCHER \ CMAKE_Swift_LINKER_PREFERENCE \ CMAKE_Swift_LINKER_PREFERENCE_PROPAGATES \ CMAKE_Swift_LINKER_WRAPPER_FLAG @@ -1547,6 +1740,7 @@ syn keyword cmakeVariable contained \ CMAKE_Swift_LINK_LIBRARY_FILE_FLAG \ CMAKE_Swift_LINK_LIBRARY_FLAG \ CMAKE_Swift_LINK_LIBRARY_SUFFIX + \ CMAKE_Swift_LINK_WHAT_YOU_USE_FLAG \ CMAKE_Swift_MODULE_DIRECTORY \ CMAKE_Swift_NUM_THREADS \ CMAKE_Swift_OUTPUT_EXTENSION @@ -1555,16 +1749,25 @@ syn keyword cmakeVariable contained \ CMAKE_Swift_SIMULATE_VERSION \ CMAKE_Swift_SIZEOF_DATA_PTR \ CMAKE_Swift_SOURCE_FILE_EXTENSIONS + \ CMAKE_Swift_STANDARD + \ CMAKE_Swift_STANDARD_DEFAULT \ CMAKE_Swift_STANDARD_INCLUDE_DIRECTORIES \ CMAKE_Swift_STANDARD_LIBRARIES + \ CMAKE_Swift_STANDARD_REQUIRED + \ CMAKE_Swift_SUPPORTED \ CMAKE_Swift_VISIBILITY_PRESET + \ CMAKE_TASKING_TOOLSET + \ CMAKE_TLS_CAINFO + \ CMAKE_TLS_VERIFY \ CMAKE_TOOLCHAIN_FILE \ CMAKE_TRY_COMPILE_CONFIGURATION + \ CMAKE_TRY_COMPILE_NO_PLATFORM_VARIABLES \ CMAKE_TRY_COMPILE_PLATFORM_VARIABLES \ CMAKE_TRY_COMPILE_TARGET_TYPE \ CMAKE_TWEAK_VERSION \ CMAKE_UNITY_BUILD \ CMAKE_UNITY_BUILD_BATCH_SIZE + \ CMAKE_UNITY_BUILD_UNIQUE_ID \ CMAKE_USER_MAKE_RULES_OVERRIDE \ CMAKE_USER_MAKE_RULES_OVERRIDE_ASM \ CMAKE_USER_MAKE_RULES_OVERRIDE_ASM_MASM @@ -1580,8 +1783,13 @@ syn keyword cmakeVariable contained \ CMAKE_USER_MAKE_RULES_OVERRIDE_Swift \ CMAKE_USE_RELATIVE_PATHS \ CMAKE_VERBOSE_MAKEFILE + \ CMAKE_VERIFY_INTERFACE_HEADER_SETS \ CMAKE_VERSION \ CMAKE_VISIBILITY_INLINES_HIDDEN + \ CMAKE_VS_DEBUGGER_COMMAND + \ CMAKE_VS_DEBUGGER_COMMAND_ARGUMENTS + \ CMAKE_VS_DEBUGGER_ENVIRONMENT + \ CMAKE_VS_DEBUGGER_WORKING_DIRECTORY \ CMAKE_VS_DEVENV_COMMAND \ CMAKE_VS_GLOBALS \ CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD @@ -1589,6 +1797,8 @@ syn keyword cmakeVariable contained \ CMAKE_VS_INTEL_Fortran_PROJECT_VERSION \ CMAKE_VS_JUST_MY_CODE_DEBUGGING \ CMAKE_VS_MSBUILD_COMMAND + \ CMAKE_VS_NO_COMPILE_BATCHING + \ CMAKE_VS_NUGET_PACKAGE_RESTORE \ CMAKE_VS_NsightTegra_VERSION \ CMAKE_VS_PLATFORM_NAME \ CMAKE_VS_PLATFORM_NAME_DEFAULT @@ -1604,11 +1814,17 @@ syn keyword cmakeVariable contained \ CMAKE_VS_SDK_LIBRARY_WINRT_DIRECTORIES \ CMAKE_VS_SDK_REFERENCE_DIRECTORIES \ CMAKE_VS_SDK_SOURCE_DIRECTORIES + \ CMAKE_VS_TARGET_FRAMEWORK_IDENTIFIER + \ CMAKE_VS_TARGET_FRAMEWORK_TARGETS_VERSION + \ CMAKE_VS_TARGET_FRAMEWORK_VERSION + \ CMAKE_VS_VERSION_BUILD_NUMBER + \ CMAKE_VS_WINDOWS_TARGET_PLATFORM_MIN_VERSION \ CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION \ CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION_MAXIMUM \ CMAKE_VS_WINRT_BY_DEFAULT \ CMAKE_WARN_DEPRECATED \ CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION + \ CMAKE_WATCOM_RUNTIME_LIBRARY \ CMAKE_WIN32_EXECUTABLE \ CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS \ CMAKE_XCODE_BUILD_SYSTEM @@ -1623,8 +1839,12 @@ syn keyword cmakeVariable contained \ CMAKE_XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER \ CMAKE_XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS \ CMAKE_XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE + \ CMAKE_XCODE_SCHEME_ENABLE_GPU_API_VALIDATION + \ CMAKE_XCODE_SCHEME_ENABLE_GPU_FRAME_CAPTURE_MODE + \ CMAKE_XCODE_SCHEME_ENABLE_GPU_SHADER_VALIDATION \ CMAKE_XCODE_SCHEME_ENVIRONMENT \ CMAKE_XCODE_SCHEME_GUARD_MALLOC + \ CMAKE_XCODE_SCHEME_LAUNCH_CONFIGURATION \ CMAKE_XCODE_SCHEME_LAUNCH_MODE \ CMAKE_XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP \ CMAKE_XCODE_SCHEME_MALLOC_GUARD_EDGES @@ -1639,8 +1859,10 @@ syn keyword cmakeVariable contained \ CMAKE_XCODE_SCHEME_LAUNCH_CONFIGURATION \ CMAKE_XCODE_SCHEME_WORKING_DIRECTORY \ CMAKE_XCODE_SCHEME_ZOMBIE_OBJECTS + \ CMAKE_XCODE_XCCONFIG \ CPACK_ABSOLUTE_DESTINATION_FILES \ CPACK_COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY + \ CPACK_CUSTOM_INSTALL_VARIABLES \ CPACK_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION \ CPACK_INCLUDE_TOPLEVEL_DIRECTORY \ CPACK_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS @@ -1675,6 +1897,7 @@ syn keyword cmakeVariable contained \ CTEST_CUSTOM_PRE_MEMCHECK \ CTEST_CUSTOM_PRE_TEST \ CTEST_CUSTOM_TESTS_IGNORE + \ CTEST_CUSTOM_TEST_OUTPUT_TRUNCATION \ CTEST_CUSTOM_WARNING_EXCEPTION \ CTEST_CUSTOM_WARNING_MATCH \ CTEST_CVS_CHECKOUT @@ -1707,6 +1930,7 @@ syn keyword cmakeVariable contained \ CTEST_RESOURCE_SPEC_FILE \ CTEST_RUN_CURRENT_SCRIPT \ CTEST_SCP_COMMAND + \ CTEST_SCRIPT_DIRECTORY \ CTEST_SITE \ CTEST_SOURCE_DIRECTORY \ CTEST_SUBMIT_INACTIVITY_TIMEOUT @@ -2005,6 +2229,7 @@ syn keyword cmakeVariable contained \ GHSMULTI \ IOS \ LIBRARY_OUTPUT_PATH + \ LINUX \ MINGW \ MSVC \ MSVC10 @@ -2023,6 +2248,7 @@ syn keyword cmakeVariable contained \ PROJECT_BINARY_DIR \ PROJECT_DESCRIPTION \ PROJECT_HOMEPAGE_URL + \ PROJECT_IS_TOP_LEVEL \ PROJECT_NAME \ PROJECT_SOURCE_DIR \ PROJECT_VERSION @@ -2040,6 +2266,7 @@ syn keyword cmakeVariable contained syn keyword cmakeModule contained \ ExternalProject + \ FetchContent syn keyword cmakeKWExternalProject contained \ AWS @@ -2053,10 +2280,10 @@ syn keyword cmakeKWExternalProject contained \ CMAKE_CACHE_ARGS \ CMAKE_CACHE_DEFAULT_ARGS \ CMAKE_EP_GIT_REMOTE_UPDATE_STRATEGY - \ CMAKE_TLS_CAINFO - \ CMAKE_TLS_VERIFY + \ CMAKE_INSTALL_MODE \ COMMENT \ CONFIGURE_COMMAND + \ CONFIGURE_HANDLED_BY_BUILD \ CVS \ CVSROOT \ CVS_MODULE @@ -2068,6 +2295,7 @@ syn keyword cmakeKWExternalProject contained \ DOWNLOADED_FILE \ DOWNLOAD_COMMAND \ DOWNLOAD_DIR + \ DOWNLOAD_EXTRACT_TIMESTAMP \ DOWNLOAD_NAME \ DOWNLOAD_NO_EXTRACT \ DOWNLOAD_NO_PROGRESS @@ -2159,24 +2387,90 @@ syn keyword cmakeKWExternalProject contained \ USES_TERMINAL_UPDATE \ WORKING_DIRECTORY +syn keyword cmakeKWFetchContent contained + \ ALWAYS + \ BINARY_DIR + \ BUILD_COMMAND + \ BYPASS_PROVIDER + \ CMAKE_PROJECT_ + \ CONFIGURE_COMMAND + \ COPY + \ CORRECT + \ DCMAKE_TOOLCHAIN_FILE + \ DESTINATION + \ DOWNLOAD_NO_EXTRACT + \ EXISTS + \ FETCHCONTENT_BASE_DIR + \ FETCHCONTENT_FULLY_DISCONNECTED + \ FETCHCONTENT_MAKEAVAILABLE_SERIAL + \ FETCHCONTENT_QUIET + \ FETCHCONTENT_SOURCE_DIR_ + \ FETCHCONTENT_TRY_FIND_PACKAGE_MODE + \ FETCHCONTENT_UPDATES_DISCONNECTED + \ FETCHCONTENT_UPDATES_DISCONNECTED_ + \ FIND_PACKAGE_ARGS + \ GIT_REPOSITORY + \ GIT_TAG + \ GLOBAL + \ GTEST_BOTH_LIBRARIES + \ GTEST_LIBRARIES + \ GTEST_MAIN_LIBRARIES + \ INSTALL_COMMAND + \ INTERNAL + \ NAME + \ NAMES + \ NEVER + \ NOTE + \ OFF + \ OPTIONAL + \ OPT_IN + \ OVERRIDE_FIND_PACKAGE + \ PACKAGE_VERSION_COMPATIBLE + \ PACKAGE_VERSION_EXACT + \ QUIET + \ SOURCE_SUBDIR + \ STREQUAL + \ SUBBUILD_DIR + \ SVN_REPOSITORY + \ SVN_REVISION + \ SYSTEM + \ TARGET + \ TEST_COMMAND + \ TRUE + \ URL + \ URL_HASH + \ VERIFY_INTERFACE_HEADER_SETS + \ WRITE + \ WRONG + \ _BINARY_DIR + \ _INCLUDE + \ _POPULATED + \ _SOURCE_DIR + syn keyword cmakeKWadd_compile_definitions contained \ COMPILE_DEFINITIONS \ VAR syn keyword cmakeKWadd_compile_options contained + \ CMAKE_ + \ COMPILE_LANGUAGE \ COMPILE_OPTIONS + \ CONFIG \ SHELL \ UNIX_COMMAND - \ WX + \ _FLAGS + \ _FLAGS_ syn keyword cmakeKWadd_custom_command contained \ APPEND \ ARGS + \ BNF \ BYPRODUCTS \ CC \ COMMAND \ COMMAND_EXPAND_LISTS \ COMMENT + \ CONFIG \ CROSSCOMPILING_EMULATOR \ DEPENDS \ DEPENDS_EXPLICIT_ONLY @@ -2188,6 +2482,7 @@ syn keyword cmakeKWadd_custom_command contained \ JOB_POOLS \ JOIN \ MAIN_DEPENDENCY + \ MODULE \ NOT \ OUTPUT \ PATH @@ -2263,17 +2558,21 @@ syn keyword cmakeKWadd_library contained \ FRAMEWORK \ GLOBAL \ HEADER_FILE_ONLY + \ HEADER_SETS \ IMPORTED \ IMPORTED_ \ IMPORTED_IMPLIB \ IMPORTED_IMPLIB_ \ IMPORTED_LOCATION \ IMPORTED_LOCATION_ + \ IMPORTED_NO_SONAME \ IMPORTED_OBJECTS \ IMPORTED_OBJECTS_ + \ IMPORTED_SONAME \ INTERFACE \ INTERFACE_ \ INTERFACE_SOURCES + \ LC_ID_DYLIB \ LIBRARY_OUTPUT_DIRECTORY \ MODULE \ OBJECT @@ -2283,22 +2582,25 @@ syn keyword cmakeKWadd_library contained \ POST_BUILD \ PRE_BUILD \ PRE_LINK - \ PRIVATE - \ PUBLIC + \ PRIVATE_HEADER + \ PUBLIC_HEADER \ RUNTIME_OUTPUT_DIRECTORY \ SHARED + \ SONAME \ SOURCES \ STATIC + \ TARGETS \ TARGET_OBJECTS + \ TARGET_RUNTIME_DLLS \ UNKNOWN syn keyword cmakeKWadd_link_options contained \ CMAKE_ + \ CONFIG \ CUDA_RESOLVE_DEVICE_SYMBOLS \ CUDA_SEPARABLE_COMPILATION \ DEVICE_LINK \ GCC - \ GNU \ HOST_LINK \ LANG \ LINKER @@ -2306,11 +2608,14 @@ syn keyword cmakeKWadd_link_options contained \ SHELL \ STATIC_LIBRARY_OPTIONS \ UNIX_COMMAND + \ _FLAGS + \ _FLAGS_ \ _LINKER_WRAPPER_FLAG \ _LINKER_WRAPPER_FLAG_SEP syn keyword cmakeKWadd_subdirectory contained \ EXCLUDE_FROM_ALL + \ SYSTEM syn keyword cmakeKWadd_test contained \ BUILD_TESTING @@ -2324,15 +2629,64 @@ syn keyword cmakeKWadd_test contained \ SKIP_REGULAR_EXPRESSION \ TARGET_FILE \ WILL_FAIL + \ WILL_FALL \ WORKING_DIRECTORY +syn keyword cmakeKWblock contained + \ PARENT_SCOPE + \ POLICIES + \ PROPAGATE + \ PUSH + \ SCOPE_FOR + \ TRUE + \ VARIABLES + syn keyword cmakeKWbuild_command contained \ CONFIGURATION + \ PARALLEL_LEVEL \ TARGET +syn keyword cmakeKWcmake_file_api contained + \ API + \ API_VERSION + \ BUILD_DIR + \ CMAKEFILES + \ CODEMODEL + \ COMMAND + \ CONFIG + \ QUERY + \ TOOLCHAINS + syn keyword cmakeKWcmake_host_system_information contained + \ APPEND \ AVAILABLE_PHYSICAL_MEMORY \ AVAILABLE_VIRTUAL_MEMORY + \ BOTH + \ CMAKE_GET_OS_RELEASE_FALLBACK_CONTENT + \ CMAKE_GET_OS_RELEASE_FALLBACK_RESULT_ + \ CMAKE_GET_OS_RELEASE_FALLBACK_RESULT_ID + \ CMAKE_GET_OS_RELEASE_FALLBACK_RESULT_NAME + \ CMAKE_GET_OS_RELEASE_FALLBACK_RESULT_PRETTY_NAME + \ CMAKE_GET_OS_RELEASE_FALLBACK_RESULT_VERSION + \ CMAKE_GET_OS_RELEASE_FALLBACK_RESULT_VERSION_ID + \ CMAKE_GET_OS_RELEASE_FALLBACK_SCRIPTS + \ DISTRIB_INFO + \ DISTRIB_PRETTY_NAME + \ DISTRO + \ DISTRO_BUG_REPORT_URL + \ DISTRO_HOME_URL + \ DISTRO_ID + \ DISTRO_ID_LIKE + \ DISTRO_NAME + \ DISTRO_PRETTY_NAME + \ DISTRO_PRIVACY_POLICY_URL + \ DISTRO_SUPPORT_URL + \ DISTRO_UBUNTU_CODENAME + \ DISTRO_VERSION + \ DISTRO_VERSION_CODENAME + \ DISTRO_VERSION_ID + \ ERROR_VARIABLE + \ EXISTS \ FQDN \ HAS_FPU \ HAS_MMX @@ -2341,38 +2695,101 @@ syn keyword cmakeKWcmake_host_system_information contained \ HAS_SSE \ HAS_SSE_FP \ HAS_SSE_MMX + \ HKCC + \ HKCR + \ HKCU + \ HKEY_CLASSES_ROOT + \ HKEY_CURRENT_CONFIG + \ HKEY_CURRENT_USER + \ HKEY_LOCAL_MACHINE + \ HKEY_USERS + \ HKLM + \ HKU \ HOSTNAME \ ID + \ LIMIT_COUNT + \ LISTS + \ LTS + \ MATCHES + \ NNN + \ NOT \ NUMBER_OF_LOGICAL_CORES \ NUMBER_OF_PHYSICAL_CORES \ OS_NAME \ OS_PLATFORM \ OS_RELEASE \ OS_VERSION + \ PRETTY_NAME \ PROCESSOR_DESCRIPTION \ PROCESSOR_NAME \ PROCESSOR_SERIAL_NUMBER \ QUERY + \ REG_DWORD + \ REG_EXPAND_SZ + \ REG_MULTI_SZ + \ REG_QWORD + \ REG_SZ \ RESULT + \ SEPARATOR + \ SOFTWARE + \ STATUS + \ STRINGS + \ SUBKEYS + \ TARGET \ TOTAL_PHYSICAL_MEMORY \ TOTAL_VIRTUAL_MEMORY + \ VALUE_NAMES + \ VAR + \ VIEW + \ WINDOWS_REGISTRY syn keyword cmakeKWcmake_language contained \ AND + \ ANY + \ APPEND + \ ARGN + \ BINARY_DIR + \ BYPASS_PROVIDER \ CALL \ CANCEL_CALL \ CODE + \ COMMAND + \ COMMAND_ERROR_IS_FATAL + \ DCMAKE_PROJECT_TOP_LEVEL_INCLUDES \ DEFER \ DIRECTORY \ EVAL \ FALSE + \ FETCHCONTENT_MAKEAVAILABE_SERIAL + \ FETCHCONTENT_MAKEAVAILABLE_SERIAL + \ FETCHCONTENT_SOURCE_DIR_ + \ FETCHCONTENT_TRY_FIND_PACKAGE_MODE + \ FIND_PACKAGE + \ FIND_PACKAGE_ARGS \ GET_CALL_IDS - \ ID + \ GET_MESSAGE_LOG_LEVEL + \ GIT_REPOSITORY + \ GIT_SUBMODULES + \ GIT_TAG \ ID_VAR - \ OR + \ MATCHES + \ MYCOMP_PROVIDER_INSTALL_DIR + \ NEVER + \ NOT + \ OVERRIDE_FIND_PACKAGE + \ PATH + \ POP_BACK + \ QUIET + \ SET_DEPENDENCY_PROVIDER + \ SOURCE_DIR \ STATUS + \ STREQUAL + \ SUPPORTED_METHODS \ TRUE + \ VERSION \ WRITE + \ _FOUND + \ _PATH syn keyword cmakeKWcmake_minimum_required contained \ FATAL_ERROR @@ -2407,22 +2824,21 @@ syn keyword cmakeKWcmake_path contained \ ABSOLUTE_PATH \ AND \ APPEND + \ APPEND_STRING \ BASE_DIRECTORY - \ CMAKE_PATH \ COMPARE - \ CONCAT \ CONVERT - \ ELSEIF - \ ENDIF + \ EQUAL \ EXTENSION \ EXTENSION_DEF \ FALSE + \ FILENAME \ FILENAME_DEF \ GET \ GET_EXTENSION \ GET_FILENAME \ GET_PARENT_PATH - \ GET_RELATIVE_PATH + \ GET_RELATIVE_PART \ GET_ROOT_DIRECTORY \ GET_ROOT_NAME \ GET_ROOT_PATH @@ -2431,12 +2847,11 @@ syn keyword cmakeKWcmake_path contained \ HAS_EXTENSION \ HAS_FILENAME \ HAS_PARENT_PATH - \ HAS_RELATIVE_PATH + \ HAS_RELATIVE_PART \ HAS_ROOT_DIRECTORY \ HAS_ROOT_NAME \ HAS_ROOT_PATH \ HAS_STEM - \ IF \ IS_ABSOLUTE \ IS_PREFIX \ IS_RELATIVE @@ -2445,23 +2860,21 @@ syn keyword cmakeKWcmake_path contained \ NATIVE_PATH \ NORMALIZE \ NORMAL_PATH - \ NOT \ NOT_EQUAL \ OP - \ OS \ OUTPUT_VARIABLE \ PARENT_PATH - \ PROXIMATE_PATH \ REAL_PATH + \ RELATIVE_PART \ RELATIVE_PATH \ REMOVE_EXTENSION \ REMOVE_FILENAME \ REPLACE_EXTENSION \ REPLACE_FILENAME - \ RETURN \ ROOT_DIRECTORY \ ROOT_NAME \ ROOT_PATH + \ SET \ STEM \ STREQUAL \ TO_CMAKE_PATH_LIST @@ -2476,8 +2889,10 @@ syn keyword cmakeKWcmake_policy contained \ NNNN \ NO_POLICY_SCOPE \ OLD + \ POLICIES \ POP \ PUSH + \ SCOPE_FOR \ SET \ VERSION @@ -2489,9 +2904,14 @@ syn keyword cmakeKWconfigure_file contained \ FILE_PERMISSIONS \ FOO_ENABLE \ FOO_STRING + \ GENERATE + \ INTERFACE \ LF \ NEWLINE_STYLE \ NO_SOURCE_PERMISSIONS + \ PRIVATE + \ PUBLIC + \ SYSTEM \ USE_SOURCE_PERMISSIONS \ VAR @@ -2506,6 +2926,7 @@ syn keyword cmakeKWctest_build contained \ APPEND \ BUILD \ CAPTURE_CMAKE_ERROR + \ CMAKE_BUILD_PARALLEL_LEVEL \ CONFIGURATION \ CTEST_BUILD_CONFIGURATION \ CTEST_BUILD_FLAGS @@ -2513,6 +2934,7 @@ syn keyword cmakeKWctest_build contained \ FLAGS \ NUMBER_ERRORS \ NUMBER_WARNINGS + \ PARALLEL_LEVEL \ QUIET \ RETURN_VALUE \ TARGET @@ -2537,6 +2959,7 @@ syn keyword cmakeKWctest_coverage contained syn keyword cmakeKWctest_memcheck contained \ APPEND \ BUILD + \ CAPTURE_CMAKE_ERROR \ DEFECT_COUNT \ EXCLUDE \ EXCLUDE_FIXTURE @@ -2547,11 +2970,15 @@ syn keyword cmakeKWctest_memcheck contained \ INCLUDE_LABEL \ OFF \ ON + \ OUTPUT_JUNIT \ PARALLEL_LEVEL \ QUIET + \ REPEAT + \ RESOURCE_SPEC_FILE \ RETURN_VALUE \ SCHEDULE_RANDOM \ START + \ STOP_ON_FAILURE \ STOP_TIME \ STRIDE \ TEST_LOAD @@ -2587,6 +3014,8 @@ syn keyword cmakeKWctest_submit contained syn keyword cmakeKWctest_test contained \ AFTER_TIMEOUT \ APPEND + \ ATTACHED_FILES + \ ATTACHED_FILES_ON_FAIL \ BUILD \ CAPTURE_CMAKE_ERROR \ CPU @@ -2597,8 +3026,10 @@ syn keyword cmakeKWctest_test contained \ EXCLUDE_LABEL \ INCLUDE \ INCLUDE_LABEL + \ LABELS \ OFF \ ON + \ OUTPUT_JUNIT \ PARALLEL_LEVEL \ QUIET \ REPEAT @@ -2612,6 +3043,8 @@ syn keyword cmakeKWctest_test contained \ TEST_LOAD \ UNTIL_FAIL \ UNTIL_PASS + \ URL + \ XML syn keyword cmakeKWctest_update contained \ CAPTURE_CMAKE_ERROR @@ -2629,15 +3062,18 @@ syn keyword cmakeKWdefine_property contained \ APPEND_STRING \ BRIEF_DOCS \ CACHED_VARIABLE + \ CMAKE_ \ DIRECTORY \ FULL_DOCS \ GLOBAL \ INHERITED + \ INITIALIZE_FROM_VARIABLE \ PROPERTY \ SOURCE \ TARGET \ TEST \ VARIABLE + \ _CMAKE_ syn keyword cmakeKWdoxygen_add_docs contained \ ALL @@ -2647,6 +3083,10 @@ syn keyword cmakeKWdoxygen_add_docs contained syn keyword cmakeKWenable_language contained \ ASM + \ ASM_MARMASM + \ ASM_MASM + \ ASM_NASM + \ ATT \ CUDA \ HIP \ ISPC @@ -2684,6 +3124,7 @@ syn keyword cmakeKWexecute_process contained \ OUTPUT_QUIET \ OUTPUT_STRIP_TRAILING_WHITESPACE \ OUTPUT_VARIABLE + \ POSIX \ RESULTS_VARIABLE \ RESULT_VARIABLE \ RFC @@ -2691,17 +3132,17 @@ syn keyword cmakeKWexecute_process contained \ STDOUT \ TIMEOUT \ UTF - \ VERBATIM \ WORKING_DIRECTORY syn keyword cmakeKWexport contained \ ANDROID_MK \ APPEND + \ CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API \ CONFIG + \ CXX_MODULES_DIRECTORY \ EXPORT \ EXPORT_LINK_INTERFACE_LIBRARIES \ FILE - \ IMPORTED \ IMPORTED_ \ NAMESPACE \ NDK @@ -2717,7 +3158,6 @@ syn keyword cmakeKWexport_library_dependencies contained \ SET syn keyword cmakeKWfile contained - \ ALGO \ APPEND \ ARCHIVE_CREATE \ ARCHIVE_EXTRACT @@ -2729,9 +3169,8 @@ syn keyword cmakeKWfile contained \ CMAKE_GET_RUNTIME_DEPENDENCIES_COMMAND \ CMAKE_GET_RUNTIME_DEPENDENCIES_PLATFORM \ CMAKE_GET_RUNTIME_DEPENDENCIES_TOOL + \ CMAKE_INSTALL_MODE \ CMAKE_OBJDUMP - \ CMAKE_TLS_CAINFO - \ CMAKE_TLS_VERIFY \ CODE \ COMPILE_FEATURES \ COMPRESSION @@ -2742,7 +3181,8 @@ syn keyword cmakeKWfile contained \ CONFLICTING_DEPENDENCIES_PREFIX \ CONTENT \ CONVERT - \ COPY + \ COPYONLY + \ COPY_FILE \ COPY_ON_ERROR \ CREATE_LINK \ CRLF @@ -2755,6 +3195,7 @@ syn keyword cmakeKWfile contained \ ENCODING \ ESCAPE_QUOTES \ EXECUTABLES + \ EXPAND_TILDE \ EXPECTED_HASH \ FILES_MATCHING \ FILE_PERMISSIONS @@ -2772,10 +3213,12 @@ syn keyword cmakeKWfile contained \ GUARD \ HASH \ HEX + \ HOME \ HTTPHEADER \ IGNORED \ INACTIVITY_TIMEOUT \ INPUT + \ INPUT_MAY_BE_RECENT \ INSTALL \ IS_ABSOLUTE \ LENGTH_MAXIMUM @@ -2800,9 +3243,11 @@ syn keyword cmakeKWfile contained \ NEWLINE_STYLE \ NOT \ NO_HEX_CONVERSION + \ NO_REPLACE \ NO_SOURCE_PERMISSIONS \ OFFSET \ ONLY + \ ONLY_IF_DIFFERENT \ OPTIONAL \ OUTPUT \ OWNER_EXECUTE @@ -2812,11 +3257,15 @@ syn keyword cmakeKWfile contained \ PATTERN \ PATTERNS \ PERMISSIONS + \ POST_EXCLUDE_FILES \ POST_EXCLUDE_REGEXES + \ POST_INCLUDE_FILES \ POST_INCLUDE_REGEXES \ PRE_EXCLUDE_REGEXES \ PRE_INCLUDE_REGEXES \ PROCESS + \ RANGE_END + \ RANGE_START \ READ \ READ_SYMLINK \ REAL_PATH @@ -2833,7 +3282,10 @@ syn keyword cmakeKWfile contained \ RESULT_VARIABLE \ RPATH \ RUNPATH + \ RUNTIME_DEPENDENCY_SET \ SCRIPT + \ SETGID + \ SETUID \ SHARED \ SHOW_PROGRESS \ SIZE @@ -2856,6 +3308,7 @@ syn keyword cmakeKWfile contained \ UNRESOLVED_DEPENDENCIES_VAR \ UPLOAD \ URL + \ USERPROFILE \ USERPWD \ USE_SOURCE_PERMISSIONS \ UTC @@ -2869,54 +3322,87 @@ syn keyword cmakeKWfile contained \ _FILENAMES syn keyword cmakeKWfind_file contained + \ BOTH + \ CATEGORY \ CMAKE_FIND_ROOT_PATH_BOTH + \ CMAKE_FIND_USE_ \ DOC \ DVAR \ FALSE + \ FIND_XXX_REGISTRY_VIEW \ HINTS + \ HOST \ INCLUDE + \ MATCHES \ NAMES + \ NOT + \ NO_CACHE \ NO_CMAKE_ENVIRONMENT_PATH \ NO_CMAKE_FIND_ROOT_PATH + \ NO_CMAKE_INSTALL_PREFIX \ NO_CMAKE_PATH \ NO_CMAKE_SYSTEM_PATH \ NO_DEFAULT_PATH \ NO_PACKAGE_ROOT_PATH \ NO_SYSTEM_ENVIRONMENT_PATH \ ONLY_CMAKE_FIND_ROOT_PATH + \ PACKAGENAME + \ PARENT_SCOPE \ PATHS \ PATH_SUFFIXES + \ REGISTRY_VIEW \ REQUIRED + \ TARGET + \ VALIDATOR \ VAR syn keyword cmakeKWfind_library contained + \ BOTH + \ CATEGORY \ CMAKE_FIND_ROOT_PATH_BOTH + \ CMAKE_FIND_USE_ \ DOC \ DVAR \ FALSE + \ FIND_XXX_REGISTRY_VIEW \ HINTS - \ INCLUDE + \ HOST + \ LIB + \ MATCHES \ NAMES \ NAMES_PER_DIR + \ NOT + \ NO_CACHE \ NO_CMAKE_ENVIRONMENT_PATH \ NO_CMAKE_FIND_ROOT_PATH + \ NO_CMAKE_INSTALL_PREFIX \ NO_CMAKE_PATH \ NO_CMAKE_SYSTEM_PATH \ NO_DEFAULT_PATH \ NO_PACKAGE_ROOT_PATH \ NO_SYSTEM_ENVIRONMENT_PATH \ ONLY_CMAKE_FIND_ROOT_PATH + \ PACKAGENAME + \ PARENT_SCOPE \ PATHS \ PATH_SUFFIXES + \ REGISTRY_VIEW \ REQUIRED + \ TARGET + \ VALIDATOR \ VAR syn keyword cmakeKWfind_package contained \ ABI + \ BOTH \ BUNDLE + \ BYPASS_PROVIDER + \ CATEGORY \ CMAKE_DISABLE_FIND_PACKAGE_ \ CMAKE_REQUIRE_FIND_PACKAGE_ \ CMAKE_FIND_ROOT_PATH_BOTH + \ CMAKE_FIND_USE_ + \ CMAKE_REQUIRE_FIND_PACKAGE_ \ COMPONENTS \ CONFIG \ CONFIGS @@ -2927,7 +3413,9 @@ syn keyword cmakeKWfind_package contained \ FALSE \ FIND_PACKAGE_VERSION_FORMAT \ FRAMEWORK + \ GLOBAL \ HINTS + \ HOST \ INCLUDE \ MODULE \ NAMES @@ -2935,6 +3423,7 @@ syn keyword cmakeKWfind_package contained \ NO_CMAKE_BUILDS_PATH \ NO_CMAKE_ENVIRONMENT_PATH \ NO_CMAKE_FIND_ROOT_PATH + \ NO_CMAKE_INSTALL_PREFIX \ NO_CMAKE_PACKAGE_REGISTRY \ NO_CMAKE_PATH \ NO_CMAKE_SYSTEM_PACKAGE_REGISTRY @@ -2944,8 +3433,10 @@ syn keyword cmakeKWfind_package contained \ NO_PACKAGE_ROOT_PATH \ NO_POLICY_SCOPE \ NO_SYSTEM_ENVIRONMENT_PATH + \ OLD \ ONLY_CMAKE_FIND_ROOT_PATH \ OPTIONAL_COMPONENTS + \ PACKAGENAME \ PACKAGE_FIND_NAME \ PACKAGE_FIND_VERSION \ PACKAGE_FIND_VERSION_COMPLETE @@ -2974,60 +3465,92 @@ syn keyword cmakeKWfind_package contained \ PATHS \ PATH_SUFFIXES \ QUIET + \ REGISTRY_VIEW \ REQUIRED \ SET + \ TARGET \ TRUE + \ VALUE \ _CONFIG \ _CONSIDERED_CONFIGS \ _CONSIDERED_VERSIONS \ _DIR \ _FIND_COMPONENTS \ _FIND_QUIETLY + \ _FIND_REGISTRY_VIEW \ _FIND_REQUIRED \ _FIND_REQUIRED_ \ _FIND_VERSION_EXACT \ _FOUND syn keyword cmakeKWfind_path contained + \ BOTH + \ CATEGORY \ CMAKE_FIND_ROOT_PATH_BOTH + \ CMAKE_FIND_USE_ \ DOC \ DVAR \ FALSE + \ FIND_XXX_REGISTRY_VIEW \ HINTS + \ HOST \ INCLUDE + \ MATCHES \ NAMES + \ NOT + \ NO_CACHE \ NO_CMAKE_ENVIRONMENT_PATH \ NO_CMAKE_FIND_ROOT_PATH + \ NO_CMAKE_INSTALL_PREFIX \ NO_CMAKE_PATH \ NO_CMAKE_SYSTEM_PATH \ NO_DEFAULT_PATH \ NO_PACKAGE_ROOT_PATH \ NO_SYSTEM_ENVIRONMENT_PATH \ ONLY_CMAKE_FIND_ROOT_PATH + \ PACKAGENAME + \ PARENT_SCOPE \ PATHS \ PATH_SUFFIXES + \ REGISTRY_VIEW \ REQUIRED + \ TARGET + \ VALIDATOR \ VAR syn keyword cmakeKWfind_program contained + \ BOTH + \ CATEGORY \ CMAKE_FIND_ROOT_PATH_BOTH + \ CMAKE_FIND_USE_ \ DOC \ DVAR \ FALSE + \ FIND_XXX_REGISTRY_VIEW \ HINTS + \ HOST + \ MATCHES \ NAMES \ NAMES_PER_DIR + \ NOT + \ NO_CACHE \ NO_CMAKE_ENVIRONMENT_PATH \ NO_CMAKE_FIND_ROOT_PATH + \ NO_CMAKE_INSTALL_PREFIX \ NO_CMAKE_PATH \ NO_CMAKE_SYSTEM_PATH \ NO_DEFAULT_PATH \ NO_PACKAGE_ROOT_PATH \ NO_SYSTEM_ENVIRONMENT_PATH \ ONLY_CMAKE_FIND_ROOT_PATH + \ PACKAGENAME + \ PARENT_SCOPE \ PATHS \ PATH_SUFFIXES + \ REGISTRY_VIEW \ REQUIRED + \ TARGET + \ VALIDATOR \ VAR syn keyword cmakeKWfltk_wrap_ui contained @@ -3070,17 +3593,19 @@ syn keyword cmakeKWget_filename_component contained \ NAME \ NAME_WE \ NAME_WLE - \ PATH \ PROGRAM \ PROGRAM_ARGS + \ QUERY \ REALPATH \ REAL_PATH + \ WINDOWS_REGISTRY syn keyword cmakeKWget_property contained \ BRIEF_DOCS \ DEFINED \ DIRECTORY \ FULL_DOCS + \ GENERATED \ GLOBAL \ INSTALL \ PROPERTY @@ -3093,6 +3618,7 @@ syn keyword cmakeKWget_property contained syn keyword cmakeKWget_source_file_property contained \ DIRECTORY + \ GENERATED \ INHERITED \ LOCATION \ TARGET_DIRECTORY @@ -3109,6 +3635,7 @@ syn keyword cmakeKWif contained \ CMAKE_MATCH_ \ CMP \ COMMAND + \ COMPARE \ DEFINED \ EQUAL \ EXISTS @@ -3128,6 +3655,7 @@ syn keyword cmakeKWif contained \ NOT \ OFF \ OR + \ PATH_EQUAL \ POLICY \ STREQUAL \ STRGREATER @@ -3172,11 +3700,14 @@ syn keyword cmakeKWinclude_guard contained syn keyword cmakeKWinstall contained \ AFTER \ AIX + \ ALL_COMPONENTS \ APT \ ARCHIVE \ BEFORE \ BUILD_TYPE \ BUNDLE + \ BUNDLE_EXECUTABLE + \ CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API \ CMAKE_INSTALL_BINDIR \ CMAKE_INSTALL_DATADIR \ CMAKE_INSTALL_DATAROOTDIR @@ -3187,6 +3718,7 @@ syn keyword cmakeKWinstall contained \ CMAKE_INSTALL_LOCALEDIR \ CMAKE_INSTALL_LOCALSTATEDIR \ CMAKE_INSTALL_MANDIR + \ CMAKE_INSTALL_MODE \ CMAKE_INSTALL_RUNSTATEDIR \ CMAKE_INSTALL_SBINDIR \ CMAKE_INSTALL_SHARESTATEDIR @@ -3195,6 +3727,8 @@ syn keyword cmakeKWinstall contained \ COMPONENT \ CONFIGURATIONS \ CVS + \ CXX_MODULES_BMI + \ CXX_MODULES_DIRECTORY \ DATA \ DATAROOT \ DBUILD_TYPE @@ -3207,6 +3741,7 @@ syn keyword cmakeKWinstall contained \ DOC \ ENABLE_EXPORTS \ EXCLUDE_FROM_ALL + \ EXECUTABLES \ EXPORT \ EXPORT_ANDROID_MK \ EXPORT_LINK_INTERFACE_LIBRARIES @@ -3214,14 +3749,18 @@ syn keyword cmakeKWinstall contained \ FILES \ FILES_MATCHING \ FILE_PERMISSIONS + \ FILE_SET \ FRAMEWORK + \ GET_RUNTIME_DEPENDENCIES \ GROUP_EXECUTE \ GROUP_READ \ GROUP_WRITE - \ IMPORTED_ + \ HEADERS + \ IMPORTED_RUNTIME_ARTIFACTS \ INCLUDES \ INFO \ INSTALL_PREFIX + \ INTERFACE \ INTERFACE_INCLUDE_DIRECTORIES \ LIBRARY \ LOCALE @@ -3241,18 +3780,24 @@ syn keyword cmakeKWinstall contained \ OWNER_WRITE \ PATTERN \ PERMISSIONS + \ POST_EXCLUDE_FILES + \ POST_EXCLUDE_REGEXES + \ POST_INCLUDE_FILES + \ POST_INCLUDE_REGEXES \ POST_INSTALL_SCRIPT + \ PRE_EXCLUDE_REGEXES + \ PRE_INCLUDE_REGEXES \ PRE_INSTALL_SCRIPT \ PRIVATE_HEADER \ PROGRAMS \ PROPERTIES \ PUBLIC_HEADER - \ REGEX \ RENAME \ RESOURCE \ RPM \ RUNSTATE - \ RUNTIME + \ RUNTIME_DEPENDENCIES + \ RUNTIME_DEPENDENCY_SET \ SBIN \ SCRIPT \ SETGID @@ -3333,6 +3878,11 @@ syn keyword cmakeKWlist contained \ TOLOWER \ TOUPPER \ TRANSFORM + \ TRANSFORM_APPEND + \ TRANSFORM_GENEX_STRIP + \ TRANSFORM_REPLACE + \ TRANSFORM_STRIP + \ TRANSFORM_TOLOWER syn keyword cmakeKWload_cache contained \ EXCLUDE @@ -3370,10 +3920,15 @@ syn keyword cmakeKWmessage contained \ CHECK_FAIL \ CHECK_PASS \ CHECK_START + \ CONFIGURE_LOG \ DEBUG + \ DEFINED \ DEPRECATION \ FATAL_ERROR + \ GET_MESSAGE_LOG_LEVEL \ GUI + \ INTERNAL + \ MY_CHECK_RESULT \ NOTICE \ POP_BACK \ SEND_ERROR @@ -3384,10 +3939,13 @@ syn keyword cmakeKWmessage contained syn keyword cmakeKWoption contained \ OFF - \ ON syn keyword cmakeKWproject contained \ ASM + \ ASM_MARMASM + \ ASM_MASM + \ ASM_NASM + \ ATT \ CMAKE_PROJECT_ \ CUDA \ DESCRIPTION @@ -3405,6 +3963,7 @@ syn keyword cmakeKWproject contained \ _DESCRIPTION \ _HOMEPAGE_URL \ _INCLUDE_BEFORE + \ _IS_TOP_LEVEL \ _SOURCE_DIR \ _VERSION \ _VERSION_MAJOR @@ -3424,6 +3983,11 @@ syn keyword cmakeKWremove contained syn keyword cmakeKWreturn contained \ DEFER + \ PARENT_SCOPE + \ PROPAGATE + \ SCOPE_FOR + \ VARIABLES + \ VERSION syn keyword cmakeKWseparate_arguments contained \ MSDN @@ -3439,10 +4003,13 @@ syn keyword cmakeKWset contained \ FORCE \ INTERNAL \ OFF + \ OLD \ ON \ PARENT_SCOPE + \ PROPAGATE \ STRING \ STRINGS + \ VAR syn keyword cmakeKWset_directory_properties contained \ DIRECTORY @@ -3452,9 +4019,11 @@ syn keyword cmakeKWset_property contained \ APPEND \ APPEND_STRING \ DIRECTORY + \ GENERATED \ GLOBAL \ INHERITED \ INSTALL + \ NAME \ PROPERTY \ SOURCE \ TARGET @@ -3464,17 +4033,17 @@ syn keyword cmakeKWset_property contained syn keyword cmakeKWset_source_files_properties contained \ DIRECTORY + \ GENERATED \ PROPERTIES \ SOURCE \ TARGET_DIRECTORY syn keyword cmakeKWset_target_properties contained \ PROPERTIES - \ TARGET syn keyword cmakeKWset_tests_properties contained + \ NAME \ PROPERTIES - \ TEST syn keyword cmakeKWsite_name contained \ HOSTNAME @@ -3506,9 +4075,9 @@ syn keyword cmakeKWstring contained \ GUID \ HASH \ HEX + \ ISO \ JOIN \ JSON - \ JSONLENGTH \ LENGTH \ LESS \ LESS_EQUAL @@ -3573,7 +4142,10 @@ syn keyword cmakeKWtarget_compile_features contained syn keyword cmakeKWtarget_compile_options contained \ ALIAS \ BEFORE + \ CMAKE_ + \ COMPILE_LANGUAGE \ COMPILE_OPTIONS + \ CONFIG \ IMPORTED \ INTERFACE \ INTERFACE_COMPILE_OPTIONS @@ -3581,8 +4153,11 @@ syn keyword cmakeKWtarget_compile_options contained \ PUBLIC \ SHELL \ UNIX_COMMAND + \ _FLAGS + \ _FLAGS_ syn keyword cmakeKWtarget_include_directories contained + \ AFTER \ ALIAS \ BEFORE \ BUILD_INTERFACE @@ -3619,6 +4194,7 @@ syn keyword cmakeKWtarget_link_libraries contained \ IMPORTED_NO_SONAME \ INTERFACE \ INTERFACE_LINK_LIBRARIES + \ LINK_FLAGS \ LINK_INTERFACE_LIBRARIES \ LINK_INTERFACE_LIBRARIES_DEBUG \ LINK_INTERFACE_MULTIPLICITY @@ -3631,16 +4207,17 @@ syn keyword cmakeKWtarget_link_libraries contained \ PUBLIC \ SHARED \ STATIC + \ TARGET_OBJECTS syn keyword cmakeKWtarget_link_options contained \ ALIAS \ BEFORE \ CMAKE_ + \ CONFIG \ CUDA_RESOLVE_DEVICE_SYMBOLS \ CUDA_SEPARABLE_COMPILATION \ DEVICE_LINK \ GCC - \ GNU \ HOST_LINK \ IMPORTED \ INTERFACE @@ -3653,6 +4230,8 @@ syn keyword cmakeKWtarget_link_options contained \ SHELL \ STATIC_LIBRARY_OPTIONS \ UNIX_COMMAND + \ _FLAGS + \ _FLAGS_ \ _LINKER_WRAPPER_FLAG \ _LINKER_WRAPPER_FLAG_SEP @@ -3677,15 +4256,46 @@ syn keyword cmakeKWtarget_precompile_headers contained syn keyword cmakeKWtarget_sources contained \ ALIAS + \ BASE_DIRS + \ BUILD_INTERFACE + \ CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API + \ CONFIG + \ CORRECT + \ CXX_MODULES + \ CXX_MODULE_DIRS + \ CXX_MODULE_DIRS_ + \ CXX_MODULE_SETS + \ CXX_MODULE_SET_ + \ EXPORT + \ FILES + \ FILE_SET + \ FRAMEWORK + \ HEADERS + \ HEADER_DIRS + \ HEADER_DIRS_ + \ HEADER_FILE_ONLY + \ HEADER_SETS + \ HEADER_SET_ \ IMPORTED + \ INCLUDE_DIRECTORIES \ INTERFACE + \ INTERFACE_CXX_MODULE_SETS + \ INTERFACE_HEADER_SETS + \ INTERFACE_INCLUDE_DIRECTORIES \ INTERFACE_SOURCES + \ NAME \ PRIVATE \ PUBLIC \ SOURCES + \ SOURCE_DIR + \ TARGETS + \ TRUE + \ TYPE + \ WRONG syn keyword cmakeKWtry_compile contained \ ALL_BUILD + \ BINARY_DIR \ CMAKE_FLAGS \ COMPILE_DEFINITIONS \ COPY_FILE @@ -3713,8 +4323,11 @@ syn keyword cmakeKWtry_compile contained \ LINK_DIRECTORIES \ LINK_LIBRARIES \ LINK_OPTIONS + \ LOG_DESCRIPTION \ MULTI \ NOT + \ NO_CACHE + \ NO_LOG \ OBJCXX_EXTENSIONS \ OBJCXX_STANDARD \ OBJCXX_STANDARD_REQUIRED @@ -3723,9 +4336,16 @@ syn keyword cmakeKWtry_compile contained \ OBJC_STANDARD_REQUIRED \ OUTPUT_VARIABLE \ PRIVATE + \ PROJECT + \ RESULTVAR \ SOURCES + \ SOURCE_DIR + \ SOURCE_FROM_CONTENT + \ SOURCE_FROM_FILE + \ SOURCE_FROM_VAR \ STATIC_LIBRARY \ STATIC_LIBRARY_OPTIONS + \ TARGET \ TRUE \ TYPE \ VALUE @@ -3738,18 +4358,28 @@ syn keyword cmakeKWtry_run contained \ CMAKE_FLAGS \ COMPILE_DEFINITIONS \ COMPILE_OUTPUT_VARIABLE - \ DLINK_LIBRARIES - \ DVAR + \ COPY_FILE + \ COPY_FILE_ERROR \ FAILED_TO_RUN \ FALSE - \ INCLUDE_DIRECTORIES - \ LINK_DIRECTORIES + \ LANG \ LINK_LIBRARIES \ LINK_OPTIONS + \ LOG_DESCRIPTION + \ NO_CACHE + \ NO_LOG + \ RUN_OUTPUT_STDERR_VARIABLE + \ RUN_OUTPUT_STDOUT_VARIABLE \ RUN_OUTPUT_VARIABLE + \ SOURCES + \ SOURCE_FROM_CONTENT + \ SOURCE_FROM_FILE + \ SOURCE_FROM_VAR \ TRUE - \ TYPE - \ VALUE + \ WORKING_DIRECTORY + \ _EXTENSIONS + \ _STANDARD + \ _STANDARD_REQUIRED \ __TRYRUN_OUTPUT syn keyword cmakeKWunset contained @@ -3783,26 +4413,38 @@ syn keyword cmakeKWwrite_file contained syn keyword cmakeGeneratorExpressions contained - \ AND + \ ABSOLUTE_PATH + \ ACTION + \ AIX \ ANGLE + \ APPEND \ ARCHIVE_OUTPUT_NAME \ ARCHIVE_OUTPUT_NAME_ + \ ASCENDING \ BAR \ BOOL \ BUILD_INTERFACE - \ CMAKE_ - \ COMMA - \ COMMAND + \ BUILD_LOCAL_INTERFACE + \ CMAKE_LINK_GROUP_USING_ + \ CMAKE_LINK_LIBRARY_USING_ + \ CMAKE_PATH + \ CODE + \ COMMAND_CONFIG + \ COMMAND_EXPAND_LISTS + \ COMPARE \ COMPILE_DEFINITIONS \ COMPILE_FEATURES \ COMPILE_LANGUAGE \ COMPILE_LANG_AND_ID + \ COMPILE_ONLY \ COMPILING_CUDA + \ COMPILING_CXX \ COMPILING_CXX_WITH_CLANG \ COMPILING_CXX_WITH_INTEL \ COMPILING_C_WITH_CLANG \ CONFIG \ CONFIGURATION + \ CONTENT \ CUDA_COMPILER_ID \ CUDA_COMPILER_VERSION \ CUDA_RESOLVE_DEVICE_SYMBOLS @@ -3817,71 +4459,146 @@ syn keyword cmakeGeneratorExpressions contained \ C_STANDARD \ DEBUG_MODE \ DEBUG_POSTFIX + \ DENABLE_SOME_FEATURE + \ DESCENDING \ DEVICE_LINK \ DLL + \ ENABLE_EXPORTS \ EXCLUDE \ EXPORT + \ EXTENSION_DEF \ FALSE + \ FILENAME_DEF + \ FILE_BASENAME \ FILTER + \ FIND \ FOO_EXTRA_THINGS \ GENERATE \ GENEX_EVAL - \ GNU + \ GET_EXTENSION + \ GET_FILENAME + \ GET_PARENT_PATH + \ GET_RELATIVE_PART + \ GET_ROOT_DIRECTORY + \ GET_ROOT_NAME + \ GET_ROOT_PATH + \ GET_STEM + \ HAS_ + \ HAS_EXTENSION + \ HAS_FILENAME + \ HAS_PARENT_PATH + \ HAS_RELATIVE_PART + \ HAS_ROOT_DIRECTORY + \ HAS_ROOT_NAME + \ HAS_ROOT_PATH + \ HAS_STEM + \ HAVE_SOME_FEATURE \ HIP_COMPILER_ID \ HIP_COMPILER_VERSION \ HIP_STANDARD \ HOST_LINK \ IF \ IGNORE + \ IMPORTED_LOCATION \ IMPORT_PREFIX \ IMPORT_SUFFIX \ INCLUDE_DIRECTORIES + \ INSENSITIVE + \ INSERT \ INSTALL_INTERFACE \ INSTALL_NAME_DIR \ INSTALL_PREFIX - \ INTERFACE + \ INSTALL_RPATH \ INTERFACE_LINK_LIBRARIES + \ INTERFACE_LINK_LIBRARIES_DIRECT \ IN_LIST \ ISPC_COMPILER_ID \ ISPC_COMPILER_VERSION + \ IS_ABSOLUTE + \ IS_PREFIX + \ IS_RELATIVE \ JOIN \ LANG \ LANG_COMPILER_ID + \ LAST_ONLY + \ LENGTH \ LIBRARY_OUTPUT_NAME \ LIBRARY_OUTPUT_NAME_ + \ LINK_GROUP + \ LINK_GROUP_PREDEFINED_FEATURES \ LINK_LANGUAGE \ LINK_LANG_AND_ID \ LINK_LIBRARIES + \ LINK_LIBRARY + \ LINK_LIBRARY_OVERRIDE + \ LINK_LIBRARY_OVERRIDE_ + \ LINK_LIBRARY_PREDEFINED_FEATURES \ LINK_ONLY \ LOWER_CASE \ MAKE_C_IDENTIFIER \ MAP_IMPORTED_CONFIG_ + \ MODULE + \ NATURAL \ NO + \ NORMALIZE + \ NORMAL_PATH \ NOT \ OBJCXX_COMPILER_ID \ OBJCXX_COMPILER_VERSION \ OBJC_COMPILER_ID \ OBJC_COMPILER_VERSION + \ OBJECT \ OFF \ OLD_COMPILER + \ ORDER + \ OUTPUT + \ OUTPUT_CONFIG \ OUTPUT_NAME \ OUTPUT_NAME_ + \ PATH + \ PATH_EQUAL \ PDB_NAME \ PDB_NAME_ \ PDB_OUTPUT_DIRECTORY \ PDB_OUTPUT_DIRECTORY_ \ PLATFORM_ID + \ POP_BACK + \ POP_FRONT \ POSIX + \ POST_BUILD + \ PREPEND \ PRIVATE \ PUBLIC + \ REGEX + \ RELATIVE_PATH + \ REMOVE_AT \ REMOVE_DUPLICATES + \ REMOVE_EXTENSION + \ REMOVE_FILENAME + \ REMOVE_ITEM + \ REPLACE + \ REPLACE_EXTENSION + \ REPLACE_FILENAME + \ REQUIRED + \ RESCAN + \ REVERSE + \ RPATH + \ RUNTIME_DEPENDENCY_SET \ RUNTIME_OUTPUT_NAME \ RUNTIME_OUTPUT_NAME_ + \ SCRIPT \ SDK + \ SELECTOR \ SEMICOLON + \ SENSITIVE + \ SHARED \ SHELL_PATH + \ SORT \ STATIC \ STREQUAL + \ STRING + \ STRIP + \ SUBLIST \ TARGET_BUNDLE_CONTENT_DIR \ TARGET_BUNDLE_DIR \ TARGET_BUNDLE_DIR_NAME @@ -3893,12 +4610,30 @@ syn keyword cmakeGeneratorExpressions contained \ TARGET_FILE_PREFIX \ TARGET_FILE_SUFFIX \ TARGET_GENEX_EVAL + \ TARGET_IMPORT_FILE + \ TARGET_IMPORT_FILE_BASE_NAME + \ TARGET_IMPORT_FILE_DIR + \ TARGET_IMPORT_FILE_NAME + \ TARGET_IMPORT_FILE_PREFIX + \ TARGET_IMPORT_FILE_SUFFIX \ TARGET_LINKER_FILE \ TARGET_LINKER_FILE_BASE_NAME \ TARGET_LINKER_FILE_DIR \ TARGET_LINKER_FILE_NAME \ TARGET_LINKER_FILE_PREFIX \ TARGET_LINKER_FILE_SUFFIX + \ TARGET_LINKER_IMPORT_FILE + \ TARGET_LINKER_IMPORT_FILE_BASE_NAME + \ TARGET_LINKER_IMPORT_FILE_DIR + \ TARGET_LINKER_IMPORT_FILE_NAME + \ TARGET_LINKER_IMPORT_FILE_PREFIX + \ TARGET_LINKER_IMPORT_FILE_SUFFIX + \ TARGET_LINKER_LIBRARY_FILE + \ TARGET_LINKER_LIBRARY_FILE_BASE_NAME + \ TARGET_LINKER_LIBRARY_FILE_DIR + \ TARGET_LINKER_LIBRARY_FILE_NAME + \ TARGET_LINKER_LIBRARY_FILE_PREFIX + \ TARGET_LINKER_LIBRARY_FILE_SUFFIX \ TARGET_NAME_IF_EXISTS \ TARGET_OBJECTS \ TARGET_PDB_FILE @@ -3907,16 +4642,34 @@ syn keyword cmakeGeneratorExpressions contained \ TARGET_PDB_FILE_NAME \ TARGET_POLICY \ TARGET_PROPERTY + \ TARGET_RUNTIME_DLLS + \ TARGET_RUNTIME_DLL_DIRS \ TARGET_SONAME_FILE \ TARGET_SONAME_FILE_DIR \ TARGET_SONAME_FILE_NAME + \ TARGET_SONAME_IMPORT_FILE + \ TARGET_SONAME_IMPORT_FILE_DIR + \ TARGET_SONAME_IMPORT_FILE_NAME + \ TOLOWER + \ TOUPPER + \ TRANSFORM + \ TRANSFORM_APPEND + \ TRANSFORM_REPLACE + \ TRANSFORM_STRIP + \ TRANSFORM_TOLOWER + \ UNKNOWN \ UPPER_CASE + \ VERBATIM \ VERSION_EQUAL - \ VERSION_GREATER \ VERSION_GREATER_EQUAL \ VERSION_LESS \ VERSION_LESS_EQUAL + \ WHOLE_ARCHIVE + \ WRONG + \ _LINK_GROUP_USING_ + \ _LINK_LIBRARY_USING_ \ _POSTFIX + \ _SUPPORTED syn case ignore @@ -3936,6 +4689,7 @@ syn keyword cmakeCommand \ block \ break \ build_command + \ cmake_file_api \ cmake_host_system_information \ cmake_language \ cmake_minimum_required @@ -4085,6 +4839,7 @@ hi def link cmakeVariableValue Type hi def link cmakeVariable Identifier hi def link cmakeKWExternalProject ModeMsg +hi def link cmakeKWFetchContent ModeMsg hi def link cmakeKWadd_compile_definitions ModeMsg hi def link cmakeKWadd_compile_options ModeMsg hi def link cmakeKWadd_custom_command ModeMsg @@ -4096,7 +4851,9 @@ hi def link cmakeKWadd_library ModeMsg hi def link cmakeKWadd_link_options ModeMsg hi def link cmakeKWadd_subdirectory ModeMsg hi def link cmakeKWadd_test ModeMsg +hi def link cmakeKWblock ModeMsg hi def link cmakeKWbuild_command ModeMsg +hi def link cmakeKWcmake_file_api ModeMsg hi def link cmakeKWcmake_host_system_information ModeMsg hi def link cmakeKWcmake_language ModeMsg hi def link cmakeKWcmake_minimum_required ModeMsg diff --git a/CMakeLists.txt b/CMakeLists.txt index d559c08..2823ca4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ # Distributed under the OSI-approved BSD 3-Clause License. See accompanying # file Copyright.txt or https://cmake.org/licensing for details. -cmake_minimum_required(VERSION 3.13...3.25 FATAL_ERROR) +cmake_minimum_required(VERSION 3.13...3.26 FATAL_ERROR) set(CMAKE_USER_MAKE_RULES_OVERRIDE_C ${CMAKE_CURRENT_SOURCE_DIR}/Source/Modules/OverrideC.cmake) set(CMAKE_USER_MAKE_RULES_OVERRIDE_CXX ${CMAKE_CURRENT_SOURCE_DIR}/Source/Modules/OverrideCXX.cmake) @@ -131,6 +131,8 @@ if(CMake_BUILD_LTO) endif() endif() +option(CMake_BUILD_PCH "Compile CMake with precompiled headers" OFF) + # Check whether to build support for the debugger mode. if(NOT CMake_TEST_EXTERNAL_CMAKE) if(NOT DEFINED CMake_ENABLE_DEBUGGER) @@ -153,7 +155,6 @@ endif() # simply to improve readability of the main script #----------------------------------------------------------------------- macro(CMAKE_HANDLE_SYSTEM_LIBRARIES) - # Options have dependencies. include(CMakeDependentOption) # Allow the user to enable/disable all system utility library options by @@ -324,6 +325,9 @@ configure_file(.clang-tidy .clang-tidy COPYONLY) option(CMake_RUN_IWYU "Run include-what-you-use with the compiler." OFF) if(CMake_RUN_IWYU) + if(CMake_BUILD_PCH) + message(FATAL_ERROR "CMake_RUN_IWYU and CMake_BUILD_PCH are ON, but they are incompatible!") + endif() find_program(IWYU_COMMAND NAMES include-what-you-use iwyu) if(NOT IWYU_COMMAND) message(FATAL_ERROR "CMake_RUN_IWYU is ON but include-what-you-use is not found!") diff --git a/Help/command/add_custom_command.rst b/Help/command/add_custom_command.rst index f1be309..c305cc2 100644 --- a/Help/command/add_custom_command.rst +++ b/Help/command/add_custom_command.rst @@ -24,6 +24,7 @@ The first signature is for adding a custom command to produce an output: [COMMENT comment] [DEPFILE depfile] [JOB_POOL job_pool] + [JOB_SERVER_AWARE <bool>] [VERBATIM] [APPEND] [USES_TERMINAL] [COMMAND_EXPAND_LISTS] [DEPENDS_EXPLICIT_ONLY]) @@ -221,6 +222,19 @@ The options are: Using a pool that is not defined by :prop_gbl:`JOB_POOLS` causes an error by ninja at build time. +``JOB_SERVER_AWARE`` + .. versionadded:: 3.28 + + Specify that the command is GNU Make job server aware. + + For the :generator:`Unix Makefiles`, :generator:`MSYS Makefiles`, and + :generator:`MinGW Makefiles` generators this will add the ``+`` prefix to the + recipe line. See the `GNU Make Documentation`_ for more information. + + This option is silently ignored by other generators. + +.. _`GNU Make Documentation`: https://www.gnu.org/software/make/manual/html_node/MAKE-Variable.html + ``MAIN_DEPENDENCY`` Specify the primary input source file to the command. This is treated just like any value given to the ``DEPENDS`` option @@ -512,7 +526,7 @@ one of the keywords to make clear the behavior they expect. Because generator expressions can be used in custom commands, it is possible to define ``COMMAND`` lines or whole custom commands which evaluate to empty strings for certain configurations. - For **Visual Studio 11 2012 (and newer)** generators these command + For **Visual Studio 12 2013 (and newer)** generators these command lines or custom commands will be omitted for the specific configuration and no "empty-string-command" will be added. diff --git a/Help/command/add_custom_target.rst b/Help/command/add_custom_target.rst index 545b9a5..ef0c8d9 100644 --- a/Help/command/add_custom_target.rst +++ b/Help/command/add_custom_target.rst @@ -12,6 +12,7 @@ Add a target with no output so it will always be built. [WORKING_DIRECTORY dir] [COMMENT comment] [JOB_POOL job_pool] + [JOB_SERVER_AWARE <bool>] [VERBATIM] [USES_TERMINAL] [COMMAND_EXPAND_LISTS] [SOURCES src1 [src2...]]) @@ -146,6 +147,19 @@ The options are: Using a pool that is not defined by :prop_gbl:`JOB_POOLS` causes an error by ninja at build time. +``JOB_SERVER_AWARE`` + .. versionadded:: 3.28 + + Specify that the command is GNU Make job server aware. + + For the :generator:`Unix Makefiles`, :generator:`MSYS Makefiles`, and + :generator:`MinGW Makefiles` generators this will add the ``+`` prefix to the + recipe line. See the `GNU Make Documentation`_ for more information. + + This option is silently ignored by other generators. + +.. _`GNU Make Documentation`: https://www.gnu.org/software/make/manual/html_node/MAKE-Variable.html + ``SOURCES`` Specify additional source files to be included in the custom target. Specified source files will be added to IDE project files for diff --git a/Help/command/exec_program.rst b/Help/command/exec_program.rst index 983a6df..6010176 100644 --- a/Help/command/exec_program.rst +++ b/Help/command/exec_program.rst @@ -1,6 +1,10 @@ exec_program ------------ +.. versionchanged:: 3.28 + This command is available only if policy :policy:`CMP0153` is not set to ``NEW``. + Port projects to the :command:`execute_process` command. + .. deprecated:: 3.0 Use the :command:`execute_process` command instead. diff --git a/Help/command/file.rst b/Help/command/file.rst index 30a7f4d..f9d1a79 100644 --- a/Help/command/file.rst +++ b/Help/command/file.rst @@ -981,6 +981,11 @@ Path Conversion if ``USERPROFILE`` is not defined. On all other platforms, only ``HOME`` is used. + .. versionchanged:: 3.28 + + All symlinks are resolved before collapsing ``../`` components. + See policy :policy:`CMP0152`. + .. signature:: file(RELATIVE_PATH <variable> <directory> <file>) diff --git a/Help/command/find_library.rst b/Help/command/find_library.rst index 99e36a4..fb2c2f1 100644 --- a/Help/command/find_library.rst +++ b/Help/command/find_library.rst @@ -60,6 +60,10 @@ path to the framework ``<fullPath>/A.framework``. When a full path to a framework is used as a library, CMake will use a ``-framework A``, and a ``-F<fullPath>`` to link the framework to the target. +.. versionadded:: 3.28 + + The library found can now be a ``.xcframework`` folder. + If the :variable:`CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX` variable is set all search paths will be tested as normal, with the suffix appended, and with all matches of ``lib/`` replaced with diff --git a/Help/command/set_tests_properties.rst b/Help/command/set_tests_properties.rst index 125e460..1df9d73 100644 --- a/Help/command/set_tests_properties.rst +++ b/Help/command/set_tests_properties.rst @@ -20,4 +20,4 @@ See Also * :command:`add_test` * :command:`define_property` * the more general :command:`set_property` command -* :ref:`Target Properties` for the list of properties known to CMake +* :ref:`Test Properties` for the list of properties known to CMake diff --git a/Help/command/target_link_libraries.rst b/Help/command/target_link_libraries.rst index 1d27660..cc6bc0f 100644 --- a/Help/command/target_link_libraries.rst +++ b/Help/command/target_link_libraries.rst @@ -66,6 +66,12 @@ Each ``<item>`` may be: :ref:`usage requirement <Target Usage Requirements>`. This has the same effect as passing the framework directory as an include directory. + .. versionadded:: 3.28 + + The library file may point to a ``.xcframework`` folder on macOS. If it + does, the target will get the selected library's ``Headers`` directory as + a usage requirement. + .. versionadded:: 3.8 On :ref:`Visual Studio Generators` for VS 2010 and above, library files ending in ``.targets`` will be treated as MSBuild targets files and diff --git a/Help/dev/experimental.rst b/Help/dev/experimental.rst index eac86ab..7328d7b 100644 --- a/Help/dev/experimental.rst +++ b/Help/dev/experimental.rst @@ -18,7 +18,7 @@ C++20 Module APIs ================= Variable: ``CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API`` -Value: ``aa1f7df0-828a-4fcd-9afc-2dc80491aca7`` +Value: ``bf70d4b0-9fb7-465c-9803-34014e70d112`` In order to support C++20 modules, there are a number of behaviors that have CMake APIs to provide the required features to build and export them from a diff --git a/Help/envvar/CMAKE_CROSSCOMPILING_EMULATOR.rst b/Help/envvar/CMAKE_CROSSCOMPILING_EMULATOR.rst new file mode 100644 index 0000000..3e397d8 --- /dev/null +++ b/Help/envvar/CMAKE_CROSSCOMPILING_EMULATOR.rst @@ -0,0 +1,11 @@ +CMAKE_CROSSCOMPILING_EMULATOR +----------------------------- + +.. versionadded:: 3.28 + +.. include:: ENV_VAR.txt + +The default value for :variable:`CMAKE_CROSSCOMPILING_EMULATOR` when there +is no explicit configuration given on the first run while creating a new +build tree. On later runs in an existing build tree the value persists in +the cache as :variable:`CMAKE_CROSSCOMPILING_EMULATOR`. diff --git a/Help/generator/Visual Studio 10 2010.rst b/Help/generator/Visual Studio 10 2010.rst index 888164f..a36046a 100644 --- a/Help/generator/Visual Studio 10 2010.rst +++ b/Help/generator/Visual Studio 10 2010.rst @@ -3,6 +3,6 @@ Visual Studio 10 2010 Removed. This once generated Visual Studio 10 2010 project files, but the generator has been removed since CMake 3.25. It is still possible -to build with VS 10 2010 tools using the :generator:`Visual Studio 12 2013` +to build with VS 10 2010 tools using the :generator:`Visual Studio 14 2015` (or above) generator with :variable:`CMAKE_GENERATOR_TOOLSET` set to ``v100``, or by using the :generator:`NMake Makefiles` generator. diff --git a/Help/generator/Visual Studio 11 2012.rst b/Help/generator/Visual Studio 11 2012.rst index 4e7195c..5ded24c 100644 --- a/Help/generator/Visual Studio 11 2012.rst +++ b/Help/generator/Visual Studio 11 2012.rst @@ -1,57 +1,8 @@ Visual Studio 11 2012 --------------------- -Deprecated. Generates Visual Studio 11 (VS 2012) project files. - -.. note:: - This generator is deprecated and will be removed in a future version - of CMake. It will still be possible to build with VS 11 2012 tools - using the :generator:`Visual Studio 12 2013` (or above) generator - with :variable:`CMAKE_GENERATOR_TOOLSET` set to ``v110``, or by - using the :generator:`NMake Makefiles` generator. - -For compatibility with CMake versions prior to 3.0, one may specify this -generator using the name "Visual Studio 11" without the year component. - -Project Types -^^^^^^^^^^^^^ - -Only Visual C++ and C# projects may be generated (and Fortran with -Intel compiler integration). Other types of projects (JavaScript, -Database, Website, etc.) are not supported. - -Platform Selection -^^^^^^^^^^^^^^^^^^ - -The default target platform name (architecture) is ``Win32``. - -.. versionadded:: 3.1 - The :variable:`CMAKE_GENERATOR_PLATFORM` variable may be set, perhaps - via the :option:`cmake -A` option, to specify a target platform - name (architecture). For example: - - * ``cmake -G "Visual Studio 11 2012" -A Win32`` - * ``cmake -G "Visual Studio 11 2012" -A x64`` - * ``cmake -G "Visual Studio 11 2012" -A ARM`` - * ``cmake -G "Visual Studio 11 2012" -A <WinCE-SDK>`` - (Specify a target platform matching a Windows CE SDK name.) - -For compatibility with CMake versions prior to 3.1, one may specify -a target platform name optionally at the end of the generator name. -This is supported only for: - -``Visual Studio 11 2012 Win64`` - Specify target platform ``x64``. - -``Visual Studio 11 2012 ARM`` - Specify target platform ``ARM``. - -``Visual Studio 11 2012 <WinCE-SDK>`` - Specify target platform matching a Windows CE SDK name. - -Toolset Selection -^^^^^^^^^^^^^^^^^ - -The ``v110`` toolset that comes with Visual Studio 11 2012 is selected by -default. The :variable:`CMAKE_GENERATOR_TOOLSET` option may be set, perhaps -via the :option:`cmake -T` option, to specify another toolset. +Removed. This once generated Visual Studio 11 2012 project files, but +the generator has been removed since CMake 3.28. It is still possible +to build with VS 11 2012 tools using the :generator:`Visual Studio 14 2015` +(or above) generator with :variable:`CMAKE_GENERATOR_TOOLSET` set to ``v110``, +or by using the :generator:`NMake Makefiles` generator. diff --git a/Help/generator/Visual Studio 12 2013.rst b/Help/generator/Visual Studio 12 2013.rst index 3dbcfe6..522522c 100644 --- a/Help/generator/Visual Studio 12 2013.rst +++ b/Help/generator/Visual Studio 12 2013.rst @@ -1,7 +1,14 @@ Visual Studio 12 2013 --------------------- -Generates Visual Studio 12 (VS 2013) project files. +Deprecated. Generates Visual Studio 12 (VS 2013) project files. + +.. note:: + This generator is deprecated and will be removed in a future version + of CMake. It will still be possible to build with VS 12 2013 tools + using the :generator:`Visual Studio 14 2015` (or above) generator + with :variable:`CMAKE_GENERATOR_TOOLSET` set to ``v120``, or by + using the :generator:`NMake Makefiles` generator. For compatibility with CMake versions prior to 3.0, one may specify this generator using the name "Visual Studio 12" without the year component. diff --git a/Help/generator/Visual Studio 9 2008.rst b/Help/generator/Visual Studio 9 2008.rst index 816969d..1439270 100644 --- a/Help/generator/Visual Studio 9 2008.rst +++ b/Help/generator/Visual Studio 9 2008.rst @@ -6,7 +6,7 @@ Deprecated. Generates Visual Studio 9 2008 project files. .. note:: This generator is deprecated and will be removed in a future version of CMake. It will still be possible to build with VS 9 2008 tools - using the :generator:`Visual Studio 12 2013` generator (or above, + using the :generator:`Visual Studio 14 2015` generator (or above, and with VS 10 2010 also installed) with :variable:`CMAKE_GENERATOR_TOOLSET` set to ``v90``, or by using the :generator:`NMake Makefiles` generator. diff --git a/Help/guide/tutorial/Adding Generator Expressions.rst b/Help/guide/tutorial/Adding Generator Expressions.rst index 3dab97f..910eacb 100644 --- a/Help/guide/tutorial/Adding Generator Expressions.rst +++ b/Help/guide/tutorial/Adding Generator Expressions.rst @@ -149,8 +149,8 @@ interface library. Lastly, we only want these warning flags to be used during builds. Consumers of our installed project should not inherit our warning flags. To specify -this, we wrap our flags in a generator expression using the ``BUILD_INTERFACE`` -condition. The resulting full code looks like the following: +this, we wrap our flags from TODO 3 in a generator expression using the +``BUILD_INTERFACE`` condition. The resulting full code looks like the following: .. raw:: html diff --git a/Help/guide/tutorial/Adding Usage Requirements for a Library.rst b/Help/guide/tutorial/Adding Usage Requirements for a Library.rst index 2273063..5e803f5 100644 --- a/Help/guide/tutorial/Adding Usage Requirements for a Library.rst +++ b/Help/guide/tutorial/Adding Usage Requirements for a Library.rst @@ -127,7 +127,7 @@ Remove this line: </details> -And the lines: +And remove ``EXTRA_INCLUDES`` from ``target_include_directories``: .. raw:: html @@ -143,23 +143,6 @@ And the lines: </details> -The remaining code looks like: - -.. raw:: html - - <details><summary>Click to show/hide the resulting code</summary> - -.. literalinclude:: Step4/CMakeLists.txt - :caption: Remaining code after removing EXTRA_INCLUDES - :name: CMakeLists.txt-after-removing-EXTRA_INCLUDES - :language: cmake - :start-after: add_subdirectory(MathFunctions) - -.. raw:: html - - </details> - - Notice that with this technique, the only thing our executable target does to use our library is call :command:`target_link_libraries` with the name of the library target. In larger projects, the classic method of specifying @@ -309,8 +292,8 @@ and this: :caption: TODO 7: MathFunctions/CMakeLists.txt :name: MathFunctions-SqrtLibrary-target_link_libraries-step4 :language: cmake - :start-after: target_link_libraries(SqrtLibrary - :end-before: endif() + :start-after: # link our compiler flags interface library + :end-before: target_link_libraries(MathFunctions PUBLIC SqrtLibrary) .. raw:: html diff --git a/Help/guide/tutorial/Adding a Library.rst b/Help/guide/tutorial/Adding a Library.rst index 694dfaf..178334a 100644 --- a/Help/guide/tutorial/Adding a Library.rst +++ b/Help/guide/tutorial/Adding a Library.rst @@ -96,7 +96,7 @@ a library target called ``MathFunctions`` with :command:`add_library`. The source files for the library are passed as an argument to :command:`add_library`. This looks like the following line: -.. raw:: html/ +.. raw:: html <details><summary>TODO 1: Click to show/hide answer</summary> diff --git a/Help/guide/tutorial/Selecting Static or Shared Libraries.rst b/Help/guide/tutorial/Selecting Static or Shared Libraries.rst index 504e42f..a2f5e2a 100644 --- a/Help/guide/tutorial/Selecting Static or Shared Libraries.rst +++ b/Help/guide/tutorial/Selecting Static or Shared Libraries.rst @@ -44,7 +44,18 @@ SqrtLibrary to be ``True`` when building shared libraries. :caption: MathFunctions/CMakeLists.txt :name: MathFunctions/CMakeLists.txt-POSITION_INDEPENDENT_CODE :language: cmake - :lines: 37-42 + :start-at: # state that SqrtLibrary need PIC when the default is shared libraries + :end-at: ) + +Define ``EXPORTING_MYMATH`` stating we are using ``declspec(dllexport)`` when +building on Windows. + +.. literalinclude:: Step11/MathFunctions/CMakeLists.txt + :caption: MathFunctions/CMakeLists.txt + :name: MathFunctions/CMakeLists.txt-dll-export + :language: cmake + :start-at: # define the symbol stating we are using the declspec(dllexport) when + :end-at: target_compile_definitions(MathFunctions PRIVATE "EXPORTING_MYMATH") **Exercise**: We modified ``MathFunctions.h`` to use dll export defines. Using CMake documentation can you find a helper module to simplify this? diff --git a/Help/manual/cmake-env-variables.7.rst b/Help/manual/cmake-env-variables.7.rst index 197e56e..356e73d 100644 --- a/Help/manual/cmake-env-variables.7.rst +++ b/Help/manual/cmake-env-variables.7.rst @@ -43,6 +43,7 @@ Environment Variables that Control the Build /envvar/CMAKE_COLOR_DIAGNOSTICS /envvar/CMAKE_CONFIGURATION_TYPES /envvar/CMAKE_CONFIG_TYPE + /envvar/CMAKE_CROSSCOMPILING_EMULATOR /envvar/CMAKE_EXPORT_COMPILE_COMMANDS /envvar/CMAKE_GENERATOR /envvar/CMAKE_GENERATOR_INSTANCE diff --git a/Help/manual/cmake-policies.7.rst b/Help/manual/cmake-policies.7.rst index 7c48806..a018aff 100644 --- a/Help/manual/cmake-policies.7.rst +++ b/Help/manual/cmake-policies.7.rst @@ -51,6 +51,15 @@ The :variable:`CMAKE_MINIMUM_REQUIRED_VERSION` variable may also be used to determine whether to report an error on use of deprecated macros or functions. +Policies Introduced by CMake 3.28 +================================= + +.. toctree:: + :maxdepth: 1 + + CMP0153: The exec_program command should not be called. </policy/CMP0153> + CMP0152: file(REAL_PATH) resolves symlinks before collapsing ../ components. </policy/CMP0152> + Policies Introduced by CMake 3.27 ================================= diff --git a/Help/manual/cmake-toolchains.7.rst b/Help/manual/cmake-toolchains.7.rst index a831fa6..e32bd29 100644 --- a/Help/manual/cmake-toolchains.7.rst +++ b/Help/manual/cmake-toolchains.7.rst @@ -573,12 +573,12 @@ See also target properties: * :prop_tgt:`ANDROID_SKIP_ANT_STEP` * :prop_tgt:`ANDROID_STL_TYPE` -.. _`Cross Compiling for iOS, tvOS, or watchOS`: +.. _`Cross Compiling for iOS, tvOS, visionOS, or watchOS`: -Cross Compiling for iOS, tvOS, or watchOS ------------------------------------------ +Cross Compiling for iOS, tvOS, visionOS, or watchOS +--------------------------------------------------- -For cross-compiling to iOS, tvOS, or watchOS, the :generator:`Xcode` +For cross-compiling to iOS, tvOS, visionOS, or watchOS, the :generator:`Xcode` generator is recommended. The :generator:`Unix Makefiles` or :generator:`Ninja` generators can also be used, but they require the project to handle more areas like target CPU selection and code signing. @@ -591,13 +591,14 @@ a different SDK (e.g. a simulator) can be selected by setting the necessary (see :ref:`Switching Between Device and Simulator` below). A list of available SDKs can be obtained by running ``xcodebuild -showsdks``. -======= ================= ==================== ================ -OS CMAKE_SYSTEM_NAME Device SDK (default) Simulator SDK -======= ================= ==================== ================ -iOS iOS iphoneos iphonesimulator -tvOS tvOS appletvos appletvsimulator -watchOS watchOS watchos watchsimulator -======= ================= ==================== ================ +======== ================= ==================== ================ +OS CMAKE_SYSTEM_NAME Device SDK (default) Simulator SDK +======== ================= ==================== ================ +iOS iOS iphoneos iphonesimulator +tvOS tvOS appletvos appletvsimulator +visionOS visionOS xros xrsimulator +watchOS watchOS watchos watchsimulator +======== ================= ==================== ================ For example, to create a CMake configuration for iOS, the following command is sufficient: @@ -608,7 +609,7 @@ command is sufficient: Variable :variable:`CMAKE_OSX_ARCHITECTURES` can be used to set architectures for both device and simulator. Variable :variable:`CMAKE_OSX_DEPLOYMENT_TARGET` -can be used to set an iOS/tvOS/watchOS deployment target. +can be used to set an iOS/tvOS/visionOS/watchOS deployment target. Next configuration will install fat 5 architectures iOS library and add the ``-miphoneos-version-min=9.3``/``-mios-simulator-version-min=9.3`` diff --git a/Help/policy/CMP0152.rst b/Help/policy/CMP0152.rst new file mode 100644 index 0000000..d7e8692 --- /dev/null +++ b/Help/policy/CMP0152.rst @@ -0,0 +1,20 @@ +CMP0152 +------- + +.. versionadded:: 3.28 + +:command:`file(REAL_PATH)` resolves symlinks before collapsing ../ components. + +In CMake 3.27 and below, :command:`file(REAL_PATH)` collapsed any ``../`` +components in a path before resolving symlinks. This produced incorrect +results when the ``../`` collapsed away a symlink. + +The ``OLD`` behavior for this policy is to collapse ``../`` components before +resolving symlinks. +The ``NEW`` behavior for this policy is to resolve all symlinks before +collapsing ``../`` components. + +This policy was introduced in CMake version 3.28. Use the +:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly. + +.. include:: DEPRECATED.txt diff --git a/Help/policy/CMP0153.rst b/Help/policy/CMP0153.rst new file mode 100644 index 0000000..4c9f3dc --- /dev/null +++ b/Help/policy/CMP0153.rst @@ -0,0 +1,12 @@ +CMP0153 +------- + +The :command:`exec_program` command should not be called. + +This command has long been superseded by the :command:`execute_process` +command and has been deprecated since CMake 3.0. + +.. |disallowed_version| replace:: 3.28 +.. include:: DISALLOWED_COMMAND.txt + +.. include:: DEPRECATED.txt diff --git a/Help/prop_gbl/XCODE_EMIT_EFFECTIVE_PLATFORM_NAME.rst b/Help/prop_gbl/XCODE_EMIT_EFFECTIVE_PLATFORM_NAME.rst index 392b704..6794a26 100644 --- a/Help/prop_gbl/XCODE_EMIT_EFFECTIVE_PLATFORM_NAME.rst +++ b/Help/prop_gbl/XCODE_EMIT_EFFECTIVE_PLATFORM_NAME.rst @@ -16,8 +16,8 @@ generator emits the ``EFFECTIVE_PLATFORM_NAME`` variable: - If set to ``ON`` it will always be emitted - If set to ``OFF`` it will never be emitted - If unset (the default) it will only be emitted when the project was - configured for an embedded Xcode SDK like iOS, tvOS, watchOS or any - of the simulators. + configured for an embedded Xcode SDK like iOS, tvOS, visionOS, watchOS + or any of the simulators. .. note:: diff --git a/Help/prop_tgt/DLL_NAME_WITH_SOVERSION.rst b/Help/prop_tgt/DLL_NAME_WITH_SOVERSION.rst index 59ef00f..c86b218 100644 --- a/Help/prop_tgt/DLL_NAME_WITH_SOVERSION.rst +++ b/Help/prop_tgt/DLL_NAME_WITH_SOVERSION.rst @@ -3,8 +3,8 @@ DLL_NAME_WITH_SOVERSION .. versionadded:: 3.27 -This property control whether the :prop_tgt:`SOVERSION` target -property are added to the filename of generated DLL filenames +This property controls whether the :prop_tgt:`SOVERSION` target +property is added to the filename of generated DLL filenames for the Windows platform, which is selected when the :variable:`WIN32` variable is set. diff --git a/Help/prop_tgt/IMPORTED_IMPLIB.rst b/Help/prop_tgt/IMPORTED_IMPLIB.rst index e67acba..27601d2 100644 --- a/Help/prop_tgt/IMPORTED_IMPLIB.rst +++ b/Help/prop_tgt/IMPORTED_IMPLIB.rst @@ -11,6 +11,12 @@ This property may be set: * On macOS, to an import file (e.g. ``.tbd``) created for shared libraries (see the :prop_tgt:`ENABLE_EXPORTS` target property). For frameworks this is the location of the ``.tbd`` file symlink just inside the framework folder. +* .. versionadded:: 3.28 + On non-DLL platforms, to the location of a shared library. + When set without also specifying an :prop_tgt:`IMPORTED_LOCATION`, + the library is considered to be a stub, and its location will not + be added as a runtime search path to dependents that link it. + The ``IMPORTED_IMPLIB`` target property may be overridden for a given configuration ``<CONFIG>`` by the configuration-specific diff --git a/Help/prop_tgt/IMPORTED_LOCATION.rst b/Help/prop_tgt/IMPORTED_LOCATION.rst index a7207d8..915085b 100644 --- a/Help/prop_tgt/IMPORTED_LOCATION.rst +++ b/Help/prop_tgt/IMPORTED_LOCATION.rst @@ -15,6 +15,17 @@ is the location of the ``.dll`` part of the library. For ``UNKNOWN`` libraries this is the location of the file to be linked. Ignored for non-imported targets. +.. versionadded:: 3.28 + + For frameworks on macOS, this may be the location of the framework folder + itself. + +.. versionadded:: 3.28 + + This may be the location of a ``.xcframework`` folder on macOS. If it is, + any target that links against it will get the selected library's ``Headers`` + directory as a usage requirement. + The ``IMPORTED_LOCATION`` target property may be overridden for a given configuration ``<CONFIG>`` by the configuration-specific :prop_tgt:`IMPORTED_LOCATION_<CONFIG>` target property. Furthermore, diff --git a/Help/prop_tgt/IMPORTED_OBJECTS.rst b/Help/prop_tgt/IMPORTED_OBJECTS.rst index d71c219..9aacea7 100644 --- a/Help/prop_tgt/IMPORTED_OBJECTS.rst +++ b/Help/prop_tgt/IMPORTED_OBJECTS.rst @@ -31,7 +31,7 @@ once per architecture for each source file. Unlike the other generators, it does not generate universal object file binaries. A further complication with the :generator:`Xcode` generator is that when -targeting device platforms (iOS, tvOS or watchOS), the :generator:`Xcode` +targeting device platforms (iOS, tvOS, visionOS or watchOS), the :generator:`Xcode` generator has the ability to use either the device or simulator SDK without needing CMake to be re-run. The SDK can be selected at build time. But since some architectures can be supported by both the device and the diff --git a/Help/prop_tgt/IOS_INSTALL_COMBINED.rst b/Help/prop_tgt/IOS_INSTALL_COMBINED.rst index 92d60dc..c296691 100644 --- a/Help/prop_tgt/IOS_INSTALL_COMBINED.rst +++ b/Help/prop_tgt/IOS_INSTALL_COMBINED.rst @@ -2,18 +2,27 @@ IOS_INSTALL_COMBINED -------------------- .. versionadded:: 3.5 +.. deprecated:: 3.28 + + :prop_tgt:`IOS_INSTALL_COMBINED` was designed to make universal binaries + containing iOS/arm* device code paired with iOS Simulator/x86_64 code + (or similar for other Apple embedded platforms). Universal binaries can only + differentiate code based on CPU type, so this only made sense before the + days of arm64 macOS machines (i.e. iOS Simulator/arm64). Apple now + recommends xcframeworks, which contain multiple binaries for different + platforms, for this use case. Build a combined (device and simulator) target when installing. -When this property is set to set to false (which is the default) then it will +When this property is set to false, which is the default, then it will either be built with the device SDK or the simulator SDK depending on the SDK set. But if this property is set to true then the target will at install time -also be built for the corresponding SDK and combined into one library. +also be built for the other SDK and combined into one library. .. note:: - If a selected architecture is available for both: device SDK and simulator + If a selected architecture is available for both device SDK and simulator SDK it will be built for the SDK selected by :variable:`CMAKE_OSX_SYSROOT` - and removed from the corresponding SDK. + and removed from the other SDK. This feature requires at least Xcode version 6. diff --git a/Help/prop_tgt/Swift_LANGUAGE_VERSION.rst b/Help/prop_tgt/Swift_LANGUAGE_VERSION.rst index afc6b31..d1d80a8 100644 --- a/Help/prop_tgt/Swift_LANGUAGE_VERSION.rst +++ b/Help/prop_tgt/Swift_LANGUAGE_VERSION.rst @@ -4,5 +4,6 @@ Swift_LANGUAGE_VERSION .. versionadded:: 3.16 This property sets the language version for the Swift sources in the target. If -one is not specified, it will default to ``<CMAKE_Swift_LANGUAGE_VERSION>`` if -specified, otherwise it is the latest version supported by the compiler. +one is not specified, it will default to +:variable:`CMAKE_Swift_LANGUAGE_VERSION` if specified, otherwise it is the +latest version supported by the compiler. diff --git a/Help/prop_tgt/VS_DEBUGGER_COMMAND.rst b/Help/prop_tgt/VS_DEBUGGER_COMMAND.rst index 5bf47a3..8c136f2 100644 --- a/Help/prop_tgt/VS_DEBUGGER_COMMAND.rst +++ b/Help/prop_tgt/VS_DEBUGGER_COMMAND.rst @@ -11,5 +11,5 @@ project file. This property is initialized by the value of the variable :variable:`CMAKE_VS_DEBUGGER_COMMAND` if it is set when a target is created. -This property only works for Visual Studio 11 2012 and above; +This property only works for Visual Studio 12 2013 and above; it is ignored on other generators. diff --git a/Help/prop_tgt/VS_DEBUGGER_COMMAND_ARGUMENTS.rst b/Help/prop_tgt/VS_DEBUGGER_COMMAND_ARGUMENTS.rst index 4b9dff7..2656826 100644 --- a/Help/prop_tgt/VS_DEBUGGER_COMMAND_ARGUMENTS.rst +++ b/Help/prop_tgt/VS_DEBUGGER_COMMAND_ARGUMENTS.rst @@ -11,5 +11,5 @@ project file. This property is initialized by the value of the variable :variable:`CMAKE_VS_DEBUGGER_COMMAND_ARGUMENTS` if it is set when a target is created. -This property only works for Visual Studio 11 2012 and above; +This property only works for Visual Studio 12 2013 and above; it is ignored on other generators. diff --git a/Help/prop_tgt/VS_DEBUGGER_ENVIRONMENT.rst b/Help/prop_tgt/VS_DEBUGGER_ENVIRONMENT.rst index 8373dbb..d78d594 100644 --- a/Help/prop_tgt/VS_DEBUGGER_ENVIRONMENT.rst +++ b/Help/prop_tgt/VS_DEBUGGER_ENVIRONMENT.rst @@ -11,5 +11,5 @@ project file. This property is initialized by the value of the variable :variable:`CMAKE_VS_DEBUGGER_ENVIRONMENT` if it is set when a target is created. -This property only works for Visual Studio 11 2012 and above; +This property only works for Visual Studio 12 2013 and above; it is ignored on other generators. diff --git a/Help/prop_tgt/VS_DEBUGGER_WORKING_DIRECTORY.rst b/Help/prop_tgt/VS_DEBUGGER_WORKING_DIRECTORY.rst index 3942047..1026dfa 100644 --- a/Help/prop_tgt/VS_DEBUGGER_WORKING_DIRECTORY.rst +++ b/Help/prop_tgt/VS_DEBUGGER_WORKING_DIRECTORY.rst @@ -11,5 +11,5 @@ project file. This property is initialized by the value of the variable :variable:`CMAKE_VS_DEBUGGER_WORKING_DIRECTORY` if it is set when a target is created. -This property only works for Visual Studio 11 2012 and above; +This property only works for Visual Studio 12 2013 and above; it is ignored on other generators. diff --git a/Help/prop_tgt/VS_DOTNET_STARTUP_OBJECT.rst b/Help/prop_tgt/VS_DOTNET_STARTUP_OBJECT.rst index 8a85ba4..eeb7dda 100644 --- a/Help/prop_tgt/VS_DOTNET_STARTUP_OBJECT.rst +++ b/Help/prop_tgt/VS_DOTNET_STARTUP_OBJECT.rst @@ -12,7 +12,7 @@ If the property is unset, Visual Studio uses the first matching than one ``Main()`` method is available in the current project, the property becomes mandatory for building the project. -This property only works for Visual Studio 11 2012 and above; +This property only works for Visual Studio 12 2013 and above; it is ignored on other generators. .. code-block:: cmake diff --git a/Help/prop_tgt/VS_KEYWORD.rst b/Help/prop_tgt/VS_KEYWORD.rst index 221b986..f04d109 100644 --- a/Help/prop_tgt/VS_KEYWORD.rst +++ b/Help/prop_tgt/VS_KEYWORD.rst @@ -7,4 +7,4 @@ Can be set to change the visual studio keyword, for example Qt integration works better if this is set to Qt4VSv1.0. Use the :prop_tgt:`VS_GLOBAL_KEYWORD` target property to set the -keyword for Visual Studio 11 (2012) and newer. +keyword for Visual Studio 12 (2013) and newer. diff --git a/Help/release/3.14.rst b/Help/release/3.14.rst index 8a9738c..5fedf7d 100644 --- a/Help/release/3.14.rst +++ b/Help/release/3.14.rst @@ -63,7 +63,8 @@ File-Based API Platforms --------- -* CMake now supports :ref:`Cross Compiling for iOS, tvOS, or watchOS` +* CMake now supports + :ref:`Cross Compiling for iOS, tvOS, or watchOS <Cross Compiling for iOS, tvOS, visionOS, or watchOS>` using simple toolchain files. Command-Line diff --git a/Help/release/dev/0-sample-topic.rst b/Help/release/dev/0-sample-topic.rst new file mode 100644 index 0000000..e4cc01e --- /dev/null +++ b/Help/release/dev/0-sample-topic.rst @@ -0,0 +1,7 @@ +0-sample-topic +-------------- + +* This is a sample release note for the change in a topic. + Developers should add similar notes for each topic branch + making a noteworthy change. Each document should be named + and titled to match the topic name to avoid merge conflicts. diff --git a/Help/release/dev/CMAKE_CROSSCOMPILING_EMULATOR-env-variable.rst b/Help/release/dev/CMAKE_CROSSCOMPILING_EMULATOR-env-variable.rst new file mode 100644 index 0000000..269e739 --- /dev/null +++ b/Help/release/dev/CMAKE_CROSSCOMPILING_EMULATOR-env-variable.rst @@ -0,0 +1,6 @@ +CMAKE_CROSSCOMPILING_EMULATOR-env-variable +------------------------------------------ + +* The :envvar:`CMAKE_CROSSCOMPILING_EMULATOR` environment variable + was added to initialize the :variable:`CMAKE_CROSSCOMPILING_EMULATOR` + cache variable. diff --git a/Help/release/dev/FindCURL-static.rst b/Help/release/dev/FindCURL-static.rst new file mode 100644 index 0000000..3c369d2 --- /dev/null +++ b/Help/release/dev/FindCURL-static.rst @@ -0,0 +1,5 @@ +FindCURL-static +--------------- + +* The :module:`FindCURL` module gained a ``CURL_USE_STATIC_LIBS`` hint + to select static libraries. diff --git a/Help/release/dev/FindEXPAT-static.rst b/Help/release/dev/FindEXPAT-static.rst new file mode 100644 index 0000000..8808ebd --- /dev/null +++ b/Help/release/dev/FindEXPAT-static.rst @@ -0,0 +1,5 @@ +FindEXPAT-static +---------------- + +* The :module:`FindEXPAT` module gained a ``EXPAT_USE_STATIC_LIBS`` hint + to select static libraries. diff --git a/Help/release/dev/apple-visionos.rst b/Help/release/dev/apple-visionos.rst new file mode 100644 index 0000000..db76248 --- /dev/null +++ b/Help/release/dev/apple-visionos.rst @@ -0,0 +1,7 @@ +apple-visionos +-------------- + +* CMake learned about Apple visionOS and its `xros` and `xrsimulator` SDKs. + Compiling for Apple visionOS can be requested by setting + :variable:`CMAKE_SYSTEM_NAME` to ``visionOS``. For more + information see :manual:`cmake-toolchains(7)`. diff --git a/Help/release/dev/command-job-server-aware.rst b/Help/release/dev/command-job-server-aware.rst new file mode 100644 index 0000000..224c739 --- /dev/null +++ b/Help/release/dev/command-job-server-aware.rst @@ -0,0 +1,5 @@ +command-job-server-aware +------------------------ + +* The :command:`add_custom_command` and :command:`add_custom_target` + commands gained a ``JOB_SERVER_AWARE`` option. diff --git a/Help/release/dev/deprecate-install-combined.rst b/Help/release/dev/deprecate-install-combined.rst new file mode 100644 index 0000000..12a0a43 --- /dev/null +++ b/Help/release/dev/deprecate-install-combined.rst @@ -0,0 +1,6 @@ +deprecate-install-combined +-------------------------- + +* The :prop_tgt:`IOS_INSTALL_COMBINED` target property and corresponding + :variable:`CMAKE_IOS_INSTALL_COMBINED` variable have been deprecated. + Their functionality does not make sense on Apple Silicon hosts. diff --git a/Help/release/dev/exec_program-policy.rst b/Help/release/dev/exec_program-policy.rst new file mode 100644 index 0000000..8ddae5b --- /dev/null +++ b/Help/release/dev/exec_program-policy.rst @@ -0,0 +1,6 @@ +exec_program-policy +------------------- + +* The :command:`exec_program` command, which has been deprecated since CMake + 3.0, has been removed by policy :policy:`CMP0153`. Use the + :command:`execute_process` command instead. diff --git a/Help/release/dev/imported-implib-only.rst b/Help/release/dev/imported-implib-only.rst new file mode 100644 index 0000000..aa817b7 --- /dev/null +++ b/Help/release/dev/imported-implib-only.rst @@ -0,0 +1,7 @@ +imported-implib-only +-------------------- + +* On imported shared libraries, the :prop_tgt:`IMPORTED_IMPLIB` target + property may now be used without :prop_tgt:`IMPORTED_LOCATION`. + This can be used to represent a stub library whose location should not + be added as a runtime search path to dependents that link it. diff --git a/Help/release/dev/imported-target-framework-path.rst b/Help/release/dev/imported-target-framework-path.rst new file mode 100644 index 0000000..68c3431 --- /dev/null +++ b/Help/release/dev/imported-target-framework-path.rst @@ -0,0 +1,5 @@ +imported-target-framework-path +------------------------------ + +* The :prop_tgt:`IMPORTED_LOCATION` property of a macOS framework may now be + the location of the framework folder itself. diff --git a/Help/release/dev/remove-vs11-generator.rst b/Help/release/dev/remove-vs11-generator.rst new file mode 100644 index 0000000..971d679 --- /dev/null +++ b/Help/release/dev/remove-vs11-generator.rst @@ -0,0 +1,4 @@ +remove-vs11-generator +--------------------- + +* The :generator:`Visual Studio 11 2012` generator has been removed. diff --git a/Help/release/dev/vs12-deprecate.rst b/Help/release/dev/vs12-deprecate.rst new file mode 100644 index 0000000..23d7e2a --- /dev/null +++ b/Help/release/dev/vs12-deprecate.rst @@ -0,0 +1,5 @@ +vs12-deprecate +-------------- + +* The :generator:`Visual Studio 12 2013` generator is now deprecated + and will be removed in a future version of CMake. diff --git a/Help/release/dev/xcframework-find-library.rst b/Help/release/dev/xcframework-find-library.rst new file mode 100644 index 0000000..527270e --- /dev/null +++ b/Help/release/dev/xcframework-find-library.rst @@ -0,0 +1,5 @@ +xcframework-find-library +------------------------ + +* The :command:`find_library` command can now find ``.xcframework`` folders on + Apple platforms. diff --git a/Help/release/dev/xcframework-target-link-libraries.rst b/Help/release/dev/xcframework-target-link-libraries.rst new file mode 100644 index 0000000..7edded5 --- /dev/null +++ b/Help/release/dev/xcframework-target-link-libraries.rst @@ -0,0 +1,7 @@ +xcframework-target-link-libraries +--------------------------------- + +* Targets may now link against an ``.xcframework`` folder in + :command:`target_link_libraries`. +* The :prop_tgt:`IMPORTED_LOCATION` property of a target may now be an + ``.xcframework`` folder. diff --git a/Help/release/index.rst b/Help/release/index.rst index fc1f744..3851b7e 100644 --- a/Help/release/index.rst +++ b/Help/release/index.rst @@ -7,6 +7,8 @@ CMake Release Notes This file should include the adjacent "dev.txt" file in development versions but not in release versions. +.. include:: dev.txt + Releases ======== diff --git a/Help/variable/APPLE.rst b/Help/variable/APPLE.rst index 810d5fc..e799397 100644 --- a/Help/variable/APPLE.rst +++ b/Help/variable/APPLE.rst @@ -2,4 +2,4 @@ APPLE ----- Set to ``True`` when the target system is an Apple platform -(macOS, iOS, tvOS or watchOS). +(macOS, iOS, tvOS, visionOS or watchOS). diff --git a/Help/variable/CMAKE_CFG_INTDIR.rst b/Help/variable/CMAKE_CFG_INTDIR.rst index 3a57659..3045d91 100644 --- a/Help/variable/CMAKE_CFG_INTDIR.rst +++ b/Help/variable/CMAKE_CFG_INTDIR.rst @@ -19,7 +19,7 @@ Example values: :: $(ConfigurationName) = Visual Studio 9 - $(Configuration) = Visual Studio 11 and above + $(Configuration) = Visual Studio 12 and above $(CONFIGURATION) = Xcode . = Make-based tools . = Ninja diff --git a/Help/variable/CMAKE_CROSSCOMPILING_EMULATOR.rst b/Help/variable/CMAKE_CROSSCOMPILING_EMULATOR.rst index e21b35d..1c3a26c 100644 --- a/Help/variable/CMAKE_CROSSCOMPILING_EMULATOR.rst +++ b/Help/variable/CMAKE_CROSSCOMPILING_EMULATOR.rst @@ -12,6 +12,10 @@ for the target system. Lists>`, then the first value is the command and remaining values are its arguments. +.. versionadded:: 3.28 + This variable can be initialized via an + :envvar:`CMAKE_CROSSCOMPILING_EMULATOR` environment variable. + The command will be used to run :command:`try_run` generated executables, which avoids manual population of the ``TryRunResults.cmake`` file. diff --git a/Help/variable/CMAKE_CUDA_HOST_COMPILER.rst b/Help/variable/CMAKE_CUDA_HOST_COMPILER.rst index 9817b1a..6e2d756 100644 --- a/Help/variable/CMAKE_CUDA_HOST_COMPILER.rst +++ b/Help/variable/CMAKE_CUDA_HOST_COMPILER.rst @@ -26,4 +26,11 @@ is read-only and changes to it are undefined behavior. .. note:: + Projects should not try to set ``CMAKE_CUDA_HOST_COMPILER`` to match + :variable:`CMAKE_CXX_COMPILER <CMAKE_<LANG>_COMPILER>` themselves. + It is the end-user's responsibility, not the project's, to ensure that + the C++ and CUDA compilers target the same ABI. + +.. note:: + Ignored when using :ref:`Visual Studio Generators`. diff --git a/Help/variable/CMAKE_IOS_INSTALL_COMBINED.rst b/Help/variable/CMAKE_IOS_INSTALL_COMBINED.rst index cd7fd8d..0024ba9 100644 --- a/Help/variable/CMAKE_IOS_INSTALL_COMBINED.rst +++ b/Help/variable/CMAKE_IOS_INSTALL_COMBINED.rst @@ -2,6 +2,9 @@ CMAKE_IOS_INSTALL_COMBINED -------------------------- .. versionadded:: 3.5 +.. deprecated:: 3.28 + + This is deprecated because :prop_tgt:`IOS_INSTALL_COMBINED` is deprecated. Default value for :prop_tgt:`IOS_INSTALL_COMBINED` of targets. diff --git a/Help/variable/CMAKE_MACOSX_BUNDLE.rst b/Help/variable/CMAKE_MACOSX_BUNDLE.rst index 43ddff5..483c5b3 100644 --- a/Help/variable/CMAKE_MACOSX_BUNDLE.rst +++ b/Help/variable/CMAKE_MACOSX_BUNDLE.rst @@ -7,4 +7,4 @@ This variable is used to initialize the :prop_tgt:`MACOSX_BUNDLE` property on all the targets. See that target property for additional information. This variable is set to ``ON`` by default if :variable:`CMAKE_SYSTEM_NAME` -equals to :ref:`iOS, tvOS or watchOS <Cross Compiling for iOS, tvOS, or watchOS>`. +equals to :ref:`iOS, tvOS, visionOS or watchOS <Cross Compiling for iOS, tvOS, visionOS, or watchOS>`. diff --git a/Help/variable/CMAKE_OSX_VARIABLE.txt b/Help/variable/CMAKE_OSX_VARIABLE.txt index 5670980..962fcd3 100644 --- a/Help/variable/CMAKE_OSX_VARIABLE.txt +++ b/Help/variable/CMAKE_OSX_VARIABLE.txt @@ -7,6 +7,6 @@ remove it while initializing a cache entry of the same name) unless policy :policy:`CMP0126` is set to ``NEW``. Despite the ``OSX`` part in the variable name(s) they apply also to -other SDKs than macOS like iOS, tvOS, or watchOS. +other SDKs than macOS like iOS, tvOS, visionOS, or watchOS. This variable is ignored on platforms other than Apple. diff --git a/Help/variable/CMAKE_VS_DEVENV_COMMAND.rst b/Help/variable/CMAKE_VS_DEVENV_COMMAND.rst index 2bb97c4..155931f 100644 --- a/Help/variable/CMAKE_VS_DEVENV_COMMAND.rst +++ b/Help/variable/CMAKE_VS_DEVENV_COMMAND.rst @@ -10,5 +10,5 @@ This variable is not defined by other generators even if ``devenv.com`` is installed on the computer. The :variable:`CMAKE_VS_MSBUILD_COMMAND` is also provided for -:generator:`Visual Studio 11 2012` and above. +:generator:`Visual Studio 12 2013` and above. See also the :variable:`CMAKE_MAKE_PROGRAM` variable. diff --git a/Help/variable/CMAKE_VS_MSBUILD_COMMAND.rst b/Help/variable/CMAKE_VS_MSBUILD_COMMAND.rst index 8a521a3..96924d5 100644 --- a/Help/variable/CMAKE_VS_MSBUILD_COMMAND.rst +++ b/Help/variable/CMAKE_VS_MSBUILD_COMMAND.rst @@ -1,7 +1,7 @@ CMAKE_VS_MSBUILD_COMMAND ------------------------ -The generators for :generator:`Visual Studio 11 2012` and above set this +The generators for :generator:`Visual Studio 12 2013` and above set this variable to the ``MSBuild.exe`` command installed with the corresponding Visual Studio version. diff --git a/Modules/CMakeDetermineCSharpCompiler.cmake b/Modules/CMakeDetermineCSharpCompiler.cmake index fe98469..652eb63 100644 --- a/Modules/CMakeDetermineCSharpCompiler.cmake +++ b/Modules/CMakeDetermineCSharpCompiler.cmake @@ -3,7 +3,7 @@ if(NOT ${CMAKE_GENERATOR} MATCHES "Visual Studio ([^9]|[9][0-9])") message(FATAL_ERROR - "C# is currently only supported for Microsoft Visual Studio 11 2012 and later.") + "C# is currently only supported for Microsoft Visual Studio 12 2013 and later.") endif() include(${CMAKE_ROOT}/Modules/CMakeDetermineCompiler.cmake) diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake index 6c49096..4db9aa8 100644 --- a/Modules/CMakeDetermineCompilerId.cmake +++ b/Modules/CMakeDetermineCompilerId.cmake @@ -608,6 +608,7 @@ Id flags: ${testflags} ${CMAKE_${lang}_COMPILER_ID_FLAGS_ALWAYS} if(CMAKE_OSX_SYSROOT) set(id_sdkroot "SDKROOT = \"${CMAKE_OSX_SYSROOT}\";") if(CMAKE_OSX_SYSROOT MATCHES "(^|/)[Ii][Pp][Hh][Oo][Nn][Ee]" OR + CMAKE_OSX_SYSROOT MATCHES "(^|/)[Xx][Rr]" OR CMAKE_OSX_SYSROOT MATCHES "(^|/)[Aa][Pp][Pp][Ll][Ee][Tt][Vv]") set(id_product_type "com.apple.product-type.bundle.unit-test") elseif(CMAKE_OSX_SYSROOT MATCHES "(^|/)[Ww][Aa][Tt][Cc][Hh]") diff --git a/Modules/CMakeDetermineSystem.cmake b/Modules/CMakeDetermineSystem.cmake index 386be73..fff4e9d 100644 --- a/Modules/CMakeDetermineSystem.cmake +++ b/Modules/CMakeDetermineSystem.cmake @@ -47,6 +47,28 @@ if(CMAKE_HOST_UNIX) set(CMAKE_HOST_SYSTEM_VERSION "${_CMAKE_HOST_SYSTEM_MAJOR_VERSION}.${_CMAKE_HOST_SYSTEM_MINOR_VERSION}") unset(_CMAKE_HOST_SYSTEM_MAJOR_VERSION) unset(_CMAKE_HOST_SYSTEM_MINOR_VERSION) + elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Android") + execute_process(COMMAND getprop ro.build.version.sdk + OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_VERSION + OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_QUIET) + + if(NOT DEFINED CMAKE_SYSTEM_VERSION) + set(_ANDROID_API_LEVEL_H $ENV{PREFIX}/include/android/api-level.h) + set(_ANDROID_API_REGEX "#define __ANDROID_API__ ([0-9]+)") + file(READ ${_ANDROID_API_LEVEL_H} _ANDROID_API_LEVEL_H_CONTENT) + string(REGEX MATCH ${_ANDROID_API_REGEX} _ANDROID_API_LINE "${_ANDROID_API_LEVEL_H_CONTENT}") + string(REGEX REPLACE ${_ANDROID_API_REGEX} "\\1" _ANDROID_API "${_ANDROID_API_LINE}") + if(_ANDROID_API) + set(CMAKE_SYSTEM_VERSION "${_ANDROID_API}") + endif() + + unset(_ANDROID_API_LEVEL_H) + unset(_ANDROID_API_LEVEL_H_CONTENT) + unset(_ANDROID_API_REGEX) + unset(_ANDROID_API_LINE) + unset(_ANDROID_API) + endif() else() execute_process(COMMAND ${CMAKE_UNAME} -r OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_VERSION diff --git a/Modules/CMakeSwiftInformation.cmake b/Modules/CMakeSwiftInformation.cmake index 777c680..1c6f0df 100644 --- a/Modules/CMakeSwiftInformation.cmake +++ b/Modules/CMakeSwiftInformation.cmake @@ -21,7 +21,8 @@ set(CMAKE_INCLUDE_FLAG_Swift "-I ") # FIXME: Move compiler- and platform-specific flags to the above-included modules. if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" OR CMAKE_SYSTEM_NAME STREQUAL "iOS" - OR CMAKE_SYSTEM_NAME STREQUAL "tvOS" OR CMAKE_SYSTEM_NAME STREQUAL "watchOS") + OR CMAKE_SYSTEM_NAME STREQUAL "tvOS" OR CMAKE_SYSTEM_NAME STREQUAL "visionOS" + OR CMAKE_SYSTEM_NAME STREQUAL "watchOS") set(CMAKE_SHARED_LIBRARY_SONAME_Swift_FLAG "-Xlinker -install_name -Xlinker ") elseif(NOT CMAKE_SYSTEM_NAME STREQUAL Windows) set(CMAKE_SHARED_LIBRARY_SONAME_Swift_FLAG "-Xlinker -soname -Xlinker ") @@ -30,7 +31,8 @@ if(NOT CMAKE_SYSTEM_NAME STREQUAL Windows) set(CMAKE_EXECUTABLE_RUNTIME_Swift_FLAG "-Xlinker -rpath -Xlinker ") set(CMAKE_SHARED_LIBRARY_RUNTIME_Swift_FLAG "-Xlinker -rpath -Xlinker ") if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" OR CMAKE_SYSTEM_NAME STREQUAL "iOS" - OR CMAKE_SYSTEM_NAME STREQUAL "tvOS" OR CMAKE_SYSTEM_NAME STREQUAL "watchOS") + OR CMAKE_SYSTEM_NAME STREQUAL "tvOS" OR CMAKE_SYSTEM_NAME STREQUAL "visionOS" + OR CMAKE_SYSTEM_NAME STREQUAL "watchOS") set(CMAKE_EXECUTABLE_RUNTIME_Swift_FLAG_SEP "") set(CMAKE_SHARED_LIBRARY_RUNTIME_Swift_FLAG_SEP "") else() diff --git a/Modules/CMakeSystemSpecificInitialize.cmake b/Modules/CMakeSystemSpecificInitialize.cmake index e87d868..ee8cb86 100644 --- a/Modules/CMakeSystemSpecificInitialize.cmake +++ b/Modules/CMakeSystemSpecificInitialize.cmake @@ -25,7 +25,7 @@ unset(LINUX) # It is useful to share the same aforementioned configuration files and # avoids duplicating them in case of tightly related platforms. # -# An example are the platforms supported by Xcode (macOS, iOS, tvOS, +# An example are the platforms supported by Xcode (macOS, iOS, tvOS, visionOS # and watchOS). For all of those the CMAKE_EFFECTIVE_SYSTEM_NAME is # set to Apple which results in using # Platform/Apple-AppleClang-CXX.cmake for the Apple C++ compiler. diff --git a/Modules/CheckLanguage.cmake b/Modules/CheckLanguage.cmake index 69913a3..04e721c 100644 --- a/Modules/CheckLanguage.cmake +++ b/Modules/CheckLanguage.cmake @@ -5,26 +5,45 @@ CheckLanguage ------------- -Check if a language can be enabled +Check whether a language can be enabled by the :command:`enable_language` +or :command:`project` commands: -Usage: +.. command:: check_language -:: + .. code-block:: cmake - check_language(<lang>) + check_language(<lang>) -where ``<lang>`` is a language that may be passed to :command:`enable_language` -such as ``Fortran``. If :variable:`CMAKE_<LANG>_COMPILER` is already defined -the check does nothing. Otherwise it tries enabling the language in a -test project. The result is cached in :variable:`CMAKE_<LANG>_COMPILER` -as the compiler that was found, or ``NOTFOUND`` if the language cannot be -enabled. For CUDA which can have an explicit host compiler, the cache -:variable:`CMAKE_CUDA_HOST_COMPILER` variable will be set if it was required -for compilation (and cleared if it was not). + Try enabling language ``<lang>`` in a test project and record results + in the cache: -Example: + :variable:`CMAKE_<LANG>_COMPILER` + If the language can be enabled, this variable is set to the compiler + that was found. If the language cannot be enabled, this variable is + set to ``NOTFOUND``. -:: + If this variable is already set, either explicitly or cached by + a previous call, the check is skipped. + + :variable:`CMAKE_CUDA_HOST_COMPILER` + This variable is set when ``<lang>`` is ``CUDA``. + + If the check detects an explicit host compiler that is required for + compilation, this variable will be set to that compiler. + If the check detects that no explicit host compiler is needed, + this variable will be cleared. + + If this variable is already set, its value is preserved only if + :variable:`CMAKE_CUDA_COMPILER <CMAKE_<LANG>_COMPILER>` is also set. + Otherwise, the check runs and overwrites + :variable:`CMAKE_CUDA_HOST_COMPILER` with a new result. + Note that :variable:`CMAKE_CUDA_HOST_COMPILER` documents it should + not be set without also setting + :variable:`CMAKE_CUDA_COMPILER <CMAKE_<LANG>_COMPILER>` to a NVCC compiler. + +For example: + +.. code-block:: cmake check_language(Fortran) if(CMAKE_Fortran_COMPILER) diff --git a/Modules/FindCUDAToolkit.cmake b/Modules/FindCUDAToolkit.cmake index c2627e7..12aca8d 100644 --- a/Modules/FindCUDAToolkit.cmake +++ b/Modules/FindCUDAToolkit.cmake @@ -965,12 +965,15 @@ if(CUDAToolkit_FOUND) # search paths without symlinks if(CUDAToolkit_LIBRARY_DIR MATCHES ".*/cuda/${CUDAToolkit_VERSION_MAJOR}.${CUDAToolkit_VERSION_MINOR}/lib64$") # Search location for math_libs/ - file(REAL_PATH "${CUDAToolkit_LIBRARY_DIR}/../../../" _cmake_search_dir) - list(APPEND CUDAToolkit_LIBRARY_SEARCH_DIRS "${_cmake_search_dir}") - - # Search location for extras like cupti - file(REAL_PATH "${CUDAToolkit_LIBRARY_DIR}/../" _cmake_search_dir) - list(APPEND CUDAToolkit_LIBRARY_SEARCH_DIRS "${_cmake_search_dir}") + block(SCOPE_FOR POLICIES) + cmake_policy(SET CMP0152 NEW) + file(REAL_PATH "${CUDAToolkit_LIBRARY_DIR}/../../../../../" _cmake_search_dir) + list(APPEND CUDAToolkit_LIBRARY_SEARCH_DIRS "${_cmake_search_dir}") + + # Search location for extras like cupti + file(REAL_PATH "${CUDAToolkit_LIBRARY_DIR}/../../../" _cmake_search_dir) + list(APPEND CUDAToolkit_LIBRARY_SEARCH_DIRS "${_cmake_search_dir}") + endblock() endif() # If no `CUDAToolkit_LIBRARY_ROOT` exists set it based on CUDAToolkit_LIBRARY_DIR @@ -1009,17 +1012,26 @@ if(CUDAToolkit_FOUND) ) # Don't try any stub directories until we have exhausted all other # search locations. - find_library(CUDA_${lib_name}_LIBRARY - NAMES ${search_names} - HINTS ${CUDAToolkit_LIBRARY_SEARCH_DIRS} - ENV CUDA_PATH - PATH_SUFFIXES lib64/stubs lib/x64/stubs lib/stubs stubs - ) + set(CUDA_IMPORT_PROPERTY IMPORTED_LOCATION) + set(CUDA_IMPORT_TYPE UNKNOWN) + if(NOT CUDA_${lib_name}_LIBRARY) + find_library(CUDA_${lib_name}_LIBRARY + NAMES ${search_names} + HINTS ${CUDAToolkit_LIBRARY_SEARCH_DIRS} + ENV CUDA_PATH + PATH_SUFFIXES lib64/stubs lib/x64/stubs lib/stubs stubs + ) + if(CUDA_${lib_name}_LIBRARY AND NOT WIN32) + # Use `IMPORTED_IMPLIB` so that we don't add a `-rpath` entry for stub directories + set(CUDA_IMPORT_PROPERTY IMPORTED_IMPLIB) + set(CUDA_IMPORT_TYPE SHARED) + endif() + endif() mark_as_advanced(CUDA_${lib_name}_LIBRARY) if (NOT TARGET CUDA::${lib_name} AND CUDA_${lib_name}_LIBRARY) - add_library(CUDA::${lib_name} UNKNOWN IMPORTED) + add_library(CUDA::${lib_name} ${CUDA_IMPORT_TYPE} IMPORTED) target_include_directories(CUDA::${lib_name} SYSTEM INTERFACE "${CUDAToolkit_INCLUDE_DIRS}") if(DEFINED CUDAToolkit_MATH_INCLUDE_DIR) string(FIND ${CUDA_${lib_name}_LIBRARY} "math_libs" math_libs) @@ -1027,7 +1039,7 @@ if(CUDAToolkit_FOUND) target_include_directories(CUDA::${lib_name} SYSTEM INTERFACE "${CUDAToolkit_MATH_INCLUDE_DIR}") endif() endif() - set_property(TARGET CUDA::${lib_name} PROPERTY IMPORTED_LOCATION "${CUDA_${lib_name}_LIBRARY}") + set_property(TARGET CUDA::${lib_name} PROPERTY ${CUDA_IMPORT_PROPERTY} "${CUDA_${lib_name}_LIBRARY}") foreach(dep ${arg_DEPS}) if(TARGET CUDA::${dep}) target_link_libraries(CUDA::${lib_name} INTERFACE CUDA::${dep}) diff --git a/Modules/FindCURL.cmake b/Modules/FindCURL.cmake index acb87dc..2f33dac 100644 --- a/Modules/FindCURL.cmake +++ b/Modules/FindCURL.cmake @@ -58,6 +58,18 @@ returns its results with no further action. Set ``CURL_NO_CURL_CMAKE`` to ``ON`` to disable this search. +Hints +^^^^^ + +``CURL_USE_STATIC_LIBS`` + + .. versionadded:: 3.28 + + Set to ``TRUE`` to use static libraries. + + This is meaningful only when CURL is not found via its + CMake Package Configuration file. + #]=======================================================================] include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) @@ -193,6 +205,11 @@ if(CURL_FOUND) set_target_properties(CURL::libcurl PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${CURL_INCLUDE_DIRS}") + if(CURL_USE_STATIC_LIBS) + set_property(TARGET CURL::libcurl APPEND PROPERTY + INTERFACE_COMPILE_DEFINITIONS "CURL_STATICLIB") + endif() + if(EXISTS "${CURL_LIBRARY}") set_target_properties(CURL::libcurl PROPERTIES IMPORTED_LINK_INTERFACE_LANGUAGES "C" @@ -212,5 +229,11 @@ if(CURL_FOUND) IMPORTED_LINK_INTERFACE_LANGUAGES "C" IMPORTED_LOCATION_DEBUG "${CURL_LIBRARY_DEBUG}") endif() + + if(CURL_USE_STATIC_LIBS AND MSVC) + set_target_properties(CURL::libcurl PROPERTIES + INTERFACE_LINK_LIBRARIES "normaliz.lib;ws2_32.lib;wldap32.lib") + endif() + endif() endif() diff --git a/Modules/FindEXPAT.cmake b/Modules/FindEXPAT.cmake index 3bedc73..762931e 100644 --- a/Modules/FindEXPAT.cmake +++ b/Modules/FindEXPAT.cmake @@ -30,6 +30,15 @@ This module will set the following variables in your project: ``EXPAT_FOUND`` true if the Expat headers and libraries were found. +Hints +^^^^^ + +``EXPAT_USE_STATIC_LIBS`` + + .. versionadded:: 3.28 + + Set to ``TRUE`` to use static libraries. + #]=======================================================================] find_package(PkgConfig QUIET) @@ -43,8 +52,13 @@ set(EXPAT_NAMES expat expatw) set(EXPAT_NAMES_DEBUG expatd expatwd) if(WIN32) - list(APPEND EXPAT_NAMES expatMT expatMD expatwMT expatwMD) - list(APPEND EXPAT_NAMES_DEBUG expatdMT expatdMD expatwdMT expatwdMD) + if(EXPAT_USE_STATIC_LIBS) + list(APPEND EXPAT_NAMES expatMT expatwMT) + list(APPEND EXPAT_NAMES_DEBUG expatdMT expatwdMT) + else() + list(APPEND EXPAT_NAMES expatMT expatMD expatwMT expatwMD) + list(APPEND EXPAT_NAMES_DEBUG expatdMT expatdMD expatwdMT expatwdMD) + endif() endif() # Allow EXPAT_LIBRARY to be set manually, as the location of the expat library @@ -115,6 +129,11 @@ if(EXPAT_FOUND) IMPORTED_LINK_INTERFACE_LANGUAGES "C" INTERFACE_INCLUDE_DIRECTORIES "${EXPAT_INCLUDE_DIRS}") + if(EXPAT_USE_STATIC_LIBS) + set_property(TARGET EXPAT::EXPAT APPEND PROPERTY + INTERFACE_COMPILE_DEFINITIONS "XML_STATIC") + endif() + if(EXPAT_LIBRARY_RELEASE) set_property(TARGET EXPAT::EXPAT APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) diff --git a/Modules/FindFLTK.cmake b/Modules/FindFLTK.cmake index d54d2f6..a245c6c 100644 --- a/Modules/FindFLTK.cmake +++ b/Modules/FindFLTK.cmake @@ -232,7 +232,7 @@ else() find_program(FLTK_CONFIG_SCRIPT fltk-config PATHS ${FLTK_BIN_DIR}) if(FLTK_CONFIG_SCRIPT) if(NOT FLTK_INCLUDE_DIR) - exec_program(${FLTK_CONFIG_SCRIPT} ARGS --cxxflags OUTPUT_VARIABLE FLTK_CXXFLAGS) + execute_process(COMMAND ${FLTK_CONFIG_SCRIPT} --cxxflags OUTPUT_VARIABLE FLTK_CXXFLAGS) if(FLTK_CXXFLAGS) string(REGEX MATCHALL "-I[^ ]*" _fltk_temp_dirs ${FLTK_CXXFLAGS}) string(REPLACE "-I" "" _fltk_temp_dirs "${_fltk_temp_dirs}") @@ -256,7 +256,7 @@ else() # Try to find FLTK library if(UNIX) if(FLTK_CONFIG_SCRIPT) - exec_program(${FLTK_CONFIG_SCRIPT} ARGS --libs OUTPUT_VARIABLE _FLTK_POSSIBLE_LIBS) + execute_process(COMMAND ${FLTK_CONFIG_SCRIPT} --libs OUTPUT_VARIABLE _FLTK_POSSIBLE_LIBS) if(_FLTK_POSSIBLE_LIBS) get_filename_component(_FLTK_POSSIBLE_LIBRARY_DIR ${_FLTK_POSSIBLE_LIBS} PATH) endif() @@ -292,12 +292,12 @@ else() # Find the extra libraries needed for the fltk_images library. if(UNIX) if(FLTK_CONFIG_SCRIPT) - exec_program(${FLTK_CONFIG_SCRIPT} ARGS --use-images --ldflags + execute_process(COMMAND ${FLTK_CONFIG_SCRIPT} --use-images --ldflags OUTPUT_VARIABLE FLTK_IMAGES_LDFLAGS) set(FLTK_LIBS_EXTRACT_REGEX ".*-lfltk_images (.*) -lfltk.*") if("${FLTK_IMAGES_LDFLAGS}" MATCHES "${FLTK_LIBS_EXTRACT_REGEX}") string(REGEX REPLACE " +" ";" FLTK_IMAGES_LIBS "${CMAKE_MATCH_1}") - # The EXEC_PROGRAM will not be inherited into subdirectories from + # The execute_process() will not be inherited into subdirectories from # the file that originally included this module. Save the answer. set(FLTK_IMAGES_LIBS "${FLTK_IMAGES_LIBS}" CACHE INTERNAL "Extra libraries for fltk_images library.") diff --git a/Modules/FindFLTK2.cmake b/Modules/FindFLTK2.cmake index a43f7a4..2f6e41d 100644 --- a/Modules/FindFLTK2.cmake +++ b/Modules/FindFLTK2.cmake @@ -191,12 +191,12 @@ if(FLTK2_DIR) if(UNIX) find_program(FLTK2_CONFIG_SCRIPT fltk2-config PATHS ${FLTK2_BIN_DIR}) if(FLTK2_CONFIG_SCRIPT) - exec_program(${FLTK2_CONFIG_SCRIPT} ARGS --use-images --ldflags + execute_process(COMMAND ${FLTK2_CONFIG_SCRIPT} --use-images --ldflags OUTPUT_VARIABLE FLTK2_IMAGES_LDFLAGS) set(FLTK2_LIBS_EXTRACT_REGEX ".*-lfltk2_images (.*) -lfltk2.*") if("${FLTK2_IMAGES_LDFLAGS}" MATCHES "${FLTK2_LIBS_EXTRACT_REGEX}") string(REGEX REPLACE " +" ";" FLTK2_IMAGES_LIBS "${CMAKE_MATCH_1}") - # The EXEC_PROGRAM will not be inherited into subdirectories from + # The execute_process() will not be inherited into subdirectories from # the file that originally included this module. Save the answer. set(FLTK2_IMAGES_LIBS "${FLTK2_IMAGES_LIBS}" CACHE INTERNAL "Extra libraries for fltk_images library.") diff --git a/Modules/FindProtobuf.cmake b/Modules/FindProtobuf.cmake index a92fb52..008b537 100644 --- a/Modules/FindProtobuf.cmake +++ b/Modules/FindProtobuf.cmake @@ -136,15 +136,95 @@ Example: Variable to define with autogenerated Python files ``ARGN`` ``.proto`` files + +.. command:: protobuf_generate + + .. versionadded:: 3.13 + + Automatically generate source files from ``.proto`` schema files at build time:: + + protobuf_generate ( + TARGET <target> + [LANGUAGE <lang>] + [OUT_VAR <out_var>] + [EXPORT_MACRO <macro>] + [PROTOC_OUT_DIR <dir>] + [PLUGIN <plugin>] + [PLUGIN_OPTIONS <plugin_options>] + [DEPENDENCIES <depends] + [PROTOS <protobuf_files>] + [IMPORT_DIRS <dirs>] + [GENERATE_EXTENSIONS <extensions>] + [PROTOC_OPTIONS <protoc_options>] + [APPEND_PATH]) + + ``APPEND_PATH`` + A flag that causes the base path of all proto schema files to be added to + ``IMPORT_DIRS``. + ``LANGUAGE`` + A single value: cpp or python. Determines what kind of source files are + being generated. Defaults to cpp. + ``OUT_VAR`` + Name of a CMake variable that will be filled with the paths to the generated + source files. + ``EXPORT_MACRO`` + Name of a macro that is applied to all generated Protobuf message classes + and extern variables. It can, for example, be used to declare DLL exports. + ``PROTOC_OUT_DIR`` + Output directory of generated source files. Defaults to ``CMAKE_CURRENT_BINARY_DIR``. + ``PLUGIN`` + .. versionadded:: 3.21 + + An optional plugin executable. This could, for example, be the path to + ``grpc_cpp_plugin``. + ``PLUGIN_OPTIONS`` + .. versionadded:: 3.28 + + Additional options provided to the plugin, such as ``generate_mock_code=true`` + for the gRPC cpp plugin. + ``DEPENDENCIES`` + .. versionadded:: 3.28 + + Arguments forwarded to the ``DEPENDS`` of the underlying ``add_custom_command`` + invocation. + ``TARGET`` + CMake target that will have the generated files added as sources. + ``PROTOS`` + List of proto schema files. If omitted, then every source file ending in *proto* of ``TARGET`` will be used. + ``IMPORT_DIRS`` + A common parent directory for the schema files. For example, if the schema file is + ``proto/helloworld/helloworld.proto`` and the import directory ``proto/`` then the + generated files are ``${PROTOC_OUT_DIR}/helloworld/helloworld.pb.h`` and + ``${PROTOC_OUT_DIR}/helloworld/helloworld.pb.cc``. + ``GENERATE_EXTENSIONS`` + If LANGUAGE is omitted then this must be set to the extensions that protoc generates. + ``PROTOC_OPTIONS`` + .. versionadded:: 3.28 + + Additional arguments that are forwarded to protoc. + + Example:: + + find_package(gRPC CONFIG REQUIRED) + find_package(Protobuf REQUIRED) + add_library(ProtoTest Test.proto) + target_link_libraries(ProtoTest PUBLIC gRPC::grpc++) + protobuf_generate(TARGET ProtoTest) + protobuf_generate( + TARGET ProtoTest + LANGUAGE grpc + PLUGIN protoc-gen-grpc=$<TARGET_FILE:gRPC::grpc_cpp_plugin> + PLUGIN_OPTIONS generate_mock_code=true + GENERATE_EXTENSIONS .grpc.pb.h .grpc.pb.cc) #]=======================================================================] function(protobuf_generate) set(_options APPEND_PATH DESCRIPTORS) - set(_singleargs LANGUAGE OUT_VAR EXPORT_MACRO PROTOC_OUT_DIR PLUGIN) + set(_singleargs LANGUAGE OUT_VAR EXPORT_MACRO PROTOC_OUT_DIR PLUGIN PLUGIN_OPTIONS DEPENDENCIES) if(COMMAND target_sources) list(APPEND _singleargs TARGET) endif() - set(_multiargs PROTOS IMPORT_DIRS GENERATE_EXTENSIONS) + set(_multiargs PROTOS IMPORT_DIRS GENERATE_EXTENSIONS PROTOC_OPTIONS) cmake_parse_arguments(protobuf_generate "${_options}" "${_singleargs}" "${_multiargs}" "${ARGN}") @@ -168,9 +248,18 @@ function(protobuf_generate) endif() if(protobuf_generate_EXPORT_MACRO AND protobuf_generate_LANGUAGE STREQUAL cpp) - set(_dll_export_decl "dllexport_decl=${protobuf_generate_EXPORT_MACRO}:") + set(_dll_export_decl "dllexport_decl=${protobuf_generate_EXPORT_MACRO}") endif() + foreach(_option ${_dll_export_decl} ${protobuf_generate_PLUGIN_OPTIONS}) + # append comma - not using CMake lists and string replacement as users + # might have semicolons in options + if(_plugin_options) + set( _plugin_options "${_plugin_options},") + endif() + set(_plugin_options "${_plugin_options}${_option}") + endforeach() + if(protobuf_generate_PLUGIN) set(_plugin "--plugin=${protobuf_generate_PLUGIN}") endif() @@ -204,14 +293,12 @@ function(protobuf_generate) # Create an include path for each file specified foreach(_file ${protobuf_generate_PROTOS}) get_filename_component(_abs_file ${_file} ABSOLUTE) - get_filename_component(_abs_path ${_abs_file} PATH) - list(FIND _protobuf_include_path ${_abs_path} _contains_already) + get_filename_component(_abs_dir ${_abs_file} DIRECTORY) + list(FIND _protobuf_include_path ${_abs_dir} _contains_already) if(${_contains_already} EQUAL -1) - list(APPEND _protobuf_include_path -I ${_abs_path}) + list(APPEND _protobuf_include_path -I ${_abs_dir}) endif() endforeach() - else() - set(_protobuf_include_path -I ${CMAKE_CURRENT_SOURCE_DIR}) endif() foreach(DIR ${protobuf_generate_IMPORT_DIRS}) @@ -222,6 +309,10 @@ function(protobuf_generate) endif() endforeach() + if(NOT _protobuf_include_path) + set(_protobuf_include_path -I ${CMAKE_CURRENT_SOURCE_DIR}) + endif() + set(_generated_srcs_all) foreach(_proto ${protobuf_generate_PROTOS}) get_filename_component(_abs_file ${_proto} ABSOLUTE) @@ -246,12 +337,20 @@ function(protobuf_generate) endif() list(APPEND _generated_srcs_all ${_generated_srcs}) + set(_comment "Running ${protobuf_generate_LANGUAGE} protocol buffer compiler on ${_proto}") + if(protobuf_generate_PROTOC_OPTIONS) + set(_comment "${_comment}, protoc-options: ${protobuf_generate_PROTOC_OPTIONS}") + endif() + if(_plugin_options) + set(_comment "${_comment}, plugin-options: ${_plugin_options}") + endif() + add_custom_command( OUTPUT ${_generated_srcs} - COMMAND protobuf::protoc - ARGS --${protobuf_generate_LANGUAGE}_out ${_dll_export_decl}${protobuf_generate_PROTOC_OUT_DIR} ${_plugin} ${_dll_desc_out} ${_protobuf_include_path} ${_abs_file} - DEPENDS ${_abs_file} protobuf::protoc - COMMENT "Running ${protobuf_generate_LANGUAGE} protocol buffer compiler on ${_proto}" + COMMAND protobuf::protoc + ARGS ${protobuf_generate_PROTOC_OPTIONS} --${protobuf_generate_LANGUAGE}_out ${_plugin_options}:${protobuf_generate_PROTOC_OUT_DIR} ${_plugin} ${_dll_desc_out} ${_protobuf_include_path} ${_abs_file} + DEPENDS ${_abs_file} protobuf::protoc ${protobuf_generate_DEPENDENCIES} + COMMENT ${_comment} VERBATIM ) endforeach() diff --git a/Modules/FindPython/Support.cmake b/Modules/FindPython/Support.cmake index f78433d..65501e3 100644 --- a/Modules/FindPython/Support.cmake +++ b/Modules/FindPython/Support.cmake @@ -981,7 +981,7 @@ function (_PYTHON_VALIDATE_COMPILER) # retrieve python environment version from compiler set (working_dir "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/PythonCompilerVersion.dir") - file (WRITE "${working_dir}/version.py" "import sys; sys.stdout.write('.'.join([str(x) for x in sys.version_info[:3]]))\n") + file (WRITE "${working_dir}/version.py" "import sys; sys.stdout.write('.'.join([str(x) for x in sys.version_info[:3]])); sys.stdout.flush()\n") execute_process (COMMAND ${launcher} "${_${_PYTHON_PREFIX}_COMPILER}" ${_${_PYTHON_PREFIX}_IRON_PYTHON_COMPILER_ARCH_FLAGS} /target:exe /embed "${working_dir}/version.py" @@ -2520,7 +2520,7 @@ if ("Compiler" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS) # retrieve python environment version from compiler _python_get_launcher (_${_PYTHON_PREFIX}_COMPILER_LAUNCHER COMPILER) set (_${_PYTHON_PREFIX}_VERSION_DIR "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/PythonCompilerVersion.dir") - file (WRITE "${_${_PYTHON_PREFIX}_VERSION_DIR}/version.py" "import sys; sys.stdout.write('.'.join([str(x) for x in sys.version_info[:3]]))\n") + file (WRITE "${_${_PYTHON_PREFIX}_VERSION_DIR}/version.py" "import sys; sys.stdout.write('.'.join([str(x) for x in sys.version_info[:3]])); sys.stdout.flush()\n") execute_process (COMMAND ${_${_PYTHON_PREFIX}_COMPILER_LAUNCHER} "${_${_PYTHON_PREFIX}_COMPILER}" ${_${_PYTHON_PREFIX}_IRON_PYTHON_COMPILER_ARCH_FLAGS} /target:exe /embed "${_${_PYTHON_PREFIX}_VERSION_DIR}/version.py" diff --git a/Modules/FindQt.cmake b/Modules/FindQt.cmake index 44a1f41..604f8e3 100644 --- a/Modules/FindQt.cmake +++ b/Modules/FindQt.cmake @@ -91,7 +91,7 @@ endif () # now find qmake find_program(QT_QMAKE_EXECUTABLE_FINDQT NAMES qmake PATHS "${QT_SEARCH_PATH}/bin" "$ENV{QTDIR}/bin") if(QT_QMAKE_EXECUTABLE_FINDQT) - exec_program(${QT_QMAKE_EXECUTABLE_FINDQT} ARGS "-query QT_VERSION" + execute_process(COMMAND ${QT_QMAKE_EXECUTABLE_FINDQT} -query QT_VERSION OUTPUT_VARIABLE QTVERSION) if(QTVERSION MATCHES "4") set(QT_QMAKE_EXECUTABLE ${QT_QMAKE_EXECUTABLE_FINDQT} CACHE PATH "Qt4 qmake program.") @@ -103,8 +103,8 @@ if(QT_QMAKE_EXECUTABLE_FINDQT) endif() if(QT_QMAKE_EXECUTABLE_FINDQT) - exec_program( ${QT_QMAKE_EXECUTABLE_FINDQT} - ARGS "-query QT_INSTALL_HEADERS" + execute_process(COMMAND ${QT_QMAKE_EXECUTABLE_FINDQT} + -query QT_INSTALL_HEADERS OUTPUT_VARIABLE qt_headers ) endif() diff --git a/Modules/FindwxWindows.cmake b/Modules/FindwxWindows.cmake index 6e4be91..d1b25e1 100644 --- a/Modules/FindwxWindows.cmake +++ b/Modules/FindwxWindows.cmake @@ -635,14 +635,14 @@ else() # remember: always link shared to use systems GL etc. libs (no static # linking, just link *against* static .a libs) if(WXWINDOWS_USE_SHARED_LIBS) - set(WX_CONFIG_ARGS_LIBS "--libs") + set(WX_CONFIG_ARGS_LIBS --libs) else() - set(WX_CONFIG_ARGS_LIBS "--static --libs") + set(WX_CONFIG_ARGS_LIBS --static --libs) endif() # do we need additionial wx GL stuff like GLCanvas ? if(WXWINDOWS_USE_GL) - string(APPEND WX_CONFIG_ARGS_LIBS " --gl-libs" ) + list(APPEND WX_CONFIG_ARGS_LIBS --gl-libs) endif() ##message("DBG: WX_CONFIG_ARGS_LIBS=${WX_CONFIG_ARGS_LIBS}===") @@ -662,14 +662,15 @@ else() ##CMAKE_WXWINDOWS_CXX_FLAGS=${CMAKE_WXWINDOWS_CXX_FLAGS}===") # keep the back-quoted string for clarity - set(WXWINDOWS_LIBRARIES "`${CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE} ${WX_CONFIG_ARGS_LIBS}`") + string(REPLACE ";" " " _wx_config_args_libs "${WX_CONFIG_ARGS_LIBS}") + set(WXWINDOWS_LIBRARIES "`${CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE} ${_wx_config_args_libs}`") ##message("DBG2: for linking: ##WXWINDOWS_LIBRARIES=${WXWINDOWS_LIBRARIES}===") # evaluate wx-config output to separate linker flags and linkdirs for # rpath: - exec_program(${CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE} - ARGS ${WX_CONFIG_ARGS_LIBS} + execute_process(COMMAND ${CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE} + ${WX_CONFIG_ARGS_LIBS} OUTPUT_VARIABLE WX_CONFIG_LIBS ) ## extract linkdirs (-L) for rpath diff --git a/Modules/Platform/Apple-Clang.cmake b/Modules/Platform/Apple-Clang.cmake index 0681bfb..4d7546a 100644 --- a/Modules/Platform/Apple-Clang.cmake +++ b/Modules/Platform/Apple-Clang.cmake @@ -22,6 +22,10 @@ macro(__apple_compiler_clang lang) set(CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG "-mtvos-version-min=") elseif(_CMAKE_OSX_SYSROOT_PATH MATCHES "/AppleTVSimulator") set(CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG "-mtvos-simulator-version-min=") + elseif(_CMAKE_OSX_SYSROOT_PATH MATCHES "/XROS") + set(CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG "-mtargetos=xros") + elseif(_CMAKE_OSX_SYSROOT_PATH MATCHES "/XRSimulator") + set(CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG "-mtargetos=xros") elseif(_CMAKE_OSX_SYSROOT_PATH MATCHES "/WatchOS") set(CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG "-mwatchos-version-min=") elseif(_CMAKE_OSX_SYSROOT_PATH MATCHES "/WatchSimulator") diff --git a/Modules/Platform/Darwin-Initialize.cmake b/Modules/Platform/Darwin-Initialize.cmake index e253392..8d5bf8c 100644 --- a/Modules/Platform/Darwin-Initialize.cmake +++ b/Modules/Platform/Darwin-Initialize.cmake @@ -43,7 +43,7 @@ if(NOT CMAKE_CROSSCOMPILING AND unset(_sysctl_stdout) endif() -# macOS, iOS, tvOS, and watchOS should lookup compilers from +# macOS, iOS, tvOS, visionOS, and watchOS should lookup compilers from # Platform/Apple-${CMAKE_CXX_COMPILER_ID}-<LANG> set(CMAKE_EFFECTIVE_SYSTEM_NAME "Apple") @@ -76,6 +76,8 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL iOS) set(_CMAKE_OSX_SYSROOT_DEFAULT "iphoneos") elseif(CMAKE_SYSTEM_NAME STREQUAL tvOS) set(_CMAKE_OSX_SYSROOT_DEFAULT "appletvos") +elseif(CMAKE_SYSTEM_NAME STREQUAL visionOS) + set(_CMAKE_OSX_SYSROOT_DEFAULT "xros") elseif(CMAKE_SYSTEM_NAME STREQUAL watchOS) set(_CMAKE_OSX_SYSROOT_DEFAULT "watchos") elseif("${CMAKE_GENERATOR}" MATCHES Xcode diff --git a/Modules/Platform/Darwin.cmake b/Modules/Platform/Darwin.cmake index 48a9065..d614182 100644 --- a/Modules/Platform/Darwin.cmake +++ b/Modules/Platform/Darwin.cmake @@ -1,4 +1,4 @@ -if(CMAKE_SYSTEM_NAME STREQUAL "iOS" OR CMAKE_SYSTEM_NAME STREQUAL "tvOS" OR CMAKE_SYSTEM_NAME STREQUAL "watchOS") +if(CMAKE_SYSTEM_NAME STREQUAL "iOS" OR CMAKE_SYSTEM_NAME STREQUAL "tvOS" OR CMAKE_SYSTEM_NAME STREQUAL "visionOS" OR CMAKE_SYSTEM_NAME STREQUAL "watchOS") if(NOT DEFINED CMAKE_MACOSX_BUNDLE) set(CMAKE_MACOSX_BUNDLE ON) endif() diff --git a/Modules/Platform/Windows-MSVC.cmake b/Modules/Platform/Windows-MSVC.cmake index 8e96bf4..829ab9b 100644 --- a/Modules/Platform/Windows-MSVC.cmake +++ b/Modules/Platform/Windows-MSVC.cmake @@ -28,6 +28,8 @@ endif() if(CMAKE_SYSTEM_NAME STREQUAL "WindowsCE") set(_PLATFORM_LINK_FLAGS " /subsystem:windowsce") +elseif(CMAKE_SYSTEM_NAME STREQUAL "WindowsKernelModeDriver") + set(_PLATFORM_LINK_FLAGS " -subsystem:native -kernel -MANIFEST:NO") else() set(_PLATFORM_LINK_FLAGS "") endif() @@ -223,6 +225,18 @@ elseif(WINDOWS_PHONE OR WINDOWS_STORE) else() set(CMAKE_C_STANDARD_LIBRARIES_INIT "kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib") endif() +elseif(CMAKE_SYSTEM_NAME STREQUAL "WindowsKernelModeDriver") + set(CMAKE_C_STANDARD_LIBRARIES_INIT "") + set(_FLAGS_C " -kernel") + set(_FLAGS_CXX " -kernel") + foreach(t EXE SHARED MODULE) + string(APPEND CMAKE_${t}_LINKER_FLAGS_INIT " -NODEFAULTLIB") + endforeach() + if((_MSVC_C_ARCHITECTURE_FAMILY STREQUAL "x64") OR (_MSVC_CXX_ARCHITECTURE_FAMILY STREQUAL "x64")) + set(_PLATFORM_DEFINES "${_PLATFORM_DEFINES} -D_AMD64_ -DAMD64") + elseif((_MSVC_C_ARCHITECTURE_FAMILY STREQUAL "ARM64") OR (_MSVC_CXX_ARCHITECTURE_FAMILY STREQUAL "ARM64")) + set(_PLATFORM_DEFINES "${_PLATFORM_DEFINES} -D_ARM64_ -DARM64") + endif() else() set(_PLATFORM_DEFINES "/DWIN32") if((_MSVC_C_ARCHITECTURE_FAMILY STREQUAL "ARM64EC") OR (_MSVC_CXX_ARCHITECTURE_FAMILY STREQUAL "ARM64EC")) @@ -294,7 +308,7 @@ endif() # add /debug and /INCREMENTAL:YES to DEBUG and RELWITHDEBINFO also add pdbtype # on versions that support it set( MSVC_INCREMENTAL_YES_FLAG "") -if(NOT WINDOWS_PHONE AND NOT WINDOWS_STORE) +if(NOT WINDOWS_PHONE AND NOT WINDOWS_STORE AND NOT CMAKE_SYSTEM_NAME STREQUAL "WindowsKernelModeDriver") if(NOT MSVC_INCREMENTAL_DEFAULT) set( MSVC_INCREMENTAL_YES_FLAG "/INCREMENTAL:YES") else() @@ -353,8 +367,14 @@ macro(__windows_compiler_msvc lang) set(_CMAKE_VS_LINK_DLL "<CMAKE_COMMAND> -E vs_link_dll --intdir=<OBJECT_DIR> --rc=<CMAKE_RC_COMPILER> --mt=<CMAKE_MT> --manifests <MANIFESTS> -- ") set(_CMAKE_VS_LINK_EXE "<CMAKE_COMMAND> -E vs_link_exe --intdir=<OBJECT_DIR> --rc=<CMAKE_RC_COMPILER> --mt=<CMAKE_MT> --manifests <MANIFESTS> -- ") endif() + if(CMAKE_SYSTEM_NAME STREQUAL "WindowsKernelModeDriver") + set(_DLL_DRIVER "-driver") + else() + set(_DLL_DRIVER "/dll") + endif() set(CMAKE_${lang}_CREATE_SHARED_LIBRARY - "${_CMAKE_VS_LINK_DLL}<CMAKE_LINKER> ${CMAKE_CL_NOLOGO} <OBJECTS> ${CMAKE_START_TEMP_FILE} /out:<TARGET> /implib:<TARGET_IMPLIB> /pdb:<TARGET_PDB> /dll /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR>${_PLATFORM_LINK_FLAGS} <LINK_FLAGS> <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}") + "${_CMAKE_VS_LINK_DLL}<CMAKE_LINKER> ${CMAKE_CL_NOLOGO} <OBJECTS> ${CMAKE_START_TEMP_FILE} /out:<TARGET> /implib:<TARGET_IMPLIB> /pdb:<TARGET_PDB> ${_DLL_DRIVER} /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR>${_PLATFORM_LINK_FLAGS} <LINK_FLAGS> <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}") + unset(_DLL_DRIVER) set(CMAKE_${lang}_CREATE_SHARED_MODULE ${CMAKE_${lang}_CREATE_SHARED_LIBRARY}) set(CMAKE_${lang}_CREATE_STATIC_LIBRARY "<CMAKE_AR> ${CMAKE_CL_NOLOGO} <LINK_FLAGS> /out:<TARGET> <OBJECTS> ") diff --git a/Modules/Platform/Windows.cmake b/Modules/Platform/Windows.cmake index 8697e7a..1bf39cf 100644 --- a/Modules/Platform/Windows.cmake +++ b/Modules/Platform/Windows.cmake @@ -1,7 +1,11 @@ set(CMAKE_STATIC_LIBRARY_PREFIX "") set(CMAKE_STATIC_LIBRARY_SUFFIX ".lib") set(CMAKE_SHARED_LIBRARY_PREFIX "") # lib -set(CMAKE_SHARED_LIBRARY_SUFFIX ".dll") # .so +if(CMAKE_SYSTEM_NAME STREQUAL "WindowsKernelModeDriver") + set(CMAKE_SHARED_LIBRARY_SUFFIX ".sys") # .so +else() + set(CMAKE_SHARED_LIBRARY_SUFFIX ".dll") # .so +endif() set(CMAKE_IMPORT_LIBRARY_PREFIX "") set(CMAKE_IMPORT_LIBRARY_SUFFIX ".lib") set(CMAKE_EXECUTABLE_SUFFIX ".exe") # .exe diff --git a/Modules/Platform/WindowsKernelModeDriver-Initialize.cmake b/Modules/Platform/WindowsKernelModeDriver-Initialize.cmake new file mode 100644 index 0000000..6f0ef33 --- /dev/null +++ b/Modules/Platform/WindowsKernelModeDriver-Initialize.cmake @@ -0,0 +1,11 @@ +# undocumented, do not use outside of CMake +cmake_language(GET_EXPERIMENTAL_FEATURE_ENABLED "WindowsKernelModeDriver" _cmake_windows_kernel_mode_driver_enabled) +if(NOT _cmake_windows_kernel_mode_driver_enabled) + message(FATAL_ERROR "Windows kernel-mode driver experimental support is not enabled.") +endif() + +if(CMAKE_GENERATOR MATCHES "Visual Studio") + message(FATAL_ERROR "Visual Studio generators do not yet support CMAKE_SYSTEM_NAME=WindowsKernelModeDriver.") +endif() + +set(_CMAKE_FEATURE_DETECTION_TARGET_TYPE STATIC_LIBRARY) diff --git a/Modules/Platform/WindowsKernelModeDriver-MSVC-C.cmake b/Modules/Platform/WindowsKernelModeDriver-MSVC-C.cmake new file mode 100644 index 0000000..ce8060b --- /dev/null +++ b/Modules/Platform/WindowsKernelModeDriver-MSVC-C.cmake @@ -0,0 +1 @@ +include(Platform/Windows-MSVC-C) diff --git a/Modules/Platform/WindowsKernelModeDriver-MSVC-CXX.cmake b/Modules/Platform/WindowsKernelModeDriver-MSVC-CXX.cmake new file mode 100644 index 0000000..281eadc --- /dev/null +++ b/Modules/Platform/WindowsKernelModeDriver-MSVC-CXX.cmake @@ -0,0 +1 @@ +include(Platform/Windows-MSVC-CXX) diff --git a/Modules/Platform/WindowsKernelModeDriver.cmake b/Modules/Platform/WindowsKernelModeDriver.cmake new file mode 100644 index 0000000..65b2eae --- /dev/null +++ b/Modules/Platform/WindowsKernelModeDriver.cmake @@ -0,0 +1 @@ +include(Platform/Windows) diff --git a/Modules/Platform/visionOS-Determine-CXX.cmake b/Modules/Platform/visionOS-Determine-CXX.cmake new file mode 100644 index 0000000..ac80fa6 --- /dev/null +++ b/Modules/Platform/visionOS-Determine-CXX.cmake @@ -0,0 +1 @@ +include(Platform/Darwin-Determine-CXX) diff --git a/Modules/Platform/visionOS-Initialize.cmake b/Modules/Platform/visionOS-Initialize.cmake new file mode 100644 index 0000000..e8431bc --- /dev/null +++ b/Modules/Platform/visionOS-Initialize.cmake @@ -0,0 +1,7 @@ +include(Platform/Darwin-Initialize) + +if(NOT _CMAKE_OSX_SYSROOT_PATH MATCHES "/XR(OS|Simulator)") + message(FATAL_ERROR "${CMAKE_OSX_SYSROOT} is not an visionOS SDK") +endif() + +set(_CMAKE_FEATURE_DETECTION_TARGET_TYPE STATIC_LIBRARY) diff --git a/Modules/Platform/visionOS.cmake b/Modules/Platform/visionOS.cmake new file mode 100644 index 0000000..850ddc2 --- /dev/null +++ b/Modules/Platform/visionOS.cmake @@ -0,0 +1 @@ +include(Platform/Darwin) diff --git a/Modules/UsePkgConfig.cmake b/Modules/UsePkgConfig.cmake index 32d228d..b020259 100644 --- a/Modules/UsePkgConfig.cmake +++ b/Modules/UsePkgConfig.cmake @@ -35,25 +35,25 @@ macro(PKGCONFIG _package _include_DIR _link_DIR _link_FLAGS _cflags) # if pkg-config has been found if(PKGCONFIG_EXECUTABLE) - exec_program(${PKGCONFIG_EXECUTABLE} ARGS ${_package} --exists RETURN_VALUE _return_VALUE OUTPUT_VARIABLE _pkgconfigDevNull ) + execute_process(COMMAND ${PKGCONFIG_EXECUTABLE} ${_package} --exists RESULT_VARIABLE _return_VALUE OUTPUT_VARIABLE _pkgconfigDevNull ) # and if the package of interest also exists for pkg-config, then get the information if(NOT _return_VALUE) - exec_program(${PKGCONFIG_EXECUTABLE} ARGS ${_package} --variable=includedir + execute_process(COMMAND ${PKGCONFIG_EXECUTABLE} ${_package} --variable=includedir OUTPUT_VARIABLE ${_include_DIR} ) string(REGEX REPLACE "[\r\n]" " " ${_include_DIR} "${${_include_DIR}}") - exec_program(${PKGCONFIG_EXECUTABLE} ARGS ${_package} --variable=libdir + execute_process(COMMAND ${PKGCONFIG_EXECUTABLE} ${_package} --variable=libdir OUTPUT_VARIABLE ${_link_DIR} ) string(REGEX REPLACE "[\r\n]" " " ${_link_DIR} "${${_link_DIR}}") - exec_program(${PKGCONFIG_EXECUTABLE} ARGS ${_package} --libs + execute_process(COMMAND ${PKGCONFIG_EXECUTABLE} ${_package} --libs OUTPUT_VARIABLE ${_link_FLAGS} ) string(REGEX REPLACE "[\r\n]" " " ${_link_FLAGS} "${${_link_FLAGS}}") - exec_program(${PKGCONFIG_EXECUTABLE} ARGS ${_package} --cflags + execute_process(COMMAND ${PKGCONFIG_EXECUTABLE} ${_package} --cflags OUTPUT_VARIABLE ${_cflags} ) string(REGEX REPLACE "[\r\n]" " " ${_cflags} "${${_cflags}}") diff --git a/Modules/UseSWIG.cmake b/Modules/UseSWIG.cmake index ca16bc2..cece973 100644 --- a/Modules/UseSWIG.cmake +++ b/Modules/UseSWIG.cmake @@ -189,7 +189,7 @@ ensure generated files will receive the required settings. :ref:`Makefile <Makefile Generators>`, :ref:`Ninja <Ninja Generators>`, :generator:`Xcode`, and :ref:`Visual Studio <Visual Studio Generators>` - (:generator:`Visual Studio 11 2012` and above) generators. Default value is + (:generator:`Visual Studio 12 2013` and above) generators. Default value is ``FALSE``. .. versionadded:: 3.21 @@ -353,7 +353,7 @@ as well as ``SWIG``: :ref:`Makefile <Makefile Generators>`, :ref:`Ninja <Ninja Generators>`, :generator:`Xcode`, and :ref:`Visual Studio <Visual Studio Generators>` - (:generator:`Visual Studio 11 2012` and above) generators. Default value is + (:generator:`Visual Studio 12 2013` and above) generators. Default value is ``FALSE``. Source file property ``USE_SWIG_DEPENDENCIES``, if not defined, will be @@ -68,8 +68,8 @@ you can build directly in the source tree:: Or, if you plan to develop CMake or otherwise run the test suite, create a separate build tree:: - $ mkdir cmake-build && cd cmake-build - $ ../cmake-source/bootstrap && make + $ mkdir build && cd build + $ ../bootstrap && make Windows ^^^^^^^ diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index f022dda..6581e0d 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -371,6 +371,8 @@ add_library( cmNewLineStyle.cxx cmOrderDirectories.cxx cmOrderDirectories.h + cmPlistParser.cxx + cmPlistParser.h cmPolicies.h cmPolicies.cxx cmProcessOutput.cxx @@ -438,6 +440,7 @@ add_library( cmUVHandlePtr.h cmUVProcessChain.cxx cmUVProcessChain.h + cmUVStream.h cmUVStreambuf.h cmUVSignalHackRAII.h cmVariableWatch.cxx @@ -450,6 +453,8 @@ add_library( cmWorkerPool.h cmWorkingDirectory.cxx cmWorkingDirectory.h + cmXcFramework.cxx + cmXcFramework.h cmXMLParser.cxx cmXMLParser.h cmXMLSafe.cxx @@ -928,6 +933,44 @@ if(WIN32 OR CMAKE_SYSTEM_NAME STREQUAL "Linux") ) endif() +if(CMake_BUILD_PCH) + target_precompile_headers(CMakeLib PRIVATE + "$<$<COMPILE_LANGUAGE:CXX>:<string$<ANGLE-R>>" + "$<$<COMPILE_LANGUAGE:CXX>:<iostream$<ANGLE-R>>" + "$<$<COMPILE_LANGUAGE:CXX>:<sstream$<ANGLE-R>>" + "$<$<COMPILE_LANGUAGE:CXX>:<iomanip$<ANGLE-R>>" + "$<$<COMPILE_LANGUAGE:CXX>:<cm/memory$<ANGLE-R>>" + "$<$<COMPILE_LANGUAGE:CXX>:<cm3p/cppdap/protocol.h$<ANGLE-R>>" + "$<$<COMPILE_LANGUAGE:CXX>:cmMakefile.h>" + "$<$<COMPILE_LANGUAGE:CXX>:cmGlobalGenerator.h>" + "$<$<COMPILE_LANGUAGE:CXX>:cmLocalGenerator.h>" + "$<$<COMPILE_LANGUAGE:CXX>:cmGeneratorTarget.h>" + "$<$<COMPILE_LANGUAGE:CXX>:cmGeneratorExpression.h>" + "$<$<COMPILE_LANGUAGE:CXX>:cmArgumentParser.h>" + "$<$<COMPILE_LANGUAGE:CXX>:cmake.h>" + "$<$<COMPILE_LANGUAGE:CXX>:cmCMakePath.h>" + "$<$<COMPILE_LANGUAGE:CXX>:cmDebuggerPipeConnection.h>" + "$<$<COMPILE_LANGUAGE:CXX>:cmCurl.h>") + + set_source_files_properties( + "LexerParser/cmFortranLexer.cxx" + PROPERTIES SKIP_PRECOMPILE_HEADERS ON) + + if(WIN32) + target_precompile_headers(CMakeLib PRIVATE + "$<$<COMPILE_LANGUAGE:CXX>:<cm3p/uv.h$<ANGLE-R>>" + "$<$<COMPILE_LANGUAGE:CXX>:cmVSSetupHelper.h>") + set_source_files_properties("LexerParser/cmFortranParser.cxx" PROPERTIES SKIP_PRECOMPILE_HEADERS ON) + else() + set_source_files_properties( + "LexerParser/cmCommandArgumentLexer.cxx" + "LexerParser/cmGccDepfileLexer.cxx" + "LexerParser/cmExprLexer.cxx" + "LexerParser/cmDependsJavaLexer.cxx" + PROPERTIES SKIP_PRECOMPILE_HEADERS ON) + endif() +endif() + # Temporary variable for tools targets set(_tools) @@ -1036,6 +1079,24 @@ target_include_directories( ) target_link_libraries(CTestLib PUBLIC CMakeLib) +if(CMake_BUILD_PCH) + target_precompile_headers(CTestLib PRIVATE + "cmDuration.h" + "cmMakefile.h" + "cmSystemTools.h" + "cmGlobalGenerator.h" + "cmake.h" + "CTest/cmCTestGenericHandler.h" + "<sstream>" + "<cm3p/uv.h>") + + if(WIN32) + target_precompile_headers(CTestLib PRIVATE "cmCurl.h" "CTest/cmCTestMultiProcessHandler.h") + else() + set_source_files_properties("LexerParser/cmCTestResourceGroupsLexer.cxx" PROPERTIES SKIP_PRECOMPILE_HEADERS ON) + endif() +endif() + # # Build CPackLib # diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index d5b9a2a..d2d44ac 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 27) -set(CMake_VERSION_PATCH 1) +set(CMake_VERSION_PATCH 20230801) #set(CMake_VERSION_RC 0) set(CMake_VERSION_IS_DIRTY 0) diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx index afd85cd..11d90c0 100644 --- a/Source/CPack/cmCPackGenerator.cxx +++ b/Source/CPack/cmCPackGenerator.cxx @@ -1119,8 +1119,8 @@ int cmCPackGenerator::DoPackage() // Run post-build actions cmValue postBuildScripts = this->GetOption("CPACK_POST_BUILD_SCRIPTS"); if (postBuildScripts) { - this->MakefileMap->AddDefinition("CPACK_PACKAGE_FILES", - cmJoin(this->packageFileNames, ";")); + this->MakefileMap->AddDefinition( + "CPACK_PACKAGE_FILES", cmList::to_string(this->packageFileNames)); const cmList scripts{ postBuildScripts }; for (const auto& script : scripts) { diff --git a/Source/CPack/cmCPackNuGetGenerator.cxx b/Source/CPack/cmCPackNuGetGenerator.cxx index 5de8179..aa99fb6 100644 --- a/Source/CPack/cmCPackNuGetGenerator.cxx +++ b/Source/CPack/cmCPackNuGetGenerator.cxx @@ -12,7 +12,7 @@ #include "cmCPackComponentGroup.h" #include "cmCPackLog.h" -#include "cmStringAlgorithms.h" +#include "cmList.h" #include "cmSystemTools.h" #include "cmValue.h" @@ -82,10 +82,10 @@ void cmCPackNuGetGenerator::SetupGroupComponentVariables(bool ignoreGroup) std::back_inserter(components), [](cmCPackComponent const* comp) { return comp->Name; }); this->SetOption("CPACK_NUGET_" + compGUp + "_GROUP_COMPONENTS", - cmJoin(components, ";")); + cmList::to_string(components)); } if (!groups.empty()) { - this->SetOption("CPACK_NUGET_GROUPS", cmJoin(groups, ";")); + this->SetOption("CPACK_NUGET_GROUPS", cmList::to_string(groups)); } // Handle Orphan components (components not belonging to any groups) @@ -103,7 +103,7 @@ void cmCPackNuGetGenerator::SetupGroupComponentVariables(bool ignoreGroup) } } if (!components.empty()) { - this->SetOption("CPACK_NUGET_COMPONENTS", cmJoin(components, ";")); + this->SetOption("CPACK_NUGET_COMPONENTS", cmList::to_string(components)); } } else { @@ -114,7 +114,7 @@ void cmCPackNuGetGenerator::SetupGroupComponentVariables(bool ignoreGroup) [](std::pair<std::string, cmCPackComponent> const& comp) { return comp.first; }); - this->SetOption("CPACK_NUGET_COMPONENTS", cmJoin(components, ";")); + this->SetOption("CPACK_NUGET_COMPONENTS", cmList::to_string(components)); } } diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx index 90716e6..00c8fa2 100644 --- a/Source/CPack/cpack.cxx +++ b/Source/CPack/cpack.cxx @@ -363,11 +363,11 @@ int main(int argc, char const* const* argv) } if (!expandedPreset->Generators.empty() && generator.empty()) { - generator = cmJoin(expandedPreset->Generators, ";"); + generator = cmList::to_string(expandedPreset->Generators); } if (!expandedPreset->Configurations.empty() && cpackBuildConfig.empty()) { - cpackBuildConfig = cmJoin(expandedPreset->Configurations, ";"); + cpackBuildConfig = cmList::to_string(expandedPreset->Configurations); } definitions.insert(expandedPreset->Variables.begin(), diff --git a/Source/CTest/cmCTestBZR.cxx b/Source/CTest/cmCTestBZR.cxx index 81a866a..246e811 100644 --- a/Source/CTest/cmCTestBZR.cxx +++ b/Source/CTest/cmCTestBZR.cxx @@ -16,7 +16,6 @@ #include "cmCTest.h" #include "cmCTestVC.h" -#include "cmProcessTools.h" #include "cmSystemTools.h" #include "cmXMLParser.h" diff --git a/Source/CTest/cmCTestBuildHandler.cxx b/Source/CTest/cmCTestBuildHandler.cxx index 882b579..00ecf42 100644 --- a/Source/CTest/cmCTestBuildHandler.cxx +++ b/Source/CTest/cmCTestBuildHandler.cxx @@ -3,6 +3,7 @@ #include "cmCTestBuildHandler.h" #include <cstdlib> +#include <ratio> #include <set> #include <utility> diff --git a/Source/CTest/cmCTestCVS.cxx b/Source/CTest/cmCTestCVS.cxx index 87ab762..95e898c 100644 --- a/Source/CTest/cmCTestCVS.cxx +++ b/Source/CTest/cmCTestCVS.cxx @@ -10,7 +10,6 @@ #include "cmsys/RegularExpression.hxx" #include "cmCTest.h" -#include "cmProcessTools.h" #include "cmStringAlgorithms.h" #include "cmSystemTools.h" #include "cmXMLWriter.h" diff --git a/Source/CTest/cmCTestConfigureCommand.cxx b/Source/CTest/cmCTestConfigureCommand.cxx index bae1f54..e0326a9 100644 --- a/Source/CTest/cmCTestConfigureCommand.cxx +++ b/Source/CTest/cmCTestConfigureCommand.cxx @@ -4,6 +4,7 @@ #include <cstring> #include <sstream> +#include <vector> #include <cmext/string_view> diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx index 5c48cbf..2874be7 100644 --- a/Source/CTest/cmCTestCoverageHandler.cxx +++ b/Source/CTest/cmCTestCoverageHandler.cxx @@ -9,7 +9,9 @@ #include <cstring> #include <iomanip> #include <iterator> +#include <ratio> #include <sstream> +#include <type_traits> #include <utility> #include <cmext/algorithm> diff --git a/Source/CTest/cmCTestGIT.cxx b/Source/CTest/cmCTestGIT.cxx index a6e7ac5..5f8cb74 100644 --- a/Source/CTest/cmCTestGIT.cxx +++ b/Source/CTest/cmCTestGIT.cxx @@ -16,7 +16,6 @@ #include "cmCTestVC.h" #include "cmList.h" #include "cmProcessOutput.h" -#include "cmProcessTools.h" #include "cmStringAlgorithms.h" #include "cmSystemTools.h" #include "cmValue.h" diff --git a/Source/CTest/cmCTestHG.cxx b/Source/CTest/cmCTestHG.cxx index 97b01ba..02837ba 100644 --- a/Source/CTest/cmCTestHG.cxx +++ b/Source/CTest/cmCTestHG.cxx @@ -11,7 +11,6 @@ #include "cmCTest.h" #include "cmCTestVC.h" -#include "cmProcessTools.h" #include "cmSystemTools.h" #include "cmXMLParser.h" diff --git a/Source/CTest/cmCTestMemCheckHandler.cxx b/Source/CTest/cmCTestMemCheckHandler.cxx index 6f6a642..b51de84 100644 --- a/Source/CTest/cmCTestMemCheckHandler.cxx +++ b/Source/CTest/cmCTestMemCheckHandler.cxx @@ -7,6 +7,7 @@ #include <cstring> #include <iostream> #include <iterator> +#include <ratio> #include <sstream> #include <utility> diff --git a/Source/CTest/cmCTestP4.cxx b/Source/CTest/cmCTestP4.cxx index e22ec4b..0e002b9 100644 --- a/Source/CTest/cmCTestP4.cxx +++ b/Source/CTest/cmCTestP4.cxx @@ -14,7 +14,6 @@ #include "cmCTest.h" #include "cmCTestVC.h" #include "cmList.h" -#include "cmProcessTools.h" #include "cmRange.h" #include "cmSystemTools.h" diff --git a/Source/CTest/cmCTestSVN.cxx b/Source/CTest/cmCTestSVN.cxx index 4c98fdf..91a1177 100644 --- a/Source/CTest/cmCTestSVN.cxx +++ b/Source/CTest/cmCTestSVN.cxx @@ -13,7 +13,6 @@ #include "cmCTest.h" #include "cmCTestVC.h" -#include "cmProcessTools.h" #include "cmStringAlgorithms.h" #include "cmSystemTools.h" #include "cmXMLParser.h" diff --git a/Source/CTest/cmCTestTestCommand.cxx b/Source/CTest/cmCTestTestCommand.cxx index 5488388..c717868 100644 --- a/Source/CTest/cmCTestTestCommand.cxx +++ b/Source/CTest/cmCTestTestCommand.cxx @@ -4,6 +4,7 @@ #include <chrono> #include <cstdlib> +#include <ratio> #include <sstream> #include <cmext/string_view> diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index 6b02a5e..94014a8 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -13,6 +13,7 @@ #include <functional> #include <iomanip> #include <iterator> +#include <ratio> #include <set> #include <sstream> #include <utility> @@ -2617,6 +2618,21 @@ bool cmCTestTestHandler::WriteJUnitXML() xml.EndElement(); // </failure> } + xml.StartElement("properties"); + if ((result.Properties) && (!result.Properties->Labels.empty())) { + xml.StartElement("property"); + xml.Attribute("name", "cmake_labels"); + // Pass the property as a cmake-formatted list, consumers will know + // anyway that this information is coming from cmake, so it should + // be ok to put it here as a cmake-list. + xml.Attribute("value", cmList::to_string(result.Properties->Labels)); + // if we export more properties, this should be done the same way, + // i.e. prefix the property name with "cmake_", and it it can be + // a list, write it cmake-formatted. + xml.EndElement(); // </property> + } + xml.EndElement(); // </properties> + // Note: compressed test output is unconditionally disabled when // --output-junit is specified. xml.Element("system-out", result.Output); diff --git a/Source/CTest/cmCTestTestHandler.h b/Source/CTest/cmCTestTestHandler.h index 315a5b7..3e80c94 100644 --- a/Source/CTest/cmCTestTestHandler.h +++ b/Source/CTest/cmCTestTestHandler.h @@ -22,7 +22,7 @@ #include "cmCTest.h" #include "cmCTestGenericHandler.h" #include "cmCTestResourceSpec.h" -#include "cmCTestTypes.h" +#include "cmCTestTypes.h" // IWYU pragma: keep #include "cmDuration.h" #include "cmListFileCache.h" #include "cmValue.h" diff --git a/Source/CTest/cmParseGTMCoverage.cxx b/Source/CTest/cmParseGTMCoverage.cxx index 14417cc..c63b496 100644 --- a/Source/CTest/cmParseGTMCoverage.cxx +++ b/Source/CTest/cmParseGTMCoverage.cxx @@ -2,7 +2,6 @@ #include <cstdio> #include <cstdlib> -#include <map> #include <vector> #include "cmsys/Directory.hxx" diff --git a/Source/CTest/cmProcess.cxx b/Source/CTest/cmProcess.cxx index 269b92c..2c809b6 100644 --- a/Source/CTest/cmProcess.cxx +++ b/Source/CTest/cmProcess.cxx @@ -4,6 +4,7 @@ #include <csignal> #include <iostream> +#include <ratio> #include <string> #include <utility> diff --git a/Source/Checks/Curses/CMakeLists.txt b/Source/Checks/Curses/CMakeLists.txt index 0fee7ac..bc6b906 100644 --- a/Source/Checks/Curses/CMakeLists.txt +++ b/Source/Checks/Curses/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.13...3.24 FATAL_ERROR) +cmake_minimum_required(VERSION 3.13...3.26 FATAL_ERROR) project(CheckCurses C) set(CURSES_NEED_NCURSES TRUE) diff --git a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx index fc5450e..0b104ea 100644 --- a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx +++ b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx @@ -4,6 +4,7 @@ #include <cassert> #include <utility> +#include <vector> #include <cm/memory> diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx index a1b2149..77a0048 100644 --- a/Source/CursesDialog/cmCursesMainForm.cxx +++ b/Source/CursesDialog/cmCursesMainForm.cxx @@ -458,6 +458,14 @@ void cmCursesMainForm::UpdateProgress(const std::string& msg, float prog) } } +void cmCursesMainForm::Write() +{ + this->FillCacheManagerFromUI(); + this->CMakeInstance->SaveCache( + this->CMakeInstance->GetHomeOutputDirectory()); + this->LoadCache(nullptr); +} + int cmCursesMainForm::Configure(int noconfigure) { this->ResetOutputs(); @@ -471,10 +479,7 @@ int cmCursesMainForm::Configure(int noconfigure) } // always save the current gui values to disk - this->FillCacheManagerFromUI(); - this->CMakeInstance->SaveCache( - this->CMakeInstance->GetHomeOutputDirectory()); - this->LoadCache(nullptr); + this->Write(); // run the generate process this->OkToGenerate = true; @@ -794,6 +799,21 @@ void cmCursesMainForm::HandleInput() else if (key == KEY_PPAGE || key == ctrl('u')) { form_driver(this->Form, REQ_PREV_PAGE); } + // first entry + else if (key == KEY_HOME) { + form_driver(this->Form, REQ_FIRST_PAGE); + form_driver(this->Form, REQ_FIRST_FIELD); + } + // last entry + else if (key == KEY_END) { + form_driver(this->Form, REQ_LAST_PAGE); + form_driver(this->Form, REQ_LAST_FIELD); + } + // write and quit + else if (key == 'w') { + this->Write(); + break; + } // configure else if (key == 'c') { this->Configure(); @@ -854,6 +874,10 @@ void cmCursesMainForm::HandleInput() if (!this->OldSearchString.empty()) { this->JumpToCacheEntry(this->OldSearchString.c_str()); } + } else if (key == 'N') { + if (!this->OldSearchString.empty()) { + this->JumpToCacheEntry(this->OldSearchString.c_str(), true); + } } // switch advanced on/off else if (key == 't') { @@ -945,6 +969,11 @@ int cmCursesMainForm::LoadCache(const char* /*unused*/) void cmCursesMainForm::JumpToCacheEntry(const char* astr) { + this->JumpToCacheEntry(astr, false); +} + +void cmCursesMainForm::JumpToCacheEntry(const char* astr, bool reverse) +{ std::string str; if (astr) { str = cmSystemTools::LowerCase(astr); @@ -973,12 +1002,21 @@ void cmCursesMainForm::JumpToCacheEntry(const char* astr) } } } - if (static_cast<size_t>(findex) >= 3 * this->NumberOfVisibleEntries - 1) { - set_current_field(this->Form, this->Fields[2]); - } else if (new_page(this->Fields[findex + 1])) { - form_driver(this->Form, REQ_NEXT_PAGE); + if (!reverse && + static_cast<size_t>(findex) >= 3 * this->NumberOfVisibleEntries - 1) { + form_driver(this->Form, REQ_FIRST_PAGE); + form_driver(this->Form, REQ_FIRST_FIELD); + } else if (reverse && static_cast<size_t>(findex) < 3) { + form_driver(this->Form, REQ_LAST_PAGE); + form_driver(this->Form, REQ_LAST_FIELD); + } else if (this->Fields[findex + (reverse ? -3 : 1)]->page != + this->Fields[findex]->page) { + form_driver(this->Form, reverse ? REQ_PREV_PAGE : REQ_NEXT_PAGE); + if (reverse) { + form_driver(this->Form, REQ_LAST_FIELD); + } } else { - form_driver(this->Form, REQ_NEXT_FIELD); + form_driver(this->Form, reverse ? REQ_PREV_FIELD : REQ_NEXT_FIELD); } cur = current_field(this->Form); findex = field_index(cur); @@ -1040,15 +1078,21 @@ const char* cmCursesMainForm::s_ConstHelpMessage = "hit 'g' to have CMake generate all the build files (i.e. makefiles or " "project files) and exit. " "At any point during the process, you can exit ccmake with 'q'. However, " - "this will not generate/change any build files.\n\n" + "this will not generate/change any build files. Additionally, you can exit " + "ccmake with 'w' to write changes to the cache file without generating or " + "changing the build files.\n\n" "ccmake KEYS:\n\n" "Navigation: " "You can use the arrow keys and page up, down to navigate the options. " - "Alternatively, you can use the following keys: \n" + "Additionally, you can use the following keys: \n" " C-n or j : next option\n" " C-p or k : previous options\n" " C-d : down one page\n" - " C-u : up one page\n\n" + " C-u : up one page\n" + " Home : jump to first option\n" + " End : jump to last option\n" + " n : next search result\n" + " N : previous search result\n\n" "Editing options: " "To change an option press enter or return. If the current options is a " "boolean, this will toggle its value. " diff --git a/Source/CursesDialog/cmCursesMainForm.h b/Source/CursesDialog/cmCursesMainForm.h index 112b7e8..1ce75e7 100644 --- a/Source/CursesDialog/cmCursesMainForm.h +++ b/Source/CursesDialog/cmCursesMainForm.h @@ -87,6 +87,11 @@ public: void AddError(const std::string& message, const char* title) override; /** + * Write files to cache file without reconfiguring. + */ + void Write(); + + /** * Used to do a configure. If argument is specified, it does only the check * and not configure. */ @@ -123,6 +128,7 @@ protected: // Jump to the cache entry whose name matches the string. void JumpToCacheEntry(const char* str); + void JumpToCacheEntry(const char* str, bool reverse); // Clear and reset the output log and state void ResetOutputs(); diff --git a/Source/LexerParser/cmCommandArgumentParser.cxx b/Source/LexerParser/cmCommandArgumentParser.cxx index 4c49e0f..7ea0b15 100644 --- a/Source/LexerParser/cmCommandArgumentParser.cxx +++ b/Source/LexerParser/cmCommandArgumentParser.cxx @@ -97,7 +97,6 @@ Run bison like this: # include <malloc.h> #endif -#include <stdint.h> /* Make sure the parser uses standard memory allocation. The default generated parser malloc/free declarations do not work on all platforms. */ @@ -137,7 +136,7 @@ static void cmCommandArgument_yyerror(yyscan_t yyscanner, const char* message); # endif #endif -#line 141 "cmCommandArgumentParser.cxx" +#line 140 "cmCommandArgumentParser.cxx" # ifndef YY_CAST # ifdef __cplusplus @@ -576,9 +575,9 @@ static const yytype_int8 yytranslate[] = /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint8 yyrline[] = { - 0, 102, 102, 108, 111, 116, 119, 124, 127, 132, - 135, 138, 141, 144, 147, 152, 155, 158, 161, 166, - 169, 174, 177, 182, 185 + 0, 101, 101, 107, 110, 115, 118, 123, 126, 131, + 134, 137, 140, 143, 146, 151, 154, 157, 160, 165, + 168, 173, 176, 181, 184 }; #endif @@ -1437,192 +1436,192 @@ yyreduce: switch (yyn) { case 2: /* Start: GoalWithOptionalBackSlash */ -#line 102 "cmCommandArgumentParser.y" +#line 101 "cmCommandArgumentParser.y" { (yyval.str) = 0; yyGetParser->SetResult((yyvsp[0].str)); } -#line 1446 "cmCommandArgumentParser.cxx" +#line 1445 "cmCommandArgumentParser.cxx" break; case 3: /* GoalWithOptionalBackSlash: Goal */ -#line 108 "cmCommandArgumentParser.y" +#line 107 "cmCommandArgumentParser.y" { (yyval.str) = (yyvsp[0].str); } -#line 1454 "cmCommandArgumentParser.cxx" +#line 1453 "cmCommandArgumentParser.cxx" break; case 4: /* GoalWithOptionalBackSlash: Goal "\\" */ -#line 111 "cmCommandArgumentParser.y" +#line 110 "cmCommandArgumentParser.y" { (yyval.str) = yyGetParser->CombineUnions((yyvsp[-1].str), (yyvsp[0].str)); } -#line 1462 "cmCommandArgumentParser.cxx" +#line 1461 "cmCommandArgumentParser.cxx" break; case 5: /* Goal: %empty */ -#line 116 "cmCommandArgumentParser.y" +#line 115 "cmCommandArgumentParser.y" { (yyval.str) = 0; } -#line 1470 "cmCommandArgumentParser.cxx" +#line 1469 "cmCommandArgumentParser.cxx" break; case 6: /* Goal: String Goal */ -#line 119 "cmCommandArgumentParser.y" +#line 118 "cmCommandArgumentParser.y" { (yyval.str) = yyGetParser->CombineUnions((yyvsp[-1].str), (yyvsp[0].str)); } -#line 1478 "cmCommandArgumentParser.cxx" +#line 1477 "cmCommandArgumentParser.cxx" break; case 7: /* String: OuterText */ -#line 124 "cmCommandArgumentParser.y" +#line 123 "cmCommandArgumentParser.y" { (yyval.str) = (yyvsp[0].str); } -#line 1486 "cmCommandArgumentParser.cxx" +#line 1485 "cmCommandArgumentParser.cxx" break; case 8: /* String: Variable */ -#line 127 "cmCommandArgumentParser.y" +#line 126 "cmCommandArgumentParser.y" { (yyval.str) = (yyvsp[0].str); } -#line 1494 "cmCommandArgumentParser.cxx" +#line 1493 "cmCommandArgumentParser.cxx" break; case 9: /* OuterText: cal_NAME */ -#line 132 "cmCommandArgumentParser.y" +#line 131 "cmCommandArgumentParser.y" { (yyval.str) = (yyvsp[0].str); } -#line 1502 "cmCommandArgumentParser.cxx" +#line 1501 "cmCommandArgumentParser.cxx" break; case 10: /* OuterText: "@" */ -#line 135 "cmCommandArgumentParser.y" +#line 134 "cmCommandArgumentParser.y" { (yyval.str) = (yyvsp[0].str); } -#line 1510 "cmCommandArgumentParser.cxx" +#line 1509 "cmCommandArgumentParser.cxx" break; case 11: /* OuterText: "$" */ -#line 138 "cmCommandArgumentParser.y" +#line 137 "cmCommandArgumentParser.y" { (yyval.str) = (yyvsp[0].str); } -#line 1518 "cmCommandArgumentParser.cxx" +#line 1517 "cmCommandArgumentParser.cxx" break; case 12: /* OuterText: "{" */ -#line 141 "cmCommandArgumentParser.y" +#line 140 "cmCommandArgumentParser.y" { (yyval.str) = (yyvsp[0].str); } -#line 1526 "cmCommandArgumentParser.cxx" +#line 1525 "cmCommandArgumentParser.cxx" break; case 13: /* OuterText: "}" */ -#line 144 "cmCommandArgumentParser.y" +#line 143 "cmCommandArgumentParser.y" { (yyval.str) = (yyvsp[0].str); } -#line 1534 "cmCommandArgumentParser.cxx" +#line 1533 "cmCommandArgumentParser.cxx" break; case 14: /* OuterText: cal_SYMBOL */ -#line 147 "cmCommandArgumentParser.y" +#line 146 "cmCommandArgumentParser.y" { (yyval.str) = (yyvsp[0].str); } -#line 1542 "cmCommandArgumentParser.cxx" +#line 1541 "cmCommandArgumentParser.cxx" break; case 15: /* Variable: cal_ENVCURLY EnvVarName "}" */ -#line 152 "cmCommandArgumentParser.y" +#line 151 "cmCommandArgumentParser.y" { (yyval.str) = yyGetParser->ExpandSpecialVariable((yyvsp[-2].str), (yyvsp[-1].str)); } -#line 1550 "cmCommandArgumentParser.cxx" +#line 1549 "cmCommandArgumentParser.cxx" break; case 16: /* Variable: cal_NCURLY MultipleIds "}" */ -#line 155 "cmCommandArgumentParser.y" +#line 154 "cmCommandArgumentParser.y" { (yyval.str) = yyGetParser->ExpandSpecialVariable((yyvsp[-2].str), (yyvsp[-1].str)); } -#line 1558 "cmCommandArgumentParser.cxx" +#line 1557 "cmCommandArgumentParser.cxx" break; case 17: /* Variable: cal_DCURLY MultipleIds "}" */ -#line 158 "cmCommandArgumentParser.y" +#line 157 "cmCommandArgumentParser.y" { (yyval.str) = yyGetParser->ExpandVariable((yyvsp[-1].str)); } -#line 1566 "cmCommandArgumentParser.cxx" +#line 1565 "cmCommandArgumentParser.cxx" break; case 18: /* Variable: cal_ATNAME */ -#line 161 "cmCommandArgumentParser.y" +#line 160 "cmCommandArgumentParser.y" { (yyval.str) = yyGetParser->ExpandVariableForAt((yyvsp[0].str)); } -#line 1574 "cmCommandArgumentParser.cxx" +#line 1573 "cmCommandArgumentParser.cxx" break; case 19: /* EnvVarName: MultipleIds */ -#line 166 "cmCommandArgumentParser.y" +#line 165 "cmCommandArgumentParser.y" { (yyval.str) = (yyvsp[0].str); } -#line 1582 "cmCommandArgumentParser.cxx" +#line 1581 "cmCommandArgumentParser.cxx" break; case 20: /* EnvVarName: cal_SYMBOL EnvVarName */ -#line 169 "cmCommandArgumentParser.y" +#line 168 "cmCommandArgumentParser.y" { (yyval.str) = (yyvsp[-1].str); } -#line 1590 "cmCommandArgumentParser.cxx" +#line 1589 "cmCommandArgumentParser.cxx" break; case 21: /* MultipleIds: %empty */ -#line 174 "cmCommandArgumentParser.y" +#line 173 "cmCommandArgumentParser.y" { (yyval.str) = 0; } -#line 1598 "cmCommandArgumentParser.cxx" +#line 1597 "cmCommandArgumentParser.cxx" break; case 22: /* MultipleIds: ID MultipleIds */ -#line 177 "cmCommandArgumentParser.y" +#line 176 "cmCommandArgumentParser.y" { (yyval.str) = yyGetParser->CombineUnions((yyvsp[-1].str), (yyvsp[0].str)); } -#line 1606 "cmCommandArgumentParser.cxx" +#line 1605 "cmCommandArgumentParser.cxx" break; case 23: /* ID: cal_NAME */ -#line 182 "cmCommandArgumentParser.y" +#line 181 "cmCommandArgumentParser.y" { (yyval.str) = (yyvsp[0].str); } -#line 1614 "cmCommandArgumentParser.cxx" +#line 1613 "cmCommandArgumentParser.cxx" break; case 24: /* ID: Variable */ -#line 185 "cmCommandArgumentParser.y" +#line 184 "cmCommandArgumentParser.y" { (yyval.str) = (yyvsp[0].str); } -#line 1622 "cmCommandArgumentParser.cxx" +#line 1621 "cmCommandArgumentParser.cxx" break; -#line 1626 "cmCommandArgumentParser.cxx" +#line 1625 "cmCommandArgumentParser.cxx" default: break; } @@ -1846,7 +1845,7 @@ yyreturnlab: return yyresult; } -#line 190 "cmCommandArgumentParser.y" +#line 189 "cmCommandArgumentParser.y" /* End of grammar */ diff --git a/Source/LexerParser/cmCommandArgumentParser.y b/Source/LexerParser/cmCommandArgumentParser.y index 602e1c3..59f4b32 100644 --- a/Source/LexerParser/cmCommandArgumentParser.y +++ b/Source/LexerParser/cmCommandArgumentParser.y @@ -22,7 +22,6 @@ Run bison like this: # include <malloc.h> #endif -#include <stdint.h> /* Make sure the parser uses standard memory allocation. The default generated parser malloc/free declarations do not work on all platforms. */ diff --git a/Source/LexerParser/cmDependsJavaParser.cxx b/Source/LexerParser/cmDependsJavaParser.cxx index 59cf1be..6755c70 100644 --- a/Source/LexerParser/cmDependsJavaParser.cxx +++ b/Source/LexerParser/cmDependsJavaParser.cxx @@ -88,7 +88,6 @@ Run bison like this: #include "cmConfigure.h" // IWYU pragma: keep -#include <stdint.h> #include <stdlib.h> #include <string.h> #include <string> @@ -126,7 +125,7 @@ static void cmDependsJava_yyerror(yyscan_t yyscanner, const char* message); # endif #endif -#line 130 "cmDependsJavaParser.cxx" +#line 129 "cmDependsJavaParser.cxx" # ifndef YY_CAST # ifdef __cplusplus @@ -814,42 +813,42 @@ static const yytype_int8 yytranslate[] = /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_int16 yyrline[] = { - 0, 185, 185, 194, 202, 210, 218, 226, 234, 243, - 251, 260, 268, 277, 282, 287, 292, 297, 302, 307, - 312, 318, 326, 335, 345, 354, 363, 371, 381, 387, - 394, 401, 407, 414, 423, 433, 443, 452, 460, 469, - 478, 484, 493, 499, 508, 514, 523, 535, 543, 552, - 564, 577, 585, 593, 602, 610, 619, 619, 619, 620, - 621, 621, 621, 621, 621, 621, 622, 625, 635, 644, - 653, 662, 672, 678, 687, 696, 705, 713, 722, 731, - 737, 746, 754, 762, 770, 779, 787, 796, 802, 810, - 819, 827, 836, 845, 854, 862, 871, 879, 887, 896, - 905, 915, 922, 932, 942, 949, 956, 959, 965, 975, - 985, 995, 1001, 1011, 1021, 1031, 1040, 1050, 1061, 1071, - 1078, 1088, 1097, 1107, 1116, 1126, 1132, 1142, 1151, 1161, - 1171, 1178, 1187, 1196, 1205, 1214, 1222, 1231, 1240, 1250, - 1260, 1269, 1279, 1289, 1296, 1305, 1315, 1324, 1334, 1343, - 1350, 1360, 1369, 1379, 1388, 1397, 1407, 1417, 1426, 1436, - 1445, 1454, 1463, 1472, 1481, 1491, 1500, 1509, 1518, 1527, - 1537, 1546, 1555, 1564, 1573, 1582, 1591, 1600, 1609, 1618, - 1627, 1636, 1646, 1656, 1667, 1677, 1687, 1696, 1705, 1714, - 1723, 1732, 1741, 1751, 1761, 1771, 1781, 1788, 1795, 1802, - 1812, 1819, 1829, 1839, 1848, 1858, 1867, 1877, 1884, 1891, - 1898, 1906, 1913, 1923, 1930, 1940, 1950, 1957, 1967, 1976, - 1986, 1996, 2005, 2015, 2024, 2034, 2045, 2052, 2059, 2070, - 2080, 2090, 2100, 2109, 2119, 2126, 2136, 2145, 2155, 2162, - 2172, 2181, 2191, 2200, 2206, 2215, 2224, 2233, 2242, 2252, - 2262, 2269, 2279, 2286, 2296, 2305, 2315, 2324, 2333, 2342, - 2352, 2359, 2369, 2378, 2388, 2398, 2404, 2411, 2421, 2431, - 2441, 2452, 2462, 2473, 2483, 2494, 2504, 2514, 2523, 2532, - 2541, 2550, 2560, 2570, 2580, 2589, 2598, 2607, 2616, 2626, - 2636, 2646, 2655, 2664, 2673, 2683, 2692, 2701, 2708, 2717, - 2726, 2735, 2745, 2754, 2763, 2773, 2782, 2791, 2800, 2810, - 2819, 2828, 2837, 2846, 2855, 2865, 2874, 2883, 2893, 2902, - 2912, 2921, 2931, 2940, 2950, 2959, 2969, 2978, 2988, 2997, - 3007, 3016, 3026, 3036, 3046, 3055, 3065, 3074, 3083, 3092, - 3101, 3110, 3119, 3128, 3137, 3146, 3155, 3164, 3174, 3184, - 3194, 3203 + 0, 184, 184, 193, 201, 209, 217, 225, 233, 242, + 250, 259, 267, 276, 281, 286, 291, 296, 301, 306, + 311, 317, 325, 334, 344, 353, 362, 370, 380, 386, + 393, 400, 406, 413, 422, 432, 442, 451, 459, 468, + 477, 483, 492, 498, 507, 513, 522, 534, 542, 551, + 563, 576, 584, 592, 601, 609, 618, 618, 618, 619, + 620, 620, 620, 620, 620, 620, 621, 624, 634, 643, + 652, 661, 671, 677, 686, 695, 704, 712, 721, 730, + 736, 745, 753, 761, 769, 778, 786, 795, 801, 809, + 818, 826, 835, 844, 853, 861, 870, 878, 886, 895, + 904, 914, 921, 931, 941, 948, 955, 958, 964, 974, + 984, 994, 1000, 1010, 1020, 1030, 1039, 1049, 1060, 1070, + 1077, 1087, 1096, 1106, 1115, 1125, 1131, 1141, 1150, 1160, + 1170, 1177, 1186, 1195, 1204, 1213, 1221, 1230, 1239, 1249, + 1259, 1268, 1278, 1288, 1295, 1304, 1314, 1323, 1333, 1342, + 1349, 1359, 1368, 1378, 1387, 1396, 1406, 1416, 1425, 1435, + 1444, 1453, 1462, 1471, 1480, 1490, 1499, 1508, 1517, 1526, + 1536, 1545, 1554, 1563, 1572, 1581, 1590, 1599, 1608, 1617, + 1626, 1635, 1645, 1655, 1666, 1676, 1686, 1695, 1704, 1713, + 1722, 1731, 1740, 1750, 1760, 1770, 1780, 1787, 1794, 1801, + 1811, 1818, 1828, 1838, 1847, 1857, 1866, 1876, 1883, 1890, + 1897, 1905, 1912, 1922, 1929, 1939, 1949, 1956, 1966, 1975, + 1985, 1995, 2004, 2014, 2023, 2033, 2044, 2051, 2058, 2069, + 2079, 2089, 2099, 2108, 2118, 2125, 2135, 2144, 2154, 2161, + 2171, 2180, 2190, 2199, 2205, 2214, 2223, 2232, 2241, 2251, + 2261, 2268, 2278, 2285, 2295, 2304, 2314, 2323, 2332, 2341, + 2351, 2358, 2368, 2377, 2387, 2397, 2403, 2410, 2420, 2430, + 2440, 2451, 2461, 2472, 2482, 2493, 2503, 2513, 2522, 2531, + 2540, 2549, 2559, 2569, 2579, 2588, 2597, 2606, 2615, 2625, + 2635, 2645, 2654, 2663, 2672, 2682, 2691, 2700, 2707, 2716, + 2725, 2734, 2744, 2753, 2762, 2772, 2781, 2790, 2799, 2809, + 2818, 2827, 2836, 2845, 2854, 2864, 2873, 2882, 2892, 2901, + 2911, 2920, 2930, 2939, 2949, 2958, 2968, 2977, 2987, 2996, + 3006, 3015, 3025, 3035, 3045, 3054, 3064, 3073, 3082, 3091, + 3100, 3109, 3118, 3127, 3136, 3145, 3154, 3163, 3173, 3183, + 3193, 3202 }; #endif @@ -2470,214 +2469,214 @@ yyreduce: switch (yyn) { case 2: /* Goal: CompilationUnit */ -#line 186 "cmDependsJavaParser.y" +#line 185 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2481 "cmDependsJavaParser.cxx" +#line 2480 "cmDependsJavaParser.cxx" break; case 3: /* Literal: IntegerLiteral */ -#line 195 "cmDependsJavaParser.y" +#line 194 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2492 "cmDependsJavaParser.cxx" +#line 2491 "cmDependsJavaParser.cxx" break; case 4: /* Literal: jp_FLOATINGPOINTLITERAL */ -#line 203 "cmDependsJavaParser.y" +#line 202 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2503 "cmDependsJavaParser.cxx" +#line 2502 "cmDependsJavaParser.cxx" break; case 5: /* Literal: jp_BOOLEANLITERAL */ -#line 211 "cmDependsJavaParser.y" +#line 210 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2514 "cmDependsJavaParser.cxx" +#line 2513 "cmDependsJavaParser.cxx" break; case 6: /* Literal: jp_CHARACTERLITERAL */ -#line 219 "cmDependsJavaParser.y" +#line 218 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2525 "cmDependsJavaParser.cxx" +#line 2524 "cmDependsJavaParser.cxx" break; case 7: /* Literal: jp_STRINGLITERAL */ -#line 227 "cmDependsJavaParser.y" +#line 226 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2536 "cmDependsJavaParser.cxx" +#line 2535 "cmDependsJavaParser.cxx" break; case 8: /* Literal: jp_NULLLITERAL */ -#line 235 "cmDependsJavaParser.y" +#line 234 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2547 "cmDependsJavaParser.cxx" +#line 2546 "cmDependsJavaParser.cxx" break; case 9: /* IntegerLiteral: jp_DECIMALINTEGERLITERAL */ -#line 244 "cmDependsJavaParser.y" +#line 243 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2558 "cmDependsJavaParser.cxx" +#line 2557 "cmDependsJavaParser.cxx" break; case 10: /* IntegerLiteral: jp_HEXINTEGERLITERAL */ -#line 252 "cmDependsJavaParser.y" +#line 251 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2569 "cmDependsJavaParser.cxx" +#line 2568 "cmDependsJavaParser.cxx" break; case 11: /* Type: PrimitiveType */ -#line 261 "cmDependsJavaParser.y" +#line 260 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2580 "cmDependsJavaParser.cxx" +#line 2579 "cmDependsJavaParser.cxx" break; case 12: /* Type: ReferenceType */ -#line 269 "cmDependsJavaParser.y" +#line 268 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2591 "cmDependsJavaParser.cxx" +#line 2590 "cmDependsJavaParser.cxx" break; case 13: /* PrimitiveType: jp_BYTE_TYPE */ -#line 278 "cmDependsJavaParser.y" +#line 277 "cmDependsJavaParser.y" { jpElementStart(0); } -#line 2599 "cmDependsJavaParser.cxx" +#line 2598 "cmDependsJavaParser.cxx" break; case 14: /* PrimitiveType: jp_SHORT_TYPE */ -#line 283 "cmDependsJavaParser.y" +#line 282 "cmDependsJavaParser.y" { jpElementStart(0); } -#line 2607 "cmDependsJavaParser.cxx" +#line 2606 "cmDependsJavaParser.cxx" break; case 15: /* PrimitiveType: jp_INT_TYPE */ -#line 288 "cmDependsJavaParser.y" +#line 287 "cmDependsJavaParser.y" { jpElementStart(0); } -#line 2615 "cmDependsJavaParser.cxx" +#line 2614 "cmDependsJavaParser.cxx" break; case 16: /* PrimitiveType: jp_LONG_TYPE */ -#line 293 "cmDependsJavaParser.y" +#line 292 "cmDependsJavaParser.y" { jpElementStart(0); } -#line 2623 "cmDependsJavaParser.cxx" +#line 2622 "cmDependsJavaParser.cxx" break; case 17: /* PrimitiveType: jp_CHAR_TYPE */ -#line 298 "cmDependsJavaParser.y" +#line 297 "cmDependsJavaParser.y" { jpElementStart(0); } -#line 2631 "cmDependsJavaParser.cxx" +#line 2630 "cmDependsJavaParser.cxx" break; case 18: /* PrimitiveType: jp_FLOAT_TYPE */ -#line 303 "cmDependsJavaParser.y" +#line 302 "cmDependsJavaParser.y" { jpElementStart(0); } -#line 2639 "cmDependsJavaParser.cxx" +#line 2638 "cmDependsJavaParser.cxx" break; case 19: /* PrimitiveType: jp_DOUBLE_TYPE */ -#line 308 "cmDependsJavaParser.y" +#line 307 "cmDependsJavaParser.y" { jpElementStart(0); } -#line 2647 "cmDependsJavaParser.cxx" +#line 2646 "cmDependsJavaParser.cxx" break; case 20: /* PrimitiveType: jp_BOOLEAN_TYPE */ -#line 313 "cmDependsJavaParser.y" +#line 312 "cmDependsJavaParser.y" { jpElementStart(0); } -#line 2655 "cmDependsJavaParser.cxx" +#line 2654 "cmDependsJavaParser.cxx" break; case 21: /* ReferenceType: ClassOrInterfaceType */ -#line 319 "cmDependsJavaParser.y" +#line 318 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2666 "cmDependsJavaParser.cxx" +#line 2665 "cmDependsJavaParser.cxx" break; case 22: /* ReferenceType: ArrayType */ -#line 327 "cmDependsJavaParser.y" +#line 326 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2677 "cmDependsJavaParser.cxx" +#line 2676 "cmDependsJavaParser.cxx" break; case 23: /* ClassOrInterfaceType: Name */ -#line 336 "cmDependsJavaParser.y" +#line 335 "cmDependsJavaParser.y" { jpElementStart(1); jpStoreClass((yyvsp[0].str)); @@ -2685,44 +2684,44 @@ yyreduce: (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2689 "cmDependsJavaParser.cxx" +#line 2688 "cmDependsJavaParser.cxx" break; case 24: /* ClassType: ClassOrInterfaceType */ -#line 346 "cmDependsJavaParser.y" +#line 345 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2700 "cmDependsJavaParser.cxx" +#line 2699 "cmDependsJavaParser.cxx" break; case 25: /* InterfaceType: ClassOrInterfaceType */ -#line 355 "cmDependsJavaParser.y" +#line 354 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2711 "cmDependsJavaParser.cxx" +#line 2710 "cmDependsJavaParser.cxx" break; case 26: /* ArrayType: PrimitiveType Dims */ -#line 364 "cmDependsJavaParser.y" +#line 363 "cmDependsJavaParser.y" { jpElementStart(2); jpCheckEmpty(2); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2722 "cmDependsJavaParser.cxx" +#line 2721 "cmDependsJavaParser.cxx" break; case 27: /* ArrayType: Name Dims */ -#line 372 "cmDependsJavaParser.y" +#line 371 "cmDependsJavaParser.y" { jpElementStart(2); jpStoreClass((yyvsp[-1].str)); @@ -2730,56 +2729,56 @@ yyreduce: (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2734 "cmDependsJavaParser.cxx" +#line 2733 "cmDependsJavaParser.cxx" break; case 28: /* Name: SimpleName */ -#line 382 "cmDependsJavaParser.y" +#line 381 "cmDependsJavaParser.y" { jpElementStart(1); (yyval.str) = (yyvsp[0].str); } -#line 2743 "cmDependsJavaParser.cxx" +#line 2742 "cmDependsJavaParser.cxx" break; case 29: /* Name: QualifiedName */ -#line 388 "cmDependsJavaParser.y" +#line 387 "cmDependsJavaParser.y" { jpElementStart(1); (yyval.str) = (yyvsp[0].str); } -#line 2752 "cmDependsJavaParser.cxx" +#line 2751 "cmDependsJavaParser.cxx" break; case 30: /* SimpleName: Identifier */ -#line 395 "cmDependsJavaParser.y" +#line 394 "cmDependsJavaParser.y" { jpElementStart(1); (yyval.str) = (yyvsp[0].str); } -#line 2761 "cmDependsJavaParser.cxx" +#line 2760 "cmDependsJavaParser.cxx" break; case 31: /* Identifier: jp_NAME */ -#line 402 "cmDependsJavaParser.y" +#line 401 "cmDependsJavaParser.y" { jpElementStart(1); (yyval.str) = (yyvsp[0].str); } -#line 2770 "cmDependsJavaParser.cxx" +#line 2769 "cmDependsJavaParser.cxx" break; case 32: /* Identifier: jp_DOLLAR jp_NAME */ -#line 408 "cmDependsJavaParser.y" +#line 407 "cmDependsJavaParser.y" { jpElementStart(2); (yyval.str) = (yyvsp[0].str); } -#line 2779 "cmDependsJavaParser.cxx" +#line 2778 "cmDependsJavaParser.cxx" break; case 33: /* QualifiedName: Name jp_DOT Identifier */ -#line 415 "cmDependsJavaParser.y" +#line 414 "cmDependsJavaParser.y" { jpElementStart(3); yyGetParser->AddClassFound((yyvsp[-2].str)); @@ -2787,11 +2786,11 @@ yyreduce: yyGetParser->DeallocateParserType(&((yyvsp[-2].str))); (yyval.str) = const_cast<char*>(yyGetParser->GetCurrentCombine()); } -#line 2791 "cmDependsJavaParser.cxx" +#line 2790 "cmDependsJavaParser.cxx" break; case 34: /* QualifiedName: Name jp_DOT jp_CLASS */ -#line 424 "cmDependsJavaParser.y" +#line 423 "cmDependsJavaParser.y" { jpElementStart(3); jpStoreClass((yyvsp[-2].str)); @@ -2800,11 +2799,11 @@ yyreduce: (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2804 "cmDependsJavaParser.cxx" +#line 2803 "cmDependsJavaParser.cxx" break; case 35: /* QualifiedName: Name jp_DOT jp_THIS */ -#line 434 "cmDependsJavaParser.y" +#line 433 "cmDependsJavaParser.y" { jpElementStart(3); jpStoreClass((yyvsp[-2].str)); @@ -2813,118 +2812,118 @@ yyreduce: (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2817 "cmDependsJavaParser.cxx" +#line 2816 "cmDependsJavaParser.cxx" break; case 36: /* QualifiedName: SimpleType jp_DOT jp_CLASS */ -#line 444 "cmDependsJavaParser.y" +#line 443 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2828 "cmDependsJavaParser.cxx" +#line 2827 "cmDependsJavaParser.cxx" break; case 37: /* SimpleType: PrimitiveType */ -#line 453 "cmDependsJavaParser.y" +#line 452 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2839 "cmDependsJavaParser.cxx" +#line 2838 "cmDependsJavaParser.cxx" break; case 38: /* SimpleType: jp_VOID */ -#line 461 "cmDependsJavaParser.y" +#line 460 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2850 "cmDependsJavaParser.cxx" +#line 2849 "cmDependsJavaParser.cxx" break; case 39: /* CompilationUnit: PackageDeclarationopt ImportDeclarations TypeDeclarations */ -#line 470 "cmDependsJavaParser.y" +#line 469 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2861 "cmDependsJavaParser.cxx" +#line 2860 "cmDependsJavaParser.cxx" break; case 40: /* PackageDeclarationopt: %empty */ -#line 478 "cmDependsJavaParser.y" +#line 477 "cmDependsJavaParser.y" { jpElementStart(0); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2871 "cmDependsJavaParser.cxx" +#line 2870 "cmDependsJavaParser.cxx" break; case 41: /* PackageDeclarationopt: PackageDeclaration */ -#line 485 "cmDependsJavaParser.y" +#line 484 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2882 "cmDependsJavaParser.cxx" +#line 2881 "cmDependsJavaParser.cxx" break; case 42: /* ImportDeclarations: %empty */ -#line 493 "cmDependsJavaParser.y" +#line 492 "cmDependsJavaParser.y" { jpElementStart(0); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2892 "cmDependsJavaParser.cxx" +#line 2891 "cmDependsJavaParser.cxx" break; case 43: /* ImportDeclarations: ImportDeclarations ImportDeclaration */ -#line 500 "cmDependsJavaParser.y" +#line 499 "cmDependsJavaParser.y" { jpElementStart(2); jpCheckEmpty(2); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2903 "cmDependsJavaParser.cxx" +#line 2902 "cmDependsJavaParser.cxx" break; case 44: /* TypeDeclarations: %empty */ -#line 508 "cmDependsJavaParser.y" +#line 507 "cmDependsJavaParser.y" { jpElementStart(0); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2913 "cmDependsJavaParser.cxx" +#line 2912 "cmDependsJavaParser.cxx" break; case 45: /* TypeDeclarations: TypeDeclarations TypeDeclaration */ -#line 515 "cmDependsJavaParser.y" +#line 514 "cmDependsJavaParser.y" { jpElementStart(2); jpCheckEmpty(2); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2924 "cmDependsJavaParser.cxx" +#line 2923 "cmDependsJavaParser.cxx" break; case 46: /* PackageDeclaration: jp_PACKAGE Name jp_SEMICOL */ -#line 524 "cmDependsJavaParser.y" +#line 523 "cmDependsJavaParser.y" { jpElementStart(3); yyGetParser->SetCurrentPackage((yyvsp[-1].str)); @@ -2934,33 +2933,33 @@ yyreduce: (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2938 "cmDependsJavaParser.cxx" +#line 2937 "cmDependsJavaParser.cxx" break; case 47: /* ImportDeclaration: SingleTypeImportDeclaration */ -#line 536 "cmDependsJavaParser.y" +#line 535 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2949 "cmDependsJavaParser.cxx" +#line 2948 "cmDependsJavaParser.cxx" break; case 48: /* ImportDeclaration: TypeImportOnDemandDeclaration */ -#line 544 "cmDependsJavaParser.y" +#line 543 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2960 "cmDependsJavaParser.cxx" +#line 2959 "cmDependsJavaParser.cxx" break; case 49: /* SingleTypeImportDeclaration: jp_IMPORT Name jp_SEMICOL */ -#line 553 "cmDependsJavaParser.y" +#line 552 "cmDependsJavaParser.y" { jpElementStart(3); yyGetParser->AddPackagesImport((yyvsp[-1].str)); @@ -2970,11 +2969,11 @@ yyreduce: (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2974 "cmDependsJavaParser.cxx" +#line 2973 "cmDependsJavaParser.cxx" break; case 50: /* TypeImportOnDemandDeclaration: jp_IMPORT Name jp_DOT jp_TIMES jp_SEMICOL */ -#line 565 "cmDependsJavaParser.y" +#line 564 "cmDependsJavaParser.y" { jpElementStart(5); std::string str = (yyvsp[-3].str); @@ -2985,77 +2984,77 @@ yyreduce: (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2989 "cmDependsJavaParser.cxx" +#line 2988 "cmDependsJavaParser.cxx" break; case 51: /* TypeDeclaration: ClassDeclaration */ -#line 578 "cmDependsJavaParser.y" +#line 577 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3000 "cmDependsJavaParser.cxx" +#line 2999 "cmDependsJavaParser.cxx" break; case 52: /* TypeDeclaration: InterfaceDeclaration */ -#line 586 "cmDependsJavaParser.y" +#line 585 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3011 "cmDependsJavaParser.cxx" +#line 3010 "cmDependsJavaParser.cxx" break; case 53: /* TypeDeclaration: jp_SEMICOL */ -#line 594 "cmDependsJavaParser.y" +#line 593 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3022 "cmDependsJavaParser.cxx" +#line 3021 "cmDependsJavaParser.cxx" break; case 54: /* Modifiers: Modifier */ -#line 603 "cmDependsJavaParser.y" +#line 602 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3033 "cmDependsJavaParser.cxx" +#line 3032 "cmDependsJavaParser.cxx" break; case 55: /* Modifiers: Modifiers Modifier */ -#line 611 "cmDependsJavaParser.y" +#line 610 "cmDependsJavaParser.y" { jpElementStart(2); jpCheckEmpty(2); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3044 "cmDependsJavaParser.cxx" +#line 3043 "cmDependsJavaParser.cxx" break; case 67: /* ClassHeader: Modifiersopt jp_CLASS Identifier */ -#line 626 "cmDependsJavaParser.y" +#line 625 "cmDependsJavaParser.y" { yyGetParser->StartClass((yyvsp[0].str)); jpElementStart(3); yyGetParser->DeallocateParserType(&((yyvsp[0].str))); jpCheckEmpty(3); } -#line 3055 "cmDependsJavaParser.cxx" +#line 3054 "cmDependsJavaParser.cxx" break; case 68: /* ClassDeclaration: ClassHeader ClassBody */ -#line 636 "cmDependsJavaParser.y" +#line 635 "cmDependsJavaParser.y" { jpElementStart(2); jpCheckEmpty(2); @@ -3063,11 +3062,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); yyGetParser->EndClass(); } -#line 3067 "cmDependsJavaParser.cxx" +#line 3066 "cmDependsJavaParser.cxx" break; case 69: /* ClassDeclaration: ClassHeader Interfaces ClassBody */ -#line 645 "cmDependsJavaParser.y" +#line 644 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(2); @@ -3075,11 +3074,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); yyGetParser->EndClass(); } -#line 3079 "cmDependsJavaParser.cxx" +#line 3078 "cmDependsJavaParser.cxx" break; case 70: /* ClassDeclaration: ClassHeader Super ClassBody */ -#line 654 "cmDependsJavaParser.y" +#line 653 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); @@ -3087,11 +3086,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); yyGetParser->EndClass(); } -#line 3091 "cmDependsJavaParser.cxx" +#line 3090 "cmDependsJavaParser.cxx" break; case 71: /* ClassDeclaration: ClassHeader Super Interfaces ClassBody */ -#line 663 "cmDependsJavaParser.y" +#line 662 "cmDependsJavaParser.y" { jpElementStart(4); jpCheckEmpty(4); @@ -3099,226 +3098,226 @@ yyreduce: yyGetParser->SetCurrentCombine(""); yyGetParser->EndClass(); } -#line 3103 "cmDependsJavaParser.cxx" +#line 3102 "cmDependsJavaParser.cxx" break; case 72: /* Modifiersopt: %empty */ -#line 672 "cmDependsJavaParser.y" +#line 671 "cmDependsJavaParser.y" { jpElementStart(0); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3113 "cmDependsJavaParser.cxx" +#line 3112 "cmDependsJavaParser.cxx" break; case 73: /* Modifiersopt: Modifiers */ -#line 679 "cmDependsJavaParser.y" +#line 678 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3124 "cmDependsJavaParser.cxx" +#line 3123 "cmDependsJavaParser.cxx" break; case 74: /* Super: jp_EXTENDS ClassType */ -#line 688 "cmDependsJavaParser.y" +#line 687 "cmDependsJavaParser.y" { jpElementStart(2); jpCheckEmpty(2); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3135 "cmDependsJavaParser.cxx" +#line 3134 "cmDependsJavaParser.cxx" break; case 75: /* Interfaces: jp_IMPLEMENTS InterfaceTypeList */ -#line 697 "cmDependsJavaParser.y" +#line 696 "cmDependsJavaParser.y" { jpElementStart(2); jpCheckEmpty(2); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3146 "cmDependsJavaParser.cxx" +#line 3145 "cmDependsJavaParser.cxx" break; case 76: /* InterfaceTypeList: InterfaceType */ -#line 706 "cmDependsJavaParser.y" +#line 705 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3157 "cmDependsJavaParser.cxx" +#line 3156 "cmDependsJavaParser.cxx" break; case 77: /* InterfaceTypeList: InterfaceTypeList jp_COMMA InterfaceType */ -#line 714 "cmDependsJavaParser.y" +#line 713 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3168 "cmDependsJavaParser.cxx" +#line 3167 "cmDependsJavaParser.cxx" break; case 78: /* ClassBody: jp_CURLYSTART ClassBodyDeclarations jp_CURLYEND */ -#line 723 "cmDependsJavaParser.y" +#line 722 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3179 "cmDependsJavaParser.cxx" +#line 3178 "cmDependsJavaParser.cxx" break; case 79: /* ClassBodyDeclarations: %empty */ -#line 731 "cmDependsJavaParser.y" +#line 730 "cmDependsJavaParser.y" { jpElementStart(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3189 "cmDependsJavaParser.cxx" +#line 3188 "cmDependsJavaParser.cxx" break; case 80: /* ClassBodyDeclarations: ClassBodyDeclarations ClassBodyDeclaration */ -#line 738 "cmDependsJavaParser.y" +#line 737 "cmDependsJavaParser.y" { jpElementStart(2); jpCheckEmpty(2); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3200 "cmDependsJavaParser.cxx" +#line 3199 "cmDependsJavaParser.cxx" break; case 81: /* ClassBodyDeclaration: ClassMemberDeclaration */ -#line 747 "cmDependsJavaParser.y" +#line 746 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3211 "cmDependsJavaParser.cxx" +#line 3210 "cmDependsJavaParser.cxx" break; case 82: /* ClassBodyDeclaration: StaticInitializer */ -#line 755 "cmDependsJavaParser.y" +#line 754 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3222 "cmDependsJavaParser.cxx" +#line 3221 "cmDependsJavaParser.cxx" break; case 83: /* ClassBodyDeclaration: ConstructorDeclaration */ -#line 763 "cmDependsJavaParser.y" +#line 762 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3233 "cmDependsJavaParser.cxx" +#line 3232 "cmDependsJavaParser.cxx" break; case 84: /* ClassBodyDeclaration: TypeDeclaration */ -#line 771 "cmDependsJavaParser.y" +#line 770 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3244 "cmDependsJavaParser.cxx" +#line 3243 "cmDependsJavaParser.cxx" break; case 85: /* ClassMemberDeclaration: FieldDeclaration */ -#line 780 "cmDependsJavaParser.y" +#line 779 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3255 "cmDependsJavaParser.cxx" +#line 3254 "cmDependsJavaParser.cxx" break; case 86: /* ClassMemberDeclaration: MethodDeclaration */ -#line 788 "cmDependsJavaParser.y" +#line 787 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3266 "cmDependsJavaParser.cxx" +#line 3265 "cmDependsJavaParser.cxx" break; case 87: /* FieldDeclaration: Modifiersopt Type VariableDeclarators jp_SEMICOL */ -#line 797 "cmDependsJavaParser.y" +#line 796 "cmDependsJavaParser.y" { jpElementStart(4); } -#line 3274 "cmDependsJavaParser.cxx" +#line 3273 "cmDependsJavaParser.cxx" break; case 88: /* VariableDeclarators: VariableDeclarator */ -#line 803 "cmDependsJavaParser.y" +#line 802 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3285 "cmDependsJavaParser.cxx" +#line 3284 "cmDependsJavaParser.cxx" break; case 89: /* VariableDeclarators: VariableDeclarators jp_COMMA VariableDeclarator */ -#line 811 "cmDependsJavaParser.y" +#line 810 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3296 "cmDependsJavaParser.cxx" +#line 3295 "cmDependsJavaParser.cxx" break; case 90: /* VariableDeclarator: VariableDeclaratorId */ -#line 820 "cmDependsJavaParser.y" +#line 819 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3307 "cmDependsJavaParser.cxx" +#line 3306 "cmDependsJavaParser.cxx" break; case 91: /* VariableDeclarator: VariableDeclaratorId jp_EQUALS VariableInitializer */ -#line 828 "cmDependsJavaParser.y" +#line 827 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3318 "cmDependsJavaParser.cxx" +#line 3317 "cmDependsJavaParser.cxx" break; case 92: /* VariableDeclaratorId: Identifier */ -#line 837 "cmDependsJavaParser.y" +#line 836 "cmDependsJavaParser.y" { jpElementStart(1); yyGetParser->DeallocateParserType(&((yyvsp[0].str))); @@ -3326,77 +3325,77 @@ yyreduce: (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3330 "cmDependsJavaParser.cxx" +#line 3329 "cmDependsJavaParser.cxx" break; case 93: /* VariableDeclaratorId: VariableDeclaratorId jp_BRACKETSTART jp_BRACKETEND */ -#line 846 "cmDependsJavaParser.y" +#line 845 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3341 "cmDependsJavaParser.cxx" +#line 3340 "cmDependsJavaParser.cxx" break; case 94: /* VariableInitializer: Expression */ -#line 855 "cmDependsJavaParser.y" +#line 854 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3352 "cmDependsJavaParser.cxx" +#line 3351 "cmDependsJavaParser.cxx" break; case 95: /* VariableInitializer: ArrayInitializer */ -#line 863 "cmDependsJavaParser.y" +#line 862 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3363 "cmDependsJavaParser.cxx" +#line 3362 "cmDependsJavaParser.cxx" break; case 96: /* MethodDeclaration: MethodHeader jp_SEMICOL */ -#line 872 "cmDependsJavaParser.y" +#line 871 "cmDependsJavaParser.y" { jpElementStart(2); jpCheckEmpty(2); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3374 "cmDependsJavaParser.cxx" +#line 3373 "cmDependsJavaParser.cxx" break; case 97: /* MethodDeclaration: MethodHeader MethodBody */ -#line 880 "cmDependsJavaParser.y" +#line 879 "cmDependsJavaParser.y" { jpElementStart(2); jpCheckEmpty(2); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3385 "cmDependsJavaParser.cxx" +#line 3384 "cmDependsJavaParser.cxx" break; case 98: /* MethodDeclaration: MethodHeader MethodBody jp_SEMICOL */ -#line 888 "cmDependsJavaParser.y" +#line 887 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3396 "cmDependsJavaParser.cxx" +#line 3395 "cmDependsJavaParser.cxx" break; case 99: /* MethodHeader: Modifiersopt Type MethodDeclarator Throwsopt */ -#line 897 "cmDependsJavaParser.y" +#line 896 "cmDependsJavaParser.y" { jpElementStart(4); jpCheckEmpty(4); @@ -3404,11 +3403,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3408 "cmDependsJavaParser.cxx" +#line 3407 "cmDependsJavaParser.cxx" break; case 100: /* MethodHeader: Modifiersopt jp_VOID MethodDeclarator Throwsopt */ -#line 906 "cmDependsJavaParser.y" +#line 905 "cmDependsJavaParser.y" { jpElementStart(4); jpCheckEmpty(4); @@ -3416,22 +3415,22 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3420 "cmDependsJavaParser.cxx" +#line 3419 "cmDependsJavaParser.cxx" break; case 101: /* Throwsopt: %empty */ -#line 915 "cmDependsJavaParser.y" +#line 914 "cmDependsJavaParser.y" { jpElementStart(0); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3431 "cmDependsJavaParser.cxx" +#line 3430 "cmDependsJavaParser.cxx" break; case 102: /* Throwsopt: Throws */ -#line 923 "cmDependsJavaParser.y" +#line 922 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -3439,11 +3438,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3443 "cmDependsJavaParser.cxx" +#line 3442 "cmDependsJavaParser.cxx" break; case 103: /* MethodDeclarator: Identifier jp_PARESTART FormalParameterListopt jp_PAREEND */ -#line 933 "cmDependsJavaParser.y" +#line 932 "cmDependsJavaParser.y" { jpElementStart(4); yyGetParser->DeallocateParserType(&((yyvsp[-3].str))); @@ -3452,40 +3451,40 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3456 "cmDependsJavaParser.cxx" +#line 3455 "cmDependsJavaParser.cxx" break; case 104: /* MethodDeclarator: MethodDeclarator jp_BRACKETSTART jp_BRACKETEND */ -#line 943 "cmDependsJavaParser.y" +#line 942 "cmDependsJavaParser.y" { jpElementStart(3); } -#line 3465 "cmDependsJavaParser.cxx" +#line 3464 "cmDependsJavaParser.cxx" break; case 105: /* FormalParameterListopt: %empty */ -#line 949 "cmDependsJavaParser.y" +#line 948 "cmDependsJavaParser.y" { jpElementStart(0); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3476 "cmDependsJavaParser.cxx" +#line 3475 "cmDependsJavaParser.cxx" break; case 107: /* FormalParameterList: FormalParameter */ -#line 960 "cmDependsJavaParser.y" +#line 959 "cmDependsJavaParser.y" { jpElementStart(1); } -#line 3485 "cmDependsJavaParser.cxx" +#line 3484 "cmDependsJavaParser.cxx" break; case 108: /* FormalParameterList: FormalParameterList jp_COMMA FormalParameter */ -#line 966 "cmDependsJavaParser.y" +#line 965 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); @@ -3493,11 +3492,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3497 "cmDependsJavaParser.cxx" +#line 3496 "cmDependsJavaParser.cxx" break; case 109: /* FormalParameter: Modifiersopt Type VariableDeclaratorId */ -#line 976 "cmDependsJavaParser.y" +#line 975 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); @@ -3505,11 +3504,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3509 "cmDependsJavaParser.cxx" +#line 3508 "cmDependsJavaParser.cxx" break; case 110: /* Throws: jp_THROWS ClassTypeList */ -#line 986 "cmDependsJavaParser.y" +#line 985 "cmDependsJavaParser.y" { jpElementStart(2); jpCheckEmpty(2); @@ -3517,20 +3516,20 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3521 "cmDependsJavaParser.cxx" +#line 3520 "cmDependsJavaParser.cxx" break; case 111: /* ClassTypeList: ClassType */ -#line 996 "cmDependsJavaParser.y" +#line 995 "cmDependsJavaParser.y" { jpElementStart(1); } -#line 3530 "cmDependsJavaParser.cxx" +#line 3529 "cmDependsJavaParser.cxx" break; case 112: /* ClassTypeList: ClassTypeList jp_COMMA ClassType */ -#line 1002 "cmDependsJavaParser.y" +#line 1001 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); @@ -3538,11 +3537,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3542 "cmDependsJavaParser.cxx" +#line 3541 "cmDependsJavaParser.cxx" break; case 113: /* MethodBody: Block */ -#line 1012 "cmDependsJavaParser.y" +#line 1011 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -3550,11 +3549,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3554 "cmDependsJavaParser.cxx" +#line 3553 "cmDependsJavaParser.cxx" break; case 114: /* StaticInitializer: jp_STATIC Block */ -#line 1022 "cmDependsJavaParser.y" +#line 1021 "cmDependsJavaParser.y" { jpElementStart(2); jpCheckEmpty(2); @@ -3562,11 +3561,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3566 "cmDependsJavaParser.cxx" +#line 3565 "cmDependsJavaParser.cxx" break; case 115: /* ConstructorDeclaration: Modifiersopt ConstructorDeclarator Throwsopt ConstructorBody */ -#line 1032 "cmDependsJavaParser.y" +#line 1031 "cmDependsJavaParser.y" { jpElementStart(4); jpCheckEmpty(4); @@ -3574,11 +3573,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3578 "cmDependsJavaParser.cxx" +#line 3577 "cmDependsJavaParser.cxx" break; case 116: /* ConstructorDeclaration: Modifiersopt ConstructorDeclarator Throwsopt ConstructorBody jp_SEMICOL */ -#line 1041 "cmDependsJavaParser.y" +#line 1040 "cmDependsJavaParser.y" { jpElementStart(5); jpCheckEmpty(5); @@ -3586,11 +3585,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3590 "cmDependsJavaParser.cxx" +#line 3589 "cmDependsJavaParser.cxx" break; case 117: /* ConstructorDeclarator: SimpleName jp_PARESTART FormalParameterListopt jp_PAREEND */ -#line 1051 "cmDependsJavaParser.y" +#line 1050 "cmDependsJavaParser.y" { jpElementStart(4); yyGetParser->DeallocateParserType(&((yyvsp[-3].str))); @@ -3599,11 +3598,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3603 "cmDependsJavaParser.cxx" +#line 3602 "cmDependsJavaParser.cxx" break; case 118: /* ConstructorBody: jp_CURLYSTART ExplicitConstructorInvocationopt BlockStatementsopt jp_CURLYEND */ -#line 1062 "cmDependsJavaParser.y" +#line 1061 "cmDependsJavaParser.y" { jpElementStart(4); jpCheckEmpty(4); @@ -3611,22 +3610,22 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3615 "cmDependsJavaParser.cxx" +#line 3614 "cmDependsJavaParser.cxx" break; case 119: /* ExplicitConstructorInvocationopt: %empty */ -#line 1071 "cmDependsJavaParser.y" +#line 1070 "cmDependsJavaParser.y" { jpElementStart(0); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3626 "cmDependsJavaParser.cxx" +#line 3625 "cmDependsJavaParser.cxx" break; case 120: /* ExplicitConstructorInvocationopt: ExplicitConstructorInvocationopt ExplicitConstructorInvocation */ -#line 1079 "cmDependsJavaParser.y" +#line 1078 "cmDependsJavaParser.y" { jpElementStart(2); jpCheckEmpty(2); @@ -3634,11 +3633,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3638 "cmDependsJavaParser.cxx" +#line 3637 "cmDependsJavaParser.cxx" break; case 121: /* ExplicitConstructorInvocation: jp_THIS jp_PARESTART ArgumentListopt jp_PAREEND jp_SEMICOL */ -#line 1089 "cmDependsJavaParser.y" +#line 1088 "cmDependsJavaParser.y" { jpElementStart(5); jpCheckEmpty(5); @@ -3646,11 +3645,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3650 "cmDependsJavaParser.cxx" +#line 3649 "cmDependsJavaParser.cxx" break; case 122: /* ExplicitConstructorInvocation: jp_SUPER jp_PARESTART ArgumentListopt jp_PAREEND jp_SEMICOL */ -#line 1098 "cmDependsJavaParser.y" +#line 1097 "cmDependsJavaParser.y" { jpElementStart(5); jpCheckEmpty(5); @@ -3658,22 +3657,22 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3662 "cmDependsJavaParser.cxx" +#line 3661 "cmDependsJavaParser.cxx" break; case 123: /* InterfaceHeader: Modifiersopt jp_INTERFACE Identifier */ -#line 1108 "cmDependsJavaParser.y" +#line 1107 "cmDependsJavaParser.y" { yyGetParser->StartClass((yyvsp[0].str)); jpElementStart(3); yyGetParser->DeallocateParserType(&((yyvsp[0].str))); jpCheckEmpty(3); } -#line 3673 "cmDependsJavaParser.cxx" +#line 3672 "cmDependsJavaParser.cxx" break; case 124: /* InterfaceDeclaration: InterfaceHeader ExtendsInterfacesopt InterfaceBody */ -#line 1117 "cmDependsJavaParser.y" +#line 1116 "cmDependsJavaParser.y" { jpElementStart(2); jpCheckEmpty(2); @@ -3681,21 +3680,21 @@ yyreduce: yyGetParser->SetCurrentCombine(""); yyGetParser->EndClass(); } -#line 3685 "cmDependsJavaParser.cxx" +#line 3684 "cmDependsJavaParser.cxx" break; case 125: /* ExtendsInterfacesopt: %empty */ -#line 1126 "cmDependsJavaParser.y" +#line 1125 "cmDependsJavaParser.y" { jpElementStart(0); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3695 "cmDependsJavaParser.cxx" +#line 3694 "cmDependsJavaParser.cxx" break; case 126: /* ExtendsInterfacesopt: ExtendsInterfaces */ -#line 1133 "cmDependsJavaParser.y" +#line 1132 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -3703,11 +3702,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3707 "cmDependsJavaParser.cxx" +#line 3706 "cmDependsJavaParser.cxx" break; case 127: /* ExtendsInterfaces: jp_EXTENDS InterfaceType */ -#line 1143 "cmDependsJavaParser.y" +#line 1142 "cmDependsJavaParser.y" { jpElementStart(2); jpCheckEmpty(2); @@ -3715,11 +3714,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3719 "cmDependsJavaParser.cxx" +#line 3718 "cmDependsJavaParser.cxx" break; case 128: /* ExtendsInterfaces: ExtendsInterfaces jp_COMMA InterfaceType */ -#line 1152 "cmDependsJavaParser.y" +#line 1151 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); @@ -3727,11 +3726,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3731 "cmDependsJavaParser.cxx" +#line 3730 "cmDependsJavaParser.cxx" break; case 129: /* InterfaceBody: jp_CURLYSTART InterfaceMemberDeclarations jp_CURLYEND */ -#line 1162 "cmDependsJavaParser.y" +#line 1161 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); @@ -3739,33 +3738,33 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3743 "cmDependsJavaParser.cxx" +#line 3742 "cmDependsJavaParser.cxx" break; case 130: /* InterfaceMemberDeclarations: %empty */ -#line 1171 "cmDependsJavaParser.y" +#line 1170 "cmDependsJavaParser.y" { jpElementStart(0); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3754 "cmDependsJavaParser.cxx" +#line 3753 "cmDependsJavaParser.cxx" break; case 131: /* InterfaceMemberDeclarations: InterfaceMemberDeclarations InterfaceMemberDeclaration */ -#line 1179 "cmDependsJavaParser.y" +#line 1178 "cmDependsJavaParser.y" { jpElementStart(2); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3765 "cmDependsJavaParser.cxx" +#line 3764 "cmDependsJavaParser.cxx" break; case 132: /* InterfaceMemberDeclaration: ConstantDeclaration */ -#line 1188 "cmDependsJavaParser.y" +#line 1187 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -3773,11 +3772,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3777 "cmDependsJavaParser.cxx" +#line 3776 "cmDependsJavaParser.cxx" break; case 133: /* InterfaceMemberDeclaration: AbstractMethodDeclaration */ -#line 1197 "cmDependsJavaParser.y" +#line 1196 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -3785,11 +3784,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3789 "cmDependsJavaParser.cxx" +#line 3788 "cmDependsJavaParser.cxx" break; case 134: /* InterfaceMemberDeclaration: ClassDeclaration */ -#line 1206 "cmDependsJavaParser.y" +#line 1205 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -3797,22 +3796,22 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3801 "cmDependsJavaParser.cxx" +#line 3800 "cmDependsJavaParser.cxx" break; case 135: /* InterfaceMemberDeclaration: ClassDeclaration jp_SEMICOL */ -#line 1215 "cmDependsJavaParser.y" +#line 1214 "cmDependsJavaParser.y" { jpElementStart(2); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3812 "cmDependsJavaParser.cxx" +#line 3811 "cmDependsJavaParser.cxx" break; case 136: /* InterfaceMemberDeclaration: InterfaceDeclaration */ -#line 1223 "cmDependsJavaParser.y" +#line 1222 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -3820,22 +3819,22 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3824 "cmDependsJavaParser.cxx" +#line 3823 "cmDependsJavaParser.cxx" break; case 137: /* InterfaceMemberDeclaration: InterfaceDeclaration jp_SEMICOL */ -#line 1232 "cmDependsJavaParser.y" +#line 1231 "cmDependsJavaParser.y" { jpElementStart(2); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3835 "cmDependsJavaParser.cxx" +#line 3834 "cmDependsJavaParser.cxx" break; case 138: /* ConstantDeclaration: FieldDeclaration */ -#line 1241 "cmDependsJavaParser.y" +#line 1240 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -3843,11 +3842,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3847 "cmDependsJavaParser.cxx" +#line 3846 "cmDependsJavaParser.cxx" break; case 139: /* AbstractMethodDeclaration: MethodHeader Semicols */ -#line 1251 "cmDependsJavaParser.y" +#line 1250 "cmDependsJavaParser.y" { jpElementStart(2); jpCheckEmpty(2); @@ -3855,11 +3854,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3859 "cmDependsJavaParser.cxx" +#line 3858 "cmDependsJavaParser.cxx" break; case 140: /* Semicols: jp_SEMICOL */ -#line 1261 "cmDependsJavaParser.y" +#line 1260 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -3867,11 +3866,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3871 "cmDependsJavaParser.cxx" +#line 3870 "cmDependsJavaParser.cxx" break; case 141: /* Semicols: Semicols jp_SEMICOL */ -#line 1270 "cmDependsJavaParser.y" +#line 1269 "cmDependsJavaParser.y" { jpElementStart(2); jpCheckEmpty(2); @@ -3879,11 +3878,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3883 "cmDependsJavaParser.cxx" +#line 3882 "cmDependsJavaParser.cxx" break; case 142: /* ArrayInitializer: jp_CURLYSTART VariableInitializersOptional jp_CURLYEND */ -#line 1280 "cmDependsJavaParser.y" +#line 1279 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); @@ -3891,22 +3890,22 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3895 "cmDependsJavaParser.cxx" +#line 3894 "cmDependsJavaParser.cxx" break; case 143: /* VariableInitializersOptional: %empty */ -#line 1289 "cmDependsJavaParser.y" +#line 1288 "cmDependsJavaParser.y" { jpElementStart(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3906 "cmDependsJavaParser.cxx" +#line 3905 "cmDependsJavaParser.cxx" break; case 144: /* VariableInitializersOptional: VariableInitializers */ -#line 1297 "cmDependsJavaParser.y" +#line 1296 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -3914,11 +3913,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3918 "cmDependsJavaParser.cxx" +#line 3917 "cmDependsJavaParser.cxx" break; case 145: /* VariableInitializersOptional: VariableInitializers jp_COMMA */ -#line 1306 "cmDependsJavaParser.y" +#line 1305 "cmDependsJavaParser.y" { jpElementStart(2); jpCheckEmpty(2); @@ -3926,11 +3925,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3930 "cmDependsJavaParser.cxx" +#line 3929 "cmDependsJavaParser.cxx" break; case 146: /* VariableInitializers: VariableInitializer */ -#line 1316 "cmDependsJavaParser.y" +#line 1315 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -3938,11 +3937,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3942 "cmDependsJavaParser.cxx" +#line 3941 "cmDependsJavaParser.cxx" break; case 147: /* VariableInitializers: VariableInitializers jp_COMMA VariableInitializer */ -#line 1325 "cmDependsJavaParser.y" +#line 1324 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); @@ -3950,33 +3949,33 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3954 "cmDependsJavaParser.cxx" +#line 3953 "cmDependsJavaParser.cxx" break; case 148: /* Block: jp_CURLYSTART BlockStatementsopt jp_CURLYEND */ -#line 1335 "cmDependsJavaParser.y" +#line 1334 "cmDependsJavaParser.y" { jpElementStart(4); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3965 "cmDependsJavaParser.cxx" +#line 3964 "cmDependsJavaParser.cxx" break; case 149: /* BlockStatementsopt: %empty */ -#line 1343 "cmDependsJavaParser.y" +#line 1342 "cmDependsJavaParser.y" { jpElementStart(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3976 "cmDependsJavaParser.cxx" +#line 3975 "cmDependsJavaParser.cxx" break; case 150: /* BlockStatementsopt: BlockStatements */ -#line 1351 "cmDependsJavaParser.y" +#line 1350 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -3984,11 +3983,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3988 "cmDependsJavaParser.cxx" +#line 3987 "cmDependsJavaParser.cxx" break; case 151: /* BlockStatements: BlockStatement */ -#line 1361 "cmDependsJavaParser.y" +#line 1360 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -3996,11 +3995,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4000 "cmDependsJavaParser.cxx" +#line 3999 "cmDependsJavaParser.cxx" break; case 152: /* BlockStatements: BlockStatements BlockStatement */ -#line 1370 "cmDependsJavaParser.y" +#line 1369 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(2); @@ -4008,11 +4007,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4012 "cmDependsJavaParser.cxx" +#line 4011 "cmDependsJavaParser.cxx" break; case 153: /* BlockStatement: LocalVariableDeclarationStatement */ -#line 1380 "cmDependsJavaParser.y" +#line 1379 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4020,11 +4019,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4024 "cmDependsJavaParser.cxx" +#line 4023 "cmDependsJavaParser.cxx" break; case 154: /* BlockStatement: Statement */ -#line 1389 "cmDependsJavaParser.y" +#line 1388 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4032,11 +4031,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4036 "cmDependsJavaParser.cxx" +#line 4035 "cmDependsJavaParser.cxx" break; case 155: /* BlockStatement: ClassDeclaration */ -#line 1398 "cmDependsJavaParser.y" +#line 1397 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4044,11 +4043,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4048 "cmDependsJavaParser.cxx" +#line 4047 "cmDependsJavaParser.cxx" break; case 156: /* LocalVariableDeclarationStatement: LocalVariableDeclaration jp_SEMICOL */ -#line 1408 "cmDependsJavaParser.y" +#line 1407 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(2); @@ -4056,11 +4055,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4060 "cmDependsJavaParser.cxx" +#line 4059 "cmDependsJavaParser.cxx" break; case 157: /* LocalVariableDeclaration: Modifiers Type VariableDeclarators */ -#line 1418 "cmDependsJavaParser.y" +#line 1417 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(3); @@ -4068,11 +4067,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4072 "cmDependsJavaParser.cxx" +#line 4071 "cmDependsJavaParser.cxx" break; case 158: /* LocalVariableDeclaration: Type VariableDeclarators */ -#line 1427 "cmDependsJavaParser.y" +#line 1426 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(2); @@ -4080,11 +4079,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4084 "cmDependsJavaParser.cxx" +#line 4083 "cmDependsJavaParser.cxx" break; case 159: /* Statement: StatementWithoutTrailingSubstatement */ -#line 1437 "cmDependsJavaParser.y" +#line 1436 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4092,11 +4091,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4096 "cmDependsJavaParser.cxx" +#line 4095 "cmDependsJavaParser.cxx" break; case 160: /* Statement: LabeledStatement */ -#line 1446 "cmDependsJavaParser.y" +#line 1445 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4104,11 +4103,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4108 "cmDependsJavaParser.cxx" +#line 4107 "cmDependsJavaParser.cxx" break; case 161: /* Statement: IfThenStatement */ -#line 1455 "cmDependsJavaParser.y" +#line 1454 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4116,11 +4115,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4120 "cmDependsJavaParser.cxx" +#line 4119 "cmDependsJavaParser.cxx" break; case 162: /* Statement: IfThenElseStatement */ -#line 1464 "cmDependsJavaParser.y" +#line 1463 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4128,11 +4127,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4132 "cmDependsJavaParser.cxx" +#line 4131 "cmDependsJavaParser.cxx" break; case 163: /* Statement: WhileStatement */ -#line 1473 "cmDependsJavaParser.y" +#line 1472 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4140,11 +4139,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4144 "cmDependsJavaParser.cxx" +#line 4143 "cmDependsJavaParser.cxx" break; case 164: /* Statement: ForStatement */ -#line 1482 "cmDependsJavaParser.y" +#line 1481 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4152,11 +4151,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4156 "cmDependsJavaParser.cxx" +#line 4155 "cmDependsJavaParser.cxx" break; case 165: /* StatementNoShortIf: StatementWithoutTrailingSubstatement */ -#line 1492 "cmDependsJavaParser.y" +#line 1491 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4164,11 +4163,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4168 "cmDependsJavaParser.cxx" +#line 4167 "cmDependsJavaParser.cxx" break; case 166: /* StatementNoShortIf: LabeledStatementNoShortIf */ -#line 1501 "cmDependsJavaParser.y" +#line 1500 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4176,11 +4175,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4180 "cmDependsJavaParser.cxx" +#line 4179 "cmDependsJavaParser.cxx" break; case 167: /* StatementNoShortIf: IfThenElseStatementNoShortIf */ -#line 1510 "cmDependsJavaParser.y" +#line 1509 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4188,11 +4187,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4192 "cmDependsJavaParser.cxx" +#line 4191 "cmDependsJavaParser.cxx" break; case 168: /* StatementNoShortIf: WhileStatementNoShortIf */ -#line 1519 "cmDependsJavaParser.y" +#line 1518 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4200,11 +4199,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4204 "cmDependsJavaParser.cxx" +#line 4203 "cmDependsJavaParser.cxx" break; case 169: /* StatementNoShortIf: ForStatementNoShortIf */ -#line 1528 "cmDependsJavaParser.y" +#line 1527 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4212,11 +4211,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4216 "cmDependsJavaParser.cxx" +#line 4215 "cmDependsJavaParser.cxx" break; case 170: /* StatementWithoutTrailingSubstatement: Block */ -#line 1538 "cmDependsJavaParser.y" +#line 1537 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4224,11 +4223,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4228 "cmDependsJavaParser.cxx" +#line 4227 "cmDependsJavaParser.cxx" break; case 171: /* StatementWithoutTrailingSubstatement: EmptyStatement */ -#line 1547 "cmDependsJavaParser.y" +#line 1546 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4236,11 +4235,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4240 "cmDependsJavaParser.cxx" +#line 4239 "cmDependsJavaParser.cxx" break; case 172: /* StatementWithoutTrailingSubstatement: ExpressionStatement */ -#line 1556 "cmDependsJavaParser.y" +#line 1555 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4248,11 +4247,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4252 "cmDependsJavaParser.cxx" +#line 4251 "cmDependsJavaParser.cxx" break; case 173: /* StatementWithoutTrailingSubstatement: SwitchStatement */ -#line 1565 "cmDependsJavaParser.y" +#line 1564 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4260,11 +4259,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4264 "cmDependsJavaParser.cxx" +#line 4263 "cmDependsJavaParser.cxx" break; case 174: /* StatementWithoutTrailingSubstatement: DoStatement */ -#line 1574 "cmDependsJavaParser.y" +#line 1573 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4272,11 +4271,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4276 "cmDependsJavaParser.cxx" +#line 4275 "cmDependsJavaParser.cxx" break; case 175: /* StatementWithoutTrailingSubstatement: BreakStatement */ -#line 1583 "cmDependsJavaParser.y" +#line 1582 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4284,11 +4283,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4288 "cmDependsJavaParser.cxx" +#line 4287 "cmDependsJavaParser.cxx" break; case 176: /* StatementWithoutTrailingSubstatement: ContinueStatement */ -#line 1592 "cmDependsJavaParser.y" +#line 1591 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4296,11 +4295,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4300 "cmDependsJavaParser.cxx" +#line 4299 "cmDependsJavaParser.cxx" break; case 177: /* StatementWithoutTrailingSubstatement: ReturnStatement */ -#line 1601 "cmDependsJavaParser.y" +#line 1600 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4308,11 +4307,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4312 "cmDependsJavaParser.cxx" +#line 4311 "cmDependsJavaParser.cxx" break; case 178: /* StatementWithoutTrailingSubstatement: SynchronizedStatement */ -#line 1610 "cmDependsJavaParser.y" +#line 1609 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4320,11 +4319,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4324 "cmDependsJavaParser.cxx" +#line 4323 "cmDependsJavaParser.cxx" break; case 179: /* StatementWithoutTrailingSubstatement: ThrowStatement */ -#line 1619 "cmDependsJavaParser.y" +#line 1618 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4332,11 +4331,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4336 "cmDependsJavaParser.cxx" +#line 4335 "cmDependsJavaParser.cxx" break; case 180: /* StatementWithoutTrailingSubstatement: TryStatement */ -#line 1628 "cmDependsJavaParser.y" +#line 1627 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4344,11 +4343,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4348 "cmDependsJavaParser.cxx" +#line 4347 "cmDependsJavaParser.cxx" break; case 181: /* StatementWithoutTrailingSubstatement: AssertStatement */ -#line 1637 "cmDependsJavaParser.y" +#line 1636 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4356,11 +4355,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4360 "cmDependsJavaParser.cxx" +#line 4359 "cmDependsJavaParser.cxx" break; case 182: /* EmptyStatement: jp_SEMICOL */ -#line 1647 "cmDependsJavaParser.y" +#line 1646 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4368,11 +4367,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4372 "cmDependsJavaParser.cxx" +#line 4371 "cmDependsJavaParser.cxx" break; case 183: /* LabeledStatement: Identifier jp_COLON Statement */ -#line 1657 "cmDependsJavaParser.y" +#line 1656 "cmDependsJavaParser.y" { jpElementStart(3); yyGetParser->DeallocateParserType(&((yyvsp[-2].str))); @@ -4381,11 +4380,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4385 "cmDependsJavaParser.cxx" +#line 4384 "cmDependsJavaParser.cxx" break; case 184: /* LabeledStatementNoShortIf: Identifier jp_COLON StatementNoShortIf */ -#line 1668 "cmDependsJavaParser.y" +#line 1667 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); @@ -4393,11 +4392,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4397 "cmDependsJavaParser.cxx" +#line 4396 "cmDependsJavaParser.cxx" break; case 185: /* ExpressionStatement: StatementExpression jp_SEMICOL */ -#line 1678 "cmDependsJavaParser.y" +#line 1677 "cmDependsJavaParser.y" { jpElementStart(2); jpCheckEmpty(2); @@ -4405,11 +4404,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4409 "cmDependsJavaParser.cxx" +#line 4408 "cmDependsJavaParser.cxx" break; case 186: /* StatementExpression: Assignment */ -#line 1688 "cmDependsJavaParser.y" +#line 1687 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4417,11 +4416,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4421 "cmDependsJavaParser.cxx" +#line 4420 "cmDependsJavaParser.cxx" break; case 187: /* StatementExpression: PreIncrementExpression */ -#line 1697 "cmDependsJavaParser.y" +#line 1696 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4429,11 +4428,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4433 "cmDependsJavaParser.cxx" +#line 4432 "cmDependsJavaParser.cxx" break; case 188: /* StatementExpression: PreDecrementExpression */ -#line 1706 "cmDependsJavaParser.y" +#line 1705 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4441,11 +4440,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4445 "cmDependsJavaParser.cxx" +#line 4444 "cmDependsJavaParser.cxx" break; case 189: /* StatementExpression: PostIncrementExpression */ -#line 1715 "cmDependsJavaParser.y" +#line 1714 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4453,11 +4452,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4457 "cmDependsJavaParser.cxx" +#line 4456 "cmDependsJavaParser.cxx" break; case 190: /* StatementExpression: PostDecrementExpression */ -#line 1724 "cmDependsJavaParser.y" +#line 1723 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4465,11 +4464,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4469 "cmDependsJavaParser.cxx" +#line 4468 "cmDependsJavaParser.cxx" break; case 191: /* StatementExpression: MethodInvocation */ -#line 1733 "cmDependsJavaParser.y" +#line 1732 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4477,11 +4476,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4481 "cmDependsJavaParser.cxx" +#line 4480 "cmDependsJavaParser.cxx" break; case 192: /* StatementExpression: ClassInstanceCreationExpression */ -#line 1742 "cmDependsJavaParser.y" +#line 1741 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4489,11 +4488,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4493 "cmDependsJavaParser.cxx" +#line 4492 "cmDependsJavaParser.cxx" break; case 193: /* IfThenStatement: jp_IF jp_PARESTART Expression jp_PAREEND Statement */ -#line 1752 "cmDependsJavaParser.y" +#line 1751 "cmDependsJavaParser.y" { jpElementStart(5); jpCheckEmpty(5); @@ -4501,11 +4500,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4505 "cmDependsJavaParser.cxx" +#line 4504 "cmDependsJavaParser.cxx" break; case 194: /* IfThenElseStatement: jp_IF jp_PARESTART Expression jp_PAREEND StatementNoShortIf jp_ELSE Statement */ -#line 1762 "cmDependsJavaParser.y" +#line 1761 "cmDependsJavaParser.y" { jpElementStart(7); jpCheckEmpty(7); @@ -4513,11 +4512,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4517 "cmDependsJavaParser.cxx" +#line 4516 "cmDependsJavaParser.cxx" break; case 195: /* IfThenElseStatementNoShortIf: jp_IF jp_PARESTART Expression jp_PAREEND StatementNoShortIf jp_ELSE StatementNoShortIf */ -#line 1772 "cmDependsJavaParser.y" +#line 1771 "cmDependsJavaParser.y" { jpElementStart(7); jpCheckEmpty(7); @@ -4525,40 +4524,40 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4529 "cmDependsJavaParser.cxx" +#line 4528 "cmDependsJavaParser.cxx" break; case 196: /* SwitchStatement: jp_SWITCH jp_PARESTART Expression jp_PAREEND SwitchBlock */ -#line 1782 "cmDependsJavaParser.y" +#line 1781 "cmDependsJavaParser.y" { jpElementStart(5); } -#line 4538 "cmDependsJavaParser.cxx" +#line 4537 "cmDependsJavaParser.cxx" break; case 197: /* SwitchBlock: jp_CURLYSTART SwitchBlockStatementGroups SwitchLabelsopt jp_CURLYEND */ -#line 1789 "cmDependsJavaParser.y" +#line 1788 "cmDependsJavaParser.y" { jpElementStart(4); } -#line 4547 "cmDependsJavaParser.cxx" +#line 4546 "cmDependsJavaParser.cxx" break; case 198: /* SwitchLabelsopt: %empty */ -#line 1795 "cmDependsJavaParser.y" +#line 1794 "cmDependsJavaParser.y" { jpElementStart(0); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 4558 "cmDependsJavaParser.cxx" +#line 4557 "cmDependsJavaParser.cxx" break; case 199: /* SwitchLabelsopt: SwitchLabels */ -#line 1803 "cmDependsJavaParser.y" +#line 1802 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4566,22 +4565,22 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4570 "cmDependsJavaParser.cxx" +#line 4569 "cmDependsJavaParser.cxx" break; case 200: /* SwitchBlockStatementGroups: %empty */ -#line 1812 "cmDependsJavaParser.y" +#line 1811 "cmDependsJavaParser.y" { jpElementStart(0); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 4581 "cmDependsJavaParser.cxx" +#line 4580 "cmDependsJavaParser.cxx" break; case 201: /* SwitchBlockStatementGroups: SwitchBlockStatementGroups SwitchBlockStatementGroup */ -#line 1820 "cmDependsJavaParser.y" +#line 1819 "cmDependsJavaParser.y" { jpElementStart(2); jpCheckEmpty(2); @@ -4589,11 +4588,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4593 "cmDependsJavaParser.cxx" +#line 4592 "cmDependsJavaParser.cxx" break; case 202: /* SwitchBlockStatementGroup: SwitchLabels BlockStatements */ -#line 1830 "cmDependsJavaParser.y" +#line 1829 "cmDependsJavaParser.y" { jpElementStart(2); jpCheckEmpty(2); @@ -4601,11 +4600,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4605 "cmDependsJavaParser.cxx" +#line 4604 "cmDependsJavaParser.cxx" break; case 203: /* SwitchLabels: SwitchLabel */ -#line 1840 "cmDependsJavaParser.y" +#line 1839 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4613,11 +4612,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4617 "cmDependsJavaParser.cxx" +#line 4616 "cmDependsJavaParser.cxx" break; case 204: /* SwitchLabels: SwitchLabels SwitchLabel */ -#line 1849 "cmDependsJavaParser.y" +#line 1848 "cmDependsJavaParser.y" { jpElementStart(2); jpCheckEmpty(2); @@ -4625,11 +4624,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4629 "cmDependsJavaParser.cxx" +#line 4628 "cmDependsJavaParser.cxx" break; case 205: /* SwitchLabel: jp_CASE ConstantExpression jp_COLON */ -#line 1859 "cmDependsJavaParser.y" +#line 1858 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); @@ -4637,11 +4636,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4641 "cmDependsJavaParser.cxx" +#line 4640 "cmDependsJavaParser.cxx" break; case 206: /* SwitchLabel: jp_DEFAULT jp_COLON */ -#line 1868 "cmDependsJavaParser.y" +#line 1867 "cmDependsJavaParser.y" { jpElementStart(2); jpCheckEmpty(2); @@ -4649,58 +4648,58 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4653 "cmDependsJavaParser.cxx" +#line 4652 "cmDependsJavaParser.cxx" break; case 207: /* WhileStatement: jp_WHILE jp_PARESTART Expression jp_PAREEND Statement */ -#line 1878 "cmDependsJavaParser.y" +#line 1877 "cmDependsJavaParser.y" { jpElementStart(5); } -#line 4662 "cmDependsJavaParser.cxx" +#line 4661 "cmDependsJavaParser.cxx" break; case 208: /* WhileStatementNoShortIf: jp_WHILE jp_PARESTART Expression jp_PAREEND StatementNoShortIf */ -#line 1885 "cmDependsJavaParser.y" +#line 1884 "cmDependsJavaParser.y" { jpElementStart(5); } -#line 4671 "cmDependsJavaParser.cxx" +#line 4670 "cmDependsJavaParser.cxx" break; case 209: /* DoStatement: jp_DO Statement jp_WHILE jp_PARESTART Expression jp_PAREEND jp_SEMICOL */ -#line 1892 "cmDependsJavaParser.y" +#line 1891 "cmDependsJavaParser.y" { jpElementStart(7); } -#line 4680 "cmDependsJavaParser.cxx" +#line 4679 "cmDependsJavaParser.cxx" break; case 210: /* ForStatement: jp_FOR jp_PARESTART ForInitopt jp_SEMICOL Expressionopt jp_SEMICOL ForUpdateopt jp_PAREEND Statement */ -#line 1900 "cmDependsJavaParser.y" +#line 1899 "cmDependsJavaParser.y" { jpElementStart(9); } -#line 4689 "cmDependsJavaParser.cxx" +#line 4688 "cmDependsJavaParser.cxx" break; case 211: /* ForUpdateopt: %empty */ -#line 1906 "cmDependsJavaParser.y" +#line 1905 "cmDependsJavaParser.y" { jpElementStart(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 4700 "cmDependsJavaParser.cxx" +#line 4699 "cmDependsJavaParser.cxx" break; case 212: /* ForUpdateopt: ForUpdate */ -#line 1914 "cmDependsJavaParser.y" +#line 1913 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4708,22 +4707,22 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4712 "cmDependsJavaParser.cxx" +#line 4711 "cmDependsJavaParser.cxx" break; case 213: /* ForInitopt: %empty */ -#line 1923 "cmDependsJavaParser.y" +#line 1922 "cmDependsJavaParser.y" { jpElementStart(0); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 4723 "cmDependsJavaParser.cxx" +#line 4722 "cmDependsJavaParser.cxx" break; case 214: /* ForInitopt: ForInit */ -#line 1931 "cmDependsJavaParser.y" +#line 1930 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4731,33 +4730,33 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4735 "cmDependsJavaParser.cxx" +#line 4734 "cmDependsJavaParser.cxx" break; case 215: /* ForStatementNoShortIf: jp_FOR jp_PARESTART ForInitopt jp_SEMICOL Expressionopt jp_SEMICOL ForUpdateopt jp_PAREEND StatementNoShortIf */ -#line 1942 "cmDependsJavaParser.y" +#line 1941 "cmDependsJavaParser.y" { jpElementStart(9); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 4746 "cmDependsJavaParser.cxx" +#line 4745 "cmDependsJavaParser.cxx" break; case 216: /* Expressionopt: %empty */ -#line 1950 "cmDependsJavaParser.y" +#line 1949 "cmDependsJavaParser.y" { jpElementStart(0); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 4757 "cmDependsJavaParser.cxx" +#line 4756 "cmDependsJavaParser.cxx" break; case 217: /* Expressionopt: Expression */ -#line 1958 "cmDependsJavaParser.y" +#line 1957 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4765,11 +4764,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4769 "cmDependsJavaParser.cxx" +#line 4768 "cmDependsJavaParser.cxx" break; case 218: /* ForInit: StatementExpressionList */ -#line 1968 "cmDependsJavaParser.y" +#line 1967 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4777,11 +4776,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4781 "cmDependsJavaParser.cxx" +#line 4780 "cmDependsJavaParser.cxx" break; case 219: /* ForInit: LocalVariableDeclaration */ -#line 1977 "cmDependsJavaParser.y" +#line 1976 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4789,11 +4788,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4793 "cmDependsJavaParser.cxx" +#line 4792 "cmDependsJavaParser.cxx" break; case 220: /* ForUpdate: StatementExpressionList */ -#line 1987 "cmDependsJavaParser.y" +#line 1986 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4801,11 +4800,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4805 "cmDependsJavaParser.cxx" +#line 4804 "cmDependsJavaParser.cxx" break; case 221: /* StatementExpressionList: StatementExpression */ -#line 1997 "cmDependsJavaParser.y" +#line 1996 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4813,11 +4812,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4817 "cmDependsJavaParser.cxx" +#line 4816 "cmDependsJavaParser.cxx" break; case 222: /* StatementExpressionList: StatementExpressionList jp_COMMA StatementExpression */ -#line 2006 "cmDependsJavaParser.y" +#line 2005 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); @@ -4825,11 +4824,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4829 "cmDependsJavaParser.cxx" +#line 4828 "cmDependsJavaParser.cxx" break; case 223: /* AssertStatement: jp_ASSERT Expression jp_SEMICOL */ -#line 2016 "cmDependsJavaParser.y" +#line 2015 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); @@ -4837,11 +4836,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4841 "cmDependsJavaParser.cxx" +#line 4840 "cmDependsJavaParser.cxx" break; case 224: /* AssertStatement: jp_ASSERT Expression jp_COLON Expression jp_SEMICOL */ -#line 2025 "cmDependsJavaParser.y" +#line 2024 "cmDependsJavaParser.y" { jpElementStart(5); jpCheckEmpty(5); @@ -4849,11 +4848,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4853 "cmDependsJavaParser.cxx" +#line 4852 "cmDependsJavaParser.cxx" break; case 225: /* BreakStatement: jp_BREAK Identifieropt jp_SEMICOL */ -#line 2035 "cmDependsJavaParser.y" +#line 2034 "cmDependsJavaParser.y" { jpElementStart(3); yyGetParser->DeallocateParserType(&((yyvsp[-1].str))); @@ -4862,31 +4861,31 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4866 "cmDependsJavaParser.cxx" +#line 4865 "cmDependsJavaParser.cxx" break; case 226: /* Identifieropt: %empty */ -#line 2045 "cmDependsJavaParser.y" +#line 2044 "cmDependsJavaParser.y" { jpElementStart(0); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 4877 "cmDependsJavaParser.cxx" +#line 4876 "cmDependsJavaParser.cxx" break; case 227: /* Identifieropt: Identifier */ -#line 2053 "cmDependsJavaParser.y" +#line 2052 "cmDependsJavaParser.y" { jpElementStart(1); } -#line 4886 "cmDependsJavaParser.cxx" +#line 4885 "cmDependsJavaParser.cxx" break; case 228: /* ContinueStatement: jp_CONTINUE Identifieropt jp_SEMICOL */ -#line 2060 "cmDependsJavaParser.y" +#line 2059 "cmDependsJavaParser.y" { jpElementStart(3); yyGetParser->DeallocateParserType(&((yyvsp[-1].str))); @@ -4895,11 +4894,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4899 "cmDependsJavaParser.cxx" +#line 4898 "cmDependsJavaParser.cxx" break; case 229: /* ReturnStatement: jp_RETURN Expressionopt jp_SEMICOL */ -#line 2071 "cmDependsJavaParser.y" +#line 2070 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); @@ -4907,11 +4906,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4911 "cmDependsJavaParser.cxx" +#line 4910 "cmDependsJavaParser.cxx" break; case 230: /* ThrowStatement: jp_THROW Expression jp_SEMICOL */ -#line 2081 "cmDependsJavaParser.y" +#line 2080 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); @@ -4919,11 +4918,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4923 "cmDependsJavaParser.cxx" +#line 4922 "cmDependsJavaParser.cxx" break; case 231: /* SynchronizedStatement: jp_SYNCHRONIZED jp_PARESTART Expression jp_PAREEND Block */ -#line 2091 "cmDependsJavaParser.y" +#line 2090 "cmDependsJavaParser.y" { jpElementStart(5); jpCheckEmpty(5); @@ -4931,11 +4930,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4935 "cmDependsJavaParser.cxx" +#line 4934 "cmDependsJavaParser.cxx" break; case 232: /* TryStatement: jp_TRY Block Catches */ -#line 2101 "cmDependsJavaParser.y" +#line 2100 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); @@ -4943,11 +4942,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4947 "cmDependsJavaParser.cxx" +#line 4946 "cmDependsJavaParser.cxx" break; case 233: /* TryStatement: jp_TRY Block Catchesopt Finally */ -#line 2110 "cmDependsJavaParser.y" +#line 2109 "cmDependsJavaParser.y" { jpElementStart(4); jpCheckEmpty(4); @@ -4955,22 +4954,22 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4959 "cmDependsJavaParser.cxx" +#line 4958 "cmDependsJavaParser.cxx" break; case 234: /* Catchesopt: %empty */ -#line 2119 "cmDependsJavaParser.y" +#line 2118 "cmDependsJavaParser.y" { jpElementStart(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 4970 "cmDependsJavaParser.cxx" +#line 4969 "cmDependsJavaParser.cxx" break; case 235: /* Catchesopt: Catches */ -#line 2127 "cmDependsJavaParser.y" +#line 2126 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4978,11 +4977,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4982 "cmDependsJavaParser.cxx" +#line 4981 "cmDependsJavaParser.cxx" break; case 236: /* Catches: CatchClause */ -#line 2137 "cmDependsJavaParser.y" +#line 2136 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -4990,11 +4989,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4994 "cmDependsJavaParser.cxx" +#line 4993 "cmDependsJavaParser.cxx" break; case 237: /* Catches: Catches CatchClause */ -#line 2146 "cmDependsJavaParser.y" +#line 2145 "cmDependsJavaParser.y" { jpElementStart(2); jpCheckEmpty(2); @@ -5002,20 +5001,20 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5006 "cmDependsJavaParser.cxx" +#line 5005 "cmDependsJavaParser.cxx" break; case 238: /* CatchClause: jp_CATCH jp_PARESTART FormalParameter jp_PAREEND Block */ -#line 2156 "cmDependsJavaParser.y" +#line 2155 "cmDependsJavaParser.y" { jpElementStart(5); } -#line 5015 "cmDependsJavaParser.cxx" +#line 5014 "cmDependsJavaParser.cxx" break; case 239: /* Finally: jp_FINALLY Block */ -#line 2163 "cmDependsJavaParser.y" +#line 2162 "cmDependsJavaParser.y" { jpElementStart(2); jpCheckEmpty(2); @@ -5023,11 +5022,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5027 "cmDependsJavaParser.cxx" +#line 5026 "cmDependsJavaParser.cxx" break; case 240: /* Primary: PrimaryNoNewArray */ -#line 2173 "cmDependsJavaParser.y" +#line 2172 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -5035,11 +5034,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5039 "cmDependsJavaParser.cxx" +#line 5038 "cmDependsJavaParser.cxx" break; case 241: /* Primary: ArrayCreationExpression */ -#line 2182 "cmDependsJavaParser.y" +#line 2181 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -5047,11 +5046,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5051 "cmDependsJavaParser.cxx" +#line 5050 "cmDependsJavaParser.cxx" break; case 242: /* PrimaryNoNewArray: Literal */ -#line 2192 "cmDependsJavaParser.y" +#line 2191 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -5059,20 +5058,20 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5063 "cmDependsJavaParser.cxx" +#line 5062 "cmDependsJavaParser.cxx" break; case 243: /* PrimaryNoNewArray: jp_THIS */ -#line 2201 "cmDependsJavaParser.y" +#line 2200 "cmDependsJavaParser.y" { jpElementStart(1); } -#line 5072 "cmDependsJavaParser.cxx" +#line 5071 "cmDependsJavaParser.cxx" break; case 244: /* PrimaryNoNewArray: jp_PARESTART Expression jp_PAREEND */ -#line 2207 "cmDependsJavaParser.y" +#line 2206 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); @@ -5080,11 +5079,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5084 "cmDependsJavaParser.cxx" +#line 5083 "cmDependsJavaParser.cxx" break; case 245: /* PrimaryNoNewArray: ClassInstanceCreationExpression */ -#line 2216 "cmDependsJavaParser.y" +#line 2215 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -5092,11 +5091,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5096 "cmDependsJavaParser.cxx" +#line 5095 "cmDependsJavaParser.cxx" break; case 246: /* PrimaryNoNewArray: FieldAccess */ -#line 2225 "cmDependsJavaParser.y" +#line 2224 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -5104,11 +5103,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5108 "cmDependsJavaParser.cxx" +#line 5107 "cmDependsJavaParser.cxx" break; case 247: /* PrimaryNoNewArray: MethodInvocation */ -#line 2234 "cmDependsJavaParser.y" +#line 2233 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -5116,11 +5115,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5120 "cmDependsJavaParser.cxx" +#line 5119 "cmDependsJavaParser.cxx" break; case 248: /* PrimaryNoNewArray: ArrayAccess */ -#line 2243 "cmDependsJavaParser.y" +#line 2242 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -5128,11 +5127,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5132 "cmDependsJavaParser.cxx" +#line 5131 "cmDependsJavaParser.cxx" break; case 249: /* ClassInstanceCreationExpression: New ClassType jp_PARESTART ArgumentListopt jp_PAREEND ClassBodyOpt */ -#line 2253 "cmDependsJavaParser.y" +#line 2252 "cmDependsJavaParser.y" { jpElementStart(6); jpCheckEmpty(6); @@ -5140,22 +5139,22 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5144 "cmDependsJavaParser.cxx" +#line 5143 "cmDependsJavaParser.cxx" break; case 250: /* ClassBodyOpt: %empty */ -#line 2262 "cmDependsJavaParser.y" +#line 2261 "cmDependsJavaParser.y" { jpElementStart(0); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 5155 "cmDependsJavaParser.cxx" +#line 5154 "cmDependsJavaParser.cxx" break; case 251: /* ClassBodyOpt: ClassBody */ -#line 2270 "cmDependsJavaParser.y" +#line 2269 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -5163,22 +5162,22 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5167 "cmDependsJavaParser.cxx" +#line 5166 "cmDependsJavaParser.cxx" break; case 252: /* ArgumentListopt: %empty */ -#line 2279 "cmDependsJavaParser.y" +#line 2278 "cmDependsJavaParser.y" { jpElementStart(0); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 5178 "cmDependsJavaParser.cxx" +#line 5177 "cmDependsJavaParser.cxx" break; case 253: /* ArgumentListopt: ArgumentList */ -#line 2287 "cmDependsJavaParser.y" +#line 2286 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -5186,11 +5185,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5190 "cmDependsJavaParser.cxx" +#line 5189 "cmDependsJavaParser.cxx" break; case 254: /* ArgumentList: Expression */ -#line 2297 "cmDependsJavaParser.y" +#line 2296 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -5198,11 +5197,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5202 "cmDependsJavaParser.cxx" +#line 5201 "cmDependsJavaParser.cxx" break; case 255: /* ArgumentList: ArgumentList jp_COMMA Expression */ -#line 2306 "cmDependsJavaParser.y" +#line 2305 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); @@ -5210,11 +5209,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5214 "cmDependsJavaParser.cxx" +#line 5213 "cmDependsJavaParser.cxx" break; case 256: /* ArrayCreationExpression: New PrimitiveType DimExprs Dimsopt */ -#line 2316 "cmDependsJavaParser.y" +#line 2315 "cmDependsJavaParser.y" { jpElementStart(4); jpCheckEmpty(4); @@ -5222,11 +5221,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5226 "cmDependsJavaParser.cxx" +#line 5225 "cmDependsJavaParser.cxx" break; case 257: /* ArrayCreationExpression: New ClassOrInterfaceType DimExprs Dimsopt */ -#line 2325 "cmDependsJavaParser.y" +#line 2324 "cmDependsJavaParser.y" { jpElementStart(4); jpCheckEmpty(4); @@ -5234,11 +5233,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5238 "cmDependsJavaParser.cxx" +#line 5237 "cmDependsJavaParser.cxx" break; case 258: /* ArrayCreationExpression: New PrimitiveType Dims ArrayInitializer */ -#line 2334 "cmDependsJavaParser.y" +#line 2333 "cmDependsJavaParser.y" { jpElementStart(4); jpCheckEmpty(4); @@ -5246,11 +5245,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5250 "cmDependsJavaParser.cxx" +#line 5249 "cmDependsJavaParser.cxx" break; case 259: /* ArrayCreationExpression: New ClassOrInterfaceType Dims ArrayInitializer */ -#line 2343 "cmDependsJavaParser.y" +#line 2342 "cmDependsJavaParser.y" { jpElementStart(4); jpCheckEmpty(4); @@ -5258,22 +5257,22 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5262 "cmDependsJavaParser.cxx" +#line 5261 "cmDependsJavaParser.cxx" break; case 260: /* Dimsopt: %empty */ -#line 2352 "cmDependsJavaParser.y" +#line 2351 "cmDependsJavaParser.y" { jpElementStart(0); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 5273 "cmDependsJavaParser.cxx" +#line 5272 "cmDependsJavaParser.cxx" break; case 261: /* Dimsopt: Dims */ -#line 2360 "cmDependsJavaParser.y" +#line 2359 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -5281,11 +5280,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5285 "cmDependsJavaParser.cxx" +#line 5284 "cmDependsJavaParser.cxx" break; case 262: /* DimExprs: DimExpr */ -#line 2370 "cmDependsJavaParser.y" +#line 2369 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -5293,11 +5292,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5297 "cmDependsJavaParser.cxx" +#line 5296 "cmDependsJavaParser.cxx" break; case 263: /* DimExprs: DimExprs DimExpr */ -#line 2379 "cmDependsJavaParser.y" +#line 2378 "cmDependsJavaParser.y" { jpElementStart(2); jpCheckEmpty(2); @@ -5305,11 +5304,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5309 "cmDependsJavaParser.cxx" +#line 5308 "cmDependsJavaParser.cxx" break; case 264: /* DimExpr: jp_BRACKETSTART Expression jp_BRACKETEND */ -#line 2389 "cmDependsJavaParser.y" +#line 2388 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); @@ -5317,29 +5316,29 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5321 "cmDependsJavaParser.cxx" +#line 5320 "cmDependsJavaParser.cxx" break; case 265: /* Dims: jp_BRACKETSTART jp_BRACKETEND */ -#line 2399 "cmDependsJavaParser.y" +#line 2398 "cmDependsJavaParser.y" { jpElementStart(2); } -#line 5330 "cmDependsJavaParser.cxx" +#line 5329 "cmDependsJavaParser.cxx" break; case 266: /* Dims: Dims jp_BRACKETSTART jp_BRACKETEND */ -#line 2405 "cmDependsJavaParser.y" +#line 2404 "cmDependsJavaParser.y" { jpElementStart(3); } -#line 5339 "cmDependsJavaParser.cxx" +#line 5338 "cmDependsJavaParser.cxx" break; case 267: /* FieldAccess: Primary jp_DOT Identifier */ -#line 2412 "cmDependsJavaParser.y" +#line 2411 "cmDependsJavaParser.y" { jpElementStart(3); yyGetParser->DeallocateParserType(&((yyvsp[0].str))); @@ -5348,11 +5347,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5352 "cmDependsJavaParser.cxx" +#line 5351 "cmDependsJavaParser.cxx" break; case 268: /* FieldAccess: jp_SUPER jp_DOT Identifier */ -#line 2422 "cmDependsJavaParser.y" +#line 2421 "cmDependsJavaParser.y" { jpElementStart(3); yyGetParser->DeallocateParserType(&((yyvsp[0].str))); @@ -5361,11 +5360,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5365 "cmDependsJavaParser.cxx" +#line 5364 "cmDependsJavaParser.cxx" break; case 269: /* FieldAccess: jp_THIS jp_DOT Identifier */ -#line 2432 "cmDependsJavaParser.y" +#line 2431 "cmDependsJavaParser.y" { jpElementStart(3); yyGetParser->DeallocateParserType(&((yyvsp[0].str))); @@ -5374,11 +5373,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5378 "cmDependsJavaParser.cxx" +#line 5377 "cmDependsJavaParser.cxx" break; case 270: /* FieldAccess: Primary jp_DOT jp_THIS */ -#line 2442 "cmDependsJavaParser.y" +#line 2441 "cmDependsJavaParser.y" { jpElementStart(3); yyGetParser->DeallocateParserType(&((yyvsp[0].str))); @@ -5387,11 +5386,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5391 "cmDependsJavaParser.cxx" +#line 5390 "cmDependsJavaParser.cxx" break; case 271: /* MethodInvocation: Name jp_PARESTART ArgumentListopt jp_PAREEND */ -#line 2453 "cmDependsJavaParser.y" +#line 2452 "cmDependsJavaParser.y" { jpElementStart(4); yyGetParser->DeallocateParserType(&((yyvsp[-3].str))); @@ -5400,11 +5399,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5404 "cmDependsJavaParser.cxx" +#line 5403 "cmDependsJavaParser.cxx" break; case 272: /* MethodInvocation: Primary jp_DOT Identifier jp_PARESTART ArgumentListopt jp_PAREEND */ -#line 2463 "cmDependsJavaParser.y" +#line 2462 "cmDependsJavaParser.y" { jpElementStart(6); yyGetParser->DeallocateParserType(&((yyvsp[-5].str))); @@ -5414,11 +5413,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5418 "cmDependsJavaParser.cxx" +#line 5417 "cmDependsJavaParser.cxx" break; case 273: /* MethodInvocation: jp_SUPER jp_DOT Identifier jp_PARESTART ArgumentListopt jp_PAREEND */ -#line 2474 "cmDependsJavaParser.y" +#line 2473 "cmDependsJavaParser.y" { jpElementStart(6); yyGetParser->DeallocateParserType(&((yyvsp[-3].str))); @@ -5427,11 +5426,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5431 "cmDependsJavaParser.cxx" +#line 5430 "cmDependsJavaParser.cxx" break; case 274: /* MethodInvocation: jp_THIS jp_DOT Identifier jp_PARESTART ArgumentListopt jp_PAREEND */ -#line 2484 "cmDependsJavaParser.y" +#line 2483 "cmDependsJavaParser.y" { jpElementStart(6); yyGetParser->DeallocateParserType(&((yyvsp[-3].str))); @@ -5440,11 +5439,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5444 "cmDependsJavaParser.cxx" +#line 5443 "cmDependsJavaParser.cxx" break; case 275: /* ArrayAccess: Name jp_BRACKETSTART Expression jp_BRACKETEND */ -#line 2495 "cmDependsJavaParser.y" +#line 2494 "cmDependsJavaParser.y" { jpElementStart(4); yyGetParser->DeallocateParserType(&((yyvsp[-3].str))); @@ -5453,11 +5452,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5457 "cmDependsJavaParser.cxx" +#line 5456 "cmDependsJavaParser.cxx" break; case 276: /* ArrayAccess: PrimaryNoNewArray jp_BRACKETSTART Expression jp_BRACKETEND */ -#line 2505 "cmDependsJavaParser.y" +#line 2504 "cmDependsJavaParser.y" { jpElementStart(4); jpCheckEmpty(4); @@ -5465,11 +5464,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5469 "cmDependsJavaParser.cxx" +#line 5468 "cmDependsJavaParser.cxx" break; case 277: /* PostfixExpression: Primary */ -#line 2515 "cmDependsJavaParser.y" +#line 2514 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -5477,11 +5476,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5481 "cmDependsJavaParser.cxx" +#line 5480 "cmDependsJavaParser.cxx" break; case 278: /* PostfixExpression: Name */ -#line 2524 "cmDependsJavaParser.y" +#line 2523 "cmDependsJavaParser.y" { jpElementStart(1); yyGetParser->DeallocateParserType(&((yyvsp[0].str))); @@ -5489,11 +5488,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5493 "cmDependsJavaParser.cxx" +#line 5492 "cmDependsJavaParser.cxx" break; case 279: /* PostfixExpression: ArrayType jp_DOT jp_CLASS */ -#line 2533 "cmDependsJavaParser.y" +#line 2532 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); @@ -5501,11 +5500,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5505 "cmDependsJavaParser.cxx" +#line 5504 "cmDependsJavaParser.cxx" break; case 280: /* PostfixExpression: PostIncrementExpression */ -#line 2542 "cmDependsJavaParser.y" +#line 2541 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -5513,11 +5512,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5517 "cmDependsJavaParser.cxx" +#line 5516 "cmDependsJavaParser.cxx" break; case 281: /* PostfixExpression: PostDecrementExpression */ -#line 2551 "cmDependsJavaParser.y" +#line 2550 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -5525,11 +5524,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5529 "cmDependsJavaParser.cxx" +#line 5528 "cmDependsJavaParser.cxx" break; case 282: /* PostIncrementExpression: PostfixExpression jp_PLUSPLUS */ -#line 2561 "cmDependsJavaParser.y" +#line 2560 "cmDependsJavaParser.y" { jpElementStart(2); jpCheckEmpty(2); @@ -5537,11 +5536,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5541 "cmDependsJavaParser.cxx" +#line 5540 "cmDependsJavaParser.cxx" break; case 283: /* PostDecrementExpression: PostfixExpression jp_MINUSMINUS */ -#line 2571 "cmDependsJavaParser.y" +#line 2570 "cmDependsJavaParser.y" { jpElementStart(2); jpCheckEmpty(2); @@ -5549,11 +5548,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5553 "cmDependsJavaParser.cxx" +#line 5552 "cmDependsJavaParser.cxx" break; case 284: /* UnaryExpression: PreIncrementExpression */ -#line 2581 "cmDependsJavaParser.y" +#line 2580 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -5561,11 +5560,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5565 "cmDependsJavaParser.cxx" +#line 5564 "cmDependsJavaParser.cxx" break; case 285: /* UnaryExpression: PreDecrementExpression */ -#line 2590 "cmDependsJavaParser.y" +#line 2589 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -5573,11 +5572,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5577 "cmDependsJavaParser.cxx" +#line 5576 "cmDependsJavaParser.cxx" break; case 286: /* UnaryExpression: jp_PLUS UnaryExpression */ -#line 2599 "cmDependsJavaParser.y" +#line 2598 "cmDependsJavaParser.y" { jpElementStart(2); jpCheckEmpty(2); @@ -5585,11 +5584,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5589 "cmDependsJavaParser.cxx" +#line 5588 "cmDependsJavaParser.cxx" break; case 287: /* UnaryExpression: jp_MINUS UnaryExpression */ -#line 2608 "cmDependsJavaParser.y" +#line 2607 "cmDependsJavaParser.y" { jpElementStart(2); jpCheckEmpty(2); @@ -5597,11 +5596,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5601 "cmDependsJavaParser.cxx" +#line 5600 "cmDependsJavaParser.cxx" break; case 288: /* UnaryExpression: UnaryExpressionNotPlusMinus */ -#line 2617 "cmDependsJavaParser.y" +#line 2616 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -5609,11 +5608,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5613 "cmDependsJavaParser.cxx" +#line 5612 "cmDependsJavaParser.cxx" break; case 289: /* PreIncrementExpression: jp_PLUSPLUS UnaryExpression */ -#line 2627 "cmDependsJavaParser.y" +#line 2626 "cmDependsJavaParser.y" { jpElementStart(2); jpCheckEmpty(2); @@ -5621,11 +5620,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5625 "cmDependsJavaParser.cxx" +#line 5624 "cmDependsJavaParser.cxx" break; case 290: /* PreDecrementExpression: jp_MINUSMINUS UnaryExpression */ -#line 2637 "cmDependsJavaParser.y" +#line 2636 "cmDependsJavaParser.y" { jpElementStart(2); jpCheckEmpty(2); @@ -5633,11 +5632,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5637 "cmDependsJavaParser.cxx" +#line 5636 "cmDependsJavaParser.cxx" break; case 291: /* UnaryExpressionNotPlusMinus: PostfixExpression */ -#line 2647 "cmDependsJavaParser.y" +#line 2646 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -5645,11 +5644,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5649 "cmDependsJavaParser.cxx" +#line 5648 "cmDependsJavaParser.cxx" break; case 292: /* UnaryExpressionNotPlusMinus: jp_TILDE UnaryExpression */ -#line 2656 "cmDependsJavaParser.y" +#line 2655 "cmDependsJavaParser.y" { jpElementStart(2); jpCheckEmpty(2); @@ -5657,11 +5656,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5661 "cmDependsJavaParser.cxx" +#line 5660 "cmDependsJavaParser.cxx" break; case 293: /* UnaryExpressionNotPlusMinus: jp_EXCLAMATION UnaryExpression */ -#line 2665 "cmDependsJavaParser.y" +#line 2664 "cmDependsJavaParser.y" { jpElementStart(2); jpCheckEmpty(2); @@ -5669,11 +5668,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5673 "cmDependsJavaParser.cxx" +#line 5672 "cmDependsJavaParser.cxx" break; case 294: /* UnaryExpressionNotPlusMinus: CastExpression */ -#line 2674 "cmDependsJavaParser.y" +#line 2673 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -5681,11 +5680,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5685 "cmDependsJavaParser.cxx" +#line 5684 "cmDependsJavaParser.cxx" break; case 295: /* CastExpression: jp_PARESTART PrimitiveType Dimsopt jp_PAREEND UnaryExpression */ -#line 2684 "cmDependsJavaParser.y" +#line 2683 "cmDependsJavaParser.y" { jpElementStart(5); jpCheckEmpty(5); @@ -5693,11 +5692,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5697 "cmDependsJavaParser.cxx" +#line 5696 "cmDependsJavaParser.cxx" break; case 296: /* CastExpression: jp_PARESTART Expression jp_PAREEND UnaryExpressionNotPlusMinus */ -#line 2693 "cmDependsJavaParser.y" +#line 2692 "cmDependsJavaParser.y" { jpElementStart(4); jpCheckEmpty(4); @@ -5705,20 +5704,20 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5709 "cmDependsJavaParser.cxx" +#line 5708 "cmDependsJavaParser.cxx" break; case 297: /* CastExpression: jp_PARESTART Name Dims jp_PAREEND UnaryExpressionNotPlusMinus */ -#line 2702 "cmDependsJavaParser.y" +#line 2701 "cmDependsJavaParser.y" { jpElementStart(5); } -#line 5718 "cmDependsJavaParser.cxx" +#line 5717 "cmDependsJavaParser.cxx" break; case 298: /* MultiplicativeExpression: UnaryExpression */ -#line 2709 "cmDependsJavaParser.y" +#line 2708 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -5726,11 +5725,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5730 "cmDependsJavaParser.cxx" +#line 5729 "cmDependsJavaParser.cxx" break; case 299: /* MultiplicativeExpression: MultiplicativeExpression jp_TIMES UnaryExpression */ -#line 2718 "cmDependsJavaParser.y" +#line 2717 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); @@ -5738,11 +5737,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5742 "cmDependsJavaParser.cxx" +#line 5741 "cmDependsJavaParser.cxx" break; case 300: /* MultiplicativeExpression: MultiplicativeExpression jp_DIVIDE UnaryExpression */ -#line 2727 "cmDependsJavaParser.y" +#line 2726 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); @@ -5750,11 +5749,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5754 "cmDependsJavaParser.cxx" +#line 5753 "cmDependsJavaParser.cxx" break; case 301: /* MultiplicativeExpression: MultiplicativeExpression jp_PERCENT UnaryExpression */ -#line 2736 "cmDependsJavaParser.y" +#line 2735 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); @@ -5762,11 +5761,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5766 "cmDependsJavaParser.cxx" +#line 5765 "cmDependsJavaParser.cxx" break; case 302: /* AdditiveExpression: MultiplicativeExpression */ -#line 2746 "cmDependsJavaParser.y" +#line 2745 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -5774,11 +5773,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5778 "cmDependsJavaParser.cxx" +#line 5777 "cmDependsJavaParser.cxx" break; case 303: /* AdditiveExpression: AdditiveExpression jp_PLUS MultiplicativeExpression */ -#line 2755 "cmDependsJavaParser.y" +#line 2754 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); @@ -5786,11 +5785,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5790 "cmDependsJavaParser.cxx" +#line 5789 "cmDependsJavaParser.cxx" break; case 304: /* AdditiveExpression: AdditiveExpression jp_MINUS MultiplicativeExpression */ -#line 2764 "cmDependsJavaParser.y" +#line 2763 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); @@ -5798,11 +5797,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5802 "cmDependsJavaParser.cxx" +#line 5801 "cmDependsJavaParser.cxx" break; case 305: /* ShiftExpression: AdditiveExpression */ -#line 2774 "cmDependsJavaParser.y" +#line 2773 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -5810,11 +5809,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5814 "cmDependsJavaParser.cxx" +#line 5813 "cmDependsJavaParser.cxx" break; case 306: /* ShiftExpression: ShiftExpression jp_LTLT AdditiveExpression */ -#line 2783 "cmDependsJavaParser.y" +#line 2782 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); @@ -5822,11 +5821,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5826 "cmDependsJavaParser.cxx" +#line 5825 "cmDependsJavaParser.cxx" break; case 307: /* ShiftExpression: ShiftExpression jp_GTGT AdditiveExpression */ -#line 2792 "cmDependsJavaParser.y" +#line 2791 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); @@ -5834,11 +5833,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5838 "cmDependsJavaParser.cxx" +#line 5837 "cmDependsJavaParser.cxx" break; case 308: /* ShiftExpression: ShiftExpression jp_GTGTGT AdditiveExpression */ -#line 2801 "cmDependsJavaParser.y" +#line 2800 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); @@ -5846,11 +5845,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5850 "cmDependsJavaParser.cxx" +#line 5849 "cmDependsJavaParser.cxx" break; case 309: /* RelationalExpression: ShiftExpression */ -#line 2811 "cmDependsJavaParser.y" +#line 2810 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -5858,11 +5857,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5862 "cmDependsJavaParser.cxx" +#line 5861 "cmDependsJavaParser.cxx" break; case 310: /* RelationalExpression: RelationalExpression jp_LESSTHAN ShiftExpression */ -#line 2820 "cmDependsJavaParser.y" +#line 2819 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); @@ -5870,11 +5869,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5874 "cmDependsJavaParser.cxx" +#line 5873 "cmDependsJavaParser.cxx" break; case 311: /* RelationalExpression: RelationalExpression jp_GREATER ShiftExpression */ -#line 2829 "cmDependsJavaParser.y" +#line 2828 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); @@ -5882,11 +5881,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5886 "cmDependsJavaParser.cxx" +#line 5885 "cmDependsJavaParser.cxx" break; case 312: /* RelationalExpression: RelationalExpression jp_LTEQUALS ShiftExpression */ -#line 2838 "cmDependsJavaParser.y" +#line 2837 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); @@ -5894,11 +5893,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5898 "cmDependsJavaParser.cxx" +#line 5897 "cmDependsJavaParser.cxx" break; case 313: /* RelationalExpression: RelationalExpression jp_GTEQUALS ShiftExpression */ -#line 2847 "cmDependsJavaParser.y" +#line 2846 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); @@ -5906,11 +5905,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5910 "cmDependsJavaParser.cxx" +#line 5909 "cmDependsJavaParser.cxx" break; case 314: /* RelationalExpression: RelationalExpression jp_INSTANCEOF ReferenceType */ -#line 2856 "cmDependsJavaParser.y" +#line 2855 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); @@ -5918,11 +5917,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5922 "cmDependsJavaParser.cxx" +#line 5921 "cmDependsJavaParser.cxx" break; case 315: /* EqualityExpression: RelationalExpression */ -#line 2866 "cmDependsJavaParser.y" +#line 2865 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -5930,11 +5929,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5934 "cmDependsJavaParser.cxx" +#line 5933 "cmDependsJavaParser.cxx" break; case 316: /* EqualityExpression: EqualityExpression jp_EQUALSEQUALS RelationalExpression */ -#line 2875 "cmDependsJavaParser.y" +#line 2874 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); @@ -5942,11 +5941,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5946 "cmDependsJavaParser.cxx" +#line 5945 "cmDependsJavaParser.cxx" break; case 317: /* EqualityExpression: EqualityExpression jp_EXCLAMATIONEQUALS RelationalExpression */ -#line 2884 "cmDependsJavaParser.y" +#line 2883 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); @@ -5954,11 +5953,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5958 "cmDependsJavaParser.cxx" +#line 5957 "cmDependsJavaParser.cxx" break; case 318: /* AndExpression: EqualityExpression */ -#line 2894 "cmDependsJavaParser.y" +#line 2893 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -5966,11 +5965,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5970 "cmDependsJavaParser.cxx" +#line 5969 "cmDependsJavaParser.cxx" break; case 319: /* AndExpression: AndExpression jp_AND EqualityExpression */ -#line 2903 "cmDependsJavaParser.y" +#line 2902 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); @@ -5978,11 +5977,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5982 "cmDependsJavaParser.cxx" +#line 5981 "cmDependsJavaParser.cxx" break; case 320: /* ExclusiveOrExpression: AndExpression */ -#line 2913 "cmDependsJavaParser.y" +#line 2912 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -5990,11 +5989,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5994 "cmDependsJavaParser.cxx" +#line 5993 "cmDependsJavaParser.cxx" break; case 321: /* ExclusiveOrExpression: ExclusiveOrExpression jp_CARROT AndExpression */ -#line 2922 "cmDependsJavaParser.y" +#line 2921 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); @@ -6002,11 +6001,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 6006 "cmDependsJavaParser.cxx" +#line 6005 "cmDependsJavaParser.cxx" break; case 322: /* InclusiveOrExpression: ExclusiveOrExpression */ -#line 2932 "cmDependsJavaParser.y" +#line 2931 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -6014,11 +6013,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 6018 "cmDependsJavaParser.cxx" +#line 6017 "cmDependsJavaParser.cxx" break; case 323: /* InclusiveOrExpression: InclusiveOrExpression jp_PIPE ExclusiveOrExpression */ -#line 2941 "cmDependsJavaParser.y" +#line 2940 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); @@ -6026,11 +6025,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 6030 "cmDependsJavaParser.cxx" +#line 6029 "cmDependsJavaParser.cxx" break; case 324: /* ConditionalAndExpression: InclusiveOrExpression */ -#line 2951 "cmDependsJavaParser.y" +#line 2950 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -6038,11 +6037,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 6042 "cmDependsJavaParser.cxx" +#line 6041 "cmDependsJavaParser.cxx" break; case 325: /* ConditionalAndExpression: ConditionalAndExpression jp_ANDAND InclusiveOrExpression */ -#line 2960 "cmDependsJavaParser.y" +#line 2959 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); @@ -6050,11 +6049,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 6054 "cmDependsJavaParser.cxx" +#line 6053 "cmDependsJavaParser.cxx" break; case 326: /* ConditionalOrExpression: ConditionalAndExpression */ -#line 2970 "cmDependsJavaParser.y" +#line 2969 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -6062,11 +6061,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 6066 "cmDependsJavaParser.cxx" +#line 6065 "cmDependsJavaParser.cxx" break; case 327: /* ConditionalOrExpression: ConditionalOrExpression jp_PIPEPIPE ConditionalAndExpression */ -#line 2979 "cmDependsJavaParser.y" +#line 2978 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); @@ -6074,11 +6073,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 6078 "cmDependsJavaParser.cxx" +#line 6077 "cmDependsJavaParser.cxx" break; case 328: /* ConditionalExpression: ConditionalOrExpression */ -#line 2989 "cmDependsJavaParser.y" +#line 2988 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -6086,11 +6085,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 6090 "cmDependsJavaParser.cxx" +#line 6089 "cmDependsJavaParser.cxx" break; case 329: /* ConditionalExpression: ConditionalOrExpression jp_QUESTION Expression jp_COLON ConditionalExpression */ -#line 2998 "cmDependsJavaParser.y" +#line 2997 "cmDependsJavaParser.y" { jpElementStart(5); jpCheckEmpty(5); @@ -6098,11 +6097,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 6102 "cmDependsJavaParser.cxx" +#line 6101 "cmDependsJavaParser.cxx" break; case 330: /* AssignmentExpression: ConditionalExpression */ -#line 3008 "cmDependsJavaParser.y" +#line 3007 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -6110,11 +6109,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 6114 "cmDependsJavaParser.cxx" +#line 6113 "cmDependsJavaParser.cxx" break; case 331: /* AssignmentExpression: Assignment */ -#line 3017 "cmDependsJavaParser.y" +#line 3016 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -6122,11 +6121,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 6126 "cmDependsJavaParser.cxx" +#line 6125 "cmDependsJavaParser.cxx" break; case 332: /* Assignment: LeftHandSide AssignmentOperator AssignmentExpression */ -#line 3027 "cmDependsJavaParser.y" +#line 3026 "cmDependsJavaParser.y" { jpElementStart(3); jpCheckEmpty(3); @@ -6134,11 +6133,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 6138 "cmDependsJavaParser.cxx" +#line 6137 "cmDependsJavaParser.cxx" break; case 333: /* LeftHandSide: Name */ -#line 3037 "cmDependsJavaParser.y" +#line 3036 "cmDependsJavaParser.y" { jpElementStart(1); yyGetParser->DeallocateParserType(&((yyvsp[0].str))); @@ -6147,11 +6146,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 6151 "cmDependsJavaParser.cxx" +#line 6150 "cmDependsJavaParser.cxx" break; case 334: /* LeftHandSide: FieldAccess */ -#line 3047 "cmDependsJavaParser.y" +#line 3046 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -6159,11 +6158,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 6163 "cmDependsJavaParser.cxx" +#line 6162 "cmDependsJavaParser.cxx" break; case 335: /* LeftHandSide: ArrayAccess */ -#line 3056 "cmDependsJavaParser.y" +#line 3055 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -6171,11 +6170,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 6175 "cmDependsJavaParser.cxx" +#line 6174 "cmDependsJavaParser.cxx" break; case 336: /* AssignmentOperator: jp_EQUALS */ -#line 3066 "cmDependsJavaParser.y" +#line 3065 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -6183,11 +6182,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 6187 "cmDependsJavaParser.cxx" +#line 6186 "cmDependsJavaParser.cxx" break; case 337: /* AssignmentOperator: jp_TIMESEQUALS */ -#line 3075 "cmDependsJavaParser.y" +#line 3074 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -6195,11 +6194,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 6199 "cmDependsJavaParser.cxx" +#line 6198 "cmDependsJavaParser.cxx" break; case 338: /* AssignmentOperator: jp_DIVIDEEQUALS */ -#line 3084 "cmDependsJavaParser.y" +#line 3083 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -6207,11 +6206,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 6211 "cmDependsJavaParser.cxx" +#line 6210 "cmDependsJavaParser.cxx" break; case 339: /* AssignmentOperator: jp_PERCENTEQUALS */ -#line 3093 "cmDependsJavaParser.y" +#line 3092 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -6219,11 +6218,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 6223 "cmDependsJavaParser.cxx" +#line 6222 "cmDependsJavaParser.cxx" break; case 340: /* AssignmentOperator: jp_PLUSEQUALS */ -#line 3102 "cmDependsJavaParser.y" +#line 3101 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -6231,11 +6230,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 6235 "cmDependsJavaParser.cxx" +#line 6234 "cmDependsJavaParser.cxx" break; case 341: /* AssignmentOperator: jp_MINUSEQUALS */ -#line 3111 "cmDependsJavaParser.y" +#line 3110 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -6243,11 +6242,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 6247 "cmDependsJavaParser.cxx" +#line 6246 "cmDependsJavaParser.cxx" break; case 342: /* AssignmentOperator: jp_LESLESEQUALS */ -#line 3120 "cmDependsJavaParser.y" +#line 3119 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -6255,11 +6254,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 6259 "cmDependsJavaParser.cxx" +#line 6258 "cmDependsJavaParser.cxx" break; case 343: /* AssignmentOperator: jp_GTGTEQUALS */ -#line 3129 "cmDependsJavaParser.y" +#line 3128 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -6267,11 +6266,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 6271 "cmDependsJavaParser.cxx" +#line 6270 "cmDependsJavaParser.cxx" break; case 344: /* AssignmentOperator: jp_GTGTGTEQUALS */ -#line 3138 "cmDependsJavaParser.y" +#line 3137 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -6279,11 +6278,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 6283 "cmDependsJavaParser.cxx" +#line 6282 "cmDependsJavaParser.cxx" break; case 345: /* AssignmentOperator: jp_ANDEQUALS */ -#line 3147 "cmDependsJavaParser.y" +#line 3146 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -6291,11 +6290,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 6295 "cmDependsJavaParser.cxx" +#line 6294 "cmDependsJavaParser.cxx" break; case 346: /* AssignmentOperator: jp_CARROTEQUALS */ -#line 3156 "cmDependsJavaParser.y" +#line 3155 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -6303,11 +6302,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 6307 "cmDependsJavaParser.cxx" +#line 6306 "cmDependsJavaParser.cxx" break; case 347: /* AssignmentOperator: jp_PIPEEQUALS */ -#line 3165 "cmDependsJavaParser.y" +#line 3164 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -6315,11 +6314,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 6319 "cmDependsJavaParser.cxx" +#line 6318 "cmDependsJavaParser.cxx" break; case 348: /* Expression: AssignmentExpression */ -#line 3175 "cmDependsJavaParser.y" +#line 3174 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -6327,11 +6326,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 6331 "cmDependsJavaParser.cxx" +#line 6330 "cmDependsJavaParser.cxx" break; case 349: /* ConstantExpression: Expression */ -#line 3185 "cmDependsJavaParser.y" +#line 3184 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -6339,11 +6338,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 6343 "cmDependsJavaParser.cxx" +#line 6342 "cmDependsJavaParser.cxx" break; case 350: /* New: jp_NEW */ -#line 3195 "cmDependsJavaParser.y" +#line 3194 "cmDependsJavaParser.y" { jpElementStart(1); jpCheckEmpty(1); @@ -6351,11 +6350,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 6355 "cmDependsJavaParser.cxx" +#line 6354 "cmDependsJavaParser.cxx" break; case 351: /* New: Name jp_DOT jp_NEW */ -#line 3204 "cmDependsJavaParser.y" +#line 3203 "cmDependsJavaParser.y" { jpElementStart(3); jpStoreClass((yyvsp[-2].str)); @@ -6364,11 +6363,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 6368 "cmDependsJavaParser.cxx" +#line 6367 "cmDependsJavaParser.cxx" break; -#line 6372 "cmDependsJavaParser.cxx" +#line 6371 "cmDependsJavaParser.cxx" default: break; } @@ -6592,7 +6591,7 @@ yyreturnlab: return yyresult; } -#line 3213 "cmDependsJavaParser.y" +#line 3212 "cmDependsJavaParser.y" /* End of grammar */ diff --git a/Source/LexerParser/cmDependsJavaParser.y b/Source/LexerParser/cmDependsJavaParser.y index ff37af2..d64043a 100644 --- a/Source/LexerParser/cmDependsJavaParser.y +++ b/Source/LexerParser/cmDependsJavaParser.y @@ -13,7 +13,6 @@ Run bison like this: #include "cmConfigure.h" // IWYU pragma: keep -#include <stdint.h> #include <stdlib.h> #include <string.h> #include <string> diff --git a/Source/LexerParser/cmExprParser.cxx b/Source/LexerParser/cmExprParser.cxx index cb5e498..80c0abd 100644 --- a/Source/LexerParser/cmExprParser.cxx +++ b/Source/LexerParser/cmExprParser.cxx @@ -88,7 +88,6 @@ Run bison like this: #include "cmConfigure.h" // IWYU pragma: keep -#include <stdint.h> #include <stdlib.h> #include <string.h> #include <stdexcept> @@ -127,7 +126,7 @@ static void cmExpr_yyerror(yyscan_t yyscanner, const char* message); # pragma diag_suppress 550 /* variable set but never used */ #endif -#line 131 "cmExprParser.cxx" +#line 130 "cmExprParser.cxx" # ifndef YY_CAST # ifdef __cplusplus @@ -569,9 +568,9 @@ static const yytype_int8 yytranslate[] = /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint8 yyrline[] = { - 0, 88, 88, 93, 96, 101, 104, 109, 112, 117, - 120, 123, 128, 131, 134, 139, 142, 145, 151, 156, - 159, 162, 165, 170, 173 + 0, 87, 87, 92, 95, 100, 103, 108, 111, 116, + 119, 122, 127, 130, 133, 138, 141, 144, 150, 155, + 158, 161, 164, 169, 172 }; #endif @@ -1432,194 +1431,194 @@ yyreduce: switch (yyn) { case 2: /* start: exp */ -#line 88 "cmExprParser.y" +#line 87 "cmExprParser.y" { cmExpr_yyget_extra(yyscanner)->SetResult((yyvsp[0].Number)); } -#line 1440 "cmExprParser.cxx" +#line 1439 "cmExprParser.cxx" break; case 3: /* exp: bitwiseor */ -#line 93 "cmExprParser.y" +#line 92 "cmExprParser.y" { (yyval.Number) = (yyvsp[0].Number); } -#line 1448 "cmExprParser.cxx" +#line 1447 "cmExprParser.cxx" break; case 4: /* exp: exp exp_OR bitwiseor */ -#line 96 "cmExprParser.y" +#line 95 "cmExprParser.y" { (yyval.Number) = (yyvsp[-2].Number) | (yyvsp[0].Number); } -#line 1456 "cmExprParser.cxx" +#line 1455 "cmExprParser.cxx" break; case 5: /* bitwiseor: bitwisexor */ -#line 101 "cmExprParser.y" +#line 100 "cmExprParser.y" { (yyval.Number) = (yyvsp[0].Number); } -#line 1464 "cmExprParser.cxx" +#line 1463 "cmExprParser.cxx" break; case 6: /* bitwiseor: bitwiseor exp_XOR bitwisexor */ -#line 104 "cmExprParser.y" +#line 103 "cmExprParser.y" { (yyval.Number) = (yyvsp[-2].Number) ^ (yyvsp[0].Number); } -#line 1472 "cmExprParser.cxx" +#line 1471 "cmExprParser.cxx" break; case 7: /* bitwisexor: bitwiseand */ -#line 109 "cmExprParser.y" +#line 108 "cmExprParser.y" { (yyval.Number) = (yyvsp[0].Number); } -#line 1480 "cmExprParser.cxx" +#line 1479 "cmExprParser.cxx" break; case 8: /* bitwisexor: bitwisexor exp_AND bitwiseand */ -#line 112 "cmExprParser.y" +#line 111 "cmExprParser.y" { (yyval.Number) = (yyvsp[-2].Number) & (yyvsp[0].Number); } -#line 1488 "cmExprParser.cxx" +#line 1487 "cmExprParser.cxx" break; case 9: /* bitwiseand: shift */ -#line 117 "cmExprParser.y" +#line 116 "cmExprParser.y" { (yyval.Number) = (yyvsp[0].Number); } -#line 1496 "cmExprParser.cxx" +#line 1495 "cmExprParser.cxx" break; case 10: /* bitwiseand: bitwiseand exp_SHIFTLEFT shift */ -#line 120 "cmExprParser.y" +#line 119 "cmExprParser.y" { (yyval.Number) = (yyvsp[-2].Number) << (yyvsp[0].Number); } -#line 1504 "cmExprParser.cxx" +#line 1503 "cmExprParser.cxx" break; case 11: /* bitwiseand: bitwiseand exp_SHIFTRIGHT shift */ -#line 123 "cmExprParser.y" +#line 122 "cmExprParser.y" { (yyval.Number) = (yyvsp[-2].Number) >> (yyvsp[0].Number); } -#line 1512 "cmExprParser.cxx" +#line 1511 "cmExprParser.cxx" break; case 12: /* shift: term */ -#line 128 "cmExprParser.y" +#line 127 "cmExprParser.y" { (yyval.Number) = (yyvsp[0].Number); } -#line 1520 "cmExprParser.cxx" +#line 1519 "cmExprParser.cxx" break; case 13: /* shift: shift exp_PLUS term */ -#line 131 "cmExprParser.y" +#line 130 "cmExprParser.y" { (yyval.Number) = (yyvsp[-2].Number) + (yyvsp[0].Number); } -#line 1528 "cmExprParser.cxx" +#line 1527 "cmExprParser.cxx" break; case 14: /* shift: shift exp_MINUS term */ -#line 134 "cmExprParser.y" +#line 133 "cmExprParser.y" { (yyval.Number) = (yyvsp[-2].Number) - (yyvsp[0].Number); } -#line 1536 "cmExprParser.cxx" +#line 1535 "cmExprParser.cxx" break; case 15: /* term: unary */ -#line 139 "cmExprParser.y" +#line 138 "cmExprParser.y" { (yyval.Number) = (yyvsp[0].Number); } -#line 1544 "cmExprParser.cxx" +#line 1543 "cmExprParser.cxx" break; case 16: /* term: term exp_TIMES unary */ -#line 142 "cmExprParser.y" +#line 141 "cmExprParser.y" { (yyval.Number) = (yyvsp[-2].Number) * (yyvsp[0].Number); } -#line 1552 "cmExprParser.cxx" +#line 1551 "cmExprParser.cxx" break; case 17: /* term: term exp_DIVIDE unary */ -#line 145 "cmExprParser.y" +#line 144 "cmExprParser.y" { if (yyvsp[0].Number == 0) { throw std::overflow_error("divide by zero"); } (yyval.Number) = (yyvsp[-2].Number) / (yyvsp[0].Number); } -#line 1563 "cmExprParser.cxx" +#line 1562 "cmExprParser.cxx" break; case 18: /* term: term exp_MOD unary */ -#line 151 "cmExprParser.y" +#line 150 "cmExprParser.y" { (yyval.Number) = (yyvsp[-2].Number) % (yyvsp[0].Number); } -#line 1571 "cmExprParser.cxx" +#line 1570 "cmExprParser.cxx" break; case 19: /* unary: factor */ -#line 156 "cmExprParser.y" +#line 155 "cmExprParser.y" { (yyval.Number) = (yyvsp[0].Number); } -#line 1579 "cmExprParser.cxx" +#line 1578 "cmExprParser.cxx" break; case 20: /* unary: exp_PLUS unary */ -#line 159 "cmExprParser.y" +#line 158 "cmExprParser.y" { (yyval.Number) = + (yyvsp[0].Number); } -#line 1587 "cmExprParser.cxx" +#line 1586 "cmExprParser.cxx" break; case 21: /* unary: exp_MINUS unary */ -#line 162 "cmExprParser.y" +#line 161 "cmExprParser.y" { (yyval.Number) = - (yyvsp[0].Number); } -#line 1595 "cmExprParser.cxx" +#line 1594 "cmExprParser.cxx" break; case 22: /* unary: exp_NOT unary */ -#line 165 "cmExprParser.y" +#line 164 "cmExprParser.y" { (yyval.Number) = ~ (yyvsp[0].Number); } -#line 1603 "cmExprParser.cxx" +#line 1602 "cmExprParser.cxx" break; case 23: /* factor: exp_NUMBER */ -#line 170 "cmExprParser.y" +#line 169 "cmExprParser.y" { (yyval.Number) = (yyvsp[0].Number); } -#line 1611 "cmExprParser.cxx" +#line 1610 "cmExprParser.cxx" break; case 24: /* factor: exp_OPENPARENT exp exp_CLOSEPARENT */ -#line 173 "cmExprParser.y" +#line 172 "cmExprParser.y" { (yyval.Number) = (yyvsp[-1].Number); } -#line 1619 "cmExprParser.cxx" +#line 1618 "cmExprParser.cxx" break; -#line 1623 "cmExprParser.cxx" +#line 1622 "cmExprParser.cxx" default: break; } @@ -1843,7 +1842,7 @@ yyreturnlab: return yyresult; } -#line 178 "cmExprParser.y" +#line 177 "cmExprParser.y" /* End of grammar */ diff --git a/Source/LexerParser/cmExprParser.y b/Source/LexerParser/cmExprParser.y index 1c959f6..51df56e 100644 --- a/Source/LexerParser/cmExprParser.y +++ b/Source/LexerParser/cmExprParser.y @@ -13,7 +13,6 @@ Run bison like this: #include "cmConfigure.h" // IWYU pragma: keep -#include <stdint.h> #include <stdlib.h> #include <string.h> #include <stdexcept> diff --git a/Source/LexerParser/cmGccDepfileLexer.cxx b/Source/LexerParser/cmGccDepfileLexer.cxx index e588853..ca5577e 100644 --- a/Source/LexerParser/cmGccDepfileLexer.cxx +++ b/Source/LexerParser/cmGccDepfileLexer.cxx @@ -256,7 +256,6 @@ typedef int16_t flex_int16_t; typedef uint16_t flex_uint16_t; typedef int32_t flex_int32_t; typedef uint32_t flex_uint32_t; -typedef uint64_t flex_uint64_t; #else typedef signed char flex_int8_t; typedef short int flex_int16_t; @@ -421,7 +420,7 @@ struct yy_buffer_state /* Number of characters read into yy_ch_buf, not including EOB * characters. */ - yy_size_t yy_n_chars; + int yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to @@ -498,7 +497,7 @@ static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file , yyscan_t yyscanner YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner ); YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner ); -YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, yy_size_t len , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner ); void *yyalloc ( yy_size_t , yyscan_t yyscanner ); void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner ); @@ -545,7 +544,7 @@ static void yynoreturn yy_fatal_error ( const char* msg , yyscan_t yyscanner ); */ #define YY_DO_BEFORE_ACTION \ yyg->yytext_ptr = yy_bp; \ - yyleng = (yy_size_t) (yy_cp - yy_bp); \ + yyleng = (int) (yy_cp - yy_bp); \ yyg->yy_hold_char = *yy_cp; \ *yy_cp = '\0'; \ yyg->yy_c_buf_p = yy_cp; @@ -674,8 +673,8 @@ struct yyguts_t size_t yy_buffer_stack_max; /**< capacity of stack. */ YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */ char yy_hold_char; - yy_size_t yy_n_chars; - yy_size_t yyleng_r; + int yy_n_chars; + int yyleng_r; char *yy_c_buf_p; int yy_init; int yy_start; @@ -722,7 +721,7 @@ FILE *yyget_out ( yyscan_t yyscanner ); void yyset_out ( FILE * _out_str , yyscan_t yyscanner ); - yy_size_t yyget_leng ( yyscan_t yyscanner ); + int yyget_leng ( yyscan_t yyscanner ); char *yyget_text ( yyscan_t yyscanner ); @@ -795,7 +794,7 @@ static int input ( yyscan_t yyscanner ); if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ - yy_size_t n; \ + int n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ @@ -1241,7 +1240,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) else { - yy_size_t num_to_read = + int num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) @@ -1255,7 +1254,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) if ( b->yy_is_our_buffer ) { - yy_size_t new_size = b->yy_buf_size * 2; + int new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; @@ -1313,7 +1312,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) if ((yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { /* Extend the array by 50%, plus the number we really need. */ - yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1); + int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1); YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc( (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size , yyscanner ); if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) @@ -1406,7 +1405,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ - yy_size_t number_to_move = yyg->yy_n_chars + 2; + int number_to_move = yyg->yy_n_chars + 2; char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; char *source = @@ -1458,7 +1457,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) else { /* need more input */ - yy_size_t offset = yyg->yy_c_buf_p - yyg->yytext_ptr; + int offset = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr); ++yyg->yy_c_buf_p; switch ( yy_get_next_buffer( yyscanner ) ) @@ -1836,12 +1835,12 @@ YY_BUFFER_STATE yy_scan_string (const char * yystr , yyscan_t yyscanner) * @param yyscanner The scanner object. * @return the newly allocated buffer state object. */ -YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, yy_size_t _yybytes_len , yyscan_t yyscanner) +YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len , yyscan_t yyscanner) { YY_BUFFER_STATE b; char *buf; yy_size_t n; - yy_size_t i; + int i; /* Get memory for full buffer, including space for trailing EOB's. */ n = (yy_size_t) (_yybytes_len + 2); @@ -1885,7 +1884,7 @@ static void yynoreturn yy_fatal_error (const char* msg , yyscan_t yyscanner) do \ { \ /* Undo effects of setting up yytext. */ \ - yy_size_t yyless_macro_arg = (n); \ + int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ yytext[yyleng] = yyg->yy_hold_char; \ yyg->yy_c_buf_p = yytext + yyless_macro_arg; \ @@ -1953,7 +1952,7 @@ FILE *yyget_out (yyscan_t yyscanner) /** Get the length of the current token. * @param yyscanner The scanner object. */ -yy_size_t yyget_leng (yyscan_t yyscanner) +int yyget_leng (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yyleng; diff --git a/Source/LexerParser/cmGccDepfileLexer.h b/Source/LexerParser/cmGccDepfileLexer.h index ab73ebc..7d34060 100644 --- a/Source/LexerParser/cmGccDepfileLexer.h +++ b/Source/LexerParser/cmGccDepfileLexer.h @@ -258,7 +258,6 @@ typedef int16_t flex_int16_t; typedef uint16_t flex_uint16_t; typedef int32_t flex_int32_t; typedef uint32_t flex_uint32_t; -typedef uint64_t flex_uint64_t; #else typedef signed char flex_int8_t; typedef short int flex_int16_t; @@ -372,7 +371,7 @@ struct yy_buffer_state /* Number of characters read into yy_ch_buf, not including EOB * characters. */ - yy_size_t yy_n_chars; + int yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to @@ -416,7 +415,7 @@ void yypop_buffer_state ( yyscan_t yyscanner ); YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner ); YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner ); -YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, yy_size_t len , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner ); void *yyalloc ( yy_size_t , yyscan_t yyscanner ); void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner ); @@ -463,7 +462,7 @@ FILE *yyget_out ( yyscan_t yyscanner ); void yyset_out ( FILE * _out_str , yyscan_t yyscanner ); - yy_size_t yyget_leng ( yyscan_t yyscanner ); + int yyget_leng ( yyscan_t yyscanner ); char *yyget_text ( yyscan_t yyscanner ); diff --git a/Source/cmAddCustomCommandCommand.cxx b/Source/cmAddCustomCommandCommand.cxx index b1398db..b1589ff 100644 --- a/Source/cmAddCustomCommandCommand.cxx +++ b/Source/cmAddCustomCommandCommand.cxx @@ -19,6 +19,7 @@ #include "cmPolicies.h" #include "cmStringAlgorithms.h" #include "cmSystemTools.h" +#include "cmValue.h" bool cmAddCustomCommandCommand(std::vector<std::string> const& args, cmExecutionStatus& status) @@ -39,6 +40,7 @@ bool cmAddCustomCommandCommand(std::vector<std::string> const& args, std::string working; std::string depfile; std::string job_pool; + std::string job_server_aware; std::string comment_buffer; const char* comment = nullptr; std::vector<std::string> depends; @@ -78,6 +80,7 @@ bool cmAddCustomCommandCommand(std::vector<std::string> const& args, doing_working_directory, doing_depfile, doing_job_pool, + doing_job_server_aware, doing_nothing }; @@ -95,6 +98,7 @@ bool cmAddCustomCommandCommand(std::vector<std::string> const& args, MAKE_STATIC_KEYWORD(DEPFILE); MAKE_STATIC_KEYWORD(IMPLICIT_DEPENDS); MAKE_STATIC_KEYWORD(JOB_POOL); + MAKE_STATIC_KEYWORD(JOB_SERVER_AWARE); MAKE_STATIC_KEYWORD(MAIN_DEPENDENCY); MAKE_STATIC_KEYWORD(OUTPUT); MAKE_STATIC_KEYWORD(OUTPUTS); @@ -126,6 +130,7 @@ bool cmAddCustomCommandCommand(std::vector<std::string> const& args, keyPRE_BUILD, keyPRE_LINK, keySOURCE, + keyJOB_SERVER_AWARE, keyTARGET, keyUSES_TERMINAL, keyVERBATIM, @@ -190,6 +195,8 @@ bool cmAddCustomCommandCommand(std::vector<std::string> const& args, } } else if (copy == keyJOB_POOL) { doing = doing_job_pool; + } else if (copy == keyJOB_SERVER_AWARE) { + doing = doing_job_server_aware; } } else { std::string filename; @@ -226,6 +233,9 @@ bool cmAddCustomCommandCommand(std::vector<std::string> const& args, case doing_job_pool: job_pool = copy; break; + case doing_job_server_aware: + job_server_aware = copy; + break; case doing_working_directory: working = copy; break; @@ -334,6 +344,7 @@ bool cmAddCustomCommandCommand(std::vector<std::string> const& args, cc->SetUsesTerminal(uses_terminal); cc->SetDepfile(depfile); cc->SetJobPool(job_pool); + cc->SetJobserverAware(cmIsOn(job_server_aware)); cc->SetCommandExpandLists(command_expand_lists); cc->SetDependsExplicitOnly(depends_explicit_only); if (source.empty() && output.empty()) { diff --git a/Source/cmAddCustomTargetCommand.cxx b/Source/cmAddCustomTargetCommand.cxx index a246d06..711eaa5 100644 --- a/Source/cmAddCustomTargetCommand.cxx +++ b/Source/cmAddCustomTargetCommand.cxx @@ -17,6 +17,7 @@ #include "cmStringAlgorithms.h" #include "cmSystemTools.h" #include "cmTarget.h" +#include "cmValue.h" bool cmAddCustomTargetCommand(std::vector<std::string> const& args, cmExecutionStatus& status) @@ -54,6 +55,7 @@ bool cmAddCustomTargetCommand(std::vector<std::string> const& args, const char* comment = nullptr; std::vector<std::string> sources; std::string job_pool; + std::string job_server_aware; // Keep track of parser state. enum tdoing @@ -65,6 +67,7 @@ bool cmAddCustomTargetCommand(std::vector<std::string> const& args, doing_comment, doing_source, doing_job_pool, + doing_job_server_aware, doing_nothing }; tdoing doing = doing_command; @@ -102,6 +105,8 @@ bool cmAddCustomTargetCommand(std::vector<std::string> const& args, doing = doing_comment; } else if (copy == "JOB_POOL") { doing = doing_job_pool; + } else if (copy == "JOB_SERVER_AWARE") { + doing = doing_job_server_aware; } else if (copy == "COMMAND") { doing = doing_command; @@ -148,6 +153,9 @@ bool cmAddCustomTargetCommand(std::vector<std::string> const& args, case doing_job_pool: job_pool = copy; break; + case doing_job_server_aware: + job_server_aware = copy; + break; default: status.SetError("Wrong syntax. Unknown type of argument."); return false; @@ -223,6 +231,7 @@ bool cmAddCustomTargetCommand(std::vector<std::string> const& args, cc->SetUsesTerminal(uses_terminal); cc->SetCommandExpandLists(command_expand_lists); cc->SetJobPool(job_pool); + cc->SetJobserverAware(cmIsOn(job_server_aware)); cmTarget* target = mf.AddUtilityCommand(targetName, excludeFromAll, std::move(cc)); diff --git a/Source/cmAuxSourceDirectoryCommand.cxx b/Source/cmAuxSourceDirectoryCommand.cxx index 35f4c88..b2e3cad 100644 --- a/Source/cmAuxSourceDirectoryCommand.cxx +++ b/Source/cmAuxSourceDirectoryCommand.cxx @@ -11,6 +11,7 @@ #include "cmsys/Directory.hxx" #include "cmExecutionStatus.h" +#include "cmList.h" #include "cmMakefile.h" #include "cmSourceFile.h" #include "cmStringAlgorithms.h" @@ -67,7 +68,7 @@ bool cmAuxSourceDirectoryCommand(std::vector<std::string> const& args, if (!sourceListValue.empty()) { sourceListValue += ";"; } - sourceListValue += cmJoin(files, ";"); + sourceListValue += cmList::to_string(files); mf.AddDefinition(args[1], sourceListValue); return true; } diff --git a/Source/cmBinUtilsLinuxELFObjdumpGetRuntimeDependenciesTool.cxx b/Source/cmBinUtilsLinuxELFObjdumpGetRuntimeDependenciesTool.cxx index 566e4a4..8043f82 100644 --- a/Source/cmBinUtilsLinuxELFObjdumpGetRuntimeDependenciesTool.cxx +++ b/Source/cmBinUtilsLinuxELFObjdumpGetRuntimeDependenciesTool.cxx @@ -10,6 +10,7 @@ #include "cmRuntimeDependencyArchive.h" #include "cmSystemTools.h" #include "cmUVProcessChain.h" +#include "cmUVStream.h" cmBinUtilsLinuxELFObjdumpGetRuntimeDependenciesTool:: cmBinUtilsLinuxELFObjdumpGetRuntimeDependenciesTool( @@ -35,7 +36,7 @@ bool cmBinUtilsLinuxELFObjdumpGetRuntimeDependenciesTool::GetFileInfo( builder.AddCommand(command); auto process = builder.Start(); - if (!process.Valid()) { + if (!process.Valid() || process.GetStatus(0).SpawnResult != 0) { std::ostringstream e; e << "Failed to start objdump process for:\n " << file; this->SetError(e.str()); @@ -46,7 +47,8 @@ bool cmBinUtilsLinuxELFObjdumpGetRuntimeDependenciesTool::GetFileInfo( static const cmsys::RegularExpression neededRegex("^ *NEEDED *([^\n]*)$"); static const cmsys::RegularExpression rpathRegex("^ *RPATH *([^\n]*)$"); static const cmsys::RegularExpression runpathRegex("^ *RUNPATH *([^\n]*)$"); - while (std::getline(*process.OutputStream(), line)) { + cmUVPipeIStream output(process.GetLoop(), process.OutputStream()); + while (std::getline(output, line)) { cmsys::RegularExpressionMatch match; if (neededRegex.find(line.c_str(), match)) { needed.push_back(match.match(1)); @@ -73,8 +75,7 @@ bool cmBinUtilsLinuxELFObjdumpGetRuntimeDependenciesTool::GetFileInfo( this->SetError(e.str()); return false; } - auto status = process.GetStatus(); - if (!status[0] || status[0]->ExitStatus != 0) { + if (process.GetStatus(0).ExitStatus != 0) { std::ostringstream e; e << "Failed to run objdump on:\n " << file; this->SetError(e.str()); diff --git a/Source/cmBinUtilsMacOSMachOLinker.cxx b/Source/cmBinUtilsMacOSMachOLinker.cxx index c064377..90e0891 100644 --- a/Source/cmBinUtilsMacOSMachOLinker.cxx +++ b/Source/cmBinUtilsMacOSMachOLinker.cxx @@ -5,7 +5,6 @@ #include <sstream> #include <string> -#include <type_traits> #include <utility> #include <vector> diff --git a/Source/cmBinUtilsMacOSMachOOToolGetRuntimeDependenciesTool.cxx b/Source/cmBinUtilsMacOSMachOOToolGetRuntimeDependenciesTool.cxx index 6d97720..4c35841 100644 --- a/Source/cmBinUtilsMacOSMachOOToolGetRuntimeDependenciesTool.cxx +++ b/Source/cmBinUtilsMacOSMachOOToolGetRuntimeDependenciesTool.cxx @@ -9,6 +9,7 @@ #include "cmRuntimeDependencyArchive.h" #include "cmUVProcessChain.h" +#include "cmUVStream.h" cmBinUtilsMacOSMachOOToolGetRuntimeDependenciesTool:: cmBinUtilsMacOSMachOOToolGetRuntimeDependenciesTool( @@ -34,7 +35,7 @@ bool cmBinUtilsMacOSMachOOToolGetRuntimeDependenciesTool::GetFileInfo( .AddCommand(command); auto process = builder.Start(); - if (!process.Valid()) { + if (!process.Valid() || process.GetStatus(0).SpawnResult != 0) { std::ostringstream e; e << "Failed to start otool process for:\n " << file; this->SetError(e.str()); @@ -49,11 +50,12 @@ bool cmBinUtilsMacOSMachOOToolGetRuntimeDependenciesTool::GetFileInfo( "^ *path (.*) \\(offset [0-9]+\\)$"); static const cmsys::RegularExpression nameRegex( "^ *name (.*) \\(offset [0-9]+\\)$"); - while (std::getline(*process.OutputStream(), line)) { + cmUVPipeIStream output(process.GetLoop(), process.OutputStream()); + while (std::getline(output, line)) { cmsys::RegularExpressionMatch cmdMatch; if (rpathRegex.find(line.c_str(), cmdMatch)) { - if (!std::getline(*process.OutputStream(), line) || - !std::getline(*process.OutputStream(), line)) { + // NOLINTNEXTLINE(misc-redundant-expression) + if (!std::getline(output, line) || !std::getline(output, line)) { this->SetError("Invalid output from otool"); return false; } @@ -66,8 +68,8 @@ bool cmBinUtilsMacOSMachOOToolGetRuntimeDependenciesTool::GetFileInfo( return false; } } else if (loadDylibRegex.find(line.c_str(), cmdMatch)) { - if (!std::getline(*process.OutputStream(), line) || - !std::getline(*process.OutputStream(), line)) { + // NOLINTNEXTLINE(misc-redundant-expression) + if (!std::getline(output, line) || !std::getline(output, line)) { this->SetError("Invalid output from otool"); return false; } @@ -88,8 +90,7 @@ bool cmBinUtilsMacOSMachOOToolGetRuntimeDependenciesTool::GetFileInfo( this->SetError(e.str()); return false; } - auto status = process.GetStatus(); - if (!status[0] || status[0]->ExitStatus != 0) { + if (process.GetStatus(0).ExitStatus != 0) { std::ostringstream e; e << "Failed to run otool on:\n " << file; this->SetError(e.str()); diff --git a/Source/cmBinUtilsWindowsPEDumpbinGetRuntimeDependenciesTool.cxx b/Source/cmBinUtilsWindowsPEDumpbinGetRuntimeDependenciesTool.cxx index f342884..cd21140 100644 --- a/Source/cmBinUtilsWindowsPEDumpbinGetRuntimeDependenciesTool.cxx +++ b/Source/cmBinUtilsWindowsPEDumpbinGetRuntimeDependenciesTool.cxx @@ -9,6 +9,7 @@ #include "cmRuntimeDependencyArchive.h" #include "cmUVProcessChain.h" +#include "cmUVStream.h" cmBinUtilsWindowsPEDumpbinGetRuntimeDependenciesTool:: cmBinUtilsWindowsPEDumpbinGetRuntimeDependenciesTool( @@ -33,7 +34,7 @@ bool cmBinUtilsWindowsPEDumpbinGetRuntimeDependenciesTool::GetFileInfo( builder.AddCommand(command); auto process = builder.Start(); - if (!process.Valid()) { + if (!process.Valid() || process.GetStatus(0).SpawnResult != 0) { std::ostringstream e; e << "Failed to start dumpbin process for:\n " << file; this->SetError(e.str()); @@ -43,7 +44,8 @@ bool cmBinUtilsWindowsPEDumpbinGetRuntimeDependenciesTool::GetFileInfo( std::string line; static const cmsys::RegularExpression regex( "^ ([^\n]*\\.[Dd][Ll][Ll])\r$"); - while (std::getline(*process.OutputStream(), line)) { + cmUVPipeIStream output(process.GetLoop(), process.OutputStream()); + while (std::getline(output, line)) { cmsys::RegularExpressionMatch match; if (regex.find(line.c_str(), match)) { needed.push_back(match.match(1)); @@ -56,8 +58,7 @@ bool cmBinUtilsWindowsPEDumpbinGetRuntimeDependenciesTool::GetFileInfo( this->SetError(e.str()); return false; } - auto status = process.GetStatus(); - if (!status[0] || status[0]->ExitStatus != 0) { + if (process.GetStatus(0).ExitStatus != 0) { std::ostringstream e; e << "Failed to run dumpbin on:\n " << file; this->SetError(e.str()); diff --git a/Source/cmBinUtilsWindowsPEObjdumpGetRuntimeDependenciesTool.cxx b/Source/cmBinUtilsWindowsPEObjdumpGetRuntimeDependenciesTool.cxx index f14de55..d95da95 100644 --- a/Source/cmBinUtilsWindowsPEObjdumpGetRuntimeDependenciesTool.cxx +++ b/Source/cmBinUtilsWindowsPEObjdumpGetRuntimeDependenciesTool.cxx @@ -10,6 +10,7 @@ #include "cmRuntimeDependencyArchive.h" #include "cmSystemTools.h" #include "cmUVProcessChain.h" +#include "cmUVStream.h" cmBinUtilsWindowsPEObjdumpGetRuntimeDependenciesTool:: cmBinUtilsWindowsPEObjdumpGetRuntimeDependenciesTool( @@ -34,7 +35,7 @@ bool cmBinUtilsWindowsPEObjdumpGetRuntimeDependenciesTool::GetFileInfo( builder.AddCommand(command); auto process = builder.Start(); - if (!process.Valid()) { + if (!process.Valid() || process.GetStatus(0).SpawnResult != 0) { std::ostringstream e; e << "Failed to start objdump process for:\n " << file; this->SetError(e.str()); @@ -44,7 +45,8 @@ bool cmBinUtilsWindowsPEObjdumpGetRuntimeDependenciesTool::GetFileInfo( std::string line; static const cmsys::RegularExpression regex( "^\t*DLL Name: ([^\n]*\\.[Dd][Ll][Ll])$"); - while (cmSystemTools::GetLineFromStream(*process.OutputStream(), line)) { + cmUVPipeIStream output(process.GetLoop(), process.OutputStream()); + while (cmSystemTools::GetLineFromStream(output, line)) { cmsys::RegularExpressionMatch match; if (regex.find(line.c_str(), match)) { needed.push_back(match.match(1)); @@ -57,8 +59,7 @@ bool cmBinUtilsWindowsPEObjdumpGetRuntimeDependenciesTool::GetFileInfo( this->SetError(e.str()); return false; } - auto status = process.GetStatus(); - if (!status[0] || status[0]->ExitStatus != 0) { + if (process.GetStatus(0).ExitStatus != 0) { std::ostringstream e; e << "Failed to run objdump on:\n " << file; this->SetError(e.str()); diff --git a/Source/cmBlockCommand.cxx b/Source/cmBlockCommand.cxx index ec79149..42f1ad3 100644 --- a/Source/cmBlockCommand.cxx +++ b/Source/cmBlockCommand.cxx @@ -3,7 +3,8 @@ #include "cmBlockCommand.h" -#include <cstdint> // IWYU pragma: keep +#include <cstdint> +#include <initializer_list> #include <utility> #include <cm/memory> diff --git a/Source/cmCMakeHostSystemInformationCommand.cxx b/Source/cmCMakeHostSystemInformationCommand.cxx index 1c00f15..da680ca 100644 --- a/Source/cmCMakeHostSystemInformationCommand.cxx +++ b/Source/cmCMakeHostSystemInformationCommand.cxx @@ -5,6 +5,7 @@ #include <algorithm> #include <cassert> #include <cctype> +#include <cstddef> #include <initializer_list> #include <map> #include <string> @@ -529,12 +530,12 @@ bool QueryWindowsRegistry(Range args, cmExecutionStatus& status, if (arguments.ValueNames) { auto result = registry.GetValueNames(key, view); if (result) { - makefile.AddDefinition(variable, cmJoin(*result, ";"_s)); + makefile.AddDefinition(variable, cmList::to_string(*result)); } } else if (arguments.SubKeys) { auto result = registry.GetSubKeys(key, view); if (result) { - makefile.AddDefinition(variable, cmJoin(*result, ";"_s)); + makefile.AddDefinition(variable, cmList::to_string(*result)); } } else { auto result = diff --git a/Source/cmCMakeLanguageCommand.cxx b/Source/cmCMakeLanguageCommand.cxx index c7e9209..329427c 100644 --- a/Source/cmCMakeLanguageCommand.cxx +++ b/Source/cmCMakeLanguageCommand.cxx @@ -5,7 +5,6 @@ #include <algorithm> #include <array> #include <cstddef> -#include <memory> #include <string> #include <utility> @@ -17,10 +16,11 @@ #include "cmArgumentParserTypes.h" #include "cmDependencyProvider.h" #include "cmExecutionStatus.h" +#include "cmExperimental.h" #include "cmGlobalGenerator.h" #include "cmListFileCache.h" #include "cmMakefile.h" -#include "cmMessageType.h" +#include "cmMessageType.h" // IWYU pragma: keep #include "cmRange.h" #include "cmState.h" #include "cmStringAlgorithms.h" @@ -328,6 +328,46 @@ bool cmCMakeLanguageCommandGET_MESSAGE_LOG_LEVEL( makefile.AddDefinition(outputVariable, outputValue); return true; } + +bool cmCMakeLanguageCommandGET_EXPERIMENTAL_FEATURE_ENABLED( + std::vector<cmListFileArgument> const& args, cmExecutionStatus& status) +{ + cmMakefile& makefile = status.GetMakefile(); + std::vector<std::string> expandedArgs; + makefile.ExpandArguments(args, expandedArgs); + + if (expandedArgs.size() != 3) { + return FatalError(status, + "sub-command GET_EXPERIMENTAL_FEATURE_ENABLED expects " + "exactly two arguments"); + } + + auto const& featureName = expandedArgs[1]; + auto const& variableName = expandedArgs[2]; + + auto feature = cmExperimental::Feature::Sentinel; + for (std::size_t i = 0; + i < static_cast<std::size_t>(cmExperimental::Feature::Sentinel); i++) { + if (cmExperimental::DataForFeature(static_cast<cmExperimental::Feature>(i)) + .Name == featureName) { + feature = static_cast<cmExperimental::Feature>(i); + break; + } + } + if (feature == cmExperimental::Feature::Sentinel) { + return FatalError(status, + cmStrCat("Experimental feature name \"", featureName, + "\" does not exist.")); + } + + if (cmExperimental::HasSupportEnabled(makefile, feature)) { + makefile.AddDefinition(variableName, "TRUE"); + } else { + makefile.AddDefinition(variableName, "FALSE"); + } + + return true; +} } bool cmCMakeLanguageCommand(std::vector<cmListFileArgument> const& args, @@ -480,5 +520,10 @@ bool cmCMakeLanguageCommand(std::vector<cmListFileArgument> const& args, return cmCMakeLanguageCommandGET_MESSAGE_LOG_LEVEL(args, status); } + if (expArgs[expArg] == "GET_EXPERIMENTAL_FEATURE_ENABLED") { + return cmCMakeLanguageCommandGET_EXPERIMENTAL_FEATURE_ENABLED(args, + status); + } + return FatalError(status, "called with unknown meta-operation"); } diff --git a/Source/cmCMakePath.cxx b/Source/cmCMakePath.cxx index 73321c6..5080f58 100644 --- a/Source/cmCMakePath.cxx +++ b/Source/cmCMakePath.cxx @@ -15,6 +15,8 @@ #include <cm/string_view> #if defined(_WIN32) +# include <cmext/string_view> + # include "cmStringAlgorithms.h" #endif diff --git a/Source/cmCMakePath.h b/Source/cmCMakePath.h index 15aa30c..a42ac98 100644 --- a/Source/cmCMakePath.h +++ b/Source/cmCMakePath.h @@ -12,7 +12,10 @@ #include <cm/filesystem> #include <cm/string_view> #include <cm/type_traits> -#include <cmext/string_view> + +namespace cm { +class static_string_view; +} namespace detail { #if defined(__SUNPRO_CC) && defined(__sparc) @@ -123,11 +126,29 @@ public: : Path(FormatPath(source, fmt)) { } + cmCMakePath(const char* source, format fmt = generic_format) noexcept + : Path(FormatPath(cm::string_view{ source }, fmt)) + { + } +#if defined(__SUNPRO_CC) && defined(__sparc) + // Oracle DeveloperStudio C++ compiler on Solaris/Sparc is confused when + // standard methods and templates use the same name. The template is selected + // rather than the standard one regardless the arguments of the method. + cmCMakePath(const std::string& source, format fmt = generic_format) + : Path(FormatPath(source, fmt)) + { + } + cmCMakePath(std::string&& source, format fmt = generic_format) + : Path(FormatPath(std::move(source), fmt)) + { + } +#else template <typename Source, typename = enable_if_move_pathable<Source>> cmCMakePath(Source source, format fmt = generic_format) : Path(FormatPath(std::move(source), fmt)) { } +#endif template <typename Source, typename = enable_if_move_pathable<Source>> cmCMakePath& Assign(Source&& source) @@ -156,6 +177,41 @@ public: } return *this; } +#if defined(__SUNPRO_CC) && defined(__sparc) + // Oracle DeveloperStudio C++ compiler on Solaris/Sparc is confused when + // standard methods and templates use the same name. The template is selected + // rather than the standard one regardless the arguments of the method. + cmCMakePath& operator=(cm::filesystem::path&& source) + { + this->Assign(std::forward<cm::filesystem::path>(source)); + return *this; + } + cmCMakePath& operator=(std::string&& source) + { + this->Assign(std::forward<std::string>(source)); + return *this; + } + cmCMakePath& operator=(const cm::filesystem::path& source) + { + this->Assign(source); + return *this; + } + cmCMakePath& operator=(const std::string& source) + { + this->Assign(source); + return *this; + } + cmCMakePath& operator=(const cm::string_view source) + { + this->Assign(source); + return *this; + } + cmCMakePath& operator=(const char* source) + { + this->Assign(cm::string_view{ source }); + return *this; + } +#else template <typename Source, typename = enable_if_move_pathable<Source>> cmCMakePath& operator=(Source&& source) { @@ -168,6 +224,7 @@ public: this->Assign(source); return *this; } +#endif // Concatenation cmCMakePath& Append(const cmCMakePath& path) @@ -182,12 +239,29 @@ public: this->Path = this->Path.generic_string(); return *this; } - +#if defined(__SUNPRO_CC) && defined(__sparc) + // Oracle DeveloperStudio C++ compiler on Solaris/Sparc is confused when + // standard methods and templates use the same name. The template is selected + // rather than the standard one regardless the arguments of the method. + cmCMakePath& Append(const std::string& source) + { + return this->Append(cm::filesystem::path(source)); + } + cmCMakePath& Append(cm::string_view source) + { + return this->Append(cm::filesystem::path(source)); + } + cmCMakePath& Append(const char* source) + { + return this->Append(cm::filesystem::path(cm::string_view{ source })); + } +#else template <typename Source, typename = enable_if_pathable<Source>> cmCMakePath& Append(const Source& source) { return this->Append(cm::filesystem::path(source)); } +#endif cmCMakePath& operator/=(const cmCMakePath& path) { @@ -204,17 +278,38 @@ public: this->Path += path.Path; return *this; } - cmCMakePath& Concat(cm::static_string_view source) + cmCMakePath& Concat(cm::string_view source) { - this->Path.concat(std::string(source)); + this->Path.operator+=(std::string(source)); return *this; } +#if defined(__SUNPRO_CC) && defined(__sparc) + // Oracle DeveloperStudio C++ compiler on Solaris/Sparc is confused when + // standard methods and templates use the same name. The template is selected + // rather than the standard one regardless the arguments of the method. + cmCMakePath& Concat(const cm::filesystem::path& source) + { + this->Path.operator+=(source); + return *this; + } + cmCMakePath& Concat(const std::string& source) + { + this->Path.operator+=(source); + return *this; + } + cmCMakePath& Concat(const char* source) + { + this->Path.operator+=(source); + return *this; + } +#else template <typename Source, typename = enable_if_pathable<Source>> cmCMakePath& Concat(const Source& source) { - this->Path.concat(source); + this->Path.operator+=(source); return *this; } +#endif cmCMakePath& operator+=(const cmCMakePath& path) { @@ -242,6 +337,32 @@ public: } return *this; } +#if defined(__SUNPRO_CC) && defined(__sparc) + // Oracle DeveloperStudio C++ compiler on Solaris/Sparc is confused when + // standard methods and templates use the same name. The template is selected + // rather than the standard one regardless the arguments of the method. + cmCMakePath& ReplaceFileName(const cm::filesystem::path& filename) + { + if (this->Path.has_filename()) { + this->Path.replace_filename(filename); + } + return *this; + } + cmCMakePath& ReplaceFileName(const std::string& filename) + { + if (this->Path.has_filename()) { + this->Path.replace_filename(filename); + } + return *this; + } + cmCMakePath& ReplaceFileName(cm::string_view filename) + { + if (this->Path.has_filename()) { + this->Path.replace_filename(filename); + } + return *this; + } +#else template <typename Source, typename = enable_if_pathable<Source>> cmCMakePath& ReplaceFileName(const Source& filename) { @@ -250,18 +371,40 @@ public: } return *this; } +#endif cmCMakePath& ReplaceExtension(const cmCMakePath& extension = cmCMakePath()) { this->Path.replace_extension(extension.Path); return *this; } +#if defined(__SUNPRO_CC) && defined(__sparc) + // Oracle DeveloperStudio C++ compiler on Solaris/Sparc is confused when + // standard methods and templates use the same name. The template is selected + // rather than the standard one regardless the arguments of the method. + cmCMakePath& ReplaceExtension(const cm::filesystem::path& extension) + { + this->Path.replace_extension(extension); + return *this; + } + cmCMakePath& ReplaceExtension(const std::string& extension) + { + this->Path.replace_extension(extension); + return *this; + } + cmCMakePath& ReplaceExtension(const cm::string_view extension) + { + this->Path.replace_extension(extension); + return *this; + } +#else template <typename Source, typename = enable_if_pathable<Source>> cmCMakePath& ReplaceExtension(const Source& extension) { this->Path.replace_extension(extension); return *this; } +#endif cmCMakePath& ReplaceWideExtension( const cmCMakePath& extension = cmCMakePath()) @@ -269,11 +412,26 @@ public: return this->ReplaceWideExtension( static_cast<cm::string_view>(extension.Path.string())); } + cmCMakePath& ReplaceWideExtension(const cm::filesystem::path& extension) + { + return this->ReplaceWideExtension( + static_cast<cm::string_view>(extension.string())); + } +#if defined(__SUNPRO_CC) && defined(__sparc) + // Oracle DeveloperStudio C++ compiler on Solaris/Sparc is confused when + // standard methods and templates use the same name. The template is selected + // rather than the standard one regardless the arguments of the method. + cmCMakePath& ReplaceWideExtension(const std::string& extension) + { + return this->ReplaceWideExtension(cm::string_view{ extension }); + } +#else template <typename Source, typename = enable_if_pathable<Source>> cmCMakePath& ReplaceWideExtension(const Source& extension) { - return this->ReplaceWideExtension(cm::string_view(extension)); + return this->ReplaceWideExtension(extension); } +#endif cmCMakePath& ReplaceWideExtension(cm::string_view extension); cmCMakePath& RemoveExtension() @@ -355,12 +513,25 @@ public: // Windows) so convert back to '/' return path.generic_string(); } +#if defined(__SUNPRO_CC) && defined(__sparc) + // Oracle DeveloperStudio C++ compiler on Solaris/Sparc is confused when + // standard methods and templates use the same name. The template is selected + // rather than the standard one regardless the arguments of the method. + cmCMakePath Relative(const std::string& base) const + { + return this->Relative(cm::filesystem::path(base)); + } + cmCMakePath Relative(cm::string_view base) const + { + return this->Relative(cm::filesystem::path(base)); + } +#else template <typename Source, typename = enable_if_pathable<Source>> cmCMakePath Relative(const Source& base) const { return this->Relative(cm::filesystem::path(base)); } - +#endif cmCMakePath Proximate(const cmCMakePath& base) const { return this->Proximate(base.Path); @@ -372,21 +543,49 @@ public: // Windows) so convert back to '/' return path.generic_string(); } +#if defined(__SUNPRO_CC) && defined(__sparc) + // Oracle DeveloperStudio C++ compiler on Solaris/Sparc is confused when + // standard methods and templates use the same name. The template is selected + // rather than the standard one regardless the arguments of the method. + cmCMakePath Proximate(const std::string& base) const + { + return this->Proximate(cm::filesystem::path(base)); + } + cmCMakePath Proximate(cm::string_view base) const + { + return this->Proximate(cm::filesystem::path(base)); + } +#else template <typename Source, typename = enable_if_pathable<Source>> cmCMakePath Proximate(const Source& base) const { return this->Proximate(cm::filesystem::path(base)); } +#endif cmCMakePath Absolute(const cmCMakePath& base) const { return this->Absolute(base.Path); } +#if defined(__SUNPRO_CC) && defined(__sparc) + // Oracle DeveloperStudio C++ compiler on Solaris/Sparc is confused when + // standard methods and templates use the same name. The template is selected + // rather than the standard one regardless the arguments of the method. + cmCMakePath Absolute(const std::string& base) const + { + return this->Absolute(cm::filesystem::path(base)); + } + cmCMakePath Absolute(cm::string_view base) const + { + return this->Absolute(cm::filesystem::path(base)); + } +#else template <typename Source, typename = enable_if_pathable<Source>> cmCMakePath Absolute(const Source& base) const { return this->Absolute(cm::filesystem::path(base)); } +#endif cmCMakePath Absolute(const cm::filesystem::path& base) const; // Comparison diff --git a/Source/cmCMakePresetsGraph.cxx b/Source/cmCMakePresetsGraph.cxx index 13eddbe..2707000 100644 --- a/Source/cmCMakePresetsGraph.cxx +++ b/Source/cmCMakePresetsGraph.cxx @@ -4,6 +4,7 @@ #include <algorithm> #include <cassert> +#include <cstddef> #include <functional> #include <iostream> #include <iterator> diff --git a/Source/cmCMakePresetsGraph.h b/Source/cmCMakePresetsGraph.h index 7844624..a000e7d 100644 --- a/Source/cmCMakePresetsGraph.h +++ b/Source/cmCMakePresetsGraph.h @@ -15,9 +15,9 @@ #include <cm/optional> #include "cmJSONState.h" -#include "cmStateTypes.h" +#include "cmStateTypes.h" // IWYU pragma: keep -#include "CTest/cmCTestTypes.h" +#include "CTest/cmCTestTypes.h" // IWYU pragma: keep enum class PackageResolveMode; diff --git a/Source/cmCMakePresetsGraphReadJSONConfigurePresets.cxx b/Source/cmCMakePresetsGraphReadJSONConfigurePresets.cxx index 66ec6a4..3890cd0 100644 --- a/Source/cmCMakePresetsGraphReadJSONConfigurePresets.cxx +++ b/Source/cmCMakePresetsGraphReadJSONConfigurePresets.cxx @@ -16,9 +16,10 @@ #include "cmCMakePresetsGraph.h" #include "cmCMakePresetsGraphInternal.h" #include "cmJSONHelpers.h" -#include "cmJSONState.h" #include "cmStateTypes.h" +class cmJSONState; + namespace { using CacheVariable = cmCMakePresetsGraph::CacheVariable; using ConfigurePreset = cmCMakePresetsGraph::ConfigurePreset; diff --git a/Source/cmCMakePresetsGraphReadJSONPackagePresets.cxx b/Source/cmCMakePresetsGraphReadJSONPackagePresets.cxx index 7290d4d..bbd77ba 100644 --- a/Source/cmCMakePresetsGraphReadJSONPackagePresets.cxx +++ b/Source/cmCMakePresetsGraphReadJSONPackagePresets.cxx @@ -1,7 +1,6 @@ /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying file Copyright.txt or https://cmake.org/licensing for details. */ #include <cstddef> -#include <functional> #include <map> #include <memory> #include <string> diff --git a/Source/cmCMakePresetsGraphReadJSONTestPresets.cxx b/Source/cmCMakePresetsGraphReadJSONTestPresets.cxx index 791be04..a7c59fa 100644 --- a/Source/cmCMakePresetsGraphReadJSONTestPresets.cxx +++ b/Source/cmCMakePresetsGraphReadJSONTestPresets.cxx @@ -1,7 +1,6 @@ /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying file Copyright.txt or https://cmake.org/licensing for details. */ #include <cstddef> -#include <functional> #include <map> #include <memory> #include <string> diff --git a/Source/cmCMakePresetsGraphReadJSONWorkflowPresets.cxx b/Source/cmCMakePresetsGraphReadJSONWorkflowPresets.cxx index 7224e17..f596d6c 100644 --- a/Source/cmCMakePresetsGraphReadJSONWorkflowPresets.cxx +++ b/Source/cmCMakePresetsGraphReadJSONWorkflowPresets.cxx @@ -1,7 +1,6 @@ /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying file Copyright.txt or https://cmake.org/licensing for details. */ #include <cstddef> -#include <functional> #include <string> #include <vector> diff --git a/Source/cmCPackPropertiesGenerator.cxx b/Source/cmCPackPropertiesGenerator.cxx index cc9ad01..fbf7d73 100644 --- a/Source/cmCPackPropertiesGenerator.cxx +++ b/Source/cmCPackPropertiesGenerator.cxx @@ -1,6 +1,7 @@ #include "cmCPackPropertiesGenerator.h" #include <map> +#include <memory> #include <ostream> #include "cmGeneratorExpression.h" diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index a311041..6ff6437 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -11,6 +11,7 @@ #include <ctime> #include <iostream> #include <map> +#include <ratio> #include <sstream> #include <string> #include <utility> diff --git a/Source/cmCommands.cxx b/Source/cmCommands.cxx index ae83b2e..2ee4f47 100644 --- a/Source/cmCommands.cxx +++ b/Source/cmCommands.cxx @@ -135,7 +135,6 @@ void GetScriptingCommands(cmState* state) state->AddBuiltinCommand("cmake_path", cmCMakePathCommand); state->AddBuiltinCommand("cmake_policy", cmCMakePolicyCommand); state->AddBuiltinCommand("configure_file", cmConfigureFileCommand); - state->AddBuiltinCommand("exec_program", cmExecProgramCommand); state->AddBuiltinCommand("execute_process", cmExecuteProcessCommand); state->AddBuiltinCommand("file", cmFileCommand); state->AddBuiltinCommand("find_file", cmFindFile); @@ -220,6 +219,9 @@ void GetScriptingCommands(cmState* state) state->AddDisallowedCommand( "use_mangled_mesa", cmUseMangledMesaCommand, cmPolicies::CMP0030, "The use_mangled_mesa command should not be called; see CMP0030."); + state->AddDisallowedCommand( + "exec_program", cmExecProgramCommand, cmPolicies::CMP0153, + "The exec_program command should not be called; see CMP0153."); #endif } diff --git a/Source/cmCommonTargetGenerator.cxx b/Source/cmCommonTargetGenerator.cxx index 1924235..e583daa 100644 --- a/Source/cmCommonTargetGenerator.cxx +++ b/Source/cmCommonTargetGenerator.cxx @@ -4,6 +4,7 @@ #include <algorithm> #include <sstream> +#include <type_traits> #include <utility> #include <cm/string_view> diff --git a/Source/cmComputeLinkDepends.cxx b/Source/cmComputeLinkDepends.cxx index f51a1c8..7394d86 100644 --- a/Source/cmComputeLinkDepends.cxx +++ b/Source/cmComputeLinkDepends.cxx @@ -8,6 +8,7 @@ #include <cstdio> #include <iterator> #include <sstream> +#include <type_traits> #include <unordered_map> #include <utility> diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx index ebbb88f..be73fa3 100644 --- a/Source/cmComputeLinkInformation.cxx +++ b/Source/cmComputeLinkInformation.cxx @@ -29,6 +29,7 @@ #include "cmSystemTools.h" #include "cmTarget.h" #include "cmValue.h" +#include "cmXcFramework.h" #include "cmake.h" // #define CM_COMPUTE_LINK_INFO_DEBUG @@ -373,6 +374,10 @@ cmComputeLinkInformation::cmComputeLinkInformation( this->LibraryFeatureDescriptors.emplace( "__CMAKE_LINK_FRAMEWORK", LibraryFeatureDescriptor{ "__CMAKE_LINK_FRAMEWORK", "<LIBRARY>" }); + // To link xcframework using a full path + this->LibraryFeatureDescriptors.emplace( + "__CMAKE_LINK_XCFRAMEWORK", + LibraryFeatureDescriptor{ "__CMAKE_LINK_XCFRAMEWORK", "<LIBRARY>" }); // Check the platform policy for missing soname case. this->NoSONameUsesPath = @@ -519,6 +524,12 @@ cmComputeLinkInformation::GetFrameworkPathsEmitted() const return this->FrameworkPathsEmitted; } +std::vector<std::string> const& +cmComputeLinkInformation::GetXcFrameworkHeaderPaths() const +{ + return this->XcFrameworkHeaderPaths; +} + const std::set<const cmGeneratorTarget*>& cmComputeLinkInformation::GetSharedLibrariesLinked() const { @@ -1159,6 +1170,13 @@ void cmComputeLinkInformation::AddItem(LinkEntry const& entry) } else { this->ObjectLibrariesLinked.push_back(entry.Target); } + } else if (this->GlobalGenerator->IsXcode() && + !tgt->GetImportedXcFrameworkPath(config).empty()) { + this->Items.emplace_back( + tgt->GetImportedXcFrameworkPath(config), ItemIsPath::Yes, tgt, + this->FindLibraryFeature(entry.Feature == DEFAULT + ? "__CMAKE_LINK_XCFRAMEWORK" + : entry.Feature)); } else { // Decide whether to use an import library. cmStateEnums::ArtifactType artifact = tgt->HasImportLibrary(config) @@ -1198,6 +1216,25 @@ void cmComputeLinkInformation::AddItem(LinkEntry const& entry) this->AddRuntimeDLL(tgt); } } + + auto xcFrameworkPath = tgt->GetImportedXcFrameworkPath(config); + if (!xcFrameworkPath.empty()) { + auto plist = cmParseXcFrameworkPlist(xcFrameworkPath, *this->Makefile, + item.Backtrace); + if (!plist) { + return; + } + if (auto const* library = + plist->SelectSuitableLibrary(*this->Makefile, item.Backtrace)) { + if (!library->HeadersPath.empty()) { + this->AddXcFrameworkHeaderPath(cmStrCat(xcFrameworkPath, '/', + library->LibraryIdentifier, + '/', library->HeadersPath)); + } + } else { + return; + } + } } else { // This is not a CMake target. Use the name given. if (cmHasSuffix(entry.Feature, "FRAMEWORK"_s) || @@ -1206,6 +1243,12 @@ void cmComputeLinkInformation::AddItem(LinkEntry const& entry) this->Target->IsApple())) { // This is a framework. this->AddFrameworkItem(entry); + } else if (cmHasSuffix(entry.Feature, "XCFRAMEWORK"_s) || + (entry.Feature == DEFAULT && + cmSystemTools::IsPathToXcFramework(item.Value) && + this->Target->IsApple())) { + // This is a framework. + this->AddXcFrameworkItem(entry); } else if (cmSystemTools::FileIsFullPath(item.Value)) { if (cmSystemTools::FileIsDirectory(item.Value)) { // This is a directory. @@ -1589,7 +1632,9 @@ void cmComputeLinkInformation::AddTargetItem(LinkEntry const& entry) this->OldLinkDirItems.push_back(item.Value); } - if (target->IsFrameworkOnApple()) { + const bool isImportedFrameworkFolderOnApple = + target->IsImportedFrameworkFolderOnApple(this->Config); + if (target->IsFrameworkOnApple() || isImportedFrameworkFolderOnApple) { // Add the framework directory and the framework item itself auto fwDescriptor = this->GlobalGenerator->SplitFrameworkPath( item.Value, cmGlobalGenerator::FrameworkFormat::Extended); @@ -1607,16 +1652,33 @@ void cmComputeLinkInformation::AddTargetItem(LinkEntry const& entry) } if (this->GlobalGenerator->IsXcode()) { - this->Items.emplace_back( - item, ItemIsPath::Yes, target, - this->FindLibraryFeature(entry.Feature == DEFAULT - ? "__CMAKE_LINK_FRAMEWORK" - : entry.Feature)); + if (isImportedFrameworkFolderOnApple) { + if (entry.Feature == DEFAULT) { + this->AddLibraryFeature("FRAMEWORK"); + this->Items.emplace_back(item, ItemIsPath::Yes, target, + this->FindLibraryFeature("FRAMEWORK")); + } else { + this->Items.emplace_back(item, ItemIsPath::Yes, target, + this->FindLibraryFeature(entry.Feature)); + } + } else { + this->Items.emplace_back( + item, ItemIsPath::Yes, target, + this->FindLibraryFeature(entry.Feature == DEFAULT + ? "__CMAKE_LINK_FRAMEWORK" + : entry.Feature)); + } } else { if (cmHasSuffix(entry.Feature, "FRAMEWORK"_s)) { this->Items.emplace_back(fwDescriptor->GetLinkName(), ItemIsPath::Yes, target, this->FindLibraryFeature(entry.Feature)); + } else if (entry.Feature == DEFAULT && + isImportedFrameworkFolderOnApple) { + this->AddLibraryFeature("FRAMEWORK"); + this->Items.emplace_back(fwDescriptor->GetLinkName(), ItemIsPath::Yes, + target, + this->FindLibraryFeature("FRAMEWORK")); } else { this->Items.emplace_back( item, ItemIsPath::Yes, target, @@ -1926,6 +1988,46 @@ void cmComputeLinkInformation::AddFrameworkItem(LinkEntry const& entry) } } +void cmComputeLinkInformation::AddXcFrameworkItem(LinkEntry const& entry) +{ + auto plist = cmParseXcFrameworkPlist(entry.Item.Value, *this->Makefile, + entry.Item.Backtrace); + if (!plist) { + return; + } + + if (auto const* lib = + plist->SelectSuitableLibrary(*this->Makefile, entry.Item.Backtrace)) { + if (this->GlobalGenerator->IsXcode()) { + this->Items.emplace_back( + entry.Item.Value, ItemIsPath::Yes, nullptr, + this->FindLibraryFeature(entry.Feature == DEFAULT + ? "__CMAKE_LINK_XCFRAMEWORK" + : entry.Feature)); + } else { + auto libraryPath = cmStrCat( + entry.Item.Value, '/', lib->LibraryIdentifier, '/', lib->LibraryPath); + LinkEntry libraryEntry( + BT<std::string>(libraryPath, entry.Item.Backtrace), entry.Target); + + if (cmSystemTools::IsPathToFramework(libraryPath) && + this->Target->IsApple()) { + // This is a framework. + this->AddFrameworkItem(libraryEntry); + } else { + this->Depends.push_back(libraryPath); + this->AddFullItem(libraryEntry); + this->AddLibraryRuntimeInfo(libraryPath); + if (!lib->HeadersPath.empty()) { + this->AddXcFrameworkHeaderPath(cmStrCat(entry.Item.Value, '/', + lib->LibraryIdentifier, '/', + lib->HeadersPath)); + } + } + } + } +} + void cmComputeLinkInformation::DropDirectoryItem(BT<std::string> const& item) { // A full path to a directory was found as a link item. Warn the @@ -1963,6 +2065,11 @@ void cmComputeLinkInformation::AddFrameworkPath(std::string const& p) } } +void cmComputeLinkInformation::AddXcFrameworkHeaderPath(std::string const& p) +{ + this->XcFrameworkHeaderPaths.push_back(p); +} + bool cmComputeLinkInformation::CheckSharedLibNoSOName(LinkEntry const& entry) { // This platform will use the path to a library as its soname if the @@ -2232,16 +2339,20 @@ void cmComputeLinkInformation::AddLibraryRuntimeInfo( if (target->GetType() != cmStateEnums::SHARED_LIBRARY) { return; } + auto const* info = target->GetImportInfo(this->Config); // Try to get the soname of the library. Only files with this name // could possibly conflict. - std::string soName = target->GetSOName(this->Config); - const char* soname = soName.empty() ? nullptr : soName.c_str(); - - // Include this library in the runtime path ordering. - this->OrderRuntimeSearchPath->AddRuntimeLibrary(fullPath, soname); - if (this->LinkWithRuntimePath) { - this->OrderLinkerSearchPath->AddRuntimeLibrary(fullPath, soname); + const char* soname = + (!info || info->SOName.empty()) ? nullptr : info->SOName.c_str(); + + // If this shared library has a known runtime artifact (IMPORTED_LOCATION), + // include its location in the runtime path ordering. + if (!info || !info->Location.empty()) { + this->OrderRuntimeSearchPath->AddRuntimeLibrary(fullPath, soname); + if (this->LinkWithRuntimePath) { + this->OrderLinkerSearchPath->AddRuntimeLibrary(fullPath, soname); + } } } diff --git a/Source/cmComputeLinkInformation.h b/Source/cmComputeLinkInformation.h index 8393a29..e75423f 100644 --- a/Source/cmComputeLinkInformation.h +++ b/Source/cmComputeLinkInformation.h @@ -88,6 +88,7 @@ public: std::vector<std::string> const& GetDepends() const; std::vector<std::string> const& GetFrameworkPaths() const; std::set<std::string> const& GetFrameworkPathsEmitted() const; + std::vector<std::string> const& GetXcFrameworkHeaderPaths() const; std::string GetLinkLanguage() const { return this->LinkLanguage; } std::vector<std::string> const& GetRuntimeSearchPath() const; std::string const& GetRuntimeFlag() const { return this->RuntimeFlag; } @@ -132,6 +133,7 @@ private: std::vector<std::string> Directories; std::vector<std::string> Depends; std::vector<std::string> FrameworkPaths; + std::vector<std::string> XcFrameworkHeaderPaths; std::vector<std::string> RuntimeSearchPath; std::set<cmGeneratorTarget const*> SharedLibrariesLinked; std::vector<cmGeneratorTarget const*> ObjectLibrariesLinked; @@ -204,6 +206,7 @@ private: bool CheckImplicitDirItem(LinkEntry const& entry); void AddUserItem(LinkEntry const& entry, bool pathNotKnown); void AddFrameworkItem(LinkEntry const& entry); + void AddXcFrameworkItem(LinkEntry const& entry); void DropDirectoryItem(BT<std::string> const& item); bool CheckSharedLibNoSOName(LinkEntry const& entry); void AddSharedLibNoSOName(LinkEntry const& entry); @@ -214,6 +217,8 @@ private: void AddFrameworkPath(std::string const& p); std::set<std::string> FrameworkPathsEmitted; + void AddXcFrameworkHeaderPath(std::string const& p); + // Linker search path computation. std::unique_ptr<cmOrderDirectories> OrderLinkerSearchPath; bool FinishLinkerSearchDirectories(); diff --git a/Source/cmConditionEvaluator.h b/Source/cmConditionEvaluator.h index 9486b16..4f42206 100644 --- a/Source/cmConditionEvaluator.h +++ b/Source/cmConditionEvaluator.h @@ -10,7 +10,7 @@ #include <cmext/string_view> #include "cmListFileCache.h" -#include "cmMessageType.h" +#include "cmMessageType.h" // IWYU pragma: keep #include "cmPolicies.h" #include "cmValue.h" diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx index 7d4ab50..cddbb9b 100644 --- a/Source/cmCoreTryCompile.cxx +++ b/Source/cmCoreTryCompile.cxx @@ -7,7 +7,6 @@ #include <cstring> #include <set> #include <sstream> -#include <type_traits> #include <utility> #include <cm/string_view> @@ -18,6 +17,7 @@ #include "cmArgumentParser.h" #include "cmConfigureLog.h" +#include "cmExperimental.h" #include "cmExportTryCompileFileGenerator.h" #include "cmGlobalGenerator.h" #include "cmList.h" @@ -231,7 +231,7 @@ Arguments cmCoreTryCompile::ParseArgs( !unparsedArguments.empty()) { std::string m = "Unknown arguments:"; for (const auto& i : unparsedArguments) { - m = cmStrCat(m, "\n \"", i, "\""); + m = cmStrCat(m, "\n \"", i, '"'); } this->Makefile->IssueMessage(MessageType::AUTHOR_WARNING, m); } @@ -345,7 +345,7 @@ cm::optional<cmTryCompileResult> cmCoreTryCompile::TryCompileCode( this->Makefile->IssueMessage( MessageType::FATAL_ERROR, cmStrCat("<bindir> is not an absolute path:\n '", - *arguments.BinaryDirectory, "'")); + *arguments.BinaryDirectory, '\'')); return cm::nullopt; } this->BinaryDirectory = *arguments.BinaryDirectory; @@ -377,7 +377,7 @@ cm::optional<cmTryCompileResult> cmCoreTryCompile::TryCompileCode( cmStrCat("Only libraries may be used as try_compile or try_run " "IMPORTED LINK_LIBRARIES. Got ", tgt->GetName(), " of type ", - cmState::GetTargetTypeName(tgt->GetType()), ".")); + cmState::GetTargetTypeName(tgt->GetType()), '.')); return cm::nullopt; } if (tgt->IsImported()) { @@ -478,11 +478,11 @@ cm::optional<cmTryCompileResult> cmCoreTryCompile::TryCompileCode( std::map<std::string, std::string> cmakeVariables; - std::string outFileName = this->BinaryDirectory + "/CMakeLists.txt"; + std::string outFileName = cmStrCat(this->BinaryDirectory, "/CMakeLists.txt"); // which signature are we using? If we are using var srcfile bindir if (this->SrcFileSignature) { // remove any CMakeCache.txt files so we will have a clean test - std::string ccFile = this->BinaryDirectory + "/CMakeCache.txt"; + std::string ccFile = cmStrCat(this->BinaryDirectory, "/CMakeCache.txt"); cmSystemTools::RemoveFile(ccFile); // Choose sources. @@ -525,12 +525,12 @@ cm::optional<cmTryCompileResult> cmCoreTryCompile::TryCompileCode( if (!cmSystemTools::GetFilenamePath(dst).empty()) { const auto& msg = - cmStrCat("SOURCE_FROM_FILE given invalid filename \"", dst, "\""); + cmStrCat("SOURCE_FROM_FILE given invalid filename \"", dst, '"'); this->Makefile->IssueMessage(MessageType::FATAL_ERROR, msg); return cm::nullopt; } - auto dstPath = cmStrCat(this->BinaryDirectory, "/", dst); + auto dstPath = cmStrCat(this->BinaryDirectory, '/', dst); auto const result = cmSystemTools::CopyFileAlways(src, dstPath); if (!result.IsSuccess()) { const auto& msg = cmStrCat("SOURCE_FROM_FILE failed to copy \"", src, @@ -554,10 +554,13 @@ cm::optional<cmTryCompileResult> cmCoreTryCompile::TryCompileCode( testLangs.insert(lang); } else { std::ostringstream err; - err << "Unknown extension \"" << ext << "\" for file\n" - << " " << si << "\n" - << "try_compile() works only for enabled languages. " - << "Currently these are:\n "; + err << "Unknown extension \"" << ext + << "\" for file\n" + " " + << si + << "\n" + "try_compile() works only for enabled languages. " + "Currently these are:\n "; std::vector<std::string> langs; gg->GetEnabledLanguages(langs); err << cmJoin(langs, " "); @@ -586,7 +589,7 @@ cm::optional<cmTryCompileResult> cmCoreTryCompile::TryCompileCode( std::ostringstream e; /* clang-format off */ e << "Failed to open\n" - << " " << outFileName << "\n" + " " << outFileName << "\n" << cmSystemTools::GetLastSystemError(); /* clang-format on */ this->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str()); @@ -654,9 +657,9 @@ cm::optional<cmTryCompileResult> cmCoreTryCompile::TryCompileCode( std::string projectLangs; for (std::string const& li : testLangs) { - projectLangs += " " + li; + projectLangs += cmStrCat(' ', li); std::string rulesOverrideBase = "CMAKE_USER_MAKE_RULES_OVERRIDE"; - std::string rulesOverrideLang = cmStrCat(rulesOverrideBase, "_", li); + std::string rulesOverrideLang = cmStrCat(rulesOverrideBase, '_', li); if (cmValue rulesOverridePath = this->Makefile->GetDefinition(rulesOverrideLang)) { fprintf(fout, "set(%s \"%s\")\n", rulesOverrideLang.c_str(), @@ -689,7 +692,7 @@ cm::optional<cmTryCompileResult> cmCoreTryCompile::TryCompileCode( } fprintf(fout, "set(CMAKE_VERBOSE_MAKEFILE 1)\n"); for (std::string const& li : testLangs) { - std::string langFlags = "CMAKE_" + li + "_FLAGS"; + std::string langFlags = cmStrCat("CMAKE_", li, "_FLAGS"); cmValue flags = this->Makefile->GetDefinition(langFlags); fprintf(fout, "set(CMAKE_%s_FLAGS %s)\n", li.c_str(), cmOutputConverter::EscapeForCMake(*flags).c_str()); @@ -793,10 +796,10 @@ cm::optional<cmTryCompileResult> cmCoreTryCompile::TryCompileCode( } if (!targets.empty()) { - std::string fname = "/" + std::string(targetName) + "Targets.cmake"; + std::string fname = cmStrCat('/', targetName, "Targets.cmake"); cmExportTryCompileFileGenerator tcfg(gg, targets, this->Makefile, testLangs); - tcfg.SetExportFile((this->BinaryDirectory + fname).c_str()); + tcfg.SetExportFile(cmStrCat(this->BinaryDirectory, fname).c_str()); tcfg.SetConfig(tcConfig); if (!tcfg.GenerateImportFile()) { @@ -964,7 +967,7 @@ cm::optional<cmTryCompileResult> cmCoreTryCompile::TryCompileCode( if (arguments.LinkLibraries) { std::string libsToLink = " "; for (std::string const& i : *arguments.LinkLibraries) { - libsToLink += "\"" + cmTrimWhitespace(i) + "\" "; + libsToLink += cmStrCat('"', cmTrimWhitespace(i), "\" "); } fprintf(fout, "target_link_libraries(%s %s)\n", targetName.c_str(), libsToLink.c_str()); @@ -1063,14 +1066,25 @@ cm::optional<cmTryCompileResult> cmCoreTryCompile::TryCompileCode( if (cmValue tcArchs = this->Makefile->GetDefinition( kCMAKE_TRY_COMPILE_OSX_ARCHITECTURES)) { vars.erase(kCMAKE_OSX_ARCHITECTURES); - std::string flag = "-DCMAKE_OSX_ARCHITECTURES=" + *tcArchs; + std::string flag = cmStrCat("-DCMAKE_OSX_ARCHITECTURES=", *tcArchs); arguments.CMakeFlags.emplace_back(std::move(flag)); cmakeVariables.emplace("CMAKE_OSX_ARCHITECTURES", *tcArchs); } + // Pass down CMAKE_EXPERIMENTAL_* feature flags + for (std::size_t i = 0; + i < static_cast<std::size_t>(cmExperimental::Feature::Sentinel); + i++) { + auto const& data = cmExperimental::DataForFeature( + static_cast<cmExperimental::Feature>(i)); + if (data.ForwardThroughTryCompile) { + vars.insert(data.Variable); + } + } + for (std::string const& var : vars) { if (cmValue val = this->Makefile->GetDefinition(var)) { - std::string flag = "-D" + var + "=" + *val; + std::string flag = cmStrCat("-D", var, '=', *val); arguments.CMakeFlags.emplace_back(std::move(flag)); cmakeVariables.emplace(var, *val); } @@ -1081,7 +1095,7 @@ cm::optional<cmTryCompileResult> cmCoreTryCompile::TryCompileCode( // Forward the GHS variables to the inner project cache. for (std::string const& var : ghs_platform_vars) { if (cmValue val = this->Makefile->GetDefinition(var)) { - std::string flag = "-D" + var + "=" + "'" + *val + "'"; + std::string flag = cmStrCat("-D", var, "=\'", *val, '\''); arguments.CMakeFlags.emplace_back(std::move(flag)); cmakeVariables.emplace(var, *val); } @@ -1143,11 +1157,11 @@ cm::optional<cmTryCompileResult> cmCoreTryCompile::TryCompileCode( } /* clang-format off */ err = cmStrCat( - "Cannot copy output executable\n", - " '", this->OutputFile, "'\n", - "to destination specified by COPY_FILE:\n", - " '", copyFile, "'\n", - "because:\n", + "Cannot copy output executable\n" + " '", this->OutputFile, "'\n" + "to destination specified by COPY_FILE:\n" + " '", copyFile, "'\n" + "because:\n" " ", err, "\n", this->FindErrorMessage); /* clang-format on */ @@ -1192,10 +1206,10 @@ void cmCoreTryCompile::CleanupFiles(std::string const& binDir) } if (!IsTemporary(binDir)) { - cmSystemTools::Error( + cmSystemTools::Error(cmStrCat( "TRY_COMPILE attempt to remove -rf directory that does not contain " - "CMakeTmp or CMakeScratch: \"" + - binDir + "\""); + "CMakeTmp or CMakeScratch: \"", + binDir, '"')); return; } @@ -1208,8 +1222,7 @@ void cmCoreTryCompile::CleanupFiles(std::string const& binDir) // Do not delete NFS temporary files. !cmHasPrefix(fileName, ".nfs")) { if (deletedFiles.insert(fileName).second) { - std::string const fullPath = - std::string(binDir).append("/").append(fileName); + std::string const fullPath = cmStrCat(binDir, '/', fileName); if (cmSystemTools::FileIsSymlink(fullPath)) { cmSystemTools::RemoveFile(fullPath); } else if (cmSystemTools::FileIsDirectory(fullPath)) { @@ -1293,12 +1306,12 @@ std::string cmCoreTryCompile::WriteSource(std::string const& filename, { if (!cmSystemTools::GetFilenamePath(filename).empty()) { const auto& msg = - cmStrCat(command, " given invalid filename \"", filename, "\""); + cmStrCat(command, " given invalid filename \"", filename, '"'); this->Makefile->IssueMessage(MessageType::FATAL_ERROR, msg); return {}; } - auto filepath = cmStrCat(this->BinaryDirectory, "/", filename); + auto filepath = cmStrCat(this->BinaryDirectory, '/', filename); cmsys::ofstream file{ filepath.c_str(), std::ios::out }; if (!file) { const auto& msg = @@ -1309,7 +1322,7 @@ std::string cmCoreTryCompile::WriteSource(std::string const& filename, file << content; if (!file) { - const auto& msg = cmStrCat(command, " failed to write \"", filename, "\""); + const auto& msg = cmStrCat(command, " failed to write \"", filename, '"'); this->Makefile->IssueMessage(MessageType::FATAL_ERROR, msg); return {}; } diff --git a/Source/cmCustomCommand.cxx b/Source/cmCustomCommand.cxx index e12cf70..9958e4d 100644 --- a/Source/cmCustomCommand.cxx +++ b/Source/cmCustomCommand.cxx @@ -194,6 +194,16 @@ void cmCustomCommand::SetJobPool(const std::string& job_pool) this->JobPool = job_pool; } +bool cmCustomCommand::GetJobserverAware() const +{ + return this->JobserverAware; +} + +void cmCustomCommand::SetJobserverAware(bool b) +{ + this->JobserverAware = b; +} + #define DEFINE_CC_POLICY_ACCESSOR(P) \ cmPolicies::PolicyStatus cmCustomCommand::Get##P##Status() const \ { \ diff --git a/Source/cmCustomCommand.h b/Source/cmCustomCommand.h index 1e68dbf..167e601 100644 --- a/Source/cmCustomCommand.h +++ b/Source/cmCustomCommand.h @@ -115,6 +115,11 @@ public: const std::string& GetJobPool() const; void SetJobPool(const std::string& job_pool); + /** Set/Get whether this custom command should be given access to the + jobserver (if possible). */ + bool GetJobserverAware() const; + void SetJobserverAware(bool b); + #define DECLARE_CC_POLICY_ACCESSOR(P) \ cmPolicies::PolicyStatus Get##P##Status() const; CM_FOR_EACH_CUSTOM_COMMAND_POLICY(DECLARE_CC_POLICY_ACCESSOR) @@ -139,6 +144,7 @@ private: std::string WorkingDirectory; std::string Depfile; std::string JobPool; + bool JobserverAware = false; bool HaveComment = false; bool EscapeAllowMakeVars = false; bool EscapeOldStyle = true; diff --git a/Source/cmCxxModuleMapper.cxx b/Source/cmCxxModuleMapper.cxx index e836a2a..e6c10c6 100644 --- a/Source/cmCxxModuleMapper.cxx +++ b/Source/cmCxxModuleMapper.cxx @@ -74,8 +74,62 @@ CxxBmiLocation CxxModuleLocations::BmiGeneratorPathForModule( namespace { +struct TransitiveUsage +{ + TransitiveUsage(std::string name, std::string location, LookupMethod method) + : LogicalName(std::move(name)) + , Location(std::move(location)) + , Method(method) + { + } + + std::string LogicalName; + std::string Location; + LookupMethod Method; +}; + +std::vector<TransitiveUsage> GetTransitiveUsages( + CxxModuleLocations const& loc, std::vector<cmSourceReqInfo> const& required, + CxxModuleUsage const& usages) +{ + std::set<std::string> transitive_usage_directs; + std::set<std::string> transitive_usage_names; + + std::vector<TransitiveUsage> all_usages; + + for (auto const& r : required) { + auto bmi_loc = loc.BmiGeneratorPathForModule(r.LogicalName); + if (bmi_loc.IsKnown()) { + all_usages.emplace_back(r.LogicalName, bmi_loc.Location(), r.Method); + transitive_usage_directs.insert(r.LogicalName); + + // Insert transitive usages. + auto transitive_usages = usages.Usage.find(r.LogicalName); + if (transitive_usages != usages.Usage.end()) { + transitive_usage_names.insert(transitive_usages->second.begin(), + transitive_usages->second.end()); + } + } + } + + for (auto const& transitive_name : transitive_usage_names) { + if (transitive_usage_directs.count(transitive_name)) { + continue; + } + + auto module_ref = usages.Reference.find(transitive_name); + if (module_ref != usages.Reference.end()) { + all_usages.emplace_back(transitive_name, module_ref->second.Path, + module_ref->second.Method); + } + } + + return all_usages; +} + std::string CxxModuleMapContentClang(CxxModuleLocations const& loc, - cmScanDepInfo const& obj) + cmScanDepInfo const& obj, + CxxModuleUsage const& usages) { std::stringstream mm; @@ -98,12 +152,11 @@ std::string CxxModuleMapContentClang(CxxModuleLocations const& loc, break; } } - for (auto const& r : obj.Requires) { - auto bmi_loc = loc.BmiGeneratorPathForModule(r.LogicalName); - if (bmi_loc.IsKnown()) { - mm << "-fmodule-file=" << r.LogicalName << "=" << bmi_loc.Location() - << '\n'; - } + + auto all_usages = GetTransitiveUsages(loc, obj.Requires, usages); + for (auto const& usage : all_usages) { + mm << "-fmodule-file=" << usage.LogicalName << '=' << usage.Location + << '\n'; } return mm.str(); @@ -122,7 +175,7 @@ std::string CxxModuleMapContentGcc(CxxModuleLocations const& loc, // generate any). // Write the root directory to use for module paths. - mm << "$root " << loc.RootDirectory << "\n"; + mm << "$root " << loc.RootDirectory << '\n'; for (auto const& p : obj.Provides) { auto bmi_loc = loc.BmiGeneratorPathForModule(p.LogicalName); @@ -180,37 +233,11 @@ std::string CxxModuleMapContentMsvc(CxxModuleLocations const& loc, } } - std::set<std::string> transitive_usage_directs; - std::set<std::string> transitive_usage_names; - - for (auto const& r : obj.Requires) { - auto bmi_loc = loc.BmiGeneratorPathForModule(r.LogicalName); - if (bmi_loc.IsKnown()) { - auto flag = flag_for_method(r.Method); - - mm << flag << ' ' << r.LogicalName << '=' << bmi_loc.Location() << "\n"; - transitive_usage_directs.insert(r.LogicalName); - - // Insert transitive usages. - auto transitive_usages = usages.Usage.find(r.LogicalName); - if (transitive_usages != usages.Usage.end()) { - transitive_usage_names.insert(transitive_usages->second.begin(), - transitive_usages->second.end()); - } - } - } - - for (auto const& transitive_name : transitive_usage_names) { - if (transitive_usage_directs.count(transitive_name)) { - continue; - } + auto all_usages = GetTransitiveUsages(loc, obj.Requires, usages); + for (auto const& usage : all_usages) { + auto flag = flag_for_method(usage.Method); - auto module_ref = usages.Reference.find(transitive_name); - if (module_ref != usages.Reference.end()) { - auto flag = flag_for_method(module_ref->second.Method); - mm << flag << ' ' << transitive_name << '=' << module_ref->second.Path - << "\n"; - } + mm << flag << ' ' << usage.LogicalName << '=' << usage.Location << '\n'; } return mm.str(); @@ -393,7 +420,7 @@ std::string CxxModuleMapContent(CxxModuleMapFormat format, { switch (format) { case CxxModuleMapFormat::Clang: - return CxxModuleMapContentClang(loc, obj); + return CxxModuleMapContentClang(loc, obj, usages); case CxxModuleMapFormat::Gcc: return CxxModuleMapContentGcc(loc, obj); case CxxModuleMapFormat::Msvc: diff --git a/Source/cmCxxModuleMapper.h b/Source/cmCxxModuleMapper.h index ef01e48..34111f7 100644 --- a/Source/cmCxxModuleMapper.h +++ b/Source/cmCxxModuleMapper.h @@ -13,7 +13,8 @@ #include <cm/optional> #include <cmext/string_view> -#include "cmScanDepFormat.h" +enum class LookupMethod; +struct cmScanDepInfo; enum class CxxModuleMapFormat { diff --git a/Source/cmDebuggerAdapter.h b/Source/cmDebuggerAdapter.h index f261d88..3403b36 100644 --- a/Source/cmDebuggerAdapter.h +++ b/Source/cmDebuggerAdapter.h @@ -16,7 +16,7 @@ #include <cm3p/cppdap/io.h> // IWYU pragma: keep -#include "cmMessageType.h" +#include "cmMessageType.h" // IWYU pragma: keep class cmListFileFunction; class cmMakefile; diff --git a/Source/cmDebuggerBreakpointManager.cxx b/Source/cmDebuggerBreakpointManager.cxx index 4ae6728..db18c6e 100644 --- a/Source/cmDebuggerBreakpointManager.cxx +++ b/Source/cmDebuggerBreakpointManager.cxx @@ -5,7 +5,6 @@ #include <algorithm> #include <cstddef> #include <cstdint> -#include <memory> #include <utility> #include <cm3p/cppdap/optional.h> diff --git a/Source/cmDebuggerBreakpointManager.h b/Source/cmDebuggerBreakpointManager.h index 747722f..815262a 100644 --- a/Source/cmDebuggerBreakpointManager.h +++ b/Source/cmDebuggerBreakpointManager.h @@ -14,11 +14,9 @@ #include <cm3p/cppdap/protocol.h> -class cmListFileFunction; +#include "cmDebuggerSourceBreakpoint.h" -namespace cmDebugger { -class cmDebuggerSourceBreakpoint; -} +class cmListFileFunction; namespace dap { class Session; diff --git a/Source/cmDebuggerExceptionManager.h b/Source/cmDebuggerExceptionManager.h index b819128..4c044d7 100644 --- a/Source/cmDebuggerExceptionManager.h +++ b/Source/cmDebuggerExceptionManager.h @@ -5,7 +5,6 @@ #include "cmConfigure.h" // IWYU pragma: keep #include <cstddef> -#include <functional> #include <mutex> #include <string> #include <unordered_map> @@ -14,7 +13,7 @@ #include <cm3p/cppdap/protocol.h> -#include "cmMessageType.h" +#include "cmMessageType.h" // IWYU pragma: keep namespace dap { class Session; diff --git a/Source/cmDebuggerProtocol.h b/Source/cmDebuggerProtocol.h index 4334aed..d4b1a96 100644 --- a/Source/cmDebuggerProtocol.h +++ b/Source/cmDebuggerProtocol.h @@ -4,7 +4,7 @@ #include "cmConfigure.h" // IWYU pragma: keep -#include <vector> +#include <string> #include <cm3p/cppdap/protocol.h> diff --git a/Source/cmDebuggerVariablesHelper.cxx b/Source/cmDebuggerVariablesHelper.cxx index 1322b20..73f9111 100644 --- a/Source/cmDebuggerVariablesHelper.cxx +++ b/Source/cmDebuggerVariablesHelper.cxx @@ -7,10 +7,11 @@ #include <cstddef> #include <functional> #include <iomanip> +#include <iterator> #include <map> #include <sstream> -#include "cm_codecvt.hxx" +#include "cm_codecvt_Encoding.hxx" #include "cmDebuggerStackFrame.h" #include "cmDebuggerVariables.h" @@ -578,17 +579,17 @@ std::shared_ptr<cmDebuggerVariables> cmDebuggerVariablesHelper::CreateIfAny( return {}; } - auto makeFileEncodingString = [](codecvt::Encoding encoding) { + auto makeFileEncodingString = [](codecvt_Encoding encoding) { switch (encoding) { - case codecvt::Encoding::None: + case codecvt_Encoding::None: return "None"; - case codecvt::Encoding::UTF8: + case codecvt_Encoding::UTF8: return "UTF8"; - case codecvt::Encoding::UTF8_WITH_BOM: + case codecvt_Encoding::UTF8_WITH_BOM: return "UTF8_WITH_BOM"; - case codecvt::Encoding::ANSI: + case codecvt_Encoding::ANSI: return "ANSI"; - case codecvt::Encoding::ConsoleOutput: + case codecvt_Encoding::ConsoleOutput: return "ConsoleOutput"; default: return "Unknown"; diff --git a/Source/cmDebuggerVariablesManager.h b/Source/cmDebuggerVariablesManager.h index c219164..9a64f10 100644 --- a/Source/cmDebuggerVariablesManager.h +++ b/Source/cmDebuggerVariablesManager.h @@ -7,14 +7,9 @@ #include <cstdint> #include <functional> #include <unordered_map> -#include <vector> -#include <cm3p/cppdap/types.h> // IWYU pragma: keep - -namespace dap { -struct Variable; -struct VariablesRequest; -} +#include <cm3p/cppdap/protocol.h> +#include <cm3p/cppdap/types.h> namespace cmDebugger { diff --git a/Source/cmDefinitions.cxx b/Source/cmDefinitions.cxx index a5f8aab..453c0d1 100644 --- a/Source/cmDefinitions.cxx +++ b/Source/cmDefinitions.cxx @@ -3,7 +3,6 @@ #include "cmDefinitions.h" #include <cassert> -#include <functional> #include <unordered_set> #include <utility> diff --git a/Source/cmDefinitions.h b/Source/cmDefinitions.h index 22fef80..11d8947 100644 --- a/Source/cmDefinitions.h +++ b/Source/cmDefinitions.h @@ -4,7 +4,6 @@ #include "cmConfigure.h" // IWYU pragma: keep -#include <functional> #include <string> #include <unordered_map> #include <vector> diff --git a/Source/cmDependsCompiler.cxx b/Source/cmDependsCompiler.cxx index c8061c3..27f328d 100644 --- a/Source/cmDependsCompiler.cxx +++ b/Source/cmDependsCompiler.cxx @@ -6,7 +6,6 @@ #include <algorithm> #include <iterator> #include <map> -#include <memory> #include <string> #include <unordered_set> #include <utility> diff --git a/Source/cmDependsFortran.cxx b/Source/cmDependsFortran.cxx index d038db7..2a50565 100644 --- a/Source/cmDependsFortran.cxx +++ b/Source/cmDependsFortran.cxx @@ -6,6 +6,7 @@ #include <cstdlib> #include <iostream> #include <map> +#include <type_traits> #include <utility> #include "cmsys/FStream.hxx" diff --git a/Source/cmDocumentationFormatter.cxx b/Source/cmDocumentationFormatter.cxx index 70ba1fc..b85b2f5 100644 --- a/Source/cmDocumentationFormatter.cxx +++ b/Source/cmDocumentationFormatter.cxx @@ -2,7 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmDocumentationFormatter.h" -#include <algorithm> +#include <algorithm> // IWYU pragma: keep #include <cassert> #include <iomanip> #include <ostream> diff --git a/Source/cmDocumentationFormatter.h b/Source/cmDocumentationFormatter.h index e269f6a..9d35e0a 100644 --- a/Source/cmDocumentationFormatter.h +++ b/Source/cmDocumentationFormatter.h @@ -4,6 +4,7 @@ #include "cmConfigure.h" // IWYU pragma: keep +#include <cstddef> #include <iosfwd> #include <string> diff --git a/Source/cmExecuteProcessCommand.cxx b/Source/cmExecuteProcessCommand.cxx index 7fbd826..3b98219 100644 --- a/Source/cmExecuteProcessCommand.cxx +++ b/Source/cmExecuteProcessCommand.cxx @@ -20,6 +20,7 @@ #include "cmArgumentParser.h" #include "cmExecutionStatus.h" +#include "cmList.h" #include "cmMakefile.h" #include "cmMessageType.h" #include "cmProcessOutput.h" @@ -356,7 +357,7 @@ bool cmExecuteProcessCommand(std::vector<std::string> const& args, } } status.GetMakefile().AddDefinition(arguments.ResultsVariable, - cmJoin(res, ";")); + cmList::to_string(res)); } break; case cmsysProcess_State_Exception: status.GetMakefile().AddDefinition( diff --git a/Source/cmExperimental.cxx b/Source/cmExperimental.cxx index 2f26627..51c174e 100644 --- a/Source/cmExperimental.cxx +++ b/Source/cmExperimental.cxx @@ -18,36 +18,41 @@ namespace { * Search for other instances to keep the documentation and test suite * up-to-date. */ - -struct FeatureData -{ - std::string const Uuid; - std::string const Variable; - std::string const Description; - bool Warned; -} LookupTable[] = { +cmExperimental::FeatureData LookupTable[] = { // CxxModuleCMakeApi - { "aa1f7df0-828a-4fcd-9afc-2dc80491aca7", + { "CxxModuleCMakeApi", "bf70d4b0-9fb7-465c-9803-34014e70d112", "CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API", "CMake's C++ module support is experimental. It is meant only for " "experimentation and feedback to CMake developers.", + false, // https://gitlab.kitware.com/cmake/cmake/-/issues/25097 false }, + // WindowsKernelModeDriver + { "WindowsKernelModeDriver", "5c2d848d-4efa-4529-a768-efd57171bf68", + "CMAKE_EXPERIMENTAL_WINDOWS_KERNEL_MODE_DRIVER", + "CMake's Windows kernel-mode driver support is experimental. It is meant " + "only for experimentation and feedback to CMake developers.", + true, false }, }; static_assert(sizeof(LookupTable) / sizeof(LookupTable[0]) == static_cast<size_t>(cmExperimental::Feature::Sentinel), "Experimental feature lookup table mismatch"); -FeatureData& DataForFeature(cmExperimental::Feature f) +cmExperimental::FeatureData& DataForFeature(cmExperimental::Feature f) { assert(f != cmExperimental::Feature::Sentinel); return LookupTable[static_cast<size_t>(f)]; } } +const cmExperimental::FeatureData& cmExperimental::DataForFeature(Feature f) +{ + return ::DataForFeature(f); +} + bool cmExperimental::HasSupportEnabled(cmMakefile const& mf, Feature f) { bool enabled = false; - auto& data = DataForFeature(f); + auto& data = ::DataForFeature(f); auto value = mf.GetDefinition(data.Variable); if (value == data.Uuid) { diff --git a/Source/cmExperimental.h b/Source/cmExperimental.h index 26e0d17..3374ba8 100644 --- a/Source/cmExperimental.h +++ b/Source/cmExperimental.h @@ -5,6 +5,8 @@ #include "cmConfigure.h" // IWYU pragma: keep +#include <string> + class cmMakefile; class cmExperimental @@ -13,9 +15,21 @@ public: enum class Feature { CxxModuleCMakeApi, + WindowsKernelModeDriver, Sentinel, }; + struct FeatureData + { + std::string const Name; + std::string const Uuid; + std::string const Variable; + std::string const Description; + bool const ForwardThroughTryCompile; + bool Warned; + }; + + static const FeatureData& DataForFeature(Feature f); static bool HasSupportEnabled(cmMakefile const& mf, Feature f); }; diff --git a/Source/cmExportBuildAndroidMKGenerator.cxx b/Source/cmExportBuildAndroidMKGenerator.cxx index 5e7008b..c54e6ac 100644 --- a/Source/cmExportBuildAndroidMKGenerator.cxx +++ b/Source/cmExportBuildAndroidMKGenerator.cxx @@ -2,6 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmExportBuildAndroidMKGenerator.h" +#include <map> #include <sstream> #include <utility> #include <vector> diff --git a/Source/cmExportBuildAndroidMKGenerator.h b/Source/cmExportBuildAndroidMKGenerator.h index 1a9a626..7067488 100644 --- a/Source/cmExportBuildAndroidMKGenerator.h +++ b/Source/cmExportBuildAndroidMKGenerator.h @@ -8,7 +8,6 @@ #include <string> #include "cmExportBuildFileGenerator.h" -#include "cmExportFileGenerator.h" #include "cmStateTypes.h" class cmGeneratorTarget; diff --git a/Source/cmExportBuildFileGenerator.cxx b/Source/cmExportBuildFileGenerator.cxx index df26bad..8d3960c 100644 --- a/Source/cmExportBuildFileGenerator.cxx +++ b/Source/cmExportBuildFileGenerator.cxx @@ -19,6 +19,7 @@ #include "cmGeneratorExpression.h" #include "cmGeneratorTarget.h" #include "cmGlobalGenerator.h" +#include "cmList.h" #include "cmLocalGenerator.h" #include "cmMakefile.h" #include "cmMessageType.h" @@ -237,7 +238,7 @@ void cmExportBuildFileGenerator::SetImportLocationProperty( } // Store the property. - properties[prop] = cmJoin(objects, ";"); + properties[prop] = cmList::to_string(objects); } else { // Add the main target file. { diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx index 22276ae..481c98f 100644 --- a/Source/cmExportFileGenerator.cxx +++ b/Source/cmExportFileGenerator.cxx @@ -383,7 +383,7 @@ void cmExportFileGenerator::PopulateIncludeDirectoriesInterface( cmGeneratorExpression ge(*target->Makefile->GetCMakeInstance()); std::string dirs = cmGeneratorExpression::Preprocess( - cmJoin(target->Target->GetInstallIncludeDirectoriesEntries(te), ";"), + cmList::to_string(target->Target->GetInstallIncludeDirectoriesEntries(te)), preprocessRule, true); this->ReplaceInstallPrefix(dirs); std::unique_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(dirs); @@ -955,13 +955,13 @@ void cmExportFileGenerator::GeneratePolicyHeaderCode(std::ostream& os) // Isolate the file policy level. // Support CMake versions as far back as 2.6 but also support using NEW - // policy settings for up to CMake 3.25 (this upper limit may be reviewed + // policy settings for up to CMake 3.26 (this upper limit may be reviewed // and increased from time to time). This reduces the opportunity for CMake // warnings when an older export file is later used with newer CMake // versions. /* clang-format off */ os << "cmake_policy(PUSH)\n" - << "cmake_policy(VERSION 2.8.3...3.25)\n"; + << "cmake_policy(VERSION 2.8.3...3.26)\n"; /* clang-format on */ } diff --git a/Source/cmExportInstallAndroidMKGenerator.h b/Source/cmExportInstallAndroidMKGenerator.h index c05751a..061358d 100644 --- a/Source/cmExportInstallAndroidMKGenerator.h +++ b/Source/cmExportInstallAndroidMKGenerator.h @@ -8,7 +8,6 @@ #include <set> #include <string> -#include "cmExportFileGenerator.h" #include "cmExportInstallFileGenerator.h" #include "cmStateTypes.h" diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx index 538c883..264c947 100644 --- a/Source/cmExportInstallFileGenerator.cxx +++ b/Source/cmExportInstallFileGenerator.cxx @@ -19,6 +19,7 @@ #include "cmInstallExportGenerator.h" #include "cmInstallFileSetGenerator.h" #include "cmInstallTargetGenerator.h" +#include "cmList.h" #include "cmLocalGenerator.h" #include "cmMakefile.h" #include "cmMessageType.h" @@ -430,7 +431,7 @@ void cmExportInstallFileGenerator::SetImportLocationProperty( } // Store the property. - properties[prop] = cmJoin(objects, ";"); + properties[prop] = cmList::to_string(objects); importedLocations.insert(prop); } else { if (target->IsFrameworkOnApple() && target->HasImportLibrary(config)) { @@ -590,10 +591,12 @@ std::string cmExportInstallFileGenerator::GetFileSetDirectories( auto cge = ge.Parse(te->FileSetGenerators.at(fileSet)->GetDestination()); for (auto const& config : configs) { - auto dest = cmStrCat("${_IMPORT_PREFIX}/", - cmOutputConverter::EscapeForCMake( - cge->Evaluate(gte->LocalGenerator, config, gte), - cmOutputConverter::WrapQuotes::NoWrap)); + auto unescapedDest = cge->Evaluate(gte->LocalGenerator, config, gte); + auto dest = cmOutputConverter::EscapeForCMake( + unescapedDest, cmOutputConverter::WrapQuotes::NoWrap); + if (!cmSystemTools::FileIsFullPath(unescapedDest)) { + dest = cmStrCat("${_IMPORT_PREFIX}/", dest); + } auto const& type = fileSet->GetType(); // C++ modules do not support interface file sets which are dependent upon @@ -645,11 +648,14 @@ std::string cmExportInstallFileGenerator::GetFileSetFiles( fileSet->EvaluateFileEntry(directories, files, entry, gte->LocalGenerator, config, gte); } - auto dest = cmStrCat("${_IMPORT_PREFIX}/", - cmOutputConverter::EscapeForCMake( - destCge->Evaluate(gte->LocalGenerator, config, gte), - cmOutputConverter::WrapQuotes::NoWrap), - '/'); + auto unescapedDest = destCge->Evaluate(gte->LocalGenerator, config, gte); + auto dest = + cmStrCat(cmOutputConverter::EscapeForCMake( + unescapedDest, cmOutputConverter::WrapQuotes::NoWrap), + '/'); + if (!cmSystemTools::FileIsFullPath(unescapedDest)) { + dest = cmStrCat("${_IMPORT_PREFIX}/", dest); + } bool const contextSensitive = destCge->GetHadContextSensitiveCondition() || std::any_of(directoryEntries.begin(), directoryEntries.end(), diff --git a/Source/cmExportLibraryDependenciesCommand.cxx b/Source/cmExportLibraryDependenciesCommand.cxx index 8aec12b..02d0444 100644 --- a/Source/cmExportLibraryDependenciesCommand.cxx +++ b/Source/cmExportLibraryDependenciesCommand.cxx @@ -3,6 +3,7 @@ #include "cmExportLibraryDependenciesCommand.h" #include <map> +#include <unordered_map> #include <utility> #include <cm/memory> diff --git a/Source/cmExportTryCompileFileGenerator.cxx b/Source/cmExportTryCompileFileGenerator.cxx index f30c3c3..00c9173 100644 --- a/Source/cmExportTryCompileFileGenerator.cxx +++ b/Source/cmExportTryCompileFileGenerator.cxx @@ -2,7 +2,6 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmExportTryCompileFileGenerator.h" -#include <map> #include <utility> #include <cm/memory> @@ -13,7 +12,6 @@ #include "cmGeneratorTarget.h" #include "cmGlobalGenerator.h" #include "cmList.h" -#include "cmListFileCache.h" #include "cmLocalGenerator.h" #include "cmMakefile.h" #include "cmOutputConverter.h" @@ -156,12 +154,12 @@ std::string cmExportTryCompileFileGenerator::GetFileSetDirectories( cmGeneratorTarget* /*gte*/, cmFileSet* fileSet, cmTargetExport* /*te*/) { return cmOutputConverter::EscapeForCMake( - cmJoin(fileSet->GetDirectoryEntries(), ";")); + cmList::to_string(fileSet->GetDirectoryEntries())); } std::string cmExportTryCompileFileGenerator::GetFileSetFiles( cmGeneratorTarget* /*gte*/, cmFileSet* fileSet, cmTargetExport* /*te*/) { return cmOutputConverter::EscapeForCMake( - cmJoin(fileSet->GetFileEntries(), ";")); + cmList::to_string(fileSet->GetFileEntries())); } diff --git a/Source/cmFileAPI.cxx b/Source/cmFileAPI.cxx index 8abb5a8..8b0f309 100644 --- a/Source/cmFileAPI.cxx +++ b/Source/cmFileAPI.cxx @@ -5,7 +5,6 @@ #include <algorithm> #include <cassert> #include <chrono> -#include <cstddef> #include <ctime> #include <iomanip> #include <sstream> diff --git a/Source/cmFileAPICodemodel.cxx b/Source/cmFileAPICodemodel.cxx index 280ebb0..812b1b5 100644 --- a/Source/cmFileAPICodemodel.cxx +++ b/Source/cmFileAPICodemodel.cxx @@ -5,7 +5,6 @@ #include <algorithm> #include <cassert> #include <cstddef> -#include <functional> #include <limits> #include <map> #include <memory> diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index 45fba8b..f4fbf75 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -30,6 +30,7 @@ #include "cmArgumentParser.h" #include "cmArgumentParserTypes.h" +#include "cmCMakePath.h" #include "cmCryptoHash.h" #include "cmELF.h" #include "cmExecutionStatus.h" @@ -42,6 +43,7 @@ #include "cmGeneratorExpression.h" #include "cmGlobalGenerator.h" #include "cmHexFileConverter.h" +#include "cmList.h" #include "cmListFileCache.h" #include "cmMakefile.h" #include "cmMessageType.h" @@ -805,7 +807,7 @@ bool HandleGlobImpl(std::vector<std::string> const& args, bool recurse, std::sort(files.begin(), files.end()); files.erase(std::unique(files.begin(), files.end()), files.end()); - status.GetMakefile().AddDefinition(variable, cmJoin(files, ";")); + status.GetMakefile().AddDefinition(variable, cmList::to_string(files)); return true; } @@ -1277,9 +1279,58 @@ bool HandleRealPathCommand(std::vector<std::string> const& args, } } - auto realPath = - cmSystemTools::CollapseFullPath(input, *arguments.BaseDirectory); - realPath = cmSystemTools::GetRealPath(realPath); + bool warnAbout152 = false; + bool use152New = true; + cmPolicies::PolicyStatus policyStatus = + status.GetMakefile().GetPolicyStatus(cmPolicies::CMP0152); + switch (policyStatus) { + case cmPolicies::REQUIRED_IF_USED: + case cmPolicies::REQUIRED_ALWAYS: + case cmPolicies::NEW: + break; + case cmPolicies::WARN: + use152New = false; + warnAbout152 = true; + break; + case cmPolicies::OLD: + use152New = false; + warnAbout152 = false; + break; + } + + auto computeNewPath = [=](std::string const& in, std::string& result) { + auto path = cmCMakePath{ in }; + if (path.IsRelative()) { + auto basePath = cmCMakePath{ *arguments.BaseDirectory }; + path = basePath.Append(path); + } + result = cmSystemTools::GetActualCaseForPath( + cmSystemTools::GetRealPath(path.String())); + }; + + std::string realPath; + if (use152New) { + computeNewPath(input, realPath); + } else { + std::string oldPolicyPath = + cmSystemTools::CollapseFullPath(input, *arguments.BaseDirectory); + oldPolicyPath = cmSystemTools::GetRealPath(oldPolicyPath); + if (warnAbout152) { + computeNewPath(input, realPath); + if (oldPolicyPath != realPath) { + status.GetMakefile().IssueMessage( + MessageType::AUTHOR_WARNING, + cmStrCat( + cmPolicies::GetPolicyWarning(cmPolicies::CMP0152), '\n', + "From input path:\n ", input, + "\nthe policy OLD behavior produces path:\n ", oldPolicyPath, + "\nbut the policy NEW behavior produces path:\n ", realPath, + "\nSince the policy is not set, CMake is using the OLD " + "behavior for compatibility.")); + } + } + realPath = oldPolicyPath; + } status.GetMakefile().AddDefinition(args[2], realPath); @@ -1556,7 +1607,7 @@ bool HandlePathCommand(std::vector<std::string> const& args, #endif std::vector<std::string> path = cmSystemTools::SplitString(args[1], pathSep); - std::string value = cmJoin(cmMakeRange(path).transform(convert), ";"); + std::string value = cmList::to_string(cmMakeRange(path).transform(convert)); status.GetMakefile().AddDefinition(args[2], value); return true; } @@ -3157,7 +3208,7 @@ bool HandleGetRuntimeDependenciesCommand(std::vector<std::string> const& args, if (!parsedArgs.RPathPrefix.empty()) { status.GetMakefile().AddDefinition( parsedArgs.RPathPrefix + "_" + firstPath, - cmJoin(archive.GetRPaths().at(firstPath), ";")); + cmList::to_string(archive.GetRPaths().at(firstPath))); } } else if (!parsedArgs.ConflictingDependenciesPrefix.empty()) { conflictingDeps.push_back(val.first); @@ -3165,7 +3216,7 @@ bool HandleGetRuntimeDependenciesCommand(std::vector<std::string> const& args, paths.insert(paths.begin(), val.second.begin(), val.second.end()); std::string varName = parsedArgs.ConflictingDependenciesPrefix + "_" + val.first; - std::string pathsStr = cmJoin(paths, ";"); + std::string pathsStr = cmList::to_string(paths); status.GetMakefile().AddDefinition(varName, pathsStr); } else { std::ostringstream e; @@ -3196,17 +3247,17 @@ bool HandleGetRuntimeDependenciesCommand(std::vector<std::string> const& args, } if (!parsedArgs.ResolvedDependenciesVar.empty()) { - std::string val = cmJoin(deps, ";"); + std::string val = cmList::to_string(deps); status.GetMakefile().AddDefinition(parsedArgs.ResolvedDependenciesVar, val); } if (!parsedArgs.UnresolvedDependenciesVar.empty()) { - std::string val = cmJoin(unresolvedDeps, ";"); + std::string val = cmList::to_string(unresolvedDeps); status.GetMakefile().AddDefinition(parsedArgs.UnresolvedDependenciesVar, val); } if (!parsedArgs.ConflictingDependenciesPrefix.empty()) { - std::string val = cmJoin(conflictingDeps, ";"); + std::string val = cmList::to_string(conflictingDeps); status.GetMakefile().AddDefinition( parsedArgs.ConflictingDependenciesPrefix + "_FILENAMES", val); } diff --git a/Source/cmFileLock.cxx b/Source/cmFileLock.cxx index 5d197d2..548e327 100644 --- a/Source/cmFileLock.cxx +++ b/Source/cmFileLock.cxx @@ -12,11 +12,7 @@ cmFileLock::cmFileLock(cmFileLock&& other) noexcept { this->File = other.File; -#if defined(_WIN32) - other.File = INVALID_HANDLE_VALUE; -#else - other.File = -1; -#endif + other.File = (decltype(other.File))-1; this->Filename = std::move(other.Filename); } @@ -32,11 +28,7 @@ cmFileLock::~cmFileLock() cmFileLock& cmFileLock::operator=(cmFileLock&& other) noexcept { this->File = other.File; -#if defined(_WIN32) - other.File = INVALID_HANDLE_VALUE; -#else - other.File = -1; -#endif + other.File = (decltype(other.File))-1; this->Filename = std::move(other.Filename); return *this; diff --git a/Source/cmFileLock.h b/Source/cmFileLock.h index 94baea1..0f2e7d9 100644 --- a/Source/cmFileLock.h +++ b/Source/cmFileLock.h @@ -7,7 +7,7 @@ #include <string> #if defined(_WIN32) -# include <windows.h> // HANDLE +using HANDLE = void*; #endif class cmFileLockResult; @@ -53,8 +53,8 @@ private: cmFileLockResult LockWithTimeout(unsigned long timeoutSec); #if defined(_WIN32) - HANDLE File = INVALID_HANDLE_VALUE; - BOOL LockFile(DWORD flags); + HANDLE File = (HANDLE)-1; + int LockFile(int flags); #else int File = -1; int LockFile(int cmd, int type) const; diff --git a/Source/cmFileLockResult.cxx b/Source/cmFileLockResult.cxx index b7f7f38..632c0e9 100644 --- a/Source/cmFileLockResult.cxx +++ b/Source/cmFileLockResult.cxx @@ -5,6 +5,10 @@ #include <cerrno> #include <cstring> +#ifdef _WIN32 +# include <Windows.h> +#endif + cmFileLockResult cmFileLockResult::MakeOk() { return { OK, 0 }; diff --git a/Source/cmFileLockResult.h b/Source/cmFileLockResult.h index 8a58d1f..e252de7 100644 --- a/Source/cmFileLockResult.h +++ b/Source/cmFileLockResult.h @@ -6,10 +6,6 @@ #include <string> -#if defined(_WIN32) -# include <windows.h> // DWORD -#endif - /** * @brief Result of the locking/unlocking file. * @note See @c cmFileLock @@ -17,11 +13,7 @@ class cmFileLockResult { public: -#if defined(_WIN32) - using Error = DWORD; -#else using Error = int; -#endif /** * @brief Successful lock/unlock. diff --git a/Source/cmFileLockWin32.cxx b/Source/cmFileLockWin32.cxx index 7bee5f2..244ade2 100644 --- a/Source/cmFileLockWin32.cxx +++ b/Source/cmFileLockWin32.cxx @@ -78,7 +78,7 @@ cmFileLockResult cmFileLock::LockWithTimeout(unsigned long seconds) } } -BOOL cmFileLock::LockFile(DWORD flags) +int cmFileLock::LockFile(int flags) { const DWORD reserved = 0; const unsigned long len = static_cast<unsigned long>(-1); diff --git a/Source/cmFileTime.cxx b/Source/cmFileTime.cxx index 0606baf..3d103d3 100644 --- a/Source/cmFileTime.cxx +++ b/Source/cmFileTime.cxx @@ -2,7 +2,6 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmFileTime.h" -#include <ctime> #include <string> // Use a platform-specific API to get file times efficiently. diff --git a/Source/cmFindBase.cxx b/Source/cmFindBase.cxx index 5e92dd0..9f78418 100644 --- a/Source/cmFindBase.cxx +++ b/Source/cmFindBase.cxx @@ -6,6 +6,7 @@ #include <cstddef> #include <deque> #include <functional> +#include <iterator> #include <map> #include <utility> diff --git a/Source/cmFindLibraryCommand.cxx b/Source/cmFindLibraryCommand.cxx index 9eb0603..df77ad0 100644 --- a/Source/cmFindLibraryCommand.cxx +++ b/Source/cmFindLibraryCommand.cxx @@ -251,8 +251,14 @@ struct cmFindLibraryHelper void DebugLibraryFailed(std::string const& name, std::string const& path) { if (this->DebugMode) { - auto regexName = - cmStrCat(this->PrefixRegexStr, name, this->SuffixRegexStr); + // To improve readability of the debug output, if there is only one + // prefix/suffix, use the plain prefix/suffix instead of the regex. + const auto& prefix = (this->Prefixes.size() == 1) ? this->Prefixes[0] + : this->PrefixRegexStr; + const auto& suffix = (this->Suffixes.size() == 1) ? this->Suffixes[0] + : this->SuffixRegexStr; + + auto regexName = cmStrCat(prefix, name, suffix); this->DebugSearches.FailedAt(path, regexName); } } @@ -552,6 +558,14 @@ std::string cmFindLibraryCommand::FindFrameworkLibraryNamesPerDir() // Search for all names in each search path. for (std::string const& d : this->SearchPaths) { for (std::string const& n : this->Names) { + fwPath = cmStrCat(d, n, ".xcframework"); + if (cmSystemTools::FileIsDirectory(fwPath)) { + auto finalPath = cmSystemTools::CollapseFullPath(fwPath); + if (this->Validate(finalPath)) { + return finalPath; + } + } + fwPath = cmStrCat(d, n, ".framework"); if (cmSystemTools::FileIsDirectory(fwPath)) { auto finalPath = cmSystemTools::CollapseFullPath(fwPath); @@ -572,6 +586,14 @@ std::string cmFindLibraryCommand::FindFrameworkLibraryDirsPerName() // Search for each name in all search paths. for (std::string const& n : this->Names) { for (std::string const& d : this->SearchPaths) { + fwPath = cmStrCat(d, n, ".xcframework"); + if (cmSystemTools::FileIsDirectory(fwPath)) { + auto finalPath = cmSystemTools::CollapseFullPath(fwPath); + if (this->Validate(finalPath)) { + return finalPath; + } + } + fwPath = cmStrCat(d, n, ".framework"); if (cmSystemTools::FileIsDirectory(fwPath)) { auto finalPath = cmSystemTools::CollapseFullPath(fwPath); diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index f863a51..30458cd 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/Source/cmFindPackageCommand.cxx @@ -11,7 +11,6 @@ #include <sstream> #include <utility> -#include <cm/memory> #include <cm/optional> #include <cmext/string_view> diff --git a/Source/cmFunctionCommand.cxx b/Source/cmFunctionCommand.cxx index f4768b6..8d2d972 100644 --- a/Source/cmFunctionCommand.cxx +++ b/Source/cmFunctionCommand.cxx @@ -11,6 +11,7 @@ #include "cmExecutionStatus.h" #include "cmFunctionBlocker.h" +#include "cmList.h" #include "cmListFileCache.h" #include "cmMakefile.h" #include "cmPolicies.h" @@ -89,9 +90,9 @@ bool cmFunctionHelperCommand::operator()( } // define ARGV and ARGN - auto const argvDef = cmJoin(expandedArgs, ";"); + auto const argvDef = cmList::to_string(expandedArgs); auto const eit = expandedArgs.begin() + (this->Args.size() - 1); - auto const argnDef = cmJoin(cmMakeRange(eit, expandedArgs.end()), ";"); + auto const argnDef = cmList::to_string(cmMakeRange(eit, expandedArgs.end())); makefile.AddDefinition(ARGV, argvDef); makefile.MarkVariableAsUsed(ARGV); makefile.AddDefinition(ARGN, argnDef); diff --git a/Source/cmGccDepfileLexerHelper.cxx b/Source/cmGccDepfileLexerHelper.cxx index 87377de..a375904 100644 --- a/Source/cmGccDepfileLexerHelper.cxx +++ b/Source/cmGccDepfileLexerHelper.cxx @@ -4,7 +4,6 @@ #include <algorithm> #include <cstdio> -#include <memory> #include <string> #include <vector> diff --git a/Source/cmGeneratedFileStream.cxx b/Source/cmGeneratedFileStream.cxx index 133bf5f..37a2be4 100644 --- a/Source/cmGeneratedFileStream.cxx +++ b/Source/cmGeneratedFileStream.cxx @@ -3,6 +3,7 @@ #include "cmGeneratedFileStream.h" #include <cstdio> +#include <locale> #include "cmStringAlgorithms.h" #include "cmSystemTools.h" @@ -16,7 +17,7 @@ cmGeneratedFileStream::cmGeneratedFileStream(Encoding encoding) { #ifndef CMAKE_BOOTSTRAP - if (encoding != codecvt::None) { + if (encoding != codecvt_Encoding::None) { this->imbue(std::locale(this->getloc(), new codecvt(encoding))); } #else @@ -35,13 +36,13 @@ cmGeneratedFileStream::cmGeneratedFileStream(std::string const& name, cmSystemTools::ReportLastSystemError(""); } #ifndef CMAKE_BOOTSTRAP - if (encoding != codecvt::None) { + if (encoding != codecvt_Encoding::None) { this->imbue(std::locale(this->getloc(), new codecvt(encoding))); } #else static_cast<void>(encoding); #endif - if (encoding == codecvt::UTF8_WITH_BOM) { + if (encoding == codecvt_Encoding::UTF8_WITH_BOM) { // Write the BOM encoding header into the file char magic[] = { static_cast<char>(0xEF), static_cast<char>(0xBB), static_cast<char>(0xBF) }; diff --git a/Source/cmGeneratedFileStream.h b/Source/cmGeneratedFileStream.h index bfc121f..a26616d 100644 --- a/Source/cmGeneratedFileStream.h +++ b/Source/cmGeneratedFileStream.h @@ -8,7 +8,7 @@ #include "cmsys/FStream.hxx" -#include "cm_codecvt.hxx" +#include "cm_codecvt_Encoding.hxx" // This is the first base class of cmGeneratedFileStream. It will be // created before and destroyed after the ofstream portion and can @@ -77,13 +77,13 @@ class cmGeneratedFileStream { public: using Stream = cmsys::ofstream; - using Encoding = codecvt::Encoding; + using Encoding = codecvt_Encoding; /** * This constructor prepares a default stream. The open method must * be used before writing to the stream. */ - cmGeneratedFileStream(Encoding encoding = codecvt::None); + cmGeneratedFileStream(codecvt_Encoding encoding = codecvt_Encoding::None); /** * This constructor takes the name of the file to be generated. It @@ -92,7 +92,7 @@ public: * second argument is set to true. */ cmGeneratedFileStream(std::string const& name, bool quiet = false, - Encoding encoding = codecvt::None); + codecvt_Encoding encoding = codecvt_Encoding::None); /** * The destructor checks the stream status to be sure the temporary @@ -151,5 +151,5 @@ public: * Write a specific string using an alternate encoding. * Afterward, the original encoding is restored. */ - void WriteAltEncoding(std::string const& data, Encoding encoding); + void WriteAltEncoding(std::string const& data, codecvt_Encoding encoding); }; diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx index 7fe814a..30798a3 100644 --- a/Source/cmGeneratorExpressionNode.cxx +++ b/Source/cmGeneratorExpressionNode.cxx @@ -2540,7 +2540,7 @@ static const struct LinkLibraryNode : public cmGeneratorExpressionNode list.front() = LL_BEGIN; list.push_back(LL_END); - return cmJoin(list, ";"_s); + return list.to_string(); } } linkLibraryNode; @@ -2609,7 +2609,7 @@ static const struct LinkGroupNode : public cmGeneratorExpressionNode list.front() = LG_BEGIN; list.push_back(LG_END); - return cmJoin(list, ";"_s); + return list.to_string(); } } linkGroupNode; @@ -2634,7 +2634,7 @@ static const struct HostLinkNode : public cmGeneratorExpressionNode } return context->HeadTarget->IsDeviceLink() ? std::string() - : cmJoin(parameters, ";"); + : cmList::to_string(parameters); } } hostLinkNode; @@ -2669,7 +2669,7 @@ static const struct DeviceLinkNode : public cmGeneratorExpressionNode list.insert(list.begin(), static_cast<std::string>(DL_BEGIN)); list.push_back(static_cast<std::string>(DL_END)); - return cmJoin(list, ";"); + return list.to_string(); } return std::string(); @@ -3106,7 +3106,7 @@ static const struct TargetObjectsNode : public cmGeneratorExpressionNode mf->AddTargetObject(tgtName, o); } - return cmJoin(objects, ";"); + return objects.to_string(); } } targetObjectsNode; @@ -3166,7 +3166,7 @@ static const struct TargetRuntimeDllsNode : public TargetRuntimeDllsBaseNode cmGeneratorExpressionDAGChecker* /*dagChecker*/) const override { std::vector<std::string> dlls = CollectDlls(parameters, context, content); - return cmJoin(dlls, ";"); + return cmList::to_string(dlls); } } targetRuntimeDllsNode; @@ -3189,7 +3189,7 @@ static const struct TargetRuntimeDllDirsNode : public TargetRuntimeDllsBaseNode dllDirs.push_back(directory); } } - return cmJoin(dllDirs, ";"); + return cmList::to_string(dllDirs); } } targetRuntimeDllDirsNode; diff --git a/Source/cmGeneratorExpressionParser.h b/Source/cmGeneratorExpressionParser.h index 63273e4..490de0a 100644 --- a/Source/cmGeneratorExpressionParser.h +++ b/Source/cmGeneratorExpressionParser.h @@ -7,10 +7,9 @@ #include <memory> #include <vector> +#include "cmGeneratorExpressionEvaluator.h" #include "cmGeneratorExpressionLexer.h" -struct cmGeneratorExpressionEvaluator; - struct cmGeneratorExpressionParser { cmGeneratorExpressionParser(std::vector<cmGeneratorExpressionToken> tokens); diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 357d0a6..3be3697 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -13,6 +13,7 @@ #include <iterator> #include <queue> #include <sstream> +#include <type_traits> #include <unordered_set> #include <utility> @@ -190,7 +191,7 @@ public: } static std::string filesStr; - filesStr = cmJoin(files, ";"); + filesStr = cmList::to_string(files); return filesStr; } @@ -322,8 +323,7 @@ cmValue cmGeneratorTarget::GetSourcesProperty() const values.push_back(se->GetInput()); } static std::string value; - value.clear(); - value = cmJoin(values, ";"); + value = cmList::to_string(values); return cmValue(value); } @@ -1493,9 +1493,9 @@ std::string AddLangSpecificInterfaceIncludeDirectories( } std::string directories; - if (const auto* interface = target->GetLinkInterfaceLibraries( + if (const auto* link_interface = target->GetLinkInterfaceLibraries( config, root, LinkInterfaceFor::Usage)) { - for (const cmLinkItem& library : interface->Libraries) { + for (const cmLinkItem& library : link_interface->Libraries) { if (const cmGeneratorTarget* dependency = library.Target) { if (cm::contains(dependency->GetAllConfigCompileLanguages(), lang)) { auto* lg = dependency->GetLocalGenerator(); @@ -3828,7 +3828,8 @@ std::vector<BT<std::string>> cmGeneratorTarget::GetIncludeDirectories( if (lib.Target == nullptr) { libDir = cmSystemTools::CollapseFullPath( lib.AsStr(), this->Makefile->GetHomeOutputDirectory()); - } else if (lib.Target->Target->IsFrameworkOnApple()) { + } else if (lib.Target->Target->IsFrameworkOnApple() || + this->IsImportedFrameworkFolderOnApple(config)) { libDir = lib.Target->GetLocation(config); } else { continue; @@ -8572,6 +8573,16 @@ bool cmGeneratorTarget::IsFrameworkOnApple() const return this->Target->IsFrameworkOnApple(); } +bool cmGeneratorTarget::IsImportedFrameworkFolderOnApple( + const std::string& config) const +{ + return this->IsApple() && this->IsImported() && + (this->GetType() == cmStateEnums::STATIC_LIBRARY || + this->GetType() == cmStateEnums::SHARED_LIBRARY || + this->GetType() == cmStateEnums::UNKNOWN_LIBRARY) && + cmSystemTools::IsPathToFramework(this->GetLocation(config)); +} + bool cmGeneratorTarget::IsAppBundleOnApple() const { return this->Target->IsAppBundleOnApple(); @@ -8864,6 +8875,47 @@ std::string cmGeneratorTarget::GenerateHeaderSetVerificationFile( return filename; } +std::string cmGeneratorTarget::GetImportedXcFrameworkPath( + const std::string& config) const +{ + if (!(this->IsApple() && this->IsImported() && + (this->GetType() == cmStateEnums::SHARED_LIBRARY || + this->GetType() == cmStateEnums::STATIC_LIBRARY || + this->GetType() == cmStateEnums::UNKNOWN_LIBRARY))) { + return {}; + } + + std::string desiredConfig = config; + if (config.empty()) { + desiredConfig = "NOCONFIG"; + } + + std::string result; + + cmValue loc = nullptr; + cmValue imp = nullptr; + std::string suffix; + + if (this->Target->GetMappedConfig(desiredConfig, loc, imp, suffix)) { + if (loc) { + result = *loc; + } else { + std::string impProp = cmStrCat("IMPORTED_LOCATION", suffix); + if (cmValue configLocation = this->GetProperty(impProp)) { + result = *configLocation; + } else if (cmValue location = this->GetProperty("IMPORTED_LOCATION")) { + result = *location; + } + } + + if (cmSystemTools::IsPathToXcFramework(result)) { + return result; + } + } + + return {}; +} + bool cmGeneratorTarget::HaveFortranSources(std::string const& config) const { auto sources = cmGeneratorTarget::GetSourceFiles(config); diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h index 78945c3..3de9b17 100644 --- a/Source/cmGeneratorTarget.h +++ b/Source/cmGeneratorTarget.h @@ -17,6 +17,7 @@ #include <cm/optional> #include "cmAlgorithms.h" +#include "cmComputeLinkInformation.h" #include "cmLinkItem.h" #include "cmListFileCache.h" #include "cmPolicies.h" @@ -24,7 +25,6 @@ #include "cmValue.h" enum class cmBuildStep; -class cmComputeLinkInformation; class cmCustomCommand; class cmFileSet; class cmGlobalGenerator; @@ -812,6 +812,10 @@ public: Apple. */ bool IsFrameworkOnApple() const; + /** Return whether this target is an IMPORTED library target on Apple + with a .framework folder as its location. */ + bool IsImportedFrameworkFolderOnApple(const std::string& config) const; + /** Return whether this target is an executable Bundle on Apple. */ bool IsAppBundleOnApple() const; @@ -922,6 +926,8 @@ public: cmSourceFile& source, const std::string& dir, cm::optional<std::set<std::string>>& languages) const; + std::string GetImportedXcFrameworkPath(const std::string& config) const; + private: void AddSourceCommon(const std::string& src, bool before = false); @@ -1072,6 +1078,7 @@ private: std::string SharedDeps; }; + friend cmComputeLinkInformation; using ImportInfoMapType = std::map<std::string, ImportInfo>; mutable ImportInfoMapType ImportInfoMap; void ComputeImportInfo(std::string const& desired_config, diff --git a/Source/cmGetCMakePropertyCommand.cxx b/Source/cmGetCMakePropertyCommand.cxx index 42bd206..d2c4fd6 100644 --- a/Source/cmGetCMakePropertyCommand.cxx +++ b/Source/cmGetCMakePropertyCommand.cxx @@ -6,9 +6,9 @@ #include "cmExecutionStatus.h" #include "cmGlobalGenerator.h" +#include "cmList.h" #include "cmMakefile.h" #include "cmState.h" -#include "cmStringAlgorithms.h" #include "cmValue.h" // cmGetCMakePropertyCommand @@ -35,7 +35,7 @@ bool cmGetCMakePropertyCommand(std::vector<std::string> const& args, } else if (args[1] == "COMPONENTS") { const std::set<std::string>* components = status.GetMakefile().GetGlobalGenerator()->GetInstallComponents(); - output = cmJoin(*components, ";"); + output = cmList::to_string(*components); } else { cmValue prop = nullptr; if (!args[1].empty()) { diff --git a/Source/cmGhsMultiTargetGenerator.cxx b/Source/cmGhsMultiTargetGenerator.cxx index a1e0650..4475d88 100644 --- a/Source/cmGhsMultiTargetGenerator.cxx +++ b/Source/cmGhsMultiTargetGenerator.cxx @@ -6,6 +6,7 @@ #include <memory> #include <ostream> #include <set> +#include <type_traits> #include <utility> #include <vector> diff --git a/Source/cmGlobalBorlandMakefileGenerator.h b/Source/cmGlobalBorlandMakefileGenerator.h index 049d6ba..a2adbd0 100644 --- a/Source/cmGlobalBorlandMakefileGenerator.h +++ b/Source/cmGlobalBorlandMakefileGenerator.h @@ -54,6 +54,8 @@ public: bool AllowDeleteOnError() const override { return false; } bool CanEscapeOctothorpe() const override { return true; } + bool IsGNUMakeJobServerAware() const override { return false; } + protected: std::vector<GeneratedMakeCommand> GenerateBuildCommand( const std::string& makeProgram, const std::string& projectName, diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 5175aae..8a8d2e0 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -13,6 +13,7 @@ #include <iomanip> #include <iterator> #include <sstream> +#include <type_traits> #include <utility> #include <cm/memory> @@ -24,9 +25,7 @@ #include "cmsys/FStream.hxx" #include "cmsys/RegularExpression.hxx" -#if defined(_WIN32) && !defined(__CYGWIN__) -# include <windows.h> -#endif +#include "cm_codecvt_Encoding.hxx" #include "cmAlgorithms.h" #include "cmCPackPropertiesGenerator.h" @@ -142,6 +141,10 @@ cmGlobalGenerator::~cmGlobalGenerator() { this->ClearGeneratorMembers(); } +codecvt_Encoding cmGlobalGenerator::GetMakefileEncoding() const +{ + return codecvt_Encoding::None; +} #if !defined(CMAKE_BOOTSTRAP) Json::Value cmGlobalGenerator::GetJson() const @@ -239,7 +242,8 @@ void cmGlobalGenerator::ResolveLanguageCompiler(const std::string& lang, if (!mf->GetDefinition(langComp)) { if (!optional) { - cmSystemTools::Error(langComp + " not set, after EnableLanguage"); + cmSystemTools::Error( + cmStrCat(langComp, " not set, after EnableLanguage")); } return; } @@ -636,11 +640,10 @@ void cmGlobalGenerator::EnableLanguage( #if defined(_WIN32) && !defined(__CYGWIN__) cmSystemTools::WindowsVersion windowsVersion = cmSystemTools::GetWindowsVersion(); - std::ostringstream windowsVersionString; - windowsVersionString << windowsVersion.dwMajorVersion << "." - << windowsVersion.dwMinorVersion << "." - << windowsVersion.dwBuildNumber; - mf->AddDefinition("CMAKE_HOST_SYSTEM_VERSION", windowsVersionString.str()); + auto windowsVersionString = cmStrCat(windowsVersion.dwMajorVersion, '.', + windowsVersion.dwMinorVersion, '.', + windowsVersion.dwBuildNumber); + mf->AddDefinition("CMAKE_HOST_SYSTEM_VERSION", windowsVersionString); #endif // Read the DetermineSystem file std::string systemFile = mf->GetModulesFile("CMakeDetermineSystem.cmake"); @@ -695,22 +698,22 @@ void cmGlobalGenerator::EnableLanguage( setupFile, mf->GetCurrentSourceDirectory()); if (!cmSystemTools::FileExists(absSetupFile)) { cmSystemTools::Error( - "CMAKE_PROJECT_TOP_LEVEL_INCLUDES file does not exist: " + - setupFile); + cmStrCat("CMAKE_PROJECT_TOP_LEVEL_INCLUDES file does not exist: ", + setupFile)); mf->GetState()->SetInTopLevelIncludes(false); return; } if (cmSystemTools::FileIsDirectory(absSetupFile)) { cmSystemTools::Error( - "CMAKE_PROJECT_TOP_LEVEL_INCLUDES file is a directory: " + - setupFile); + cmStrCat("CMAKE_PROJECT_TOP_LEVEL_INCLUDES file is a directory: ", + setupFile)); mf->GetState()->SetInTopLevelIncludes(false); return; } if (!mf->ReadListFile(absSetupFile)) { cmSystemTools::Error( - "Failed reading CMAKE_PROJECT_TOP_LEVEL_INCLUDES file: " + - setupFile); + cmStrCat("Failed reading CMAKE_PROJECT_TOP_LEVEL_INCLUDES file: ", + setupFile)); mf->GetState()->SetInTopLevelIncludes(false); return; } @@ -754,7 +757,8 @@ void cmGlobalGenerator::EnableLanguage( // to avoid duplicate compiler tests. if (cmSystemTools::FileExists(fpath)) { if (!mf->ReadListFile(fpath)) { - cmSystemTools::Error("Could not find cmake module file: " + fpath); + cmSystemTools::Error( + cmStrCat("Could not find cmake module file: ", fpath)); } // if this file was found then the language was already determined // to be working @@ -778,8 +782,8 @@ void cmGlobalGenerator::EnableLanguage( cmStrCat("CMakeDetermine", lang, "Compiler.cmake"); std::string determineFile = mf->GetModulesFile(determineCompiler); if (!mf->ReadListFile(determineFile)) { - cmSystemTools::Error("Could not find cmake module file: " + - determineCompiler); + cmSystemTools::Error( + cmStrCat("Could not find cmake module file: ", determineCompiler)); } if (cmSystemTools::GetFatalErrorOccurred()) { return; @@ -807,7 +811,8 @@ void cmGlobalGenerator::EnableLanguage( // configures CMake(LANG)Compiler.cmake fpath = cmStrCat(rootBin, "/CMake", lang, "Compiler.cmake"); if (!mf->ReadListFile(fpath)) { - cmSystemTools::Error("Could not find cmake module file: " + fpath); + cmSystemTools::Error( + cmStrCat("Could not find cmake module file: ", fpath)); } this->SetLanguageEnabledFlag(lang, mf); needSetLanguageEnabledMaps[lang] = true; @@ -890,10 +895,11 @@ void cmGlobalGenerator::EnableLanguage( fpath = cmStrCat("CMake", lang, "Information.cmake"); std::string informationFile = mf->GetModulesFile(fpath); if (informationFile.empty()) { - cmSystemTools::Error("Could not find cmake module file: " + fpath); + cmSystemTools::Error( + cmStrCat("Could not find cmake module file: ", fpath)); } else if (!mf->ReadListFile(informationFile)) { - cmSystemTools::Error("Could not process cmake module file: " + - informationFile); + cmSystemTools::Error( + cmStrCat("Could not process cmake module file: ", informationFile)); } } if (needSetLanguageEnabledMaps[lang]) { @@ -911,8 +917,8 @@ void cmGlobalGenerator::EnableLanguage( std::string testLang = cmStrCat("CMakeTest", lang, "Compiler.cmake"); std::string ifpath = mf->GetModulesFile(testLang); if (!mf->ReadListFile(ifpath)) { - cmSystemTools::Error("Could not find cmake module file: " + - testLang); + cmSystemTools::Error( + cmStrCat("Could not find cmake module file: ", testLang)); } std::string compilerWorks = cmStrCat("CMAKE_", lang, "_COMPILER_WORKS"); @@ -977,7 +983,7 @@ void cmGlobalGenerator::PrintCompilerAdvice(std::ostream& os, void cmGlobalGenerator::CheckCompilerIdCompatibility( cmMakefile* mf, std::string const& lang) const { - std::string compilerIdVar = "CMAKE_" + lang + "_COMPILER_ID"; + std::string compilerIdVar = cmStrCat("CMAKE_", lang, "_COMPILER_ID"); std::string const compilerId = mf->GetSafeDefinition(compilerIdVar); if (compilerId == "AppleClang") { @@ -1105,9 +1111,9 @@ void cmGlobalGenerator::CheckCompilerIdCompatibility( } { // Fix compiler versions. - std::string version = "CMAKE_" + lang + "_COMPILER_VERSION"; - std::string emulated = "CMAKE_" + lang + "_SIMULATE_VERSION"; - std::string emulatedId = "CMAKE_" + lang + "_SIMULATE_ID"; + std::string version = cmStrCat("CMAKE_", lang, "_COMPILER_VERSION"); + std::string emulated = cmStrCat("CMAKE_", lang, "_SIMULATE_VERSION"); + std::string emulatedId = cmStrCat("CMAKE_", lang, "_SIMULATE_ID"); std::string const& actual = mf->GetRequiredDefinition(emulated); mf->AddDefinition(version, actual); mf->RemoveDefinition(emulatedId); @@ -1208,7 +1214,7 @@ void cmGlobalGenerator::SetLanguageEnabledMaps(const std::string& l, return; } - std::string linkerPrefVar = "CMAKE_" + l + "_LINKER_PREFERENCE"; + std::string linkerPrefVar = cmStrCat("CMAKE_", l, "_LINKER_PREFERENCE"); cmValue linkerPref = mf->GetDefinition(linkerPrefVar); int preference = 0; if (cmNonempty(linkerPref)) { @@ -1234,7 +1240,7 @@ void cmGlobalGenerator::SetLanguageEnabledMaps(const std::string& l, this->LanguageToLinkerPreference[l] = preference; - std::string outputExtensionVar = "CMAKE_" + l + "_OUTPUT_EXTENSION"; + std::string outputExtensionVar = cmStrCat("CMAKE_", l, "_OUTPUT_EXTENSION"); if (cmValue p = mf->GetDefinition(outputExtensionVar)) { std::string outputExtension = *p; this->LanguageToOutputExtension[l] = outputExtension; @@ -1251,7 +1257,7 @@ void cmGlobalGenerator::SetLanguageEnabledMaps(const std::string& l, this->FillExtensionToLanguageMap(l, mf); std::string ignoreExtensionsVar = - std::string("CMAKE_") + std::string(l) + std::string("_IGNORE_EXTENSIONS"); + cmStrCat("CMAKE_", l, "_IGNORE_EXTENSIONS"); std::string ignoreExts = mf->GetSafeDefinition(ignoreExtensionsVar); cmList extensionList{ ignoreExts }; for (std::string const& i : extensionList) { @@ -1262,8 +1268,7 @@ void cmGlobalGenerator::SetLanguageEnabledMaps(const std::string& l, void cmGlobalGenerator::FillExtensionToLanguageMap(const std::string& l, cmMakefile* mf) { - std::string extensionsVar = std::string("CMAKE_") + std::string(l) + - std::string("_SOURCE_FILE_EXTENSIONS"); + std::string extensionsVar = cmStrCat("CMAKE_", l, "_SOURCE_FILE_EXTENSIONS"); const std::string& exts = mf->GetSafeDefinition(extensionsVar); cmList extensionList{ exts }; for (std::string const& i : extensionList) { @@ -1886,7 +1891,7 @@ void cmGlobalGenerator::FinalizeTargetConfiguration() std::set<std::string> standardIncludesSet; for (std::string const& li : langs) { std::string const standardIncludesVar = - "CMAKE_" + li + "_STANDARD_INCLUDE_DIRECTORIES"; + cmStrCat("CMAKE_", li, "_STANDARD_INCLUDE_DIRECTORIES"); std::string const& standardIncludesStr = mf->GetSafeDefinition(standardIncludesVar); cmList standardIncludesList{ standardIncludesStr }; @@ -2017,13 +2022,14 @@ void cmGlobalGenerator::CheckTargetProperties() for (auto const& notFound : notFoundMap) { notFoundVars += notFound.first; notFoundVars += notFound.second; - notFoundVars += "\n"; + notFoundVars += '\n'; } - cmSystemTools::Error("The following variables are used in this project, " - "but they are set to NOTFOUND.\n" - "Please set them or make sure they are set and " - "tested correctly in the CMake files:\n" + - notFoundVars); + cmSystemTools::Error( + cmStrCat("The following variables are used in this project, " + "but they are set to NOTFOUND.\n" + "Please set them or make sure they are set and " + "tested correctly in the CMake files:\n", + notFoundVars)); } } @@ -2181,8 +2187,8 @@ int cmGlobalGenerator::Build( outputflag, timeout)) { cmSystemTools::SetRunCommandHideConsole(hideconsole); cmSystemTools::Error( - "Generator: execution of make failed. Make command was: " + - makeCommandStr); + cmStrCat("Generator: execution of make failed. Make command was: ", + makeCommandStr)); ostr << *outputPtr << "\nGenerator: execution of make failed. Make command was: " << outputMakeCommandStr << std::endl; @@ -3342,7 +3348,7 @@ void cmGlobalGenerator::WriteSummary(cmGeneratorTarget* target) // Place the labels file in a per-target support directory. std::string dir = target->GetSupportDirectory(); std::string file = cmStrCat(dir, "/Labels.txt"); - std::string json_file = dir + "/Labels.json"; + std::string json_file = cmStrCat(dir, "/Labels.json"); #ifndef CMAKE_BOOTSTRAP // Check whether labels are enabled for this target. diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index 9aefaff..563ebb6 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -19,18 +19,16 @@ #include <cmext/algorithm> #include <cmext/string_view> -#include "cm_codecvt.hxx" - #include "cmBuildOptions.h" #include "cmCustomCommandLines.h" #include "cmDuration.h" #include "cmExportSet.h" +#include "cmLocalGenerator.h" #include "cmStateSnapshot.h" #include "cmStringAlgorithms.h" #include "cmSystemTools.h" #include "cmTarget.h" #include "cmTargetDepend.h" -#include "cmTransformDepfile.h" #include "cmValue.h" #if !defined(CMAKE_BOOTSTRAP) @@ -41,13 +39,15 @@ #define CMAKE_DIRECTORY_ID_SEP "::@" +enum class cmDepfileFormat; +enum class codecvt_Encoding; + class cmDirectoryId; class cmExportBuildFileGenerator; class cmExternalMakefileProjectGenerator; class cmGeneratorTarget; class cmInstallRuntimeDependencySet; class cmLinkLineComputer; -class cmLocalGenerator; class cmMakefile; class cmOutputConverter; class cmQtAutoGenGlobalInitializer; @@ -120,10 +120,7 @@ public: } /** Get encoding used by generator for makefile files */ - virtual codecvt::Encoding GetMakefileEncoding() const - { - return codecvt::None; - } + virtual codecvt_Encoding GetMakefileEncoding() const; #if !defined(CMAKE_BOOTSTRAP) /** Get a JSON object describing the generator. */ @@ -161,6 +158,8 @@ public: virtual bool CheckCxxModuleSupport() { return false; } + virtual bool IsGNUMakeJobServerAware() const { return false; } + bool Compute(); virtual void AddExtraIDETargets() {} @@ -640,6 +639,8 @@ public: }; StripCommandStyle GetStripCommandStyle(std::string const& strip); + virtual std::string& EncodeLiteral(std::string& lit) { return lit; } + protected: // for a project collect all its targets by following depend // information, and also collect all the targets diff --git a/Source/cmGlobalJOMMakefileGenerator.h b/Source/cmGlobalJOMMakefileGenerator.h index 5e74875..cd3ed33 100644 --- a/Source/cmGlobalJOMMakefileGenerator.h +++ b/Source/cmGlobalJOMMakefileGenerator.h @@ -47,6 +47,8 @@ public: void EnableLanguage(std::vector<std::string> const& languages, cmMakefile*, bool optional) override; + bool IsGNUMakeJobServerAware() const override { return false; } + protected: std::vector<GeneratedMakeCommand> GenerateBuildCommand( const std::string& makeProgram, const std::string& projectName, diff --git a/Source/cmGlobalNMakeMakefileGenerator.h b/Source/cmGlobalNMakeMakefileGenerator.h index 436ebca..eafab83 100644 --- a/Source/cmGlobalNMakeMakefileGenerator.h +++ b/Source/cmGlobalNMakeMakefileGenerator.h @@ -7,7 +7,7 @@ #include <string> #include <vector> -#include "cm_codecvt.hxx" +#include "cm_codecvt_Encoding.hxx" #include "cmGlobalGeneratorFactory.h" #include "cmGlobalUnixMakefileGenerator3.h" @@ -38,9 +38,10 @@ public: static std::string GetActualName() { return "NMake Makefiles"; } /** Get encoding used by generator for makefile files */ - codecvt::Encoding GetMakefileEncoding() const override + codecvt_Encoding GetMakefileEncoding() const override { - return this->NMakeSupportsUTF8 ? codecvt::UTF8_WITH_BOM : codecvt::ANSI; + return this->NMakeSupportsUTF8 ? codecvt_Encoding::UTF8_WITH_BOM + : codecvt_Encoding::ANSI; } /** Get the documentation entry for this generator. */ @@ -53,6 +54,8 @@ public: void EnableLanguage(std::vector<std::string> const& languages, cmMakefile*, bool optional) override; + bool IsGNUMakeJobServerAware() const override { return false; } + protected: std::vector<GeneratedMakeCommand> GenerateBuildCommand( const std::string& makeProgram, const std::string& projectName, diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 97c9b70..9ca1b2e 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -8,6 +8,7 @@ #include <cstdio> #include <functional> #include <sstream> +#include <type_traits> #include <utility> #include <cm/iterator> @@ -181,14 +182,13 @@ std::string cmGlobalNinjaGenerator::EncodeRuleName(std::string const& name) return encoded; } -std::string cmGlobalNinjaGenerator::EncodeLiteral(const std::string& lit) +std::string cmGlobalNinjaGenerator::GetEncodedLiteral(const std::string& lit) { std::string result = lit; - EncodeLiteralInplace(result); - return result; + return this->EncodeLiteral(result); } -void cmGlobalNinjaGenerator::EncodeLiteralInplace(std::string& lit) +std::string& cmGlobalNinjaGenerator::EncodeLiteral(std::string& lit) { cmSystemTools::ReplaceString(lit, "$", "$$"); cmSystemTools::ReplaceString(lit, "\n", "$\n"); @@ -196,6 +196,7 @@ void cmGlobalNinjaGenerator::EncodeLiteralInplace(std::string& lit) cmSystemTools::ReplaceString(lit, cmStrCat('$', this->GetCMakeCFGIntDir()), this->GetCMakeCFGIntDir()); } + return lit; } std::string cmGlobalNinjaGenerator::EncodePath(const std::string& path) @@ -207,7 +208,7 @@ std::string cmGlobalNinjaGenerator::EncodePath(const std::string& path) else std::replace(result.begin(), result.end(), '/', '\\'); #endif - this->EncodeLiteralInplace(result); + this->EncodeLiteral(result); cmSystemTools::ReplaceString(result, " ", "$ "); cmSystemTools::ReplaceString(result, ":", "$:"); return result; @@ -394,7 +395,7 @@ void cmGlobalNinjaGenerator::WriteCustomCommandBuild( #endif vars["COMMAND"] = std::move(cmd); } - vars["DESC"] = this->EncodeLiteral(description); + vars["DESC"] = this->GetEncodedLiteral(description); if (restat) { vars["restat"] = "1"; } @@ -566,7 +567,7 @@ std::unique_ptr<cmLocalGenerator> cmGlobalNinjaGenerator::CreateLocalGenerator( cm::make_unique<cmLocalNinjaGenerator>(this, mf)); } -codecvt::Encoding cmGlobalNinjaGenerator::GetMakefileEncoding() const +codecvt_Encoding cmGlobalNinjaGenerator::GetMakefileEncoding() const { return this->NinjaExpectedEncoding; } @@ -799,7 +800,7 @@ void cmGlobalNinjaGenerator::CheckNinjaFeatures() if (this->NinjaSupportsCodePage) { this->CheckNinjaCodePage(); } else { - this->NinjaExpectedEncoding = codecvt::ANSI; + this->NinjaExpectedEncoding = codecvt_Encoding::ANSI; } #endif } @@ -830,9 +831,9 @@ void cmGlobalNinjaGenerator::CheckNinjaCodePage() lineView.substr(cmStrLen("Build file encoding: ")); if (encoding == "UTF-8") { // Ninja expects UTF-8. We use that internally. No conversion needed. - this->NinjaExpectedEncoding = codecvt::None; + this->NinjaExpectedEncoding = codecvt_Encoding::None; } else { - this->NinjaExpectedEncoding = codecvt::ANSI; + this->NinjaExpectedEncoding = codecvt_Encoding::ANSI; } found = true; break; @@ -842,10 +843,10 @@ void cmGlobalNinjaGenerator::CheckNinjaCodePage() this->GetCMakeInstance()->IssueMessage( MessageType::WARNING, "Could not determine Ninja's code page, defaulting to UTF-8"); - this->NinjaExpectedEncoding = codecvt::None; + this->NinjaExpectedEncoding = codecvt_Encoding::None; } } else { - this->NinjaExpectedEncoding = codecvt::ANSI; + this->NinjaExpectedEncoding = codecvt_Encoding::ANSI; } } diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h index bfbe57f..4b026eb 100644 --- a/Source/cmGlobalNinjaGenerator.h +++ b/Source/cmGlobalNinjaGenerator.h @@ -16,7 +16,7 @@ #include <cm/optional> -#include "cm_codecvt.hxx" +#include "cm_codecvt_Encoding.hxx" #include "cmBuildOptions.h" #include "cmGeneratedFileStream.h" @@ -77,8 +77,8 @@ public: static void WriteDivider(std::ostream& os); static std::string EncodeRuleName(std::string const& name); - std::string EncodeLiteral(const std::string& lit); - void EncodeLiteralInplace(std::string& lit); + std::string& EncodeLiteral(std::string& lit) override; + std::string GetEncodedLiteral(const std::string& lit); std::string EncodePath(const std::string& path); std::unique_ptr<cmLinkLineComputer> CreateLinkLineComputer( @@ -192,7 +192,7 @@ public: bool IsNinja() const override { return true; } /** Get encoding used by generator for ninja files */ - codecvt::Encoding GetMakefileEncoding() const override; + codecvt_Encoding GetMakefileEncoding() const override; static cmDocumentationEntry GetDocumentation(); @@ -590,7 +590,7 @@ private: bool NinjaSupportsMetadataOnRegeneration = false; bool NinjaSupportsCodePage = false; - codecvt::Encoding NinjaExpectedEncoding = codecvt::None; + codecvt_Encoding NinjaExpectedEncoding = codecvt_Encoding::None; bool DiagnosedCxxModuleNinjaSupport = false; diff --git a/Source/cmGlobalUnixMakefileGenerator3.h b/Source/cmGlobalUnixMakefileGenerator3.h index 760679a..ee78351 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.h +++ b/Source/cmGlobalUnixMakefileGenerator3.h @@ -120,6 +120,8 @@ public: void Configure() override; + bool IsGNUMakeJobServerAware() const override { return true; } + /** * Generate the all required files for building this project/tree. This * basically creates a series of LocalGenerators for each directory and diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx index 321f377..f1d04e5 100644 --- a/Source/cmGlobalVisualStudio10Generator.cxx +++ b/Source/cmGlobalVisualStudio10Generator.cxx @@ -1230,7 +1230,6 @@ const char* cmGlobalVisualStudio10Generator::GetToolsVersion() const { switch (this->Version) { case cmGlobalVisualStudioGenerator::VSVersion::VS9: - case cmGlobalVisualStudioGenerator::VSVersion::VS11: return "4.0"; // in Visual Studio 2013 they detached the MSBuild tools version diff --git a/Source/cmGlobalVisualStudio11Generator.cxx b/Source/cmGlobalVisualStudio11Generator.cxx index 3ad10eb..c4e1e11 100644 --- a/Source/cmGlobalVisualStudio11Generator.cxx +++ b/Source/cmGlobalVisualStudio11Generator.cxx @@ -8,156 +8,17 @@ #include <vector> #include "cmGlobalGenerator.h" -#include "cmGlobalGeneratorFactory.h" #include "cmGlobalVisualStudioGenerator.h" #include "cmMakefile.h" #include "cmMessageType.h" #include "cmStringAlgorithms.h" #include "cmSystemTools.h" -static const char vs11generatorName[] = "Visual Studio 11 2012"; - -// Map generator name without year to name with year. -static const char* cmVS11GenName(const std::string& name, std::string& genName) -{ - if (strncmp(name.c_str(), vs11generatorName, - sizeof(vs11generatorName) - 6) != 0) { - return nullptr; - } - const char* p = name.c_str() + sizeof(vs11generatorName) - 6; - if (cmHasLiteralPrefix(p, " 2012")) { - p += 5; - } - genName = std::string(vs11generatorName) + p; - return p; -} - -class cmGlobalVisualStudio11Generator::Factory - : public cmGlobalGeneratorFactory -{ -public: - std::unique_ptr<cmGlobalGenerator> CreateGlobalGenerator( - const std::string& name, bool allowArch, cmake* cm) const override - { - std::string genName; - const char* p = cmVS11GenName(name, genName); - if (!p) { - return std::unique_ptr<cmGlobalGenerator>(); - } - if (!*p) { - return std::unique_ptr<cmGlobalGenerator>( - new cmGlobalVisualStudio11Generator(cm, genName, "")); - } - if (!allowArch || *p++ != ' ') { - return std::unique_ptr<cmGlobalGenerator>(); - } - if (strcmp(p, "Win64") == 0) { - return std::unique_ptr<cmGlobalGenerator>( - new cmGlobalVisualStudio11Generator(cm, genName, "x64")); - } - if (strcmp(p, "ARM") == 0) { - return std::unique_ptr<cmGlobalGenerator>( - new cmGlobalVisualStudio11Generator(cm, genName, "ARM")); - } - - std::set<std::string> installedSDKs = - cmGlobalVisualStudio11Generator::GetInstalledWindowsCESDKs(); - - if (installedSDKs.find(p) == installedSDKs.end()) { - return std::unique_ptr<cmGlobalGenerator>(); - } - - auto ret = std::unique_ptr<cmGlobalVisualStudio11Generator>( - new cmGlobalVisualStudio11Generator(cm, name, p)); - ret->WindowsCEVersion = "8.00"; - return std::unique_ptr<cmGlobalGenerator>(std::move(ret)); - } - - cmDocumentationEntry GetDocumentation() const override - { - return { std::string(vs11generatorName) + " [arch]", - "Deprecated. Generates Visual Studio 2012 project files. " - "Optional [arch] can be \"Win64\" or \"ARM\"." }; - } - - std::vector<std::string> GetGeneratorNames() const override - { - std::vector<std::string> names; - names.push_back(vs11generatorName); - return names; - } - - std::vector<std::string> GetGeneratorNamesWithPlatform() const override - { - std::vector<std::string> names; - names.push_back(vs11generatorName + std::string(" ARM")); - names.push_back(vs11generatorName + std::string(" Win64")); - - std::set<std::string> installedSDKs = - cmGlobalVisualStudio11Generator::GetInstalledWindowsCESDKs(); - for (std::string const& i : installedSDKs) { - names.push_back(std::string(vs11generatorName) + " " + i); - } - - return names; - } - - bool SupportsToolset() const override { return true; } - bool SupportsPlatform() const override { return true; } - - std::vector<std::string> GetKnownPlatforms() const override - { - std::vector<std::string> platforms; - platforms.emplace_back("x64"); - platforms.emplace_back("Win32"); - platforms.emplace_back("ARM"); - - std::set<std::string> installedSDKs = - cmGlobalVisualStudio11Generator::GetInstalledWindowsCESDKs(); - for (std::string const& i : installedSDKs) { - platforms.emplace_back(i); - } - - return platforms; - } - - std::string GetDefaultPlatformName() const override { return "Win32"; } -}; - -std::unique_ptr<cmGlobalGeneratorFactory> -cmGlobalVisualStudio11Generator::NewFactory() -{ - return std::unique_ptr<cmGlobalGeneratorFactory>(new Factory); -} - cmGlobalVisualStudio11Generator::cmGlobalVisualStudio11Generator( cmake* cm, const std::string& name, std::string const& platformInGeneratorName) : cmGlobalVisualStudio10Generator(cm, name, platformInGeneratorName) { - std::string vc11Express; - this->ExpressEdition = cmSystemTools::ReadRegistryValue( - "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\11.0\\Setup\\VC;" - "ProductDir", - vc11Express, cmSystemTools::KeyWOW64_32); - this->DefaultPlatformToolset = "v110"; - this->DefaultCLFlagTableName = "v11"; - this->DefaultCSharpFlagTableName = "v11"; - this->DefaultLibFlagTableName = "v11"; - this->DefaultLinkFlagTableName = "v11"; - this->DefaultMasmFlagTableName = "v11"; - this->DefaultRCFlagTableName = "v11"; - this->Version = VSVersion::VS11; -} - -bool cmGlobalVisualStudio11Generator::MatchesGeneratorName( - const std::string& name) const -{ - std::string genName; - if (cmVS11GenName(name, genName)) { - return genName == this->GetName(); - } - return false; } void cmGlobalVisualStudio11Generator::EnableLanguage( diff --git a/Source/cmGlobalVisualStudio11Generator.h b/Source/cmGlobalVisualStudio11Generator.h index fd25984..ad12c1f 100644 --- a/Source/cmGlobalVisualStudio11Generator.h +++ b/Source/cmGlobalVisualStudio11Generator.h @@ -13,7 +13,6 @@ #include "cmGlobalVisualStudio10Generator.h" #include "cmTransformDepfile.h" -class cmGlobalGeneratorFactory; class cmMakefile; class cmake; @@ -21,10 +20,6 @@ class cmake; class cmGlobalVisualStudio11Generator : public cmGlobalVisualStudio10Generator { public: - static std::unique_ptr<cmGlobalGeneratorFactory> NewFactory(); - - bool MatchesGeneratorName(const std::string& name) const override; - void EnableLanguage(std::vector<std::string> const& languages, cmMakefile*, bool optional) override; @@ -58,8 +53,4 @@ protected: /** Return true if target system supports debugging deployment. */ bool TargetSystemSupportsDeployment() const override; - -private: - class Factory; - friend class Factory; }; diff --git a/Source/cmGlobalVisualStudio12Generator.cxx b/Source/cmGlobalVisualStudio12Generator.cxx index d417f9e..b7af31b 100644 --- a/Source/cmGlobalVisualStudio12Generator.cxx +++ b/Source/cmGlobalVisualStudio12Generator.cxx @@ -64,7 +64,7 @@ public: cmDocumentationEntry GetDocumentation() const override { return { std::string(vs12generatorName) + " [arch]", - "Generates Visual Studio 2013 project files. " + "Deprecated. Generates Visual Studio 2013 project files. " "Optional [arch] can be \"Win64\" or \"ARM\"." }; } diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx index b254777..203bb09 100644 --- a/Source/cmGlobalVisualStudio7Generator.cxx +++ b/Source/cmGlobalVisualStudio7Generator.cxx @@ -330,23 +330,23 @@ void cmGlobalVisualStudio7Generator::Generate() } } - if (this->Version == VSVersion::VS11 && + if (this->Version == VSVersion::VS12 && !this->CMakeInstance->GetIsInTryCompile()) { - std::string cmakeWarnVS11; + std::string cmakeWarnVS12; if (cmValue cached = this->CMakeInstance->GetState()->GetCacheEntryValue( - "CMAKE_WARN_VS11")) { - this->CMakeInstance->MarkCliAsUsed("CMAKE_WARN_VS11"); - cmakeWarnVS11 = *cached; + "CMAKE_WARN_VS12")) { + this->CMakeInstance->MarkCliAsUsed("CMAKE_WARN_VS12"); + cmakeWarnVS12 = *cached; } else { - cmSystemTools::GetEnv("CMAKE_WARN_VS11", cmakeWarnVS11); + cmSystemTools::GetEnv("CMAKE_WARN_VS12", cmakeWarnVS12); } - if (cmakeWarnVS11.empty() || !cmIsOff(cmakeWarnVS11)) { + if (cmakeWarnVS12.empty() || !cmIsOff(cmakeWarnVS12)) { this->CMakeInstance->IssueMessage( MessageType::WARNING, - "The \"Visual Studio 11 2012\" generator is deprecated " + "The \"Visual Studio 12 2013\" generator is deprecated " "and will be removed in a future version of CMake." "\n" - "Add CMAKE_WARN_VS11=OFF to the cache to disable this warning."); + "Add CMAKE_WARN_VS12=OFF to the cache to disable this warning."); } } } diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx index 6b024db..4d7571a 100644 --- a/Source/cmGlobalVisualStudioGenerator.cxx +++ b/Source/cmGlobalVisualStudioGenerator.cxx @@ -105,8 +105,6 @@ const char* cmGlobalVisualStudioGenerator::GetIDEVersion() const switch (this->Version) { case cmGlobalVisualStudioGenerator::VSVersion::VS9: return "9.0"; - case cmGlobalVisualStudioGenerator::VSVersion::VS11: - return "11.0"; case cmGlobalVisualStudioGenerator::VSVersion::VS12: return "12.0"; case cmGlobalVisualStudioGenerator::VSVersion::VS14: @@ -132,14 +130,6 @@ void cmGlobalVisualStudioGenerator::WriteSLNHeader(std::ostream& fout) fout << "Microsoft Visual Studio Solution File, Format Version 10.00\n"; fout << "# Visual Studio 2008\n"; break; - case cmGlobalVisualStudioGenerator::VSVersion::VS11: - fout << "Microsoft Visual Studio Solution File, Format Version 12.00\n"; - if (this->ExpressEdition) { - fout << "# Visual Studio Express 2012 for Windows Desktop\n"; - } else { - fout << "# Visual Studio 2012\n"; - } - break; case cmGlobalVisualStudioGenerator::VSVersion::VS12: fout << "Microsoft Visual Studio Solution File, Format Version 12.00\n"; if (this->ExpressEdition) { diff --git a/Source/cmGlobalVisualStudioGenerator.h b/Source/cmGlobalVisualStudioGenerator.h index 52db98d..76713fa 100644 --- a/Source/cmGlobalVisualStudioGenerator.h +++ b/Source/cmGlobalVisualStudioGenerator.h @@ -10,7 +10,7 @@ #include <string> #include <vector> -#include "cm_codecvt.hxx" +#include "cm_codecvt_Encoding.hxx" #include "cmGlobalGenerator.h" #include "cmTargetDepend.h" @@ -35,7 +35,6 @@ public: enum class VSVersion : uint16_t { VS9 = 90, - VS11 = 110, VS12 = 120, /* VS13 = 130 was skipped */ VS14 = 140, @@ -120,9 +119,9 @@ public: /** Get encoding used by generator for generated source files */ - codecvt::Encoding GetMakefileEncoding() const override + codecvt_Encoding GetMakefileEncoding() const override { - return codecvt::ANSI; + return codecvt_Encoding::ANSI; } class TargetSet : public std::set<cmGeneratorTarget const*> diff --git a/Source/cmGlobalVisualStudioVersionedGenerator.cxx b/Source/cmGlobalVisualStudioVersionedGenerator.cxx index 602b42f..9fe66d3 100644 --- a/Source/cmGlobalVisualStudioVersionedGenerator.cxx +++ b/Source/cmGlobalVisualStudioVersionedGenerator.cxx @@ -127,8 +127,6 @@ static unsigned int VSVersionToMajor( switch (v) { case cmGlobalVisualStudioGenerator::VSVersion::VS9: return 9; - case cmGlobalVisualStudioGenerator::VSVersion::VS11: - return 11; case cmGlobalVisualStudioGenerator::VSVersion::VS12: return 12; case cmGlobalVisualStudioGenerator::VSVersion::VS14: @@ -149,8 +147,6 @@ static const char* VSVersionToToolset( switch (v) { case cmGlobalVisualStudioGenerator::VSVersion::VS9: return "v90"; - case cmGlobalVisualStudioGenerator::VSVersion::VS11: - return "v110"; case cmGlobalVisualStudioGenerator::VSVersion::VS12: return "v120"; case cmGlobalVisualStudioGenerator::VSVersion::VS14: @@ -171,8 +167,6 @@ static std::string VSVersionToMajorString( switch (v) { case cmGlobalVisualStudioGenerator::VSVersion::VS9: return "9"; - case cmGlobalVisualStudioGenerator::VSVersion::VS11: - return "11"; case cmGlobalVisualStudioGenerator::VSVersion::VS12: return "12"; case cmGlobalVisualStudioGenerator::VSVersion::VS14: @@ -192,7 +186,6 @@ static const char* VSVersionToAndroidToolset( { switch (v) { case cmGlobalVisualStudioGenerator::VSVersion::VS9: - case cmGlobalVisualStudioGenerator::VSVersion::VS11: case cmGlobalVisualStudioGenerator::VSVersion::VS12: return ""; case cmGlobalVisualStudioGenerator::VSVersion::VS14: @@ -493,7 +486,6 @@ bool cmGlobalVisualStudioVersionedGenerator::MatchesGeneratorName( std::string genName; switch (this->Version) { case cmGlobalVisualStudioGenerator::VSVersion::VS9: - case cmGlobalVisualStudioGenerator::VSVersion::VS11: case cmGlobalVisualStudioGenerator::VSVersion::VS12: case cmGlobalVisualStudioGenerator::VSVersion::VS14: break; @@ -761,7 +753,6 @@ cmGlobalVisualStudioVersionedGenerator::GetAndroidApplicationTypeRevision() { switch (this->Version) { case cmGlobalVisualStudioGenerator::VSVersion::VS9: - case cmGlobalVisualStudioGenerator::VSVersion::VS11: case cmGlobalVisualStudioGenerator::VSVersion::VS12: return ""; case cmGlobalVisualStudioGenerator::VSVersion::VS14: diff --git a/Source/cmGlobalWatcomWMakeGenerator.h b/Source/cmGlobalWatcomWMakeGenerator.h index 5579120..8b24679 100644 --- a/Source/cmGlobalWatcomWMakeGenerator.h +++ b/Source/cmGlobalWatcomWMakeGenerator.h @@ -53,6 +53,8 @@ public: bool AllowNotParallel() const override { return false; } bool AllowDeleteOnError() const override { return false; } + bool IsGNUMakeJobServerAware() const override { return false; } + protected: std::vector<GeneratedMakeCommand> GenerateBuildCommand( const std::string& makeProgram, const std::string& projectName, diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index fd58f75..247d4fc 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -53,6 +53,7 @@ #include "cmXCodeObject.h" #include "cmXCodeScheme.h" #include "cmXMLWriter.h" +#include "cmXcFramework.h" #include "cmake.h" #if !defined(CMAKE_BOOTSTRAP) && defined(__APPLE__) @@ -1061,12 +1062,14 @@ bool IsLinkPhaseLibraryExtension(const std::string& fileExt) { // Empty file extension is a special case for paths to framework's // internal binary which could be MyFw.framework/Versions/*/MyFw - return (fileExt == ".framework" || fileExt == ".a" || fileExt == ".o" || - fileExt == ".dylib" || fileExt == ".tbd" || fileExt.empty()); + return (fileExt == ".framework" || fileExt == ".xcframework" || + fileExt == ".a" || fileExt == ".o" || fileExt == ".dylib" || + fileExt == ".tbd" || fileExt.empty()); } bool IsLibraryType(const std::string& fileType) { - return (fileType == "wrapper.framework" || fileType == "archive.ar" || + return (fileType == "wrapper.framework" || + fileType == "wrapper.xcframework" || fileType == "archive.ar" || fileType == "compiled.mach-o.objfile" || fileType == "compiled.mach-o.dylib" || fileType == "compiled.mach-o.executable" || @@ -1079,6 +1082,9 @@ std::string GetDirectoryValueFromFileExtension(const std::string& dirExt) if (ext == "framework") { return "wrapper.framework"; } + if (ext == "xcframework") { + return "wrapper.xcframework"; + } if (ext == "xcassets") { return "folder.assetcatalog"; } @@ -3607,6 +3613,8 @@ void cmGlobalXCodeGenerator::AddDependAndLinkInformation(cmXCodeObject* target) bool canUseLinkPhase = !libItem.HasFeature() || libItem.GetFeatureName() == "__CMAKE_LINK_FRAMEWORK"_s || libItem.GetFeatureName() == "FRAMEWORK"_s || + libItem.GetFeatureName() == "__CMAKE_LINK_XCFRAMEWORK"_s || + libItem.GetFeatureName() == "XCFRAMEWORK"_s || libItem.GetFeatureName() == "WEAK_FRAMEWORK"_s || libItem.GetFeatureName() == "WEAK_LIBRARY"_s; if (canUseLinkPhase) { @@ -3917,12 +3925,14 @@ void cmGlobalXCodeGenerator::AddDependAndLinkInformation(cmXCodeObject* target) if (cmSystemTools::FileIsFullPath(cleanPath)) { cleanPath = cmSystemTools::CollapseFullPath(cleanPath); } - bool isFramework = + bool isXcFramework = + cmHasSuffix(libName.GetFeatureName(), "XCFRAMEWORK"_s); + bool isFramework = !isXcFramework && cmHasSuffix(libName.GetFeatureName(), "FRAMEWORK"_s); if (isFramework) { const auto fwDescriptor = this->SplitFrameworkPath( cleanPath, cmGlobalGenerator::FrameworkFormat::Extended); - if (!fwDescriptor->Directory.empty() && + if (isFramework && !fwDescriptor->Directory.empty() && emitted.insert(fwDescriptor->Directory).second) { // This is a search path we had not added before and it isn't // an implicit search path, so we need it @@ -3940,13 +3950,54 @@ void cmGlobalXCodeGenerator::AddDependAndLinkInformation(cmXCodeObject* target) fwDescriptor->GetLinkName())) .Value); } + } else if (isXcFramework) { + auto plist = cmParseXcFrameworkPlist( + cleanPath, *this->Makefiles.front(), libName.Value.Backtrace); + if (!plist) { + return; + } + if (auto const* library = plist->SelectSuitableLibrary( + *this->Makefiles.front(), libName.Value.Backtrace)) { + auto libraryPath = + cmStrCat(cleanPath, '/', library->LibraryIdentifier, '/', + library->LibraryPath); + if (auto const fwDescriptor = this->SplitFrameworkPath( + libraryPath, + cmGlobalGenerator::FrameworkFormat::Relaxed)) { + if (!fwDescriptor->Directory.empty() && + emitted.insert(fwDescriptor->Directory).second) { + // This is a search path we had not added before and it + // isn't an implicit search path, so we need it + fwSearchPaths.Add( + this->XCodeEscapePath(fwDescriptor->Directory)); + } + libPaths.Add(cmStrCat( + "-framework ", + this->XCodeEscapePath(fwDescriptor->GetLinkName()))); + } else { + libPaths.Add( + libName.GetFormattedItem(this->XCodeEscapePath(libraryPath)) + .Value); + if (!library->HeadersPath.empty()) { + this->AppendBuildSettingAttribute( + target, "HEADER_SEARCH_PATHS", + this->CreateString(this->XCodeEscapePath( + cmStrCat(cleanPath, '/', library->LibraryIdentifier, '/', + library->HeadersPath))), + configName); + } + } + } else { + return; + } } else { libPaths.Add( libName.GetFormattedItem(this->XCodeEscapePath(cleanPath)) .Value); } if ((!libName.Target || libName.Target->IsImported()) && - (isFramework || IsLinkPhaseLibraryExtension(cleanPath))) { + (isFramework || isXcFramework || + IsLinkPhaseLibraryExtension(cleanPath))) { // Create file reference for embedding auto it = this->ExternalLibRefs.find(cleanPath); if (it == this->ExternalLibRefs.end()) { @@ -5155,6 +5206,10 @@ std::string cmGlobalXCodeGenerator::GetDeploymentPlatform(const cmMakefile* mf) case cmMakefile::AppleSDK::WatchSimulator: return "WATCHOS_DEPLOYMENT_TARGET"; + case cmMakefile::AppleSDK::XROS: + case cmMakefile::AppleSDK::XRSimulator: + return "XROS_DEPLOYMENT_TARGET"; + case cmMakefile::AppleSDK::MacOS: default: return "MACOSX_DEPLOYMENT_TARGET"; diff --git a/Source/cmInstallCxxModuleBmiGenerator.cxx b/Source/cmInstallCxxModuleBmiGenerator.cxx index 1ef1eaa..111691e 100644 --- a/Source/cmInstallCxxModuleBmiGenerator.cxx +++ b/Source/cmInstallCxxModuleBmiGenerator.cxx @@ -11,6 +11,7 @@ #include "cmListFileCache.h" #include "cmLocalGenerator.h" #include "cmOutputConverter.h" +#include "cmScriptGenerator.h" #include "cmStringAlgorithms.h" cmInstallCxxModuleBmiGenerator::cmInstallCxxModuleBmiGenerator( diff --git a/Source/cmInstallCxxModuleBmiGenerator.h b/Source/cmInstallCxxModuleBmiGenerator.h index 21edb2e..23ed02e 100644 --- a/Source/cmInstallCxxModuleBmiGenerator.h +++ b/Source/cmInstallCxxModuleBmiGenerator.h @@ -9,7 +9,6 @@ #include <vector> #include "cmInstallGenerator.h" -#include "cmScriptGenerator.h" class cmGeneratorTarget; class cmListFileBacktrace; diff --git a/Source/cmInstallDirectoryGenerator.h b/Source/cmInstallDirectoryGenerator.h index 7deb9ba..96a924f 100644 --- a/Source/cmInstallDirectoryGenerator.h +++ b/Source/cmInstallDirectoryGenerator.h @@ -9,7 +9,6 @@ #include <vector> #include "cmInstallGenerator.h" -#include "cmScriptGenerator.h" class cmListFileBacktrace; class cmLocalGenerator; diff --git a/Source/cmInstallExportGenerator.cxx b/Source/cmInstallExportGenerator.cxx index 1d81b0b..32196d3 100644 --- a/Source/cmInstallExportGenerator.cxx +++ b/Source/cmInstallExportGenerator.cxx @@ -16,6 +16,7 @@ #include "cmInstallType.h" #include "cmListFileCache.h" #include "cmLocalGenerator.h" +#include "cmScriptGenerator.h" #include "cmStringAlgorithms.h" #include "cmSystemTools.h" diff --git a/Source/cmInstallExportGenerator.h b/Source/cmInstallExportGenerator.h index 346ca67..f2d4a05 100644 --- a/Source/cmInstallExportGenerator.h +++ b/Source/cmInstallExportGenerator.h @@ -10,7 +10,6 @@ #include <vector> #include "cmInstallGenerator.h" -#include "cmScriptGenerator.h" class cmExportInstallFileGenerator; class cmExportSet; diff --git a/Source/cmInstallFileSetGenerator.h b/Source/cmInstallFileSetGenerator.h index 56341d4..708cee6 100644 --- a/Source/cmInstallFileSetGenerator.h +++ b/Source/cmInstallFileSetGenerator.h @@ -8,7 +8,6 @@ #include <vector> #include "cmInstallGenerator.h" -#include "cmScriptGenerator.h" class cmGeneratorTarget; class cmFileSet; diff --git a/Source/cmInstallFilesGenerator.h b/Source/cmInstallFilesGenerator.h index 53076b3..874bde1 100644 --- a/Source/cmInstallFilesGenerator.h +++ b/Source/cmInstallFilesGenerator.h @@ -9,7 +9,6 @@ #include <vector> #include "cmInstallGenerator.h" -#include "cmScriptGenerator.h" class cmListFileBacktrace; class cmLocalGenerator; diff --git a/Source/cmInstallGetRuntimeDependenciesGenerator.cxx b/Source/cmInstallGetRuntimeDependenciesGenerator.cxx index 3e493bc..3f8a103 100644 --- a/Source/cmInstallGetRuntimeDependenciesGenerator.cxx +++ b/Source/cmInstallGetRuntimeDependenciesGenerator.cxx @@ -19,6 +19,7 @@ #include "cmLocalGenerator.h" #include "cmMakefile.h" #include "cmOutputConverter.h" +#include "cmScriptGenerator.h" #include "cmStringAlgorithms.h" namespace { diff --git a/Source/cmInstallGetRuntimeDependenciesGenerator.h b/Source/cmInstallGetRuntimeDependenciesGenerator.h index a2d6593..8e4e8cb 100644 --- a/Source/cmInstallGetRuntimeDependenciesGenerator.h +++ b/Source/cmInstallGetRuntimeDependenciesGenerator.h @@ -7,7 +7,6 @@ #include <vector> #include "cmInstallGenerator.h" -#include "cmScriptGenerator.h" class cmListFileBacktrace; class cmLocalGenerator; diff --git a/Source/cmInstallImportedRuntimeArtifactsGenerator.h b/Source/cmInstallImportedRuntimeArtifactsGenerator.h index 9e045ee..84d3fee 100644 --- a/Source/cmInstallImportedRuntimeArtifactsGenerator.h +++ b/Source/cmInstallImportedRuntimeArtifactsGenerator.h @@ -8,7 +8,6 @@ #include "cmInstallGenerator.h" #include "cmListFileCache.h" -#include "cmScriptGenerator.h" class cmGeneratorTarget; class cmLocalGenerator; diff --git a/Source/cmInstallRuntimeDependencySetGenerator.h b/Source/cmInstallRuntimeDependencySetGenerator.h index 680361b..1a3c1e4 100644 --- a/Source/cmInstallRuntimeDependencySetGenerator.h +++ b/Source/cmInstallRuntimeDependencySetGenerator.h @@ -7,7 +7,6 @@ #include <vector> #include "cmInstallGenerator.h" -#include "cmScriptGenerator.h" class cmInstallRuntimeDependencySet; class cmListFileBacktrace; diff --git a/Source/cmInstallScriptGenerator.h b/Source/cmInstallScriptGenerator.h index c3a7058..012a4a3 100644 --- a/Source/cmInstallScriptGenerator.h +++ b/Source/cmInstallScriptGenerator.h @@ -9,7 +9,6 @@ #include "cmInstallGenerator.h" #include "cmListFileCache.h" -#include "cmScriptGenerator.h" class cmLocalGenerator; diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx index 3ac100d..e7998ea 100644 --- a/Source/cmInstallTargetGenerator.cxx +++ b/Source/cmInstallTargetGenerator.cxx @@ -23,6 +23,7 @@ #include "cmMessageType.h" #include "cmOutputConverter.h" #include "cmPolicies.h" +#include "cmScriptGenerator.h" #include "cmStateTypes.h" #include "cmStringAlgorithms.h" #include "cmSystemTools.h" diff --git a/Source/cmInstallTargetGenerator.h b/Source/cmInstallTargetGenerator.h index 2f41163..11a3264 100644 --- a/Source/cmInstallTargetGenerator.h +++ b/Source/cmInstallTargetGenerator.h @@ -11,7 +11,6 @@ #include "cmInstallGenerator.h" #include "cmInstallType.h" #include "cmListFileCache.h" -#include "cmScriptGenerator.h" class cmGeneratorTarget; class cmLocalGenerator; diff --git a/Source/cmInstalledFile.h b/Source/cmInstalledFile.h index 373c349..e0d7647 100644 --- a/Source/cmInstalledFile.h +++ b/Source/cmInstalledFile.h @@ -9,7 +9,8 @@ #include <string> #include <vector> -class cmCompiledGeneratorExpression; +#include "cmGeneratorExpression.h" + class cmMakefile; /** \class cmInstalledFile diff --git a/Source/cmJSONHelpers.h b/Source/cmJSONHelpers.h index 94641de..5dfb154 100644 --- a/Source/cmJSONHelpers.h +++ b/Source/cmJSONHelpers.h @@ -38,7 +38,6 @@ using ObjectErrorGenerator = std::function<ErrorGenerator(ObjectError, const Json::Value::Members&)>; const auto EXPECTED_TYPE = [](const std::string& type) { return [type](const Json::Value* value, cmJSONState* state) -> void { -#if !defined(CMAKE_BOOTSTRAP) if (state->key().empty()) { state->AddErrorAtValue(cmStrCat("Expected ", type), value); return; @@ -48,7 +47,6 @@ const auto EXPECTED_TYPE = [](const std::string& type) { errMsg = cmStrCat(errMsg, ", got: ", value->asString()); } state->AddErrorAtValue(errMsg, value); -#endif }; }; const auto INVALID_STRING = [](const Json::Value* value, @@ -75,7 +73,6 @@ const auto INVALID_NAMED_OBJECT = const Json::Value::Members& extraFields) -> ErrorGenerator { return [nameGenerator, errorType, extraFields]( const Json::Value* value, cmJSONState* state) -> void { -#if !defined(CMAKE_BOOTSTRAP) std::string name = nameGenerator(value, state); switch (errorType) { case ObjectError::RequiredMissing: @@ -102,7 +99,6 @@ const auto INVALID_NAMED_OBJECT = value); break; } -#endif }; }; }; diff --git a/Source/cmJSONState.cxx b/Source/cmJSONState.cxx index 92bde77..1abdaa6 100644 --- a/Source/cmJSONState.cxx +++ b/Source/cmJSONState.cxx @@ -3,10 +3,9 @@ #include "cmJSONState.h" +#include <iterator> #include <sstream> -#include <cm/memory> - #include <cm3p/json/reader.h> #include <cm3p/json/value.h> diff --git a/Source/cmJSONState.h b/Source/cmJSONState.h index 4984c81..9071268 100644 --- a/Source/cmJSONState.h +++ b/Source/cmJSONState.h @@ -9,7 +9,6 @@ #include <utility> #include <vector> -#include "cmJSONState.h" #include "cmStringAlgorithms.h" namespace Json { diff --git a/Source/cmLDConfigLDConfigTool.cxx b/Source/cmLDConfigLDConfigTool.cxx index 0752b33..154aa27 100644 --- a/Source/cmLDConfigLDConfigTool.cxx +++ b/Source/cmLDConfigLDConfigTool.cxx @@ -14,6 +14,7 @@ #include "cmRuntimeDependencyArchive.h" #include "cmSystemTools.h" #include "cmUVProcessChain.h" +#include "cmUVStream.h" cmLDConfigLDConfigTool::cmLDConfigLDConfigTool( cmRuntimeDependencyArchive* archive) @@ -43,14 +44,15 @@ bool cmLDConfigLDConfigTool::GetLDConfigPaths(std::vector<std::string>& paths) builder.SetBuiltinStream(cmUVProcessChainBuilder::Stream_OUTPUT) .AddCommand(ldConfigCommand); auto process = builder.Start(); - if (!process.Valid()) { + if (!process.Valid() || process.GetStatus(0).SpawnResult != 0) { this->Archive->SetError("Failed to start ldconfig process"); return false; } std::string line; static const cmsys::RegularExpression regex("^([^\t:]*):"); - while (std::getline(*process.OutputStream(), line)) { + cmUVPipeIStream output(process.GetLoop(), process.OutputStream()); + while (std::getline(output, line)) { cmsys::RegularExpressionMatch match; if (regex.find(line.c_str(), match)) { paths.push_back(match.match(1)); @@ -61,8 +63,7 @@ bool cmLDConfigLDConfigTool::GetLDConfigPaths(std::vector<std::string>& paths) this->Archive->SetError("Failed to wait on ldconfig process"); return false; } - auto status = process.GetStatus(); - if (!status[0] || status[0]->ExitStatus != 0) { + if (process.GetStatus(0).ExitStatus != 0) { this->Archive->SetError("Failed to run ldconfig"); return false; } diff --git a/Source/cmLinkDirectoriesCommand.cxx b/Source/cmLinkDirectoriesCommand.cxx index 1ec071b..6775a60 100644 --- a/Source/cmLinkDirectoriesCommand.cxx +++ b/Source/cmLinkDirectoriesCommand.cxx @@ -6,6 +6,7 @@ #include "cmExecutionStatus.h" #include "cmGeneratorExpression.h" +#include "cmList.h" #include "cmMakefile.h" #include "cmMessageType.h" #include "cmPolicies.h" @@ -39,7 +40,7 @@ bool cmLinkDirectoriesCommand(std::vector<std::string> const& args, AddLinkDir(mf, *i, directories); } - mf.AddLinkDirectory(cmJoin(directories, ";"), before); + mf.AddLinkDirectory(cmList::to_string(directories), before); return true; } diff --git a/Source/cmList.cxx b/Source/cmList.cxx index 022fcd2..3835e59 100644 --- a/Source/cmList.cxx +++ b/Source/cmList.cxx @@ -19,6 +19,7 @@ #include "cmAlgorithms.h" #include "cmGeneratorExpression.h" +#include "cmListFileCache.h" #include "cmRange.h" #include "cmStringAlgorithms.h" #include "cmStringReplaceHelper.h" @@ -802,11 +803,6 @@ cmList& cmList::transform(TransformAction action, return *this; } -std::string cmList::join(cm::string_view glue) const -{ - return cmJoin(this->Values, glue); -} - std::string& cmList::append(std::string& list, cm::string_view value) { if (list.empty()) { @@ -1001,3 +997,8 @@ cmList::container_type::iterator cmList::Insert( } return container.begin() + delta; } + +std::string const& cmList::ToString(BT<std::string> const& s) +{ + return s.Value; +} diff --git a/Source/cmList.h b/Source/cmList.h index eba0400..dc5850a 100644 --- a/Source/cmList.h +++ b/Source/cmList.h @@ -22,6 +22,9 @@ #include "cmValue.h" +template <typename T> +class BT; + /** * CMake lists management * A CMake list is a string where list elements are separated by the ';' @@ -936,7 +939,10 @@ public: std::vector<std::string> const& args, std::unique_ptr<TransformSelector> = {}); - std::string join(cm::string_view glue) const; + std::string join(cm::string_view glue) const + { + return cmList::Join(this->Values, glue); + } void swap(cmList& other) noexcept { this->Values.swap(other.Values); } @@ -1092,8 +1098,8 @@ public: return cmList::append(list, cm::string_view{ std::accumulate( std::next(first), last, *first, - [](std::string a, const std::string& b) { - return std::move(a) + + [](const std::string& a, const std::string& b) { + return a + std::string(cmList::element_separator) + b; }) }); } @@ -1116,6 +1122,13 @@ public: }) }); } + template <typename Range, + cm::enable_if_t<cm::is_range<Range>::value, int> = 0> + static std::string to_string(Range const& r) + { + return cmList::Join(r, cmList::element_separator); + } + // Non-members // =========== friend inline bool operator==(const cmList& lhs, const cmList& rhs) noexcept @@ -1185,6 +1198,27 @@ private: return container.begin() + delta; } + static std::string const& ToString(std::string const& s) { return s; } + static std::string ToString(cm::string_view s) { return std::string{ s }; } + static std::string const& ToString(BT<std::string> const&); + + template <typename Range> + static std::string Join(Range const& r, cm::string_view glue) + { + if (cm::size(r) == 0) { + return std::string{}; + } + + const auto sep = std::string{ glue }; + + std::string joined = cmList::ToString(*std::begin(r)); + for (auto it = std::next(std::begin(r)); it != std::end(r); ++it) { + joined += sep + cmList::ToString(*it); + } + + return joined; + } + container_type Values; }; diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 7ad4023..186b856 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -10,6 +10,7 @@ #include <initializer_list> #include <iterator> #include <sstream> +#include <type_traits> #include <unordered_set> #include <utility> #include <vector> @@ -40,6 +41,7 @@ #include "cmLinkLineDeviceComputer.h" #include "cmList.h" #include "cmMakefile.h" +#include "cmMessageType.h" #include "cmRange.h" #include "cmRulePlaceholderExpander.h" #include "cmSourceFile.h" @@ -1431,11 +1433,14 @@ void cmLocalGenerator::GetDeviceLinkFlags( } this->AddVisibilityPresetFlags(linkFlags, target, "CUDA"); + this->GetGlobalGenerator()->EncodeLiteral(linkFlags); std::vector<std::string> linkOpts; target->GetLinkOptions(linkOpts, config, "CUDA"); + this->SetLinkScriptShell(this->GetGlobalGenerator()->GetUseLinkScript()); // LINK_OPTIONS are escaped. this->AppendCompileOptions(linkFlags, linkOpts); + this->SetLinkScriptShell(false); } void cmLocalGenerator::GetTargetFlags( @@ -1501,13 +1506,17 @@ void cmLocalGenerator::GetTargetFlags( } if (!sharedLibFlags.empty()) { + this->GetGlobalGenerator()->EncodeLiteral(sharedLibFlags); linkFlags.emplace_back(std::move(sharedLibFlags)); } std::vector<BT<std::string>> linkOpts = target->GetLinkOptions(config, linkLanguage); + this->SetLinkScriptShell(this->GetGlobalGenerator()->GetUseLinkScript()); // LINK_OPTIONS are escaped. this->AppendCompileOptions(linkFlags, linkOpts); + this->SetLinkScriptShell(false); + if (pcli) { this->OutputLinkLibraries(pcli, linkLineComputer, linkLibs, frameworkPath, linkPath); @@ -1581,13 +1590,16 @@ void cmLocalGenerator::GetTargetFlags( } if (!exeFlags.empty()) { + this->GetGlobalGenerator()->EncodeLiteral(exeFlags); linkFlags.emplace_back(std::move(exeFlags)); } std::vector<BT<std::string>> linkOpts = target->GetLinkOptions(config, linkLanguage); + this->SetLinkScriptShell(this->GetGlobalGenerator()->GetUseLinkScript()); // LINK_OPTIONS are escaped. this->AppendCompileOptions(linkFlags, linkOpts); + this->SetLinkScriptShell(false); } break; default: break; @@ -1603,6 +1615,7 @@ void cmLocalGenerator::GetTargetFlags( config); if (!extraLinkFlags.empty()) { + this->GetGlobalGenerator()->EncodeLiteral(extraLinkFlags); linkFlags.emplace_back(std::move(extraLinkFlags)); } } @@ -1648,6 +1661,8 @@ std::vector<BT<std::string>> cmLocalGenerator::GetTargetCompileFlags( this->AppendFlags(compileFlags, mf->GetDefineFlags()); this->AppendFlags(compileFlags, this->GetFrameworkFlags(lang, config, target)); + this->AppendFlags(compileFlags, + this->GetXcFrameworkFlags(lang, config, target)); if (!compileFlags.empty()) { flags.emplace_back(std::move(compileFlags)); @@ -1713,6 +1728,43 @@ std::string cmLocalGenerator::GetFrameworkFlags(std::string const& lang, return flags; } +std::string cmLocalGenerator::GetXcFrameworkFlags(std::string const& lang, + std::string const& config, + cmGeneratorTarget* target) +{ + cmLocalGenerator* lg = target->GetLocalGenerator(); + cmMakefile* mf = lg->GetMakefile(); + + if (!target->IsApple()) { + return std::string(); + } + + cmValue includeSearchFlag = + mf->GetDefinition(cmStrCat("CMAKE_INCLUDE_FLAG_", lang)); + cmValue sysIncludeSearchFlag = + mf->GetDefinition(cmStrCat("CMAKE_INCLUDE_SYSTEM_FLAG_", lang)); + + if (!includeSearchFlag && !sysIncludeSearchFlag) { + return std::string{}; + } + + std::string flags; + if (cmComputeLinkInformation* cli = target->GetLinkInformation(config)) { + std::vector<std::string> const& paths = cli->GetXcFrameworkHeaderPaths(); + for (std::string const& path : paths) { + if (sysIncludeSearchFlag && + target->IsSystemIncludeDirectory(path, config, lang)) { + flags += *sysIncludeSearchFlag; + } else { + flags += *includeSearchFlag; + } + flags += lg->ConvertToOutputFormat(path, cmOutputConverter::SHELL); + flags += " "; + } + } + return flags; +} + void cmLocalGenerator::GetTargetDefines(cmGeneratorTarget const* target, std::string const& config, std::string const& lang, diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h index c811408..3d2e5f6 100644 --- a/Source/cmLocalGenerator.h +++ b/Source/cmLocalGenerator.h @@ -19,8 +19,9 @@ #include <cm3p/kwiml/int.h> #include "cmCustomCommandTypes.h" +#include "cmGeneratorTarget.h" #include "cmListFileCache.h" -#include "cmMessageType.h" +#include "cmMessageType.h" // IWYU pragma: keep #include "cmOutputConverter.h" #include "cmPolicies.h" #include "cmStateSnapshot.h" @@ -31,7 +32,6 @@ class cmComputeLinkInformation; class cmCustomCommand; class cmCustomCommandGenerator; class cmCustomCommandLines; -class cmGeneratorTarget; class cmGlobalGenerator; class cmImplicitDependsList; class cmLinkLineComputer; @@ -520,6 +520,9 @@ public: std::string GetFrameworkFlags(std::string const& l, std::string const& config, cmGeneratorTarget* target); + std::string GetXcFrameworkFlags(std::string const& l, + std::string const& config, + cmGeneratorTarget* target); virtual std::string GetTargetFortranFlags(cmGeneratorTarget const* target, std::string const& config); diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx index 4b0604c..2316fb3 100644 --- a/Source/cmLocalNinjaGenerator.cxx +++ b/Source/cmLocalNinjaGenerator.cxx @@ -14,6 +14,8 @@ #include "cmsys/FStream.hxx" +#include "cm_codecvt_Encoding.hxx" + #include "cmCryptoHash.h" #include "cmCustomCommand.h" #include "cmCustomCommandGenerator.h" diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index 3c6b303..e26a6ea 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -1080,6 +1080,15 @@ void cmLocalUnixMakefileGenerator3::AppendCustomCommand( // Setup the proper working directory for the commands. this->CreateCDCommand(commands1, dir, relative); + cmGlobalUnixMakefileGenerator3* gg = + static_cast<cmGlobalUnixMakefileGenerator3*>(this->GlobalGenerator); + + // Prefix the commands with the jobserver prefix "+" + if (ccg.GetCC().GetJobserverAware() && gg->IsGNUMakeJobServerAware()) { + std::transform(commands1.begin(), commands1.end(), commands1.begin(), + [](std::string const& cmd) { return cmStrCat("+", cmd); }); + } + // push back the custom commands cm::append(commands, commands1); } diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index af0e118..24ef5c2 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -198,7 +198,7 @@ void cmLocalVisualStudio7Generator::GenerateTarget(cmGeneratorTarget* target) // Intel Fortran always uses VS9 format ".vfproj" files. cmGlobalVisualStudioGenerator::VSVersion realVersion = gg->GetVersion(); if (this->FortranProject && - gg->GetVersion() >= cmGlobalVisualStudioGenerator::VSVersion::VS11) { + gg->GetVersion() >= cmGlobalVisualStudioGenerator::VSVersion::VS12) { gg->SetVersion(cmGlobalVisualStudioGenerator::VSVersion::VS9); } diff --git a/Source/cmLocalXCodeGenerator.cxx b/Source/cmLocalXCodeGenerator.cxx index 759ee7b..eb05424 100644 --- a/Source/cmLocalXCodeGenerator.cxx +++ b/Source/cmLocalXCodeGenerator.cxx @@ -83,6 +83,12 @@ void cmLocalXCodeGenerator::AddGeneratorSpecificInstallSetup(std::ostream& os) case cmMakefile::AppleSDK::WatchSimulator: platformName = "watchsimulator"; break; + case cmMakefile::AppleSDK::XROS: + platformName = "xros"; + break; + case cmMakefile::AppleSDK::XRSimulator: + platformName = "xrsimulator"; + break; case cmMakefile::AppleSDK::MacOS: break; } diff --git a/Source/cmMacroCommand.cxx b/Source/cmMacroCommand.cxx index 47ad749..3d7cd8b 100644 --- a/Source/cmMacroCommand.cxx +++ b/Source/cmMacroCommand.cxx @@ -12,6 +12,7 @@ #include "cmExecutionStatus.h" #include "cmFunctionBlocker.h" +#include "cmList.h" #include "cmListFileCache.h" #include "cmMakefile.h" #include "cmPolicies.h" @@ -66,8 +67,9 @@ bool cmMacroHelperCommand::operator()( std::string argcDef = std::to_string(expandedArgs.size()); auto eit = expandedArgs.begin() + (this->Args.size() - 1); - std::string expandedArgn = cmJoin(cmMakeRange(eit, expandedArgs.end()), ";"); - std::string expandedArgv = cmJoin(expandedArgs, ";"); + std::string expandedArgn = + cmList::to_string(cmMakeRange(eit, expandedArgs.end())); + std::string expandedArgv = cmList::to_string(expandedArgs); std::vector<std::string> variables; variables.reserve(this->Args.size() - 1); for (unsigned int j = 1; j < this->Args.size(); ++j) { diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 0af0ed0..a96a36d 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -32,6 +32,7 @@ #include "cmCommandArgumentParserHelper.h" #include "cmCustomCommand.h" #include "cmCustomCommandLines.h" +#include "cmCustomCommandTypes.h" #include "cmExecutionStatus.h" #include "cmExpandedCommandArgument.h" // IWYU pragma: keep #include "cmExportBuildFileGenerator.h" @@ -515,7 +516,7 @@ bool cmMakefile::ExecuteCommand(const cmListFileFunction& lff, if (!hadNestedError) { // The command invocation requested that we report an error. std::string const error = - std::string(lff.OriginalName()) + " " + status.GetError(); + cmStrCat(lff.OriginalName(), ' ', status.GetError()); this->IssueMessage(MessageType::FATAL_ERROR, error); } result = false; @@ -1756,7 +1757,7 @@ void cmMakefile::Configure() bool hasVersion = false; // search for the right policy command for (cmListFileFunction const& func : listFile.Functions) { - if (func.LowerCaseName() == "cmake_minimum_required") { + if (func.LowerCaseName() == "cmake_minimum_required"_s) { hasVersion = true; break; } @@ -1803,7 +1804,7 @@ void cmMakefile::Configure() bool hasProject = false; // search for a project command for (cmListFileFunction const& func : listFile.Functions) { - if (func.LowerCaseName() == "project") { + if (func.LowerCaseName() == "project"_s) { hasProject = true; break; } @@ -1860,7 +1861,8 @@ void cmMakefile::ConfigureSubDirectory(cmMakefile* mf) cmSystemTools::Message(msg); } - std::string const currentStartFile = currentStart + "/CMakeLists.txt"; + std::string const currentStartFile = + cmStrCat(currentStart, "/CMakeLists.txt"); if (!cmSystemTools::FileExists(currentStartFile, true)) { // The file is missing. Check policy CMP0014. std::ostringstream e; @@ -1980,7 +1982,7 @@ void cmMakefile::AddIncludeDirectories(const std::vector<std::string>& incs, return; } - std::string entryString = cmJoin(incs, ";"); + std::string entryString = cmList::to_string(incs); if (before) { this->StateSnapshot.GetDirectory().PrependIncludeDirectoriesEntry( BT<std::string>(entryString, this->Backtrace)); @@ -2149,11 +2151,11 @@ void cmMakefile::AddGlobalLinkInformation(cmTarget& target) for (auto j = linkLibs.begin(); j != linkLibs.end(); ++j) { std::string libraryName = *j; cmTargetLinkLibraryType libType = GENERAL_LibraryType; - if (libraryName == "optimized") { + if (libraryName == "optimized"_s) { libType = OPTIMIZED_LibraryType; ++j; libraryName = *j; - } else if (libraryName == "debug") { + } else if (libraryName == "debug"_s) { libType = DEBUG_LibraryType; ++j; libraryName = *j; @@ -2520,7 +2522,7 @@ bool cmMakefile::IsSet(const std::string& name) const bool cmMakefile::PlatformIs32Bit() const { if (cmValue plat_abi = this->GetDefinition("CMAKE_INTERNAL_PLATFORM_ABI")) { - if (*plat_abi == "ELF X32") { + if (*plat_abi == "ELF X32"_s) { return false; } } @@ -2541,7 +2543,7 @@ bool cmMakefile::PlatformIs64Bit() const bool cmMakefile::PlatformIsx32() const { if (cmValue plat_abi = this->GetDefinition("CMAKE_INTERNAL_PLATFORM_ABI")) { - if (*plat_abi == "ELF X32") { + if (*plat_abi == "ELF X32"_s) { return true; } } @@ -2565,11 +2567,13 @@ cmMakefile::AppleSDK cmMakefile::GetAppleSDKType() const { "iphonesimulator", AppleSDK::IPhoneSimulator }, { "watchos", AppleSDK::WatchOS }, { "watchsimulator", AppleSDK::WatchSimulator }, + { "xros", AppleSDK::XROS }, + { "xrsimulator", AppleSDK::XRSimulator }, }; for (auto const& entry : sdkDatabase) { if (cmHasPrefix(sdkRoot, entry.name) || - sdkRoot.find(std::string("/") + entry.name) != std::string::npos) { + sdkRoot.find(cmStrCat('/', entry.name)) != std::string::npos) { return entry.sdk; } } @@ -3004,12 +3008,11 @@ cm::optional<std::string> cmMakefile::DeferGetCallIds() const { cm::optional<std::string> ids; if (this->Defer) { - ids = cmJoin( + ids = cmList::to_string( cmMakeRange(this->Defer->Commands) .filter([](DeferCommand const& dc) -> bool { return !dc.Id.empty(); }) .transform( - [](DeferCommand const& dc) -> std::string const& { return dc.Id; }), - ";"); + [](DeferCommand const& dc) -> std::string const& { return dc.Id; })); } return ids; } @@ -3152,15 +3155,15 @@ MessageType cmMakefile::ExpandVariablesInStringNew( char nextc = *next; if (nextc == 't') { result.append(last, in - last); - result.append("\t"); + result.push_back('\t'); last = next + 1; } else if (nextc == 'n') { result.append(last, in - last); - result.append("\n"); + result.push_back('\n'); last = next + 1; } else if (nextc == 'r') { result.append(last, in - last); - result.append("\r"); + result.push_back('\r'); last = next + 1; } else if (nextc == ';' && openstack.empty()) { // Handled in ExpandListArgument; pass the backslash literally. @@ -3237,9 +3240,9 @@ MessageType cmMakefile::ExpandVariablesInStringNew( errorstr += "Invalid character (\'"; errorstr += inc; result.append(last, in - last); - errorstr += "\') in a variable name: " - "'" + - result.substr(openstack.back().loc) + "'"; + errorstr += cmStrCat("\') in a variable name: " + "'", + result.substr(openstack.back().loc), '\''); mtype = MessageType::FATAL_ERROR; error = true; } @@ -3646,13 +3649,13 @@ void cmMakefile::EnableLanguage(std::vector<std::string> const& languages, } } if (!duplicate_languages.empty()) { - auto quantity = duplicate_languages.size() == 1 ? std::string(" has") - : std::string("s have"); - this->IssueMessage(MessageType::AUTHOR_WARNING, - "Languages to be enabled may not be specified more " - "than once at the same time. The following language" + - quantity + " been specified multiple times: " + - cmJoin(duplicate_languages, ", ")); + auto quantity = duplicate_languages.size() == 1 ? " has"_s : "s have"_s; + this->IssueMessage( + MessageType::AUTHOR_WARNING, + cmStrCat("Languages to be enabled may not be specified more " + "than once at the same time. The following language", + quantity, " been specified multiple times: ", + cmJoin(duplicate_languages, ", "))); } } @@ -3663,7 +3666,7 @@ void cmMakefile::EnableLanguage(std::vector<std::string> const& languages, std::vector<std::string> languages_for_RC; languages_without_RC.reserve(unique_languages.size()); for (std::string const& language : unique_languages) { - if (language == "RC") { + if (language == "RC"_s) { languages_for_RC.push_back(language); } else { languages_without_RC.push_back(language); @@ -3697,8 +3700,9 @@ int cmMakefile::TryCompile(const std::string& srcdir, cmWorkingDirectory workdir(bindir); if (workdir.Failed()) { this->IssueMessage(MessageType::FATAL_ERROR, - "Failed to set working directory to " + bindir + " : " + - std::strerror(workdir.GetLastResult())); + cmStrCat("Failed to set working directory to ", bindir, + " : ", + std::strerror(workdir.GetLastResult()))); cmSystemTools::SetFatalErrorOccurred(); this->IsSourceFileTryCompile = false; return 1; @@ -3926,7 +3930,7 @@ std::string cmMakefile::GetModulesFile(const std::string& filename, if (!moduleInCMakeModulePath.empty() && !moduleInCMakeRoot.empty()) { cmValue currentFile = this->GetDefinition("CMAKE_CURRENT_LIST_FILE"); - std::string mods = cmSystemTools::GetCMakeRoot() + "/Modules/"; + std::string mods = cmStrCat(cmSystemTools::GetCMakeRoot(), "/Modules/"); if (currentFile && cmSystemTools::IsSubDirectory(*currentFile, mods)) { switch (this->GetPolicyStatus(cmPolicies::CMP0017)) { case cmPolicies::WARN: { @@ -3985,8 +3989,9 @@ void cmMakefile::ConfigureString(const std::string& input, std::string& output, cmValue def = this->GetDefinition(this->cmDefineRegex.match(2)); if (!cmIsOff(def)) { const std::string indentation = this->cmDefineRegex.match(1); - cmSystemTools::ReplaceString(line, "#" + indentation + "cmakedefine", - "#" + indentation + "define"); + cmSystemTools::ReplaceString(line, + cmStrCat("#", indentation, "cmakedefine"), + cmStrCat("#", indentation, "define")); output += line; } else { output += "/* #undef "; @@ -3996,8 +4001,9 @@ void cmMakefile::ConfigureString(const std::string& input, std::string& output, } else if (this->cmDefine01Regex.find(line)) { const std::string indentation = this->cmDefine01Regex.match(1); cmValue def = this->GetDefinition(this->cmDefine01Regex.match(2)); - cmSystemTools::ReplaceString(line, "#" + indentation + "cmakedefine01", - "#" + indentation + "define"); + cmSystemTools::ReplaceString(line, + cmStrCat("#", indentation, "cmakedefine01"), + cmStrCat("#", indentation, "define")); output += line; if (!cmIsOff(def)) { output += " 1"; @@ -4035,12 +4041,12 @@ int cmMakefile::ConfigureFile(const std::string& infile, { int res = 1; if (!this->CanIWriteThisFile(outfile)) { - cmSystemTools::Error("Attempt to write file: " + outfile + - " into a source directory."); + cmSystemTools::Error(cmStrCat("Attempt to write file: ", outfile, + " into a source directory.")); return 0; } if (!cmSystemTools::FileExists(infile)) { - cmSystemTools::Error("File " + infile + " does not exist."); + cmSystemTools::Error(cmStrCat("File ", infile, " does not exist.")); return 0; } std::string soutfile = outfile; @@ -4153,14 +4159,14 @@ cmValue cmMakefile::GetProperty(const std::string& prop) const { // Check for computed properties. static std::string output; - if (prop == "TESTS") { + if (prop == "TESTS"_s) { std::vector<std::string> keys; // get list of keys const auto* t = this; std::transform( t->Tests.begin(), t->Tests.end(), std::back_inserter(keys), [](decltype(t->Tests)::value_type const& pair) { return pair.first; }); - output = cmJoin(keys, ";"); + output = cmList::to_string(keys); return cmValue(output); } @@ -4613,7 +4619,7 @@ bool cmMakefile::SetPolicy(cmPolicies::PolicyID id, } // Deprecate old policies. - if (status == cmPolicies::OLD && id <= cmPolicies::CMP0114 && + if (status == cmPolicies::OLD && id <= cmPolicies::CMP0120 && !(this->GetCMakeInstance()->GetIsInTryCompile() && ( // Policies set by cmCoreTryCompile::TryCompileCode. diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 7005942..b81af2f 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -25,9 +25,9 @@ #include "cmAlgorithms.h" #include "cmCustomCommand.h" -#include "cmCustomCommandTypes.h" +#include "cmFunctionBlocker.h" #include "cmListFileCache.h" -#include "cmMessageType.h" +#include "cmMessageType.h" // IWYU pragma: keep #include "cmNewLineStyle.h" #include "cmPolicies.h" #include "cmSourceFileLocationKind.h" @@ -43,12 +43,14 @@ # include "cmSourceGroup.h" #endif +enum class cmCustomCommandType; +enum class cmObjectLibraryCommands; + class cmCompiledGeneratorExpression; class cmCustomCommandLines; class cmExecutionStatus; class cmExpandedCommandArgument; class cmExportBuildFileGenerator; -class cmFunctionBlocker; class cmGeneratorExpressionEvaluationFile; class cmGlobalGenerator; class cmInstallGenerator; @@ -561,6 +563,8 @@ public: AppleTVSimulator, WatchOS, WatchSimulator, + XROS, + XRSimulator, }; /** What SDK type points CMAKE_OSX_SYSROOT to? */ diff --git a/Source/cmMakefileProfilingData.cxx b/Source/cmMakefileProfilingData.cxx index e903ae1..9387582 100644 --- a/Source/cmMakefileProfilingData.cxx +++ b/Source/cmMakefileProfilingData.cxx @@ -4,7 +4,6 @@ #include <chrono> #include <stdexcept> -#include <type_traits> #include <utility> #include <cm3p/json/value.h> diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index 5f27856..5e3bf61 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -17,7 +17,7 @@ #include <cmext/algorithm> #include <cmext/string_view> -#include "cm_codecvt.hxx" +#include "cm_codecvt_Encoding.hxx" #include "cmComputeLinkInformation.h" #include "cmCustomCommand.h" @@ -126,8 +126,11 @@ void cmMakefileTargetGenerator::GetDeviceLinkFlags( std::vector<std::string> linkOpts; this->GeneratorTarget->GetLinkOptions(linkOpts, this->GetConfigName(), linkLanguage); + this->LocalGenerator->SetLinkScriptShell( + this->GlobalGenerator->GetUseLinkScript()); // LINK_OPTIONS are escaped. this->LocalGenerator->AppendCompileOptions(linkFlags, linkOpts); + this->LocalGenerator->SetLinkScriptShell(false); } void cmMakefileTargetGenerator::GetTargetLinkFlags( @@ -144,8 +147,11 @@ void cmMakefileTargetGenerator::GetTargetLinkFlags( std::vector<std::string> opts; this->GeneratorTarget->GetLinkOptions(opts, this->GetConfigName(), linkLanguage); + this->LocalGenerator->SetLinkScriptShell( + this->GlobalGenerator->GetUseLinkScript()); // LINK_OPTIONS are escaped. this->LocalGenerator->AppendCompileOptions(flags, opts); + this->LocalGenerator->SetLinkScriptShell(false); this->LocalGenerator->AppendPositionIndependentLinkerFlags( flags, this->GeneratorTarget, this->GetConfigName(), linkLanguage); @@ -2129,12 +2135,12 @@ std::string cmMakefileTargetGenerator::CreateResponseFile( // FIXME: Find a better way to determine the response file encoding, // perhaps using tool-specific platform information variables. // For now, use the makefile encoding as a heuristic. - codecvt::Encoding responseEncoding = + codecvt_Encoding responseEncoding = this->GlobalGenerator->GetMakefileEncoding(); // Non-MSVC tooling doesn't understand BOM encoded files. - if (responseEncoding == codecvt::UTF8_WITH_BOM && + if (responseEncoding == codecvt_Encoding::UTF8_WITH_BOM && (language == "CUDA" || !this->Makefile->IsOn("MSVC"))) { - responseEncoding = codecvt::UTF8; + responseEncoding = codecvt_Encoding::UTF8; } // Create the response file. diff --git a/Source/cmMessenger.cxx b/Source/cmMessenger.cxx index 4e975d1..b4ea71c 100644 --- a/Source/cmMessenger.cxx +++ b/Source/cmMessenger.cxx @@ -4,6 +4,7 @@ #include "cmDocumentationFormatter.h" #include "cmMessageMetadata.h" +#include "cmMessageType.h" #include "cmStringAlgorithms.h" #include "cmSystemTools.h" diff --git a/Source/cmMessenger.h b/Source/cmMessenger.h index bdefb00..d9462d4 100644 --- a/Source/cmMessenger.h +++ b/Source/cmMessenger.h @@ -11,7 +11,7 @@ #include <cm/optional> #include "cmListFileCache.h" -#include "cmMessageType.h" +#include "cmMessageType.h" // IWYU pragma: keep #ifdef CMake_ENABLE_DEBUGGER namespace cmDebugger { diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index 063ca6b..e41a0c3 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -5,7 +5,6 @@ #include <algorithm> #include <cassert> #include <iterator> -#include <map> #include <set> #include <sstream> #include <unordered_set> @@ -952,8 +951,6 @@ void cmNinjaNormalTargetGenerator::WriteNvidiaDeviceLinkStatement( this->addPoolNinjaVariable("JOB_POOL_LINK", genTarget, vars); - vars["LINK_FLAGS"] = globalGen->EncodeLiteral(vars["LINK_FLAGS"]); - vars["MANIFESTS"] = this->GetManifests(config); vars["LINK_PATH"] = frameworkPath + linkPath; @@ -1271,8 +1268,6 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement( vars["LINK_FLAGS"], this->GetGeneratorTarget(), this->TargetLinkLanguage(config)); - vars["LINK_FLAGS"] = globalGen->EncodeLiteral(vars["LINK_FLAGS"]); - vars["MANIFESTS"] = this->GetManifests(config); vars["AIX_EXPORTS"] = this->GetAIXExports(config); diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index d712d71..6e74d9a 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -9,7 +9,6 @@ #include <iterator> #include <map> #include <ostream> -#include <type_traits> #include <unordered_map> #include <unordered_set> #include <utility> diff --git a/Source/cmOrderDirectories.cxx b/Source/cmOrderDirectories.cxx index 37c4afc..a46c87b 100644 --- a/Source/cmOrderDirectories.cxx +++ b/Source/cmOrderDirectories.cxx @@ -6,6 +6,7 @@ #include <cassert> #include <functional> #include <sstream> +#include <type_traits> #include <vector> #include <cm/memory> diff --git a/Source/cmOutputConverter.cxx b/Source/cmOutputConverter.cxx index 02981ae..9c30d74 100644 --- a/Source/cmOutputConverter.cxx +++ b/Source/cmOutputConverter.cxx @@ -6,6 +6,7 @@ #include <cassert> #include <cctype> #include <set> +#include <vector> #ifdef _WIN32 # include <unordered_map> diff --git a/Source/cmOutputRequiredFilesCommand.cxx b/Source/cmOutputRequiredFilesCommand.cxx index f147ed2..6a9a74c 100644 --- a/Source/cmOutputRequiredFilesCommand.cxx +++ b/Source/cmOutputRequiredFilesCommand.cxx @@ -5,6 +5,7 @@ #include <cstdio> #include <map> #include <set> +#include <unordered_map> #include <utility> #include <cm/memory> diff --git a/Source/cmParseArgumentsCommand.cxx b/Source/cmParseArgumentsCommand.cxx index b0462f0..f193ed9 100644 --- a/Source/cmParseArgumentsCommand.cxx +++ b/Source/cmParseArgumentsCommand.cxx @@ -20,7 +20,9 @@ #include "cmSystemTools.h" #include "cmValue.h" -static std::string EscapeArg(const std::string& arg) +namespace { + +std::string EscapeArg(const std::string& arg) { // replace ";" with "\;" so output argument lists will split correctly std::string escapedArg; @@ -33,14 +35,12 @@ static std::string EscapeArg(const std::string& arg) return escapedArg; } -static std::string JoinList(std::vector<std::string> const& arg, bool escape) +std::string JoinList(std::vector<std::string> const& arg, bool escape) { - return escape ? cmJoin(cmMakeRange(arg).transform(EscapeArg), ";") - : cmJoin(cmMakeRange(arg), ";"); + return escape ? cmList::to_string(cmMakeRange(arg).transform(EscapeArg)) + : cmList::to_string(cmMakeRange(arg)); } -namespace { - using options_map = std::map<std::string, bool>; using single_map = std::map<std::string, std::string>; using multi_map = @@ -108,8 +108,9 @@ static void PassParsedArguments( } if (!keywordsMissingValues.empty()) { - makefile.AddDefinition(prefix + "KEYWORDS_MISSING_VALUES", - cmJoin(cmMakeRange(keywordsMissingValues), ";")); + makefile.AddDefinition( + prefix + "KEYWORDS_MISSING_VALUES", + cmList::to_string(cmMakeRange(keywordsMissingValues))); } else { makefile.RemoveDefinition(prefix + "KEYWORDS_MISSING_VALUES"); } diff --git a/Source/cmPlistParser.cxx b/Source/cmPlistParser.cxx new file mode 100644 index 0000000..ce3c171 --- /dev/null +++ b/Source/cmPlistParser.cxx @@ -0,0 +1,33 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ +#include "cmPlistParser.h" + +#include <cm3p/json/reader.h> +#include <cm3p/json/value.h> + +#include "cmUVProcessChain.h" +#include "cmUVStream.h" + +cm::optional<Json::Value> cmParsePlist(const std::string& filename) +{ + cmUVProcessChainBuilder builder; + builder.AddCommand( + { "/usr/bin/plutil", "-convert", "json", "-o", "-", filename }); + builder.SetBuiltinStream(cmUVProcessChainBuilder::Stream_OUTPUT); + + auto chain = builder.Start(); + chain.Wait(); + + auto const& status = chain.GetStatus(0); + if (status.ExitStatus != 0) { + return cm::nullopt; + } + + Json::Reader reader; + Json::Value value; + cmUVPipeIStream outputStream(chain.GetLoop(), chain.OutputStream()); + if (!reader.parse(outputStream, value)) { + return cm::nullopt; + } + return cm::optional<Json::Value>(value); +} diff --git a/Source/cmPlistParser.h b/Source/cmPlistParser.h new file mode 100644 index 0000000..2ace254 --- /dev/null +++ b/Source/cmPlistParser.h @@ -0,0 +1,13 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ +#pragma once + +#include <string> + +#include <cm/optional> + +namespace Json { +class Value; +} + +cm::optional<Json::Value> cmParsePlist(const std::string& filename); diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx index d5e5725..d89c8c8 100644 --- a/Source/cmPolicies.cxx +++ b/Source/cmPolicies.cxx @@ -123,23 +123,23 @@ static void DiagnoseAncientPolicies( { std::ostringstream e; e << "The project requests behavior compatible with CMake version \"" - << majorVer << "." << minorVer << "." << patchVer + << majorVer << '.' << minorVer << '.' << patchVer << "\", which requires the OLD behavior for some policies:\n"; for (cmPolicies::PolicyID i : ancient) { - e << " " << idToString(i) << ": " << idToShortDescription(i) << "\n"; + e << " " << idToString(i) << ": " << idToShortDescription(i) << '\n'; } e << "However, this version of CMake no longer supports the OLD " - << "behavior for these policies. " - << "Please either update your CMakeLists.txt files to conform to " - << "the new behavior or use an older version of CMake that still " - << "supports the old behavior."; + "behavior for these policies. " + "Please either update your CMakeLists.txt files to conform to " + "the new behavior or use an older version of CMake that still " + "supports the old behavior."; mf->IssueMessage(MessageType::FATAL_ERROR, e.str()); } static bool GetPolicyDefault(cmMakefile* mf, std::string const& policy, cmPolicies::PolicyStatus* defaultSetting) { - std::string defaultVar = "CMAKE_POLICY_DEFAULT_" + policy; + std::string defaultVar = cmStrCat("CMAKE_POLICY_DEFAULT_", policy); std::string const& defaultValue = mf->GetSafeDefinition(defaultVar); if (defaultValue == "NEW") { *defaultSetting = cmPolicies::NEW; @@ -148,10 +148,10 @@ static bool GetPolicyDefault(cmMakefile* mf, std::string const& policy, } else if (defaultValue.empty()) { *defaultSetting = cmPolicies::WARN; } else { - std::ostringstream e; - e << defaultVar << " has value \"" << defaultValue - << R"(" but must be "OLD", "NEW", or "" (empty).)"; - mf->IssueMessage(MessageType::FATAL_ERROR, e.str()); + mf->IssueMessage( + MessageType::FATAL_ERROR, + cmStrCat(defaultVar, " has value \"", defaultValue, + R"(" but must be "OLD", "NEW", or "" (empty).)")); return false; } @@ -170,10 +170,11 @@ bool cmPolicies::ApplyPolicyVersion(cmMakefile* mf, unsigned int minTweak = 0; if (sscanf(version_min.c_str(), "%u.%u.%u.%u", &minMajor, &minMinor, &minPatch, &minTweak) < 2) { - std::ostringstream e; - e << "Invalid policy version value \"" << version_min << "\". " - << "A numeric major.minor[.patch[.tweak]] must be given."; - mf->IssueMessage(MessageType::FATAL_ERROR, e.str()); + mf->IssueMessage( + MessageType::FATAL_ERROR, + cmStrCat("Invalid policy version value \"", version_min, + "\". " + "A numeric major.minor[.patch[.tweak]] must be given.")); return false; } @@ -199,13 +200,14 @@ bool cmPolicies::ApplyPolicyVersion(cmMakefile* mf, minMinor == cmVersion::GetMinorVersion() && minPatch == cmVersion::GetPatchVersion() && minTweak > cmVersion::GetTweakVersion())) { - std::ostringstream e; - e << "An attempt was made to set the policy version of CMake to \"" - << version_min << "\" which is greater than this version of CMake. " - << "This is not allowed because the greater version may have new " - << "policies not known to this CMake. " - << "You may need a newer CMake version to build this project."; - mf->IssueMessage(MessageType::FATAL_ERROR, e.str()); + mf->IssueMessage( + MessageType::FATAL_ERROR, + cmStrCat("An attempt was made to set the policy version of CMake to \"", + version_min, + "\" which is greater than this version of CMake. ", + "This is not allowed because the greater version may have new " + "policies not known to this CMake. " + "You may need a newer CMake version to build this project.")); return false; } @@ -221,10 +223,11 @@ bool cmPolicies::ApplyPolicyVersion(cmMakefile* mf, unsigned int maxTweak = 0; if (sscanf(version_max.c_str(), "%u.%u.%u.%u", &maxMajor, &maxMinor, &maxPatch, &maxTweak) < 2) { - std::ostringstream e; - e << "Invalid policy max version value \"" << version_max << "\". " - << "A numeric major.minor[.patch[.tweak]] must be given."; - mf->IssueMessage(MessageType::FATAL_ERROR, e.str()); + mf->IssueMessage( + MessageType::FATAL_ERROR, + cmStrCat("Invalid policy max version value \"", version_max, + "\". " + "A numeric major.minor[.patch[.tweak]] must be given.")); return false; } @@ -234,11 +237,10 @@ bool cmPolicies::ApplyPolicyVersion(cmMakefile* mf, minPatch > maxPatch) || (minMajor == maxMajor && minMinor == maxMinor && minPatch == maxPatch && minTweak > maxTweak)) { - std::ostringstream e; - e << "Policy VERSION range \"" << version_min << "..." << version_max - << "\"" - << " specifies a larger minimum than maximum."; - mf->IssueMessage(MessageType::FATAL_ERROR, e.str()); + mf->IssueMessage( + MessageType::FATAL_ERROR, + cmStrCat("Policy VERSION range \"", version_min, "...", version_max, + "\" specifies a larger minimum than maximum.")); return false; } @@ -328,61 +330,49 @@ bool cmPolicies::GetPolicyID(const char* id, cmPolicies::PolicyID& pid) //! return a warning string for a given policy std::string cmPolicies::GetPolicyWarning(cmPolicies::PolicyID id) { - std::ostringstream msg; - msg << "Policy " << idToString(id) - << " is not set: " - "" - << idToShortDescription(id) - << " " - "Run \"cmake --help-policy " - << idToString(id) - << "\" for " - "policy details. " - "Use the cmake_policy command to set the policy " - "and suppress this warning."; - return msg.str(); + return cmStrCat("Policy ", idToString(id), + " is not set: ", idToShortDescription(id), + " " + "Run \"cmake --help-policy ", + idToString(id), + "\" for " + "policy details. " + "Use the cmake_policy command to set the policy " + "and suppress this warning."); } std::string cmPolicies::GetPolicyDeprecatedWarning(cmPolicies::PolicyID id) { - std::ostringstream msg; - /* clang-format off */ - msg << - "The OLD behavior for policy " << idToString(id) << " " + return cmStrCat( + "The OLD behavior for policy ", idToString(id), + " " "will be removed from a future version of CMake.\n" "The cmake-policies(7) manual explains that the OLD behaviors of all " "policies are deprecated and that a policy should be set to OLD only " "under specific short-term circumstances. Projects should be ported " - "to the NEW behavior and not rely on setting a policy to OLD." - ; - /* clang-format on */ - return msg.str(); + "to the NEW behavior and not rely on setting a policy to OLD."); } //! return an error string for when a required policy is unspecified std::string cmPolicies::GetRequiredPolicyError(cmPolicies::PolicyID id) { - std::ostringstream error; - error << "Policy " << idToString(id) - << " is not set to NEW: " - "" - << idToShortDescription(id) - << " " - "Run \"cmake --help-policy " - << idToString(id) - << "\" for " - "policy details. " - "CMake now requires this policy to be set to NEW by the project. " - "The policy may be set explicitly using the code\n" - " cmake_policy(SET " - << idToString(id) - << " NEW)\n" - "or by upgrading all policies with the code\n" - " cmake_policy(VERSION " - << idToVersion(id) - << ") # or later\n" - "Run \"cmake --help-command cmake_policy\" for more information."; - return error.str(); + return cmStrCat( + "Policy ", idToString(id), + " is not set to NEW: ", idToShortDescription(id), + " " + "Run \"cmake --help-policy ", + idToString(id), + "\" for policy details. " + "CMake now requires this policy to be set to NEW by the project. " + "The policy may be set explicitly using the code\n" + " cmake_policy(SET ", + idToString(id), + " NEW)\n" + "or by upgrading all policies with the code\n" + " cmake_policy(VERSION ", + idToVersion(id), + ") # or later\n" + "Run \"cmake --help-command cmake_policy\" for more information."); } //! Get the default status for a policy @@ -395,18 +385,18 @@ cmPolicies::PolicyStatus cmPolicies::GetPolicyStatus( std::string cmPolicies::GetRequiredAlwaysPolicyError(cmPolicies::PolicyID id) { std::string pid = idToString(id); - std::ostringstream e; - e << "Policy " << pid << " may not be set to OLD behavior because this " - << "version of CMake no longer supports it. " - << "The policy was introduced in " - << "CMake version " << idToVersion(id) - << ", and use of NEW behavior is now required." - << "\n" - << "Please either update your CMakeLists.txt files to conform to " - << "the new behavior or use an older version of CMake that still " - << "supports the old behavior. " - << "Run cmake --help-policy " << pid << " for more information."; - return e.str(); + return cmStrCat( + "Policy ", pid, + " may not be set to OLD behavior because this " + "version of CMake no longer supports it. " + "The policy was introduced in CMake version ", + idToVersion(id), + ", and use of NEW behavior is now required." + "\n" + "Please either update your CMakeLists.txt files to conform to " + "the new behavior or use an older version of CMake that still " + "supports the old behavior. Run cmake --help-policy ", + pid, " for more information."); } cmPolicies::PolicyStatus cmPolicies::PolicyMap::Get( diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h index a0030d3..26c141d 100644 --- a/Source/cmPolicies.h +++ b/Source/cmPolicies.h @@ -459,7 +459,13 @@ class cmMakefile; SELECT(POLICY, CMP0151, \ "AUTOMOC include directory is a system include directory by " \ "default.", \ - 3, 27, 0, cmPolicies::WARN) + 3, 27, 0, cmPolicies::WARN) \ + SELECT( \ + POLICY, CMP0152, \ + "file(REAL_PATH) resolves symlinks before collapsing ../ components.", 3, \ + 28, 0, cmPolicies::WARN) \ + SELECT(POLICY, CMP0153, "The exec_program command should not be called.", \ + 3, 28, 0, cmPolicies::WARN) #define CM_SELECT_ID(F, A1, A2, A3, A4, A5, A6) F(A1) #define CM_FOR_EACH_POLICY_ID(POLICY) \ diff --git a/Source/cmProjectCommand.cxx b/Source/cmProjectCommand.cxx index 4d1ccfe..3aef299 100644 --- a/Source/cmProjectCommand.cxx +++ b/Source/cmProjectCommand.cxx @@ -3,7 +3,6 @@ #include "cmProjectCommand.h" #include <array> -#include <cstddef> #include <cstdio> #include <functional> #include <limits> diff --git a/Source/cmQtAutoGenerator.cxx b/Source/cmQtAutoGenerator.cxx index e5c7bda..c048312 100644 --- a/Source/cmQtAutoGenerator.cxx +++ b/Source/cmQtAutoGenerator.cxx @@ -2,6 +2,8 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmQtAutoGenerator.h" +#include <iterator> + #include <cm3p/json/reader.h> #include "cmsys/FStream.hxx" diff --git a/Source/cmQtAutoMocUic.cxx b/Source/cmQtAutoMocUic.cxx index a101a81..429b737 100644 --- a/Source/cmQtAutoMocUic.cxx +++ b/Source/cmQtAutoMocUic.cxx @@ -27,6 +27,7 @@ #include "cmCryptoHash.h" #include "cmFileTime.h" #include "cmGccDepfileReader.h" +#include "cmGccDepfileReaderTypes.h" #include "cmGeneratedFileStream.h" #include "cmQtAutoGen.h" #include "cmQtAutoGenerator.h" diff --git a/Source/cmQtAutoRcc.cxx b/Source/cmQtAutoRcc.cxx index 414a692..e288645 100644 --- a/Source/cmQtAutoRcc.cxx +++ b/Source/cmQtAutoRcc.cxx @@ -14,7 +14,6 @@ #include "cmFileLockResult.h" #include "cmFileTime.h" #include "cmProcessOutput.h" -#include "cmQtAutoGen.h" #include "cmQtAutoGenerator.h" #include "cmStringAlgorithms.h" #include "cmSystemTools.h" diff --git a/Source/cmSeparateArgumentsCommand.cxx b/Source/cmSeparateArgumentsCommand.cxx index 17285e7..3576e4f 100644 --- a/Source/cmSeparateArgumentsCommand.cxx +++ b/Source/cmSeparateArgumentsCommand.cxx @@ -9,6 +9,7 @@ #include "cmArgumentParser.h" #include "cmExecutionStatus.h" +#include "cmList.h" #include "cmMakefile.h" #include "cmRange.h" #include "cmStringAlgorithms.h" @@ -159,7 +160,7 @@ bool cmSeparateArgumentsCommand(std::vector<std::string> const& args, pos += 2; } }); - auto value = cmJoin(values, ";"); + auto value = cmList::to_string(values); status.GetMakefile().AddDefinition(var, value); return true; diff --git a/Source/cmSetCommand.cxx b/Source/cmSetCommand.cxx index 040eb08..c4bb949 100644 --- a/Source/cmSetCommand.cxx +++ b/Source/cmSetCommand.cxx @@ -3,6 +3,7 @@ #include "cmSetCommand.h" #include "cmExecutionStatus.h" +#include "cmList.h" #include "cmMakefile.h" #include "cmMessageType.h" #include "cmRange.h" @@ -103,7 +104,8 @@ bool cmSetCommand(std::vector<std::string> const& args, } // collect any values into a single semi-colon separated value list - value = cmJoin(cmMakeRange(args).advance(1).retreat(ignoreLastArgs), ";"); + value = + cmList::to_string(cmMakeRange(args).advance(1).retreat(ignoreLastArgs)); if (parentScope) { status.GetMakefile().RaiseScope(variable, value.c_str()); diff --git a/Source/cmSourceFile.cxx b/Source/cmSourceFile.cxx index 3403745..1be680a 100644 --- a/Source/cmSourceFile.cxx +++ b/Source/cmSourceFile.cxx @@ -8,6 +8,7 @@ #include <cmext/string_view> #include "cmGlobalGenerator.h" +#include "cmList.h" #include "cmListFileCache.h" #include "cmMakefile.h" #include "cmMessageType.h" @@ -390,7 +391,7 @@ cmValue cmSourceFile::GetProperty(const std::string& prop) const } static std::string output; - output = cmJoin(this->IncludeDirectories, ";"); + output = cmList::to_string(this->IncludeDirectories); return cmValue(output); } @@ -400,7 +401,7 @@ cmValue cmSourceFile::GetProperty(const std::string& prop) const } static std::string output; - output = cmJoin(this->CompileOptions, ";"); + output = cmList::to_string(this->CompileOptions); return cmValue(output); } @@ -410,7 +411,7 @@ cmValue cmSourceFile::GetProperty(const std::string& prop) const } static std::string output; - output = cmJoin(this->CompileDefinitions, ";"); + output = cmList::to_string(this->CompileDefinitions); return cmValue(output); } diff --git a/Source/cmSourceGroupCommand.cxx b/Source/cmSourceGroupCommand.cxx index bb75a14..4b1685f 100644 --- a/Source/cmSourceGroupCommand.cxx +++ b/Source/cmSourceGroupCommand.cxx @@ -4,6 +4,7 @@ #include <cstddef> #include <map> +#include <memory> #include <set> #include <utility> @@ -11,6 +12,8 @@ #include "cmExecutionStatus.h" #include "cmMakefile.h" +#include "cmSourceFile.h" +#include "cmSourceFileLocation.h" #include "cmSourceGroup.h" #include "cmStringAlgorithms.h" #include "cmSystemTools.h" @@ -194,7 +197,10 @@ bool cmSourceGroupCommand(std::vector<std::string> const& args, // If only two arguments are given, the pre-1.8 version of the // command is being invoked. - if (args.size() == 2 && args[1] != "FILES") { + bool isShortTreeSyntax = + ((args.size() == 2) && (args[0] == kTreeOptionName) && + cmSystemTools::FileIsDirectory(args[1])); + if (args.size() == 2 && args[1] != kFilesOptionName && !isShortTreeSyntax) { cmSourceGroup* sg = mf.GetOrCreateSourceGroup(args[0]); if (!sg) { @@ -274,8 +280,19 @@ static bool processTree(cmMakefile& mf, ParsedArguments& parsedArguments, ? "" : parsedArguments[kPrefixOptionName].front(); - const std::vector<std::string> filesVector = prepareFilesPathsForTree( - parsedArguments[kFilesOptionName], mf.GetCurrentSourceDirectory()); + std::vector<std::string> files = parsedArguments[kFilesOptionName]; + if (files.empty()) { + const std::vector<std::unique_ptr<cmSourceFile>>& srcFiles = + mf.GetSourceFiles(); + for (const auto& srcFile : srcFiles) { + if (!srcFile->GetIsGenerated()) { + files.push_back(srcFile->GetLocation().GetFullPath()); + } + } + } + + const std::vector<std::string> filesVector = + prepareFilesPathsForTree(files, mf.GetCurrentSourceDirectory()); if (!rootIsPrefix(root, filesVector, errorMsg)) { return false; diff --git a/Source/cmState.cxx b/Source/cmState.cxx index 2596d8c..d41e8e5 100644 --- a/Source/cmState.cxx +++ b/Source/cmState.cxx @@ -17,6 +17,7 @@ #include "cmDefinitions.h" #include "cmExecutionStatus.h" #include "cmGlobVerificationManager.h" +#include "cmList.h" #include "cmListFileCache.h" #include "cmMakefile.h" #include "cmMessageType.h" @@ -584,10 +585,10 @@ cmValue cmState::GetGlobalProperty(const std::string& prop) { if (prop == "CACHE_VARIABLES") { std::vector<std::string> cacheKeys = this->GetCacheEntryKeys(); - this->SetGlobalProperty("CACHE_VARIABLES", cmJoin(cacheKeys, ";")); + this->SetGlobalProperty("CACHE_VARIABLES", cmList::to_string(cacheKeys)); } else if (prop == "COMMANDS") { std::vector<std::string> commands = this->GetCommandNames(); - this->SetGlobalProperty("COMMANDS", cmJoin(commands, ";")); + this->SetGlobalProperty("COMMANDS", cmList::to_string(commands)); } else if (prop == "IN_TRY_COMPILE") { this->SetGlobalProperty( "IN_TRY_COMPILE", @@ -596,8 +597,7 @@ cmValue cmState::GetGlobalProperty(const std::string& prop) this->SetGlobalProperty("GENERATOR_IS_MULTI_CONFIG", this->IsGeneratorMultiConfig ? "1" : "0"); } else if (prop == "ENABLED_LANGUAGES") { - std::string langs; - langs = cmJoin(this->EnabledLanguages, ";"); + auto langs = cmList::to_string(this->EnabledLanguages); this->SetGlobalProperty("ENABLED_LANGUAGES", langs); } else if (prop == "CMAKE_ROLE") { std::string mode = this->GetModeString(); diff --git a/Source/cmState.h b/Source/cmState.h index 1ebd79a..b79f3e6 100644 --- a/Source/cmState.h +++ b/Source/cmState.h @@ -8,7 +8,6 @@ #include <memory> #include <set> #include <string> -#include <type_traits> #include <unordered_map> #include <unordered_set> #include <utility> diff --git a/Source/cmStateDirectory.cxx b/Source/cmStateDirectory.cxx index 6e6fcbd..39353f3 100644 --- a/Source/cmStateDirectory.cxx +++ b/Source/cmStateDirectory.cxx @@ -13,6 +13,7 @@ #include <cmext/string_view> #include "cmAlgorithms.h" +#include "cmList.h" #include "cmListFileCache.h" #include "cmProperty.h" #include "cmPropertyMap.h" @@ -20,7 +21,6 @@ #include "cmState.h" #include "cmStatePrivate.h" #include "cmStateTypes.h" -#include "cmStringAlgorithms.h" #include "cmSystemTools.h" #include "cmValue.h" @@ -381,15 +381,15 @@ cmValue cmStateDirectory::GetProperty(const std::string& prop, for (cmStateSnapshot const& ci : children) { child_dirs.push_back(ci.GetDirectory().GetCurrentSource()); } - output = cmJoin(child_dirs, ";"); + output = cmList::to_string(child_dirs); return cmValue(output); } if (prop == kBUILDSYSTEM_TARGETS) { - output = cmJoin(this->DirectoryState->NormalTargetNames, ";"); + output = cmList::to_string(this->DirectoryState->NormalTargetNames); return cmValue(output); } if (prop == "IMPORTED_TARGETS"_s) { - output = cmJoin(this->DirectoryState->ImportedTargetNames, ";"); + output = cmList::to_string(this->DirectoryState->ImportedTargetNames); return cmValue(output); } @@ -401,38 +401,38 @@ cmValue cmStateDirectory::GetProperty(const std::string& prop, snp = snp.GetCallStackParent(); } std::reverse(listFiles.begin(), listFiles.end()); - output = cmJoin(listFiles, ";"); + output = cmList::to_string(listFiles); return cmValue(output); } if (prop == "CACHE_VARIABLES") { - output = cmJoin(this->Snapshot_.State->GetCacheEntryKeys(), ";"); + output = cmList::to_string(this->Snapshot_.State->GetCacheEntryKeys()); return cmValue(output); } if (prop == "VARIABLES") { std::vector<std::string> res = this->Snapshot_.ClosureKeys(); cm::append(res, this->Snapshot_.State->GetCacheEntryKeys()); std::sort(res.begin(), res.end()); - output = cmJoin(res, ";"); + output = cmList::to_string(res); return cmValue(output); } if (prop == "INCLUDE_DIRECTORIES") { - output = cmJoin(this->GetIncludeDirectoriesEntries(), ";"); + output = cmList::to_string(this->GetIncludeDirectoriesEntries()); return cmValue(output); } if (prop == "COMPILE_OPTIONS") { - output = cmJoin(this->GetCompileOptionsEntries(), ";"); + output = cmList::to_string(this->GetCompileOptionsEntries()); return cmValue(output); } if (prop == "COMPILE_DEFINITIONS") { - output = cmJoin(this->GetCompileDefinitionsEntries(), ";"); + output = cmList::to_string(this->GetCompileDefinitionsEntries()); return cmValue(output); } if (prop == "LINK_OPTIONS") { - output = cmJoin(this->GetLinkOptionsEntries(), ";"); + output = cmList::to_string(this->GetLinkOptionsEntries()); return cmValue(output); } if (prop == "LINK_DIRECTORIES") { - output = cmJoin(this->GetLinkDirectoriesEntries(), ";"); + output = cmList::to_string(this->GetLinkDirectoriesEntries()); return cmValue(output); } diff --git a/Source/cmStateSnapshot.cxx b/Source/cmStateSnapshot.cxx index e230702..8217a9c 100644 --- a/Source/cmStateSnapshot.cxx +++ b/Source/cmStateSnapshot.cxx @@ -10,6 +10,7 @@ #include <cm/iterator> #include "cmDefinitions.h" +#include "cmLinkedTree.h" #include "cmListFileCache.h" #include "cmPropertyMap.h" #include "cmState.h" diff --git a/Source/cmStateSnapshot.h b/Source/cmStateSnapshot.h index a61ec83..1796d76 100644 --- a/Source/cmStateSnapshot.h +++ b/Source/cmStateSnapshot.h @@ -10,7 +10,6 @@ #include <cm/string_view> -#include "cmLinkedTree.h" #include "cmPolicies.h" #include "cmStateTypes.h" #include "cmValue.h" diff --git a/Source/cmString.hxx b/Source/cmString.hxx index f1e462b..86b21c8 100644 --- a/Source/cmString.hxx +++ b/Source/cmString.hxx @@ -6,7 +6,6 @@ #include <algorithm> #include <cstddef> -#include <functional> #include <initializer_list> #include <memory> #include <ostream> diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 1fb0079..bf3fcd9 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -529,7 +529,7 @@ bool cmSystemTools::SplitProgramFromArgs(std::string const& command, return !in_single && !in_escape && !in_double; } -size_t cmSystemTools::CalculateCommandLineLengthLimit() +std::size_t cmSystemTools::CalculateCommandLineLengthLimit() { size_t sz = #ifdef _WIN32 @@ -1900,6 +1900,12 @@ bool cmSystemTools::IsPathToFramework(const std::string& path) cmHasLiteralSuffix(path, ".framework")); } +bool cmSystemTools::IsPathToXcFramework(const std::string& path) +{ + return (cmSystemTools::FileIsFullPath(path) && + cmHasLiteralSuffix(path, ".xcframework")); +} + bool cmSystemTools::IsPathToMacOSSharedLibrary(const std::string& path) { return (cmSystemTools::FileIsFullPath(path) && diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h index 7d55d4b..27d788e 100644 --- a/Source/cmSystemTools.h +++ b/Source/cmSystemTools.h @@ -111,6 +111,9 @@ public: //! Return true if the path is a framework static bool IsPathToFramework(const std::string& path); + //! Return true if the path is a xcframework + static bool IsPathToXcFramework(const std::string& path); + //! Return true if the path is a macOS non-framework shared library (aka //! .dylib) static bool IsPathToMacOSSharedLibrary(const std::string& path); @@ -302,7 +305,7 @@ public: std::vector<std::string>::const_iterator argBeg, std::vector<std::string>::const_iterator argEnd); - static size_t CalculateCommandLineLengthLimit(); + static std::size_t CalculateCommandLineLengthLimit(); static void DisableRunCommandOutput() { s_DisableRunCommandOutput = true; } static void EnableRunCommandOutput() { s_DisableRunCommandOutput = false; } diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index b53adf8..593a019 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -40,6 +40,7 @@ #include "cmSystemTools.h" #include "cmTargetPropertyComputer.h" #include "cmValue.h" +#include "cmXcFramework.h" #include "cmake.h" template <> @@ -811,12 +812,12 @@ std::pair<bool, cmValue> FileSetType::ReadProperties( did_read = true; } else if (prop == this->SelfEntries.PropertyName) { static std::string output; - output = cmJoin(this->SelfEntries.Entries, ";"_s); + output = cmList::to_string(this->SelfEntries.Entries); value = cmValue(output); did_read = true; } else if (prop == this->InterfaceEntries.PropertyName) { static std::string output; - output = cmJoin(this->InterfaceEntries.Entries, ";"_s); + output = cmList::to_string(this->InterfaceEntries.Entries); value = cmValue(output); did_read = true; } else if (cmHasPrefix(prop, this->DirectoryPrefix)) { @@ -899,7 +900,7 @@ std::pair<bool, cmValue> UsageRequirementProperty::Read( if (!this->Entries.empty()) { // Storage to back the returned `cmValue`. static std::string output; - output = cmJoin(this->Entries, ";"); + output = cmList::to_string(this->Entries); value = cmValue(output); } did_read = true; @@ -2130,7 +2131,7 @@ cmValue cmTargetInternals::GetFileSetDirectories( return nullptr; } static std::string output; - output = cmJoin(fileSet->GetDirectoryEntries(), ";"_s); + output = cmList::to_string(fileSet->GetDirectoryEntries()); return cmValue(output); } @@ -2150,7 +2151,7 @@ cmValue cmTargetInternals::GetFileSetPaths(cmTarget const* self, return nullptr; } static std::string output; - output = cmJoin(fileSet->GetFileEntries(), ";"_s); + output = cmList::to_string(fileSet->GetFileEntries()); return cmValue(output); } @@ -2422,6 +2423,7 @@ cmValue cmTarget::GetProperty(const std::string& prop) const propC_STANDARD, propCXX_STANDARD, propCUDA_STANDARD, + propHIP_STANDARD, propOBJC_STANDARD, propOBJCXX_STANDARD, propLINK_LIBRARIES, @@ -2446,8 +2448,8 @@ cmValue cmTarget::GetProperty(const std::string& prop) const }; if (specialProps.count(prop)) { if (prop == propC_STANDARD || prop == propCXX_STANDARD || - prop == propCUDA_STANDARD || prop == propOBJC_STANDARD || - prop == propOBJCXX_STANDARD) { + prop == propCUDA_STANDARD || prop == propHIP_STANDARD || + prop == propOBJC_STANDARD || prop == propOBJCXX_STANDARD) { auto propertyIter = this->impl->LanguageStandardProperties.find(prop); if (propertyIter == this->impl->LanguageStandardProperties.end()) { return nullptr; @@ -2495,7 +2497,7 @@ cmValue cmTarget::GetProperty(const std::string& prop) const [](const BT<std::pair<std::string, bool>>& item) -> std::string { return item.Value.first; }); - output = cmJoin(utilities, ";"); + output = cmList::to_string(utilities); return cmValue(output); } if (prop == propIMPORTED) { @@ -2779,6 +2781,8 @@ std::string cmTarget::ImportedGetFullPath( case cmStateEnums::RuntimeBinaryArtifact: if (loc) { result = *loc; + } else if (imp) { + result = *imp; } else { std::string impProp = cmStrCat("IMPORTED_LOCATION", suffix); if (cmValue config_location = this->GetProperty(impProp)) { @@ -2787,6 +2791,35 @@ std::string cmTarget::ImportedGetFullPath( this->GetProperty("IMPORTED_LOCATION")) { result = *location; } + if (result.empty() && + (this->GetType() == cmStateEnums::SHARED_LIBRARY || + this->IsExecutableWithExports())) { + impProp = cmStrCat("IMPORTED_IMPLIB", suffix); + if (cmValue config_implib = this->GetProperty(impProp)) { + result = *config_implib; + } else if (cmValue implib = this->GetProperty("IMPORTED_IMPLIB")) { + result = *implib; + } + } + } + if (this->IsApple() && + (this->impl->TargetType == cmStateEnums::SHARED_LIBRARY || + this->impl->TargetType == cmStateEnums::STATIC_LIBRARY || + this->impl->TargetType == cmStateEnums::UNKNOWN_LIBRARY) && + cmSystemTools::IsPathToXcFramework(result)) { + auto plist = cmParseXcFrameworkPlist(result, *this->impl->Makefile, + this->impl->Backtrace); + if (!plist) { + return ""; + } + auto const* library = plist->SelectSuitableLibrary( + *this->impl->Makefile, this->impl->Backtrace); + if (library) { + result = cmStrCat(result, '/', library->LibraryIdentifier, '/', + library->LibraryPath); + } else { + return ""; + } } break; @@ -2812,7 +2845,10 @@ std::string cmTarget::ImportedGetFullPath( std::string unset; std::string configuration; - if (artifact == cmStateEnums::RuntimeBinaryArtifact) { + if (this->GetType() == cmStateEnums::SHARED_LIBRARY && + artifact == cmStateEnums::RuntimeBinaryArtifact) { + unset = "IMPORTED_LOCATION or IMPORTED_IMPLIB"; + } else if (artifact == cmStateEnums::RuntimeBinaryArtifact) { unset = "IMPORTED_LOCATION"; } else if (artifact == cmStateEnums::ImportLibraryArtifact) { unset = "IMPORTED_IMPLIB"; @@ -2985,11 +3021,10 @@ bool cmTarget::GetMappedConfig(std::string const& desired_config, cmValue& loc, } // If we needed to find one of the mapped configurations but did not - // On a DLL platform there may be only IMPORTED_IMPLIB for a shared - // library or an executable with exports. - bool allowImp = (this->IsDLLPlatform() && - (this->GetType() == cmStateEnums::SHARED_LIBRARY || - this->IsExecutableWithExports())) || + // There may be only IMPORTED_IMPLIB for a shared library or an executable + // with exports. + bool allowImp = (this->GetType() == cmStateEnums::SHARED_LIBRARY || + this->IsExecutableWithExports()) || (this->IsAIX() && this->IsExecutableWithExports()) || (this->GetMakefile()->PlatformSupportsAppleTextStubs() && this->IsSharedLibraryWithExports()); diff --git a/Source/cmTarget.h b/Source/cmTarget.h index 2d12a70..7c10295 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -15,7 +15,7 @@ #include <cm/optional> #include "cmAlgorithms.h" -#include "cmFileSet.h" +#include "cmListFileCache.h" #include "cmPolicies.h" #include "cmStateTypes.h" #include "cmStringAlgorithms.h" @@ -23,20 +23,16 @@ #include "cmValue.h" class cmCustomCommand; +class cmFileSet; class cmGlobalGenerator; class cmInstallTargetGenerator; -class cmListFileBacktrace; -class cmListFileContext; class cmMakefile; class cmPropertyMap; class cmSourceFile; class cmTargetExport; class cmTargetInternals; -template <typename T> -class BT; -template <typename T> -class BTs; +enum class cmFileSetVisibility; /** \class cmTarget * \brief Represent a library or executable target loaded from a makefile. diff --git a/Source/cmTargetCompileFeaturesCommand.cxx b/Source/cmTargetCompileFeaturesCommand.cxx index aa1abdd..37c125b 100644 --- a/Source/cmTargetCompileFeaturesCommand.cxx +++ b/Source/cmTargetCompileFeaturesCommand.cxx @@ -2,6 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmTargetCompileFeaturesCommand.h" +#include "cmList.h" #include "cmMakefile.h" #include "cmMessageType.h" #include "cmStandardLevelResolver.h" @@ -43,7 +44,7 @@ private: std::string Join(const std::vector<std::string>& content) override { - return cmJoin(content, ";"); + return cmList::to_string(content); } }; diff --git a/Source/cmTargetCompileOptionsCommand.cxx b/Source/cmTargetCompileOptionsCommand.cxx index 8ca3842..e73a75f 100644 --- a/Source/cmTargetCompileOptionsCommand.cxx +++ b/Source/cmTargetCompileOptionsCommand.cxx @@ -2,6 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmTargetCompileOptionsCommand.h" +#include "cmList.h" #include "cmListFileCache.h" #include "cmMakefile.h" #include "cmMessageType.h" @@ -44,7 +45,7 @@ private: std::string Join(const std::vector<std::string>& content) override { - return cmJoin(content, ";"); + return cmList::to_string(content); } }; diff --git a/Source/cmTargetLinkDirectoriesCommand.cxx b/Source/cmTargetLinkDirectoriesCommand.cxx index 3ba27a8..dddb348 100644 --- a/Source/cmTargetLinkDirectoriesCommand.cxx +++ b/Source/cmTargetLinkDirectoriesCommand.cxx @@ -3,6 +3,7 @@ #include "cmTargetLinkDirectoriesCommand.h" #include "cmGeneratorExpression.h" +#include "cmList.h" #include "cmListFileCache.h" #include "cmMakefile.h" #include "cmMessageType.h" @@ -58,7 +59,7 @@ std::string TargetLinkDirectoriesImpl::Join( directories.push_back(unixPath); } - return cmJoin(directories, ";"); + return cmList::to_string(directories); } } // namespace diff --git a/Source/cmTargetLinkLibrariesCommand.cxx b/Source/cmTargetLinkLibrariesCommand.cxx index 03d7c9f..bfd3972 100644 --- a/Source/cmTargetLinkLibrariesCommand.cxx +++ b/Source/cmTargetLinkLibrariesCommand.cxx @@ -3,6 +3,7 @@ #include "cmTargetLinkLibrariesCommand.h" #include <cassert> +#include <cstddef> #include <memory> #include <sstream> #include <unordered_set> diff --git a/Source/cmTargetLinkOptionsCommand.cxx b/Source/cmTargetLinkOptionsCommand.cxx index 3ea2d71..cd93835 100644 --- a/Source/cmTargetLinkOptionsCommand.cxx +++ b/Source/cmTargetLinkOptionsCommand.cxx @@ -2,6 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmTargetLinkOptionsCommand.h" +#include "cmList.h" #include "cmListFileCache.h" #include "cmMakefile.h" #include "cmMessageType.h" @@ -36,7 +37,7 @@ private: std::string Join(const std::vector<std::string>& content) override { - return cmJoin(content, ";"); + return cmList::to_string(content); } }; diff --git a/Source/cmTargetPrecompileHeadersCommand.cxx b/Source/cmTargetPrecompileHeadersCommand.cxx index 4dd158d..0173a92 100644 --- a/Source/cmTargetPrecompileHeadersCommand.cxx +++ b/Source/cmTargetPrecompileHeadersCommand.cxx @@ -5,6 +5,7 @@ #include <utility> #include "cmGeneratorExpression.h" +#include "cmList.h" #include "cmListFileCache.h" #include "cmMakefile.h" #include "cmMessageType.h" @@ -73,7 +74,7 @@ private: std::string Join(const std::vector<std::string>& content) override { - return cmJoin(content, ";"); + return cmList::to_string(content); } }; diff --git a/Source/cmTargetSourcesCommand.cxx b/Source/cmTargetSourcesCommand.cxx index 12328b1..3d484f5 100644 --- a/Source/cmTargetSourcesCommand.cxx +++ b/Source/cmTargetSourcesCommand.cxx @@ -98,7 +98,7 @@ private: std::string Join(const std::vector<std::string>& content) override { - return cmJoin(content, ";"); + return cmList::to_string(content); } enum class IsInterface diff --git a/Source/cmTransformDepfile.cxx b/Source/cmTransformDepfile.cxx index 12c121f..914172b 100644 --- a/Source/cmTransformDepfile.cxx +++ b/Source/cmTransformDepfile.cxx @@ -5,7 +5,6 @@ #include <algorithm> #include <functional> #include <string> -#include <type_traits> #include <utility> #include <vector> diff --git a/Source/cmUVHandlePtr.cxx b/Source/cmUVHandlePtr.cxx index e05b2d52..34e6a70 100644 --- a/Source/cmUVHandlePtr.cxx +++ b/Source/cmUVHandlePtr.cxx @@ -11,6 +11,9 @@ namespace cm { +template <typename T> +struct uv_handle_deleter; + struct uv_loop_deleter { void operator()(uv_loop_t* loop) const; diff --git a/Source/cmUVProcessChain.cxx b/Source/cmUVProcessChain.cxx index ed5f38b..655e52a 100644 --- a/Source/cmUVProcessChain.cxx +++ b/Source/cmUVProcessChain.cxx @@ -1,16 +1,11 @@ /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying file Copyright.txt or https://cmake.org/licensing for details. */ -#include "cmConfigure.h" - #include "cmUVProcessChain.h" #include <array> -#include <cassert> #include <csignal> #include <cstdio> #include <istream> // IWYU pragma: keep -#include <iterator> -#include <type_traits> #include <utility> #include <cm/memory> @@ -19,43 +14,24 @@ #include "cmGetPipes.h" #include "cmUVHandlePtr.h" -#include "cmUVStreambuf.h" struct cmUVProcessChain::InternalData { - struct BasicStreamData + struct StreamData { - cmUVStreambuf Streambuf; - cm::uv_pipe_ptr BuiltinStream; + int BuiltinStream = -1; uv_stdio_container_t Stdio; }; - template <typename IOStream> - struct StreamData : public BasicStreamData - { - StreamData() - : BuiltinIOStream(&this->Streambuf) - { - } - - IOStream BuiltinIOStream; - - IOStream* GetBuiltinStream() - { - if (this->BuiltinStream.get()) { - return &this->BuiltinIOStream; - } - return nullptr; - } - }; - struct ProcessData { cmUVProcessChain::InternalData* Data; cm::uv_process_ptr Process; + cm::uv_pipe_ptr InputPipe; cm::uv_pipe_ptr OutputPipe; - bool Finished = false; Status ProcessStatus; + + void Finish(); }; const cmUVProcessChainBuilder* Builder = nullptr; @@ -64,18 +40,21 @@ struct cmUVProcessChain::InternalData cm::uv_loop_ptr Loop; - StreamData<std::istream> OutputStreamData; - StreamData<std::istream> ErrorStreamData; + StreamData InputStreamData; + StreamData OutputStreamData; + StreamData ErrorStreamData; + cm::uv_pipe_ptr TempOutputPipe; + cm::uv_pipe_ptr TempErrorPipe; unsigned int ProcessesCompleted = 0; std::vector<std::unique_ptr<ProcessData>> Processes; bool Prepare(const cmUVProcessChainBuilder* builder); - bool AddCommand(const cmUVProcessChainBuilder::ProcessConfiguration& config, - bool first, bool last); - bool Finish(); - - static const Status* GetStatus(const ProcessData& data); + void SpawnProcess( + std::size_t index, + const cmUVProcessChainBuilder::ProcessConfiguration& config, bool first, + bool last); + void Finish(); }; cmUVProcessChainBuilder::cmUVProcessChainBuilder() @@ -132,9 +111,6 @@ cmUVProcessChainBuilder& cmUVProcessChainBuilder::SetExternalStream( { switch (stdio) { case Stream_INPUT: - // FIXME - break; - case Stream_OUTPUT: case Stream_ERROR: { auto& streamData = this->Stdio[stdio]; @@ -167,11 +143,9 @@ cmUVProcessChain cmUVProcessChainBuilder::Start() const return chain; } - for (auto it = this->Processes.begin(); it != this->Processes.end(); ++it) { - if (!chain.Data->AddCommand(*it, it == this->Processes.begin(), - it == std::prev(this->Processes.end()))) { - return chain; - } + for (std::size_t i = 0; i < this->Processes.size(); i++) { + chain.Data->SpawnProcess(i, this->Processes[i], i == 0, + i == this->Processes.size() - 1); } chain.Data->Finish(); @@ -179,20 +153,30 @@ cmUVProcessChain cmUVProcessChainBuilder::Start() const return chain; } -const cmUVProcessChain::Status* cmUVProcessChain::InternalData::GetStatus( - const cmUVProcessChain::InternalData::ProcessData& data) -{ - if (data.Finished) { - return &data.ProcessStatus; - } - return nullptr; -} - bool cmUVProcessChain::InternalData::Prepare( const cmUVProcessChainBuilder* builder) { this->Builder = builder; + auto const& input = + this->Builder->Stdio[cmUVProcessChainBuilder::Stream_INPUT]; + auto& inputData = this->InputStreamData; + switch (input.Type) { + case cmUVProcessChainBuilder::None: + inputData.Stdio.flags = UV_IGNORE; + break; + + case cmUVProcessChainBuilder::Builtin: { + // FIXME + break; + } + + case cmUVProcessChainBuilder::External: + inputData.Stdio.flags = UV_INHERIT_FD; + inputData.Stdio.data.fd = input.FileDescriptor; + break; + } + auto const& error = this->Builder->Stdio[cmUVProcessChainBuilder::Stream_ERROR]; auto& errorData = this->ErrorStreamData; @@ -207,12 +191,17 @@ bool cmUVProcessChain::InternalData::Prepare( return false; } - errorData.BuiltinStream.init(*this->Loop, 0); - if (uv_pipe_open(errorData.BuiltinStream, pipeFd[0]) < 0) { - return false; - } + errorData.BuiltinStream = pipeFd[0]; errorData.Stdio.flags = UV_INHERIT_FD; errorData.Stdio.data.fd = pipeFd[1]; + + if (this->TempErrorPipe.init(*this->Loop, 0) < 0) { + return false; + } + if (uv_pipe_open(this->TempErrorPipe, errorData.Stdio.data.fd) < 0) { + return false; + } + break; } @@ -232,13 +221,25 @@ bool cmUVProcessChain::InternalData::Prepare( case cmUVProcessChainBuilder::Builtin: if (this->Builder->MergedBuiltinStreams) { + outputData.BuiltinStream = errorData.BuiltinStream; outputData.Stdio.flags = UV_INHERIT_FD; outputData.Stdio.data.fd = errorData.Stdio.data.fd; } else { - outputData.BuiltinStream.init(*this->Loop, 0); - outputData.Stdio.flags = - static_cast<uv_stdio_flags>(UV_CREATE_PIPE | UV_WRITABLE_PIPE); - outputData.Stdio.data.stream = outputData.BuiltinStream; + int pipeFd[2]; + if (cmGetPipes(pipeFd) < 0) { + return false; + } + + outputData.BuiltinStream = pipeFd[0]; + outputData.Stdio.flags = UV_INHERIT_FD; + outputData.Stdio.data.fd = pipeFd[1]; + + if (this->TempOutputPipe.init(*this->Loop, 0) < 0) { + return false; + } + if (uv_pipe_open(this->TempOutputPipe, outputData.Stdio.data.fd) < 0) { + return false; + } } break; @@ -248,16 +249,47 @@ bool cmUVProcessChain::InternalData::Prepare( break; } + bool first = true; + for (std::size_t i = 0; i < this->Builder->Processes.size(); i++) { + this->Processes.emplace_back(cm::make_unique<ProcessData>()); + auto& process = *this->Processes.back(); + process.Data = this; + process.ProcessStatus.Finished = false; + + if (!first) { + auto& prevProcess = *this->Processes[i - 1]; + + int pipeFd[2]; + if (cmGetPipes(pipeFd) < 0) { + return false; + } + + if (prevProcess.OutputPipe.init(*this->Loop, 0) < 0) { + return false; + } + if (uv_pipe_open(prevProcess.OutputPipe, pipeFd[1]) < 0) { + return false; + } + if (process.InputPipe.init(*this->Loop, 0) < 0) { + return false; + } + if (uv_pipe_open(process.InputPipe, pipeFd[0]) < 0) { + return false; + } + } + + first = false; + } + return true; } -bool cmUVProcessChain::InternalData::AddCommand( +void cmUVProcessChain::InternalData::SpawnProcess( + std::size_t index, const cmUVProcessChainBuilder::ProcessConfiguration& config, bool first, bool last) { - this->Processes.emplace_back(cm::make_unique<ProcessData>()); - auto& process = *this->Processes.back(); - process.Data = this; + auto& process = *this->Processes[index]; auto options = uv_process_options_t(); @@ -277,24 +309,18 @@ bool cmUVProcessChain::InternalData::AddCommand( } std::array<uv_stdio_container_t, 3> stdio; - stdio[0] = uv_stdio_container_t(); if (first) { - stdio[0].flags = UV_IGNORE; + stdio[0] = this->InputStreamData.Stdio; } else { - assert(this->Processes.size() >= 2); - auto& prev = *this->Processes[this->Processes.size() - 2]; + stdio[0] = uv_stdio_container_t(); stdio[0].flags = UV_INHERIT_STREAM; - stdio[0].data.stream = prev.OutputPipe; + stdio[0].data.stream = process.InputPipe; } if (last) { stdio[1] = this->OutputStreamData.Stdio; } else { - if (process.OutputPipe.init(*this->Loop, 0) < 0) { - return false; - } stdio[1] = uv_stdio_container_t(); - stdio[1].flags = - static_cast<uv_stdio_flags>(UV_CREATE_PIPE | UV_WRITABLE_PIPE); + stdio[1].flags = UV_INHERIT_STREAM; stdio[1].data.stream = process.OutputPipe; } stdio[2] = this->ErrorStreamData.Stdio; @@ -304,40 +330,24 @@ bool cmUVProcessChain::InternalData::AddCommand( options.exit_cb = [](uv_process_t* handle, int64_t exitStatus, int termSignal) { auto* processData = static_cast<ProcessData*>(handle->data); - processData->Finished = true; processData->ProcessStatus.ExitStatus = exitStatus; processData->ProcessStatus.TermSignal = termSignal; - processData->Data->ProcessesCompleted++; + processData->Finish(); }; - return process.Process.spawn(*this->Loop, options, &process) >= 0; + if ((process.ProcessStatus.SpawnResult = + process.Process.spawn(*this->Loop, options, &process)) < 0) { + process.Finish(); + } + process.InputPipe.reset(); + process.OutputPipe.reset(); } -bool cmUVProcessChain::InternalData::Finish() +void cmUVProcessChain::InternalData::Finish() { - if (this->Builder->Stdio[cmUVProcessChainBuilder::Stream_OUTPUT].Type == - cmUVProcessChainBuilder::Builtin && - !this->Builder->MergedBuiltinStreams) { - this->OutputStreamData.Streambuf.open( - this->OutputStreamData.BuiltinStream); - } - - if (this->Builder->Stdio[cmUVProcessChainBuilder::Stream_ERROR].Type == - cmUVProcessChainBuilder::Builtin) { - cm::uv_pipe_ptr tmpPipe; - if (tmpPipe.init(*this->Loop, 0) < 0) { - return false; - } - if (uv_pipe_open(tmpPipe, this->ErrorStreamData.Stdio.data.fd) < 0) { - return false; - } - tmpPipe.reset(); - - this->ErrorStreamData.Streambuf.open(this->ErrorStreamData.BuiltinStream); - } - + this->TempOutputPipe.reset(); + this->TempErrorPipe.reset(); this->Valid = true; - return true; } cmUVProcessChain::cmUVProcessChain() @@ -365,17 +375,14 @@ uv_loop_t& cmUVProcessChain::GetLoop() return *this->Data->Loop; } -std::istream* cmUVProcessChain::OutputStream() +int cmUVProcessChain::OutputStream() { - if (this->Data->Builder->MergedBuiltinStreams) { - return this->Data->ErrorStreamData.GetBuiltinStream(); - } - return this->Data->OutputStreamData.GetBuiltinStream(); + return this->Data->OutputStreamData.BuiltinStream; } -std::istream* cmUVProcessChain::ErrorStream() +int cmUVProcessChain::ErrorStream() { - return this->Data->ErrorStreamData.GetBuiltinStream(); + return this->Data->ErrorStreamData.BuiltinStream; } bool cmUVProcessChain::Valid() const @@ -383,12 +390,12 @@ bool cmUVProcessChain::Valid() const return this->Data->Valid; } -bool cmUVProcessChain::Wait(int64_t milliseconds) +bool cmUVProcessChain::Wait(uint64_t milliseconds) { bool timeout = false; cm::uv_timer_ptr timer; - if (milliseconds >= 0) { + if (milliseconds > 0) { timer.init(*this->Data->Loop, &timeout); timer.start( [](uv_timer_t* handle) { @@ -412,19 +419,15 @@ std::vector<const cmUVProcessChain::Status*> cmUVProcessChain::GetStatus() std::vector<const cmUVProcessChain::Status*> statuses( this->Data->Processes.size(), nullptr); for (std::size_t i = 0; i < statuses.size(); i++) { - statuses[i] = this->GetStatus(i); + statuses[i] = &this->GetStatus(i); } return statuses; } -const cmUVProcessChain::Status* cmUVProcessChain::GetStatus( +const cmUVProcessChain::Status& cmUVProcessChain::GetStatus( std::size_t index) const { - auto const& process = *this->Data->Processes[index]; - if (process.Finished) { - return &process.ProcessStatus; - } - return nullptr; + return this->Data->Processes[index]->ProcessStatus; } bool cmUVProcessChain::Finished() const @@ -435,8 +438,12 @@ bool cmUVProcessChain::Finished() const std::pair<cmUVProcessChain::ExceptionCode, std::string> cmUVProcessChain::Status::GetException() const { + if (this->SpawnResult) { + return std::make_pair(ExceptionCode::Spawn, + uv_strerror(this->SpawnResult)); + } #ifdef _WIN32 - if ((this->ExitStatus & 0xF0000000) == 0xC0000000) { + if (this->Finished && (this->ExitStatus & 0xF0000000) == 0xC0000000) { // Child terminated due to exceptional behavior. switch (this->ExitStatus) { case STATUS_CONTROL_C_EXIT: @@ -511,9 +518,8 @@ cmUVProcessChain::Status::GetException() const } } } - return std::make_pair(ExceptionCode::None, ""); #else - if (this->TermSignal) { + if (this->Finished && this->TermSignal) { switch (this->TermSignal) { # ifdef SIGSEGV case SIGSEGV: @@ -670,6 +676,12 @@ cmUVProcessChain::Status::GetException() const } } } - return std::make_pair(ExceptionCode::None, ""); #endif + return std::make_pair(ExceptionCode::None, ""); +} + +void cmUVProcessChain::InternalData::ProcessData::Finish() +{ + this->ProcessStatus.Finished = true; + this->Data->ProcessesCompleted++; } diff --git a/Source/cmUVProcessChain.h b/Source/cmUVProcessChain.h index f92742f..0f37e7d 100644 --- a/Source/cmUVProcessChain.h +++ b/Source/cmUVProcessChain.h @@ -2,10 +2,11 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #pragma once +#include "cmConfigure.h" // IWYU pragma: keep + #include <array> #include <cstddef> // IWYU pragma: keep #include <cstdint> -#include <iosfwd> #include <memory> #include <string> #include <utility> @@ -74,11 +75,14 @@ public: Illegal, Interrupt, Numerical, + Spawn, Other, }; struct Status { + int SpawnResult; + bool Finished; int64_t ExitStatus; int TermSignal; @@ -96,13 +100,13 @@ public: uv_loop_t& GetLoop(); // FIXME: Add stdin support - std::istream* OutputStream(); - std::istream* ErrorStream(); + int OutputStream(); + int ErrorStream(); bool Valid() const; - bool Wait(int64_t milliseconds = -1); + bool Wait(uint64_t milliseconds = 0); std::vector<const Status*> GetStatus() const; - const Status* GetStatus(std::size_t index) const; + const Status& GetStatus(std::size_t index) const; bool Finished() const; private: diff --git a/Source/cmUVStream.h b/Source/cmUVStream.h new file mode 100644 index 0000000..5998256 --- /dev/null +++ b/Source/cmUVStream.h @@ -0,0 +1,140 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ +#pragma once + +#include <cassert> +#include <istream> + +#include <cm3p/uv.h> + +#include "cmUVHandlePtr.h" +#include "cmUVStreambuf.h" + +template <typename CharT, typename Traits = std::char_traits<CharT>> +class cmBasicUVIStream : public std::basic_istream<CharT> +{ +public: + cmBasicUVIStream(); + cmBasicUVIStream(uv_stream_t* stream); + + bool is_open() const; + + void open(uv_stream_t* stream); + + void close(); + +private: + cmBasicUVStreambuf<CharT, Traits> Buffer; +}; + +template <typename CharT, typename Traits> +cmBasicUVIStream<CharT, Traits>::cmBasicUVIStream() + : std::basic_istream<CharT, Traits>(&this->Buffer) +{ +} + +template <typename CharT, typename Traits> +cmBasicUVIStream<CharT, Traits>::cmBasicUVIStream(uv_stream_t* stream) + : cmBasicUVIStream() +{ + this->open(stream); +} + +template <typename CharT, typename Traits> +bool cmBasicUVIStream<CharT, Traits>::is_open() const +{ + return this->Buffer.is_open(); +} + +template <typename CharT, typename Traits> +void cmBasicUVIStream<CharT, Traits>::open(uv_stream_t* stream) +{ + this->Buffer.open(stream); +} + +template <typename CharT, typename Traits> +void cmBasicUVIStream<CharT, Traits>::close() +{ + this->Buffer.close(); +} + +using cmUVIStream = cmBasicUVIStream<char>; + +template <typename CharT, typename Traits = std::char_traits<CharT>> +class cmBasicUVPipeIStream : public cmBasicUVIStream<CharT, Traits> +{ +public: + cmBasicUVPipeIStream(); + cmBasicUVPipeIStream(uv_loop_t& loop, int fd); + + using cmBasicUVIStream<CharT, Traits>::is_open; + + void open(uv_loop_t& loop, int fd); + + void close(); + +private: + cm::uv_pipe_ptr Pipe; +}; + +template <typename CharT, typename Traits> +cmBasicUVPipeIStream<CharT, Traits>::cmBasicUVPipeIStream() = default; + +template <typename CharT, typename Traits> +cmBasicUVPipeIStream<CharT, Traits>::cmBasicUVPipeIStream(uv_loop_t& loop, + int fd) +{ + this->open(loop, fd); +} + +template <typename CharT, typename Traits> +void cmBasicUVPipeIStream<CharT, Traits>::open(uv_loop_t& loop, int fd) +{ + this->Pipe.init(loop, 0); + uv_pipe_open(this->Pipe, fd); + this->cmBasicUVIStream<CharT, Traits>::open(this->Pipe); +} + +template <typename CharT, typename Traits> +void cmBasicUVPipeIStream<CharT, Traits>::close() +{ + this->cmBasicUVIStream<CharT, Traits>::close(); + this->Pipe.reset(); +} + +using cmUVPipeIStream = cmBasicUVPipeIStream<char>; + +template <typename ReadCallback, typename FinishCallback> +void cmUVStreamRead(uv_stream_t* stream, ReadCallback onRead, + FinishCallback onFinish) +{ + struct ReadData + { + std::vector<char> Buffer; + ReadCallback OnRead; + FinishCallback OnFinish; + }; + + stream->data = new ReadData{ {}, std::move(onRead), std::move(onFinish) }; + uv_read_start( + stream, + [](uv_handle_t* s, std::size_t suggestedSize, uv_buf_t* buffer) { + auto* data = static_cast<ReadData*>(s->data); + data->Buffer.resize(suggestedSize); + buffer->base = data->Buffer.data(); + buffer->len = suggestedSize; + }, + [](uv_stream_t* s, ssize_t nread, const uv_buf_t* buffer) { + auto* data = static_cast<ReadData*>(s->data); + if (nread > 0) { + (void)buffer; + assert(buffer->base == data->Buffer.data()); + data->Buffer.resize(nread); + data->OnRead(std::move(data->Buffer)); + } else if (nread < 0 /*|| nread == UV_EOF*/) { + data->OnFinish(); + uv_read_stop(s); + delete data; + } + }); +} diff --git a/Source/cmUVStreambuf.h b/Source/cmUVStreambuf.h index efe45de..4f7b209 100644 --- a/Source/cmUVStreambuf.h +++ b/Source/cmUVStreambuf.h @@ -14,7 +14,8 @@ /* * This file is based on example code from: * - * http://www.voidcn.com/article/p-vjnlygmc-gy.html + * https://web.archive.org/web/20170515211805/ + * http://www.mr-edd.co.uk/blog/beginners_guide_streambuf * * The example code was distributed under the following license: * diff --git a/Source/cmUuid.cxx b/Source/cmUuid.cxx index 6688668..5f5d3e4 100644 --- a/Source/cmUuid.cxx +++ b/Source/cmUuid.cxx @@ -104,20 +104,20 @@ std::string cmUuid::BinaryToString(const unsigned char* input) const size_t bytes = kUuidGroups[i]; for (size_t j = 0; j < bytes; ++j) { - unsigned char byte = input[inputIndex++]; - output += this->ByteToHex(byte); + unsigned char inputByte = input[inputIndex++]; + output += this->ByteToHex(inputByte); } } return output; } -std::string cmUuid::ByteToHex(unsigned char byte) const +std::string cmUuid::ByteToHex(unsigned char inputByte) const { std::string result(" "); for (int i = 0; i < 2; ++i) { - unsigned char rest = byte % 16; - byte /= 16; + unsigned char rest = inputByte % 16; + inputByte /= 16; char c = (rest < 0xA) ? static_cast<char>('0' + rest) : static_cast<char>('a' + (rest - 0xA)); result.at(1 - i) = c; diff --git a/Source/cmValue.h b/Source/cmValue.h index f96d2f5..c924dda 100644 --- a/Source/cmValue.h +++ b/Source/cmValue.h @@ -4,7 +4,6 @@ #include "cmConfigure.h" // IWYU pragma: keep -#include <cstddef> #include <iosfwd> #include <string> diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 8d6b024..90de51a 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -24,6 +24,7 @@ #include "cmComputeLinkInformation.h" #include "cmCustomCommand.h" #include "cmCustomCommandGenerator.h" +#include "cmFileSet.h" #include "cmGeneratedFileStream.h" #include "cmGeneratorExpression.h" #include "cmGeneratorTarget.h" @@ -2534,18 +2535,6 @@ void cmVisualStudio10TargetGenerator::WriteAllSources(Elem& e0) break; case cmGeneratorTarget::SourceKindExternalObject: tool = "Object"; - if (this->LocalGenerator->GetVersion() < - cmGlobalVisualStudioGenerator::VSVersion::VS11) { - // For VS == 10 we cannot use LinkObjects to avoid linking custom - // command outputs. If an object file is generated in this target, - // then vs10 will use it in the build, and we have to list it as - // None instead of Object. - std::vector<cmSourceFile*> const* d = - this->GeneratorTarget->GetSourceDepends(si.Source); - if (d && !d->empty()) { - tool = "None"; - } - } break; case cmGeneratorTarget::SourceKindExtra: this->WriteExtraSource(e1, si.Source, toolSettings); diff --git a/Source/cmVisualStudioGeneratorOptions.cxx b/Source/cmVisualStudioGeneratorOptions.cxx index 6e98874..7e4503b 100644 --- a/Source/cmVisualStudioGeneratorOptions.cxx +++ b/Source/cmVisualStudioGeneratorOptions.cxx @@ -75,7 +75,6 @@ void cmVisualStudioGeneratorOptions::FixExceptionHandlingDefault() // the flag to disable exception handling. When the user does // remove the flag we need to override the IDE default of on. switch (this->Version) { - case cmGlobalVisualStudioGenerator::VSVersion::VS11: case cmGlobalVisualStudioGenerator::VSVersion::VS12: case cmGlobalVisualStudioGenerator::VSVersion::VS14: case cmGlobalVisualStudioGenerator::VSVersion::VS15: diff --git a/Source/cmWindowsRegistry.cxx b/Source/cmWindowsRegistry.cxx index 6dba863..a4a1ad6 100644 --- a/Source/cmWindowsRegistry.cxx +++ b/Source/cmWindowsRegistry.cxx @@ -6,7 +6,6 @@ #include <cctype> #include <cstddef> -#include <functional> #include <type_traits> #include <unordered_map> #include <utility> diff --git a/Source/cmWindowsRegistry.h b/Source/cmWindowsRegistry.h index f4a0e7b..42179ed 100644 --- a/Source/cmWindowsRegistry.h +++ b/Source/cmWindowsRegistry.h @@ -5,6 +5,7 @@ #include "cmConfigure.h" // IWYU pragma: keep #include <cstdint> // IWYU pragma: keep +#include <initializer_list> #include <string> #include <vector> diff --git a/Source/cmXcFramework.cxx b/Source/cmXcFramework.cxx new file mode 100644 index 0000000..6435ef9 --- /dev/null +++ b/Source/cmXcFramework.cxx @@ -0,0 +1,173 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ +#include "cmXcFramework.h" + +#include <string> + +#include <cmext/string_view> + +#include <cm3p/json/value.h> + +#include "cmJSONHelpers.h" +#include "cmJSONState.h" +#include "cmMakefile.h" +#include "cmMessageType.h" +#include "cmPlistParser.h" +#include "cmStringAlgorithms.h" +#include "cmake.h" + +namespace { +struct PlistMetadata +{ + std::string CFBundlePackageType; + std::string XCFrameworkFormatVersion; +}; + +auto const PlistMetadataHelper = + cmJSONHelperBuilder::Object<PlistMetadata>{} + .Bind("CFBundlePackageType"_s, &PlistMetadata::CFBundlePackageType, + cmJSONHelperBuilder::String()) + .Bind("XCFrameworkFormatVersion"_s, + &PlistMetadata::XCFrameworkFormatVersion, + cmJSONHelperBuilder::String()); + +bool PlistSupportedPlatformHelper( + cmXcFrameworkPlistSupportedPlatform& platform, const Json::Value* value, + cmJSONState* /*state*/) +{ + if (!value) { + return false; + } + + if (!value->isString()) { + return false; + } + + if (value->asString() == "macos") { + platform = cmXcFrameworkPlistSupportedPlatform::macOS; + return true; + } + if (value->asString() == "ios") { + platform = cmXcFrameworkPlistSupportedPlatform::iOS; + return true; + } + if (value->asString() == "tvos") { + platform = cmXcFrameworkPlistSupportedPlatform::tvOS; + return true; + } + if (value->asString() == "watchos") { + platform = cmXcFrameworkPlistSupportedPlatform::watchOS; + return true; + } + if (value->asString() == "xros") { + platform = cmXcFrameworkPlistSupportedPlatform::visionOS; + return true; + } + + return false; +} + +auto const PlistLibraryHelper = + cmJSONHelperBuilder::Object<cmXcFrameworkPlistLibrary>{} + .Bind("LibraryIdentifier"_s, &cmXcFrameworkPlistLibrary::LibraryIdentifier, + cmJSONHelperBuilder::String()) + .Bind("LibraryPath"_s, &cmXcFrameworkPlistLibrary::LibraryPath, + cmJSONHelperBuilder::String()) + .Bind("HeadersPath"_s, &cmXcFrameworkPlistLibrary::HeadersPath, + cmJSONHelperBuilder::String(), false) + .Bind("SupportedArchitectures"_s, + &cmXcFrameworkPlistLibrary::SupportedArchitectures, + cmJSONHelperBuilder::Vector<std::string>( + JsonErrors::EXPECTED_TYPE("array"), cmJSONHelperBuilder::String())) + .Bind("SupportedPlatform"_s, &cmXcFrameworkPlistLibrary::SupportedPlatform, + PlistSupportedPlatformHelper); + +auto const PlistHelper = + cmJSONHelperBuilder::Object<cmXcFrameworkPlist>{}.Bind( + "AvailableLibraries"_s, &cmXcFrameworkPlist::AvailableLibraries, + cmJSONHelperBuilder::Vector<cmXcFrameworkPlistLibrary>( + JsonErrors::EXPECTED_TYPE("array"), PlistLibraryHelper)); +} + +cm::optional<cmXcFrameworkPlist> cmParseXcFrameworkPlist( + const std::string& xcframeworkPath, const cmMakefile& mf, + const cmListFileBacktrace& bt) +{ + std::string plistPath = cmStrCat(xcframeworkPath, "/Info.plist"); + + auto value = cmParsePlist(plistPath); + if (!value) { + mf.GetCMakeInstance()->IssueMessage( + MessageType::FATAL_ERROR, + cmStrCat("Unable to parse plist file:\n ", plistPath), bt); + return cm::nullopt; + } + + cmJSONState state; + + PlistMetadata metadata; + if (!PlistMetadataHelper(metadata, &*value, &state)) { + mf.GetCMakeInstance()->IssueMessage( + MessageType::FATAL_ERROR, + cmStrCat("Invalid xcframework .plist file:\n ", plistPath), bt); + return cm::nullopt; + } + if (metadata.CFBundlePackageType != "XFWK" || + metadata.XCFrameworkFormatVersion != "1.0") { + mf.GetCMakeInstance()->IssueMessage( + MessageType::FATAL_ERROR, + cmStrCat("Expected:\n ", plistPath, + "\nto have CFBundlePackageType \"XFWK\" and " + "XCFrameworkFormatVersion \"1.0\""), + bt); + return cm::nullopt; + } + + cmXcFrameworkPlist plist; + if (!PlistHelper(plist, &*value, &state)) { + mf.GetCMakeInstance()->IssueMessage( + MessageType::FATAL_ERROR, + cmStrCat("Invalid xcframework .plist file:\n ", plistPath), bt); + return cm::nullopt; + } + plist.Path = plistPath; + return cm::optional<cmXcFrameworkPlist>(plist); +} + +const cmXcFrameworkPlistLibrary* cmXcFrameworkPlist::SelectSuitableLibrary( + const cmMakefile& mf, const cmListFileBacktrace& bt) const +{ + auto systemName = mf.GetSafeDefinition("CMAKE_SYSTEM_NAME"); + + for (auto const& lib : this->AvailableLibraries) { + std::string supportedSystemName; + switch (lib.SupportedPlatform) { + case cmXcFrameworkPlistSupportedPlatform::macOS: + supportedSystemName = "Darwin"; + break; + case cmXcFrameworkPlistSupportedPlatform::iOS: + supportedSystemName = "iOS"; + break; + case cmXcFrameworkPlistSupportedPlatform::tvOS: + supportedSystemName = "tvOS"; + break; + case cmXcFrameworkPlistSupportedPlatform::watchOS: + supportedSystemName = "watchOS"; + break; + case cmXcFrameworkPlistSupportedPlatform::visionOS: + supportedSystemName = "visionOS"; + break; + } + + if (systemName == supportedSystemName) { + return &lib; + } + } + + mf.GetCMakeInstance()->IssueMessage( + MessageType::FATAL_ERROR, + cmStrCat("Unable to find suitable library in:\n ", this->Path, + "\nfor system name \"", systemName, '"'), + bt); + return nullptr; +} diff --git a/Source/cmXcFramework.h b/Source/cmXcFramework.h new file mode 100644 index 0000000..c35df11 --- /dev/null +++ b/Source/cmXcFramework.h @@ -0,0 +1,44 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ +#pragma once + +#include <string> +#include <vector> + +#include <cm/optional> + +#include "cmListFileCache.h" + +class cmMakefile; + +enum class cmXcFrameworkPlistSupportedPlatform +{ + macOS, + iOS, + tvOS, + watchOS, + visionOS, +}; + +struct cmXcFrameworkPlistLibrary +{ + std::string LibraryIdentifier; + std::string LibraryPath; + std::string HeadersPath; + std::vector<std::string> SupportedArchitectures; + cmXcFrameworkPlistSupportedPlatform SupportedPlatform; +}; + +struct cmXcFrameworkPlist +{ + std::string Path; + std::vector<cmXcFrameworkPlistLibrary> AvailableLibraries; + + const cmXcFrameworkPlistLibrary* SelectSuitableLibrary( + const cmMakefile& mf, + const cmListFileBacktrace& bt = cmListFileBacktrace{}) const; +}; + +cm::optional<cmXcFrameworkPlist> cmParseXcFrameworkPlist( + const std::string& xcframeworkPath, const cmMakefile& mf, + const cmListFileBacktrace& bt = cmListFileBacktrace{}); diff --git a/Source/cm_codecvt.cxx b/Source/cm_codecvt.cxx index 12877b8..60faced 100644 --- a/Source/cm_codecvt.cxx +++ b/Source/cm_codecvt.cxx @@ -13,19 +13,21 @@ # include "cm_utf8.h" #endif -codecvt::codecvt(Encoding e) +#include "cm_codecvt_Encoding.hxx" + +codecvt::codecvt(codecvt_Encoding e) #if defined(_WIN32) : m_codepage(0) #endif { switch (e) { - case codecvt::ConsoleOutput: + case codecvt_Encoding::ConsoleOutput: #if defined(_WIN32) m_noconv = false; m_codepage = GetConsoleOutputCP(); break; #endif - case codecvt::ANSI: + case codecvt_Encoding::ANSI: #if defined(_WIN32) m_noconv = false; m_codepage = CP_ACP; @@ -33,10 +35,10 @@ codecvt::codecvt(Encoding e) #endif // We don't know which ANSI encoding to use for other platforms than // Windows so we don't do any conversion there - case codecvt::UTF8: - case codecvt::UTF8_WITH_BOM: + case codecvt_Encoding::UTF8: + case codecvt_Encoding::UTF8_WITH_BOM: // Assume internal encoding is UTF-8 - case codecvt::None: + case codecvt_Encoding::None: // No encoding default: this->m_noconv = true; diff --git a/Source/cm_codecvt.hxx b/Source/cm_codecvt.hxx index f628de7..c25f9ef 100644 --- a/Source/cm_codecvt.hxx +++ b/Source/cm_codecvt.hxx @@ -7,21 +7,14 @@ #include <cwchar> #include <locale> +enum class codecvt_Encoding; + class codecvt : public std::codecvt<char, char, mbstate_t> { public: - enum Encoding - { - None, - UTF8, - UTF8_WITH_BOM, - ANSI, - ConsoleOutput, - }; - #ifndef CMAKE_BOOTSTRAP - codecvt(Encoding e); + codecvt(codecvt_Encoding e); protected: ~codecvt() override; diff --git a/Source/cm_codecvt_Encoding.hxx b/Source/cm_codecvt_Encoding.hxx new file mode 100644 index 0000000..b91ad8f --- /dev/null +++ b/Source/cm_codecvt_Encoding.hxx @@ -0,0 +1,12 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ +#pragma once + +enum class codecvt_Encoding +{ + None, + UTF8, + UTF8_WITH_BOM, + ANSI, + ConsoleOutput, +}; diff --git a/Source/cmake.cxx b/Source/cmake.cxx index f30d4d3..b8ebca5 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -94,7 +94,6 @@ # include "cmGlobalBorlandMakefileGenerator.h" # include "cmGlobalJOMMakefileGenerator.h" # include "cmGlobalNMakeMakefileGenerator.h" -# include "cmGlobalVisualStudio11Generator.h" # include "cmGlobalVisualStudio12Generator.h" # include "cmGlobalVisualStudio14Generator.h" # include "cmGlobalVisualStudio9Generator.h" @@ -2507,6 +2506,18 @@ int cmake::ActualConfigure() "Name of generator toolset.", cmStateEnums::INTERNAL); } + if (!this->State->GetInitializedCacheValue( + "CMAKE_CROSSCOMPILING_EMULATOR")) { + cm::optional<std::string> emulator = + cmSystemTools::GetEnvVar("CMAKE_CROSSCOMPILING_EMULATOR"); + if (emulator && !emulator->empty()) { + std::string message = + "Emulator to run executables and tests when cross compiling."; + this->AddCacheEntry("CMAKE_CROSSCOMPILING_EMULATOR", *emulator, message, + cmStateEnums::STRING); + } + } + // reset any system configuration information, except for when we are // InTryCompile. With TryCompile the system info is taken from the parent's // info to save time @@ -2605,7 +2616,6 @@ std::unique_ptr<cmGlobalGenerator> cmake::EvaluateDefaultGlobalGenerator() static VSVersionedGenerator const vsGenerators[] = { { "14.0", "Visual Studio 14 2015" }, // { "12.0", "Visual Studio 12 2013" }, // - { "11.0", "Visual Studio 11 2012" }, // { "9.0", "Visual Studio 9 2008" } }; static const char* const vsEntries[] = { @@ -2990,7 +3000,6 @@ void cmake::AddDefaultGenerators() cmGlobalVisualStudioVersionedGenerator::NewFactory15()); this->Generators.push_back(cmGlobalVisualStudio14Generator::NewFactory()); this->Generators.push_back(cmGlobalVisualStudio12Generator::NewFactory()); - this->Generators.push_back(cmGlobalVisualStudio11Generator::NewFactory()); this->Generators.push_back(cmGlobalVisualStudio9Generator::NewFactory()); this->Generators.push_back(cmGlobalBorlandMakefileGenerator::NewFactory()); this->Generators.push_back(cmGlobalNMakeMakefileGenerator::NewFactory()); @@ -3916,7 +3925,7 @@ std::function<int()> cmake::BuildWorkflowStep( return [builder]() -> int { auto chain = builder.Start(); chain.Wait(); - return static_cast<int>(chain.GetStatus().front()->ExitStatus); + return static_cast<int>(chain.GetStatus(0).ExitStatus); }; } #endif diff --git a/Source/cmake.h b/Source/cmake.h index 156d061..58f90c9 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -17,8 +17,9 @@ #include <cm/string_view> #include <cmext/string_view> -#include "cmDocumentationEntry.h" +#include "cmDocumentationEntry.h" // IWYU pragma: keep #include "cmGeneratedFileStream.h" +#include "cmGlobalGeneratorFactory.h" #include "cmInstalledFile.h" #include "cmListFileCache.h" #include "cmMessageType.h" @@ -48,7 +49,6 @@ class cmExternalMakefileProjectGeneratorFactory; class cmFileAPI; class cmFileTimeCache; class cmGlobalGenerator; -class cmGlobalGeneratorFactory; class cmMakefile; class cmMessenger; class cmVariableWatch; diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx index 0c8d8db..ce2479b 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -28,6 +28,7 @@ #include "cmSystemTools.h" #include "cmTransformDepfile.h" #include "cmUVProcessChain.h" +#include "cmUVStream.h" #include "cmUtils.hxx" #include "cmValue.h" #include "cmVersion.h" @@ -2008,7 +2009,7 @@ int cmcmd::RunPreprocessor(const std::vector<std::string>& command, .SetBuiltinStream(cmUVProcessChainBuilder::Stream_ERROR) .AddCommand(command); auto process = builder.Start(); - if (!process.Valid()) { + if (!process.Valid() || process.GetStatus(0).SpawnResult != 0) { std::cerr << "Failed to start preprocessor."; return 1; } @@ -2016,12 +2017,9 @@ int cmcmd::RunPreprocessor(const std::vector<std::string>& command, std::cerr << "Failed to wait for preprocessor"; return 1; } - auto status = process.GetStatus(); - if (!status[0] || status[0]->ExitStatus != 0) { - auto* errorStream = process.ErrorStream(); - if (errorStream) { - std::cerr << errorStream->rdbuf(); - } + if (process.GetStatus(0).ExitStatus != 0) { + cmUVPipeIStream errorStream(process.GetLoop(), process.ErrorStream()); + std::cerr << errorStream.rdbuf(); return 1; } @@ -2130,7 +2128,7 @@ int cmcmd::RunLLVMRC(std::vector<std::string> const& args) .AddCommand(resource_compile); auto process = builder.Start(); result = 0; - if (!process.Valid()) { + if (!process.Valid() || process.GetStatus(0).SpawnResult != 0) { std::cerr << "Failed to start resource compiler."; result = 1; } else { @@ -2144,12 +2142,9 @@ int cmcmd::RunLLVMRC(std::vector<std::string> const& args) if (result != 0) { return result; } - auto status = process.GetStatus(); - if (!status[0] || status[0]->ExitStatus != 0) { - auto* errorStream = process.ErrorStream(); - if (errorStream) { - std::cerr << errorStream->rdbuf(); - } + if (process.GetStatus(0).ExitStatus != 0) { + cmUVPipeIStream errorStream(process.GetLoop(), process.ErrorStream()); + std::cerr << errorStream.rdbuf(); return 1; } diff --git a/Tests/CMakeLib/CMakeLists.txt b/Tests/CMakeLib/CMakeLists.txt index 5c14de2..4454f49 100644 --- a/Tests/CMakeLib/CMakeLists.txt +++ b/Tests/CMakeLib/CMakeLists.txt @@ -31,6 +31,7 @@ set(CMakeLib_TESTS testCMExtAlgorithm.cxx testCMExtEnumSet.cxx testList.cxx + testCMakePath.cxx ) if(CMake_ENABLE_DEBUGGER) list(APPEND CMakeLib_TESTS @@ -63,10 +64,15 @@ if(WIN32) endif() configure_file(testXMLParser.h.in testXMLParser.h @ONLY) +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/testUVProcessChainInput.txt" "HELLO WORLD!") create_test_sourcelist(CMakeLib_TEST_SRCS CMakeLibTests.cxx ${CMakeLib_TESTS}) add_executable(CMakeLibTests ${CMakeLib_TEST_SRCS}) -target_link_libraries(CMakeLibTests CMakeLib CTestLib) +target_link_libraries(CMakeLibTests PRIVATE CTestLib CMakeLib) +if(CMake_BUILD_PCH) + target_precompile_headers(CMakeLibTests PRIVATE "<iostream>" "<cm3p/uv.h>") + target_compile_definitions(CMakeLibTests PRIVATE "NOMINMAX") +endif() set_property(TARGET CMakeLibTests PROPERTY C_CLANG_TIDY "") set_property(TARGET CMakeLibTests PROPERTY CXX_CLANG_TIDY "") diff --git a/Tests/CMakeLib/testCMExtAlgorithm.cxx b/Tests/CMakeLib/testCMExtAlgorithm.cxx index c909f24..53b0302 100644 --- a/Tests/CMakeLib/testCMExtAlgorithm.cxx +++ b/Tests/CMakeLib/testCMExtAlgorithm.cxx @@ -1,6 +1,5 @@ #include <iostream> #include <memory> -#include <type_traits> #include <utility> #include <vector> diff --git a/Tests/CMakeLib/testCMakePath.cxx b/Tests/CMakeLib/testCMakePath.cxx new file mode 100644 index 0000000..aa17e50 --- /dev/null +++ b/Tests/CMakeLib/testCMakePath.cxx @@ -0,0 +1,441 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ + +#include "cmConfigure.h" // IWYU pragma: keep + +#include <iostream> +#include <string> +#include <utility> + +#include <cm/string_view> +#include <cmext/string_view> + +#include "cmCMakePath.h" + +namespace { + +void checkResult(bool success) +{ + if (!success) { + std::cout << " => failed"; + } + std::cout << std::endl; +} + +bool testConstructors() +{ + std::cout << "testConstructors()"; + + bool result = true; + + { + cmCMakePath path; + if (!path.String().empty() || path != cmCMakePath{}) { + result = false; + } + } + { + cmCMakePath path{ "aa/bb" }; + if (path.String() != "aa/bb") { + result = false; + } + } + { + std::string s{ "aa/bb" }; + cmCMakePath path{ s }; + if (path.String() != "aa/bb") { + result = false; + } + } + { + cmCMakePath path{ "aa/bb"_s }; + if (path.String() != "aa/bb") { + result = false; + } + } + { + cmCMakePath path1{ "aa/bb" }; + cmCMakePath path2("aa/bb"_s); + + if (path1 != path2) { + result = false; + } + if (path1.String() != "aa/bb") { + result = false; + } + if (path1.String() != path2.String()) { + result = false; + } + } + { + cmCMakePath path1{ "aa/bb" }; + cmCMakePath path2{ path1 }; + + if (path1 != path2) { + result = false; + } + if (path1.String() != "aa/bb") { + result = false; + } + if (path1.String() != path2.String()) { + result = false; + } + } + + checkResult(result); + + return result; +} + +bool testAssign() +{ + std::cout << "testAssign()"; + + bool result = true; + + { + cmCMakePath path1{ "aa/bb" }; + cmCMakePath path2{ "cc/dd" }; + + path2 = path1; + if (path1 != path2) { + result = false; + } + if (path1.String() != "aa/bb") { + result = false; + } + if (path1.String() != path2.String()) { + result = false; + } + } + { + cmCMakePath path1{ "aa/bb" }; + cmCMakePath path2{ "cc/dd" }; + + path2 = std::move(path1); + if (path2.String() != "aa/bb") { + result = false; + } + } + { + std::string path1{ "aa/bb" }; + cmCMakePath path2{ "cc/dd" }; + + path2 = path1; + if (path2.String() != "aa/bb") { + result = false; + } + } + { + std::string path1{ "aa/bb" }; + cmCMakePath path2{ "cc/dd" }; + + path2 = std::move(path1); + if (path2.String() != "aa/bb") { + result = false; + } + } + { + cm::string_view path1{ "aa/bb" }; + cmCMakePath path2{ "cc/dd" }; + + path2 = path1; + if (path2.String() != "aa/bb") { + result = false; + } + } + { + char path1[] = "aa/bb"; + cmCMakePath path2{ "cc/dd" }; + + path2 = path1; + if (path2.String() != "aa/bb") { + result = false; + } + } + { + std::string path1{ "aa/bb" }; + cmCMakePath path2{ "cc/dd" }; + + path2.Assign(path1); + if (path2.String() != path1) { + result = false; + } + } + { + std::string path1{ "aa/bb" }; + cmCMakePath path2{ "cc/dd" }; + + path2.Assign(std::move(path1)); + if (path2.String() != "aa/bb") { + result = false; + } + } + { + cm::string_view path1{ "aa/bb" }; + cmCMakePath path2{ "cc/dd" }; + + path2.Assign(path1); + if (path2.String() != path1) { + result = false; + } + } + { + char path1[] = "aa/bb"; + cmCMakePath path2{ "cc/dd" }; + + path2.Assign(path1); + if (path2.String() != path1) { + result = false; + } + } + + checkResult(result); + + return result; +} + +bool testConcat() +{ + std::cout << "testConcat()"; + + bool result = true; + + { + cmCMakePath path1{ "aa/bb" }; + cmCMakePath path2{ "cc/dd" }; + + path2 += path1; + + if (path2.String() != "cc/ddaa/bb") { + result = false; + } + } + { + cmCMakePath path1{ "aa/bb" }; + cmCMakePath path2{ "cc/dd" }; + + path2 += std::move(path1); + if (path2.String() != "cc/ddaa/bb") { + result = false; + } + } + { + std::string path1{ "aa/bb" }; + cmCMakePath path2{ "cc/dd" }; + + path2 += path1; + if (path2.String() != "cc/ddaa/bb") { + result = false; + } + } + { + std::string path1{ "aa/bb" }; + cmCMakePath path2{ "cc/dd" }; + + path2 += std::move(path1); + if (path2.String() != "cc/ddaa/bb") { + result = false; + } + } + { + cm::string_view path1{ "aa/bb" }; + cmCMakePath path2{ "cc/dd" }; + + path2 += path1; + if (path2.String() != "cc/ddaa/bb") { + result = false; + } + } + { + char path1[] = "aa/bb"; + cmCMakePath path2{ "cc/dd" }; + + path2 += path1; + if (path2.String() != "cc/ddaa/bb") { + result = false; + } + } + { + cmCMakePath path1{ "aa/bb" }; + cmCMakePath path2{ "cc/dd" }; + + path2.Concat(path1); + if (path2.String() != "cc/ddaa/bb") { + result = false; + } + } + { + std::string path1{ "aa/bb" }; + cmCMakePath path2{ "cc/dd" }; + + path2.Concat(path1); + if (path2.String() != "cc/ddaa/bb") { + result = false; + } + } + { + std::string path1{ "aa/bb" }; + cmCMakePath path2{ "cc/dd" }; + + path2.Concat(std::move(path1)); + if (path2.String() != "cc/ddaa/bb") { + result = false; + } + } + { + cm::string_view path1{ "aa/bb" }; + cmCMakePath path2{ "cc/dd" }; + + path2.Concat(path1); + if (path2.String() != "cc/ddaa/bb") { + result = false; + } + } + { + char path1[] = "aa/bb"; + cmCMakePath path2{ "cc/dd" }; + + path2.Concat(path1); + if (path2.String() != "cc/ddaa/bb") { + result = false; + } + } + + checkResult(result); + + return result; +} + +bool testAppend() +{ + std::cout << "testAppend()"; + + bool result = true; + + { + cmCMakePath path1{ "aa/bb" }; + cmCMakePath path2{ "cc/dd" }; + + path2 /= path1; + + if (path2.String() != "cc/dd/aa/bb") { + result = false; + } + } + { + cmCMakePath path1{ "aa/bb" }; + cmCMakePath path2{ "cc/dd" }; + + path2 /= std::move(path1); + if (path2.String() != "cc/dd/aa/bb") { + result = false; + } + } + { + std::string path1{ "aa/bb" }; + cmCMakePath path2{ "cc/dd" }; + + path2 /= path1; + if (path2.String() != "cc/dd/aa/bb") { + result = false; + } + } + { + std::string path1{ "aa/bb" }; + cmCMakePath path2{ "cc/dd" }; + + path2 /= std::move(path1); + if (path2.String() != "cc/dd/aa/bb") { + result = false; + } + } + { + cm::string_view path1{ "aa/bb" }; + cmCMakePath path2{ "cc/dd" }; + + path2 /= path1; + if (path2.String() != "cc/dd/aa/bb") { + result = false; + } + } + { + char path1[] = "aa/bb"; + cmCMakePath path2{ "cc/dd" }; + + path2 /= path1; + if (path2.String() != "cc/dd/aa/bb") { + result = false; + } + } + { + cmCMakePath path1{ "aa/bb" }; + cmCMakePath path2{ "cc/dd" }; + + path2.Append(path1); + if (path2.String() != "cc/dd/aa/bb") { + result = false; + } + } + { + std::string path1{ "aa/bb" }; + cmCMakePath path2{ "cc/dd" }; + + path2.Append(path1); + if (path2.String() != "cc/dd/aa/bb") { + result = false; + } + } + { + std::string path1{ "aa/bb" }; + cmCMakePath path2{ "cc/dd" }; + + path2.Append(std::move(path1)); + if (path2.String() != "cc/dd/aa/bb") { + result = false; + } + } + { + cm::string_view path1{ "aa/bb" }; + cmCMakePath path2{ "cc/dd" }; + + path2.Append(path1); + if (path2.String() != "cc/dd/aa/bb") { + result = false; + } + } + { + char path1[] = "aa/bb"; + cmCMakePath path2{ "cc/dd" }; + + path2.Append(path1); + if (path2.String() != "cc/dd/aa/bb") { + result = false; + } + } + + checkResult(result); + + return result; +} +} + +int testCMakePath(int /*unused*/, char* /*unused*/[]) +{ + int result = 0; + + if (!testConstructors()) { + result = 1; + } + if (!testAssign()) { + result = 1; + } + if (!testConcat()) { + result = 1; + } + if (!testAppend()) { + result = 1; + } + + return result; +} diff --git a/Tests/CMakeLib/testEncoding.cxx b/Tests/CMakeLib/testEncoding.cxx index 4936898..460d845 100644 --- a/Tests/CMakeLib/testEncoding.cxx +++ b/Tests/CMakeLib/testEncoding.cxx @@ -1,4 +1,5 @@ #include <iostream> +#include <iterator> #include <string> #include "cmsys/FStream.hxx" diff --git a/Tests/CMakeLib/testGccDepfileReader.cxx b/Tests/CMakeLib/testGccDepfileReader.cxx index d46e8f3..fb19c14 100644 --- a/Tests/CMakeLib/testGccDepfileReader.cxx +++ b/Tests/CMakeLib/testGccDepfileReader.cxx @@ -1,6 +1,5 @@ #include <cstddef> // IWYU pragma: keep #include <iostream> -#include <memory> #include <string> #include <utility> #include <vector> diff --git a/Tests/CMakeLib/testList.cxx b/Tests/CMakeLib/testList.cxx index f6ec720..3e99ae8 100644 --- a/Tests/CMakeLib/testList.cxx +++ b/Tests/CMakeLib/testList.cxx @@ -4,7 +4,6 @@ #include <iostream> #include <stdexcept> #include <string> -#include <type_traits> #include <utility> #include <vector> diff --git a/Tests/CMakeLib/testOptional.cxx b/Tests/CMakeLib/testOptional.cxx index 785f031..933ab70 100644 --- a/Tests/CMakeLib/testOptional.cxx +++ b/Tests/CMakeLib/testOptional.cxx @@ -1,5 +1,4 @@ #include <iostream> -#include <type_traits> #include <vector> #include <cm/optional> diff --git a/Tests/CMakeLib/testString.cxx b/Tests/CMakeLib/testString.cxx index af34a2f..3509266 100644 --- a/Tests/CMakeLib/testString.cxx +++ b/Tests/CMakeLib/testString.cxx @@ -1,14 +1,12 @@ /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying file Copyright.txt or https://cmake.org/licensing for details. */ -#include <cstddef> // IWYU pragma: keep #include <cstring> #include <iostream> #include <iterator> #include <sstream> #include <stdexcept> #include <string> -#include <type_traits> #include <utility> #include <cm/string_view> diff --git a/Tests/CMakeLib/testUVProcessChain.cxx b/Tests/CMakeLib/testUVProcessChain.cxx index 7027689..fc84bb0 100644 --- a/Tests/CMakeLib/testUVProcessChain.cxx +++ b/Tests/CMakeLib/testUVProcessChain.cxx @@ -1,10 +1,10 @@ #include <algorithm> #include <csignal> +#include <cstdio> #include <functional> #include <iostream> #include <sstream> #include <string> -#include <type_traits> #include <utility> #include <vector> @@ -16,11 +16,11 @@ #include "cmStringAlgorithms.h" #include "cmUVHandlePtr.h" #include "cmUVProcessChain.h" +#include "cmUVStream.h" #include "cmUVStreambuf.h" struct ExpectedStatus { - bool Finished; bool MatchExitStatus; bool MatchTermSignal; cmUVProcessChain::Status Status; @@ -28,38 +28,6 @@ struct ExpectedStatus std::string ExceptionString; }; -static const std::vector<ExpectedStatus> status1 = { - { false, false, false, { 0, 0 }, cmUVProcessChain::ExceptionCode::None, "" }, - { false, false, false, { 0, 0 }, cmUVProcessChain::ExceptionCode::None, "" }, - { false, false, false, { 0, 0 }, cmUVProcessChain::ExceptionCode::None, "" }, -}; - -static const std::vector<ExpectedStatus> status2 = { - { true, true, true, { 0, 0 }, cmUVProcessChain::ExceptionCode::None, "" }, - { false, false, false, { 0, 0 }, cmUVProcessChain::ExceptionCode::None, "" }, - { false, false, false, { 0, 0 }, cmUVProcessChain::ExceptionCode::None, "" }, -}; - -static const std::vector<ExpectedStatus> status3 = { - { true, true, true, { 0, 0 }, cmUVProcessChain::ExceptionCode::None, "" }, - { true, true, true, { 1, 0 }, cmUVProcessChain::ExceptionCode::None, "" }, -#ifdef _WIN32 - { true, - true, - true, - { STATUS_ACCESS_VIOLATION, 0 }, - cmUVProcessChain::ExceptionCode::Fault, - "Access violation" }, -#else - { true, - false, - true, - { 0, SIGABRT }, - cmUVProcessChain::ExceptionCode::Other, - "Subprocess aborted" }, -#endif -}; - static const char* ExceptionCodeToString(cmUVProcessChain::ExceptionCode code) { switch (code) { @@ -73,6 +41,8 @@ static const char* ExceptionCodeToString(cmUVProcessChain::ExceptionCode code) return "Interrupt"; case cmUVProcessChain::ExceptionCode::Numerical: return "Numerical"; + case cmUVProcessChain::ExceptionCode::Spawn: + return "Spawn"; case cmUVProcessChain::ExceptionCode::Other: return "Other"; default: @@ -83,9 +53,10 @@ static const char* ExceptionCodeToString(cmUVProcessChain::ExceptionCode code) bool operator==(const cmUVProcessChain::Status* actual, const ExpectedStatus& expected) { - if (!expected.Finished) { - return !actual; - } else if (!actual) { + if (expected.Status.SpawnResult != actual->SpawnResult) { + return false; + } + if (expected.Status.Finished != actual->Finished) { return false; } if (expected.MatchExitStatus && @@ -96,7 +67,7 @@ bool operator==(const cmUVProcessChain::Status* actual, expected.Status.TermSignal != actual->TermSignal) { return false; } - if (expected.Finished && + if (expected.Status.Finished && std::make_pair(expected.ExceptionCode, expected.ExceptionString) != actual->GetException()) { return false; @@ -150,39 +121,96 @@ static void printResults( { std::cout << "Expected: " << std::endl; for (auto const& e : expected) { - if (e.Finished) { - std::cout << " ExitStatus: " - << printExpected(e.MatchExitStatus, e.Status.ExitStatus) - << ", TermSignal: " - << printExpected(e.MatchTermSignal, e.Status.TermSignal) - << ", ExceptionCode: " - << printExpected(e.Finished, - ExceptionCodeToString(e.ExceptionCode)) - << ", ExceptionString: \"" - << printExpected(e.Finished, e.ExceptionString) << '"' - << std::endl; - } else { - std::cout << " null" << std::endl; - } + std::cout << " SpawnResult: " << e.Status.SpawnResult + << ", Finished: " << e.Status.Finished << ", ExitStatus: " + << printExpected(e.MatchExitStatus, e.Status.ExitStatus) + << ", TermSignal: " + << printExpected(e.MatchTermSignal, e.Status.TermSignal) + << ", ExceptionCode: " + << printExpected(e.Status.Finished, + ExceptionCodeToString(e.ExceptionCode)) + << ", ExceptionString: \"" + << printExpected(e.Status.Finished, e.ExceptionString) << '"' + << std::endl; } std::cout << "Actual:" << std::endl; for (auto const& a : actual) { - if (a) { - auto exception = a->GetException(); - std::cout << " ExitStatus: " << a->ExitStatus - << ", TermSignal: " << a->TermSignal << ", ExceptionCode: " - << ExceptionCodeToString(exception.first) - << ", ExceptionString: \"" << exception.second << '"' - << std::endl; - } else { - std::cout << " null" << std::endl; - } + auto exception = a->GetException(); + std::cout << " SpawnResult: " << a->SpawnResult + << ", Finished: " << a->Finished + << ", ExitStatus: " << a->ExitStatus + << ", TermSignal: " << a->TermSignal + << ", ExceptionCode: " << ExceptionCodeToString(exception.first) + << ", ExceptionString: \"" << exception.second << '"' + << std::endl; } } static bool checkExecution(cmUVProcessChainBuilder& builder, std::unique_ptr<cmUVProcessChain>& chain) { + static const std::vector<ExpectedStatus> status1 = { + { false, + false, + { 0, false, 0, 0 }, + cmUVProcessChain::ExceptionCode::None, + "" }, + { false, + false, + { 0, false, 0, 0 }, + cmUVProcessChain::ExceptionCode::None, + "" }, + { false, + false, + { 0, false, 0, 0 }, + cmUVProcessChain::ExceptionCode::None, + "" }, + }; + + static const std::vector<ExpectedStatus> status2 = { + { true, + true, + { 0, true, 0, 0 }, + cmUVProcessChain::ExceptionCode::None, + "" }, + { false, + false, + { 0, false, 0, 0 }, + cmUVProcessChain::ExceptionCode::None, + "" }, + { false, + false, + { 0, false, 0, 0 }, + cmUVProcessChain::ExceptionCode::None, + "" }, + }; + + static const std::vector<ExpectedStatus> status3 = { + { true, + true, + { 0, true, 0, 0 }, + cmUVProcessChain::ExceptionCode::None, + "" }, + { true, + true, + { 0, true, 1, 0 }, + cmUVProcessChain::ExceptionCode::None, + "" }, +#ifdef _WIN32 + { true, + true, + { 0, true, STATUS_ACCESS_VIOLATION, 0 }, + cmUVProcessChain::ExceptionCode::Fault, + "Access violation" }, +#else + { false, + true, + { 0, true, 0, SIGABRT }, + cmUVProcessChain::ExceptionCode::Other, + "Subprocess aborted" }, +#endif + }; + std::vector<const cmUVProcessChain::Status*> status; chain = cm::make_unique<cmUVProcessChain>(builder.Start()); @@ -201,7 +229,7 @@ static bool checkExecution(cmUVProcessChainBuilder& builder, return false; } - if (chain->Wait(6000)) { + if (chain->Wait(9000)) { std::cout << "Wait() returned true, should be false" << std::endl; return false; } @@ -273,16 +301,19 @@ bool testUVProcessChainBuiltin(const char* helperCommand) return false; } - if (!chain->OutputStream()) { - std::cout << "OutputStream() was null, expecting not null" << std::endl; + if (chain->OutputStream() < 0) { + std::cout << "OutputStream() was invalid, expecting valid" << std::endl; return false; } - if (!chain->ErrorStream()) { - std::cout << "ErrorStream() was null, expecting not null" << std::endl; + if (chain->ErrorStream() < 0) { + std::cout << "ErrorStream() was invalid, expecting valid" << std::endl; return false; } - if (!checkOutput(*chain->OutputStream(), *chain->ErrorStream())) { + cmUVPipeIStream output(chain->GetLoop(), chain->OutputStream()); + cmUVPipeIStream error(chain->GetLoop(), chain->ErrorStream()); + + if (!checkOutput(output, error)) { return false; } @@ -302,12 +333,12 @@ bool testUVProcessChainBuiltinMerged(const char* helperCommand) return false; } - if (!chain->OutputStream()) { - std::cout << "OutputStream() was null, expecting not null" << std::endl; + if (chain->OutputStream() < 0) { + std::cout << "OutputStream() was invalid, expecting valid" << std::endl; return false; } - if (!chain->ErrorStream()) { - std::cout << "ErrorStream() was null, expecting not null" << std::endl; + if (chain->ErrorStream() < 0) { + std::cout << "ErrorStream() was invalid, expecting valid" << std::endl; return false; } if (chain->OutputStream() != chain->ErrorStream()) { @@ -316,7 +347,9 @@ bool testUVProcessChainBuiltinMerged(const char* helperCommand) return false; } - std::string merged = getInput(*chain->OutputStream()); + cmUVPipeIStream mergedStream(chain->GetLoop(), chain->OutputStream()); + + std::string merged = getInput(mergedStream); auto qemuErrorPos = merged.find("qemu:"); if (qemuErrorPos != std::string::npos) { merged.resize(qemuErrorPos); @@ -370,12 +403,12 @@ bool testUVProcessChainExternal(const char* helperCommand) return false; } - if (chain->OutputStream()) { - std::cout << "OutputStream() was not null, expecting null" << std::endl; + if (chain->OutputStream() >= 0) { + std::cout << "OutputStream() was valid, expecting invalid" << std::endl; return false; } - if (chain->ErrorStream()) { - std::cout << "ErrorStream() was not null, expecting null" << std::endl; + if (chain->ErrorStream() >= 0) { + std::cout << "ErrorStream() was valid, expecting invalid" << std::endl; return false; } @@ -418,12 +451,12 @@ bool testUVProcessChainNone(const char* helperCommand) return false; } - if (chain->OutputStream()) { - std::cout << "OutputStream() was not null, expecting null" << std::endl; + if (chain->OutputStream() >= 0) { + std::cout << "OutputStream() was valid, expecting invalid" << std::endl; return false; } - if (chain->ErrorStream()) { - std::cout << "ErrorStream() was not null, expecting null" << std::endl; + if (chain->ErrorStream() >= 0) { + std::cout << "ErrorStream() was valid, expecting invalid" << std::endl; return false; } @@ -445,7 +478,8 @@ bool testUVProcessChainCwdUnchanged(const char* helperCommand) return false; } - auto cwd = getInput(*chain.OutputStream()); + cmUVPipeIStream output(chain.GetLoop(), chain.OutputStream()); + auto cwd = getInput(output); if (!cmHasLiteralSuffix(cwd, "/Tests/CMakeLib")) { std::cout << "Working directory was \"" << cwd << "\", expected to end in \"/Tests/CMakeLib\"" << std::endl; @@ -471,7 +505,8 @@ bool testUVProcessChainCwdChanged(const char* helperCommand) return false; } - auto cwd = getInput(*chain.OutputStream()); + cmUVPipeIStream output(chain.GetLoop(), chain.OutputStream()); + auto cwd = getInput(output); if (!cmHasLiteralSuffix(cwd, "/Tests")) { std::cout << "Working directory was \"" << cwd << "\", expected to end in \"/Tests\"" << std::endl; @@ -481,6 +516,155 @@ bool testUVProcessChainCwdChanged(const char* helperCommand) return true; } +bool testUVProcessChainSpawnFail(const char* helperCommand) +{ + static const std::vector<ExpectedStatus> status1 = { + { false, + false, + { 0, false, 0, 0 }, + cmUVProcessChain::ExceptionCode::None, + "" }, + { false, + false, + { UV_ENOENT, true, 0, 0 }, + cmUVProcessChain::ExceptionCode::Spawn, + uv_strerror(UV_ENOENT) }, +#ifdef _WIN32 + { true, + true, + { 0, true, STATUS_ACCESS_VIOLATION, 0 }, + cmUVProcessChain::ExceptionCode::Fault, + "Access violation" }, +#else + { false, + true, + { 0, true, 0, SIGABRT }, + cmUVProcessChain::ExceptionCode::Other, + "Subprocess aborted" }, +#endif + }; + + static const std::vector<ExpectedStatus> status2 = { +#ifdef _WIN32 + { true, + true, + { 0, true, 0, 0 }, + cmUVProcessChain::ExceptionCode::None, + "" }, +#else + { false, + true, + { 0, true, 0, SIGPIPE }, + cmUVProcessChain::ExceptionCode::Other, + "SIGPIPE" }, +#endif + { false, + false, + { UV_ENOENT, true, 0, 0 }, + cmUVProcessChain::ExceptionCode::Spawn, + uv_strerror(UV_ENOENT) }, +#ifdef _WIN32 + { true, + true, + { 0, true, STATUS_ACCESS_VIOLATION, 0 }, + cmUVProcessChain::ExceptionCode::Fault, + "Access violation" }, +#else + { false, + true, + { 0, true, 0, SIGABRT }, + cmUVProcessChain::ExceptionCode::Other, + "Subprocess aborted" }, +#endif + }; + + std::vector<const cmUVProcessChain::Status*> status; + + cmUVProcessChainBuilder builder; + builder.AddCommand({ helperCommand, "echo" }) + .AddCommand({ "this_command_is_for_cmake_and_should_never_exist" }) + .AddCommand({ helperCommand, "dedup" }) + .SetBuiltinStream(cmUVProcessChainBuilder::Stream_OUTPUT) + .SetBuiltinStream(cmUVProcessChainBuilder::Stream_ERROR); + + auto chain = builder.Start(); + if (!chain.Valid()) { + std::cout << "Valid() returned false, should be true" << std::endl; + return false; + } + + // Some platforms, like Solaris 10, take a long time to report a trapped + // subprocess to the parent process (about 1.7 seconds in the case of + // Solaris 10.) Wait 3 seconds to give it enough time. + if (chain.Wait(3000)) { + std::cout << "Wait() did not time out" << std::endl; + return false; + } + + status = chain.GetStatus(); + if (!resultsMatch(status, status1)) { + std::cout << "GetStatus() did not produce expected output" << std::endl; + printResults(status, status1); + return false; + } + + if (!chain.Wait()) { + std::cout << "Wait() timed out" << std::endl; + return false; + } + + status = chain.GetStatus(); + if (!resultsMatch(status, status2)) { + std::cout << "GetStatus() did not produce expected output" << std::endl; + printResults(status, status2); + return false; + } + + return true; +} + +bool testUVProcessChainInputFile(const char* helperCommand) +{ + std::unique_ptr<FILE, int (*)(FILE*)> f( + fopen("testUVProcessChainInput.txt", "rb"), fclose); + + cmUVProcessChainBuilder builder; + builder.AddCommand({ helperCommand, "dedup" }) + .SetExternalStream(cmUVProcessChainBuilder::Stream_INPUT, fileno(f.get())) + .SetBuiltinStream(cmUVProcessChainBuilder::Stream_OUTPUT); + + auto chain = builder.Start(); + + if (!chain.Wait()) { + std::cout << "Wait() timed out" << std::endl; + return false; + } + + cmUVPipeIStream stream(chain.GetLoop(), chain.OutputStream()); + std::string output = getInput(stream); + if (output != "HELO WRD!") { + std::cout << "Output was \"" << output << "\", expected \"HELO WRD!\"" + << std::endl; + return false; + } + + return true; +} + +bool testUVProcessChainWait0(const char* helperCommand) +{ + cmUVProcessChainBuilder builder; + builder.AddCommand({ helperCommand, "echo" }); + + auto chain = builder.Start(); + if (!chain.Wait(0)) { + std::cout << "Wait(0) returned false, should be true" << std::endl; + return false; + } + + return true; +} + int testUVProcessChain(int argc, char** const argv) { if (argc < 2) { @@ -518,5 +702,20 @@ int testUVProcessChain(int argc, char** const argv) return -1; } + if (!testUVProcessChainSpawnFail(argv[1])) { + std::cout << "While executing testUVProcessChainSpawnFail().\n"; + return -1; + } + + if (!testUVProcessChainInputFile(argv[1])) { + std::cout << "While executing testUVProcessChainInputFile().\n"; + return -1; + } + + if (!testUVProcessChainWait0(argv[1])) { + std::cout << "While executing testUVProcessChainWait0().\n"; + return -1; + } + return 0; } diff --git a/Tests/CMakeLib/testUVProcessChainHelper.cxx b/Tests/CMakeLib/testUVProcessChainHelper.cxx index 99743e7..fcc45b0 100644 --- a/Tests/CMakeLib/testUVProcessChainHelper.cxx +++ b/Tests/CMakeLib/testUVProcessChainHelper.cxx @@ -32,13 +32,13 @@ int main(int argc, char** argv) std::string command = argv[1]; if (command == "echo") { - std::this_thread::sleep_for(std::chrono::milliseconds(3000)); + std::this_thread::sleep_for(std::chrono::milliseconds(6000)); std::cout << "HELLO world!" << std::flush; std::cerr << "1" << std::flush; return 0; } if (command == "capitalize") { - std::this_thread::sleep_for(std::chrono::milliseconds(9000)); + std::this_thread::sleep_for(std::chrono::milliseconds(12000)); std::string input = getStdin(); for (auto& c : input) { c = static_cast<char>(std::toupper(c)); diff --git a/Tests/CMakeLib/testUVStreambuf.cxx b/Tests/CMakeLib/testUVStreambuf.cxx index f9ed6af..f3977d4 100644 --- a/Tests/CMakeLib/testUVStreambuf.cxx +++ b/Tests/CMakeLib/testUVStreambuf.cxx @@ -3,11 +3,14 @@ #include <string> #include <vector> +#include <cmext/algorithm> + #include <cm3p/uv.h> #include <stdint.h> #include "cmGetPipes.h" #include "cmUVHandlePtr.h" +#include "cmUVStream.h" #include "cmUVStreambuf.h" #define TEST_STR_LINE_1 "This string must be exactly 128 characters long so" @@ -437,6 +440,90 @@ end: return success; } +bool testUVPipeIStream() +{ + int pipe[] = { -1, -1 }; + if (cmGetPipes(pipe) < 0) { + std::cout << "cmGetPipes() returned an error" << std::endl; + return false; + } + + cm::uv_loop_ptr loop; + loop.init(); + cm::uv_pipe_ptr pipeSink; + pipeSink.init(*loop, 0); + uv_pipe_open(pipeSink, pipe[1]); + + std::string str = "Hello world!\n"; + uv_write_t writeReq; + uv_buf_t buf; + buf.base = &str.front(); + buf.len = str.length(); + uv_write(&writeReq, pipeSink, &buf, 1, nullptr); + uv_run(loop, UV_RUN_DEFAULT); + + cmUVPipeIStream pin(*loop, pipe[0]); + std::string line; + std::getline(pin, line); + if (line != "Hello world!") { + std::cout << "Line was \"" << line << "\", should be \"Hello world!\"" + << std::endl; + return false; + } + + return true; +} + +bool testUVStreamRead() +{ + int pipe[] = { -1, -1 }; + if (cmGetPipes(pipe) < 0) { + std::cout << "cmGetPipes() returned an error" << std::endl; + return false; + } + + cm::uv_loop_ptr loop; + loop.init(); + cm::uv_pipe_ptr pipeSink; + pipeSink.init(*loop, 0); + uv_pipe_open(pipeSink, pipe[1]); + + std::string str = "Hello world!"; + uv_write_t writeReq; + uv_buf_t buf; + buf.base = &str.front(); + buf.len = str.length(); + uv_write(&writeReq, pipeSink, &buf, 1, nullptr); + uv_run(loop, UV_RUN_DEFAULT); + pipeSink.reset(); + + cm::uv_pipe_ptr pipeSource; + pipeSource.init(*loop, 0); + uv_pipe_open(pipeSource, pipe[0]); + + std::string output; + bool finished = false; + cmUVStreamRead( + pipeSource, + [&output](std::vector<char> data) { cm::append(output, data); }, + [&output, &finished]() { + if (output != "Hello world!") { + std::cout << "Output was \"" << output + << "\", should be \"Hello world!\"" << std::endl; + return; + } + finished = true; + }); + uv_run(loop, UV_RUN_DEFAULT); + + if (!finished) { + std::cout << "finished was not set" << std::endl; + return false; + } + + return true; +} + int testUVStreambuf(int argc, char** const argv) { if (argc < 2) { @@ -454,5 +541,15 @@ int testUVStreambuf(int argc, char** const argv) return -1; } + if (!testUVPipeIStream()) { + std::cout << "While executing testUVPipeIStream().\n"; + return -1; + } + + if (!testUVStreamRead()) { + std::cout << "While executing testUVPipeIStream().\n"; + return -1; + } + return 0; } diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 19dea8f..f5ce6d9 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -42,8 +42,8 @@ endif() # Suppress generator deprecation warnings in test suite. if(CMAKE_GENERATOR MATCHES "^Visual Studio 9 2008") set(TEST_WARN_VS_CODE "set(ENV{CMAKE_WARN_VS9} OFF)") -elseif(CMAKE_GENERATOR MATCHES "^Visual Studio 11 2012") - set(TEST_WARN_VS_CODE "set(ENV{CMAKE_WARN_VS11} OFF)") +elseif(CMAKE_GENERATOR MATCHES "^Visual Studio 12 2013") + set(TEST_WARN_VS_CODE "set(ENV{CMAKE_WARN_VS12} OFF)") else() set(TEST_WARN_VS_CODE "") endif() @@ -1540,10 +1540,40 @@ if(BUILD_TESTING) add_subdirectory(GoogleTest) endif() - if(CMake_TEST_FindPython OR CMake_TEST_FindPython_SABIModule OR CMake_TEST_FindPython_NumPy - OR CMake_TEST_FindPython_Conda OR CMake_TEST_FindPython_IronPython OR CMake_TEST_FindPython_PyPy) - if (CMake_TEST_FindPython AND CMAKE_SYSTEM_NAME MATCHES "Linux|Darwin") - set(CMake_TEST_FindPython_SABIModule TRUE) + if(CMake_TEST_FindPython) + set(CMake_TEST_FindPython2 TRUE) + set(CMake_TEST_FindPython3 TRUE) + endif() + if(CMake_TEST_FindPython_SABIMOdule) + set(CMake_TEST_FindPython2_SABIModule TRUE) + set(CMake_TEST_FindPython3_SABIModule TRUE) + endif() + if(CMake_TEST_FindPython_NumPy) + set(CMake_TEST_FindPython2_NumPyy TRUE) + set(CMake_TEST_FindPython3_NumPy TRUE) + endif() + if(CMake_TEST_FindPython_Conda) + set(CMake_TEST_FindPython3_Conda TRUE) + endif() + if(CMake_TEST_FindPython_IronPython) + set(CMake_TEST_FindPython2_IronPython TRUE) + set(CMake_TEST_FindPython3_IronPython TRUE) + endif() + if(CMake_TEST_FindPython_PyPy) + set(CMake_TEST_FindPython2_PyPy TRUE) + set(CMake_TEST_FindPython3_PyPy TRUE) + endif() + if(CMake_TEST_FindPython2 OR CMake_TEST_FindPython3 + OR CMake_TEST_FindPython2_SABIModule OR CMake_TEST_FindPython3_SABIModule + OR CMake_TEST_FindPython2_NumPy OR CMake_TEST_FindPython3_NumPy + OR CMake_TEST_FindPython3_Conda + OR CMake_TEST_FindPython2_IronPython OR CMake_TEST_FindPython3_IronPython + OR CMake_TEST_FindPython2_PyPy OR CMake_TEST_FindPython3_PyPy) + if (CMake_TEST_FindPython2 AND CMAKE_SYSTEM_NAME MATCHES "Linux|Darwin") + set(CMake_TEST_FindPython2_SABIModule TRUE) + endif() + if (CMake_TEST_FindPython3 AND CMAKE_SYSTEM_NAME MATCHES "Linux|Darwin") + set(CMake_TEST_FindPython3_SABIModule TRUE) endif() add_subdirectory(FindPython) endif() @@ -2279,11 +2309,6 @@ if(BUILD_TESTING) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/VSWinStorePhone/${name}") endmacro() - if(vs11 AND ws80) - add_test_VSWinStorePhone(vs11-store80-X86 "Visual Studio 11 2012" WindowsStore 8.0 Win32) - add_test_VSWinStorePhone(vs11-store80-ARM "Visual Studio 11 2012" WindowsStore 8.0 ARM) - add_test_VSWinStorePhone(vs11-store80-X64 "Visual Studio 11 2012" WindowsStore 8.0 x64) - endif() if(vs12 AND ws81) add_test_VSWinStorePhone(vs12-store81-X86 "Visual Studio 12 2013" WindowsStore 8.1 Win32) add_test_VSWinStorePhone(vs12-store81-ARM "Visual Studio 12 2013" WindowsStore 8.1 ARM) @@ -2311,10 +2336,6 @@ if(BUILD_TESTING) add_test_VSWinStorePhone(vs14-store10_0-ARM "Visual Studio 14 2015" WindowsStore 10.0 ARM) add_test_VSWinStorePhone(vs14-store10_0-X64 "Visual Studio 14 2015" WindowsStore 10.0 x64) endif() - if(vs11 AND wp80) - add_test_VSWinStorePhone(vs11-phone80-X86 "Visual Studio 11 2012" WindowsPhone 8.0 Win32) - add_test_VSWinStorePhone(vs11-phone80-ARM "Visual Studio 11 2012" WindowsPhone 8.0 ARM) - endif() if(vs12 AND wp81) add_test_VSWinStorePhone(vs12-phone81-X86 "Visual Studio 12 2013" WindowsPhone 8.1 Win32) add_test_VSWinStorePhone(vs12-phone81-ARM "Visual Studio 12 2013" WindowsPhone 8.1 ARM) @@ -2341,10 +2362,6 @@ if(BUILD_TESTING) endforeach() endmacro() - if(vs11) - add_test_VSWinCE(vs11-ce80-ARM "Visual Studio 11 2012" WindowsCE 8.0 ${wince_sdk}) - endif() - if(vs12) add_test_VSWinCE(vs12-ce80-ARM "Visual Studio 12 2013" WindowsCE 8.0 ${wince_sdk}) endif() @@ -2471,9 +2488,6 @@ if(BUILD_TESTING) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/VSAndroid/${name}") endmacro() if(tegra AND NOT "${CMake_SOURCE_DIR};${CMake_BINARY_DIR}" MATCHES " ") - if(vs11) - add_test_VSAndroid(vs11 "Visual Studio 11 2012" "Tegra-Android") - endif() if(vs12) add_test_VSAndroid(vs12 "Visual Studio 12 2013" "Tegra-Android") endif() diff --git a/Tests/CMakeOnly/CheckCXXCompilerFlag/CMakeLists.txt b/Tests/CMakeOnly/CheckCXXCompilerFlag/CMakeLists.txt index e6ed559..0f3bd4c 100644 --- a/Tests/CMakeOnly/CheckCXXCompilerFlag/CMakeLists.txt +++ b/Tests/CMakeOnly/CheckCXXCompilerFlag/CMakeLists.txt @@ -20,7 +20,7 @@ macro(TEST_PASS value msg) endmacro() if(CMAKE_COMPILER_IS_GNUCXX) - exec_program(${CMAKE_C_COMPILER} ARGS --version OUTPUT_VARIABLE _gcc_version_info) + execute_process(COMMAND ${CMAKE_C_COMPILER} --version OUTPUT_VARIABLE _gcc_version_info) string (REGEX MATCH "[345]\\.[0-9]\\.[0-9]" _gcc_version "${_gcc_version_info}") # gcc on mac just reports: "gcc (GCC) 3.3 20030304 ..." without the # patch level, handle this here: @@ -30,12 +30,12 @@ if(CMAKE_COMPILER_IS_GNUCXX) endif() if(CMAKE_CXX_COMPILER_ID MATCHES Clang) - exec_program(${CMAKE_CXX_COMPILER} ARGS --version OUTPUT_VARIABLE _clang_version_info) + execute_process(COMMAND ${CMAKE_CXX_COMPILER} --version OUTPUT_VARIABLE _clang_version_info) string (REGEX REPLACE ".*version ([0-9]\\.[0-9]).*" "\\1" _clang_version "${_clang_version_info}") endif() if(CMAKE_CXX_COMPILER_ID MATCHES Intel) - exec_program(${CMAKE_CXX_COMPILER} ARGS -V OUTPUT_VARIABLE _intel_version_info) + execute_process(COMMAND ${CMAKE_CXX_COMPILER} -V OUTPUT_VARIABLE _intel_version_info) string (REGEX REPLACE ".*Version ([0-9]+(\\.[0-9]+)+).*" "\\1" _intel_version "${_intel_version_info}") endif() diff --git a/Tests/CommandLineTest/CMakeLists.txt b/Tests/CommandLineTest/CMakeLists.txt index 96aac10..a44fb39 100644 --- a/Tests/CommandLineTest/CMakeLists.txt +++ b/Tests/CommandLineTest/CMakeLists.txt @@ -2,58 +2,58 @@ cmake_minimum_required (VERSION 2.6) project(CommandLineTest) get_filename_component(CMAKE_BIN_DIR ${CMAKE_COMMAND} PATH) -macro(EXEC_CMAKE_COMMAND CMAKE_ARGS) - exec_program("${CMAKE_COMMAND}" ARGS "${CMAKE_ARGS}" RETURN_VALUE RET) +macro(EXEC_CMAKE_COMMAND) + execute_process(COMMAND "${CMAKE_COMMAND}" ${ARGN} RESULT_VARIABLE RET) if(${RET}) - message(SEND_ERROR "CMake command failed with arguments \"${CMAKE_ARGS}\"") + message(SEND_ERROR "CMake command failed with arguments \"${ARGN}\"") endif() endmacro() -EXEC_CMAKE_COMMAND("-E chdir \"${CMAKE_CURRENT_SOURCE_DIR}\" \"${CMAKE_COMMAND}\" -E echo \"Hello World\"") -EXEC_CMAKE_COMMAND("-E time \"${CMAKE_COMMAND} -N -L ${CommandLineTest_SOURCE_DIR}\"") -EXEC_CMAKE_COMMAND("-E time \"${CMAKE_COMMAND} -N -LA ${CommandLineTest_SOURCE_DIR}\"") -EXEC_CMAKE_COMMAND("-E time \"${CMAKE_COMMAND} -N -LH ${CommandLineTest_SOURCE_DIR}\"") -EXEC_CMAKE_COMMAND("-E time \"${CMAKE_COMMAND} -N -LAH ${CommandLineTest_SOURCE_DIR}\"") -EXEC_CMAKE_COMMAND("--help") -EXEC_CMAKE_COMMAND("--help-command-list") -EXEC_CMAKE_COMMAND("--help add_executable") -EXEC_CMAKE_COMMAND("--help-command add_executable") -EXEC_CMAKE_COMMAND("--help-full \"${CMAKE_CURRENT_BINARY_DIR}/cmake.txt\"") -EXEC_CMAKE_COMMAND("--help-man \"${CMAKE_CURRENT_BINARY_DIR}/cmake.man\"") -EXEC_CMAKE_COMMAND("--help-html \"${CMAKE_CURRENT_BINARY_DIR}/cmake.html\"") -EXEC_CMAKE_COMMAND("--copyright \"${CMAKE_CURRENT_BINARY_DIR}/Copyright.txt\"") -EXEC_CMAKE_COMMAND("--version \"${CMAKE_CURRENT_BINARY_DIR}/version.txt\"") +EXEC_CMAKE_COMMAND(-E chdir "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_COMMAND}" -E echo "Hello World") +EXEC_CMAKE_COMMAND(-E time "${CMAKE_COMMAND} -N -L ${CommandLineTest_SOURCE_DIR}") +EXEC_CMAKE_COMMAND(-E time "${CMAKE_COMMAND} -N -LA ${CommandLineTest_SOURCE_DIR}") +EXEC_CMAKE_COMMAND(-E time "${CMAKE_COMMAND} -N -LH ${CommandLineTest_SOURCE_DIR}") +EXEC_CMAKE_COMMAND(-E time "${CMAKE_COMMAND} -N -LAH ${CommandLineTest_SOURCE_DIR}") +EXEC_CMAKE_COMMAND(--help) +EXEC_CMAKE_COMMAND(--help-command-list) +EXEC_CMAKE_COMMAND(--help add_executable) +EXEC_CMAKE_COMMAND(--help-command add_executable) +EXEC_CMAKE_COMMAND(--help-full "${CMAKE_CURRENT_BINARY_DIR}/cmake.txt") +EXEC_CMAKE_COMMAND(--help-man "${CMAKE_CURRENT_BINARY_DIR}/cmake.man") +EXEC_CMAKE_COMMAND(--help-html "${CMAKE_CURRENT_BINARY_DIR}/cmake.html") +EXEC_CMAKE_COMMAND(--copyright "${CMAKE_CURRENT_BINARY_DIR}/Copyright.txt") +EXEC_CMAKE_COMMAND(--version "${CMAKE_CURRENT_BINARY_DIR}/version.txt") add_executable(CommandLineTest CommandLineTest.cxx) get_filename_component(CMAKE_COMMAND_PATH "${CMAKE_COMMAND}" PATH) set(CTEST_COMMAND "${CMAKE_COMMAND_PATH}/ctest") -macro(EXEC_CTEST_COMMAND CMAKE_ARGS) - exec_program("${CTEST_COMMAND}" ARGS "${CMAKE_ARGS}" RETURN_VALUE RET) +macro(EXEC_CTEST_COMMAND) + execute_process(COMMAND "${CTEST_COMMAND}" ${ARGN} RESULT_VARIABLE RET) if(${RET}) message(SEND_ERROR "CTest command failed with arguments \"${CMAKE_ARGS}\"") endif() endmacro() -macro(EXEC_CTEST_COMMAND_WITH_DIR DIR CMAKE_ARGS) - exec_program("${CTEST_COMMAND}" "${DIR}" ARGS "${CMAKE_ARGS}" RETURN_VALUE RET) +macro(EXEC_CTEST_COMMAND_WITH_DIR DIR) + execute_process(COMMAND "${CTEST_COMMAND}" ${ARGN} WORKING_DIRECTORY "${DIR}" RESULT_VARIABLE RET) if(${RET}) message(SEND_ERROR "CTest command failed with arguments \"${CMAKE_ARGS}\"") endif() endmacro() -EXEC_CTEST_COMMAND_WITH_DIR("${CMAKE_CURRENT_BINARY_DIR}/../.." "-N") -EXEC_CTEST_COMMAND_WITH_DIR("${CMAKE_CURRENT_BINARY_DIR}/../.." "-R complex -N") -EXEC_CTEST_COMMAND_WITH_DIR("${CMAKE_CURRENT_BINARY_DIR}/../.." "-E Simple -N") -EXEC_CTEST_COMMAND_WITH_DIR("${CMAKE_CURRENT_BINARY_DIR}/../.." "-E Simple -N") -EXEC_CTEST_COMMAND_WITH_DIR("${CMAKE_CURRENT_BINARY_DIR}/../.." "-N -I -10") -EXEC_CTEST_COMMAND_WITH_DIR("${CMAKE_CURRENT_BINARY_DIR}/../.." "-N -I 10-") -EXEC_CTEST_COMMAND_WITH_DIR("${CMAKE_CURRENT_BINARY_DIR}/../.." "-N -I 3,4") -EXEC_CTEST_COMMAND("--help") -EXEC_CTEST_COMMAND("--copyright") -EXEC_CTEST_COMMAND("--help-full \"${CMAKE_CURRENT_BINARY_DIR}/ctest.txt\"") -EXEC_CTEST_COMMAND("--help-man \"${CMAKE_CURRENT_BINARY_DIR}/ctest.man\"") -EXEC_CTEST_COMMAND("--help-html \"${CMAKE_CURRENT_BINARY_DIR}/ctest.html\"") -EXEC_CTEST_COMMAND("--version") +EXEC_CTEST_COMMAND_WITH_DIR("${CMAKE_CURRENT_BINARY_DIR}/../.." -N) +EXEC_CTEST_COMMAND_WITH_DIR("${CMAKE_CURRENT_BINARY_DIR}/../.." -R complex -N) +EXEC_CTEST_COMMAND_WITH_DIR("${CMAKE_CURRENT_BINARY_DIR}/../.." -E Simple -N) +EXEC_CTEST_COMMAND_WITH_DIR("${CMAKE_CURRENT_BINARY_DIR}/../.." -E Simple -N) +EXEC_CTEST_COMMAND_WITH_DIR("${CMAKE_CURRENT_BINARY_DIR}/../.." -N -I -10) +EXEC_CTEST_COMMAND_WITH_DIR("${CMAKE_CURRENT_BINARY_DIR}/../.." -N -I 10-) +EXEC_CTEST_COMMAND_WITH_DIR("${CMAKE_CURRENT_BINARY_DIR}/../.." -N -I 3,4) +EXEC_CTEST_COMMAND(--help) +EXEC_CTEST_COMMAND(--copyright) +EXEC_CTEST_COMMAND(--help-full "${CMAKE_CURRENT_BINARY_DIR}/ctest.txt") +EXEC_CTEST_COMMAND(--help-man "${CMAKE_CURRENT_BINARY_DIR}/ctest.man") +EXEC_CTEST_COMMAND(--help-html "${CMAKE_CURRENT_BINARY_DIR}/ctest.html") +EXEC_CTEST_COMMAND(--version) if(THIS_SHOULD_BE_SET) message(STATUS "***************************") diff --git a/Tests/Complex/CMakeLists.txt b/Tests/Complex/CMakeLists.txt index 9493a2f..d3a184d 100644 --- a/Tests/Complex/CMakeLists.txt +++ b/Tests/Complex/CMakeLists.txt @@ -327,12 +327,12 @@ if (WIN32) ${Complex_SOURCE_DIR}/Library/dummy "${dir}/${file}" COPYONLY) - exec_program(${CMAKE_COMMAND} ARGS "-E write_regv \"${hkey}\" \"${dir}\"") + execute_process(COMMAND ${CMAKE_COMMAND} -E write_regv "${hkey}" "${dir}") find_path(REGISTRY_TEST_PATH ${file} "[${hkey}]" DOC "Registry_Test_Path") - exec_program(${CMAKE_COMMAND} ARGS "-E delete_regv \"${hkey}\"") - exec_program(${CMAKE_COMMAND} ARGS "-E rm -f \"${dir}/${file}\"") + execute_process(COMMAND ${CMAKE_COMMAND} -E delete_regv "${hkey}") + execute_process(COMMAND ${CMAKE_COMMAND} -E rm -f "${dir}/${file}") endif () endif () diff --git a/Tests/ComplexOneConfig/CMakeLists.txt b/Tests/ComplexOneConfig/CMakeLists.txt index e4fdc68..dd996e1 100644 --- a/Tests/ComplexOneConfig/CMakeLists.txt +++ b/Tests/ComplexOneConfig/CMakeLists.txt @@ -284,12 +284,12 @@ if (WIN32) ${Complex_SOURCE_DIR}/Library/dummy "${dir}/${file}" COPYONLY) - exec_program(${CMAKE_COMMAND} ARGS "-E write_regv \"${hkey}\" \"${dir}\"") + execute_process(COMMAND ${CMAKE_COMMAND} -E write_regv "${hkey}" "${dir}") find_path(REGISTRY_TEST_PATH ${file} "[${hkey}]" DOC "Registry_Test_Path") - exec_program(${CMAKE_COMMAND} ARGS "-E delete_regv \"${hkey}\"") - exec_program(${CMAKE_COMMAND} ARGS "-E rm -f \"${dir}/${file}\"") + execute_process(COMMAND ${CMAKE_COMMAND} -E delete_regv "${hkey}") + execute_process(COMMAND ${CMAKE_COMMAND} -E rm -f "${dir}/${file}") endif () endif () diff --git a/Tests/Cuda/CMakeLists.txt b/Tests/Cuda/CMakeLists.txt index 0041b07..c737bcc 100644 --- a/Tests/Cuda/CMakeLists.txt +++ b/Tests/Cuda/CMakeLists.txt @@ -13,6 +13,7 @@ add_cuda_test_macro(Cuda.MixedStandardLevels4 MixedStandardLevels4) add_cuda_test_macro(Cuda.MixedStandardLevels5 MixedStandardLevels5) add_cuda_test_macro(Cuda.NotEnabled CudaNotEnabled) add_cuda_test_macro(Cuda.SeparableCompCXXOnly SeparableCompCXXOnly) +add_cuda_test_macro(Cuda.StubRPATH StubRPATH) add_cuda_test_macro(Cuda.Toolkit Toolkit) add_cuda_test_macro(Cuda.IncludePathNoToolkit IncludePathNoToolkit) add_cuda_test_macro(Cuda.SharedRuntimePlusToolkit SharedRuntimePlusToolkit) diff --git a/Tests/Cuda/StubRPATH/CMakeLists.txt b/Tests/Cuda/StubRPATH/CMakeLists.txt new file mode 100644 index 0000000..93643c5 --- /dev/null +++ b/Tests/Cuda/StubRPATH/CMakeLists.txt @@ -0,0 +1,21 @@ +cmake_minimum_required(VERSION 3.18) +project(StubRPATH CXX) + +#Verify that linking to a stub library doesn't cause an `-rpath` entry + +# Needed for `CUDAToolkit_LIBRARY_SEARCH_DIRS` +find_package(CUDAToolkit REQUIRED) + +find_library(CUDA_DRIVER_STUB_LIBRARY + NAMES cuda + HINTS ${CUDAToolkit_LIBRARY_SEARCH_DIRS} + ENV CUDA_PATH + PATH_SUFFIXES lib64/stubs lib/x64/stubs lib/stubs stubs +) +add_library(imported_stub IMPORTED SHARED) +set_target_properties(imported_stub PROPERTIES IMPORTED_IMPLIB "${CUDA_DRIVER_STUB_LIBRARY}") +set_target_properties(imported_stub PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${CUDAToolkit_INCLUDE_DIRS}") + +set(CMAKE_CXX_STANDARD 11) +add_executable(StubRPATH main.cxx) +target_link_libraries(StubRPATH PRIVATE imported_stub) diff --git a/Tests/Cuda/StubRPATH/main.cxx b/Tests/Cuda/StubRPATH/main.cxx new file mode 100644 index 0000000..877856e --- /dev/null +++ b/Tests/Cuda/StubRPATH/main.cxx @@ -0,0 +1,17 @@ + +#include <iostream> + +#include <cuda.h> + +int main(int argc, char** argv) +{ + int nDevices = 0; + cuInit(0); + auto err = cuDeviceGetCount(&nDevices); + if (err != CUDA_SUCCESS) { + std::cerr << "Failed to retrieve the number of CUDA enabled devices " + << err << std::endl; + return 1; + } + return 0; +} diff --git a/Tests/ExternalOBJ/CMakeLists.txt b/Tests/ExternalOBJ/CMakeLists.txt index 4ff75b8..141977c 100644 --- a/Tests/ExternalOBJ/CMakeLists.txt +++ b/Tests/ExternalOBJ/CMakeLists.txt @@ -3,7 +3,7 @@ project (ExternalOBJ) if(APPLE) # set _CMAKE_OSX_MACHINE to umame -m - exec_program(uname ARGS -m OUTPUT_VARIABLE _CMAKE_OSX_MACHINE) + execute_process(COMMAND uname -m OUTPUT_VARIABLE _CMAKE_OSX_MACHINE OUTPUT_STRIP_TRAILING_WHITESPACE) # check for Power PC and change to ppc if("${_CMAKE_OSX_MACHINE}" MATCHES "Power") set(_CMAKE_OSX_MACHINE ppc) diff --git a/Tests/ExternalOBJ/Object/CMakeLists.txt b/Tests/ExternalOBJ/Object/CMakeLists.txt index dbfe09e..a886da0 100644 --- a/Tests/ExternalOBJ/Object/CMakeLists.txt +++ b/Tests/ExternalOBJ/Object/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required (VERSION 2.6) project(Object) if(APPLE) # set _CMAKE_OSX_MACHINE to umame -m - exec_program(uname ARGS -m OUTPUT_VARIABLE _CMAKE_OSX_MACHINE) + execute_process(COMMAND uname -m OUTPUT_VARIABLE _CMAKE_OSX_MACHINE OUTPUT_STRIP_TRAILING_WHITESPACE) # check for Power PC and change to ppc if("${_CMAKE_OSX_MACHINE}" MATCHES "Power") set(_CMAKE_OSX_MACHINE ppc) diff --git a/Tests/FindPython/ArtifactsInteractive/CMakeLists.txt b/Tests/FindPython/ArtifactsInteractive/CMakeLists.txt index 99823a6..18f8fda 100644 --- a/Tests/FindPython/ArtifactsInteractive/CMakeLists.txt +++ b/Tests/FindPython/ArtifactsInteractive/CMakeLists.txt @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.5) project(TestArtifactsInteractive LANGUAGES C) set (components Interpreter Development) -if (CMake_TEST_FindPython_NumPy) +if (CMake_TEST_FindPython3_NumPy) list (APPEND components NumPy) endif() @@ -12,13 +12,13 @@ find_package(Python3 REQUIRED COMPONENTS ${components}) if (Python3_ARTIFACTS_INTERACTIVE) if (NOT DEFINED CACHE{Python3_EXECUTABLE} OR NOT DEFINED CACHE{Python3_LIBRARY} OR NOT DEFINED CACHE{Python3_INCLUDE_DIR} - OR (CMake_TEST_FindPython_NumPy AND NOT DEFINED CACHE{Python3_NumPy_INCLUDE_DIR})) + OR (CMake_TEST_FindPython3_NumPy AND NOT DEFINED CACHE{Python3_NumPy_INCLUDE_DIR})) message (FATAL_ERROR "Python3_ARTIFACTS_INTERACTIVE=ON Failed.") endif() else() if (DEFINED CACHE{Python3_EXECUTABLE} OR DEFINED CACHE{Python3_LIBRARY} OR DEFINED CACHE{Python3_INCLUDE_DIR} - OR (CMake_TEST_FindPython_NumPy AND DEFINED CACHE{Python3_NumPy_INCLUDE_DIR})) + OR (CMake_TEST_FindPython3_NumPy AND DEFINED CACHE{Python3_NumPy_INCLUDE_DIR})) message (FATAL_ERROR "Python3_ARTIFACTS_INTERACTIVE=OFF Failed.") endif() endif() diff --git a/Tests/FindPython/CMakeLists.txt b/Tests/FindPython/CMakeLists.txt index b6942c9..636a7b0 100644 --- a/Tests/FindPython/CMakeLists.txt +++ b/Tests/FindPython/CMakeLists.txt @@ -1,4 +1,4 @@ -if(CMake_TEST_FindPython) +if(CMake_TEST_FindPython2) add_test(NAME FindPython.Python2.LOCATION COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> --build-and-test @@ -44,6 +44,139 @@ if(CMake_TEST_FindPython) set_tests_properties(FindPython.Python2Fail PROPERTIES PASS_REGULAR_EXPRESSION "Could NOT find Python2 \\(missing: foobar\\)") + add_test(NAME FindPython.Python.V2.LOCATION COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindPython/Python" + "${CMake_BINARY_DIR}/Tests/FindPython/Python.V2.LOCATION" + ${build_generator_args} + --build-project TestPython + --build-options ${build_options} -DPython_REQUESTED_VERSION=2 -DPython_FIND_STRATEGY=LOCATION + --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> + ) + add_test(NAME FindPython.Python.V2.VERSION COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindPython/Python" + "${CMake_BINARY_DIR}/Tests/FindPython/Python.V2.VERSION" + ${build_generator_args} + --build-project TestPython + --build-options ${build_options} -DPython_REQUESTED_VERSION=2 -DPython_FIND_STRATEGY=VERSION + --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> + ) + + add_test(NAME FindPython.Python2.ExactVersion.LOCATION COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindPython/ExactVersion" + "${CMake_BINARY_DIR}/Tests/FindPython/Python2.ExactVersion.LOCATION" + ${build_generator_args} + --build-project TestExactVersion + --build-options ${build_options} -DPython_MAJOR_VERSION=2 + -DPython_REQUESTED_VERSION=2.1.2 + -DPython2_FIND_STRATEGY=LOCATION + --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> + ) + add_test(NAME FindPython.Python2.ExactVersion.VERSION COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindPython/ExactVersion" + "${CMake_BINARY_DIR}/Tests/FindPython/Python2.ExactVersion.VERSION" + ${build_generator_args} + --build-project TestExactVersion + --build-options ${build_options} -DPython_MAJOR_VERSION=2 + -DPython_REQUESTED_VERSION=2.1.2 + -DPython2_FIND_STRATEGY=VERSION + --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> + ) + + add_test(NAME FindPython.Python.V2.ExactVersion.LOCATION COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindPython/ExactVersion" + "${CMake_BINARY_DIR}/Tests/FindPython/Python.V2.ExactVersion.LOCATION" + ${build_generator_args} + --build-project TestExactVersion + --build-options ${build_options} -DPython_REQUESTED_VERSION=2.1.2 + -DPython_FIND_STRATEGY=LOCATION + --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> + ) + add_test(NAME FindPython.Python.V2.ExactVersion.VERSION COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindPython/ExactVersion" + "${CMake_BINARY_DIR}/Tests/FindPython/Python.V2.ExactVersion.VERSION" + ${build_generator_args} + --build-project TestExactVersion + --build-options ${build_options} -DPython_REQUESTED_VERSION=2.1.2 + -DPython_FIND_STRATEGY=VERSION + --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> + ) + + add_test(NAME FindPython.Python2.VersionRange.LOCATION COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindPython/VersionRange" + "${CMake_BINARY_DIR}/Tests/FindPython/Python2.VersionRange.LOCATION" + ${build_generator_args} + --build-project TestVersionRange + --build-options ${build_options} -DPython=Python2 -DPython_REQUESTED_VERSION=2 + -DPython2_FIND_STRATEGY=LOCATION + ) + add_test(NAME FindPython.Python2.VersionRange.VERSION COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindPython/VersionRange" + "${CMake_BINARY_DIR}/Tests/FindPython/Python2.VersionRange.VERSION" + ${build_generator_args} + --build-project TestVersionRange + --build-options ${build_options} -DPython=Python2 -DPython_REQUESTED_VERSION=2 + -DPython2_FIND_STRATEGY=VERSION + ) + add_test(NAME FindPython.Python.V2.VersionRange.LOCATION COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindPython/VersionRange" + "${CMake_BINARY_DIR}/Tests/FindPython/Python.V2.VersionRange.LOCATION" + ${build_generator_args} + --build-project TestVersionRange + --build-options ${build_options} -DPython=Python -DPython_REQUESTED_VERSION=2 + -DPython_FIND_STRATEGY=LOCATION + ) + add_test(NAME FindPython.Python.V2.VersionRange.VERSION COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindPython/VersionRange" + "${CMake_BINARY_DIR}/Tests/FindPython/Python.V2.VersionRange.VERSION" + ${build_generator_args} + --build-project TestVersionRange + --build-options ${build_options} -DPython=Python -DPython_REQUESTED_VERSION=2 + -DPython_FIND_STRATEGY=VERSION + ) + + add_test(NAME FindPython.Python2Embedded COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindPython/Python2Embedded" + "${CMake_BINARY_DIR}/Tests/FindPython/Python2Embedded" + ${build_generator_args} + --build-project TestPython2Embedded + --build-options ${build_options} + --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> + ) + + set_property(TEST FindPython.Python2.LOCATION FindPython.Python2.VERSION + FindPython.Python2.Development.Module FindPython.Python2Fail + FindPython.Python.V2.LOCATION FindPython.Python.V2.VERSION + FindPython.Python2.ExactVersion.LOCATION FindPython.Python2.ExactVersion.VERSION + FindPython.Python.V2.ExactVersion.LOCATION FindPython.Python.V2.ExactVersion.VERSION + FindPython.Python2.VersionRange.LOCATION FindPython.Python2.VersionRange.VERSION + FindPython.Python.V2.VersionRange.LOCATION FindPython.Python.V2.VersionRange.VERSION + FindPython.Python2Embedded + APPEND PROPERTY LABELS Python2) +endif() + +if(CMake_TEST_FindPython3) add_test(NAME FindPython.Python3.LOCATION COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> --build-and-test @@ -89,46 +222,6 @@ if(CMake_TEST_FindPython) set_tests_properties(FindPython.Python3Fail PROPERTIES PASS_REGULAR_EXPRESSION "Could NOT find Python3 \\(missing: foobar\\)") - add_test(NAME FindPython.Python.LOCATION COMMAND - ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> - --build-and-test - "${CMake_SOURCE_DIR}/Tests/FindPython/Python" - "${CMake_BINARY_DIR}/Tests/FindPython/Python.LOCATION" - ${build_generator_args} - --build-project TestPython - --build-options ${build_options} -DPython_FIND_STRATEGY=LOCATION - --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> - ) - add_test(NAME FindPython.Python.VERSION COMMAND - ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> - --build-and-test - "${CMake_SOURCE_DIR}/Tests/FindPython/Python" - "${CMake_BINARY_DIR}/Tests/FindPython/Python.VERSION" - ${build_generator_args} - --build-project TestPython - --build-options ${build_options} -DPython_FIND_STRATEGY=VERSION - --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> - ) - add_test(NAME FindPython.Python.V2.LOCATION COMMAND - ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> - --build-and-test - "${CMake_SOURCE_DIR}/Tests/FindPython/Python" - "${CMake_BINARY_DIR}/Tests/FindPython/Python.V2.LOCATION" - ${build_generator_args} - --build-project TestPython - --build-options ${build_options} -DPython_REQUESTED_VERSION=2 -DPython_FIND_STRATEGY=LOCATION - --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> - ) - add_test(NAME FindPython.Python.V2.VERSION COMMAND - ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> - --build-and-test - "${CMake_SOURCE_DIR}/Tests/FindPython/Python" - "${CMake_BINARY_DIR}/Tests/FindPython/Python.V2.VERSION" - ${build_generator_args} - --build-project TestPython - --build-options ${build_options} -DPython_REQUESTED_VERSION=2 -DPython_FIND_STRATEGY=VERSION - --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> - ) add_test(NAME FindPython.Python.V3.LOCATION COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> --build-and-test @@ -150,30 +243,6 @@ if(CMake_TEST_FindPython) --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> ) - add_test(NAME FindPython.Python2.ExactVersion.LOCATION COMMAND - ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> - --build-and-test - "${CMake_SOURCE_DIR}/Tests/FindPython/ExactVersion" - "${CMake_BINARY_DIR}/Tests/FindPython/Python2.ExactVersion.LOCATION" - ${build_generator_args} - --build-project TestExactVersion - --build-options ${build_options} -DPython_MAJOR_VERSION=2 - -DPython_REQUESTED_VERSION=2.1.2 - -DPython2_FIND_STRATEGY=LOCATION - --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> - ) - add_test(NAME FindPython.Python2.ExactVersion.VERSION COMMAND - ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> - --build-and-test - "${CMake_SOURCE_DIR}/Tests/FindPython/ExactVersion" - "${CMake_BINARY_DIR}/Tests/FindPython/Python2.ExactVersion.VERSION" - ${build_generator_args} - --build-project TestExactVersion - --build-options ${build_options} -DPython_MAJOR_VERSION=2 - -DPython_REQUESTED_VERSION=2.1.2 - -DPython2_FIND_STRATEGY=VERSION - --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> - ) add_test(NAME FindPython.Python3.ExactVersion.LOCATION COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> --build-and-test @@ -198,28 +267,6 @@ if(CMake_TEST_FindPython) -DPython3_FIND_STRATEGY=VERSION --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> ) - add_test(NAME FindPython.Python.V2.ExactVersion.LOCATION COMMAND - ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> - --build-and-test - "${CMake_SOURCE_DIR}/Tests/FindPython/ExactVersion" - "${CMake_BINARY_DIR}/Tests/FindPython/Python.V2.ExactVersion.LOCATION" - ${build_generator_args} - --build-project TestExactVersion - --build-options ${build_options} -DPython_REQUESTED_VERSION=2.1.2 - -DPython_FIND_STRATEGY=LOCATION - --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> - ) - add_test(NAME FindPython.Python.V2.ExactVersion.VERSION COMMAND - ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> - --build-and-test - "${CMake_SOURCE_DIR}/Tests/FindPython/ExactVersion" - "${CMake_BINARY_DIR}/Tests/FindPython/Python.V2.ExactVersion.VERSION" - ${build_generator_args} - --build-project TestExactVersion - --build-options ${build_options} -DPython_REQUESTED_VERSION=2.1.2 - -DPython_FIND_STRATEGY=VERSION - --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> - ) add_test(NAME FindPython.Python.V3.ExactVersion.LOCATION COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> --build-and-test @@ -263,46 +310,6 @@ if(CMake_TEST_FindPython) --build-options ${build_options} -DPython=Python3 -DPython_REQUESTED_VERSION=3 -DPython3_FIND_STRATEGY=VERSION ) - add_test(NAME FindPython.Python2.VersionRange.LOCATION COMMAND - ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> - --build-and-test - "${CMake_SOURCE_DIR}/Tests/FindPython/VersionRange" - "${CMake_BINARY_DIR}/Tests/FindPython/Python2.VersionRange.LOCATION" - ${build_generator_args} - --build-project TestVersionRange - --build-options ${build_options} -DPython=Python2 -DPython_REQUESTED_VERSION=2 - -DPython2_FIND_STRATEGY=LOCATION - ) - add_test(NAME FindPython.Python2.VersionRange.VERSION COMMAND - ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> - --build-and-test - "${CMake_SOURCE_DIR}/Tests/FindPython/VersionRange" - "${CMake_BINARY_DIR}/Tests/FindPython/Python2.VersionRange.VERSION" - ${build_generator_args} - --build-project TestVersionRange - --build-options ${build_options} -DPython=Python2 -DPython_REQUESTED_VERSION=2 - -DPython2_FIND_STRATEGY=VERSION - ) - add_test(NAME FindPython.Python.V2.VersionRange.LOCATION COMMAND - ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> - --build-and-test - "${CMake_SOURCE_DIR}/Tests/FindPython/VersionRange" - "${CMake_BINARY_DIR}/Tests/FindPython/Python.V2.VersionRange.LOCATION" - ${build_generator_args} - --build-project TestVersionRange - --build-options ${build_options} -DPython=Python -DPython_REQUESTED_VERSION=2 - -DPython_FIND_STRATEGY=LOCATION - ) - add_test(NAME FindPython.Python.V2.VersionRange.VERSION COMMAND - ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> - --build-and-test - "${CMake_SOURCE_DIR}/Tests/FindPython/VersionRange" - "${CMake_BINARY_DIR}/Tests/FindPython/Python.V2.VersionRange.VERSION" - ${build_generator_args} - --build-project TestVersionRange - --build-options ${build_options} -DPython=Python -DPython_REQUESTED_VERSION=2 - -DPython_FIND_STRATEGY=VERSION - ) add_test(NAME FindPython.Python.V3.VersionRange.LOCATION COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> --build-and-test @@ -324,17 +331,6 @@ if(CMake_TEST_FindPython) -DPython_FIND_STRATEGY=VERSION ) - add_test(NAME FindPython.MultiplePackages COMMAND - ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> - --build-and-test - "${CMake_SOURCE_DIR}/Tests/FindPython/MultiplePackages" - "${CMake_BINARY_DIR}/Tests/FindPython/MultiplePackages" - ${build_generator_args} - --build-project TestMultiplePackages - --build-options ${build_options} - --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> - ) - add_test(NAME FindPython.VirtualEnv COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> --build-and-test @@ -346,16 +342,6 @@ if(CMake_TEST_FindPython) --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> ) - add_test(NAME FindPython.Python2Embedded COMMAND - ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> - --build-and-test - "${CMake_SOURCE_DIR}/Tests/FindPython/Python2Embedded" - "${CMake_BINARY_DIR}/Tests/FindPython/Python2Embedded" - ${build_generator_args} - --build-project TestPython2Embedded - --build-options ${build_options} - --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> - ) add_test(NAME FindPython.Python3Embedded COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> --build-and-test @@ -377,7 +363,7 @@ if(CMake_TEST_FindPython) --build-options ${build_options} "-Dbuild_generator_args=${build_generator_args}" "-DCMake_SOURCE_DIR=${CMake_SOURCE_DIR}" "-DCMake_BINARY_DIR=${CMake_BINARY_DIR}" - "-DCMake_TEST_FindPython_SABIModule=${CMake_TEST_FindPython_SABIModule}" + "-DCMake_TEST_FindPython3_SABIModule=${CMake_TEST_FindPython3_SABIModule}" --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> ) @@ -391,7 +377,7 @@ if(CMake_TEST_FindPython) --build-options ${build_options} "-Dbuild_generator_args=${build_generator_args}" "-DCMake_SOURCE_DIR=${CMake_SOURCE_DIR}" "-DCMake_BINARY_DIR=${CMake_BINARY_DIR}" - "-DCMake_TEST_FindPython_NumPy=${CMake_TEST_FindPython_NumPy}" + "-DCMake_TEST_FindPython3_NumPy=${CMake_TEST_FindPython3_NumPy}" "-DPython3_ARTIFACTS_INTERACTIVE=ON" --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> ) @@ -405,7 +391,7 @@ if(CMake_TEST_FindPython) --build-options ${build_options} "-Dbuild_generator_args=${build_generator_args}" "-DCMake_SOURCE_DIR=${CMake_SOURCE_DIR}" "-DCMake_BINARY_DIR=${CMake_BINARY_DIR}" - "-DCMake_TEST_FindPython_NumPy=${CMake_TEST_FindPython_NumPy}" + "-DCMake_TEST_FindPython3_NumPy=${CMake_TEST_FindPython3_NumPy}" "-DPython3_ARTIFACTS_INTERACTIVE=OFF" --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> ) @@ -420,7 +406,7 @@ if(CMake_TEST_FindPython) --build-options ${build_options} "-Dbuild_generator_args=${build_generator_args}" "-DCMake_SOURCE_DIR=${CMake_SOURCE_DIR}" "-DCMake_BINARY_DIR=${CMake_BINARY_DIR}" - "-DCMake_TEST_FindPython_NumPy=${CMake_TEST_FindPython_NumPy}" + "-DCMake_TEST_FindPython3_NumPy=${CMake_TEST_FindPython3_NumPy}" --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> ) @@ -437,6 +423,54 @@ if(CMake_TEST_FindPython) --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> ) + set_property(TEST FindPython.Python3.LOCATION FindPython.Python3.VERSION + FindPython.Python3.Development.Module FindPython.Python3Fail + FindPython.Python.V3.LOCATION FindPython.Python.V3.VERSION + FindPython.Python3.ExactVersion.LOCATION FindPython.Python3.ExactVersion.VERSION + FindPython.Python.V3.ExactVersion.LOCATION FindPython.Python.V3.ExactVersion.VERSION + FindPython.Python3.VersionRange.LOCATION FindPython.Python3.VersionRange.VERSION + FindPython.Python.V3.VersionRange.LOCATION FindPython.Python.V3.VersionRange.VERSION + FindPython.VirtualEnv FindPython.Python3Embedded FindPython.RequiredArtifacts + FindPython.ArtifactsInteractive.ON FindPython.ArtifactsInteractive.OFF + FindPython.CustomFailureMessage FindPython.DifferentComponents + APPEND PROPERTY LABELS Python3) + + if (CMAKE_SYSTEM_NAME STREQUAL "Linux") + add_test(NAME FindPython.UnversionedNames COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindPython/UnversionedNames" + "${CMake_BINARY_DIR}/Tests/FindPython/UnversionedNames" + ${build_generator_args} + --build-project UnversionedNames + --build-options ${build_options} + ) + set_property(TEST FindPython.UnversionedNames APPEND PROPERTY LABELS Python3) + endif() +endif() + +if(CMake_TEST_FindPython2 OR CMake_TEST_FindPython3) + add_test(NAME FindPython.Python.LOCATION COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindPython/Python" + "${CMake_BINARY_DIR}/Tests/FindPython/Python.LOCATION" + ${build_generator_args} + --build-project TestPython + --build-options ${build_options} -DPython_FIND_STRATEGY=LOCATION + --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> + ) + add_test(NAME FindPython.Python.VERSION COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindPython/Python" + "${CMake_BINARY_DIR}/Tests/FindPython/Python.VERSION" + ${build_generator_args} + --build-project TestPython + --build-options ${build_options} -DPython_FIND_STRATEGY=VERSION + --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> + ) + if (CMAKE_SYSTEM_NAME MATCHES "Linux|Darwin") add_test(NAME FindPython.Interpreter.SOABI COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> @@ -464,22 +498,28 @@ if(CMake_TEST_FindPython) "-DCMake_TEST_FindPython_COMPONENT=Development" --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> ) + + set_property(TEST FindPython.Interpreter.SOABI FindPython.Development.SOABI + APPEND PROPERTY LABELS Python2 Python3) endif() - if (CMAKE_SYSTEM_NAME STREQUAL "Linux") - add_test(NAME FindPython.UnversionedNames COMMAND - ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> - --build-and-test - "${CMake_SOURCE_DIR}/Tests/FindPython/UnversionedNames" - "${CMake_BINARY_DIR}/Tests/FindPython/UnversionedNames" - ${build_generator_args} - --build-project UnversionedNames - --build-options ${build_options} + add_test(NAME FindPython.MultiplePackages COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindPython/MultiplePackages" + "${CMake_BINARY_DIR}/Tests/FindPython/MultiplePackages" + ${build_generator_args} + --build-project TestMultiplePackages + --build-options ${build_options} + --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> ) - endif() + + set_property(TEST FindPython.Python.LOCATION FindPython.Python.VERSION FindPython.MultiplePackages + APPEND PROPERTY LABELS Python2 Python3) endif() -if(CMake_TEST_FindPython_SABIModule) + +if(CMake_TEST_FindPython2_SABIModule) add_test(NAME FindPython.Python2.Development.SABIModule COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> --build-and-test @@ -490,9 +530,12 @@ if(CMake_TEST_FindPython_SABIModule) --build-options ${build_options} --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> ) - set_tests_properties(FindPython.Python2.Development.SABIModule PROPERTIES - PASS_REGULAR_EXPRESSION "Could NOT find Python2 \\(missing: .*Development\\.SABIModule") + set_tests_properties(FindPython.Python2.Development.SABIModule PROPERTIES + PASS_REGULAR_EXPRESSION "Could NOT find Python2 \\(missing: .*Development\\.SABIModule") + set_property(TEST FindPython.Python2.Development.SABIModule APPEND PROPERTY LABELS Python2) +endif() +if(CMake_TEST_FindPython3_SABIModule) # Use exclusively Release configuration because Debug is, on Windows with MSVC, # unusable with SABI: Python force link with debug version of full versioned library rather than # the stable ABI one. @@ -506,9 +549,10 @@ if(CMake_TEST_FindPython_SABIModule) --build-options ${build_options} --test-command ${CMAKE_CTEST_COMMAND} -V -C Release ) + set_property(TEST FindPython.Python3.Development.SABIModule APPEND PROPERTY LABELS Python3) endif() -if(CMake_TEST_FindPython_NumPy) +if(CMake_TEST_FindPython2_NumPy OR CMake_TEST_FindPython3_NumPy) add_test(NAME FindPython.NumPy COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> --build-and-test @@ -528,9 +572,11 @@ if(CMake_TEST_FindPython_NumPy) --build-project TestNumPyOnly --build-options ${build_options} ) + + set_property(TEST FindPython.NumPy FindPython.NumPyOnly APPEND PROPERTY LABELS Python2 Python3) endif() -if(CMake_TEST_FindPython_Conda) +if(CMake_TEST_FindPython3_Conda) add_test(NAME FindPython.VirtualEnvConda COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> --build-and-test @@ -541,73 +587,83 @@ if(CMake_TEST_FindPython_Conda) --build-options ${build_options} --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> ) + set_property(TEST FindPython.VirtualEnvConda APPEND PROPERTY LABELS Python3) endif() -if (CMake_TEST_FindPython AND CMake_TEST_FindPython_IronPython) - add_test(NAME FindPython.Implementation.CPython COMMAND +if (CMake_TEST_FindPython2 AND CMake_TEST_FindPython2_IronPython) + add_test(NAME FindPython.Implementation.CPython2 COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> --build-and-test "${CMake_SOURCE_DIR}/Tests/FindPython/Implementation" - "${CMake_BINARY_DIR}/Tests/FindPython/Implementation.CPython" + "${CMake_BINARY_DIR}/Tests/FindPython/Implementation.CPython2" ${build_generator_args} --build-project TestImplementationCPython --build-options ${build_options} -DPython_REQUESTED_VERSION=2 -DPython_REQUESTED_IMPLEMENTATIONS=CPython --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> ) - add_test(NAME FindPython.Implementation.IronPython COMMAND + add_test(NAME FindPython.Implementation.IronPython2 COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> --build-and-test "${CMake_SOURCE_DIR}/Tests/FindPython/Implementation" - "${CMake_BINARY_DIR}/Tests/FindPython/Implementation.IronPython" + "${CMake_BINARY_DIR}/Tests/FindPython/Implementation.IronPython2" ${build_generator_args} --build-project TestImplementationIronPython --build-options ${build_options} -DPython_REQUESTED_VERSION=2 -DPython_REQUESTED_IMPLEMENTATION=IronPython --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> ) + + set_property(TEST FindPython.Implementation.CPython2 FindPython.Implementation.IronPython2 + APPEND PROPERTY LABELS Python2) endif() -if(CMake_TEST_FindPython_IronPython) - add_test(NAME FindPython.IronPython2.LOCATION COMMAND +if (CMake_TEST_FindPython3 AND CMake_TEST_FindPython3_IronPython) + add_test(NAME FindPython.Implementation.CPython3 COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> --build-and-test - "${CMake_SOURCE_DIR}/Tests/FindPython/IronPython2" - "${CMake_BINARY_DIR}/Tests/FindPython/IronPython2.LOCATION" + "${CMake_SOURCE_DIR}/Tests/FindPython/Implementation" + "${CMake_BINARY_DIR}/Tests/FindPython/Implementation.CPython3" ${build_generator_args} - --build-project TestIronPython2 - --build-options ${build_options} -DPython2_FIND_STRATEGY=LOCATION + --build-project TestImplementationCPython + --build-options ${build_options} -DPython_REQUESTED_VERSION=3 -DPython_REQUESTED_IMPLEMENTATIONS=CPython --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> ) - add_test(NAME FindPython.IronPython2.VERSION COMMAND + add_test(NAME FindPython.Implementation.IronPython3 COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> --build-and-test - "${CMake_SOURCE_DIR}/Tests/FindPython/IronPython2" - "${CMake_BINARY_DIR}/Tests/FindPython/IronPython2.VERSION" + "${CMake_SOURCE_DIR}/Tests/FindPython/Implementation" + "${CMake_BINARY_DIR}/Tests/FindPython/Implementation.IronPython3" ${build_generator_args} - --build-project TestIronPython2 - --build-options ${build_options} -DPython2_FIND_STRATEGY=VERSION + --build-project TestImplementationIronPython + --build-options ${build_options} -DPython_REQUESTED_VERSION=3 -DPython_REQUESTED_IMPLEMENTATION=IronPython --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> ) - add_test(NAME FindPython.IronPython.LOCATION COMMAND + set_property(TEST FindPython.Implementation.CPython3 FindPython.Implementation.IronPython3 + APPEND PROPERTY LABELS Python3) +endif() + +if(CMake_TEST_FindPython2_IronPython) + add_test(NAME FindPython.IronPython2.LOCATION COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> --build-and-test - "${CMake_SOURCE_DIR}/Tests/FindPython/IronPython" - "${CMake_BINARY_DIR}/Tests/FindPython/IronPython.LOCATION" + "${CMake_SOURCE_DIR}/Tests/FindPython/IronPython2" + "${CMake_BINARY_DIR}/Tests/FindPython/IronPython2.LOCATION" ${build_generator_args} - --build-project TestIronPython - --build-options ${build_options} -DPython_FIND_STRATEGY=LOCATION + --build-project TestIronPython2 + --build-options ${build_options} -DPython2_FIND_STRATEGY=LOCATION --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> ) - add_test(NAME FindPython.IronPython.VERSION COMMAND + add_test(NAME FindPython.IronPython2.VERSION COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> --build-and-test - "${CMake_SOURCE_DIR}/Tests/FindPython/IronPython" - "${CMake_BINARY_DIR}/Tests/FindPython/IronPython.VERSION" + "${CMake_SOURCE_DIR}/Tests/FindPython/IronPython2" + "${CMake_BINARY_DIR}/Tests/FindPython/IronPython2.VERSION" ${build_generator_args} - --build-project TestIronPython - --build-options ${build_options} -DPython_FIND_STRATEGY=VERSION + --build-project TestIronPython2 + --build-options ${build_options} -DPython2_FIND_STRATEGY=VERSION --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> ) + add_test(NAME FindPython.IronPython.V2.LOCATION COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> --build-and-test @@ -651,71 +707,133 @@ if(CMake_TEST_FindPython_IronPython) -DPython2_FIND_IMPLEMENTATIONS=IronPython -DPython2_FIND_STRATEGY=VERSION ) + + set_property(TEST FindPython.IronPython2.LOCATION FindPython.IronPython2.VERSION + FindPython.IronPython.V2.LOCATION FindPython.IronPython.V2.VERSION + FindPython.IronPython2.VersionRange.LOCATION FindPython.IronPython2.VersionRange.VERSION + APPEND PROPERTY LABELS Python2) endif() -if(CMake_TEST_FindPython_PyPy) - add_test(NAME FindPython.PyPy2.LOCATION COMMAND +if(CMake_TEST_FindPython3_IronPython) + add_test(NAME FindPython.IronPython3.LOCATION COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> --build-and-test - "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy2" - "${CMake_BINARY_DIR}/Tests/FindPython/PyPy2.LOCATION" + "${CMake_SOURCE_DIR}/Tests/FindPython/IronPython3" + "${CMake_BINARY_DIR}/Tests/FindPython/IronPython3.LOCATION" ${build_generator_args} - --build-project TestPyPy2 - --build-options ${build_options} -DPython2_FIND_STRATEGY=LOCATION + --build-project TestIronPython3 + --build-options ${build_options} -DPython3_FIND_STRATEGY=LOCATION --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> ) - add_test(NAME FindPython.PyPy2.VERSION COMMAND + add_test(NAME FindPython.IronPython3.VERSION COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> --build-and-test - "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy2" - "${CMake_BINARY_DIR}/Tests/FindPython/PyPy2.VERSION" + "${CMake_SOURCE_DIR}/Tests/FindPython/IronPython3" + "${CMake_BINARY_DIR}/Tests/FindPython/IronPython3.VERSION" ${build_generator_args} - --build-project TestPyPy2 - --build-options ${build_options} -DPython2_FIND_STRATEGY=VERSION + --build-project TestIronPython3 + --build-options ${build_options} -DPython3_FIND_STRATEGY=VERSION --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> ) - add_test(NAME FindPython.PyPy3.LOCATION COMMAND + add_test(NAME FindPython.IronPython.V3.LOCATION COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> --build-and-test - "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy3" - "${CMake_BINARY_DIR}/Tests/FindPython/PyPy3.LOCATION" + "${CMake_SOURCE_DIR}/Tests/FindPython/IronPython" + "${CMake_BINARY_DIR}/Tests/FindPython/IronPython.V3.LOCATION" ${build_generator_args} - --build-project TestPyPy3 - --build-options ${build_options} -DPython3_FIND_STRATEGY=LOCATION + --build-project TestIronPython + --build-options ${build_options} -DPython_REQUESTED_VERSION=3 -DPython_FIND_STRATEGY=LOCATION --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> ) - add_test(NAME FindPython.PyPy3.VERSION COMMAND + add_test(NAME FindPython.IronPython.V3.VERSION COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> --build-and-test - "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy3" - "${CMake_BINARY_DIR}/Tests/FindPython/PyPy3.VERSION" + "${CMake_SOURCE_DIR}/Tests/FindPython/IronPython" + "${CMake_BINARY_DIR}/Tests/FindPython/IronPython.V3.VERSION" ${build_generator_args} - --build-project TestPyPy3 - --build-options ${build_options} -DPython3_FIND_STRATEGY=VERSION + --build-project TestIronPython + --build-options ${build_options} -DPython_REQUESTED_VERSION=3 -DPython_FIND_STRATEGY=VERSION --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> ) - add_test(NAME FindPython.PyPy.LOCATION COMMAND + add_test(NAME FindPython.IronPython3.VersionRange.LOCATION COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> --build-and-test - "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy" - "${CMake_BINARY_DIR}/Tests/FindPython/PyPy.LOCATION" + "${CMake_SOURCE_DIR}/Tests/FindPython/VersionRange" + "${CMake_BINARY_DIR}/Tests/FindPython/IronPython3.VersionRange.LOCATION" ${build_generator_args} - --build-project TestPyPy + --build-project TestVersionRange + --build-options ${build_options} -DPython=Python3 -DPython_REQUESTED_VERSION=3 + -DPython3_FIND_IMPLEMENTATIONS=IronPython + -DPython3_FIND_STRATEGY=LOCATION + ) + add_test(NAME FindPython.IronPython3.VersionRange.VERSION COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindPython/VersionRange" + "${CMake_BINARY_DIR}/Tests/FindPython/IronPython3.VersionRange.VERSION" + ${build_generator_args} + --build-project TestVersionRange + --build-options ${build_options} -DPython=Python3 -DPython_REQUESTED_VERSION=3 + -DPython3_FIND_IMPLEMENTATIONS=IronPython + -DPython3_FIND_STRATEGY=VERSION + ) + + set_property(TEST FindPython.IronPython3.LOCATION FindPython.IronPython3.VERSION + FindPython.IronPython.V3.LOCATION FindPython.IronPython.V3.VERSION + FindPython.IronPython3.VersionRange.LOCATION FindPython.IronPython3.VersionRange.VERSION + APPEND PROPERTY LABELS Python3) +endif() + +if(CMake_TEST_FindPython2_IronPython OR CMake_TEST_FindPython3_IronPython) + add_test(NAME FindPython.IronPython.LOCATION COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindPython/IronPython" + "${CMake_BINARY_DIR}/Tests/FindPython/IronPython.LOCATION" + ${build_generator_args} + --build-project TestIronPython --build-options ${build_options} -DPython_FIND_STRATEGY=LOCATION --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> ) - add_test(NAME FindPython.PyPy.VERSION COMMAND + add_test(NAME FindPython.IronPython.VERSION COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> --build-and-test - "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy" - "${CMake_BINARY_DIR}/Tests/FindPython/PyPy.VERSION" + "${CMake_SOURCE_DIR}/Tests/FindPython/IronPython" + "${CMake_BINARY_DIR}/Tests/FindPython/IronPython.VERSION" ${build_generator_args} - --build-project TestPyPy + --build-project TestIronPython --build-options ${build_options} -DPython_FIND_STRATEGY=VERSION --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> ) + + set_property(TEST FindPython.IronPython.LOCATION FindPython.IronPython.VERSION + APPEND PROPERTY LABELS Python2 Python3) +endif() + +if(CMake_TEST_FindPython2_PyPy) + add_test(NAME FindPython.PyPy2.LOCATION COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy2" + "${CMake_BINARY_DIR}/Tests/FindPython/PyPy2.LOCATION" + ${build_generator_args} + --build-project TestPyPy2 + --build-options ${build_options} -DPython2_FIND_STRATEGY=LOCATION + --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> + ) + add_test(NAME FindPython.PyPy2.VERSION COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy2" + "${CMake_BINARY_DIR}/Tests/FindPython/PyPy2.VERSION" + ${build_generator_args} + --build-project TestPyPy2 + --build-options ${build_options} -DPython2_FIND_STRATEGY=VERSION + --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> + ) + add_test(NAME FindPython.PyPy.V2.LOCATION COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> --build-and-test @@ -736,6 +854,34 @@ if(CMake_TEST_FindPython_PyPy) --build-options ${build_options} -DPython_REQUESTED_VERSION=2 -DPython_FIND_STRATEGY=VERSION --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> ) + + set_property(TEST FindPython.PyPy2.LOCATION FindPython.PyPy2.VERSION + FindPython.PyPy.V2.LOCATION FindPython.PyPy.V2.VERSION + APPEND PROPERTY LABELS Python2) +endif() + +if(CMake_TEST_FindPython3_PyPy) + add_test(NAME FindPython.PyPy3.LOCATION COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy3" + "${CMake_BINARY_DIR}/Tests/FindPython/PyPy3.LOCATION" + ${build_generator_args} + --build-project TestPyPy3 + --build-options ${build_options} -DPython3_FIND_STRATEGY=LOCATION + --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> + ) + add_test(NAME FindPython.PyPy3.VERSION COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy3" + "${CMake_BINARY_DIR}/Tests/FindPython/PyPy3.VERSION" + ${build_generator_args} + --build-project TestPyPy3 + --build-options ${build_options} -DPython3_FIND_STRATEGY=VERSION + --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> + ) + add_test(NAME FindPython.PyPy.V3.LOCATION COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> --build-and-test @@ -756,4 +902,34 @@ if(CMake_TEST_FindPython_PyPy) --build-options ${build_options} -DPython_REQUESTED_VERSION=3 -DPython_FIND_STRATEGY=VERSION --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> ) + + set_property(TEST FindPython.PyPy3.LOCATION FindPython.PyPy3.VERSION + FindPython.PyPy.V3.LOCATION FindPython.PyPy.V3.VERSION + APPEND PROPERTY LABELS Python3) +endif() + +if(CMake_TEST_FindPython2_PyPy OR CMake_TEST_FindPython3_PyPy) + add_test(NAME FindPython.PyPy.LOCATION COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy" + "${CMake_BINARY_DIR}/Tests/FindPython/PyPy.LOCATION" + ${build_generator_args} + --build-project TestPyPy + --build-options ${build_options} -DPython_FIND_STRATEGY=LOCATION + --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> + ) + add_test(NAME FindPython.PyPy.VERSION COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy" + "${CMake_BINARY_DIR}/Tests/FindPython/PyPy.VERSION" + ${build_generator_args} + --build-project TestPyPy + --build-options ${build_options} -DPython_FIND_STRATEGY=VERSION + --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> + ) + + set_property(TEST FindPython.PyPy.LOCATION FindPython.PyPy.VERSION + APPEND PROPERTY LABELS Python2 Python3) endif() diff --git a/Tests/FindPython/CustomFailureMessage/CMakeLists.txt b/Tests/FindPython/CustomFailureMessage/CMakeLists.txt index 283aeec..e0148f3 100644 --- a/Tests/FindPython/CustomFailureMessage/CMakeLists.txt +++ b/Tests/FindPython/CustomFailureMessage/CMakeLists.txt @@ -62,7 +62,7 @@ set_tests_properties(FindPython.CustomFailureMessage.Multiple PROPERTIES PASS_REGULAR_EXPRESSION "Reason given by package:.+Interpreter: Cannot run the interpreter.+Development: Cannot find the library") -if (CMake_TEST_FindPython_NumPy) +if (CMake_TEST_FindPython3_NumPy) add_test(NAME FindPython.CustomFailureMessage.NumPy COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> --build-and-test diff --git a/Tests/FindPython/IronPython3/CMakeLists.txt b/Tests/FindPython/IronPython3/CMakeLists.txt new file mode 100644 index 0000000..b09097a --- /dev/null +++ b/Tests/FindPython/IronPython3/CMakeLists.txt @@ -0,0 +1,31 @@ +cmake_minimum_required(VERSION 3.5) + +project(TestIronPython3 LANGUAGES NONE) + +set (Python3_FIND_IMPLEMENTATIONS "IronPython") + +find_package(Python3 COMPONENTS Interpreter Compiler) +if (NOT Python3_FOUND) + message (FATAL_ERROR "Failed to find Python 3") +endif() + +if (NOT Python3_Interpreter_FOUND) + message (FATAL_ERROR "Failed to find Python 3 Interpreter") +endif() +if (NOT Python3_INTERPRETER_ID STREQUAL "IronPython") + message (FATAL_ERROR "Erroneous interpreter ID (${Python3_INTERPRETER_ID})") +endif() + +if (NOT Python3_Compiler_FOUND) + message (FATAL_ERROR "Failed to find Python 3 Compiler") +endif() +if (NOT Python3_COMPILER_ID STREQUAL "IronPython") + message (FATAL_ERROR "Erroneous compiler ID (${Python3_COMPILER_ID})") +endif() + +if(NOT TARGET Python3::Interpreter) + message(SEND_ERROR "Python3::Interpreter not found") +endif() +if(NOT TARGET Python3::Compiler) + message(SEND_ERROR "Python3::Compiler not found") +endif() diff --git a/Tests/FindPython/MultiplePackages/CMakeLists.txt b/Tests/FindPython/MultiplePackages/CMakeLists.txt index 4845035..352a2f6f 100644 --- a/Tests/FindPython/MultiplePackages/CMakeLists.txt +++ b/Tests/FindPython/MultiplePackages/CMakeLists.txt @@ -2,32 +2,44 @@ cmake_minimum_required(VERSION 3.5) project(TestMultiplePackages C) -find_package (Python2 REQUIRED COMPONENTS Interpreter Development) -find_package (Python3 REQUIRED COMPONENTS Interpreter Development) - -# Must find Python 3 find_package (Python REQUIRED) -if (NOT Python3_EXECUTABLE STREQUAL Python_EXECUTABLE) - message (FATAL_ERROR - "Python interpreters do not match:\n" - " Python_EXECUTABLE='${Python_EXECUTABLE}'\n" - " Python3_EXECUTABLE='${Python3_EXECUTABLE}'\n" +if (CMake_TEST_FindPython2) + find_package (Python2 REQUIRED COMPONENTS Interpreter Development) + + if (NOT CMake_TEST_FindPython3 AND NOT Python2_EXECUTABLE STREQUAL Python_EXECUTABLE) + message (FATAL_ERROR + "Python interpreters do not match:\n" + " Python_EXECUTABLE='${Python_EXECUTABLE}'\n" + " Python2_EXECUTABLE='${Python3_EXECUTABLE}'\n" ) -endif() + endif() + + Python2_add_library (spam2 MODULE ../spam.c) + target_compile_definitions (spam2 PRIVATE PYTHON2) + add_test (NAME python2_spam2 + COMMAND "${CMAKE_COMMAND}" -E env "PYTHONPATH=$<TARGET_FILE_DIR:spam3>" + "${Python2_EXECUTABLE}" -c "import spam2; spam2.system(\"cd\")") -Python2_add_library (spam2 MODULE ../spam.c) -target_compile_definitions (spam2 PRIVATE PYTHON2) +endif() + +if (CMake_TEST_FindPython3) + find_package (Python3 REQUIRED COMPONENTS Interpreter Development) -Python3_add_library (spam3 MODULE ../spam.c) -target_compile_definitions (spam3 PRIVATE PYTHON3) + if (NOT Python3_EXECUTABLE STREQUAL Python_EXECUTABLE) + message (FATAL_ERROR + "Python interpreters do not match:\n" + " Python_EXECUTABLE='${Python_EXECUTABLE}'\n" + " Python3_EXECUTABLE='${Python3_EXECUTABLE}'\n" + ) + endif() + Python3_add_library (spam3 MODULE ../spam.c) + target_compile_definitions (spam3 PRIVATE PYTHON3) -add_test (NAME python2_spam2 - COMMAND "${CMAKE_COMMAND}" -E env "PYTHONPATH=$<TARGET_FILE_DIR:spam3>" - "${Python2_EXECUTABLE}" -c "import spam2; spam2.system(\"cd\")") + add_test (NAME python3_spam3 + COMMAND "${CMAKE_COMMAND}" -E env "PYTHONPATH=$<TARGET_FILE_DIR:spam3>" + "${Python3_EXECUTABLE}" -c "import spam3; spam3.system(\"cd\")") -add_test (NAME python3_spam3 - COMMAND "${CMAKE_COMMAND}" -E env "PYTHONPATH=$<TARGET_FILE_DIR:spam3>" - "${Python3_EXECUTABLE}" -c "import spam3; spam3.system(\"cd\")") +endif() diff --git a/Tests/FindPython/NumPy/CMakeLists.txt b/Tests/FindPython/NumPy/CMakeLists.txt index 9920336..336bb83 100644 --- a/Tests/FindPython/NumPy/CMakeLists.txt +++ b/Tests/FindPython/NumPy/CMakeLists.txt @@ -2,21 +2,30 @@ cmake_minimum_required(VERSION 3.5) project(TestNumPy LANGUAGES C) -find_package (Python2 REQUIRED COMPONENTS Interpreter Development NumPy) -find_package (Python3 REQUIRED COMPONENTS Interpreter Development NumPy) +if(CMake_TEST_FindPython2_NumPy) -Python2_add_library (arraytest2 MODULE arraytest.c) -target_compile_definitions (arraytest2 PRIVATE PYTHON2) -target_link_libraries (arraytest2 PRIVATE Python2::NumPy) + find_package (Python2 REQUIRED COMPONENTS Interpreter Development NumPy) -Python3_add_library (arraytest3 MODULE arraytest.c) -target_compile_definitions (arraytest3 PRIVATE PYTHON3) -target_link_libraries (arraytest3 PRIVATE Python3::NumPy) + Python2_add_library (arraytest2 MODULE arraytest.c) + target_compile_definitions (arraytest2 PRIVATE PYTHON2) + target_link_libraries (arraytest2 PRIVATE Python2::NumPy) -add_test (NAME python2_arraytest - COMMAND "${CMAKE_COMMAND}" -E env "PYTHONPATH=$<TARGET_FILE_DIR:arraytest2>" - "${Python2_EXECUTABLE}" -c "import numpy; import arraytest2; arraytest2.vecsq(numpy.array([1, 2, 3]));") + add_test (NAME python2_arraytest + COMMAND "${CMAKE_COMMAND}" -E env "PYTHONPATH=$<TARGET_FILE_DIR:arraytest2>" + "${Python2_EXECUTABLE}" -c "import numpy; import arraytest2; arraytest2.vecsq(numpy.array([1, 2, 3]));") -add_test (NAME python3_arraytest - COMMAND "${CMAKE_COMMAND}" -E env "PYTHONPATH=$<TARGET_FILE_DIR:arraytest3>" - "${Python3_EXECUTABLE}" -c "import numpy; import arraytest3; arraytest3.vecsq(numpy.array([1, 2, 3]));") +endif() + +if(CMake_TEST_FindPython3_NumPy) + + find_package (Python3 REQUIRED COMPONENTS Interpreter Development NumPy) + + Python3_add_library (arraytest3 MODULE arraytest.c) + target_compile_definitions (arraytest3 PRIVATE PYTHON3) + target_link_libraries (arraytest3 PRIVATE Python3::NumPy) + + add_test (NAME python3_arraytest + COMMAND "${CMAKE_COMMAND}" -E env "PYTHONPATH=$<TARGET_FILE_DIR:arraytest3>" + "${Python3_EXECUTABLE}" -c "import numpy; import arraytest3; arraytest3.vecsq(numpy.array([1, 2, 3]));") + +endif() diff --git a/Tests/FindPython/NumPyOnly/CMakeLists.txt b/Tests/FindPython/NumPyOnly/CMakeLists.txt index 9aa1bcf..115cf2b 100644 --- a/Tests/FindPython/NumPyOnly/CMakeLists.txt +++ b/Tests/FindPython/NumPyOnly/CMakeLists.txt @@ -2,13 +2,23 @@ cmake_minimum_required(VERSION 3.5) project(TestNumPyOnly LANGUAGES C) -find_package(Python2 REQUIRED COMPONENTS NumPy) -find_package(Python3 REQUIRED COMPONENTS NumPy) +if(CMake_TEST_FindPython2_NumPy) + + find_package(Python2 REQUIRED COMPONENTS NumPy) + + Python2_add_library (arraytest2 MODULE ../NumPy/arraytest.c) + target_compile_definitions (arraytest2 PRIVATE PYTHON2) + target_link_libraries (arraytest2 PRIVATE Python2::NumPy) + +endif() -Python2_add_library (arraytest2 MODULE ../NumPy/arraytest.c) -target_compile_definitions (arraytest2 PRIVATE PYTHON2) -target_link_libraries (arraytest2 PRIVATE Python2::NumPy) + +if(CMake_TEST_FindPython3_NumPy) + +find_package(Python3 REQUIRED COMPONENTS NumPy) Python3_add_library (arraytest3 MODULE ../NumPy/arraytest.c) target_compile_definitions (arraytest3 PRIVATE PYTHON3) target_link_libraries (arraytest3 PRIVATE Python3::NumPy) + +endif() diff --git a/Tests/FindPython/RequiredArtifacts/CMakeLists.txt b/Tests/FindPython/RequiredArtifacts/CMakeLists.txt index cb9d4d3..eec28a5 100644 --- a/Tests/FindPython/RequiredArtifacts/CMakeLists.txt +++ b/Tests/FindPython/RequiredArtifacts/CMakeLists.txt @@ -4,13 +4,20 @@ project(TestRequiredArtifacts LANGUAGES C) include(CTest) -find_package(Python2 REQUIRED COMPONENTS Interpreter Development) -if (NOT Python2_FOUND) - message (FATAL_ERROR "Failed to find Python 2") +if(CMake_TEST_FindPython2) + find_package(Python2 REQUIRED COMPONENTS Interpreter Development) + if (NOT Python2_FOUND) + message (FATAL_ERROR "Failed to find Python 2") + endif() + set(USER_LIBRARY "${Python2_LIBRARY_RELEASE}") + set(USER_INCLUDE_DIR "${Python2_INCLUDE_DIRS}") +else() + set(USER_LIBRARY "/path/to/invalid${CMAKE_C_LINK_LIBRARY_SUFFIX}") + set(USER_INCLUDE_DIR "/path/to/invalid/dir") endif() set(components Interpreter Development) -if (CMake_TEST_FindPython_SABIModule AND WIN32) +if (CMake_TEST_FindPython3_SABIModule AND WIN32) list (APPEND components Development.SABIModule) endif() find_package(Python3 REQUIRED COMPONENTS ${components}) @@ -61,7 +68,7 @@ add_test(NAME FindPython.RequiredArtifacts.Library.INVALID COMMAND ${build_generator_args} --build-project TestRequiredArtifacts.Check --build-options -DPYTHON_IS_FOUND=FALSE -DCHECK_LIBRARY=ON - "-DPython3_LIBRARY=${Python2_LIBRARY_RELEASE}" + "-DPython3_LIBRARY=${USER_LIBRARY}" --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> ) @@ -84,7 +91,7 @@ add_test(NAME FindPython.RequiredArtifacts.Include.INVALID COMMAND ${build_generator_args} --build-project TestRequiredArtifacts.Check --build-options -DPYTHON_IS_FOUND=FALSE -DCHECK_INCLUDE=ON - "-DPython3_INCLUDE_DIR=${Python2_INCLUDE_DIRS}" + "-DPython3_INCLUDE_DIR=${USER_INCLUDE_DIR}" --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> ) @@ -97,7 +104,7 @@ add_test(NAME FindPython.RequiredArtifacts.Interpreter-Library.INVALID COMMAND --build-project TestRequiredArtifacts.Check --build-options -DPYTHON_IS_FOUND=FALSE -DCHECK_INTERPRETER=ON -DCHECK_LIBRARY=ON "-DPython3_EXECUTABLE=${Python3_EXECUTABLE}" - "-DPython3_LIBRARY=${Python2_LIBRARY_RELEASE}" + "-DPython3_LIBRARY=${USER_LIBRARY}" --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> ) @@ -110,11 +117,11 @@ add_test(NAME FindPython.RequiredArtifacts.Library-Include.INVALID COMMAND --build-project TestRequiredArtifacts.Check --build-options -DPYTHON_IS_FOUND=FALSE -DCHECK_LIBRARY=ON -DCHECK_INCLUDE=ON "-DPython3_LIBRARY=${Python3_LIBRARY_RELEASE}" - "-DPython3_INCLUDE_DIR=${Python2_INCLUDE_DIRS}" + "-DPython3_INCLUDE_DIR=${USER_INCLUDE_DIR}" --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> ) -if (CMake_TEST_FindPython_SABIModule AND WIN32) +if (CMake_TEST_FindPython3_SABIModule AND WIN32) add_test(NAME FindPython.RequiredArtifacts.SABILibrary.VALID COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> --build-and-test @@ -134,7 +141,7 @@ if (CMake_TEST_FindPython_SABIModule AND WIN32) ${build_generator_args} --build-project TestRequiredArtifacts.Check --build-options -DPYTHON_IS_FOUND=FALSE -DCHECK_SABI_LIBRARY=ON - "-DPython3_SABI_LIBRARY=${Python2_LIBRARY_RELEASE}" + "-DPython3_SABI_LIBRARY=${USER_LIBRARY}" --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> ) endif() diff --git a/Tests/FindPython/SOABI/CMakeLists.txt b/Tests/FindPython/SOABI/CMakeLists.txt index 60399d3..6c0e9a9 100644 --- a/Tests/FindPython/SOABI/CMakeLists.txt +++ b/Tests/FindPython/SOABI/CMakeLists.txt @@ -2,37 +2,40 @@ cmake_minimum_required(VERSION 3.5) project(TestSOABI LANGUAGES C) -find_package(Python3 COMPONENTS ${CMake_TEST_FindPython_COMPONENT}) -if (NOT Python3_FOUND) - message (FATAL_ERROR "Failed to find Python 3") -endif() +if(CMake_TEST_FindPython3) + find_package(Python3 COMPONENTS ${CMake_TEST_FindPython_COMPONENT}) + if (NOT Python3_FOUND) + message (FATAL_ERROR "Failed to find Python 3") + endif() -if(NOT DEFINED Python3_SOABI) - message(FATAL_ERROR "Python3_SOABI for ${CMake_TEST_FindPython_COMPONENT} not found") -endif() + if(NOT DEFINED Python3_SOABI) + message(FATAL_ERROR "Python3_SOABI for ${CMake_TEST_FindPython_COMPONENT} not found") + endif() -if (Python3_Development_FOUND AND Python3_SOABI) - Python3_add_library (spam3 MODULE WITH_SOABI ../spam.c) - target_compile_definitions (spam3 PRIVATE PYTHON3) + if (Python3_Development_FOUND AND Python3_SOABI) + Python3_add_library (spam3 MODULE WITH_SOABI ../spam.c) + target_compile_definitions (spam3 PRIVATE PYTHON3) - get_property (suffix TARGET spam3 PROPERTY SUFFIX) - if (NOT suffix MATCHES "^.${Python3_SOABI}") - message(FATAL_ERROR "Module suffix do not include Python3_SOABI") + get_property (suffix TARGET spam3 PROPERTY SUFFIX) + if (NOT suffix MATCHES "^.${Python3_SOABI}") + message(FATAL_ERROR "Module suffix do not include Python3_SOABI") + endif() endif() endif() +if(CMake_TEST_FindPython2) + find_package(Python2 COMPONENTS ${CMake_TEST_FindPython_COMPONENT}) + if(NOT DEFINED Python2_SOABI) + message(FATAL_ERROR "Python2_SOABI for ${CMake_TEST_FindPython_COMPONENT} not found") + endif() -find_package(Python2 COMPONENTS ${CMake_TEST_FindPython_COMPONENT}) -if(NOT DEFINED Python2_SOABI) - message(FATAL_ERROR "Python2_SOABI for ${CMake_TEST_FindPython_COMPONENT} not found") -endif() - -if (Python2_Development_FOUND AND Python2_SOABI) - Python2_add_library (spam2 MODULE WITH_SOABI ../spam.c) - target_compile_definitions (spam2 PRIVATE PYTHON2) + if (Python2_Development_FOUND AND Python2_SOABI) + Python2_add_library (spam2 MODULE WITH_SOABI ../spam.c) + target_compile_definitions (spam2 PRIVATE PYTHON2) - get_property (suffix TARGET spam2 PROPERTY SUFFIX) - if (NOT suffix MATCHES "^.${Python2_SOABI}") - message(FATAL_ERROR "Module suffix do not include Python2_SOABI") + get_property (suffix TARGET spam2 PROPERTY SUFFIX) + if (NOT suffix MATCHES "^.${Python2_SOABI}") + message(FATAL_ERROR "Module suffix do not include Python2_SOABI") + endif() endif() endif() diff --git a/Tests/FindPython/VirtualEnv/CMakeLists.txt b/Tests/FindPython/VirtualEnv/CMakeLists.txt index e2e5bd2..ea742ea 100644 --- a/Tests/FindPython/VirtualEnv/CMakeLists.txt +++ b/Tests/FindPython/VirtualEnv/CMakeLists.txt @@ -27,21 +27,23 @@ add_test(NAME FindPython3.VirtualEnvDefault "${CMAKE_COMMAND}" "-DPYTHON3_VIRTUAL_ENV=${Python3_VIRTUAL_ENV}" -P "${CMAKE_CURRENT_LIST_DIR}/VirtualEnvDefault.cmake") -add_test(NAME FindPython3.VirtualEnvOnly - COMMAND "${CMAKE_COMMAND}" -E env --unset=PYTHONHOME - --unset=CONDA_PREFIX - "VIRTUAL_ENV=${Python3_VIRTUAL_ENV}" - "${CMAKE_COMMAND}" "-DPYTHON3_VIRTUAL_ENV=${Python3_VIRTUAL_ENV}" - -P "${CMAKE_CURRENT_LIST_DIR}/VirtualEnvOnly.cmake") -add_test(NAME FindPython3.UnsetVirtualEnvOnly - COMMAND "${CMAKE_COMMAND}" -E env --unset=PYTHONHOME - --unset=VIRTUAL_ENV - --unset=CONDA_PREFIX - "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_LIST_DIR}/VirtualEnvOnly.cmake") - add_test(NAME FindPython3.VirtualEnvStandard COMMAND "${CMAKE_COMMAND}" -E env --unset=PYTHONHOME --unset=CONDA_PREFIX "VIRTUAL_ENV=${Python3_VIRTUAL_ENV}" "${CMAKE_COMMAND}" "-DPYTHON3_VIRTUAL_ENV=${Python3_VIRTUAL_ENV}" -P "${CMAKE_CURRENT_LIST_DIR}/VirtualEnvStandard.cmake") + +if(CMake_TEST_FindPython2) + add_test(NAME FindPython3.VirtualEnvOnly + COMMAND "${CMAKE_COMMAND}" -E env --unset=PYTHONHOME + --unset=CONDA_PREFIX + "VIRTUAL_ENV=${Python3_VIRTUAL_ENV}" + "${CMAKE_COMMAND}" "-DPYTHON3_VIRTUAL_ENV=${Python3_VIRTUAL_ENV}" + -P "${CMAKE_CURRENT_LIST_DIR}/VirtualEnvOnly.cmake") + add_test(NAME FindPython3.UnsetVirtualEnvOnly + COMMAND "${CMAKE_COMMAND}" -E env --unset=PYTHONHOME + --unset=VIRTUAL_ENV + --unset=CONDA_PREFIX + "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_LIST_DIR}/VirtualEnvOnly.cmake") +endif() diff --git a/Tests/FindPython/VirtualEnvConda/CMakeLists.txt b/Tests/FindPython/VirtualEnvConda/CMakeLists.txt index 2f7c0db..3a64c31 100644 --- a/Tests/FindPython/VirtualEnvConda/CMakeLists.txt +++ b/Tests/FindPython/VirtualEnvConda/CMakeLists.txt @@ -26,21 +26,23 @@ add_test(NAME FindPython3.VirtualEnvDefaultConda "${CMAKE_COMMAND}" "-DPYTHON3_VIRTUAL_ENV=${Python3_VIRTUAL_ENV}" -P "${CMAKE_CURRENT_LIST_DIR}/VirtualEnvDefault.cmake") -add_test(NAME FindPython3.VirtualEnvOnlyConda - COMMAND "${CMAKE_COMMAND}" -E env --unset=PYTHONHOME - --unset=VIRTUAL_ENV - "CONDA_PREFIX=${Python3_VIRTUAL_ENV}" - "${CMAKE_COMMAND}" "-DPYTHON3_VIRTUAL_ENV=${Python3_VIRTUAL_ENV}" - -P "${CMAKE_CURRENT_LIST_DIR}/VirtualEnvOnly.cmake") -add_test(NAME FindPython3.UnsetVirtualEnvOnlyConda - COMMAND "${CMAKE_COMMAND}" -E env --unset=PYTHONHOME - --unset=CONDA_PREFIX - --unset=VIRTUAL_ENV - "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_LIST_DIR}/VirtualEnvOnly.cmake") - add_test(NAME FindPython3.VirtualEnvStandardConda COMMAND "${CMAKE_COMMAND}" -E env --unset=PYTHONHOME --unset=VIRTUAL_ENV "CONDA_PREFIX=${Python3_VIRTUAL_ENV}" "${CMAKE_COMMAND}" "-DPYTHON3_VIRTUAL_ENV=${Python3_VIRTUAL_ENV}" -P "${CMAKE_CURRENT_LIST_DIR}/VirtualEnvStandard.cmake") + +if(Cmake_TEST_FindPython2) + add_test(NAME FindPython3.VirtualEnvOnlyConda + COMMAND "${CMAKE_COMMAND}" -E env --unset=PYTHONHOME + --unset=VIRTUAL_ENV + "CONDA_PREFIX=${Python3_VIRTUAL_ENV}" + "${CMAKE_COMMAND}" "-DPYTHON3_VIRTUAL_ENV=${Python3_VIRTUAL_ENV}" + -P "${CMAKE_CURRENT_LIST_DIR}/VirtualEnvOnly.cmake") + add_test(NAME FindPython3.UnsetVirtualEnvOnlyConda + COMMAND "${CMAKE_COMMAND}" -E env --unset=PYTHONHOME + --unset=CONDA_PREFIX + --unset=VIRTUAL_ENV + "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_LIST_DIR}/VirtualEnvOnly.cmake") +endif() diff --git a/Tests/GeneratorExpression/CMakeLists.txt b/Tests/GeneratorExpression/CMakeLists.txt index ef115e6..df7cda0 100644 --- a/Tests/GeneratorExpression/CMakeLists.txt +++ b/Tests/GeneratorExpression/CMakeLists.txt @@ -214,6 +214,22 @@ set_property(TARGET importedFallback2 PROPERTY IMPORTED_IMPLIB_SPECIAL special_i set_property(TARGET importedFallback2 PROPERTY MAP_IMPORTED_CONFIG_NOCONFIG SPECIAL "") set_property(TARGET importedFallback2 PROPERTY MAP_IMPORTED_CONFIG_DEBUG SPECIAL "") set_property(TARGET importedFallback2 PROPERTY MAP_IMPORTED_CONFIG_RELEASE SPECIAL "") +set_property(TARGET importedFallback2 PROPERTY MAP_IMPORTED_CONFIG_RELWITHDEBINFO SPECIAL "") + +add_library(importedFallback3 SHARED IMPORTED) +set_property(TARGET importedFallback3 PROPERTY IMPORTED_LOCATION_DEBUG debug_loc) +set_property(TARGET importedFallback3 PROPERTY IMPORTED_LOCATION_RELEASE release_loc) +set_property(TARGET importedFallback3 PROPERTY IMPORTED_LOCATION fallback_loc) +set_property(TARGET importedFallback3 PROPERTY IMPORTED_IMPLIB imp_loc) +set_property(TARGET importedFallback3 PROPERTY MAP_IMPORTED_CONFIG_DEBUG "" DEBUG) +set_property(TARGET importedFallback3 PROPERTY MAP_IMPORTED_CONFIG_RELEASE "") + +add_library(importedFallback4 SHARED IMPORTED) +set_property(TARGET importedFallback4 PROPERTY IMPORTED_LOCATION fallback_loc) +set_property(TARGET importedFallback4 PROPERTY IMPORTED_IMPLIB imp_loc) + +add_library(importedFallback5 SHARED IMPORTED) +set_property(TARGET importedFallback5 PROPERTY IMPORTED_IMPLIB imp_loc) add_library(importedFallback_genex STATIC IMPORTED) set_property(TARGET importedFallback_genex PROPERTY IMPORTED_CONFIGURATIONS RELEASE) @@ -232,7 +248,10 @@ add_custom_target(check-part3 ALL -Dconfig=$<CONFIGURATION> -Dtest_imported_includes=$<TARGET_PROPERTY:imported4,INCLUDE_DIRECTORIES> -Dtest_imported_fallback=$<STREQUAL:$<TARGET_FILE_NAME:importedFallback>,fallback_loc> - -Dtest_imported_fallback2=$<IF:$<OR:$<PLATFORM_ID:Windows,CYGWIN,MSYS>,$<AND:$<PLATFORM_ID:Darwin>,$<BOOL:${CMAKE_TAPI}>>>,$<STREQUAL:$<TARGET_LINKER_FILE_NAME:importedFallback2>,special_imp>,$<STREQUAL:$<TARGET_LINKER_FILE_NAME:importedFallback2>,fallback_loc>> + -Dtest_imported_fallback2=$<STREQUAL:$<TARGET_LINKER_FILE_NAME:importedFallback2>,special_imp> + -Dtest_imported_fallback3=$<IF:$<PLATFORM_ID:Windows,CYGWIN,MSYS>,$<STREQUAL:$<TARGET_LINKER_FILE_NAME:importedFallback3>,imp_loc>,$<STREQUAL:$<TARGET_LINKER_FILE_NAME:importedFallback3>,fallback_loc>> + -Dtest_imported_fallback4=$<IF:$<PLATFORM_ID:Windows,CYGWIN,MSYS>,$<STREQUAL:$<TARGET_LINKER_FILE_NAME:importedFallback4>,imp_loc>,$<STREQUAL:$<TARGET_LINKER_FILE_NAME:importedFallback4>,fallback_loc>> + -Dtest_imported_fallback5=$<STREQUAL:$<TARGET_LINKER_FILE_NAME:importedFallback5>,imp_loc> -Dtest_imported_fallback_genex=$<STREQUAL:$<TARGET_PROPERTY:importedFallback_genex,INTERFACE_COMPILE_DEFINITIONS>,FOOBAR=1> -Dtest_alias_file_exe=$<STREQUAL:$<TARGET_FILE:Alias::SomeExe>,$<TARGET_FILE:someexe>> -Dtest_alias_file_lib=$<STREQUAL:$<TARGET_FILE:Alias::SomeLib>,$<TARGET_FILE:empty1>> diff --git a/Tests/GeneratorExpression/check-part3.cmake b/Tests/GeneratorExpression/check-part3.cmake index 7bb0d85..eda3bc1 100644 --- a/Tests/GeneratorExpression/check-part3.cmake +++ b/Tests/GeneratorExpression/check-part3.cmake @@ -20,6 +20,9 @@ endif() check(test_imported_fallback "1") check(test_imported_fallback2 "1") +check(test_imported_fallback3 "1") +check(test_imported_fallback4 "1") +check(test_imported_fallback5 "1") check(test_imported_fallback_genex "1") check(test_alias_file_exe "1") diff --git a/Tests/RunCMake/CMP0111/CMP0111-Common.cmake b/Tests/RunCMake/CMP0111/CMP0111-Common.cmake index c31e4ba..ab9e405 100644 --- a/Tests/RunCMake/CMP0111/CMP0111-Common.cmake +++ b/Tests/RunCMake/CMP0111/CMP0111-Common.cmake @@ -1,6 +1,3 @@ -# Prevent duplicate errors on some platforms. -set(CMAKE_IMPORT_LIBRARY_SUFFIX "placeholder") - add_library(unknown_lib UNKNOWN IMPORTED) add_library(static_lib STATIC IMPORTED) add_library(shared_lib SHARED IMPORTED) diff --git a/Tests/RunCMake/CMP0111/CMP0111-NEW-stderr.txt b/Tests/RunCMake/CMP0111/CMP0111-NEW-stderr.txt index 91a90e5..c6439e2 100644 --- a/Tests/RunCMake/CMP0111/CMP0111-NEW-stderr.txt +++ b/Tests/RunCMake/CMP0111/CMP0111-NEW-stderr.txt @@ -1,17 +1,6 @@ -^CMake Error in CMakeLists.txt: - IMPORTED_LOCATION not set for imported target "unknown_lib"( configuration +^(CMake Error in CMakeLists.txt: + IMPORTED_(LOCATION|IMPLIB) not set for imported target "(unknown|static)_lib"( configuration "[^"]+")?. -+ -CMake Error in CMakeLists.txt: - IMPORTED_LOCATION not set for imported target "static_lib"( configuration - "[^"]+")?. -+ -CMake Error in CMakeLists.txt: - IMPORTED_IMPLIB not set for imported target "shared_lib"( configuration - "[^"]+")?.( -+ -CMake Error in CMakeLists.txt: - IMPORTED_(LOCATION|IMPLIB) not set for imported target "(unknown|static|shared)_lib"( configuration - "[^"]+")?.)* -+ +)+ +.*(IMPORTED_LOCATION or )?IMPORTED_IMPLIB not set for imported target.*"shared_lib".* CMake Generate step failed. Build files cannot be regenerated correctly.$ diff --git a/Tests/RunCMake/CMP0111/CMP0111-WARN-stderr.txt b/Tests/RunCMake/CMP0111/CMP0111-WARN-stderr.txt index 27af911..7a46c41 100644 --- a/Tests/RunCMake/CMP0111/CMP0111-WARN-stderr.txt +++ b/Tests/RunCMake/CMP0111/CMP0111-WARN-stderr.txt @@ -1,39 +1,19 @@ -^CMake Warning \(dev\) in CMakeLists.txt: +^(CMake Warning \(dev\) in CMakeLists.txt: Policy CMP0111 is not set: An imported target missing its location property fails during generation. Run "cmake --help-policy CMP0111" for policy details. Use the cmake_policy command to set the policy and suppress this warning. - IMPORTED_LOCATION not set for imported target "unknown_lib"( configuration + IMPORTED_(LOCATION|IMPLIB) not set for imported target "(unknown|static)_lib"( configuration "[^"]+")?. This warning is for project developers. Use -Wno-dev to suppress it. -+ -CMake Warning \(dev\) in CMakeLists.txt: ++)+CMake Warning \(dev\) in CMakeLists.txt: Policy CMP0111 is not set: An imported target missing its location property fails during generation. Run "cmake --help-policy CMP0111" for policy details. Use the cmake_policy command to set the policy and suppress this warning. - IMPORTED_LOCATION not set for imported target "static_lib"( configuration + IMPORTED_(LOCATION|IMPLIB) not set for imported target "(unknown|static)_lib"( configuration "[^"]+")?. -This warning is for project developers. Use -Wno-dev to suppress it. -+ -CMake Warning \(dev\) in CMakeLists.txt: - Policy CMP0111 is not set: An imported target missing its location property - fails during generation. Run "cmake --help-policy CMP0111" for policy - details. Use the cmake_policy command to set the policy and suppress this - warning. - - IMPORTED_IMPLIB not set for imported target "shared_lib"( configuration - "[^"]+")?. -This warning is for project developers. Use -Wno-dev to suppress it.( -+ -CMake Warning \(dev\) in CMakeLists.txt: - Policy CMP0111 is not set: An imported target missing its location property - fails during generation. Run "cmake --help-policy CMP0111" for policy - details. Use the cmake_policy command to set the policy and suppress this - warning. - - IMPORTED_(LOCATION|IMPLIB) not set for imported target "(unknown|static|shared)_lib"( configuration - "[^"]+")?. -This warning is for project developers. Use -Wno-dev to suppress it.)*$ +.*(IMPORTED_LOCATION or )?IMPORTED_IMPLIB not set for imported target.*"shared_lib".* +This warning is for project developers. Use -Wno-dev to suppress it.$ diff --git a/Tests/RunCMake/CMP0115/CMP0115-OLD-stderr.txt b/Tests/RunCMake/CMP0115/CMP0115-OLD-stderr.txt index 67d00f7..3472f33 100644 --- a/Tests/RunCMake/CMP0115/CMP0115-OLD-stderr.txt +++ b/Tests/RunCMake/CMP0115/CMP0115-OLD-stderr.txt @@ -1,4 +1,13 @@ -^CMake Error at CMP0115\.cmake:[0-9]+ \(add_executable\): +^CMake Deprecation Warning at CMakeLists\.txt:[0-9]+ \(cmake_minimum_required\): + The OLD behavior for policy CMP0115 will be removed from a future version + of CMake\. + + The cmake-policies\(7\) manual explains that the OLD behaviors of all + policies are deprecated and that a policy should be set to OLD only under + specific short-term circumstances\. Projects should be ported to the NEW + behavior and not rely on setting a policy to OLD\. ++ +CMake Error at CMP0115\.cmake:[0-9]+ \(add_executable\): Cannot find source file: noexist diff --git a/Tests/RunCMake/CMP0116/CMP0116-Mixed-stderr.txt b/Tests/RunCMake/CMP0116/CMP0116-Mixed-stderr.txt index 10e83a9..930dd3c 100644 --- a/Tests/RunCMake/CMP0116/CMP0116-Mixed-stderr.txt +++ b/Tests/RunCMake/CMP0116/CMP0116-Mixed-stderr.txt @@ -1,4 +1,15 @@ -^CMake Warning \(dev\) at CMP0116-Mixed\.cmake:1 \(add_custom_command\): +^CMake Deprecation Warning at CMP0116-Mixed\.cmake:[0-9]+ \(cmake_policy\): + The OLD behavior for policy CMP0116 will be removed from a future version + of CMake\. + + The cmake-policies\(7\) manual explains that the OLD behaviors of all + policies are deprecated and that a policy should be set to OLD only under + specific short-term circumstances\. Projects should be ported to the NEW + behavior and not rely on setting a policy to OLD\. +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\) ++ +CMake Warning \(dev\) at CMP0116-Mixed\.cmake:1 \(add_custom_command\): Policy CMP0116 is not set: Ninja generators transform DEPFILEs from add_custom_command\(\)\. Run "cmake --help-policy CMP0116" for policy details\. Use the cmake_policy command to set the policy and suppress this diff --git a/Tests/RunCMake/CMP0116/CMP0116-OLD-NOWARN-stderr.txt b/Tests/RunCMake/CMP0116/CMP0116-OLD-NOWARN-stderr.txt new file mode 100644 index 0000000..887601c --- /dev/null +++ b/Tests/RunCMake/CMP0116/CMP0116-OLD-NOWARN-stderr.txt @@ -0,0 +1,8 @@ +^CMake Deprecation Warning at CMakeLists\.txt:[0-9]+ \(cmake_minimum_required\): + The OLD behavior for policy CMP0116 will be removed from a future version + of CMake\. + + The cmake-policies\(7\) manual explains that the OLD behaviors of all + policies are deprecated and that a policy should be set to OLD only under + specific short-term circumstances\. Projects should be ported to the NEW + behavior and not rely on setting a policy to OLD\.$ diff --git a/Tests/RunCMake/CMP0116/CMP0116-OLD-WARN-stderr.txt b/Tests/RunCMake/CMP0116/CMP0116-OLD-WARN-stderr.txt new file mode 100644 index 0000000..887601c --- /dev/null +++ b/Tests/RunCMake/CMP0116/CMP0116-OLD-WARN-stderr.txt @@ -0,0 +1,8 @@ +^CMake Deprecation Warning at CMakeLists\.txt:[0-9]+ \(cmake_minimum_required\): + The OLD behavior for policy CMP0116 will be removed from a future version + of CMake\. + + The cmake-policies\(7\) manual explains that the OLD behaviors of all + policies are deprecated and that a policy should be set to OLD only under + specific short-term circumstances\. Projects should be ported to the NEW + behavior and not rely on setting a policy to OLD\.$ diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test1-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test1-stderr.txt index 2af72a4..9285f9d 100644 --- a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test1-stderr.txt +++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test1-stderr.txt @@ -1,4 +1,15 @@ -^prop: `0` +^CMake Deprecation Warning at CMP0118-OLD-Test1\.cmake:[0-9]+ \(cmake_policy\): + The OLD behavior for policy CMP0118 will be removed from a future version + of CMake\. + + The cmake-policies\(7\) manual explains that the OLD behaviors of all + policies are deprecated and that a policy should be set to OLD only under + specific short-term circumstances\. Projects should be ported to the NEW + behavior and not rely on setting a policy to OLD\. +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\) ++ +prop: `0` CMake Error at CMP0118-Common-Test1\.cmake:[0-9]+ \(target_sources\): Cannot find source file: diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test10-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test10-stderr.txt index 6109f65..9bd3d33 100644 --- a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test10-stderr.txt +++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test10-stderr.txt @@ -1,4 +1,15 @@ -^Generated_source0\.txt: # 1a # GENERATED = `1` +^CMake Deprecation Warning at CMP0118-OLD-Test10\.cmake:[0-9]+ \(cmake_policy\): + The OLD behavior for policy CMP0118 will be removed from a future version + of CMake\. + + The cmake-policies\(7\) manual explains that the OLD behaviors of all + policies are deprecated and that a policy should be set to OLD only under + specific short-term circumstances\. Projects should be ported to the NEW + behavior and not rely on setting a policy to OLD\. +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\) ++ +Generated_source0\.txt: # 1a # GENERATED = `1` Generated_source0\.txt: # 1b # GENERATED = `1` Generated_source0\.txt: # 2a # GENERATED = `1` Generated_source0\.txt: # 2b # GENERATED = `1` diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test11-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test11-stderr.txt index e5e97de..4730caf 100644 --- a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test11-stderr.txt +++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test11-stderr.txt @@ -1,4 +1,15 @@ -^Generated_source0\.txt: # 1a # GENERATED = `1` +^CMake Deprecation Warning at CMP0118-OLD-Test11\.cmake:[0-9]+ \(cmake_policy\): + The OLD behavior for policy CMP0118 will be removed from a future version + of CMake\. + + The cmake-policies\(7\) manual explains that the OLD behaviors of all + policies are deprecated and that a policy should be set to OLD only under + specific short-term circumstances\. Projects should be ported to the NEW + behavior and not rely on setting a policy to OLD\. +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\) ++ +Generated_source0\.txt: # 1a # GENERATED = `1` Generated_source0\.txt: # 1b # GENERATED = `1` Generated_source0\.txt: # 2a # GENERATED = `1` Generated_source0\.txt: # 2b # GENERATED = `1` diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test12-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test12-stderr.txt index e6c429c..69a07e1 100644 --- a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test12-stderr.txt +++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test12-stderr.txt @@ -1,4 +1,15 @@ -^CMake Error at subdir-Common-Test12/CMakeLists\.txt:[0-9]+ \(add_custom_command\): +^CMake Deprecation Warning at CMP0118-OLD-Test12\.cmake:[0-9]+ \(cmake_policy\): + The OLD behavior for policy CMP0118 will be removed from a future version + of CMake\. + + The cmake-policies\(7\) manual explains that the OLD behaviors of all + policies are deprecated and that a policy should be set to OLD only under + specific short-term circumstances\. Projects should be ported to the NEW + behavior and not rely on setting a policy to OLD\. +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\) ++ +CMake Error at subdir-Common-Test12/CMakeLists\.txt:[0-9]+ \(add_custom_command\): TARGET 'custom[4-6]' was not created in this directory\. + CMake Error at subdir-Common-Test12/CMakeLists\.txt:[0-9]+ \(add_custom_command\): diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test13-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test13-stderr.txt index 75dbf23..45c1dcb 100644 --- a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test13-stderr.txt +++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test13-stderr.txt @@ -1,4 +1,15 @@ -^CMake Error at subdir-Common-Test13/CMakeLists\.txt:[0-9]+ \(add_custom_command\): +^CMake Deprecation Warning at CMP0118-OLD-Test13\.cmake:[0-9]+ \(cmake_policy\): + The OLD behavior for policy CMP0118 will be removed from a future version + of CMake\. + + The cmake-policies\(7\) manual explains that the OLD behaviors of all + policies are deprecated and that a policy should be set to OLD only under + specific short-term circumstances\. Projects should be ported to the NEW + behavior and not rely on setting a policy to OLD\. +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\) ++ +CMake Error at subdir-Common-Test13/CMakeLists\.txt:[0-9]+ \(add_custom_command\): TARGET 'custom[4-6]' was not created in this directory\. + CMake Error at subdir-Common-Test13/CMakeLists\.txt:[0-9]+ \(add_custom_command\): diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test14-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test14-stderr.txt index f5b3d1a..7ade0cf 100644 --- a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test14-stderr.txt +++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test14-stderr.txt @@ -1,4 +1,15 @@ -^Generated_source0\.txt: # 1a # GENERATED = `1` +^CMake Deprecation Warning at CMP0118-OLD-Test14\.cmake:[0-9]+ \(cmake_policy\): + The OLD behavior for policy CMP0118 will be removed from a future version + of CMake\. + + The cmake-policies\(7\) manual explains that the OLD behaviors of all + policies are deprecated and that a policy should be set to OLD only under + specific short-term circumstances\. Projects should be ported to the NEW + behavior and not rely on setting a policy to OLD\. +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\) ++ +Generated_source0\.txt: # 1a # GENERATED = `1` Generated_source0\.txt: # 1b # GENERATED = `1` Generated_source0\.txt: # 2a # GENERATED = `1` Generated_source0\.txt: # 2b # GENERATED = `1` diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test15-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test15-stderr.txt index a30bc84..5735539 100644 --- a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test15-stderr.txt +++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test15-stderr.txt @@ -1,4 +1,15 @@ -^Generated_source0\.txt: # 1a # GENERATED = `1` +^CMake Deprecation Warning at CMP0118-OLD-Test15\.cmake:[0-9]+ \(cmake_policy\): + The OLD behavior for policy CMP0118 will be removed from a future version + of CMake\. + + The cmake-policies\(7\) manual explains that the OLD behaviors of all + policies are deprecated and that a policy should be set to OLD only under + specific short-term circumstances\. Projects should be ported to the NEW + behavior and not rely on setting a policy to OLD\. +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\) ++ +Generated_source0\.txt: # 1a # GENERATED = `1` Generated_source0\.txt: # 1b # GENERATED = `1` Generated_source0\.txt: # 2a # GENERATED = `1` Generated_source0\.txt: # 2b # GENERATED = `1` diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test2-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test2-stderr.txt index 403ce5a..74eb3e1 100644 --- a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test2-stderr.txt +++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test2-stderr.txt @@ -1 +1,12 @@ -^prop: `1`$ +^CMake Deprecation Warning at CMP0118-OLD-Test2\.cmake:[0-9]+ \(cmake_policy\): + The OLD behavior for policy CMP0118 will be removed from a future version + of CMake\. + + The cmake-policies\(7\) manual explains that the OLD behaviors of all + policies are deprecated and that a policy should be set to OLD only under + specific short-term circumstances\. Projects should be ported to the NEW + behavior and not rely on setting a policy to OLD\. +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\) ++ +prop: `1`$ diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test3-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test3-stderr.txt index 4f4fea3..cce5b19 100644 --- a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test3-stderr.txt +++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test3-stderr.txt @@ -1,4 +1,15 @@ -^Generated_with_full_path1\.txt: # 1a # GENERATED = `1` +^CMake Deprecation Warning at CMP0118-OLD-Test3\.cmake:[0-9]+ \(cmake_policy\): + The OLD behavior for policy CMP0118 will be removed from a future version + of CMake\. + + The cmake-policies\(7\) manual explains that the OLD behaviors of all + policies are deprecated and that a policy should be set to OLD only under + specific short-term circumstances\. Projects should be ported to the NEW + behavior and not rely on setting a policy to OLD\. +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\) ++ +Generated_with_full_path1\.txt: # 1a # GENERATED = `1` Generated_with_full_path1\.txt: # 1b # GENERATED = `1` Generated_with_full_path1\.txt: # 2a # GENERATED = `1` Generated_with_full_path1\.txt: # 2b # GENERATED = `1` diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test3b-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test3b-stderr.txt index 3c80531..47eee2e 100644 --- a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test3b-stderr.txt +++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test3b-stderr.txt @@ -1,4 +1,15 @@ -^Generated_with_full_path1\.txt: # 1a # GENERATED = `1` +^CMake Deprecation Warning at CMP0118-OLD-Test3b\.cmake:[0-9]+ \(cmake_policy\): + The OLD behavior for policy CMP0118 will be removed from a future version + of CMake\. + + The cmake-policies\(7\) manual explains that the OLD behaviors of all + policies are deprecated and that a policy should be set to OLD only under + specific short-term circumstances\. Projects should be ported to the NEW + behavior and not rely on setting a policy to OLD\. +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\) ++ +Generated_with_full_path1\.txt: # 1a # GENERATED = `1` Generated_with_full_path1\.txt: # 1b # GENERATED = `1` Generated_with_full_path1\.txt: # 2a # GENERATED = `1` Generated_with_full_path1\.txt: # 2b # GENERATED = `1` diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test4-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test4-stderr.txt index 9600fee..f17c9be 100644 --- a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test4-stderr.txt +++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test4-stderr.txt @@ -1,4 +1,15 @@ -^Generated_with_full_path1\.txt: # 1a # GENERATED = `0` +^CMake Deprecation Warning at CMP0118-OLD-Test4\.cmake:[0-9]+ \(cmake_policy\): + The OLD behavior for policy CMP0118 will be removed from a future version + of CMake\. + + The cmake-policies\(7\) manual explains that the OLD behaviors of all + policies are deprecated and that a policy should be set to OLD only under + specific short-term circumstances\. Projects should be ported to the NEW + behavior and not rely on setting a policy to OLD\. +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\) ++ +Generated_with_full_path1\.txt: # 1a # GENERATED = `0` Generated_with_full_path1\.txt: # 1b # GENERATED = `0` Generated_with_full_path1\.txt: # 2a # GENERATED = `0` Generated_with_full_path1\.txt: # 2b # GENERATED = `0` diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test4b-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test4b-stderr.txt index e638660..388e90e 100644 --- a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test4b-stderr.txt +++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test4b-stderr.txt @@ -1,4 +1,15 @@ -^Generated_with_full_path1\.txt: # 1a # GENERATED = `0` +^CMake Deprecation Warning at CMP0118-OLD-Test4b\.cmake:[0-9]+ \(cmake_policy\): + The OLD behavior for policy CMP0118 will be removed from a future version + of CMake\. + + The cmake-policies\(7\) manual explains that the OLD behaviors of all + policies are deprecated and that a policy should be set to OLD only under + specific short-term circumstances\. Projects should be ported to the NEW + behavior and not rely on setting a policy to OLD\. +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\) ++ +Generated_with_full_path1\.txt: # 1a # GENERATED = `0` Generated_with_full_path1\.txt: # 1b # GENERATED = `0` Generated_with_full_path1\.txt: # 2a # GENERATED = `0` Generated_with_full_path1\.txt: # 2b # GENERATED = `0` diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test5-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test5-stderr.txt index 18e6a8c..4a67fa7 100644 --- a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test5-stderr.txt +++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test5-stderr.txt @@ -1,4 +1,15 @@ -^Generated_with_full_path1\.txt: # 1a # GENERATED = `1` +^CMake Deprecation Warning at CMP0118-OLD-Test5\.cmake:[0-9]+ \(cmake_policy\): + The OLD behavior for policy CMP0118 will be removed from a future version + of CMake\. + + The cmake-policies\(7\) manual explains that the OLD behaviors of all + policies are deprecated and that a policy should be set to OLD only under + specific short-term circumstances\. Projects should be ported to the NEW + behavior and not rely on setting a policy to OLD\. +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\) ++ +Generated_with_full_path1\.txt: # 1a # GENERATED = `1` Generated_with_full_path1\.txt: # 1b # GENERATED = `1` Generated_with_full_path1\.txt: # 2a # GENERATED = `1` Generated_with_full_path1\.txt: # 2b # GENERATED = `1` diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test6-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test6-stderr.txt index a60545f..0cad373 100644 --- a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test6-stderr.txt +++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test6-stderr.txt @@ -1,4 +1,15 @@ -^Generated_source1\.txt: # 1a # GENERATED = `1` +^CMake Deprecation Warning at CMP0118-OLD-Test6\.cmake:[0-9]+ \(cmake_policy\): + The OLD behavior for policy CMP0118 will be removed from a future version + of CMake\. + + The cmake-policies\(7\) manual explains that the OLD behaviors of all + policies are deprecated and that a policy should be set to OLD only under + specific short-term circumstances\. Projects should be ported to the NEW + behavior and not rely on setting a policy to OLD\. +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\) ++ +Generated_source1\.txt: # 1a # GENERATED = `1` Generated_source1\.txt: # 1b # GENERATED = `1` Generated_source1\.txt: # 2a # GENERATED = `1` Generated_source1\.txt: # 2b # GENERATED = `1` diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test7-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test7-stderr.txt index fd496cb..7f232d5 100644 --- a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test7-stderr.txt +++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test7-stderr.txt @@ -1,4 +1,15 @@ -^Generated_source1\.txt: # 1a # GENERATED = `1` +^CMake Deprecation Warning at CMP0118-OLD-Test7\.cmake:[0-9]+ \(cmake_policy\): + The OLD behavior for policy CMP0118 will be removed from a future version + of CMake\. + + The cmake-policies\(7\) manual explains that the OLD behaviors of all + policies are deprecated and that a policy should be set to OLD only under + specific short-term circumstances\. Projects should be ported to the NEW + behavior and not rely on setting a policy to OLD\. +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\) ++ +Generated_source1\.txt: # 1a # GENERATED = `1` Generated_source1\.txt: # 1b # GENERATED = `1` Generated_source1\.txt: # 2a # GENERATED = `1` Generated_source1\.txt: # 2b # GENERATED = `1` diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test8-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test8-stderr.txt index 3505242..dd9d2ef 100644 --- a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test8-stderr.txt +++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test8-stderr.txt @@ -1,4 +1,15 @@ -^Generated_source1\.txt: # 1a # GENERATED = `0` +^CMake Deprecation Warning at CMP0118-OLD-Test8\.cmake:[0-9]+ \(cmake_policy\): + The OLD behavior for policy CMP0118 will be removed from a future version + of CMake\. + + The cmake-policies\(7\) manual explains that the OLD behaviors of all + policies are deprecated and that a policy should be set to OLD only under + specific short-term circumstances\. Projects should be ported to the NEW + behavior and not rely on setting a policy to OLD\. +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\) ++ +Generated_source1\.txt: # 1a # GENERATED = `0` Generated_source1\.txt: # 1b # GENERATED = `0` Generated_source1\.txt: # 2a # GENERATED = `0` Generated_source1\.txt: # 2b # GENERATED = `0` diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test9-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test9-stderr.txt index 63a9341..e01f782 100644 --- a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test9-stderr.txt +++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test9-stderr.txt @@ -1,4 +1,15 @@ -^Generated_source1\.txt: # 1a # GENERATED = `0` +^CMake Deprecation Warning at CMP0118-OLD-Test9\.cmake:[0-9]+ \(cmake_policy\): + The OLD behavior for policy CMP0118 will be removed from a future version + of CMake\. + + The cmake-policies\(7\) manual explains that the OLD behaviors of all + policies are deprecated and that a policy should be set to OLD only under + specific short-term circumstances\. Projects should be ported to the NEW + behavior and not rely on setting a policy to OLD\. +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\) ++ +Generated_source1\.txt: # 1a # GENERATED = `0` Generated_source1\.txt: # 1b # GENERATED = `0` Generated_source1\.txt: # 2a # GENERATED = `0` Generated_source1\.txt: # 2b # GENERATED = `0` diff --git a/Tests/RunCMake/CMP0118/GenInSubdir-OLD-stderr.txt b/Tests/RunCMake/CMP0118/GenInSubdir-OLD-stderr.txt index 5e9cf6c..2fc472b 100644 --- a/Tests/RunCMake/CMP0118/GenInSubdir-OLD-stderr.txt +++ b/Tests/RunCMake/CMP0118/GenInSubdir-OLD-stderr.txt @@ -1,4 +1,15 @@ -^CMake Error at GenInSubdir/CMakeLists\.txt:[0-9]+ \(target_sources\): +^CMake Deprecation Warning at GenInSubdir-OLD\.cmake:[0-9]+ \(cmake_policy\): + The OLD behavior for policy CMP0118 will be removed from a future version + of CMake\. + + The cmake-policies\(7\) manual explains that the OLD behaviors of all + policies are deprecated and that a policy should be set to OLD only under + specific short-term circumstances\. Projects should be ported to the NEW + behavior and not rely on setting a policy to OLD\. +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\) ++ +CMake Error at GenInSubdir/CMakeLists\.txt:[0-9]+ \(target_sources\): Cannot find source file: [^ diff --git a/Tests/RunCMake/CMP0119/CMP0119-OLD-stderr.txt b/Tests/RunCMake/CMP0119/CMP0119-OLD-stderr.txt new file mode 100644 index 0000000..86eac41 --- /dev/null +++ b/Tests/RunCMake/CMP0119/CMP0119-OLD-stderr.txt @@ -0,0 +1,10 @@ +^CMake Deprecation Warning at CMP0119-OLD\.cmake:[0-9]+ \(cmake_policy\): + The OLD behavior for policy CMP0119 will be removed from a future version + of CMake\. + + The cmake-policies\(7\) manual explains that the OLD behaviors of all + policies are deprecated and that a policy should be set to OLD only under + specific short-term circumstances\. Projects should be ported to the NEW + behavior and not rely on setting a policy to OLD\. +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/CMP0152/CMP0152-Common.cmake b/Tests/RunCMake/CMP0152/CMP0152-Common.cmake new file mode 100644 index 0000000..6429cca --- /dev/null +++ b/Tests/RunCMake/CMP0152/CMP0152-Common.cmake @@ -0,0 +1,5 @@ +file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/dir/") +file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/dir/nested/") +file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/dir/nested/bin/") +file(CREATE_LINK "${CMAKE_CURRENT_BINARY_DIR}/dir/nested/bin" "${CMAKE_CURRENT_BINARY_DIR}/dir/bin" SYMBOLIC) +file(REAL_PATH "${CMAKE_CURRENT_BINARY_DIR}/dir/bin/../" real_path) diff --git a/Tests/RunCMake/CommandLine/DeprecateVS11-WARN-ON.cmake b/Tests/RunCMake/CMP0152/CMP0152-NEW-stdout.txt index e69de29..e69de29 100644 --- a/Tests/RunCMake/CommandLine/DeprecateVS11-WARN-ON.cmake +++ b/Tests/RunCMake/CMP0152/CMP0152-NEW-stdout.txt diff --git a/Tests/RunCMake/CMP0152/CMP0152-NEW.cmake b/Tests/RunCMake/CMP0152/CMP0152-NEW.cmake new file mode 100644 index 0000000..86a3b55 --- /dev/null +++ b/Tests/RunCMake/CMP0152/CMP0152-NEW.cmake @@ -0,0 +1,2 @@ +cmake_policy(SET CMP0152 NEW) +include(CMP0152-Common.cmake) diff --git a/Tests/RunCMake/CommandLine/DeprecateVS11-WARN-OFF.cmake b/Tests/RunCMake/CMP0152/CMP0152-OLD-stderr.txt index e69de29..e69de29 100644 --- a/Tests/RunCMake/CommandLine/DeprecateVS11-WARN-OFF.cmake +++ b/Tests/RunCMake/CMP0152/CMP0152-OLD-stderr.txt diff --git a/Tests/RunCMake/CMP0152/CMP0152-OLD.cmake b/Tests/RunCMake/CMP0152/CMP0152-OLD.cmake new file mode 100644 index 0000000..62ac300 --- /dev/null +++ b/Tests/RunCMake/CMP0152/CMP0152-OLD.cmake @@ -0,0 +1,2 @@ +cmake_policy(SET CMP0152 OLD) +include(CMP0152-Common.cmake) diff --git a/Tests/RunCMake/CMP0152/CMP0152-WARN-stderr.txt b/Tests/RunCMake/CMP0152/CMP0152-WARN-stderr.txt new file mode 100644 index 0000000..8d63168 --- /dev/null +++ b/Tests/RunCMake/CMP0152/CMP0152-WARN-stderr.txt @@ -0,0 +1,27 @@ +^CMake Warning \(dev\) at CMP0152-Common\.cmake:[0-9]+ \(file\): + Policy CMP0152 is not set: file\(REAL_PATH\) resolves symlinks before + collapsing \.\./ components\. Run "cmake --help-policy CMP0152" for policy + details\. Use the cmake_policy command to set the policy and suppress this + warning\. + + From input path: + + [^ +]*/Tests/RunCMake/CMP0152/CMP0152-WARN-build/dir/bin/\.\./ + + the policy OLD behavior produces path: + + [^ +]*/Tests/RunCMake/CMP0152/CMP0152-WARN-build/dir + + but the policy NEW behavior produces path: + + [^ +]*/Tests/RunCMake/CMP0152/CMP0152-WARN-build/dir/nested + + Since the policy is not set, CMake is using the OLD behavior for + compatibility. +Call Stack \(most recent call first\): + CMP0152-WARN\.cmake:[0-9]+ \(include\) + CMakeLists.txt:[0-9]+ \(include\) +This warning is for project developers\. Use -Wno-dev to suppress it\.$ diff --git a/Tests/RunCMake/CMP0152/CMP0152-WARN.cmake b/Tests/RunCMake/CMP0152/CMP0152-WARN.cmake new file mode 100644 index 0000000..e85589e --- /dev/null +++ b/Tests/RunCMake/CMP0152/CMP0152-WARN.cmake @@ -0,0 +1,2 @@ + +include(CMP0152-Common.cmake) diff --git a/Tests/RunCMake/CMP0152/CMakeLists.txt b/Tests/RunCMake/CMP0152/CMakeLists.txt new file mode 100644 index 0000000..5ff8d3e --- /dev/null +++ b/Tests/RunCMake/CMP0152/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 3.23) +project(${RunCMake_TEST} NONE) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/CMP0152/RunCMakeTest.cmake b/Tests/RunCMake/CMP0152/RunCMakeTest.cmake new file mode 100644 index 0000000..7a9bab3 --- /dev/null +++ b/Tests/RunCMake/CMP0152/RunCMakeTest.cmake @@ -0,0 +1,7 @@ +include(RunCMake) + +if(NOT CMAKE_GENERATOR_NO_COMPILER_ENV) + run_cmake(CMP0152-WARN) + run_cmake(CMP0152-OLD) + run_cmake(CMP0152-NEW) +endif() diff --git a/Tests/RunCMake/CMP0153/CMP0153-NEW-result.txt b/Tests/RunCMake/CMP0153/CMP0153-NEW-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMP0153/CMP0153-NEW-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMP0153/CMP0153-NEW-stderr.txt b/Tests/RunCMake/CMP0153/CMP0153-NEW-stderr.txt new file mode 100644 index 0000000..e24eee7 --- /dev/null +++ b/Tests/RunCMake/CMP0153/CMP0153-NEW-stderr.txt @@ -0,0 +1,3 @@ +^CMake Error at [^ +]*/Tests/RunCMake/CMP0153/CMP0153-NEW\.cmake:[0-9]+ \(exec_program\): + The exec_program command should not be called; see CMP0153\.$ diff --git a/Tests/RunCMake/CMP0153/CMP0153-NEW-stdout.txt b/Tests/RunCMake/CMP0153/CMP0153-NEW-stdout.txt new file mode 100644 index 0000000..10f3293 --- /dev/null +++ b/Tests/RunCMake/CMP0153/CMP0153-NEW-stdout.txt @@ -0,0 +1 @@ +^$ diff --git a/Tests/RunCMake/CMP0153/CMP0153-NEW.cmake b/Tests/RunCMake/CMP0153/CMP0153-NEW.cmake new file mode 100644 index 0000000..d252b46 --- /dev/null +++ b/Tests/RunCMake/CMP0153/CMP0153-NEW.cmake @@ -0,0 +1,2 @@ +cmake_policy(SET CMP0153 NEW) +exec_program("${CMAKE_COMMAND}" ARGS "-E echo \"exec_program() called\"") diff --git a/Tests/RunCMake/CMP0153/CMP0153-OLD-stdout.txt b/Tests/RunCMake/CMP0153/CMP0153-OLD-stdout.txt new file mode 100644 index 0000000..1aa5183 --- /dev/null +++ b/Tests/RunCMake/CMP0153/CMP0153-OLD-stdout.txt @@ -0,0 +1 @@ +exec_program\(\) called diff --git a/Tests/RunCMake/CMP0153/CMP0153-OLD.cmake b/Tests/RunCMake/CMP0153/CMP0153-OLD.cmake new file mode 100644 index 0000000..d3c47a7 --- /dev/null +++ b/Tests/RunCMake/CMP0153/CMP0153-OLD.cmake @@ -0,0 +1,2 @@ +cmake_policy(SET CMP0153 OLD) +exec_program("${CMAKE_COMMAND}" ARGS "-E echo \"exec_program() called\"") diff --git a/Tests/RunCMake/CMP0153/CMP0153-WARN-stderr.txt b/Tests/RunCMake/CMP0153/CMP0153-WARN-stderr.txt new file mode 100644 index 0000000..8f22d4e --- /dev/null +++ b/Tests/RunCMake/CMP0153/CMP0153-WARN-stderr.txt @@ -0,0 +1,6 @@ +^CMake Warning \(dev\) at [^ +]*/Tests/RunCMake/CMP0153/CMP0153-WARN\.cmake:[0-9]+ \(exec_program\): + Policy CMP0153 is not set: The exec_program command should not be called\. + Run "cmake --help-policy CMP0153" for policy details\. Use the cmake_policy + command to set the policy and suppress this warning\. +This warning is for project developers\. Use -Wno-dev to suppress it\.$ diff --git a/Tests/RunCMake/CMP0153/CMP0153-WARN-stdout.txt b/Tests/RunCMake/CMP0153/CMP0153-WARN-stdout.txt new file mode 100644 index 0000000..1aa5183 --- /dev/null +++ b/Tests/RunCMake/CMP0153/CMP0153-WARN-stdout.txt @@ -0,0 +1 @@ +exec_program\(\) called diff --git a/Tests/RunCMake/CMP0153/CMP0153-WARN.cmake b/Tests/RunCMake/CMP0153/CMP0153-WARN.cmake new file mode 100644 index 0000000..ba81501 --- /dev/null +++ b/Tests/RunCMake/CMP0153/CMP0153-WARN.cmake @@ -0,0 +1 @@ +exec_program("${CMAKE_COMMAND}" ARGS "-E echo \"exec_program() called\"") diff --git a/Tests/RunCMake/CMP0153/CMakeLists.txt b/Tests/RunCMake/CMP0153/CMakeLists.txt new file mode 100644 index 0000000..922aad6 --- /dev/null +++ b/Tests/RunCMake/CMP0153/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 3.27) +project(${RunCMake_TEST} NONE) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/CMP0153/RunCMakeTest.cmake b/Tests/RunCMake/CMP0153/RunCMakeTest.cmake new file mode 100644 index 0000000..3d01dbf --- /dev/null +++ b/Tests/RunCMake/CMP0153/RunCMakeTest.cmake @@ -0,0 +1,9 @@ +include(RunCMake) + +function(run_cmp0153 name) + run_cmake_command(${name} ${CMAKE_COMMAND} -P "${RunCMake_SOURCE_DIR}/${name}.cmake") +endfunction() + +run_cmp0153(CMP0153-WARN) +run_cmp0153(CMP0153-OLD) +run_cmp0153(CMP0153-NEW) diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 63b7568..f8b84b2 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -165,14 +165,21 @@ if(GIT_EXECUTABLE) add_RunCMake_test(CMP0150) endif() +if(NOT WIN32 OR CYGWIN) + add_RunCMake_test(CMP0152) +endif() + +add_RunCMake_test(CMP0153) + # The test for Policy 65 requires the use of the # CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS variable, which both the VS and Xcode # generators ignore. The policy will have no effect on those generators. if(NOT CMAKE_GENERATOR MATCHES "Visual Studio|Xcode") add_RunCMake_test(CMP0065 -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}) endif() +add_executable(detect_jobserver detect_jobserver.c) if(CMAKE_GENERATOR MATCHES "Make") - add_RunCMake_test(Make -DMAKE_IS_GNU=${MAKE_IS_GNU}) + add_RunCMake_test(Make -DMAKE_IS_GNU=${MAKE_IS_GNU} -DDETECT_JOBSERVER=$<TARGET_FILE:detect_jobserver>) endif() unset(ninja_test_with_qt_version) unset(ninja_qt_args) @@ -363,7 +370,8 @@ if(CMake_TEST_FindOpenSSL) endif() if(CMake_TEST_UseSWIG) add_RunCMake_test(FindSWIG) - add_RunCMake_test(UseSWIG -DCMake_TEST_FindPython=${CMake_TEST_FindPython}) + add_RunCMake_test(UseSWIG -DCMake_TEST_FindPython2=${CMake_TEST_FindPython2} + -DCMake_TEST_FindPython3=${CMake_TEST_FindPython3}) endif() if(NOT CMAKE_C_COMPILER_ID MATCHES "Watcom") add_RunCMake_test(GenerateExportHeader) @@ -528,6 +536,7 @@ add_RunCMake_test(option) add_RunCMake_test(PrintHelpers) add_RunCMake_test(project -DCMake_TEST_RESOURCES=${CMake_TEST_RESOURCES}) add_RunCMake_test(project_injected) +add_RunCMake_test(property_init) add_RunCMake_test(DependencyProviders) add_RunCMake_test(return) add_RunCMake_test(separate_arguments) @@ -695,6 +704,23 @@ endif() if(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 6.0) add_RunCMake_test(Framework) + if(NOT DEFINED CMake_TEST_XcFramework) + set(CMake_TEST_XcFramework ON) + endif() + if(CMake_TEST_XcFramework AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 11.0) + set(XcFramework_ARGS -DCMAKE_C_COMPILER_VERSION=${CMAKE_C_COMPILER_VERSION}) + add_RunCMake_test(XcFramework) + + # This test can take a very long time due to lots of combinations. + # Use a long default timeout and provide an option to customize it. + if(NOT DEFINED CMake_TEST_XcFramework_TIMEOUT) + set(CMake_TEST_XcFramework_TIMEOUT 3000) + endif() + set_tests_properties(RunCMake.XcFramework PROPERTIES + TIMEOUT "${CMake_TEST_XcFramework_TIMEOUT}" + RUN_SERIAL TRUE + ) + endif() endif() add_RunCMake_test(File_Archive) diff --git a/Tests/RunCMake/CXXModules/CMakeLists.txt b/Tests/RunCMake/CXXModules/CMakeLists.txt index 88eb282..640d67b 100644 --- a/Tests/RunCMake/CXXModules/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.23) project(${RunCMake_TEST} NONE) -set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "aa1f7df0-828a-4fcd-9afc-2dc80491aca7") +set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "bf70d4b0-9fb7-465c-9803-34014e70d112") include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/CXXModules/examples/cxx-modules-rules.cmake b/Tests/RunCMake/CXXModules/examples/cxx-modules-rules.cmake index ff7219a..c17b5a4 100644 --- a/Tests/RunCMake/CXXModules/examples/cxx-modules-rules.cmake +++ b/Tests/RunCMake/CXXModules/examples/cxx-modules-rules.cmake @@ -1,4 +1,4 @@ -set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "aa1f7df0-828a-4fcd-9afc-2dc80491aca7") +set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "bf70d4b0-9fb7-465c-9803-34014e70d112") if (NOT EXISTS "${CMake_TEST_MODULE_COMPILATION_RULES}") message(FATAL_ERROR diff --git a/Tests/RunCMake/CXXModules/examples/deep-chain-stderr.txt b/Tests/RunCMake/CXXModules/examples/deep-chain-stderr.txt index 78bdf2b..659414d 100644 --- a/Tests/RunCMake/CXXModules/examples/deep-chain-stderr.txt +++ b/Tests/RunCMake/CXXModules/examples/deep-chain-stderr.txt @@ -1,4 +1,4 @@ -CMake Warning \(dev\) at CMakeLists.txt:7 \(target_sources\): +CMake Warning \(dev\) at CMakeLists.txt:15 \(target_sources\): CMake's C\+\+ module support is experimental. It is meant only for experimentation and feedback to CMake developers. This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/examples/deep-chain/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/deep-chain/CMakeLists.txt index 515b240..78a1d0b 100644 --- a/Tests/RunCMake/CXXModules/examples/deep-chain/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/deep-chain/CMakeLists.txt @@ -3,6 +3,14 @@ project(cxx_modules_deep_chain CXX) include("${CMAKE_SOURCE_DIR}/../cxx-modules-rules.cmake") +if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + include(CheckCompilerFlag) + check_compiler_flag(CXX "-Wread-modules-implicitly" have_implicit_module_warning) + if (have_implicit_module_warning) + add_compile_options(-Werror=read-modules-implicitly) + endif () +endif () + add_library(a STATIC) target_sources(a PUBLIC diff --git a/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-build/test/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-build/test/CMakeLists.txt index d227e55..a3e55f6 100644 --- a/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-build/test/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-build/test/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.24) project(cxx_modules_library NONE) -set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "aa1f7df0-828a-4fcd-9afc-2dc80491aca7") +set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "bf70d4b0-9fb7-465c-9803-34014e70d112") find_package(export_bmi_and_interfaces REQUIRED) diff --git a/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-install/test/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-install/test/CMakeLists.txt index d46d28b..0144b70 100644 --- a/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-install/test/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-install/test/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.24) project(cxx_modules_library NONE) -set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "aa1f7df0-828a-4fcd-9afc-2dc80491aca7") +set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "bf70d4b0-9fb7-465c-9803-34014e70d112") find_package(export_bmi_and_interfaces REQUIRED) diff --git a/Tests/RunCMake/CXXModules/examples/export-interface-build/test/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/export-interface-build/test/CMakeLists.txt index 3cd156a..bd2f2d4 100644 --- a/Tests/RunCMake/CXXModules/examples/export-interface-build/test/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/export-interface-build/test/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.24) project(cxx_modules_library NONE) -set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "aa1f7df0-828a-4fcd-9afc-2dc80491aca7") +set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "bf70d4b0-9fb7-465c-9803-34014e70d112") find_package(export_interfaces REQUIRED) diff --git a/Tests/RunCMake/CXXModules/examples/export-interface-install/test/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/export-interface-install/test/CMakeLists.txt index 71bf86c..87451fe 100644 --- a/Tests/RunCMake/CXXModules/examples/export-interface-install/test/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/export-interface-install/test/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.24) project(cxx_modules_library NONE) -set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "aa1f7df0-828a-4fcd-9afc-2dc80491aca7") +set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "bf70d4b0-9fb7-465c-9803-34014e70d112") find_package(export_interfaces REQUIRED) diff --git a/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-build/test/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-build/test/CMakeLists.txt index 0c094ac..5b6abc6 100644 --- a/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-build/test/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-build/test/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.24) project(cxx_modules_library NONE) -set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "aa1f7df0-828a-4fcd-9afc-2dc80491aca7") +set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "bf70d4b0-9fb7-465c-9803-34014e70d112") find_package(export_interfaces_no_properties REQUIRED) diff --git a/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-install/test/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-install/test/CMakeLists.txt index 0c094ac..5b6abc6 100644 --- a/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-install/test/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-install/test/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.24) project(cxx_modules_library NONE) -set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "aa1f7df0-828a-4fcd-9afc-2dc80491aca7") +set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "bf70d4b0-9fb7-465c-9803-34014e70d112") find_package(export_interfaces_no_properties REQUIRED) diff --git a/Tests/RunCMake/CommandLine/DeprecateVS11-WARN-ON-stderr.txt b/Tests/RunCMake/CommandLine/DeprecateVS11-WARN-ON-stderr.txt deleted file mode 100644 index 9080942..0000000 --- a/Tests/RunCMake/CommandLine/DeprecateVS11-WARN-ON-stderr.txt +++ /dev/null @@ -1,5 +0,0 @@ -^CMake Warning: - The "Visual Studio 11 2012" generator is deprecated and will be removed in - a future version of CMake. - - Add CMAKE_WARN_VS11=OFF to the cache to disable this warning.$ diff --git a/Tests/RunCMake/CommandLine/DeprecateVS12-WARN-OFF.cmake b/Tests/RunCMake/CommandLine/DeprecateVS12-WARN-OFF.cmake new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/CommandLine/DeprecateVS12-WARN-OFF.cmake diff --git a/Tests/RunCMake/CommandLine/DeprecateVS12-WARN-ON-stderr.txt b/Tests/RunCMake/CommandLine/DeprecateVS12-WARN-ON-stderr.txt new file mode 100644 index 0000000..b69408e --- /dev/null +++ b/Tests/RunCMake/CommandLine/DeprecateVS12-WARN-ON-stderr.txt @@ -0,0 +1,5 @@ +^CMake Warning: + The "Visual Studio 12 2013" generator is deprecated and will be removed in + a future version of CMake. + + Add CMAKE_WARN_VS12=OFF to the cache to disable this warning.$ diff --git a/Tests/RunCMake/CommandLine/DeprecateVS12-WARN-ON.cmake b/Tests/RunCMake/CommandLine/DeprecateVS12-WARN-ON.cmake new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/CommandLine/DeprecateVS12-WARN-ON.cmake diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake index 45b4c0e..611dde2 100644 --- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake +++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake @@ -1119,9 +1119,9 @@ if(RunCMake_GENERATOR MATCHES "^Visual Studio 9 2008") run_cmake_with_options(DeprecateVS9-WARN-OFF -DCMAKE_WARN_VS9=OFF) endif() -if(RunCMake_GENERATOR MATCHES "^Visual Studio 11 2012") - run_cmake_with_options(DeprecateVS11-WARN-ON -DCMAKE_WARN_VS11=ON) - unset(ENV{CMAKE_WARN_VS11}) - run_cmake(DeprecateVS11-WARN-ON) - run_cmake_with_options(DeprecateVS11-WARN-OFF -DCMAKE_WARN_VS11=OFF) +if(RunCMake_GENERATOR MATCHES "^Visual Studio 12 2013") + run_cmake_with_options(DeprecateVS12-WARN-ON -DCMAKE_WARN_VS12=ON) + unset(ENV{CMAKE_WARN_VS12}) + run_cmake(DeprecateVS12-WARN-ON) + run_cmake_with_options(DeprecateVS12-WARN-OFF -DCMAKE_WARN_VS12=OFF) endif() diff --git a/Tests/RunCMake/CrosscompilingEmulator/EnvCrossCompilingEmulator-stdout.txt b/Tests/RunCMake/CrosscompilingEmulator/EnvCrossCompilingEmulator-stdout.txt new file mode 100644 index 0000000..9a7d746 --- /dev/null +++ b/Tests/RunCMake/CrosscompilingEmulator/EnvCrossCompilingEmulator-stdout.txt @@ -0,0 +1,2 @@ +-- env_emulator='pseudo_emulator(\.exe)?' +-- emulator='pseudo_emulator(\.exe)?' diff --git a/Tests/RunCMake/CrosscompilingEmulator/EnvCrossCompilingEmulator.cmake b/Tests/RunCMake/CrosscompilingEmulator/EnvCrossCompilingEmulator.cmake new file mode 100644 index 0000000..55fc483 --- /dev/null +++ b/Tests/RunCMake/CrosscompilingEmulator/EnvCrossCompilingEmulator.cmake @@ -0,0 +1,6 @@ +message(STATUS "ENV{CMAKE_CROSS_COMPILING_EMULATOR}='$ENV{CMAKE_CROSSCOMPILING_EMULATOR}'") +message(STATUS "CMAKE_CROSSCOMPLING_EMULATOR='${CMAKE_CROSSCOMPILING_EMULATOR}'") +get_filename_component(env_emulator "$ENV{CMAKE_CROSSCOMPILING_EMULATOR}" NAME) +message(STATUS "env_emulator='${env_emulator}'") +get_filename_component(emulator "${CMAKE_CROSSCOMPILING_EMULATOR}" NAME) +message(STATUS "emulator='${emulator}'") diff --git a/Tests/RunCMake/CrosscompilingEmulator/RunCMakeTest.cmake b/Tests/RunCMake/CrosscompilingEmulator/RunCMakeTest.cmake index 97b7b5a..1ffd91c 100644 --- a/Tests/RunCMake/CrosscompilingEmulator/RunCMakeTest.cmake +++ b/Tests/RunCMake/CrosscompilingEmulator/RunCMakeTest.cmake @@ -26,3 +26,11 @@ set(RunCMake_TEST_OPTIONS "-DCMAKE_CROSSCOMPILING_EMULATOR=${PSEUDO_EMULATOR_CUSTOM_COMMAND_ARG}\;custom_argument") CustomCommandGenerator_run_and_build(AddCustomCommandWithArg) CustomCommandGenerator_run_and_build(AddCustomTargetWithArg) +unset(RunCMake_TEST_OPTIONS) + +function(run_EnvCrossCompilingEmulator) + set(ENV{CMAKE_CROSSCOMPILING_EMULATOR} "${PSEUDO_EMULATOR}") + run_cmake(EnvCrossCompilingEmulator) + unset(ENV{CMAKE_CROSSCOMPILING_EMULATOR}) +endfunction() +run_EnvCrossCompilingEmulator() diff --git a/Tests/RunCMake/Framework/FrameworkConsumption.cmake b/Tests/RunCMake/Framework/FrameworkConsumption.cmake index 2180cf9..f831a94 100644 --- a/Tests/RunCMake/Framework/FrameworkConsumption.cmake +++ b/Tests/RunCMake/Framework/FrameworkConsumption.cmake @@ -1,5 +1,7 @@ enable_language(C) +set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install") + # Create framework and ensure header is placed in Headers set(input_header "${CMAKE_SOURCE_DIR}/Gui.h") add_library(Gui SHARED Gui.c "${input_header}") @@ -8,6 +10,8 @@ set_target_properties(Gui PROPERTIES FRAMEWORK TRUE ) +install(TARGETS Gui DESTINATION .) + add_executable(app main.c) target_link_libraries(app PRIVATE Gui) diff --git a/Tests/RunCMake/Framework/ImportedFrameworkConsumption.cmake b/Tests/RunCMake/Framework/ImportedFrameworkConsumption.cmake new file mode 100644 index 0000000..c44a1bb --- /dev/null +++ b/Tests/RunCMake/Framework/ImportedFrameworkConsumption.cmake @@ -0,0 +1,7 @@ +enable_language(C) + +add_library(Gui IMPORTED UNKNOWN) +set_property(TARGET Gui PROPERTY IMPORTED_LOCATION "${CMAKE_BINARY_DIR}/../FrameworkConsumption-build/install/Gui.framework") + +add_executable(app main.c) +target_link_libraries(app PRIVATE Gui) diff --git a/Tests/RunCMake/Framework/RunCMakeTest.cmake b/Tests/RunCMake/Framework/RunCMakeTest.cmake index a767130..7319a59 100644 --- a/Tests/RunCMake/Framework/RunCMakeTest.cmake +++ b/Tests/RunCMake/Framework/RunCMakeTest.cmake @@ -113,7 +113,16 @@ function(framework_consumption) file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}") file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}") run_cmake(FrameworkConsumption) - run_cmake_command(FrameworkConsumption-build ${CMAKE_COMMAND} --build .) + run_cmake_command(FrameworkConsumption-build ${CMAKE_COMMAND} --build . --config Release) + run_cmake_command(FrameworkConsumption-install ${CMAKE_COMMAND} --install . --config Release) + + set(RunCMake_TEST_BINARY_DIR "${RunCMake_BINARY_DIR}/ImportedFrameworkConsumption-build") + set(RunCMake_TEST_NO_CLEAN 1) + + file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}") + file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}") + run_cmake(ImportedFrameworkConsumption) + run_cmake_command(ImportedFrameworkConsumption-build ${CMAKE_COMMAND} --build . --config Release) endfunction() framework_consumption() diff --git a/Tests/RunCMake/MSVCRuntimeTypeInfo/CMP0117-OLD-stderr.txt b/Tests/RunCMake/MSVCRuntimeTypeInfo/CMP0117-OLD-stderr.txt new file mode 100644 index 0000000..4499d97 --- /dev/null +++ b/Tests/RunCMake/MSVCRuntimeTypeInfo/CMP0117-OLD-stderr.txt @@ -0,0 +1,10 @@ +^CMake Deprecation Warning at CMP0117-OLD\.cmake:[0-9]+ \(cmake_policy\): + The OLD behavior for policy CMP0117 will be removed from a future version + of CMake\. + + The cmake-policies\(7\) manual explains that the OLD behaviors of all + policies are deprecated and that a policy should be set to OLD only under + specific short-term circumstances\. Projects should be ported to the NEW + behavior and not rely on setting a policy to OLD\. +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/Make/DetectJobServer-absent-parallel-build-stderr.txt b/Tests/RunCMake/Make/DetectJobServer-absent-parallel-build-stderr.txt new file mode 100644 index 0000000..c63bde3 --- /dev/null +++ b/Tests/RunCMake/Make/DetectJobServer-absent-parallel-build-stderr.txt @@ -0,0 +1 @@ +^(Warning: (Borland's make|NMake|Watcom's WMake) does not support parallel builds\. Ignoring parallel build command line option\.)?$ diff --git a/Tests/RunCMake/Make/DetectJobServer-absent.cmake b/Tests/RunCMake/Make/DetectJobServer-absent.cmake new file mode 100644 index 0000000..e3dddc0 --- /dev/null +++ b/Tests/RunCMake/Make/DetectJobServer-absent.cmake @@ -0,0 +1,13 @@ +# Verifies that the jobserver connection is absent +add_custom_command(OUTPUT custom_command.txt + JOB_SERVER_AWARE OFF + COMMENT "Should not detect jobserver" + COMMAND ${DETECT_JOBSERVER} --absent "custom_command.txt" +) + +# trigger the custom command to run +add_custom_target(dummy ALL + JOB_SERVER_AWARE OFF + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/custom_command.txt + COMMAND ${DETECT_JOBSERVER} --absent "custom_target.txt" +) diff --git a/Tests/RunCMake/Make/DetectJobServer-present.cmake b/Tests/RunCMake/Make/DetectJobServer-present.cmake new file mode 100644 index 0000000..a33658f --- /dev/null +++ b/Tests/RunCMake/Make/DetectJobServer-present.cmake @@ -0,0 +1,13 @@ +# Verifies that the jobserver is present +add_custom_command(OUTPUT custom_command.txt + JOB_SERVER_AWARE ON + COMMENT "Should detect jobserver support" + COMMAND ${DETECT_JOBSERVER} --present "custom_command.txt" +) + +# trigger the custom command to run +add_custom_target(dummy ALL + JOB_SERVER_AWARE ON + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/custom_command.txt + COMMAND ${DETECT_JOBSERVER} --present "custom_target.txt" +) diff --git a/Tests/RunCMake/Make/Foo/CMakeLists.txt b/Tests/RunCMake/Make/Foo/CMakeLists.txt new file mode 100644 index 0000000..baa6634 --- /dev/null +++ b/Tests/RunCMake/Make/Foo/CMakeLists.txt @@ -0,0 +1,4 @@ +cmake_minimum_required(VERSION 3.26) +project(Foo NONE) + +add_custom_target(drive ALL COMMAND ${CMAKE_COMMAND} -E true) diff --git a/Tests/RunCMake/Make/GNUMakeJobServerAware-check.cmake b/Tests/RunCMake/Make/GNUMakeJobServerAware-check.cmake new file mode 100644 index 0000000..da18f00 --- /dev/null +++ b/Tests/RunCMake/Make/GNUMakeJobServerAware-check.cmake @@ -0,0 +1,26 @@ +set(BUILD_DIR "${RunCMake_BINARY_DIR}/GNUMakeJobServerAware-build") + +function(check target line) + # Read the file and split it into a list of lines + file(READ ${BUILD_DIR}/${target} contents) + STRING(REGEX REPLACE ";" "\\\\;" contents "${contents}") + STRING(REGEX REPLACE "\n" ";" contents "${contents}") + + set(found FALSE) + foreach(entry ${contents}) + if("${entry}" MATCHES "${line}") + set(found TRUE) + break() + endif() + endforeach() + + if(NOT found) + message(FATAL_ERROR "Could not find '${line}' in ${BUILD_DIR}/${target}\n${contents}") + endif() +endfunction() + +check("CMakeFiles/dummy.dir/build.make" [[\+\$\(CMAKE_COMMAND\) -E true]]) +check("CMakeFiles/dummy2.dir/build.make" [[\+\$\(CMAKE_COMMAND\) -E true]]) + +check("CMakeFiles/dummy3.dir/build.make" [[\+cd (/d )?"?.*"? && \$\(CMAKE_COMMAND\) -E true]]) +check("CMakeFiles/dummy4.dir/build.make" [[\+cd (/d )?"?.*"? && \$\(CMAKE_COMMAND\) -E true]]) diff --git a/Tests/RunCMake/Make/GNUMakeJobServerAware.cmake b/Tests/RunCMake/Make/GNUMakeJobServerAware.cmake new file mode 100644 index 0000000..d92e842 --- /dev/null +++ b/Tests/RunCMake/Make/GNUMakeJobServerAware.cmake @@ -0,0 +1,31 @@ +# Test JOB_SERVER_AWARE with custom commands +add_custom_command( + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/missing" + JOB_SERVER_AWARE ON + COMMAND $(CMAKE_COMMAND) -E true +) +add_custom_target(dummy ALL DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/missing") + +# Test JOB_SERVER_AWARE with custom targets +add_custom_target( + dummy2 ALL + JOB_SERVER_AWARE ON + COMMAND $(CMAKE_COMMAND) -E true +) + +# Test JOB_SERVER_AWARE with custom commands with WORKING_DIRECTORY +add_custom_command( + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/missing2" + JOB_SERVER_AWARE ON + COMMAND $(CMAKE_COMMAND) -E true + WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Foo" +) +add_custom_target(dummy3 ALL DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/missing2") + +# Test JOB_SERVER_AWARE with custom targets with WORKING_DIRECTORY +add_custom_target( + dummy4 ALL + JOB_SERVER_AWARE ON + COMMAND $(CMAKE_COMMAND) -E true + WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Foo" +) diff --git a/Tests/RunCMake/Make/RunCMakeTest.cmake b/Tests/RunCMake/Make/RunCMakeTest.cmake index c7717ec..12904c8 100644 --- a/Tests/RunCMake/Make/RunCMakeTest.cmake +++ b/Tests/RunCMake/Make/RunCMakeTest.cmake @@ -70,3 +70,43 @@ if(NOT RunCMake_GENERATOR STREQUAL "Watcom WMake") run_CMP0113(OLD) run_CMP0113(NEW) endif() + +function(detect_jobserver_present is_parallel) + set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/DetectJobServer-present-build) + set(RunCMake_TEST_NO_CLEAN 1) + set(RunCMake_TEST_OPTIONS "-DDETECT_JOBSERVER=${DETECT_JOBSERVER}") + run_cmake(DetectJobServer-present) + if (is_parallel) + run_cmake_command(DetectJobServer-present-parallel-build ${CMAKE_COMMAND} --build . -j4) + else() + run_cmake_command(DetectJobServer-present-build ${CMAKE_COMMAND} --build .) + endif() +endfunction() + +function(detect_jobserver_absent is_parallel) + set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/DetectJobServer-absent-build) + set(RunCMake_TEST_NO_CLEAN 1) + set(RunCMake_TEST_OPTIONS "-DDETECT_JOBSERVER=${DETECT_JOBSERVER}") + run_cmake(DetectJobServer-absent) + if (is_parallel) + run_cmake_command(DetectJobServer-absent-parallel-build ${CMAKE_COMMAND} --build . -j4) + else() + run_cmake_command(DetectJobServer-absent-build ${CMAKE_COMMAND} --build .) + endif() +endfunction() + +# Jobservers are currently only supported by GNU makes, except MSYS2 make +if(MAKE_IS_GNU AND NOT RunCMake_GENERATOR MATCHES "MSYS Makefiles") + detect_jobserver_present(ON) +else() + detect_jobserver_absent(ON) +endif() +# No matter which generator is used, the jobserver should not be present if a +# parallel build is not requested +detect_jobserver_absent(OFF) + +if(MAKE_IS_GNU) + # In GNU makes, `JOB_SERVER_AWARE` support is implemented by prefixing + # commands with the '+' operator. + run_cmake(GNUMakeJobServerAware) +endif() diff --git a/Tests/RunCMake/Ninja/QtAutoMocDeps-stderr.txt b/Tests/RunCMake/Ninja/QtAutoMocDeps-stderr.txt new file mode 100644 index 0000000..6024984 --- /dev/null +++ b/Tests/RunCMake/Ninja/QtAutoMocDeps-stderr.txt @@ -0,0 +1,8 @@ +^CMake Deprecation Warning at QtSubDir1/CMakeLists\.txt:[0-9]+ \(cmake_policy\): + The OLD behavior for policy CMP0116 will be removed from a future version + of CMake\. + + The cmake-policies\(7\) manual explains that the OLD behaviors of all + policies are deprecated and that a policy should be set to OLD only under + specific short-term circumstances\. Projects should be ported to the NEW + behavior and not rely on setting a policy to OLD\.$ diff --git a/Tests/RunCMake/UseSWIG/RunCMakeTest.cmake b/Tests/RunCMake/UseSWIG/RunCMakeTest.cmake index c7a118f..537f67d 100644 --- a/Tests/RunCMake/UseSWIG/RunCMakeTest.cmake +++ b/Tests/RunCMake/UseSWIG/RunCMakeTest.cmake @@ -6,7 +6,7 @@ run_cmake(CMP0078-NEW) run_cmake(CMP0086-WARN) -if (CMake_TEST_FindPython) +if (CMake_TEST_FindPython2 OR CMake_TEST_FindPython3) macro(run_cmake_target test subtest target) set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${test}-build) diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-OLD-Direct-stderr.txt b/Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-OLD-Direct-stderr.txt new file mode 100644 index 0000000..53f603e --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-OLD-Direct-stderr.txt @@ -0,0 +1,10 @@ +^CMake Deprecation Warning at CMP0120-OLD-Direct\.cmake:[0-9]+ \(cmake_policy\): + The OLD behavior for policy CMP0120 will be removed from a future version + of CMake\. + + The cmake-policies\(7\) manual explains that the OLD behaviors of all + policies are deprecated and that a policy should be set to OLD only under + specific short-term circumstances\. Projects should be ported to the NEW + behavior and not rely on setting a policy to OLD\. +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-OLD-stderr.txt b/Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-OLD-stderr.txt new file mode 100644 index 0000000..fea708f --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-OLD-stderr.txt @@ -0,0 +1,10 @@ +^CMake Deprecation Warning at CMP0120-OLD\.cmake:[0-9]+ \(cmake_policy\): + The OLD behavior for policy CMP0120 will be removed from a future version + of CMake\. + + The cmake-policies\(7\) manual explains that the OLD behaviors of all + policies are deprecated and that a policy should be set to OLD only under + specific short-term circumstances\. Projects should be ported to the NEW + behavior and not rely on setting a policy to OLD\. +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/XcFramework/CMakeLists.txt b/Tests/RunCMake/XcFramework/CMakeLists.txt new file mode 100644 index 0000000..54a4d62 --- /dev/null +++ b/Tests/RunCMake/XcFramework/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 3.26) +project(${RunCMake_TEST} NONE) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/XcFramework/RunCMakeTest.cmake b/Tests/RunCMake/XcFramework/RunCMakeTest.cmake new file mode 100644 index 0000000..95883bf --- /dev/null +++ b/Tests/RunCMake/XcFramework/RunCMakeTest.cmake @@ -0,0 +1,93 @@ +include(RunCMake) + +function(create_library type platform system_name archs) + set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/create-${type}-${platform}-build) + run_cmake_with_options(create-${type}-${platform} -DCMAKE_SYSTEM_NAME=${system_name} -DCMAKE_OSX_ARCHITECTURES=${archs} -DCMAKE_INSTALL_PREFIX=${RunCMake_TEST_BINARY_DIR}/install) + + set(RunCMake_TEST_NO_CLEAN 1) + run_cmake_command(create-${type}-${platform}-build ${CMAKE_COMMAND} --build . --config Release) + run_cmake_command(create-${type}-${platform}-install ${CMAKE_COMMAND} --install . --config Release) +endfunction() + +function(create_libraries type) + create_library(${type} macos Darwin "${macos_archs_2}") + create_library(${type} ios iOS "arm64") + create_library(${type} tvos tvOS "arm64") + create_library(${type} watchos watchOS "armv7k\\\\;arm64_32") + if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 15) + create_library(${type} visionos visionOS "arm64") + endif() +endfunction() + +function(create_xcframework name type platforms) + set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/create-xcframework-${name}-build) + set(args) + foreach(platform IN LISTS platforms) + if(type STREQUAL "framework") + list(APPEND args -framework ${RunCMake_BINARY_DIR}/create-${type}-${platform}-build/install/lib/mylib.framework) + else() + list(APPEND args -library ${RunCMake_BINARY_DIR}/create-${type}-${platform}-build/install/lib/libmylib.a -headers ${RunCMake_SOURCE_DIR}/mylib/include) + endif() + endforeach() + run_cmake_command(create-xcframework-${name} xcodebuild -create-xcframework ${args} -output ${RunCMake_TEST_BINARY_DIR}/mylib.xcframework) +endfunction() + +function(create_executable name xcfname system_name archs) + set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/create-executable-${name}-build) + run_cmake_with_options(create-executable-${name} -DCMAKE_SYSTEM_NAME=${system_name} -DCMAKE_OSX_ARCHITECTURES=${archs} -DMYLIB_LIBRARY=${RunCMake_BINARY_DIR}/create-xcframework-${xcfname}-build/mylib.xcframework) + + set(RunCMake_TEST_NO_CLEAN 1) + run_cmake_command(create-executable-${name}-build ${CMAKE_COMMAND} --build . --config Release) +endfunction() + +function(create_executables name type) + create_executable(${name}-macos ${type} Darwin "${macos_archs_2}") + create_executable(${name}-ios ${type} iOS "arm64") + create_executable(${name}-tvos ${type} tvOS "arm64") + create_executable(${name}-watchos ${type} watchOS "armv7k\\\\;arm64_32") + if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 15) + create_executable(${name}-visionos ${type} visionOS "arm64") + endif() +endfunction() + +set(xcframework_platforms macos ios tvos watchos) +if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 15) + list(APPEND xcframework_platforms visionos) +endif() +if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 12) + set(macos_archs_1 "x86_64\\;arm64") + set(macos_archs_2 "x86_64\\\\;arm64") +else() + set(macos_archs_1 "x86_64") + set(macos_archs_2 "x86_64") +endif() + +create_libraries(library) +create_libraries(framework) +create_xcframework(library library "${xcframework_platforms}") +create_xcframework(framework framework "${xcframework_platforms}") +create_xcframework(incomplete framework "tvos;watchos") +create_executables(library library) +create_executables(framework framework) +run_cmake_with_options(create-executable-incomplete -DCMAKE_SYSTEM_NAME=Darwin "-DCMAKE_OSX_ARCHITECTURES=${macos_archs_1}" -DMYLIB_LIBRARY=${RunCMake_BINARY_DIR}/create-xcframework-incomplete-build/mylib.xcframework) +create_executables(target-library library) +create_executables(target-framework framework) +run_cmake_with_options(create-executable-target-incomplete -DCMAKE_SYSTEM_NAME=Darwin "-DCMAKE_OSX_ARCHITECTURES=${macos_archs_1}" -DMYLIB_LIBRARY=${RunCMake_BINARY_DIR}/create-xcframework-incomplete-build/mylib.xcframework) +if(RunCMake_GENERATOR STREQUAL "Xcode" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 12) + create_executables(library-link-phase library) + create_executables(framework-link-phase framework) + run_cmake_with_options(create-executable-incomplete-link-phase -DCMAKE_SYSTEM_NAME=Darwin "-DCMAKE_OSX_ARCHITECTURES=${macos_archs_1}" -DMYLIB_LIBRARY=${RunCMake_BINARY_DIR}/create-xcframework-incomplete-build/mylib.xcframework) + create_executables(target-library-link-phase library) + create_executables(target-framework-link-phase framework) + run_cmake_with_options(create-executable-target-incomplete-link-phase -DCMAKE_SYSTEM_NAME=Darwin "-DCMAKE_OSX_ARCHITECTURES=${macos_archs_1}" -DMYLIB_LIBRARY=${RunCMake_BINARY_DIR}/create-xcframework-incomplete-build/mylib.xcframework) +endif() + +# Ensure that .xcframework is found before .framework +set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/create-xcframework-framework-build) +set(RunCMake_TEST_NO_CLEAN 1) +run_cmake_command(copy-framework ${CMAKE_COMMAND} -E copy_directory ${RunCMake_BINARY_DIR}/create-framework-macos-build/install/lib/mylib.framework ${RunCMake_TEST_BINARY_DIR}/mylib.framework) +unset(RunCMake_TEST_NO_CLEAN) +unset(RunCMake_TEST_BINARY_DIR) + +run_cmake(find-library) +run_cmake_command(find-library-script ${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR}/find-library.cmake) diff --git a/Tests/RunCMake/XcFramework/create-executable-framework-ios.cmake b/Tests/RunCMake/XcFramework/create-executable-framework-ios.cmake new file mode 100644 index 0000000..760d9d4 --- /dev/null +++ b/Tests/RunCMake/XcFramework/create-executable-framework-ios.cmake @@ -0,0 +1 @@ +include(create-executable.cmake) diff --git a/Tests/RunCMake/XcFramework/create-executable-framework-link-phase-ios.cmake b/Tests/RunCMake/XcFramework/create-executable-framework-link-phase-ios.cmake new file mode 100644 index 0000000..2888c85 --- /dev/null +++ b/Tests/RunCMake/XcFramework/create-executable-framework-link-phase-ios.cmake @@ -0,0 +1 @@ +include(create-executable-link-phase.cmake) diff --git a/Tests/RunCMake/XcFramework/create-executable-framework-link-phase-macos.cmake b/Tests/RunCMake/XcFramework/create-executable-framework-link-phase-macos.cmake new file mode 100644 index 0000000..2888c85 --- /dev/null +++ b/Tests/RunCMake/XcFramework/create-executable-framework-link-phase-macos.cmake @@ -0,0 +1 @@ +include(create-executable-link-phase.cmake) diff --git a/Tests/RunCMake/XcFramework/create-executable-framework-link-phase-tvos.cmake b/Tests/RunCMake/XcFramework/create-executable-framework-link-phase-tvos.cmake new file mode 100644 index 0000000..2888c85 --- /dev/null +++ b/Tests/RunCMake/XcFramework/create-executable-framework-link-phase-tvos.cmake @@ -0,0 +1 @@ +include(create-executable-link-phase.cmake) diff --git a/Tests/RunCMake/XcFramework/create-executable-framework-link-phase-visionos.cmake b/Tests/RunCMake/XcFramework/create-executable-framework-link-phase-visionos.cmake new file mode 100644 index 0000000..2888c85 --- /dev/null +++ b/Tests/RunCMake/XcFramework/create-executable-framework-link-phase-visionos.cmake @@ -0,0 +1 @@ +include(create-executable-link-phase.cmake) diff --git a/Tests/RunCMake/XcFramework/create-executable-framework-link-phase-watchos.cmake b/Tests/RunCMake/XcFramework/create-executable-framework-link-phase-watchos.cmake new file mode 100644 index 0000000..2888c85 --- /dev/null +++ b/Tests/RunCMake/XcFramework/create-executable-framework-link-phase-watchos.cmake @@ -0,0 +1 @@ +include(create-executable-link-phase.cmake) diff --git a/Tests/RunCMake/XcFramework/create-executable-framework-macos.cmake b/Tests/RunCMake/XcFramework/create-executable-framework-macos.cmake new file mode 100644 index 0000000..760d9d4 --- /dev/null +++ b/Tests/RunCMake/XcFramework/create-executable-framework-macos.cmake @@ -0,0 +1 @@ +include(create-executable.cmake) diff --git a/Tests/RunCMake/XcFramework/create-executable-framework-tvos.cmake b/Tests/RunCMake/XcFramework/create-executable-framework-tvos.cmake new file mode 100644 index 0000000..760d9d4 --- /dev/null +++ b/Tests/RunCMake/XcFramework/create-executable-framework-tvos.cmake @@ -0,0 +1 @@ +include(create-executable.cmake) diff --git a/Tests/RunCMake/XcFramework/create-executable-framework-visionos.cmake b/Tests/RunCMake/XcFramework/create-executable-framework-visionos.cmake new file mode 100644 index 0000000..760d9d4 --- /dev/null +++ b/Tests/RunCMake/XcFramework/create-executable-framework-visionos.cmake @@ -0,0 +1 @@ +include(create-executable.cmake) diff --git a/Tests/RunCMake/XcFramework/create-executable-framework-watchos.cmake b/Tests/RunCMake/XcFramework/create-executable-framework-watchos.cmake new file mode 100644 index 0000000..760d9d4 --- /dev/null +++ b/Tests/RunCMake/XcFramework/create-executable-framework-watchos.cmake @@ -0,0 +1 @@ +include(create-executable.cmake) diff --git a/Tests/RunCMake/XcFramework/create-executable-incomplete-link-phase-result.txt b/Tests/RunCMake/XcFramework/create-executable-incomplete-link-phase-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/XcFramework/create-executable-incomplete-link-phase-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/XcFramework/create-executable-incomplete-link-phase-stderr.txt b/Tests/RunCMake/XcFramework/create-executable-incomplete-link-phase-stderr.txt new file mode 100644 index 0000000..5b43e19 --- /dev/null +++ b/Tests/RunCMake/XcFramework/create-executable-incomplete-link-phase-stderr.txt @@ -0,0 +1,11 @@ +CMake Error at create-executable\.cmake:[0-9]+ \(target_link_libraries\): + Unable to find suitable library in: + + [^ +]*/Tests/RunCMake/XcFramework/create-xcframework-incomplete-build/mylib\.xcframework/Info\.plist + + for system name "Darwin" +Call Stack \(most recent call first\): + create-executable-link-phase\.cmake:[0-9]+ \(include\) + create-executable-incomplete-link-phase\.cmake:[0-9]+ \(include\) + CMakeLists\.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/XcFramework/create-executable-incomplete-link-phase.cmake b/Tests/RunCMake/XcFramework/create-executable-incomplete-link-phase.cmake new file mode 100644 index 0000000..2888c85 --- /dev/null +++ b/Tests/RunCMake/XcFramework/create-executable-incomplete-link-phase.cmake @@ -0,0 +1 @@ +include(create-executable-link-phase.cmake) diff --git a/Tests/RunCMake/XcFramework/create-executable-incomplete-result.txt b/Tests/RunCMake/XcFramework/create-executable-incomplete-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/XcFramework/create-executable-incomplete-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/XcFramework/create-executable-incomplete-stderr.txt b/Tests/RunCMake/XcFramework/create-executable-incomplete-stderr.txt new file mode 100644 index 0000000..66b7d62 --- /dev/null +++ b/Tests/RunCMake/XcFramework/create-executable-incomplete-stderr.txt @@ -0,0 +1,10 @@ +CMake Error at create-executable\.cmake:[0-9]+ \(target_link_libraries\): + Unable to find suitable library in: + + [^ +]*/Tests/RunCMake/XcFramework/create-xcframework-incomplete-build/mylib\.xcframework/Info\.plist + + for system name "Darwin" +Call Stack \(most recent call first\): + create-executable-incomplete\.cmake:[0-9]+ \(include\) + CMakeLists\.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/XcFramework/create-executable-incomplete.cmake b/Tests/RunCMake/XcFramework/create-executable-incomplete.cmake new file mode 100644 index 0000000..760d9d4 --- /dev/null +++ b/Tests/RunCMake/XcFramework/create-executable-incomplete.cmake @@ -0,0 +1 @@ +include(create-executable.cmake) diff --git a/Tests/RunCMake/XcFramework/create-executable-library-ios.cmake b/Tests/RunCMake/XcFramework/create-executable-library-ios.cmake new file mode 100644 index 0000000..760d9d4 --- /dev/null +++ b/Tests/RunCMake/XcFramework/create-executable-library-ios.cmake @@ -0,0 +1 @@ +include(create-executable.cmake) diff --git a/Tests/RunCMake/XcFramework/create-executable-library-link-phase-ios.cmake b/Tests/RunCMake/XcFramework/create-executable-library-link-phase-ios.cmake new file mode 100644 index 0000000..2888c85 --- /dev/null +++ b/Tests/RunCMake/XcFramework/create-executable-library-link-phase-ios.cmake @@ -0,0 +1 @@ +include(create-executable-link-phase.cmake) diff --git a/Tests/RunCMake/XcFramework/create-executable-library-link-phase-macos.cmake b/Tests/RunCMake/XcFramework/create-executable-library-link-phase-macos.cmake new file mode 100644 index 0000000..2888c85 --- /dev/null +++ b/Tests/RunCMake/XcFramework/create-executable-library-link-phase-macos.cmake @@ -0,0 +1 @@ +include(create-executable-link-phase.cmake) diff --git a/Tests/RunCMake/XcFramework/create-executable-library-link-phase-tvos.cmake b/Tests/RunCMake/XcFramework/create-executable-library-link-phase-tvos.cmake new file mode 100644 index 0000000..2888c85 --- /dev/null +++ b/Tests/RunCMake/XcFramework/create-executable-library-link-phase-tvos.cmake @@ -0,0 +1 @@ +include(create-executable-link-phase.cmake) diff --git a/Tests/RunCMake/XcFramework/create-executable-library-link-phase-visionos.cmake b/Tests/RunCMake/XcFramework/create-executable-library-link-phase-visionos.cmake new file mode 100644 index 0000000..2888c85 --- /dev/null +++ b/Tests/RunCMake/XcFramework/create-executable-library-link-phase-visionos.cmake @@ -0,0 +1 @@ +include(create-executable-link-phase.cmake) diff --git a/Tests/RunCMake/XcFramework/create-executable-library-link-phase-watchos.cmake b/Tests/RunCMake/XcFramework/create-executable-library-link-phase-watchos.cmake new file mode 100644 index 0000000..2888c85 --- /dev/null +++ b/Tests/RunCMake/XcFramework/create-executable-library-link-phase-watchos.cmake @@ -0,0 +1 @@ +include(create-executable-link-phase.cmake) diff --git a/Tests/RunCMake/XcFramework/create-executable-library-macos.cmake b/Tests/RunCMake/XcFramework/create-executable-library-macos.cmake new file mode 100644 index 0000000..760d9d4 --- /dev/null +++ b/Tests/RunCMake/XcFramework/create-executable-library-macos.cmake @@ -0,0 +1 @@ +include(create-executable.cmake) diff --git a/Tests/RunCMake/XcFramework/create-executable-library-tvos.cmake b/Tests/RunCMake/XcFramework/create-executable-library-tvos.cmake new file mode 100644 index 0000000..760d9d4 --- /dev/null +++ b/Tests/RunCMake/XcFramework/create-executable-library-tvos.cmake @@ -0,0 +1 @@ +include(create-executable.cmake) diff --git a/Tests/RunCMake/XcFramework/create-executable-library-visionos.cmake b/Tests/RunCMake/XcFramework/create-executable-library-visionos.cmake new file mode 100644 index 0000000..760d9d4 --- /dev/null +++ b/Tests/RunCMake/XcFramework/create-executable-library-visionos.cmake @@ -0,0 +1 @@ +include(create-executable.cmake) diff --git a/Tests/RunCMake/XcFramework/create-executable-library-watchos.cmake b/Tests/RunCMake/XcFramework/create-executable-library-watchos.cmake new file mode 100644 index 0000000..760d9d4 --- /dev/null +++ b/Tests/RunCMake/XcFramework/create-executable-library-watchos.cmake @@ -0,0 +1 @@ +include(create-executable.cmake) diff --git a/Tests/RunCMake/XcFramework/create-executable-link-phase.cmake b/Tests/RunCMake/XcFramework/create-executable-link-phase.cmake new file mode 100644 index 0000000..9884781 --- /dev/null +++ b/Tests/RunCMake/XcFramework/create-executable-link-phase.cmake @@ -0,0 +1,2 @@ +include(create-executable.cmake) +set_property(TARGET myexe PROPERTY XCODE_LINK_BUILD_PHASE_MODE "KNOWN_LOCATION") diff --git a/Tests/RunCMake/XcFramework/create-executable-target-framework-ios.cmake b/Tests/RunCMake/XcFramework/create-executable-target-framework-ios.cmake new file mode 100644 index 0000000..b2e3469 --- /dev/null +++ b/Tests/RunCMake/XcFramework/create-executable-target-framework-ios.cmake @@ -0,0 +1 @@ +include(create-executable-target.cmake) diff --git a/Tests/RunCMake/XcFramework/create-executable-target-framework-link-phase-ios.cmake b/Tests/RunCMake/XcFramework/create-executable-target-framework-link-phase-ios.cmake new file mode 100644 index 0000000..dfeccb9 --- /dev/null +++ b/Tests/RunCMake/XcFramework/create-executable-target-framework-link-phase-ios.cmake @@ -0,0 +1 @@ +include(create-executable-target-link-phase.cmake) diff --git a/Tests/RunCMake/XcFramework/create-executable-target-framework-link-phase-macos.cmake b/Tests/RunCMake/XcFramework/create-executable-target-framework-link-phase-macos.cmake new file mode 100644 index 0000000..dfeccb9 --- /dev/null +++ b/Tests/RunCMake/XcFramework/create-executable-target-framework-link-phase-macos.cmake @@ -0,0 +1 @@ +include(create-executable-target-link-phase.cmake) diff --git a/Tests/RunCMake/XcFramework/create-executable-target-framework-link-phase-tvos.cmake b/Tests/RunCMake/XcFramework/create-executable-target-framework-link-phase-tvos.cmake new file mode 100644 index 0000000..dfeccb9 --- /dev/null +++ b/Tests/RunCMake/XcFramework/create-executable-target-framework-link-phase-tvos.cmake @@ -0,0 +1 @@ +include(create-executable-target-link-phase.cmake) diff --git a/Tests/RunCMake/XcFramework/create-executable-target-framework-link-phase-visionos.cmake b/Tests/RunCMake/XcFramework/create-executable-target-framework-link-phase-visionos.cmake new file mode 100644 index 0000000..dfeccb9 --- /dev/null +++ b/Tests/RunCMake/XcFramework/create-executable-target-framework-link-phase-visionos.cmake @@ -0,0 +1 @@ +include(create-executable-target-link-phase.cmake) diff --git a/Tests/RunCMake/XcFramework/create-executable-target-framework-link-phase-watchos.cmake b/Tests/RunCMake/XcFramework/create-executable-target-framework-link-phase-watchos.cmake new file mode 100644 index 0000000..dfeccb9 --- /dev/null +++ b/Tests/RunCMake/XcFramework/create-executable-target-framework-link-phase-watchos.cmake @@ -0,0 +1 @@ +include(create-executable-target-link-phase.cmake) diff --git a/Tests/RunCMake/XcFramework/create-executable-target-framework-macos.cmake b/Tests/RunCMake/XcFramework/create-executable-target-framework-macos.cmake new file mode 100644 index 0000000..b2e3469 --- /dev/null +++ b/Tests/RunCMake/XcFramework/create-executable-target-framework-macos.cmake @@ -0,0 +1 @@ +include(create-executable-target.cmake) diff --git a/Tests/RunCMake/XcFramework/create-executable-target-framework-tvos.cmake b/Tests/RunCMake/XcFramework/create-executable-target-framework-tvos.cmake new file mode 100644 index 0000000..b2e3469 --- /dev/null +++ b/Tests/RunCMake/XcFramework/create-executable-target-framework-tvos.cmake @@ -0,0 +1 @@ +include(create-executable-target.cmake) diff --git a/Tests/RunCMake/XcFramework/create-executable-target-framework-visionos.cmake b/Tests/RunCMake/XcFramework/create-executable-target-framework-visionos.cmake new file mode 100644 index 0000000..b2e3469 --- /dev/null +++ b/Tests/RunCMake/XcFramework/create-executable-target-framework-visionos.cmake @@ -0,0 +1 @@ +include(create-executable-target.cmake) diff --git a/Tests/RunCMake/XcFramework/create-executable-target-framework-watchos.cmake b/Tests/RunCMake/XcFramework/create-executable-target-framework-watchos.cmake new file mode 100644 index 0000000..b2e3469 --- /dev/null +++ b/Tests/RunCMake/XcFramework/create-executable-target-framework-watchos.cmake @@ -0,0 +1 @@ +include(create-executable-target.cmake) diff --git a/Tests/RunCMake/XcFramework/create-executable-target-incomplete-link-phase-result.txt b/Tests/RunCMake/XcFramework/create-executable-target-incomplete-link-phase-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/XcFramework/create-executable-target-incomplete-link-phase-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/XcFramework/create-executable-target-incomplete-link-phase-stderr.txt b/Tests/RunCMake/XcFramework/create-executable-target-incomplete-link-phase-stderr.txt new file mode 100644 index 0000000..1308933 --- /dev/null +++ b/Tests/RunCMake/XcFramework/create-executable-target-incomplete-link-phase-stderr.txt @@ -0,0 +1,11 @@ +CMake Error at create-executable-target\.cmake:[0-9]+ \(target_link_libraries\): + Unable to find suitable library in: + + [^ +]*/Tests/RunCMake/XcFramework/create-xcframework-incomplete-build/mylib\.xcframework/Info\.plist + + for system name "Darwin" +Call Stack \(most recent call first\): + create-executable-target-link-phase\.cmake:[0-9]+ \(include\) + create-executable-target-incomplete-link-phase\.cmake:[0-9]+ \(include\) + CMakeLists\.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/XcFramework/create-executable-target-incomplete-link-phase.cmake b/Tests/RunCMake/XcFramework/create-executable-target-incomplete-link-phase.cmake new file mode 100644 index 0000000..dfeccb9 --- /dev/null +++ b/Tests/RunCMake/XcFramework/create-executable-target-incomplete-link-phase.cmake @@ -0,0 +1 @@ +include(create-executable-target-link-phase.cmake) diff --git a/Tests/RunCMake/XcFramework/create-executable-target-incomplete-result.txt b/Tests/RunCMake/XcFramework/create-executable-target-incomplete-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/XcFramework/create-executable-target-incomplete-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/XcFramework/create-executable-target-incomplete-stderr.txt b/Tests/RunCMake/XcFramework/create-executable-target-incomplete-stderr.txt new file mode 100644 index 0000000..716b17d --- /dev/null +++ b/Tests/RunCMake/XcFramework/create-executable-target-incomplete-stderr.txt @@ -0,0 +1,10 @@ +CMake Error at create-executable-target\.cmake:[0-9]+ \(target_link_libraries\): + Unable to find suitable library in: + + [^ +]*/Tests/RunCMake/XcFramework/create-xcframework-incomplete-build/mylib\.xcframework/Info\.plist + + for system name "Darwin" +Call Stack \(most recent call first\): + create-executable-target-incomplete\.cmake:[0-9]+ \(include\) + CMakeLists\.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/XcFramework/create-executable-target-incomplete.cmake b/Tests/RunCMake/XcFramework/create-executable-target-incomplete.cmake new file mode 100644 index 0000000..b2e3469 --- /dev/null +++ b/Tests/RunCMake/XcFramework/create-executable-target-incomplete.cmake @@ -0,0 +1 @@ +include(create-executable-target.cmake) diff --git a/Tests/RunCMake/XcFramework/create-executable-target-library-ios.cmake b/Tests/RunCMake/XcFramework/create-executable-target-library-ios.cmake new file mode 100644 index 0000000..b2e3469 --- /dev/null +++ b/Tests/RunCMake/XcFramework/create-executable-target-library-ios.cmake @@ -0,0 +1 @@ +include(create-executable-target.cmake) diff --git a/Tests/RunCMake/XcFramework/create-executable-target-library-link-phase-ios.cmake b/Tests/RunCMake/XcFramework/create-executable-target-library-link-phase-ios.cmake new file mode 100644 index 0000000..dfeccb9 --- /dev/null +++ b/Tests/RunCMake/XcFramework/create-executable-target-library-link-phase-ios.cmake @@ -0,0 +1 @@ +include(create-executable-target-link-phase.cmake) diff --git a/Tests/RunCMake/XcFramework/create-executable-target-library-link-phase-macos.cmake b/Tests/RunCMake/XcFramework/create-executable-target-library-link-phase-macos.cmake new file mode 100644 index 0000000..dfeccb9 --- /dev/null +++ b/Tests/RunCMake/XcFramework/create-executable-target-library-link-phase-macos.cmake @@ -0,0 +1 @@ +include(create-executable-target-link-phase.cmake) diff --git a/Tests/RunCMake/XcFramework/create-executable-target-library-link-phase-tvos.cmake b/Tests/RunCMake/XcFramework/create-executable-target-library-link-phase-tvos.cmake new file mode 100644 index 0000000..dfeccb9 --- /dev/null +++ b/Tests/RunCMake/XcFramework/create-executable-target-library-link-phase-tvos.cmake @@ -0,0 +1 @@ +include(create-executable-target-link-phase.cmake) diff --git a/Tests/RunCMake/XcFramework/create-executable-target-library-link-phase-visionos.cmake b/Tests/RunCMake/XcFramework/create-executable-target-library-link-phase-visionos.cmake new file mode 100644 index 0000000..dfeccb9 --- /dev/null +++ b/Tests/RunCMake/XcFramework/create-executable-target-library-link-phase-visionos.cmake @@ -0,0 +1 @@ +include(create-executable-target-link-phase.cmake) diff --git a/Tests/RunCMake/XcFramework/create-executable-target-library-link-phase-watchos.cmake b/Tests/RunCMake/XcFramework/create-executable-target-library-link-phase-watchos.cmake new file mode 100644 index 0000000..dfeccb9 --- /dev/null +++ b/Tests/RunCMake/XcFramework/create-executable-target-library-link-phase-watchos.cmake @@ -0,0 +1 @@ +include(create-executable-target-link-phase.cmake) diff --git a/Tests/RunCMake/XcFramework/create-executable-target-library-macos.cmake b/Tests/RunCMake/XcFramework/create-executable-target-library-macos.cmake new file mode 100644 index 0000000..b2e3469 --- /dev/null +++ b/Tests/RunCMake/XcFramework/create-executable-target-library-macos.cmake @@ -0,0 +1 @@ +include(create-executable-target.cmake) diff --git a/Tests/RunCMake/XcFramework/create-executable-target-library-tvos.cmake b/Tests/RunCMake/XcFramework/create-executable-target-library-tvos.cmake new file mode 100644 index 0000000..b2e3469 --- /dev/null +++ b/Tests/RunCMake/XcFramework/create-executable-target-library-tvos.cmake @@ -0,0 +1 @@ +include(create-executable-target.cmake) diff --git a/Tests/RunCMake/XcFramework/create-executable-target-library-visionos.cmake b/Tests/RunCMake/XcFramework/create-executable-target-library-visionos.cmake new file mode 100644 index 0000000..b2e3469 --- /dev/null +++ b/Tests/RunCMake/XcFramework/create-executable-target-library-visionos.cmake @@ -0,0 +1 @@ +include(create-executable-target.cmake) diff --git a/Tests/RunCMake/XcFramework/create-executable-target-library-watchos.cmake b/Tests/RunCMake/XcFramework/create-executable-target-library-watchos.cmake new file mode 100644 index 0000000..b2e3469 --- /dev/null +++ b/Tests/RunCMake/XcFramework/create-executable-target-library-watchos.cmake @@ -0,0 +1 @@ +include(create-executable-target.cmake) diff --git a/Tests/RunCMake/XcFramework/create-executable-target-link-phase.cmake b/Tests/RunCMake/XcFramework/create-executable-target-link-phase.cmake new file mode 100644 index 0000000..9c0b0d5 --- /dev/null +++ b/Tests/RunCMake/XcFramework/create-executable-target-link-phase.cmake @@ -0,0 +1,2 @@ +include(create-executable-target.cmake) +set_property(TARGET myexe PROPERTY XCODE_LINK_BUILD_PHASE_MODE "KNOWN_LOCATION") diff --git a/Tests/RunCMake/XcFramework/create-executable-target.cmake b/Tests/RunCMake/XcFramework/create-executable-target.cmake new file mode 100644 index 0000000..0cc356c --- /dev/null +++ b/Tests/RunCMake/XcFramework/create-executable-target.cmake @@ -0,0 +1,21 @@ +enable_language(C) + +if(CMAKE_SYSTEM_NAME STREQUAL "iOS") + set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED "NO") + set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO") + set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "") + set(CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE "NO") +endif() + +if(CMAKE_SYSTEM_NAME STREQUAL "tvOS" OR CMAKE_SYSTEM_NAME STREQUAL "watchOS" OR CMAKE_SYSTEM_NAME STREQUAL "visionOS") + set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED "NO") + set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO") + set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "") + set(CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE "YES") +endif() + +add_library(mylib IMPORTED STATIC) +set_property(TARGET mylib PROPERTY IMPORTED_LOCATION ${MYLIB_LIBRARY}) + +add_executable(myexe myexe/myexe.c) +target_link_libraries(myexe PRIVATE mylib) diff --git a/Tests/RunCMake/XcFramework/create-executable.cmake b/Tests/RunCMake/XcFramework/create-executable.cmake new file mode 100644 index 0000000..6706b9f --- /dev/null +++ b/Tests/RunCMake/XcFramework/create-executable.cmake @@ -0,0 +1,18 @@ +enable_language(C) + +if(CMAKE_SYSTEM_NAME STREQUAL "iOS") + set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED "NO") + set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO") + set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "") + set(CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE "NO") +endif() + +if(CMAKE_SYSTEM_NAME STREQUAL "tvOS" OR CMAKE_SYSTEM_NAME STREQUAL "watchOS" OR CMAKE_SYSTEM_NAME STREQUAL "visionOS") + set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED "NO") + set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO") + set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "") + set(CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE "YES") +endif() + +add_executable(myexe myexe/myexe.c) +target_link_libraries(myexe PRIVATE ${MYLIB_LIBRARY}) diff --git a/Tests/RunCMake/XcFramework/create-framework-ios.cmake b/Tests/RunCMake/XcFramework/create-framework-ios.cmake new file mode 100644 index 0000000..8b7df9b --- /dev/null +++ b/Tests/RunCMake/XcFramework/create-framework-ios.cmake @@ -0,0 +1 @@ +include(create-framework.cmake) diff --git a/Tests/RunCMake/XcFramework/create-framework-macos.cmake b/Tests/RunCMake/XcFramework/create-framework-macos.cmake new file mode 100644 index 0000000..8b7df9b --- /dev/null +++ b/Tests/RunCMake/XcFramework/create-framework-macos.cmake @@ -0,0 +1 @@ +include(create-framework.cmake) diff --git a/Tests/RunCMake/XcFramework/create-framework-tvos.cmake b/Tests/RunCMake/XcFramework/create-framework-tvos.cmake new file mode 100644 index 0000000..8b7df9b --- /dev/null +++ b/Tests/RunCMake/XcFramework/create-framework-tvos.cmake @@ -0,0 +1 @@ +include(create-framework.cmake) diff --git a/Tests/RunCMake/XcFramework/create-framework-visionos.cmake b/Tests/RunCMake/XcFramework/create-framework-visionos.cmake new file mode 100644 index 0000000..8b7df9b --- /dev/null +++ b/Tests/RunCMake/XcFramework/create-framework-visionos.cmake @@ -0,0 +1 @@ +include(create-framework.cmake) diff --git a/Tests/RunCMake/XcFramework/create-framework-watchos.cmake b/Tests/RunCMake/XcFramework/create-framework-watchos.cmake new file mode 100644 index 0000000..8b7df9b --- /dev/null +++ b/Tests/RunCMake/XcFramework/create-framework-watchos.cmake @@ -0,0 +1 @@ +include(create-framework.cmake) diff --git a/Tests/RunCMake/XcFramework/create-framework.cmake b/Tests/RunCMake/XcFramework/create-framework.cmake new file mode 100644 index 0000000..f4406e6 --- /dev/null +++ b/Tests/RunCMake/XcFramework/create-framework.cmake @@ -0,0 +1,3 @@ +set(CMAKE_FRAMEWORK ON) +include(create-library-common.cmake) +install(FILES mylib/include/mylib/mylib.h DESTINATION lib/mylib.framework/Headers) diff --git a/Tests/RunCMake/XcFramework/create-library-common.cmake b/Tests/RunCMake/XcFramework/create-library-common.cmake new file mode 100644 index 0000000..958660d --- /dev/null +++ b/Tests/RunCMake/XcFramework/create-library-common.cmake @@ -0,0 +1,12 @@ +enable_language(C) + +if(CMAKE_SYSTEM_NAME STREQUAL "iOS") + set(CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE "NO") +endif() + +if(CMAKE_SYSTEM_NAME STREQUAL "tvOS" OR CMAKE_SYSTEM_NAME STREQUAL "watchOS" OR CMAKE_SYSTEM_NAME STREQUAL "visionOS") + set(CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE "YES") +endif() + +add_library(mylib STATIC mylib/mylib.c) +install(TARGETS mylib DESTINATION lib) diff --git a/Tests/RunCMake/XcFramework/create-library-ios.cmake b/Tests/RunCMake/XcFramework/create-library-ios.cmake new file mode 100644 index 0000000..a9f5dee --- /dev/null +++ b/Tests/RunCMake/XcFramework/create-library-ios.cmake @@ -0,0 +1 @@ +include(create-library.cmake) diff --git a/Tests/RunCMake/XcFramework/create-library-macos.cmake b/Tests/RunCMake/XcFramework/create-library-macos.cmake new file mode 100644 index 0000000..a9f5dee --- /dev/null +++ b/Tests/RunCMake/XcFramework/create-library-macos.cmake @@ -0,0 +1 @@ +include(create-library.cmake) diff --git a/Tests/RunCMake/XcFramework/create-library-tvos.cmake b/Tests/RunCMake/XcFramework/create-library-tvos.cmake new file mode 100644 index 0000000..a9f5dee --- /dev/null +++ b/Tests/RunCMake/XcFramework/create-library-tvos.cmake @@ -0,0 +1 @@ +include(create-library.cmake) diff --git a/Tests/RunCMake/XcFramework/create-library-visionos.cmake b/Tests/RunCMake/XcFramework/create-library-visionos.cmake new file mode 100644 index 0000000..a9f5dee --- /dev/null +++ b/Tests/RunCMake/XcFramework/create-library-visionos.cmake @@ -0,0 +1 @@ +include(create-library.cmake) diff --git a/Tests/RunCMake/XcFramework/create-library-watchos.cmake b/Tests/RunCMake/XcFramework/create-library-watchos.cmake new file mode 100644 index 0000000..a9f5dee --- /dev/null +++ b/Tests/RunCMake/XcFramework/create-library-watchos.cmake @@ -0,0 +1 @@ +include(create-library.cmake) diff --git a/Tests/RunCMake/XcFramework/create-library.cmake b/Tests/RunCMake/XcFramework/create-library.cmake new file mode 100644 index 0000000..f2a5249 --- /dev/null +++ b/Tests/RunCMake/XcFramework/create-library.cmake @@ -0,0 +1 @@ +include(create-library-common.cmake) diff --git a/Tests/RunCMake/XcFramework/find-library.cmake b/Tests/RunCMake/XcFramework/find-library.cmake new file mode 100644 index 0000000..c5fe8db --- /dev/null +++ b/Tests/RunCMake/XcFramework/find-library.cmake @@ -0,0 +1,5 @@ +find_library(MYLIB_XCFRAMEWORK mylib NO_DEFAULT_PATH PATHS "${CMAKE_BINARY_DIR}/../create-xcframework-framework-build") +file(REAL_PATH "${CMAKE_BINARY_DIR}/../create-xcframework-framework-build/mylib.xcframework" expected_path) +if(NOT MYLIB_XCFRAMEWORK STREQUAL expected_path) + message(FATAL_ERROR "Expected value of MYLIB_XCFRAMEWORK:\n ${expected_path}\nActual value:\n ${MYLIB_XCFRAMEWORK}") +endif() diff --git a/Tests/RunCMake/XcFramework/myexe/myexe.c b/Tests/RunCMake/XcFramework/myexe/myexe.c new file mode 100644 index 0000000..d04efbd --- /dev/null +++ b/Tests/RunCMake/XcFramework/myexe/myexe.c @@ -0,0 +1,7 @@ +#include <mylib/mylib.h> + +int main(void) +{ + mylib(); + return 0; +} diff --git a/Tests/RunCMake/XcFramework/mylib/include/mylib/mylib.h b/Tests/RunCMake/XcFramework/mylib/include/mylib/mylib.h new file mode 100644 index 0000000..1de07aa --- /dev/null +++ b/Tests/RunCMake/XcFramework/mylib/include/mylib/mylib.h @@ -0,0 +1,3 @@ +#pragma once + +extern void mylib(void); diff --git a/Tests/RunCMake/XcFramework/mylib/mylib.c b/Tests/RunCMake/XcFramework/mylib/mylib.c new file mode 100644 index 0000000..4489684 --- /dev/null +++ b/Tests/RunCMake/XcFramework/mylib/mylib.c @@ -0,0 +1,3 @@ +void mylib(void) +{ +} diff --git a/Tests/RunCMake/XcodeProject-Device/DeploymentTarget.c b/Tests/RunCMake/XcodeProject-Device/DeploymentTarget.c index 5e0f40f..c00fce7 100644 --- a/Tests/RunCMake/XcodeProject-Device/DeploymentTarget.c +++ b/Tests/RunCMake/XcodeProject-Device/DeploymentTarget.c @@ -5,6 +5,10 @@ # if __MAC_OS_X_VERSION_MIN_REQUIRED != __MAC_10_11 # error macOS deployment version mismatch # endif +#elif TARGET_OS_XR +# if __XR_OS_VERSION_MIN_REQUIRED != __XROS_1_0 +# error visionOS deployment version mismatch +# endif #elif TARGET_OS_IOS # if __IPHONE_OS_VERSION_MIN_REQUIRED != __IPHONE_9_1 # error iOS deployment version mismatch diff --git a/Tests/RunCMake/XcodeProject-Device/DeploymentTarget.cmake b/Tests/RunCMake/XcodeProject-Device/DeploymentTarget.cmake index 234ceef..80e3877 100644 --- a/Tests/RunCMake/XcodeProject-Device/DeploymentTarget.cmake +++ b/Tests/RunCMake/XcodeProject-Device/DeploymentTarget.cmake @@ -7,6 +7,12 @@ if(CMAKE_SYSTEM_NAME STREQUAL "iOS") set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED "NO") set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO") set(CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE "NO") +elseif(CMAKE_SYSTEM_NAME STREQUAL "visionOS") + set(CMAKE_OSX_DEPLOYMENT_TARGET "1.0") + set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED "NO") + set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO") + set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "") + set(CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE "YES") elseif(CMAKE_SYSTEM_NAME STREQUAL "watchOS") set(CMAKE_OSX_DEPLOYMENT_TARGET "2.0") set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED "NO") diff --git a/Tests/RunCMake/XcodeProject-Device/RunCMakeTest.cmake b/Tests/RunCMake/XcodeProject-Device/RunCMakeTest.cmake index e2ed045..b3ab624 100644 --- a/Tests/RunCMake/XcodeProject-Device/RunCMakeTest.cmake +++ b/Tests/RunCMake/XcodeProject-Device/RunCMakeTest.cmake @@ -93,6 +93,25 @@ if(NOT XCODE_VERSION VERSION_LESS 7.1) unset(RunCMake_TEST_OPTIONS) endif() +if(NOT XCODE_VERSION VERSION_LESS 15) + set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/XcodeBundlesVisionOS-build) + set(RunCMake_TEST_NO_CLEAN 1) + set(RunCMake_TEST_OPTIONS + "-DCMAKE_SYSTEM_NAME=visionOS" + "-DCMAKE_INSTALL_PREFIX:PATH=${RunCMake_TEST_BINARY_DIR}/_install") + + file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}") + file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}") + + run_cmake(XcodeBundles) + run_cmake_command(XcodeBundles-build-visionOS ${CMAKE_COMMAND} --build .) + run_cmake_command(XcodeBundles-install-visionOS ${CMAKE_COMMAND} --build . --target install) + + unset(RunCMake_TEST_BINARY_DIR) + unset(RunCMake_TEST_NO_CLEAN) + unset(RunCMake_TEST_OPTIONS) +endif() + if(NOT XCODE_VERSION VERSION_LESS 7) set(RunCMake_TEST_OPTIONS "-DCMAKE_TOOLCHAIN_FILE=${RunCMake_SOURCE_DIR}/osx.cmake") run_cmake(XcodeTbdStub) @@ -242,6 +261,10 @@ if(XCODE_VERSION VERSION_GREATER_EQUAL 8) deployment_target_test(tvOS appletvsimulator) deployment_target_test(watchOS watchos) deployment_target_test(watchOS watchsimulator) + if(XCODE_VERSION VERSION_GREATER_EQUAL 15) + deployment_target_test(visionOS xros) + deployment_target_test(visionOS xrsimulator) + endif() endif() if(XCODE_VERSION VERSION_GREATER_EQUAL 8) diff --git a/Tests/RunCMake/XcodeProject-Device/XcodeBundles.cmake b/Tests/RunCMake/XcodeProject-Device/XcodeBundles.cmake index a9fafd2..376a7fc 100644 --- a/Tests/RunCMake/XcodeProject-Device/XcodeBundles.cmake +++ b/Tests/RunCMake/XcodeProject-Device/XcodeBundles.cmake @@ -9,7 +9,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "iOS") set(CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE "NO") endif() -if(CMAKE_SYSTEM_NAME STREQUAL "tvOS" OR CMAKE_SYSTEM_NAME STREQUAL "watchOS") +if(CMAKE_SYSTEM_NAME STREQUAL "tvOS" OR CMAKE_SYSTEM_NAME STREQUAL "visionOS" OR CMAKE_SYSTEM_NAME STREQUAL "watchOS") set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED "NO") set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO") set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "") diff --git a/Tests/RunCMake/detect_jobserver.c b/Tests/RunCMake/detect_jobserver.c new file mode 100644 index 0000000..a6c1a7c --- /dev/null +++ b/Tests/RunCMake/detect_jobserver.c @@ -0,0 +1,204 @@ +#ifndef _CRT_SECURE_NO_WARNINGS +# define _CRT_SECURE_NO_WARNINGS +#endif + +#if defined(_MSC_VER) && _MSC_VER >= 1928 +# pragma warning(disable : 5105) /* macro expansion warning in windows.h */ +#endif + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#define MAX_MESSAGE_LENGTH 1023 +#define USAGE "Usage: %s [--present|--absent] <output_file>\n" + +// Extracts --jobserver-auth=<string> or --jobserver-fds=<string> from +// MAKEFLAGS. The returned pointer points to the start of <string> Returns NULL +// if MAKEFLAGS is not set or does not contain --jobserver-auth or +// --jobserver-fds +char* jobserver_auth(char* message) +{ + const char* jobserver_auth = "--jobserver-auth="; + const char* jobserver_fds = "--jobserver-fds="; + char* auth; + char* fds; + char* start; + char* end; + char* result; + size_t len; + + char* makeflags = getenv("MAKEFLAGS"); + if (makeflags == NULL) { + strncpy(message, "MAKEFLAGS not set", MAX_MESSAGE_LENGTH); + return NULL; + } + + // write MAKEFLAGS to stdout for debugging + fprintf(stdout, "MAKEFLAGS: %s\n", makeflags); + + auth = strstr(makeflags, jobserver_auth); + fds = strstr(makeflags, jobserver_fds); + if (auth == NULL && fds == NULL) { + strncpy(message, "No jobserver found", MAX_MESSAGE_LENGTH); + return NULL; + } else if (auth != NULL) { + start = auth + strlen(jobserver_auth); + } else { + start = fds + strlen(jobserver_fds); + } + + end = strchr(start, ' '); + if (end == NULL) { + end = start + strlen(start); + } + len = (size_t)(end - start); + result = (char*)malloc(len + 1); + strncpy(result, start, len); + result[len] = '\0'; + + return result; +} + +#if defined(_WIN32) +# include <windows.h> + +int windows_semaphore(const char* semaphore, char* message) +{ + // Open the semaphore + HANDLE hSemaphore = OpenSemaphoreA(SEMAPHORE_ALL_ACCESS, FALSE, semaphore); + + if (hSemaphore == NULL) { +# if defined(_MSC_VER) && _MSC_VER < 1900 + sprintf(message, "Error opening semaphore: %s (%ld)\n", semaphore, + GetLastError()); +# else + snprintf(message, MAX_MESSAGE_LENGTH, + "Error opening semaphore: %s (%ld)\n", semaphore, GetLastError()); +# endif + return 1; + } + + strncpy(message, "Success", MAX_MESSAGE_LENGTH); + return 0; +} +#else +# include <errno.h> +# include <fcntl.h> + +int test_fd(int read_fd, int write_fd, char* message) +{ + // Detect if the file descriptors are valid + int read_good = fcntl(read_fd, F_GETFD) != -1; + int read_error = errno; + + int write_good = fcntl(write_fd, F_GETFD) != -1; + int write_error = errno; + + if (!read_good || !write_good) { + snprintf(message, MAX_MESSAGE_LENGTH, + "Error opening file descriptors: %d (%s), %d (%s)\n", read_fd, + strerror(read_error), write_fd, strerror(write_error)); + return 1; + } + + snprintf(message, MAX_MESSAGE_LENGTH, "Success\n"); + return 0; +} + +int posix(const char* jobserver, char* message) +{ + int read_fd; + int write_fd; + const char* path; + + // First try to parse as "R,W" file descriptors + if (sscanf(jobserver, "%d,%d", &read_fd, &write_fd) == 2) { + return test_fd(read_fd, write_fd, message); + } + + // Then try to parse as "fifo:PATH" + if (strncmp(jobserver, "fifo:", 5) == 0) { + path = jobserver + 5; + read_fd = open(path, O_RDONLY); + write_fd = open(path, O_WRONLY); + return test_fd(read_fd, write_fd, message); + } + + // We don't understand the format + snprintf(message, MAX_MESSAGE_LENGTH, "Unrecognized jobserver format: %s\n", + jobserver); + return 1; +} +#endif + +// Takes 2 arguments: +// Either --present or --absent to indicate we expect the jobserver to be +// "present and valid", or "absent or invalid" +// +// if `--present` is passed, the exit code will be 0 if the jobserver is +// present, 1 if it is absent if `--absent` is passed, the exit code will be 0 +// if the jobserver is absent, 1 if it is present in either case, if there is +// some fatal error (e.g the output file cannot be opened), the exit code will +// be 2 +int main(int argc, char** argv) +{ + char message[MAX_MESSAGE_LENGTH + 1]; + char* output_file; + FILE* fp; + int expecting_present; + int expecting_absent; + char* jobserver; + int result; + + if (argc != 3) { + fprintf(stderr, USAGE, argv[0]); + return 2; + } + + expecting_present = strcmp(argv[1], "--present") == 0; + expecting_absent = strcmp(argv[1], "--absent") == 0; + if (!expecting_present && !expecting_absent) { + fprintf(stderr, USAGE, argv[0]); + return 2; + } + + output_file = argv[2]; + fp = fopen(output_file, "w"); + if (fp == NULL) { + fprintf(stderr, "Error opening output file: %s\n", output_file); + return 2; + } + + jobserver = jobserver_auth(message); + if (jobserver == NULL) { + if (expecting_absent) { + fprintf(stdout, "Success\n"); + return 0; + } + + fprintf(stderr, "%s\n", message); + return 1; + } + +#if defined(_WIN32) + result = windows_semaphore(jobserver, message); +#else + result = posix(jobserver, message); +#endif + free(jobserver); + message[MAX_MESSAGE_LENGTH] = 0; + + if (result == 0 && expecting_present) { + fprintf(stdout, "Success\n"); + return 0; + } + + if (result == 1 && expecting_absent) { + fprintf(stdout, "Success\n"); + return 0; + } + + fprintf(stderr, "%s\n", message); + return 1; +} diff --git a/Tests/RunCMake/file/REAL_PATH.cmake b/Tests/RunCMake/file/REAL_PATH.cmake index 9c5d4ea..08d400d 100644 --- a/Tests/RunCMake/file/REAL_PATH.cmake +++ b/Tests/RunCMake/file/REAL_PATH.cmake @@ -13,6 +13,43 @@ if (NOT WIN32 OR CYGWIN) if (NOT real_path STREQUAL "${CMAKE_CURRENT_BINARY_DIR}/test.txt") message(SEND_ERROR "real path is \"${real_path}\", should be \"${CMAKE_CURRENT_BINARY_DIR}/test.txt\"") endif() + + file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/dir/") + file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/dir/nested/") + file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/dir/nested/bin/") + file(CREATE_LINK "${CMAKE_CURRENT_BINARY_DIR}/dir/nested/bin" "${CMAKE_CURRENT_BINARY_DIR}/dir/bin" SYMBOLIC) + + cmake_policy(SET CMP0152 NEW) + file(REAL_PATH "${CMAKE_CURRENT_BINARY_DIR}/dir/bin/../" real_path) + if (NOT real_path STREQUAL "${CMAKE_CURRENT_BINARY_DIR}/dir/nested") + message(SEND_ERROR "real path is \"${real_path}\", should be \"${CMAKE_CURRENT_BINARY_DIR}/dir/nested\"") + endif() + + file(REAL_PATH "${CMAKE_CURRENT_BINARY_DIR}/dir/bin/../bin" real_path) + if (NOT real_path STREQUAL "${CMAKE_CURRENT_BINARY_DIR}/dir/nested/bin") + message(SEND_ERROR "real path is \"${real_path}\", should be \"${CMAKE_CURRENT_BINARY_DIR}/dir/nested/bin\"") + endif() + + file(REAL_PATH "dir/bin/../bin" real_path BASE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}") + if (NOT real_path STREQUAL "${CMAKE_CURRENT_BINARY_DIR}/dir/nested/bin") + message(SEND_ERROR "real path is \"${real_path}\", should be \"${CMAKE_CURRENT_BINARY_DIR}/dir/nested/bin\"") + endif() + + file(REAL_PATH "../bin" real_path BASE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/dir/bin/" ) + if (NOT real_path STREQUAL "${CMAKE_CURRENT_BINARY_DIR}/dir/nested/bin") + message(SEND_ERROR "real path is \"${real_path}\", should be \"${CMAKE_CURRENT_BINARY_DIR}/dir/nested/bin\"") + endif() + + cmake_policy(SET CMP0152 OLD) + file(REAL_PATH "${CMAKE_CURRENT_BINARY_DIR}/dir/bin/../" real_path) + if (NOT real_path STREQUAL "${CMAKE_CURRENT_BINARY_DIR}/dir") + message(SEND_ERROR "real path is \"${real_path}\", should be \"${CMAKE_CURRENT_BINARY_DIR}/dir/nested\"") + endif() + file(REAL_PATH "../" real_path BASE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/dir/bin/") + if (NOT real_path STREQUAL "${CMAKE_CURRENT_BINARY_DIR}/dir") + message(SEND_ERROR "real path is \"${real_path}\", should be \"${CMAKE_CURRENT_BINARY_DIR}/dir\"") + endif() + endif() diff --git a/Tests/RunCMake/find_library/FromScriptMode-stderr-darwin.txt b/Tests/RunCMake/find_library/FromScriptMode-stderr-darwin.txt index 185720b..b0bf460 100644 --- a/Tests/RunCMake/find_library/FromScriptMode-stderr-darwin.txt +++ b/Tests/RunCMake/find_library/FromScriptMode-stderr-darwin.txt @@ -1,4 +1,4 @@ .*find_library considered the following locations.* -.*\(lib\)library_no_exist\(\\.tbd\|\\.dylib\|\\.so\|\\.a\).* +.*liblibrary_no_exist\(\\.tbd\|\\.dylib\|\\.so\|\\.a\).* .*The item was found at.* .*lib/libcreated.a.* diff --git a/Tests/RunCMake/find_library/FromScriptMode-stderr.txt b/Tests/RunCMake/find_library/FromScriptMode-stderr.txt index 046f680..6f25184 100644 --- a/Tests/RunCMake/find_library/FromScriptMode-stderr.txt +++ b/Tests/RunCMake/find_library/FromScriptMode-stderr.txt @@ -1,4 +1,4 @@ .*find_library considered the following locations.* -.*\(lib\)library_no_exist\(\\.so\|\\.a\).* +.*liblibrary_no_exist\(\\.so\|\\.a\).* .*The item was found at.* .*lib/libcreated.a.* diff --git a/Tests/RunCMake/property_init/Always.cmake b/Tests/RunCMake/property_init/Always.cmake new file mode 100644 index 0000000..db23563 --- /dev/null +++ b/Tests/RunCMake/property_init/Always.cmake @@ -0,0 +1,15 @@ +set(properties + # property expected alias + # Test a property which should never be initialized. + "notset" "<UNSET>" "<SAME>" + + # Build graph properties + "VERIFY_INTERFACE_HEADER_SETS" "TRUE" "<SAME>" + + # Metadata + "FOLDER" "folder" "<SAME>" + ) + +prepare_target_types(always ${all_target_types}) + +run_property_tests(always properties) diff --git a/Tests/RunCMake/property_init/CMakeLists.txt b/Tests/RunCMake/property_init/CMakeLists.txt new file mode 100644 index 0000000..51883af --- /dev/null +++ b/Tests/RunCMake/property_init/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.12) +project(${RunCMake_TEST} C) + +set(main_sources main.c) +set(library_sources library.c) + +include(util.cmake) + +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/property_init/CompileSources.cmake b/Tests/RunCMake/property_init/CompileSources.cmake new file mode 100644 index 0000000..e8c5554 --- /dev/null +++ b/Tests/RunCMake/property_init/CompileSources.cmake @@ -0,0 +1,274 @@ +set(dir "${CMAKE_CURRENT_BINARY_DIR}") + +set(properties + # property expected alias + # Compilation properties + "COMPILE_WARNING_AS_ERROR" "ON" "<SAME>" + "INTERPROCEDURAL_OPTIMIZATION" "OFF" "<SAME>" + "NO_SYSTEM_FROM_IMPORTED" "ON" "<SAME>" + "VISIBILITY_INLINES_HIDDEN" "ON" "<SAME>" + ## Features + ### PCH + "DISABLE_PRECOMPILE_HEADERS" "ON" "<SAME>" + "PCH_WARN_INVALID" "OFF" "<SAME>" + "PCH_INSTANTIATE_TEMPLATES" "OFF" "<SAME>" + ## Platforms + ### Android + "ANDROID_API" "9" "<SAME>" + "ANDROID_API_MIN" "9" "<SAME>" + "ANDROID_ARCH" "arm64-v8a" "<SAME>" + "ANDROID_ASSETS_DIRECTORIES" "${dir}" "<SAME>" + "ANDROID_JAVA_SOURCE_DIR" "${dir}" "<SAME>" + "ANDROID_STL_TYPE" "system" "<SAME>" + ### macOS + "OSX_ARCHITECTURES" "arm64" "<SAME>" + ### Windows + "MSVC_DEBUG_INFORMATION_FORMAT" "Embedded" "<SAME>" + "MSVC_RUNTIME_LIBRARY" "MultiThreaded" "<SAME>" + "VS_JUST_MY_CODE_DEBUGGING" "ON" "<SAME>" + ### OpenWatcom + "WATCOM_RUNTIME_LIBRARY" "MultiThreaded" "<SAME>" + ## Language + ### CUDA + "CUDA_SEPARABLE_COMPILATION" "ON" "<SAME>" + "CUDA_ARCHITECTURES" "naive" "<SAME>" + ### Fortran + "Fortran_FORMAT" "FREE" "<SAME>" + "Fortran_MODULE_DIRECTORY" "${dir}" "<SAME>" + "Fortran_COMPILER_LAUNCHER" "ccache" "<SAME>" + "Fortran_PREPROCESS" "ON" "<SAME>" + "Fortran_VISIBILITY_PRESET" "hidden" "<SAME>" + ### HIP + "HIP_ARCHITECTURES" "gfx801" "<SAME>" + ### ISPC + "ISPC_COMPILER_LAUNCHER" "ccache" "<SAME>" + "ISPC_HEADER_DIRECTORY" "${dir}" "<SAME>" + "ISPC_HEADER_SUFFIX" "_i.h" "<SAME>" + "ISPC_INSTRUCTION_SETS" "avx2-i32x4" "<SAME>" + ### Swift + "Swift_LANGUAGE_VERSION" "2.3" "<SAME>" + "Swift_MODULE_DIRECTORY" "${dir}" "<SAME>" + ### moc + "AUTOMOC" "OFF" "<SAME>" + "AUTOMOC_COMPILER_PREDEFINES" "OFF" "<SAME>" + "AUTOMOC_MACRO_NAMES" "MOC_CLASS" "<SAME>" + "AUTOMOC_MOC_OPTIONS" "-v" "<SAME>" + "AUTOMOC_PATH_PREFIX" "moc_" "<SAME>" + "AUTOMOC_EXECUTABLE" "automoc" "<SAME>" + ### uic + "AUTOUIC" "OFF" "<SAME>" + "AUTOUIC_OPTIONS" "-v" "<SAME>" + "AUTOUIC_SEARCH_PATHS" "${dir}" "<SAME>" + "AUTOUIC_EXECUTABLE" "autouic" "<SAME>" + ### rcc + "AUTORCC" "OFF" "<SAME>" + "AUTORCC_OPTIONS" "-v" "<SAME>" + "AUTORCC_EXECUTABLE" "autorcc" "<SAME>" + + # Linking properties + "LINK_SEARCH_START_STATIC" "-Bstatic" "<SAME>" + "LINK_SEARCH_END_STATIC" "-Bdynamic" "<SAME>" + ## Dependent library lookup + "MACOSX_RPATH" "@loader_path/" "<SAME>" + ### Build + "BUILD_RPATH" "../lib" "<SAME>" + "BUILD_RPATH_USE_ORIGIN" "ON" "<SAME>" + "SKIP_BUILD_RPATH" "ON" "<SAME>" + "BUILD_WITH_INSTALL_RPATH" "ON" "<SAME>" + "BUILD_WITH_INSTALL_NAME_DIR" "@rpath/" "<SAME>" + ### Install + "INSTALL_NAME_DIR" "@rpath/" "<SAME>" + "INSTALL_REMOVE_ENVIRONMENT_RPATH" "ON" "<SAME>" + "INSTALL_RPATH" "@rpath/" "<SAME>" + "INSTALL_RPATH_USE_LINK_PATH" "ON" "<SAME>" + ## Platforms + ### Android + "ANDROID_JAR_DIRECTORIES" "${dir}" "<SAME>" + "ANDROID_JAR_DEPENDENCIES" "${dir}/foo.jar" "<SAME>" + "ANDROID_NATIVE_LIB_DIRECTORIES" "${dir}" "<SAME>" + "ANDROID_NATIVE_LIB_DEPENDENCIES" "${dir}/native.a" "<SAME>" + "ANDROID_PROGUARD" "ON" "<SAME>" + "ANDROID_PROGUARD_CONFIG_PATH" "proguard.props" "<SAME>" + "ANDROID_SECURE_PROPS_PATH" "secure.props" "<SAME>" + ### iOS + "IOS_INSTALL_COMBINED" "ON" "<SAME>" + ### Windows + "GNUtoMS" "ON" "<SAME>" + "WIN32_EXECUTABLE" "OFF" "<SAME>" + ## Languages + ### C + "C_LINKER_LAUNCHER" "ccache" "<SAME>" + ### C++ + "CXX_LINKER_LAUNCHER" "ccache" "<SAME>" + ### CUDA + "CUDA_RESOLVE_DEVICE_SYMBOLS" "ON" "<SAME>" + "CUDA_RUNTIME_LIBRARY" "Static" "<SAME>" + ### HIP + "HIP_RUNTIME_LIBRARY" "SHARED" "<SAME>" + ### Objective C + "OBJC_LINKER_LAUNCHER" "ccache" "<SAME>" + ### Objective C++ + "OBJCXX_LINKER_LAUNCHER" "ccache" "<SAME>" + + # Static analysis + ## C + "C_CLANG_TIDY" "clang-tidy" "<SAME>" + "C_CLANG_TIDY_EXPORT_FIXES_DIR" "${dir}" "<SAME>" + "C_CPPLINT" "cpplint" "<SAME>" + "C_CPPCHECK" "cppcheck" "<SAME>" + "C_INCLUDE_WHAT_YOU_USE" "iwyu" "<SAME>" + ## C++ + "CXX_CLANG_TIDY" "clang-tidy" "<SAME>" + "CXX_CLANG_TIDY_EXPORT_FIXES_DIR" "${dir}" "<SAME>" + "CXX_CPPLINT" "cpplint" "<SAME>" + "CXX_CPPCHECK" "cppcheck" "<SAME>" + "CXX_INCLUDE_WHAT_YOU_USE" "iwyu" "<SAME>" + ## Objective C + "OBJC_CLANG_TIDY" "clang-tidy" "<SAME>" + "OBJC_CLANG_TIDY_EXPORT_FIXES_DIR" "${dir}" "<SAME>" + ## Objective C++ + "OBJCXX_CLANG_TIDY" "clang-tidy" "<SAME>" + "OBJCXX_CLANG_TIDY_EXPORT_FIXES_DIR" "${dir}" "<SAME>" + ## Linking + "LINK_WHAT_YOU_USE" "lwyu" "<SAME>" + + # Build graph properties + "LINK_DEPENDS_NO_SHARED" "OFF" "<SAME>" + "UNITY_BUILD" "OFF" "<SAME>" + "UNITY_BUILD_UNIQUE_ID" "unity" "<SAME>" + "UNITY_BUILD_BATCH_SIZE" "10" "<SAME>" + "UNITY_BUILD_MODE" "GROUP" "<SAME>" + "OPTIMIZE_DEPENDENCIES" "ON" "<SAME>" + ## Android + "ANDROID_ANT_ADDITIONAL_OPTIONS" "-v" "<SAME>" + "ANDROID_PROCESS_MAX" "2" "<SAME>" + "ANDROID_SKIP_ANT_STEP" "ON" "<SAME>" + ## Autogen + "AUTOGEN_ORIGIN_DEPENDS" "OFF" "<SAME>" + "AUTOGEN_PARALLEL" "ON" "<SAME>" + "AUTOGEN_USE_SYSTEM_INCLUDE" "ON" "<SAME>" + ## moc + "AUTOMOC_DEPEND_FILTERS" "FIRST<SEMI>SECOND" "<SAME>" + ## C++ + "CXX_SCAN_FOR_MODULES" "ON" "<SAME>" + ## Ninja + "JOB_POOL_COMPILE" "compile_pool" "<SAME>" + "JOB_POOL_LINK" "link_pool" "<SAME>" + "JOB_POOL_PRECOMPILE_HEADER" "pch_pool" "<SAME>" + ## Visual Studio + "VS_NO_COMPILE_BATCHING" "ON" "<SAME>" + "VS_WINDOWS_TARGET_PLATFORM_MIN_VERSION" "10.0.10240.0" "<SAME>" + + # Output location properties + "ARCHIVE_OUTPUT_DIRECTORY" "${dir}" "<SAME>" + "COMPILE_PDB_OUTPUT_DIRECTORY" "${dir}" "<SAME>" + "LIBRARY_OUTPUT_DIRECTORY" "${dir}" "<SAME>" + "PDB_OUTPUT_DIRECTORY" "${dir}" "<SAME>" + "RUNTIME_OUTPUT_DIRECTORY" "${dir}" "<SAME>" + + # macOS bundle properties + "FRAMEWORK" "OFF" "<SAME>" + "FRAMEWORK_MULTI_CONFIG_POSTFIX" ".mcpostfix" "<SAME>" + "MACOSX_BUNDLE" "OFF" "<SAME>" + + # Usage requirement properties + "LINK_INTERFACE_LIBRARIES" "c" "<SAME>" + + # Metadata + "EXPORT_COMPILE_COMMANDS" "OFF" "<SAME>" + ) + +if (CMAKE_HOST_APPLE) # compile-guarded in CMake + if (CMAKE_GENERATOR STREQUAL "Xcode") + list(APPEND properties + # property expected alias + # Xcode properties + "XCODE_SCHEME_ADDRESS_SANITIZER" "ON" "<SAME>" + "XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN" "ON" "<SAME>" + "XCODE_SCHEME_DEBUG_DOCUMENT_VERSIONING" "ON" "<SAME>" + "XCODE_SCHEME_ENABLE_GPU_FRAME_CAPTURE_MODE" "ON" "<SAME>" + "XCODE_SCHEME_THREAD_SANITIZER" "ON" "<SAME>" + "XCODE_SCHEME_THREAD_SANITIZER_STOP" "ON" "<SAME>" + "XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER" "ON" "<SAME>" + "XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP" "ON" "<SAME>" + "XCODE_SCHEME_LAUNCH_CONFIGURATION" "ON" "<SAME>" + "XCODE_SCHEME_ENABLE_GPU_API_VALIDATION" "ON" "<SAME>" + "XCODE_SCHEME_ENABLE_GPU_SHADER_VALIDATION" "ON" "<SAME>" + "XCODE_SCHEME_WORKING_DIRECTORY" "ON" "<SAME>" + "XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER" "ON" "<SAME>" + "XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP" "ON" "<SAME>" + "XCODE_SCHEME_MALLOC_SCRIBBLE" "ON" "<SAME>" + "XCODE_SCHEME_MALLOC_GUARD_EDGES" "ON" "<SAME>" + "XCODE_SCHEME_GUARD_MALLOC" "ON" "<SAME>" + "XCODE_SCHEME_LAUNCH_MODE" "ON" "<SAME>" + "XCODE_SCHEME_ZOMBIE_OBJECTS" "ON" "<SAME>" + "XCODE_SCHEME_MALLOC_STACK" "ON" "<SAME>" + "XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE" "ON" "<SAME>" + "XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS" "ON" "<SAME>" + "XCODE_SCHEME_ENVIRONMENT" "ON" "<SAME>" + "XCODE_LINK_BUILD_PHASE_MODE" "BUILT_ONLY" "<SAME>" + ) + endif () +endif () + +macro (add_language_properties lang std) + list(APPEND properties + # property expected alias + "${lang}_COMPILER_LAUNCHER" "ccache" "<SAME>" + "${lang}_STANDARD" "${std}" "<SAME>" + "${lang}_STANDARD_REQUIRED" "TRUE" "<SAME>" + "${lang}_EXTENSIONS" "FALSE" "<SAME>" + "${lang}_VISIBILITY_PRESET" "hidden" "<SAME>" + ) +endmacro () + +# Mock up knowing the standard flag. This doesn't actually build, so nothing +# should care at this point. +set(CMAKE_Cc_std_11_STANDARD_COMPILE_OPTION "-std=c11") + +add_language_properties(C c_std_11) +add_language_properties(CXX cxx_std_11) +add_language_properties(CUDA cuda_std_11) +add_language_properties(HIP hip_std_11) +add_language_properties(OBJC c_std_99) +add_language_properties(OBJCXX cxx_std_11) + +# Set up pools for properties set above. +if (CMAKE_GENERATOR MATCHES "Ninja") + set_property(GLOBAL APPEND + PROPERTY + JOB_POOLS + compile_pool=1 + link_pool=1 + pch_pool=1) +endif () + +prepare_target_types(can_compile_sources + EXECUTABLE SHARED STATIC MODULE OBJECT) + +run_property_tests(can_compile_sources properties) + +set(properties_with_defaults + # property expected alias + "PCH_WARN_INVALID" "ON" "<SAME>" + "PCH_INSTANTIATE_TEMPLATES" "ON" "<SAME>" + "ISPC_HEADER_SUFFIX" "_ispc.h" "<SAME>" + "SKIP_BUILD_RPATH" "OFF" "<SAME>" + "BUILD_WITH_INSTALL_RPATH" "OFF" "<SAME>" + "INSTALL_RPATH" "" "<SAME>" + "INSTALL_RPATH_USE_LINK_PATH" "OFF" "<SAME>" + "UNITY_BUILD_BATCH_SIZE" "8" "<SAME>" + "UNITY_BUILD_MODE" "BATCH" "<SAME>" + ) + +if (CMAKE_HOST_APPLE) + if (CMAKE_GENERATOR STREQUAL "Xcode") + list(APPEND properties_with_defaults + # property expected alias + "XCODE_LINK_BUILD_PHASE_MODE" "NONE" "<SAME>" + ) + endif () +endif () + +set(with_defaults 1) +run_property_tests(can_compile_sources properties_with_defaults) diff --git a/Tests/RunCMake/property_init/Executable.cmake b/Tests/RunCMake/property_init/Executable.cmake new file mode 100644 index 0000000..ede0e4b --- /dev/null +++ b/Tests/RunCMake/property_init/Executable.cmake @@ -0,0 +1,25 @@ +set(dir "${CMAKE_CURRENT_BINARY_DIR}") + +set(properties + # property expected alias + # Compilation properties + ## Platforms + ### Windows + "VS_DEBUGGER_COMMAND" "vsdbg" "<SAME>" + "VS_DEBUGGER_COMMAND_ARGUMENTS" "/?" "<SAME>" + "VS_DEBUGGER_ENVIRONMENT" "env=val" "<SAME>" + "VS_DEBUGGER_WORKING_DIRECTORY" "${dir}" "<SAME>" + + # Linking properties + ## Platforms + ### Android + "ANDROID_GUI" "OFF" "<SAME>" + + # Metadata + "CROSSCOMPILING_EMULATOR" "emu" "<SAME>" + ) + +prepare_target_types(executable + EXECUTABLE + IMPORTED_EXECUTABLE) +run_property_tests(executable properties) diff --git a/Tests/RunCMake/property_init/ImportedTargets.cmake b/Tests/RunCMake/property_init/ImportedTargets.cmake new file mode 100644 index 0000000..0b51998 --- /dev/null +++ b/Tests/RunCMake/property_init/ImportedTargets.cmake @@ -0,0 +1,9 @@ +set(properties + # property expected alias + "SYSTEM" "ON" "<SAME>" + ) + +prepare_target_types(imported + IMPORTED_EXECUTABLE IMPORTED_INTERFACE IMPORTED_MODULE IMPORTED_OBJECT IMPORTED_SHARED IMPORTED_STATIC) +set(with_defaults 1) +run_property_tests(imported properties) diff --git a/Tests/RunCMake/property_init/LibraryArtifact.cmake b/Tests/RunCMake/property_init/LibraryArtifact.cmake new file mode 100644 index 0000000..942b433 --- /dev/null +++ b/Tests/RunCMake/property_init/LibraryArtifact.cmake @@ -0,0 +1,10 @@ +per_config(properties + # property expected alias + # Linking properties + "_POSTFIX" "test" "<UNSET>" + ) + +prepare_target_types(library_with_artifact + MODULE SHARED STATIC + IMPORTED_MODULE IMPORTED_SHARED IMPORTED_STATIC) +run_property_tests(library_with_artifact properties) diff --git a/Tests/RunCMake/property_init/Linkable.cmake b/Tests/RunCMake/property_init/Linkable.cmake new file mode 100644 index 0000000..e5d75d1 --- /dev/null +++ b/Tests/RunCMake/property_init/Linkable.cmake @@ -0,0 +1,12 @@ +per_config(properties + # property expected alias + # Linking properties + ## Platforms + ### macOS + "FRAMEWORK_MULTI_CONFIG_POSTFIX_" ".fw" "<UNSET>" + ) + +prepare_target_types(linkable + EXECUTABLE SHARED STATIC + IMPORTED_EXECUTABLE IMPORTED_SHARED IMPORTED_STATIC) +run_property_tests(linkable properties) diff --git a/Tests/RunCMake/property_init/NonImportedNormalTarget.cmake b/Tests/RunCMake/property_init/NonImportedNormalTarget.cmake new file mode 100644 index 0000000..cf3b726 --- /dev/null +++ b/Tests/RunCMake/property_init/NonImportedNormalTarget.cmake @@ -0,0 +1,9 @@ +set(properties + # property expected alias + # Linking properties + "LINK_LIBRARIES_ONLY_TARGETS" "OFF" "<SAME>" + ) + +prepare_target_types(normal_non_imported + EXECUTABLE SHARED STATIC MODULE OBJECT INTERFACE) +run_property_tests(normal_non_imported properties) diff --git a/Tests/RunCMake/property_init/NonImportedTarget.cmake b/Tests/RunCMake/property_init/NonImportedTarget.cmake new file mode 100644 index 0000000..7e2e22c --- /dev/null +++ b/Tests/RunCMake/property_init/NonImportedTarget.cmake @@ -0,0 +1,11 @@ +set(properties + # property expected alias + # Compilation properties + ## Language + ### CSharp + "DOTNET_SDK" "Microsoft.NET.Sdk" "<SAME>" + ) + +prepare_target_types(non_imported + EXECUTABLE SHARED STATIC MODULE OBJECT INTERFACE CUSTOM) +run_property_tests(non_imported properties) diff --git a/Tests/RunCMake/property_init/NormalTarget.cmake b/Tests/RunCMake/property_init/NormalTarget.cmake new file mode 100644 index 0000000..99507cf --- /dev/null +++ b/Tests/RunCMake/property_init/NormalTarget.cmake @@ -0,0 +1,10 @@ +per_config(properties + # property expected alias + # Usage requirement properties + "MAP_IMPORTED_CONFIG_" "Release" "<UNSET>" + ) + +prepare_target_types(normal + EXECUTABLE INTERFACE MODULE OBJECT SHARED STATIC + IMPORTED_EXECUTABLE IMPORTED_INTERFACE IMPORTED_MODULE IMPORTED_OBJECT IMPORTED_SHARED IMPORTED_STATIC) +run_property_tests(normal properties) diff --git a/Tests/RunCMake/property_init/PICTargets.cmake b/Tests/RunCMake/property_init/PICTargets.cmake new file mode 100644 index 0000000..6c99505 --- /dev/null +++ b/Tests/RunCMake/property_init/PICTargets.cmake @@ -0,0 +1,21 @@ +set(properties + # property expected alias + # Compilation properties + "POSITION_INDEPENDENT_CODE" "True" "<SAME>" + ) + +prepare_target_types(pic_targets + EXECUTABLE MODULE OBJECT SHARED STATIC + IMPORTED_MODULE IMPORTED_SHARED) +run_property_tests(pic_targets properties) + +set(APPEND properties_with_defaults + # property expected alias + "POSITION_INDEPENDENT_CODE" "True" "<SAME>" + ) + +prepare_target_types(pic_default_targets + MODULE SHARED + IMPORTED_MODULE IMPORTED_SHARED) +set(with_defaults 1) +run_property_tests(pic_default_targets properties_with_defaults) diff --git a/Tests/RunCMake/property_init/RunCMakeTest.cmake b/Tests/RunCMake/property_init/RunCMakeTest.cmake new file mode 100644 index 0000000..310da72 --- /dev/null +++ b/Tests/RunCMake/property_init/RunCMakeTest.cmake @@ -0,0 +1,16 @@ +include(RunCMake) + +run_cmake(Always) +run_cmake(CompileSources) +run_cmake(Executable) +run_cmake(ImportedTargets) +run_cmake(LibraryArtifact) +run_cmake(Linkable) +run_cmake(NonImportedNormalTarget) +run_cmake(NonImportedTarget) +run_cmake(NormalTarget) +run_cmake(PICTargets) +run_cmake(SharedLibrary) +run_cmake(TargetsWithArtifact) +run_cmake(TargetsWithCommands) +run_cmake(TargetsWithExports) diff --git a/Tests/RunCMake/property_init/SharedLibrary.cmake b/Tests/RunCMake/property_init/SharedLibrary.cmake new file mode 100644 index 0000000..49715a4 --- /dev/null +++ b/Tests/RunCMake/property_init/SharedLibrary.cmake @@ -0,0 +1,12 @@ +set(dir "${CMAKE_CURRENT_BINARY_DIR}") + +set(properties + # property expected alias + # Linking properties + "DLL_NAME_WITH_SOVERSION" "OFF" "<SAME>" + ) + +prepare_target_types(shared_library + SHARED + IMPORTED_SHARED) +run_property_tests(shared_library properties) diff --git a/Tests/RunCMake/property_init/TargetsWithArtifact.cmake b/Tests/RunCMake/property_init/TargetsWithArtifact.cmake new file mode 100644 index 0000000..0c19ea3 --- /dev/null +++ b/Tests/RunCMake/property_init/TargetsWithArtifact.cmake @@ -0,0 +1,19 @@ +set(dir "${CMAKE_CURRENT_BINARY_DIR}") + +per_config(properties + # property expected alias + # Compilation properties + "INTERPROCEDURAL_OPTIMIZATION_" "OFF" "<UNSET>" + + # Output location properties + "ARCHIVE_OUTPUT_DIRECTORY_" "${dir}" "<UNSET>" + "COMPILE_PDB_OUTPUT_DIRECTORY_" "${dir}" "<UNSET>" + "LIBRARY_OUTPUT_DIRECTORY_" "${dir}" "<UNSET>" + "PDB_OUTPUT_DIRECTORY_" "${dir}" "<UNSET>" + "RUNTIME_OUTPUT_DIRECTORY_" "${dir}" "<UNSET>" + ) + +prepare_target_types(with_artifact + EXECUTABLE MODULE SHARED STATIC + IMPORTED_EXECUTABLE IMPORTED_MODULE IMPORTED_SHARED IMPORTED_STATIC) +run_property_tests(with_artifact properties) diff --git a/Tests/RunCMake/property_init/TargetsWithCommands.cmake b/Tests/RunCMake/property_init/TargetsWithCommands.cmake new file mode 100644 index 0000000..4db0ca3 --- /dev/null +++ b/Tests/RunCMake/property_init/TargetsWithCommands.cmake @@ -0,0 +1,13 @@ +set(properties + # property expected alias + # Compilation properties + ## Language + ### CSharp + "DOTNET_TARGET_FRAMEWORK" "netcoreapp2.1" "<SAME>" + "DOTNET_TARGET_FRAMEWORK_VERSION" "v4.5" "<SAME>" + ) + +prepare_target_types(with_commands + EXECUTABLE MODULE OBJECT SHARED STATIC CUSTOM + IMPORTED_EXECUTABLE IMPORTED_MODULE IMPORTED_OBJECT IMPORTED_SHARED IMPORTED_STATIC) +run_property_tests(with_commands properties) diff --git a/Tests/RunCMake/property_init/TargetsWithExports.cmake b/Tests/RunCMake/property_init/TargetsWithExports.cmake new file mode 100644 index 0000000..9b2e213 --- /dev/null +++ b/Tests/RunCMake/property_init/TargetsWithExports.cmake @@ -0,0 +1,51 @@ +set(properties + # property expected alias + # Linking properties + ## Platforms + ### AIX + "AIX_EXPORT_ALL_SYMBOLS" "OFF" "<SAME>" + ### Windows + "WINDOWS_EXPORT_ALL_SYMBOLS" "OFF" "<SAME>" + ) + +prepare_target_types(symbol_export_target + EXECUTABLE SHARED + IMPORTED_EXECUTABLE IMPORTED_SHARED) +run_property_tests(symbol_export_target properties) + +# `ENABLE_EXPORTS` has a more complicated initialization. +set(properties + # property expected alias + # Linking properties + "ENABLE_EXPORTS" "OFF" "<SAME>" + ) + +prepare_target_types(executable + EXECUTABLE + IMPORTED_EXECUTABLE) +set(iteration "-ENABLE_EXPORTS") +run_property_tests(executable_target properties) + +set(with_defaults 1) + +set(CMAKE_SHARED_LIBRARY_ENABLE_EXPORTS OFF) +set(properties + # property expected alias + # Linking properties + "ENABLE_EXPORTS" "OFF" "<SAME>" + ) + +set(iteration "-SHARED_LIBRARY_ENABLE_EXPORTS") +run_property_tests(shared_library_target properties) +unset(CMAKE_SHARED_LIBRARY_ENABLE_EXPORTS) + +set(CMAKE_EXECUTABLE_ENABLE_EXPORTS OFF) +set(properties + # property expected alias + # Linking properties + "ENABLE_EXPORTS" "OFF" "<SAME>" + ) + +set(iteration "-EXECUTABLE_ENABLE_EXPORTS") +run_property_tests(executable_target properties) +unset(CMAKE_EXECUTABLE_ENABLE_EXPORTS) diff --git a/Tests/RunCMake/property_init/library.c b/Tests/RunCMake/property_init/library.c new file mode 100644 index 0000000..ad6a649 --- /dev/null +++ b/Tests/RunCMake/property_init/library.c @@ -0,0 +1,4 @@ +int foo(int arg) +{ + return arg; +} diff --git a/Tests/RunCMake/property_init/main.c b/Tests/RunCMake/property_init/main.c new file mode 100644 index 0000000..14917b7 --- /dev/null +++ b/Tests/RunCMake/property_init/main.c @@ -0,0 +1,4 @@ +int main(int argc, char* argv[]) +{ + return argc - 1; +} diff --git a/Tests/RunCMake/property_init/util.cmake b/Tests/RunCMake/property_init/util.cmake new file mode 100644 index 0000000..7edc6f9 --- /dev/null +++ b/Tests/RunCMake/property_init/util.cmake @@ -0,0 +1,191 @@ +set(all_target_types + "EXECUTABLE" + + "IMPORTED_EXECUTABLE" + + "INTERFACE" + "MODULE" + "OBJECT" + "SHARED" + "STATIC" + + "IMPORTED_INTERFACE" + "IMPORTED_MODULE" + "IMPORTED_OBJECT" + "IMPORTED_SHARED" + "IMPORTED_STATIC" + + "CUSTOM") + +function (prepare_target_types name) + set("${name}" "${ARGN}" PARENT_SCOPE) + list(REMOVE_ITEM all_target_types ${ARGN}) + set("not_${name}" "${all_target_types}" PARENT_SCOPE) +endfunction () + +function (per_config variable) + prepare_properties("${property_table}" properties expected_values expected_alias) + + get_property(is_multi_config GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) + if (is_multi_config) + set(configs "${CMAKE_CONFIGURATION_TYPES}") + else () + if (NOT CMAKE_BUILD_TYPE STREQUAL "") + set(configs "${CMAKE_BUILD_TYPE}") + endif () + endif () + + foreach (property expected alias IN ZIP_LISTS expected_properties expected_values expected_alias) + if (property MATCHES "^_") + set(prepend 1) + elseif (property MATCHES "_$") + set(prepend 0) + else () + message(SEND_ERROR + "Per-config properties must have a `_` at one end of their name: '${property}'") + endif () + foreach (config IN LISTS configs) + if (prepend) + list(APPEND "${variable}" + "${config}_${property}" "${value}/${config}" "${alias}") + else () + list(APPEND "${variable}" + "${property}_${config}" "${value}/${config}" "${alias}") + endif () + endforeach () + endforeach () + + set("${variable}" "${${variable}}" PARENT_SCOPE) +endfunction () + +function (make_target name type) + if (type STREQUAL "EXECUTABLE") + add_executable("${name}") + target_sources("${name}" PRIVATE ${main_sources}) + elseif (type STREQUAL "IMPORTED_EXECUTABLE") + add_executable("${name}" IMPORTED) + set_property(TARGET "${name}" PROPERTY IMPORTED_LOCATION "${CMAKE_COMMAND}") + elseif (type STREQUAL "CUSTOM") + add_custom_target("${name}" COMMAND "${CMAKE_EXECUTABLE}" -E echo "${name}") + elseif (type MATCHES "IMPORTED_") + string(REPLACE "IMPORTED_" "" type "${type}") + add_library("${name}" IMPORTED ${type}) + if (NOT type STREQUAL "INTERFACE") + set_property(TARGET "${name}" PROPERTY IMPORTED_LOCATION "${default_library_location}") + endif () + else () + add_library("${name}" ${type}) + target_sources("${name}" PRIVATE ${library_sources}) + endif () + + if (type MATCHES "EXECUTABLE") + add_executable("alias::${name}" ALIAS "${name}") + elseif (NOT type STREQUAL "CUSTOM") + add_library("alias::${name}" ALIAS "${name}") + endif () +endfunction () + +function (check_property target property expected) + if (NOT TARGET "${target}") + message(SEND_ERROR + "No such target '${target}'") + return () + endif () + + get_property(is_set TARGET "${target}" PROPERTY "${property}" SET) + if (is_set) + get_property(actual TARGET "${target}" PROPERTY "${property}") + endif () + if (expected STREQUAL "<UNSET>") + if (is_set) + message(SEND_ERROR + "Target '${target}' should not have '${property}' set at all, but is '${actual}'") + endif () + elseif (is_set AND NOT expected STREQUAL actual) + message(SEND_ERROR + "Target '${target}' should have '${property}' set to '${expected}', but is '${actual}'") + elseif (NOT is_set) + message(SEND_ERROR + "Target '${target}' should have '${property}' set to '${expected}', but is not set at all") + endif () +endfunction () + +function (prepare_properties table output_properties output_expected output_alias) + set(_properties) + set(_expected) + set(_alias) + + set(variable "_properties") + foreach (item IN LISTS "${table}") + list(APPEND "${variable}" "${item}") + if (variable STREQUAL "_properties") + set(variable "_expected") + elseif (variable STREQUAL "_expected") + set(variable "_alias") + elseif (variable STREQUAL "_alias") + set(variable "_properties") + else () + message(FATAL_ERROR + "Failed to track property table parsing") + endif () + endforeach () + if (NOT variable STREQUAL "_properties") + message(FATAL_ERROR + "Table does not have a multiple of 3 items") + endif () + + set("${output_properties}" "${_properties}" PARENT_SCOPE) + set("${output_expected}" "${_expected}" PARENT_SCOPE) + set("${output_alias}" "${_alias}" PARENT_SCOPE) +endfunction () + +# Contextual variables: +# iteration: make unique target names +# with_defaults: if set, do not set variables, but instead test internal +# default calculations +function (run_property_tests applied_types property_table) + prepare_properties("${property_table}" expected_properties expected_values expected_alias) + + if (NOT with_defaults) + foreach (property expected IN ZIP_LISTS expected_properties expected_values) + string(REPLACE "<SEMI>" ";" expected "${expected}") + set("CMAKE_${property}" "${expected}") + endforeach () + endif () + + foreach (target_type IN LISTS "${applied_types}") + set(target_name "${RunCMake_TEST}${iteration}-${target_type}") + if (with_defaults) + string(APPEND target_name "-defaults") + endif () + make_target("${target_name}" "${target_type}") + foreach (property expected alias IN ZIP_LISTS expected_properties expected_values expected_alias) + string(REPLACE "<SEMI>" ";" expected "${expected}") + check_property("${target_name}" "${property}" "${expected}") + if (NOT target_type STREQUAL "CUSTOM") + if (alias STREQUAL "<SAME>") + check_property("alias::${target_name}" "${property}" "${expected}") + elseif (alias STREQUAL "<UNSET>") + check_property("alias::${target_name}" "${property}" "<UNSET>") + else () + message(FATAL_ERROR + "Invalid `alias` entry for property '${property}': '${alias}'") + endif () + endif () + endforeach () + endforeach () + + foreach (target_type IN LISTS "not_${applied_types}") + set(target_name "${RunCMake_TEST}${iteration}-${target_type}-unset") + if (with_defaults) + string(APPEND target_name "-defaults") + endif () + make_target("${target_name}" "${target_type}") + foreach (property IN LISTS expected_properties) + check_property("${target_name}" "${property}" "<UNSET>") + if (NOT target_type STREQUAL "CUSTOM") + check_property("alias::${target_name}" "${property}" "<UNSET>") + endif () + endforeach () + endforeach () +endfunction () diff --git a/Tests/RunCMake/target_link_libraries-ALIAS/AliasTargets.cmake b/Tests/RunCMake/target_link_libraries-ALIAS/AliasTargets.cmake index 4a0f068..65c708c 100644 --- a/Tests/RunCMake/target_link_libraries-ALIAS/AliasTargets.cmake +++ b/Tests/RunCMake/target_link_libraries-ALIAS/AliasTargets.cmake @@ -14,8 +14,14 @@ set_property(TARGET import-local PROPERTY IMPORTED_LOCATION "${binary_dir}/${CMA set_property(TARGET import-local PROPERTY IMPORTED_IMPLIB "${binary_dir}/${CMAKE_STATIC_LIBRARY_PREFIX}func${CMAKE_IMPORT_LIBRARY_SUFFIX}") add_library(alias::local ALIAS import-local) +if(NOT DEFINED CMAKE_IMPORT_LIBRARY_SUFFIX) + add_library(import-local-stub SHARED IMPORTED) + set_property(TARGET import-local-stub PROPERTY IMPORTED_IMPLIB "${binary_dir}/${CMAKE_STATIC_LIBRARY_PREFIX}func${CMAKE_SHARED_LIBRARY_SUFFIX}") + add_library(alias::local-stub ALIAS import-local-stub) +endif() + add_library (lib-local SHARED lib.c) -target_link_libraries (lib-local PRIVATE alias::local) +target_link_libraries (lib-local PRIVATE alias::local $<TARGET_NAME_IF_EXISTS:alias::local-stub>) add_executable (main-local main.c) target_link_libraries (main-local PRIVATE alias::local) diff --git a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/RunCMakeTest.cmake b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/RunCMakeTest.cmake index 9b6581c..8e4745a 100644 --- a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/RunCMakeTest.cmake +++ b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/RunCMakeTest.cmake @@ -126,7 +126,7 @@ if ((CMAKE_SYSTEM_NAME STREQUAL "Windows" AND ((DEFINED MSVC_VERSION AND MSVC_VERSION GREATER "1900") OR (CMAKE_C_COMPILER_ID MATCHES "GNU|Clang" AND NOT CMAKE_C_SIMULATE_ID STREQUAL "MSVC"))) OR (CMAKE_SYSTEM_NAME STREQUAL "SunOS" AND (NOT CMAKE_C_COMPILER_ID STREQUAL "SunPro" OR CMAKE_C_COMPILER_VERSION GREATER "5.9")) - OR CMAKE_SYSTEM_NAME MATCHES "Darwin|iOS|tvOS|watchOS|Linux|BSD|MSYS|CYGWIN") + OR CMAKE_SYSTEM_NAME MATCHES "Darwin|iOS|tvOS|visionOS|watchOS|Linux|BSD|MSYS|CYGWIN") run_cmake(feature-WHOLE_ARCHIVE) run_cmake_target(feature-WHOLE_ARCHIVE link-exe main) endif() diff --git a/Tests/RunCMake/target_link_libraries/ImportedTargetStub.cmake b/Tests/RunCMake/target_link_libraries/ImportedTargetStub.cmake new file mode 100644 index 0000000..04f9cfb --- /dev/null +++ b/Tests/RunCMake/target_link_libraries/ImportedTargetStub.cmake @@ -0,0 +1,2 @@ +add_library(SharedStubImportedGlobal SHARED IMPORTED GLOBAL) +set_target_properties(SharedStubImportedGlobal PROPERTIES IMPORTED_IMPLIB z) diff --git a/Tests/RunCMake/target_link_libraries/RunCMakeTest.cmake b/Tests/RunCMake/target_link_libraries/RunCMakeTest.cmake index 7c5d77d..0e3877a 100644 --- a/Tests/RunCMake/target_link_libraries/RunCMakeTest.cmake +++ b/Tests/RunCMake/target_link_libraries/RunCMakeTest.cmake @@ -23,6 +23,7 @@ run_cmake(CMP0079-link-NEW-bogus) run_cmake(CMP0108-OLD-self-link) run_cmake(CMP0108-NEW-self-link) run_cmake(ImportedTarget) +run_cmake(ImportedTargetStub) run_cmake(ImportedTargetFailure) run_cmake(MixedSignature) run_cmake(Separate-PRIVATE-LINK_PRIVATE-uses) diff --git a/Tests/RunCMake/target_link_options/LINK_OPTIONS-dollar-option-check.cmake b/Tests/RunCMake/target_link_options/LINK_OPTIONS-dollar-option-check.cmake new file mode 100644 index 0000000..0f897fe --- /dev/null +++ b/Tests/RunCMake/target_link_options/LINK_OPTIONS-dollar-option-check.cmake @@ -0,0 +1,4 @@ + +if (NOT actual_stdout MATCHES "BADFLAG_\\$dollar") + set (RunCMake_TEST_FAILED "Not found expected 'BADFLAG_$dollar'.") +endif() diff --git a/Tests/RunCMake/target_link_options/LINK_OPTIONS-dollar-option-result.txt b/Tests/RunCMake/target_link_options/LINK_OPTIONS-dollar-option-result.txt new file mode 100644 index 0000000..8d98f9d --- /dev/null +++ b/Tests/RunCMake/target_link_options/LINK_OPTIONS-dollar-option-result.txt @@ -0,0 +1 @@ +.* diff --git a/Tests/RunCMake/target_link_options/LINK_OPTIONS.cmake b/Tests/RunCMake/target_link_options/LINK_OPTIONS.cmake index bb04841..879151b 100644 --- a/Tests/RunCMake/target_link_options/LINK_OPTIONS.cmake +++ b/Tests/RunCMake/target_link_options/LINK_OPTIONS.cmake @@ -53,3 +53,7 @@ target_link_options(LinkOptions_mod PRIVATE $<$<CONFIG:Release>:${pre}BADFLAG_RE # executable with generator expression add_executable(LinkOptions_exe LinkOptionsExe.c) target_link_options(LinkOptions_exe PRIVATE $<$<CONFIG:Release>:${pre}BADFLAG_RELEASE${obj}>) + +# executable with dollar character +add_executable(LinkOptions_dollar_exe LinkOptionsExe.c) +target_link_options(LinkOptions_dollar_exe PRIVATE "${pre}BADFLAG_$dollar${obj}") diff --git a/Tests/RunCMake/target_link_options/RunCMakeTest.cmake b/Tests/RunCMake/target_link_options/RunCMakeTest.cmake index 1a29ecf..ff0c5a8 100644 --- a/Tests/RunCMake/target_link_options/RunCMakeTest.cmake +++ b/Tests/RunCMake/target_link_options/RunCMakeTest.cmake @@ -30,7 +30,7 @@ if (NOT CMAKE_C_COMPILER_ID STREQUAL "Intel") run_cmake_target(LINK_OPTIONS shared LinkOptions_shared --config Release) run_cmake_target(LINK_OPTIONS mod LinkOptions_mod --config Release) run_cmake_target(LINK_OPTIONS exe LinkOptions_exe --config Release) - + run_cmake_target(LINK_OPTIONS dollar-option LinkOptions_dollar_exe --config Release) run_cmake(genex_LINK_LANGUAGE) diff --git a/Tests/RunCMake/target_sources/FileSetAbsoluteInstallIncludeDirExport.cmake b/Tests/RunCMake/target_sources/FileSetAbsoluteInstallIncludeDirExport.cmake new file mode 100644 index 0000000..f049d91 --- /dev/null +++ b/Tests/RunCMake/target_sources/FileSetAbsoluteInstallIncludeDirExport.cmake @@ -0,0 +1,16 @@ +enable_language(C) + +# According to https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html#module:GNUInstallDirs +# relative CMAKE_INSTALL_<dir> are encouraged, but absolute path's are also allowed. +# Construct an absolute CMAKE_INSTALL_INCLUDEDIR. +set(CMAKE_INSTALL_INCLUDEDIR "${CMAKE_INSTALL_PREFIX}/include") + +add_library(lib1) +target_sources(lib1 + PRIVATE lib1.c + PUBLIC FILE_SET HEADERS BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR} FILES h1.h) +# Expect install(TARGETS) to respect absolute CMAKE_INSTALL_INCLUDEDIR +# when installing the HEADERS. +# Must not prepend the CMAKE_INSTALL_PREFIX in the <pkg>-config.cmake. +install(TARGETS lib1 EXPORT lib1-config FILE_SET HEADERS) +install(EXPORT lib1-config NAMESPACE lib1:: DESTINATION share/lib1) diff --git a/Tests/RunCMake/target_sources/FileSetAbsoluteInstallIncludeDirImport.cmake b/Tests/RunCMake/target_sources/FileSetAbsoluteInstallIncludeDirImport.cmake new file mode 100644 index 0000000..123d6ae --- /dev/null +++ b/Tests/RunCMake/target_sources/FileSetAbsoluteInstallIncludeDirImport.cmake @@ -0,0 +1,9 @@ +enable_language(CXX) + +get_filename_component(CMAKE_PREFIX_PATH "${CMAKE_BINARY_DIR}" DIRECTORY) +string(APPEND CMAKE_PREFIX_PATH "/FileSetAbsoluteInstallIncludeDirExport-build/install") + +find_package(lib1 REQUIRED) + +add_executable(exe main.cpp) +target_link_libraries(exe PRIVATE lib1::lib1) diff --git a/Tests/RunCMake/target_sources/FileSetDefaultWrongTypeExperimental.cmake b/Tests/RunCMake/target_sources/FileSetDefaultWrongTypeExperimental.cmake index 44f1626..84e1802 100644 --- a/Tests/RunCMake/target_sources/FileSetDefaultWrongTypeExperimental.cmake +++ b/Tests/RunCMake/target_sources/FileSetDefaultWrongTypeExperimental.cmake @@ -1,6 +1,6 @@ enable_language(C) -set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "aa1f7df0-828a-4fcd-9afc-2dc80491aca7") +set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "bf70d4b0-9fb7-465c-9803-34014e70d112") add_library(lib1 STATIC empty.c) target_sources(lib1 PRIVATE FILE_SET UNKNOWN) diff --git a/Tests/RunCMake/target_sources/FileSetWrongTypeExperimental.cmake b/Tests/RunCMake/target_sources/FileSetWrongTypeExperimental.cmake index adf1185..78e782d 100644 --- a/Tests/RunCMake/target_sources/FileSetWrongTypeExperimental.cmake +++ b/Tests/RunCMake/target_sources/FileSetWrongTypeExperimental.cmake @@ -1,6 +1,6 @@ enable_language(C) -set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "aa1f7df0-828a-4fcd-9afc-2dc80491aca7") +set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "bf70d4b0-9fb7-465c-9803-34014e70d112") add_library(lib1 STATIC empty.c) target_sources(lib1 PRIVATE FILE_SET a TYPE UNKNOWN) diff --git a/Tests/RunCMake/target_sources/RunCMakeTest.cmake b/Tests/RunCMake/target_sources/RunCMakeTest.cmake index 90915cd..8505f71 100644 --- a/Tests/RunCMake/target_sources/RunCMakeTest.cmake +++ b/Tests/RunCMake/target_sources/RunCMakeTest.cmake @@ -99,3 +99,4 @@ function(run_export_import name) endfunction() run_export_import(FileSet) +run_export_import(FileSetAbsoluteInstallIncludeDir) diff --git a/Tests/SourceGroups/CMakeLists.txt b/Tests/SourceGroups/CMakeLists.txt index d726395..550fe9e 100644 --- a/Tests/SourceGroups/CMakeLists.txt +++ b/Tests/SourceGroups/CMakeLists.txt @@ -63,3 +63,5 @@ add_executable(SourceGroups main.c bar.c foo.c sub1/foo.c sub1/foobar.c baz.c ${tree_files_with_prefix} ${tree_files_without_prefix} ${tree_files_with_empty_prefix} README.txt nested.c) + +add_subdirectory(sub2) diff --git a/Tests/SourceGroups/sub2/CMakeLists.txt b/Tests/SourceGroups/sub2/CMakeLists.txt new file mode 100644 index 0000000..e457bc4 --- /dev/null +++ b/Tests/SourceGroups/sub2/CMakeLists.txt @@ -0,0 +1,4 @@ +add_executable(SourceGroups2 main.c + qux.c subsub/qax.c) + +source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" ) #PREFIX TheSubDir2 ) diff --git a/Tests/SourceGroups/sub2/main.c b/Tests/SourceGroups/sub2/main.c new file mode 100644 index 0000000..4cd8ae0 --- /dev/null +++ b/Tests/SourceGroups/sub2/main.c @@ -0,0 +1,11 @@ +#include <stdio.h> + +extern int qax(void); +extern int qux(void); + +int main() +{ + printf("qux: %d qax: %d\n", qux(), qax()); + + return 0; +} diff --git a/Tests/SourceGroups/sub2/qux.c b/Tests/SourceGroups/sub2/qux.c new file mode 100644 index 0000000..1a8b6f9 --- /dev/null +++ b/Tests/SourceGroups/sub2/qux.c @@ -0,0 +1,4 @@ +int qux(void) +{ + return 1234; +} diff --git a/Tests/SourceGroups/sub2/subsub/qax.c b/Tests/SourceGroups/sub2/subsub/qax.c new file mode 100644 index 0000000..c1b1042 --- /dev/null +++ b/Tests/SourceGroups/sub2/subsub/qax.c @@ -0,0 +1,4 @@ +int qax(void) +{ + return 123; +} diff --git a/Tests/UseSWIG/AlternateLibraryName/CMakeLists.txt b/Tests/UseSWIG/AlternateLibraryName/CMakeLists.txt index a2c239c..f20593c 100644 --- a/Tests/UseSWIG/AlternateLibraryName/CMakeLists.txt +++ b/Tests/UseSWIG/AlternateLibraryName/CMakeLists.txt @@ -7,7 +7,7 @@ include(CTest) find_package(SWIG REQUIRED) include(${SWIG_USE_FILE}) -find_package(Python2 REQUIRED COMPONENTS Interpreter Development) +find_package(Python REQUIRED COMPONENTS Interpreter Development) # Path separator if (WIN32) @@ -27,9 +27,9 @@ swig_add_library(example_python set_target_properties (example_python PROPERTIES INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/.." SWIG_USE_TARGET_INCLUDE_DIRECTORIES TRUE) -target_link_libraries(example_python PRIVATE Python2::Python) +target_link_libraries(example_python PRIVATE Python::Python) add_test (NAME AlternateLibraryName.example1 COMMAND "${CMAKE_COMMAND}" -E env "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}${PS}$<TARGET_FILE_DIR:example_python>" - "${Python2_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/../runme.py") + "${Python_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/../runme.py") diff --git a/Tests/UseSWIG/CMakeLists.txt b/Tests/UseSWIG/CMakeLists.txt index 7c4925e..3d80270 100644 --- a/Tests/UseSWIG/CMakeLists.txt +++ b/Tests/UseSWIG/CMakeLists.txt @@ -147,16 +147,18 @@ add_test(NAME UseSWIG.MultipleModules COMMAND --build-options ${build_options} --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> ) -add_test(NAME UseSWIG.MultiplePython COMMAND - ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> - --build-and-test - "${CMake_SOURCE_DIR}/Tests/UseSWIG/MultiplePython" - "${CMake_BINARY_DIR}/Tests/UseSWIG/MultiplePython" - ${build_generator_args} - --build-project TestMultiplePython - --build-options ${build_options} - --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> +if(CMake_TEST_FindPython2 AND CMake_TEST_FindPython3) + add_test(NAME UseSWIG.MultiplePython COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/UseSWIG/MultiplePython" + "${CMake_BINARY_DIR}/Tests/UseSWIG/MultiplePython" + ${build_generator_args} + --build-project TestMultiplePython + --build-options ${build_options} + --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> ) +endif() add_test(NAME UseSWIG.MultipleFiles COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> --build-and-test @@ -165,20 +167,20 @@ add_test(NAME UseSWIG.MultipleFiles COMMAND ${build_generator_args} --build-project TestMultipleFiles --build-options ${build_options} - ) - +) -add_test(NAME UseSWIG.ModuleVersion2 COMMAND - ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> - --build-and-test - "${CMake_SOURCE_DIR}/Tests/UseSWIG/ModuleVersion2" - "${CMake_BINARY_DIR}/Tests/UseSWIG/ModuleVersion2" - ${build_generator_args} - --build-project TestModuleVersion2 - --build-options ${build_options} - --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> +if(CMake_TEST_FindPython2 OR CMake_TEST_FindPython3) + add_test(NAME UseSWIG.ModuleVersion2 COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/UseSWIG/ModuleVersion2" + "${CMake_BINARY_DIR}/Tests/UseSWIG/ModuleVersion2" + ${build_generator_args} + --build-project TestModuleVersion2 + --build-options ${build_options} + --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> ) - +endif() add_test(NAME UseSWIG.UseTargetINCLUDE_DIRECTORIES COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> diff --git a/Tests/UseSWIG/ModuleName/CMakeLists.txt b/Tests/UseSWIG/ModuleName/CMakeLists.txt index 435b441..c62319f 100644 --- a/Tests/UseSWIG/ModuleName/CMakeLists.txt +++ b/Tests/UseSWIG/ModuleName/CMakeLists.txt @@ -8,14 +8,7 @@ find_package(SWIG REQUIRED) cmake_policy(SET CMP0086 NEW) include(${SWIG_USE_FILE}) -find_package(Python2 REQUIRED COMPONENTS Interpreter Development) - -# Path separator -if (WIN32) - set (PS "$<SEMICOLON>") -else() - set (PS ":") -endif() +find_package(Python REQUIRED COMPONENTS Interpreter Development) unset(CMAKE_SWIG_FLAGS) @@ -34,9 +27,9 @@ set_target_properties (example1 PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/example1" ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/example1" RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/example1") -target_link_libraries(example1 PRIVATE Python2::Module) +target_link_libraries(example1 PRIVATE Python::Module) add_test (NAME ModuleName.example1 - COMMAND "${CMAKE_COMMAND}" -E env "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}/Python2${PS}$<TARGET_FILE_DIR:example1>" - "${Python2_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/runme.py") + COMMAND "${CMAKE_COMMAND}" -E env "PYTHONPATH=$<TARGET_FILE_DIR:example1>" + "${Python_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/runme.py") diff --git a/Tests/UseSWIG/ModuleVersion2/CMakeLists.txt b/Tests/UseSWIG/ModuleVersion2/CMakeLists.txt index 093e858..317ed47 100644 --- a/Tests/UseSWIG/ModuleVersion2/CMakeLists.txt +++ b/Tests/UseSWIG/ModuleVersion2/CMakeLists.txt @@ -7,9 +7,6 @@ include(CTest) find_package(SWIG REQUIRED) include(${SWIG_USE_FILE}) -find_package(Python2 REQUIRED COMPONENTS Interpreter Development) -find_package(Python3 REQUIRED COMPONENTS Interpreter Development) - if (WIN32) set (PS $<SEMICOLON>) else() @@ -25,32 +22,69 @@ set_property(SOURCE "../example.i" PROPERTY COMPILE_OPTIONS -includeall) set_property(SOURCE "../example.i" PROPERTY GENERATED_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/..") -swig_add_library(example1 - LANGUAGE python - SOURCES ../example.i ../example.cxx) -set_target_properties (example1 PROPERTIES - OUTPUT_NAME example - LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Python2" - ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Python2" - RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Python2") -target_link_libraries(example1 PRIVATE Python2::Module) - -# re-use sample interface file for another plugin -swig_add_library(example2 - LANGUAGE python - SOURCES ../example.i ../example.cxx) -set_target_properties (example2 PROPERTIES - OUTPUT_NAME example - LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Python3" - ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Python3" - RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Python3") -target_link_libraries(example2 PRIVATE Python3::Module) - - -add_test (NAME ModuleVersion2.example1 - COMMAND "${CMAKE_COMMAND}" -E env "PYTHONPATH=$<TARGET_PROPERTY:example1,SWIG_SUPPORT_FILES_DIRECTORY>${PS}$<TARGET_FILE_DIR:example1>" - "${Python2_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/../runme.py") - -add_test (NAME ModuleVersion2.example2 - COMMAND "${CMAKE_COMMAND}" -E env "PYTHONPATH=$<TARGET_PROPERTY:example2,SWIG_SUPPORT_FILES_DIRECTORY>${PS}$<TARGET_FILE_DIR:example2>" - "${Python3_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/../runme.py") +if(CMake_TEST_FindPython2) + find_package(Python2 REQUIRED COMPONENTS Interpreter Development) + + swig_add_library(example1 + LANGUAGE python + SOURCES ../example.i ../example.cxx) + set_target_properties (example1 PROPERTIES + OUTPUT_NAME example + LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Python2-1" + ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Python2-1" + RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Python2-1") + target_link_libraries(example1 PRIVATE Python2::Module) + + add_test (NAME ModuleVersion2.example1 + COMMAND "${CMAKE_COMMAND}" -E env "PYTHONPATH=$<TARGET_PROPERTY:example1,SWIG_SUPPORT_FILES_DIRECTORY>${PS}$<TARGET_FILE_DIR:example1>" + "${Python2_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/../runme.py") + + # re-use sample interface file for another plugin + swig_add_library(example2 + LANGUAGE python + SOURCES ../example.i ../example.cxx) + set_target_properties (example2 PROPERTIES + OUTPUT_NAME example + LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Python2-2" + ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Python2-2" + RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Python2-2") + target_link_libraries(example2 PRIVATE Python2::Module) + + add_test (NAME ModuleVersion2.example2 + COMMAND "${CMAKE_COMMAND}" -E env "PYTHONPATH=$<TARGET_PROPERTY:example2,SWIG_SUPPORT_FILES_DIRECTORY>${PS}$<TARGET_FILE_DIR:example2>" + "${Python2_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/../runme.py") +endif() + +if(CMake_TEST_FindPython3) + find_package(Python3 REQUIRED COMPONENTS Interpreter Development) + + swig_add_library(example3 + LANGUAGE python + SOURCES ../example.i ../example.cxx) + set_target_properties (example3 PROPERTIES + OUTPUT_NAME example + LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Python3-1" + ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Python3-1" + RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Python3-1") + target_link_libraries(example3 PRIVATE Python3::Module) + + add_test (NAME ModuleVersion2.example3 + COMMAND "${CMAKE_COMMAND}" -E env "PYTHONPATH=$<TARGET_PROPERTY:example3,SWIG_SUPPORT_FILES_DIRECTORY>${PS}$<TARGET_FILE_DIR:example3>" + "${Python3_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/../runme.py") + + + # re-use sample interface file for another plugin + swig_add_library(example4 + LANGUAGE python + SOURCES ../example.i ../example.cxx) + set_target_properties (example2 PROPERTIES + OUTPUT_NAME example + LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Python3-2" + ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Python3-2" + RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Python3-2") + target_link_libraries(example4 PRIVATE Python3::Module) + + add_test (NAME ModuleVersion2.example4 + COMMAND "${CMAKE_COMMAND}" -E env "PYTHONPATH=$<TARGET_PROPERTY:example4,SWIG_SUPPORT_FILES_DIRECTORY>${PS}$<TARGET_FILE_DIR:example4>" + "${Python3_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/../runme.py") +endif() diff --git a/Tests/UseSWIG/MultipleFiles/CMakeLists.txt b/Tests/UseSWIG/MultipleFiles/CMakeLists.txt index bf3d946..36734f9 100644 --- a/Tests/UseSWIG/MultipleFiles/CMakeLists.txt +++ b/Tests/UseSWIG/MultipleFiles/CMakeLists.txt @@ -11,7 +11,7 @@ unset(SWIG_LANG_DEFINITIONS) unset(SWIG_LANG_OPTIONS) unset(SWIG_LANG_LIBRARIES) -find_package(Python3 REQUIRED COMPONENTS Development) +find_package(Python REQUIRED COMPONENTS Development) set_property(SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/add.i" PROPERTY CPLUSPLUS ON) set_property(SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/sub.i" PROPERTY CPLUSPLUS ON) @@ -27,4 +27,4 @@ swig_add_library(example "${CMAKE_CURRENT_SOURCE_DIR}/add.cxx" "${CMAKE_CURRENT_SOURCE_DIR}/sub.cxx") target_include_directories(example PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}") -target_link_libraries(example PRIVATE Python3::Module) +target_link_libraries(example PRIVATE Python::Module) diff --git a/Tests/UseSWIG/UseTargetINCLUDE_DIRECTORIES/CMakeLists.txt b/Tests/UseSWIG/UseTargetINCLUDE_DIRECTORIES/CMakeLists.txt index 80a2e16..6cdf987 100644 --- a/Tests/UseSWIG/UseTargetINCLUDE_DIRECTORIES/CMakeLists.txt +++ b/Tests/UseSWIG/UseTargetINCLUDE_DIRECTORIES/CMakeLists.txt @@ -7,7 +7,7 @@ include(CTest) find_package(SWIG REQUIRED) include(${SWIG_USE_FILE}) -find_package(Python3 REQUIRED COMPONENTS Interpreter Development) +find_package(Python REQUIRED COMPONENTS Interpreter Development) unset(CMAKE_SWIG_FLAGS) @@ -25,7 +25,7 @@ set_target_properties (example1 PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/example1" ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/example1" RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/example1") -target_link_libraries(example1 PRIVATE Python3::Module) +target_link_libraries(example1 PRIVATE Python::Module) # Check that source property override target property @@ -42,4 +42,4 @@ set_target_properties (example2 PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/example2" ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/example2" RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/example2") -target_link_libraries(example2 PRIVATE Python3::Module) +target_link_libraries(example2 PRIVATE Python::Module) diff --git a/Utilities/Doxygen/CMakeLists.txt b/Utilities/Doxygen/CMakeLists.txt index fee21b6..12b5407 100644 --- a/Utilities/Doxygen/CMakeLists.txt +++ b/Utilities/Doxygen/CMakeLists.txt @@ -3,7 +3,7 @@ if(NOT CMake_SOURCE_DIR) set(CMakeDeveloperReference_STANDALONE 1) - cmake_minimum_required(VERSION 3.13...3.25 FATAL_ERROR) + cmake_minimum_required(VERSION 3.13...3.26 FATAL_ERROR) get_filename_component(tmp "${CMAKE_CURRENT_SOURCE_DIR}" PATH) get_filename_component(CMake_SOURCE_DIR "${tmp}" PATH) include(${CMake_SOURCE_DIR}/Modules/CTestUseLaunchers.cmake) diff --git a/Utilities/IWYU/mapping.imp b/Utilities/IWYU/mapping.imp index 0f03c33..e45970d 100644 --- a/Utilities/IWYU/mapping.imp +++ b/Utilities/IWYU/mapping.imp @@ -1,4 +1,6 @@ [ + # https://github.com/include-what-you-use/include-what-you-use/blob/master/docs/IWYUMappings.md + # C++ alternatives to C standard headers { include: [ "<assert.h>", public, "<cassert>", public ] }, { include: [ "<complex.h>", public, "<ccomplex>", public ] }, @@ -30,7 +32,7 @@ { include: [ "<bits/std_abs.h>", private, "<stdlib.h>", public ] }, { include: [ "<bits/stdint-intn.h>", private, "<stdint.h>", public ] }, { include: [ "<bits/stdint-uintn.h>", private, "<stdint.h>", public ] }, - { include: [ "<bits/string_view.tcc>", private, "<string_view>", private ] }, + { include: [ "<bits/string_view.tcc>", private, "<string_view>", public ] }, { include: [ "<bits/time.h>", private, "<time.h>", public ] }, { include: [ "<bits/types/clock_t.h>", private, "<time.h>", public ] }, { include: [ "<bits/types/mbstate_t.h>", private, "<wchar.h>", public ] }, @@ -41,70 +43,16 @@ # HACK: check whether this can be removed with next iwyu release. { symbol: [ "__GLIBC__", private, "<stdlib.h>", public ] }, - { symbol: [ "_Noreturn", private, "<stdlib.h>", public ] }, # HACK: iwyu wrongly thinks that including <iosfwd> is sufficient. { symbol: [ "std::stringstream", private, "<sstream>", public ] }, { symbol: [ "std::istringstream", private, "<sstream>", public ] }, { symbol: [ "std::ostringstream", private, "<sstream>", public ] }, - # HACK: iwyu suggests <ext/alloc_traits.h> and <memory> each time vector[] is used. - # https://github.com/include-what-you-use/include-what-you-use/issues/166 - { include: [ "<ext/alloc_traits.h>", private, "<vector>", public ] }, - { symbol: [ "std::allocator_traits<std::allocator<cmFileLock> >::value_type", private, "<vector>", public ] }, - { symbol: [ "std::allocator_traits<std::allocator<cmFileLockPool::ScopePool> >::value_type", private, "<vector>", public ] }, - { symbol: [ "std::allocator_traits<std::allocator<cmComputeComponentGraph::TarjanEntry> >::value_type", private, "<vector>", public ] }, - { symbol: [ "std::allocator_traits<std::allocator<cmFortranFile> >::value_type", private, "<vector>", public ] }, - { symbol: [ "std::allocator_traits<std::allocator<cmGraphEdgeList> >::value_type", private, "<vector>", public ] }, - { symbol: [ "std::allocator_traits<std::allocator<cmOrderDirectories::ConflictList> >::value_type", private, "<vector>", public ] }, - { symbol: [ "std::allocator_traits<std::allocator<cmStateSnapshot> >::value_type", private, "<vector>", public ] }, - { symbol: [ "std::allocator_traits<std::allocator<std::basic_string<char> > >::value_type", private, "<vector>", public ] }, - { symbol: [ "std::allocator_traits<std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >::value_type", private, "<vector>", public ] }, - { symbol: [ "std::allocator_traits<std::allocator<std::vector<std::basic_string<char>, std::allocator<std::basic_string<char> > > > >::value_type", private, "<vector>", public ] }, - { symbol: [ "std::allocator_traits<std::allocator<std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > >::value_type", private, "<vector>", public ] }, - { symbol: [ "std::allocator_traits<std::allocator<uv_stdio_container_s> >::value_type", private, "<vector>", public ] }, - - # TODO: enable this block and remove some <utility> includes? - #{ symbol: [ "std::pair", private, "<utility>", public ] }, - #{ symbol: [ "std::pair", private, "<map>", public ] }, - #{ symbol: [ "std::pair", private, "<set>", public ] }, - - # HACK: iwyu wrongly thinks that <system_error> is needed for std::hash - { symbol: [ "std::hash", private, "<functional>", public ] }, - - # HACK: iwyu thinks we use a libstdc++ private type - { symbol: [ "__gnu_cxx::size_t", private, "<cstddef>", public ] }, - - # __decay_and_strip is used internally in the C++11 standard library. - # IWYU does not classify it as internal and suggests to add <type_traits>. - # To ignore it, we simply map it to a file that is included anyway. - # Use 'CMake_IWYU_VERBOSE' to see the fully qualified names that need this. - # TODO: Can this be simplified with an @-expression? - #{ symbol: [ "@std::__decay_and_strip<.*>::__type", private, "\"cmConfigure.h\"", public ] }, - { symbol: [ "std::__decay_and_strip<int>::__type", private, "\"cmConfigure.h\"", public ] }, - { symbol: [ "std::__decay_and_strip<bool>::__type", private, "\"cmConfigure.h\"", public ] }, - { symbol: [ "std::__decay_and_strip<char const (&)[1]>::__type", private, "\"cmConfigure.h\"", public ] }, - { symbol: [ "std::__decay_and_strip<cmCommand *&>::__type", private, "\"cmConfigure.h\"", public ] }, - { symbol: [ "std::__decay_and_strip<cmGeneratorTarget *&>::__type", private, "\"cmConfigure.h\"", public ] }, - { symbol: [ "std::__decay_and_strip<cmFindCommon::PathLabel &>::__type", private, "\"cmConfigure.h\"", public ] }, - { symbol: [ "std::__decay_and_strip<cmSearchPath>::__type", private, "\"cmConfigure.h\"", public ] }, - { symbol: [ "std::__decay_and_strip<cm::string_view>::__type", private, "\"cmConfigure.h\"", public ] }, - { symbol: [ "std::__decay_and_strip<std::basic_string<char> &>::__type", private, "\"cmConfigure.h\"", public ] }, - { symbol: [ "std::__decay_and_strip<const std::basic_string<char> &>::__type", private, "\"cmConfigure.h\"", public ] }, - { symbol: [ "std::__decay_and_strip<cmFindPackageCommand::PathLabel &>::__type", private, "\"cmConfigure.h\"", public ] }, - { symbol: [ "std::__decay_and_strip<cmGlobalNinjaGenerator::TargetAlias &>::__type", private, "\"cmConfigure.h\"", public ] }, - { symbol: [ "std::__decay_and_strip<__gnu_cxx::__normal_iterator<const cmCTestTestHandler::cmCTestTestProperties *, std::vector<cmCTestTestHandler::cmCTestTestProperties, std::allocator<cmCTestTestHandler::cmCTestTestProperties> > > &>::__type", private, "\"cmConfigure.h\"", public ] }, - { symbol: [ "std::__decay_and_strip<const __gnu_cxx::__normal_iterator<std::pair<cm::string_view, std::function<void (ArgumentParser::Instance &)> > *, std::vector<std::pair<cm::string_view, std::function<void (ArgumentParser::Instance &)> >, std::allocator<std::pair<cm::string_view, std::function<void (ArgumentParser::Instance &)> > > > > &>::__type", private, "\"cmConfigure.h\"", public ] }, - { symbol: [ "std::__success_type<std::chrono::duration<double, std::ratio<1, 1> > >::type", private, "\"cmConfigure.h\"", public ] }, - { symbol: [ "std::__success_type<std::chrono::duration<long, std::ratio<1, 1000000000> > >::type", private, "\"cmConfigure.h\"", public ] }, - { symbol: [ "std::enable_if<true, std::chrono::duration<long, std::ratio<1, 1> > >::type", private, "\"cmConfigure.h\"", public ] }, - { symbol: [ "std::enable_if<true, std::chrono::duration<long, std::ratio<60, 1> > >::type", private, "\"cmConfigure.h\"", public ] }, - { symbol: [ "std::enable_if<true, std::chrono::duration<long, std::ratio<1, 1000> > >::type", private, "\"cmConfigure.h\"", public ] }, - { symbol: [ "__gnu_cxx::__enable_if<true, bool>::__type", private, "\"cmConfigure.h\"", public ] }, - { symbol: [ "std::remove_reference<std::basic_string<char, std::char_traits<char>, std::allocator<char> > &>::type", private, "\"cmConfigure.h\"", public ] }, - { symbol: [ "std::remove_reference<cmCTestTestHandler::Signal &>::type", private, "\"cmConfigure.h\"", public ] }, - { symbol: [ "std::remove_reference<Defer &>::type", private, "\"cmConfigure.h\"", public ] }, - { symbol: [ "std::remove_reference<dap::StoppedEvent &>::type", private, "\"cmConfigure.h\"", public ] }, + # HACK: iwyu attributes vector's usage of std::max to its caller. + # https://github.com/include-what-you-use/include-what-you-use/issues/908 + { symbol: ["std::max", "private", "<algorithm>", "public" ] }, + { symbol: ["std::max", "private", "<vector>", "public" ] }, # Wrappers for 3rd-party libraries { include: [ "@<.*curl/curlver.h>", private, "<cm3p/curl/curl.h>", public ] }, @@ -127,10 +75,10 @@ { include: [ "<ostream>", public, "\"cmsys/FStream.hxx\"", public ] }, { include: [ "<fstream>", public, "\"cmsys/FStream.hxx\"", public ] }, - { include: [ "<filesystem>", private, "<cm/filesystem>", public ] }, - { include: [ "<optional>", private, "<cm/optional>", public ] }, - { include: [ "<shared_mutex>", private, "<cm/shared_mutex>", public ] }, - { include: [ "<string_view>", private, "<cm/string_view>", public ] }, + { include: [ "<filesystem>", public, "<cm/filesystem>", public ] }, + { include: [ "<optional>", public, "<cm/optional>", public ] }, + { include: [ "<shared_mutex>", public, "<cm/shared_mutex>", public ] }, + { include: [ "<string_view>", public, "<cm/string_view>", public ] }, # major and minor are used as macro arguments. Those are false matches. { symbol: [ "major", private, "\"cmVersion.h\"", public ] }, diff --git a/Utilities/Sphinx/CMakeLists.txt b/Utilities/Sphinx/CMakeLists.txt index bde6c6b..694ba3c 100644 --- a/Utilities/Sphinx/CMakeLists.txt +++ b/Utilities/Sphinx/CMakeLists.txt @@ -3,7 +3,7 @@ if(NOT CMake_SOURCE_DIR) set(CMakeHelp_STANDALONE 1) - cmake_minimum_required(VERSION 3.13...3.25 FATAL_ERROR) + cmake_minimum_required(VERSION 3.13...3.26 FATAL_ERROR) get_filename_component(tmp "${CMAKE_CURRENT_SOURCE_DIR}" PATH) get_filename_component(CMake_SOURCE_DIR "${tmp}" PATH) include(${CMake_SOURCE_DIR}/Modules/CTestUseLaunchers.cmake) diff --git a/Utilities/cmbzip2/CMakeLists.txt b/Utilities/cmbzip2/CMakeLists.txt index 1d7b265..b52358e 100644 --- a/Utilities/cmbzip2/CMakeLists.txt +++ b/Utilities/cmbzip2/CMakeLists.txt @@ -19,3 +19,7 @@ endif() add_definitions(-D_FILE_OFFSET_BITS=64) add_library(cmbzip2 blocksort.c huffman.c crctable.c randtable.c compress.c decompress.c bzlib.c) + +if(WIN32 AND CMake_BUILD_PCH) + target_precompile_headers(cmbzip2 PRIVATE "bzlib.h") +endif() diff --git a/Utilities/cmcppdap/CMakeLists.txt b/Utilities/cmcppdap/CMakeLists.txt index b6841f1..fe48132 100644 --- a/Utilities/cmcppdap/CMakeLists.txt +++ b/Utilities/cmcppdap/CMakeLists.txt @@ -37,4 +37,8 @@ if(CMake_HAVE_CXX_ATOMIC_LIB) target_link_libraries(cmcppdap PRIVATE atomic) endif() +if(CMake_BUILD_PCH) + target_precompile_headers(cmcppdap PRIVATE "include/dap/protocol.h") +endif() + install(FILES NOTICE DESTINATION ${CMAKE_DOC_DIR}/cmcppdap) diff --git a/Utilities/cmcurl/lib/CMakeLists.txt b/Utilities/cmcurl/lib/CMakeLists.txt index f1d0f76..ba75420 100644 --- a/Utilities/cmcurl/lib/CMakeLists.txt +++ b/Utilities/cmcurl/lib/CMakeLists.txt @@ -110,6 +110,10 @@ set_target_properties(${LIB_NAME} PROPERTIES OUTPUT_NAME ${LIBCURL_OUTPUT_NAME} ) +if(WIN32 AND CMake_BUILD_PCH) + target_precompile_headers(${LIB_NAME} PRIVATE "curl_setup.h" "curl_sspi.h" "${CURL_SOURCE_DIR}/include/curl/curl.h") +endif() + if(0) # This code not needed for building within CMake. if(CMAKE_SYSTEM_NAME STREQUAL "AIX" OR CMAKE_SYSTEM_NAME STREQUAL "Linux" OR diff --git a/Utilities/cmlibarchive/libarchive/CMakeLists.txt b/Utilities/cmlibarchive/libarchive/CMakeLists.txt index bee69c2..e820853 100644 --- a/Utilities/cmlibarchive/libarchive/CMakeLists.txt +++ b/Utilities/cmlibarchive/libarchive/CMakeLists.txt @@ -246,6 +246,10 @@ ENDIF() ADD_LIBRARY(cmlibarchive STATIC ${libarchive_SOURCES} ${include_HEADERS}) TARGET_LINK_LIBRARIES(cmlibarchive ${ADDITIONAL_LIBS}) +if(WIN32 AND CMake_BUILD_PCH) + target_precompile_headers(cmlibarchive PRIVATE "archive_platform.h" "archive_entry.h" "<cm3p/bzlib.h>") +endif() + IF(0) # CMake does not build libarchive's full package. # Libarchive is a shared library ADD_LIBRARY(archive SHARED ${libarchive_SOURCES} ${include_HEADERS}) diff --git a/Utilities/cmliblzma/CMakeLists.txt b/Utilities/cmliblzma/CMakeLists.txt index 3121fbe..3ba3ce9 100644 --- a/Utilities/cmliblzma/CMakeLists.txt +++ b/Utilities/cmliblzma/CMakeLists.txt @@ -186,4 +186,8 @@ ELSEIF((CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "LCC" SET_PROPERTY(TARGET cmliblzma PROPERTY COMPILE_FLAGS "-O0") ENDIF() +if(WIN32 AND CMake_BUILD_PCH) + target_precompile_headers(cmliblzma PRIVATE "common/mythread.h") +endif() + INSTALL(FILES COPYING DESTINATION ${CMAKE_DOC_DIR}/cmliblzma) diff --git a/Utilities/cmlibuv/CMakeLists.txt b/Utilities/cmlibuv/CMakeLists.txt index ad3d433..9df0c7f 100644 --- a/Utilities/cmlibuv/CMakeLists.txt +++ b/Utilities/cmlibuv/CMakeLists.txt @@ -365,4 +365,8 @@ add_library(cmlibuv STATIC ${uv_sources}) target_link_libraries(cmlibuv ${uv_libraries}) set_property(TARGET cmlibuv PROPERTY COMPILE_DEFINITIONS ${uv_defines}) +if(WIN32 AND CMake_BUILD_PCH) + target_precompile_headers(cmlibuv PRIVATE "include/uv.h" "src/win/internal.h") +endif() + install(FILES LICENSE DESTINATION ${CMAKE_DOC_DIR}/cmlibuv) diff --git a/Utilities/std/cmext/algorithm b/Utilities/std/cmext/algorithm index 11514fc..46377f4 100644 --- a/Utilities/std/cmext/algorithm +++ b/Utilities/std/cmext/algorithm @@ -16,6 +16,7 @@ #if defined(__SUNPRO_CC) && defined(__sparc) # include <list> +# include <string> # include <vector> #endif @@ -67,11 +68,15 @@ namespace cm { APPEND_TWO(C1, C2) \ APPEND_TWO(C2, C1) -// For now, manage only support for std::vector and std::list. -// Other sequential container support can be added if needed. +// For now, manage only support for std::vector, std::list, and +// std::basic_string. Other sequential container support can be added if +// needed. APPEND(std::vector) APPEND(std::list) +APPEND(std::basic_string) APPEND_MIX(std::vector, std::list) +APPEND_MIX(std::vector, std::basic_string) +APPEND_MIX(std::list, std::basic_string) # undef APPEND # undef APPEND_MIX diff --git a/Utilities/std/cmext/iterator b/Utilities/std/cmext/iterator index eba10dd..85a28fa 100644 --- a/Utilities/std/cmext/iterator +++ b/Utilities/std/cmext/iterator @@ -24,9 +24,18 @@ using is_input_iterator = // checks if a type is a range type: std::begin() and std::end() are supported template <typename Range> -using is_range = cm::bool_constant< - cm::is_iterator<decltype(std::begin(std::declval<const Range>()))>::value && - cm::is_iterator<decltype(std::end(std::declval<const Range>()))>::value>; +using is_range = +#if defined(_MSC_VER) && _MSC_VER < 1920 + // MS C++ is not able to evaluate complex type introspection, + // so use a simplified version + cm::bool_constant<std::is_class<Range>::value || + std::is_array<Range>::value>; +#else + cm::bool_constant< + cm::is_iterator<decltype(std::begin( + std::declval<const Range>()))>::value && + cm::is_iterator<decltype(std::end(std::declval<const Range>()))>::value>; +#endif // checks if a type is an input range type: std::begin() and std::end() are // returning an input iterator @@ -414,6 +414,7 @@ CMAKE_CXX_SOURCES="\ cmInstallTargetGenerator \ cmInstallTargetsCommand \ cmInstalledFile \ + cmJSONState \ cmLDConfigLDConfigTool \ cmLDConfigTool \ cmLinkDirectoriesCommand \ @@ -450,6 +451,7 @@ CMAKE_CXX_SOURCES="\ cmGccDepfileReader \ cmReturnCommand \ cmPlaceholderExpander \ + cmPlistParser \ cmRulePlaceholderExpander \ cmRuntimeDependencyArchive \ cmScriptGenerator \ @@ -499,6 +501,7 @@ CMAKE_CXX_SOURCES="\ cmWhileCommand \ cmWindowsRegistry \ cmWorkingDirectory \ + cmXcFramework \ cmake \ cmakemain \ cmcmd \ @@ -588,6 +591,12 @@ LIBRHASH_C_SOURCES="\ librhash/sha512.c \ " +JSONCPP_CXX_SOURCES="\ + src/lib_json/json_reader.cpp \ + src/lib_json/json_value.cpp \ + src/lib_json/json_writer.cpp \ + " + if ${cmake_system_mingw}; then LIBUV_C_SOURCES="\ src/fs-poll.c \ @@ -1091,12 +1100,6 @@ if test "${cmake_bootstrap_generator}" = "Ninja"; then cmFortranLexer \ cmFortranParser \ " - - JSONCPP_CXX_SOURCES="\ - src/lib_json/json_reader.cpp \ - src/lib_json/json_value.cpp \ - src/lib_json/json_writer.cpp \ - " else CMAKE_CXX_SOURCES="${CMAKE_CXX_SOURCES} \ cmDepends \ @@ -1110,8 +1113,6 @@ else cmMakefileUtilityTargetGenerator \ cmProcessTools \ " - - JSONCPP_CXX_SOURCES= fi # Add Cygwin-specific flags @@ -1725,12 +1726,10 @@ if test "x${bootstrap_system_librhash}" = "x"; then objs="${objs} rhash-`cmake_obj ${a}`" done fi -if test "${cmake_bootstrap_generator}" = "Ninja"; then - if test "x${bootstrap_system_jsoncpp}" = "x"; then - for a in ${JSONCPP_CXX_SOURCES}; do - objs="${objs} jsoncpp-`cmake_obj ${a}`" - done - fi +if test "x${bootstrap_system_jsoncpp}" = "x"; then + for a in ${JSONCPP_CXX_SOURCES}; do + objs="${objs} jsoncpp-`cmake_obj ${a}`" + done fi libs="" @@ -1799,17 +1798,15 @@ if test "x${bootstrap_system_librhash}" != "x"; then libs="${libs} -lrhash" fi -if test "${cmake_bootstrap_generator}" = "Ninja"; then - jsoncpp_cxx_flags= - if test "x${bootstrap_system_jsoncpp}" = "x"; then - jsoncpp_cxx_flags="${jsoncpp_cxx_flags} `cmake_escape_shell "-I${cmake_source_dir}/Utilities/cmjsoncpp/include"`" - else - if test `which pkg-config`; then - use_jsoncpp_flags="`pkg-config --cflags jsoncpp`" - cmake_cxx_flags="${cmake_cxx_flags} ${use_jsoncpp_flags}" - fi - libs="${libs} -ljsoncpp" +jsoncpp_cxx_flags= +if test "x${bootstrap_system_jsoncpp}" = "x"; then + jsoncpp_cxx_flags="${jsoncpp_cxx_flags} `cmake_escape_shell "-I${cmake_source_dir}/Utilities/cmjsoncpp/include"`" +else + if test `which pkg-config`; then + use_jsoncpp_flags="`pkg-config --cflags jsoncpp`" + cmake_cxx_flags="${cmake_cxx_flags} ${use_jsoncpp_flags}" fi + libs="${libs} -ljsoncpp" fi if test "x${cmake_ansi_cxx_flags}" != "x"; then @@ -1949,13 +1946,11 @@ if test "x${bootstrap_system_librhash}" = "x"; then write_source_rule "c" "rhash-`cmake_obj ${a}`" "${src}" "" done fi -if test "${cmake_bootstrap_generator}" = "Ninja"; then - if test "x${bootstrap_system_jsoncpp}" = "x"; then - for a in ${JSONCPP_CXX_SOURCES}; do - src=`cmake_escape_artifact "${cmake_source_dir}/Utilities/cmjsoncpp/${a}"` - write_source_rule "cxx" "jsoncpp-`cmake_obj ${a}`" "${src}" "${jsoncpp_cxx_flags}" - done - fi +if test "x${bootstrap_system_jsoncpp}" = "x"; then + for a in ${JSONCPP_CXX_SOURCES}; do + src=`cmake_escape_artifact "${cmake_source_dir}/Utilities/cmjsoncpp/${a}"` + write_source_rule "cxx" "jsoncpp-`cmake_obj ${a}`" "${src}" "${jsoncpp_cxx_flags}" + done fi if test "${cmake_bootstrap_generator}" = "Ninja"; then echo " diff --git a/cmake_uninstall.cmake.in b/cmake_uninstall.cmake.in index b5fc700..9e61b00 100644 --- a/cmake_uninstall.cmake.in +++ b/cmake_uninstall.cmake.in @@ -7,10 +7,10 @@ string(REPLACE "\n" ";" files "${files}") foreach(file ${files}) message(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"") if(EXISTS "$ENV{DESTDIR}${file}") - exec_program( - "@CMAKE_COMMAND@" ARGS "-E rm -f \"$ENV{DESTDIR}${file}\"" + execute_process( + COMMAND "@CMAKE_COMMAND@" -E rm -f "$ENV{DESTDIR}${file}" OUTPUT_VARIABLE rm_out - RETURN_VALUE rm_retval + RESULT_VARIABLE rm_retval ) if("${rm_retval}" STREQUAL 0) else() |