diff options
731 files changed, 37024 insertions, 7387 deletions
diff --git a/.clang-tidy b/.clang-tidy index 8d79b0c..dc60714 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -1,5 +1,8 @@ --- Checks: "-*,\ +bugprone-*,\ +-bugprone-macro-parentheses,\ +-bugprone-misplaced-widening-cast,\ google-readability-casting,\ misc-*,\ -misc-incorrect-roundings,\ @@ -12,7 +15,6 @@ modernize-*,\ -modernize-raw-string-literal,\ -modernize-return-braced-init-list,\ -modernize-use-auto,\ --modernize-use-default-member-init,\ -modernize-use-emplace,\ -modernize-use-equals-default,\ -modernize-use-equals-delete,\ @@ -21,15 +23,19 @@ modernize-*,\ -modernize-use-using,\ performance-*,\ -performance-inefficient-string-concatenation,\ +-performance-inefficient-vector-operation,\ readability-*,\ -readability-function-size,\ -readability-identifier-naming,\ -readability-implicit-bool-cast,\ +-readability-implicit-bool-conversion,\ -readability-inconsistent-declaration-parameter-name,\ -readability-named-parameter,\ -readability-redundant-declaration,\ --readability-redundant-member-init,\ -readability-simplify-boolean-expr,\ " HeaderFilterRegex: 'Source/cm[^/]*\.(h|hxx|cxx)$' +CheckOptions: + - key: modernize-use-default-member-init.UseAssignment + value: '1' ... diff --git a/Auxiliary/vim/syntax/cmake.vim b/Auxiliary/vim/syntax/cmake.vim index d4d0edf..b67ef06 100644 --- a/Auxiliary/vim/syntax/cmake.vim +++ b/Auxiliary/vim/syntax/cmake.vim @@ -877,6 +877,7 @@ syn keyword cmakeKWExternalProject contained \ LOG_DOWNLOAD \ LOG_INSTALL \ LOG_MERGED_STDOUTERR + \ LOG_OUTPUT_ON_FAILURE \ LOG_PATCH \ LOG_TEST \ LOG_UPDATE diff --git a/CMakeLists.txt b/CMakeLists.txt index 756e379..75a0b52 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -137,10 +137,6 @@ macro(CMAKE_HANDLE_SYSTEM_LIBRARIES) # Options have dependencies. include(CMakeDependentOption) - # Optionally use system xmlrpc. We no longer build or use it by default. - option(CTEST_USE_XMLRPC "Enable xmlrpc submission method in CTest." OFF) - mark_as_advanced(CTEST_USE_XMLRPC) - # Allow the user to enable/disable all system utility library options by # defining CMAKE_USE_SYSTEM_LIBRARIES or CMAKE_USE_SYSTEM_LIBRARY_${util}. set(UTILITIES BZIP2 CURL EXPAT FORM JSONCPP LIBARCHIVE LIBLZMA LIBRHASH LIBUV ZLIB) @@ -171,10 +167,8 @@ macro(CMAKE_HANDLE_SYSTEM_LIBRARIES) # Optionally use system utility libraries. option(CMAKE_USE_SYSTEM_LIBARCHIVE "Use system-installed libarchive" "${CMAKE_USE_SYSTEM_LIBRARY_LIBARCHIVE}") - CMAKE_DEPENDENT_OPTION(CMAKE_USE_SYSTEM_CURL "Use system-installed curl" - "${CMAKE_USE_SYSTEM_LIBRARY_CURL}" "NOT CTEST_USE_XMLRPC" ON) - CMAKE_DEPENDENT_OPTION(CMAKE_USE_SYSTEM_EXPAT "Use system-installed expat" - "${CMAKE_USE_SYSTEM_LIBRARY_EXPAT}" "NOT CTEST_USE_XMLRPC" ON) + option(CMAKE_USE_SYSTEM_CURL "Use system-installed curl" "${CMAKE_USE_SYSTEM_LIBRARY_CURL}") + option(CMAKE_USE_SYSTEM_EXPAT "Use system-installed expat" "${CMAKE_USE_SYSTEM_LIBRARY_EXPAT}") CMAKE_DEPENDENT_OPTION(CMAKE_USE_SYSTEM_ZLIB "Use system-installed zlib" "${CMAKE_USE_SYSTEM_LIBRARY_ZLIB}" "NOT CMAKE_USE_SYSTEM_LIBARCHIVE;NOT CMAKE_USE_SYSTEM_CURL" ON) CMAKE_DEPENDENT_OPTION(CMAKE_USE_SYSTEM_BZIP2 "Use system-installed bzip2" @@ -212,7 +206,7 @@ endmacro() macro(CMAKE_SETUP_TESTING) if(BUILD_TESTING) set(CMAKE_TEST_SYSTEM_LIBRARIES 0) - foreach(util CURL EXPAT XMLRPC ZLIB) + foreach(util CURL EXPAT ZLIB) if(CMAKE_USE_SYSTEM_${util}) set(CMAKE_TEST_SYSTEM_LIBRARIES 1) endif() @@ -544,7 +538,7 @@ macro (CMAKE_BUILD_UTILITIES) #--------------------------------------------------------------------- # Build jsoncpp library. if(CMAKE_USE_SYSTEM_JSONCPP) - find_package(JsonCpp) + find_package(JsonCpp 1.4.1) if(NOT JsonCpp_FOUND) message(FATAL_ERROR "CMAKE_USE_SYSTEM_JSONCPP is ON but a JsonCpp is not found!") @@ -572,18 +566,6 @@ macro (CMAKE_BUILD_UTILITIES) endif() #--------------------------------------------------------------------- - # Build XMLRPC library for CMake and CTest. - if(CTEST_USE_XMLRPC) - find_package(XMLRPC QUIET REQUIRED libwww-client) - if(NOT XMLRPC_FOUND) - message(FATAL_ERROR - "CTEST_USE_XMLRPC is ON but xmlrpc is not found!") - endif() - set(CMAKE_XMLRPC_INCLUDES ${XMLRPC_INCLUDE_DIRS}) - set(CMAKE_XMLRPC_LIBRARIES ${XMLRPC_LIBRARIES}) - endif() - - #--------------------------------------------------------------------- # Use curses? if (UNIX) if(NOT DEFINED BUILD_CursesDialog) @@ -736,7 +718,7 @@ if(NOT CMake_TEST_EXTERNAL_CMAKE) # the build tree, which is both the build and the install RPATH. if (UNIX) if( CMAKE_USE_SYSTEM_CURL OR CMAKE_USE_SYSTEM_ZLIB - OR CMAKE_USE_SYSTEM_EXPAT OR CTEST_USE_XMLRPC OR CURSES_NEED_RPATH OR QT_NEED_RPATH) + OR CMAKE_USE_SYSTEM_EXPAT OR CURSES_NEED_RPATH OR QT_NEED_RPATH) set(CMAKE_SKIP_RPATH OFF CACHE INTERNAL "CMake built with RPATH.") set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 84f6abb..7e71111 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -24,7 +24,8 @@ CMake uses `Kitware's GitLab Instance`_ to manage development and code review. To contribute patches: #. Fork the upstream `CMake Repository`_ into a personal account. -#. Run `Utilities/SetupForDevelopment.sh`_ for local configuration. +#. Run `Utilities/SetupForDevelopment.sh`_ for local git configuration. +#. See `Building CMake`_ for building CMake locally. #. See the `CMake Source Code Guide`_ for coding guidelines. #. Base all new work on the upstream ``master`` branch. Base work on the upstream ``release`` branch only if it fixes a @@ -45,6 +46,7 @@ The merge request will enter the `CMake Review Process`_ for consideration. .. _`Kitware's GitLab Instance`: https://gitlab.kitware.com .. _`CMake Repository`: https://gitlab.kitware.com/cmake/cmake .. _`Utilities/SetupForDevelopment.sh`: Utilities/SetupForDevelopment.sh +.. _`Building CMake`: README.rst#building-cmake .. _`CMake Source Code Guide`: Help/dev/source.rst .. _`commit messages`: Help/dev/review.rst#commit-messages .. _`CMake Review Process`: Help/dev/review.rst diff --git a/Copyright.txt b/Copyright.txt index c7a81b1..f236214 100644 --- a/Copyright.txt +++ b/Copyright.txt @@ -1,5 +1,5 @@ CMake - Cross Platform Makefile Generator -Copyright 2000-2018 Kitware, Inc. and Contributors +Copyright 2000-2019 Kitware, Inc. and Contributors All rights reserved. Redistribution and use in source and binary forms, with or without @@ -63,6 +63,7 @@ The following individuals and institutions are among the Contributors: * Ilya Lavrenov <ilya.lavrenov@itseez.com> * Insight Software Consortium <insightsoftwareconsortium.org> * Jan Woetzel +* Julien Schueller * Kelly Thompson <kgt@lanl.gov> * Laurent Montel <montel@kde.org> * Konstantin Podsvirov <konstantin@podsvirov.pro> @@ -72,6 +73,7 @@ The following individuals and institutions are among the Contributors: * Matthaeus G. Chajdas * Matthias Kretz <kretz@kde.org> * Matthias Maennich <matthias@maennich.net> +* Michael Hirsch, Ph.D. <www.scivision.co> * Michael Stürmer * Miguel A. Figueroa-Villanueva * Mike Jackson diff --git a/Help/command/add_compile_options.rst b/Help/command/add_compile_options.rst index fcdcfd4..43805c3 100644 --- a/Help/command/add_compile_options.rst +++ b/Help/command/add_compile_options.rst @@ -7,15 +7,12 @@ Add options to the compilation of source files. add_compile_options(<option> ...) -Adds options to the compiler command line for targets in the current -directory and below that are added after this command is invoked. -See documentation of the :prop_dir:`directory <COMPILE_OPTIONS>` and -:prop_tgt:`target <COMPILE_OPTIONS>` ``COMPILE_OPTIONS`` properties. +Adds options to the :prop_dir:`COMPILE_OPTIONS` directory property. +These options are used when compiling targets from the current +directory and below. -This command can be used to add any options, but alternative commands -exist to add preprocessor definitions (:command:`target_compile_definitions` -and :command:`add_compile_definitions`) or include directories -(:command:`target_include_directories` and :command:`include_directories`). +Arguments +^^^^^^^^^ Arguments to ``add_compile_options`` may use "generator expressions" with the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)` @@ -23,3 +20,29 @@ manual for available expressions. See the :manual:`cmake-buildsystem(7)` manual for more on defining buildsystem properties. .. include:: OPTIONS_SHELL.txt + +Example +^^^^^^^ + +Since different compilers support different options, a typical use of +this command is in a compiler-specific conditional clause: + +.. code-block:: cmake + + if (MSVC) + # warning level 4 and all warnings as errors + add_compile_options(/W4 /WX) + else() + # lots of warnings and all warnings as errors + add_compile_options(-Wall -Wextra -pedantic -Werror) + endif() + +See Also +^^^^^^^^ + +This command can be used to add any options. However, for +adding preprocessor definitions and include directories it is recommended +to use the more specific commands :command:`add_compile_definitions` +and :command:`include_directories`. + +The command :command:`target_compile_options` adds target-specific options. diff --git a/Help/command/ctest_build.rst b/Help/command/ctest_build.rst index 55bb4a3..66e1844 100644 --- a/Help/command/ctest_build.rst +++ b/Help/command/ctest_build.rst @@ -50,9 +50,7 @@ The options are: for an example. ``PROJECT_NAME <project-name>`` - Set the name of the project to build. This should correspond - to the top-level call to the :command:`project` command. - If not specified the ``CTEST_PROJECT_NAME`` variable will be checked. + Ignored. This was once used but is no longer needed. ``TARGET <target-name>`` Specify the name of a target to build. If not specified the diff --git a/Help/command/file.rst b/Help/command/file.rst index f5279c0..6e2a6dd 100644 --- a/Help/command/file.rst +++ b/Help/command/file.rst @@ -25,6 +25,8 @@ Synopsis file({`REMOVE`_ | `REMOVE_RECURSE`_ } [<files>...]) file(`MAKE_DIRECTORY`_ [<dir>...]) file({`COPY`_ | `INSTALL`_} <file>... DESTINATION <dir> [...]) + file(`SIZE`_ <filename> <out-var>) + file(`READ_SYMLINK`_ <filename> <out-var>) `Path Conversion`_ file(`RELATIVE_PATH`_ <out-var> <directory> <file>) @@ -333,6 +335,39 @@ and ``NO_SOURCE_PERMISSIONS`` is default. Installation scripts generated by the :command:`install` command use this signature (with some undocumented options for internal use). +.. _SIZE: + +.. code-block:: cmake + + file(SIZE <filename> <variable>) + +Determine the file size of the ``<filename>`` and put the result in +``<variable>`` variable. Requires that ``<filename>`` is a valid path +pointing to a file and is readable. + +.. _READ_SYMLINK: + +.. code-block:: cmake + + file(READ_SYMLINK <filename> <variable>) + +Read the symlink at ``<filename>`` and put the result in ``<variable>``. +Requires that ``<filename>`` is a valid path pointing to a symlink. If +``<filename>`` does not exist, or is not a symlink, an error is thrown. + +Note that this command returns the raw symlink path and does not resolve +relative symlinks. If you want to resolve the relative symlink yourself, you +could do something like this: + +.. code-block:: cmake + + set(filename "/path/to/foo.sym") + file(READ_SYMLINK "${filename}" result) + if(NOT IS_ABSOLUTE "${result}") + get_filename_component(dir "${filename}" DIRECTORY) + set(result "${dir}/${result}") + endif() + Path Conversion ^^^^^^^^^^^^^^^ diff --git a/Help/command/get_target_property.rst b/Help/command/get_target_property.rst index cbf4721..4327681 100644 --- a/Help/command/get_target_property.rst +++ b/Help/command/get_target_property.rst @@ -23,3 +23,5 @@ target so far created. The targets do not need to be in the current ``CMakeLists.txt`` file. See also the more general :command:`get_property` command. + +See :ref:`Target Properties` for the list of properties known to CMake. diff --git a/Help/command/install.rst b/Help/command/install.rst index 55c8485..a0e8c37 100644 --- a/Help/command/install.rst +++ b/Help/command/install.rst @@ -547,6 +547,11 @@ example, the code will print a message during installation. +``<file>`` or ``<code>`` may use "generator expressions" with the syntax +``$<...>`` (in the case of ``<file>``, this refers to their use in the file +name, not the file's contents). See the +:manual:`cmake-generator-expressions(7)` manual for available expressions. + Installing Exports ^^^^^^^^^^^^^^^^^^ diff --git a/Help/command/macro.rst b/Help/command/macro.rst index 42a99fc..05e5d79 100644 --- a/Help/command/macro.rst +++ b/Help/command/macro.rst @@ -76,16 +76,16 @@ Macro vs Function The ``macro`` command is very similar to the :command:`function` command. Nonetheless, there are a few important differences. -In a function, ``ARGC``, ``ARGC`` and ``ARGV0``, ``ARGV1``, ... are -true variables in the usual CMake sense. In a macro, they are not. -They are string replacements much like the C preprocessor would do +In a function, ``ARGN``, ``ARGC``, ``ARGV`` and ``ARGV0``, ``ARGV1``, ... +are true variables in the usual CMake sense. In a macro, they are not, +they are string replacements much like the C preprocessor would do with a macro. This has a number of consequences, as explained in the :ref:`Argument Caveats` section below. Another difference between macros and functions is the control flow. -A function is executed by transfering control from the calling +A function is executed by transferring control from the calling statement to the function body. A macro is executed as if the macro -body were pasted in place of the calling statement. This has for +body were pasted in place of the calling statement. This has the consequence that a :command:`return()` in a macro body does not just terminate execution of the macro; rather, control is returned from the scope of the macro call. To avoid confusion, it is recommended @@ -96,7 +96,7 @@ to avoid :command:`return()` in macros altogether. Argument Caveats ^^^^^^^^^^^^^^^^ -Since ``ARGC``, ``ARGC``, ``ARGV0`` etc are not variables, +Since ``ARGN``, ``ARGC``, ``ARGV``, ``ARGV0`` etc. are not variables, you will NOT be able to use commands like .. code-block:: cmake diff --git a/Help/command/target_compile_options.rst b/Help/command/target_compile_options.rst index c26c926..47e7d86 100644 --- a/Help/command/target_compile_options.rst +++ b/Help/command/target_compile_options.rst @@ -9,22 +9,18 @@ Add compile options to a target. <INTERFACE|PUBLIC|PRIVATE> [items1...] [<INTERFACE|PUBLIC|PRIVATE> [items2...] ...]) -Specifies compile options to use when compiling a given target. The -named ``<target>`` must have been created by a command such as -:command:`add_executable` or :command:`add_library` and must not be an -:ref:`ALIAS target <Alias Targets>`. +Adds options to the :prop_tgt:`COMPILE_OPTIONS` or +:prop_tgt:`INTERFACE_COMPILE_OPTIONS` target properties. These options +are used when compiling the given ``<target>``, which must have been +created by a command such as :command:`add_executable` or +:command:`add_library` and must not be an :ref:`ALIAS target <Alias Targets>`. + +Arguments +^^^^^^^^^ If ``BEFORE`` is specified, the content will be prepended to the property instead of being appended. -This command can be used to add any options, but -alternative commands exist to add preprocessor definitions -(:command:`target_compile_definitions` and :command:`add_compile_definitions`) -or include directories (:command:`target_include_directories` and -:command:`include_directories`). See documentation of the -:prop_dir:`directory <COMPILE_OPTIONS>` and -:prop_tgt:`target <COMPILE_OPTIONS>` ``COMPILE_OPTIONS`` properties. - The ``INTERFACE``, ``PUBLIC`` and ``PRIVATE`` keywords are required to specify the scope of the following arguments. ``PRIVATE`` and ``PUBLIC`` items will populate the :prop_tgt:`COMPILE_OPTIONS` property of @@ -40,3 +36,13 @@ manual for available expressions. See the :manual:`cmake-buildsystem(7)` manual for more on defining buildsystem properties. .. include:: OPTIONS_SHELL.txt + +See Also +^^^^^^^^ + +This command can be used to add any options. However, for adding +preprocessor definitions and include directories it is recommended +to use the more specific commands :command:`target_compile_definitions` +and :command:`target_include_directories`. + +For directory-wide settings, there is the command :command:`add_compile_options`. diff --git a/Help/command/try_compile.rst b/Help/command/try_compile.rst index 28caa7c..cf9e06f 100644 --- a/Help/command/try_compile.rst +++ b/Help/command/try_compile.rst @@ -33,6 +33,7 @@ Try Compiling Source Files try_compile(RESULT_VAR <bindir> <srcfile|SOURCES srcfile...> [CMAKE_FLAGS <flags>...] [COMPILE_DEFINITIONS <defs>...] + [LINK_OPTIONS <options>...] [LINK_LIBRARIES <libs>...] [OUTPUT_VARIABLE <var>] [COPY_FILE <fileName> [COPY_FILE_ERROR <var>]] @@ -55,6 +56,7 @@ the source(s) as an executable that looks something like this: include_directories(${INCLUDE_DIRECTORIES}) link_directories(${LINK_DIRECTORIES}) add_executable(cmTryCompileExec <srcfile>...) + target_link_options(cmTryCompileExec PRIVATE <LINK_OPTIONS from caller>) target_link_libraries(cmTryCompileExec ${LINK_LIBRARIES}) The options are: @@ -67,7 +69,7 @@ The options are: are used. ``COMPILE_DEFINITIONS <defs>...`` - Specify ``-Ddefinition`` arguments to pass to ``add_definitions`` + Specify ``-Ddefinition`` arguments to pass to :command:`add_definitions` in the generated test project. ``COPY_FILE <fileName>`` @@ -85,6 +87,11 @@ The options are: If this option is specified, any ``-DLINK_LIBRARIES=...`` value given to the ``CMAKE_FLAGS`` option will be ignored. +``LINK_OPTIONS <options>...`` + Specify link step options to pass to :command:`target_link_options` or + to :prop_tgt:`STATIC_LIBRARY_OPTIONS` target property in the generated + project, depending of the :variable:`CMAKE_TRY_COMPILE_TARGET_TYPE` variable. + ``OUTPUT_VARIABLE <var>`` Store the output from the build process the given variable. @@ -127,7 +134,13 @@ default values: If :policy:`CMP0056` is set to ``NEW``, then :variable:`CMAKE_EXE_LINKER_FLAGS` is passed in as well. -The current setting of :policy:`CMP0065` is set in the generated project. +If :policy:`CMP0083` is set to ``NEW``, then in order to obtain correct +behavior at link time, the ``check_pie_supported()`` command from the +:module:`CheckPIESupported` module must be called before using the +:command:`try_compile` command. + +The current settings of :policy:`CMP0065` and :policy:`CMP0083` are set in the +generated project. Set the :variable:`CMAKE_TRY_COMPILE_CONFIGURATION` variable to choose a build configuration. diff --git a/Help/command/try_run.rst b/Help/command/try_run.rst index dfa0bf9..137402f 100644 --- a/Help/command/try_run.rst +++ b/Help/command/try_run.rst @@ -15,6 +15,7 @@ Try Compiling and Running Source Files try_run(RUN_RESULT_VAR COMPILE_RESULT_VAR bindir srcfile [CMAKE_FLAGS <flags>...] [COMPILE_DEFINITIONS <defs>...] + [LINK_OPTIONS <options>...] [LINK_LIBRARIES <libs>...] [COMPILE_OUTPUT_VARIABLE <var>] [RUN_OUTPUT_VARIABLE <var>] @@ -38,7 +39,7 @@ The options are: are used. ``COMPILE_DEFINITIONS <defs>...`` - Specify ``-Ddefinition`` arguments to pass to ``add_definitions`` + Specify ``-Ddefinition`` arguments to pass to :command:`add_definitions` in the generated test project. ``COMPILE_OUTPUT_VARIABLE <var>`` @@ -52,6 +53,10 @@ The options are: If this option is specified, any ``-DLINK_LIBRARIES=...`` value given to the ``CMAKE_FLAGS`` option will be ignored. +``LINK_OPTIONS <options>...`` + Specify link step options to pass to :command:`target_link_options` in the + generated project. + ``OUTPUT_VARIABLE <var>`` Report the compile build output and the output from running the executable in the given variable. This option exists for legacy reasons. Prefer diff --git a/Help/cpack_gen/deb.rst b/Help/cpack_gen/deb.rst index fdde654..23f0515 100644 --- a/Help/cpack_gen/deb.rst +++ b/Help/cpack_gen/deb.rst @@ -15,9 +15,9 @@ better deb package when Debian specific tools ``dpkg-xxx`` are usable on the build system. The CPack DEB generator has specific features which are controlled by the -specifics :code:`CPACK_DEBIAN_XXX` variables. +specifics ``CPACK_DEBIAN_XXX`` variables. -:code:`CPACK_DEBIAN_<COMPONENT>_XXXX` variables may be used in order to have +``CPACK_DEBIAN_<COMPONENT>_XXXX`` variables may be used in order to have **component** specific values. Note however that ``<COMPONENT>`` refers to the **grouping name** written in upper case. It may be either a component name or a component GROUP name. @@ -133,8 +133,8 @@ List of CPack DEB generator specific variables: The Debian package architecture * Mandatory : YES - * Default : Output of :code:`dpkg --print-architecture` (or :code:`i386` - if :code:`dpkg` is not found) + * Default : Output of ``dpkg --print-architecture`` (or ``i386`` + if ``dpkg`` is not found) .. variable:: CPACK_DEBIAN_PACKAGE_DEPENDS CPACK_DEBIAN_<COMPONENT>_PACKAGE_DEPENDS @@ -176,7 +176,7 @@ List of CPack DEB generator specific variables: The Debian package maintainer * Mandatory : YES - * Default : :code:`CPACK_PACKAGE_CONTACT` + * Default : ``CPACK_PACKAGE_CONTACT`` .. variable:: CPACK_DEBIAN_PACKAGE_DESCRIPTION CPACK_COMPONENT_<COMPONENT>_DESCRIPTION @@ -205,18 +205,18 @@ List of CPack DEB generator specific variables: The archive format used for creating the Debian package. * Mandatory : YES - * Default : "paxr" + * Default : "gnutar" - Possible values are: + Possible value is: - - paxr - gnutar .. note:: - Default pax archive format is the most portable format and generates - packages that do not treat sparse files specially. - GNU tar format on the other hand supports longer filenames. + This variable previously defaulted to the ``paxr`` value, but ``dpkg`` + has never supported that tar format. For backwards compatibility the + ``paxr`` value will be mapped to ``gnutar`` and a deprecation message + will be emitted. .. variable:: CPACK_DEBIAN_COMPRESSION_TYPE @@ -260,7 +260,7 @@ List of CPack DEB generator specific variables: .. variable:: CPACK_DEBIAN_PACKAGE_SHLIBDEPS CPACK_DEBIAN_<COMPONENT>_PACKAGE_SHLIBDEPS - May be set to ON in order to use :code:`dpkg-shlibdeps` to generate + May be set to ON in order to use ``dpkg-shlibdeps`` to generate better package dependency list. * Mandatory : NO @@ -272,7 +272,7 @@ List of CPack DEB generator specific variables: .. note:: You may need set :variable:`CMAKE_INSTALL_RPATH` to an appropriate value - if you use this feature, because if you don't :code:`dpkg-shlibdeps` + if you use this feature, because if you don't ``dpkg-shlibdeps`` may fail to find your own shared libs. See https://gitlab.kitware.com/cmake/community/wikis/doc/cmake/RPATH-handling @@ -289,7 +289,7 @@ List of CPack DEB generator specific variables: Sets the `Pre-Depends` field of the Debian package. Like :variable:`Depends <CPACK_DEBIAN_PACKAGE_DEPENDS>`, except that it - also forces :code:`dpkg` to complete installation of the packages named + also forces ``dpkg`` to complete installation of the packages named before even starting the installation of the package which declares the pre-dependency. @@ -324,7 +324,7 @@ List of CPack DEB generator specific variables: Sets the `Breaks` field of the Debian package. When a binary package (P) declares that it breaks other packages (B), - :code:`dpkg` will not allow the package (P) which declares `Breaks` be + ``dpkg`` will not allow the package (P) which declares `Breaks` be **unpacked** unless the packages that will be broken (B) are deconfigured first. As long as the package (P) is configured, the previously deconfigured @@ -344,7 +344,7 @@ List of CPack DEB generator specific variables: Sets the `Conflicts` field of the Debian package. When one binary package declares a conflict with another using a `Conflicts` - field, :code:`dpkg` will not allow them to be unpacked on the system at + field, ``dpkg`` will not allow them to be unpacked on the system at the same time. * Mandatory : NO diff --git a/Help/cpack_gen/freebsd.rst b/Help/cpack_gen/freebsd.rst index b22ea9a..a8dd320 100644 --- a/Help/cpack_gen/freebsd.rst +++ b/Help/cpack_gen/freebsd.rst @@ -20,7 +20,7 @@ The CPack FreeBSD generator should work on any host with libpkg installed. The packages it produces are specific to the host architecture and ABI. The CPack FreeBSD generator sets package-metadata through -:code:`CPACK_FREEBSD_XXX` variables. The CPack FreeBSD generator, unlike the +``CPACK_FREEBSD_XXX`` variables. The CPack FreeBSD generator, unlike the CPack Deb generator, does not specially support componentized packages; a single package is created from all the software artifacts created through CMake. diff --git a/Help/cpack_gen/nuget.rst b/Help/cpack_gen/nuget.rst index c8c481f..f8aa626 100644 --- a/Help/cpack_gen/nuget.rst +++ b/Help/cpack_gen/nuget.rst @@ -18,7 +18,7 @@ The CPack NuGet generator may be used to create NuGet packages using it uses the ``CPACK_XXX`` variables used by :module:`CPack`. The CPack NuGet generator has specific features which are controlled by the -specifics :code:`CPACK_NUGET_XXX` variables. In the "one per group" mode +specifics ``CPACK_NUGET_XXX`` variables. In the "one per group" mode (see :variable:`CPACK_COMPONENTS_GROUPING`), ``<compName>`` placeholder in the variables below would contain a group name (uppercased and turned into a "C" identifier). diff --git a/Help/cpack_gen/rpm.rst b/Help/cpack_gen/rpm.rst index 5c543ff..65009db 100644 --- a/Help/cpack_gen/rpm.rst +++ b/Help/cpack_gen/rpm.rst @@ -11,9 +11,9 @@ The CPack RPM generator is a :module:`CPack` generator thus it uses the ``CPACK_XXX`` variables used by :module:`CPack`. The CPack RPM generator has specific features which are controlled by the specifics -:code:`CPACK_RPM_XXX` variables. +``CPACK_RPM_XXX`` variables. -:code:`CPACK_RPM_<COMPONENT>_XXXX` variables may be used in order to have +``CPACK_RPM_<COMPONENT>_XXXX`` variables may be used in order to have **component** specific values. Note however that ``<COMPONENT>`` refers to the **grouping name** written in upper case. It may be either a component name or a component GROUP name. Usually those variables correspond to RPM spec file diff --git a/Help/dev/documentation.rst b/Help/dev/documentation.rst index 1b2c942..c302790 100644 --- a/Help/dev/documentation.rst +++ b/Help/dev/documentation.rst @@ -458,32 +458,22 @@ reStructuredText markup from comment blocks that start in ``.rst:``. At the top of ``Modules/<module-name>.cmake``, begin with the following license notice: -.. code-block:: cmake +:: # Distributed under the OSI-approved BSD 3-Clause License. See accompanying # file Copyright.txt or https://cmake.org/licensing for details. After this notice, add a *BLANK* line. Then, add documentation using -a `Line Comment`_ block of the form: - -.. code-block:: cmake - - #.rst: - # <module-name> - # ------------- - # - # <reStructuredText documentation of module> - -or a `Bracket Comment`_ of the form: +a `Bracket Comment`_ of the form: :: - #[[.rst: - <module-name> - ------------- + #[=======================================================================[.rst: + <module-name> + ------------- - <reStructuredText documentation of module> - #]] + <reStructuredText documentation of module> + #]=======================================================================] Any number of ``=`` may be used in the opening and closing brackets as long as they match. Content on the line containing the closing @@ -496,35 +486,38 @@ For example, a ``Findxxx.cmake`` module may contain: :: - # Distributed under the OSI-approved BSD 3-Clause License. See accompanying - # file Copyright.txt or https://cmake.org/licensing for details. + # Distributed under the OSI-approved BSD 3-Clause License. See accompanying + # file Copyright.txt or https://cmake.org/licensing for details. + + #[=======================================================================[.rst: + FindXxx + ------- + + This is a cool module. + This module does really cool stuff. + It can do even more than you think. + + It even needs two paragraphs to tell you about it. + And it defines the following variables: + + ``VAR_COOL`` + this is great isn't it? + ``VAR_REALLY_COOL`` + cool right? + #]=======================================================================] + + <code> + + #[=======================================================================[.rst: + .. command:: xxx_do_something + + This command does something for Xxx:: - #.rst: - # FindXxx - # ------- - # - # This is a cool module. - # This module does really cool stuff. - # It can do even more than you think. - # - # It even needs two paragraphs to tell you about it. - # And it defines the following variables: - # - # * VAR_COOL: this is great isn't it? - # * VAR_REALLY_COOL: cool right? - - <code> - - #[========================================[.rst: - .. command:: xxx_do_something - - This command does something for Xxx:: - - xxx_do_something(some arguments) - #]========================================] - macro(xxx_do_something) - <code> - endmacro() + xxx_do_something(some arguments) + #]=======================================================================] + macro(xxx_do_something) + <code> + endmacro() Test the documentation formatting by running ``cmake --help-module <module-name>``, and also by enabling the @@ -534,5 +527,4 @@ have a .cmake file in this directory NOT show up in the modules documentation, simply leave out the ``Help/module/<module-name>.rst`` file and the ``Help/manual/cmake-modules.7.rst`` toctree entry. -.. _`Line Comment`: https://cmake.org/cmake/help/latest/manual/cmake-language.7.html#line-comment .. _`Bracket Comment`: https://cmake.org/cmake/help/latest/manual/cmake-language.7.html#bracket-comment diff --git a/Help/dev/review.rst b/Help/dev/review.rst index a524115..0c4eded 100644 --- a/Help/dev/review.rst +++ b/Help/dev/review.rst @@ -323,6 +323,14 @@ branch (e.g. ``master``) branch followed by a sequence of merges each integrating changes from an open MR that has been staged for integration testing. Each time the target integration branch is updated the stage is rebuilt automatically by merging the staged MR topics again. +The branch is stored in the upstream repository by special refs: + +* ``refs/stage/master/head``: The current topic stage branch. + This is used by continuous builds that report to CDash. +* ``refs/stage/master/nightly/latest``: Topic stage as of 1am UTC each night. + This is used by most nightly builds that report to CDash. +* ``refs/stage/master/nightly/<yyyy>/<mm>/<dd>``: Topic stage as of 1am UTC + on the date specified. This is used for historical reference. `CMake GitLab Project Developers`_ may stage a MR for integration testing by adding a comment with a command among the `comment trailing lines`_:: diff --git a/Help/index.rst b/Help/index.rst index fe1b73c..a948939 100644 --- a/Help/index.rst +++ b/Help/index.rst @@ -30,6 +30,7 @@ Reference Manuals /manual/cmake-compile-features.7 /manual/cmake-developer.7 /manual/cmake-env-variables.7 + /manual/cmake-file-api.7 /manual/cmake-generator-expressions.7 /manual/cmake-generators.7 /manual/cmake-language.7 diff --git a/Help/manual/ccmake.1.rst b/Help/manual/ccmake.1.rst index cc3ceec..9548471 100644 --- a/Help/manual/ccmake.1.rst +++ b/Help/manual/ccmake.1.rst @@ -13,7 +13,7 @@ Synopsis Description =========== -The "ccmake" executable is the CMake curses interface. Project +The **ccmake** executable is the CMake curses interface. Project configuration settings may be specified interactively through this GUI. Brief instructions are provided at the bottom of the terminal when the program is running. diff --git a/Help/manual/cmake-developer.7.rst b/Help/manual/cmake-developer.7.rst index b949464..85ed935 100644 --- a/Help/manual/cmake-developer.7.rst +++ b/Help/manual/cmake-developer.7.rst @@ -196,49 +196,78 @@ them. A Sample Find Module -------------------- -We will describe how to create a simple find module for a library -``Foo``. +We will describe how to create a simple find module for a library ``Foo``. -The first thing that is needed is a license notice. +The top of the module should begin with a license notice, followed by +a blank line, and then followed by a :ref:`Bracket Comment`. The comment +should begin with ``.rst:`` to indicate that the rest of its content is +reStructuredText-format documentation. For example: -.. code-block:: cmake +:: - # Distributed under the OSI-approved BSD 3-Clause License. See accompanying - # file Copyright.txt or https://cmake.org/licensing for details. + # Distributed under the OSI-approved BSD 3-Clause License. See accompanying + # file Copyright.txt or https://cmake.org/licensing for details. -Next we need module documentation. CMake's documentation system requires you -to follow the license notice with a blank line and then with a documentation -marker and the name of the module. You should follow this with a simple -statement of what the module does. + #[=======================================================================[.rst: + FindFoo + ------- -.. code-block:: cmake + Finds the Foo library. - #.rst: - # FindFoo - # ------- - # - # Finds the Foo library - # + Imported Targets + ^^^^^^^^^^^^^^^^ -More description may be required for some packages. If there are -caveats or other details users of the module should be aware of, you can -add further paragraphs below this. Then you need to document what -variables and imported targets are set by the module, such as + This module provides the following imported targets, if found: -.. code-block:: cmake + ``Foo::Foo`` + The Foo library + + Result Variables + ^^^^^^^^^^^^^^^^ + + This will define the following variables: + + ``Foo_FOUND`` + True if the system has the Foo library. + ``Foo_VERSION`` + The version of the Foo library which was found. + ``Foo_INCLUDE_DIRS`` + Include directories needed to use Foo. + ``Foo_LIBRARIES`` + Libraries needed to link to Foo. + + Cache Variables + ^^^^^^^^^^^^^^^ + + The following cache variables may also be set: + + ``Foo_INCLUDE_DIR`` + The directory containing ``foo.h``. + ``Foo_LIBRARY`` + The path to the Foo library. + + #]=======================================================================] + +The module documentation consists of: + +* An underlined heading specifying the module name. + +* A simple description of what the module finds. + More description may be required for some packages. If there are + caveats or other details users of the module should be aware of, + specify them here. + +* A section listing imported targets provided by the module, if any. + +* A section listing result variables provided by the module. - # This will define the following variables:: - # - # Foo_FOUND - True if the system has the Foo library - # Foo_VERSION - The version of the Foo library which was found - # - # and the following imported targets:: - # - # Foo::Foo - The Foo library +* Optionally a section listing cache variables used by the module, if any. -If the package provides any macros, they should be listed here, but can -be documented where they are defined. +If the package provides any macros or functions, they should be listed in +an additional section, but can be documented by additional ``.rst:`` +comment blocks immediately above where those macros or functions are defined. +The find module implementation may begin below the documentation block. Now the actual libraries and so on have to be found. The code here will obviously vary from module to module (dealing with that, after all, is the point of find modules), but there tends to be a common pattern for libraries. diff --git a/Help/manual/cmake-file-api.7.rst b/Help/manual/cmake-file-api.7.rst new file mode 100644 index 0000000..f3e0208 --- /dev/null +++ b/Help/manual/cmake-file-api.7.rst @@ -0,0 +1,1111 @@ +.. cmake-manual-description: CMake File-Based API + +cmake-file-api(7) +***************** + +.. only:: html + + .. contents:: + +Introduction +============ + +CMake provides a file-based API that clients may use to get semantic +information about the buildsystems CMake generates. Clients may use +the API by writing query files to a specific location in a build tree +to request zero or more `Object Kinds`_. When CMake generates the +buildsystem in that build tree it will read the query files and write +reply files for the client to read. + +The file-based API uses a ``<build>/.cmake/api/`` directory at the top +of a build tree. The API is versioned to support changes to the layout +of files within the API directory. API file layout versioning is +orthogonal to the versioning of `Object Kinds`_ used in replies. +This version of CMake supports only one API version, `API v1`_. + +API v1 +====== + +API v1 is housed in the ``<build>/.cmake/api/v1/`` directory. +It has the following subdirectories: + +``query/`` + Holds query files written by clients. + These may be `v1 Shared Stateless Query Files`_, + `v1 Client Stateless Query Files`_, or `v1 Client Stateful Query Files`_. + +``reply/`` + Holds reply files written by CMake whenever it runs to generate a build + system. These are indexed by a `v1 Reply Index File`_ file that may + reference additional `v1 Reply Files`_. CMake owns all reply files. + Clients must never remove them. + + Clients may look for and read a reply index file at any time. + Clients may optionally create the ``reply/`` directory at any time + and monitor it for the appearance of a new reply index file. + +v1 Shared Stateless Query Files +------------------------------- + +Shared stateless query files allow clients to share requests for +major versions of the `Object Kinds`_ and get all requested versions +recognized by the CMake that runs. + +Clients may create shared requests by creating empty files in the +``v1/query/`` directory. The form is:: + + <build>/.cmake/api/v1/query/<kind>-v<major> + +where ``<kind>`` is one of the `Object Kinds`_, ``-v`` is literal, +and ``<major>`` is the major version number. + +Files of this form are stateless shared queries not owned by any specific +client. Once created they should not be removed without external client +coordination or human intervention. + +v1 Client Stateless Query Files +------------------------------- + +Client stateless query files allow clients to create owned requests for +major versions of the `Object Kinds`_ and get all requested versions +recognized by the CMake that runs. + +Clients may create owned requests by creating empty files in +client-specific query subdirectories. The form is:: + + <build>/.cmake/api/v1/query/client-<client>/<kind>-v<major> + +where ``client-`` is literal, ``<client>`` is a string uniquely +identifying the client, ``<kind>`` is one of the `Object Kinds`_, +``-v`` is literal, and ``<major>`` is the major version number. +Each client must choose a unique ``<client>`` identifier via its +own means. + +Files of this form are stateless queries owned by the client ``<client>``. +The owning client may remove them at any time. + +v1 Client Stateful Query Files +------------------------------ + +Stateful query files allow clients to request a list of versions of +each of the `Object Kinds`_ and get only the most recent version +recognized by the CMake that runs. + +Clients may create owned stateful queries by creating ``query.json`` +files in client-specific query subdirectories. The form is:: + + <build>/.cmake/api/v1/query/client-<client>/query.json + +where ``client-`` is literal, ``<client>`` is a string uniquely +identifying the client, and ``query.json`` is literal. Each client +must choose a unique ``<client>`` identifier via its own means. + +``query.json`` files are stateful queries owned by the client ``<client>``. +The owning client may update or remove them at any time. When a +given client installation is updated it may then update the stateful +query it writes to build trees to request newer object versions. +This can be used to avoid asking CMake to generate multiple object +versions unnecessarily. + +A ``query.json`` file must contain a JSON object: + +.. code-block:: json + + { + "requests": [ + { "kind": "<kind>" , "version": 1 }, + { "kind": "<kind>" , "version": { "major": 1, "minor": 2 } }, + { "kind": "<kind>" , "version": [2, 1] }, + { "kind": "<kind>" , "version": [2, { "major": 1, "minor": 2 }] }, + { "kind": "<kind>" , "version": 1, "client": {} }, + { "kind": "..." } + ], + "client": {} + } + +The members are: + +``requests`` + A JSON array containing zero or more requests. Each request is + a JSON object with members: + + ``kind`` + Specifies one of the `Object Kinds`_ to be included in the reply. + + ``version`` + Indicates the version(s) of the object kind that the client + understands. Versions have major and minor components following + semantic version conventions. The value must be + + * a JSON integer specifying a (non-negative) major version number, or + * a JSON object containing ``major`` and (optionally) ``minor`` + members specifying non-negative integer version components, or + * a JSON array whose elements are each one of the above. + + ``client`` + Optional member reserved for use by the client. This value is + preserved in the reply written for the client in the + `v1 Reply Index File`_ but is otherwise ignored. Clients may use + this to pass custom information with a request through to its reply. + + For each requested object kind CMake will choose the *first* version + that it recognizes for that kind among those listed in the request. + The response will use the selected *major* version with the highest + *minor* version known to the running CMake for that major version. + Therefore clients should list all supported major versions in + preferred order along with the minimal minor version required + for each major version. + +``client`` + Optional member reserved for use by the client. This value is + preserved in the reply written for the client in the + `v1 Reply Index File`_ but is otherwise ignored. Clients may use + this to pass custom information with a query through to its reply. + +Other ``query.json`` top-level members are reserved for future use. +If present they are ignored for forward compatibility. + +v1 Reply Index File +------------------- + +CMake writes an ``index-*.json`` file to the ``v1/reply/`` directory +whenever it runs to generate a build system. Clients must read the +reply index file first and may read other `v1 Reply Files`_ only by +following references. The form of the reply index file name is:: + + <build>/.cmake/api/v1/reply/index-<unspecified>.json + +where ``index-`` is literal and ``<unspecified>`` is an unspecified +name selected by CMake. Whenever a new index file is generated it +is given a new name and any old one is deleted. During the short +time between these steps there may be multiple index files present; +the one with the largest name in lexicographic order is the current +index file. + +The reply index file contains a JSON object: + +.. code-block:: json + + { + "cmake": { + "version": { + "major": 3, "minor": 14, "patch": 0, "suffix": "", + "string": "3.14.0", "isDirty": false + }, + "paths": { + "cmake": "/prefix/bin/cmake", + "ctest": "/prefix/bin/ctest", + "cpack": "/prefix/bin/cpack", + "root": "/prefix/share/cmake-3.14" + }, + "generator": { + "name": "Unix Makefiles" + } + }, + "objects": [ + { "kind": "<kind>", + "version": { "major": 1, "minor": 0 }, + "jsonFile": "<file>" }, + { "...": "..." } + ], + "reply": { + "<kind>-v<major>": { "kind": "<kind>", + "version": { "major": 1, "minor": 0 }, + "jsonFile": "<file>" }, + "<unknown>": { "error": "unknown query file" }, + "...": {}, + "client-<client>": { + "<kind>-v<major>": { "kind": "<kind>", + "version": { "major": 1, "minor": 0 }, + "jsonFile": "<file>" }, + "<unknown>": { "error": "unknown query file" }, + "...": {}, + "query.json": { + "requests": [ {}, {}, {} ], + "responses": [ + { "kind": "<kind>", + "version": { "major": 1, "minor": 0 }, + "jsonFile": "<file>" }, + { "error": "unknown query file" }, + { "...": {} } + ], + "client": {} + } + } + } + } + +The members are: + +``cmake`` + A JSON object containing information about the instance of CMake that + generated the reply. It contains members: + + ``version`` + A JSON object specifying the version of CMake with members: + + ``major``, ``minor``, ``patch`` + Integer values specifying the major, minor, and patch version components. + ``suffix`` + A string specifying the version suffix, if any, e.g. ``g0abc3``. + ``string`` + A string specifying the full version in the format + ``<major>.<minor>.<patch>[-<suffix>]``. + ``isDirty`` + A boolean indicating whether the version was built from a version + controlled source tree with local modifications. + + ``paths`` + A JSON object specifying paths to things that come with CMake. + It has members for ``cmake``, ``ctest``, and ``cpack`` whose values + are JSON strings specifying the absolute path to each tool, + represented with forward slashes. It also has a ``root`` member for + the absolute path to the directory containing CMake resources like the + ``Modules/`` directory (see :variable:`CMAKE_ROOT`). + + ``generator`` + A JSON object describing the CMake generator used for the build. + It has members: + + ``name`` + A string specifying the name of the generator. + ``platform`` + If the generator supports :variable:`CMAKE_GENERATOR_PLATFORM`, + this is a string specifying the generator platform name. + +``objects`` + A JSON array listing all versions of all `Object Kinds`_ generated + as part of the reply. Each array entry is a + `v1 Reply File Reference`_. + +``reply`` + A JSON object mirroring the content of the ``query/`` directory + that CMake loaded to produce the reply. The members are of the form + + ``<kind>-v<major>`` + A member of this form appears for each of the + `v1 Shared Stateless Query Files`_ that CMake recognized as a + request for object kind ``<kind>`` with major version ``<major>``. + The value is a `v1 Reply File Reference`_ to the corresponding + reply file for that object kind and version. + + ``<unknown>`` + A member of this form appears for each of the + `v1 Shared Stateless Query Files`_ that CMake did not recognize. + The value is a JSON object with a single ``error`` member + containing a string with an error message indicating that the + query file is unknown. + + ``client-<client>`` + A member of this form appears for each client-owned directory + holding `v1 Client Stateless Query Files`_. + The value is a JSON object mirroring the content of the + ``query/client-<client>/`` directory. The members are of the form: + + ``<kind>-v<major>`` + A member of this form appears for each of the + `v1 Client Stateless Query Files`_ that CMake recognized as a + request for object kind ``<kind>`` with major version ``<major>``. + The value is a `v1 Reply File Reference`_ to the corresponding + reply file for that object kind and version. + + ``<unknown>`` + A member of this form appears for each of the + `v1 Client Stateless Query Files`_ that CMake did not recognize. + The value is a JSON object with a single ``error`` member + containing a string with an error message indicating that the + query file is unknown. + + ``query.json`` + This member appears for clients using + `v1 Client Stateful Query Files`_. + If the ``query.json`` file failed to read or parse as a JSON object, + this member is a JSON object with a single ``error`` member + containing a string with an error message. Otherwise, this member + is a JSON object mirroring the content of the ``query.json`` file. + The members are: + + ``client`` + A copy of the ``query.json`` file ``client`` member, if it exists. + + ``requests`` + A copy of the ``query.json`` file ``requests`` member, if it exists. + + ``responses`` + If the ``query.json`` file ``requests`` member is missing or invalid, + this member is a JSON object with a single ``error`` member + containing a string with an error message. Otherwise, this member + contains a JSON array with a response for each entry of the + ``requests`` array, in the same order. Each response is + + * a JSON object with a single ``error`` member containing a string + with an error message, or + * a `v1 Reply File Reference`_ to the corresponding reply file for + the requested object kind and selected version. + +After reading the reply index file, clients may read the other +`v1 Reply Files`_ it references. + +v1 Reply File Reference +^^^^^^^^^^^^^^^^^^^^^^^ + +The reply index file represents each reference to another reply file +using a JSON object with members: + +``kind`` + A string specifying one of the `Object Kinds`_. +``version`` + A JSON object with members ``major`` and ``minor`` specifying + integer version components of the object kind. +``jsonFile`` + A JSON string specifying a path relative to the reply index file + to another JSON file containing the object. + +v1 Reply Files +-------------- + +Reply files containing specific `Object Kinds`_ are written by CMake. +The names of these files are unspecified and must not be interpreted +by clients. Clients must first read the `v1 Reply Index File`_ and +and follow references to the names of the desired response objects. + +Reply files (including the index file) will never be replaced by +files of the same name but different content. This allows a client +to read the files concurrently with a running CMake that may generate +a new reply. However, after generating a new reply CMake will attempt +to remove reply files from previous runs that it did not just write. +If a client attempts to read a reply file referenced by the index but +finds the file missing, that means a concurrent CMake has generated +a new reply. The client may simply start again by reading the new +reply index file. + +Object Kinds +============ + +The CMake file-based API reports semantic information about the build +system using the following kinds of JSON objects. Each kind of object +is versioned independently using semantic versioning with major and +minor components. Every kind of object has the form: + +.. code-block:: json + + { + "kind": "<kind>", + "version": { "major": 1, "minor": 0 }, + "...": {} + } + +The ``kind`` member is a string specifying the object kind name. +The ``version`` member is a JSON object with ``major`` and ``minor`` +members specifying integer components of the object kind's version. +Additional top-level members are specific to each object kind. + +Object Kind "codemodel" +----------------------- + +The ``codemodel`` object kind describes the build system structure as +modeled by CMake. + +There is only one ``codemodel`` object major version, version 2. +Version 1 does not exist to avoid confusion with that from +:manual:`cmake-server(7)` mode. + +"codemodel" version 2 +^^^^^^^^^^^^^^^^^^^^^ + +``codemodel`` object version 2 is a JSON object: + +.. code-block:: json + + { + "kind": "codemodel", + "version": { "major": 2, "minor": 0 }, + "paths": { + "source": "/path/to/top-level-source-dir", + "build": "/path/to/top-level-build-dir" + }, + "configurations": [ + { + "name": "Debug", + "directories": [ + { + "source": ".", + "build": ".", + "childIndexes": [ 1 ], + "projectIndex": 0, + "targetIndexes": [ 0 ], + "hasInstallRule": true, + "minimumCMakeVersion": { + "string": "3.14" + } + }, + { + "source": "sub", + "build": "sub", + "parentIndex": 0, + "projectIndex": 0, + "targetIndexes": [ 1 ], + "minimumCMakeVersion": { + "string": "3.14" + } + } + ], + "projects": [ + { + "name": "MyProject", + "directoryIndexes": [ 0, 1 ], + "targetIndexes": [ 0, 1 ] + } + ], + "targets": [ + { + "name": "MyExecutable", + "directoryIndex": 0, + "projectIndex": 0, + "jsonFile": "<file>" + }, + { + "name": "MyLibrary", + "directoryIndex": 1, + "projectIndex": 0, + "jsonFile": "<file>" + } + ] + } + ] + } + +The members specific to ``codemodel`` objects are: + +``paths`` + A JSON object containing members: + + ``source`` + A string specifying the absolute path to the top-level source directory, + represented with forward slashes. + + ``build`` + A string specifying the absolute path to the top-level build directory, + represented with forward slashes. + +``configurations`` + A JSON array of entries corresponding to available build configurations. + On single-configuration generators there is one entry for the value + of the :variable:`CMAKE_BUILD_TYPE` variable. For multi-configuration + generators there is an entry for each configuration listed in the + :variable:`CMAKE_CONFIGURATION_TYPES` variable. + Each entry is a JSON object containing members: + + ``name`` + A string specifying the name of the configuration, e.g. ``Debug``. + + ``directories`` + A JSON array of entries each corresponding to a build system directory + whose source directory contains a ``CMakeLists.txt`` file. The first + entry corresponds to the top-level directory. Each entry is a + JSON object containing members: + + ``source`` + A string specifying the path to the source directory, represented + with forward slashes. If the directory is inside the top-level + source directory then the path is specified relative to that + directory (with ``.`` for the top-level source directory itself). + Otherwise the path is absolute. + + ``build`` + A string specifying the path to the build directory, represented + with forward slashes. If the directory is inside the top-level + build directory then the path is specified relative to that + directory (with ``.`` for the top-level build directory itself). + Otherwise the path is absolute. + + ``parentIndex`` + Optional member that is present when the directory is not top-level. + The value is an unsigned integer 0-based index of another entry in + the main ``directories`` array that corresponds to the parent + directory that added this directory as a subdirectory. + + ``childIndexes`` + Optional member that is present when the directory has subdirectories. + The value is a JSON array of entries corresponding to child directories + created by the :command:`add_subdirectory` or :command:`subdirs` + command. Each entry is an unsigned integer 0-based index of another + entry in the main ``directories`` array. + + ``projectIndex`` + An unsigned integer 0-based index into the main ``projects`` array + indicating the build system project to which the this directory belongs. + + ``targetIndexes`` + Optional member that is present when the directory itself has targets, + excluding those belonging to subdirectories. The value is a JSON + array of entries corresponding to the targets. Each entry is an + unsigned integer 0-based index into the main ``targets`` array. + + ``minimumCMakeVersion`` + Optional member present when a minimum required version of CMake is + known for the directory. This is the ``<min>`` version given to the + most local call to the :command:`cmake_minimum_required(VERSION)` + command in the directory itself or one of its ancestors. + The value is a JSON object with one member: + + ``string`` + A string specifying the minimum required version in the format:: + + <major>.<minor>[.<patch>[.<tweak>]][<suffix>] + + Each component is an unsigned integer and the suffix may be an + arbitrary string. + + ``hasInstallRule`` + Optional member that is present with boolean value ``true`` when + the directory or one of its subdirectories contains any + :command:`install` rules, i.e. whether a ``make install`` + or equivalent rule is available. + + ``projects`` + A JSON array of entries corresponding to the top-level project + and sub-projects defined in the build system. Each (sub-)project + corresponds to a source directory whose ``CMakeLists.txt`` file + calls the :command:`project` command with a project name different + from its parent directory. The first entry corresponds to the + top-level project. + + Each entry is a JSON object containing members: + + ``name`` + A string specifying the name given to the :command:`project` command. + + ``parentIndex`` + Optional member that is present when the project is not top-level. + The value is an unsigned integer 0-based index of another entry in + the main ``projects`` array that corresponds to the parent project + that added this project as a sub-project. + + ``childIndexes`` + Optional member that is present when the project has sub-projects. + The value is a JSON array of entries corresponding to the sub-projects. + Each entry is an unsigned integer 0-based index of another + entry in the main ``projects`` array. + + ``directoryIndexes`` + A JSON array of entries corresponding to build system directories + that are part of the project. The first entry corresponds to the + top-level directory of the project. Each entry is an unsigned + integer 0-based index into the main ``directories`` array. + + ``targetIndexes`` + Optional member that is present when the project itself has targets, + excluding those belonging to sub-projects. The value is a JSON + array of entries corresponding to the targets. Each entry is an + unsigned integer 0-based index into the main ``targets`` array. + + ``targets`` + A JSON array of entries corresponding to the build system targets. + Such targets are created by calls to :command:`add_executable`, + :command:`add_library`, and :command:`add_custom_target`, excluding + imported targets and interface libraries (which do not generate any + build rules). Each entry is a JSON object containing members: + + ``name`` + A string specifying the target name. + + ``id`` + A string uniquely identifying the target. This matches the ``id`` + field in the file referenced by ``jsonFile``. + + ``directoryIndex`` + An unsigned integer 0-based index into the main ``directories`` array + indicating the build system directory in which the target is defined. + + ``projectIndex`` + An unsigned integer 0-based index into the main ``projects`` array + indicating the build system project in which the target is defined. + + ``jsonFile`` + A JSON string specifying a path relative to the codemodel file + to another JSON file containing a + `"codemodel" version 2 "target" object`_. + +"codemodel" version 2 "target" object +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +A codemodel "target" object is referenced by a `"codemodel" version 2`_ +object's ``targets`` array. Each "target" object is a JSON object +with members: + +``name`` + A string specifying the logical name of the target. + +``id`` + A string uniquely identifying the target. The format is unspecified + and should not be interpreted by clients. + +``type`` + A string specifying the type of the target. The value is one of + ``EXECUTABLE``, ``STATIC_LIBRARY``, ``SHARED_LIBRARY``, + ``MODULE_LIBRARY``, ``OBJECT_LIBRARY``, or ``UTILITY``. + +``backtrace`` + Optional member that is present when a CMake language backtrace to + the command in the source code that created the target is available. + The value is an unsigned integer 0-based index into the + ``backtraceGraph`` member's ``nodes`` array. + +``folder`` + Optional member that is present when the :prop_tgt:`FOLDER` target + property is set. The value is a JSON object with one member: + + ``name`` + A string specifying the name of the target folder. + +``paths`` + A JSON object containing members: + + ``source`` + A string specifying the path to the target's source directory, + represented with forward slashes. If the directory is inside the + top-level source directory then the path is specified relative to + that directory (with ``.`` for the top-level source directory itself). + Otherwise the path is absolute. + + ``build`` + A string specifying the path to the target's build directory, + represented with forward slashes. If the directory is inside the + top-level build directory then the path is specified relative to + that directory (with ``.`` for the top-level build directory itself). + Otherwise the path is absolute. + +``nameOnDisk`` + Optional member that is present for executable and library targets + that are linked or archived into a single primary artifact. + The value is a string specifying the file name of that artifact on disk. + +``artifacts`` + Optional member that is present for executable and library targets + that produce artifacts on disk meant for consumption by dependents. + The value is a JSON array of entries corresponding to the artifacts. + Each entry is a JSON object containing one member: + + ``path`` + A string specifying the path to the file on disk, represented with + forward slashes. If the file is inside the top-level build directory + then the path is specified relative to that directory. + Otherwise the path is absolute. + +``isGeneratorProvided`` + Optional member that is present with boolean value ``true`` if the + target is provided by CMake's build system generator rather than by + a command in the source code. + +``install`` + Optional member that is present when the target has an :command:`install` + rule. The value is a JSON object with members: + + ``prefix`` + A JSON object specifying the installation prefix. It has one member: + + ``path`` + A string specifying the value of :variable:`CMAKE_INSTALL_PREFIX`. + + ``destinations`` + A JSON array of entries specifying an install destination path. + Each entry is a JSON object with members: + + ``path`` + A string specifying the install destination path. The path may + be absolute or relative to the install prefix. + + ``backtrace`` + Optional member that is present when a CMake language backtrace to + the :command:`install` command invocation that specified this + destination is available. The value is an unsigned integer 0-based + index into the ``backtraceGraph`` member's ``nodes`` array. + +``link`` + Optional member that is present for executables and shared library + targets that link into a runtime binary. The value is a JSON object + with members describing the link step: + + ``language`` + A string specifying the language (e.g. ``C``, ``CXX``, ``Fortran``) + of the toolchain is used to invoke the linker. + + ``commandFragments`` + Optional member that is present when fragments of the link command + line invocation are available. The value is a JSON array of entries + specifying ordered fragments. Each entry is a JSON object with members: + + ``fragment`` + A string specifying a fragment of the link command line invocation. + The value is encoded in the build system's native shell format. + + ``role`` + A string specifying the role of the fragment's content: + + * ``flags``: link flags. + * ``libraries``: link library file paths or flags. + * ``libraryPath``: library search path flags. + * ``frameworkPath``: macOS framework search path flags. + + ``lto`` + Optional member that is present with boolean value ``true`` + when link-time optimization (a.k.a. interprocedural optimization + or link-time code generation) is enabled. + + ``sysroot`` + Optional member that is present when the :variable:`CMAKE_SYSROOT_LINK` + or :variable:`CMAKE_SYSROOT` variable is defined. The value is a + JSON object with one member: + + ``path`` + A string specifying the absolute path to the sysroot, represented + with forward slashes. + +``archive`` + Optional member that is present for static library targets. The value + is a JSON object with members describing the archive step: + + ``commandFragments`` + Optional member that is present when fragments of the archiver command + line invocation are available. The value is a JSON array of entries + specifying the fragments. Each entry is a JSON object with members: + + ``fragment`` + A string specifying a fragment of the archiver command line invocation. + The value is encoded in the build system's native shell format. + + ``role`` + A string specifying the role of the fragment's content: + + * ``flags``: archiver flags. + + ``lto`` + Optional member that is present with boolean value ``true`` + when link-time optimization (a.k.a. interprocedural optimization + or link-time code generation) is enabled. + +``dependencies`` + Optional member that is present when the target depends on other targets. + The value is a JSON array of entries corresponding to the dependencies. + Each entry is a JSON object with members: + + ``id`` + A string uniquely identifying the target on which this target depends. + This matches the main ``id`` member of the other target. + + ``backtrace`` + Optional member that is present when a CMake language backtrace to + the :command:`add_dependencies`, :command:`target_link_libraries`, + or other command invocation that created this dependency is + available. The value is an unsigned integer 0-based index into + the ``backtraceGraph`` member's ``nodes`` array. + +``sources`` + A JSON array of entries corresponding to the target's source files. + Each entry is a JSON object with members: + + ``path`` + A string specifying the path to the source file on disk, represented + with forward slashes. If the file is inside the top-level source + directory then the path is specified relative to that directory. + Otherwise the path is absolute. + + ``compileGroupIndex`` + Optional member that is present when the source is compiled. + The value is an unsigned integer 0-based index into the + ``compileGroups`` array. + + ``sourceGroupIndex`` + Optional member that is present when the source is part of a source + group either via the :command:`source_group` command or by default. + The value is an unsigned integer 0-based index into the + ``sourceGroups`` array. + + ``isGenerated`` + Optional member that is present with boolean value ``true`` if + the source is :prop_sf:`GENERATED`. + + ``backtrace`` + Optional member that is present when a CMake language backtrace to + the :command:`target_sources`, :command:`add_executable`, + :command:`add_library`, :command:`add_custom_target`, or other + command invocation that added this source to the target is + available. The value is an unsigned integer 0-based index into + the ``backtraceGraph`` member's ``nodes`` array. + +``sourceGroups`` + Optional member that is present when sources are grouped together by + the :command:`source_group` command or by default. The value is a + JSON array of entries corresponding to the groups. Each entry is + a JSON object with members: + + ``name`` + A string specifying the name of the source group. + + ``sourceIndexes`` + A JSON array listing the sources belonging to the group. + Each entry is an unsigned integer 0-based index into the + main ``sources`` array for the target. + +``compileGroups`` + Optional member that is present when the target has sources that compile. + The value is a JSON array of entries corresponding to groups of sources + that all compile with the same settings. Each entry is a JSON object + with members: + + ``sourceIndexes`` + A JSON array listing the sources belonging to the group. + Each entry is an unsigned integer 0-based index into the + main ``sources`` array for the target. + + ``language`` + A string specifying the language (e.g. ``C``, ``CXX``, ``Fortran``) + of the toolchain is used to compile the source file. + + ``compileCommandFragments`` + Optional member that is present when fragments of the compiler command + line invocation are available. The value is a JSON array of entries + specifying ordered fragments. Each entry is a JSON object with + one member: + + ``fragment`` + A string specifying a fragment of the compile command line invocation. + The value is encoded in the build system's native shell format. + + ``includes`` + Optional member that is present when there are include directories. + The value is a JSON array with an entry for each directory. Each + entry is a JSON object with members: + + ``path`` + A string specifying the path to the include directory, + represented with forward slashes. + + ``isSystem`` + Optional member that is present with boolean value ``true`` if + the include directory is marked as a system include directory. + + ``backtrace`` + Optional member that is present when a CMake language backtrace to + the :command:`target_include_directories` or other command invocation + that added this include directory is available. The value is + an unsigned integer 0-based index into the ``backtraceGraph`` + member's ``nodes`` array. + + ``defines`` + Optional member that is present when there are preprocessor definitions. + The value is a JSON array with an entry for each definition. Each + entry is a JSON object with members: + + ``define`` + A string specifying the preprocessor definition in the format + ``<name>[=<value>]``, e.g. ``DEF`` or ``DEF=1``. + + ``backtrace`` + Optional member that is present when a CMake language backtrace to + the :command:`target_compile_definitions` or other command invocation + that added this preprocessor definition is available. The value is + an unsigned integer 0-based index into the ``backtraceGraph`` + member's ``nodes`` array. + + ``sysroot`` + Optional member that is present when the + :variable:`CMAKE_SYSROOT_COMPILE` or :variable:`CMAKE_SYSROOT` + variable is defined. The value is a JSON object with one member: + + ``path`` + A string specifying the absolute path to the sysroot, represented + with forward slashes. + +``backtraceGraph`` + A JSON object describing the graph of backtraces whose nodes are + referenced from ``backtrace`` members elsewhere. The members are: + + ``nodes`` + A JSON array listing nodes in the backtrace graph. Each entry + is a JSON object with members: + + ``file`` + An unsigned integer 0-based index into the backtrace ``files`` array. + + ``line`` + An optional member present when the node represents a line within + the file. The value is an unsigned integer 1-based line number. + + ``command`` + An optional member present when the node represents a command + invocation within the file. The value is an unsigned integer + 0-based index into the backtrace ``commands`` array. + + ``parent`` + An optional member present when the node is not the bottom of + the call stack. The value is an unsigned integer 0-based index + of another entry in the backtrace ``nodes`` array. + + ``commands`` + A JSON array listing command names referenced by backtrace nodes. + Each entry is a string specifying a command name. + + ``files`` + A JSON array listing CMake language files referenced by backtrace nodes. + Each entry is a string specifying the path to a file, represented + with forward slashes. If the file is inside the top-level source + directory then the path is specified relative to that directory. + Otherwise the path is absolute. + +Object Kind "cache" +------------------- + +The ``cache`` object kind lists cache entries. These are the +:ref:`CMake Language Variables` stored in the persistent cache +(``CMakeCache.txt``) for the build tree. + +There is only one ``cache`` object major version, version 2. +Version 1 does not exist to avoid confusion with that from +:manual:`cmake-server(7)` mode. + +"cache" version 2 +^^^^^^^^^^^^^^^^^ + +``cache`` object version 2 is a JSON object: + +.. code-block:: json + + { + "kind": "cache", + "version": { "major": 2, "minor": 0 }, + "entries": [ + { + "name": "BUILD_SHARED_LIBS", + "value": "ON", + "type": "BOOL", + "properties": [ + { + "name": "HELPSTRING", + "value": "Build shared libraries" + } + ] + }, + { + "name": "CMAKE_GENERATOR", + "value": "Unix Makefiles", + "type": "INTERNAL", + "properties": [ + { + "name": "HELPSTRING", + "value": "Name of generator." + } + ] + } + ] + } + +The members specific to ``cache`` objects are: + +``entries`` + A JSON array whose entries are each a JSON object specifying a + cache entry. The members of each entry are: + + ``name`` + A string specifying the name of the entry. + + ``value`` + A string specifying the value of the entry. + + ``type`` + A string specifying the type of the entry used by + :manual:`cmake-gui(1)` to choose a widget for editing. + + ``properties`` + A JSON array of entries specifying associated + :ref:`cache entry properties <Cache Entry Properties>`. + Each entry is a JSON object containing members: + + ``name`` + A string specifying the name of the cache entry property. + + ``value`` + A string specifying the value of the cache entry property. + +Object Kind "cmakeFiles" +------------------------ + +The ``cmakeFiles`` object kind lists files used by CMake while +configuring and generating the build system. These include the +``CMakeLists.txt`` files as well as included ``.cmake`` files. + +There is only one ``cmakeFiles`` object major version, version 1. + +"cmakeFiles" version 1 +^^^^^^^^^^^^^^^^^^^^^^ + +``cmakeFiles`` object version 1 is a JSON object: + +.. code-block:: json + + { + "kind": "cmakeFiles", + "version": { "major": 1, "minor": 0 }, + "paths": { + "build": "/path/to/top-level-build-dir", + "source": "/path/to/top-level-source-dir" + }, + "inputs": [ + { + "path": "CMakeLists.txt" + }, + { + "isGenerated": true, + "path": "/path/to/top-level-build-dir/.../CMakeSystem.cmake" + }, + { + "isExternal": true, + "path": "/path/to/external/third-party/module.cmake" + }, + { + "isCMake": true, + "isExternal": true, + "path": "/path/to/cmake/Modules/CMakeGenericSystem.cmake" + } + ] + } + +The members specific to ``cmakeFiles`` objects are: + +``paths`` + A JSON object containing members: + + ``source`` + A string specifying the absolute path to the top-level source directory, + represented with forward slashes. + + ``build`` + A string specifying the absolute path to the top-level build directory, + represented with forward slashes. + +``inputs`` + A JSON array whose entries are each a JSON object specifying an input + file used by CMake when configuring and generating the build system. + The members of each entry are: + + ``path`` + A string specifying the path to an input file to CMake, represented + with forward slashes. If the file is inside the top-level source + directory then the path is specified relative to that directory. + Otherwise the path is absolute. + + ``isGenerated`` + Optional member that is present with boolean value ``true`` + if the path specifies a file that is under the top-level + build directory and the build is out-of-source. + This member is not available on in-source builds. + + ``isExternal`` + Optional member that is present with boolean value ``true`` + if the path specifies a file that is not under the top-level + source or build directories. + + ``isCMake`` + Optional member that is present with boolean value ``true`` + if the path specifies a file in the CMake installation. diff --git a/Help/manual/cmake-generators.7.rst b/Help/manual/cmake-generators.7.rst index 0287767..1de10c4 100644 --- a/Help/manual/cmake-generators.7.rst +++ b/Help/manual/cmake-generators.7.rst @@ -27,6 +27,8 @@ when creating a new build tree. CMake Generators ================ +.. _`Command-Line Build Tool Generators`: + Command-Line Build Tool Generators ---------------------------------- @@ -58,6 +60,8 @@ Ninja Generator /generator/Ninja +.. _`IDE Build Tool Generators`: + IDE Build Tool Generators ------------------------- diff --git a/Help/manual/cmake-gui.1.rst b/Help/manual/cmake-gui.1.rst index 57a9850..9322e33 100644 --- a/Help/manual/cmake-gui.1.rst +++ b/Help/manual/cmake-gui.1.rst @@ -14,7 +14,7 @@ Synopsis Description =========== -The "cmake-gui" executable is the CMake GUI. Project configuration +The **cmake-gui** executable is the CMake GUI. Project configuration settings may be specified interactively. Brief instructions are provided at the bottom of the window when the program is running. diff --git a/Help/manual/cmake-modules.7.rst b/Help/manual/cmake-modules.7.rst index cd5d1a5..940186a 100644 --- a/Help/manual/cmake-modules.7.rst +++ b/Help/manual/cmake-modules.7.rst @@ -35,6 +35,7 @@ These modules are loaded using the :command:`include` command. /module/CheckIncludeFiles /module/CheckLanguage /module/CheckLibraryExists + /module/CheckPIESupported /module/CheckPrototypeDefinition /module/CheckStructHasMember /module/CheckSymbolExists @@ -176,6 +177,7 @@ They are normally called through the :command:`find_package` command. /module/FindMPEG2 /module/FindMPEG /module/FindMPI + /module/FindOctave /module/FindODBC /module/FindOpenACC /module/FindOpenAL diff --git a/Help/manual/cmake-policies.7.rst b/Help/manual/cmake-policies.7.rst index 7c0fe6d..40ec1ef 100644 --- a/Help/manual/cmake-policies.7.rst +++ b/Help/manual/cmake-policies.7.rst @@ -57,6 +57,9 @@ Policies Introduced by CMake 3.14 .. toctree:: :maxdepth: 1 + CMP0087: install(SCRIPT | CODE) supports generator expressions. </policy/CMP0087> + CMP0086: UseSWIG honors SWIG_MODULE_NAME via -module flag. </policy/CMP0086> + CMP0085: IN_LIST generator expression handles empty list items. </policy/CMP0085> CMP0084: The FindQt module does not exist for find_package(). </policy/CMP0084> CMP0083: Add PIE options when linking executable. </policy/CMP0083> CMP0082: Install rules from add_subdirectory() are interleaved with those in caller. </policy/CMP0082> diff --git a/Help/manual/cmake.1.rst b/Help/manual/cmake.1.rst index b11526c..915e0d4 100644 --- a/Help/manual/cmake.1.rst +++ b/Help/manual/cmake.1.rst @@ -8,37 +8,164 @@ Synopsis .. parsed-literal:: - cmake [<options>] {<path-to-source> | <path-to-existing-build>} - cmake [<options>] -S <path-to-source> -B <path-to-build> - cmake [{-D <var>=<value>}...] -P <cmake-script-file> - cmake --build <dir> [<options>...] [-- <build-tool-options>...] - cmake --open <dir> - cmake -E <command> [<options>...] - cmake --find-package <options>... + `Generate a Project Buildsystem`_ + cmake [<options>] <path-to-source> + cmake [<options>] <path-to-existing-build> + cmake [<options>] -S <path-to-source> -B <path-to-build> + + `Build a Project`_ + cmake --build <dir> [<options>] [-- <build-tool-options>] + + `Open a Project`_ + cmake --open <dir> + + `Run a Script`_ + cmake [{-D <var>=<value>}...] -P <cmake-script-file> + + `Run a Command-Line Tool`_ + cmake -E <command> [<options>] + + `Run the Find-Package Tool`_ + cmake --find-package [<options>] + + `View Help`_ + cmake --help[-<topic>] Description =========== -The "cmake" executable is the CMake command-line interface. It may be -used to configure projects in scripts. Project configuration settings -may be specified on the command line with the -D option. +The **cmake** executable is the command-line interface of the cross-platform +buildsystem generator CMake. The above `Synopsis`_ lists various actions +the tool can perform as described in sections below. + +To build a software project with CMake, `Generate a Project Buildsystem`_. +Optionally use **cmake** to `Build a Project`_ or just run the +corresponding build tool (e.g. ``make``) directly. **cmake** can also +be used to `View Help`_. + +The other actions are meant for use by software developers writing +scripts in the :manual:`CMake language <cmake-language(7)>` to support +their builds. + +For graphical user interfaces that may be used in place of **cmake**, +see :manual:`ccmake <ccmake(1)>` and :manual:`cmake-gui <cmake-gui(1)>`. +For command-line interfaces to the CMake testing and packaging facilities, +see :manual:`ctest <ctest(1)>` and :manual:`cpack <cpack(1)>`. + +For more information on CMake at large, `see also`_ the links at the end +of this manual. + + +Introduction to CMake Buildsystems +================================== + +A *buildsystem* describes how to build a project's executables and libraries +from its source code using a *build tool* to automate the process. For +example, a buildsystem may be a ``Makefile`` for use with a command-line +``make`` tool or a project file for an Integrated Development Environment +(IDE). In order to avoid maintaining multiple such buildsystems, a project +may specify its buildsystem abstractly using files written in the +:manual:`CMake language <cmake-language(7)>`. From these files CMake +generates a preferred buildsystem locally for each user through a backend +called a *generator*. + +To generate a buildsystem with CMake, the following must be selected: + +Source Tree + The top-level directory containing source files provided by the project. + The project specifies its buildsystem using files as described in the + :manual:`cmake-language(7)` manual, starting with a top-level file named + ``CMakeLists.txt``. These files specify build targets and their + dependencies as described in the :manual:`cmake-buildsystem(7)` manual. + +Build Tree + The top-level directory in which buildsystem files and build output + artifacts (e.g. executables and libraries) are to be stored. + CMake will write a ``CMakeCache.txt`` file to identify the directory + as a build tree and store persistent information such as buildsystem + configuration options. + + To maintain a pristine source tree, perform an *out-of-source* build + by using a separate dedicated build tree. An *in-source* build in + which the build tree is placed in the same directory as the source + tree is also supported, but discouraged. + +Generator + This chooses the kind of buildsystem to generate. See the + :manual:`cmake-generators(7)` manual for documentation of all generators. + Run ``cmake --help`` to see a list of generators available locally. + Optionally use the ``-G`` option below to specify a generator, or simply + accept the default CMake chooses for the current platform. + + When using one of the :ref:`Command-Line Build Tool Generators` + CMake expects that the environment needed by the compiler toolchain + is already configured in the shell. When using one of the + :ref:`IDE Build Tool Generators`, no particular environment is needed. + + +Generate a Project Buildsystem +============================== + +Run CMake with one of the following command signatures to specify the +source and build trees and generate a buildsystem: + +``cmake [<options>] <path-to-source>`` + Uses the current working directory as the build tree, and + ``<path-to-source>`` as the source tree. The specified path may + be absolute or relative to the current working directory. + The source tree must contain a ``CMakeLists.txt`` file and must + *not* contain a ``CMakeCache.txt`` file because the latter + identifies an existing build tree. For example: + + .. code-block:: console + + $ mkdir build ; cd build + $ cmake ../src + +``cmake [<options>] <path-to-existing-build>`` + Uses ``<path-to-existing-build>`` as the build tree, and loads the + path to the source tree from its ``CMakeCache.txt`` file, which must + have already been generated by a previous run of CMake. The specified + path may be absolute or relative to the current working directory. + For example: + + .. code-block:: console + + $ cd build + $ cmake . + +``cmake [<options>] -S <path-to-source> -B <path-to-build>`` + Uses ``<path-to-build>`` as the build tree and ``<path-to-source>`` + as the source tree. The specified paths may be absolute or relative + to the current working directory. The source tree must contain a + ``CMakeLists.txt`` file. The build tree will be created automatically + if it does not already exist. For example: + + .. code-block:: console + + $ cmake -S src -B build + +In all cases the ``<options>`` may be zero or more of the `Options`_ below. + +After generating a buildsystem one may use the corresponding native +build tool to build the project. For example, after using the +:generator:`Unix Makefiles` generator one may run ``make`` directly: + + .. code-block:: console + + $ make + $ make install -CMake is a cross-platform build system generator. Projects specify -their build process with platform-independent CMake listfiles included -in each directory of a source tree with the name CMakeLists.txt. -Users build a project by using CMake to generate a build system for a -native tool on their platform. +Alternatively, one may use **cmake** to `Build a Project`_ by +automatically choosing and invoking the appropriate native build tool. .. _`CMake Options`: Options -======= +------- .. include:: OPTIONS_BUILD.txt -``-E <command> [<options>...]`` - See `Command-Line Tool Mode`_. - ``-L[A][H]`` List non-advanced cached variables. @@ -50,30 +177,12 @@ Options display also advanced variables. If H is specified, it will also display help for each variable. -``--build <dir>`` - See `Build Tool Mode`_. - -``--open <dir>`` - Open the generated project in the associated application. This is - only supported by some generators. - ``-N`` View mode only. Only load the cache. Do not actually run configure and generate steps. -``-P <file>`` - Process script mode. - - Process the given cmake file as a script written in the CMake - language. No configure or generate step is performed and the cache - is not modified. If variables are defined using -D, this must be - done before the -P argument. - -``--find-package`` - See `Find-Package Tool Mode`_. - ``--graphviz=[file]`` Generate graphviz of dependencies, see :module:`CMakeGraphVizOptions` for more. @@ -142,17 +251,17 @@ Options in CMAKE_SOURCE_DIR and CMAKE_BINARY_DIR. This flag tells CMake to warn about other files as well. -.. include:: OPTIONS_HELP.txt - .. _`Build Tool Mode`: -Build Tool Mode +Build a Project =============== CMake provides a command-line signature to build an already-generated -project binary tree:: +project binary tree: - cmake --build <dir> [<options>...] [-- <build-tool-options>...] +.. code-block:: shell + + cmake --build <dir> [<options>] [-- <build-tool-options>] This abstracts a native build tool's command-line interface with the following options: @@ -185,12 +294,41 @@ following options: Run ``cmake --build`` with no options for quick help. -Command-Line Tool Mode -====================== -CMake provides builtin command-line tools through the signature:: +Open a Project +============== + +.. code-block:: shell + + cmake --open <dir> + +Open the generated project in the associated application. This is only +supported by some generators. + + +.. _`Script Processing Mode`: + +Run a Script +============ + +.. code-block:: shell - cmake -E <command> [<options>...] + cmake [{-D <var>=<value>}...] -P <cmake-script-file> + +Process the given cmake file as a script written in the CMake +language. No configure or generate step is performed and the cache +is not modified. If variables are defined using -D, this must be +done before the -P argument. + + +Run a Command-Line Tool +======================= + +CMake provides builtin command-line tools through the signature + +.. code-block:: shell + + cmake -E <command> [<options>] Run ``cmake -E`` or ``cmake -E help`` for a summary of commands. Available commands are: @@ -326,7 +464,7 @@ Available commands are: ``sleep <number>...`` Sleep for given number of seconds. -``tar [cxt][vf][zjJ] file.tar [<options>...] [--] [<file>...]`` +``tar [cxt][vf][zjJ] file.tar [<options>] [--] [<file>...]`` Create or extract a tar or zip archive. Options are: ``--`` @@ -379,24 +517,40 @@ The following ``cmake -E`` commands are available only on Windows: ``write_regv <key> <value>`` Write Windows registry value. -Find-Package Tool Mode -====================== -CMake provides a helper for Makefile-based projects with the signature:: +Run the Find-Package Tool +========================= - cmake --find-package <options>... +CMake provides a pkg-config like helper for Makefile-based projects: -This runs in a pkg-config like mode. +.. code-block:: shell -Search a package using :command:`find_package()` and print the resulting flags -to stdout. This can be used to use cmake instead of pkg-config to find -installed libraries in plain Makefile-based projects or in autoconf-based -projects (via ``share/aclocal/cmake.m4``). + cmake --find-package [<options>] + +It searches a package using :command:`find_package()` and prints the +resulting flags to stdout. This can be used instead of pkg-config +to find installed libraries in plain Makefile-based projects or in +autoconf-based projects (via ``share/aclocal/cmake.m4``). .. note:: This mode is not well-supported due to some technical limitations. It is kept for compatibility but should not be used in new projects. + +View Help +========= + +To print selected pages from the CMake documentation, use + +.. code-block:: shell + + cmake --help[-<topic>] + +with one of the following options: + +.. include:: OPTIONS_HELP.txt + + See Also ======== diff --git a/Help/manual/cpack.1.rst b/Help/manual/cpack.1.rst index 6159d7b..679c547 100644 --- a/Help/manual/cpack.1.rst +++ b/Help/manual/cpack.1.rst @@ -13,12 +13,29 @@ Synopsis Description =========== -The ``cpack`` executable is the CMake packaging program. -CMake projects use :command:`install` commands to define the contents of -packages which can be generated in various formats by this tool. -The :module:`CPack` module greatly simplifies the creation of the input file -used by ``cpack``, allowing most aspects of the packaging configuration to be -controlled directly from the CMake project's own ``CMakeLists.txt`` files. +The **cpack** executable is the CMake packaging program. It generates +installers and source packages in a variety of formats. + +For each installer or package format, **cpack** has a specific backend, +called "generator". A generator is responsible for generating the required +inputs and invoking the specific package creation tools. These installer +or package generators are not to be confused with the makefile generators +of the :manual:`cmake <cmake(1)>` command. + +All supported generators are specified in the :manual:`cpack-generators +<cpack-generators(7)>` manual. The command ``cpack --help`` prints a +list of generators supported for the target platform. Which of them are +to be used can be selected through the :variable:`CPACK_GENERATOR` variable +or through the command-line option ``-G``. + +The **cpack** program is steered by a configuration file written in the +:manual:`CMake language <cmake-language(7)>`. Unless chosen differently +through the command-line option ``--config``, the file ``CPackConfig.cmake`` +in the current directory is used. + +In the standard CMake workflow, the file ``CPackConfig.cmake`` is generated +by the :manual:`cmake <cmake(1)>` executable, provided the :module:`CPack` +module is included by the project's ``CMakeLists.txt`` file. Options ======= @@ -27,14 +44,9 @@ Options ``<generators>`` is a :ref:`semicolon-separated list <CMake Language Lists>` of generator names. ``cpack`` will iterate through this list and produce package(s) in that generator's format according to the details provided in - the ``CPackConfig.cmake`` configuration file. A generator is responsible for - generating the required inputs for a particular package system and invoking - that system's package creation tools. All supported generators are specified - in the :manual:`Generators <cpack-generators(7)>` section of the manual and - the ``--help`` option lists the generators supported for the target platform. - - If this option is not given, the :variable:`CPACK_GENERATOR` variable - determines the default set of generators that will be used. + the ``CPackConfig.cmake`` configuration file. If this option is not given, + the :variable:`CPACK_GENERATOR` variable determines the default set of + generators that will be used. ``-C <Configuration>`` Specify the project configuration to be packaged (e.g. ``Debug``, diff --git a/Help/manual/ctest.1.rst b/Help/manual/ctest.1.rst index e24b10d..1ef20ab 100644 --- a/Help/manual/ctest.1.rst +++ b/Help/manual/ctest.1.rst @@ -19,7 +19,7 @@ Synopsis Description =========== -The "ctest" executable is the CMake test driver program. +The **ctest** executable is the CMake test driver program. CMake-generated build trees created for projects that use the ENABLE_TESTING and ADD_TEST commands have testing support. This program will run the tests and report results. @@ -38,7 +38,7 @@ Options ``--progress`` Enable short progress output from tests. - When the output of ``ctest`` is being sent directly to a terminal, the + When the output of **ctest** is being sent directly to a terminal, the progress through the set of tests is reported by updating the same line rather than printing start and end messages for each test on new lines. This can significantly reduce the verbosity of the test output. @@ -313,10 +313,11 @@ See `Build and Test Mode`_. Do not use. ``--timeout <seconds>`` - Set a global timeout on all tests. + Set the default test timeout. - This option will set a global timeout on all tests that do not - already have a timeout set on them. + This option effectively sets a timeout on all tests that do not + already have a timeout set on them via the :prop_test:`TIMEOUT` + property. ``--stop-time <time>`` Set a time at which all tests should stop running. @@ -1069,7 +1070,7 @@ Configuration settings include: * :module:`CTest` module variable: ``BUILDNAME`` ``CDashVersion`` - Specify the version of `CDash`_ on the server. + Legacy option. Not used. * `CTest Script`_ variable: none, detected from server * :module:`CTest` module variable: ``CTEST_CDASH_VERSION`` @@ -1106,17 +1107,14 @@ Configuration settings include: ``DropMethod`` Specify the method by which results should be submitted to the - dashboard server. The value may be ``cp``, ``ftp``, ``http``, - ``https``, ``scp``, or ``xmlrpc`` (if CMake was built with - support for it). + dashboard server. The value may be ``http`` or ``https``. * `CTest Script`_ variable: :variable:`CTEST_DROP_METHOD` * :module:`CTest` module variable: ``DROP_METHOD`` if set, else ``CTEST_DROP_METHOD`` ``DropSite`` - The dashboard server name - (for ``ftp``, ``http``, and ``https``, ``scp``, and ``xmlrpc``). + The dashboard server name. * `CTest Script`_ variable: :variable:`CTEST_DROP_SITE` * :module:`CTest` module variable: ``DROP_SITE`` if set, @@ -1139,14 +1137,13 @@ Configuration settings include: else ``CTEST_DROP_SITE_USER`` ``IsCDash`` - Specify whether the dashboard server is `CDash`_ or an older - dashboard server implementation requiring ``TriggerSite``. + Legacy option. Not used. * `CTest Script`_ variable: :variable:`CTEST_DROP_SITE_CDASH` * :module:`CTest` module variable: ``CTEST_DROP_SITE_CDASH`` ``ScpCommand`` - ``scp`` command-line tool to use when ``DropMethod`` is ``scp``. + Legacy option. Not used. * `CTest Script`_ variable: :variable:`CTEST_SCP_COMMAND` * :module:`CTest` module variable: ``SCPCOMMAND`` @@ -1160,8 +1157,7 @@ Configuration settings include: initialized by the :command:`site_name` command ``TriggerSite`` - Legacy option to support older dashboard server implementations. - Not used when ``IsCDash`` is true. + Legacy option. Not used. * `CTest Script`_ variable: :variable:`CTEST_TRIGGER_SITE` * :module:`CTest` module variable: ``TRIGGER_SITE`` if set, diff --git a/Help/module/CheckPIESupported.rst b/Help/module/CheckPIESupported.rst new file mode 100644 index 0000000..02e7b43 --- /dev/null +++ b/Help/module/CheckPIESupported.rst @@ -0,0 +1 @@ +.. cmake-module:: ../../Modules/CheckPIESupported.cmake diff --git a/Help/module/FindOctave.rst b/Help/module/FindOctave.rst new file mode 100644 index 0000000..2dbcec4 --- /dev/null +++ b/Help/module/FindOctave.rst @@ -0,0 +1 @@ +.. cmake-module:: ../../Modules/FindOctave.cmake diff --git a/Help/policy/CMP0078.rst b/Help/policy/CMP0078.rst index 54cdc9c..2e97934 100644 --- a/Help/policy/CMP0078.rst +++ b/Help/policy/CMP0078.rst @@ -1,6 +1,8 @@ CMP0078 ------- +:module:`UseSWIG` generates standard target names. + Starting with CMake 3.13, :module:`UseSWIG` generates now standard target names. This policy provides compatibility with projects that expect the legacy behavior. diff --git a/Help/policy/CMP0083.rst b/Help/policy/CMP0083.rst index 7b467b0..b26d6c8 100644 --- a/Help/policy/CMP0083.rst +++ b/Help/policy/CMP0083.rst @@ -17,8 +17,46 @@ is set: passed to the linker step. For example ``-no-pie`` for ``GCC``. * Not set: no flags are passed to the linker step. +Since a given linker may not support ``PIE`` flags in all environments in +which it is used, it is the project's responsibility to use the +:module:`CheckPIESupported` module to check for support to ensure that the +:prop_tgt:`POSITION_INDEPENDENT_CODE` target property for executables will be +honored at link time. + This policy was introduced in CMake version 3.14. CMake version |release| warns when the policy is not set and uses ``OLD`` behavior. Use the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly. .. include:: DEPRECATED.txt + +Examples +^^^^^^^^ + +Behave like CMake 3.13 and do not apply any ``PIE`` flags at link stage. + +.. code-block:: cmake + + cmake_minimum_required(VERSION 3.13) + project(foo) + + # ... + + add_executable(foo ...) + set_property(TARGET foo PROPERTY POSITION_INDEPENDENT_CODE TRUE) + +Use the :module:`CheckPIESupported` module to detect whether ``PIE`` is +supported by the current linker and environment. Apply ``PIE`` flags only +if the linker supports them. + +.. code-block:: cmake + + cmake_minimum_required(VERSION 3.14) # CMP0083 NEW + project(foo) + + include(CheckPIESupported) + check_pie_supported() + + # ... + + add_executable(foo ...) + set_property(TARGET foo PROPERTY POSITION_INDEPENDENT_CODE TRUE) diff --git a/Help/policy/CMP0085.rst b/Help/policy/CMP0085.rst new file mode 100644 index 0000000..d9ec9a2 --- /dev/null +++ b/Help/policy/CMP0085.rst @@ -0,0 +1,21 @@ +CMP0085 +------- + +``$<IN_LIST:...>`` handles empty list items. + +In CMake 3.13 and lower, the ``$<IN_LIST:...>`` generator expression always +returned ``0`` if the first argument was empty, even if the list contained an +empty item. This behavior is inconsistent with the ``IN_LIST`` behavior of +:command:`if`, which this generator expression is meant to emulate. CMake 3.14 +and later handles this case correctly. + +The ``OLD`` behavior of this policy is for ``$<IN_LIST:...>`` to always return +``0`` if the first argument is empty. The ``NEW`` behavior is to return ``1`` +if the first argument is empty and the list contains an empty item. + +This policy was introduced in CMake version 3.14. CMake version +|release| warns when the policy is not set and uses ``OLD`` behavior. +Use the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` +explicitly. + +.. include:: DEPRECATED.txt diff --git a/Help/policy/CMP0086.rst b/Help/policy/CMP0086.rst new file mode 100644 index 0000000..4a9e8b8 --- /dev/null +++ b/Help/policy/CMP0086.rst @@ -0,0 +1,20 @@ +CMP0086 +------- + +:module:`UseSWIG` honors ``SWIG_MODULE_NAME`` via ``-module`` flag. + +Starting with CMake 3.14, :module:`UseSWIG` passes option +``-module <module_name>`` to ``SWIG`` compiler if the file property +``SWIG_MODULE_NAME`` is specified. This policy provides compatibility with +projects that expect the legacy behavior. + +The ``OLD`` behavior for this policy is to never pass ``-module`` option. +The ``NEW`` behavior is to pass ``-module`` option to ``SWIG`` compiler if +``SWIG_MODULE_NAME`` is specified. + +This policy was introduced in CMake version 3.14. CMake version +|release| warns when the policy is not set and uses ``OLD`` behavior. +Use the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` +explicitly. + +.. include:: DEPRECATED.txt diff --git a/Help/policy/CMP0087.rst b/Help/policy/CMP0087.rst new file mode 100644 index 0000000..4c45b99 --- /dev/null +++ b/Help/policy/CMP0087.rst @@ -0,0 +1,29 @@ +CMP0087 +------- + +:command:`install(CODE)` and :command:`install(SCRIPT)` support generator +expressions. + +In CMake 3.13 and earlier, :command:`install(CODE)` and +:command:`install(SCRIPT)` did not evaluate generator expressions. CMake 3.14 +and later will evaluate generator expressions for :command:`install(CODE)` and +:command:`install(SCRIPT)`. + +The ``OLD`` behavior of this policy is for :command:`install(CODE)` and +:command:`install(SCRIPT)` to not evaluate generator expressions. The ``NEW`` +behavior is to evaluate generator expressions for :command:`install(CODE)` and +:command:`install(SCRIPT)`. + +Note that it is the value of this policy setting at the end of the directory +scope that is important, not its setting at the time of the call to +:command:`install(CODE)` or :command:`install(SCRIPT)`. This has implications +for calling these commands from places that have their own policy scope but not +their own directory scope (e.g. from files brought in via :command:`include()` +rather than :command:`add_subdirectory()`). + +This policy was introduced in CMake version 3.14. CMake version +|release| warns when the policy is not set and uses ``OLD`` behavior. +Use the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` +explicitly. + +.. include:: DEPRECATED.txt diff --git a/Help/prop_tgt/AUTOGEN_ORIGIN_DEPENDS.rst b/Help/prop_tgt/AUTOGEN_ORIGIN_DEPENDS.rst index f61089a..022bab5 100644 --- a/Help/prop_tgt/AUTOGEN_ORIGIN_DEPENDS.rst +++ b/Help/prop_tgt/AUTOGEN_ORIGIN_DEPENDS.rst @@ -5,22 +5,34 @@ Switch for forwarding origin target dependencies to the corresponding ``_autogen`` target. Targets which have their :prop_tgt:`AUTOMOC` or :prop_tgt:`AUTOUIC` property -``ON`` have a corresponding ``_autogen`` target which is used to auto generate +``ON`` have a corresponding ``_autogen`` target which generates ``moc`` and ``uic`` files. As this ``_autogen`` target is created at -generate-time, it is not possible to define dependencies of it, -such as to create inputs for the ``moc`` or ``uic`` executable. - -The dependencies of the ``_autogen`` target are composed from - -- the origin target dependencies - (by default enabled via :prop_tgt:`AUTOGEN_ORIGIN_DEPENDS`) -- user defined dependencies from :prop_tgt:`AUTOGEN_TARGET_DEPENDS` - -:prop_tgt:`AUTOGEN_ORIGIN_DEPENDS` decides whether the origin target -dependencies should be forwarded to the ``_autogen`` target or not. +generate-time, it is not possible to define dependencies of it using +e.g. :command:`add_dependencies`. Instead the +:prop_tgt:`AUTOGEN_ORIGIN_DEPENDS` target property decides whether the origin +target dependencies should be forwarded to the ``_autogen`` target or not. By default :prop_tgt:`AUTOGEN_ORIGIN_DEPENDS` is initialized from :variable:`CMAKE_AUTOGEN_ORIGIN_DEPENDS` which is ``ON`` by default. +In total the dependencies of the ``_autogen`` target are composed from + +- forwarded origin target dependencies + (enabled by default via :prop_tgt:`AUTOGEN_ORIGIN_DEPENDS`) +- additional user defined dependencies from :prop_tgt:`AUTOGEN_TARGET_DEPENDS` + See the :manual:`cmake-qt(7)` manual for more information on using CMake with Qt. + +Note +^^^^ + +Disabling :prop_tgt:`AUTOGEN_ORIGIN_DEPENDS` is useful to avoid building of +origin target dependencies when building the ``_autogen`` target only. +This is especially interesting when a +:variable:`global autogen target <CMAKE_GLOBAL_AUTOGEN_TARGET>` is enabled. + +When the ``_autogen`` target doesn't require all the origin target's +dependencies, and :prop_tgt:`AUTOGEN_ORIGIN_DEPENDS` is disabled, it might be +necessary to extend :prop_tgt:`AUTOGEN_TARGET_DEPENDS` to add missing +dependencies. diff --git a/Help/prop_tgt/AUTOGEN_TARGET_DEPENDS.rst b/Help/prop_tgt/AUTOGEN_TARGET_DEPENDS.rst index 84c2bfe..d5c5e14 100644 --- a/Help/prop_tgt/AUTOGEN_TARGET_DEPENDS.rst +++ b/Help/prop_tgt/AUTOGEN_TARGET_DEPENDS.rst @@ -1,23 +1,22 @@ AUTOGEN_TARGET_DEPENDS ---------------------- -Target dependencies of the corresponding ``_autogen`` target. +Additional target dependencies of the corresponding ``_autogen`` target. Targets which have their :prop_tgt:`AUTOMOC` or :prop_tgt:`AUTOUIC` property -``ON`` have a corresponding ``_autogen`` target which is used to auto generate +``ON`` have a corresponding ``_autogen`` target which generates ``moc`` and ``uic`` files. As this ``_autogen`` target is created at -generate-time, it is not possible to define dependencies of it, -such as to create inputs for the ``moc`` or ``uic`` executable. +generate-time, it is not possible to define dependencies of it using +e.g. :command:`add_dependencies`. Instead the +:prop_tgt:`AUTOGEN_TARGET_DEPENDS` target property can be set to a +:ref:`;-list <CMake Language Lists>` of additional dependencies for the +``_autogen`` target. Dependencies can be target names or file names. -The dependencies of the ``_autogen`` target are composed from +In total the dependencies of the ``_autogen`` target are composed from -- the origin target dependencies - (by default enabled via :prop_tgt:`AUTOGEN_ORIGIN_DEPENDS`) -- user defined dependencies from :prop_tgt:`AUTOGEN_TARGET_DEPENDS` - -The :prop_tgt:`AUTOGEN_TARGET_DEPENDS` target property can be set to a -list of additional dependencies for the ``_autogen`` target. Dependencies -can be target names or file names. +- forwarded origin target dependencies + (enabled by default via :prop_tgt:`AUTOGEN_ORIGIN_DEPENDS`) +- additional user defined dependencies from :prop_tgt:`AUTOGEN_TARGET_DEPENDS` See the :manual:`cmake-qt(7)` manual for more information on using CMake with Qt. @@ -32,6 +31,6 @@ If :prop_tgt:`AUTOMOC` or :prop_tgt:`AUTOUIC` depends on a file that is either - a :prop_sf:`GENERATED` C++ file that isn't recognized by :prop_tgt:`AUTOMOC` and :prop_tgt:`AUTOUIC` because it's skipped by :prop_sf:`SKIP_AUTOMOC`, :prop_sf:`SKIP_AUTOUIC`, :prop_sf:`SKIP_AUTOGEN` or :policy:`CMP0071` or -- a file that isn't in the target's sources +- a file that isn't in the origin target's sources it must added to :prop_tgt:`AUTOGEN_TARGET_DEPENDS`. diff --git a/Help/prop_tgt/POSITION_INDEPENDENT_CODE.rst b/Help/prop_tgt/POSITION_INDEPENDENT_CODE.rst index 54af8c6..0aaf66b 100644 --- a/Help/prop_tgt/POSITION_INDEPENDENT_CODE.rst +++ b/Help/prop_tgt/POSITION_INDEPENDENT_CODE.rst @@ -9,3 +9,8 @@ property is ``True`` by default for ``SHARED`` and ``MODULE`` library targets and ``False`` otherwise. This property is initialized by the value of the :variable:`CMAKE_POSITION_INDEPENDENT_CODE` variable if it is set when a target is created. + +.. note:: + + For executable targets, the link step is controlled by the :policy:`CMP0083` + policy and the :module:`CheckPIESupported` module. diff --git a/Help/release/3.13.rst b/Help/release/3.13.rst index 9f7e61f..68e05c3 100644 --- a/Help/release/3.13.rst +++ b/Help/release/3.13.rst @@ -239,3 +239,16 @@ Other Changes These internal implementation modules are also no longer available to scripts that may have been incorrectly including them, because they should never have been available in the first place. + +Updates +======= + +Changes made since CMake 3.13.0 include the following. + +3.13.2 +------ + +* CMake 3.13.0 included a change to pass compiler implicit include + directories to the ``moc`` tool for :prop_tgt:`AUTOMOC`. This has + been reverted due to regressing existing builds and will need + further investigation before being re-introduced in a later release. diff --git a/Help/release/dev/FindCURL-components.rst b/Help/release/dev/FindCURL-components.rst new file mode 100644 index 0000000..9c50ede --- /dev/null +++ b/Help/release/dev/FindCURL-components.rst @@ -0,0 +1,5 @@ +FindCURL-components +------------------- + +* The :module:`FindCURL` module gained support for requesting + protocols as package components. diff --git a/Help/release/dev/FindGIF-modernize.rst b/Help/release/dev/FindGIF-modernize.rst new file mode 100644 index 0000000..3bb4821 --- /dev/null +++ b/Help/release/dev/FindGIF-modernize.rst @@ -0,0 +1,4 @@ +FindGIF-modernize +----------------- + +* The :module:`FindGIF` module now provides imported targets. diff --git a/Help/release/dev/FindLibLZMA-target.rst b/Help/release/dev/FindLibLZMA-target.rst new file mode 100644 index 0000000..a13c45f --- /dev/null +++ b/Help/release/dev/FindLibLZMA-target.rst @@ -0,0 +1,4 @@ +FindLibLZMA-target +------------------ + +* The :module:`FindLibLZMA` module now provides an imported target. diff --git a/Help/release/dev/FindOctave.rst b/Help/release/dev/FindOctave.rst new file mode 100644 index 0000000..fe3b242 --- /dev/null +++ b/Help/release/dev/FindOctave.rst @@ -0,0 +1,4 @@ +FindOctave +---------- + +* A :module:`FindOctave` module was added to find GNU octave. diff --git a/Help/release/dev/FindX11-imported-targets.rst b/Help/release/dev/FindX11-imported-targets.rst new file mode 100644 index 0000000..4df753d --- /dev/null +++ b/Help/release/dev/FindX11-imported-targets.rst @@ -0,0 +1,32 @@ +FindX11-imported-targets +------------------------ + +* The :module:`FindX11` had the following variables renamed in order to match + their library names rather than header names. The old variables are provided + for compatibility: + + - ``X11_Xxf86misc_INCLUDE_PATH`` instead of ``X11_xf86misc_INCLUDE_PATH`` + - ``X11_Xxf86misc_LIB`` instead of ``X11_xf86misc_LIB`` + - ``X11_Xxf86misc_FOUND`` instead of ``X11_xf86misc_FOUND`` + - ``X11_Xxf86vm_INCLUDE_PATH`` instead of ``X11_xf86vmode_INCLUDE_PATH`` + - ``X11_Xxf86vm_LIB`` instead of ``X11_xf86vmode_LIB`` + - ``X11_Xxf86vm_FOUND`` instead of ``X11_xf86vmode_FOUND`` + - ``X11_xkbfile_INCLUDE_PATH`` instead of ``X11_Xkbfile_INCLUDE_PATH`` + - ``X11_xkbfile_LIB`` instead of ``X11_Xkbfile_LIB`` + - ``X11_xkbfile_FOUND`` instead of ``X11_Xkbfile_FOUND`` + - ``X11_Xtst_INCLUDE_PATH`` instead of ``X11_XTest_INCLUDE_PATH`` + - ``X11_Xtst_LIB`` instead of ``X11_XTest_LIB`` + - ``X11_Xtst_FOUND`` instead of ``X11_XTest_FOUND`` + - ``X11_Xss_INCLUDE_PATH`` instead of ``X11_Xscreensaver_INCLUDE_PATH`` + - ``X11_Xss_LIB`` instead of ``X11_Xscreensaver_LIB`` + - ``X11_Xss_FOUND`` instead of ``X11_Xscreensaver_FOUND`` + + The following variables are deprecated completely since they were + essentially duplicates: + + - ``X11_Xinput_INCLUDE_PATH`` (use ``X11_Xi_INCLUDE_PATH``) + - ``X11_Xinput_LIB`` (use ``X11_Xi_LIB``) + - ``X11_Xinput_FOUND`` (use ``X11_Xi_FOUND``) + +* The :module:`FindX11` now provides ``X11_Xext_INCLUDE_PATH``. +* The :module:`FindX11` now provides imported targets. diff --git a/Help/release/dev/UseSWIG-CMP0086.rst b/Help/release/dev/UseSWIG-CMP0086.rst new file mode 100644 index 0000000..d6fd0d1 --- /dev/null +++ b/Help/release/dev/UseSWIG-CMP0086.rst @@ -0,0 +1,6 @@ +UseSWIG-CMP0086 +--------------- + +* The :module:`UseSWIG` module passes option ``-module <module_name>`` to + ``SWIG`` compiler if the file property ``SWIG_MODULE_NAME`` is defined. + See policy :policy:`CMP0086`. diff --git a/Help/release/dev/UseSWIG-source-file-ext.rst b/Help/release/dev/UseSWIG-source-file-ext.rst new file mode 100644 index 0000000..5d11dc6 --- /dev/null +++ b/Help/release/dev/UseSWIG-source-file-ext.rst @@ -0,0 +1,5 @@ +UseSWIG-source-file-ext +----------------------- + +* The :module:`UseSWIG` module gains capability to specify + ``SWIG`` source file extensions. diff --git a/Help/release/dev/check-functions-LINK_OPTIONS.rst b/Help/release/dev/check-functions-LINK_OPTIONS.rst new file mode 100644 index 0000000..a6bfed2 --- /dev/null +++ b/Help/release/dev/check-functions-LINK_OPTIONS.rst @@ -0,0 +1,5 @@ +check-functions-LINK_OPTIONS +---------------------------- + +* The family of modules to check capabilities (like + :module:`CheckCSourceCompiles`) gain capability to manage ``LINK_OPTIONS``. diff --git a/Help/release/dev/cpack-deb-tar-format.rst b/Help/release/dev/cpack-deb-tar-format.rst new file mode 100644 index 0000000..9296ec6 --- /dev/null +++ b/Help/release/dev/cpack-deb-tar-format.rst @@ -0,0 +1,7 @@ +cpack-deb-tar-format +-------------------- + +* The :module:`CPack` module no longer defaults to the ``paxr`` value in the + :variable:`CPACK_DEBIAN_ARCHIVE_TYPE` variable, because ``dpkg`` has + never supported the PAX tar format. The ``paxr`` value will be mapped + to ``gnutar`` and a deprecation message emitted. diff --git a/Help/release/dev/file-read_symlink.rst b/Help/release/dev/file-read_symlink.rst new file mode 100644 index 0000000..718802e --- /dev/null +++ b/Help/release/dev/file-read_symlink.rst @@ -0,0 +1,5 @@ +file-read_symlink +----------------- + +* The :command:`file` command learned a new sub-command, ``READ_SYMLINK``, + which can be used to determine the path that a symlink points to. diff --git a/Help/release/dev/file-size.rst b/Help/release/dev/file-size.rst new file mode 100644 index 0000000..4f0e196 --- /dev/null +++ b/Help/release/dev/file-size.rst @@ -0,0 +1,5 @@ +file-size +--------- + +* The :command:`file` command gained a ``SIZE`` mode to get the size + of a file on disk. diff --git a/Help/release/dev/fileapi.rst b/Help/release/dev/fileapi.rst new file mode 100644 index 0000000..c3f03ef --- /dev/null +++ b/Help/release/dev/fileapi.rst @@ -0,0 +1,5 @@ +fileapi +------- + +* A file-based api for clients to get semantic buildsystem information + has been added. See the :manual:`cmake-file-api(7)` manual. diff --git a/Help/release/dev/genex-in_list-empty-args.rst b/Help/release/dev/genex-in_list-empty-args.rst new file mode 100644 index 0000000..ec1c6c0 --- /dev/null +++ b/Help/release/dev/genex-in_list-empty-args.rst @@ -0,0 +1,5 @@ +genex-in_list-empty-args +------------------------ + +* The $<IN_LIST:...> generator expression now correctly handles an empty + argument. See :policy:`CMP0085` for details. diff --git a/Help/release/dev/install-code-script-genex.rst b/Help/release/dev/install-code-script-genex.rst new file mode 100644 index 0000000..a28a466 --- /dev/null +++ b/Help/release/dev/install-code-script-genex.rst @@ -0,0 +1,5 @@ +install-code-script-genex +------------------------- + +* The :command:`install(CODE)` and :command:`install(SCRIPT)` commands + learned to support generator expressions. See policy :policy:`CMP0087`. diff --git a/Help/release/dev/link-option-PIE.rst b/Help/release/dev/link-option-PIE.rst index 824ab2c..872343c 100644 --- a/Help/release/dev/link-option-PIE.rst +++ b/Help/release/dev/link-option-PIE.rst @@ -2,5 +2,8 @@ link-option-PIE --------------- * Required link options to manage Position Independent Executable are now - added when :prop_tgt:`POSITION_INDEPENDENT_CODE` is set. These flags are - controlled by policy :policy:`CMP0083`. + added when :prop_tgt:`POSITION_INDEPENDENT_CODE` is set. The project is + responsible for using the :module:`CheckPIESupported` module to check for + ``PIE`` support to ensure that the :prop_tgt:`POSITION_INDEPENDENT_CODE` + target property will be honored at link time for executables. This behavior + is controlled by policy :policy:`CMP0083`. diff --git a/Help/release/dev/object-library-link.rst b/Help/release/dev/object-library-link.rst new file mode 100644 index 0000000..990d915 --- /dev/null +++ b/Help/release/dev/object-library-link.rst @@ -0,0 +1,5 @@ +object-library-link +------------------- + +* Object library linking has been fixed to propagate transitive link + dependencies of object libraries to consuming targets. diff --git a/Help/release/dev/submit-method.rst b/Help/release/dev/submit-method.rst new file mode 100644 index 0000000..38f0b92 --- /dev/null +++ b/Help/release/dev/submit-method.rst @@ -0,0 +1,6 @@ +submit-method +------------- + +* CTest no longer supports submissions via ``ftp``, ``scp``, ``cp``, and + ``xmlrpc``. CDash is the only maintained testing dashboard for CTest, + and it only supports submissions over ``http`` and ``https``. diff --git a/Help/release/dev/try_compile-LINK_OPTIONS.rst b/Help/release/dev/try_compile-LINK_OPTIONS.rst new file mode 100644 index 0000000..1db485b --- /dev/null +++ b/Help/release/dev/try_compile-LINK_OPTIONS.rst @@ -0,0 +1,5 @@ +try_compile-LINK_OPTIONS +------------------------ + +* The commands :command:`try_compile` and :command:`try_run` gain new + option ``LINK_OPTIONS``. diff --git a/Help/variable/CMAKE_ARGC.rst b/Help/variable/CMAKE_ARGC.rst index aec9711..30db2a2 100644 --- a/Help/variable/CMAKE_ARGC.rst +++ b/Help/variable/CMAKE_ARGC.rst @@ -3,6 +3,6 @@ CMAKE_ARGC Number of command line arguments passed to CMake in script mode. -When run in :ref:`-P <CMake Options>` script mode, CMake sets this variable to -the number of command line arguments. See also :variable:`CMAKE_ARGV0`, -``1``, ``2`` ... +When run in :ref:`-P <Script Processing Mode>` script mode, CMake sets this +variable to the number of command line arguments. See also +:variable:`CMAKE_ARGV0`, ``1``, ``2`` ... diff --git a/Help/variable/CMAKE_ARGV0.rst b/Help/variable/CMAKE_ARGV0.rst index 8b1ecb7..c4d1c21 100644 --- a/Help/variable/CMAKE_ARGV0.rst +++ b/Help/variable/CMAKE_ARGV0.rst @@ -3,7 +3,7 @@ CMAKE_ARGV0 Command line argument passed to CMake in script mode. -When run in :ref:`-P <CMake Options>` script mode, CMake sets this variable to -the first command line argument. It then also sets ``CMAKE_ARGV1``, +When run in :ref:`-P <Script Processing Mode>` script mode, CMake sets this +variable to the first command line argument. It then also sets ``CMAKE_ARGV1``, ``CMAKE_ARGV2``, ... and so on, up to the number of command line arguments given. See also :variable:`CMAKE_ARGC`. diff --git a/Help/variable/CMAKE_GLOBAL_AUTOGEN_TARGET.rst b/Help/variable/CMAKE_GLOBAL_AUTOGEN_TARGET.rst index 75903ab..e82867d 100644 --- a/Help/variable/CMAKE_GLOBAL_AUTOGEN_TARGET.rst +++ b/Help/variable/CMAKE_GLOBAL_AUTOGEN_TARGET.rst @@ -16,3 +16,11 @@ By default :variable:`CMAKE_GLOBAL_AUTOGEN_TARGET` is unset. See the :manual:`cmake-qt(7)` manual for more information on using CMake with Qt. + +Note +^^^^ + +``<ORIGIN>_autogen`` targets by default inherit their origin target's +dependencies. This might result in unintended dependency target +builds when only ``<ORIGIN>_autogen`` targets are built. A solution is to +disable :prop_tgt:`AUTOGEN_ORIGIN_DEPENDS` on the respective origin targets. diff --git a/Help/variable/CTEST_SCP_COMMAND.rst b/Help/variable/CTEST_SCP_COMMAND.rst index 0f128b1..19ea8b3 100644 --- a/Help/variable/CTEST_SCP_COMMAND.rst +++ b/Help/variable/CTEST_SCP_COMMAND.rst @@ -1,5 +1,4 @@ CTEST_SCP_COMMAND ----------------- -Specify the CTest ``SCPCommand`` setting -in a :manual:`ctest(1)` dashboard client script. +Legacy option. Not used. diff --git a/Help/variable/CTEST_TRIGGER_SITE.rst b/Help/variable/CTEST_TRIGGER_SITE.rst index de92428..a50e405 100644 --- a/Help/variable/CTEST_TRIGGER_SITE.rst +++ b/Help/variable/CTEST_TRIGGER_SITE.rst @@ -1,5 +1,4 @@ CTEST_TRIGGER_SITE ------------------ -Specify the CTest ``TriggerSite`` setting -in a :manual:`ctest(1)` dashboard client script. +Legacy option. Not used. diff --git a/Modules/BasicConfigVersion-AnyNewerVersion.cmake.in b/Modules/BasicConfigVersion-AnyNewerVersion.cmake.in index bc78016..afffc04 100644 --- a/Modules/BasicConfigVersion-AnyNewerVersion.cmake.in +++ b/Modules/BasicConfigVersion-AnyNewerVersion.cmake.in @@ -18,6 +18,12 @@ else() endif() endif() + +# if the installed project requested no architecture check, don't perform the check +if("@CVF_ARCH_INDEPENDENT@") + return() +endif() + # if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it: if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "@CMAKE_SIZEOF_VOID_P@" STREQUAL "") return() diff --git a/Modules/BasicConfigVersion-ExactVersion.cmake.in b/Modules/BasicConfigVersion-ExactVersion.cmake.in index de4a23a..fe5c2e5 100644 --- a/Modules/BasicConfigVersion-ExactVersion.cmake.in +++ b/Modules/BasicConfigVersion-ExactVersion.cmake.in @@ -34,6 +34,11 @@ if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION) endif() +# if the installed project requested no architecture check, don't perform the check +if("@CVF_ARCH_INDEPENDENT@") + return() +endif() + # if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it: if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "@CMAKE_SIZEOF_VOID_P@" STREQUAL "") return() diff --git a/Modules/BasicConfigVersion-SameMajorVersion.cmake.in b/Modules/BasicConfigVersion-SameMajorVersion.cmake.in index a32245d..d885c0f 100644 --- a/Modules/BasicConfigVersion-SameMajorVersion.cmake.in +++ b/Modules/BasicConfigVersion-SameMajorVersion.cmake.in @@ -33,6 +33,11 @@ else() endif() +# if the installed project requested no architecture check, don't perform the check +if("@CVF_ARCH_INDEPENDENT@") + return() +endif() + # if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it: if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "@CMAKE_SIZEOF_VOID_P@" STREQUAL "") return() diff --git a/Modules/BasicConfigVersion-SameMinorVersion.cmake.in b/Modules/BasicConfigVersion-SameMinorVersion.cmake.in index 59ca253..bf055e8 100644 --- a/Modules/BasicConfigVersion-SameMinorVersion.cmake.in +++ b/Modules/BasicConfigVersion-SameMinorVersion.cmake.in @@ -37,6 +37,11 @@ else() endif() +# if the installed project requested no architecture check, don't perform the check +if("@CVF_ARCH_INDEPENDENT@") + return() +endif() + # if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it: if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "@CMAKE_SIZEOF_VOID_P@" STREQUAL "") return() diff --git a/Modules/BundleUtilities.cmake b/Modules/BundleUtilities.cmake index 10e5510..d5c47f8 100644 --- a/Modules/BundleUtilities.cmake +++ b/Modules/BundleUtilities.cmake @@ -877,9 +877,13 @@ function(fixup_bundle_item resolved_embedded_item exepath dirs) execute_process(COMMAND chmod u+w "${resolved_embedded_item}") endif() + # CMAKE_INSTALL_NAME_TOOL may not be set if executed in script mode + # Duplicated from CMakeFindBinUtils.cmake + find_program(CMAKE_INSTALL_NAME_TOOL NAMES install_name_tool HINTS ${_CMAKE_TOOLCHAIN_LOCATION}) + # Only if install_name_tool supports -delete_rpath: # - execute_process(COMMAND install_name_tool + execute_process(COMMAND ${CMAKE_INSTALL_NAME_TOOL} OUTPUT_VARIABLE install_name_tool_usage ERROR_VARIABLE install_name_tool_usage ) @@ -897,7 +901,7 @@ function(fixup_bundle_item resolved_embedded_item exepath dirs) # to install_name_tool: # if(changes) - set(cmd install_name_tool ${changes} "${resolved_embedded_item}") + set(cmd ${CMAKE_INSTALL_NAME_TOOL} ${changes} "${resolved_embedded_item}") execute_process(COMMAND ${cmd} RESULT_VARIABLE install_name_tool_result) if(NOT install_name_tool_result EQUAL 0) string(REPLACE ";" "' '" msg "'${cmd}'") diff --git a/Modules/CMakeBackwardCompatibilityC.cmake b/Modules/CMakeBackwardCompatibilityC.cmake index 5d86d73..775a513 100644 --- a/Modules/CMakeBackwardCompatibilityC.cmake +++ b/Modules/CMakeBackwardCompatibilityC.cmake @@ -59,9 +59,6 @@ if(NOT CMAKE_SKIP_COMPATIBILITY_TESTS) set (CMAKE_HP_PTHREADS ${CMAKE_HP_PTHREADS_INIT} CACHE BOOL "Use HP pthreads.") - set (CMAKE_USE_SPROC ${CMAKE_USE_SPROC_INIT} CACHE BOOL - "Use sproc libs.") - if(__ERASE_CMAKE_TRY_COMPILE_OSX_ARCHITECTURES) set(CMAKE_TRY_COMPILE_OSX_ARCHITECTURES) set(__ERASE_CMAKE_TRY_COMPILE_OSX_ARCHITECTURES) @@ -72,7 +69,6 @@ mark_as_advanced( CMAKE_HP_PTHREADS CMAKE_THREAD_LIBS CMAKE_USE_PTHREADS -CMAKE_USE_SPROC CMAKE_USE_WIN32_THREADS CMAKE_X_CFLAGS CMAKE_X_LIBS diff --git a/Modules/CMakeDetermineCCompiler.cmake b/Modules/CMakeDetermineCCompiler.cmake index 17706ea..1a0d8a6 100644 --- a/Modules/CMakeDetermineCCompiler.cmake +++ b/Modules/CMakeDetermineCCompiler.cmake @@ -136,7 +136,7 @@ endif () # "arm-unknown-nto-qnx6" instead of the correct "arm-unknown-nto-qnx6.3.0-" if (CMAKE_CROSSCOMPILING AND NOT _CMAKE_TOOLCHAIN_PREFIX) - if(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang") + if(CMAKE_C_COMPILER_ID MATCHES "GNU|Clang|QCC") get_filename_component(COMPILER_BASENAME "${CMAKE_C_COMPILER}" NAME) if (COMPILER_BASENAME MATCHES "^(.+-)(clang|g?cc)(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$") set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1}) @@ -145,7 +145,7 @@ if (CMAKE_CROSSCOMPILING AND NOT _CMAKE_TOOLCHAIN_PREFIX) set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_C_COMPILER_TARGET}-) endif() elseif(COMPILER_BASENAME MATCHES "qcc(\\.exe)?$") - if(CMAKE_C_COMPILER_TARGET MATCHES "gcc_nto([^_le]+)(le)?") + if(CMAKE_C_COMPILER_TARGET MATCHES "gcc_nto([a-z0-9]+_[0-9]+|[^_le]+)(le)?") set(_CMAKE_TOOLCHAIN_PREFIX nto${CMAKE_MATCH_1}-) endif() endif () diff --git a/Modules/CMakeDetermineCXXCompiler.cmake b/Modules/CMakeDetermineCXXCompiler.cmake index 70d17a1..0a0c37b 100644 --- a/Modules/CMakeDetermineCXXCompiler.cmake +++ b/Modules/CMakeDetermineCXXCompiler.cmake @@ -133,7 +133,7 @@ endif () if (CMAKE_CROSSCOMPILING AND NOT _CMAKE_TOOLCHAIN_PREFIX) - if("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU" OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") + if("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU|Clang|QCC") get_filename_component(COMPILER_BASENAME "${CMAKE_CXX_COMPILER}" NAME) if (COMPILER_BASENAME MATCHES "^(.+-)(clan)?[gc]\\+\\+(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$") set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1}) @@ -142,7 +142,7 @@ if (CMAKE_CROSSCOMPILING AND NOT _CMAKE_TOOLCHAIN_PREFIX) set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_CXX_COMPILER_TARGET}-) endif() elseif(COMPILER_BASENAME MATCHES "QCC(\\.exe)?$") - if(CMAKE_CXX_COMPILER_TARGET MATCHES "gcc_nto([^_le]+)(le)?") + if(CMAKE_CXX_COMPILER_TARGET MATCHES "gcc_nto([a-z0-9]+_[0-9]+|[^_le]+)(le)") set(_CMAKE_TOOLCHAIN_PREFIX nto${CMAKE_MATCH_1}-) endif() endif () diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake index 5e2df26a..050d3e7 100644 --- a/Modules/CMakeDetermineCompilerId.cmake +++ b/Modules/CMakeDetermineCompilerId.cmake @@ -659,13 +659,10 @@ function(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file) # set(CMAKE_EXECUTABLE_FORMAT "COFF" CACHE STRING "Executable file format") # endif() # -# # Mach-O files start with CAFEBABE or FEEDFACE, according to http://radio.weblogs.com/0100490/2003/01/28.html -# if("${CMAKE_EXECUTABLE_MAGIC}" MATCHES "cafebabe") -# set(CMAKE_EXECUTABLE_FORMAT "MACHO" CACHE STRING "Executable file format") -# endif() -# if("${CMAKE_EXECUTABLE_MAGIC}" MATCHES "feedface") -# set(CMAKE_EXECUTABLE_FORMAT "MACHO" CACHE STRING "Executable file format") -# endif() + # Mach-O files start with MH_MAGIC or MH_CIGAM + if("${CMAKE_EXECUTABLE_MAGIC}" MATCHES "feedface|cefaedfe|feedfacf|cffaedfe") + set(CMAKE_EXECUTABLE_FORMAT "MACHO" CACHE STRING "Executable file format") + endif() endif() if(NOT DEFINED CMAKE_EXECUTABLE_FORMAT) diff --git a/Modules/CMakePackageConfigHelpers.cmake b/Modules/CMakePackageConfigHelpers.cmake index bcc9bf8..22fc953 100644 --- a/Modules/CMakePackageConfigHelpers.cmake +++ b/Modules/CMakePackageConfigHelpers.cmake @@ -124,7 +124,8 @@ Generating a Package Version File write_basic_package_version_file(<filename> [VERSION <major.minor.patch>] - COMPATIBILITY <AnyNewerVersion|SameMajorVersion|SameMinorVersion|ExactVersion> ) + COMPATIBILITY <AnyNewerVersion|SameMajorVersion|SameMinorVersion|ExactVersion> + [ARCH_INDEPENDENT] ) Writes a file for use as ``<PackageName>ConfigVersion.cmake`` file to @@ -158,6 +159,18 @@ If your project has more elaborated version matching rules, you will need to write your own custom ``ConfigVersion.cmake`` file instead of using this macro. +If ``ARCH_INDEPENDENT`` is given, the installed package version will be +considered compatible even if it was built for a different architecture than +the requested architecture. Otherwise, an architecture check will be performed, +and the package will be considered compatible only if the architecture matches +exactly. For example, if the package is built for a 32-bit architecture, the +package is only considered compatible if it is used on a 32-bit architecture, +unless ``ARCH_INDEPENDENT`` is given, in which case the package is considered +compatible on any architecture. + +.. note:: ``ARCH_INDEPENDENT`` is intended for header-only libraries or similar + packages with no binaries. + Internally, this macro executes :command:`configure_file()` to create the resulting version file. Depending on the ``COMPATIBILITY``, the corresponding ``BasicConfigVersion-<COMPATIBILITY>.cmake.in`` file is used. diff --git a/Modules/CMakePushCheckState.cmake b/Modules/CMakePushCheckState.cmake index 7628d1a..f6bfc12 100644 --- a/Modules/CMakePushCheckState.cmake +++ b/Modules/CMakePushCheckState.cmake @@ -7,26 +7,27 @@ CMakePushCheckState -This module defines three macros: CMAKE_PUSH_CHECK_STATE() -CMAKE_POP_CHECK_STATE() and CMAKE_RESET_CHECK_STATE() These macros can +This module defines three macros: ``CMAKE_PUSH_CHECK_STATE()`` +``CMAKE_POP_CHECK_STATE()`` and ``CMAKE_RESET_CHECK_STATE()`` These macros can be used to save, restore and reset (i.e., clear contents) the state of -the variables CMAKE_REQUIRED_FLAGS, CMAKE_REQUIRED_DEFINITIONS, -CMAKE_REQUIRED_LIBRARIES, CMAKE_REQUIRED_INCLUDES and CMAKE_EXTRA_INCLUDE_FILES -used by the various Check-files coming with CMake, like e.g. -check_function_exists() etc. The variable contents are pushed on a -stack, pushing multiple times is supported. This is useful e.g. when -executing such tests in a Find-module, where they have to be set, but -after the Find-module has been executed they should have the same -value as they had before. - -CMAKE_PUSH_CHECK_STATE() macro receives optional argument RESET. -Whether it's specified, CMAKE_PUSH_CHECK_STATE() will set all -CMAKE_REQUIRED_* variables to empty values, same as -CMAKE_RESET_CHECK_STATE() call will do. +the variables ``CMAKE_REQUIRED_FLAGS``, ``CMAKE_REQUIRED_DEFINITIONS``, +``CMAKE_REQUIRED_LINK_OPTIONS``, ``CMAKE_REQUIRED_LIBRARIES``, +``CMAKE_REQUIRED_INCLUDES`` and ``CMAKE_EXTRA_INCLUDE_FILES`` used by the +various Check-files coming with CMake, like e.g. ``check_function_exists()`` +etc. +The variable contents are pushed on a stack, pushing multiple times is +supported. This is useful e.g. when executing such tests in a Find-module, +where they have to be set, but after the Find-module has been executed they +should have the same value as they had before. + +``CMAKE_PUSH_CHECK_STATE()`` macro receives optional argument ``RESET``. +Whether it's specified, ``CMAKE_PUSH_CHECK_STATE()`` will set all +``CMAKE_REQUIRED_*`` variables to empty values, same as +``CMAKE_RESET_CHECK_STATE()`` call will do. Usage: -:: +.. code-block:: cmake cmake_push_check_state(RESET) set(CMAKE_REQUIRED_DEFINITIONS -DSOME_MORE_DEF) @@ -42,6 +43,7 @@ macro(CMAKE_RESET_CHECK_STATE) set(CMAKE_EXTRA_INCLUDE_FILES) set(CMAKE_REQUIRED_INCLUDES) set(CMAKE_REQUIRED_DEFINITIONS) + set(CMAKE_REQUIRED_LINK_OPTIONS) set(CMAKE_REQUIRED_LIBRARIES) set(CMAKE_REQUIRED_FLAGS) set(CMAKE_REQUIRED_QUIET) @@ -56,12 +58,13 @@ macro(CMAKE_PUSH_CHECK_STATE) math(EXPR _CMAKE_PUSH_CHECK_STATE_COUNTER "${_CMAKE_PUSH_CHECK_STATE_COUNTER}+1") - set(_CMAKE_EXTRA_INCLUDE_FILES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_EXTRA_INCLUDE_FILES}) - set(_CMAKE_REQUIRED_INCLUDES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_INCLUDES}) - set(_CMAKE_REQUIRED_DEFINITIONS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_DEFINITIONS}) - set(_CMAKE_REQUIRED_LIBRARIES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_LIBRARIES}) - set(_CMAKE_REQUIRED_FLAGS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_FLAGS}) - set(_CMAKE_REQUIRED_QUIET_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_QUIET}) + set(_CMAKE_EXTRA_INCLUDE_FILES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_EXTRA_INCLUDE_FILES}) + set(_CMAKE_REQUIRED_INCLUDES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_INCLUDES}) + set(_CMAKE_REQUIRED_DEFINITIONS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_DEFINITIONS}) + set(_CMAKE_REQUIRED_LINK_OPTIONS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_LINK_OPTIONS}) + set(_CMAKE_REQUIRED_LIBRARIES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_LIBRARIES}) + set(_CMAKE_REQUIRED_FLAGS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_FLAGS}) + set(_CMAKE_REQUIRED_QUIET_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_QUIET}) if (${ARGC} GREATER 0 AND "${ARGV0}" STREQUAL "RESET") cmake_reset_check_state() @@ -74,12 +77,13 @@ macro(CMAKE_POP_CHECK_STATE) # don't pop more than we pushed if("${_CMAKE_PUSH_CHECK_STATE_COUNTER}" GREATER "0") - set(CMAKE_EXTRA_INCLUDE_FILES ${_CMAKE_EXTRA_INCLUDE_FILES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}}) - set(CMAKE_REQUIRED_INCLUDES ${_CMAKE_REQUIRED_INCLUDES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}}) - set(CMAKE_REQUIRED_DEFINITIONS ${_CMAKE_REQUIRED_DEFINITIONS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}}) - set(CMAKE_REQUIRED_LIBRARIES ${_CMAKE_REQUIRED_LIBRARIES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}}) - set(CMAKE_REQUIRED_FLAGS ${_CMAKE_REQUIRED_FLAGS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}}) - set(CMAKE_REQUIRED_QUIET ${_CMAKE_REQUIRED_QUIET_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}}) + set(CMAKE_EXTRA_INCLUDE_FILES ${_CMAKE_EXTRA_INCLUDE_FILES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}}) + set(CMAKE_REQUIRED_INCLUDES ${_CMAKE_REQUIRED_INCLUDES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}}) + set(CMAKE_REQUIRED_DEFINITIONS ${_CMAKE_REQUIRED_DEFINITIONS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}}) + set(CMAKE_REQUIRED_LINK_OPTIONS ${_CMAKE_REQUIRED_LINK_OPTIONS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}}) + set(CMAKE_REQUIRED_LIBRARIES ${_CMAKE_REQUIRED_LIBRARIES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}}) + set(CMAKE_REQUIRED_FLAGS ${_CMAKE_REQUIRED_FLAGS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}}) + set(CMAKE_REQUIRED_QUIET ${_CMAKE_REQUIRED_QUIET_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}}) math(EXPR _CMAKE_PUSH_CHECK_STATE_COUNTER "${_CMAKE_PUSH_CHECK_STATE_COUNTER}-1") endif() diff --git a/Modules/CPack.cmake b/Modules/CPack.cmake index ebce851..c9008db 100644 --- a/Modules/CPack.cmake +++ b/Modules/CPack.cmake @@ -10,20 +10,23 @@ Build binary and source package installers. Introduction ^^^^^^^^^^^^ -The CPack module generates binary and source installers in a variety of -formats using the cpack program. Inclusion of the CPack module adds -two new build targets, ``package`` and ``package_source``, which build -the binary and source installers respectively. The generated binary -installers contain everything installed via CMake's :command:`install` -command (and the deprecated :command:`install_files`, -:command:`install_programs` and :command:`install_targets` commands). +The CPack module generates a file ``CPackConfig.cmake`` intended for +use in a subsequent run of the :manual:`cpack <cpack(1)>` program +where it steers the generation of installers or/and source packages. + +Inclusion of the CPack module adds two new build targets, ``package`` +and ``package_source``, which build the binary and source installers +respectively. The generated binary installers contain everything +installed via CMake's :command:`install` command (and the deprecated +commands :command:`install_files`, :command:`install_programs`, and +:command:`install_targets`). For certain kinds of binary installers (including the graphical installers on macOS and Windows), CPack generates installers that allow users to select individual application components to install. See :module:`CPackComponent` module for further details. -CPack generators +CPack Generators ^^^^^^^^^^^^^^^^ The :variable:`CPACK_GENERATOR` variable has different meanings in different @@ -60,7 +63,7 @@ This is the key: For each generator listed in :variable:`CPACK_GENERATOR` in internally to *the one currently being used* and then include the :variable:`CPACK_PROJECT_CONFIG_FILE`. -Variables common to all CPack generators +Variables common to all CPack Generators ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Before including this CPack module in your ``CMakeLists.txt`` file, there @@ -250,6 +253,9 @@ installers. The most commonly-used variables are: received by the cpack program. Defaults to ``FALSE`` for backwards compatibility. +Variables for Source Package Generators +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + The following CPack variables are specific to source packages, and will not affect binary packages: @@ -284,6 +290,9 @@ will not affect binary packages: must be properly escaped), e.g., ``/CVS/;/\\.svn/;\\.swp$;\\.#;/#;.*~;cscope.*`` +Variables for Advanced Use +^^^^^^^^^^^^^^^^^^^^^^^^^^ + The following variables are for advanced uses of CPack: .. variable:: CPACK_CMAKE_GENERATOR diff --git a/Modules/CTest.cmake b/Modules/CTest.cmake index 2ea931d..8848bdd 100644 --- a/Modules/CTest.cmake +++ b/Modules/CTest.cmake @@ -27,7 +27,6 @@ to creating tests when testing is enabled. To enable submissions to a CDash server, create a ``CTestConfig.cmake`` file at the top of the project with content such as:: - set(CTEST_PROJECT_NAME "MyProject") set(CTEST_NIGHTLY_START_TIME "01:00:00 UTC") set(CTEST_DROP_METHOD "http") set(CTEST_DROP_SITE "my.cdash.org") @@ -178,9 +177,6 @@ if(BUILD_TESTING) ) set(MEMORYCHECK_SUPPRESSIONS_FILE "" CACHE FILEPATH "File that contains suppressions for the memory checker") - find_program(SCPCOMMAND scp DOC - "Path to scp command, used by CTest for submitting results to a Dart server" - ) find_program(COVERAGE_COMMAND gcov DOC "Path to the coverage program that CTest uses for performing coverage inspection" ) diff --git a/Modules/CheckCSourceCompiles.cmake b/Modules/CheckCSourceCompiles.cmake index 5b0b70e..77ba0cc 100644 --- a/Modules/CheckCSourceCompiles.cmake +++ b/Modules/CheckCSourceCompiles.cmake @@ -43,6 +43,10 @@ Check if given C source compiles and links into an executable. ``try_compile()``, i.e. the contents of the :prop_dir:`INCLUDE_DIRECTORIES` directory property will be ignored. + ``CMAKE_REQUIRED_LINK_OPTIONS`` + A :ref:`;-list <CMake Language Lists>` of options to add to the link + command (see :command:`try_compile` for further details). + ``CMAKE_REQUIRED_LIBRARIES`` A :ref:`;-list <CMake Language Lists>` of libraries to add to the link command. These can be the name of system libraries or they can be @@ -78,6 +82,12 @@ macro(CHECK_C_SOURCE_COMPILES SOURCE VAR) endforeach() set(MACRO_CHECK_FUNCTION_DEFINITIONS "-D${VAR} ${CMAKE_REQUIRED_FLAGS}") + if(CMAKE_REQUIRED_LINK_OPTIONS) + set(CHECK_C_SOURCE_COMPILES_ADD_LINK_OPTIONS + LINK_OPTIONS ${CMAKE_REQUIRED_LINK_OPTIONS}) + else() + set(CHECK_C_SOURCE_COMPILES_ADD_LINK_OPTIONS) + endif() if(CMAKE_REQUIRED_LIBRARIES) set(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES LINK_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES}) @@ -100,6 +110,7 @@ macro(CHECK_C_SOURCE_COMPILES SOURCE VAR) ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} + ${CHECK_C_SOURCE_COMPILES_ADD_LINK_OPTIONS} ${CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES} CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS} "${CHECK_C_SOURCE_COMPILES_ADD_INCLUDES}" diff --git a/Modules/CheckCSourceRuns.cmake b/Modules/CheckCSourceRuns.cmake index e682b29..eba70f2 100644 --- a/Modules/CheckCSourceRuns.cmake +++ b/Modules/CheckCSourceRuns.cmake @@ -42,6 +42,10 @@ subsequently be run. ``try_run()``, i.e. the contents of the :prop_dir:`INCLUDE_DIRECTORIES` directory property will be ignored. + ``CMAKE_REQUIRED_LINK_OPTIONS`` + A :ref:`;-list <CMake Language Lists>` of options to add to the link + command (see :command:`try_run` for further details). + ``CMAKE_REQUIRED_LIBRARIES`` A :ref:`;-list <CMake Language Lists>` of libraries to add to the link command. These can be the name of system libraries or they can be @@ -66,6 +70,12 @@ macro(CHECK_C_SOURCE_RUNS SOURCE VAR) if(NOT DEFINED "${VAR}") set(MACRO_CHECK_FUNCTION_DEFINITIONS "-D${VAR} ${CMAKE_REQUIRED_FLAGS}") + if(CMAKE_REQUIRED_LINK_OPTIONS) + set(CHECK_C_SOURCE_COMPILES_ADD_LINK_OPTIONS + LINK_OPTIONS ${CMAKE_REQUIRED_LINK_OPTIONS}) + else() + set(CHECK_C_SOURCE_COMPILES_ADD_LINK_OPTIONS) + endif() if(CMAKE_REQUIRED_LIBRARIES) set(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES LINK_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES}) @@ -88,6 +98,7 @@ macro(CHECK_C_SOURCE_RUNS SOURCE VAR) ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} + ${CHECK_C_SOURCE_COMPILES_ADD_LINK_OPTIONS} ${CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES} CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS} -DCMAKE_SKIP_RPATH:BOOL=${CMAKE_SKIP_RPATH} diff --git a/Modules/CheckCXXSourceCompiles.cmake b/Modules/CheckCXXSourceCompiles.cmake index f7ec8eb..cc457a5 100644 --- a/Modules/CheckCXXSourceCompiles.cmake +++ b/Modules/CheckCXXSourceCompiles.cmake @@ -43,6 +43,10 @@ Check if given C++ source compiles and links into an executable. ``try_compile()``, i.e. the contents of the :prop_dir:`INCLUDE_DIRECTORIES` directory property will be ignored. + ``CMAKE_REQUIRED_LINK_OPTIONS`` + A :ref:`;-list <CMake Language Lists>` of options to add to the link + command (see :command:`try_compile` for further details). + ``CMAKE_REQUIRED_LIBRARIES`` A :ref:`;-list <CMake Language Lists>` of libraries to add to the link command. These can be the name of system libraries or they can be @@ -79,6 +83,12 @@ macro(CHECK_CXX_SOURCE_COMPILES SOURCE VAR) set(MACRO_CHECK_FUNCTION_DEFINITIONS "-D${VAR} ${CMAKE_REQUIRED_FLAGS}") + if(CMAKE_REQUIRED_LINK_OPTIONS) + set(CHECK_CXX_SOURCE_COMPILES_ADD_LINK_OPTIONS + LINK_OPTIONS ${CMAKE_REQUIRED_LINK_OPTIONS}) + else() + set(CHECK_CXX_SOURCE_COMPILES_ADD_LINK_OPTIONS) + endif() if(CMAKE_REQUIRED_LIBRARIES) set(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES LINK_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES}) @@ -101,6 +111,7 @@ macro(CHECK_CXX_SOURCE_COMPILES SOURCE VAR) ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.cxx COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} + ${CHECK_CXX_SOURCE_COMPILES_ADD_LINK_OPTIONS} ${CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES} CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS} "${CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES}" diff --git a/Modules/CheckCXXSourceRuns.cmake b/Modules/CheckCXXSourceRuns.cmake index bdc2291..7db976b 100644 --- a/Modules/CheckCXXSourceRuns.cmake +++ b/Modules/CheckCXXSourceRuns.cmake @@ -42,6 +42,10 @@ subsequently be run. ``try_run()``, i.e. the contents of the :prop_dir:`INCLUDE_DIRECTORIES` directory property will be ignored. + ``CMAKE_REQUIRED_LINK_OPTIONS`` + A :ref:`;-list <CMake Language Lists>` of options to add to the link + command (see :command:`try_run` for further details). + ``CMAKE_REQUIRED_LIBRARIES`` A :ref:`;-list <CMake Language Lists>` of libraries to add to the link command. These can be the name of system libraries or they can be @@ -66,6 +70,12 @@ macro(CHECK_CXX_SOURCE_RUNS SOURCE VAR) if(NOT DEFINED "${VAR}") set(MACRO_CHECK_FUNCTION_DEFINITIONS "-D${VAR} ${CMAKE_REQUIRED_FLAGS}") + if(CMAKE_REQUIRED_LINK_OPTIONS) + set(CHECK_CXX_SOURCE_COMPILES_ADD_LINK_OPTIONS + LINK_OPTIONS ${CMAKE_REQUIRED_LINK_OPTIONS}) + else() + set(CHECK_CXX_SOURCE_COMPILES_ADD_LINK_OPTIONS) + endif() if(CMAKE_REQUIRED_LIBRARIES) set(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES LINK_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES}) @@ -88,6 +98,7 @@ macro(CHECK_CXX_SOURCE_RUNS SOURCE VAR) ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.cxx COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} + ${CHECK_CXX_SOURCE_COMPILES_ADD_LINK_OPTIONS} ${CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES} CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS} -DCMAKE_SKIP_RPATH:BOOL=${CMAKE_SKIP_RPATH} diff --git a/Modules/CheckCXXSymbolExists.cmake b/Modules/CheckCXXSymbolExists.cmake index d067001..970e301 100644 --- a/Modules/CheckCXXSymbolExists.cmake +++ b/Modules/CheckCXXSymbolExists.cmake @@ -7,35 +7,42 @@ CheckCXXSymbolExists Check if a symbol exists as a function, variable, or macro in C++ -.. code-block:: cmake +.. command:: CHECK_CXX_SYMBOL_EXISTS - CHECK_CXX_SYMBOL_EXISTS(<symbol> <files> <variable>) + .. code-block:: cmake -Check that the ``<symbol>`` is available after including given header -``<files>`` and store the result in a ``<variable>``. Specify the list of -files in one argument as a semicolon-separated list. -CHECK_CXX_SYMBOL_EXISTS() can be used to check in C++ files, as -opposed to CHECK_SYMBOL_EXISTS(), which works only for C. + CHECK_CXX_SYMBOL_EXISTS(<symbol> <files> <variable>) -If the header files define the symbol as a macro it is considered -available and assumed to work. If the header files declare the symbol -as a function or variable then the symbol must also be available for -linking. If the symbol is a type or enum value it will not be -recognized (consider using CheckTypeSize or CheckCSourceCompiles). + Check that the ``<symbol>`` is available after including given header + ``<files>`` and store the result in a ``<variable>``. Specify the list of + files in one argument as a semicolon-separated list. + ``CHECK_CXX_SYMBOL_EXISTS()`` can be used to check in C++ files, as + opposed to ``CHECK_SYMBOL_EXISTS()``, which works only for ``C``. + + If the header files define the symbol as a macro it is considered + available and assumed to work. If the header files declare the symbol + as a function or variable then the symbol must also be available for + linking. If the symbol is a type or enum value it will not be + recognized (consider using :module:`CheckTypeSize` + or :module:`CheckCSourceCompiles`). The following variables may be set before calling this macro to modify the way the check is run: ``CMAKE_REQUIRED_FLAGS`` - string of compile command line flags + string of compile command line flags. ``CMAKE_REQUIRED_DEFINITIONS`` - list of macros to define (-DFOO=bar) + a :ref:`;-list <CMake Language Lists>` of macros to define (-DFOO=bar). ``CMAKE_REQUIRED_INCLUDES`` - list of include directories + a :ref:`;-list <CMake Language Lists>` of header search paths to pass to + the compiler. +``CMAKE_REQUIRED_LINK_OPTIONS`` + a :ref:`;-list <CMake Language Lists>` of options to add to the link command. ``CMAKE_REQUIRED_LIBRARIES`` - list of libraries to link + a :ref:`;-list <CMake Language Lists>` of libraries to add to the link + command. See policy :policy:`CMP0075`. ``CMAKE_REQUIRED_QUIET`` - execute quietly without messages + execute quietly without messages. #]=======================================================================] include_guard(GLOBAL) diff --git a/Modules/CheckFortranFunctionExists.cmake b/Modules/CheckFortranFunctionExists.cmake index dc371aa..7ca205a 100644 --- a/Modules/CheckFortranFunctionExists.cmake +++ b/Modules/CheckFortranFunctionExists.cmake @@ -5,24 +5,33 @@ CheckFortranFunctionExists -------------------------- -:command:`Macro <macro>` which checks if a Fortran function exists. +Check if a Fortran function exists. -.. code-block:: cmake +.. command:: CHECK_FORTRAN_FUNCTION_EXISTS - CHECK_FORTRAN_FUNCTION_EXISTS(<function> <result>) + .. code-block:: cmake -where + CHECK_FORTRAN_FUNCTION_EXISTS(<function> <result>) -``<function>`` - the name of the Fortran function -``<result>`` - variable to store the result; will be created as an internal cache variable. + where + + ``<function>`` + the name of the Fortran function + ``<result>`` + variable to store the result; will be created as an internal cache variable. The following variables may be set before calling this macro to modify the way the check is run: +``CMAKE_REQUIRED_LINK_OPTIONS`` + A :ref:`;-list <CMake Language Lists>` of options to add to the link + command (see :command:`try_compile` for further details). + ``CMAKE_REQUIRED_LIBRARIES`` - list of libraries to link + A :ref:`;-list <CMake Language Lists>` of libraries to add to the link + command. These can be the name of system libraries or they can be + :ref:`Imported Targets <Imported Targets>` (see :command:`try_compile` for + further details). #]=======================================================================] include_guard(GLOBAL) @@ -30,6 +39,12 @@ include_guard(GLOBAL) macro(CHECK_FORTRAN_FUNCTION_EXISTS FUNCTION VARIABLE) if(NOT DEFINED ${VARIABLE}) message(STATUS "Looking for Fortran ${FUNCTION}") + if(CMAKE_REQUIRED_LINK_OPTIONS) + set(CHECK_FUNCTION_EXISTS_ADD_LINK_OPTIONS + LINK_OPTIONS ${CMAKE_REQUIRED_LINK_OPTIONS}) + else() + set(CHECK_FUNCTION_EXISTS_ADD_LINK_OPTIONS) + endif() if(CMAKE_REQUIRED_LIBRARIES) set(CHECK_FUNCTION_EXISTS_ADD_LIBRARIES LINK_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES}) @@ -48,6 +63,7 @@ macro(CHECK_FORTRAN_FUNCTION_EXISTS FUNCTION VARIABLE) try_compile(${VARIABLE} ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler.f + ${CHECK_FUNCTION_EXISTS_ADD_LINK_OPTIONS} ${CHECK_FUNCTION_EXISTS_ADD_LIBRARIES} OUTPUT_VARIABLE OUTPUT ) diff --git a/Modules/CheckFortranSourceCompiles.cmake b/Modules/CheckFortranSourceCompiles.cmake index 977b7b4..b3e83dd 100644 --- a/Modules/CheckFortranSourceCompiles.cmake +++ b/Modules/CheckFortranSourceCompiles.cmake @@ -49,6 +49,10 @@ Check if given Fortran source compiles and links into an executable. ``try_compile()``, i.e. the contents of the :prop_dir:`INCLUDE_DIRECTORIES` directory property will be ignored. + ``CMAKE_REQUIRED_LINK_OPTIONS`` + A :ref:`;-list <CMake Language Lists>` of options to add to the link + command (see :command:`try_compile` for further details). + ``CMAKE_REQUIRED_LIBRARIES`` A :ref:`;-list <CMake Language Lists>` of libraries to add to the link command. These can be the name of system libraries or they can be @@ -88,6 +92,12 @@ macro(CHECK_Fortran_SOURCE_COMPILES SOURCE VAR) endif() set(MACRO_CHECK_FUNCTION_DEFINITIONS "-D${VAR} ${CMAKE_REQUIRED_FLAGS}") + if(CMAKE_REQUIRED_LINK_OPTIONS) + set(CHECK_Fortran_SOURCE_COMPILES_ADD_LINK_OPTIONS + LINK_OPTIONS ${CMAKE_REQUIRED_LINK_OPTIONS}) + else() + set(CHECK_Fortran_SOURCE_COMPILES_ADD_LINK_OPTIONS) + endif() if(CMAKE_REQUIRED_LIBRARIES) set(CHECK_Fortran_SOURCE_COMPILES_ADD_LIBRARIES LINK_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES}) @@ -110,6 +120,7 @@ macro(CHECK_Fortran_SOURCE_COMPILES SOURCE VAR) ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.${_SRC_EXT} COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} + ${CHECK_Fortran_SOURCE_COMPILES_ADD_LINK_OPTIONS} ${CHECK_Fortran_SOURCE_COMPILES_ADD_LIBRARIES} CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS} "${CHECK_Fortran_SOURCE_COMPILES_ADD_INCLUDES}" diff --git a/Modules/CheckFunctionExists.cmake b/Modules/CheckFunctionExists.cmake index cbec739..c39144f 100644 --- a/Modules/CheckFunctionExists.cmake +++ b/Modules/CheckFunctionExists.cmake @@ -7,27 +7,33 @@ CheckFunctionExists Check if a C function can be linked -.. code-block:: cmake +.. command:: check_function_exists - check_function_exists(<function> <variable>) + .. code-block:: cmake -Checks that the ``<function>`` is provided by libraries on the system and store -the result in a ``<variable>``, which will be created as an internal -cache variable. + check_function_exists(<function> <variable>) + + Checks that the ``<function>`` is provided by libraries on the system and store + the result in a ``<variable>``, which will be created as an internal + cache variable. The following variables may be set before calling this macro to modify the way the check is run: ``CMAKE_REQUIRED_FLAGS`` - string of compile command line flags + string of compile command line flags. ``CMAKE_REQUIRED_DEFINITIONS`` - list of macros to define (-DFOO=bar) + a :ref:`;-list <CMake Language Lists>` of macros to define (-DFOO=bar). ``CMAKE_REQUIRED_INCLUDES`` - list of include directories + a :ref:`;-list <CMake Language Lists>` of header search paths to pass to + the compiler. +``CMAKE_REQUIRED_LINK_OPTIONS`` + a :ref:`;-list <CMake Language Lists>` of options to add to the link command. ``CMAKE_REQUIRED_LIBRARIES`` - list of libraries to link + a :ref:`;-list <CMake Language Lists>` of libraries to add to the link + command. See policy :policy:`CMP0075`. ``CMAKE_REQUIRED_QUIET`` - execute quietly without messages + execute quietly without messages. .. note:: @@ -53,6 +59,12 @@ macro(CHECK_FUNCTION_EXISTS FUNCTION VARIABLE) if(NOT CMAKE_REQUIRED_QUIET) message(STATUS "Looking for ${FUNCTION}") endif() + if(CMAKE_REQUIRED_LINK_OPTIONS) + set(CHECK_FUNCTION_EXISTS_ADD_LINK_OPTIONS + LINK_OPTIONS ${CMAKE_REQUIRED_LINK_OPTIONS}) + else() + set(CHECK_FUNCTION_EXISTS_ADD_LINK_OPTIONS) + endif() if(CMAKE_REQUIRED_LIBRARIES) set(CHECK_FUNCTION_EXISTS_ADD_LIBRARIES LINK_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES}) @@ -79,6 +91,7 @@ macro(CHECK_FUNCTION_EXISTS FUNCTION VARIABLE) ${CMAKE_BINARY_DIR} ${_cfe_source} COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} + ${CHECK_FUNCTION_EXISTS_ADD_LINK_OPTIONS} ${CHECK_FUNCTION_EXISTS_ADD_LIBRARIES} CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS} "${CHECK_FUNCTION_EXISTS_ADD_INCLUDES}" diff --git a/Modules/CheckIPOSupported.cmake b/Modules/CheckIPOSupported.cmake index ad8852c..0d6ad20 100644 --- a/Modules/CheckIPOSupported.cmake +++ b/Modules/CheckIPOSupported.cmake @@ -51,8 +51,6 @@ Examples #]=======================================================================] -include(CMakeParseArguments) # cmake_parse_arguments - # X_RESULT - name of the final result variable # X_OUTPUT - name of the variable with information about error macro(_ipo_not_supported output) diff --git a/Modules/CheckIncludeFile.cmake b/Modules/CheckIncludeFile.cmake index 87dac4f..d7b9481 100644 --- a/Modules/CheckIncludeFile.cmake +++ b/Modules/CheckIncludeFile.cmake @@ -9,7 +9,7 @@ Provides a macro to check if a header file can be included in ``C``. .. command:: CHECK_INCLUDE_FILE - :: + .. code-block:: cmake CHECK_INCLUDE_FILE(<include> <variable> [<flags>]) @@ -22,15 +22,19 @@ The following variables may be set before calling this macro to modify the way the check is run: ``CMAKE_REQUIRED_FLAGS`` - string of compile command line flags + string of compile command line flags. ``CMAKE_REQUIRED_DEFINITIONS`` - list of macros to define (-DFOO=bar) + a :ref:`;-list <CMake Language Lists>` of macros to define (-DFOO=bar). ``CMAKE_REQUIRED_INCLUDES`` - list of include directories + a :ref:`;-list <CMake Language Lists>` of header search paths to pass to + the compiler. +``CMAKE_REQUIRED_LINK_OPTIONS`` + a :ref:`;-list <CMake Language Lists>` of options to add to the link command. ``CMAKE_REQUIRED_LIBRARIES`` - A list of libraries to link. See policy :policy:`CMP0075`. + a :ref:`;-list <CMake Language Lists>` of libraries to add to the link + command. See policy :policy:`CMP0075`. ``CMAKE_REQUIRED_QUIET`` - execute quietly without messages + execute quietly without messages. See the :module:`CheckIncludeFiles` module to check for multiple headers at once. See the :module:`CheckIncludeFileCXX` module to check for headers @@ -58,6 +62,11 @@ macro(CHECK_INCLUDE_FILE INCLUDE VARIABLE) string(APPEND CMAKE_C_FLAGS " ${ARGV2}") endif() + set(_CIF_LINK_OPTIONS) + if(CMAKE_REQUIRED_LINK_OPTIONS) + set(_CIF_LINK_OPTIONS LINK_OPTIONS ${CMAKE_REQUIRED_LINK_OPTIONS}) + endif() + set(_CIF_LINK_LIBRARIES "") if(CMAKE_REQUIRED_LIBRARIES) cmake_policy(GET CMP0075 _CIF_CMP0075 @@ -85,11 +94,13 @@ macro(CHECK_INCLUDE_FILE INCLUDE VARIABLE) ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFile.c COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} + ${_CIF_LINK_OPTIONS} ${_CIF_LINK_LIBRARIES} CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_INCLUDE_FILE_FLAGS} "${CHECK_INCLUDE_FILE_C_INCLUDE_DIRS}" OUTPUT_VARIABLE OUTPUT) + unset(_CIF_LINK_OPTIONS) unset(_CIF_LINK_LIBRARIES) if(${ARGC} EQUAL 3) diff --git a/Modules/CheckIncludeFileCXX.cmake b/Modules/CheckIncludeFileCXX.cmake index 42b5eaf..de5a83b 100644 --- a/Modules/CheckIncludeFileCXX.cmake +++ b/Modules/CheckIncludeFileCXX.cmake @@ -9,7 +9,7 @@ Provides a macro to check if a header file can be included in ``CXX``. .. command:: CHECK_INCLUDE_FILE_CXX - :: + .. code-block:: cmake CHECK_INCLUDE_FILE_CXX(<include> <variable> [<flags>]) @@ -22,15 +22,19 @@ The following variables may be set before calling this macro to modify the way the check is run: ``CMAKE_REQUIRED_FLAGS`` - string of compile command line flags + string of compile command line flags. ``CMAKE_REQUIRED_DEFINITIONS`` - list of macros to define (-DFOO=bar) + a :ref:`;-list <CMake Language Lists>` of macros to define (-DFOO=bar). ``CMAKE_REQUIRED_INCLUDES`` - list of include directories + a :ref:`;-list <CMake Language Lists>` of header search paths to pass to + the compiler. +``CMAKE_REQUIRED_LINK_OPTIONS`` + a :ref:`;-list <CMake Language Lists>` of options to add to the link command. ``CMAKE_REQUIRED_LIBRARIES`` - A list of libraries to link. See policy :policy:`CMP0075`. + a :ref:`;-list <CMake Language Lists>` of libraries to add to the link + command. See policy :policy:`CMP0075`. ``CMAKE_REQUIRED_QUIET`` - execute quietly without messages + execute quietly without messages. See modules :module:`CheckIncludeFile` and :module:`CheckIncludeFiles` to check for one or more ``C`` headers. @@ -57,6 +61,11 @@ macro(CHECK_INCLUDE_FILE_CXX INCLUDE VARIABLE) string(APPEND CMAKE_CXX_FLAGS " ${ARGV2}") endif() + set(_CIF_LINK_OPTIONS) + if(CMAKE_REQUIRED_LINK_OPTIONS) + set(_CIF_LINK_OPTIONS LINK_OPTIONS ${CMAKE_REQUIRED_LINK_OPTIONS}) + endif() + set(_CIF_LINK_LIBRARIES "") if(CMAKE_REQUIRED_LIBRARIES) cmake_policy(GET CMP0075 _CIF_CMP0075 @@ -84,11 +93,13 @@ macro(CHECK_INCLUDE_FILE_CXX INCLUDE VARIABLE) ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFile.cxx COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} + ${_CIF_LINK_OPTIONS} ${_CIF_LINK_LIBRARIES} CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_INCLUDE_FILE_FLAGS} "${CHECK_INCLUDE_FILE_CXX_INCLUDE_DIRS}" OUTPUT_VARIABLE OUTPUT) + unset(_CIF_LINK_OPTIONS) unset(_CIF_LINK_LIBRARIES) if(${ARGC} EQUAL 3) diff --git a/Modules/CheckIncludeFiles.cmake b/Modules/CheckIncludeFiles.cmake index b303260..f52ab55 100644 --- a/Modules/CheckIncludeFiles.cmake +++ b/Modules/CheckIncludeFiles.cmake @@ -10,7 +10,7 @@ be included together. .. command:: CHECK_INCLUDE_FILES - :: + .. code-block:: cmake CHECK_INCLUDE_FILES("<includes>" <variable> [LANGUAGE <language>]) @@ -19,24 +19,28 @@ be included together. entry named ``<variable>``. Specify the ``<includes>`` argument as a :ref:`;-list <CMake Language Lists>` of header file names. -If LANGUAGE is set, the specified compiler will be used to perform the -check. Acceptable values are ``C`` and ``CXX``. If not set, the C compiler -will be used if enabled. If the C compiler is not enabled, the C++ -compiler will be used if enabled. + If ``LANGUAGE`` is set, the specified compiler will be used to perform the + check. Acceptable values are ``C`` and ``CXX``. If not set, the C compiler + will be used if enabled. If the C compiler is not enabled, the C++ + compiler will be used if enabled. The following variables may be set before calling this macro to modify the way the check is run: ``CMAKE_REQUIRED_FLAGS`` - string of compile command line flags + string of compile command line flags. ``CMAKE_REQUIRED_DEFINITIONS`` - list of macros to define (-DFOO=bar) + a :ref:`;-list <CMake Language Lists>` of macros to define (-DFOO=bar). ``CMAKE_REQUIRED_INCLUDES`` - list of include directories + a :ref:`;-list <CMake Language Lists>` of header search paths to pass to + the compiler. +``CMAKE_REQUIRED_LINK_OPTIONS`` + a :ref:`;-list <CMake Language Lists>` of options to add to the link command. ``CMAKE_REQUIRED_LIBRARIES`` - A list of libraries to link. See policy :policy:`CMP0075`. + a :ref:`;-list <CMake Language Lists>` of libraries to add to the link + command. See policy :policy:`CMP0075`. ``CMAKE_REQUIRED_QUIET`` - execute quietly without messages + execute quietly without messages. See modules :module:`CheckIncludeFile` and :module:`CheckIncludeFileCXX` to check for a single header file in ``C`` or ``CXX`` languages. @@ -98,6 +102,11 @@ macro(CHECK_INCLUDE_FILES INCLUDE VARIABLE) set(_description "include file ${_INCLUDE}") endif() + set(_CIF_LINK_OPTIONS) + if(CMAKE_REQUIRED_LINK_OPTIONS) + set(_CIF_LINK_OPTIONS LINK_OPTIONS ${CMAKE_REQUIRED_LINK_OPTIONS}) + endif() + set(_CIF_LINK_LIBRARIES "") if(CMAKE_REQUIRED_LIBRARIES) cmake_policy(GET CMP0075 _CIF_CMP0075 @@ -128,11 +137,13 @@ macro(CHECK_INCLUDE_FILES INCLUDE VARIABLE) ${CMAKE_BINARY_DIR} ${src} COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} + ${_CIF_LINK_OPTIONS} ${_CIF_LINK_LIBRARIES} CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_INCLUDE_FILES_FLAGS} "${CHECK_INCLUDE_FILES_INCLUDE_DIRS}" OUTPUT_VARIABLE OUTPUT) + unset(_CIF_LINK_OPTIONS) unset(_CIF_LINK_LIBRARIES) if(${VARIABLE}) if(NOT CMAKE_REQUIRED_QUIET) diff --git a/Modules/CheckLibraryExists.cmake b/Modules/CheckLibraryExists.cmake index 428a6b0..6504df5 100644 --- a/Modules/CheckLibraryExists.cmake +++ b/Modules/CheckLibraryExists.cmake @@ -7,15 +7,19 @@ CheckLibraryExists Check if the function exists. -CHECK_LIBRARY_EXISTS (LIBRARY FUNCTION LOCATION VARIABLE) +.. command:: CHECK_LIBRARY_EXISTS -:: + .. code-block:: cmake + + CHECK_LIBRARY_EXISTS(LIBRARY FUNCTION LOCATION VARIABLE) - LIBRARY - the name of the library you are looking for - FUNCTION - the name of the function - LOCATION - location where the library should be found - VARIABLE - variable to store the result - Will be created as an internal cache variable. + :: + + LIBRARY - the name of the library you are looking for + FUNCTION - the name of the function + LOCATION - location where the library should be found + VARIABLE - variable to store the result + Will be created as an internal cache variable. @@ -26,6 +30,7 @@ the way the check is run: CMAKE_REQUIRED_FLAGS = string of compile command line flags CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar) + CMAKE_REQUIRED_LINK_OPTIONS = list of options to pass to link command CMAKE_REQUIRED_LIBRARIES = list of libraries to link CMAKE_REQUIRED_QUIET = execute quietly without messages #]=======================================================================] @@ -39,6 +44,11 @@ macro(CHECK_LIBRARY_EXISTS LIBRARY FUNCTION LOCATION VARIABLE) if(NOT CMAKE_REQUIRED_QUIET) message(STATUS "Looking for ${FUNCTION} in ${LIBRARY}") endif() + set(CHECK_LIBRARY_EXISTS_LINK_OPTIONS) + if(CMAKE_REQUIRED_LINK_OPTIONS) + set(CHECK_LIBRARY_EXISTS_LINK_OPTIONS + LINK_OPTIONS ${CMAKE_REQUIRED_LINK_OPTIONS}) + endif() set(CHECK_LIBRARY_EXISTS_LIBRARIES ${LIBRARY}) if(CMAKE_REQUIRED_LIBRARIES) set(CHECK_LIBRARY_EXISTS_LIBRARIES @@ -58,6 +68,7 @@ macro(CHECK_LIBRARY_EXISTS LIBRARY FUNCTION LOCATION VARIABLE) ${CMAKE_BINARY_DIR} ${_cle_source} COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} + ${CHECK_LIBRARY_EXISTS_LINK_OPTIONS} LINK_LIBRARIES ${CHECK_LIBRARY_EXISTS_LIBRARIES} CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_LIBRARY_EXISTS_DEFINITION} diff --git a/Modules/CheckPIESupported.cmake b/Modules/CheckPIESupported.cmake new file mode 100644 index 0000000..720217d --- /dev/null +++ b/Modules/CheckPIESupported.cmake @@ -0,0 +1,134 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +#[=======================================================================[.rst: +CheckPIESupported +----------------- + +Check whether the linker supports position independent code (PIE) or no +position independent code (NO_PIE) for executables. +Use this to ensure that the :prop_tgt:`POSITION_INDEPENDENT_CODE` target +property for executables will be honored at link time. + +.. command:: check_pie_supported + + :: + + check_pie_supported([OUTPUT_VARIABLE <output>] + [LANGUAGES <lang>...]) + + Options are: + + ``OUTPUT_VARIABLE <output>`` + Set ``<output>`` variable with details about any error. + ``LANGUAGES <lang>...`` + Check the linkers used for each of the specified languages. + Supported languages are ``C``, ``CXX``, and ``Fortran``. + +It makes no sense to use this module when :policy:`CMP0083` is set to ``OLD``, +so the command will return an error in this case. See policy :policy:`CMP0083` +for details. + +Variables +^^^^^^^^^ + +For each language checked, two boolean cache variables are defined. + + ``CMAKE_<lang>_LINK_PIE_SUPPORTED`` + Set to ``YES`` if ``PIE`` is supported by the linker and ``NO`` otherwise. + ``CMAKE_<lang>_LINK_NO_PIE_SUPPORTED`` + Set to ``YES`` if ``NO_PIE`` is supported by the linker and ``NO`` otherwise. + +Examples +^^^^^^^^ + +.. code-block:: cmake + + check_pie_supported() + set_property(TARGET foo PROPERTY POSITION_INDEPENDENT_CODE TRUE) + +.. code-block:: cmake + + # Retrieve any error message. + check_pie_supported(OUTPUT_VARIABLE output LANGUAGES C) + set_property(TARGET foo PROPERTY POSITION_INDEPENDENT_CODE TRUE) + if(NOT CMAKE_C_LINK_PIE_SUPPORTED) + message(WARNING "PIE is not supported at link time: ${output}.\n" + "PIE link options will not be passed to linker.") + endif() + +#]=======================================================================] + + +include (Internal/CMakeCheckCompilerFlag) + +function (check_pie_supported) + cmake_policy(GET CMP0083 cmp0083) + + if (NOT cmp0083) + message(FATAL_ERROR "check_pie_supported: Policy CMP0083 is not set") + endif() + + if(cmp0083 STREQUAL "OLD") + message(FATAL_ERROR "check_pie_supported: Policy CMP0083 set to OLD") + endif() + + set(optional) + set(one OUTPUT_VARIABLE) + set(multiple LANGUAGES) + + cmake_parse_arguments(CHECK_PIE "${optional}" "${one}" "${multiple}" "${ARGN}") + if(CHECK_PIE_UNPARSED_ARGUMENTS) + message(FATAL_ERROR "check_pie_supported: Unparsed arguments: ${CHECK_PIE_UNPARSED_ARGUMENTS}") + endif() + + if (CHECK_PIE_LANGUAGES) + set (unsupported_languages "${CHECK_PIE_LANGUAGES}") + list (REMOVE_ITEM unsupported_languages "C" "CXX" "Fortran") + if(unsupported_languages) + message(FATAL_ERROR "check_pie_supported: language(s) '${unsupported_languages}' not supported") + endif() + else() + # User did not set any languages, use defaults + get_property (enabled_languages GLOBAL PROPERTY ENABLED_LANGUAGES) + if (NOT enabled_languages) + return() + endif() + + list (FILTER enabled_languages INCLUDE REGEX "^(C|CXX|Fortran)$") + if (NOT enabled_languages) + return() + endif() + + set (CHECK_PIE_LANGUAGES ${enabled_languages}) + endif() + + set (outputs) + + foreach(lang IN LISTS CHECK_PIE_LANGUAGES) + if(_CMAKE_${lang}_PIE_MAY_BE_SUPPORTED_BY_LINKER) + cmake_check_compiler_flag(${lang} "${CMAKE_${lang}_LINK_OPTIONS_PIE}" + CMAKE_${lang}_LINK_PIE_SUPPORTED + OUTPUT_VARIABLE output) + if (NOT CMAKE_${lang}_LINK_PIE_SUPPORTED) + string (APPEND outputs "PIE (${lang}): ${output}\n") + endif() + + cmake_check_compiler_flag(${lang} "${CMAKE_${lang}_LINK_OPTIONS_NO_PIE}" + CMAKE_${lang}_LINK_NO_PIE_SUPPORTED + OUTPUT_VARIABLE output) + if (NOT CMAKE_${lang}_LINK_NO_PIE_SUPPORTED) + string (APPEND outputs "NO_PIE (${lang}): ${output}\n") + endif() + else() + # no support at link time. Set cache variables to NO + set(CMAKE_${lang}_LINK_PIE_SUPPORTED NO CACHE INTERNAL "PIE (${lang})") + set(CMAKE_${lang}_LINK_NO_PIE_SUPPORTED NO CACHE INTERNAL "NO_PIE (${lang})") + string (APPEND outputs "PIE and NO_PIE are not supported by linker for ${lang}") + endif() + endforeach() + + if (CHECK_PIE_OUTPUT_VARIABLE) + set (${CHECK_PIE_OUTPUT_VARIABLE} "${outputs}" PARENT_SCOPE) + endif() +endfunction() diff --git a/Modules/CheckPrototypeDefinition.cmake b/Modules/CheckPrototypeDefinition.cmake index c90b766..a7b020c 100644 --- a/Modules/CheckPrototypeDefinition.cmake +++ b/Modules/CheckPrototypeDefinition.cmake @@ -7,26 +7,30 @@ CheckPrototypeDefinition Check if the prototype we expect is correct. -check_prototype_definition(FUNCTION PROTOTYPE RETURN HEADER VARIABLE) +.. command:: check_prototype_definition -:: + .. code-block:: cmake - FUNCTION - The name of the function (used to check if prototype exists) - PROTOTYPE- The prototype to check. - RETURN - The return value of the function. - HEADER - The header files required. - VARIABLE - The variable to store the result. - Will be created as an internal cache variable. + check_prototype_definition(FUNCTION PROTOTYPE RETURN HEADER VARIABLE) -Example: + :: -:: + FUNCTION - The name of the function (used to check if prototype exists) + PROTOTYPE- The prototype to check. + RETURN - The return value of the function. + HEADER - The header files required. + VARIABLE - The variable to store the result. + Will be created as an internal cache variable. + + Example: - check_prototype_definition(getpwent_r - "struct passwd *getpwent_r(struct passwd *src, char *buf, int buflen)" - "NULL" - "unistd.h;pwd.h" - SOLARIS_GETPWENT_R) + .. code-block:: cmake + + check_prototype_definition(getpwent_r + "struct passwd *getpwent_r(struct passwd *src, char *buf, int buflen)" + "NULL" + "unistd.h;pwd.h" + SOLARIS_GETPWENT_R) The following variables may be set before calling this function to modify the way the check is run: @@ -36,6 +40,7 @@ the way the check is run: CMAKE_REQUIRED_FLAGS = string of compile command line flags CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar) CMAKE_REQUIRED_INCLUDES = list of include directories + CMAKE_REQUIRED_LINK_OPTIONS = list of options to pass to link command CMAKE_REQUIRED_LIBRARIES = list of libraries to link CMAKE_REQUIRED_QUIET = execute quietly without messages #]=======================================================================] @@ -52,6 +57,12 @@ function(check_prototype_definition _FUNCTION _PROTOTYPE _RETURN _HEADER _VARIAB set(CHECK_PROTOTYPE_DEFINITION_CONTENT "/* */\n") set(CHECK_PROTOTYPE_DEFINITION_FLAGS ${CMAKE_REQUIRED_FLAGS}) + if (CMAKE_REQUIRED_LINK_OPTIONS) + set(CHECK_PROTOTYPE_DEFINITION_LINK_OPTIONS + LINK_OPTIONS ${CMAKE_REQUIRED_LINK_OPTIONS}) + else() + set(CHECK_PROTOTYPE_DEFINITION_LINK_OPTIONS) + endif() if (CMAKE_REQUIRED_LIBRARIES) set(CHECK_PROTOTYPE_DEFINITION_LIBS LINK_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES}) @@ -83,6 +94,7 @@ function(check_prototype_definition _FUNCTION _PROTOTYPE _RETURN _HEADER _VARIAB ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckPrototypeDefinition.c COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} + ${CHECK_PROTOTYPE_DEFINITION_LINK_OPTIONS} ${CHECK_PROTOTYPE_DEFINITION_LIBS} CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${CHECK_PROTOTYPE_DEFINITION_FLAGS} "${CMAKE_SYMBOL_EXISTS_INCLUDES}" diff --git a/Modules/CheckStructHasMember.cmake b/Modules/CheckStructHasMember.cmake index e7c337c..7fef857 100644 --- a/Modules/CheckStructHasMember.cmake +++ b/Modules/CheckStructHasMember.cmake @@ -7,18 +7,20 @@ CheckStructHasMember Check if the given struct or class has the specified member variable -:: +.. command:: CHECK_STRUCT_HAS_MEMBER - CHECK_STRUCT_HAS_MEMBER(<struct> <member> <header> <variable> - [LANGUAGE <language>]) + .. code-block:: cmake -:: + CHECK_STRUCT_HAS_MEMBER(<struct> <member> <header> <variable> + [LANGUAGE <language>]) - <struct> - the name of the struct or class you are interested in - <member> - the member which existence you want to check - <header> - the header(s) where the prototype should be declared - <variable> - variable to store the result - <language> - the compiler to use (C or CXX) + :: + + <struct> - the name of the struct or class you are interested in + <member> - the member which existence you want to check + <header> - the header(s) where the prototype should be declared + <variable> - variable to store the result + <language> - the compiler to use (C or CXX) @@ -30,13 +32,17 @@ the way the check is run: CMAKE_REQUIRED_FLAGS = string of compile command line flags CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar) CMAKE_REQUIRED_INCLUDES = list of include directories + CMAKE_REQUIRED_LINK_OPTIONS = list of options to pass to link command CMAKE_REQUIRED_LIBRARIES = list of libraries to link CMAKE_REQUIRED_QUIET = execute quietly without messages +Example: + +.. code-block:: cmake -Example: CHECK_STRUCT_HAS_MEMBER("struct timeval" tv_sec sys/select.h -HAVE_TIMEVAL_TV_SEC LANGUAGE C) + CHECK_STRUCT_HAS_MEMBER("struct timeval" tv_sec sys/select.h + HAVE_TIMEVAL_TV_SEC LANGUAGE C) #]=======================================================================] include_guard(GLOBAL) diff --git a/Modules/CheckSymbolExists.cmake b/Modules/CheckSymbolExists.cmake index 3483121..b9ef808 100644 --- a/Modules/CheckSymbolExists.cmake +++ b/Modules/CheckSymbolExists.cmake @@ -10,7 +10,7 @@ or macro in ``C``. .. command:: check_symbol_exists - :: + .. code-block:: cmake check_symbol_exists(<symbol> <files> <variable>) @@ -32,15 +32,19 @@ The following variables may be set before calling this macro to modify the way the check is run: ``CMAKE_REQUIRED_FLAGS`` - string of compile command line flags + string of compile command line flags. ``CMAKE_REQUIRED_DEFINITIONS`` - list of macros to define (-DFOO=bar) + a :ref:`;-list <CMake Language Lists>` of macros to define (-DFOO=bar). ``CMAKE_REQUIRED_INCLUDES`` - list of include directories + a :ref:`;-list <CMake Language Lists>` of header search paths to pass to + the compiler. +``CMAKE_REQUIRED_LINK_OPTIONS`` + a :ref:`;-list <CMake Language Lists>` of options to add to the link command. ``CMAKE_REQUIRED_LIBRARIES`` - list of libraries to link + a :ref:`;-list <CMake Language Lists>` of libraries to add to the link + command. See policy :policy:`CMP0075`. ``CMAKE_REQUIRED_QUIET`` - execute quietly without messages + execute quietly without messages. #]=======================================================================] include_guard(GLOBAL) @@ -62,6 +66,12 @@ macro(__CHECK_SYMBOL_EXISTS_IMPL SOURCEFILE SYMBOL FILES VARIABLE) if(NOT DEFINED "${VARIABLE}" OR "x${${VARIABLE}}" STREQUAL "x${VARIABLE}") set(CMAKE_CONFIGURABLE_FILE_CONTENT "/* */\n") set(MACRO_CHECK_SYMBOL_EXISTS_FLAGS ${CMAKE_REQUIRED_FLAGS}) + if(CMAKE_REQUIRED_LINK_OPTIONS) + set(CHECK_SYMBOL_EXISTS_LINK_OPTIONS + LINK_OPTIONS ${CMAKE_REQUIRED_LINK_OPTIONS}) + else() + set(CHECK_SYMBOL_EXISTS_LINK_OPTIONS) + endif() if(CMAKE_REQUIRED_LIBRARIES) set(CHECK_SYMBOL_EXISTS_LIBS LINK_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES}) @@ -91,6 +101,7 @@ macro(__CHECK_SYMBOL_EXISTS_IMPL SOURCEFILE SYMBOL FILES VARIABLE) ${CMAKE_BINARY_DIR} "${SOURCEFILE}" COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} + ${CHECK_SYMBOL_EXISTS_LINK_OPTIONS} ${CHECK_SYMBOL_EXISTS_LIBS} CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_SYMBOL_EXISTS_FLAGS} diff --git a/Modules/CheckTypeSize.cmake b/Modules/CheckTypeSize.cmake index 2c53df9..3727373 100644 --- a/Modules/CheckTypeSize.cmake +++ b/Modules/CheckTypeSize.cmake @@ -7,50 +7,52 @@ CheckTypeSize Check sizeof a type -:: +.. command:: CHECK_TYPE_SIZE - CHECK_TYPE_SIZE(TYPE VARIABLE [BUILTIN_TYPES_ONLY] - [LANGUAGE <language>]) + .. code-block:: cmake -Check if the type exists and determine its size. On return, -"HAVE_${VARIABLE}" holds the existence of the type, and "${VARIABLE}" -holds one of the following: + CHECK_TYPE_SIZE(TYPE VARIABLE [BUILTIN_TYPES_ONLY] + [LANGUAGE <language>]) -:: + Check if the type exists and determine its size. On return, + ``HAVE_${VARIABLE}`` holds the existence of the type, and ``${VARIABLE}`` + holds one of the following: - <size> = type has non-zero size <size> - "0" = type has arch-dependent size (see below) - "" = type does not exist + :: -Both ``HAVE_${VARIABLE}`` and ``${VARIABLE}`` will be created as internal -cache variables. + <size> = type has non-zero size <size> + "0" = type has arch-dependent size (see below) + "" = type does not exist -Furthermore, the variable "${VARIABLE}_CODE" holds C preprocessor code -to define the macro "${VARIABLE}" to the size of the type, or leave -the macro undefined if the type does not exist. + Both ``HAVE_${VARIABLE}`` and ``${VARIABLE}`` will be created as internal + cache variables. -The variable "${VARIABLE}" may be "0" when CMAKE_OSX_ARCHITECTURES has -multiple architectures for building OS X universal binaries. This -indicates that the type size varies across architectures. In this -case "${VARIABLE}_CODE" contains C preprocessor tests mapping from -each architecture macro to the corresponding type size. The list of -architecture macros is stored in "${VARIABLE}_KEYS", and the value for -each key is stored in "${VARIABLE}-${KEY}". + Furthermore, the variable ``${VARIABLE}_CODE`` holds C preprocessor code + to define the macro ``${VARIABLE}`` to the size of the type, or leave + the macro undefined if the type does not exist. -If the BUILTIN_TYPES_ONLY option is not given, the macro checks for -headers <sys/types.h>, <stdint.h>, and <stddef.h>, and saves results -in HAVE_SYS_TYPES_H, HAVE_STDINT_H, and HAVE_STDDEF_H. The type size -check automatically includes the available headers, thus supporting -checks of types defined in the headers. + The variable ``${VARIABLE}`` may be ``0`` when + :variable:`CMAKE_OSX_ARCHITECTURES` has multiple architectures for building + OS X universal binaries. This indicates that the type size varies across + architectures. In this case ``${VARIABLE}_CODE`` contains C preprocessor + tests mapping from each architecture macro to the corresponding type size. + The list of architecture macros is stored in ``${VARIABLE}_KEYS``, and the + value for each key is stored in ``${VARIABLE}-${KEY}``. -If LANGUAGE is set, the specified compiler will be used to perform the -check. Acceptable values are C and CXX + If the ``BUILTIN_TYPES_ONLY`` option is not given, the macro checks for + headers ``<sys/types.h>``, ``<stdint.h>``, and ``<stddef.h>``, and saves + results in ``HAVE_SYS_TYPES_H``, ``HAVE_STDINT_H``, and ``HAVE_STDDEF_H``. + The type size check automatically includes the available headers, thus + supporting checks of types defined in the headers. + + If ``LANGUAGE`` is set, the specified compiler will be used to perform the + check. Acceptable values are ``C`` and ``CXX``. Despite the name of the macro you may use it to check the size of more complex expressions, too. To check e.g. for the size of a struct member you can do something like this: -:: +.. code-block:: cmake check_type_size("((struct something*)0)->member" SIZEOF_MEMBER) @@ -64,6 +66,7 @@ the way the check is run: CMAKE_REQUIRED_FLAGS = string of compile command line flags CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar) CMAKE_REQUIRED_INCLUDES = list of include directories + CMAKE_REQUIRED_LINK_OPTIONS = list of options to pass to link command CMAKE_REQUIRED_LIBRARIES = list of libraries to link CMAKE_REQUIRED_QUIET = execute quietly without messages CMAKE_EXTRA_INCLUDE_FILES = list of extra headers to include @@ -116,6 +119,7 @@ function(__check_type_size_impl type var map builtin language) configure_file(${__check_type_size_dir}/CheckTypeSize.c.in ${src} @ONLY) try_compile(HAVE_${var} ${CMAKE_BINARY_DIR} ${src} COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} + LINK_OPTIONS ${CMAKE_REQUIRED_LINK_OPTIONS} LINK_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CMAKE_FLAGS "-DCOMPILE_DEFINITIONS:STRING=${CMAKE_REQUIRED_FLAGS}" diff --git a/Modules/CheckVariableExists.cmake b/Modules/CheckVariableExists.cmake index f30165e..f4953a3 100644 --- a/Modules/CheckVariableExists.cmake +++ b/Modules/CheckVariableExists.cmake @@ -7,20 +7,21 @@ CheckVariableExists Check if the variable exists. -:: +.. command:: CHECK_VARIABLE_EXISTS - CHECK_VARIABLE_EXISTS(VAR VARIABLE) + .. code-block:: cmake + CHECK_VARIABLE_EXISTS(VAR VARIABLE) -:: + :: - VAR - the name of the variable - VARIABLE - variable to store the result - Will be created as an internal cache variable. + VAR - the name of the variable + VARIABLE - variable to store the result + Will be created as an internal cache variable. -This macro is only for C variables. + This macro is only for ``C`` variables. The following variables may be set before calling this macro to modify the way the check is run: @@ -29,6 +30,7 @@ the way the check is run: CMAKE_REQUIRED_FLAGS = string of compile command line flags CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar) + CMAKE_REQUIRED_LINK_OPTIONS = list of options to pass to link command CMAKE_REQUIRED_LIBRARIES = list of libraries to link CMAKE_REQUIRED_QUIET = execute quietly without messages #]=======================================================================] @@ -42,6 +44,12 @@ macro(CHECK_VARIABLE_EXISTS VAR VARIABLE) if(NOT CMAKE_REQUIRED_QUIET) message(STATUS "Looking for ${VAR}") endif() + if(CMAKE_REQUIRED_LINK_OPTIONS) + set(CHECK_VARIABLE_EXISTS_ADD_LINK_OPTIONS + LINK_OPTIONS ${CMAKE_REQUIRED_LINK_OPTIONS}) + else() + set(CHECK_VARIABLE_EXISTS_ADD_LINK_OPTIONS) + endif() if(CMAKE_REQUIRED_LIBRARIES) set(CHECK_VARIABLE_EXISTS_ADD_LIBRARIES LINK_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES}) @@ -52,6 +60,7 @@ macro(CHECK_VARIABLE_EXISTS VAR VARIABLE) ${CMAKE_BINARY_DIR} ${CMAKE_ROOT}/Modules/CheckVariableExists.c COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} + ${CHECK_VARIABLE_EXISTS_ADD_LINK_OPTIONS} ${CHECK_VARIABLE_EXISTS_ADD_LIBRARIES} CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_VARIABLE_DEFINITIONS} OUTPUT_VARIABLE OUTPUT) diff --git a/Modules/Compiler/AppleClang-C.cmake b/Modules/Compiler/AppleClang-C.cmake index 8754951..a48adec 100644 --- a/Modules/Compiler/AppleClang-C.cmake +++ b/Modules/Compiler/AppleClang-C.cmake @@ -1,9 +1,6 @@ include(Compiler/Clang) __compiler_clang(C) -set(CMAKE_C_LINK_OPTIONS_PIE ${CMAKE_C_COMPILE_OPTIONS_PIE} -Xlinker -pie) -set(CMAKE_C_LINK_OPTIONS_NO_PIE -Xlinker -no_pie) - if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.0) set(CMAKE_C90_STANDARD_COMPILE_OPTION "-std=c90") set(CMAKE_C90_EXTENSION_COMPILE_OPTION "-std=gnu90") diff --git a/Modules/Compiler/AppleClang-CXX.cmake b/Modules/Compiler/AppleClang-CXX.cmake index 54c1388..e5fd647 100644 --- a/Modules/Compiler/AppleClang-CXX.cmake +++ b/Modules/Compiler/AppleClang-CXX.cmake @@ -1,9 +1,6 @@ include(Compiler/Clang) __compiler_clang(CXX) -set(CMAKE_CXX_LINK_OPTIONS_PIE ${CMAKE_CXX_COMPILE_OPTIONS_PIE} -Xlinker -pie) -set(CMAKE_CXX_LINK_OPTIONS_NO_PIE -Xlinker -no_pie) - if(NOT "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC") set(CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN "-fvisibility-inlines-hidden") endif() diff --git a/Modules/Compiler/Clang.cmake b/Modules/Compiler/Clang.cmake index 7cee9c7..c3f13f3 100644 --- a/Modules/Compiler/Clang.cmake +++ b/Modules/Compiler/Clang.cmake @@ -23,23 +23,9 @@ else() set(CMAKE_${lang}_COMPILE_OPTIONS_PIE "-fPIE") # Link options for PIE are already set in 'Compiler/GNU.cmake' # but clang may require alternate syntax on some platforms - if (NOT CMAKE_${lang}_FLAG_PIE) - cmake_check_compiler_flag(${lang} "${CMAKE_${lang}_COMPILE_OPTIONS_PIE};-Xlinker;-pie" - CMAKE_${lang}_FLAG_XLINKER_PIE) - if (CMAKE_${lang}_FLAG_XLINKER_PIE) - set(CMAKE_${lang}_LINK_OPTIONS_PIE ${CMAKE_${lang}_COMPILE_OPTIONS_PIE} "-Xlinker" "-pie") - else() - set(CMAKE_${lang}_LINK_OPTIONS_PIE "") - endif() - endif() - if (NOT CMAKE_${lang}_FLAG_NO_PIE) - cmake_check_compiler_flag(${lang} "-Xlinker;-no_pie" - CMAKE_${lang}_FLAG_XLINKER_NO_PIE) - if (CMAKE_${lang}_FLAG_XLINKER_NO_PIE) - set(CMAKE_${lang}_LINK_OPTIONS_NO_PIE "-Xlinker" "-no_pie") - else() - set(CMAKE_${lang}_LINK_OPTIONS_NO_PIE "") - endif() + if (APPLE) + set(CMAKE_${lang}_LINK_OPTIONS_PIE ${CMAKE_${lang}_COMPILE_OPTIONS_PIE} -Xlinker -pie) + set(CMAKE_${lang}_LINK_OPTIONS_NO_PIE -Xlinker -no_pie) endif() set(CMAKE_INCLUDE_SYSTEM_FLAG_${lang} "-isystem ") set(CMAKE_${lang}_COMPILE_OPTIONS_VISIBILITY "-fvisibility=") diff --git a/Modules/Compiler/GNU.cmake b/Modules/Compiler/GNU.cmake index 688a1b5..6b1bd3a 100644 --- a/Modules/Compiler/GNU.cmake +++ b/Modules/Compiler/GNU.cmake @@ -15,23 +15,14 @@ macro(__compiler_gnu lang) # Feature flags. set(CMAKE_${lang}_VERBOSE_FLAG "-v") set(CMAKE_${lang}_COMPILE_OPTIONS_PIC "-fPIC") + set (_CMAKE_${lang}_PIE_MAY_BE_SUPPORTED_BY_LINKER NO) if(NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 3.4) set(CMAKE_${lang}_COMPILE_OPTIONS_PIE "-fPIE") # Support of PIE at link stage depends on various elements : platform, compiler, linker - # so the easiest way is to check if compiler supports these flags - cmake_check_compiler_flag(${lang} "${CMAKE_${lang}_COMPILE_OPTIONS_PIE};-pie" - CMAKE_${lang}_FLAG_PIE) - if (CMAKE_${lang}_FLAG_PIE) - set(CMAKE_${lang}_LINK_OPTIONS_PIE ${CMAKE_${lang}_COMPILE_OPTIONS_PIE} "-pie") - else() - set(CMAKE_${lang}_LINK_OPTIONS_PIE "") - endif() - cmake_check_compiler_flag(${lang} "-no-pie" CMAKE_${lang}_FLAG_NO_PIE) - if (CMAKE_${lang}_FLAG_NO_PIE) - set(CMAKE_${lang}_LINK_OPTIONS_NO_PIE "-no-pie") - else() - set(CMAKE_${lang}_LINK_OPTIONS_NO_PIE "") - endif() + # so to activate it, module CheckPIESupported must be used. + set (_CMAKE_${lang}_PIE_MAY_BE_SUPPORTED_BY_LINKER YES) + set(CMAKE_${lang}_LINK_OPTIONS_PIE ${CMAKE_${lang}_COMPILE_OPTIONS_PIE} "-pie") + set(CMAKE_${lang}_LINK_OPTIONS_NO_PIE "-no-pie") endif() if(NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 4.0) set(CMAKE_${lang}_COMPILE_OPTIONS_VISIBILITY "-fvisibility=") diff --git a/Modules/Compiler/QCC-C-FeatureTests.cmake b/Modules/Compiler/QCC-C-FeatureTests.cmake new file mode 100644 index 0000000..68f4197 --- /dev/null +++ b/Modules/Compiler/QCC-C-FeatureTests.cmake @@ -0,0 +1 @@ +include(Compiler/GNU-C-FeatureTests) diff --git a/Modules/Compiler/QCC-C.cmake b/Modules/Compiler/QCC-C.cmake index ae4a2f4..6db619e 100644 --- a/Modules/Compiler/QCC-C.cmake +++ b/Modules/Compiler/QCC-C.cmake @@ -1,2 +1,5 @@ +# To include compiler feature detection +include(Compiler/GNU-C) + include(Compiler/QCC) __compiler_qcc(C) diff --git a/Modules/Compiler/QCC-CXX-FeatureTests.cmake b/Modules/Compiler/QCC-CXX-FeatureTests.cmake new file mode 100644 index 0000000..c836b94 --- /dev/null +++ b/Modules/Compiler/QCC-CXX-FeatureTests.cmake @@ -0,0 +1 @@ +include(Compiler/GNU-CXX-FeatureTests) diff --git a/Modules/Compiler/QCC-CXX.cmake b/Modules/Compiler/QCC-CXX.cmake index e86d1fa..0e7314a 100644 --- a/Modules/Compiler/QCC-CXX.cmake +++ b/Modules/Compiler/QCC-CXX.cmake @@ -1,3 +1,6 @@ +# To include compiler feature detection +include(Compiler/GNU-CXX) + include(Compiler/QCC) __compiler_qcc(CXX) diff --git a/Modules/Compiler/SunPro-C.cmake b/Modules/Compiler/SunPro-C.cmake index 75b8fe6..c4aba8e 100644 --- a/Modules/Compiler/SunPro-C.cmake +++ b/Modules/Compiler/SunPro-C.cmake @@ -7,6 +7,7 @@ set(CMAKE_C_VERBOSE_FLAG "-#") set(CMAKE_C_COMPILE_OPTIONS_PIC -KPIC) set(CMAKE_C_COMPILE_OPTIONS_PIE "") +set(_CMAKE_C_PIE_MAY_BE_SUPPORTED_BY_LINKER NO) set(CMAKE_C_LINK_OPTIONS_PIE "") set(CMAKE_C_LINK_OPTIONS_NO_PIE "") set(CMAKE_SHARED_LIBRARY_C_FLAGS "-KPIC") diff --git a/Modules/Compiler/SunPro-CXX.cmake b/Modules/Compiler/SunPro-CXX.cmake index 662ac30..5ce58b2 100644 --- a/Modules/Compiler/SunPro-CXX.cmake +++ b/Modules/Compiler/SunPro-CXX.cmake @@ -7,6 +7,7 @@ set(CMAKE_CXX_VERBOSE_FLAG "-v") set(CMAKE_CXX_COMPILE_OPTIONS_PIC -KPIC) set(CMAKE_CXX_COMPILE_OPTIONS_PIE "") +set(_CMAKE_CXX_PIE_MAY_BE_SUPPORTED_BY_LINKER NO) set(CMAKE_CXX_LINK_OPTIONS_PIE "") set(CMAKE_CXX_LINK_OPTIONS_NO_PIE "") set(CMAKE_SHARED_LIBRARY_CXX_FLAGS "-KPIC") diff --git a/Modules/Compiler/SunPro-Fortran.cmake b/Modules/Compiler/SunPro-Fortran.cmake index e110253..0c93c94 100644 --- a/Modules/Compiler/SunPro-Fortran.cmake +++ b/Modules/Compiler/SunPro-Fortran.cmake @@ -4,6 +4,7 @@ set(CMAKE_Fortran_FORMAT_FREE_FLAG "-free") set(CMAKE_Fortran_COMPILE_OPTIONS_PIC "-KPIC") set(CMAKE_Fortran_COMPILE_OPTIONS_PIE "") +set(_CMAKE_Fortran_PIE_MAY_BE_SUPPORTED_BY_LINKER NO) set(CMAKE_Fortran_LINK_OPTIONS_PIE "") set(CMAKE_Fortran_LINK_OPTIONS_NO_PIE "") set(CMAKE_SHARED_LIBRARY_Fortran_FLAGS "-KPIC") diff --git a/Modules/DartConfiguration.tcl.in b/Modules/DartConfiguration.tcl.in index b86a5a9..24e7b55 100644 --- a/Modules/DartConfiguration.tcl.in +++ b/Modules/DartConfiguration.tcl.in @@ -20,17 +20,12 @@ BuildName: @BUILDNAME@ LabelsForSubprojects: @CTEST_LABELS_FOR_SUBPROJECTS@ # Submission information -IsCDash: @CTEST_DROP_SITE_CDASH@ -CDashVersion: @CTEST_CDASH_VERSION@ -QueryCDashVersion: @CTEST_CDASH_QUERY_VERSION@ DropSite: @DROP_SITE@ DropLocation: @DROP_LOCATION@ DropSiteUser: @DROP_SITE_USER@ DropSitePassword: @DROP_SITE_PASSWORD@ DropSiteMode: @DROP_SITE_MODE@ DropMethod: @DROP_METHOD@ -TriggerSite: @TRIGGER_SITE@ -ScpCommand: @SCPCOMMAND@ # Dashboard start time NightlyStartTime: @NIGHTLY_START_TIME@ diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake index 93cd74a..e763bab 100644 --- a/Modules/ExternalProject.cmake +++ b/Modules/ExternalProject.cmake @@ -550,6 +550,14 @@ External Project Definition ``LOG_MERGED_STDOUTERR <bool>`` When enabled, the output the step is not split by stdout and stderr. + ``LOG_OUTPUT_ON_FAILURE <bool>`` + This option only has an effect if at least one of the other ``LOG_<step>`` + options is enabled. If an error occurs for a step which has logging to + file enabled, that step's output will be printed to the console if + ``LOG_OUTPUT_ON_FAILURE`` is set to true. For cases where a large amount + of output is recorded, just the end of that output may be printed to the + console. + **Terminal Access Options:** Steps can be given direct access to the terminal in some cases. Giving a step access to the terminal may allow it to receive terminal input if @@ -1953,6 +1961,7 @@ endif() set(script ${stamp_dir}/${name}-${step}-$<CONFIG>.cmake) set(logbase ${log_dir}/${name}-${step}) get_property(log_merged TARGET ${name} PROPERTY _EP_LOG_MERGED_STDOUTERR) + get_property(log_output_on_failure TARGET ${name} PROPERTY _EP_LOG_OUTPUT_ON_FAILURE) if (log_merged) set(stdout_log "${logbase}.log") set(stderr_log "${logbase}.log") @@ -1961,21 +1970,55 @@ endif() set(stderr_log "${logbase}-err.log") endif() set(code " +cmake_minimum_required(VERSION 3.13) ${code_cygpath_make} set(command \"${command}\") +set(log_merged \"${log_merged}\") +set(log_output_on_failure \"${log_output_on_failure}\") +set(stdout_log \"${stdout_log}\") +set(stderr_log \"${stderr_log}\") execute_process( COMMAND \${command} RESULT_VARIABLE result - OUTPUT_FILE \"${stdout_log}\" - ERROR_FILE \"${stderr_log}\" + OUTPUT_FILE \"\${stdout_log}\" + ERROR_FILE \"\${stderr_log}\" ) +macro(read_up_to_max_size log_file output_var) + file(SIZE \${log_file} determined_size) + set(max_size 10240) + if (determined_size GREATER max_size) + math(EXPR seek_position \"\${determined_size} - \${max_size}\") + file(READ \${log_file} \${output_var} OFFSET \${seek_position}) + set(\${output_var} \"...skipping to end...\\n\${\${output_var}}\") + else() + file(READ \${log_file} \${output_var}) + endif() +endmacro() if(result) set(msg \"Command failed: \${result}\\n\") foreach(arg IN LISTS command) set(msg \"\${msg} '\${arg}'\") endforeach() - set(msg \"\${msg}\\nSee also\\n ${stderr_log}\") - message(FATAL_ERROR \"\${msg}\") + if (\${log_merged}) + set(msg \"\${msg}\\nSee also\\n \${stderr_log}\") + else() + set(msg \"\${msg}\\nSee also\\n ${logbase}-*.log\") + endif() + if (\${log_output_on_failure}) + message(SEND_ERROR \"\${msg}\") + if (\${log_merged}) + read_up_to_max_size(\"\${stderr_log}\" error_log_contents) + message(STATUS \"Log output is:\\n\${error_log_contents}\") + else() + read_up_to_max_size(\"\${stdout_log}\" out_log_contents) + read_up_to_max_size(\"\${stderr_log}\" err_log_contents) + message(STATUS \"stdout output is:\\n\${out_log_contents}\") + message(STATUS \"stderr output is:\\n\${err_log_contents}\") + endif() + message(FATAL_ERROR \"Stopping after outputting logs.\") + else() + message(FATAL_ERROR \"\${msg}\") + endif() else() set(msg \"${name} ${step} command succeeded. See also ${logbase}-*.log\") message(STATUS \"\${msg}\") diff --git a/Modules/FeatureSummary.cmake b/Modules/FeatureSummary.cmake index fbce235..4a3e83a 100644 --- a/Modules/FeatureSummary.cmake +++ b/Modules/FeatureSummary.cmake @@ -97,8 +97,6 @@ Functions #]=======================================================================] -include(CMakeParseArguments) - function(_FS_GET_FEATURE_SUMMARY _property _var _includeQuiet) get_property(_fsPkgTypes GLOBAL PROPERTY FeatureSummary_PKG_TYPES) diff --git a/Modules/FindBLAS.cmake b/Modules/FindBLAS.cmake index d150826..b6348fd 100644 --- a/Modules/FindBLAS.cmake +++ b/Modules/FindBLAS.cmake @@ -94,6 +94,7 @@ if(BLA_PREFER_PKGCONFIG) find_package(PkgConfig) pkg_check_modules(PKGC_BLAS blas) if(PKGC_BLAS_FOUND) + set(BLAS_FOUND ${PKGC_BLAS_FOUND}) set(BLAS_LIBRARIES "${PKGC_BLAS_LINK_LIBRARIES}") return() endif() @@ -126,6 +127,8 @@ macro(Check_Fortran_Libraries LIBRARIES _prefix _name _flags _list _thread) endif () endif () + list(APPEND _libdir "${CMAKE_C_IMPLICIT_LINK_DIRECTORIES}") + foreach(_library ${_list}) set(_combined_name ${_combined_name}_${_library}) @@ -170,6 +173,8 @@ macro(Check_Fortran_Libraries LIBRARIES _prefix _name _flags _list _thread) if(_libraries_work) if("${_list}" STREQUAL "") set(${LIBRARIES} "${LIBRARIES}-PLACEHOLDER-FOR-EMPTY-LIBRARIES") + else() + set(${LIBRARIES} ${${LIBRARIES}} ${_thread}) # for static link endif() else() set(${LIBRARIES} FALSE) @@ -205,14 +210,34 @@ endif () #BLAS in intel mkl 10+ library? (em64t 64bit) if (BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All") if (NOT BLAS_LIBRARIES) + + # System-specific settings + if (WIN32) + if (BLA_STATIC) + set(BLAS_mkl_DLL_SUFFIX "") + else() + set(BLAS_mkl_DLL_SUFFIX "_dll") + endif() + else() + if(CMAKE_Fortran_COMPILER_LOADED AND CMAKE_Fortran_COMPILER_ID STREQUAL "GNU") + set(BLAS_mkl_INTFACE "gf") + set(BLAS_mkl_THREADING "gnu") + set(BLAS_mkl_OMP "gomp") + else() + set(BLAS_mkl_INTFACE "intel") + set(BLAS_mkl_THREADING "intel") + set(BLAS_mkl_OMP "iomp5") + endif() + set(BLAS_mkl_LM "-lm") + set(BLAS_mkl_LDL "-ldl") + endif() + if (BLA_VENDOR MATCHES "_64ilp") set(BLAS_mkl_ILP_MODE "ilp64") else () set(BLAS_mkl_ILP_MODE "lp64") endif () - if (NOT WIN32) - set(LM "-lm") - endif () + if (CMAKE_C_COMPILER_LOADED OR CMAKE_CXX_COMPILER_LOADED) if(BLAS_FIND_QUIETLY OR NOT BLAS_FIND_REQUIRED) find_package(Threads) @@ -226,12 +251,6 @@ if (BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All") set(BLAS_mkl_SEARCH_SYMBOL sgemm_f95) set(_LIBRARIES BLAS95_LIBRARIES) if (WIN32) - if (BLA_STATIC) - set(BLAS_mkl_DLL_SUFFIX "") - else() - set(BLAS_mkl_DLL_SUFFIX "_dll") - endif() - # Find the main file (32-bit or 64-bit) set(BLAS_SEARCH_LIBS_WIN_MAIN "") if (BLA_VENDOR STREQUAL "Intel10_32" OR BLA_VENDOR STREQUAL "All") @@ -267,38 +286,32 @@ if (BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All") endforeach() else () if (BLA_VENDOR STREQUAL "Intel10_32" OR BLA_VENDOR STREQUAL "All") + # old version + list(APPEND BLAS_SEARCH_LIBS + "mkl_blas95 mkl_${BLAS_mkl_INTFACE} mkl_${BLAS_mkl_THREADING}_thread mkl_core guide") + + # mkl >= 10.3 list(APPEND BLAS_SEARCH_LIBS - "mkl_blas95 mkl_intel mkl_intel_thread mkl_core guide") + "mkl_blas95 mkl_${BLAS_mkl_INTFACE} mkl_${BLAS_mkl_THREADING}_thread mkl_core ${BLAS_mkl_OMP}") endif () if (BLA_VENDOR MATCHES "^Intel10_64i?lp$" OR BLA_VENDOR STREQUAL "All") # old version list(APPEND BLAS_SEARCH_LIBS - "mkl_blas95 mkl_intel_${BLAS_mkl_ILP_MODE} mkl_intel_thread mkl_core guide") + "mkl_blas95 mkl_${BLAS_mkl_INTFACE}_${BLAS_mkl_ILP_MODE} mkl_${BLAS_mkl_THREADING}_thread mkl_core guide") # mkl >= 10.3 - if (CMAKE_C_COMPILER MATCHES ".+gcc") - list(APPEND BLAS_SEARCH_LIBS - "mkl_blas95_${BLAS_mkl_ILP_MODE} mkl_intel_${BLAS_mkl_ILP_MODE} mkl_gnu_thread mkl_core gomp") - else () - list(APPEND BLAS_SEARCH_LIBS - "mkl_blas95_${BLAS_mkl_ILP_MODE} mkl_intel_${BLAS_mkl_ILP_MODE} mkl_intel_thread mkl_core iomp5") - endif () + list(APPEND BLAS_SEARCH_LIBS + "mkl_blas95_${BLAS_mkl_ILP_MODE} mkl_${BLAS_mkl_INTFACE}_${BLAS_mkl_ILP_MODE} mkl_${BLAS_mkl_THREADING}_thread mkl_core ${BLAS_mkl_OMP}") endif () if (BLA_VENDOR MATCHES "^Intel10_64i?lp_seq$" OR BLA_VENDOR STREQUAL "All") list(APPEND BLAS_SEARCH_LIBS - "mkl_blas95_${BLAS_mkl_ILP_MODE} mkl_intel_${BLAS_mkl_ILP_MODE} mkl_sequential mkl_core") + "mkl_blas95_${BLAS_mkl_ILP_MODE} mkl_${BLAS_mkl_INTFACE}_${BLAS_mkl_ILP_MODE} mkl_sequential mkl_core") endif () endif () else () set(BLAS_mkl_SEARCH_SYMBOL sgemm) set(_LIBRARIES BLAS_LIBRARIES) if (WIN32) - if (BLA_STATIC) - set(BLAS_mkl_DLL_SUFFIX "") - else() - set(BLAS_mkl_DLL_SUFFIX "_dll") - endif() - # Find the main file (32-bit or 64-bit) set(BLAS_SEARCH_LIBS_WIN_MAIN "") if (BLA_VENDOR STREQUAL "Intel10_32" OR BLA_VENDOR STREQUAL "All") @@ -334,27 +347,26 @@ if (BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All") endforeach() else () if (BLA_VENDOR STREQUAL "Intel10_32" OR BLA_VENDOR STREQUAL "All") + # old version + list(APPEND BLAS_SEARCH_LIBS + "mkl_${BLAS_mkl_INTFACE} mkl_${BLAS_mkl_THREADING}_thread mkl_core guide") + + # mkl >= 10.3 list(APPEND BLAS_SEARCH_LIBS - "mkl_intel mkl_intel_thread mkl_core guide") + "mkl_${BLAS_mkl_INTFACE} mkl_${BLAS_mkl_THREADING}_thread mkl_core ${BLAS_mkl_OMP}") endif () if (BLA_VENDOR MATCHES "^Intel10_64i?lp$" OR BLA_VENDOR STREQUAL "All") - # old version list(APPEND BLAS_SEARCH_LIBS - "mkl_intel_${BLAS_mkl_ILP_MODE} mkl_intel_thread mkl_core guide") + "mkl_${BLAS_mkl_INTFACE}_${BLAS_mkl_ILP_MODE} mkl_${BLAS_mkl_THREADING}_thread mkl_core guide") # mkl >= 10.3 - if (CMAKE_C_COMPILER MATCHES ".+gcc") - list(APPEND BLAS_SEARCH_LIBS - "mkl_intel_${BLAS_mkl_ILP_MODE} mkl_gnu_thread mkl_core gomp") - else () - list(APPEND BLAS_SEARCH_LIBS - "mkl_intel_${BLAS_mkl_ILP_MODE} mkl_intel_thread mkl_core iomp5") - endif () + list(APPEND BLAS_SEARCH_LIBS + "mkl_${BLAS_mkl_INTFACE}_${BLAS_mkl_ILP_MODE} mkl_${BLAS_mkl_THREADING}_thread mkl_core ${BLAS_mkl_OMP}") endif () if (BLA_VENDOR MATCHES "^Intel10_64i?lp_seq$" OR BLA_VENDOR STREQUAL "All") list(APPEND BLAS_SEARCH_LIBS - "mkl_intel_${BLAS_mkl_ILP_MODE} mkl_sequential mkl_core") + "mkl_${BLAS_mkl_INTFACE}_${BLAS_mkl_ILP_MODE} mkl_sequential mkl_core") endif () #older vesions of intel mkl libs @@ -378,16 +390,30 @@ if (BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All") ${BLAS_mkl_SEARCH_SYMBOL} "" "${SEARCH_LIBS}" - "${CMAKE_THREAD_LIBS_INIT};${LM}" + "${CMAKE_THREAD_LIBS_INIT};${BLAS_mkl_LM};${BLAS_mkl_LDL}" ) endif () endforeach () endif () unset(BLAS_mkl_ILP_MODE) + unset(BLAS_mkl_INTFACE) + unset(BLAS_mkl_THREADING) + unset(BLAS_mkl_OMP) + unset(BLAS_mkl_DLL_SUFFIX) + unset(BLAS_mkl_LM) + unset(BLAS_mkl_LDL) endif () endif () +if(BLA_F95) + find_package_handle_standard_args(BLAS REQUIRED_VARS BLAS95_LIBRARIES) + set(BLAS95_FOUND ${BLAS_FOUND}) + if(BLAS_FOUND) + set(BLAS_LIBRARIES "${BLAS95_LIBRARIES}") + endif() +endif() + if (BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All") if(NOT BLAS_LIBRARIES) # gotoblas (http://www.tacc.utexas.edu/tacc-projects/gotoblas2) @@ -723,13 +749,7 @@ if (BLA_VENDOR STREQUAL "Generic" OR BLA_VENDOR STREQUAL "All") endif() endif () -if(BLA_F95) - find_package_handle_standard_args(BLAS REQUIRED_VARS BLAS95_LIBRARIES) - set(BLAS95_FOUND ${BLAS_FOUND}) - if(BLAS_FOUND) - set(BLAS_LIBRARIES "${BLAS95_LIBRARIES}") - endif() -else() +if(NOT BLA_F95) find_package_handle_standard_args(BLAS REQUIRED_VARS BLAS_LIBRARIES) endif() diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake index ccd245b..ce307fa 100644 --- a/Modules/FindBoost.cmake +++ b/Modules/FindBoost.cmake @@ -35,6 +35,7 @@ case results are reported in variables:: Boost_MAJOR_VERSION - Boost major version number (X in X.y.z) Boost_MINOR_VERSION - Boost minor version number (Y in x.Y.z) Boost_SUBMINOR_VERSION - Boost subminor version number (Z in x.y.Z) + Boost_VERSION_STRING - Boost version number in x.y.z format Boost_LIB_DIAGNOSTIC_DEFINITIONS (Windows) - Pass to add_definitions() to have diagnostic information about Boost's automatic linking @@ -410,15 +411,12 @@ endmacro() #------------------------------------------------------------------------------- -# -# Runs compiler with "-dumpversion" and parses major/minor -# version with a regex. -# +# Convert CMAKE_CXX_COMPILER_VERSION to boost compiler suffix version. function(_Boost_COMPILER_DUMPVERSION _OUTPUT_VERSION _OUTPUT_VERSION_MAJOR _OUTPUT_VERSION_MINOR) string(REGEX REPLACE "([0-9]+)\\.([0-9]+)(\\.[0-9]+)?" "\\1" - _boost_COMPILER_VERSION_MAJOR ${CMAKE_CXX_COMPILER_VERSION}) + _boost_COMPILER_VERSION_MAJOR "${CMAKE_CXX_COMPILER_VERSION}") string(REGEX REPLACE "([0-9]+)\\.([0-9]+)(\\.[0-9]+)?" "\\2" - _boost_COMPILER_VERSION_MINOR ${CMAKE_CXX_COMPILER_VERSION}) + _boost_COMPILER_VERSION_MINOR "${CMAKE_CXX_COMPILER_VERSION}") set(_boost_COMPILER_VERSION "${_boost_COMPILER_VERSION_MAJOR}${_boost_COMPILER_VERSION_MINOR}") @@ -1371,6 +1369,7 @@ if(Boost_INCLUDE_DIR) math(EXPR Boost_MAJOR_VERSION "${Boost_VERSION} / 100000") math(EXPR Boost_MINOR_VERSION "${Boost_VERSION} / 100 % 1000") math(EXPR Boost_SUBMINOR_VERSION "${Boost_VERSION} % 100") + set(Boost_VERSION_STRING "${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}") string(APPEND Boost_ERROR_REASON "Boost version: ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}\nBoost include path: ${Boost_INCLUDE_DIR}") diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake index 0f5cab4..228eed4 100644 --- a/Modules/FindCUDA.cmake +++ b/Modules/FindCUDA.cmake @@ -875,11 +875,7 @@ endif() if(CUDA_USE_STATIC_CUDA_RUNTIME) if(UNIX) - # Check for the dependent libraries. Here we look for pthreads. - if (DEFINED CMAKE_THREAD_PREFER_PTHREAD) - set(_cuda_cmake_thread_prefer_pthread ${CMAKE_THREAD_PREFER_PTHREAD}) - endif() - set(CMAKE_THREAD_PREFER_PTHREAD 1) + # Check for the dependent libraries. # Many of the FindXYZ CMake comes with makes use of try_compile with int main(){return 0;} # as the source file. Unfortunately this causes a warning with -Wstrict-prototypes and @@ -890,13 +886,6 @@ if(CUDA_USE_STATIC_CUDA_RUNTIME) find_package(Threads REQUIRED) set(CMAKE_C_FLAGS ${_cuda_cmake_c_flags}) - if (DEFINED _cuda_cmake_thread_prefer_pthread) - set(CMAKE_THREAD_PREFER_PTHREAD ${_cuda_cmake_thread_prefer_pthread}) - unset(_cuda_cmake_thread_prefer_pthread) - else() - unset(CMAKE_THREAD_PREFER_PTHREAD) - endif() - if(NOT APPLE) #On Linux, you must link against librt when using the static cuda runtime. find_library(CUDA_rt_LIBRARY rt) diff --git a/Modules/FindCUDA/select_compute_arch.cmake b/Modules/FindCUDA/select_compute_arch.cmake index 1baf051..7ddb709 100644 --- a/Modules/FindCUDA/select_compute_arch.cmake +++ b/Modules/FindCUDA/select_compute_arch.cmake @@ -5,9 +5,9 @@ # - "Auto" detects local machine GPU compute arch at runtime. # - "Common" and "All" cover common and entire subsets of architectures # ARCH_AND_PTX : NAME | NUM.NUM | NUM.NUM(NUM.NUM) | NUM.NUM+PTX -# NAME: Fermi Kepler Maxwell Kepler+Tegra Kepler+Tesla Maxwell+Tegra Pascal +# NAME: Fermi Kepler Maxwell Kepler+Tegra Kepler+Tesla Maxwell+Tegra Pascal Volta Turing # NUM: Any number. Only those pairs are currently accepted by NVCC though: -# 2.0 2.1 3.0 3.2 3.5 3.7 5.0 5.2 5.3 6.0 6.2 +# 2.0 2.1 3.0 3.2 3.5 3.7 5.0 5.2 5.3 6.0 6.2 7.0 7.2 7.5 # Returns LIST of flags to be added to CUDA_NVCC_FLAGS in ${out_variable} # Additionally, sets ${out_variable}_readable to the resulting numeric list # Example: @@ -63,12 +63,23 @@ endif () if(CUDA_VERSION VERSION_GREATER_EQUAL "9.0") list(APPEND CUDA_KNOWN_GPU_ARCHITECTURES "Volta") list(APPEND CUDA_COMMON_GPU_ARCHITECTURES "7.0" "7.0+PTX") + list(APPEND CUDA_ALL_GPU_ARCHITECTURES "7.0" "7.0+PTX" "7.2" "7.2+PTX") if(CUDA_VERSION VERSION_LESS "10.0") set(CUDA_LIMIT_GPU_ARCHITECTURE "8.0") endif() endif() +if(CUDA_VERSION VERSION_GREATER_EQUAL "10.0") + list(APPEND CUDA_KNOWN_GPU_ARCHITECTURES "Turing") + list(APPEND CUDA_COMMON_GPU_ARCHITECTURES "7.5" "7.5+PTX") + list(APPEND CUDA_ALL_GPU_ARCHITECTURES "7.5" "7.5+PTX") + + if(CUDA_VERSION VERSION_LESS "11.0") + set(CUDA_LIMIT_GPU_ARCHITECTURE "9.0") + endif() +endif() + ################################################################################################ # A function for automatic detection of GPUs installed (if autodetection is enabled) # Usage: @@ -200,6 +211,9 @@ function(CUDA_SELECT_NVCC_ARCH_FLAGS out_variable) elseif(${arch_name} STREQUAL "Volta") set(arch_bin 7.0 7.0) set(arch_ptx 7.0) + elseif(${arch_name} STREQUAL "Turing") + set(arch_bin 7.5) + set(arch_ptx 7.5) else() message(SEND_ERROR "Unknown CUDA Architecture Name ${arch_name} in CUDA_SELECT_NVCC_ARCH_FLAGS") endif() diff --git a/Modules/FindCURL.cmake b/Modules/FindCURL.cmake index a4b238d..d28dfea 100644 --- a/Modules/FindCURL.cmake +++ b/Modules/FindCURL.cmake @@ -7,6 +7,14 @@ FindCURL Find the native CURL headers and libraries. +This module accept optional COMPONENTS to check supported features and +protocols:: + + PROTOCOLS: ICT FILE FTP FTPS GOPHER HTTP HTTPS IMAP IMAPS LDAP LDAPS POP3 + POP3S RTMP RTSP SCP SFTP SMB SMBS SMTP SMTPS TELNET TFTP + FEATURES: SSL IPv6 UnixSockets libz AsynchDNS IDN GSS-API PSL SPNEGO + Kerberos NTLM NTLM_WB TLS-SRP HTTP2 HTTPS-proxy + IMPORTED Targets ^^^^^^^^^^^^^^^^ @@ -31,8 +39,20 @@ This module defines the following variables: The version of curl found. #]=======================================================================] +find_package(PkgConfig QUIET) +if(PKG_CONFIG_FOUND) + pkg_check_modules(PC_CURL QUIET libcurl) + if(PC_CURL_FOUND) + set(CURL_VERSION_STRING ${PC_CURL_VERSION}) + pkg_get_variable(CURL_SUPPORTED_PROTOCOLS libcurl supported_protocols) + pkg_get_variable(CURL_SUPPORTED_FEATURES libcurl supported_features) + endif() +endif() + # Look for the header file. -find_path(CURL_INCLUDE_DIR NAMES curl/curl.h) +find_path(CURL_INCLUDE_DIR + NAMES curl/curl.h + HINTS ${PC_CURL_INCLUDE_DIRS}) mark_as_advanced(CURL_INCLUDE_DIR) if(NOT CURL_LIBRARY) @@ -45,6 +65,7 @@ if(NOT CURL_LIBRARY) curllib_static # Windows older "Win32 - MSVC" prebuilts (libcurl.lib, e.g. libcurl-7.15.5-win32-msvc.zip): libcurl + HINTS ${PC_CURL_LIBRARY_DIRS} ) mark_as_advanced(CURL_LIBRARY_RELEASE) @@ -52,6 +73,7 @@ if(NOT CURL_LIBRARY) # Windows MSVC CMake builds in debug configuration on vcpkg: libcurl-d_imp libcurl-d + HINTS ${PC_CURL_LIBRARY_DIRS} ) mark_as_advanced(CURL_LIBRARY_DEBUG) @@ -59,7 +81,7 @@ if(NOT CURL_LIBRARY) select_library_configurations(CURL) endif() -if(CURL_INCLUDE_DIR) +if(CURL_INCLUDE_DIR AND NOT CURL_VERSION_STRING) foreach(_curl_version_header curlver.h curl.h) if(EXISTS "${CURL_INCLUDE_DIR}/curl/${_curl_version_header}") file(STRINGS "${CURL_INCLUDE_DIR}/curl/${_curl_version_header}" curl_version_str REGEX "^#define[\t ]+LIBCURL_VERSION[\t ]+\".*\"") @@ -71,10 +93,57 @@ if(CURL_INCLUDE_DIR) endforeach() endif() +if(CURL_FIND_COMPONENTS) + set(CURL_KNOWN_PROTOCOLS ICT FILE FTP FTPS GOPHER HTTP HTTPS IMAP IMAPS LDAP LDAPS POP3 POP3S RTMP RTSP SCP SFTP SMB SMBS SMTP SMTPS TELNET TFTP) + set(CURL_KNOWN_FEATURES SSL IPv6 UnixSockets libz AsynchDNS IDN GSS-API PSL SPNEGO Kerberos NTLM NTLM_WB TLS-SRP HTTP2 HTTPS-proxy) + foreach(component IN LISTS CURL_KNOWN_PROTOCOLS CURL_KNOWN_FEATURES) + set(CURL_${component}_FOUND FALSE) + endforeach() + if(NOT PC_CURL_FOUND) + find_program(CURL_CONFIG_EXECUTABLE NAMES curl-config) + if(CURL_CONFIG_EXECUTABLE) + execute_process(COMMAND ${CURL_CONFIG_EXECUTABLE} --version + OUTPUT_VARIABLE CURL_CONFIG_VERSION_STRING + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE) + execute_process(COMMAND ${CURL_CONFIG_EXECUTABLE} --feature + OUTPUT_VARIABLE CURL_CONFIG_FEATURES_STRING + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE) + string(REPLACE "\n" ";" CURL_CONFIG_FEATURES "${CURL_CONFIG_FEATURES_STRING}") + execute_process(COMMAND ${CURL_CONFIG_EXECUTABLE} --protocols + OUTPUT_VARIABLE CURL_CONFIG_PROTOCOLS_STRING + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE) + string(REPLACE "\n" ";" CURL_CONFIG_PROTOCOLS "${CURL_CONFIG_PROTOCOLS_STRING}") + endif() + + endif() + foreach(component IN LISTS CURL_FIND_COMPONENTS) + list(FIND CURL_KNOWN_PROTOCOLS ${component} _found) + if(_found) + list(FIND CURL_SUPPORTED_PROTOCOLS ${component} _found) + if(_found) + set(CURL_${component}_FOUND TRUE) + elseif(CURL_FIND_REQUIRED) + message(FATAL_ERROR "CURL: Required protocol ${component} is not found") + endif() + else() + list(FIND CURL_SUPPORTED_FEATURES ${component} _found) + if(_found) + set(CURL_${component}_FOUND TRUE) + elseif(CURL_FIND_REQUIRED) + message(FATAL_ERROR "CURL: Required feature ${component} is not found") + endif() + endif() + endforeach() +endif() + include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(CURL +find_package_handle_standard_args(CURL REQUIRED_VARS CURL_LIBRARY CURL_INCLUDE_DIR - VERSION_VAR CURL_VERSION_STRING) + VERSION_VAR CURL_VERSION_STRING + HANDLE_COMPONENTS) if(CURL_FOUND) set(CURL_LIBRARIES ${CURL_LIBRARY}) diff --git a/Modules/FindDCMTK.cmake b/Modules/FindDCMTK.cmake index 302c089..111e0ff 100644 --- a/Modules/FindDCMTK.cmake +++ b/Modules/FindDCMTK.cmake @@ -200,7 +200,6 @@ if(DCMTK_oflog_LIBRARY_RELEASE OR DCMTK_oflog_LIBRARY_DEBUG) # Hack - Not having a DCMTKConfig.cmake file to read the settings from, we will attempt to # find the library in all cases. # Ideally, pthread library should be discovered only if DCMTK_WITH_THREADS is enabled. - set(CMAKE_THREAD_PREFER_PTHREAD TRUE) find_package(Threads) endif() diff --git a/Modules/FindDoxygen.cmake b/Modules/FindDoxygen.cmake index 2ed9449..fdd3a92 100644 --- a/Modules/FindDoxygen.cmake +++ b/Modules/FindDoxygen.cmake @@ -485,12 +485,18 @@ endmacro() # Find Graphviz Dot... # macro(_Doxygen_find_dot) - set(_x86 "(x86)") - file( - GLOB _Doxygen_GRAPHVIZ_BIN_DIRS - "$ENV{ProgramFiles}/Graphviz*/bin" - "$ENV{ProgramFiles${_x86}}/Graphviz*/bin" - ) + if(WIN32) + set(_x86 "(x86)") + file( + GLOB _Doxygen_GRAPHVIZ_BIN_DIRS + "$ENV{ProgramFiles}/Graphviz*/bin" + "$ENV{ProgramFiles${_x86}}/Graphviz*/bin" + ) + unset(_x86) + else() + set(_Doxygen_GRAPHVIZ_BIN_DIRS "") + endif() + find_program( DOXYGEN_DOT_EXECUTABLE NAMES dot @@ -529,7 +535,6 @@ macro(_Doxygen_find_dot) endif() unset(_Doxygen_GRAPHVIZ_BIN_DIRS) - unset(_x86) endmacro() # diff --git a/Modules/FindGIF.cmake b/Modules/FindGIF.cmake index 9a995af..9687b57 100644 --- a/Modules/FindGIF.cmake +++ b/Modules/FindGIF.cmake @@ -7,22 +7,43 @@ FindGIF This finds the GIF library (giflib) -The module defines the following variables: +Imported targets +^^^^^^^^^^^^^^^^ + +This module defines the following :prop_tgt:`IMPORTED` target: + +``GIF::GIF`` + The giflib library, if found. + +Result variables +^^^^^^^^^^^^^^^^ + +This module will set the following variables in your project: ``GIF_FOUND`` - True if giflib was found + If false, do not try to use GIF. +``GIF_INCLUDE_DIRS`` + where to find gif_lib.h, etc. ``GIF_LIBRARIES`` - Libraries to link to in order to use giflib -``GIF_INCLUDE_DIR`` - where to find the headers + the libraries needed to use GIF. ``GIF_VERSION`` - 3, 4 or a full version string (eg 5.1.4) for versions >= 4.1.6 + 3, 4 or a full version string (eg 5.1.4) for versions >= 4.1.6. + +Cache variables +^^^^^^^^^^^^^^^ + +The following cache variables may also be set: -The minimum required version of giflib can be specified using the -standard syntax, e.g. find_package(GIF 4) +``GIF_INCLUDE_DIR`` + where to find the GIF headers. +``GIF_LIBRARY`` + where to find the GIF library. + +Hints +^^^^^ -$GIF_DIR is an environment variable that would correspond to the -./configure --prefix=$GIF_DIR +``GIF_DIR`` is an environment variable that would correspond to the +``./configure --prefix=$GIF_DIR``. #]=======================================================================] # Created by Eric Wing. @@ -44,9 +65,6 @@ find_library(GIF_LIBRARY PATH_SUFFIXES lib ) -# see readme.txt -set(GIF_LIBRARIES ${GIF_LIBRARY}) - # Very basic version detection. # The GIF_LIB_VERSION string in gif_lib.h seems to be unreliable, since it seems # to be always " Version 2.0, " in versions 3.x of giflib. @@ -90,4 +108,20 @@ include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) FIND_PACKAGE_HANDLE_STANDARD_ARGS(GIF REQUIRED_VARS GIF_LIBRARY GIF_INCLUDE_DIR VERSION_VAR GIF_VERSION ) +if(GIF_FOUND) + set(GIF_INCLUDE_DIRS "${GIF_INCLUDE_DIR}") + set(GIF_LIBRARIES ${GIF_LIBRARY}) + + if(NOT TARGET GIF::GIF) + add_library(GIF::GIF UNKNOWN IMPORTED) + set_target_properties(GIF::GIF PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${GIF_INCLUDE_DIRS}") + if(EXISTS "${GIF_LIBRARY}") + set_target_properties(GIF::GIF PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "C" + IMPORTED_LOCATION "${GIF_LIBRARY}") + endif() + endif() +endif() + mark_as_advanced(GIF_INCLUDE_DIR GIF_LIBRARY) diff --git a/Modules/FindHDF5.cmake b/Modules/FindHDF5.cmake index e36767a..2772b7d 100644 --- a/Modules/FindHDF5.cmake +++ b/Modules/FindHDF5.cmake @@ -818,7 +818,7 @@ if( NOT HDF5_FOUND ) set( THIS_LIBRARY_SEARCH_DEBUG lib${LIB}d.a lib${LIB}_debug.a lib${LIB}d lib${LIB}_D lib${LIB}_debug lib${LIB}d-static.a lib${LIB}_debug-static.a lib${LIB}d-static lib${LIB}_D-static lib${LIB}_debug-static ) - set( THIS_LIBRARY_SEARCH_RELEASE lib${LIB}.a ${LIB} lib${LIB}-static.a lib${LIB}-static) + set( THIS_LIBRARY_SEARCH_RELEASE lib${LIB}.a lib${LIB} lib${LIB}-static.a lib${LIB}-static) else() set( THIS_LIBRARY_SEARCH_DEBUG ${LIB}d ${LIB}_D ${LIB}_debug ${LIB}d-shared ${LIB}_D-shared ${LIB}_debug-shared) set( THIS_LIBRARY_SEARCH_RELEASE ${LIB} ${LIB}-shared) diff --git a/Modules/FindLAPACK.cmake b/Modules/FindLAPACK.cmake index 62ff94c..7619664 100644 --- a/Modules/FindLAPACK.cmake +++ b/Modules/FindLAPACK.cmake @@ -96,6 +96,9 @@ if (NOT _libdir) set(_libdir ENV LD_LIBRARY_PATH) endif () endif () + +list(APPEND _libdir "${CMAKE_C_IMPLICIT_LINK_DIRECTORIES}") + foreach(_library ${_list}) set(_combined_name ${_combined_name}_${_library}) @@ -175,6 +178,84 @@ if(BLAS_FOUND) endif() endif () +#intel lapack +if (BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All") + if (NOT WIN32) + set(LAPACK_mkl_LM "-lm") + set(LAPACK_mkl_LDL "-ldl") + endif () + if (CMAKE_C_COMPILER_LOADED OR CMAKE_CXX_COMPILER_LOADED) + if(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED) + find_PACKAGE(Threads) + else() + find_package(Threads REQUIRED) + endif() + + if (BLA_VENDOR MATCHES "_64ilp") + set(LAPACK_mkl_ILP_MODE "ilp64") + else () + set(LAPACK_mkl_ILP_MODE "lp64") + endif () + + set(LAPACK_SEARCH_LIBS "") + + if (BLA_F95) + set(LAPACK_mkl_SEARCH_SYMBOL "cheev_f95") + set(_LIBRARIES LAPACK95_LIBRARIES) + set(_BLAS_LIBRARIES ${BLAS95_LIBRARIES}) + + # old + list(APPEND LAPACK_SEARCH_LIBS + "mkl_lapack95") + # new >= 10.3 + list(APPEND LAPACK_SEARCH_LIBS + "mkl_intel_c") + list(APPEND LAPACK_SEARCH_LIBS + "mkl_lapack95_${LAPACK_mkl_ILP_MODE}") + else() + set(LAPACK_mkl_SEARCH_SYMBOL "cheev") + set(_LIBRARIES LAPACK_LIBRARIES) + set(_BLAS_LIBRARIES ${BLAS_LIBRARIES}) + + # old + list(APPEND LAPACK_SEARCH_LIBS + "mkl_lapack") + endif() + + # First try empty lapack libs + if (NOT ${_LIBRARIES}) + check_lapack_libraries( + ${_LIBRARIES} + LAPACK + ${LAPACK_mkl_SEARCH_SYMBOL} + "" + "" + "${_BLAS_LIBRARIES}" + "" + ) + endif () + # Then try the search libs + foreach (IT ${LAPACK_SEARCH_LIBS}) + if (NOT ${_LIBRARIES}) + check_lapack_libraries( + ${_LIBRARIES} + LAPACK + ${LAPACK_mkl_SEARCH_SYMBOL} + "" + "${IT}" + "${_BLAS_LIBRARIES}" + "${CMAKE_THREAD_LIBS_INIT};${LAPACK_mkl_LM};${LAPACK_mkl_LDL}" + ) + endif () + endforeach () + + unset(LAPACK_mkl_ILP_MODE) + unset(LAPACK_mkl_SEARCH_SYMBOL) + unset(LAPACK_mkl_LM) + unset(LAPACK_mkl_LDL) + endif () +endif() + if (BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All") if(NOT LAPACK_LIBRARIES) check_lapack_libraries( @@ -267,82 +348,7 @@ if (BLA_VENDOR STREQUAL "Generic" OR ) endif () endif () -#intel lapack -if (BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All") - if (NOT WIN32) - set(LM "-lm") - endif () - if (CMAKE_C_COMPILER_LOADED OR CMAKE_CXX_COMPILER_LOADED) - if(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED) - find_PACKAGE(Threads) - else() - find_package(Threads REQUIRED) - endif() - - if (BLA_VENDOR MATCHES "_64ilp") - set(BLAS_mkl_ILP_MODE "ilp64") - else () - set(BLAS_mkl_ILP_MODE "lp64") - endif () - - set(LAPACK_SEARCH_LIBS "") - - if (BLA_F95) - set(LAPACK_mkl_SEARCH_SYMBOL "cheev_f95") - set(_LIBRARIES LAPACK95_LIBRARIES) - set(_BLAS_LIBRARIES ${BLAS95_LIBRARIES}) - - # old - list(APPEND LAPACK_SEARCH_LIBS - "mkl_lapack95") - # new >= 10.3 - list(APPEND LAPACK_SEARCH_LIBS - "mkl_intel_c") - list(APPEND LAPACK_SEARCH_LIBS - "mkl_lapack95_${BLAS_mkl_ILP_MODE}") - else() - set(LAPACK_mkl_SEARCH_SYMBOL "cheev") - set(_LIBRARIES LAPACK_LIBRARIES) - set(_BLAS_LIBRARIES ${BLAS_LIBRARIES}) - # old - list(APPEND LAPACK_SEARCH_LIBS - "mkl_lapack") - # new >= 10.3 - list(APPEND LAPACK_SEARCH_LIBS - "mkl_gf_${BLAS_mkl_ILP_MODE}") - endif() - - # First try empty lapack libs - if (NOT ${_LIBRARIES}) - check_lapack_libraries( - ${_LIBRARIES} - BLAS - ${LAPACK_mkl_SEARCH_SYMBOL} - "" - "" - "${_BLAS_LIBRARIES}" - "${CMAKE_THREAD_LIBS_INIT};${LM}" - ) - endif () - # Then try the search libs - foreach (IT ${LAPACK_SEARCH_LIBS}) - if (NOT ${_LIBRARIES}) - check_lapack_libraries( - ${_LIBRARIES} - BLAS - ${LAPACK_mkl_SEARCH_SYMBOL} - "" - "${IT}" - "${_BLAS_LIBRARIES}" - "${CMAKE_THREAD_LIBS_INIT};${LM}" - ) - endif () - endforeach () - - unset(BLAS_mkl_ILP_MODE) - endif () -endif() else() message(STATUS "LAPACK requires BLAS") endif() diff --git a/Modules/FindLibLZMA.cmake b/Modules/FindLibLZMA.cmake index 6d30e57..6225744 100644 --- a/Modules/FindLibLZMA.cmake +++ b/Modules/FindLibLZMA.cmake @@ -5,22 +5,40 @@ FindLibLZMA ----------- -Find LibLZMA +Find LZMA compression algorithm headers and library. -Find LibLZMA headers and library -:: +Imported Targets +^^^^^^^^^^^^^^^^ - LIBLZMA_FOUND - True if liblzma is found. - LIBLZMA_INCLUDE_DIRS - Directory where liblzma headers are located. - LIBLZMA_LIBRARIES - Lzma libraries to link against. - LIBLZMA_HAS_AUTO_DECODER - True if lzma_auto_decoder() is found (required). - LIBLZMA_HAS_EASY_ENCODER - True if lzma_easy_encoder() is found (required). - LIBLZMA_HAS_LZMA_PRESET - True if lzma_lzma_preset() is found (required). - LIBLZMA_VERSION_MAJOR - The major version of lzma - LIBLZMA_VERSION_MINOR - The minor version of lzma - LIBLZMA_VERSION_PATCH - The patch version of lzma - LIBLZMA_VERSION_STRING - version number as a string (ex: "5.0.3") +This module defines :prop_tgt:`IMPORTED` target ``LibLZMA::LibLZMA``, if +liblzma has been found. + +Result variables +^^^^^^^^^^^^^^^^ + +This module will set the following variables in your project: + +``LIBLZMA_FOUND`` + True if liblzma headers and library were found. +``LIBLZMA_INCLUDE_DIRS`` + Directory where liblzma headers are located. +``LIBLZMA_LIBRARIES`` + Lzma libraries to link against. +``LIBLZMA_HAS_AUTO_DECODER`` + True if lzma_auto_decoder() is found (required). +``LIBLZMA_HAS_EASY_ENCODER`` + True if lzma_easy_encoder() is found (required). +``LIBLZMA_HAS_LZMA_PRESET`` + True if lzma_lzma_preset() is found (required). +``LIBLZMA_VERSION_MAJOR`` + The major version of lzma +``LIBLZMA_VERSION_MINOR`` + The minor version of lzma +``LIBLZMA_VERSION_PATCH`` + The patch version of lzma +``LIBLZMA_VERSION_STRING`` + version number as a string (ex: "5.0.3") #]=======================================================================] find_path(LIBLZMA_INCLUDE_DIR lzma.h ) @@ -51,17 +69,23 @@ if (LIBLZMA_LIBRARY) endif () include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibLZMA REQUIRED_VARS LIBLZMA_INCLUDE_DIR - LIBLZMA_LIBRARY +find_package_handle_standard_args(LibLZMA REQUIRED_VARS LIBLZMA_LIBRARY + LIBLZMA_INCLUDE_DIR LIBLZMA_HAS_AUTO_DECODER LIBLZMA_HAS_EASY_ENCODER LIBLZMA_HAS_LZMA_PRESET VERSION_VAR LIBLZMA_VERSION_STRING ) +mark_as_advanced( LIBLZMA_INCLUDE_DIR LIBLZMA_LIBRARY ) if (LIBLZMA_FOUND) set(LIBLZMA_LIBRARIES ${LIBLZMA_LIBRARY}) set(LIBLZMA_INCLUDE_DIRS ${LIBLZMA_INCLUDE_DIR}) + if(NOT TARGET LibLZMA::LibLZMA) + add_library(LibLZMA::LibLZMA UNKNOWN IMPORTED) + set_target_properties(LibLZMA::LibLZMA PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES ${LIBLZMA_INCLUDE_DIR} + IMPORTED_LINK_INTERFACE_LANGUAGES C + IMPORTED_LOCATION ${LIBLZMA_LIBRARY}) + endif() endif () - -mark_as_advanced( LIBLZMA_INCLUDE_DIR LIBLZMA_LIBRARY ) diff --git a/Modules/FindOctave.cmake b/Modules/FindOctave.cmake new file mode 100644 index 0000000..8ae6a47 --- /dev/null +++ b/Modules/FindOctave.cmake @@ -0,0 +1,167 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +#[=======================================================================[.rst: +FindOctave +---------- + +Finds GNU Octave interpreter, libraries and compilers. + +Imported targets +^^^^^^^^^^^^^^^^ + +This module defines the following :prop_tgt:`IMPORTED` targets: + +``Octave::Interpreter`` + Octave interpreter (the main program) +``Octave::Octave`` + include directories and libraries + +If no ``COMPONENTS`` are specified, ``Interpreter`` is assumed. + +Result Variables +^^^^^^^^^^^^^^^^ + +``Octave_FOUND`` + Octave interpreter and/or libraries were found +``Octave_<component>_FOUND`` + Octave <component> specified was found + +``Octave_EXECUTABLE`` + Octave interpreter +``Octave_INCLUDE_DIRS`` + include path for mex.h +``Octave_LIBRARIES`` + octinterp, octave libraries + + +Cache variables +^^^^^^^^^^^^^^^ + +The following cache variables may also be set: + +``Octave_INTERP_LIBRARY`` + path to the library octinterp +``Octave_OCTAVE_LIBRARY`` + path to the liboctave library + +#]=======================================================================] + +cmake_policy(VERSION 3.3) + +unset(Octave_REQUIRED_VARS) +unset(Octave_Development_FOUND) +unset(Octave_Interpreter_FOUND) +set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME Interpreter) + +if(Development IN_LIST Octave_FIND_COMPONENTS) + find_program(Octave_CONFIG_EXECUTABLE + NAMES octave-config) + + if(Octave_CONFIG_EXECUTABLE) + + execute_process(COMMAND ${Octave_CONFIG_EXECUTABLE} -p BINDIR + OUTPUT_VARIABLE Octave_BINARY_DIR + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE) + + execute_process(COMMAND ${Octave_CONFIG_EXECUTABLE} -p OCTINCLUDEDIR + OUTPUT_VARIABLE Octave_INCLUDE_DIR + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE) + list(APPEND Octave_REQUIRED_VARS ${Octave_INCLUDE_DIR}) + + execute_process(COMMAND ${Octave_CONFIG_EXECUTABLE} -p OCTLIBDIR + OUTPUT_VARIABLE Octave_LIB1 + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE) + + execute_process(COMMAND ${Octave_CONFIG_EXECUTABLE} -p LIBDIR + OUTPUT_VARIABLE Octave_LIB2 + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE) + + find_library(Octave_INTERP_LIBRARY + NAMES octinterp + PATHS ${Octave_LIB1} ${Octave_LIB2} + NO_DEFAULT_PATH + ) + find_library(Octave_OCTAVE_LIBRARY + NAMES octave + PATHS ${Octave_LIB1} ${Octave_LIB2} + NO_DEFAULT_PATH + ) + list(APPEND Octave_REQUIRED_VARS ${Octave_OCTAVE_LIBRARY} ${Octave_INTERP_LIBRARY}) + + if(Octave_REQUIRED_VARS) + set(Octave_Development_FOUND true) + endif() + endif(Octave_CONFIG_EXECUTABLE) +endif() + +if(Interpreter IN_LIST Octave_FIND_COMPONENTS) + + find_program(Octave_EXECUTABLE + NAMES octave) + + list(APPEND Octave_REQUIRED_VARS ${Octave_EXECUTABLE}) + +endif() + +if(Octave_EXECUTABLE) + execute_process(COMMAND ${Octave_EXECUTABLE} -v + OUTPUT_VARIABLE Octave_VERSION + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE) + + + string(REGEX REPLACE "GNU Octave, version ([0-9]+)\\.[0-9]+\\.[0-9]+.*" "\\1" Octave_VERSION_MAJOR ${Octave_VERSION}) + string(REGEX REPLACE "GNU Octave, version [0-9]+\\.([0-9]+)\\.[0-9]+.*" "\\1" Octave_VERSION_MINOR ${Octave_VERSION}) + string(REGEX REPLACE "GNU Octave, version [0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" Octave_VERSION_PATCH ${Octave_VERSION}) + + set(Octave_VERSION ${Octave_VERSION_MAJOR}.${Octave_VERSION_MINOR}.${Octave_VERSION_PATCH}) + + set(Octave_Interpreter_FOUND true) + +endif(Octave_EXECUTABLE) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Octave + REQUIRED_VARS Octave_REQUIRED_VARS + VERSION_VAR Octave_VERSION + HANDLE_COMPONENTS) + + +if(Octave_Development_FOUND) + set(Octave_LIBRARIES ${Octave_INTERP_LIBRARY} ${Octave_OCTAVE_LIBRARY}) + set(Octave_INCLUDE_DIRS ${Octave_INCLUDE_DIR}) + + if(NOT TARGET Octave::Octave) + add_library(Octave::Octave UNKNOWN IMPORTED) + set_target_properties(Octave::Octave PROPERTIES + IMPORTED_LOCATION ${Octave_OCTAVE_LIBRARY} + INTERFACE_INCLUDE_DIRECTORIES ${Octave_INCLUDE_DIR} + ) + endif() + +endif() + + +if(Octave_Interpreter_FOUND) + if(NOT TARGET Octave::Interpreter) + add_executable(Octave::Interpreter IMPORTED) + set_target_properties(Octave::Interpreter PROPERTIES + IMPORTED_LOCATION ${Octave_EXECUTABLE} + VERSION ${Octave_VERSION}) + endif() +endif() + +mark_as_advanced( + Octave_CONFIG_EXECUTABLE + Octave_INTERP_LIBRARY + Octave_OCTAVE_LIBRARY + Octave_INCLUDE_DIR + Octave_VERSION_MAJOR + Octave_VERSION_MINOR + Octave_VERSION_PATCH +) diff --git a/Modules/FindProtobuf.cmake b/Modules/FindProtobuf.cmake index 593fff6..1758fb3 100644 --- a/Modules/FindProtobuf.cmake +++ b/Modules/FindProtobuf.cmake @@ -121,8 +121,6 @@ Example: #]=======================================================================] function(protobuf_generate) - include(CMakeParseArguments) - set(_options APPEND_PATH DESCRIPTORS) set(_singleargs LANGUAGE OUT_VAR EXPORT_MACRO PROTOC_OUT_DIR) if(COMMAND target_sources) diff --git a/Modules/FindPython/Support.cmake b/Modules/FindPython/Support.cmake index 5b1ed4b..e0ebb90 100644 --- a/Modules/FindPython/Support.cmake +++ b/Modules/FindPython/Support.cmake @@ -711,6 +711,23 @@ if ("Development" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS if (NOT _${_PYTHON_PREFIX}_CONFIG) continue() endif() + if (DEFINED CMAKE_LIBRARY_ARCHITECTURE) + # check that config tool match library architecture + execute_process (COMMAND "${_${_PYTHON_PREFIX}_CONFIG}" --configdir + RESULT_VARIABLE _${_PYTHON_PREFIX}_RESULT + OUTPUT_VARIABLE _${_PYTHON_PREFIX}_CONFIGDIR + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE) + if (_${_PYTHON_PREFIX}_RESULT) + unset (_${_PYTHON_PREFIX}_CONFIG CACHE) + continue() + endif() + string(FIND "${_${_PYTHON_PREFIX}_CONFIGDIR}" "${CMAKE_LIBRARY_ARCHITECTURE}" _${_PYTHON_PREFIX}_RESULT) + if (_${_PYTHON_PREFIX}_RESULT EQUAL -1) + unset (_${_PYTHON_PREFIX}_CONFIG CACHE) + continue() + endif() + endif() # retrieve root install directory execute_process (COMMAND "${_${_PYTHON_PREFIX}_CONFIG}" --prefix diff --git a/Modules/FindThreads.cmake b/Modules/FindThreads.cmake index dfb683f..9c96a1b 100644 --- a/Modules/FindThreads.cmake +++ b/Modules/FindThreads.cmake @@ -12,7 +12,6 @@ The following variables are set :: CMAKE_THREAD_LIBS_INIT - the thread library - CMAKE_USE_SPROC_INIT - are we using sproc? CMAKE_USE_WIN32_THREADS_INIT - using WIN32 threads? CMAKE_USE_PTHREADS_INIT - are we using pthreads CMAKE_HP_PTHREADS_INIT - are we using hp pthreads @@ -23,12 +22,6 @@ The following import target is created Threads::Threads -For systems with multiple thread libraries, caller can set - -:: - - CMAKE_THREAD_PREFER_PTHREAD - If the use of the -pthread compiler and linker flag is preferred then the caller can set @@ -55,12 +48,6 @@ else() message(FATAL_ERROR "FindThreads only works if either C or CXX language is enabled") endif() -# Do we have sproc? -if(CMAKE_SYSTEM_NAME MATCHES IRIX AND NOT CMAKE_THREAD_PREFER_PTHREAD) - include (CheckIncludeFiles) - CHECK_INCLUDE_FILES("sys/types.h;sys/prctl.h" CMAKE_HAVE_SPROC_H) -endif() - # Internal helper macro. # Do NOT even think about using it outside of this file! macro(_check_threads_lib LIBNAME FUNCNAME VARNAME) @@ -113,53 +100,56 @@ macro(_check_pthreads_flag) endif() endmacro() -if(CMAKE_HAVE_SPROC_H AND NOT CMAKE_THREAD_PREFER_PTHREAD) - # We have sproc - set(CMAKE_USE_SPROC_INIT 1) +# Do we have pthreads? +if(CMAKE_C_COMPILER_LOADED) + CHECK_INCLUDE_FILE("pthread.h" CMAKE_HAVE_PTHREAD_H) else() - # Do we have pthreads? - if(CMAKE_C_COMPILER_LOADED) - CHECK_INCLUDE_FILE("pthread.h" CMAKE_HAVE_PTHREAD_H) - else() - CHECK_INCLUDE_FILE_CXX("pthread.h" CMAKE_HAVE_PTHREAD_H) - endif() - if(CMAKE_HAVE_PTHREAD_H) - - # - # We have pthread.h - # Let's check for the library now. - # - set(CMAKE_HAVE_THREADS_LIBRARY) - if(NOT THREADS_HAVE_PTHREAD_ARG) - # Check if pthread functions are in normal C library - CHECK_SYMBOL_EXISTS(pthread_create pthread.h CMAKE_HAVE_LIBC_CREATE) - if(CMAKE_HAVE_LIBC_CREATE) - set(CMAKE_THREAD_LIBS_INIT "") - set(CMAKE_HAVE_THREADS_LIBRARY 1) - set(Threads_FOUND TRUE) - else() - - # Check for -pthread first if enabled. This is the recommended - # way, but not backwards compatible as one must also pass -pthread - # as compiler flag then. - if (THREADS_PREFER_PTHREAD_FLAG) - _check_pthreads_flag() - endif () - - _check_threads_lib(pthreads pthread_create CMAKE_HAVE_PTHREADS_CREATE) - _check_threads_lib(pthread pthread_create CMAKE_HAVE_PTHREAD_CREATE) - if(CMAKE_SYSTEM_NAME MATCHES "SunOS") - # On sun also check for -lthread - _check_threads_lib(thread thr_create CMAKE_HAVE_THR_CREATE) - endif() + CHECK_INCLUDE_FILE_CXX("pthread.h" CMAKE_HAVE_PTHREAD_H) +endif() +if(CMAKE_HAVE_PTHREAD_H) + + # + # We have pthread.h + # Let's check for the library now. + # + set(CMAKE_HAVE_THREADS_LIBRARY) + if(NOT THREADS_HAVE_PTHREAD_ARG) + # Check if pthread functions are in normal C library. + # If the pthread functions already exist in C library, we could just use + # them instead of linking to the additional pthread library. We could + # try to check any pthread symbol name, but here is an exception. If we + # use clang asan build, we will find the pthread_create() symbol in the + # libc(libasan). However, it doesn't have the full pthread implementation. + # So, we can't assume that we have the pthread implementation in libc + # using the pthread_create() checking here. Then, we turn to check the + # pthread_kill() symbol instead. + CHECK_SYMBOL_EXISTS(pthread_kill pthread.h CMAKE_HAVE_LIBC_PTHREAD_KILL) + if(CMAKE_HAVE_LIBC_PTHREAD_KILL) + set(CMAKE_THREAD_LIBS_INIT "") + set(CMAKE_HAVE_THREADS_LIBRARY 1) + set(Threads_FOUND TRUE) + else() + + # Check for -pthread first if enabled. This is the recommended + # way, but not backwards compatible as one must also pass -pthread + # as compiler flag then. + if (THREADS_PREFER_PTHREAD_FLAG) + _check_pthreads_flag() + endif () + + _check_threads_lib(pthreads pthread_create CMAKE_HAVE_PTHREADS_CREATE) + _check_threads_lib(pthread pthread_create CMAKE_HAVE_PTHREAD_CREATE) + if(CMAKE_SYSTEM_NAME MATCHES "SunOS") + # On sun also check for -lthread + _check_threads_lib(thread thr_create CMAKE_HAVE_THR_CREATE) endif() endif() - - _check_pthreads_flag() endif() + + _check_pthreads_flag() endif() -if(CMAKE_THREAD_LIBS_INIT OR CMAKE_HAVE_LIBC_CREATE) +if(CMAKE_THREAD_LIBS_INIT OR CMAKE_HAVE_LIBC_PTHREAD_KILL) set(CMAKE_USE_PTHREADS_INIT 1) set(Threads_FOUND TRUE) endif() diff --git a/Modules/FindX11.cmake b/Modules/FindX11.cmake index 232804a..46a7449 100644 --- a/Modules/FindX11.cmake +++ b/Modules/FindX11.cmake @@ -15,43 +15,43 @@ Try to find X11 on UNIX systems. The following values are defined X11_INCLUDE_DIR - include directories to use X11 X11_LIBRARIES - link against these to use X11 -and also the following more fine grained variables: +and also the following more fine grained variables and targets: :: - X11_ICE_INCLUDE_PATH, X11_ICE_LIB, X11_ICE_FOUND - X11_SM_INCLUDE_PATH, X11_SM_LIB, X11_SM_FOUND - X11_X11_INCLUDE_PATH, X11_X11_LIB - X11_Xaccessrules_INCLUDE_PATH, X11_Xaccess_FOUND + X11_ICE_INCLUDE_PATH, X11_ICE_LIB, X11_ICE_FOUND, X11::ICE + X11_SM_INCLUDE_PATH, X11_SM_LIB, X11_SM_FOUND, X11::SM + X11_X11_INCLUDE_PATH, X11_X11_LIB, X11::X11 + X11_Xaccessrules_INCLUDE_PATH, X11_Xaccessstr_INCLUDE_PATH, X11_Xaccess_FOUND - X11_Xau_INCLUDE_PATH, X11_Xau_LIB, X11_Xau_FOUND - X11_Xcomposite_INCLUDE_PATH, X11_Xcomposite_LIB, X11_Xcomposite_FOUND - X11_Xcursor_INCLUDE_PATH, X11_Xcursor_LIB, X11_Xcursor_FOUND - X11_Xdamage_INCLUDE_PATH, X11_Xdamage_LIB, X11_Xdamage_FOUND - X11_Xdmcp_INCLUDE_PATH, X11_Xdmcp_LIB, X11_Xdmcp_FOUND - X11_Xext_LIB, X11_Xext_FOUND + X11_Xau_INCLUDE_PATH, X11_Xau_LIB, X11_Xau_FOUND, X11::Xau + X11_Xcomposite_INCLUDE_PATH, X11_Xcomposite_LIB, X11_Xcomposite_FOUND, X11::Xcomposite + X11_Xcursor_INCLUDE_PATH, X11_Xcursor_LIB, X11_Xcursor_FOUND, X11::Xcursor + X11_Xdamage_INCLUDE_PATH, X11_Xdamage_LIB, X11_Xdamage_FOUND, X11::Xdamage + X11_Xdmcp_INCLUDE_PATH, X11_Xdmcp_LIB, X11_Xdmcp_FOUND, X11::Xdmcp + X11_Xext_INCLUDE_PATH, X11_Xext_LIB, X11_Xext_FOUND, X11::Xext + X11_Xxf86misc_INCLUDE_PATH, X11_Xxf86misc_LIB, X11_Xxf86misc_FOUND, X11::Xxf86misc + X11_Xxf86vm_INCLUDE_PATH, X11_Xxf86vm_LIB X11_Xxf86vm_FOUND, X11::Xxf86vm + X11_Xfixes_INCLUDE_PATH, X11_Xfixes_LIB, X11_Xfixes_FOUND, X11::Xfixes + X11_Xft_INCLUDE_PATH, X11_Xft_LIB, X11_Xft_FOUND, X11::Xft + X11_Xi_INCLUDE_PATH, X11_Xi_LIB, X11_Xi_FOUND, X11::Xi + X11_Xinerama_INCLUDE_PATH, X11_Xinerama_LIB, X11_Xinerama_FOUND, X11::Xinerama + X11_Xkb_INCLUDE_PATH, + X11_Xkblib_INCLUDE_PATH, X11_Xkb_FOUND, X11::Xkb + X11_xkbfile_INCLUDE_PATH, X11_xkbfile_LIB, X11_xkbfile_FOUND, X11::xkbfile + X11_Xmu_INCLUDE_PATH, X11_Xmu_LIB, X11_Xmu_FOUND, X11::Xmu + X11_Xpm_INCLUDE_PATH, X11_Xpm_LIB, X11_Xpm_FOUND, X11::Xpm + X11_Xtst_INCLUDE_PATH, X11_Xtst_LIB, X11_Xtst_FOUND, X11::Xtst + X11_Xrandr_INCLUDE_PATH, X11_Xrandr_LIB, X11_Xrandr_FOUND, X11::Xrandr + X11_Xrender_INCLUDE_PATH, X11_Xrender_LIB, X11_Xrender_FOUND, X11::Xrender + X11_XRes_INCLUDE_PATH, X11_XRes_LIB, X11_XRes_FOUND, X11::XRes + X11_Xss_INCLUDE_PATH, X11_Xss_LIB, X11_Xss_FOUND, X11::Xss + X11_Xt_INCLUDE_PATH, X11_Xt_LIB, X11_Xt_FOUND, X11::Xt + X11_Xutil_INCLUDE_PATH, X11_Xutil_FOUND, X11::Xutil + X11_Xv_INCLUDE_PATH, X11_Xv_LIB, X11_Xv_FOUND, X11::Xv X11_dpms_INCLUDE_PATH, (in X11_Xext_LIB), X11_dpms_FOUND X11_XShm_INCLUDE_PATH, (in X11_Xext_LIB), X11_XShm_FOUND X11_Xshape_INCLUDE_PATH, (in X11_Xext_LIB), X11_Xshape_FOUND - X11_xf86misc_INCLUDE_PATH, X11_Xxf86misc_LIB, X11_xf86misc_FOUND - X11_xf86vmode_INCLUDE_PATH, X11_Xxf86vm_LIB X11_xf86vmode_FOUND - X11_Xfixes_INCLUDE_PATH, X11_Xfixes_LIB, X11_Xfixes_FOUND - X11_Xft_INCLUDE_PATH, X11_Xft_LIB, X11_Xft_FOUND - X11_Xi_INCLUDE_PATH, X11_Xi_LIB, X11_Xi_FOUND - X11_Xinerama_INCLUDE_PATH, X11_Xinerama_LIB, X11_Xinerama_FOUND - X11_Xinput_INCLUDE_PATH, X11_Xinput_LIB, X11_Xinput_FOUND - X11_Xkb_INCLUDE_PATH, X11_Xkb_FOUND - X11_Xkblib_INCLUDE_PATH, X11_Xkb_FOUND - X11_Xkbfile_INCLUDE_PATH, X11_Xkbfile_LIB, X11_Xkbfile_FOUND - X11_Xmu_INCLUDE_PATH, X11_Xmu_LIB, X11_Xmu_FOUND - X11_Xpm_INCLUDE_PATH, X11_Xpm_LIB, X11_Xpm_FOUND - X11_XTest_INCLUDE_PATH, X11_XTest_LIB, X11_XTest_FOUND - X11_Xrandr_INCLUDE_PATH, X11_Xrandr_LIB, X11_Xrandr_FOUND - X11_Xrender_INCLUDE_PATH, X11_Xrender_LIB, X11_Xrender_FOUND - X11_Xscreensaver_INCLUDE_PATH, X11_Xscreensaver_LIB, X11_Xscreensaver_FOUND - X11_Xt_INCLUDE_PATH, X11_Xt_LIB, X11_Xt_FOUND - X11_Xutil_INCLUDE_PATH, X11_Xutil_FOUND - X11_Xv_INCLUDE_PATH, X11_Xv_LIB, X11_Xv_FOUND X11_XSync_INCLUDE_PATH, (in X11_Xext_LIB), X11_XSync_FOUND #]=======================================================================] @@ -98,31 +98,38 @@ if (UNIX) find_path(X11_Xcursor_INCLUDE_PATH X11/Xcursor/Xcursor.h ${X11_INC_SEARCH_PATH}) find_path(X11_Xdamage_INCLUDE_PATH X11/extensions/Xdamage.h ${X11_INC_SEARCH_PATH}) find_path(X11_Xdmcp_INCLUDE_PATH X11/Xdmcp.h ${X11_INC_SEARCH_PATH}) + find_path(X11_Xext_INCLUDE_PATH X11/extensions/Xext.h ${X11_INC_SEARCH_PATH}) find_path(X11_dpms_INCLUDE_PATH X11/extensions/dpms.h ${X11_INC_SEARCH_PATH}) - find_path(X11_xf86misc_INCLUDE_PATH X11/extensions/xf86misc.h ${X11_INC_SEARCH_PATH}) - find_path(X11_xf86vmode_INCLUDE_PATH X11/extensions/xf86vmode.h ${X11_INC_SEARCH_PATH}) + find_path(X11_Xxf86misc_INCLUDE_PATH X11/extensions/xf86misc.h ${X11_INC_SEARCH_PATH}) + find_path(X11_Xxf86vm_INCLUDE_PATH X11/extensions/xf86vmode.h ${X11_INC_SEARCH_PATH}) find_path(X11_Xfixes_INCLUDE_PATH X11/extensions/Xfixes.h ${X11_INC_SEARCH_PATH}) find_path(X11_Xft_INCLUDE_PATH X11/Xft/Xft.h ${X11_INC_SEARCH_PATH}) find_path(X11_Xi_INCLUDE_PATH X11/extensions/XInput.h ${X11_INC_SEARCH_PATH}) find_path(X11_Xinerama_INCLUDE_PATH X11/extensions/Xinerama.h ${X11_INC_SEARCH_PATH}) - find_path(X11_Xinput_INCLUDE_PATH X11/extensions/XInput.h ${X11_INC_SEARCH_PATH}) find_path(X11_Xkb_INCLUDE_PATH X11/extensions/XKB.h ${X11_INC_SEARCH_PATH}) find_path(X11_Xkblib_INCLUDE_PATH X11/XKBlib.h ${X11_INC_SEARCH_PATH}) - find_path(X11_Xkbfile_INCLUDE_PATH X11/extensions/XKBfile.h ${X11_INC_SEARCH_PATH}) + find_path(X11_xkbfile_INCLUDE_PATH X11/extensions/XKBfile.h ${X11_INC_SEARCH_PATH}) find_path(X11_Xmu_INCLUDE_PATH X11/Xmu/Xmu.h ${X11_INC_SEARCH_PATH}) find_path(X11_Xpm_INCLUDE_PATH X11/xpm.h ${X11_INC_SEARCH_PATH}) - find_path(X11_XTest_INCLUDE_PATH X11/extensions/XTest.h ${X11_INC_SEARCH_PATH}) + find_path(X11_Xtst_INCLUDE_PATH X11/extensions/XTest.h ${X11_INC_SEARCH_PATH}) find_path(X11_XShm_INCLUDE_PATH X11/extensions/XShm.h ${X11_INC_SEARCH_PATH}) find_path(X11_Xrandr_INCLUDE_PATH X11/extensions/Xrandr.h ${X11_INC_SEARCH_PATH}) find_path(X11_Xrender_INCLUDE_PATH X11/extensions/Xrender.h ${X11_INC_SEARCH_PATH}) find_path(X11_XRes_INCLUDE_PATH X11/extensions/XRes.h ${X11_INC_SEARCH_PATH}) - find_path(X11_Xscreensaver_INCLUDE_PATH X11/extensions/scrnsaver.h ${X11_INC_SEARCH_PATH}) + find_path(X11_Xss_INCLUDE_PATH X11/extensions/scrnsaver.h ${X11_INC_SEARCH_PATH}) find_path(X11_Xshape_INCLUDE_PATH X11/extensions/shape.h ${X11_INC_SEARCH_PATH}) find_path(X11_Xutil_INCLUDE_PATH X11/Xutil.h ${X11_INC_SEARCH_PATH}) find_path(X11_Xt_INCLUDE_PATH X11/Intrinsic.h ${X11_INC_SEARCH_PATH}) find_path(X11_Xv_INCLUDE_PATH X11/extensions/Xvlib.h ${X11_INC_SEARCH_PATH}) find_path(X11_XSync_INCLUDE_PATH X11/extensions/sync.h ${X11_INC_SEARCH_PATH}) + # Backwards compatibility. + set(X11_Xinput_INCLUDE_PATH "${X11_Xi_INCLUDE_PATH}") + set(X11_xf86misc_INCLUDE_PATH "${X11_Xxf86misc_INCLUDE_PATH}") + set(X11_xf86vmode_INCLUDE_PATH "${X11_Xxf8vm_INCLUDE_PATH}") + set(X11_Xkbfile_INCLUDE_PATH "${X11_xkbfile_INCLUDE_PATH}") + set(X11_XTest_INCLUDE_PATH "${X11_Xtst_INCLUDE_PATH}") + set(X11_Xscreensaver_INCLUDE_PATH "${X11_Xss_INCLUDE_PATH}") find_library(X11_X11_LIB X11 ${X11_LIB_SEARCH_PATH}) @@ -139,20 +146,25 @@ if (UNIX) find_library(X11_Xft_LIB Xft ${X11_LIB_SEARCH_PATH}) find_library(X11_Xi_LIB Xi ${X11_LIB_SEARCH_PATH}) find_library(X11_Xinerama_LIB Xinerama ${X11_LIB_SEARCH_PATH}) - find_library(X11_Xinput_LIB Xi ${X11_LIB_SEARCH_PATH}) - find_library(X11_Xkbfile_LIB xkbfile ${X11_LIB_SEARCH_PATH}) + find_library(X11_xkbfile_LIB xkbfile ${X11_LIB_SEARCH_PATH}) find_library(X11_Xmu_LIB Xmu ${X11_LIB_SEARCH_PATH}) find_library(X11_Xpm_LIB Xpm ${X11_LIB_SEARCH_PATH}) find_library(X11_Xrandr_LIB Xrandr ${X11_LIB_SEARCH_PATH}) find_library(X11_Xrender_LIB Xrender ${X11_LIB_SEARCH_PATH}) find_library(X11_XRes_LIB XRes ${X11_LIB_SEARCH_PATH}) - find_library(X11_Xscreensaver_LIB Xss ${X11_LIB_SEARCH_PATH}) + find_library(X11_Xss_LIB Xss ${X11_LIB_SEARCH_PATH}) find_library(X11_Xt_LIB Xt ${X11_LIB_SEARCH_PATH}) - find_library(X11_XTest_LIB Xtst ${X11_LIB_SEARCH_PATH}) + find_library(X11_Xtst_LIB Xtst ${X11_LIB_SEARCH_PATH}) find_library(X11_Xv_LIB Xv ${X11_LIB_SEARCH_PATH}) find_library(X11_Xxf86misc_LIB Xxf86misc ${X11_LIB_SEARCH_PATH}) find_library(X11_Xxf86vm_LIB Xxf86vm ${X11_LIB_SEARCH_PATH}) + # Backwards compatibility. + set(X11_Xinput_LIB "${X11_Xi_LIB}") + set(X11_Xkbfile_LIB "${X11_xkbfile_LIB}") + set(X11_XTest_LIB "${X11_Xtst_LIB}") + set(X11_Xscreensaver_LIB "${X11_Xss_LIB}") + set(X11_LIBRARY_DIR "") if(X11_X11_LIB) get_filename_component(X11_LIBRARY_DIR ${X11_X11_LIB} PATH) @@ -160,31 +172,31 @@ if (UNIX) set(X11_INCLUDE_DIR) # start with empty list if(X11_X11_INCLUDE_PATH) - set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_X11_INCLUDE_PATH}) + list(APPEND X11_INCLUDE_DIR ${X11_X11_INCLUDE_PATH}) endif() if(X11_Xlib_INCLUDE_PATH) - set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xlib_INCLUDE_PATH}) + list(APPEND X11_INCLUDE_DIR ${X11_Xlib_INCLUDE_PATH}) endif() if(X11_Xutil_INCLUDE_PATH) set(X11_Xutil_FOUND TRUE) - set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xutil_INCLUDE_PATH}) + list(APPEND X11_INCLUDE_DIR ${X11_Xutil_INCLUDE_PATH}) endif() if(X11_Xshape_INCLUDE_PATH) set(X11_Xshape_FOUND TRUE) - set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xshape_INCLUDE_PATH}) + list(APPEND X11_INCLUDE_DIR ${X11_Xshape_INCLUDE_PATH}) endif() set(X11_LIBRARIES) # start with empty list if(X11_X11_LIB) - set(X11_LIBRARIES ${X11_LIBRARIES} ${X11_X11_LIB}) + list(APPEND X11_LIBRARIES ${X11_X11_LIB}) endif() if(X11_Xext_LIB) set(X11_Xext_FOUND TRUE) - set(X11_LIBRARIES ${X11_LIBRARIES} ${X11_Xext_LIB}) + list(APPEND X11_LIBRARIES ${X11_Xext_LIB}) endif() if(X11_Xt_LIB AND X11_Xt_INCLUDE_PATH) @@ -192,13 +204,17 @@ if (UNIX) endif() if(X11_Xft_LIB AND X11_Xft_INCLUDE_PATH) - set(X11_Xft_FOUND TRUE) - set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xft_INCLUDE_PATH}) + find_package(Freetype QUIET) + find_package(Fontconfig QUIET) + if (FREETYPE_FOUND AND FONTCONFIG_FOUND) + set(X11_Xft_FOUND TRUE) + endif () + list(APPEND X11_INCLUDE_DIR ${X11_Xft_INCLUDE_PATH}) endif() if(X11_Xv_LIB AND X11_Xv_INCLUDE_PATH) set(X11_Xv_FOUND TRUE) - set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xv_INCLUDE_PATH}) + list(APPEND X11_INCLUDE_DIR ${X11_Xv_INCLUDE_PATH}) endif() if (X11_Xau_LIB AND X11_Xau_INCLUDE_PATH) @@ -207,118 +223,124 @@ if (UNIX) if (X11_Xdmcp_INCLUDE_PATH AND X11_Xdmcp_LIB) set(X11_Xdmcp_FOUND TRUE) - set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xdmcp_INCLUDE_PATH}) + list(APPEND X11_INCLUDE_DIR ${X11_Xdmcp_INCLUDE_PATH}) endif () if (X11_Xaccessrules_INCLUDE_PATH AND X11_Xaccessstr_INCLUDE_PATH) set(X11_Xaccess_FOUND TRUE) set(X11_Xaccess_INCLUDE_PATH ${X11_Xaccessstr_INCLUDE_PATH}) - set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xaccess_INCLUDE_PATH}) + list(APPEND X11_INCLUDE_DIR ${X11_Xaccess_INCLUDE_PATH}) endif () if (X11_Xpm_INCLUDE_PATH AND X11_Xpm_LIB) set(X11_Xpm_FOUND TRUE) - set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xpm_INCLUDE_PATH}) + list(APPEND X11_INCLUDE_DIR ${X11_Xpm_INCLUDE_PATH}) endif () if (X11_Xcomposite_INCLUDE_PATH AND X11_Xcomposite_LIB) set(X11_Xcomposite_FOUND TRUE) - set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xcomposite_INCLUDE_PATH}) + list(APPEND X11_INCLUDE_DIR ${X11_Xcomposite_INCLUDE_PATH}) endif () if (X11_Xdamage_INCLUDE_PATH AND X11_Xdamage_LIB) set(X11_Xdamage_FOUND TRUE) - set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xdamage_INCLUDE_PATH}) + list(APPEND X11_INCLUDE_DIR ${X11_Xdamage_INCLUDE_PATH}) endif () if (X11_XShm_INCLUDE_PATH) set(X11_XShm_FOUND TRUE) - set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_XShm_INCLUDE_PATH}) + list(APPEND X11_INCLUDE_DIR ${X11_XShm_INCLUDE_PATH}) endif () - if (X11_XTest_INCLUDE_PATH AND X11_XTest_LIB) + if (X11_Xtst_INCLUDE_PATH AND X11_Xtst_LIB) + set(X11_Xtst_FOUND TRUE) + # Backwards compatibility. set(X11_XTest_FOUND TRUE) - set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_XTest_INCLUDE_PATH}) + list(APPEND X11_INCLUDE_DIR ${X11_Xtst_INCLUDE_PATH}) endif () if (X11_Xi_INCLUDE_PATH AND X11_Xi_LIB) set(X11_Xi_FOUND TRUE) - set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xi_INCLUDE_PATH}) + # Backwards compatibility. + set(X11_Xinput_FOUND TRUE) + list(APPEND X11_INCLUDE_DIR ${X11_Xi_INCLUDE_PATH}) endif () if (X11_Xinerama_INCLUDE_PATH AND X11_Xinerama_LIB) set(X11_Xinerama_FOUND TRUE) - set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xinerama_INCLUDE_PATH}) + list(APPEND X11_INCLUDE_DIR ${X11_Xinerama_INCLUDE_PATH}) endif () if (X11_Xfixes_INCLUDE_PATH AND X11_Xfixes_LIB) set(X11_Xfixes_FOUND TRUE) - set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xfixes_INCLUDE_PATH}) + list(APPEND X11_INCLUDE_DIR ${X11_Xfixes_INCLUDE_PATH}) endif () if (X11_Xrender_INCLUDE_PATH AND X11_Xrender_LIB) set(X11_Xrender_FOUND TRUE) - set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xrender_INCLUDE_PATH}) + list(APPEND X11_INCLUDE_DIR ${X11_Xrender_INCLUDE_PATH}) endif () if (X11_XRes_INCLUDE_PATH AND X11_XRes_LIB) set(X11_XRes_FOUND TRUE) - set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_XRes_INCLUDE_PATH}) + list(APPEND X11_INCLUDE_DIR ${X11_XRes_INCLUDE_PATH}) endif () if (X11_Xrandr_INCLUDE_PATH AND X11_Xrandr_LIB) set(X11_Xrandr_FOUND TRUE) - set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xrandr_INCLUDE_PATH}) + list(APPEND X11_INCLUDE_DIR ${X11_Xrandr_INCLUDE_PATH}) endif () - if (X11_xf86misc_INCLUDE_PATH AND X11_Xxf86misc_LIB) + if (X11_Xxf86misc_INCLUDE_PATH AND X11_Xxf86misc_LIB) + set(X11_Xxf86misc_FOUND TRUE) + # Backwards compatibility. set(X11_xf86misc_FOUND TRUE) - set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_xf86misc_INCLUDE_PATH}) + list(APPEND X11_INCLUDE_DIR ${X11_Xxf86misc_INCLUDE_PATH}) endif () - if (X11_xf86vmode_INCLUDE_PATH AND X11_Xxf86vm_LIB) + if (X11_Xxf86vm_INCLUDE_PATH AND X11_Xxf86vm_LIB) + set(X11_Xxf86vm_FOUND TRUE) + # Backwards compatibility. set(X11_xf86vmode_FOUND TRUE) - set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_xf86vmode_INCLUDE_PATH}) + list(APPEND X11_INCLUDE_DIR ${X11_Xxf86vm_INCLUDE_PATH}) endif () if (X11_Xcursor_INCLUDE_PATH AND X11_Xcursor_LIB) set(X11_Xcursor_FOUND TRUE) - set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xcursor_INCLUDE_PATH}) + list(APPEND X11_INCLUDE_DIR ${X11_Xcursor_INCLUDE_PATH}) endif () - if (X11_Xscreensaver_INCLUDE_PATH AND X11_Xscreensaver_LIB) + if (X11_Xss_INCLUDE_PATH AND X11_Xss_LIB) + set(X11_Xss_FOUND TRUE) set(X11_Xscreensaver_FOUND TRUE) - set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xscreensaver_INCLUDE_PATH}) + list(APPEND X11_INCLUDE_DIR ${X11_Xss_INCLUDE_PATH}) endif () if (X11_dpms_INCLUDE_PATH) set(X11_dpms_FOUND TRUE) - set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_dpms_INCLUDE_PATH}) + list(APPEND X11_INCLUDE_DIR ${X11_dpms_INCLUDE_PATH}) endif () if (X11_Xkb_INCLUDE_PATH AND X11_Xkblib_INCLUDE_PATH AND X11_Xlib_INCLUDE_PATH) set(X11_Xkb_FOUND TRUE) - set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xkb_INCLUDE_PATH} ) + list(APPEND X11_INCLUDE_DIR ${X11_Xkb_INCLUDE_PATH} ) endif () - if (X11_Xkbfile_INCLUDE_PATH AND X11_Xkbfile_LIB AND X11_Xlib_INCLUDE_PATH) + if (X11_xkbfile_INCLUDE_PATH AND X11_xkbfile_LIB AND X11_Xlib_INCLUDE_PATH) + set(X11_xkbfile_FOUND TRUE) + # Backwards compatibility. set(X11_Xkbfile_FOUND TRUE) - set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xkbfile_INCLUDE_PATH} ) + list(APPEND X11_INCLUDE_DIR ${X11_xkbfile_INCLUDE_PATH} ) endif () if (X11_Xmu_INCLUDE_PATH AND X11_Xmu_LIB) set(X11_Xmu_FOUND TRUE) - set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xmu_INCLUDE_PATH}) - endif () - - if (X11_Xinput_INCLUDE_PATH AND X11_Xinput_LIB) - set(X11_Xinput_FOUND TRUE) - set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xinput_INCLUDE_PATH}) + list(APPEND X11_INCLUDE_DIR ${X11_Xmu_INCLUDE_PATH}) endif () if (X11_XSync_INCLUDE_PATH) set(X11_XSync_FOUND TRUE) - set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_XSync_INCLUDE_PATH}) + list(APPEND X11_INCLUDE_DIR ${X11_XSync_INCLUDE_PATH}) endif () if(X11_ICE_LIB AND X11_ICE_INCLUDE_PATH) @@ -340,6 +362,11 @@ if (UNIX) set(X11_FOUND 1) endif () + include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) + find_package_handle_standard_args(X11 + REQUIRED_VARS X11_X11_INCLUDE_PATH X11_X11_LIB + HANDLE_COMPONENTS) + if(X11_FOUND) include(${CMAKE_CURRENT_LIST_DIR}/CheckFunctionExists.cmake) include(${CMAKE_CURRENT_LIST_DIR}/CheckLibraryExists.cmake) @@ -352,69 +379,69 @@ if (UNIX) set(X11_X_EXTRA_LIBS "") # See if XOpenDisplay in X11 works by itself. - CHECK_LIBRARY_EXISTS("${X11_LIBRARIES}" "XOpenDisplay" "${X11_LIBRARY_DIR}" X11_LIB_X11_SOLO) + check_library_exists("${X11_LIBRARIES}" "XOpenDisplay" "${X11_LIBRARY_DIR}" X11_LIB_X11_SOLO) if(NOT X11_LIB_X11_SOLO) # Find library needed for dnet_ntoa. - CHECK_LIBRARY_EXISTS("dnet" "dnet_ntoa" "" X11_LIB_DNET_HAS_DNET_NTOA) + check_library_exists("dnet" "dnet_ntoa" "" X11_LIB_DNET_HAS_DNET_NTOA) if (X11_LIB_DNET_HAS_DNET_NTOA) - set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -ldnet) + list(APPEND X11_X_EXTRA_LIBS -ldnet) else () - CHECK_LIBRARY_EXISTS("dnet_stub" "dnet_ntoa" "" X11_LIB_DNET_STUB_HAS_DNET_NTOA) + check_library_exists("dnet_stub" "dnet_ntoa" "" X11_LIB_DNET_STUB_HAS_DNET_NTOA) if (X11_LIB_DNET_STUB_HAS_DNET_NTOA) - set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -ldnet_stub) + list(APPEND X11_X_EXTRA_LIBS -ldnet_stub) endif () endif () endif() # Find library needed for gethostbyname. - CHECK_FUNCTION_EXISTS("gethostbyname" CMAKE_HAVE_GETHOSTBYNAME) + check_function_exists("gethostbyname" CMAKE_HAVE_GETHOSTBYNAME) if(NOT CMAKE_HAVE_GETHOSTBYNAME) - CHECK_LIBRARY_EXISTS("nsl" "gethostbyname" "" CMAKE_LIB_NSL_HAS_GETHOSTBYNAME) + check_library_exists("nsl" "gethostbyname" "" CMAKE_LIB_NSL_HAS_GETHOSTBYNAME) if (CMAKE_LIB_NSL_HAS_GETHOSTBYNAME) - set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lnsl) + list(APPEND X11_X_EXTRA_LIBS -lnsl) else () - CHECK_LIBRARY_EXISTS("bsd" "gethostbyname" "" CMAKE_LIB_BSD_HAS_GETHOSTBYNAME) + check_library_exists("bsd" "gethostbyname" "" CMAKE_LIB_BSD_HAS_GETHOSTBYNAME) if (CMAKE_LIB_BSD_HAS_GETHOSTBYNAME) - set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lbsd) + list(APPEND X11_X_EXTRA_LIBS -lbsd) endif () endif () endif() # Find library needed for connect. - CHECK_FUNCTION_EXISTS("connect" CMAKE_HAVE_CONNECT) + check_function_exists("connect" CMAKE_HAVE_CONNECT) if(NOT CMAKE_HAVE_CONNECT) - CHECK_LIBRARY_EXISTS("socket" "connect" "" CMAKE_LIB_SOCKET_HAS_CONNECT) + check_library_exists("socket" "connect" "" CMAKE_LIB_SOCKET_HAS_CONNECT) if (CMAKE_LIB_SOCKET_HAS_CONNECT) - set (X11_X_EXTRA_LIBS -lsocket ${X11_X_EXTRA_LIBS}) + list(INSERT X11_X_EXTRA_LIBS 0 -lsocket) endif () endif() # Find library needed for remove. - CHECK_FUNCTION_EXISTS("remove" CMAKE_HAVE_REMOVE) + check_function_exists("remove" CMAKE_HAVE_REMOVE) if(NOT CMAKE_HAVE_REMOVE) - CHECK_LIBRARY_EXISTS("posix" "remove" "" CMAKE_LIB_POSIX_HAS_REMOVE) + check_library_exists("posix" "remove" "" CMAKE_LIB_POSIX_HAS_REMOVE) if (CMAKE_LIB_POSIX_HAS_REMOVE) - set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lposix) + list(APPEND X11_X_EXTRA_LIBS -lposix) endif () endif() # Find library needed for shmat. - CHECK_FUNCTION_EXISTS("shmat" CMAKE_HAVE_SHMAT) + check_function_exists("shmat" CMAKE_HAVE_SHMAT) if(NOT CMAKE_HAVE_SHMAT) - CHECK_LIBRARY_EXISTS("ipc" "shmat" "" CMAKE_LIB_IPS_HAS_SHMAT) + check_library_exists("ipc" "shmat" "" CMAKE_LIB_IPS_HAS_SHMAT) if (CMAKE_LIB_IPS_HAS_SHMAT) - set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lipc) + list(APPEND X11_X_EXTRA_LIBS -lipc) endif () endif() endif() if (X11_ICE_FOUND) - CHECK_LIBRARY_EXISTS("ICE" "IceConnectionNumber" "${X11_LIBRARY_DIR}" + check_library_exists("ICE" "IceConnectionNumber" "${X11_LIBRARY_DIR}" CMAKE_LIB_ICE_HAS_ICECONNECTIONNUMBER) if(CMAKE_LIB_ICE_HAS_ICECONNECTIONNUMBER) set (X11_X_PRE_LIBS ${X11_ICE_LIB}) if(X11_SM_LIB) - set (X11_X_PRE_LIBS ${X11_SM_LIB} ${X11_X_PRE_LIBS}) + list(INSERT X11_X_PRE_LIBS 0 ${X11_SM_LIB}) endif() endif() endif () @@ -422,18 +449,222 @@ if (UNIX) # Build the final list of libraries. set(X11_LIBRARIES ${X11_X_PRE_LIBS} ${X11_LIBRARIES} ${X11_X_EXTRA_LIBS}) - include(${CMAKE_CURRENT_LIST_DIR}/FindPackageMessage.cmake) - FIND_PACKAGE_MESSAGE(X11 "Found X11: ${X11_X11_LIB}" - "[${X11_X11_LIB}][${X11_INCLUDE_DIR}]") - else () - if (X11_FIND_REQUIRED) - message(FATAL_ERROR "Could not find X11") + if (NOT TARGET X11::X11) + add_library(X11::X11 UNKNOWN IMPORTED) + set_target_properties(X11::X11 PROPERTIES + IMPORTED_LOCATION "${X11_X11_LIB}" + INTERFACE_INCLUDE_DIRECTORIES "${X11_X11_INCLUDE_PATH}") endif () endif () + if (X11_ICE_FOUND AND NOT TARGET X11::ICE) + add_library(X11::ICE UNKNOWN IMPORTED) + set_target_properties(X11::ICE PROPERTIES + IMPORTED_LOCATION "${X11_ICE_LIB}" + INTERFACE_INCLUDE_DIRECTORIES "${X11_ICE_INCLUDE_PATH}") + endif () + + if (X11_SM_FOUND AND NOT TARGET X11::SM) + add_library(X11::SM UNKNOWN IMPORTED) + set_target_properties(X11::SM PROPERTIES + IMPORTED_LOCATION "${X11_SM_LIB}" + INTERFACE_INCLUDE_DIRECTORIES "${X11_SM_INCLUDE_PATH}") + endif () + + if (X11_Xau_FOUND AND NOT TARGET X11::Xau) + add_library(X11::Xau UNKNOWN IMPORTED) + set_target_properties(X11::Xau PROPERTIES + IMPORTED_LOCATION "${X11_Xau_LIB}" + INTERFACE_INCLUDE_DIRECTORIES "${X11_Xau_INCLUDE_PATH}") + endif () + + if (X11_Xcomposite_FOUND AND NOT TARGET X11::Xcomposite) + add_library(X11::Xcomposite UNKNOWN IMPORTED) + set_target_properties(X11::Xcomposite PROPERTIES + IMPORTED_LOCATION "${X11_Xcomposite_LIB}" + INTERFACE_INCLUDE_DIRECTORIES "${X11_Xcomposite_INCLUDE_PATH}" + INTERFACE_LINK_LIBRARIES "X11::X11") + endif () + + if (X11_Xcursor_FOUND AND NOT TARGET X11::Xcursor) + add_library(X11::Xcursor UNKNOWN IMPORTED) + set_target_properties(X11::Xcursor PROPERTIES + IMPORTED_LOCATION "${X11_Xcursor_LIB}" + INTERFACE_INCLUDE_DIRECTORIES "${X11_Xcursor_INCLUDE_PATH}" + INTERFACE_LINK_LIBRARIES "X11::Xrender;X11::Xfixes;X11::X11") + endif () + + if (X11_Xdamage_FOUND AND NOT TARGET X11::Xdamage) + add_library(X11::Xdamage UNKNOWN IMPORTED) + set_target_properties(X11::Xdamage PROPERTIES + IMPORTED_LOCATION "${X11_Xdamage_LIB}" + INTERFACE_INCLUDE_DIRECTORIES "${X11_Xdamage_INCLUDE_PATH}" + INTERFACE_LINK_LIBRARIES "X11::Xfixes;X11::X11") + endif () + + if (X11_Xdmcp_FOUND AND NOT TARGET X11::Xdmcp) + add_library(X11::Xdmcp UNKNOWN IMPORTED) + set_target_properties(X11::Xdmcp PROPERTIES + IMPORTED_LOCATION "${X11_Xdmcp_LIB}" + INTERFACE_INCLUDE_DIRECTORIES "${X11_Xdmcp_INCLUDE_PATH}") + endif () + + if (X11_Xext_FOUND AND NOT TARGET X11::Xext) + add_library(X11::Xext UNKNOWN IMPORTED) + set_target_properties(X11::Xext PROPERTIES + IMPORTED_LOCATION "${X11_Xext_LIB}" + INTERFACE_INCLUDE_DIRECTORIES "${X11_Xext_INCLUDE_PATH}" + INTERFACE_LINK_LIBRARIES "X11::X11") + endif () + + if (X11_Xxf86misc_FOUND AND NOT TARGET X11::Xxf86misc) + add_library(X11::Xxf86misc UNKNOWN IMPORTED) + set_target_properties(X11::Xxf86misc PROPERTIES + IMPORTED_LOCATION "${X11_Xxf86misc_LIB}" + INTERFACE_INCLUDE_DIRECTORIES "${X11_Xxf86misc_INCLUDE_PATH}" + INTERFACE_LINK_LIBRARIES "X11::X11;X11::Xext") + endif () + + if (X11_Xxf86vm_FOUND AND NOT TARGET X11::Xxf86vm) + add_library(X11::Xxf86vm UNKNOWN IMPORTED) + set_target_properties(X11::Xxf86vm PROPERTIES + IMPORTED_LOCATION "${X11_Xxf86vm_LIB}" + INTERFACE_INCLUDE_DIRECTORIES "${X11_Xxf86vm_INCLUDE_PATH}" + INTERFACE_LINK_LIBRARIES "X11::X11;X11::Xext") + endif () + + if (X11_Xfixes_FOUND AND NOT TARGET X11::Xfixes) + add_library(X11::Xfixes UNKNOWN IMPORTED) + set_target_properties(X11::Xfixes PROPERTIES + IMPORTED_LOCATION "${X11_Xfixes_LIB}" + INTERFACE_INCLUDE_DIRECTORIES "${X11_Xfixes_INCLUDE_PATH}" + INTERFACE_LINK_LIBRARIES "X11::X11") + endif () + + if (X11_Xft_FOUND AND NOT TARGET X11::Xft) + add_library(X11::Xft UNKNOWN IMPORTED) + set_target_properties(X11::Xft PROPERTIES + IMPORTED_LOCATION "${X11_Xft_LIB}" + INTERFACE_INCLUDE_DIRECTORIES "${X11_Xft_INCLUDE_PATH}" + INTERFACE_LINK_LIBRARIES "X11::Xrender;X11::X11;Fontconfig::Fontconfig;Freetype::Freetype") + endif () + + if (X11_Xi_FOUND AND NOT TARGET X11::Xi) + add_library(X11::Xi UNKNOWN IMPORTED) + set_target_properties(X11::Xi PROPERTIES + IMPORTED_LOCATION "${X11_Xi_LIB}" + INTERFACE_INCLUDE_DIRECTORIES "${X11_Xi_INCLUDE_PATH}" + INTERFACE_LINK_LIBRARIES "X11::Xext;X11::X11") + endif () + + if (X11_Xinerama_FOUND AND NOT TARGET X11::Xinerama) + add_library(X11::Xinerama UNKNOWN IMPORTED) + set_target_properties(X11::Xinerama PROPERTIES + IMPORTED_LOCATION "${X11_Xinerama_LIB}" + INTERFACE_INCLUDE_DIRECTORIES "${X11_Xinerama_INCLUDE_PATH}" + INTERFACE_LINK_LIBRARIES "X11::Xext;X11::X11") + endif () + + if (X11_Xkb_FOUND AND NOT TARGET X11::Xkb) + add_library(X11::Xkb INTERFACE IMPORTED) + set_target_properties(X11::Xkb PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${X11_Xkb_INCLUDE_PATH}" + INTERFACE_LINK_LIBRARIES "X11::X11") + endif () + + if (X11_xkbfile_FOUND AND NOT TARGET X11::xkbfile) + add_library(X11::xkbfile UNKNOWN IMPORTED) + set_target_properties(X11::xkbfile PROPERTIES + IMPORTED_LOCATION "${X11_xkbfile_LIB}" + INTERFACE_INCLUDE_DIRECTORIES "${X11_xkbfile_INCLUDE_PATH}" + INTERFACE_LINK_LIBRARIES "X11::X11") + endif () + + if (X11_Xmu_FOUND AND NOT TARGET X11::Xmu) + add_library(X11::Xmu UNKNOWN IMPORTED) + set_target_properties(X11::Xmu PROPERTIES + IMPORTED_LOCATION "${X11_Xmu_LIB}" + INTERFACE_INCLUDE_DIRECTORIES "${X11_Xmu_INCLUDE_PATH}" + INTERFACE_LINK_LIBRARIES "X11::Xt;X11::Xext;X11::X11") + endif () + + if (X11_Xpm_FOUND AND NOT TARGET X11::Xpm) + add_library(X11::Xpm UNKNOWN IMPORTED) + set_target_properties(X11::Xpm PROPERTIES + IMPORTED_LOCATION "${X11_Xpm_LIB}" + INTERFACE_INCLUDE_DIRECTORIES "${X11_Xpm_INCLUDE_PATH}" + INTERFACE_LINK_LIBRARIES "X11::X11") + endif () + + if (X11_Xtst_FOUND AND NOT TARGET X11::Xtst) + add_library(X11::Xtst UNKNOWN IMPORTED) + set_target_properties(X11::Xtst PROPERTIES + IMPORTED_LOCATION "${X11_Xtst_LIB}" + INTERFACE_INCLUDE_DIRECTORIES "${X11_Xtst_INCLUDE_PATH}" + INTERFACE_LINK_LIBRARIES "X11::Xi;X11::Xext;X11::X11") + endif () + + if (X11_Xrandr_FOUND AND NOT TARGET X11::Xrandr) + add_library(X11::Xrandr UNKNOWN IMPORTED) + set_target_properties(X11::Xrandr PROPERTIES + IMPORTED_LOCATION "${X11_Xrandr_LIB}" + INTERFACE_INCLUDE_DIRECTORIES "${X11_Xrandr_INCLUDE_PATH}" + INTERFACE_LINK_LIBRARIES "X11::Xrender;X11::Xext;X11::X11") + endif () + + if (X11_Xrender_FOUND AND NOT TARGET X11::Xrender) + add_library(X11::Xrender UNKNOWN IMPORTED) + set_target_properties(X11::Xrender PROPERTIES + IMPORTED_LOCATION "${X11_Xrender_LIB}" + INTERFACE_INCLUDE_DIRECTORIES "${X11_Xrender_INCLUDE_PATH}" + INTERFACE_LINK_LIBRARIES "X11::X11") + endif () + + if (X11_XRes_FOUND AND NOT TARGET X11::XRes) + add_library(X11::XRes UNKNOWN IMPORTED) + set_target_properties(X11::XRes PROPERTIES + IMPORTED_LOCATION "${X11_XRes_LIB}" + INTERFACE_INCLUDE_DIRECTORIES "${X11_XRes_INCLUDE_PATH}" + INTERFACE_LINK_LIBRARIES "X11::Xext;X11::X11") + endif () + + if (X11_Xss_FOUND AND NOT TARGET X11::Xss) + add_library(X11::Xss UNKNOWN IMPORTED) + set_target_properties(X11::Xss PROPERTIES + IMPORTED_LOCATION "${X11_Xss_LIB}" + INTERFACE_INCLUDE_DIRECTORIES "${X11_Xss_INCLUDE_PATH}" + INTERFACE_LINK_LIBRARIES "X11::Xext;X11::X11") + endif () + + if (X11_Xt_FOUND AND NOT TARGET X11::Xt) + add_library(X11::Xt UNKNOWN IMPORTED) + set_target_properties(X11::Xt PROPERTIES + IMPORTED_LOCATION "${X11_Xt_LIB}" + INTERFACE_INCLUDE_DIRECTORIES "${X11_Xt_INCLUDE_PATH}" + INTERFACE_LINK_LIBRARIES "X11::ICE;X11::SM;X11::X11") + endif () + + if (X11_Xutil_FOUND AND NOT TARGET X11::Xutil) + add_library(X11::Xutil INTERFACE IMPORTED) + set_target_properties(X11::Xutil PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${X11_Xutil_INCLUDE_PATH}" + # libX11 contains the implementations for functions in the Xutil.h + # header. + INTERFACE_LINK_LIBRARIES "X11::X11") + endif () + + if (X11_Xv_FOUND AND NOT TARGET X11::Xv) + add_library(X11::Xv UNKNOWN IMPORTED) + set_target_properties(X11::Xv PROPERTIES + IMPORTED_LOCATION "${X11_Xv_LIB}" + INTERFACE_INCLUDE_DIRECTORIES "${X11_Xv_INCLUDE_PATH}" + INTERFACE_LINK_LIBRARIES "X11::Xext;X11::X11") + endif () + mark_as_advanced( X11_X11_INCLUDE_PATH X11_X11_LIB + X11_Xext_INCLUDE_PATH X11_Xext_LIB X11_Xau_LIB X11_Xau_INCLUDE_PATH @@ -441,7 +672,6 @@ if (UNIX) X11_Xutil_INCLUDE_PATH X11_Xcomposite_INCLUDE_PATH X11_Xcomposite_LIB - X11_Xaccess_INCLUDE_PATH X11_Xfixes_LIB X11_Xfixes_INCLUDE_PATH X11_Xrandr_LIB @@ -453,15 +683,15 @@ if (UNIX) X11_XRes_LIB X11_XRes_INCLUDE_PATH X11_Xxf86misc_LIB - X11_xf86misc_INCLUDE_PATH + X11_Xxf86misc_INCLUDE_PATH X11_Xxf86vm_LIB - X11_xf86vmode_INCLUDE_PATH + X11_Xxf86vm_INCLUDE_PATH X11_Xi_LIB X11_Xi_INCLUDE_PATH X11_Xinerama_LIB X11_Xinerama_INCLUDE_PATH - X11_XTest_LIB - X11_XTest_INCLUDE_PATH + X11_Xtst_LIB + X11_Xtst_INCLUDE_PATH X11_Xcursor_LIB X11_Xcursor_INCLUDE_PATH X11_dpms_INCLUDE_PATH @@ -474,16 +704,14 @@ if (UNIX) X11_Xdmcp_INCLUDE_PATH X11_Xkb_INCLUDE_PATH X11_Xkblib_INCLUDE_PATH - X11_Xkbfile_INCLUDE_PATH - X11_Xkbfile_LIB + X11_xkbfile_INCLUDE_PATH + X11_xkbfile_LIB X11_Xmu_INCLUDE_PATH X11_Xmu_LIB - X11_Xscreensaver_INCLUDE_PATH - X11_Xscreensaver_LIB + X11_Xss_INCLUDE_PATH + X11_Xss_LIB X11_Xpm_INCLUDE_PATH X11_Xpm_LIB - X11_Xinput_LIB - X11_Xinput_INCLUDE_PATH X11_Xft_LIB X11_Xft_INCLUDE_PATH X11_Xshape_INCLUDE_PATH @@ -499,5 +727,3 @@ if (UNIX) set(CMAKE_FIND_FRAMEWORK ${CMAKE_FIND_FRAMEWORK_SAVE}) set(CMAKE_REQUIRED_QUIET ${CMAKE_REQUIRED_QUIET_SAVE}) endif () - -# X11_FIND_REQUIRED_<component> could be checked too diff --git a/Modules/GetPrerequisites.cmake b/Modules/GetPrerequisites.cmake index 5b32f7c..fa6d75a 100644 --- a/Modules/GetPrerequisites.cmake +++ b/Modules/GetPrerequisites.cmake @@ -63,6 +63,9 @@ searched first when a target without any path info is given. Then standard system locations are also searched: PATH, Framework locations, /usr/lib... +The variable GET_PREREQUISITES_VERBOSE can be set to true to enable verbose +output. + :: LIST_PREREQUISITES(<target> [<recurse> [<exclude_system> [<verbose>]]]) @@ -644,6 +647,10 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa set(rpaths "") endif() + if(GET_PREREQUISITES_VERBOSE) + set(verbose 1) + endif() + if(NOT IS_ABSOLUTE "${target}") message("warning: target '${target}' is not absolute...") endif() @@ -653,6 +660,15 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa return() endif() + # Check for a script by extension (.bat,.sh,...) or if the file starts with "#!" (shebang) + file(READ ${target} file_contents LIMIT 5) + if(target MATCHES "\\.(bat|c?sh|bash|ksh|cmd)$" OR file_contents MATCHES "^#!") + message(STATUS "GetPrequisites(${target}) : ignoring script file") + # Clear var + set(${prerequisites_var} "" PARENT_SCOPE) + return() + endif() + set(gp_cmd_paths ${gp_cmd_paths} "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\14.0;InstallDir]/../../VC/bin" "$ENV{VS140COMNTOOLS}/../../VC/bin" @@ -711,25 +727,25 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa set(gp_cmd_maybe_filter) # optional command to pre-filter gp_tool results - if(gp_tool STREQUAL "ldd") + if(gp_tool MATCHES "ldd$") set(gp_cmd_args "") set(gp_regex "^[\t ]*[^\t ]+ => ([^\t\(]+) .*${eol_char}$") set(gp_regex_error "not found${eol_char}$") set(gp_regex_fallback "^[\t ]*([^\t ]+) => ([^\t ]+).*${eol_char}$") set(gp_regex_cmp_count 1) - elseif(gp_tool STREQUAL "otool") + elseif(gp_tool MATCHES "otool$") set(gp_cmd_args "-L") set(gp_regex "^\t([^\t]+) \\(compatibility version ([0-9]+.[0-9]+.[0-9]+), current version ([0-9]+.[0-9]+.[0-9]+)\\)${eol_char}$") set(gp_regex_error "") set(gp_regex_fallback "") set(gp_regex_cmp_count 3) - elseif(gp_tool STREQUAL "dumpbin") + elseif(gp_tool MATCHES "dumpbin$") set(gp_cmd_args "/dependents") set(gp_regex "^ ([^ ].*[Dd][Ll][Ll])${eol_char}$") set(gp_regex_error "") set(gp_regex_fallback "") set(gp_regex_cmp_count 1) - elseif(gp_tool STREQUAL "objdump") + elseif(gp_tool MATCHES "objdump$") set(gp_cmd_args "-p") set(gp_regex "^\t*DLL Name: (.*\\.[Dd][Ll][Ll])${eol_char}$") set(gp_regex_error "") @@ -752,7 +768,7 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa endif() - if(gp_tool STREQUAL "dumpbin") + if(gp_tool MATCHES "dumpbin$") # When running dumpbin, it also needs the "Common7/IDE" directory in the # PATH. It will already be in the PATH if being run from a Visual Studio # command prompt. Add it to the PATH here in case we are running from a @@ -781,7 +797,7 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa # # </setup-gp_tool-vars> - if(gp_tool STREQUAL "ldd") + if(gp_tool MATCHES "ldd$") set(old_ld_env "$ENV{LD_LIBRARY_PATH}") set(new_ld_env "${exepath}") foreach(dir ${dirs}) @@ -806,7 +822,7 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa ERROR_VARIABLE gp_ev ) - if(gp_tool STREQUAL "dumpbin") + if(gp_tool MATCHES "dumpbin$") # Exclude delay load dependencies under windows (they are listed in dumpbin output after the message below) string(FIND "${gp_cmd_ov}" "Image has the following delay load dependencies" gp_delayload_pos) if (${gp_delayload_pos} GREATER -1) @@ -820,7 +836,7 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa endif() if(NOT gp_rv STREQUAL "0") - if(gp_tool STREQUAL "dumpbin") + if(gp_tool MATCHES "dumpbin$") # dumpbin error messages seem to go to stdout message(FATAL_ERROR "${gp_cmd} failed: ${gp_rv}\n${gp_ev}\n${gp_cmd_ov}") else() @@ -828,7 +844,7 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa endif() endif() - if(gp_tool STREQUAL "ldd") + if(gp_tool MATCHES "ldd$") set(ENV{LD_LIBRARY_PATH} "${old_ld_env}") endif() @@ -848,9 +864,9 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa # check for install id and remove it from list, since otool -L can include a # reference to itself set(gp_install_id) - if(gp_tool STREQUAL "otool") + if(gp_tool MATCHES "otool$") execute_process( - COMMAND otool -D ${target} + COMMAND ${gp_cmd} -D ${target} RESULT_VARIABLE otool_rv OUTPUT_VARIABLE gp_install_id_ov ERROR_VARIABLE otool_ev diff --git a/Modules/GoogleTestAddTests.cmake b/Modules/GoogleTestAddTests.cmake index 5a4bdca..4abbbec 100644 --- a/Modules/GoogleTestAddTests.cmake +++ b/Modules/GoogleTestAddTests.cmake @@ -30,6 +30,7 @@ if(NOT EXISTS "${TEST_EXECUTABLE}") endif() execute_process( COMMAND ${TEST_EXECUTOR} "${TEST_EXECUTABLE}" --gtest_list_tests + WORKING_DIRECTORY "${TEST_WORKING_DIR}" TIMEOUT ${TEST_DISCOVERY_TIMEOUT} OUTPUT_VARIABLE output RESULT_VARIABLE result diff --git a/Modules/InstallRequiredSystemLibraries.cmake b/Modules/InstallRequiredSystemLibraries.cmake index 9a5e64d..5ba8687 100644 --- a/Modules/InstallRequiredSystemLibraries.cmake +++ b/Modules/InstallRequiredSystemLibraries.cmake @@ -303,7 +303,15 @@ if(MSVC) get_filename_component(windows_kits_dir "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows Kits\\Installed Roots;KitsRoot10]" ABSOLUTE) set(programfilesx86 "ProgramFiles(x86)") - find_path(WINDOWS_KITS_DIR NAMES Redist/ucrt/DLLs/${CMAKE_MSVC_ARCH}/ucrtbase.dll + if(";${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION};$ENV{UCRTVersion};$ENV{WindowsSDKVersion};" MATCHES [=[;(10\.[0-9.]+)[;\]]=]) + set(__ucrt_version "${CMAKE_MATCH_1}/") + else() + set(__ucrt_version "") + endif() + find_path(WINDOWS_KITS_DIR + NAMES + Redist/${__ucrt_version}ucrt/DLLs/${CMAKE_MSVC_ARCH}/ucrtbase.dll + Redist/ucrt/DLLs/${CMAKE_MSVC_ARCH}/ucrtbase.dll PATHS $ENV{CMAKE_WINDOWS_KITS_10_DIR} "${windows_kits_dir}" @@ -314,11 +322,19 @@ if(MSVC) # Glob the list of UCRT DLLs. if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY) - file(GLOB __ucrt_dlls "${WINDOWS_KITS_DIR}/Redist/ucrt/DLLs/${CMAKE_MSVC_ARCH}/*.dll") + if(EXISTS "${WINDOWS_KITS_DIR}/Redist/${__ucrt_version}ucrt/DLLs/${CMAKE_MSVC_ARCH}/ucrtbase.dll") + file(GLOB __ucrt_dlls "${WINDOWS_KITS_DIR}/Redist/${__ucrt_version}ucrt/DLLs/${CMAKE_MSVC_ARCH}/*.dll") + else() + file(GLOB __ucrt_dlls "${WINDOWS_KITS_DIR}/Redist/ucrt/DLLs/${CMAKE_MSVC_ARCH}/*.dll") + endif() list(APPEND __install__libs ${__ucrt_dlls}) endif() if(CMAKE_INSTALL_DEBUG_LIBRARIES) - file(GLOB __ucrt_dlls "${WINDOWS_KITS_DIR}/bin/${CMAKE_MSVC_ARCH}/ucrt/*.dll") + if(EXISTS "${WINDOWS_KITS_DIR}/bin/${__ucrt_version}${CMAKE_MSVC_ARCH}/ucrt/ucrtbased.dll") + file(GLOB __ucrt_dlls "${WINDOWS_KITS_DIR}/bin/${__ucrt_version}${CMAKE_MSVC_ARCH}/ucrt/*.dll") + else() + file(GLOB __ucrt_dlls "${WINDOWS_KITS_DIR}/bin/${CMAKE_MSVC_ARCH}/ucrt/*.dll") + endif() list(APPEND __install__libs ${__ucrt_dlls}) endif() endif() diff --git a/Modules/Internal/CMakeCheckCompilerFlag.cmake b/Modules/Internal/CMakeCheckCompilerFlag.cmake index ca9b356..9c8dfb6 100644 --- a/Modules/Internal/CMakeCheckCompilerFlag.cmake +++ b/Modules/Internal/CMakeCheckCompilerFlag.cmake @@ -12,12 +12,17 @@ The function does not use the try_compile() command so as to avoid infinite recursion. It may not work for all platforms or toolchains, the caller is responsible for ensuring it is only called in valid situations. + cmake_check_compiler_flag(<lang> <flag> <result> + [SRC_EXT <ext>] [COMMAND_PATTERN <pattern>] + [FAIL_REGEX <regex> ...] + [OUTPUT_VARIABLE <output>]) + Parameters: - lang - Language to check. - flag - The flag to add to the compile/link command line. - result - Boolean output variable. It will be stored in the cache as an - internal variable and if true, will cause future tests that assign - to that variable to be bypassed. + <lang> - Language to check. + <flag> - The flag to add to the compile/link command line. + <result> - Boolean output variable. It will be stored in the cache as an + internal variable and if true, will cause future tests that assign + to that variable to be bypassed. Optional parameters: SRC_EXT - Overrides the extension of the source file used for the @@ -28,7 +33,7 @@ Optional parameters: the output, give a failed result for the check. A common set of regular expressions will be included in addition to those given by FAIL_REGEX. - + OUTPUT_VARIABLE - Set <output> variable with details about any error. #]=] include_guard(GLOBAL) @@ -58,7 +63,7 @@ function(CMAKE_CHECK_COMPILER_FLAG lang flag result) set(check_lang ${lang}) endif() - cmake_parse_arguments(CCCF "" "SRC_EXT;COMMAND_PATTERN" "FAIL_REGEX" ${ARGN}) + cmake_parse_arguments(CCCF "" "SRC_EXT;COMMAND_PATTERN;OUTPUT_VARIABLE" "FAIL_REGEX" ${ARGN}) if (NOT CCCF_COMMAND_PATTERN) set (CCCF_COMMAND_PATTERN "<FLAG> -o <OUTPUT> <SOURCE>") @@ -95,6 +100,10 @@ function(CMAKE_CHECK_COMPILER_FLAG lang flag result) endif() endif() + if (CCCF_OUTPUT_VARIABLE) + unset(${CCCF_OUTPUT_VARIABLE} PARENT_SCOPE) + endif() + # Compute the directory in which to run the test. set(COMPILER_FLAG_DIR "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp") # Compute source and output files. @@ -139,6 +148,9 @@ function(CMAKE_CHECK_COMPILER_FLAG lang flag result) "Determining if the ${flag} option " "is supported for ${lang} language failed with the following output:\n" "${COMPILER_FLAG_OUTPUT}\n") + if (CCCF_OUTPUT_VARIABLE) + set(${CCCF_OUTPUT_VARIABLE} "${COMPILER_FLAG_OUTPUT}" PARENT_SCOPE) + endif() return() endif() diff --git a/Modules/Internal/CPack/CPackDeb.cmake b/Modules/Internal/CPack/CPackDeb.cmake index 3042a16..89dc6f0 100644 --- a/Modules/Internal/CPack/CPackDeb.cmake +++ b/Modules/Internal/CPack/CPackDeb.cmake @@ -482,13 +482,16 @@ function(cpack_deb_prepare_package_vars) endif() if(CPACK_DEBIAN_ARCHIVE_TYPE) - set(archive_types_ "paxr;gnutar") - if(NOT CPACK_DEBIAN_ARCHIVE_TYPE IN_LIST archive_types_) + if(CPACK_DEBIAN_ARCHIVE_TYPE STREQUAL "paxr") + message(DEPRECATION "CPACK_DEBIAN_ARCHIVE_TYPE set to old and invalid " + "type 'paxr', mapping to 'gnutar'") + set(CPACK_DEBIAN_ARCHIVE_TYPE "gnutar") + elseif(NOT CPACK_DEBIAN_ARCHIVE_TYPE STREQUAL "gnutar") message(FATAL_ERROR "CPACK_DEBIAN_ARCHIVE_TYPE set to unsupported" "type ${CPACK_DEBIAN_ARCHIVE_TYPE}") endif() else() - set(CPACK_DEBIAN_ARCHIVE_TYPE "paxr") + set(CPACK_DEBIAN_ARCHIVE_TYPE "gnutar") endif() # Compression: (recommended) diff --git a/Modules/Platform/CYGWIN-GNU.cmake b/Modules/Platform/CYGWIN-GNU.cmake index f55b80d..ca90712 100644 --- a/Modules/Platform/CYGWIN-GNU.cmake +++ b/Modules/Platform/CYGWIN-GNU.cmake @@ -27,6 +27,7 @@ macro(__cygwin_compiler_gnu lang) # No -fPIC on cygwin set(CMAKE_${lang}_COMPILE_OPTIONS_PIC "") set(CMAKE_${lang}_COMPILE_OPTIONS_PIE "") + set(_CMAKE_${lang}_PIE_MAY_BE_SUPPORTED_BY_LINKER NO) set(CMAKE_${lang}_LINK_OPTIONS_PIE "") set(CMAKE_${lang}_LINK_OPTIONS_NO_PIE "") set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "") diff --git a/Modules/Platform/Fuchsia.cmake b/Modules/Platform/Fuchsia.cmake index 7b33434..4b13805 100644 --- a/Modules/Platform/Fuchsia.cmake +++ b/Modules/Platform/Fuchsia.cmake @@ -3,6 +3,7 @@ set(FUCHSIA 1) set(CMAKE_DL_LIBS "") set(CMAKE_C_COMPILE_OPTIONS_PIC "-fPIC") set(CMAKE_C_COMPILE_OPTIONS_PIE "-fPIE") +set(_CMAKE_C_PIE_MAY_BE_SUPPORTED_BY_LINKER YES) set(CMAKE_C_LINK_OPTIONS_PIE ${CMAKE_C_COMPILE_OPTIONS_PIE} "-pie") set(CMAKE_C_LINK_OPTIONS_NO_PIE "-no-pie") set(CMAKE_SHARED_LIBRARY_C_FLAGS "-fPIC") diff --git a/Modules/Platform/Linux-Intel.cmake b/Modules/Platform/Linux-Intel.cmake index ab22b1d..3b5ca59 100644 --- a/Modules/Platform/Linux-Intel.cmake +++ b/Modules/Platform/Linux-Intel.cmake @@ -23,7 +23,9 @@ endif() macro(__linux_compiler_intel lang) set(CMAKE_${lang}_COMPILE_OPTIONS_PIC "-fPIC") set(CMAKE_${lang}_COMPILE_OPTIONS_PIE "-fPIE") + set(_CMAKE_${lang}_PIE_MAY_BE_SUPPORTED_BY_LINKER NO) if (NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 13.0) + set(_CMAKE_${lang}_PIE_MAY_BE_SUPPORTED_BY_LINKER YES) set(CMAKE_${lang}_LINK_OPTIONS_PIE ${CMAKE_${lang}_COMPILE_OPTIONS_PIE} "-pie") set(CMAKE_${lang}_LINK_OPTIONS_NO_PIE "-no-pie") endif() diff --git a/Modules/Platform/Linux-PGI.cmake b/Modules/Platform/Linux-PGI.cmake index 3e7e391..0341654 100644 --- a/Modules/Platform/Linux-PGI.cmake +++ b/Modules/Platform/Linux-PGI.cmake @@ -12,6 +12,7 @@ macro(__linux_compiler_pgi lang) # Shared library compile and link flags. set(CMAKE_${lang}_COMPILE_OPTIONS_PIC "-fPIC") set(CMAKE_${lang}_COMPILE_OPTIONS_PIE "") + set(_CMAKE_${lang}_PIE_MAY_BE_SUPPORTED_BY_LINKER NO) set(CMAKE_${lang}_LINK_OPTIONS_PIE "") set(CMAKE_${lang}_LINK_OPTIONS_NO_PIE "") set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "-fPIC") diff --git a/Modules/Platform/SINIX.cmake b/Modules/Platform/SINIX.cmake index e44ceef..e3b0a05 100644 --- a/Modules/Platform/SINIX.cmake +++ b/Modules/Platform/SINIX.cmake @@ -1,5 +1,6 @@ set(CMAKE_C_COMPILE_OPTIONS_PIC -K PIC) set(CMAKE_C_COMPILE_OPTIONS_PIE "") +set(_CMAKE_C_PIE_MAY_BE_SUPPORTED_BY_LINKER NO) set(CMAKE_C_LINK_OPTIONS_PIE "") set(CMAKE_C_LINK_OPTIONS_NO_PIE "") set(CMAKE_SHARED_LIBRARY_C_FLAGS "-K PIC") diff --git a/Modules/Platform/UNIX_SV.cmake b/Modules/Platform/UNIX_SV.cmake index 433daf3..bd1ffce 100644 --- a/Modules/Platform/UNIX_SV.cmake +++ b/Modules/Platform/UNIX_SV.cmake @@ -1,5 +1,6 @@ set(CMAKE_C_COMPILE_OPTIONS_PIC -K PIC) set(CMAKE_C_COMPILE_OPTIONS_PIE "") +set(_CMAKE_C_PIE_MAY_BE_SUPPORTED_BY_LINKER NO) set(CMAKE_C_LINK_OPTIONS_PIE "") set(CMAKE_C_LINK_OPTIONS_NO_PIE "") set(CMAKE_SHARED_LIBRARY_C_FLAGS "-K PIC") diff --git a/Modules/Platform/UnixWare.cmake b/Modules/Platform/UnixWare.cmake index 8c9d430..94888d9 100644 --- a/Modules/Platform/UnixWare.cmake +++ b/Modules/Platform/UnixWare.cmake @@ -1,5 +1,6 @@ set(CMAKE_C_COMPILE_OPTIONS_PIC -K PIC) set(CMAKE_C_COMPILE_OPTIONS_PIE "") +set(_CMAKE_C_PIE_MAY_BE_SUPPORTED_BY_LINKER NO) set(CMAKE_C_LINK_OPTIONS_PIE "") set(CMAKE_C_LINK_OPTIONS_NO_PIE "") set(CMAKE_SHARED_LIBRARY_C_FLAGS "-K PIC") diff --git a/Modules/Platform/Windows-GNU.cmake b/Modules/Platform/Windows-GNU.cmake index 2e854e5..71189b1 100644 --- a/Modules/Platform/Windows-GNU.cmake +++ b/Modules/Platform/Windows-GNU.cmake @@ -72,6 +72,7 @@ macro(__windows_compiler_gnu lang) # No -fPIC on Windows set(CMAKE_${lang}_COMPILE_OPTIONS_PIC "") set(CMAKE_${lang}_COMPILE_OPTIONS_PIE "") + set(_CMAKE_${lang}_PIE_MAY_BE_SUPPORTED_BY_LINKER NO) set(CMAKE_${lang}_LINK_OPTIONS_PIE "") set(CMAKE_${lang}_LINK_OPTIONS_NO_PIE "") set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "") diff --git a/Modules/Qt4ConfigDependentSettings.cmake b/Modules/Qt4ConfigDependentSettings.cmake index 684ec21..4699ecd 100644 --- a/Modules/Qt4ConfigDependentSettings.cmake +++ b/Modules/Qt4ConfigDependentSettings.cmake @@ -256,7 +256,6 @@ if(Q_WS_X11) # X11 libraries Qt always depends on set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${X11_Xext_LIB} ${X11_X11_LIB}) - set(CMAKE_THREAD_PREFER_PTHREAD 1) find_package(Threads) if(CMAKE_USE_PTHREADS_INIT) set(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES} ${CMAKE_THREAD_LIBS_INIT}) diff --git a/Modules/UseEcos.cmake b/Modules/UseEcos.cmake index 6d13d42..9f84847 100644 --- a/Modules/UseEcos.cmake +++ b/Modules/UseEcos.cmake @@ -191,8 +191,8 @@ macro(ECOS_ADD_EXECUTABLE _exe_NAME ) set(CMAKE_CXX_LINK_EXECUTABLE "<CMAKE_CXX_COMPILER> <CMAKE_CXX_LINK_FLAGS> <OBJECTS> -o <TARGET> ${_ecos_EXTRA_LIBS} -nostdlib -nostartfiles -L${CMAKE_CURRENT_BINARY_DIR}/ecos/install/lib -Ttarget.ld ${ECOS_LD_MCPU}") set(CMAKE_C_LINK_EXECUTABLE "<CMAKE_C_COMPILER> <CMAKE_C_LINK_FLAGS> <OBJECTS> -o <TARGET> ${_ecos_EXTRA_LIBS} -nostdlib -nostartfiles -L${CMAKE_CURRENT_BINARY_DIR}/ecos/install/lib -Ttarget.ld ${ECOS_LD_MCPU}") # some strict compiler flags - set (CMAKE_C_FLAGS "-Wstrict-prototypes") - set (CMAKE_CXX_FLAGS "-Woverloaded-virtual -fno-rtti -Wctor-dtor-privacy -fno-strict-aliasing -fno-exceptions") + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wstrict-prototypes") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Woverloaded-virtual -fno-rtti -Wctor-dtor-privacy -fno-strict-aliasing -fno-exceptions") add_executable(${_exe_NAME} ${ARGN}) set_target_properties(${_exe_NAME} PROPERTIES SUFFIX ".elf") diff --git a/Modules/UseJava.cmake b/Modules/UseJava.cmake index 68c9a27..2bcd28e 100644 --- a/Modules/UseJava.cmake +++ b/Modules/UseJava.cmake @@ -644,7 +644,7 @@ function(add_jar _TARGET_NAME) string(APPEND CMAKE_JAVA_INCLUDE_PATH_FINAL "${CMAKE_JAVA_INCLUDE_FLAG_SEP}${_JAVA_JAR_PATH}") list(APPEND CMAKE_JAVA_INCLUDE_PATH ${_JAVA_JAR_PATH}) list(APPEND _JAVA_DEPENDS ${_JAVA_INCLUDE_JAR}) - list(APPEND _JAVA_COMPILE_DEPENDS ${_JAVA_INCLUDE_JAR}) + list(APPEND _JAVA_COMPILE_DEPENDS ${_JAVA_JAR_PATH}) else () message(SEND_ERROR "add_jar: INCLUDE_JARS target ${_JAVA_INCLUDE_JAR} is not a jar") endif () diff --git a/Modules/UseSWIG.cmake b/Modules/UseSWIG.cmake index d9a0389..18ea55c 100644 --- a/Modules/UseSWIG.cmake +++ b/Modules/UseSWIG.cmake @@ -75,7 +75,8 @@ Defines the following command for use with ``SWIG``: ``SOURCES`` List of sources for the library. Files with extension ``.i`` will be identified as sources for the ``SWIG`` tool. Other files will be handled in - the standard way. + the standard way. This behavior can be overriden by specifying the variable + ``SWIG_SOURCE_FILE_EXTENSIONS``. .. note:: @@ -142,6 +143,11 @@ ensure generated files will receive the required settings. set_property(SOURCE mymod.i PROPERTY SWIG_MODULE_NAME mymod_realname) + .. note:: + + If policy :policy:`CMP0086` is set to ``NEW``, ``-module <module_name>`` + is passed to ``SWIG`` compiler. + Target library properties can be set to apply same configuration to all SWIG input files. @@ -217,15 +223,31 @@ as well as ``SWIG``: ``SWIG_MODULE_<name>_EXTRA_DEPS`` Specify extra dependencies for the generated module for ``<name>``. + +``SWIG_SOURCE_FILE_EXTENSIONS`` + Specify a list of source file extensions to override the default + behavior of considering only ``.i`` files as sources for the ``SWIG`` + tool. For example: + + .. code-block:: cmake + + set(SWIG_SOURCE_FILE_EXTENSIONS ".i" ".swg") #]=======================================================================] cmake_policy(GET CMP0078 target_name_policy) +cmake_policy(GET CMP0086 module_name_policy) + cmake_policy (VERSION 3.12) if (target_name_policy) # respect user choice regarding CMP0078 policy cmake_policy(SET CMP0078 ${target_name_policy}) endif() +if (module_name_policy) + # respect user choice regarding CMP0086 policy + cmake_policy(SET CMP0086 ${module_name_policy}) +endif() unset(target_name_policy) +unset(module_name_policy) set(SWIG_CXX_EXTENSION "cxx") set(SWIG_EXTRA_LIBRARIES "") @@ -426,6 +448,19 @@ function(SWIG_ADD_SOURCE_TO_MODULE name outfiles infile) list (APPEND swig_special_flags "-c++") endif() + cmake_policy(GET CMP0086 module_name_policy) + if (module_name_policy STREQUAL "NEW") + get_source_file_property(module_name "${infile}" SWIG_MODULE_NAME) + if (module_name) + list (APPEND swig_special_flags "-module" "${module_name}") + endif() + else() + if (NOT module_name_policy) + cmake_policy(GET_WARNING CMP0086 _cmp0086_warning) + message(AUTHOR_WARNING "${_cmp0086_warning}\n") + endif() + endif() + set (swig_extra_flags) if(SWIG_MODULE_${name}_LANGUAGE STREQUAL "CSHARP") if(NOT ("-dllimport" IN_LIST swig_source_file_flags OR "-dllimport" IN_LIST SWIG_MODULE_${name}_EXTRA_FLAGS)) @@ -634,8 +669,20 @@ function(SWIG_ADD_LIBRARY name) set(CMAKE_SWIG_OUTDIR "${outputdir}") set(SWIG_OUTFILE_DIR "${outfiledir}") + # See if the user has specified source extensions for swig files? + if (NOT DEFINED SWIG_SOURCE_FILE_EXTENSIONS) + # Assume the default (*.i) file extension for Swig source files + set(SWIG_SOURCE_FILE_EXTENSIONS ".i") + endif() + + # Generate a regex out of file extensions. + string(REGEX REPLACE "([$^.*+?|()-])" "\\\\\\1" swig_source_ext_regex "${SWIG_SOURCE_FILE_EXTENSIONS}") + list (JOIN swig_source_ext_regex "|" swig_source_ext_regex) + string (PREPEND swig_source_ext_regex "(") + string (APPEND swig_source_ext_regex ")$") + set(swig_dot_i_sources ${_SAM_SOURCES}) - list(FILTER swig_dot_i_sources INCLUDE REGEX "\\.i$") + list(FILTER swig_dot_i_sources INCLUDE REGEX ${swig_source_ext_regex}) if (NOT swig_dot_i_sources) message(FATAL_ERROR "SWIG_ADD_LIBRARY: no SWIG interface files specified") endif() diff --git a/Modules/WriteBasicConfigVersionFile.cmake b/Modules/WriteBasicConfigVersionFile.cmake index 1f13096..45f9e58 100644 --- a/Modules/WriteBasicConfigVersionFile.cmake +++ b/Modules/WriteBasicConfigVersionFile.cmake @@ -15,6 +15,7 @@ WriteBasicConfigVersionFile WRITE_BASIC_CONFIG_VERSION_FILE( filename [VERSION major.minor.patch] COMPATIBILITY (AnyNewerVersion|SameMajorVersion|SameMinorVersion|ExactVersion) + [ARCH_INDEPENDENT] ) @@ -22,7 +23,7 @@ WriteBasicConfigVersionFile function(WRITE_BASIC_CONFIG_VERSION_FILE _filename) - set(options ) + set(options ARCH_INDEPENDENT ) set(oneValueArgs VERSION COMPATIBILITY ) set(multiValueArgs ) diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 9aebfa7..91c45bc 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -207,6 +207,14 @@ set(SRCS cmExtraKateGenerator.h cmExtraSublimeTextGenerator.cxx cmExtraSublimeTextGenerator.h + cmFileAPI.cxx + cmFileAPI.h + cmFileAPICache.cxx + cmFileAPICache.h + cmFileAPICodemodel.cxx + cmFileAPICodemodel.h + cmFileAPICMakeFiles.cxx + cmFileAPICMakeFiles.h cmFileLock.cxx cmFileLock.h cmFileLockPool.cxx @@ -375,6 +383,9 @@ set(SRCS cmXMLWriter.h cmake.cxx cmake.h + cm_string_view.cxx + cm_string_view.hxx + cm_static_string_view.hxx cmCommand.cxx cmCommand.h @@ -566,6 +577,8 @@ set(SRCS cmSiteNameCommand.h cmSourceGroupCommand.cxx cmSourceGroupCommand.h + cmString.cxx + cmString.hxx cmStringReplaceHelper.cxx cmStringCommand.cxx cmStringCommand.h @@ -813,7 +826,6 @@ target_compile_definitions(CMakeLib PUBLIC ${CLANG_TIDY_DEFINITIONS}) # include_directories( "${CMake_SOURCE_DIR}/Source/CTest" - ${CMAKE_XMLRPC_INCLUDES} ${CMAKE_CURL_INCLUDES} ) # @@ -879,7 +891,7 @@ set(CTEST_SRCS cmCTest.cxx # Build CTestLib add_library(CTestLib ${CTEST_SRCS}) -target_link_libraries(CTestLib CMakeLib ${CMAKE_CURL_LIBRARIES} ${CMAKE_XMLRPC_LIBRARIES}) +target_link_libraries(CTestLib CMakeLib ${CMAKE_CURL_LIBRARIES}) # # CPack diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 616e7d8..58df3d9 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 13) -set(CMake_VERSION_PATCH 20181115) +set(CMake_VERSION_PATCH 20190107) #set(CMake_VERSION_RC 1) diff --git a/Source/CPack/IFW/cmCPackIFWPackage.cxx b/Source/CPack/IFW/cmCPackIFWPackage.cxx index 67e279c..c96b5d4 100644 --- a/Source/CPack/IFW/cmCPackIFWPackage.cxx +++ b/Source/CPack/IFW/cmCPackIFWPackage.cxx @@ -359,7 +359,7 @@ int cmCPackIFWPackage::ConfigureFromPrefix(const std::string& prefix) if (this->IsSetToEmpty(option)) { this->DisplayName.clear(); } else if (const char* value = this->GetOption(option)) { - this->ExpandListArgument(value, this->DisplayName); + cmCPackIFWPackage::ExpandListArgument(value, this->DisplayName); } // Description @@ -367,7 +367,7 @@ int cmCPackIFWPackage::ConfigureFromPrefix(const std::string& prefix) if (this->IsSetToEmpty(option)) { this->Description.clear(); } else if (const char* value = this->GetOption(option)) { - this->ExpandListArgument(value, this->Description); + cmCPackIFWPackage::ExpandListArgument(value, this->Description); } // Release date diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.h b/Source/CPack/WiX/cmCPackWIXGenerator.h index 128a04d..f8c7644 100644 --- a/Source/CPack/WiX/cmCPackWIXGenerator.h +++ b/Source/CPack/WiX/cmCPackWIXGenerator.h @@ -28,20 +28,20 @@ public: ~cmCPackWIXGenerator(); protected: - virtual int InitializeInternal(); + int InitializeInternal() override; - virtual int PackageFiles(); + int PackageFiles() override; - virtual const char* GetOutputExtension() { return ".msi"; } + const char* GetOutputExtension() override { return ".msi"; } - virtual enum CPackSetDestdirSupport SupportsSetDestdir() const + enum CPackSetDestdirSupport SupportsSetDestdir() const override { return SETDESTDIR_UNSUPPORTED; } - virtual bool SupportsAbsoluteDestination() const { return false; } + bool SupportsAbsoluteDestination() const override { return false; } - virtual bool SupportsComponentInstallation() const { return true; } + bool SupportsComponentInstallation() const override { return true; } private: typedef std::map<std::string, std::string> id_map_t; diff --git a/Source/CPack/cmCPackDebGenerator.cxx b/Source/CPack/cmCPackDebGenerator.cxx index ea0ee58..29968af 100644 --- a/Source/CPack/cmCPackDebGenerator.cxx +++ b/Source/CPack/cmCPackDebGenerator.cxx @@ -80,7 +80,7 @@ DebGenerator::DebGenerator( , WorkDir(workDir) , TopLevelDir(topLevelDir) , TemporaryDir(temporaryDir) - , DebianArchiveType(debianArchiveType ? debianArchiveType : "paxr") + , DebianArchiveType(debianArchiveType ? debianArchiveType : "gnutar") , ControlValues(controlValues) , GenShLibs(genShLibs) , ShLibsFilename(shLibsFilename) diff --git a/Source/CPack/cmCPackDragNDropGenerator.cxx b/Source/CPack/cmCPackDragNDropGenerator.cxx index 5616523..326d26c 100644 --- a/Source/CPack/cmCPackDragNDropGenerator.cxx +++ b/Source/CPack/cmCPackDragNDropGenerator.cxx @@ -533,7 +533,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir, cmSystemTools::ExpandListArgument(cpack_dmg_languages, languages); } - cmGeneratedFileStream ofs(sla_r.c_str()); + cmGeneratedFileStream ofs(sla_r); ofs << "#include <CoreServices/CoreServices.r>\n\n"; if (oldStyle) { ofs << SLAHeader; diff --git a/Source/CPack/cmCPackFreeBSDGenerator.cxx b/Source/CPack/cmCPackFreeBSDGenerator.cxx index 1433414..2fcd1a8 100644 --- a/Source/CPack/cmCPackFreeBSDGenerator.cxx +++ b/Source/CPack/cmCPackFreeBSDGenerator.cxx @@ -55,8 +55,7 @@ cmGeneratedFileStream& operator<<(cmGeneratedFileStream& s, const EscapeQuotes& v) { s << '"'; - for (std::string::size_type i = 0; i < v.value.length(); ++i) { - char c = v.value[i]; + for (char c : v.value) { switch (c) { case '\n': s << "\\n"; @@ -148,8 +147,8 @@ public: ManifestKeyListValue& operator<<(const std::vector<std::string>& v) { - for (VList::const_iterator it = v.begin(); it != v.end(); ++it) { - (*this) << (*it); + for (std::string const& e : v) { + (*this) << e; } return *this; } @@ -159,9 +158,9 @@ public: bool with_comma = false; s << '['; - for (VList::const_iterator it = value.begin(); it != value.end(); ++it) { + for (std::string const& elem : value) { s << (with_comma ? ',' : ' '); - s << EscapeQuotes(*it); + s << EscapeQuotes(elem); with_comma = true; } s << " ]"; @@ -182,8 +181,8 @@ public: void write_value(cmGeneratedFileStream& s) const override { s << "{\n"; - for (VList::const_iterator it = value.begin(); it != value.end(); ++it) { - s << " \"" << *it << "\": {\"origin\": \"" << *it << "\"},\n"; + for (std::string const& elem : value) { + s << " \"" << elem << "\": {\"origin\": \"" << elem << "\"},\n"; } s << '}'; } @@ -206,9 +205,8 @@ std::string cmCPackFreeBSDGenerator::var_lookup(const char* var_name) const char* pv = this->GetOption(var_name); if (!pv) { return std::string(); - } else { - return pv; } + return pv; } // Produce UCL in the given @p manifest file for the common @@ -234,7 +232,7 @@ void cmCPackFreeBSDGenerator::write_manifest_fields( cmSystemTools::ExpandListArgument( var_lookup("CPACK_FREEBSD_PACKAGE_LICENSE"), licenses); std::string licenselogic("single"); - if (licenses.size() < 1) { + if (licenses.empty()) { cmSystemTools::SetFatalErrorOccured(); } else if (licenses.size() > 1) { licenselogic = var_lookup("CPACK_FREEBSD_PACKAGE_LICENSE_LOGIC"); @@ -249,7 +247,7 @@ void cmCPackFreeBSDGenerator::write_manifest_fields( std::vector<std::string> deps; cmSystemTools::ExpandListArgument(var_lookup("CPACK_FREEBSD_PACKAGE_DEPS"), deps); - if (deps.size() > 0) { + if (!deps.empty()) { manifest << (ManifestKeyDepsValue("deps") << deps); } } @@ -277,13 +275,9 @@ void write_manifest_files(cmGeneratedFileStream& s, const std::string& toplevel, const std::vector<std::string>& files) { - const char* c_toplevel = toplevel.c_str(); - std::vector<std::string>::const_iterator it; - s << "\"files\": {\n"; - for (it = files.begin(); it != files.end(); ++it) { - s << " \"/" << cmSystemTools::RelativePath(c_toplevel, it->c_str()) - << "\": \"" + for (std::string const& file : files) { + s << " \"/" << cmSystemTools::RelativePath(toplevel, file) << "\": \"" << "<sha256>" << "\",\n"; } @@ -313,7 +307,7 @@ int cmCPackFreeBSDGenerator::PackageFiles() std::string manifestname = toplevel + "/+MANIFEST"; { - cmGeneratedFileStream manifest(manifestname.c_str()); + cmGeneratedFileStream manifest(manifestname); manifest << "{\n"; write_manifest_fields(manifest); write_manifest_files(manifest, toplevel, files); @@ -340,16 +334,15 @@ int cmCPackFreeBSDGenerator::PackageFiles() std::string output_dir = cmSystemTools::CollapseCombinedPath(toplevel, "../"); pkg_create_from_manifest(output_dir.c_str(), ::TXZ, toplevel.c_str(), - manifestname.c_str(), NULL); + manifestname.c_str(), nullptr); std::string broken_suffix = std::string("-") + var_lookup("CPACK_TOPLEVEL_TAG") + std::string(GetOutputExtension()); - for (std::vector<std::string>::iterator it = packageFileNames.begin(); - it != packageFileNames.end(); ++it) { - cmCPackLogger(cmCPackLog::LOG_DEBUG, "Packagefile " << *it << std::endl); - if (has_suffix(*it, broken_suffix)) { - it->replace(it->size() - broken_suffix.size(), std::string::npos, - GetOutputExtension()); + for (std::string& name : packageFileNames) { + cmCPackLogger(cmCPackLog::LOG_DEBUG, "Packagefile " << name << std::endl); + if (has_suffix(name, broken_suffix)) { + name.replace(name.size() - broken_suffix.size(), std::string::npos, + GetOutputExtension()); break; } } diff --git a/Source/CPack/cmCPackNSISGenerator.cxx b/Source/CPack/cmCPackNSISGenerator.cxx index f75a750..d02aa5a 100644 --- a/Source/CPack/cmCPackNSISGenerator.cxx +++ b/Source/CPack/cmCPackNSISGenerator.cxx @@ -223,7 +223,8 @@ int cmCPackNSISGenerator::PackageFiles() if (!group.second.Description.empty()) { groupDescriptions += " !insertmacro MUI_DESCRIPTION_TEXT ${" + group.first + "} \"" + - this->TranslateNewlines(group.second.Description) + "\"\n"; + cmCPackNSISGenerator::TranslateNewlines(group.second.Description) + + "\"\n"; } } @@ -253,7 +254,8 @@ int cmCPackNSISGenerator::PackageFiles() if (!comp.second.Description.empty()) { componentDescriptions += " !insertmacro MUI_DESCRIPTION_TEXT ${" + comp.first + "} \"" + - this->TranslateNewlines(comp.second.Description) + "\"\n"; + cmCPackNSISGenerator::TranslateNewlines(comp.second.Description) + + "\"\n"; } } diff --git a/Source/CPack/cmCPackOSXX11Generator.cxx b/Source/CPack/cmCPackOSXX11Generator.cxx index dab7283..1908c17 100644 --- a/Source/CPack/cmCPackOSXX11Generator.cxx +++ b/Source/CPack/cmCPackOSXX11Generator.cxx @@ -169,7 +169,7 @@ int cmCPackOSXX11Generator::PackageFiles() numTries--; } if (!res || retVal) { - cmGeneratedFileStream ofs(tmpFile.c_str()); + cmGeneratedFileStream ofs(tmpFile); ofs << "# Run command: " << dmgCmd.str() << std::endl << "# Output:" << std::endl << output << std::endl; diff --git a/Source/CPack/cmCPackPKGGenerator.cxx b/Source/CPack/cmCPackPKGGenerator.cxx index bdda386..9401bca 100644 --- a/Source/CPack/cmCPackPKGGenerator.cxx +++ b/Source/CPack/cmCPackPKGGenerator.cxx @@ -225,7 +225,8 @@ void cmCPackPKGGenerator::CreateChoice(const cmCPackComponent& component, xout.Content(this->GetPackageName(component)); } else { xout.Content("file:./"); - xout.Content(relativePackageLocation); + xout.Content(cmSystemTools::EncodeURL(relativePackageLocation, + /*escapeSlashes=*/false)); } xout.EndElement(); // pkg-ref } diff --git a/Source/CPack/cmCPackPackageMakerGenerator.cxx b/Source/CPack/cmCPackPackageMakerGenerator.cxx index 5b1a641..a24dd30 100644 --- a/Source/CPack/cmCPackPackageMakerGenerator.cxx +++ b/Source/CPack/cmCPackPackageMakerGenerator.cxx @@ -307,7 +307,7 @@ int cmCPackPackageMakerGenerator::PackageFiles() numTries--; } if (!res || retVal) { - cmGeneratedFileStream ofs(tmpFile.c_str()); + cmGeneratedFileStream ofs(tmpFile); ofs << "# Run command: " << dmgCmd.str() << std::endl << "# Output:" << std::endl << output << std::endl; @@ -475,7 +475,7 @@ bool cmCPackPackageMakerGenerator::RunPackageMaker(const char* command, cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Done running package maker" << std::endl); if (!res || retVal) { - cmGeneratedFileStream ofs(tmpFile.c_str()); + cmGeneratedFileStream ofs(tmpFile); ofs << "# Run command: " << command << std::endl << "# Output:" << std::endl << output << std::endl; diff --git a/Source/CPack/cmCPackProductBuildGenerator.cxx b/Source/CPack/cmCPackProductBuildGenerator.cxx index 76b3275..e73d01f 100644 --- a/Source/CPack/cmCPackProductBuildGenerator.cxx +++ b/Source/CPack/cmCPackProductBuildGenerator.cxx @@ -151,7 +151,7 @@ bool cmCPackProductBuildGenerator::RunProductBuild(const std::string& command) this->GeneratorVerbose, cmDuration::zero()); cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Done running command" << std::endl); if (!res || retVal) { - cmGeneratedFileStream ofs(tmpFile.c_str()); + cmGeneratedFileStream ofs(tmpFile); ofs << "# Run command: " << command << std::endl << "# Output:" << std::endl << output << std::endl; diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx index 7cf69fc..4e49727 100644 --- a/Source/CPack/cpack.cxx +++ b/Source/CPack/cpack.cxx @@ -89,6 +89,15 @@ int cpackDefinitionArgument(const char* argument, const char* cValue, return 1; } +static void cpackProgressCallback(const char* message, float progress, + void* clientdata) +{ + (void)progress; + (void)clientdata; + + std::cout << "-- " << message << std::endl; +} + // this is CPack. int main(int argc, char const* const* argv) { @@ -202,6 +211,7 @@ int main(int argc, char const* const* argv) cmake cminst(cmake::RoleScript); cminst.SetHomeDirectory(""); cminst.SetHomeOutputDirectory(""); + cminst.SetProgressCallback(cpackProgressCallback, nullptr); cminst.GetCurrentSnapshot().SetDefaultDefinitions(); cmGlobalGenerator cmgg(&cminst); cmMakefile globalMF(&cmgg, cminst.GetCurrentSnapshot()); diff --git a/Source/CTest/cmCTestBuildCommand.cxx b/Source/CTest/cmCTestBuildCommand.cxx index ce27da1..65b4976 100644 --- a/Source/CTest/cmCTestBuildCommand.cxx +++ b/Source/CTest/cmCTestBuildCommand.cxx @@ -53,10 +53,6 @@ cmCTestGenericHandler* cmCTestBuildCommand::InitializeHandler() } else { const char* cmakeGeneratorName = this->Makefile->GetDefinition("CTEST_CMAKE_GENERATOR"); - const char* cmakeProjectName = - (this->Values[ctb_PROJECT_NAME] && *this->Values[ctb_PROJECT_NAME]) - ? this->Values[ctb_PROJECT_NAME] - : this->Makefile->GetDefinition("CTEST_PROJECT_NAME"); // Build configuration is determined by: CONFIGURATION argument, // or CTEST_BUILD_CONFIGURATION script variable, or @@ -81,8 +77,7 @@ cmCTestGenericHandler* cmCTestBuildCommand::InitializeHandler() ? this->Values[ctb_TARGET] : this->Makefile->GetDefinition("CTEST_BUILD_TARGET"); - if (cmakeGeneratorName && *cmakeGeneratorName && cmakeProjectName && - *cmakeProjectName) { + if (cmakeGeneratorName && *cmakeGeneratorName) { if (!cmakeBuildConfiguration) { cmakeBuildConfiguration = "Release"; } @@ -132,14 +127,7 @@ cmCTestGenericHandler* cmCTestBuildCommand::InitializeHandler() /* clang-format off */ ostr << "has no project to build. If this is a " "\"built with CMake\" project, verify that CTEST_CMAKE_GENERATOR " - "and CTEST_PROJECT_NAME are set." - "\n" - "CTEST_PROJECT_NAME is usually set in CTestConfig.cmake. Verify " - "that CTestConfig.cmake exists, or CTEST_PROJECT_NAME " - "is set in the script, or PROJECT_NAME is passed as an argument " - "to ctest_build." - "\n" - "Alternatively, set CTEST_BUILD_COMMAND to build the project " + "is set. Otherwise, set CTEST_BUILD_COMMAND to build the project " "with a custom command line."; /* clang-format on */ this->SetError(ostr.str()); diff --git a/Source/CTest/cmCTestBuildHandler.cxx b/Source/CTest/cmCTestBuildHandler.cxx index a8309d9..539a0ce 100644 --- a/Source/CTest/cmCTestBuildHandler.cxx +++ b/Source/CTest/cmCTestBuildHandler.cxx @@ -503,10 +503,7 @@ public: : FTC(ftc) { } - FragmentCompare() - : FTC(nullptr) - { - } + FragmentCompare() {} bool operator()(std::string const& l, std::string const& r) const { // Order files by modification time. Use lexicographic order @@ -520,7 +517,7 @@ public: } private: - cmFileTimeComparison* FTC; + cmFileTimeComparison* FTC = nullptr; }; void cmCTestBuildHandler::GenerateXMLLaunched(cmXMLWriter& xml) diff --git a/Source/CTest/cmCTestGIT.cxx b/Source/CTest/cmCTestGIT.cxx index 71fcafb..4ede3d4 100644 --- a/Source/CTest/cmCTestGIT.cxx +++ b/Source/CTest/cmCTestGIT.cxx @@ -475,15 +475,9 @@ private: { std::string Name; std::string EMail; - unsigned long Time; - long TimeZone; - Person() - : Name() - , EMail() - , Time(0) - , TimeZone(0) - { - } + unsigned long Time = 0; + long TimeZone = 0; + Person() {} }; void ParsePerson(const char* str, Person& person) @@ -618,8 +612,8 @@ bool cmCTestGIT::LoadRevisions() git, "diff-tree", "--stdin", "--always", "-z", "-r", "--pretty=raw", "--encoding=utf-8", nullptr }; - this->Log << this->ComputeCommandLine(git_rev_list) << " | " - << this->ComputeCommandLine(git_diff_tree) << "\n"; + this->Log << cmCTestGIT::ComputeCommandLine(git_rev_list) << " | " + << cmCTestGIT::ComputeCommandLine(git_diff_tree) << "\n"; cmsysProcess* cp = cmsysProcess_New(); cmsysProcess_AddCommand(cp, git_rev_list); @@ -628,7 +622,7 @@ bool cmCTestGIT::LoadRevisions() CommitParser out(this, "dt-out> "); OutputLogger err(this->Log, "dt-err> "); - this->RunProcess(cp, &out, &err, cmProcessOutput::UTF8); + cmCTestGIT::RunProcess(cp, &out, &err, cmProcessOutput::UTF8); // Send one extra zero-byte to terminate the last record. out.Process("", 1); diff --git a/Source/CTest/cmCTestHG.cxx b/Source/CTest/cmCTestHG.cxx index c3c5da4..9c6a80d 100644 --- a/Source/CTest/cmCTestHG.cxx +++ b/Source/CTest/cmCTestHG.cxx @@ -194,7 +194,8 @@ private: this->CData.clear(); if (name == "logentry") { this->Rev = Revision(); - if (const char* rev = this->FindAttribute(atts, "revision")) { + if (const char* rev = + cmCTestHG::LogParser::FindAttribute(atts, "revision")) { this->Rev.Rev = rev; } this->Changes.clear(); diff --git a/Source/CTest/cmCTestHandlerCommand.cxx b/Source/CTest/cmCTestHandlerCommand.cxx index 667a8ba..c63694d 100644 --- a/Source/CTest/cmCTestHandlerCommand.cxx +++ b/Source/CTest/cmCTestHandlerCommand.cxx @@ -206,18 +206,7 @@ bool cmCTestHandlerCommand::InitialPass(std::vector<std::string> const& args, handler->PopulateCustomVectors(this->Makefile); if (this->Values[ct_SUBMIT_INDEX]) { - if (!this->CTest->GetDropSiteCDash() && - this->CTest->GetDartVersion() <= 1) { - cmCTestLog( - this->CTest, ERROR_MESSAGE, - "Dart before version 2.0 does not support collecting submissions." - << std::endl - << "Please upgrade the server to Dart 2 or higher, or do not use " - "SUBMIT_INDEX." - << std::endl); - } else { - handler->SetSubmitIndex(atoi(this->Values[ct_SUBMIT_INDEX])); - } + handler->SetSubmitIndex(atoi(this->Values[ct_SUBMIT_INDEX])); } cmWorkingDirectory workdir( this->CTest->GetCTestConfiguration("BuildDirectory")); diff --git a/Source/CTest/cmCTestSVN.cxx b/Source/CTest/cmCTestSVN.cxx index 58d9b3d..6c439e9 100644 --- a/Source/CTest/cmCTestSVN.cxx +++ b/Source/CTest/cmCTestSVN.cxx @@ -330,13 +330,15 @@ private: if (name == "logentry") { this->Rev = Revision(); this->Rev.SVNInfo = &SVNRepo; - if (const char* rev = this->FindAttribute(atts, "revision")) { + if (const char* rev = + cmCTestSVN::LogParser::FindAttribute(atts, "revision")) { this->Rev.Rev = rev; } this->Changes.clear(); } else if (name == "path") { this->CurChange = Change(); - if (const char* action = this->FindAttribute(atts, "action")) { + if (const char* action = + cmCTestSVN::LogParser::FindAttribute(atts, "action")) { this->CurChange.Action = action[0]; } } diff --git a/Source/CTest/cmCTestScriptHandler.cxx b/Source/CTest/cmCTestScriptHandler.cxx index a87473d..30192c2 100644 --- a/Source/CTest/cmCTestScriptHandler.cxx +++ b/Source/CTest/cmCTestScriptHandler.cxx @@ -760,8 +760,8 @@ int cmCTestScriptHandler::RunConfigurationDashboard() // put the initial cache into the bin dir if (!this->InitialCache.empty()) { - if (!this->WriteInitialCache(this->BinaryDir.c_str(), - this->InitialCache.c_str())) { + if (!cmCTestScriptHandler::WriteInitialCache(this->BinaryDir.c_str(), + this->InitialCache.c_str())) { this->RestoreBackupDirectories(); return 9; } diff --git a/Source/CTest/cmCTestStartCommand.cxx b/Source/CTest/cmCTestStartCommand.cxx index 47006c1..67ff2db 100644 --- a/Source/CTest/cmCTestStartCommand.cxx +++ b/Source/CTest/cmCTestStartCommand.cxx @@ -146,7 +146,7 @@ bool cmCTestStartCommand::InitialPass(std::vector<std::string> const& args, this->CTest->SetSuppressUpdatingCTestConfiguration(true); int model; if (smodel) { - model = this->CTest->GetTestModelFromString(smodel); + model = cmCTest::GetTestModelFromString(smodel); } else { model = cmCTest::UNKNOWN; } diff --git a/Source/CTest/cmCTestSubmitCommand.cxx b/Source/CTest/cmCTestSubmitCommand.cxx index 34adb4a..43bd636 100644 --- a/Source/CTest/cmCTestSubmitCommand.cxx +++ b/Source/CTest/cmCTestSubmitCommand.cxx @@ -20,11 +20,6 @@ cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler() const char* ctestDropSite = this->Makefile->GetDefinition("CTEST_DROP_SITE"); const char* ctestDropLocation = this->Makefile->GetDefinition("CTEST_DROP_LOCATION"); - const char* ctestTriggerSite = - this->Makefile->GetDefinition("CTEST_TRIGGER_SITE"); - bool ctestDropSiteCDash = this->Makefile->IsOn("CTEST_DROP_SITE_CDASH"); - const char* ctestProjectName = - this->Makefile->GetDefinition("CTEST_PROJECT_NAME"); if (!ctestDropMethod) { ctestDropMethod = "http"; } @@ -37,24 +32,12 @@ cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler() // error: CDash requires CTEST_DROP_LOCATION definition // in CTestConfig.cmake } - this->CTest->SetCTestConfiguration("ProjectName", ctestProjectName, - this->Quiet); this->CTest->SetCTestConfiguration("DropMethod", ctestDropMethod, this->Quiet); this->CTest->SetCTestConfiguration("DropSite", ctestDropSite, this->Quiet); this->CTest->SetCTestConfiguration("DropLocation", ctestDropLocation, this->Quiet); - this->CTest->SetCTestConfiguration( - "IsCDash", ctestDropSiteCDash ? "TRUE" : "FALSE", this->Quiet); - - // Only propagate TriggerSite for non-CDash projects: - // - if (!ctestDropSiteCDash) { - this->CTest->SetCTestConfiguration("TriggerSite", ctestTriggerSite, - this->Quiet); - } - this->CTest->SetCTestConfigurationFromCMakeVariable( this->Makefile, "CurlOptions", "CTEST_CURL_OPTIONS", this->Quiet); this->CTest->SetCTestConfigurationFromCMakeVariable( @@ -62,8 +45,6 @@ cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler() this->CTest->SetCTestConfigurationFromCMakeVariable( this->Makefile, "DropSitePassword", "CTEST_DROP_SITE_PASSWORD", this->Quiet); - this->CTest->SetCTestConfigurationFromCMakeVariable( - this->Makefile, "ScpCommand", "CTEST_SCP_COMMAND", this->Quiet); const char* notesFilesVariable = this->Makefile->GetDefinition("CTEST_NOTES_FILES"); diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx index 98872a5..3042480 100644 --- a/Source/CTest/cmCTestSubmitHandler.cxx +++ b/Source/CTest/cmCTestSubmitHandler.cxx @@ -5,9 +5,7 @@ #include "cm_curl.h" #include "cm_jsoncpp_reader.h" #include "cm_jsoncpp_value.h" -#include "cmsys/Process.h" #include <chrono> -#include <cstring> #include <sstream> #include <stdio.h> #include <stdlib.h> @@ -20,20 +18,11 @@ #include "cmCurl.h" #include "cmDuration.h" #include "cmGeneratedFileStream.h" -#include "cmProcessOutput.h" #include "cmState.h" #include "cmSystemTools.h" -#include "cmThirdParty.h" -#include "cmWorkingDirectory.h" #include "cmXMLParser.h" #include "cmake.h" -#if defined(CTEST_USE_XMLRPC) -# include "cmVersion.h" -# include "cm_sys_stat.h" -# include "cm_xmlrpc.h" -#endif - #define SUBMIT_TIMEOUT_IN_SECONDS_DEFAULT 120 typedef std::vector<char> cmCTestSubmitHandlerVectorOfChar; @@ -130,8 +119,6 @@ static size_t cmCTestSubmitHandlerCurlDebugCallback(CURL* /*unused*/, } cmCTestSubmitHandler::cmCTestSubmitHandler() - : HTTPProxy() - , FTPProxy() { this->Initialize(); } @@ -143,165 +130,16 @@ void cmCTestSubmitHandler::Initialize() p = cmCTest::Part(p + 1)) { this->SubmitPart[p] = true; } - this->CDash = false; this->HasWarnings = false; this->HasErrors = false; this->Superclass::Initialize(); this->HTTPProxy.clear(); this->HTTPProxyType = 0; this->HTTPProxyAuth.clear(); - this->FTPProxy.clear(); - this->FTPProxyType = 0; this->LogFile = nullptr; this->Files.clear(); } -bool cmCTestSubmitHandler::SubmitUsingFTP( - const std::string& localprefix, const std::vector<std::string>& files, - const std::string& remoteprefix, const std::string& url) -{ - CURL* curl; - CURLcode res; - FILE* ftpfile; - char error_buffer[1024]; - - /* In windows, this will init the winsock stuff */ - ::curl_global_init(CURL_GLOBAL_ALL); - - for (std::string const& file : files) { - /* get a curl handle */ - curl = curl_easy_init(); - if (curl) { - // Using proxy - if (this->FTPProxyType > 0) { - curl_easy_setopt(curl, CURLOPT_PROXY, this->FTPProxy.c_str()); - switch (this->FTPProxyType) { - case 2: - curl_easy_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS4); - break; - case 3: - curl_easy_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5); - break; - default: - curl_easy_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_HTTP); - } - } - - // enable uploading - ::curl_easy_setopt(curl, CURLOPT_UPLOAD, 1); - - // if there is little to no activity for too long stop submitting - ::curl_easy_setopt(curl, CURLOPT_LOW_SPEED_LIMIT, 1); - ::curl_easy_setopt(curl, CURLOPT_LOW_SPEED_TIME, - SUBMIT_TIMEOUT_IN_SECONDS_DEFAULT); - - ::curl_easy_setopt(curl, CURLOPT_UPLOAD, 1); - - std::string local_file = file; - if (!cmSystemTools::FileExists(local_file)) { - local_file = localprefix + "/" + file; - } - std::string upload_as = - url + "/" + remoteprefix + cmSystemTools::GetFilenameName(file); - - if (!cmSystemTools::FileExists(local_file)) { - cmCTestLog(this->CTest, ERROR_MESSAGE, - " Cannot find file: " << local_file << std::endl); - ::curl_easy_cleanup(curl); - ::curl_global_cleanup(); - return false; - } - unsigned long filelen = cmSystemTools::FileLength(local_file); - - ftpfile = cmsys::SystemTools::Fopen(local_file, "rb"); - *this->LogFile << "\tUpload file: " << local_file << " to " << upload_as - << std::endl; - cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, - " Upload file: " << local_file << " to " - << upload_as << std::endl, - this->Quiet); - - ::curl_easy_setopt(curl, CURLOPT_VERBOSE, 1); - - // specify target - ::curl_easy_setopt(curl, CURLOPT_URL, upload_as.c_str()); - - // now specify which file to upload - ::curl_easy_setopt(curl, CURLOPT_INFILE, ftpfile); - - // and give the size of the upload (optional) - ::curl_easy_setopt(curl, CURLOPT_INFILESIZE, static_cast<long>(filelen)); - - // and give curl the buffer for errors - ::curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, &error_buffer); - - // specify handler for output - ::curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, - cmCTestSubmitHandlerWriteMemoryCallback); - ::curl_easy_setopt(curl, CURLOPT_DEBUGFUNCTION, - cmCTestSubmitHandlerCurlDebugCallback); - - /* we pass our 'chunk' struct to the callback function */ - cmCTestSubmitHandlerVectorOfChar chunk; - cmCTestSubmitHandlerVectorOfChar chunkDebug; - ::curl_easy_setopt(curl, CURLOPT_FILE, &chunk); - ::curl_easy_setopt(curl, CURLOPT_DEBUGDATA, &chunkDebug); - - // Now run off and do what you've been told! - res = ::curl_easy_perform(curl); - - if (!chunk.empty()) { - cmCTestOptionalLog(this->CTest, DEBUG, - "CURL output: [" - << cmCTestLogWrite(&*chunk.begin(), chunk.size()) - << "]" << std::endl, - this->Quiet); - } - if (!chunkDebug.empty()) { - cmCTestOptionalLog( - this->CTest, DEBUG, - "CURL debug output: [" - << cmCTestLogWrite(&*chunkDebug.begin(), chunkDebug.size()) << "]" - << std::endl, - this->Quiet); - } - - fclose(ftpfile); - if (res) { - cmCTestLog(this->CTest, ERROR_MESSAGE, - " Error when uploading file: " << local_file - << std::endl); - cmCTestLog(this->CTest, ERROR_MESSAGE, - " Error message was: " << error_buffer << std::endl); - *this->LogFile << " Error when uploading file: " << local_file - << std::endl - << " Error message was: " << error_buffer << std::endl - << " Curl output was: "; - // avoid dereference of empty vector - if (!chunk.empty()) { - *this->LogFile << cmCTestLogWrite(&*chunk.begin(), chunk.size()); - cmCTestLog(this->CTest, ERROR_MESSAGE, - "CURL output: [" - << cmCTestLogWrite(&*chunk.begin(), chunk.size()) << "]" - << std::endl); - } - *this->LogFile << std::endl; - ::curl_easy_cleanup(curl); - ::curl_global_cleanup(); - return false; - } - // always cleanup - ::curl_easy_cleanup(curl); - cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, - " Uploaded: " + local_file << std::endl, - this->Quiet); - } - } - ::curl_global_cleanup(); - return true; -} - -// Uploading files is simpler bool cmCTestSubmitHandler::SubmitUsingHTTP( const std::string& localprefix, const std::vector<std::string>& files, const std::string& remoteprefix, const std::string& url) @@ -407,26 +245,7 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP( *this->LogFile << "\tUpload file: " << local_file << " to " << remote_file << std::endl; - std::string ofile; - for (char c : remote_file) { - char hexCh[4] = { 0, 0, 0, 0 }; - hexCh[0] = c; - switch (c) { - case '+': - case '?': - case '/': - case '\\': - case '&': - case ' ': - case '=': - case '%': - sprintf(hexCh, "%%%02X", static_cast<int>(c)); - ofile.append(hexCh); - break; - default: - ofile.append(hexCh); - } - } + std::string ofile = cmSystemTools::EncodeURL(remote_file); std::string upload_as = url + ((url.find('?') == std::string::npos) ? '?' : '&') + "FileName=" + ofile; @@ -676,370 +495,6 @@ void cmCTestSubmitHandler::ParseResponse( } } -bool cmCTestSubmitHandler::TriggerUsingHTTP( - const std::vector<std::string>& files, const std::string& remoteprefix, - const std::string& url) -{ - CURL* curl; - char error_buffer[1024]; - - /* In windows, this will init the winsock stuff */ - ::curl_global_init(CURL_GLOBAL_ALL); - - for (std::string const& file : files) { - /* get a curl handle */ - curl = curl_easy_init(); - if (curl) { - // Using proxy - if (this->HTTPProxyType > 0) { - curl_easy_setopt(curl, CURLOPT_PROXY, this->HTTPProxy.c_str()); - switch (this->HTTPProxyType) { - case 2: - curl_easy_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS4); - break; - case 3: - curl_easy_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5); - break; - default: - curl_easy_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_HTTP); - if (!this->HTTPProxyAuth.empty()) { - curl_easy_setopt(curl, CURLOPT_PROXYUSERPWD, - this->HTTPProxyAuth.c_str()); - } - } - } - - ::curl_easy_setopt(curl, CURLOPT_VERBOSE, 1); - - // and give curl the buffer for errors - ::curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, &error_buffer); - - // specify handler for output - ::curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, - cmCTestSubmitHandlerWriteMemoryCallback); - ::curl_easy_setopt(curl, CURLOPT_DEBUGFUNCTION, - cmCTestSubmitHandlerCurlDebugCallback); - - /* we pass our 'chunk' struct to the callback function */ - cmCTestSubmitHandlerVectorOfChar chunk; - cmCTestSubmitHandlerVectorOfChar chunkDebug; - ::curl_easy_setopt(curl, CURLOPT_FILE, &chunk); - ::curl_easy_setopt(curl, CURLOPT_DEBUGDATA, &chunkDebug); - - std::string rfile = remoteprefix + cmSystemTools::GetFilenameName(file); - std::string ofile; - for (char c : rfile) { - char hexCh[4] = { 0, 0, 0, 0 }; - hexCh[0] = c; - switch (c) { - case '+': - case '?': - case '/': - case '\\': - case '&': - case ' ': - case '=': - case '%': - sprintf(hexCh, "%%%02X", static_cast<int>(c)); - ofile.append(hexCh); - break; - default: - ofile.append(hexCh); - } - } - std::string turl = url + - ((url.find('?') == std::string::npos) ? '?' : '&') + - "xmlfile=" + ofile; - *this->LogFile << "Trigger url: " << turl << std::endl; - cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, - " Trigger url: " << turl << std::endl, this->Quiet); - curl_easy_setopt(curl, CURLOPT_HTTPAUTH, CURLAUTH_ANY); - curl_easy_setopt(curl, CURLOPT_URL, turl.c_str()); - if (curl_easy_perform(curl)) { - cmCTestLog(this->CTest, ERROR_MESSAGE, - " Error when triggering: " << turl << std::endl); - cmCTestLog(this->CTest, ERROR_MESSAGE, - " Error message was: " << error_buffer << std::endl); - *this->LogFile << "\tTriggering failed with error: " << error_buffer - << std::endl - << " Error message was: " << error_buffer - << std::endl; - if (!chunk.empty()) { - *this->LogFile << " Curl output was: " - << cmCTestLogWrite(&*chunk.begin(), chunk.size()) - << std::endl; - cmCTestLog(this->CTest, ERROR_MESSAGE, - "CURL output: [" - << cmCTestLogWrite(&*chunk.begin(), chunk.size()) << "]" - << std::endl); - } - ::curl_easy_cleanup(curl); - ::curl_global_cleanup(); - return false; - } - - if (!chunk.empty()) { - cmCTestOptionalLog(this->CTest, DEBUG, - "CURL output: [" - << cmCTestLogWrite(&*chunk.begin(), chunk.size()) - << "]" << std::endl, - this->Quiet); - } - if (!chunkDebug.empty()) { - cmCTestOptionalLog( - this->CTest, DEBUG, - "CURL debug output: [" - << cmCTestLogWrite(&*chunkDebug.begin(), chunkDebug.size()) << "]" - << std::endl, - this->Quiet); - } - - // always cleanup - ::curl_easy_cleanup(curl); - cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, std::endl, - this->Quiet); - } - } - ::curl_global_cleanup(); - cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, - " Dart server triggered..." << std::endl, this->Quiet); - return true; -} - -bool cmCTestSubmitHandler::SubmitUsingSCP( - const std::string& scp_command, const std::string& localprefix, - const std::vector<std::string>& files, const std::string& remoteprefix, - const std::string& url) -{ - if (scp_command.empty() || localprefix.empty() || files.empty() || - remoteprefix.empty() || url.empty()) { - return false; - } - - std::vector<const char*> argv; - argv.push_back(scp_command.c_str()); // Scp command - argv.push_back(scp_command.c_str()); // Dummy string for file - argv.push_back(scp_command.c_str()); // Dummy string for remote url - argv.push_back(nullptr); - - cmsysProcess* cp = cmsysProcess_New(); - cmsysProcess_SetOption(cp, cmsysProcess_Option_HideWindow, 1); - // cmsysProcess_SetTimeout(cp, timeout); - - int problems = 0; - - for (std::string const& file : files) { - int retVal; - - std::string lfname = localprefix; - cmSystemTools::ConvertToUnixSlashes(lfname); - lfname += "/" + file; - lfname = cmSystemTools::ConvertToOutputPath(lfname); - argv[1] = lfname.c_str(); - std::string rfname = url + "/" + remoteprefix + file; - argv[2] = rfname.c_str(); - cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, - "Execute \"" << argv[0] << "\" \"" << argv[1] << "\" \"" - << argv[2] << "\"" << std::endl, - this->Quiet); - *this->LogFile << "Execute \"" << argv[0] << "\" \"" << argv[1] << "\" \"" - << argv[2] << "\"" << std::endl; - - cmsysProcess_SetCommand(cp, &*argv.begin()); - cmsysProcess_Execute(cp); - char* data; - int length; - cmProcessOutput processOutput; - std::string strdata; - - while (cmsysProcess_WaitForData(cp, &data, &length, nullptr)) { - processOutput.DecodeText(data, length, strdata); - cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, - cmCTestLogWrite(strdata.c_str(), strdata.size()), - this->Quiet); - } - processOutput.DecodeText(std::string(), strdata); - if (!strdata.empty()) { - cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, - cmCTestLogWrite(strdata.c_str(), strdata.size()), - this->Quiet); - } - - cmsysProcess_WaitForExit(cp, nullptr); - - int result = cmsysProcess_GetState(cp); - - if (result == cmsysProcess_State_Exited) { - retVal = cmsysProcess_GetExitValue(cp); - if (retVal != 0) { - cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, - "\tSCP returned: " << retVal << std::endl, - this->Quiet); - *this->LogFile << "\tSCP returned: " << retVal << std::endl; - problems++; - } - } else if (result == cmsysProcess_State_Exception) { - retVal = cmsysProcess_GetExitException(cp); - cmCTestLog(this->CTest, ERROR_MESSAGE, - "\tThere was an exception: " << retVal << std::endl); - *this->LogFile << "\tThere was an exception: " << retVal << std::endl; - problems++; - } else if (result == cmsysProcess_State_Expired) { - cmCTestLog(this->CTest, ERROR_MESSAGE, - "\tThere was a timeout" << std::endl); - *this->LogFile << "\tThere was a timeout" << std::endl; - problems++; - } else if (result == cmsysProcess_State_Error) { - cmCTestLog(this->CTest, ERROR_MESSAGE, - "\tError executing SCP: " << cmsysProcess_GetErrorString(cp) - << std::endl); - *this->LogFile << "\tError executing SCP: " - << cmsysProcess_GetErrorString(cp) << std::endl; - problems++; - } - } - cmsysProcess_Delete(cp); - return problems == 0; -} - -bool cmCTestSubmitHandler::SubmitUsingCP(const std::string& localprefix, - const std::vector<std::string>& files, - const std::string& remoteprefix, - const std::string& destination) -{ - if (localprefix.empty() || files.empty() || remoteprefix.empty() || - destination.empty()) { - /* clang-format off */ - cmCTestLog(this->CTest, ERROR_MESSAGE, - "Missing arguments for submit via cp:\n" - << "\tlocalprefix: " << localprefix << "\n" - << "\tNumber of files: " << files.size() << "\n" - << "\tremoteprefix: " << remoteprefix << "\n" - << "\tdestination: " << destination << std::endl); - /* clang-format on */ - return false; - } - - for (std::string const& file : files) { - std::string lfname = localprefix; - cmSystemTools::ConvertToUnixSlashes(lfname); - lfname += "/" + file; - std::string rfname = destination + "/" + remoteprefix + file; - cmSystemTools::CopyFileAlways(lfname, rfname); - cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, - " Copy file: " << lfname << " to " << rfname - << std::endl, - this->Quiet); - } - std::string tagDoneFile = destination + "/" + remoteprefix + "DONE"; - cmSystemTools::Touch(tagDoneFile, true); - return true; -} - -#if defined(CTEST_USE_XMLRPC) -bool cmCTestSubmitHandler::SubmitUsingXMLRPC( - const std::string& localprefix, const std::vector<std::string>& files, - const std::string& remoteprefix, const std::string& url) -{ - xmlrpc_env env; - char ctestString[] = "CTest"; - std::string ctestVersionString = cmVersion::GetCMakeVersion(); - char* ctestVersion = const_cast<char*>(ctestVersionString.c_str()); - - std::string realURL = url + "/" + remoteprefix + "/Command/"; - - /* Start up our XML-RPC client library. */ - xmlrpc_client_init(XMLRPC_CLIENT_NO_FLAGS, ctestString, ctestVersion); - - /* Initialize our error-handling environment. */ - xmlrpc_env_init(&env); - - /* Call the famous server at UserLand. */ - cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, - " Submitting to: " << realURL << " (" << remoteprefix - << ")" << std::endl, - this->Quiet); - for (std::string const& file : files) { - xmlrpc_value* result; - - std::string local_file = file; - if (!cmSystemTools::FileExists(local_file)) { - local_file = localprefix + "/" + file; - } - cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, - " Submit file: " << local_file << std::endl, - this->Quiet); - struct stat st; - if (::stat(local_file.c_str(), &st)) { - cmCTestLog(this->CTest, ERROR_MESSAGE, - " Cannot find file: " << local_file << std::endl); - return false; - } - - // off_t can be bigger than size_t. fread takes size_t. - // make sure the file is not too big. - if (static_cast<off_t>(static_cast<size_t>(st.st_size)) != - static_cast<off_t>(st.st_size)) { - cmCTestLog(this->CTest, ERROR_MESSAGE, - " File too big: " << local_file << std::endl); - return false; - } - size_t fileSize = static_cast<size_t>(st.st_size); - FILE* fp = cmsys::SystemTools::Fopen(local_file, "rb"); - if (!fp) { - cmCTestLog(this->CTest, ERROR_MESSAGE, - " Cannot open file: " << local_file << std::endl); - return false; - } - - unsigned char* fileBuffer = new unsigned char[fileSize]; - if (fread(fileBuffer, 1, fileSize, fp) != fileSize) { - delete[] fileBuffer; - fclose(fp); - cmCTestLog(this->CTest, ERROR_MESSAGE, - " Cannot read file: " << local_file << std::endl); - return false; - } - fclose(fp); - - char remoteCommand[] = "Submit.put"; - char* pRealURL = const_cast<char*>(realURL.c_str()); - result = - xmlrpc_client_call(&env, pRealURL, remoteCommand, "(6)", fileBuffer, - static_cast<xmlrpc_int32>(fileSize)); - - delete[] fileBuffer; - - if (env.fault_occurred) { - cmCTestLog(this->CTest, ERROR_MESSAGE, - " Submission problem: " << env.fault_string << " (" - << env.fault_code << ")" - << std::endl); - xmlrpc_env_clean(&env); - xmlrpc_client_cleanup(); - return false; - } - - /* Dispose of our result value. */ - xmlrpc_DECREF(result); - } - - /* Clean up our error-handling environment. */ - xmlrpc_env_clean(&env); - - /* Shutdown our XML-RPC client library. */ - xmlrpc_client_cleanup(); - return true; -} -#else -bool cmCTestSubmitHandler::SubmitUsingXMLRPC( - std::string const& /*unused*/, std::vector<std::string> const& /*unused*/, - std::string const& /*unused*/, std::string const& /*unused*/) -{ - return false; -} -#endif - void cmCTestSubmitHandler::ConstructCDashURL(std::string& dropMethod, std::string& url) { @@ -1084,8 +539,12 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file, std::string dropMethod; std::string url; this->ConstructCDashURL(dropMethod, url); - std::string::size_type pos = url.find("submit.php?"); - url = url.substr(0, pos + 10); + std::string fields; + std::string::size_type pos = url.find('?'); + if (pos != std::string::npos) { + fields = url.substr(pos + 1); + url = url.substr(0, pos); + } if (!(dropMethod == "http" || dropMethod == "https")) { cmCTestLog(this->CTest, ERROR_MESSAGE, "Only http and https are supported for CDASH_UPLOAD\n"); @@ -1133,8 +592,6 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file, const char* subproject = cm->GetState()->GetGlobalProperty("SubProject"); // TODO: Encode values for a URL instead of trusting caller. std::ostringstream str; - str << "project=" - << curl.Escape(this->CTest->GetCTestConfiguration("ProjectName")) << "&"; if (subproject) { str << "subproject=" << curl.Escape(subproject) << "&"; } @@ -1152,7 +609,10 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file, << "endtime=" << timeNow << "&" << "datafilesmd5[0]=" << md5sum << "&" << "type=" << curl.Escape(typeString); - std::string fields = str.str(); + if (!fields.empty()) { + fields += '&'; + } + fields += str.str(); cmCTestOptionalLog(this->CTest, DEBUG, "fields: " << fields << "\nurl:" << url << "\nfile: " << file << "\n", @@ -1289,11 +749,6 @@ int cmCTestSubmitHandler::ProcessHandler() if (cdashUploadFile && cdashUploadType) { return this->HandleCDashUploadFile(cdashUploadFile, cdashUploadType); } - std::string iscdash = this->CTest->GetCTestConfiguration("IsCDash"); - // cdash does not need to trigger so just return true - if (!iscdash.empty()) { - this->CDash = true; - } const std::string& buildDirectory = this->CTest->GetCTestConfiguration("BuildDirectory"); @@ -1331,36 +786,11 @@ int cmCTestSubmitHandler::ProcessHandler() } } - if (getenv("FTP_PROXY")) { - this->FTPProxyType = 1; - this->FTPProxy = getenv("FTP_PROXY"); - if (getenv("FTP_PROXY_PORT")) { - this->FTPProxy += ":"; - this->FTPProxy += getenv("FTP_PROXY_PORT"); - } - if (getenv("FTP_PROXY_TYPE")) { - std::string type = getenv("FTP_PROXY_TYPE"); - // HTTP/SOCKS4/SOCKS5 - if (type == "HTTP") { - this->FTPProxyType = 1; - } else if (type == "SOCKS4") { - this->FTPProxyType = 2; - } else if (type == "SOCKS5") { - this->FTPProxyType = 3; - } - } - } - if (!this->HTTPProxy.empty()) { cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, " Use HTTP Proxy: " << this->HTTPProxy << std::endl, this->Quiet); } - if (!this->FTPProxy.empty()) { - cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, - " Use FTP Proxy: " << this->FTPProxy << std::endl, - this->Quiet); - } cmGeneratedFileStream ofs; this->StartLogFile("Submit", ofs); @@ -1457,66 +887,11 @@ int cmCTestSubmitHandler::ProcessHandler() std::string dropMethod(this->CTest->GetCTestConfiguration("DropMethod")); - if (dropMethod.empty() || dropMethod == "ftp") { - ofs << "Using drop method: FTP" << std::endl; - cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, - " Using FTP submit method" << std::endl - << " Drop site: ftp://", - this->Quiet); - std::string url = "ftp://"; - url += cmCTest::MakeURLSafe( - this->CTest->GetCTestConfiguration("DropSiteUser")) + - ":" + - cmCTest::MakeURLSafe( - this->CTest->GetCTestConfiguration("DropSitePassword")) + - "@" + this->CTest->GetCTestConfiguration("DropSite") + - cmCTest::MakeURLSafe(this->CTest->GetCTestConfiguration("DropLocation")); - if (!this->CTest->GetCTestConfiguration("DropSiteUser").empty()) { - cmCTestOptionalLog( - this->CTest, HANDLER_OUTPUT, - this->CTest->GetCTestConfiguration("DropSiteUser").c_str(), - this->Quiet); - if (!this->CTest->GetCTestConfiguration("DropSitePassword").empty()) { - cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, ":******", - this->Quiet); - } - cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, "@", this->Quiet); - } - cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, - this->CTest->GetCTestConfiguration("DropSite") - << this->CTest->GetCTestConfiguration("DropLocation") - << std::endl, - this->Quiet); - if (!this->SubmitUsingFTP(buildDirectory + "/Testing/" + - this->CTest->GetCurrentTag(), - files, prefix, url)) { - cmCTestLog(this->CTest, ERROR_MESSAGE, - " Problems when submitting via FTP" << std::endl); - ofs << " Problems when submitting via FTP" << std::endl; - return -1; - } - if (!this->CDash) { - cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, - " Using HTTP trigger method" - << std::endl - << " Trigger site: " - << this->CTest->GetCTestConfiguration("TriggerSite") - << std::endl, - this->Quiet); - if (!this->TriggerUsingHTTP( - files, prefix, - this->CTest->GetCTestConfiguration("TriggerSite"))) { - cmCTestLog(this->CTest, ERROR_MESSAGE, - " Problems when triggering via HTTP" << std::endl); - ofs << " Problems when triggering via HTTP" << std::endl; - return -1; - } - cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, - " Submission successful" << std::endl, this->Quiet); - ofs << " Submission successful" << std::endl; - return 0; - } - } else if (dropMethod == "http" || dropMethod == "https") { + if (dropMethod.empty()) { + dropMethod = "http"; + } + + if (dropMethod == "http" || dropMethod == "https") { std::string url = dropMethod; url += "://"; ofs << "Using drop method: " << dropMethod << std::endl; @@ -1553,23 +928,6 @@ int cmCTestSubmitHandler::ProcessHandler() ofs << " Problems when submitting via HTTP" << std::endl; return -1; } - if (!this->CDash) { - cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, - " Using HTTP trigger method" - << std::endl - << " Trigger site: " - << this->CTest->GetCTestConfiguration("TriggerSite") - << std::endl, - this->Quiet); - if (!this->TriggerUsingHTTP( - files, prefix, - this->CTest->GetCTestConfiguration("TriggerSite"))) { - cmCTestLog(this->CTest, ERROR_MESSAGE, - " Problems when triggering via HTTP" << std::endl); - ofs << " Problems when triggering via HTTP" << std::endl; - return -1; - } - } if (this->HasErrors) { cmCTestLog(this->CTest, HANDLER_OUTPUT, " Errors occurred during " @@ -1587,95 +945,6 @@ int cmCTestSubmitHandler::ProcessHandler() } return 0; - } else if (dropMethod == "xmlrpc") { -#if defined(CTEST_USE_XMLRPC) - ofs << "Using drop method: XML-RPC" << std::endl; - cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, - " Using XML-RPC submit method" << std::endl, - this->Quiet); - std::string url = this->CTest->GetCTestConfiguration("DropSite"); - prefix = this->CTest->GetCTestConfiguration("DropLocation"); - if (!this->SubmitUsingXMLRPC(buildDirectory + "/Testing/" + - this->CTest->GetCurrentTag(), - files, prefix, url)) { - cmCTestLog(this->CTest, ERROR_MESSAGE, - " Problems when submitting via XML-RPC" << std::endl); - ofs << " Problems when submitting via XML-RPC" << std::endl; - return -1; - } - cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, - " Submission successful" << std::endl, this->Quiet); - ofs << " Submission successful" << std::endl; - return 0; -#else - cmCTestLog(this->CTest, ERROR_MESSAGE, - " Submission method \"xmlrpc\" not compiled into CTest!" - << std::endl); - return -1; -#endif - } else if (dropMethod == "scp") { - std::string url; - if (!this->CTest->GetCTestConfiguration("DropSiteUser").empty()) { - url += this->CTest->GetCTestConfiguration("DropSiteUser") + "@"; - } - url += this->CTest->GetCTestConfiguration("DropSite") + ":" + - this->CTest->GetCTestConfiguration("DropLocation"); - - // change to the build directory so that we can uses a relative path - // on windows since scp doesn't support "c:" a drive in the path - cmWorkingDirectory workdir(buildDirectory); - if (workdir.Failed()) { - cmCTestLog(this->CTest, ERROR_MESSAGE, - " Failed to change directory to " - << buildDirectory << " : " - << std::strerror(workdir.GetLastResult()) << std::endl); - ofs << " Failed to change directory to " << buildDirectory << " : " - << std::strerror(workdir.GetLastResult()) << std::endl; - return -1; - } - - if (!this->SubmitUsingSCP(this->CTest->GetCTestConfiguration("ScpCommand"), - "Testing/" + this->CTest->GetCurrentTag(), files, - prefix, url)) { - cmCTestLog(this->CTest, ERROR_MESSAGE, - " Problems when submitting via SCP" << std::endl); - ofs << " Problems when submitting via SCP" << std::endl; - return -1; - } - cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, - " Submission successful" << std::endl, this->Quiet); - ofs << " Submission successful" << std::endl; - return 0; - } else if (dropMethod == "cp") { - std::string location = this->CTest->GetCTestConfiguration("DropLocation"); - - // change to the build directory so that we can uses a relative path - // on windows since scp doesn't support "c:" a drive in the path - cmWorkingDirectory workdir(buildDirectory); - if (workdir.Failed()) { - cmCTestLog(this->CTest, ERROR_MESSAGE, - " Failed to change directory to " - << buildDirectory << " : " - << std::strerror(workdir.GetLastResult()) << std::endl); - ofs << " Failed to change directory to " << buildDirectory << " : " - << std::strerror(workdir.GetLastResult()) << std::endl; - return -1; - } - cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, - " Change directory: " << buildDirectory << std::endl, - this->Quiet); - - if (!this->SubmitUsingCP("Testing/" + this->CTest->GetCurrentTag(), files, - prefix, location)) { - cmCTestLog(this->CTest, ERROR_MESSAGE, - " Problems when submitting via CP" << std::endl); - ofs << " Problems when submitting via cp" << std::endl; - return -1; - } - cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, - " Submission successful" << std::endl, this->Quiet); - ofs << " Submission successful" << std::endl; - return 0; } cmCTestLog(this->CTest, ERROR_MESSAGE, diff --git a/Source/CTest/cmCTestSubmitHandler.h b/Source/CTest/cmCTestSubmitHandler.h index 66f2173..393e826 100644 --- a/Source/CTest/cmCTestSubmitHandler.h +++ b/Source/CTest/cmCTestSubmitHandler.h @@ -56,30 +56,10 @@ private: /** * Submit file using various ways */ - bool SubmitUsingFTP(const std::string& localprefix, - const std::vector<std::string>& files, - const std::string& remoteprefix, const std::string& url); bool SubmitUsingHTTP(const std::string& localprefix, const std::vector<std::string>& files, const std::string& remoteprefix, const std::string& url); - bool SubmitUsingSCP(const std::string& scp_command, - const std::string& localprefix, - const std::vector<std::string>& files, - const std::string& remoteprefix, const std::string& url); - - bool SubmitUsingCP(const std::string& localprefix, - const std::vector<std::string>& files, - const std::string& remoteprefix, const std::string& url); - - bool TriggerUsingHTTP(const std::vector<std::string>& files, - const std::string& remoteprefix, - const std::string& url); - - bool SubmitUsingXMLRPC(const std::string& localprefix, - const std::vector<std::string>& files, - const std::string& remoteprefix, - const std::string& url); typedef std::vector<char> cmCTestSubmitHandlerVectorOfChar; @@ -92,11 +72,8 @@ private: std::string HTTPProxy; int HTTPProxyType; std::string HTTPProxyAuth; - std::string FTPProxy; - int FTPProxyType; std::ostream* LogFile; bool SubmitPart[cmCTest::PartCount]; - bool CDash; bool HasWarnings; bool HasErrors; cmCTest::SetOfStrings Files; diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index 1d938e6..2e1bb0a 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -3,6 +3,7 @@ #include "cmCTestTestHandler.h" #include <algorithm> #include <chrono> +#include <cmath> #include <cmsys/Base64.h> #include <cmsys/Directory.hxx> #include <cmsys/RegularExpression.hxx> @@ -544,8 +545,7 @@ int cmCTestTestHandler::ProcessHandler() } cmCTestLog(this->CTest, HANDLER_OUTPUT, std::endl - << passColorCode << static_cast<int>(percent + .5f) - << "% tests passed" + << passColorCode << std::lround(percent) << "% tests passed" << this->CTest->GetColorCode(cmCTest::Color::CLEAR_COLOR) << ", " << failedColorCode << failed.size() << " tests failed" << this->CTest->GetColorCode(cmCTest::Color::CLEAR_COLOR) diff --git a/Source/CTest/cmCTestVC.cxx b/Source/CTest/cmCTestVC.cxx index 21c8889..63bd0e6 100644 --- a/Source/CTest/cmCTestVC.cxx +++ b/Source/CTest/cmCTestVC.cxx @@ -79,13 +79,13 @@ bool cmCTestVC::RunChild(char const* const* cmd, OutputParser* out, OutputParser* err, const char* workDir, Encoding encoding) { - this->Log << this->ComputeCommandLine(cmd) << "\n"; + this->Log << cmCTestVC::ComputeCommandLine(cmd) << "\n"; cmsysProcess* cp = cmsysProcess_New(); cmsysProcess_SetCommand(cp, cmd); workDir = workDir ? workDir : this->SourceDirectory.c_str(); cmsysProcess_SetWorkingDirectory(cp, workDir); - this->RunProcess(cp, out, err, encoding); + cmCTestVC::RunProcess(cp, out, err, encoding); int result = cmsysProcess_GetExitValue(cp); cmsysProcess_Delete(cp); return result == 0; diff --git a/Source/CTest/cmProcess.cxx b/Source/CTest/cmProcess.cxx index 39cea87..c4cf046 100644 --- a/Source/CTest/cmProcess.cxx +++ b/Source/CTest/cmProcess.cxx @@ -127,7 +127,8 @@ bool cmProcess::StartProcess(uv_loop_t& loop, std::vector<size_t>* affinity) uv_pipe_open(pipe_writer, fds[1]); uv_stdio_container_t stdio[3]; - stdio[0].flags = UV_IGNORE; + stdio[0].flags = UV_INHERIT_FD; + stdio[0].data.fd = 0; stdio[1].flags = UV_INHERIT_STREAM; stdio[1].data.stream = pipe_writer; stdio[2] = stdio[1]; diff --git a/Source/Checks/cm_cxx_features.cmake b/Source/Checks/cm_cxx_features.cmake index 1b57fd8..d941c16 100644 --- a/Source/Checks/cm_cxx_features.cmake +++ b/Source/Checks/cm_cxx_features.cmake @@ -22,6 +22,8 @@ function(cm_check_cxx_feature name) # Filter out warnings caused by local configuration. string(REGEX REPLACE "[^\n]*warning:[^\n]*directory not found for option[^\n]*" "" check_output "${check_output}") string(REGEX REPLACE "[^\n]*warning:[^\n]*object file compiled with -mlong-branch which is no longer needed[^\n]*" "" check_output "${check_output}") + # Filter out other warnings unrelated to feature checks. + string(REGEX REPLACE "[^\n]*warning:[^\n]*sprintf\\(\\) is often misused, please use snprintf[^\n]*" "" check_output "${check_output}") # Filter out xcodebuild warnings. string(REGEX REPLACE "[^\n]* xcodebuild\\[[0-9]*:[0-9]*\\] warning: [^\n]*" "" check_output "${check_output}") # If using the feature causes warnings, treat it as broken/unavailable. diff --git a/Source/LexerParser/cmFortranLexer.cxx b/Source/LexerParser/cmFortranLexer.cxx index dec0f5e..82048df 100644 --- a/Source/LexerParser/cmFortranLexer.cxx +++ b/Source/LexerParser/cmFortranLexer.cxx @@ -593,13 +593,13 @@ static const YY_CHAR yy_ec[256] = 13, 14, 1, 15, 1, 1, 1, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 17, 18, 19, 20, 21, 22, 1, 23, 24, 25, 26, 27, 28, - 24, 24, 29, 24, 24, 30, 31, 32, 33, 24, - 24, 34, 35, 36, 37, 24, 24, 24, 24, 24, - 1, 38, 1, 1, 39, 1, 23, 40, 41, 42, + 29, 29, 30, 29, 29, 31, 32, 33, 34, 29, + 29, 35, 36, 37, 38, 29, 29, 29, 29, 29, + 1, 39, 1, 1, 40, 1, 23, 24, 41, 42, - 43, 44, 24, 24, 45, 24, 24, 46, 31, 47, - 33, 24, 24, 34, 48, 36, 49, 24, 24, 24, - 24, 24, 1, 1, 1, 1, 1, 1, 1, 1, + 43, 44, 29, 29, 45, 29, 29, 46, 32, 47, + 34, 29, 29, 35, 48, 37, 49, 29, 29, 29, + 29, 29, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -621,7 +621,7 @@ static const YY_CHAR yy_meta[50] = 1, 2, 2, 3, 4, 3, 3, 1, 1, 3, 3, 3, 3, 1, 3, 5, 3, 3, 1, 3, 6, 1, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 1, 5, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 1, 5, 7, 7, 7, 7, 7, 7, 7, 7, 7 } ; @@ -629,28 +629,28 @@ static const flex_int16_t yy_base[219] = { 0, 0, 48, 0, 49, 464, 56, 52, 57, 62, 68, 466, 0, 468, 468, 462, 468, 74, 81, 468, 468, - 468, 468, 447, 468, 442, 440, 0, 41, 42, 428, - 43, 42, 91, 119, 97, 157, 455, 206, 245, 468, - 454, 101, 468, 468, 0, 455, 468, 105, 430, 424, - 62, 68, 119, 141, 468, 468, 468, 111, 0, 59, - 98, 88, 415, 109, 158, 468, 0, 162, 293, 0, - 163, 411, 107, 122, 408, 405, 446, 342, 447, 468, - 0, 444, 169, 173, 420, 421, 132, 404, 90, 404, - 179, 185, 191, 227, 295, 397, 0, 146, 178, 149, - - 412, 0, 208, 206, 398, 171, 399, 170, 399, 391, - 387, 422, 417, 221, 468, 374, 365, 347, 347, 334, - 335, 335, 330, 334, 259, 340, 188, 340, 327, 327, - 327, 324, 325, 325, 320, 322, 319, 355, 354, 325, - 327, 468, 468, 310, 309, 309, 300, 301, 273, 273, - 275, 277, 297, 468, 468, 293, 289, 283, 275, 305, - 261, 238, 237, 214, 468, 468, 468, 196, 197, 189, - 277, 181, 0, 274, 112, 468, 468, 105, 103, 311, - 468, 233, 0, 468, 468, 83, 76, 0, 281, 282, - 468, 468, 52, 468, 468, 468, 468, 23, 287, 298, - - 327, 468, 0, 0, 329, 0, 31, 468, 468, 381, - 388, 394, 397, 404, 411, 418, 425, 432 + 468, 468, 447, 468, 442, 440, 0, 19, 41, 427, + 47, 41, 90, 119, 97, 158, 455, 207, 247, 468, + 454, 101, 468, 468, 0, 455, 468, 105, 430, 423, + 62, 67, 119, 151, 468, 468, 468, 121, 0, 90, + 93, 110, 431, 112, 142, 468, 0, 160, 295, 0, + 162, 411, 123, 102, 408, 405, 446, 344, 447, 468, + 0, 444, 170, 174, 420, 421, 132, 404, 95, 404, + 180, 186, 192, 228, 297, 397, 0, 168, 144, 52, + + 411, 0, 204, 217, 397, 179, 390, 170, 389, 378, + 364, 390, 389, 230, 468, 363, 355, 337, 337, 334, + 335, 335, 330, 334, 187, 339, 267, 339, 327, 327, + 327, 324, 325, 325, 318, 319, 318, 354, 352, 323, + 327, 468, 468, 310, 307, 305, 297, 297, 275, 275, + 277, 279, 287, 468, 468, 286, 283, 273, 196, 307, + 200, 238, 234, 210, 468, 468, 468, 174, 171, 162, + 279, 182, 0, 269, 150, 468, 468, 137, 109, 323, + 468, 239, 0, 468, 468, 72, 71, 0, 283, 283, + 468, 468, 51, 468, 468, 468, 468, 37, 283, 288, + + 330, 468, 0, 0, 331, 0, 52, 468, 468, 384, + 391, 397, 400, 407, 414, 421, 428, 435 } ; static const flex_int16_t yy_def[219] = @@ -685,53 +685,53 @@ static const flex_int16_t yy_nxt[518] = { 0, 12, 13, 14, 13, 13, 15, 16, 12, 17, 18, 19, 20, 21, 12, 22, 12, 23, 24, 12, 25, - 12, 26, 27, 27, 27, 27, 28, 27, 29, 27, - 30, 27, 27, 27, 31, 27, 32, 33, 34, 27, + 12, 26, 27, 27, 27, 27, 28, 27, 27, 29, + 27, 30, 27, 27, 27, 31, 27, 32, 33, 34, 27, 27, 28, 27, 29, 27, 27, 31, 32, 35, - 35, 208, 35, 35, 41, 36, 36, 35, 37, 41, - 35, 42, 43, 36, 41, 202, 42, 43, 44, 38, - 41, 42, 60, 61, 44, 48, 64, 42, 48, 63, - 39, 39, 53, 53, 97, 53, 54, 60, 61, 64, - 55, 63, 65, 66, 201, 65, 39, 39, 68, 49, - - 97, 68, 83, 84, 69, 83, 48, 87, 88, 48, - 50, 89, 95, 100, 90, 95, 51, 198, 52, 45, - 53, 53, 98, 53, 54, 197, 45, 45, 55, 100, - 49, 121, 45, 99, 67, 102, 122, 45, 98, 45, - 45, 50, 92, 53, 193, 92, 93, 51, 192, 52, - 94, 102, 106, 107, 191, 96, 45, 67, 70, 65, - 66, 70, 65, 68, 104, 108, 68, 104, 109, 69, - 83, 84, 71, 83, 114, 125, 118, 114, 71, 119, - 92, 53, 115, 92, 93, 127, 92, 53, 94, 92, - 93, 125, 92, 53, 94, 92, 93, 127, 72, 73, - - 94, 74, 75, 189, 126, 76, 78, 104, 80, 104, - 104, 133, 104, 78, 78, 130, 134, 151, 131, 78, - 126, 78, 114, 103, 78, 114, 78, 78, 92, 53, - 115, 92, 93, 151, 195, 195, 94, 187, 186, 185, - 184, 183, 182, 78, 78, 79, 79, 80, 79, 79, + 35, 60, 35, 35, 41, 36, 36, 35, 37, 41, + 35, 42, 43, 36, 41, 60, 42, 43, 44, 38, + 41, 42, 208, 61, 44, 48, 64, 42, 48, 202, + 39, 39, 53, 53, 63, 53, 54, 61, 64, 127, + 55, 65, 66, 201, 65, 63, 39, 39, 68, 49, + + 127, 68, 83, 84, 69, 83, 48, 87, 88, 48, + 89, 50, 198, 90, 197, 97, 51, 98, 52, 45, + 53, 53, 95, 53, 54, 95, 45, 45, 55, 99, + 49, 97, 45, 98, 67, 100, 121, 45, 102, 45, + 45, 122, 50, 65, 66, 108, 65, 51, 109, 52, + 193, 100, 92, 53, 102, 92, 93, 45, 67, 70, + 94, 68, 70, 104, 68, 96, 104, 69, 106, 107, + 126, 83, 84, 71, 83, 114, 118, 71, 114, 119, + 192, 92, 53, 115, 92, 93, 126, 92, 53, 94, + 92, 93, 191, 92, 53, 94, 92, 93, 125, 72, + + 73, 94, 74, 75, 189, 104, 76, 78, 104, 80, + 187, 133, 186, 125, 78, 78, 134, 185, 104, 103, + 78, 104, 78, 130, 149, 78, 131, 78, 78, 92, + 53, 114, 92, 93, 114, 149, 184, 94, 183, 115, + 195, 195, 182, 181, 179, 78, 78, 79, 79, 80, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, - 81, 79, 79, 79, 79, 79, 79, 81, 81, 81, + 79, 79, 81, 79, 79, 79, 79, 79, 79, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, - 81, 81, 79, 81, 81, 81, 81, 81, 81, 81, - 81, 81, 81, 81, 70, 149, 95, 70, 171, 95, - - 172, 173, 174, 188, 181, 199, 180, 149, 103, 180, - 190, 200, 180, 203, 171, 180, 172, 173, 174, 188, - 103, 199, 190, 179, 204, 178, 103, 200, 205, 203, - 205, 205, 177, 205, 72, 73, 176, 74, 75, 96, - 204, 76, 78, 175, 80, 206, 170, 206, 169, 78, - 78, 168, 167, 166, 165, 78, 164, 78, 163, 162, - 78, 161, 78, 78, 160, 159, 158, 157, 156, 155, - 154, 153, 152, 150, 148, 147, 146, 145, 144, 78, - 78, 40, 40, 40, 40, 40, 40, 40, 45, 143, - 142, 141, 45, 45, 46, 46, 46, 46, 46, 46, - - 46, 59, 140, 59, 79, 79, 79, 79, 79, 79, - 79, 91, 91, 91, 91, 91, 91, 91, 194, 194, - 194, 139, 194, 194, 194, 196, 138, 196, 137, 196, - 196, 196, 207, 207, 207, 207, 207, 136, 207, 135, - 132, 129, 128, 124, 123, 120, 117, 116, 113, 80, + 81, 81, 81, 81, 81, 79, 81, 81, 81, 81, + 81, 81, 81, 81, 81, 81, 70, 151, 95, 70, + + 171, 95, 172, 173, 174, 188, 190, 199, 180, 203, + 103, 180, 151, 200, 204, 178, 171, 190, 172, 173, + 174, 188, 103, 199, 180, 203, 177, 180, 200, 176, + 204, 205, 205, 175, 205, 205, 72, 73, 103, 74, + 75, 96, 170, 76, 78, 169, 80, 168, 206, 206, + 167, 78, 78, 166, 165, 164, 163, 78, 162, 78, + 161, 160, 78, 159, 78, 78, 158, 157, 156, 155, + 154, 153, 152, 150, 148, 147, 146, 145, 144, 143, + 142, 141, 78, 78, 40, 40, 40, 40, 40, 40, + 40, 45, 140, 139, 138, 45, 45, 46, 46, 46, + + 46, 46, 46, 46, 59, 137, 59, 79, 79, 79, + 79, 79, 79, 79, 91, 91, 91, 91, 91, 91, + 91, 194, 194, 194, 136, 194, 194, 194, 196, 135, + 196, 132, 196, 196, 196, 207, 207, 207, 207, 207, + 129, 207, 128, 124, 123, 120, 117, 116, 113, 80, 112, 111, 110, 105, 101, 86, 85, 47, 82, 77, 62, 58, 57, 56, 47, 209, 37, 11, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, @@ -749,50 +749,50 @@ static const flex_int16_t yy_chk[518] = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, - 4, 207, 2, 4, 7, 2, 4, 6, 6, 8, - 6, 7, 7, 6, 9, 198, 8, 8, 9, 6, - 10, 9, 28, 29, 10, 17, 32, 10, 17, 31, - 6, 6, 18, 18, 60, 18, 18, 28, 29, 32, - 18, 31, 33, 33, 193, 33, 6, 6, 35, 17, - - 60, 35, 42, 42, 35, 42, 48, 51, 51, 48, - 17, 52, 58, 62, 52, 58, 17, 187, 17, 34, - 53, 53, 61, 53, 53, 186, 34, 34, 53, 62, - 48, 89, 34, 61, 34, 64, 89, 34, 61, 34, - 34, 48, 54, 54, 179, 54, 54, 48, 178, 48, - 54, 64, 73, 73, 175, 58, 34, 34, 36, 65, - 65, 36, 65, 68, 71, 74, 68, 71, 74, 68, - 83, 83, 36, 83, 84, 98, 87, 84, 71, 87, - 91, 91, 84, 91, 91, 100, 92, 92, 91, 92, - 92, 98, 93, 93, 92, 93, 93, 100, 36, 36, - - 93, 36, 36, 172, 99, 36, 38, 104, 38, 103, - 104, 108, 103, 38, 38, 106, 108, 127, 106, 38, - 99, 38, 114, 103, 38, 114, 38, 38, 94, 94, - 114, 94, 94, 127, 182, 182, 94, 170, 169, 168, - 164, 163, 162, 38, 38, 39, 39, 39, 39, 39, + 4, 28, 2, 4, 7, 2, 4, 6, 6, 8, + 6, 7, 7, 6, 9, 28, 8, 8, 9, 6, + 10, 9, 207, 29, 10, 17, 32, 10, 17, 198, + 6, 6, 18, 18, 31, 18, 18, 29, 32, 100, + 18, 33, 33, 193, 33, 31, 6, 6, 35, 17, + + 100, 35, 42, 42, 35, 42, 48, 51, 51, 48, + 52, 17, 187, 52, 186, 60, 17, 61, 17, 34, + 53, 53, 58, 53, 53, 58, 34, 34, 53, 61, + 48, 60, 34, 61, 34, 62, 89, 34, 64, 34, + 34, 89, 48, 65, 65, 74, 65, 48, 74, 48, + 179, 62, 54, 54, 64, 54, 54, 34, 34, 36, + 54, 68, 36, 71, 68, 58, 71, 68, 73, 73, + 99, 83, 83, 36, 83, 84, 87, 71, 84, 87, + 178, 91, 91, 84, 91, 91, 99, 92, 92, 91, + 92, 92, 175, 93, 93, 92, 93, 93, 98, 36, + + 36, 93, 36, 36, 172, 103, 36, 38, 103, 38, + 170, 108, 169, 98, 38, 38, 108, 168, 104, 103, + 38, 104, 38, 106, 125, 38, 106, 38, 38, 94, + 94, 114, 94, 94, 114, 125, 164, 94, 163, 114, + 182, 182, 162, 161, 159, 38, 38, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 69, 125, 95, 69, 149, 95, - - 150, 151, 152, 171, 161, 189, 160, 125, 69, 160, - 174, 190, 180, 199, 149, 180, 150, 151, 152, 171, - 160, 189, 174, 159, 200, 158, 180, 190, 201, 199, - 205, 201, 157, 205, 69, 69, 156, 69, 69, 95, - 200, 69, 78, 153, 78, 201, 148, 205, 147, 78, - 78, 146, 145, 144, 141, 78, 140, 78, 139, 138, - 78, 137, 78, 78, 136, 135, 134, 133, 132, 131, - 130, 129, 128, 126, 124, 123, 122, 121, 120, 78, - 78, 210, 210, 210, 210, 210, 210, 210, 211, 119, - 118, 117, 211, 211, 212, 212, 212, 212, 212, 212, - - 212, 213, 116, 213, 214, 214, 214, 214, 214, 214, - 214, 215, 215, 215, 215, 215, 215, 215, 216, 216, - 216, 113, 216, 216, 216, 217, 112, 217, 111, 217, - 217, 217, 218, 218, 218, 218, 218, 110, 218, 109, - 107, 105, 101, 96, 90, 88, 86, 85, 82, 79, + 39, 39, 39, 39, 39, 39, 69, 127, 95, 69, + + 149, 95, 150, 151, 152, 171, 174, 189, 160, 199, + 69, 160, 127, 190, 200, 158, 149, 174, 150, 151, + 152, 171, 160, 189, 180, 199, 157, 180, 190, 156, + 200, 201, 205, 153, 201, 205, 69, 69, 180, 69, + 69, 95, 148, 69, 78, 147, 78, 146, 201, 205, + 145, 78, 78, 144, 141, 140, 139, 78, 138, 78, + 137, 136, 78, 135, 78, 78, 134, 133, 132, 131, + 130, 129, 128, 126, 124, 123, 122, 121, 120, 119, + 118, 117, 78, 78, 210, 210, 210, 210, 210, 210, + 210, 211, 116, 113, 112, 211, 211, 212, 212, 212, + + 212, 212, 212, 212, 213, 111, 213, 214, 214, 214, + 214, 214, 214, 214, 215, 215, 215, 215, 215, 215, + 215, 216, 216, 216, 110, 216, 216, 216, 217, 109, + 217, 107, 217, 217, 217, 218, 218, 218, 218, 218, + 105, 218, 101, 96, 90, 88, 86, 85, 82, 79, 77, 76, 75, 72, 63, 50, 49, 46, 41, 37, 30, 26, 25, 23, 15, 11, 5, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, diff --git a/Source/LexerParser/cmFortranLexer.in.l b/Source/LexerParser/cmFortranLexer.in.l index 9acba4c..b7e837b 100644 --- a/Source/LexerParser/cmFortranLexer.in.l +++ b/Source/LexerParser/cmFortranLexer.in.l @@ -146,7 +146,7 @@ $[ \t]*endif { return F90PPR_ENDIF; } [Ii][Nn][Cc][Ll][Uu][Dd][Ee] { return INCLUDE; } [Ii][Nn][Tt][Ee][Rr][Ff][Aa][Cc][Ee] { return INTERFACE; } [Mm][Oo][Dd][Uu][Ll][Ee] { return MODULE; } -[Ss][Uu][bb][Mm][Oo][Dd][Uu][Ll][Ee] { return SUBMODULE; } +[Ss][Uu][Bb][Mm][Oo][Dd][Uu][Ll][Ee] { return SUBMODULE; } [Uu][Ss][Ee] { return USE; } [a-zA-Z_][a-zA-Z_0-9]* { diff --git a/Source/QtDialog/AddCacheEntry.cxx b/Source/QtDialog/AddCacheEntry.cxx index 6284ac9..f5e0777 100644 --- a/Source/QtDialog/AddCacheEntry.cxx +++ b/Source/QtDialog/AddCacheEntry.cxx @@ -21,8 +21,8 @@ AddCacheEntry::AddCacheEntry(QWidget* p, const QStringList& varNames, , VarTypes(varTypes) { this->setupUi(this); - for (int i = 0; i < NumTypes; i++) { - this->Type->addItem(TypeStrings[i]); + for (auto const& elem : TypeStrings) { + this->Type->addItem(elem); } QWidget* cb = new QCheckBox(); QWidget* path = new QCMakePathEditor(); @@ -32,12 +32,12 @@ AddCacheEntry::AddCacheEntry(QWidget* p, const QStringList& varNames, this->StackedWidget->addWidget(path); this->StackedWidget->addWidget(filepath); this->StackedWidget->addWidget(string); - this->setTabOrder(this->Name, this->Type); - this->setTabOrder(this->Type, cb); - this->setTabOrder(cb, path); - this->setTabOrder(path, filepath); - this->setTabOrder(filepath, string); - this->setTabOrder(string, this->Description); + AddCacheEntry::setTabOrder(this->Name, this->Type); + AddCacheEntry::setTabOrder(this->Type, cb); + AddCacheEntry::setTabOrder(cb, path); + AddCacheEntry::setTabOrder(path, filepath); + AddCacheEntry::setTabOrder(filepath, string); + AddCacheEntry::setTabOrder(string, this->Description); QCompleter* completer = new QCompleter(this->VarNames, this); this->Name->setCompleter(completer); connect(completer, SIGNAL(activated(const QString&)), this, diff --git a/Source/QtDialog/CMakeLists.txt b/Source/QtDialog/CMakeLists.txt index 330b747..9ce0323 100644 --- a/Source/QtDialog/CMakeLists.txt +++ b/Source/QtDialog/CMakeLists.txt @@ -19,9 +19,20 @@ if (Qt5Widgets_FOUND) macro(qt4_add_resources) qt5_add_resources(${ARGN}) endmacro() + set(CMake_QT_LIBRARIES ${Qt5Widgets_LIBRARIES}) set(QT_QTMAIN_LIBRARY ${Qt5Core_QTMAIN_LIBRARIES}) + # Try to find the package WinExtras for the task bar progress + if(WIN32) + find_package(Qt5WinExtras QUIET) + if (Qt5WinExtras_FOUND) + include_directories(${Qt5WinExtras_INCLUDE_DIRS}) + add_definitions(-DQT_WINEXTRAS) + list(APPEND CMake_QT_LIBRARIES ${Qt5WinExtras_LIBRARIES}) + endif() + endif() + # Remove this when the minimum version of Qt is 4.6. add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0) diff --git a/Source/QtDialog/CMakeSetup.cxx b/Source/QtDialog/CMakeSetup.cxx index 7b980a0..98cf8b0 100644 --- a/Source/QtDialog/CMakeSetup.cxx +++ b/Source/QtDialog/CMakeSetup.cxx @@ -130,15 +130,15 @@ int main(int argc, char** argv) QTranslator translator; QString transfile = QString("cmake_%1").arg(QLocale::system().name()); translator.load(transfile, translationsDir.path()); - app.installTranslator(&translator); + QApplication::installTranslator(&translator); // app setup - app.setApplicationName("CMakeSetup"); - app.setOrganizationName("Kitware"); + QApplication::setApplicationName("CMakeSetup"); + QApplication::setOrganizationName("Kitware"); QIcon appIcon; appIcon.addFile(":/Icons/CMakeSetup32.png"); appIcon.addFile(":/Icons/CMakeSetup128.png"); - app.setWindowIcon(appIcon); + QApplication::setWindowIcon(appIcon); CMakeSetupDialog dialog; dialog.show(); @@ -159,7 +159,7 @@ int main(int argc, char** argv) dialog.setSourceDirectory(QString::fromLocal8Bit(sourceDirectory.c_str())); dialog.setBinaryDirectory(QString::fromLocal8Bit(binaryDirectory.c_str())); } else { - QStringList args = app.arguments(); + QStringList args = QApplication::arguments(); if (args.count() == 2) { std::string filePath = cmSystemTools::CollapseFullPath(args[1].toLocal8Bit().data()); @@ -189,7 +189,7 @@ int main(int argc, char** argv) } } - return app.exec(); + return QApplication::exec(); } #if defined(Q_OS_MAC) @@ -216,12 +216,11 @@ static bool cmOSXInstall(std::string const& dir, std::string const& tool) if (symlink(tool.c_str(), link.c_str()) == 0) { std::cerr << "Linked: '" << link << "' -> '" << tool << "'\n"; return true; - } else { - int err = errno; - std::cerr << "Failed: '" << link << "' -> '" << tool - << "': " << strerror(err) << "\n"; - return false; } + int err = errno; + std::cerr << "Failed: '" << link << "' -> '" << tool + << "': " << strerror(err) << "\n"; + return false; } static int cmOSXInstall(std::string dir) { diff --git a/Source/QtDialog/CMakeSetupDialog.cxx b/Source/QtDialog/CMakeSetupDialog.cxx index 3761bd3..444a980 100644 --- a/Source/QtDialog/CMakeSetupDialog.cxx +++ b/Source/QtDialog/CMakeSetupDialog.cxx @@ -21,6 +21,11 @@ #include <QToolButton> #include <QUrl> +#ifdef QT_WINEXTRAS +# include <QWinTaskbarButton> +# include <QWinTaskbarProgress> +#endif + #include "AddCacheEntry.h" #include "FirstConfigure.h" #include "QCMake.h" @@ -294,6 +299,12 @@ void CMakeSetupDialog::initialize() } else { this->onBinaryDirectoryChanged(this->BinaryDirectory->lineEdit()->text()); } + +#ifdef QT_WINEXTRAS + this->TaskbarButton = new QWinTaskbarButton(this); + this->TaskbarButton->setWindow(this->windowHandle()); + this->TaskbarButton->setOverlayIcon(QIcon(":/loading.png")); +#endif } CMakeSetupDialog::~CMakeSetupDialog() @@ -381,6 +392,10 @@ void CMakeSetupDialog::doConfigure() this->CacheValues->scrollToTop(); } this->ProgressBar->reset(); + +#ifdef QT_WINEXTRAS + this->TaskbarButton->progress()->reset(); +#endif } bool CMakeSetupDialog::doConfigureInternal() @@ -495,6 +510,9 @@ void CMakeSetupDialog::doGenerate() this->enterState(ReadyConfigure); this->ProgressBar->reset(); +#ifdef QT_WINEXTRAS + this->TaskbarButton->progress()->reset(); +#endif this->ConfigureNeeded = true; } @@ -674,6 +692,12 @@ void CMakeSetupDialog::showProgress(const QString& /*msg*/, float percent) { percent = (percent * ProgressFactor) + ProgressOffset; this->ProgressBar->setValue(qRound(percent * 100)); + +#ifdef QT_WINEXTRAS + QWinTaskbarProgress* progress = this->TaskbarButton->progress(); + progress->setVisible(true); + progress->setValue(qRound(percent * 100)); +#endif } void CMakeSetupDialog::error(const QString& msg) diff --git a/Source/QtDialog/CMakeSetupDialog.h b/Source/QtDialog/CMakeSetupDialog.h index 1cce35c..39c1053 100644 --- a/Source/QtDialog/CMakeSetupDialog.h +++ b/Source/QtDialog/CMakeSetupDialog.h @@ -15,6 +15,10 @@ class CMakeCacheModel; class QProgressBar; class QToolButton; +#ifdef QT_WINEXTRAS +class QWinTaskbarButton; +#endif + /// Qt user interface for CMake class CMakeSetupDialog : public QMainWindow @@ -118,6 +122,10 @@ protected: QEventLoop LocalLoop; +#ifdef QT_WINEXTRAS + QWinTaskbarButton* TaskbarButton; +#endif + float ProgressOffset; float ProgressFactor; }; diff --git a/Source/QtDialog/QCMakeCacheView.cxx b/Source/QtDialog/QCMakeCacheView.cxx index 7d3aa57..821c3f4 100644 --- a/Source/QtDialog/QCMakeCacheView.cxx +++ b/Source/QtDialog/QCMakeCacheView.cxx @@ -248,9 +248,9 @@ void QCMakeCacheModel::setProperties(const QCMakePropertyList& props) } } else if (this->View == GroupView) { QMap<QString, QCMakePropertyList> newPropsTree; - this->breakProperties(newProps, newPropsTree); + QCMakeCacheModel::breakProperties(newProps, newPropsTree); QMap<QString, QCMakePropertyList> newPropsTree2; - this->breakProperties(newProps2, newPropsTree2); + QCMakeCacheModel::breakProperties(newProps2, newPropsTree2); QStandardItem* root = this->invisibleRootItem(); diff --git a/Source/cmArchiveWrite.h b/Source/cmArchiveWrite.h index 6c678ac..6ecdd63 100644 --- a/Source/cmArchiveWrite.h +++ b/Source/cmArchiveWrite.h @@ -40,9 +40,6 @@ private: */ class cmArchiveWrite { - typedef void (cmArchiveWrite::*safe_bool)(); - void safe_bool_true() {} - public: /** Compression type. */ enum Compress @@ -73,10 +70,7 @@ public: bool recursive = true); /** Returns true if there has been no error. */ - operator safe_bool() const - { - return this->Okay() ? &cmArchiveWrite::safe_bool_true : nullptr; - } + explicit operator bool() const { return this->Okay(); } /** Returns true if there has been an error. */ bool operator!() const { return !this->Okay(); } diff --git a/Source/cmCPluginAPI.cxx b/Source/cmCPluginAPI.cxx index 22ae340..065a184 100644 --- a/Source/cmCPluginAPI.cxx +++ b/Source/cmCPluginAPI.cxx @@ -475,11 +475,8 @@ int CCONV cmGetTotalArgumentSize(int argc, char** argv) // API for source files. struct cmCPluginAPISourceFile { - cmCPluginAPISourceFile() - : RealSourceFile(nullptr) - { - } - cmSourceFile* RealSourceFile; + cmCPluginAPISourceFile() {} + cmSourceFile* RealSourceFile = nullptr; std::string SourceName; std::string SourceExtension; std::string FullPath; diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index c2b6575..7c19864 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -292,11 +292,9 @@ cmCTest::cmCTest() this->OutputLogFile = nullptr; this->OutputLogFileLastTag = -1; this->SuppressUpdatingCTestConfiguration = false; - this->DartVersion = 1; - this->DropSiteCDash = false; this->BuildID = ""; this->OutputTestOutputOnTestFailure = false; - this->OutputColorCode = this->ColoredOutputSupportedByConsole(); + this->OutputColorCode = cmCTest::ColoredOutputSupportedByConsole(); this->RepeatTests = 1; // default to run each test once this->RepeatUntilFail = false; @@ -613,8 +611,6 @@ bool cmCTest::InitializeFromCommand(cmCTestStartCommand* command) { std::string src_dir = this->GetCTestConfiguration("SourceDirectory"); std::string bld_dir = this->GetCTestConfiguration("BuildDirectory"); - this->DartVersion = 1; - this->DropSiteCDash = false; this->BuildID = ""; for (Part p = PartStart; p != PartCount; p = Part(p + 1)) { this->Parts[p].SubmitFiles.clear(); @@ -649,16 +645,6 @@ bool cmCTest::InitializeFromCommand(cmCTestStartCommand* command) command->SetError(m); return false; } - } else { - cmCTestOptionalLog(this, WARNING, - "Cannot locate CTest configuration: in BuildDirectory: " - << bld_dir_fname << std::endl, - command->ShouldBeQuiet()); - cmCTestOptionalLog( - this, WARNING, - "Cannot locate CTest configuration: in SourceDirectory: " - << src_dir_fname << std::endl, - command->ShouldBeQuiet()); } this->SetCTestConfigurationFromCMakeVariable(mf, "NightlyStartTime", @@ -668,18 +654,6 @@ bool cmCTest::InitializeFromCommand(cmCTestStartCommand* command) command->ShouldBeQuiet()); this->SetCTestConfigurationFromCMakeVariable( mf, "BuildName", "CTEST_BUILD_NAME", command->ShouldBeQuiet()); - const char* dartVersion = mf->GetDefinition("CTEST_DART_SERVER_VERSION"); - if (dartVersion) { - this->DartVersion = atoi(dartVersion); - if (this->DartVersion < 0) { - cmCTestLog(this, ERROR_MESSAGE, - "Invalid Dart server version: " - << dartVersion << ". Please specify the version number." - << std::endl); - return false; - } - } - this->DropSiteCDash = mf->IsOn("CTEST_DROP_SITE_CDASH"); if (!this->Initialize(bld_dir.c_str(), command)) { return false; diff --git a/Source/cmCTest.h b/Source/cmCTest.h index 427049d..480204a 100644 --- a/Source/cmCTest.h +++ b/Source/cmCTest.h @@ -57,21 +57,18 @@ public: /** Representation of one part. */ struct PartInfo { - PartInfo() - : Enabled(false) - { - } + PartInfo() {} void SetName(const std::string& name) { this->Name = name; } const std::string& GetName() const { return this->Name; } void Enable() { this->Enabled = true; } - operator bool() const { return this->Enabled; } + explicit operator bool() const { return this->Enabled; } std::vector<std::string> SubmitFiles; private: - bool Enabled; + bool Enabled = false; std::string Name; }; #ifdef CMAKE_BUILD_WITH_CMAKE @@ -418,10 +415,6 @@ public: /** Get color code characters for a specific color */ std::string GetColorCode(Color color) const; - /** Get the version of dart server */ - int GetDartVersion() { return this->DartVersion; } - int GetDropSiteCDash() { return this->DropSiteCDash; } - /** The Build ID is assigned by CDash */ void SetBuildID(const std::string& id) { this->BuildID = id; } std::string GetBuildID() { return this->BuildID; } @@ -633,9 +626,6 @@ private: bool ShowLineNumbers; bool Quiet; - int DartVersion; - bool DropSiteCDash; - std::string BuildID; std::vector<std::string> InitialCommandLineArguments; diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx index 0305677..6ccb3a8 100644 --- a/Source/cmCacheManager.cxx +++ b/Source/cmCacheManager.cxx @@ -188,7 +188,7 @@ bool cmCacheManager::ReadPropertyEntry(std::string const& entryKey, } const char* end = entryKey.c_str() + entryKey.size(); - for (const char** p = this->PersistentProperties; *p; ++p) { + for (const char** p = cmCacheManager::PersistentProperties; *p; ++p) { std::string::size_type plen = strlen(*p) + 1; if (entryKey.size() > plen && *(end - plen) == '-' && strcmp(end - plen + 1, *p) == 0) { @@ -212,7 +212,7 @@ bool cmCacheManager::ReadPropertyEntry(std::string const& entryKey, void cmCacheManager::WritePropertyEntries(std::ostream& os, CacheIterator i, cmMessenger* messenger) { - for (const char** p = this->PersistentProperties; *p; ++p) { + for (const char** p = cmCacheManager::PersistentProperties; *p; ++p) { if (const char* value = i.GetProperty(*p)) { std::string helpstring = *p; helpstring += " property for variable: "; @@ -222,9 +222,9 @@ void cmCacheManager::WritePropertyEntries(std::ostream& os, CacheIterator i, std::string key = i.GetName(); key += "-"; key += *p; - this->OutputKey(os, key); + cmCacheManager::OutputKey(os, key); os << ":INTERNAL="; - this->OutputValue(os, value); + cmCacheManager::OutputValue(os, value); os << "\n"; cmCacheManager::OutputNewlineTruncationWarning(os, key, value, messenger); @@ -319,9 +319,9 @@ bool cmCacheManager::SaveCache(const std::string& path, cmMessenger* messenger) } else { cmCacheManager::OutputHelpString(fout, "Missing description"); } - this->OutputKey(fout, i.first); + cmCacheManager::OutputKey(fout, i.first); fout << ":" << cmState::CacheEntryTypeToString(t) << "="; - this->OutputValue(fout, ce.Value); + cmCacheManager::OutputValue(fout, ce.Value); fout << "\n"; cmCacheManager::OutputNewlineTruncationWarning(fout, i.first, ce.Value, messenger); @@ -346,11 +346,11 @@ bool cmCacheManager::SaveCache(const std::string& path, cmMessenger* messenger) if (t == cmStateEnums::INTERNAL) { // Format is key:type=value if (const char* help = i.GetProperty("HELPSTRING")) { - this->OutputHelpString(fout, help); + cmCacheManager::OutputHelpString(fout, help); } - this->OutputKey(fout, i.GetName()); + cmCacheManager::OutputKey(fout, i.GetName()); fout << ":" << cmState::CacheEntryTypeToString(t) << "="; - this->OutputValue(fout, i.GetValue()); + cmCacheManager::OutputValue(fout, i.GetValue()); fout << "\n"; cmCacheManager::OutputNewlineTruncationWarning(fout, i.GetName(), i.GetValue(), messenger); diff --git a/Source/cmCacheManager.h b/Source/cmCacheManager.h index a269271..b39856e 100644 --- a/Source/cmCacheManager.h +++ b/Source/cmCacheManager.h @@ -34,20 +34,15 @@ private: struct CacheEntry { std::string Value; - cmStateEnums::CacheEntryType Type; + cmStateEnums::CacheEntryType Type = cmStateEnums::UNINITIALIZED; cmPropertyMap Properties; std::vector<std::string> GetPropertyList() const; const char* GetProperty(const std::string&) const; void SetProperty(const std::string& property, const char* value); void AppendProperty(const std::string& property, const char* value, bool asString = false); - bool Initialized; - CacheEntry() - : Value("") - , Type(cmStateEnums::UNINITIALIZED) - , Initialized(false) - { - } + bool Initialized = false; + CacheEntry() {} }; public: diff --git a/Source/cmCommand.h b/Source/cmCommand.h index 2cc0b88..dfc3e78 100644 --- a/Source/cmCommand.h +++ b/Source/cmCommand.h @@ -30,10 +30,7 @@ public: /** * Construct the command. By default it has no makefile. */ - cmCommand() - : Makefile(nullptr) - { - } + cmCommand() {} /** * Need virtual destructor to destroy real command type. @@ -90,7 +87,7 @@ public: void SetError(const std::string& e); protected: - cmMakefile* Makefile; + cmMakefile* Makefile = nullptr; private: std::string Error; diff --git a/Source/cmComputeLinkDepends.h b/Source/cmComputeLinkDepends.h index 66fb1e6..32a2a62 100644 --- a/Source/cmComputeLinkDepends.h +++ b/Source/cmComputeLinkDepends.h @@ -35,16 +35,10 @@ public: struct LinkEntry { std::string Item; - cmGeneratorTarget const* Target; - bool IsSharedDep; - bool IsFlag; - LinkEntry() - : Item() - , Target(nullptr) - , IsSharedDep(false) - , IsFlag(false) - { - } + cmGeneratorTarget const* Target = nullptr; + bool IsSharedDep = false; + bool IsFlag = false; + LinkEntry() {} LinkEntry(LinkEntry const& r) : Item(r.Item) , Target(r.Target) diff --git a/Source/cmComputeLinkInformation.h b/Source/cmComputeLinkInformation.h index e00d230..db7eb96 100644 --- a/Source/cmComputeLinkInformation.h +++ b/Source/cmComputeLinkInformation.h @@ -30,12 +30,7 @@ public: struct Item { - Item() - : Value() - , IsPath(true) - , Target(nullptr) - { - } + Item() {} Item(std::string const& v, bool p, cmGeneratorTarget const* target = nullptr) : Value(v) @@ -44,8 +39,8 @@ public: { } std::string Value; - bool IsPath; - cmGeneratorTarget const* Target; + bool IsPath = true; + cmGeneratorTarget const* Target = nullptr; }; typedef std::vector<Item> ItemVector; ItemVector const& GetItems() const; diff --git a/Source/cmConvertMSBuildXMLToJSON.py b/Source/cmConvertMSBuildXMLToJSON.py index 92569e7..02074ba 100644 --- a/Source/cmConvertMSBuildXMLToJSON.py +++ b/Source/cmConvertMSBuildXMLToJSON.py @@ -96,7 +96,6 @@ def read_msbuild_json(path, values=[]): return values - def main(): """Script entrypoint.""" # Parse the arguments @@ -213,6 +212,14 @@ def __find_and_remove_value(list, compare): return found +def __normalize_switch(switch, separator): + new = switch + if switch.startswith("/") or switch.startswith("-"): + new = switch[1:] + if new and separator: + new = new + separator + return new + ########################################################################################### # private xml functions def __convert(root, tag, values, func): @@ -257,6 +264,8 @@ def __convert_bool(node): reverse_switch = __get_attribute(node, 'ReverseSwitch') if reverse_switch: + __with_argument(node, converted) + converted_reverse = copy.deepcopy(converted) converted_reverse['switch'] = reverse_switch @@ -303,7 +312,11 @@ def __convert_node(node, default_value='', default_flags=vsflags()): converted = {} converted['name'] = name - converted['switch'] = __get_attribute(node, 'Switch') + + switch = __get_attribute(node, 'Switch') + separator = __get_attribute(node, 'Separator') + converted['switch'] = __normalize_switch(switch, separator) + converted['comment'] = __get_attribute(node, 'DisplayName') converted['value'] = default_value @@ -435,7 +448,7 @@ def __write_json_file(path, values): with open(path, 'w') as f: json.dump(sorted_values, f, indent=2, separators=(',', ': ')) - + f.write("\n") ########################################################################################### # private list helpers diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx index 0b50121..f9b494e 100644 --- a/Source/cmCoreTryCompile.cxx +++ b/Source/cmCoreTryCompile.cxx @@ -24,10 +24,18 @@ static std::string const kCMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN = "CMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN"; static std::string const kCMAKE_C_COMPILER_TARGET = "CMAKE_C_COMPILER_TARGET"; +static std::string const kCMAKE_C_LINK_NO_PIE_SUPPORTED = + "CMAKE_C_LINK_NO_PIE_SUPPORTED"; +static std::string const kCMAKE_C_LINK_PIE_SUPPORTED = + "CMAKE_C_LINK_PIE_SUPPORTED"; static std::string const kCMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN = "CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN"; static std::string const kCMAKE_CXX_COMPILER_TARGET = "CMAKE_CXX_COMPILER_TARGET"; +static std::string const kCMAKE_CXX_LINK_NO_PIE_SUPPORTED = + "CMAKE_CXX_LINK_NO_PIE_SUPPORTED"; +static std::string const kCMAKE_CXX_LINK_PIE_SUPPORTED = + "CMAKE_CXX_LINK_PIE_SUPPORTED"; static std::string const kCMAKE_ENABLE_EXPORTS = "CMAKE_ENABLE_EXPORTS"; static std::string const kCMAKE_LINK_SEARCH_END_STATIC = "CMAKE_LINK_SEARCH_END_STATIC"; @@ -121,6 +129,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv, std::string cxxExtensions; std::string cudaExtensions; std::vector<std::string> targets; + std::vector<std::string> linkOptions; std::string libsToLink = " "; bool useOldLinkLibs = true; char targetNameBuf[64]; @@ -144,6 +153,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv, DoingNone, DoingCMakeFlags, DoingCompileDefinitions, + DoingLinkOptions, DoingLinkLibraries, DoingOutputVariable, DoingCopyFile, @@ -165,6 +175,8 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv, doing = DoingCMakeFlags; } else if (argv[i] == "COMPILE_DEFINITIONS") { doing = DoingCompileDefinitions; + } else if (argv[i] == "LINK_OPTIONS") { + doing = DoingLinkOptions; } else if (argv[i] == "LINK_LIBRARIES") { doing = DoingLinkLibraries; useOldLinkLibs = false; @@ -208,6 +220,8 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv, cmakeFlags.push_back(argv[i]); } else if (doing == DoingCompileDefinitions) { compileDefs.push_back(argv[i]); + } else if (doing == DoingLinkOptions) { + linkOptions.push_back(argv[i]); } else if (doing == DoingLinkLibraries) { libsToLink += "\"" + cmSystemTools::TrimWhitespace(argv[i]) + "\" "; if (cmTarget* tgt = this->Makefile->FindTargetToUse(argv[i])) { @@ -627,6 +641,16 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv, vars.insert(varList.begin(), varList.end()); } + if (this->Makefile->GetPolicyStatus(cmPolicies::CMP0083) == + cmPolicies::NEW) { + // To ensure full support of PIE, propagate cache variables + // driving the link options + vars.insert(kCMAKE_C_LINK_PIE_SUPPORTED); + vars.insert(kCMAKE_C_LINK_NO_PIE_SUPPORTED); + vars.insert(kCMAKE_CXX_LINK_PIE_SUPPORTED); + vars.insert(kCMAKE_CXX_LINK_NO_PIE_SUPPORTED); + } + /* for the TRY_COMPILEs we want to be able to specify the architecture. So the user can set CMAKE_OSX_ARCHITECTURES to i386;ppc and then set CMAKE_TRY_COMPILE_OSX_ARCHITECTURES first to i386 and then to ppc to @@ -656,6 +680,13 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv, ? "NEW" : "OLD"); + /* Set the appropriate policy information for PIE link flags */ + fprintf(fout, "cmake_policy(SET CMP0083 %s)\n", + this->Makefile->GetPolicyStatus(cmPolicies::CMP0083) == + cmPolicies::NEW + ? "NEW" + : "OLD"); + if (targetType == cmStateEnums::EXECUTABLE) { /* Put the executable at a known location (for COPY_FILE). */ fprintf(fout, "set(CMAKE_RUNTIME_OUTPUT_DIRECTORY \"%s\")\n", @@ -807,6 +838,23 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv, } } + if (!linkOptions.empty()) { + std::vector<std::string> options; + options.reserve(linkOptions.size()); + for (const auto& option : linkOptions) { + options.emplace_back(cmOutputConverter::EscapeForCMake(option)); + } + + if (targetType == cmStateEnums::STATIC_LIBRARY) { + fprintf(fout, + "set_property(TARGET %s PROPERTY STATIC_LIBRARY_OPTIONS %s)\n", + targetName.c_str(), cmJoin(options, " ").c_str()); + } else { + fprintf(fout, "target_link_options(%s PRIVATE %s)\n", + targetName.c_str(), cmJoin(options, " ").c_str()); + } + } + if (useOldLinkLibs) { fprintf(fout, "target_link_libraries(%s ${LINK_LIBRARIES})\n", targetName.c_str()); diff --git a/Source/cmCurl.cxx b/Source/cmCurl.cxx index 3360323..0482898 100644 --- a/Source/cmCurl.cxx +++ b/Source/cmCurl.cxx @@ -2,8 +2,6 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCurl.h" -#include "cmThirdParty.h" - #if !defined(CMAKE_USE_SYSTEM_CURL) && !defined(_WIN32) && \ !defined(__APPLE__) && !defined(CURL_CA_BUNDLE) && !defined(CURL_CA_PATH) # define CMAKE_FIND_CAFILE diff --git a/Source/cmCustomCommand.cxx b/Source/cmCustomCommand.cxx index e87eb1e..9dcec2f 100644 --- a/Source/cmCustomCommand.cxx +++ b/Source/cmCustomCommand.cxx @@ -15,13 +15,9 @@ cmCustomCommand::cmCustomCommand(cmMakefile const* mf, , Byproducts(byproducts) , Depends(depends) , CommandLines(commandLines) - , Backtrace() , Comment(comment ? comment : "") , WorkingDirectory(workingDirectory ? workingDirectory : "") , HaveComment(comment != nullptr) - , EscapeAllowMakeVars(false) - , EscapeOldStyle(true) - , CommandExpandLists(false) { if (mf) { this->Backtrace = mf->GetBacktrace(); diff --git a/Source/cmDefinitions.h b/Source/cmDefinitions.h index 4ab5be6..b2794fa 100644 --- a/Source/cmDefinitions.h +++ b/Source/cmDefinitions.h @@ -47,26 +47,19 @@ private: typedef std::string std_string; public: - Def() - : std_string() - , Exists(false) - , Used(false) - { - } + Def() {} Def(const char* v) : std_string(v ? v : "") , Exists(v ? true : false) - , Used(false) { } Def(const std_string& v) : std_string(v) , Exists(true) - , Used(false) { } - bool Exists; - bool Used; + bool Exists = false; + bool Used = false; }; static Def NoDef; diff --git a/Source/cmDepends.cxx b/Source/cmDepends.cxx index 6f1afd7..2acb015 100644 --- a/Source/cmDepends.cxx +++ b/Source/cmDepends.cxx @@ -15,10 +15,7 @@ cmDepends::cmDepends(cmLocalGenerator* lg, const char* targetDir) : LocalGenerator(lg) - , Verbose(false) - , FileComparison(nullptr) , TargetDirectory(targetDir) - , MaxPath(16384) , Dependee(new char[MaxPath]) , Depender(new char[MaxPath]) { diff --git a/Source/cmDepends.h b/Source/cmDepends.h index 4b9e05a..705d215 100644 --- a/Source/cmDepends.h +++ b/Source/cmDepends.h @@ -96,15 +96,15 @@ protected: cmLocalGenerator* LocalGenerator; // Flag for verbose output. - bool Verbose; - cmFileTimeComparison* FileComparison; + bool Verbose = false; + cmFileTimeComparison* FileComparison = nullptr; std::string Language; // The full path to the target's build directory. std::string TargetDirectory; - size_t MaxPath; + size_t MaxPath = 16384; char* Dependee; char* Depender; diff --git a/Source/cmDependsC.cxx b/Source/cmDependsC.cxx index f7dd33b..072d116 100644 --- a/Source/cmDependsC.cxx +++ b/Source/cmDependsC.cxx @@ -20,7 +20,6 @@ #define INCLUDE_REGEX_TRANSFORM_MARKER "#IncludeRegexTransform: " cmDependsC::cmDependsC() - : ValidDeps(nullptr) { } diff --git a/Source/cmDependsC.h b/Source/cmDependsC.h index 2f76f62..f833888 100644 --- a/Source/cmDependsC.h +++ b/Source/cmDependsC.h @@ -75,16 +75,13 @@ public: struct cmIncludeLines { - cmIncludeLines() - : Used(false) - { - } + cmIncludeLines() {} std::vector<UnscannedEntry> UnscannedEntries; - bool Used; + bool Used = false; }; protected: - const std::map<std::string, DependencyVector>* ValidDeps; + const std::map<std::string, DependencyVector>* ValidDeps = nullptr; std::set<std::string> Encountered; std::queue<UnscannedEntry> Unscanned; diff --git a/Source/cmDependsFortran.cxx b/Source/cmDependsFortran.cxx index a04cee7..e51f81e 100644 --- a/Source/cmDependsFortran.cxx +++ b/Source/cmDependsFortran.cxx @@ -69,7 +69,6 @@ public: }; cmDependsFortran::cmDependsFortran() - : Internal(nullptr) { } @@ -697,9 +696,9 @@ bool cmDependsFortran::ModulesDiffer(const char* modFile, std::string cmDependsFortran::MaybeConvertToRelativePath( std::string const& base, std::string const& path) { - if (!cmOutputConverter::ContainedInDirectory( - base, path, this->LocalGenerator->GetStateSnapshot().GetDirectory())) { + if (!this->LocalGenerator->GetStateSnapshot().GetDirectory().ContainsBoth( + base, path)) { return path; } - return cmOutputConverter::ForceToRelativePath(base, path); + return cmSystemTools::ForceToRelativePath(base, path); } diff --git a/Source/cmDependsFortran.h b/Source/cmDependsFortran.h index bee9804..5d96dd4 100644 --- a/Source/cmDependsFortran.h +++ b/Source/cmDependsFortran.h @@ -76,7 +76,7 @@ protected: std::set<std::string> PPDefinitions; // Internal implementation details. - cmDependsFortranInternals* Internal; + cmDependsFortranInternals* Internal = nullptr; private: std::string MaybeConvertToRelativePath(std::string const& base, diff --git a/Source/cmDocumentation.h b/Source/cmDocumentation.h index c80bed1..153bad6 100644 --- a/Source/cmDocumentation.h +++ b/Source/cmDocumentation.h @@ -116,11 +116,8 @@ private: struct RequestedHelpItem { - RequestedHelpItem() - : HelpType(None) - { - } - cmDocumentationEnums::Type HelpType; + RequestedHelpItem() {} + cmDocumentationEnums::Type HelpType = None; std::string Filename; std::string Argument; }; diff --git a/Source/cmDocumentationFormatter.cxx b/Source/cmDocumentationFormatter.cxx index 2267ef9..678e408 100644 --- a/Source/cmDocumentationFormatter.cxx +++ b/Source/cmDocumentationFormatter.cxx @@ -11,8 +11,6 @@ #include <vector> cmDocumentationFormatter::cmDocumentationFormatter() - : TextWidth(77) - , TextIndent("") { } diff --git a/Source/cmDocumentationFormatter.h b/Source/cmDocumentationFormatter.h index 1f04250..17b63da 100644 --- a/Source/cmDocumentationFormatter.h +++ b/Source/cmDocumentationFormatter.h @@ -59,8 +59,8 @@ public: void SetIndent(const char* indent); private: - int TextWidth; - const char* TextIndent; + int TextWidth = 77; + const char* TextIndent = ""; }; #endif diff --git a/Source/cmELF.cxx b/Source/cmELF.cxx index 0ccd68a..27f9131 100644 --- a/Source/cmELF.cxx +++ b/Source/cmELF.cxx @@ -684,7 +684,7 @@ cmELF::cmELF(const char* fname) std::unique_ptr<cmsys::ifstream> fin(new cmsys::ifstream(fname)); // Quit now if the file could not be opened. - if (!fin.get() || !*fin) { + if (!fin || !*fin) { this->ErrorMessage = "Error opening input file."; return; } diff --git a/Source/cmELF.h b/Source/cmELF.h index 9172f38..c8a91e4 100644 --- a/Source/cmELF.h +++ b/Source/cmELF.h @@ -32,7 +32,7 @@ public: std::string const& GetErrorMessage() const { return this->ErrorMessage; } /** Boolean conversion. True if the ELF file is valid. */ - operator bool() const { return this->Valid(); } + explicit operator bool() const { return this->Valid(); } /** Enumeration of ELF file types. */ enum FileType diff --git a/Source/cmExecutionStatus.h b/Source/cmExecutionStatus.h index ac5fe1d..1946231 100644 --- a/Source/cmExecutionStatus.h +++ b/Source/cmExecutionStatus.h @@ -11,13 +11,7 @@ class cmExecutionStatus { public: - cmExecutionStatus() - : ReturnInvoked(false) - , BreakInvoked(false) - , ContinueInvoked(false) - , NestedError(false) - { - } + cmExecutionStatus() {} void Clear() { @@ -40,10 +34,10 @@ public: bool GetNestedError() const { return this->NestedError; } private: - bool ReturnInvoked; - bool BreakInvoked; - bool ContinueInvoked; - bool NestedError; + bool ReturnInvoked = false; + bool BreakInvoked = false; + bool ContinueInvoked = false; + bool NestedError = false; }; #endif diff --git a/Source/cmExpandedCommandArgument.cxx b/Source/cmExpandedCommandArgument.cxx index 1c0a721..650a5ad 100644 --- a/Source/cmExpandedCommandArgument.cxx +++ b/Source/cmExpandedCommandArgument.cxx @@ -3,7 +3,6 @@ #include "cmExpandedCommandArgument.h" cmExpandedCommandArgument::cmExpandedCommandArgument() - : Quoted(false) { } diff --git a/Source/cmExpandedCommandArgument.h b/Source/cmExpandedCommandArgument.h index 302e8db..d71fc92 100644 --- a/Source/cmExpandedCommandArgument.h +++ b/Source/cmExpandedCommandArgument.h @@ -33,7 +33,7 @@ public: private: std::string Value; - bool Quoted; + bool Quoted = false; }; #endif diff --git a/Source/cmExportCommand.cxx b/Source/cmExportCommand.cxx index f965a29..3706a3c 100644 --- a/Source/cmExportCommand.cxx +++ b/Source/cmExportCommand.cxx @@ -25,9 +25,7 @@ class cmExecutionStatus; #endif cmExportCommand::cmExportCommand() - : cmCommand() - , ArgumentGroup() - , Targets(&Helper, "TARGETS") + : Targets(&Helper, "TARGETS") , Append(&Helper, "APPEND", &ArgumentGroup) , ExportSetName(&Helper, "EXPORT", &ArgumentGroup) , Namespace(&Helper, "NAMESPACE", &ArgumentGroup) diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx index bddc3c4..df27c62 100644 --- a/Source/cmExportFileGenerator.cxx +++ b/Source/cmExportFileGenerator.cxx @@ -79,7 +79,7 @@ bool cmExportFileGenerator::GenerateImportFile() ap->SetCopyIfDifferent(true); foutPtr = std::move(ap); } - if (!foutPtr.get() || !*foutPtr) { + if (!foutPtr || !*foutPtr) { std::string se = cmSystemTools::GetLastSystemError(); std::ostringstream e; e << "cannot write to file \"" << this->MainImportFile << "\": " << se; diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx index e444087..93115b6 100644 --- a/Source/cmExportInstallFileGenerator.cxx +++ b/Source/cmExportInstallFileGenerator.cxx @@ -397,8 +397,8 @@ void cmExportInstallFileGenerator::SetImportLocationProperty( prop += suffix; // Append the installed file name. - value += itgen->GetInstallFilename(target, config, - cmInstallTargetGenerator::NameImplib); + value += cmInstallTargetGenerator::GetInstallFilename( + target, config, cmInstallTargetGenerator::NameImplib); // Store the property. properties[prop] = value; @@ -426,12 +426,12 @@ void cmExportInstallFileGenerator::SetImportLocationProperty( // Append the installed file name. if (target->IsAppBundleOnApple()) { - value += itgen->GetInstallFilename(target, config); + value += cmInstallTargetGenerator::GetInstallFilename(target, config); value += ".app/Contents/MacOS/"; - value += itgen->GetInstallFilename(target, config); + value += cmInstallTargetGenerator::GetInstallFilename(target, config); } else { - value += itgen->GetInstallFilename(target, config, - cmInstallTargetGenerator::NameReal); + value += cmInstallTargetGenerator::GetInstallFilename( + target, config, cmInstallTargetGenerator::NameReal); } // Store the property. diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx index 07a60de..d70352f 100644 --- a/Source/cmExtraCodeBlocksGenerator.cxx +++ b/Source/cmExtraCodeBlocksGenerator.cxx @@ -33,7 +33,6 @@ http://forums.codeblocks.org/index.php/topic,6789.0.html */ cmExtraCodeBlocksGenerator::cmExtraCodeBlocksGenerator() - : cmExternalMakefileProjectGenerator() { } diff --git a/Source/cmExtraCodeLiteGenerator.cxx b/Source/cmExtraCodeLiteGenerator.cxx index 28106d1..bbc90a2 100644 --- a/Source/cmExtraCodeLiteGenerator.cxx +++ b/Source/cmExtraCodeLiteGenerator.cxx @@ -21,9 +21,7 @@ #include <utility> cmExtraCodeLiteGenerator::cmExtraCodeLiteGenerator() - : cmExternalMakefileProjectGenerator() - , ConfigName("NoConfig") - , CpuCount(2) + : ConfigName("NoConfig") { } diff --git a/Source/cmExtraCodeLiteGenerator.h b/Source/cmExtraCodeLiteGenerator.h index 029054f..dea7ebc 100644 --- a/Source/cmExtraCodeLiteGenerator.h +++ b/Source/cmExtraCodeLiteGenerator.h @@ -23,7 +23,7 @@ class cmExtraCodeLiteGenerator : public cmExternalMakefileProjectGenerator protected: std::string ConfigName; std::string WorkspacePath; - unsigned int CpuCount; + unsigned int CpuCount = 2; protected: std::string GetCodeLiteCompilerName(const cmMakefile* mf) const; diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx index 87ee382..e7f3ada 100644 --- a/Source/cmExtraEclipseCDT4Generator.cxx +++ b/Source/cmExtraEclipseCDT4Generator.cxx @@ -41,7 +41,6 @@ void AppendDictionary(cmXMLWriter& xml, const char* key, T const& value) } cmExtraEclipseCDT4Generator::cmExtraEclipseCDT4Generator() - : cmExternalMakefileProjectGenerator() { this->SupportsVirtualFolders = true; this->GenerateLinkedResources = true; @@ -171,9 +170,9 @@ void cmExtraEclipseCDT4Generator::CreateSourceProjectFile() // set up the project name: <project>-Source@<baseSourcePathName> cmLocalGenerator* lg = this->GlobalGenerator->GetLocalGenerators()[0]; - std::string name = - this->GenerateProjectName(lg->GetProjectName(), "Source", - this->GetPathBasename(this->HomeDirectory)); + std::string name = cmExtraEclipseCDT4Generator::GenerateProjectName( + lg->GetProjectName(), "Source", + cmExtraEclipseCDT4Generator::GetPathBasename(this->HomeDirectory)); const std::string filename = this->HomeDirectory + "/.project"; cmGeneratedFileStream fout(filename); @@ -278,10 +277,11 @@ void cmExtraEclipseCDT4Generator::CreateProjectFile() xml.StartElement("projectDescription"); xml.Element("name", - this->GenerateProjectName( + cmExtraEclipseCDT4Generator::GenerateProjectName( lg->GetProjectName(), mf->GetSafeDefinition("CMAKE_BUILD_TYPE"), - this->GetPathBasename(this->HomeOutputDirectory))); + cmExtraEclipseCDT4Generator::GetPathBasename( + this->HomeOutputDirectory))); xml.Element("comment", ""); xml.Element("projects", ""); @@ -302,16 +302,17 @@ void cmExtraEclipseCDT4Generator::CreateProjectFile() // set the make command AppendDictionary(xml, "org.eclipse.cdt.make.core.enabledIncrementalBuild", "true"); - AppendDictionary( - xml, "org.eclipse.cdt.make.core.build.command", - this->GetEclipsePath(mf->GetRequiredDefinition("CMAKE_MAKE_PROGRAM"))); + AppendDictionary(xml, "org.eclipse.cdt.make.core.build.command", + cmExtraEclipseCDT4Generator::GetEclipsePath( + mf->GetRequiredDefinition("CMAKE_MAKE_PROGRAM"))); AppendDictionary(xml, "org.eclipse.cdt.make.core.contents", "org.eclipse.cdt.make.core.activeConfigSettings"); AppendDictionary(xml, "org.eclipse.cdt.make.core.build.target.inc", "all"); AppendDictionary(xml, "org.eclipse.cdt.make.core.build.arguments", mf->GetSafeDefinition("CMAKE_ECLIPSE_MAKE_ARGUMENTS")); - AppendDictionary(xml, "org.eclipse.cdt.make.core.buildLocation", - this->GetEclipsePath(this->HomeOutputDirectory)); + AppendDictionary( + xml, "org.eclipse.cdt.make.core.buildLocation", + cmExtraEclipseCDT4Generator::GetEclipsePath(this->HomeOutputDirectory)); AppendDictionary(xml, "org.eclipse.cdt.make.core.useDefaultBuildCmd", "false"); @@ -341,8 +342,9 @@ void cmExtraEclipseCDT4Generator::CreateProjectFile() "clean"); AppendDictionary(xml, "org.eclipse.cdt.make.core.fullBuildTarget", "all"); AppendDictionary(xml, "org.eclipse.cdt.make.core.buildArguments", ""); - AppendDictionary(xml, "org.eclipse.cdt.make.core.build.location", - this->GetEclipsePath(this->HomeOutputDirectory)); + AppendDictionary( + xml, "org.eclipse.cdt.make.core.build.location", + cmExtraEclipseCDT4Generator::GetEclipsePath(this->HomeOutputDirectory)); AppendDictionary(xml, "org.eclipse.cdt.make.core.autoBuildTarget", "all"); // set error parsers @@ -407,13 +409,15 @@ void cmExtraEclipseCDT4Generator::CreateProjectFile() std::string sourceLinkedResourceName = "[Source directory]"; std::string linkSourceDirectory = - this->GetEclipsePath(lg->GetCurrentSourceDirectory()); + cmExtraEclipseCDT4Generator::GetEclipsePath( + lg->GetCurrentSourceDirectory()); // .project dir can't be subdir of a linked resource dir if (!cmSystemTools::IsSubDirectory(this->HomeOutputDirectory, linkSourceDirectory)) { - this->AppendLinkedResource(xml, sourceLinkedResourceName, - this->GetEclipsePath(linkSourceDirectory), - LinkToFolder); + cmExtraEclipseCDT4Generator::AppendLinkedResource( + xml, sourceLinkedResourceName, + cmExtraEclipseCDT4Generator::GetEclipsePath(linkSourceDirectory), + LinkToFolder); this->SrcLinkedResources.push_back(std::move(sourceLinkedResourceName)); } } @@ -439,8 +443,8 @@ void cmExtraEclipseCDT4Generator::WriteGroups( std::replace(linkName3.begin(), linkName3.end(), '\\', '/'); - this->AppendLinkedResource(xml, linkName3, "virtual:/virtual", - VirtualFolder); + cmExtraEclipseCDT4Generator::AppendLinkedResource( + xml, linkName3, "virtual:/virtual", VirtualFolder); std::vector<cmSourceGroup> const& children = sg.GetGroupChildren(); if (!children.empty()) { this->WriteGroups(children, linkName, xml); @@ -453,8 +457,9 @@ void cmExtraEclipseCDT4Generator::WriteGroups( std::string linkName4 = linkName3; linkName4 += "/"; linkName4 += cmSystemTools::GetFilenameName(fullPath); - this->AppendLinkedResource(xml, linkName4, - this->GetEclipsePath(fullPath), LinkToFile); + cmExtraEclipseCDT4Generator::AppendLinkedResource( + xml, linkName4, + cmExtraEclipseCDT4Generator::GetEclipsePath(fullPath), LinkToFile); } } } @@ -463,7 +468,8 @@ void cmExtraEclipseCDT4Generator::WriteGroups( void cmExtraEclipseCDT4Generator::CreateLinksForTargets(cmXMLWriter& xml) { std::string linkName = "[Targets]"; - this->AppendLinkedResource(xml, linkName, "virtual:/virtual", VirtualFolder); + cmExtraEclipseCDT4Generator::AppendLinkedResource( + xml, linkName, "virtual:/virtual", VirtualFolder); for (cmLocalGenerator* lg : this->GlobalGenerator->GetLocalGenerators()) { cmMakefile* makefile = lg->GetMakefile(); @@ -483,8 +489,8 @@ void cmExtraEclipseCDT4Generator::CreateLinksForTargets(cmXMLWriter& xml) : "[lib] "); linkName2 += prefix; linkName2 += target->GetName(); - this->AppendLinkedResource(xml, linkName2, "virtual:/virtual", - VirtualFolder); + cmExtraEclipseCDT4Generator::AppendLinkedResource( + xml, linkName2, "virtual:/virtual", VirtualFolder); if (!this->GenerateLinkedResources) { break; // skip generating the linked resources to the source files } @@ -522,21 +528,23 @@ void cmExtraEclipseCDT4Generator::CreateLinksToSubprojects( // for each sub project create a linked resource to the source dir // - only if it is an out-of-source build - this->AppendLinkedResource(xml, "[Subprojects]", "virtual:/virtual", - VirtualFolder); + cmExtraEclipseCDT4Generator::AppendLinkedResource( + xml, "[Subprojects]", "virtual:/virtual", VirtualFolder); for (auto const& it : this->GlobalGenerator->GetProjectMap()) { std::string linkSourceDirectory = - this->GetEclipsePath(it.second[0]->GetCurrentSourceDirectory()); + cmExtraEclipseCDT4Generator::GetEclipsePath( + it.second[0]->GetCurrentSourceDirectory()); // a linked resource must not point to a parent directory of .project or // .project itself if ((baseDir != linkSourceDirectory) && !cmSystemTools::IsSubDirectory(baseDir, linkSourceDirectory)) { std::string linkName = "[Subprojects]/"; linkName += it.first; - this->AppendLinkedResource(xml, linkName, - this->GetEclipsePath(linkSourceDirectory), - LinkToFolder); + cmExtraEclipseCDT4Generator::AppendLinkedResource( + xml, linkName, + cmExtraEclipseCDT4Generator::GetEclipsePath(linkSourceDirectory), + LinkToFolder); // Don't add it to the srcLinkedResources, because listing multiple // directories confuses the Eclipse indexer (#13596). } @@ -705,7 +713,7 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const xml.Attribute("path", p); xml.EndElement(); - // exlude source directory from output search path + // exclude source directory from output search path // - only if not named the same as an output directory if (!cmSystemTools::FileIsDirectory( std::string(this->HomeOutputDirectory + "/" + p))) { @@ -903,7 +911,8 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const // Only add the global targets from CMAKE_BINARY_DIR, // not from the subdirs if (subdir.empty()) { - this->AppendTarget(xml, targetName, make, makeArgs, subdir, ": "); + cmExtraEclipseCDT4Generator::AppendTarget(xml, targetName, make, + makeArgs, subdir, ": "); } } break; case cmStateEnums::UTILITY: @@ -918,7 +927,8 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const break; } - this->AppendTarget(xml, targetName, make, makeArgs, subdir, ": "); + cmExtraEclipseCDT4Generator::AppendTarget(xml, targetName, make, + makeArgs, subdir, ": "); break; case cmStateEnums::EXECUTABLE: case cmStateEnums::STATIC_LIBRARY: @@ -928,10 +938,12 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const const char* prefix = (target->GetType() == cmStateEnums::EXECUTABLE ? "[exe] " : "[lib] "); - this->AppendTarget(xml, targetName, make, makeArgs, subdir, prefix); + cmExtraEclipseCDT4Generator::AppendTarget(xml, targetName, make, + makeArgs, subdir, prefix); std::string fastTarget = targetName; fastTarget += "/fast"; - this->AppendTarget(xml, fastTarget, make, makeArgs, subdir, prefix); + cmExtraEclipseCDT4Generator::AppendTarget(xml, fastTarget, make, + makeArgs, subdir, prefix); // Add Build and Clean targets in the virtual folder of targets: if (this->SupportsVirtualFolders) { @@ -942,8 +954,8 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const buildArgs += lgen->GetBinaryDirectory(); buildArgs += "\" "; buildArgs += makeArgs; - this->AppendTarget(xml, "Build", make, buildArgs, virtDir, "", - targetName.c_str()); + cmExtraEclipseCDT4Generator::AppendTarget( + xml, "Build", make, buildArgs, virtDir, "", targetName.c_str()); std::string cleanArgs = "-E chdir \""; cleanArgs += lgen->GetCurrentBinaryDirectory(); @@ -953,8 +965,9 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const cmGeneratorTarget* gt = target; cleanArgs += lgen->GetTargetDirectory(gt); cleanArgs += "/cmake_clean.cmake\""; - this->AppendTarget(xml, "Clean", cmSystemTools::GetCMakeCommand(), - cleanArgs, virtDir, "", ""); + cmExtraEclipseCDT4Generator::AppendTarget( + xml, "Clean", cmSystemTools::GetCMakeCommand(), cleanArgs, + virtDir, "", ""); } } break; default: @@ -964,10 +977,12 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const // insert the all and clean targets in every subdir if (!allTarget.empty()) { - this->AppendTarget(xml, allTarget, make, makeArgs, subdir, ": "); + cmExtraEclipseCDT4Generator::AppendTarget(xml, allTarget, make, makeArgs, + subdir, ": "); } if (!cleanTarget.empty()) { - this->AppendTarget(xml, cleanTarget, make, makeArgs, subdir, ": "); + cmExtraEclipseCDT4Generator::AppendTarget(xml, cleanTarget, make, + makeArgs, subdir, ": "); } // insert rules for compiling, preprocessing and assembling individual @@ -981,14 +996,15 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const } else if (f.back() == 'i') { prefix = "[pre] "; } - this->AppendTarget(xml, f, make, makeArgs, subdir, prefix); + cmExtraEclipseCDT4Generator::AppendTarget(xml, f, make, makeArgs, subdir, + prefix); } } xml.EndElement(); // buildTargets xml.EndElement(); // storageModule - this->AppendStorageScanners(xml, *mf); + cmExtraEclipseCDT4Generator::AppendStorageScanners(xml, *mf); xml.EndElement(); // cconfiguration xml.EndElement(); // storageModule diff --git a/Source/cmExtraKateGenerator.cxx b/Source/cmExtraKateGenerator.cxx index 9410690..a9ed7fe 100644 --- a/Source/cmExtraKateGenerator.cxx +++ b/Source/cmExtraKateGenerator.cxx @@ -17,7 +17,6 @@ #include <vector> cmExtraKateGenerator::cmExtraKateGenerator() - : cmExternalMakefileProjectGenerator() { } diff --git a/Source/cmExtraSublimeTextGenerator.cxx b/Source/cmExtraSublimeTextGenerator.cxx index 882d39f..0a1886a 100644 --- a/Source/cmExtraSublimeTextGenerator.cxx +++ b/Source/cmExtraSublimeTextGenerator.cxx @@ -55,7 +55,6 @@ cmExtraSublimeTextGenerator::GetFactory() } cmExtraSublimeTextGenerator::cmExtraSublimeTextGenerator() - : cmExternalMakefileProjectGenerator() { this->ExcludeBuildFolder = false; } diff --git a/Source/cmFileAPI.cxx b/Source/cmFileAPI.cxx new file mode 100644 index 0000000..89bd258 --- /dev/null +++ b/Source/cmFileAPI.cxx @@ -0,0 +1,800 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ +#include "cmFileAPI.h" + +#include "cmAlgorithms.h" +#include "cmCryptoHash.h" +#include "cmFileAPICMakeFiles.h" +#include "cmFileAPICache.h" +#include "cmFileAPICodemodel.h" +#include "cmGlobalGenerator.h" +#include "cmSystemTools.h" +#include "cmTimestamp.h" +#include "cmake.h" +#include "cmsys/Directory.hxx" +#include "cmsys/FStream.hxx" + +#include <algorithm> +#include <cassert> +#include <chrono> +#include <ctime> +#include <iomanip> +#include <sstream> +#include <utility> + +cmFileAPI::cmFileAPI(cmake* cm) + : CMakeInstance(cm) +{ + this->APIv1 = + this->CMakeInstance->GetHomeOutputDirectory() + "/.cmake/api/v1"; + + Json::CharReaderBuilder rbuilder; + rbuilder["collectComments"] = false; + rbuilder["failIfExtra"] = true; + rbuilder["rejectDupKeys"] = false; + rbuilder["strictRoot"] = true; + this->JsonReader = + std::unique_ptr<Json::CharReader>(rbuilder.newCharReader()); + + Json::StreamWriterBuilder wbuilder; + wbuilder["indentation"] = "\t"; + this->JsonWriter = + std::unique_ptr<Json::StreamWriter>(wbuilder.newStreamWriter()); +} + +void cmFileAPI::ReadQueries() +{ + std::string const query_dir = this->APIv1 + "/query"; + this->QueryExists = cmSystemTools::FileIsDirectory(query_dir); + if (!this->QueryExists) { + return; + } + + // Load queries at the top level. + std::vector<std::string> queries = cmFileAPI::LoadDir(query_dir); + + // Read the queries and save for later. + for (std::string& query : queries) { + if (cmHasLiteralPrefix(query, "client-")) { + this->ReadClient(query); + } else if (!cmFileAPI::ReadQuery(query, this->TopQuery.Known)) { + this->TopQuery.Unknown.push_back(std::move(query)); + } + } +} + +void cmFileAPI::WriteReplies() +{ + if (this->QueryExists) { + cmSystemTools::MakeDirectory(this->APIv1 + "/reply"); + this->WriteJsonFile(this->BuildReplyIndex(), "index", ComputeSuffixTime); + } + + this->RemoveOldReplyFiles(); +} + +std::vector<std::string> cmFileAPI::LoadDir(std::string const& dir) +{ + std::vector<std::string> files; + cmsys::Directory d; + d.Load(dir); + for (unsigned long i = 0; i < d.GetNumberOfFiles(); ++i) { + std::string f = d.GetFile(i); + if (f != "." && f != "..") { + files.push_back(std::move(f)); + } + } + std::sort(files.begin(), files.end()); + return files; +} + +void cmFileAPI::RemoveOldReplyFiles() +{ + std::string const reply_dir = this->APIv1 + "/reply"; + std::vector<std::string> files = this->LoadDir(reply_dir); + for (std::string const& f : files) { + if (this->ReplyFiles.find(f) == this->ReplyFiles.end()) { + std::string file = reply_dir + "/" + f; + cmSystemTools::RemoveFile(file); + } + } +} + +bool cmFileAPI::ReadJsonFile(std::string const& file, Json::Value& value, + std::string& error) +{ + std::vector<char> content; + + cmsys::ifstream fin; + if (!cmSystemTools::FileIsDirectory(file)) { + fin.open(file.c_str(), std::ios::binary); + } + auto finEnd = fin.rdbuf()->pubseekoff(0, std::ios::end); + if (finEnd > 0) { + size_t finSize = finEnd; + try { + // Allocate a buffer to read the whole file. + content.resize(finSize); + + // Now read the file from the beginning. + fin.seekg(0, std::ios::beg); + fin.read(content.data(), finSize); + } catch (...) { + fin.setstate(std::ios::failbit); + } + } + fin.close(); + if (!fin) { + value = Json::Value(); + error = "failed to read from file"; + return false; + } + + // Parse our buffer as json. + if (!this->JsonReader->parse(content.data(), content.data() + content.size(), + &value, &error)) { + value = Json::Value(); + return false; + } + + return true; +} + +std::string cmFileAPI::WriteJsonFile( + Json::Value const& value, std::string const& prefix, + std::string (*computeSuffix)(std::string const&)) +{ + std::string fileName; + + // Write the json file with a temporary name. + std::string const& tmpFile = this->APIv1 + "/tmp.json"; + cmsys::ofstream ftmp(tmpFile.c_str()); + this->JsonWriter->write(value, &ftmp); + ftmp << "\n"; + ftmp.close(); + if (!ftmp) { + cmSystemTools::RemoveFile(tmpFile); + return fileName; + } + + // Compute the final name for the file. + fileName = prefix + "-" + computeSuffix(tmpFile) + ".json"; + + // Create the destination. + std::string file = this->APIv1 + "/reply"; + cmSystemTools::MakeDirectory(file); + file += "/"; + file += fileName; + + // If the final name already exists then assume it has proper content. + // Otherwise, atomically place the reply file at its final name + if (cmSystemTools::FileExists(file, true) || + !cmSystemTools::RenameFile(tmpFile.c_str(), file.c_str())) { + cmSystemTools::RemoveFile(tmpFile); + } + + // Record this among files we have just written. + this->ReplyFiles.insert(fileName); + + return fileName; +} + +Json::Value cmFileAPI::MaybeJsonFile(Json::Value in, std::string const& prefix) +{ + Json::Value out; + if (in.isObject() || in.isArray()) { + out = Json::objectValue; + out["jsonFile"] = this->WriteJsonFile(in, prefix); + } else { + out = std::move(in); + } + return out; +} + +std::string cmFileAPI::ComputeSuffixHash(std::string const& file) +{ + cmCryptoHash hasher(cmCryptoHash::AlgoSHA3_256); + std::string hash = hasher.HashFile(file); + hash.resize(20, '0'); + return hash; +} + +std::string cmFileAPI::ComputeSuffixTime(std::string const&) +{ + std::chrono::milliseconds ms = + std::chrono::duration_cast<std::chrono::milliseconds>( + std::chrono::system_clock::now().time_since_epoch()); + std::chrono::seconds s = + std::chrono::duration_cast<std::chrono::seconds>(ms); + + std::time_t ts = s.count(); + std::size_t tms = ms.count() % 1000; + + cmTimestamp cmts; + std::ostringstream ss; + ss << cmts.CreateTimestampFromTimeT(ts, "%Y-%m-%dT%H-%M-%S", true) << '-' + << std::setfill('0') << std::setw(4) << tms; + return ss.str(); +} + +bool cmFileAPI::ReadQuery(std::string const& query, + std::vector<Object>& objects) +{ + // Parse the "<kind>-" syntax. + std::string::size_type sep_pos = query.find('-'); + if (sep_pos == std::string::npos) { + return false; + } + std::string kindName = query.substr(0, sep_pos); + std::string verStr = query.substr(sep_pos + 1); + if (kindName == ObjectKindName(ObjectKind::CodeModel)) { + Object o; + o.Kind = ObjectKind::CodeModel; + if (verStr == "v2") { + o.Version = 2; + } else { + return false; + } + objects.push_back(o); + return true; + } + if (kindName == ObjectKindName(ObjectKind::Cache)) { + Object o; + o.Kind = ObjectKind::Cache; + if (verStr == "v2") { + o.Version = 2; + } else { + return false; + } + objects.push_back(o); + return true; + } + if (kindName == ObjectKindName(ObjectKind::CMakeFiles)) { + Object o; + o.Kind = ObjectKind::CMakeFiles; + if (verStr == "v1") { + o.Version = 1; + } else { + return false; + } + objects.push_back(o); + return true; + } + if (kindName == ObjectKindName(ObjectKind::InternalTest)) { + Object o; + o.Kind = ObjectKind::InternalTest; + if (verStr == "v1") { + o.Version = 1; + } else if (verStr == "v2") { + o.Version = 2; + } else { + return false; + } + objects.push_back(o); + return true; + } + return false; +} + +void cmFileAPI::ReadClient(std::string const& client) +{ + // Load queries for the client. + std::string clientDir = this->APIv1 + "/query/" + client; + std::vector<std::string> queries = this->LoadDir(clientDir); + + // Read the queries and save for later. + ClientQuery& clientQuery = this->ClientQueries[client]; + for (std::string& query : queries) { + if (query == "query.json") { + clientQuery.HaveQueryJson = true; + this->ReadClientQuery(client, clientQuery.QueryJson); + } else if (!this->ReadQuery(query, clientQuery.DirQuery.Known)) { + clientQuery.DirQuery.Unknown.push_back(std::move(query)); + } + } +} + +void cmFileAPI::ReadClientQuery(std::string const& client, ClientQueryJson& q) +{ + // Read the query.json file. + std::string queryFile = this->APIv1 + "/query/" + client + "/query.json"; + Json::Value query; + if (!this->ReadJsonFile(queryFile, query, q.Error)) { + return; + } + if (!query.isObject()) { + q.Error = "query root is not an object"; + return; + } + + Json::Value const& clientValue = query["client"]; + if (!clientValue.isNull()) { + q.ClientValue = clientValue; + } + q.RequestsValue = std::move(query["requests"]); + q.Requests = this->BuildClientRequests(q.RequestsValue); +} + +Json::Value cmFileAPI::BuildReplyIndex() +{ + Json::Value index(Json::objectValue); + + // Report information about this version of CMake. + index["cmake"] = this->BuildCMake(); + + // Reply to all queries that we loaded. + Json::Value& reply = index["reply"] = this->BuildReply(this->TopQuery); + for (auto const& client : this->ClientQueries) { + std::string const& clientName = client.first; + ClientQuery const& clientQuery = client.second; + reply[clientName] = this->BuildClientReply(clientQuery); + } + + // Move our index of generated objects into its field. + Json::Value& objects = index["objects"] = Json::arrayValue; + for (auto& entry : this->ReplyIndexObjects) { + objects.append(std::move(entry.second)); // NOLINT(*) + } + + return index; +} + +Json::Value cmFileAPI::BuildCMake() +{ + Json::Value cmake = Json::objectValue; + cmake["version"] = this->CMakeInstance->ReportVersionJson(); + Json::Value& cmake_paths = cmake["paths"] = Json::objectValue; + cmake_paths["cmake"] = cmSystemTools::GetCMakeCommand(); + cmake_paths["ctest"] = cmSystemTools::GetCTestCommand(); + cmake_paths["cpack"] = cmSystemTools::GetCPackCommand(); + cmake_paths["root"] = cmSystemTools::GetCMakeRoot(); + cmake["generator"] = this->CMakeInstance->GetGlobalGenerator()->GetJson(); + return cmake; +} + +Json::Value cmFileAPI::BuildReply(Query const& q) +{ + Json::Value reply = Json::objectValue; + for (Object const& o : q.Known) { + std::string const& name = ObjectName(o); + reply[name] = this->AddReplyIndexObject(o); + } + + for (std::string const& name : q.Unknown) { + reply[name] = cmFileAPI::BuildReplyError("unknown query file"); + } + return reply; +} + +Json::Value cmFileAPI::BuildReplyError(std::string const& error) +{ + Json::Value e = Json::objectValue; + e["error"] = error; + return e; +} + +Json::Value const& cmFileAPI::AddReplyIndexObject(Object const& o) +{ + Json::Value& indexEntry = this->ReplyIndexObjects[o]; + if (!indexEntry.isNull()) { + // The reply object has already been generated. + return indexEntry; + } + + // Generate this reply object. + Json::Value const& object = this->BuildObject(o); + assert(object.isObject()); + + // Populate this index entry. + indexEntry = Json::objectValue; + indexEntry["kind"] = object["kind"]; + indexEntry["version"] = object["version"]; + indexEntry["jsonFile"] = this->WriteJsonFile(object, ObjectName(o)); + return indexEntry; +} + +const char* cmFileAPI::ObjectKindName(ObjectKind kind) +{ + // Keep in sync with ObjectKind enum. + static const char* objectKindNames[] = { + "codemodel", // + "cache", // + "cmakeFiles", // + "__test" // + }; + return objectKindNames[size_t(kind)]; +} + +std::string cmFileAPI::ObjectName(Object const& o) +{ + std::string name = ObjectKindName(o.Kind); + name += "-v"; + name += std::to_string(o.Version); + return name; +} + +Json::Value cmFileAPI::BuildObject(Object const& object) +{ + Json::Value value; + + switch (object.Kind) { + case ObjectKind::CodeModel: + value = this->BuildCodeModel(object); + break; + case ObjectKind::Cache: + value = this->BuildCache(object); + break; + case ObjectKind::CMakeFiles: + value = this->BuildCMakeFiles(object); + break; + case ObjectKind::InternalTest: + value = this->BuildInternalTest(object); + break; + } + + return value; +} + +cmFileAPI::ClientRequests cmFileAPI::BuildClientRequests( + Json::Value const& requests) +{ + ClientRequests result; + if (requests.isNull()) { + result.Error = "'requests' member missing"; + return result; + } + if (!requests.isArray()) { + result.Error = "'requests' member is not an array"; + return result; + } + + result.reserve(requests.size()); + for (Json::Value const& request : requests) { + result.emplace_back(this->BuildClientRequest(request)); + } + + return result; +} + +cmFileAPI::ClientRequest cmFileAPI::BuildClientRequest( + Json::Value const& request) +{ + ClientRequest r; + + if (!request.isObject()) { + r.Error = "request is not an object"; + return r; + } + + Json::Value const& kind = request["kind"]; + if (kind.isNull()) { + r.Error = "'kind' member missing"; + return r; + } + if (!kind.isString()) { + r.Error = "'kind' member is not a string"; + return r; + } + std::string const& kindName = kind.asString(); + + if (kindName == this->ObjectKindName(ObjectKind::CodeModel)) { + r.Kind = ObjectKind::CodeModel; + } else if (kindName == this->ObjectKindName(ObjectKind::Cache)) { + r.Kind = ObjectKind::Cache; + } else if (kindName == this->ObjectKindName(ObjectKind::CMakeFiles)) { + r.Kind = ObjectKind::CMakeFiles; + } else if (kindName == this->ObjectKindName(ObjectKind::InternalTest)) { + r.Kind = ObjectKind::InternalTest; + } else { + r.Error = "unknown request kind '" + kindName + "'"; + return r; + } + + Json::Value const& version = request["version"]; + if (version.isNull()) { + r.Error = "'version' member missing"; + return r; + } + std::vector<RequestVersion> versions; + if (!cmFileAPI::ReadRequestVersions(version, versions, r.Error)) { + return r; + } + + switch (r.Kind) { + case ObjectKind::CodeModel: + this->BuildClientRequestCodeModel(r, versions); + break; + case ObjectKind::Cache: + this->BuildClientRequestCache(r, versions); + break; + case ObjectKind::CMakeFiles: + this->BuildClientRequestCMakeFiles(r, versions); + break; + case ObjectKind::InternalTest: + this->BuildClientRequestInternalTest(r, versions); + break; + } + + return r; +} + +Json::Value cmFileAPI::BuildClientReply(ClientQuery const& q) +{ + Json::Value reply = this->BuildReply(q.DirQuery); + + if (!q.HaveQueryJson) { + return reply; + } + + Json::Value& reply_query_json = reply["query.json"]; + ClientQueryJson const& qj = q.QueryJson; + + if (!qj.Error.empty()) { + reply_query_json = this->BuildReplyError(qj.Error); + return reply; + } + + if (!qj.ClientValue.isNull()) { + reply_query_json["client"] = qj.ClientValue; + } + + if (!qj.RequestsValue.isNull()) { + reply_query_json["requests"] = qj.RequestsValue; + } + + reply_query_json["responses"] = this->BuildClientReplyResponses(qj.Requests); + + return reply; +} + +Json::Value cmFileAPI::BuildClientReplyResponses( + ClientRequests const& requests) +{ + Json::Value responses; + + if (!requests.Error.empty()) { + responses = this->BuildReplyError(requests.Error); + return responses; + } + + responses = Json::arrayValue; + for (ClientRequest const& request : requests) { + responses.append(this->BuildClientReplyResponse(request)); + } + + return responses; +} + +Json::Value cmFileAPI::BuildClientReplyResponse(ClientRequest const& request) +{ + Json::Value response; + if (!request.Error.empty()) { + response = this->BuildReplyError(request.Error); + return response; + } + response = this->AddReplyIndexObject(request); + return response; +} + +bool cmFileAPI::ReadRequestVersions(Json::Value const& version, + std::vector<RequestVersion>& versions, + std::string& error) +{ + if (version.isArray()) { + for (Json::Value const& v : version) { + if (!ReadRequestVersion(v, /*inArray=*/true, versions, error)) { + return false; + } + } + } else { + if (!ReadRequestVersion(version, /*inArray=*/false, versions, error)) { + return false; + } + } + return true; +} + +bool cmFileAPI::ReadRequestVersion(Json::Value const& version, bool inArray, + std::vector<RequestVersion>& result, + std::string& error) +{ + if (version.isUInt()) { + RequestVersion v; + v.Major = version.asUInt(); + result.push_back(v); + return true; + } + + if (!version.isObject()) { + if (inArray) { + error = "'version' array entry is not a non-negative integer or object"; + } else { + error = + "'version' member is not a non-negative integer, object, or array"; + } + return false; + } + + Json::Value const& major = version["major"]; + if (major.isNull()) { + error = "'version' object 'major' member missing"; + return false; + } + if (!major.isUInt()) { + error = "'version' object 'major' member is not a non-negative integer"; + return false; + } + + RequestVersion v; + v.Major = major.asUInt(); + + Json::Value const& minor = version["minor"]; + if (minor.isUInt()) { + v.Minor = minor.asUInt(); + } else if (!minor.isNull()) { + error = "'version' object 'minor' member is not a non-negative integer"; + return false; + } + + result.push_back(v); + + return true; +} + +std::string cmFileAPI::NoSupportedVersion( + std::vector<RequestVersion> const& versions) +{ + std::ostringstream msg; + msg << "no supported version specified"; + if (!versions.empty()) { + msg << " among:"; + for (RequestVersion const& v : versions) { + msg << " " << v.Major << "." << v.Minor; + } + } + return msg.str(); +} + +// The "codemodel" object kind. + +static unsigned int const CodeModelV2Minor = 0; + +void cmFileAPI::BuildClientRequestCodeModel( + ClientRequest& r, std::vector<RequestVersion> const& versions) +{ + // Select a known version from those requested. + for (RequestVersion const& v : versions) { + if ((v.Major == 2 && v.Minor <= CodeModelV2Minor)) { + r.Version = v.Major; + break; + } + } + if (!r.Version) { + r.Error = NoSupportedVersion(versions); + } +} + +Json::Value cmFileAPI::BuildCodeModel(Object const& object) +{ + using namespace std::placeholders; + Json::Value codemodel = cmFileAPICodemodelDump(*this, object.Version); + codemodel["kind"] = this->ObjectKindName(object.Kind); + + Json::Value& version = codemodel["version"] = Json::objectValue; + if (object.Version == 2) { + version["major"] = 2; + version["minor"] = CodeModelV2Minor; + } else { + return codemodel; // should be unreachable + } + + return codemodel; +} + +// The "cache" object kind. + +static unsigned int const CacheV2Minor = 0; + +void cmFileAPI::BuildClientRequestCache( + ClientRequest& r, std::vector<RequestVersion> const& versions) +{ + // Select a known version from those requested. + for (RequestVersion const& v : versions) { + if ((v.Major == 2 && v.Minor <= CacheV2Minor)) { + r.Version = v.Major; + break; + } + } + if (!r.Version) { + r.Error = NoSupportedVersion(versions); + } +} + +Json::Value cmFileAPI::BuildCache(Object const& object) +{ + using namespace std::placeholders; + Json::Value cache = cmFileAPICacheDump(*this, object.Version); + cache["kind"] = this->ObjectKindName(object.Kind); + + Json::Value& version = cache["version"] = Json::objectValue; + if (object.Version == 2) { + version["major"] = 2; + version["minor"] = CacheV2Minor; + } else { + return cache; // should be unreachable + } + + return cache; +} + +// The "cmakeFiles" object kind. + +static unsigned int const CMakeFilesV1Minor = 0; + +void cmFileAPI::BuildClientRequestCMakeFiles( + ClientRequest& r, std::vector<RequestVersion> const& versions) +{ + // Select a known version from those requested. + for (RequestVersion const& v : versions) { + if ((v.Major == 1 && v.Minor <= CMakeFilesV1Minor)) { + r.Version = v.Major; + break; + } + } + if (!r.Version) { + r.Error = NoSupportedVersion(versions); + } +} + +Json::Value cmFileAPI::BuildCMakeFiles(Object const& object) +{ + using namespace std::placeholders; + Json::Value cmakeFiles = cmFileAPICMakeFilesDump(*this, object.Version); + cmakeFiles["kind"] = this->ObjectKindName(object.Kind); + + Json::Value& version = cmakeFiles["version"] = Json::objectValue; + if (object.Version == 1) { + version["major"] = 1; + version["minor"] = CMakeFilesV1Minor; + } else { + return cmakeFiles; // should be unreachable + } + + return cmakeFiles; +} + +// The "__test" object kind is for internal testing of CMake. + +static unsigned int const InternalTestV1Minor = 3; +static unsigned int const InternalTestV2Minor = 0; + +void cmFileAPI::BuildClientRequestInternalTest( + ClientRequest& r, std::vector<RequestVersion> const& versions) +{ + // Select a known version from those requested. + for (RequestVersion const& v : versions) { + if ((v.Major == 1 && v.Minor <= InternalTestV1Minor) || // + (v.Major == 2 && v.Minor <= InternalTestV2Minor)) { + r.Version = v.Major; + break; + } + } + if (!r.Version) { + r.Error = NoSupportedVersion(versions); + } +} + +Json::Value cmFileAPI::BuildInternalTest(Object const& object) +{ + Json::Value test = Json::objectValue; + test["kind"] = this->ObjectKindName(object.Kind); + Json::Value& version = test["version"] = Json::objectValue; + if (object.Version == 2) { + version["major"] = 2; + version["minor"] = InternalTestV2Minor; + } else { + version["major"] = 1; + version["minor"] = InternalTestV1Minor; + } + return test; +} diff --git a/Source/cmFileAPI.h b/Source/cmFileAPI.h new file mode 100644 index 0000000..341b072 --- /dev/null +++ b/Source/cmFileAPI.h @@ -0,0 +1,204 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ +#ifndef cmFileAPI_h +#define cmFileAPI_h + +#include "cmConfigure.h" // IWYU pragma: keep + +#include "cm_jsoncpp_reader.h" +#include "cm_jsoncpp_value.h" +#include "cm_jsoncpp_writer.h" + +#include <map> +#include <memory> // IWYU pragma: keep +#include <string> +#include <unordered_set> +#include <vector> + +class cmake; + +class cmFileAPI +{ +public: + cmFileAPI(cmake* cm); + + /** Read fileapi queries from disk. */ + void ReadQueries(); + + /** Write fileapi replies to disk. */ + void WriteReplies(); + + /** Get the "cmake" instance with which this was constructed. */ + cmake* GetCMakeInstance() const { return this->CMakeInstance; } + + /** Convert a JSON object or array into an object with a single + "jsonFile" member specifying a file named with the given prefix + and holding the original object. Other JSON types are unchanged. */ + Json::Value MaybeJsonFile(Json::Value in, std::string const& prefix); + +private: + cmake* CMakeInstance; + + /** The api/v1 directory location. */ + std::string APIv1; + + /** The set of files we have just written to the reply directory. */ + std::unordered_set<std::string> ReplyFiles; + + static std::vector<std::string> LoadDir(std::string const& dir); + void RemoveOldReplyFiles(); + + // Keep in sync with ObjectKindName. + enum class ObjectKind + { + CodeModel, + Cache, + CMakeFiles, + InternalTest + }; + + /** Identify one object kind and major version. */ + struct Object + { + ObjectKind Kind; + unsigned long Version = 0; + friend bool operator<(Object const& l, Object const& r) + { + if (l.Kind != r.Kind) { + return l.Kind < r.Kind; + } + return l.Version < r.Version; + } + }; + + /** Represent content of a query directory. */ + struct Query + { + /** Known object kind-version pairs. */ + std::vector<Object> Known; + /** Unknown object kind names. */ + std::vector<std::string> Unknown; + }; + + /** Represent one request in a client 'query.json'. */ + struct ClientRequest : public Object + { + /** Empty if request is valid, else the error string. */ + std::string Error; + }; + + /** Represent the "requests" in a client 'query.json'. */ + struct ClientRequests : public std::vector<ClientRequest> + { + /** Empty if requests field is valid, else the error string. */ + std::string Error; + }; + + /** Represent the content of a client query.json file. */ + struct ClientQueryJson + { + /** The error string if parsing failed, else empty. */ + std::string Error; + + /** The 'query.json' object "client" member if it exists, else null. */ + Json::Value ClientValue; + + /** The 'query.json' object "requests" member if it exists, else null. */ + Json::Value RequestsValue; + + /** Requests extracted from 'query.json'. */ + ClientRequests Requests; + }; + + /** Represent content of a client query directory. */ + struct ClientQuery + { + /** The content of the client query directory except 'query.json'. */ + Query DirQuery; + + /** True if 'query.json' exists. */ + bool HaveQueryJson = false; + + /** The 'query.json' content. */ + ClientQueryJson QueryJson; + }; + + /** Whether the top-level query directory exists at all. */ + bool QueryExists = false; + + /** The content of the top-level query directory. */ + Query TopQuery; + + /** The content of each "client-$client" query directory. */ + std::map<std::string, ClientQuery> ClientQueries; + + /** Reply index object generated for object kind/version. + This populates the "objects" field of the reply index. */ + std::map<Object, Json::Value> ReplyIndexObjects; + + std::unique_ptr<Json::CharReader> JsonReader; + std::unique_ptr<Json::StreamWriter> JsonWriter; + + bool ReadJsonFile(std::string const& file, Json::Value& value, + std::string& error); + + std::string WriteJsonFile( + Json::Value const& value, std::string const& prefix, + std::string (*computeSuffix)(std::string const&) = ComputeSuffixHash); + static std::string ComputeSuffixHash(std::string const&); + static std::string ComputeSuffixTime(std::string const&); + + static bool ReadQuery(std::string const& query, + std::vector<Object>& objects); + void ReadClient(std::string const& client); + void ReadClientQuery(std::string const& client, ClientQueryJson& q); + + Json::Value BuildReplyIndex(); + Json::Value BuildCMake(); + Json::Value BuildReply(Query const& q); + static Json::Value BuildReplyError(std::string const& error); + Json::Value const& AddReplyIndexObject(Object const& o); + + static const char* ObjectKindName(ObjectKind kind); + static std::string ObjectName(Object const& o); + + Json::Value BuildObject(Object const& object); + + ClientRequests BuildClientRequests(Json::Value const& requests); + ClientRequest BuildClientRequest(Json::Value const& request); + Json::Value BuildClientReply(ClientQuery const& q); + Json::Value BuildClientReplyResponses(ClientRequests const& requests); + Json::Value BuildClientReplyResponse(ClientRequest const& request); + + struct RequestVersion + { + unsigned int Major = 0; + unsigned int Minor = 0; + }; + static bool ReadRequestVersions(Json::Value const& version, + std::vector<RequestVersion>& versions, + std::string& error); + static bool ReadRequestVersion(Json::Value const& version, bool inArray, + std::vector<RequestVersion>& result, + std::string& error); + static std::string NoSupportedVersion( + std::vector<RequestVersion> const& versions); + + void BuildClientRequestCodeModel( + ClientRequest& r, std::vector<RequestVersion> const& versions); + Json::Value BuildCodeModel(Object const& object); + + void BuildClientRequestCache(ClientRequest& r, + std::vector<RequestVersion> const& versions); + Json::Value BuildCache(Object const& object); + + void BuildClientRequestCMakeFiles( + ClientRequest& r, std::vector<RequestVersion> const& versions); + Json::Value BuildCMakeFiles(Object const& object); + + void BuildClientRequestInternalTest( + ClientRequest& r, std::vector<RequestVersion> const& versions); + Json::Value BuildInternalTest(Object const& object); +}; + +#endif diff --git a/Source/cmFileAPICMakeFiles.cxx b/Source/cmFileAPICMakeFiles.cxx new file mode 100644 index 0000000..799a047 --- /dev/null +++ b/Source/cmFileAPICMakeFiles.cxx @@ -0,0 +1,113 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ +#include "cmFileAPICMakeFiles.h" + +#include "cmFileAPI.h" +#include "cmGlobalGenerator.h" +#include "cmLocalGenerator.h" +#include "cmMakefile.h" +#include "cmSystemTools.h" +#include "cmake.h" + +#include "cm_jsoncpp_value.h" + +#include <string> + +namespace { + +class CMakeFiles +{ + cmFileAPI& FileAPI; + unsigned long Version; + std::string CMakeModules; + std::string const& TopSource; + std::string const& TopBuild; + bool OutOfSource; + + Json::Value DumpPaths(); + Json::Value DumpInputs(); + Json::Value DumpInput(std::string const& file); + +public: + CMakeFiles(cmFileAPI& fileAPI, unsigned long version); + Json::Value Dump(); +}; + +CMakeFiles::CMakeFiles(cmFileAPI& fileAPI, unsigned long version) + : FileAPI(fileAPI) + , Version(version) + , CMakeModules(cmSystemTools::GetCMakeRoot() + "/Modules") + , TopSource(this->FileAPI.GetCMakeInstance()->GetHomeDirectory()) + , TopBuild(this->FileAPI.GetCMakeInstance()->GetHomeOutputDirectory()) + , OutOfSource(TopBuild != TopSource) +{ + static_cast<void>(this->Version); +} + +Json::Value CMakeFiles::Dump() +{ + Json::Value cmakeFiles = Json::objectValue; + cmakeFiles["paths"] = this->DumpPaths(); + cmakeFiles["inputs"] = DumpInputs(); + return cmakeFiles; +} + +Json::Value CMakeFiles::DumpPaths() +{ + Json::Value paths = Json::objectValue; + paths["source"] = this->TopSource; + paths["build"] = this->TopBuild; + return paths; +} + +Json::Value CMakeFiles::DumpInputs() +{ + Json::Value inputs = Json::arrayValue; + + cmGlobalGenerator* gg = + this->FileAPI.GetCMakeInstance()->GetGlobalGenerator(); + for (cmLocalGenerator const* lg : gg->GetLocalGenerators()) { + cmMakefile const* mf = lg->GetMakefile(); + for (std::string const& file : mf->GetListFiles()) { + inputs.append(this->DumpInput(file)); + } + } + + return inputs; +} + +Json::Value CMakeFiles::DumpInput(std::string const& file) +{ + Json::Value input = Json::objectValue; + + bool const isCMake = cmSystemTools::IsSubDirectory(file, this->CMakeModules); + if (isCMake) { + input["isCMake"] = true; + } + + if (!cmSystemTools::IsSubDirectory(file, this->TopSource) && + !cmSystemTools::IsSubDirectory(file, this->TopBuild)) { + input["isExternal"] = true; + } + + if (this->OutOfSource && + cmSystemTools::IsSubDirectory(file, this->TopBuild)) { + input["isGenerated"] = true; + } + + std::string path = file; + if (!isCMake && cmSystemTools::IsSubDirectory(path, this->TopSource)) { + // Use a relative path within the source directory. + path = cmSystemTools::RelativePath(this->TopSource, path); + } + input["path"] = path; + + return input; +} +} + +Json::Value cmFileAPICMakeFilesDump(cmFileAPI& fileAPI, unsigned long version) +{ + CMakeFiles cmakeFiles(fileAPI, version); + return cmakeFiles.Dump(); +} diff --git a/Source/cmFileAPICMakeFiles.h b/Source/cmFileAPICMakeFiles.h new file mode 100644 index 0000000..a851c32 --- /dev/null +++ b/Source/cmFileAPICMakeFiles.h @@ -0,0 +1,15 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ +#ifndef cmFileAPICMakeFiles_h +#define cmFileAPICMakeFiles_h + +#include "cmConfigure.h" // IWYU pragma: keep + +#include "cm_jsoncpp_value.h" + +class cmFileAPI; + +extern Json::Value cmFileAPICMakeFilesDump(cmFileAPI& fileAPI, + unsigned long version); + +#endif diff --git a/Source/cmFileAPICache.cxx b/Source/cmFileAPICache.cxx new file mode 100644 index 0000000..074994a --- /dev/null +++ b/Source/cmFileAPICache.cxx @@ -0,0 +1,105 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ +#include "cmFileAPICache.h" + +#include "cmFileAPI.h" +#include "cmState.h" +#include "cmake.h" + +#include "cm_jsoncpp_value.h" + +#include <algorithm> +#include <string> +#include <vector> + +namespace { + +class Cache +{ + cmFileAPI& FileAPI; + unsigned long Version; + cmState* State; + + Json::Value DumpEntries(); + Json::Value DumpEntry(std::string const& name); + Json::Value DumpEntryProperties(std::string const& name); + Json::Value DumpEntryProperty(std::string const& name, + std::string const& prop); + +public: + Cache(cmFileAPI& fileAPI, unsigned long version); + Json::Value Dump(); +}; + +Cache::Cache(cmFileAPI& fileAPI, unsigned long version) + : FileAPI(fileAPI) + , Version(version) + , State(this->FileAPI.GetCMakeInstance()->GetState()) +{ + static_cast<void>(this->Version); +} + +Json::Value Cache::Dump() +{ + Json::Value cache = Json::objectValue; + cache["entries"] = DumpEntries(); + return cache; +} + +Json::Value Cache::DumpEntries() +{ + Json::Value entries = Json::arrayValue; + + std::vector<std::string> names = this->State->GetCacheEntryKeys(); + std::sort(names.begin(), names.end()); + + for (std::string const& name : names) { + entries.append(this->DumpEntry(name)); + } + + return entries; +} + +Json::Value Cache::DumpEntry(std::string const& name) +{ + Json::Value entry = Json::objectValue; + entry["name"] = name; + entry["type"] = + cmState::CacheEntryTypeToString(this->State->GetCacheEntryType(name)); + entry["value"] = this->State->GetCacheEntryValue(name); + + Json::Value properties = this->DumpEntryProperties(name); + if (!properties.empty()) { + entry["properties"] = std::move(properties); + } + + return entry; +} + +Json::Value Cache::DumpEntryProperties(std::string const& name) +{ + Json::Value properties = Json::arrayValue; + std::vector<std::string> props = + this->State->GetCacheEntryPropertyList(name); + std::sort(props.begin(), props.end()); + for (std::string const& prop : props) { + properties.append(this->DumpEntryProperty(name, prop)); + } + return properties; +} + +Json::Value Cache::DumpEntryProperty(std::string const& name, + std::string const& prop) +{ + Json::Value property = Json::objectValue; + property["name"] = prop; + property["value"] = this->State->GetCacheEntryProperty(name, prop); + return property; +} +} + +Json::Value cmFileAPICacheDump(cmFileAPI& fileAPI, unsigned long version) +{ + Cache cache(fileAPI, version); + return cache.Dump(); +} diff --git a/Source/cmFileAPICache.h b/Source/cmFileAPICache.h new file mode 100644 index 0000000..09d9e1c --- /dev/null +++ b/Source/cmFileAPICache.h @@ -0,0 +1,15 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ +#ifndef cmFileAPICache_h +#define cmFileAPICache_h + +#include "cmConfigure.h" // IWYU pragma: keep + +#include "cm_jsoncpp_value.h" + +class cmFileAPI; + +extern Json::Value cmFileAPICacheDump(cmFileAPI& fileAPI, + unsigned long version); + +#endif diff --git a/Source/cmFileAPICodemodel.cxx b/Source/cmFileAPICodemodel.cxx new file mode 100644 index 0000000..078d1d5 --- /dev/null +++ b/Source/cmFileAPICodemodel.cxx @@ -0,0 +1,1247 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ +#include "cmFileAPICodemodel.h" + +#include "cmCryptoHash.h" +#include "cmFileAPI.h" +#include "cmGeneratorExpression.h" +#include "cmGeneratorTarget.h" +#include "cmGlobalGenerator.h" +#include "cmInstallGenerator.h" +#include "cmInstallSubdirectoryGenerator.h" +#include "cmInstallTargetGenerator.h" +#include "cmLinkLineComputer.h" +#include "cmListFileCache.h" +#include "cmLocalGenerator.h" +#include "cmMakefile.h" +#include "cmSourceFile.h" +#include "cmSourceGroup.h" +#include "cmState.h" +#include "cmStateDirectory.h" +#include "cmStateSnapshot.h" +#include "cmStateTypes.h" +#include "cmSystemTools.h" +#include "cmTarget.h" +#include "cmTargetDepend.h" +#include "cmake.h" + +#include "cm_jsoncpp_value.h" + +#include <algorithm> +#include <cassert> +#include <map> +#include <set> +#include <string> +#include <unordered_map> +#include <utility> +#include <vector> + +namespace { + +class Codemodel +{ + cmFileAPI& FileAPI; + unsigned long Version; + + Json::Value DumpPaths(); + Json::Value DumpConfigurations(); + Json::Value DumpConfiguration(std::string const& config); + +public: + Codemodel(cmFileAPI& fileAPI, unsigned long version); + Json::Value Dump(); +}; + +class CodemodelConfig +{ + cmFileAPI& FileAPI; + unsigned long Version; + std::string const& Config; + std::string TopSource; + std::string TopBuild; + + struct Directory + { + cmStateSnapshot Snapshot; + cmLocalGenerator const* LocalGenerator = nullptr; + Json::Value TargetIndexes = Json::arrayValue; + Json::ArrayIndex ProjectIndex; + bool HasInstallRule = false; + }; + std::map<cmStateSnapshot, Json::ArrayIndex, cmStateSnapshot::StrictWeakOrder> + DirectoryMap; + std::vector<Directory> Directories; + + struct Project + { + cmStateSnapshot Snapshot; + static const Json::ArrayIndex NoParentIndex = + static_cast<Json::ArrayIndex>(-1); + Json::ArrayIndex ParentIndex = NoParentIndex; + Json::Value ChildIndexes = Json::arrayValue; + Json::Value DirectoryIndexes = Json::arrayValue; + Json::Value TargetIndexes = Json::arrayValue; + }; + std::map<cmStateSnapshot, Json::ArrayIndex, cmStateSnapshot::StrictWeakOrder> + ProjectMap; + std::vector<Project> Projects; + + void ProcessDirectories(); + + Json::ArrayIndex GetDirectoryIndex(cmLocalGenerator const* lg); + Json::ArrayIndex GetDirectoryIndex(cmStateSnapshot s); + + Json::ArrayIndex AddProject(cmStateSnapshot s); + + Json::Value DumpTargets(); + Json::Value DumpTarget(cmGeneratorTarget* gt, Json::ArrayIndex ti); + + Json::Value DumpDirectories(); + Json::Value DumpDirectory(Directory& d); + + Json::Value DumpProjects(); + Json::Value DumpProject(Project& p); + + Json::Value DumpMinimumCMakeVersion(cmStateSnapshot s); + +public: + CodemodelConfig(cmFileAPI& fileAPI, unsigned long version, + std::string const& config); + Json::Value Dump(); +}; + +std::string RelativeIfUnder(std::string const& top, std::string const& in) +{ + std::string out; + if (in == top) { + out = "."; + } else if (cmSystemTools::IsSubDirectory(in, top)) { + out = in.substr(top.size() + 1); + } else { + out = in; + } + return out; +} + +std::string TargetId(cmGeneratorTarget const* gt, std::string const& topBuild) +{ + cmCryptoHash hasher(cmCryptoHash::AlgoSHA3_256); + std::string path = RelativeIfUnder( + topBuild, gt->GetLocalGenerator()->GetCurrentBinaryDirectory()); + std::string hash = hasher.HashString(path); + hash.resize(20, '0'); + return gt->GetName() + CMAKE_DIRECTORY_ID_SEP + hash; +} + +class BacktraceData +{ + std::string TopSource; + std::unordered_map<std::string, Json::ArrayIndex> CommandMap; + std::unordered_map<std::string, Json::ArrayIndex> FileMap; + std::unordered_map<cmListFileContext const*, Json::ArrayIndex> NodeMap; + Json::Value Commands = Json::arrayValue; + Json::Value Files = Json::arrayValue; + Json::Value Nodes = Json::arrayValue; + + Json::ArrayIndex AddCommand(std::string const& command) + { + auto i = this->CommandMap.find(command); + if (i == this->CommandMap.end()) { + auto cmdIndex = static_cast<Json::ArrayIndex>(this->Commands.size()); + i = this->CommandMap.emplace(command, cmdIndex).first; + this->Commands.append(command); + } + return i->second; + } + + Json::ArrayIndex AddFile(std::string const& file) + { + auto i = this->FileMap.find(file); + if (i == this->FileMap.end()) { + auto fileIndex = static_cast<Json::ArrayIndex>(this->Files.size()); + i = this->FileMap.emplace(file, fileIndex).first; + this->Files.append(RelativeIfUnder(this->TopSource, file)); + } + return i->second; + } + +public: + BacktraceData(std::string const& topSource); + bool Add(cmListFileBacktrace const& bt, Json::ArrayIndex& index); + Json::Value Dump(); +}; + +BacktraceData::BacktraceData(std::string const& topSource) + : TopSource(topSource) +{ +} + +bool BacktraceData::Add(cmListFileBacktrace const& bt, Json::ArrayIndex& index) +{ + if (bt.Empty()) { + return false; + } + cmListFileContext const* top = &bt.Top(); + auto found = this->NodeMap.find(top); + if (found != this->NodeMap.end()) { + index = found->second; + return true; + } + Json::Value entry = Json::objectValue; + entry["file"] = this->AddFile(top->FilePath); + if (top->Line) { + entry["line"] = static_cast<int>(top->Line); + } + if (!top->Name.empty()) { + entry["command"] = this->AddCommand(top->Name); + } + Json::ArrayIndex parent; + if (this->Add(bt.Pop(), parent)) { + entry["parent"] = parent; + } + index = this->NodeMap[top] = this->Nodes.size(); + this->Nodes.append(std::move(entry)); // NOLINT(*) + return true; +} + +Json::Value BacktraceData::Dump() +{ + Json::Value backtraceGraph; + this->CommandMap.clear(); + this->FileMap.clear(); + this->NodeMap.clear(); + backtraceGraph["commands"] = std::move(this->Commands); + backtraceGraph["files"] = std::move(this->Files); + backtraceGraph["nodes"] = std::move(this->Nodes); + return backtraceGraph; +} + +struct CompileData +{ + struct IncludeEntry + { + BT<std::string> Path; + bool IsSystem = false; + IncludeEntry(BT<std::string> path, bool isSystem) + : Path(std::move(path)) + , IsSystem(isSystem) + { + } + }; + + void SetDefines(std::set<BT<std::string>> const& defines); + + std::string Language; + std::string Sysroot; + std::vector<BT<std::string>> Flags; + std::vector<BT<std::string>> Defines; + std::vector<IncludeEntry> Includes; +}; + +void CompileData::SetDefines(std::set<BT<std::string>> const& defines) +{ + this->Defines.reserve(defines.size()); + for (BT<std::string> const& d : defines) { + this->Defines.push_back(d); + } +} + +class Target +{ + cmGeneratorTarget* GT; + std::string const& Config; + std::string TopSource; + std::string TopBuild; + std::vector<cmSourceGroup> SourceGroupsLocal; + BacktraceData Backtraces; + + std::map<std::string, CompileData> CompileDataMap; + + std::unordered_map<cmSourceFile const*, Json::ArrayIndex> SourceMap; + Json::Value Sources = Json::arrayValue; + + struct SourceGroup + { + std::string Name; + Json::Value SourceIndexes = Json::arrayValue; + }; + std::unordered_map<cmSourceGroup const*, Json::ArrayIndex> SourceGroupsMap; + std::vector<SourceGroup> SourceGroups; + + struct CompileGroup + { + std::map<Json::Value, Json::ArrayIndex>::iterator Entry; + Json::Value SourceIndexes = Json::arrayValue; + }; + std::map<Json::Value, Json::ArrayIndex> CompileGroupMap; + std::vector<CompileGroup> CompileGroups; + + void ProcessLanguages(); + void ProcessLanguage(std::string const& lang); + + Json::ArrayIndex AddSourceGroup(cmSourceGroup* sg, Json::ArrayIndex si); + CompileData BuildCompileData(cmSourceFile* sf); + Json::ArrayIndex AddSourceCompileGroup(cmSourceFile* sf, + Json::ArrayIndex si); + void AddBacktrace(Json::Value& object, cmListFileBacktrace const& bt); + Json::Value DumpPaths(); + Json::Value DumpCompileData(CompileData cd); + Json::Value DumpInclude(CompileData::IncludeEntry const& inc); + Json::Value DumpDefine(BT<std::string> const& def); + Json::Value DumpSources(); + Json::Value DumpSource(cmGeneratorTarget::SourceAndKind const& sk, + Json::ArrayIndex si); + Json::Value DumpSourceGroups(); + Json::Value DumpSourceGroup(SourceGroup& sg); + Json::Value DumpCompileGroups(); + Json::Value DumpCompileGroup(CompileGroup& cg); + Json::Value DumpSysroot(std::string const& path); + Json::Value DumpInstall(); + Json::Value DumpInstallPrefix(); + Json::Value DumpInstallDestinations(); + Json::Value DumpInstallDestination(cmInstallTargetGenerator* itGen); + Json::Value DumpArtifacts(); + Json::Value DumpLink(); + Json::Value DumpArchive(); + Json::Value DumpLinkCommandFragments(); + Json::Value DumpCommandFragments(std::vector<BT<std::string>> const& frags); + Json::Value DumpCommandFragment(BT<std::string> const& frag, + std::string const& role = std::string()); + Json::Value DumpDependencies(); + Json::Value DumpDependency(cmTargetDepend const& td); + Json::Value DumpFolder(); + +public: + Target(cmGeneratorTarget* gt, std::string const& config); + Json::Value Dump(); +}; + +Codemodel::Codemodel(cmFileAPI& fileAPI, unsigned long version) + : FileAPI(fileAPI) + , Version(version) +{ +} + +Json::Value Codemodel::Dump() +{ + Json::Value codemodel = Json::objectValue; + + codemodel["paths"] = this->DumpPaths(); + codemodel["configurations"] = this->DumpConfigurations(); + + return codemodel; +} + +Json::Value Codemodel::DumpPaths() +{ + Json::Value paths = Json::objectValue; + paths["source"] = this->FileAPI.GetCMakeInstance()->GetHomeDirectory(); + paths["build"] = this->FileAPI.GetCMakeInstance()->GetHomeOutputDirectory(); + return paths; +} + +Json::Value Codemodel::DumpConfigurations() +{ + std::vector<std::string> configs; + cmGlobalGenerator* gg = + this->FileAPI.GetCMakeInstance()->GetGlobalGenerator(); + auto makefiles = gg->GetMakefiles(); + if (!makefiles.empty()) { + makefiles[0]->GetConfigurations(configs); + if (configs.empty()) { + configs.emplace_back(); + } + } + Json::Value configurations = Json::arrayValue; + for (std::string const& config : configs) { + configurations.append(this->DumpConfiguration(config)); + } + return configurations; +} + +Json::Value Codemodel::DumpConfiguration(std::string const& config) +{ + CodemodelConfig configuration(this->FileAPI, this->Version, config); + return configuration.Dump(); +} + +CodemodelConfig::CodemodelConfig(cmFileAPI& fileAPI, unsigned long version, + std::string const& config) + : FileAPI(fileAPI) + , Version(version) + , Config(config) + , TopSource(this->FileAPI.GetCMakeInstance()->GetHomeDirectory()) + , TopBuild(this->FileAPI.GetCMakeInstance()->GetHomeOutputDirectory()) +{ + static_cast<void>(this->Version); +} + +Json::Value CodemodelConfig::Dump() +{ + Json::Value configuration = Json::objectValue; + configuration["name"] = this->Config; + this->ProcessDirectories(); + configuration["targets"] = this->DumpTargets(); + configuration["directories"] = this->DumpDirectories(); + configuration["projects"] = this->DumpProjects(); + return configuration; +} + +void CodemodelConfig::ProcessDirectories() +{ + cmGlobalGenerator* gg = + this->FileAPI.GetCMakeInstance()->GetGlobalGenerator(); + std::vector<cmLocalGenerator*> const& localGens = gg->GetLocalGenerators(); + + // Add directories in forward order to process parents before children. + this->Directories.reserve(localGens.size()); + for (cmLocalGenerator* lg : localGens) { + auto directoryIndex = + static_cast<Json::ArrayIndex>(this->Directories.size()); + this->Directories.emplace_back(); + Directory& d = this->Directories[directoryIndex]; + d.Snapshot = lg->GetStateSnapshot().GetBuildsystemDirectory(); + d.LocalGenerator = lg; + this->DirectoryMap[d.Snapshot] = directoryIndex; + + d.ProjectIndex = this->AddProject(d.Snapshot); + this->Projects[d.ProjectIndex].DirectoryIndexes.append(directoryIndex); + } + + // Update directories in reverse order to process children before parents. + for (auto di = this->Directories.rbegin(); di != this->Directories.rend(); + ++di) { + Directory& d = *di; + + // Accumulate the presence of install rules on the way up. + for (auto gen : d.LocalGenerator->GetMakefile()->GetInstallGenerators()) { + if (!dynamic_cast<cmInstallSubdirectoryGenerator*>(gen)) { + d.HasInstallRule = true; + break; + } + } + if (!d.HasInstallRule) { + for (cmStateSnapshot const& child : d.Snapshot.GetChildren()) { + cmStateSnapshot childDir = child.GetBuildsystemDirectory(); + Json::ArrayIndex const childIndex = this->GetDirectoryIndex(childDir); + if (this->Directories[childIndex].HasInstallRule) { + d.HasInstallRule = true; + break; + } + } + } + } +} + +Json::ArrayIndex CodemodelConfig::GetDirectoryIndex(cmLocalGenerator const* lg) +{ + return this->GetDirectoryIndex( + lg->GetStateSnapshot().GetBuildsystemDirectory()); +} + +Json::ArrayIndex CodemodelConfig::GetDirectoryIndex(cmStateSnapshot s) +{ + auto i = this->DirectoryMap.find(s); + assert(i != this->DirectoryMap.end()); + return i->second; +} + +Json::ArrayIndex CodemodelConfig::AddProject(cmStateSnapshot s) +{ + cmStateSnapshot ps = s.GetBuildsystemDirectoryParent(); + if (ps.IsValid() && ps.GetProjectName() == s.GetProjectName()) { + // This directory is part of its parent directory project. + Json::ArrayIndex const parentDirIndex = this->GetDirectoryIndex(ps); + return this->Directories[parentDirIndex].ProjectIndex; + } + + // This directory starts a new project. + auto projectIndex = static_cast<Json::ArrayIndex>(this->Projects.size()); + this->Projects.emplace_back(); + Project& p = this->Projects[projectIndex]; + p.Snapshot = s; + this->ProjectMap[s] = projectIndex; + if (ps.IsValid()) { + Json::ArrayIndex const parentDirIndex = this->GetDirectoryIndex(ps); + p.ParentIndex = this->Directories[parentDirIndex].ProjectIndex; + this->Projects[p.ParentIndex].ChildIndexes.append(projectIndex); + } + return projectIndex; +} + +Json::Value CodemodelConfig::DumpTargets() +{ + Json::Value targets = Json::arrayValue; + + std::vector<cmGeneratorTarget*> targetList; + cmGlobalGenerator* gg = + this->FileAPI.GetCMakeInstance()->GetGlobalGenerator(); + for (cmLocalGenerator const* lg : gg->GetLocalGenerators()) { + std::vector<cmGeneratorTarget*> const& list = lg->GetGeneratorTargets(); + targetList.insert(targetList.end(), list.begin(), list.end()); + } + std::sort(targetList.begin(), targetList.end(), + [](cmGeneratorTarget* l, cmGeneratorTarget* r) { + return l->GetName() < r->GetName(); + }); + + for (cmGeneratorTarget* gt : targetList) { + if (gt->GetType() == cmStateEnums::GLOBAL_TARGET || + gt->GetType() == cmStateEnums::INTERFACE_LIBRARY) { + continue; + } + + targets.append(this->DumpTarget(gt, targets.size())); + } + + return targets; +} + +Json::Value CodemodelConfig::DumpTarget(cmGeneratorTarget* gt, + Json::ArrayIndex ti) +{ + Target t(gt, this->Config); + std::string prefix = "target-" + gt->GetName(); + if (!this->Config.empty()) { + prefix += "-" + this->Config; + } + Json::Value target = this->FileAPI.MaybeJsonFile(t.Dump(), prefix); + target["name"] = gt->GetName(); + target["id"] = TargetId(gt, this->TopBuild); + + // Cross-reference directory containing target. + Json::ArrayIndex di = this->GetDirectoryIndex(gt->GetLocalGenerator()); + target["directoryIndex"] = di; + this->Directories[di].TargetIndexes.append(ti); + + // Cross-reference project containing target. + Json::ArrayIndex pi = this->Directories[di].ProjectIndex; + target["projectIndex"] = pi; + this->Projects[pi].TargetIndexes.append(ti); + + return target; +} + +Json::Value CodemodelConfig::DumpDirectories() +{ + Json::Value directories = Json::arrayValue; + for (Directory& d : this->Directories) { + directories.append(this->DumpDirectory(d)); + } + return directories; +} + +Json::Value CodemodelConfig::DumpDirectory(Directory& d) +{ + Json::Value directory = Json::objectValue; + + std::string sourceDir = d.Snapshot.GetDirectory().GetCurrentSource(); + directory["source"] = RelativeIfUnder(this->TopSource, sourceDir); + + std::string buildDir = d.Snapshot.GetDirectory().GetCurrentBinary(); + directory["build"] = RelativeIfUnder(this->TopBuild, buildDir); + + cmStateSnapshot parentDir = d.Snapshot.GetBuildsystemDirectoryParent(); + if (parentDir.IsValid()) { + directory["parentIndex"] = this->GetDirectoryIndex(parentDir); + } + + Json::Value childIndexes = Json::arrayValue; + for (cmStateSnapshot const& child : d.Snapshot.GetChildren()) { + childIndexes.append( + this->GetDirectoryIndex(child.GetBuildsystemDirectory())); + } + if (!childIndexes.empty()) { + directory["childIndexes"] = std::move(childIndexes); + } + + directory["projectIndex"] = d.ProjectIndex; + + if (!d.TargetIndexes.empty()) { + directory["targetIndexes"] = std::move(d.TargetIndexes); + } + + Json::Value minimumCMakeVersion = this->DumpMinimumCMakeVersion(d.Snapshot); + if (!minimumCMakeVersion.isNull()) { + directory["minimumCMakeVersion"] = std::move(minimumCMakeVersion); + } + + if (d.HasInstallRule) { + directory["hasInstallRule"] = true; + } + + return directory; +} + +Json::Value CodemodelConfig::DumpProjects() +{ + Json::Value projects = Json::arrayValue; + for (Project& p : this->Projects) { + projects.append(this->DumpProject(p)); + } + return projects; +} + +Json::Value CodemodelConfig::DumpProject(Project& p) +{ + Json::Value project = Json::objectValue; + + project["name"] = p.Snapshot.GetProjectName(); + + if (p.ParentIndex != Project::NoParentIndex) { + project["parentIndex"] = p.ParentIndex; + } + + if (!p.ChildIndexes.empty()) { + project["childIndexes"] = std::move(p.ChildIndexes); + } + + project["directoryIndexes"] = std::move(p.DirectoryIndexes); + + if (!p.TargetIndexes.empty()) { + project["targetIndexes"] = std::move(p.TargetIndexes); + } + + return project; +} + +Json::Value CodemodelConfig::DumpMinimumCMakeVersion(cmStateSnapshot s) +{ + Json::Value minimumCMakeVersion; + if (std::string const* def = + s.GetDefinition("CMAKE_MINIMUM_REQUIRED_VERSION")) { + minimumCMakeVersion = Json::objectValue; + minimumCMakeVersion["string"] = *def; + } + return minimumCMakeVersion; +} + +Target::Target(cmGeneratorTarget* gt, std::string const& config) + : GT(gt) + , Config(config) + , TopSource(gt->GetGlobalGenerator()->GetCMakeInstance()->GetHomeDirectory()) + , TopBuild( + gt->GetGlobalGenerator()->GetCMakeInstance()->GetHomeOutputDirectory()) + , SourceGroupsLocal(this->GT->Makefile->GetSourceGroups()) + , Backtraces(this->TopSource) +{ +} + +Json::Value Target::Dump() +{ + Json::Value target = Json::objectValue; + + cmStateEnums::TargetType const type = this->GT->GetType(); + + target["name"] = this->GT->GetName(); + target["type"] = cmState::GetTargetTypeName(type); + target["id"] = TargetId(this->GT, this->TopBuild); + target["paths"] = this->DumpPaths(); + if (this->GT->Target->GetIsGeneratorProvided()) { + target["isGeneratorProvided"] = true; + } + + this->AddBacktrace(target, this->GT->GetBacktrace()); + + if (this->GT->Target->GetHaveInstallRule()) { + target["install"] = this->DumpInstall(); + } + + if (this->GT->HaveWellDefinedOutputFiles()) { + Json::Value artifacts = this->DumpArtifacts(); + if (!artifacts.empty()) { + target["artifacts"] = std::move(artifacts); + } + } + + if (type == cmStateEnums::EXECUTABLE || + type == cmStateEnums::SHARED_LIBRARY || + type == cmStateEnums::MODULE_LIBRARY) { + target["nameOnDisk"] = this->GT->GetFullName(this->Config); + target["link"] = this->DumpLink(); + } else if (type == cmStateEnums::STATIC_LIBRARY) { + target["nameOnDisk"] = this->GT->GetFullName(this->Config); + target["archive"] = this->DumpArchive(); + } + + Json::Value dependencies = this->DumpDependencies(); + if (!dependencies.empty()) { + target["dependencies"] = dependencies; + } + + { + this->ProcessLanguages(); + + target["sources"] = this->DumpSources(); + + Json::Value folder = this->DumpFolder(); + if (!folder.isNull()) { + target["folder"] = std::move(folder); + } + + Json::Value sourceGroups = this->DumpSourceGroups(); + if (!sourceGroups.empty()) { + target["sourceGroups"] = std::move(sourceGroups); + } + + Json::Value compileGroups = this->DumpCompileGroups(); + if (!compileGroups.empty()) { + target["compileGroups"] = std::move(compileGroups); + } + } + + target["backtraceGraph"] = this->Backtraces.Dump(); + + return target; +} + +void Target::ProcessLanguages() +{ + std::set<std::string> languages; + this->GT->GetLanguages(languages, this->Config); + for (std::string const& lang : languages) { + this->ProcessLanguage(lang); + } +} + +void Target::ProcessLanguage(std::string const& lang) +{ + CompileData& cd = this->CompileDataMap[lang]; + cd.Language = lang; + if (const char* sysrootCompile = + this->GT->Makefile->GetDefinition("CMAKE_SYSROOT_COMPILE")) { + cd.Sysroot = sysrootCompile; + } else if (const char* sysroot = + this->GT->Makefile->GetDefinition("CMAKE_SYSROOT")) { + cd.Sysroot = sysroot; + } + cmLocalGenerator* lg = this->GT->GetLocalGenerator(); + { + // FIXME: Add flags from end section of ExpandRuleVariable, + // which may need to be factored out. + std::string flags; + lg->GetTargetCompileFlags(this->GT, this->Config, lang, flags); + cd.Flags.emplace_back(std::move(flags), cmListFileBacktrace()); + } + std::set<BT<std::string>> defines = + lg->GetTargetDefines(this->GT, this->Config, lang); + cd.SetDefines(defines); + std::vector<BT<std::string>> includePathList = + lg->GetIncludeDirectories(this->GT, lang, this->Config, true); + for (BT<std::string> const& i : includePathList) { + cd.Includes.emplace_back( + i, this->GT->IsSystemIncludeDirectory(i.Value, this->Config, lang)); + } +} + +Json::ArrayIndex Target::AddSourceGroup(cmSourceGroup* sg, Json::ArrayIndex si) +{ + std::unordered_map<cmSourceGroup const*, Json::ArrayIndex>::iterator i = + this->SourceGroupsMap.find(sg); + if (i == this->SourceGroupsMap.end()) { + auto sgIndex = static_cast<Json::ArrayIndex>(this->SourceGroups.size()); + i = this->SourceGroupsMap.emplace(sg, sgIndex).first; + SourceGroup g; + g.Name = sg->GetFullName(); + this->SourceGroups.push_back(std::move(g)); + } + this->SourceGroups[i->second].SourceIndexes.append(si); + return i->second; +} + +CompileData Target::BuildCompileData(cmSourceFile* sf) +{ + CompileData fd; + + fd.Language = sf->GetLanguage(); + if (fd.Language.empty()) { + return fd; + } + CompileData const& cd = this->CompileDataMap.at(fd.Language); + + fd.Sysroot = cd.Sysroot; + + cmLocalGenerator* lg = this->GT->GetLocalGenerator(); + cmGeneratorExpressionInterpreter genexInterpreter(lg, this->Config, this->GT, + fd.Language); + + fd.Flags = cd.Flags; + const std::string COMPILE_FLAGS("COMPILE_FLAGS"); + if (const char* cflags = sf->GetProperty(COMPILE_FLAGS)) { + std::string flags = genexInterpreter.Evaluate(cflags, COMPILE_FLAGS); + fd.Flags.emplace_back(std::move(flags), cmListFileBacktrace()); + } + const std::string COMPILE_OPTIONS("COMPILE_OPTIONS"); + if (const char* coptions = sf->GetProperty(COMPILE_OPTIONS)) { + std::string flags; + lg->AppendCompileOptions( + flags, genexInterpreter.Evaluate(coptions, COMPILE_OPTIONS)); + fd.Flags.emplace_back(std::move(flags), cmListFileBacktrace()); + } + + // Add include directories from source file properties. + { + std::vector<std::string> includes; + const std::string INCLUDE_DIRECTORIES("INCLUDE_DIRECTORIES"); + if (const char* cincludes = sf->GetProperty(INCLUDE_DIRECTORIES)) { + const std::string& evaluatedIncludes = + genexInterpreter.Evaluate(cincludes, INCLUDE_DIRECTORIES); + lg->AppendIncludeDirectories(includes, evaluatedIncludes, *sf); + + for (std::string const& include : includes) { + bool const isSystemInclude = this->GT->IsSystemIncludeDirectory( + include, this->Config, fd.Language); + fd.Includes.emplace_back(include, isSystemInclude); + } + } + } + fd.Includes.insert(fd.Includes.end(), cd.Includes.begin(), + cd.Includes.end()); + + const std::string COMPILE_DEFINITIONS("COMPILE_DEFINITIONS"); + std::set<std::string> fileDefines; + if (const char* defs = sf->GetProperty(COMPILE_DEFINITIONS)) { + lg->AppendDefines(fileDefines, + genexInterpreter.Evaluate(defs, COMPILE_DEFINITIONS)); + } + + const std::string defPropName = + "COMPILE_DEFINITIONS_" + cmSystemTools::UpperCase(this->Config); + if (const char* config_defs = sf->GetProperty(defPropName)) { + lg->AppendDefines( + fileDefines, + genexInterpreter.Evaluate(config_defs, COMPILE_DEFINITIONS)); + } + + std::set<BT<std::string>> defines; + defines.insert(fileDefines.begin(), fileDefines.end()); + defines.insert(cd.Defines.begin(), cd.Defines.end()); + + fd.SetDefines(defines); + + return fd; +} + +Json::ArrayIndex Target::AddSourceCompileGroup(cmSourceFile* sf, + Json::ArrayIndex si) +{ + Json::Value compileDataJson = + this->DumpCompileData(this->BuildCompileData(sf)); + std::map<Json::Value, Json::ArrayIndex>::iterator i = + this->CompileGroupMap.find(compileDataJson); + if (i == this->CompileGroupMap.end()) { + Json::ArrayIndex cgIndex = + static_cast<Json::ArrayIndex>(this->CompileGroups.size()); + i = + this->CompileGroupMap.emplace(std::move(compileDataJson), cgIndex).first; + CompileGroup g; + g.Entry = i; + this->CompileGroups.push_back(std::move(g)); + } + this->CompileGroups[i->second].SourceIndexes.append(si); + return i->second; +} + +void Target::AddBacktrace(Json::Value& object, cmListFileBacktrace const& bt) +{ + Json::ArrayIndex backtrace; + if (this->Backtraces.Add(bt, backtrace)) { + object["backtrace"] = backtrace; + } +} + +Json::Value Target::DumpPaths() +{ + Json::Value paths = Json::objectValue; + cmLocalGenerator* lg = this->GT->GetLocalGenerator(); + + std::string const& sourceDir = lg->GetCurrentSourceDirectory(); + paths["source"] = RelativeIfUnder(this->TopSource, sourceDir); + + std::string const& buildDir = lg->GetCurrentBinaryDirectory(); + paths["build"] = RelativeIfUnder(this->TopBuild, buildDir); + + return paths; +} + +Json::Value Target::DumpSources() +{ + Json::Value sources = Json::arrayValue; + cmGeneratorTarget::KindedSources const& kinded = + this->GT->GetKindedSources(this->Config); + for (cmGeneratorTarget::SourceAndKind const& sk : kinded.Sources) { + sources.append(this->DumpSource(sk, sources.size())); + } + return sources; +} + +Json::Value Target::DumpSource(cmGeneratorTarget::SourceAndKind const& sk, + Json::ArrayIndex si) +{ + Json::Value source = Json::objectValue; + + std::string const path = sk.Source.Value->GetFullPath(); + source["path"] = RelativeIfUnder(this->TopSource, path); + if (sk.Source.Value->GetPropertyAsBool("GENERATED")) { + source["isGenerated"] = true; + } + this->AddBacktrace(source, sk.Source.Backtrace); + + if (cmSourceGroup* sg = + this->GT->Makefile->FindSourceGroup(path, this->SourceGroupsLocal)) { + source["sourceGroupIndex"] = this->AddSourceGroup(sg, si); + } + + switch (sk.Kind) { + case cmGeneratorTarget::SourceKindObjectSource: { + source["compileGroupIndex"] = + this->AddSourceCompileGroup(sk.Source.Value, si); + } break; + case cmGeneratorTarget::SourceKindAppManifest: + case cmGeneratorTarget::SourceKindCertificate: + case cmGeneratorTarget::SourceKindCustomCommand: + case cmGeneratorTarget::SourceKindExternalObject: + case cmGeneratorTarget::SourceKindExtra: + case cmGeneratorTarget::SourceKindHeader: + case cmGeneratorTarget::SourceKindIDL: + case cmGeneratorTarget::SourceKindManifest: + case cmGeneratorTarget::SourceKindModuleDefinition: + case cmGeneratorTarget::SourceKindResx: + case cmGeneratorTarget::SourceKindXaml: + break; + } + + return source; +} + +Json::Value Target::DumpCompileData(CompileData cd) +{ + Json::Value result = Json::objectValue; + + if (!cd.Language.empty()) { + result["language"] = cd.Language; + } + if (!cd.Sysroot.empty()) { + result["sysroot"] = this->DumpSysroot(cd.Sysroot); + } + if (!cd.Flags.empty()) { + result["compileCommandFragments"] = this->DumpCommandFragments(cd.Flags); + } + if (!cd.Includes.empty()) { + Json::Value includes = Json::arrayValue; + for (auto const& i : cd.Includes) { + includes.append(this->DumpInclude(i)); + } + result["includes"] = includes; + } + if (!cd.Defines.empty()) { + Json::Value defines = Json::arrayValue; + for (BT<std::string> const& d : cd.Defines) { + defines.append(this->DumpDefine(d)); + } + result["defines"] = std::move(defines); + } + + return result; +} + +Json::Value Target::DumpInclude(CompileData::IncludeEntry const& inc) +{ + Json::Value include = Json::objectValue; + include["path"] = inc.Path.Value; + if (inc.IsSystem) { + include["isSystem"] = true; + } + this->AddBacktrace(include, inc.Path.Backtrace); + return include; +} + +Json::Value Target::DumpDefine(BT<std::string> const& def) +{ + Json::Value define = Json::objectValue; + define["define"] = def.Value; + this->AddBacktrace(define, def.Backtrace); + return define; +} + +Json::Value Target::DumpSourceGroups() +{ + Json::Value sourceGroups = Json::arrayValue; + for (auto& sg : this->SourceGroups) { + sourceGroups.append(this->DumpSourceGroup(sg)); + } + return sourceGroups; +} + +Json::Value Target::DumpSourceGroup(SourceGroup& sg) +{ + Json::Value group = Json::objectValue; + group["name"] = sg.Name; + group["sourceIndexes"] = std::move(sg.SourceIndexes); + return group; +} + +Json::Value Target::DumpCompileGroups() +{ + Json::Value compileGroups = Json::arrayValue; + for (auto& cg : this->CompileGroups) { + compileGroups.append(this->DumpCompileGroup(cg)); + } + return compileGroups; +} + +Json::Value Target::DumpCompileGroup(CompileGroup& cg) +{ + Json::Value group = cg.Entry->first; + group["sourceIndexes"] = std::move(cg.SourceIndexes); + return group; +} + +Json::Value Target::DumpSysroot(std::string const& path) +{ + Json::Value sysroot = Json::objectValue; + sysroot["path"] = path; + return sysroot; +} + +Json::Value Target::DumpInstall() +{ + Json::Value install = Json::objectValue; + install["prefix"] = this->DumpInstallPrefix(); + install["destinations"] = this->DumpInstallDestinations(); + return install; +} + +Json::Value Target::DumpInstallPrefix() +{ + Json::Value prefix = Json::objectValue; + std::string p = + this->GT->Makefile->GetSafeDefinition("CMAKE_INSTALL_PREFIX"); + cmSystemTools::ConvertToUnixSlashes(p); + prefix["path"] = p; + return prefix; +} + +Json::Value Target::DumpInstallDestinations() +{ + Json::Value destinations = Json::arrayValue; + auto installGens = this->GT->Makefile->GetInstallGenerators(); + for (auto iGen : installGens) { + auto itGen = dynamic_cast<cmInstallTargetGenerator*>(iGen); + if (itGen != nullptr && itGen->GetTarget() == this->GT) { + destinations.append(this->DumpInstallDestination(itGen)); + } + } + return destinations; +} + +Json::Value Target::DumpInstallDestination(cmInstallTargetGenerator* itGen) +{ + Json::Value destination = Json::objectValue; + destination["path"] = itGen->GetDestination(this->Config); + this->AddBacktrace(destination, itGen->GetBacktrace()); + return destination; +} + +Json::Value Target::DumpArtifacts() +{ + Json::Value artifacts = Json::arrayValue; + + // Object libraries have only object files as artifacts. + if (this->GT->GetType() == cmStateEnums::OBJECT_LIBRARY) { + if (!this->GT->GetGlobalGenerator()->HasKnownObjectFileLocation(nullptr)) { + return artifacts; + } + std::vector<cmSourceFile const*> objectSources; + this->GT->GetObjectSources(objectSources, this->Config); + std::string const obj_dir = this->GT->GetObjectDirectory(this->Config); + for (cmSourceFile const* sf : objectSources) { + const std::string& obj = this->GT->GetObjectName(sf); + Json::Value artifact = Json::objectValue; + artifact["path"] = RelativeIfUnder(this->TopBuild, obj_dir + obj); + artifacts.append(std::move(artifact)); // NOLINT(*) + } + return artifacts; + } + + // Other target types always have a "main" artifact. + { + Json::Value artifact = Json::objectValue; + artifact["path"] = + RelativeIfUnder(this->TopBuild, + this->GT->GetFullPath( + this->Config, cmStateEnums::RuntimeBinaryArtifact)); + artifacts.append(std::move(artifact)); // NOLINT(*) + } + + // Add Windows-specific artifacts produced by the linker. + if (this->GT->IsDLLPlatform() && + this->GT->GetType() != cmStateEnums::STATIC_LIBRARY) { + if (this->GT->GetType() == cmStateEnums::SHARED_LIBRARY || + this->GT->IsExecutableWithExports()) { + Json::Value artifact = Json::objectValue; + artifact["path"] = + RelativeIfUnder(this->TopBuild, + this->GT->GetFullPath( + this->Config, cmStateEnums::ImportLibraryArtifact)); + artifacts.append(std::move(artifact)); // NOLINT(*) + } + cmGeneratorTarget::OutputInfo const* output = + this->GT->GetOutputInfo(this->Config); + if (output && !output->PdbDir.empty()) { + Json::Value artifact = Json::objectValue; + artifact["path"] = RelativeIfUnder(this->TopBuild, + output->PdbDir + '/' + + this->GT->GetPDBName(this->Config)); + artifacts.append(std::move(artifact)); // NOLINT(*) + } + } + return artifacts; +} + +Json::Value Target::DumpLink() +{ + Json::Value link = Json::objectValue; + std::string lang = this->GT->GetLinkerLanguage(this->Config); + link["language"] = lang; + { + Json::Value commandFragments = this->DumpLinkCommandFragments(); + if (!commandFragments.empty()) { + link["commandFragments"] = std::move(commandFragments); + } + } + if (const char* sysrootLink = + this->GT->Makefile->GetDefinition("CMAKE_SYSROOT_LINK")) { + link["sysroot"] = this->DumpSysroot(sysrootLink); + } else if (const char* sysroot = + this->GT->Makefile->GetDefinition("CMAKE_SYSROOT")) { + link["sysroot"] = this->DumpSysroot(sysroot); + } + if (this->GT->IsIPOEnabled(lang, this->Config)) { + link["lto"] = true; + } + return link; +} + +Json::Value Target::DumpArchive() +{ + Json::Value archive = Json::objectValue; + { + // The "link" fragments not relevant to static libraries are empty. + Json::Value commandFragments = this->DumpLinkCommandFragments(); + if (!commandFragments.empty()) { + archive["commandFragments"] = std::move(commandFragments); + } + } + std::string lang = this->GT->GetLinkerLanguage(this->Config); + if (this->GT->IsIPOEnabled(lang, this->Config)) { + archive["lto"] = true; + } + return archive; +} + +Json::Value Target::DumpLinkCommandFragments() +{ + Json::Value linkFragments = Json::arrayValue; + + std::string linkLanguageFlags; + std::string linkFlags; + std::string frameworkPath; + std::string linkPath; + std::string linkLibs; + cmLocalGenerator* lg = this->GT->GetLocalGenerator(); + cmLinkLineComputer linkLineComputer(lg, + lg->GetStateSnapshot().GetDirectory()); + lg->GetTargetFlags(&linkLineComputer, this->Config, linkLibs, + linkLanguageFlags, linkFlags, frameworkPath, linkPath, + this->GT); + linkLanguageFlags = cmSystemTools::TrimWhitespace(linkLanguageFlags); + linkFlags = cmSystemTools::TrimWhitespace(linkFlags); + frameworkPath = cmSystemTools::TrimWhitespace(frameworkPath); + linkPath = cmSystemTools::TrimWhitespace(linkPath); + linkLibs = cmSystemTools::TrimWhitespace(linkLibs); + + if (!linkLanguageFlags.empty()) { + linkFragments.append( + this->DumpCommandFragment(std::move(linkLanguageFlags), "flags")); + } + + if (!linkFlags.empty()) { + linkFragments.append( + this->DumpCommandFragment(std::move(linkFlags), "flags")); + } + + if (!frameworkPath.empty()) { + linkFragments.append( + this->DumpCommandFragment(std::move(frameworkPath), "frameworkPath")); + } + + if (!linkPath.empty()) { + linkFragments.append( + this->DumpCommandFragment(std::move(linkPath), "libraryPath")); + } + + if (!linkLibs.empty()) { + linkFragments.append( + this->DumpCommandFragment(std::move(linkLibs), "libraries")); + } + + return linkFragments; +} + +Json::Value Target::DumpCommandFragments( + std::vector<BT<std::string>> const& frags) +{ + Json::Value commandFragments = Json::arrayValue; + for (BT<std::string> const& f : frags) { + commandFragments.append(this->DumpCommandFragment(f)); + } + return commandFragments; +} + +Json::Value Target::DumpCommandFragment(BT<std::string> const& frag, + std::string const& role) +{ + Json::Value fragment = Json::objectValue; + fragment["fragment"] = frag.Value; + if (!role.empty()) { + fragment["role"] = role; + } + this->AddBacktrace(fragment, frag.Backtrace); + return fragment; +} + +Json::Value Target::DumpDependencies() +{ + Json::Value dependencies = Json::arrayValue; + cmGlobalGenerator* gg = this->GT->GetGlobalGenerator(); + for (cmTargetDepend const& td : gg->GetTargetDirectDepends(this->GT)) { + dependencies.append(this->DumpDependency(td)); + } + return dependencies; +} + +Json::Value Target::DumpDependency(cmTargetDepend const& td) +{ + Json::Value dependency = Json::objectValue; + dependency["id"] = TargetId(td, this->TopBuild); + this->AddBacktrace(dependency, td.GetBacktrace()); + return dependency; +} + +Json::Value Target::DumpFolder() +{ + Json::Value folder; + if (const char* f = this->GT->GetProperty("FOLDER")) { + folder = Json::objectValue; + folder["name"] = f; + } + return folder; +} +} + +Json::Value cmFileAPICodemodelDump(cmFileAPI& fileAPI, unsigned long version) +{ + Codemodel codemodel(fileAPI, version); + return codemodel.Dump(); +} diff --git a/Source/cmFileAPICodemodel.h b/Source/cmFileAPICodemodel.h new file mode 100644 index 0000000..ffbd928 --- /dev/null +++ b/Source/cmFileAPICodemodel.h @@ -0,0 +1,15 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ +#ifndef cmFileAPICodemodel_h +#define cmFileAPICodemodel_h + +#include "cmConfigure.h" // IWYU pragma: keep + +#include "cm_jsoncpp_value.h" + +class cmFileAPI; + +extern Json::Value cmFileAPICodemodelDump(cmFileAPI& fileAPI, + unsigned long version); + +#endif diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index f86e5e2..594cb67 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -10,6 +10,7 @@ #include <algorithm> #include <assert.h> +#include <cmath> #include <ctype.h> #include <memory> // IWYU pragma: keep #include <sstream> @@ -176,6 +177,12 @@ bool cmFileCommand::InitialPass(std::vector<std::string> const& args, if (subCommand == "LOCK") { return this->HandleLockCommand(args); } + if (subCommand == "SIZE") { + return this->HandleSizeCommand(args); + } + if (subCommand == "READ_SYMLINK") { + return this->HandleReadSymlinkCommand(args); + } std::string e = "does not recognize sub-command " + subCommand; this->SetError(e); @@ -1088,13 +1095,9 @@ protected: // Properties set by pattern and regex match rules. struct MatchProperties { - bool Exclude; - mode_t Permissions; - MatchProperties() - : Exclude(false) - , Permissions(0) - { - } + bool Exclude = false; + mode_t Permissions = 0; + MatchProperties() {} }; struct MatchRule { @@ -2602,10 +2605,10 @@ public: bool UpdatePercentage(double value, double total, std::string& status) { - int OldPercentage = this->CurrentPercentage; + long OldPercentage = this->CurrentPercentage; if (total > 0.0) { - this->CurrentPercentage = static_cast<int>(value / total * 100.0 + 0.5); + this->CurrentPercentage = std::lround(value / total * 100.0); if (this->CurrentPercentage > 100) { // Avoid extra progress reports for unexpected data beyond total. this->CurrentPercentage = 100; @@ -2627,7 +2630,7 @@ public: cmFileCommand* GetFileCommand() { return this->FileCommand; } private: - int CurrentPercentage; + long CurrentPercentage; cmFileCommand* FileCommand; std::string Text; }; @@ -2824,7 +2827,7 @@ bool cmFileCommand::HandleDownloadCommand(std::vector<std::string> const& args) std::string algo = i->substr(0, pos); expectedHash = cmSystemTools::LowerCase(i->substr(pos + 1)); hash = std::unique_ptr<cmCryptoHash>(cmCryptoHash::New(algo.c_str())); - if (!hash.get()) { + if (!hash) { std::string err = "DOWNLOAD EXPECTED_HASH given unknown ALGO: "; err += algo; this->SetError(err); @@ -3605,3 +3608,59 @@ bool cmFileCommand::HandleTimestampCommand( return true; } + +bool cmFileCommand::HandleSizeCommand(std::vector<std::string> const& args) +{ + if (args.size() != 3) { + std::ostringstream e; + e << args[0] << " requires a file name and output variable"; + this->SetError(e.str()); + return false; + } + + unsigned int argsIndex = 1; + + const std::string& filename = args[argsIndex++]; + + const std::string& outputVariable = args[argsIndex++]; + + if (!cmSystemTools::FileExists(filename, true)) { + std::ostringstream e; + e << "SIZE requested of path that is not readable:\n " << filename; + this->SetError(e.str()); + return false; + } + + this->Makefile->AddDefinition( + outputVariable, + std::to_string(cmSystemTools::FileLength(filename)).c_str()); + + return true; +} + +bool cmFileCommand::HandleReadSymlinkCommand( + std::vector<std::string> const& args) +{ + if (args.size() != 3) { + std::ostringstream e; + e << args[0] << " requires a file name and output variable"; + this->SetError(e.str()); + return false; + } + + const std::string& filename = args[1]; + const std::string& outputVariable = args[2]; + + std::string result; + if (!cmSystemTools::ReadSymlink(filename, result)) { + std::ostringstream e; + e << "READ_SYMLINK requested of path that is not a symlink:\n " + << filename; + this->SetError(e.str()); + return false; + } + + this->Makefile->AddDefinition(outputVariable, result.c_str()); + + return true; +} diff --git a/Source/cmFileCommand.h b/Source/cmFileCommand.h index 719dca2..fe05c98 100644 --- a/Source/cmFileCommand.h +++ b/Source/cmFileCommand.h @@ -59,6 +59,8 @@ protected: bool HandleTimestampCommand(std::vector<std::string> const& args); bool HandleGenerateCommand(std::vector<std::string> const& args); bool HandleLockCommand(std::vector<std::string> const& args); + bool HandleSizeCommand(std::vector<std::string> const& args); + bool HandleReadSymlinkCommand(std::vector<std::string> const& args); private: void AddEvaluationFile(const std::string& inputName, diff --git a/Source/cmFileLock.h b/Source/cmFileLock.h index 6c9a7b8..491a40b 100644 --- a/Source/cmFileLock.h +++ b/Source/cmFileLock.h @@ -51,14 +51,13 @@ private: cmFileLockResult LockWithTimeout(unsigned long timeoutSec); #if defined(_WIN32) - typedef HANDLE FileId; + HANDLE File = INVALID_HANDLE_VALUE; BOOL LockFile(DWORD flags); #else - typedef int FileId; + int File = -1; int LockFile(int cmd, int type); #endif - FileId File; std::string Filename; }; diff --git a/Source/cmFileLockUnix.cxx b/Source/cmFileLockUnix.cxx index 7353b01..9b653e8 100644 --- a/Source/cmFileLockUnix.cxx +++ b/Source/cmFileLockUnix.cxx @@ -9,7 +9,6 @@ #include <unistd.h> cmFileLock::cmFileLock() - : File(-1) { } diff --git a/Source/cmFileLockWin32.cxx b/Source/cmFileLockWin32.cxx index 51ac249..a61d360 100644 --- a/Source/cmFileLockWin32.cxx +++ b/Source/cmFileLockWin32.cxx @@ -6,7 +6,6 @@ #include <windows.h> // CreateFileW cmFileLock::cmFileLock() - : File(INVALID_HANDLE_VALUE) { } diff --git a/Source/cmFindLibraryCommand.cxx b/Source/cmFindLibraryCommand.cxx index 1e1ab14..5a5d036 100644 --- a/Source/cmFindLibraryCommand.cxx +++ b/Source/cmFindLibraryCommand.cxx @@ -198,13 +198,10 @@ struct cmFindLibraryHelper // Current names under consideration. struct Name { - bool TryRaw; + bool TryRaw = false; std::string Raw; cmsys::RegularExpression Regex; - Name() - : TryRaw(false) - { - } + Name() {} }; std::vector<Name> Names; diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index bf928fc..3d9cd08 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/Source/cmFindPackageCommand.cxx @@ -1675,11 +1675,7 @@ private: class cmFileList { public: - cmFileList() - : First() - , Last(nullptr) - { - } + cmFileList() {} virtual ~cmFileList() {} cmFileList& operator/(cmFileListGeneratorBase const& rhs) { @@ -1703,15 +1699,14 @@ private: virtual bool Visit(std::string const& fullPath) = 0; friend class cmFileListGeneratorBase; std::unique_ptr<cmFileListGeneratorBase> First; - cmFileListGeneratorBase* Last; + cmFileListGeneratorBase* Last = nullptr; }; class cmFindPackageFileList : public cmFileList { public: cmFindPackageFileList(cmFindPackageCommand* fpc, bool use_suffixes = true) - : cmFileList() - , FPC(fpc) + : FPC(fpc) , UseSuffixes(use_suffixes) { } @@ -1753,13 +1748,11 @@ class cmFileListGeneratorFixed : public cmFileListGeneratorBase { public: cmFileListGeneratorFixed(std::string const& str) - : cmFileListGeneratorBase() - , String(str) + : String(str) { } cmFileListGeneratorFixed(cmFileListGeneratorFixed const& r) - : cmFileListGeneratorBase() - , String(r.String) + : String(r.String) { } @@ -1782,13 +1775,11 @@ class cmFileListGeneratorEnumerate : public cmFileListGeneratorBase { public: cmFileListGeneratorEnumerate(std::vector<std::string> const& v) - : cmFileListGeneratorBase() - , Vector(v) + : Vector(v) { } cmFileListGeneratorEnumerate(cmFileListGeneratorEnumerate const& r) - : cmFileListGeneratorBase() - , Vector(r.Vector) + : Vector(r.Vector) { } @@ -1817,14 +1808,12 @@ public: cmFileListGeneratorProject(std::vector<std::string> const& names, cmFindPackageCommand::SortOrderType so, cmFindPackageCommand::SortDirectionType sd) - : cmFileListGeneratorBase() - , Names(names) + : Names(names) { this->SetSort(so, sd); } cmFileListGeneratorProject(cmFileListGeneratorProject const& r) - : cmFileListGeneratorBase() - , Names(r.Names) + : Names(r.Names) { this->SetSort(r.SortOrder, r.SortDirection); } @@ -1888,14 +1877,12 @@ class cmFileListGeneratorMacProject : public cmFileListGeneratorBase public: cmFileListGeneratorMacProject(std::vector<std::string> const& names, const char* ext) - : cmFileListGeneratorBase() - , Names(names) + : Names(names) , Extension(ext) { } cmFileListGeneratorMacProject(cmFileListGeneratorMacProject const& r) - : cmFileListGeneratorBase() - , Names(r.Names) + : Names(r.Names) , Extension(r.Extension) { } @@ -1941,14 +1928,12 @@ class cmFileListGeneratorCaseInsensitive : public cmFileListGeneratorBase { public: cmFileListGeneratorCaseInsensitive(std::string const& str) - : cmFileListGeneratorBase() - , String(str) + : String(str) { } cmFileListGeneratorCaseInsensitive( cmFileListGeneratorCaseInsensitive const& r) - : cmFileListGeneratorBase() - , String(r.String) + : String(r.String) { } @@ -1985,13 +1970,11 @@ class cmFileListGeneratorGlob : public cmFileListGeneratorBase { public: cmFileListGeneratorGlob(std::string const& str) - : cmFileListGeneratorBase() - , Pattern(str) + : Pattern(str) { } cmFileListGeneratorGlob(cmFileListGeneratorGlob const& r) - : cmFileListGeneratorBase() - , Pattern(r.Pattern) + : Pattern(r.Pattern) { } diff --git a/Source/cmForEachCommand.cxx b/Source/cmForEachCommand.cxx index 9ff967c..739c9c0 100644 --- a/Source/cmForEachCommand.cxx +++ b/Source/cmForEachCommand.cxx @@ -38,7 +38,7 @@ bool cmForEachFunctionBlocker::IsFunctionBlocked(const cmListFileFunction& lff, // Remove the function blocker for this scope or bail. std::unique_ptr<cmFunctionBlocker> fb( mf.RemoveFunctionBlocker(this, lff)); - if (!fb.get()) { + if (!fb) { return false; } diff --git a/Source/cmGeneratedFileStream.cxx b/Source/cmGeneratedFileStream.cxx index 186ec8c..bf53dbf 100644 --- a/Source/cmGeneratedFileStream.cxx +++ b/Source/cmGeneratedFileStream.cxx @@ -12,8 +12,6 @@ #endif cmGeneratedFileStream::cmGeneratedFileStream(Encoding encoding) - : cmGeneratedFileStreamBase() - , Stream() { #ifdef CMAKE_BUILD_WITH_CMAKE if (encoding != codecvt::None) { @@ -105,22 +103,10 @@ void cmGeneratedFileStream::SetCompressionExtraExtension(bool ext) } cmGeneratedFileStreamBase::cmGeneratedFileStreamBase() - : Name() - , TempName() - , CopyIfDifferent(false) - , Okay(false) - , Compress(false) - , CompressExtraExtension(true) { } cmGeneratedFileStreamBase::cmGeneratedFileStreamBase(std::string const& name) - : Name() - , TempName() - , CopyIfDifferent(false) - , Okay(false) - , Compress(false) - , CompressExtraExtension(true) { this->Open(name); } diff --git a/Source/cmGeneratedFileStream.h b/Source/cmGeneratedFileStream.h index dacd166..fd11889 100644 --- a/Source/cmGeneratedFileStream.h +++ b/Source/cmGeneratedFileStream.h @@ -45,16 +45,16 @@ protected: std::string TempName; // Whether to do a copy-if-different. - bool CopyIfDifferent; + bool CopyIfDifferent = false; // Whether the real file stream was valid when it was closed. - bool Okay; + bool Okay = false; // Whether the destination file is compressed - bool Compress; + bool Compress = false; // Whether the destination file is compressed - bool CompressExtraExtension; + bool CompressExtraExtension = true; }; /** \class cmGeneratedFileStream diff --git a/Source/cmGeneratorExpressionLexer.cxx b/Source/cmGeneratorExpressionLexer.cxx index e37f165..242915d 100644 --- a/Source/cmGeneratorExpressionLexer.cxx +++ b/Source/cmGeneratorExpressionLexer.cxx @@ -3,8 +3,6 @@ #include "cmGeneratorExpressionLexer.h" cmGeneratorExpressionLexer::cmGeneratorExpressionLexer() - : SawBeginExpression(false) - , SawGeneratorExpression(false) { } diff --git a/Source/cmGeneratorExpressionLexer.h b/Source/cmGeneratorExpressionLexer.h index e53f0b5..bf24308 100644 --- a/Source/cmGeneratorExpressionLexer.h +++ b/Source/cmGeneratorExpressionLexer.h @@ -46,8 +46,8 @@ public: } private: - bool SawBeginExpression; - bool SawGeneratorExpression; + bool SawBeginExpression = false; + bool SawGeneratorExpression = false; }; #endif diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx index 49b97fb..eb3df16 100644 --- a/Source/cmGeneratorExpressionNode.cxx +++ b/Source/cmGeneratorExpressionNode.cxx @@ -283,14 +283,39 @@ static const struct InListNode : public cmGeneratorExpressionNode std::string Evaluate( const std::vector<std::string>& parameters, - cmGeneratorExpressionContext* /*context*/, + cmGeneratorExpressionContext* context, const GeneratorExpressionContent* /*content*/, cmGeneratorExpressionDAGChecker* /*dagChecker*/) const override { - std::vector<std::string> values; - cmSystemTools::ExpandListArgument(parameters[1], values); - if (values.empty()) { - return "0"; + std::vector<std::string> values, checkValues; + bool check = false; + switch (context->LG->GetPolicyStatus(cmPolicies::CMP0085)) { + case cmPolicies::WARN: + if (parameters.front().empty()) { + check = true; + cmSystemTools::ExpandListArgument(parameters[1], checkValues, true); + } + CM_FALLTHROUGH; + case cmPolicies::OLD: + cmSystemTools::ExpandListArgument(parameters[1], values); + if (check && values != checkValues) { + std::ostringstream e; + e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0085) + << "\nSearch Item:\n \"" << parameters.front() + << "\"\nList:\n \"" << parameters[1] << "\"\n"; + context->LG->GetCMakeInstance()->IssueMessage( + cmake::AUTHOR_WARNING, e.str(), context->Backtrace); + return "0"; + } + if (values.empty()) { + return "0"; + } + break; + case cmPolicies::REQUIRED_IF_USED: + case cmPolicies::REQUIRED_ALWAYS: + case cmPolicies::NEW: + cmSystemTools::ExpandListArgument(parameters[1], values, true); + break; } return std::find(values.cbegin(), values.cend(), parameters.front()) == diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 0b28d1e..80d81d5 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -4379,8 +4379,7 @@ const char* impliedValue<const char*>(const char* /*unused*/) return ""; } template <> -std::string impliedValue<std::string>( - std::string /*unused*/) // NOLINT(clang-tidy) +std::string impliedValue<std::string>(std::string /*unused*/) // NOLINT(*) { return std::string(); } diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h index 52defee..cfd1df0 100644 --- a/Source/cmGeneratorTarget.h +++ b/Source/cmGeneratorTarget.h @@ -110,11 +110,8 @@ public: std::set<std::string> ExpectedResxHeaders; std::set<std::string> ExpectedXamlHeaders; std::set<std::string> ExpectedXamlSources; - bool Initialized; - KindedSources() - : Initialized(false) - { - } + bool Initialized = false; + KindedSources() {} }; /** Get all sources needed for a configuration with kinds assigned. */ @@ -565,13 +562,9 @@ public: }; struct SourceFileFlags { - SourceFileFlags() - : Type(SourceFileTypeNormal) - , MacFolder(nullptr) - { - } - SourceFileType Type; - const char* MacFolder; // location inside Mac content folders + SourceFileFlags() {} + SourceFileType Type = SourceFileTypeNormal; + const char* MacFolder = nullptr; // location inside Mac content folders }; void GetAutoUicOptions(std::vector<std::string>& result, const std::string& config) const; @@ -757,11 +750,8 @@ private: struct CompatibleInterfaces : public CompatibleInterfacesBase { - CompatibleInterfaces() - : Done(false) - { - } - bool Done; + CompatibleInterfaces() {} + bool Done = false; }; mutable std::map<std::string, CompatibleInterfaces> CompatibleInterfacesMap; @@ -774,11 +764,8 @@ private: struct LinkImplClosure : public std::vector<cmGeneratorTarget const*> { - LinkImplClosure() - : Done(false) - { - } - bool Done; + LinkImplClosure() {} + bool Done = false; }; mutable std::map<std::string, LinkImplClosure> LinkImplClosureMap; @@ -797,15 +784,10 @@ private: // Cache import information from properties for each configuration. struct ImportInfo { - ImportInfo() - : NoSOName(false) - , Managed(Native) - , Multiplicity(0) - { - } - bool NoSOName; - ManagedType Managed; - unsigned int Multiplicity; + ImportInfo() {} + bool NoSOName = false; + ManagedType Managed = Native; + unsigned int Multiplicity = 0; std::string Location; std::string SOName; std::string ImportLibrary; diff --git a/Source/cmGlobVerificationManager.h b/Source/cmGlobVerificationManager.h index cf04c97..cdbd275 100644 --- a/Source/cmGlobVerificationManager.h +++ b/Source/cmGlobVerificationManager.h @@ -70,13 +70,10 @@ private: struct CacheEntryValue { - bool Initialized; + bool Initialized = false; std::vector<std::string> Files; std::vector<std::pair<std::string, cmListFileBacktrace>> Backtraces; - CacheEntryValue() - : Initialized(false) - { - } + CacheEntryValue() {} }; typedef std::map<CacheEntryKey, CacheEntryValue> CacheEntryMap; diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 9326e5f..47c53e7 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -112,6 +112,15 @@ cmGlobalGenerator::~cmGlobalGenerator() delete this->ExtraGenerator; } +#if defined(CMAKE_BUILD_WITH_CMAKE) +Json::Value cmGlobalGenerator::GetJson() const +{ + Json::Value generator = Json::objectValue; + generator["name"] = this->GetName(); + return generator; +} +#endif + bool cmGlobalGenerator::SetGeneratorInstance(std::string const& i, cmMakefile* mf) { @@ -1204,7 +1213,7 @@ void cmGlobalGenerator::Configure() const char* logs[] = { "CMakeOutput.log", "CMakeError.log", nullptr }; for (const char** log = logs; *log; ++log) { std::string f = this->CMakeInstance->GetHomeOutputDirectory(); - f += this->CMakeInstance->GetCMakeFilesDirectory(); + f += cmake::GetCMakeFilesDirectory(); f += "/"; f += *log; if (cmSystemTools::FileExists(f)) { @@ -2808,7 +2817,7 @@ void cmGlobalGenerator::CheckRuleHashes() #if defined(CMAKE_BUILD_WITH_CMAKE) std::string home = this->GetCMakeInstance()->GetHomeOutputDirectory(); std::string pfile = home; - pfile += this->GetCMakeInstance()->GetCMakeFilesDirectory(); + pfile += cmake::GetCMakeFilesDirectory(); pfile += "/CMakeRuleHashes.txt"; this->CheckRuleHashes(pfile, home); this->WriteRuleHashes(pfile); diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index 1ea2d24..36d3d10 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -24,6 +24,7 @@ #if defined(CMAKE_BUILD_WITH_CMAKE) # include "cmFileLockPool.h" +# include "cm_jsoncpp_value.h" #endif #define CMAKE_DIRECTORY_ID_SEP "::@" @@ -70,6 +71,11 @@ public: return codecvt::None; } +#if defined(CMAKE_BUILD_WITH_CMAKE) + /** Get a JSON object describing the generator. */ + virtual Json::Value GetJson() const; +#endif + /** Tell the generator about the target system. */ virtual bool SetSystemName(std::string const&, cmMakefile*) { return true; } @@ -472,11 +478,8 @@ protected: cmCustomCommandLines CommandLines; std::vector<std::string> Depends; std::string WorkingDir; - bool UsesTerminal; - GlobalTargetInfo() - : UsesTerminal(false) - { - } + bool UsesTerminal = false; + GlobalTargetInfo() {} }; void CreateDefaultGlobalTargets(std::vector<GlobalTargetInfo>& targets); @@ -602,13 +605,10 @@ private: // Cache directory content and target files to be built. struct DirectoryContent { - long LastDiskTime; + long LastDiskTime = -1; std::set<std::string> All; std::set<std::string> Generated; - DirectoryContent() - : LastDiskTime(-1) - { - } + DirectoryContent() {} }; std::map<std::string, DirectoryContent> DirectoryContentMap; diff --git a/Source/cmGlobalGhsMultiGenerator.h b/Source/cmGlobalGhsMultiGenerator.h index 13c5113..a5aff73 100644 --- a/Source/cmGlobalGhsMultiGenerator.h +++ b/Source/cmGlobalGhsMultiGenerator.h @@ -25,13 +25,13 @@ public: } ///! create the correct local generator - virtual cmLocalGenerator* CreateLocalGenerator(cmMakefile* mf); + cmLocalGenerator* CreateLocalGenerator(cmMakefile* mf) override; /// @return the name of this generator. static std::string GetActualName() { return "Green Hills MULTI"; } ///! Get the name for this generator - virtual std::string GetName() const { return this->GetActualName(); } + std::string GetName() const override { return this->GetActualName(); } /// Overloaded methods. @see cmGlobalGenerator::GetDocumentation() static void GetDocumentation(cmDocumentationEntry& entry); @@ -49,15 +49,15 @@ public: static bool SupportsPlatform() { return true; } // Toolset / Platform Support - virtual bool SetGeneratorToolset(std::string const& ts, cmMakefile* mf); - virtual bool SetGeneratorPlatform(std::string const& p, cmMakefile* mf); + bool SetGeneratorToolset(std::string const& ts, cmMakefile* mf) override; + bool SetGeneratorPlatform(std::string const& p, cmMakefile* mf) override; /** * Try to determine system information such as shared library * extension, pthreads, byte order etc. */ - virtual void EnableLanguage(std::vector<std::string> const& languages, - cmMakefile*, bool optional); + void EnableLanguage(std::vector<std::string> const& languages, cmMakefile*, + bool optional) override; /* * Determine what program to use for building the project. */ @@ -88,13 +88,16 @@ public: inline bool IsOSDirRelative() { return this->OSDirRelative; } protected: - virtual void Generate(); - virtual void GenerateBuildCommand( - std::vector<std::string>& makeCommand, const std::string& makeProgram, - const std::string& projectName, const std::string& projectDir, - const std::string& targetName, const std::string& config, bool fast, - int jobs, bool verbose, - std::vector<std::string> const& makeOptions = std::vector<std::string>()); + void Generate() override; + void GenerateBuildCommand(std::vector<std::string>& makeCommand, + const std::string& makeProgram, + const std::string& projectName, + const std::string& projectDir, + const std::string& targetName, + const std::string& config, bool fast, int jobs, + bool verbose, + std::vector<std::string> const& makeOptions = + std::vector<std::string>()) override; private: void GetToolset(cmMakefile* mf, std::string& tsd, std::string& ts); diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index fbc756c..dcd2585 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -112,7 +112,7 @@ std::string cmGlobalNinjaGenerator::EncodeLiteral(const std::string& lit) std::string cmGlobalNinjaGenerator::EncodePath(const std::string& path) { - std::string result = path; // NOLINT(clang-tidy) + std::string result = path; #ifdef _WIN32 if (this->IsGCCOnWindows()) std::replace(result.begin(), result.end(), '\\', '/'); @@ -254,7 +254,7 @@ void cmGlobalNinjaGenerator::WriteCustomCommandBuild( bool restat, const cmNinjaDeps& outputs, const cmNinjaDeps& deps, const cmNinjaDeps& orderOnly) { - std::string cmd = command; // NOLINT(clang-tidy) + std::string cmd = command; // NOLINT(*) #ifdef _WIN32 if (cmd.empty()) // TODO Shouldn't an empty command be handled by ninja? @@ -447,8 +447,6 @@ cmGlobalNinjaGenerator::cmGlobalNinjaGenerator(cmake* cm) , BuildFileStream(nullptr) , RulesFileStream(nullptr) , CompileCommandsStream(nullptr) - , Rules() - , AllDependencies() , UsingGCCOnWindows(false) , ComputingUnknownDependencies(false) , PolicyCMP0058(cmPolicies::WARN) @@ -503,7 +501,7 @@ void cmGlobalNinjaGenerator::Generate() std::ostringstream msg; msg << "The detected version of Ninja (" << this->NinjaVersion; msg << ") is less than the version of Ninja required by CMake ("; - msg << this->RequiredNinjaVersion() << ")."; + msg << cmGlobalNinjaGenerator::RequiredNinjaVersion() << ")."; this->GetCMakeInstance()->IssueMessage(cmake::FATAL_ERROR, msg.str()); return; } @@ -577,7 +575,7 @@ void cmGlobalNinjaGenerator::CheckNinjaFeatures() RequiredNinjaVersionForConsolePool().c_str()); this->NinjaSupportsImplicitOuts = !cmSystemTools::VersionCompare( cmSystemTools::OP_LESS, this->NinjaVersion.c_str(), - this->RequiredNinjaVersionForImplicitOuts().c_str()); + cmGlobalNinjaGenerator::RequiredNinjaVersionForImplicitOuts().c_str()); this->NinjaSupportsManifestRestat = !cmSystemTools::VersionCompare( cmSystemTools::OP_LESS, this->NinjaVersion.c_str(), RequiredNinjaVersionForManifestRestat().c_str()); @@ -1425,7 +1423,9 @@ void cmGlobalNinjaGenerator::WriteTargetRebuildManifest(std::ostream& os) << "is less than the version of Ninja required by CMake for adding " "restat dependencies to the build.ninja manifest regeneration " "target:\n" - << " " << this->RequiredNinjaVersionForManifestRestat() << "\n"; + << " " + << cmGlobalNinjaGenerator::RequiredNinjaVersionForManifestRestat() + << "\n"; msg << "Any pre-check scripts, such as those generated for file(GLOB " "CONFIGURE_DEPENDS), will not be run by Ninja."; this->GetCMakeInstance()->IssueMessage(cmake::AUTHOR_WARNING, msg.str()); @@ -1940,7 +1940,7 @@ int cmcmd_cmake_ninja_dyndep(std::vector<std::string>::const_iterator argBeg, cm.SetHomeOutputDirectory(dir_top_bld); std::unique_ptr<cmGlobalNinjaGenerator> ggd( static_cast<cmGlobalNinjaGenerator*>(cm.CreateGlobalGenerator("Ninja"))); - if (!ggd.get() || + if (!ggd || !ggd->WriteDyndepFile(dir_top_src, dir_top_bld, dir_cur_src, dir_cur_bld, arg_dd, arg_ddis, module_dir, linked_target_dirs)) { diff --git a/Source/cmGlobalUnixMakefileGenerator3.h b/Source/cmGlobalUnixMakefileGenerator3.h index a2ad095..6199586 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.h +++ b/Source/cmGlobalUnixMakefileGenerator3.h @@ -217,11 +217,8 @@ protected: // Store per-target progress counters. struct TargetProgress { - TargetProgress() - : NumberOfActions(0) - { - } - unsigned long NumberOfActions; + TargetProgress() {} + unsigned long NumberOfActions = 0; std::string VariableFile; std::vector<unsigned long> Marks; void WriteProgressVariables(unsigned long total, unsigned long& current); diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx index 82fcaad..c9c6938 100644 --- a/Source/cmGlobalVisualStudio10Generator.cxx +++ b/Source/cmGlobalVisualStudio10Generator.cxx @@ -8,19 +8,11 @@ #include "cmLocalVisualStudio10Generator.h" #include "cmMakefile.h" #include "cmSourceFile.h" -#include "cmVS10CLFlagTable.h" -#include "cmVS10CSharpFlagTable.h" -#include "cmVS10CudaFlagTable.h" -#include "cmVS10CudaHostFlagTable.h" -#include "cmVS10LibFlagTable.h" -#include "cmVS10LinkFlagTable.h" -#include "cmVS10MASMFlagTable.h" -#include "cmVS10NASMFlagTable.h" -#include "cmVS10RCFlagTable.h" #include "cmVersion.h" #include "cmVisualStudioSlnData.h" #include "cmVisualStudioSlnParser.h" #include "cmXMLWriter.h" +#include "cm_jsoncpp_reader.h" #include "cmake.h" #include "cmsys/FStream.hxx" @@ -30,6 +22,7 @@ #include <algorithm> static const char vs10generatorName[] = "Visual Studio 10 2010"; +static std::map<std::string, std::vector<cmIDEFlagTable>> loadedFlagJsonFiles; // Map generator name without year to name with year. static const char* cmVS10GenName(const std::string& name, std::string& genName) @@ -120,15 +113,16 @@ cmGlobalVisualStudio10Generator::cmGlobalVisualStudio10Generator( this->DefaultPlatformToolset = "v100"; } } - this->DefaultClFlagTable = cmVS10CLFlagTable; - this->DefaultCSharpFlagTable = cmVS10CSharpFlagTable; - this->DefaultLibFlagTable = cmVS10LibFlagTable; - this->DefaultLinkFlagTable = cmVS10LinkFlagTable; - this->DefaultCudaFlagTable = cmVS10CudaFlagTable; - this->DefaultCudaHostFlagTable = cmVS10CudaHostFlagTable; - this->DefaultMasmFlagTable = cmVS10MASMFlagTable; - this->DefaultNasmFlagTable = cmVS10NASMFlagTable; - this->DefaultRcFlagTable = cmVS10RCFlagTable; + this->DefaultCLFlagTableName = "v10"; + this->DefaultCSharpFlagTableName = "v10"; + this->DefaultLibFlagTableName = "v10"; + this->DefaultLinkFlagTableName = "v10"; + this->DefaultCudaFlagTableName = "v10"; + this->DefaultCudaHostFlagTableName = "v10"; + this->DefaultMasmFlagTableName = "v10"; + this->DefaultNasmFlagTableName = "v10"; + this->DefaultRCFlagTableName = "v10"; + this->Version = VS10; this->PlatformToolsetNeedsDebugEnum = false; } @@ -1050,67 +1044,174 @@ std::string cmGlobalVisualStudio10Generator::GetInstalledNsightTegraVersion() return version; } +static std::string cmLoadFlagTableString(Json::Value entry, const char* field) +{ + if (entry.isMember(field)) { + auto string = entry[field]; + if (string.isConvertibleTo(Json::ValueType::stringValue)) { + return string.asString(); + } + } + return ""; +} + +static unsigned int cmLoadFlagTableSpecial(Json::Value entry, + const char* field) +{ + unsigned int value = 0; + if (entry.isMember(field)) { + auto specials = entry[field]; + if (specials.isArray()) { + for (auto const& special : specials) { + std::string s = special.asString(); + if (s == "UserValue") { + value |= cmIDEFlagTable::UserValue; + } else if (s == "UserIgnored") { + value |= cmIDEFlagTable::UserIgnored; + } else if (s == "UserRequired") { + value |= cmIDEFlagTable::UserRequired; + } else if (s == "Continue") { + value |= cmIDEFlagTable::Continue; + } else if (s == "SemicolonAppendable") { + value |= cmIDEFlagTable::SemicolonAppendable; + } else if (s == "UserFollowing") { + value |= cmIDEFlagTable::UserFollowing; + } else if (s == "CaseInsensitive") { + value |= cmIDEFlagTable::CaseInsensitive; + } else if (s == "SpaceAppendable") { + value |= cmIDEFlagTable::SpaceAppendable; + } + } + } + } + return value; +} + +static cmIDEFlagTable const* cmLoadFlagTableJson( + std::string const& flagJsonPath) +{ + cmIDEFlagTable* ret = nullptr; + auto savedFlagIterator = loadedFlagJsonFiles.find(flagJsonPath); + if (savedFlagIterator != loadedFlagJsonFiles.end()) { + ret = savedFlagIterator->second.data(); + } else { + Json::Reader reader; + cmsys::ifstream stream; + + stream.open(flagJsonPath.c_str(), std::ios_base::in); + if (stream) { + Json::Value flags; + if (reader.parse(stream, flags, false) && flags.isArray()) { + std::vector<cmIDEFlagTable> flagTable; + for (auto const& flag : flags) { + cmIDEFlagTable flagEntry; + flagEntry.IDEName = cmLoadFlagTableString(flag, "name"); + flagEntry.commandFlag = cmLoadFlagTableString(flag, "switch"); + flagEntry.comment = cmLoadFlagTableString(flag, "comment"); + flagEntry.value = cmLoadFlagTableString(flag, "value"); + flagEntry.special = cmLoadFlagTableSpecial(flag, "flags"); + flagTable.push_back(flagEntry); + } + cmIDEFlagTable endFlag{ "", "", "", "", 0 }; + flagTable.push_back(endFlag); + + loadedFlagJsonFiles[flagJsonPath] = flagTable; + ret = loadedFlagJsonFiles[flagJsonPath].data(); + } + } + } + return ret; +} + +cmIDEFlagTable const* cmGlobalVisualStudio10Generator::LoadFlagTable( + std::string const& flagTableName, std::string const& table) const +{ + cmIDEFlagTable const* ret = nullptr; + + std::string filename = cmSystemTools::GetCMakeRoot() + + "/Templates/MSBuild/FlagTables/" + flagTableName + "_" + table + ".json"; + ret = cmLoadFlagTableJson(filename); + + if (!ret) { + cmMakefile* mf = this->GetCurrentMakefile(); + + std::ostringstream e; + /* clang-format off */ + e << "JSON flag table \"" << filename << + "\" could not be loaded.\n"; + /* clang-format on */ + mf->IssueMessage(cmake::FATAL_ERROR, e.str().c_str()); + } + return ret; +} + cmIDEFlagTable const* cmGlobalVisualStudio10Generator::GetClFlagTable() const { - cmIDEFlagTable const* table = this->ToolsetOptions.GetClFlagTable( - this->GetPlatformName(), this->GetPlatformToolsetString()); + std::string flagTableName = this->ToolsetOptions.GetClFlagTableName( + this->GetPlatformName(), this->GetPlatformToolsetString(), + this->DefaultCLFlagTableName); - return (table != nullptr) ? table : this->DefaultClFlagTable; + return LoadFlagTable(flagTableName, "CL"); } cmIDEFlagTable const* cmGlobalVisualStudio10Generator::GetCSharpFlagTable() const { - cmIDEFlagTable const* table = this->ToolsetOptions.GetCSharpFlagTable( - this->GetPlatformName(), this->GetPlatformToolsetString()); + std::string flagTableName = this->ToolsetOptions.GetCSharpFlagTableName( + this->GetPlatformName(), this->GetPlatformToolsetString(), + this->DefaultCSharpFlagTableName); - return (table != nullptr) ? table : this->DefaultCSharpFlagTable; + return LoadFlagTable(flagTableName, "CSharp"); } cmIDEFlagTable const* cmGlobalVisualStudio10Generator::GetRcFlagTable() const { - cmIDEFlagTable const* table = this->ToolsetOptions.GetRcFlagTable( - this->GetPlatformName(), this->GetPlatformToolsetString()); + std::string flagTableName = this->ToolsetOptions.GetRcFlagTableName( + this->GetPlatformName(), this->GetPlatformToolsetString(), + this->DefaultRCFlagTableName); - return (table != nullptr) ? table : this->DefaultRcFlagTable; + return LoadFlagTable(flagTableName, "RC"); } cmIDEFlagTable const* cmGlobalVisualStudio10Generator::GetLibFlagTable() const { - cmIDEFlagTable const* table = this->ToolsetOptions.GetLibFlagTable( - this->GetPlatformName(), this->GetPlatformToolsetString()); + std::string flagTableName = this->ToolsetOptions.GetLibFlagTableName( + this->GetPlatformName(), this->GetPlatformToolsetString(), + this->DefaultLibFlagTableName); - return (table != nullptr) ? table : this->DefaultLibFlagTable; + return LoadFlagTable(flagTableName, "LIB"); } cmIDEFlagTable const* cmGlobalVisualStudio10Generator::GetLinkFlagTable() const { - cmIDEFlagTable const* table = this->ToolsetOptions.GetLinkFlagTable( - this->GetPlatformName(), this->GetPlatformToolsetString()); + std::string flagTableName = this->ToolsetOptions.GetLinkFlagTableName( + this->GetPlatformName(), this->GetPlatformToolsetString(), + this->DefaultLinkFlagTableName); - return (table != nullptr) ? table : this->DefaultLinkFlagTable; + return LoadFlagTable(flagTableName, "Link"); } cmIDEFlagTable const* cmGlobalVisualStudio10Generator::GetCudaFlagTable() const { - return this->DefaultCudaFlagTable; + return LoadFlagTable(this->DefaultCudaFlagTableName, "Cuda"); } cmIDEFlagTable const* cmGlobalVisualStudio10Generator::GetCudaHostFlagTable() const { - return this->DefaultCudaHostFlagTable; + return LoadFlagTable(this->DefaultCudaHostFlagTableName, "CudaHost"); } cmIDEFlagTable const* cmGlobalVisualStudio10Generator::GetMasmFlagTable() const { - cmIDEFlagTable const* table = this->ToolsetOptions.GetMasmFlagTable( - this->GetPlatformName(), this->GetPlatformToolsetString()); + std::string flagTableName = this->ToolsetOptions.GetMasmFlagTableName( + this->GetPlatformName(), this->GetPlatformToolsetString(), + this->DefaultMasmFlagTableName); - return (table != nullptr) ? table : this->DefaultMasmFlagTable; + return LoadFlagTable(flagTableName, "MASM"); } cmIDEFlagTable const* cmGlobalVisualStudio10Generator::GetNasmFlagTable() const { - return this->DefaultNasmFlagTable; + return LoadFlagTable(this->DefaultNasmFlagTableName, "NASM"); } diff --git a/Source/cmGlobalVisualStudio10Generator.h b/Source/cmGlobalVisualStudio10Generator.h index 63e6903..dc49ded 100644 --- a/Source/cmGlobalVisualStudio10Generator.h +++ b/Source/cmGlobalVisualStudio10Generator.h @@ -86,7 +86,7 @@ public: } /** Return true if building for WindowsCE */ - bool TargetsWindowsCE() const { return this->SystemIsWindowsCE; } + bool TargetsWindowsCE() const override { return this->SystemIsWindowsCE; } /** Return true if building for WindowsPhone */ bool TargetsWindowsPhone() const { return this->SystemIsWindowsPhone; } @@ -140,10 +140,13 @@ protected: virtual bool SelectWindowsPhoneToolset(std::string& toolset) const; virtual bool SelectWindowsStoreToolset(std::string& toolset) const; - const char* GetIDEVersion() override { return "10.0"; } + const char* GetIDEVersion() const override { return "10.0"; } std::string const& GetMSBuildCommand(); + cmIDEFlagTable const* LoadFlagTable(std::string const& flagTableName, + std::string const& table) const; + std::string GeneratorToolset; std::string GeneratorToolsetVersion; std::string GeneratorToolsetHostArchitecture; @@ -153,15 +156,15 @@ protected: std::string SystemName; std::string SystemVersion; std::string NsightTegraVersion; - cmIDEFlagTable const* DefaultClFlagTable; - cmIDEFlagTable const* DefaultCSharpFlagTable; - cmIDEFlagTable const* DefaultLibFlagTable; - cmIDEFlagTable const* DefaultLinkFlagTable; - cmIDEFlagTable const* DefaultCudaFlagTable; - cmIDEFlagTable const* DefaultCudaHostFlagTable; - cmIDEFlagTable const* DefaultMasmFlagTable; - cmIDEFlagTable const* DefaultNasmFlagTable; - cmIDEFlagTable const* DefaultRcFlagTable; + std::string DefaultCLFlagTableName; + std::string DefaultCSharpFlagTableName; + std::string DefaultLibFlagTableName; + std::string DefaultLinkFlagTableName; + std::string DefaultCudaFlagTableName; + std::string DefaultCudaHostFlagTableName; + std::string DefaultMasmFlagTableName; + std::string DefaultNasmFlagTableName; + std::string DefaultRCFlagTableName; bool SystemIsWindowsCE; bool SystemIsWindowsPhone; bool SystemIsWindowsStore; diff --git a/Source/cmGlobalVisualStudio11Generator.cxx b/Source/cmGlobalVisualStudio11Generator.cxx index f1d5a8c..4cde874 100644 --- a/Source/cmGlobalVisualStudio11Generator.cxx +++ b/Source/cmGlobalVisualStudio11Generator.cxx @@ -6,12 +6,6 @@ #include "cmDocumentationEntry.h" #include "cmLocalVisualStudio10Generator.h" #include "cmMakefile.h" -#include "cmVS11CLFlagTable.h" -#include "cmVS11CSharpFlagTable.h" -#include "cmVS11LibFlagTable.h" -#include "cmVS11LinkFlagTable.h" -#include "cmVS11MASMFlagTable.h" -#include "cmVS11RCFlagTable.h" static const char vs11generatorName[] = "Visual Studio 11 2012"; @@ -107,12 +101,12 @@ cmGlobalVisualStudio11Generator::cmGlobalVisualStudio11Generator( "ProductDir", vc11Express, cmSystemTools::KeyWOW64_32); this->DefaultPlatformToolset = "v110"; - this->DefaultClFlagTable = cmVS11CLFlagTable; - this->DefaultCSharpFlagTable = cmVS11CSharpFlagTable; - this->DefaultLibFlagTable = cmVS11LibFlagTable; - this->DefaultLinkFlagTable = cmVS11LinkFlagTable; - this->DefaultMasmFlagTable = cmVS11MASMFlagTable; - this->DefaultRcFlagTable = cmVS11RCFlagTable; + this->DefaultCLFlagTableName = "v11"; + this->DefaultCSharpFlagTableName = "v11"; + this->DefaultLibFlagTableName = "v11"; + this->DefaultLinkFlagTableName = "v11"; + this->DefaultMasmFlagTableName = "v11"; + this->DefaultRCFlagTableName = "v11"; this->Version = VS11; } @@ -204,7 +198,7 @@ void cmGlobalVisualStudio11Generator::WriteSLNHeader(std::ostream& fout) } } -bool cmGlobalVisualStudio11Generator::UseFolderProperty() +bool cmGlobalVisualStudio11Generator::UseFolderProperty() const { // Intentionally skip up to the top-level class implementation. // Folders are not supported by the Express editions in VS10 and earlier, diff --git a/Source/cmGlobalVisualStudio11Generator.h b/Source/cmGlobalVisualStudio11Generator.h index 40f02fb..5b089a4 100644 --- a/Source/cmGlobalVisualStudio11Generator.h +++ b/Source/cmGlobalVisualStudio11Generator.h @@ -43,8 +43,8 @@ protected: bool IsWindowsPhoneToolsetInstalled() const; bool IsWindowsStoreToolsetInstalled() const; - const char* GetIDEVersion() override { return "11.0"; } - bool UseFolderProperty(); + const char* GetIDEVersion() const override { return "11.0"; } + bool UseFolderProperty() const override; static std::set<std::string> GetInstalledWindowsCESDKs(); /** Return true if the configuration needs to be deployed */ diff --git a/Source/cmGlobalVisualStudio12Generator.cxx b/Source/cmGlobalVisualStudio12Generator.cxx index e05ae70..3be7d24 100644 --- a/Source/cmGlobalVisualStudio12Generator.cxx +++ b/Source/cmGlobalVisualStudio12Generator.cxx @@ -6,12 +6,6 @@ #include "cmDocumentationEntry.h" #include "cmLocalVisualStudio10Generator.h" #include "cmMakefile.h" -#include "cmVS12CLFlagTable.h" -#include "cmVS12CSharpFlagTable.h" -#include "cmVS12LibFlagTable.h" -#include "cmVS12LinkFlagTable.h" -#include "cmVS12MASMFlagTable.h" -#include "cmVS12RCFlagTable.h" static const char vs12generatorName[] = "Visual Studio 12 2013"; @@ -90,12 +84,12 @@ cmGlobalVisualStudio12Generator::cmGlobalVisualStudio12Generator( "ProductDir", vc12Express, cmSystemTools::KeyWOW64_32); this->DefaultPlatformToolset = "v120"; - this->DefaultClFlagTable = cmVS12CLFlagTable; - this->DefaultCSharpFlagTable = cmVS12CSharpFlagTable; - this->DefaultLibFlagTable = cmVS12LibFlagTable; - this->DefaultLinkFlagTable = cmVS12LinkFlagTable; - this->DefaultMasmFlagTable = cmVS12MASMFlagTable; - this->DefaultRcFlagTable = cmVS12RCFlagTable; + this->DefaultCLFlagTableName = "v12"; + this->DefaultCSharpFlagTableName = "v12"; + this->DefaultLibFlagTableName = "v12"; + this->DefaultLinkFlagTableName = "v12"; + this->DefaultMasmFlagTableName = "v12"; + this->DefaultRCFlagTableName = "v12"; this->Version = VS12; } diff --git a/Source/cmGlobalVisualStudio12Generator.h b/Source/cmGlobalVisualStudio12Generator.h index 9d6554a..ae78de7 100644 --- a/Source/cmGlobalVisualStudio12Generator.h +++ b/Source/cmGlobalVisualStudio12Generator.h @@ -48,7 +48,7 @@ protected: // of the toolset is installed bool IsWindowsPhoneToolsetInstalled() const; bool IsWindowsStoreToolsetInstalled() const; - const char* GetIDEVersion() override { return "12.0"; } + const char* GetIDEVersion() const override { return "12.0"; } private: class Factory; diff --git a/Source/cmGlobalVisualStudio14Generator.cxx b/Source/cmGlobalVisualStudio14Generator.cxx index c3ddb3e..ac969e8 100644 --- a/Source/cmGlobalVisualStudio14Generator.cxx +++ b/Source/cmGlobalVisualStudio14Generator.cxx @@ -6,12 +6,6 @@ #include "cmDocumentationEntry.h" #include "cmLocalVisualStudio10Generator.h" #include "cmMakefile.h" -#include "cmVS140CLFlagTable.h" -#include "cmVS140CSharpFlagTable.h" -#include "cmVS140LinkFlagTable.h" -#include "cmVS14LibFlagTable.h" -#include "cmVS14MASMFlagTable.h" -#include "cmVS14RCFlagTable.h" static const char vs14generatorName[] = "Visual Studio 14 2015"; @@ -90,12 +84,12 @@ cmGlobalVisualStudio14Generator::cmGlobalVisualStudio14Generator( "ProductDir", vc14Express, cmSystemTools::KeyWOW64_32); this->DefaultPlatformToolset = "v140"; - this->DefaultClFlagTable = cmVS140CLFlagTable; - this->DefaultCSharpFlagTable = cmVS140CSharpFlagTable; - this->DefaultLibFlagTable = cmVS14LibFlagTable; - this->DefaultLinkFlagTable = cmVS140LinkFlagTable; - this->DefaultMasmFlagTable = cmVS14MASMFlagTable; - this->DefaultRcFlagTable = cmVS14RCFlagTable; + this->DefaultCLFlagTableName = "v140"; + this->DefaultCSharpFlagTableName = "v140"; + this->DefaultLibFlagTableName = "v14"; + this->DefaultLinkFlagTableName = "v140"; + this->DefaultMasmFlagTableName = "v14"; + this->DefaultRCFlagTableName = "v14"; this->Version = VS14; } @@ -215,6 +209,10 @@ bool cmGlobalVisualStudio14Generator::IsWindowsStoreToolsetInstalled() const std::string cmGlobalVisualStudio14Generator::GetWindows10SDKMaxVersion() const { // The last Windows 10 SDK version that VS 2015 can target is 10.0.14393.0. + // + // "VS 2015 Users: The Windows 10 SDK (15063, 16299, 17134, 17763) is + // officially only supported for VS 2017." From: + // https://blogs.msdn.microsoft.com/chuckw/2018/10/02/windows-10-october-2018-update/ return "10.0.14393.0"; } @@ -287,28 +285,28 @@ std::string cmGlobalVisualStudio14Generator::GetWindows10SDKVersion() // only the UCRT MSIs were installed for them. cmEraseIf(sdks, NoWindowsH()); - if (!sdks.empty()) { - // Only use the filename, which will be the SDK version. - for (std::string& i : sdks) { - i = cmSystemTools::GetFilenameName(i); - } + // Only use the filename, which will be the SDK version. + for (std::string& i : sdks) { + i = cmSystemTools::GetFilenameName(i); + } - // Sort the results to make sure we select the most recent one. - std::sort(sdks.begin(), sdks.end(), cmSystemTools::VersionCompareGreater); + // Skip SDKs that cannot be used with our toolset. + std::string maxVersion = this->GetWindows10SDKMaxVersion(); + if (!maxVersion.empty()) { + cmEraseIf(sdks, WindowsSDKTooRecent(maxVersion)); + } - // Skip SDKs that cannot be used with our toolset. - std::string maxVersion = this->GetWindows10SDKMaxVersion(); - if (!maxVersion.empty()) { - cmEraseIf(sdks, WindowsSDKTooRecent(maxVersion)); - } + // Sort the results to make sure we select the most recent one. + std::sort(sdks.begin(), sdks.end(), cmSystemTools::VersionCompareGreater); - // Look for a SDK exactly matching the requested target version. - for (std::string const& i : sdks) { - if (cmSystemTools::VersionCompareEqual(i, this->SystemVersion)) { - return i; - } + // Look for a SDK exactly matching the requested target version. + for (std::string const& i : sdks) { + if (cmSystemTools::VersionCompareEqual(i, this->SystemVersion)) { + return i; } + } + if (!sdks.empty()) { // Use the latest Windows 10 SDK since the exact version is not available. return sdks.at(0); } diff --git a/Source/cmGlobalVisualStudio14Generator.h b/Source/cmGlobalVisualStudio14Generator.h index 9f5bb4e..4bc430b 100644 --- a/Source/cmGlobalVisualStudio14Generator.h +++ b/Source/cmGlobalVisualStudio14Generator.h @@ -41,7 +41,7 @@ protected: // version of the toolset. virtual std::string GetWindows10SDKMaxVersion() const; - const char* GetIDEVersion() override { return "14.0"; } + const char* GetIDEVersion() const override { return "14.0"; } virtual bool SelectWindows10SDK(cmMakefile* mf, bool required); // Used to verify that the Desktop toolset for the current generator is diff --git a/Source/cmGlobalVisualStudio15Generator.cxx b/Source/cmGlobalVisualStudio15Generator.cxx index 23fd2d5..4a08352 100644 --- a/Source/cmGlobalVisualStudio15Generator.cxx +++ b/Source/cmGlobalVisualStudio15Generator.cxx @@ -6,9 +6,6 @@ #include "cmDocumentationEntry.h" #include "cmLocalVisualStudio10Generator.h" #include "cmMakefile.h" -#include "cmVS141CLFlagTable.h" -#include "cmVS141CSharpFlagTable.h" -#include "cmVS141LinkFlagTable.h" #include "cmVSSetupHelper.h" static const char vs15generatorName[] = "Visual Studio 15 2017"; @@ -32,8 +29,8 @@ class cmGlobalVisualStudio15Generator::Factory : public cmGlobalGeneratorFactory { public: - virtual cmGlobalGenerator* CreateGlobalGenerator(const std::string& name, - cmake* cm) const + cmGlobalGenerator* CreateGlobalGenerator(const std::string& name, + cmake* cm) const override { std::string genName; const char* p = cmVS15GenName(name, genName); @@ -55,14 +52,14 @@ public: return 0; } - virtual void GetDocumentation(cmDocumentationEntry& entry) const + void GetDocumentation(cmDocumentationEntry& entry) const override { entry.Name = std::string(vs15generatorName) + " [arch]"; entry.Brief = "Generates Visual Studio 2017 project files. " "Optional [arch] can be \"Win64\" or \"ARM\"."; } - virtual void GetGenerators(std::vector<std::string>& names) const + void GetGenerators(std::vector<std::string>& names) const override { names.push_back(vs15generatorName); names.push_back(vs15generatorName + std::string(" ARM")); @@ -84,9 +81,9 @@ cmGlobalVisualStudio15Generator::cmGlobalVisualStudio15Generator( { this->ExpressEdition = false; this->DefaultPlatformToolset = "v141"; - this->DefaultClFlagTable = cmVS141CLFlagTable; - this->DefaultCSharpFlagTable = cmVS141CSharpFlagTable; - this->DefaultLinkFlagTable = cmVS141LinkFlagTable; + this->DefaultCLFlagTableName = "v141"; + this->DefaultCSharpFlagTableName = "v141"; + this->DefaultLinkFlagTableName = "v141"; this->Version = VS15; } diff --git a/Source/cmGlobalVisualStudio15Generator.h b/Source/cmGlobalVisualStudio15Generator.h index 8ab63f1..68aa14f 100644 --- a/Source/cmGlobalVisualStudio15Generator.h +++ b/Source/cmGlobalVisualStudio15Generator.h @@ -39,7 +39,7 @@ protected: bool InitializeWindows(cmMakefile* mf) override; bool SelectWindowsStoreToolset(std::string& toolset) const override; - const char* GetIDEVersion() override { return "15.0"; } + const char* GetIDEVersion() const override { return "15.0"; } // Used to verify that the Desktop toolset for the current generator is // installed on the machine. diff --git a/Source/cmGlobalVisualStudio71Generator.h b/Source/cmGlobalVisualStudio71Generator.h index b6e3131..b634b95 100644 --- a/Source/cmGlobalVisualStudio71Generator.h +++ b/Source/cmGlobalVisualStudio71Generator.h @@ -37,7 +37,7 @@ protected: void WriteSLNHeader(std::ostream& fout) override; // Folders are not supported by VS 7.1. - virtual bool UseFolderProperty() { return false; } + bool UseFolderProperty() const override { return false; } std::string ProjectConfigurationSectionName; }; diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx index 21121f2..3648086 100644 --- a/Source/cmGlobalVisualStudio7Generator.cxx +++ b/Source/cmGlobalVisualStudio7Generator.cxx @@ -37,7 +37,7 @@ static cmVS7FlagTable cmVS7ExtraFlagTable[] = { // and have EHa passed on the command line by leaving out the table // entry. - { 0, 0, 0, 0, 0 } + { "", "", "", "", 0 } }; cmGlobalVisualStudio7Generator::cmGlobalVisualStudio7Generator( @@ -254,6 +254,15 @@ cmLocalGenerator* cmGlobalVisualStudio7Generator::CreateLocalGenerator( return lg; } +#if defined(CMAKE_BUILD_WITH_CMAKE) +Json::Value cmGlobalVisualStudio7Generator::GetJson() const +{ + Json::Value generator = this->cmGlobalVisualStudioGenerator::GetJson(); + generator["platform"] = this->GetPlatformName(); + return generator; +} +#endif + std::string const& cmGlobalVisualStudio7Generator::GetPlatformName() const { if (!this->GeneratorPlatform.empty()) { diff --git a/Source/cmGlobalVisualStudio7Generator.h b/Source/cmGlobalVisualStudio7Generator.h index 251478d..12a86f2 100644 --- a/Source/cmGlobalVisualStudio7Generator.h +++ b/Source/cmGlobalVisualStudio7Generator.h @@ -28,6 +28,10 @@ public: ///! Create a local generator appropriate to this Global Generator cmLocalGenerator* CreateLocalGenerator(cmMakefile* mf) override; +#if defined(CMAKE_BUILD_WITH_CMAKE) + Json::Value GetJson() const override; +#endif + bool SetSystemName(std::string const& s, cmMakefile* mf) override; bool SetGeneratorPlatform(std::string const& p, cmMakefile* mf) override; @@ -107,7 +111,6 @@ public: protected: void Generate() override; - virtual const char* GetIDEVersion() = 0; std::string const& GetDevEnvCommand(); virtual std::string FindDevEnvCommand(); diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx index b155d9c..ee118f1 100644 --- a/Source/cmGlobalVisualStudio8Generator.cxx +++ b/Source/cmGlobalVisualStudio8Generator.cxx @@ -78,7 +78,7 @@ void cmGlobalVisualStudio8Generator::Configure() this->cmGlobalVisualStudio7Generator::Configure(); } -bool cmGlobalVisualStudio8Generator::UseFolderProperty() +bool cmGlobalVisualStudio8Generator::UseFolderProperty() const { return IsExpressEdition() ? false : cmGlobalGenerator::UseFolderProperty(); } @@ -362,7 +362,7 @@ static cmVS7FlagTable cmVS8ExtraFlagTable[] = { { "TreatWChar_tAsBuiltInType", "Zc:wchar_t-", "wchar_t is not a built-in type", "false", 0 }, - { 0, 0, 0, 0, 0 } + { "", "", "", "", 0 } }; cmIDEFlagTable const* cmGlobalVisualStudio8Generator::GetExtraFlagTableVS8() { diff --git a/Source/cmGlobalVisualStudio8Generator.h b/Source/cmGlobalVisualStudio8Generator.h index 6f64b9c..a21c53d 100644 --- a/Source/cmGlobalVisualStudio8Generator.h +++ b/Source/cmGlobalVisualStudio8Generator.h @@ -49,7 +49,7 @@ public: protected: void AddExtraIDETargets() override; - const char* GetIDEVersion() override { return "8.0"; } + const char* GetIDEVersion() const override { return "8.0"; } std::string FindDevEnvCommand() override; @@ -73,7 +73,7 @@ protected: const char* path, const cmGeneratorTarget* t) override; - bool UseFolderProperty(); + bool UseFolderProperty() const override; std::string Name; std::string WindowsCEVersion; diff --git a/Source/cmGlobalVisualStudio9Generator.h b/Source/cmGlobalVisualStudio9Generator.h index 2aa6a91..ee17c37 100644 --- a/Source/cmGlobalVisualStudio9Generator.h +++ b/Source/cmGlobalVisualStudio9Generator.h @@ -37,7 +37,7 @@ public: std::string GetUserMacrosRegKeyBase() override; protected: - const char* GetIDEVersion() override { return "9.0"; } + const char* GetIDEVersion() const override { return "9.0"; } private: class Factory; diff --git a/Source/cmGlobalVisualStudioGenerator.h b/Source/cmGlobalVisualStudioGenerator.h index 07bc9a3..c891160 100644 --- a/Source/cmGlobalVisualStudioGenerator.h +++ b/Source/cmGlobalVisualStudioGenerator.h @@ -118,7 +118,7 @@ public: std::string ExpandCFGIntDir(const std::string& str, const std::string& config) const override; - void ComputeTargetObjectDirectory(cmGeneratorTarget* gt) const; + void ComputeTargetObjectDirectory(cmGeneratorTarget* gt) const override; std::string GetStartupProjectName(cmLocalGenerator const* root) const; @@ -137,7 +137,7 @@ protected: // below 8. virtual bool VSLinksDependencies() const { return true; } - virtual const char* GetIDEVersion() = 0; + virtual const char* GetIDEVersion() const = 0; bool ComputeTargetDepends() override; class VSDependSet : public std::set<std::string> @@ -163,7 +163,7 @@ protected: private: virtual std::string GetVSMakeProgram() = 0; void PrintCompilerAdvice(std::ostream&, std::string const&, - const char*) const + const char*) const override { } diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 8a38f9b..d6ab769 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -589,8 +589,7 @@ void cmGlobalXCodeGenerator::CreateReRunCMakeFile( this->CurrentReRunCMakeMakefile += "/CMakeScripts"; cmSystemTools::MakeDirectory(this->CurrentReRunCMakeMakefile.c_str()); this->CurrentReRunCMakeMakefile += "/ReRunCMake.make"; - cmGeneratedFileStream makefileStream( - this->CurrentReRunCMakeMakefile.c_str()); + cmGeneratedFileStream makefileStream(this->CurrentReRunCMakeMakefile); makefileStream.SetCopyIfDifferent(true); makefileStream << "# Generated by CMake, DO NOT EDIT\n\n"; @@ -1404,7 +1403,7 @@ void cmGlobalXCodeGenerator::ForceLinkerLanguage(cmGeneratorTarget* gtgt) fname += "."; fname += cmSystemTools::LowerCase(llang); { - cmGeneratedFileStream fout(fname.c_str()); + cmGeneratedFileStream fout(fname); fout << "\n"; } if (cmSourceFile* sf = mf->GetOrCreateSource(fname)) { @@ -1666,7 +1665,7 @@ void cmGlobalXCodeGenerator::CreateCustomRulesMakefile( { std::string makefileName = makefileBasename; makefileName += configName; - cmGeneratedFileStream makefileStream(makefileName.c_str()); + cmGeneratedFileStream makefileStream(makefileName); if (!makefileStream) { return; } @@ -2864,8 +2863,7 @@ bool cmGlobalXCodeGenerator::CreateGroups( } // Add the file to the list of sources. std::string const& source = sf->GetFullPath(); - cmSourceGroup* sourceGroup = - mf->FindSourceGroup(source.c_str(), sourceGroups); + cmSourceGroup* sourceGroup = mf->FindSourceGroup(source, sourceGroups); cmXCodeObject* pbxgroup = this->CreateOrGetPBXGroup(gtgt, sourceGroup); std::string key = GetGroupMapKeyFromPath(gtgt, source); this->GroupMap[key] = pbxgroup; @@ -2878,8 +2876,7 @@ bool cmGlobalXCodeGenerator::CreateGroups( listfile += "/CMakeLists.txt"; cmSourceFile* sf = gtgt->Makefile->GetOrCreateSource(listfile); std::string const& source = sf->GetFullPath(); - cmSourceGroup* sourceGroup = - mf->FindSourceGroup(source.c_str(), sourceGroups); + cmSourceGroup* sourceGroup = mf->FindSourceGroup(source, sourceGroups); cmXCodeObject* pbxgroup = this->CreateOrGetPBXGroup(gtgt, sourceGroup); std::string key = GetGroupMapKeyFromPath(gtgt, source); this->GroupMap[key] = pbxgroup; @@ -3251,7 +3248,7 @@ void cmGlobalXCodeGenerator::ComputeObjectDirArch(cmMakefile* mf) void cmGlobalXCodeGenerator::CreateXCodeDependHackTarget( std::vector<cmXCodeObject*>& targets) { - cmGeneratedFileStream makefileStream(this->CurrentXCodeHackMakefile.c_str()); + cmGeneratedFileStream makefileStream(this->CurrentXCodeHackMakefile); if (!makefileStream) { cmSystemTools::Error("Could not create", this->CurrentXCodeHackMakefile.c_str()); @@ -3392,7 +3389,7 @@ void cmGlobalXCodeGenerator::OutputXCodeProject( xcodeDir += ".xcodeproj"; cmSystemTools::MakeDirectory(xcodeDir.c_str()); std::string xcodeProjFile = xcodeDir + "/project.pbxproj"; - cmGeneratedFileStream fout(xcodeProjFile.c_str()); + cmGeneratedFileStream fout(xcodeProjFile); fout.SetCopyIfDifferent(true); if (!fout) { return; @@ -3469,7 +3466,7 @@ void cmGlobalXCodeGenerator::OutputXCodeWorkspaceSettings( std::string workspaceSettingsFile = xcodeSharedDataDir; workspaceSettingsFile += "/WorkspaceSettings.xcsettings"; - cmGeneratedFileStream fout(workspaceSettingsFile.c_str()); + cmGeneratedFileStream fout(workspaceSettingsFile); fout.SetCopyIfDifferent(true); if (!fout) { return; @@ -3566,7 +3563,7 @@ std::string cmGlobalXCodeGenerator::RelativeToSource(const char* p) { // We force conversion because Xcode breakpoints do not work unless // they are in a file named relative to the source tree. - return cmOutputConverter::ForceToRelativePath( + return cmSystemTools::ForceToRelativePath( cmSystemTools::JoinPath(this->ProjectSourceDirectoryComponents), p); } diff --git a/Source/cmIDEFlagTable.h b/Source/cmIDEFlagTable.h index 152e293..28d5d53 100644 --- a/Source/cmIDEFlagTable.h +++ b/Source/cmIDEFlagTable.h @@ -3,13 +3,15 @@ #ifndef cmIDEFlagTable_h #define cmIDEFlagTable_h +#include <string> + // This is a table mapping XML tag IDE names to command line options struct cmIDEFlagTable { - const char* IDEName; // name used in the IDE xml file - const char* commandFlag; // command line flag - const char* comment; // comment - const char* value; // string value + std::string IDEName; // name used in the IDE xml file + std::string commandFlag; // command line flag + std::string comment; // comment + std::string value; // string value unsigned int special; // flags for special handling requests enum { diff --git a/Source/cmIDEOptions.cxx b/Source/cmIDEOptions.cxx index f996788..ee0c782 100644 --- a/Source/cmIDEOptions.cxx +++ b/Source/cmIDEOptions.cxx @@ -97,24 +97,24 @@ bool cmIDEOptions::CheckFlagTable(cmIDEFlagTable const* table, { const char* pf = flag.c_str() + 1; // Look for an entry in the flag table matching this flag. - for (cmIDEFlagTable const* entry = table; entry->IDEName; ++entry) { + for (cmIDEFlagTable const* entry = table; !entry->IDEName.empty(); ++entry) { bool entry_found = false; if (entry->special & cmIDEFlagTable::UserValue) { // This flag table entry accepts a user-specified value. If // the entry specifies UserRequired we must match only if a // non-empty value is given. - int n = static_cast<int>(strlen(entry->commandFlag)); - if ((strncmp(pf, entry->commandFlag, n) == 0 || + int n = static_cast<int>(entry->commandFlag.length()); + if ((strncmp(pf, entry->commandFlag.c_str(), n) == 0 || (entry->special & cmIDEFlagTable::CaseInsensitive && - cmsysString_strncasecmp(pf, entry->commandFlag, n))) && + cmsysString_strncasecmp(pf, entry->commandFlag.c_str(), n))) && (!(entry->special & cmIDEFlagTable::UserRequired) || static_cast<int>(strlen(pf)) > n)) { this->FlagMapUpdate(entry, std::string(pf + n)); entry_found = true; } - } else if (strcmp(pf, entry->commandFlag) == 0 || + } else if (strcmp(pf, entry->commandFlag.c_str()) == 0 || (entry->special & cmIDEFlagTable::CaseInsensitive && - cmsysString_strcasecmp(pf, entry->commandFlag) == 0)) { + cmsysString_strcasecmp(pf, entry->commandFlag.c_str()) == 0)) { if (entry->special & cmIDEFlagTable::UserFollowing) { // This flag expects a value in the following argument. this->DoingFollowing = entry; diff --git a/Source/cmIfCommand.cxx b/Source/cmIfCommand.cxx index ae4041d..5d952da 100644 --- a/Source/cmIfCommand.cxx +++ b/Source/cmIfCommand.cxx @@ -39,7 +39,7 @@ bool cmIfFunctionBlocker::IsFunctionBlocked(const cmListFileFunction& lff, // Remove the function blocker for this scope or bail. std::unique_ptr<cmFunctionBlocker> fb( mf.RemoveFunctionBlocker(this, lff)); - if (!fb.get()) { + if (!fb) { return false; } diff --git a/Source/cmInstallCommandArguments.cxx b/Source/cmInstallCommandArguments.cxx index 63bdb00..538aa9f 100644 --- a/Source/cmInstallCommandArguments.cxx +++ b/Source/cmInstallCommandArguments.cxx @@ -17,9 +17,7 @@ const std::string cmInstallCommandArguments::EmptyString; cmInstallCommandArguments::cmInstallCommandArguments( const std::string& defaultComponent) - : Parser() - , ArgumentGroup() - , Destination(&Parser, "DESTINATION", &ArgumentGroup) + : Destination(&Parser, "DESTINATION", &ArgumentGroup) , Component(&Parser, "COMPONENT", &ArgumentGroup) , NamelinkComponent(&Parser, "NAMELINK_COMPONENT", &ArgumentGroup) , ExcludeFromAll(&Parser, "EXCLUDE_FROM_ALL", &ArgumentGroup) @@ -183,7 +181,8 @@ bool cmInstallCommandArguments::CheckPermissions() { this->PermissionsString.clear(); for (std::string const& perm : this->Permissions.GetVector()) { - if (!this->CheckPermissions(perm, this->PermissionsString)) { + if (!cmInstallCommandArguments::CheckPermissions( + perm, this->PermissionsString)) { return false; } } diff --git a/Source/cmInstallScriptGenerator.cxx b/Source/cmInstallScriptGenerator.cxx index 7d77b7c..b93debb 100644 --- a/Source/cmInstallScriptGenerator.cxx +++ b/Source/cmInstallScriptGenerator.cxx @@ -2,11 +2,15 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmInstallScriptGenerator.h" -#include "cmScriptGenerator.h" - #include <ostream> #include <vector> +#include "cmGeneratorExpression.h" +#include "cmLocalGenerator.h" +#include "cmPolicies.h" +#include "cmScriptGenerator.h" +#include "cmake.h" + cmInstallScriptGenerator::cmInstallScriptGenerator(const char* script, bool code, const char* component, @@ -15,25 +19,71 @@ cmInstallScriptGenerator::cmInstallScriptGenerator(const char* script, MessageDefault, exclude_from_all) , Script(script) , Code(code) + , AllowGenex(false) { + // We need per-config actions if the script has generator expressions. + if (cmGeneratorExpression::Find(Script) != std::string::npos) { + this->ActionsPerConfig = true; + } } cmInstallScriptGenerator::~cmInstallScriptGenerator() { } -void cmInstallScriptGenerator::GenerateScript(std::ostream& os) +void cmInstallScriptGenerator::Compute(cmLocalGenerator* lg) { - Indent indent; - std::string component_test = - this->CreateComponentTest(this->Component.c_str(), this->ExcludeFromAll); - os << indent << "if(" << component_test << ")\n"; + this->LocalGenerator = lg; + if (this->ActionsPerConfig) { + switch (this->LocalGenerator->GetPolicyStatus(cmPolicies::CMP0087)) { + case cmPolicies::WARN: + this->LocalGenerator->IssueMessage( + cmake::AUTHOR_WARNING, + cmPolicies::GetPolicyWarning(cmPolicies::CMP0087)); + CM_FALLTHROUGH; + case cmPolicies::OLD: + break; + case cmPolicies::NEW: + case cmPolicies::REQUIRED_ALWAYS: + case cmPolicies::REQUIRED_IF_USED: + this->AllowGenex = true; + break; + } + } +} + +void cmInstallScriptGenerator::AddScriptInstallRule(std::ostream& os, + Indent indent, + std::string const& script) +{ if (this->Code) { - os << indent << this->Script << "\n"; + os << indent << script << "\n"; } else { - os << indent << "include(\"" << this->Script << "\")\n"; + os << indent << "include(\"" << script << "\")\n"; } +} - os << indent << "endif()\n\n"; +void cmInstallScriptGenerator::GenerateScriptActions(std::ostream& os, + Indent indent) +{ + if (this->AllowGenex && this->ActionsPerConfig) { + this->cmInstallGenerator::GenerateScriptActions(os, indent); + } else { + this->AddScriptInstallRule(os, indent, this->Script); + } +} + +void cmInstallScriptGenerator::GenerateScriptForConfig( + std::ostream& os, const std::string& config, Indent indent) +{ + if (this->AllowGenex) { + cmGeneratorExpression ge; + std::unique_ptr<cmCompiledGeneratorExpression> cge = + ge.Parse(this->Script); + this->AddScriptInstallRule(os, indent, + cge->Evaluate(this->LocalGenerator, config)); + } else { + this->AddScriptInstallRule(os, indent, this->Script); + } } diff --git a/Source/cmInstallScriptGenerator.h b/Source/cmInstallScriptGenerator.h index fe0f7c6..05199d7 100644 --- a/Source/cmInstallScriptGenerator.h +++ b/Source/cmInstallScriptGenerator.h @@ -6,10 +6,13 @@ #include "cmConfigure.h" // IWYU pragma: keep #include "cmInstallGenerator.h" +#include "cmScriptGenerator.h" #include <iosfwd> #include <string> +class cmLocalGenerator; + /** \class cmInstallScriptGenerator * \brief Generate target installation rules. */ @@ -20,10 +23,19 @@ public: const char* component, bool exclude_from_all); ~cmInstallScriptGenerator() override; + void Compute(cmLocalGenerator* lg) override; + protected: - void GenerateScript(std::ostream& os) override; + void GenerateScriptActions(std::ostream& os, Indent indent) override; + void GenerateScriptForConfig(std::ostream& os, const std::string& config, + Indent indent) override; + void AddScriptInstallRule(std::ostream& os, Indent indent, + std::string const& script); + std::string Script; bool Code; + cmLocalGenerator* LocalGenerator; + bool AllowGenex; }; #endif diff --git a/Source/cmInstalledFile.cxx b/Source/cmInstalledFile.cxx index 0e06029..9f61e5b 100644 --- a/Source/cmInstalledFile.cxx +++ b/Source/cmInstalledFile.cxx @@ -10,7 +10,6 @@ #include <utility> cmInstalledFile::cmInstalledFile() - : NameExpression(nullptr) { } diff --git a/Source/cmInstalledFile.h b/Source/cmInstalledFile.h index 47a4959..070b954 100644 --- a/Source/cmInstalledFile.h +++ b/Source/cmInstalledFile.h @@ -68,7 +68,7 @@ public: private: std::string Name; - cmCompiledGeneratorExpression* NameExpression; + cmCompiledGeneratorExpression* NameExpression = nullptr; PropertyMapType Properties; }; diff --git a/Source/cmJsonObjects.cxx b/Source/cmJsonObjects.cxx index 4148894..0da6f4f 100644 --- a/Source/cmJsonObjects.cxx +++ b/Source/cmJsonObjects.cxx @@ -6,6 +6,7 @@ #include "cmGeneratorTarget.h" #include "cmGlobalGenerator.h" #include "cmInstallGenerator.h" +#include "cmInstallSubdirectoryGenerator.h" #include "cmInstallTargetGenerator.h" #include "cmJsonObjectDictionary.h" #include "cmJsonObjects.h" @@ -450,10 +451,9 @@ static Json::Value DumpTarget(cmGeneratorTarget* target, const std::string& config) { cmLocalGenerator* lg = target->GetLocalGenerator(); - const cmState* state = lg->GetState(); const cmStateEnums::TargetType type = target->GetType(); - const std::string typeName = state->GetTargetTypeName(type); + const std::string typeName = cmState::GetTargetTypeName(type); Json::Value ttl = Json::arrayValue; ttl.append("EXECUTABLE"); @@ -641,8 +641,13 @@ static Json::Value DumpProjectList(const cmake* cm, std::string const& config) // associated generators. bool hasInstallRule = false; for (const auto generator : projectIt.second) { - hasInstallRule = - generator->GetMakefile()->GetInstallGenerators().empty() == false; + for (const auto installGen : + generator->GetMakefile()->GetInstallGenerators()) { + if (!dynamic_cast<cmInstallSubdirectoryGenerator*>(installGen)) { + hasInstallRule = true; + break; + } + } if (hasInstallRule) { break; diff --git a/Source/cmLinkItem.cxx b/Source/cmLinkItem.cxx index 121731d..12a07f6 100644 --- a/Source/cmLinkItem.cxx +++ b/Source/cmLinkItem.cxx @@ -7,22 +7,18 @@ #include <utility> // IWYU pragma: keep cmLinkItem::cmLinkItem() - : String() - , Target(nullptr) { } cmLinkItem::cmLinkItem(std::string const& n, cmListFileBacktrace const& bt) : String(n) - , Target(nullptr) , Backtrace(bt) { } cmLinkItem::cmLinkItem(cmGeneratorTarget const* t, cmListFileBacktrace const& bt) - : String() - , Target(t) + : Target(t) , Backtrace(bt) { } @@ -61,7 +57,6 @@ std::ostream& operator<<(std::ostream& os, cmLinkItem const& item) cmLinkImplItem::cmLinkImplItem() : cmLinkItem() - , FromGenex(false) { } diff --git a/Source/cmLinkItem.h b/Source/cmLinkItem.h index e1ddd22..b841509 100644 --- a/Source/cmLinkItem.h +++ b/Source/cmLinkItem.h @@ -27,7 +27,7 @@ public: cmLinkItem(std::string const& s, cmListFileBacktrace const& bt); cmLinkItem(cmGeneratorTarget const* t, cmListFileBacktrace const& bt); std::string const& AsStr() const; - cmGeneratorTarget const* Target; + cmGeneratorTarget const* Target = nullptr; cmListFileBacktrace Backtrace; friend bool operator<(cmLinkItem const& l, cmLinkItem const& r); friend bool operator==(cmLinkItem const& l, cmLinkItem const& r); @@ -39,7 +39,7 @@ class cmLinkImplItem : public cmLinkItem public: cmLinkImplItem(); cmLinkImplItem(cmLinkItem item, bool fromGenex); - bool FromGenex; + bool FromGenex = false; }; /** The link implementation specifies the direct library @@ -70,36 +70,25 @@ struct cmLinkInterface : public cmLinkInterfaceLibraries // Number of repetitions of a strongly connected component of two // or more static libraries. - unsigned int Multiplicity; + unsigned int Multiplicity = 0; // Libraries listed for other configurations. // Needed only for OLD behavior of CMP0003. std::vector<cmLinkItem> WrongConfigLibraries; - bool ImplementationIsInterface; + bool ImplementationIsInterface = false; - cmLinkInterface() - : Multiplicity(0) - , ImplementationIsInterface(false) - { - } + cmLinkInterface() {} }; struct cmOptionalLinkInterface : public cmLinkInterface { - cmOptionalLinkInterface() - : LibrariesDone(false) - , AllDone(false) - , Exists(false) - , HadHeadSensitiveCondition(false) - , ExplicitLibraries(nullptr) - { - } - bool LibrariesDone; - bool AllDone; - bool Exists; - bool HadHeadSensitiveCondition; - const char* ExplicitLibraries; + cmOptionalLinkInterface() {} + bool LibrariesDone = false; + bool AllDone = false; + bool Exists = false; + bool HadHeadSensitiveCondition = false; + const char* ExplicitLibraries = nullptr; }; struct cmHeadToLinkInterfaceMap @@ -116,15 +105,10 @@ struct cmLinkImplementation : public cmLinkImplementationLibraries // Cache link implementation computation from each configuration. struct cmOptionalLinkImplementation : public cmLinkImplementation { - cmOptionalLinkImplementation() - : LibrariesDone(false) - , LanguagesDone(false) - , HadHeadSensitiveCondition(false) - { - } - bool LibrariesDone; - bool LanguagesDone; - bool HadHeadSensitiveCondition; + cmOptionalLinkImplementation() {} + bool LibrariesDone = false; + bool LanguagesDone = false; + bool HadHeadSensitiveCondition = false; }; /** Compute the link type to use for the given configuration. */ diff --git a/Source/cmLinkLineComputer.cxx b/Source/cmLinkLineComputer.cxx index 7511fd2..6643990 100644 --- a/Source/cmLinkLineComputer.cxx +++ b/Source/cmLinkLineComputer.cxx @@ -11,6 +11,7 @@ #include "cmOutputConverter.h" #include "cmStateDirectory.h" #include "cmStateTypes.h" +#include "cmSystemTools.h" cmLinkLineComputer::cmLinkLineComputer(cmOutputConverter* outputConverter, cmStateDirectory const& stateDir) @@ -46,9 +47,8 @@ std::string cmLinkLineComputer::ConvertToLinkReference( { std::string relLib = lib; - if (cmOutputConverter::ContainedInDirectory( - this->StateDir.GetCurrentBinary(), lib, this->StateDir)) { - relLib = cmOutputConverter::ForceToRelativePath( + if (this->StateDir.ContainsBoth(this->StateDir.GetCurrentBinary(), lib)) { + relLib = cmSystemTools::ForceToRelativePath( this->StateDir.GetCurrentBinary(), lib); } return relLib; diff --git a/Source/cmLinkedTree.h b/Source/cmLinkedTree.h index 975f052..099fb6d 100644 --- a/Source/cmLinkedTree.h +++ b/Source/cmLinkedTree.h @@ -6,7 +6,6 @@ #include "cmConfigure.h" // IWYU pragma: keep #include <assert.h> -#include <iterator> #include <vector> /** @@ -33,7 +32,7 @@ class cmLinkedTree typedef T& ReferenceType; public: - class iterator : public std::iterator<std::forward_iterator_tag, T> + class iterator { friend class cmLinkedTree; cmLinkedTree* Tree; diff --git a/Source/cmListFileCache.h b/Source/cmListFileCache.h index 9e4a833..4a247ba 100644 --- a/Source/cmListFileCache.h +++ b/Source/cmListFileCache.h @@ -33,11 +33,8 @@ struct cmCommandContext cmCommandName(std::string const& name) { *this = name; } cmCommandName& operator=(std::string const& name); } Name; - long Line; - cmCommandContext() - : Line(0) - { - } + long Line = 0; + cmCommandContext() {} cmCommandContext(const char* name, int line) : Name(name) , Line(line) @@ -53,12 +50,7 @@ struct cmListFileArgument Quoted, Bracket }; - cmListFileArgument() - : Value() - , Delim(Unquoted) - , Line(0) - { - } + cmListFileArgument() {} cmListFileArgument(const std::string& v, Delimiter d, long line) : Value(v) , Delim(d) @@ -71,8 +63,8 @@ struct cmListFileArgument } bool operator!=(const cmListFileArgument& r) const { return !(*this == r); } std::string Value; - Delimiter Delim; - long Line; + Delimiter Delim = Unquoted; + long Line = 0; }; class cmListFileContext @@ -80,13 +72,8 @@ class cmListFileContext public: std::string Name; std::string FilePath; - long Line; - cmListFileContext() - : Name() - , FilePath() - , Line(0) - { - } + long Line = 0; + cmListFileContext() {} static cmListFileContext FromCommandContext(cmCommandContext const& lfcc, std::string const& fileName) diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index da48950..8fac039 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -2044,8 +2044,14 @@ void cmLocalGenerator::AppendPositionIndependentLinkerFlags( return; } - std::string name = "CMAKE_" + lang + "_LINK_OPTIONS_"; - name += cmSystemTools::IsOn(PICValue) ? "PIE" : "NO_PIE"; + const std::string mode = cmSystemTools::IsOn(PICValue) ? "PIE" : "NO_PIE"; + + std::string supported = "CMAKE_" + lang + "_LINK_" + mode + "_SUPPORTED"; + if (cmSystemTools::IsOff(this->Makefile->GetDefinition(supported))) { + return; + } + + std::string name = "CMAKE_" + lang + "_LINK_OPTIONS_" + mode; auto pieFlags = this->Makefile->GetSafeDefinition(name); if (pieFlags.empty()) { diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx index 66edc91..a8647b1 100644 --- a/Source/cmLocalNinjaGenerator.cxx +++ b/Source/cmLocalNinjaGenerator.cxx @@ -188,13 +188,12 @@ void cmLocalNinjaGenerator::WriteProjectHeader(std::ostream& os) void cmLocalNinjaGenerator::WriteNinjaRequiredVersion(std::ostream& os) { // Default required version - std::string requiredVersion = - this->GetGlobalNinjaGenerator()->RequiredNinjaVersion(); + std::string requiredVersion = cmGlobalNinjaGenerator::RequiredNinjaVersion(); // Ninja generator uses the 'console' pool if available (>= 1.5) if (this->GetGlobalNinjaGenerator()->SupportsConsolePool()) { requiredVersion = - this->GetGlobalNinjaGenerator()->RequiredNinjaVersionForConsolePool(); + cmGlobalNinjaGenerator::RequiredNinjaVersionForConsolePool(); } // The Ninja generator writes rules which require support for restat @@ -204,7 +203,7 @@ void cmLocalNinjaGenerator::WriteNinjaRequiredVersion(std::ostream& os) !this->GetGlobalNinjaGenerator()->GlobalSettingIsOn( "CMAKE_SUPPRESS_REGENERATION")) { requiredVersion = - this->GetGlobalNinjaGenerator()->RequiredNinjaVersionForManifestRestat(); + cmGlobalNinjaGenerator::RequiredNinjaVersionForManifestRestat(); } cmGlobalNinjaGenerator::WriteComment( @@ -319,7 +318,10 @@ std::string cmLocalNinjaGenerator::WriteCommandScript( cmsys::ofstream script(scriptPath.c_str()); -#ifndef _WIN32 +#ifdef _WIN32 + script << "@echo off\n"; + int line = 1; +#else script << "set -e\n\n"; #endif @@ -330,12 +332,22 @@ std::string cmLocalNinjaGenerator::WriteCommandScript( // for the raw shell script. cmSystemTools::ReplaceString(cmd, "$$", "$"); #ifdef _WIN32 - script << cmd << " || exit /b" << '\n'; + script << cmd << " || (set FAIL_LINE=" << ++line << "& goto :ABORT)" + << '\n'; #else script << cmd << '\n'; #endif } +#ifdef _WIN32 + script << "goto :EOF\n\n" + ":ABORT\n" + "set ERROR_CODE=%ERRORLEVEL%\n" + "echo Batch file failed at line %FAIL_LINE% " + "with errorcode %ERRORLEVEL%\n" + "exit /b %ERROR_CODE%"; +#endif + return scriptPath; } diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index 6a535c1..707a1b5 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -470,12 +470,12 @@ void cmLocalUnixMakefileGenerator3::WriteDirectoryInformationFile() << "# The C and CXX include file regular expressions for " << "this directory.\n"; infoFileStream << "set(CMAKE_C_INCLUDE_REGEX_SCAN "; - this->WriteCMakeArgument(infoFileStream, - this->Makefile->GetIncludeRegularExpression()); + cmLocalUnixMakefileGenerator3::WriteCMakeArgument( + infoFileStream, this->Makefile->GetIncludeRegularExpression()); infoFileStream << ")\n"; infoFileStream << "set(CMAKE_C_INCLUDE_REGEX_COMPLAIN "; - this->WriteCMakeArgument(infoFileStream, - this->Makefile->GetComplainRegularExpression()); + cmLocalUnixMakefileGenerator3::WriteCMakeArgument( + infoFileStream, this->Makefile->GetComplainRegularExpression()); infoFileStream << ")\n"; infoFileStream << "set(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN})\n"; @@ -2093,9 +2093,8 @@ void cmLocalUnixMakefileGenerator3::CreateCDCommand( std::string cmLocalUnixMakefileGenerator3::MaybeConvertToRelativePath( std::string const& base, std::string const& path) { - if (!cmOutputConverter::ContainedInDirectory( - base, path, this->GetStateSnapshot().GetDirectory())) { + if (!this->GetStateSnapshot().GetDirectory().ContainsBoth(base, path)) { return path; } - return cmOutputConverter::ForceToRelativePath(base, path); + return cmSystemTools::ForceToRelativePath(base, path); } diff --git a/Source/cmLocalUnixMakefileGenerator3.h b/Source/cmLocalUnixMakefileGenerator3.h index 869ef1e..ee6b37b 100644 --- a/Source/cmLocalUnixMakefileGenerator3.h +++ b/Source/cmLocalUnixMakefileGenerator3.h @@ -264,13 +264,9 @@ private: struct LocalObjectEntry { - cmGeneratorTarget* Target; + cmGeneratorTarget* Target = nullptr; std::string Language; - LocalObjectEntry() - : Target(nullptr) - , Language() - { - } + LocalObjectEntry() {} LocalObjectEntry(cmGeneratorTarget* t, const std::string& lang) : Target(t) , Language(lang) @@ -279,15 +275,10 @@ private: }; struct LocalObjectInfo : public std::vector<LocalObjectEntry> { - bool HasSourceExtension; - bool HasPreprocessRule; - bool HasAssembleRule; - LocalObjectInfo() - : HasSourceExtension(false) - , HasPreprocessRule(false) - , HasAssembleRule(false) - { - } + bool HasSourceExtension = false; + bool HasPreprocessRule = false; + bool HasAssembleRule = false; + LocalObjectInfo() {} }; void GetLocalObjectFiles( std::map<std::string, LocalObjectInfo>& localObjectFiles); diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index 7630691..fee9dd6 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -362,7 +362,7 @@ cmVS7FlagTable cmLocalVisualStudio7GeneratorFortranFlagTable[] = { { "EnableRecursion", "recursive", "", "true", 0 }, { "ReentrantCode", "reentrancy", "", "true", 0 }, // done up to Language - { 0, 0, 0, 0, 0 } + { "", "", "", "", 0 } }; // fill the table here currently the comment field is not used for // anything other than documentation NOTE: Make sure the longer @@ -472,7 +472,7 @@ cmVS7FlagTable cmLocalVisualStudio7GeneratorFlagTable[] = { { "WarnAsError", "WX", "Treat warnings as errors", "true", 0 }, { "BrowseInformation", "FR", "Generate browse information", "1", 0 }, { "StringPooling", "GF", "Enable StringPooling", "true", 0 }, - { 0, 0, 0, 0, 0 } + { "", "", "", "", 0 } }; cmVS7FlagTable cmLocalVisualStudio7GeneratorLinkFlagTable[] = { @@ -537,7 +537,7 @@ cmVS7FlagTable cmLocalVisualStudio7GeneratorLinkFlagTable[] = { { "ModuleDefinitionFile", "DEF:", "add an export def file", "", cmVS7FlagTable::UserValue }, { "GenerateMapFile", "MAP", "enable generation of map file", "true", 0 }, - { 0, 0, 0, 0, 0 } + { "", "", "", "", 0 } }; cmVS7FlagTable cmLocalVisualStudio7GeneratorFortranLinkFlagTable[] = { @@ -545,7 +545,7 @@ cmVS7FlagTable cmLocalVisualStudio7GeneratorFortranLinkFlagTable[] = { "linkIncrementalNo", 0 }, { "LinkIncremental", "INCREMENTAL:YES", "link incremental", "linkIncrementalYes", 0 }, - { 0, 0, 0, 0, 0 } + { "", "", "", "", 0 } }; // Helper class to write build event <Tool .../> elements. diff --git a/Source/cmMachO.h b/Source/cmMachO.h index 5886d76..5482465 100644 --- a/Source/cmMachO.h +++ b/Source/cmMachO.h @@ -30,7 +30,7 @@ public: std::string const& GetErrorMessage() const; /** Boolean conversion. True if the Mach-O file is valid. */ - operator bool() const { return this->Valid(); } + explicit operator bool() const { return this->Valid(); } /** Get Install name from binary **/ bool GetInstallName(std::string& install_name); diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 790f6e0..d7c4f22 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -2342,7 +2342,7 @@ cmMakefile::AppleSDK cmMakefile::GetAppleSDKType() const { "watchsimulator", AppleSDK::WatchSimulator }, }; - for (auto entry : sdkDatabase) { + for (auto const& entry : sdkDatabase) { if (sdkRoot.find(entry.name) == 0 || sdkRoot.find(std::string("/") + entry.name) != std::string::npos) { return entry.sdk; @@ -2697,13 +2697,9 @@ typedef enum } t_domain; struct t_lookup { - t_lookup() - : domain(NORMAL) - , loc(0) - { - } - t_domain domain; - size_t loc; + t_lookup() {} + t_domain domain = NORMAL; + size_t loc = 0; }; cmake::MessageType cmMakefile::ExpandVariablesInStringNew( @@ -2727,6 +2723,7 @@ cmake::MessageType cmMakefile::ExpandVariablesInStringNew( cmState* state = this->GetCMakeInstance()->GetState(); + static const std::string lineVar = "CMAKE_CURRENT_LIST_LINE"; do { char inc = *in; switch (inc) { @@ -2739,7 +2736,6 @@ cmake::MessageType cmMakefile::ExpandVariablesInStringNew( const char* value = nullptr; std::string varresult; std::string svalue; - static const std::string lineVar = "CMAKE_CURRENT_LIST_LINE"; switch (var.domain) { case NORMAL: if (filename && lookup == lineVar) { @@ -2889,7 +2885,14 @@ cmake::MessageType cmMakefile::ExpandVariablesInStringNew( "abcdefghijklmnopqrstuvwxyz" "0123456789/_.+-")) { std::string variable(in + 1, nextAt - in - 1); - std::string varresult = this->GetSafeDefinition(variable); + + std::string varresult; + if (filename && variable == lineVar) { + varresult = std::to_string(line); + } else { + varresult = this->GetSafeDefinition(variable); + } + if (escapeQuotes) { varresult = cmSystemTools::EscapeQuotes(varresult); } @@ -3648,8 +3651,15 @@ void cmMakefile::ConfigureString(const std::string& input, std::string& output, } // Perform variable replacements. - this->ExpandVariablesInString(output, escapeQuotes, true, atOnly, nullptr, - -1, true, true); + const char* filename = nullptr; + long lineNumber = -1; + if (!this->Backtrace.Empty()) { + const auto& currentTrace = this->Backtrace.Top(); + filename = currentTrace.FilePath.c_str(); + lineNumber = currentTrace.Line; + } + this->ExpandVariablesInString(output, escapeQuotes, true, atOnly, filename, + lineNumber, true, true); } int cmMakefile::ConfigureFile(const char* infile, const char* outfile, diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx index 08bb2ce..846b12c 100644 --- a/Source/cmMakefileExecutableTargetGenerator.cxx +++ b/Source/cmMakefileExecutableTargetGenerator.cxx @@ -84,6 +84,10 @@ void cmMakefileExecutableTargetGenerator::WriteDeviceExecutableRule( bool relink) { #ifdef CMAKE_BUILD_WITH_CMAKE + if (!this->GlobalGenerator->GetLanguageEnabled("CUDA")) { + return; + } + const std::string cuda_lang("CUDA"); cmGeneratorTarget::LinkClosure const* closure = this->GeneratorTarget->GetLinkClosure(this->ConfigName); diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index 0ea9724..d1dcd81 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -1247,8 +1247,9 @@ void cmMakefileTargetGenerator::WriteObjectsVariable( } for (std::string const& obj : this->Objects) { *this->BuildFileStream << " " << lineContinue << "\n"; - *this->BuildFileStream << this->LocalGenerator->ConvertToQuotedOutputPath( - obj.c_str(), useWatcomQuote); + *this->BuildFileStream + << cmLocalUnixMakefileGenerator3::ConvertToQuotedOutputPath( + obj.c_str(), useWatcomQuote); } *this->BuildFileStream << "\n"; @@ -1269,8 +1270,9 @@ void cmMakefileTargetGenerator::WriteObjectsVariable( object = this->LocalGenerator->MaybeConvertToRelativePath(currentBinDir, obj); *this->BuildFileStream << " " << lineContinue << "\n"; - *this->BuildFileStream << this->LocalGenerator->ConvertToQuotedOutputPath( - obj.c_str(), useWatcomQuote); + *this->BuildFileStream + << cmLocalUnixMakefileGenerator3::ConvertToQuotedOutputPath( + obj.c_str(), useWatcomQuote); } *this->BuildFileStream << "\n" << "\n"; @@ -1317,11 +1319,10 @@ public: private: std::string MaybeConvertToRelativePath(std::string const& obj) { - if (!cmOutputConverter::ContainedInDirectory( - this->StateDir.GetCurrentBinary(), obj, this->StateDir)) { + if (!this->StateDir.ContainsBoth(this->StateDir.GetCurrentBinary(), obj)) { return obj; } - return cmOutputConverter::ForceToRelativePath( + return cmSystemTools::ForceToRelativePath( this->StateDir.GetCurrentBinary(), obj); } diff --git a/Source/cmMessenger.cxx b/Source/cmMessenger.cxx index a81428a..880cf4b 100644 --- a/Source/cmMessenger.cxx +++ b/Source/cmMessenger.cxx @@ -4,7 +4,6 @@ #include "cmAlgorithms.h" #include "cmDocumentationFormatter.h" -#include "cmState.h" #include "cmSystemTools.h" #if defined(CMAKE_BUILD_WITH_CMAKE) @@ -131,11 +130,6 @@ void displayMessage(cmake::MessageType t, std::ostringstream& msg) } } -cmMessenger::cmMessenger(cmState* state) - : State(state) -{ -} - void cmMessenger::IssueMessage(cmake::MessageType t, const std::string& text, const cmListFileBacktrace& backtrace) const { @@ -173,31 +167,3 @@ void cmMessenger::DisplayMessage(cmake::MessageType t, const std::string& text, displayMessage(t, msg); } - -bool cmMessenger::GetSuppressDevWarnings() const -{ - const char* cacheEntryValue = - this->State->GetCacheEntryValue("CMAKE_SUPPRESS_DEVELOPER_WARNINGS"); - return cmSystemTools::IsOn(cacheEntryValue); -} - -bool cmMessenger::GetSuppressDeprecatedWarnings() const -{ - const char* cacheEntryValue = - this->State->GetCacheEntryValue("CMAKE_WARN_DEPRECATED"); - return cacheEntryValue && cmSystemTools::IsOff(cacheEntryValue); -} - -bool cmMessenger::GetDevWarningsAsErrors() const -{ - const char* cacheEntryValue = - this->State->GetCacheEntryValue("CMAKE_SUPPRESS_DEVELOPER_ERRORS"); - return cacheEntryValue && cmSystemTools::IsOff(cacheEntryValue); -} - -bool cmMessenger::GetDeprecatedWarningsAsErrors() const -{ - const char* cacheEntryValue = - this->State->GetCacheEntryValue("CMAKE_ERROR_DEPRECATED"); - return cmSystemTools::IsOn(cacheEntryValue); -} diff --git a/Source/cmMessenger.h b/Source/cmMessenger.h index 4aafbd4..e947eaa 100644 --- a/Source/cmMessenger.h +++ b/Source/cmMessenger.h @@ -10,13 +10,9 @@ #include <string> -class cmState; - class cmMessenger { public: - cmMessenger(cmState* state); - void IssueMessage( cmake::MessageType t, std::string const& text, cmListFileBacktrace const& backtrace = cmListFileBacktrace()) const; @@ -24,16 +20,42 @@ public: void DisplayMessage(cmake::MessageType t, std::string const& text, cmListFileBacktrace const& backtrace) const; - bool GetSuppressDevWarnings() const; - bool GetSuppressDeprecatedWarnings() const; - bool GetDevWarningsAsErrors() const; - bool GetDeprecatedWarningsAsErrors() const; + void SetSuppressDevWarnings(bool suppress) + { + this->SuppressDevWarnings = suppress; + } + void SetSuppressDeprecatedWarnings(bool suppress) + { + this->SuppressDeprecatedWarnings = suppress; + } + void SetDevWarningsAsErrors(bool error) + { + this->DevWarningsAsErrors = error; + } + void SetDeprecatedWarningsAsErrors(bool error) + { + this->DeprecatedWarningsAsErrors = error; + } + + bool GetSuppressDevWarnings() const { return this->SuppressDevWarnings; } + bool GetSuppressDeprecatedWarnings() const + { + return this->SuppressDeprecatedWarnings; + } + bool GetDevWarningsAsErrors() const { return this->DevWarningsAsErrors; } + bool GetDeprecatedWarningsAsErrors() const + { + return this->DeprecatedWarningsAsErrors; + } private: bool IsMessageTypeVisible(cmake::MessageType t) const; cmake::MessageType ConvertMessageType(cmake::MessageType t) const; - cmState* State; + bool SuppressDevWarnings = false; + bool SuppressDeprecatedWarnings = false; + bool DevWarningsAsErrors = false; + bool DeprecatedWarningsAsErrors = false; }; #endif diff --git a/Source/cmNewLineStyle.cxx b/Source/cmNewLineStyle.cxx index 5500eba..12c18ee 100644 --- a/Source/cmNewLineStyle.cxx +++ b/Source/cmNewLineStyle.cxx @@ -5,7 +5,6 @@ #include <stddef.h> cmNewLineStyle::cmNewLineStyle() - : NewLineStyle(Invalid) { } diff --git a/Source/cmNewLineStyle.h b/Source/cmNewLineStyle.h index 397cd2c..f1a7bc6 100644 --- a/Source/cmNewLineStyle.h +++ b/Source/cmNewLineStyle.h @@ -33,7 +33,7 @@ public: const std::string GetCharacters() const; private: - Style NewLineStyle; + Style NewLineStyle = Invalid; }; #endif diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index 1386706..324afbf 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -37,13 +37,7 @@ class cmCustomCommand; cmNinjaNormalTargetGenerator::cmNinjaNormalTargetGenerator( cmGeneratorTarget* target) : cmNinjaTargetGenerator(target) - , TargetNameOut() - , TargetNameSO() - , TargetNameReal() - , TargetNameImport() - , TargetNamePDB() , TargetLinkLanguage("") - , DeviceLinkObject() { this->TargetLinkLanguage = target->GetLinkerLanguage(this->GetConfigName()); if (target->GetType() == cmStateEnums::EXECUTABLE) { @@ -557,6 +551,10 @@ std::vector<std::string> cmNinjaNormalTargetGenerator::ComputeLinkCmd() void cmNinjaNormalTargetGenerator::WriteDeviceLinkStatement() { + if (!this->GetGlobalGenerator()->GetLanguageEnabled("CUDA")) { + return; + } + cmGeneratorTarget& genTarget = *this->GetGeneratorTarget(); // determine if we need to do any device linking for this target diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index 7ac8d1b..228c9fb 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -54,10 +54,8 @@ cmNinjaTargetGenerator::cmNinjaTargetGenerator(cmGeneratorTarget* target) : cmCommonTargetGenerator(target) , MacOSXContentGenerator(nullptr) , OSXBundleGenerator(nullptr) - , MacContentFolders() , LocalGenerator( static_cast<cmLocalNinjaGenerator*>(target->GetLocalGenerator())) - , Objects() { MacOSXContentGenerator = new MacOSXContentGeneratorType(this); } diff --git a/Source/cmOutputConverter.cxx b/Source/cmOutputConverter.cxx index 43a0107..011c7d8 100644 --- a/Source/cmOutputConverter.cxx +++ b/Source/cmOutputConverter.cxx @@ -9,7 +9,6 @@ #include <string.h> #include <vector> -#include "cmAlgorithms.h" #include "cmState.h" #include "cmStateDirectory.h" #include "cmSystemTools.h" @@ -73,119 +72,15 @@ std::string cmOutputConverter::ConvertDirectorySeparatorsForShell( return result; } -static bool cmOutputConverterNotAbove(const char* a, const char* b) -{ - return (cmSystemTools::ComparePath(a, b) || - cmSystemTools::IsSubDirectory(a, b)); -} - -bool cmOutputConverter::ContainedInDirectory(std::string const& local_path, - std::string const& remote_path, - cmStateDirectory const& directory) -{ - const std::string& relativePathTopBinary = - directory.GetRelativePathTopBinary(); - const std::string& relativePathTopSource = - directory.GetRelativePathTopSource(); - - const bool bothInBinary = - cmOutputConverterNotAbove(local_path.c_str(), - relativePathTopBinary.c_str()) && - cmOutputConverterNotAbove(remote_path.c_str(), - relativePathTopBinary.c_str()); - - const bool bothInSource = - cmOutputConverterNotAbove(local_path.c_str(), - relativePathTopSource.c_str()) && - cmOutputConverterNotAbove(remote_path.c_str(), - relativePathTopSource.c_str()); - - return bothInSource || bothInBinary; -} - std::string cmOutputConverter::ConvertToRelativePath( std::string const& local_path, std::string const& remote_path) const { - if (!ContainedInDirectory(local_path, remote_path, - this->StateSnapshot.GetDirectory())) { + if (!this->StateSnapshot.GetDirectory().ContainsBoth(local_path, + remote_path)) { return remote_path; } - return this->ForceToRelativePath(local_path, remote_path); -} - -std::string cmOutputConverter::ForceToRelativePath( - std::string const& local_path, std::string const& remote_path) -{ - // The paths should never be quoted. - assert(local_path.front() != '\"'); - assert(remote_path.front() != '\"'); - - // The local path should never have a trailing slash. - assert(local_path.empty() || local_path.back() != '/'); - - // If the path is already relative then just return the path. - if (!cmSystemTools::FileIsFullPath(remote_path)) { - return remote_path; - } - - // Identify the longest shared path component between the remote - // path and the local path. - std::vector<std::string> local; - cmSystemTools::SplitPath(local_path, local); - std::vector<std::string> remote; - cmSystemTools::SplitPath(remote_path, remote); - unsigned int common = 0; - while (common < remote.size() && common < local.size() && - cmSystemTools::ComparePath(remote[common], local[common])) { - ++common; - } - - // If no part of the path is in common then return the full path. - if (common == 0) { - return remote_path; - } - - // If the entire path is in common then just return a ".". - if (common == remote.size() && common == local.size()) { - return "."; - } - - // If the entire path is in common except for a trailing slash then - // just return a "./". - if (common + 1 == remote.size() && remote[common].empty() && - common == local.size()) { - return "./"; - } - - // Construct the relative path. - std::string relative; - - // First add enough ../ to get up to the level of the shared portion - // of the path. Leave off the trailing slash. Note that the last - // component of local will never be empty because local should never - // have a trailing slash. - for (unsigned int i = common; i < local.size(); ++i) { - relative += ".."; - if (i < local.size() - 1) { - relative += "/"; - } - } - - // Now add the portion of the destination path that is not included - // in the shared portion of the path. Add a slash the first time - // only if there was already something in the path. If there was a - // trailing slash in the input then the last iteration of the loop - // will add a slash followed by an empty string which will preserve - // the trailing slash in the output. - - if (!relative.empty() && !remote.empty()) { - relative += "/"; - } - relative += cmJoin(cmMakeRange(remote).advance(common), "/"); - - // Finally return the path. - return relative; + return cmSystemTools::ForceToRelativePath(local_path, remote_path); } static bool cmOutputConverterIsShellOperator(const std::string& str) diff --git a/Source/cmOutputConverter.h b/Source/cmOutputConverter.h index ed7143c..5a4f879 100644 --- a/Source/cmOutputConverter.h +++ b/Source/cmOutputConverter.h @@ -10,7 +10,6 @@ #include "cmStateSnapshot.h" class cmState; -class cmStateDirectory; class cmOutputConverter { @@ -92,10 +91,6 @@ public: }; static FortranFormat GetFortranFormat(const char* value); - static bool ContainedInDirectory(std::string const& local_path, - std::string const& remote_path, - cmStateDirectory const& directory); - /** * Convert the given remote path to a relative path with respect to * the given local path. Both paths must use forward slashes and not @@ -106,14 +101,6 @@ public: std::string ConvertToRelativePath(std::string const& local_path, std::string const& remote_path) const; - /** - * Convert the given remote path to a relative path with respect to - * the given local path. Both paths must use forward slashes and not - * already be escaped or quoted. - */ - static std::string ForceToRelativePath(std::string const& local_path, - std::string const& remote_path); - private: cmState* GetState() const; diff --git a/Source/cmOutputRequiredFilesCommand.cxx b/Source/cmOutputRequiredFilesCommand.cxx index 87c1ec0..ab1e699 100644 --- a/Source/cmOutputRequiredFilesCommand.cxx +++ b/Source/cmOutputRequiredFilesCommand.cxx @@ -28,11 +28,7 @@ public: * Construct with dependency generation marked not done; instance * not placed in cmMakefile's list. */ - cmDependInformation() - : DependDone(false) - , SourceFile(nullptr) - { - } + cmDependInformation() {} /** * The set of files on which this one depends. @@ -44,13 +40,13 @@ public: * This flag indicates whether dependency checking has been * performed for this file. */ - bool DependDone; + bool DependDone = false; /** * If this object corresponds to a cmSourceFile instance, this points * to it. */ - const cmSourceFile* SourceFile; + const cmSourceFile* SourceFile = nullptr; /** * Full path to this file. diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h index 6b1314f..206dd3d 100644 --- a/Source/cmPolicies.h +++ b/Source/cmPolicies.h @@ -249,7 +249,16 @@ class cmMakefile; 0, cmPolicies::WARN) \ SELECT(POLICY, CMP0084, \ "The FindQt module does not exist for find_package().", 3, 14, 0, \ - cmPolicies::WARN) + cmPolicies::WARN) \ + SELECT(POLICY, CMP0085, "$<IN_LIST:...> handles empty list items.", 3, 14, \ + 0, cmPolicies::WARN) \ + SELECT(POLICY, CMP0086, \ + "UseSWIG honors SWIG_MODULE_NAME via -module flag.", 3, 14, 0, \ + cmPolicies::WARN) \ + SELECT(POLICY, CMP0087, \ + "Install CODE|SCRIPT allow the use of generator " \ + "expressions.", \ + 3, 14, 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/cmProcessTools.cxx b/Source/cmProcessTools.cxx index 7ab1fa3..facde5d 100644 --- a/Source/cmProcessTools.cxx +++ b/Source/cmProcessTools.cxx @@ -45,10 +45,7 @@ void cmProcessTools::RunProcess(struct cmsysProcess_s* cp, OutputParser* out, } cmProcessTools::LineParser::LineParser(char sep, bool ignoreCR) - : Log(nullptr) - , Prefix(nullptr) - , Separator(sep) - , LineEnd('\0') + : Separator(sep) , IgnoreCR(ignoreCR) { } diff --git a/Source/cmProcessTools.h b/Source/cmProcessTools.h index f1c2a22..da3693d 100644 --- a/Source/cmProcessTools.h +++ b/Source/cmProcessTools.h @@ -54,11 +54,11 @@ public: void SetLog(std::ostream* log, const char* prefix); protected: - std::ostream* Log; - const char* Prefix; + std::ostream* Log = nullptr; + const char* Prefix = nullptr; std::string Line; char Separator; - char LineEnd; + char LineEnd = '\0'; bool IgnoreCR; bool ProcessChunk(const char* data, int length) override; diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx index e71feac..6a2a951 100644 --- a/Source/cmQtAutoGenInitializer.cxx +++ b/Source/cmQtAutoGenInitializer.cxx @@ -35,9 +35,22 @@ #include <set> #include <sstream> #include <string> +#include <type_traits> #include <utility> #include <vector> +std::string GetQtExecutableTargetName( + const cmQtAutoGen::IntegerVersion& qtVersion, std::string const& executable) +{ + if (qtVersion.Major == 5) { + return ("Qt5::" + executable); + } + if (qtVersion.Major == 4) { + return ("Qt4::" + executable); + } + return (""); +} + static std::size_t GetParallelCPUCount() { static std::size_t count = 0; @@ -334,7 +347,7 @@ bool cmQtAutoGenInitializer::InitCustomTargets() // Info directory this->Dir.Info = cbd; - this->Dir.Info += makefile->GetCMakeInstance()->GetCMakeFilesDirectory(); + this->Dir.Info += cmake::GetCMakeFilesDirectory(); this->Dir.Info += '/'; this->Dir.Info += this->Target->GetName(); this->Dir.Info += "_autogen"; @@ -489,10 +502,13 @@ bool cmQtAutoGenInitializer::InitMoc() // Moc includes { - bool const appendImplicit = (this->QtVersion.Major == 5); + // We need to disable this until we have all implicit includes available. + // See issue #18669. + // bool const appendImplicit = (this->QtVersion.Major == 5); + auto GetIncludeDirs = - [this, localGen, - appendImplicit](std::string const& cfg) -> std::vector<std::string> { + [this, localGen](std::string const& cfg) -> std::vector<std::string> { + bool const appendImplicit = false; // Get the include dirs for this target, without stripping the implicit // include dirs off, see // https://gitlab.kitware.com/cmake/cmake/issues/13667 @@ -521,6 +537,12 @@ bool cmQtAutoGenInitializer::InitMoc() [this, localGen](std::string const& cfg) -> std::set<std::string> { std::set<std::string> defines; localGen->GetTargetDefines(this->Target, cfg, "CXX", defines); +#ifdef _WIN32 + if (this->Moc.PredefsCmd.empty()) { + // Add WIN32 definition if we don't have a moc_predefs.h + defines.insert("WIN32"); + } +#endif return defines; }; @@ -538,11 +560,7 @@ bool cmQtAutoGenInitializer::InitMoc() } // Moc executable - if (!GetMocExecutable()) { - return false; - } - - return true; + return GetMocExecutable(); } bool cmQtAutoGenInitializer::InitUic() @@ -619,19 +637,12 @@ bool cmQtAutoGenInitializer::InitUic() } // Uic executable - if (!GetUicExecutable()) { - return false; - } - - return true; + return GetUicExecutable(); } bool cmQtAutoGenInitializer::InitRcc() { - if (!GetRccExecutable()) { - return false; - } - return true; + return GetRccExecutable(); } bool cmQtAutoGenInitializer::InitScanFiles() @@ -1342,251 +1353,170 @@ void cmQtAutoGenInitializer::AddGeneratedSource(std::string const& filename, this->Target->AddSource(filename); } -cmQtAutoGenInitializer::IntegerVersion cmQtAutoGenInitializer::GetQtVersion( - cmGeneratorTarget const* target) +static unsigned int CharPtrToInt(const char* const input) { - cmQtAutoGenInitializer::IntegerVersion res; - cmMakefile* makefile = target->Target->GetMakefile(); - - // -- Major version - std::string qtMajor = makefile->GetSafeDefinition("QT_VERSION_MAJOR"); - if (qtMajor.empty()) { - qtMajor = makefile->GetSafeDefinition("Qt5Core_VERSION_MAJOR"); - } - { - const char* targetQtVersion = - target->GetLinkInterfaceDependentStringProperty("QT_MAJOR_VERSION", ""); - if (targetQtVersion != nullptr) { - qtMajor = targetQtVersion; - } + unsigned long tmp = 0; + if (input != nullptr && cmSystemTools::StringToULong(input, &tmp)) { + return static_cast<unsigned int>(tmp); } + return 0; +} - // -- Minor version - std::string qtMinor; - if (!qtMajor.empty()) { - if (qtMajor == "5") { - qtMinor = makefile->GetSafeDefinition("Qt5Core_VERSION_MINOR"); - } - if (qtMinor.empty()) { - qtMinor = makefile->GetSafeDefinition("QT_VERSION_MINOR"); - } - { - const char* targetQtVersion = - target->GetLinkInterfaceDependentStringProperty("QT_MINOR_VERSION", - ""); - if (targetQtVersion != nullptr) { - qtMinor = targetQtVersion; - } - } - } +static unsigned int StringToInt(const std::string& input) +{ + return input.empty() ? 0 : CharPtrToInt(input.c_str()); +} + +static std::vector<cmQtAutoGenInitializer::IntegerVersion> GetKnownQtVersions( + cmGeneratorTarget const* target) +{ + cmMakefile* makefile = target->Target->GetMakefile(); - // -- Convert to integer - if (!qtMajor.empty() && !qtMinor.empty()) { - unsigned long majorUL(0); - unsigned long minorUL(0); - if (cmSystemTools::StringToULong(qtMajor.c_str(), &majorUL) && - cmSystemTools::StringToULong(qtMinor.c_str(), &minorUL)) { - res.Major = static_cast<unsigned int>(majorUL); - res.Minor = static_cast<unsigned int>(minorUL); + std::vector<cmQtAutoGenInitializer::IntegerVersion> result; + for (const std::string& prefix : + std::vector<std::string>({ "Qt5Core", "QT" })) { + auto tmp = cmQtAutoGenInitializer::IntegerVersion( + StringToInt(makefile->GetSafeDefinition(prefix + "_VERSION_MAJOR")), + StringToInt(makefile->GetSafeDefinition(prefix + "_VERSION_MINOR"))); + if (tmp.Major != 0) { + result.push_back(tmp); } } - return res; + return result; } -bool cmQtAutoGenInitializer::GetMocExecutable() +cmQtAutoGenInitializer::IntegerVersion cmQtAutoGenInitializer::GetQtVersion( + cmGeneratorTarget const* target) { - std::string err; - - // Find moc executable - { - std::string targetName; - if (this->QtVersion.Major == 5) { - targetName = "Qt5::moc"; - } else if (this->QtVersion.Major == 4) { - targetName = "Qt4::moc"; - } else { - err = "The AUTOMOC feature supports only Qt 4 and Qt 5"; - } - if (!targetName.empty()) { - cmLocalGenerator* localGen = this->Target->GetLocalGenerator(); - cmGeneratorTarget* tgt = localGen->FindGeneratorTargetToUse(targetName); - if (tgt != nullptr) { - this->Moc.Executable = tgt->ImportedGetLocation(""); - } else { - err = "Could not find target " + targetName; - } - } + auto knownQtVersions = GetKnownQtVersions(target); + if (knownQtVersions.empty()) { + return cmQtAutoGenInitializer::IntegerVersion(); // No Qt } - // Test moc command - if (err.empty()) { - if (cmSystemTools::FileExists(this->Moc.Executable, true)) { - std::vector<std::string> command; - command.push_back(this->Moc.Executable); - command.push_back("-h"); - std::string stdOut; - std::string stdErr; - int retVal = 0; - bool result = cmSystemTools::RunSingleCommand( - command, &stdOut, &stdErr, &retVal, nullptr, - cmSystemTools::OUTPUT_NONE, cmDuration::zero(), cmProcessOutput::Auto); - if (!result) { - err = "The moc test command failed: "; - err += QuotedCommand(command); - } - } else { - err = "The moc executable "; - err += Quoted(this->Moc.Executable); - err += " does not exist"; - } + // Pick a version from the known versions: + auto targetVersion = CharPtrToInt( + target->GetLinkInterfaceDependentStringProperty("QT_MAJOR_VERSION", "")); + + if (targetVersion == 0) { + // No specific version was requested by the target: + // Use highest known Qt version. + return knownQtVersions.at(0); } - // Print error - if (!err.empty()) { - std::string msg = "AutoMoc ("; - msg += this->Target->GetName(); - msg += "): "; - msg += err; - cmSystemTools::Error(msg.c_str()); - return false; + for (auto it : knownQtVersions) { + if (it.Major == targetVersion) { + return it; + } } - return true; + // Requested version was not found + return cmQtAutoGenInitializer::IntegerVersion(); } -bool cmQtAutoGenInitializer::GetUicExecutable() +std::pair<bool, std::string> GetQtExecutable( + const cmQtAutoGen::IntegerVersion& qtVersion, cmGeneratorTarget* target, + const std::string& executable, bool ignoreMissingTarget, std::string* output) { std::string err; + std::string result; - // Find uic executable + // Find executable { - std::string targetName; - if (this->QtVersion.Major == 5) { - targetName = "Qt5::uic"; - } else if (this->QtVersion.Major == 4) { - targetName = "Qt4::uic"; + const std::string targetName = + GetQtExecutableTargetName(qtVersion, executable); + if (targetName.empty()) { + err = "The AUTOMOC, AUTOUIC and AUTORCC feature "; + err += "supports only Qt 4 and Qt 5"; } else { - err = "The AUTOUIC feature supports only Qt 4 and Qt 5"; - } - if (!targetName.empty()) { - cmLocalGenerator* localGen = this->Target->GetLocalGenerator(); + cmLocalGenerator* localGen = target->GetLocalGenerator(); cmGeneratorTarget* tgt = localGen->FindGeneratorTargetToUse(targetName); if (tgt != nullptr) { - this->Uic.Executable = tgt->ImportedGetLocation(""); + result = tgt->ImportedGetLocation(""); } else { - if (this->QtVersion.Major == 5) { - // Project does not use Qt5Widgets, but has AUTOUIC ON anyway - } else { - err = "Could not find target " + targetName; + if (ignoreMissingTarget) { + return std::make_pair(true, ""); } + + err = "Could not find target " + targetName; } } } - // Test uic command + // Test executable if (err.empty()) { - if (cmSystemTools::FileExists(this->Uic.Executable, true)) { + if (cmSystemTools::FileExists(result, true)) { std::vector<std::string> command; - command.push_back(this->Uic.Executable); + command.push_back(result); command.push_back("-h"); std::string stdOut; std::string stdErr; int retVal = 0; - bool result = cmSystemTools::RunSingleCommand( + const bool runResult = cmSystemTools::RunSingleCommand( command, &stdOut, &stdErr, &retVal, nullptr, cmSystemTools::OUTPUT_NONE, cmDuration::zero(), cmProcessOutput::Auto); - if (!result) { - err = "The uic test command failed: "; - err += QuotedCommand(command); + if (!runResult) { + err = "Test of \"" + executable + "\" binary "; + err += cmQtAutoGen::Quoted(result) + " failed: "; + err += cmQtAutoGen::QuotedCommand(command); + } else { + if (output != nullptr) { + *output = stdOut; + } } } else { - err = "The uic executable "; - err += Quoted(this->Uic.Executable); + err = "The \"" + executable + "\" binary "; + err += cmQtAutoGen::Quoted(result); err += " does not exist"; } } // Print error if (!err.empty()) { - std::string msg = "AutoUic ("; - msg += this->Target->GetName(); + std::string msg = "AutoGen ("; + msg += target->GetName(); msg += "): "; msg += err; cmSystemTools::Error(msg.c_str()); - return false; + return std::make_pair(false, ""); } - return true; + return std::make_pair(true, result); } -bool cmQtAutoGenInitializer::GetRccExecutable() +bool cmQtAutoGenInitializer::GetMocExecutable() { - std::string err; + const auto result = + GetQtExecutable(this->QtVersion, this->Target, "moc", false, nullptr); + this->Moc.Executable = result.second; + return result.first; +} - // Find rcc executable - { - std::string targetName; - if (this->QtVersion.Major == 5) { - targetName = "Qt5::rcc"; - } else if (this->QtVersion.Major == 4) { - targetName = "Qt4::rcc"; - } else { - err = "The AUTORCC feature supports only Qt 4 and Qt 5"; - } - if (!targetName.empty()) { - cmLocalGenerator* localGen = this->Target->GetLocalGenerator(); - cmGeneratorTarget* tgt = localGen->FindGeneratorTargetToUse(targetName); - if (tgt != nullptr) { - this->Rcc.Executable = tgt->ImportedGetLocation(""); - } else { - err = "Could not find target " + targetName; - } - } +bool cmQtAutoGenInitializer::GetUicExecutable() +{ + const auto result = + GetQtExecutable(this->QtVersion, this->Target, "uic", true, nullptr); + this->Uic.Executable = result.second; + return result.first; +} + +bool cmQtAutoGenInitializer::GetRccExecutable() +{ + std::string stdOut; + const auto result = + GetQtExecutable(this->QtVersion, this->Target, "rcc", false, &stdOut); + this->Rcc.Executable = result.second; + if (!result.first) { + return false; } - // Test rcc command - if (err.empty()) { - if (cmSystemTools::FileExists(this->Rcc.Executable, true)) { - std::vector<std::string> command; - command.push_back(this->Rcc.Executable); - command.push_back("-h"); - std::string stdOut; - std::string stdErr; - int retVal = 0; - bool result = cmSystemTools::RunSingleCommand( - command, &stdOut, &stdErr, &retVal, nullptr, - cmSystemTools::OUTPUT_NONE, cmDuration::zero(), cmProcessOutput::Auto); - if (result) { - // Detect if rcc supports (-)-list - if (this->QtVersion.Major == 5) { - if (stdOut.find("--list") != std::string::npos) { - this->Rcc.ListOptions.push_back("--list"); - } else { - this->Rcc.ListOptions.push_back("-list"); - } - } - } else { - err = "The rcc test command failed: "; - err += QuotedCommand(command); - } + if (this->QtVersion.Major == 5) { + if (stdOut.find("--list") != std::string::npos) { + this->Rcc.ListOptions.push_back("--list"); } else { - err = "The rcc executable "; - err += Quoted(this->Rcc.Executable); - err += " does not exist"; + this->Rcc.ListOptions.push_back("-list"); } } - - // Print error - if (!err.empty()) { - std::string msg = "AutoRcc ("; - msg += this->Target->GetName(); - msg += "): "; - msg += err; - cmSystemTools::Error(msg.c_str()); - return false; - } - return true; } diff --git a/Source/cmQtAutoGenInitializer.h b/Source/cmQtAutoGenInitializer.h index 903ec85..5cef1b3 100644 --- a/Source/cmQtAutoGenInitializer.h +++ b/Source/cmQtAutoGenInitializer.h @@ -25,11 +25,7 @@ public: class Qrc { public: - Qrc() - : Generated(false) - , Unique(false) - { - } + Qrc() {} public: std::string LockFile; @@ -40,8 +36,8 @@ public: std::string SettingsFile; std::map<std::string, std::string> ConfigSettingsFile; std::string RccFile; - bool Generated; - bool Unique; + bool Generated = false; + bool Unique = false; std::vector<std::string> Options; std::vector<std::string> Resources; }; @@ -54,7 +50,7 @@ public: InfoWriter(std::string const& filename); /// @return True if the file is open - operator bool() const { return static_cast<bool>(Ofs_); } + explicit operator bool() const { return static_cast<bool>(Ofs_); } void Write(const char* text) { Ofs_ << text; } void Write(const char* key, std::string const& value); diff --git a/Source/cmQtAutoGeneratorMocUic.cxx b/Source/cmQtAutoGeneratorMocUic.cxx index 2e6f90f..e6ee85b 100644 --- a/Source/cmQtAutoGeneratorMocUic.cxx +++ b/Source/cmQtAutoGeneratorMocUic.cxx @@ -1130,11 +1130,6 @@ void cmQtAutoGeneratorMocUic::WorkerT::UVProcessFinished() cmQtAutoGeneratorMocUic::cmQtAutoGeneratorMocUic() : Base_(&FileSys()) , Moc_(&FileSys()) - , Stage_(StageT::SETTINGS_READ) - , JobsRemain_(0) - , JobError_(false) - , JobThreadsAbort_(false) - , MocAutoFileUpdated_(false) { // Precompile regular expressions Moc_.RegExpInclude.compile( @@ -1279,16 +1274,6 @@ bool cmQtAutoGeneratorMocUic::Init(cmMakefile* makefile) Moc_.SkipList.insert(lst.begin(), lst.end()); } Moc_.Definitions = InfoGetConfigList("AM_MOC_DEFINITIONS"); -#ifdef _WIN32 - { - std::string win32("WIN32"); - auto itB = Moc().Definitions.cbegin(); - auto itE = Moc().Definitions.cend(); - if (std::find(itB, itE, win32) == itE) { - Moc_.Definitions.emplace_back(std::move(win32)); - } - } -#endif Moc_.IncludePaths = InfoGetConfigList("AM_MOC_INCLUDES"); Moc_.Options = InfoGetList("AM_MOC_OPTIONS"); Moc_.RelaxedMode = InfoGetBool("AM_MOC_RELAXED_MODE"); diff --git a/Source/cmQtAutoGeneratorMocUic.h b/Source/cmQtAutoGeneratorMocUic.h index 2226954..edf597c 100644 --- a/Source/cmQtAutoGeneratorMocUic.h +++ b/Source/cmQtAutoGeneratorMocUic.h @@ -404,7 +404,7 @@ private: MocSettingsT Moc_; UicSettingsT Uic_; // -- Progress - StageT Stage_; + StageT Stage_ = StageT::SETTINGS_READ; // -- Job queues std::mutex JobsMutex_; struct @@ -416,15 +416,15 @@ private: JobQueueT Uic; } JobQueues_; JobQueueT JobQueue_; - std::size_t volatile JobsRemain_; - bool volatile JobError_; - bool volatile JobThreadsAbort_; + std::size_t volatile JobsRemain_ = 0; + bool volatile JobError_ = false; + bool volatile JobThreadsAbort_ = false; std::condition_variable JobsConditionRead_; // -- Moc meta std::set<std::string> MocIncludedStrings_; std::set<std::string> MocIncludedFiles_; std::set<std::string> MocAutoFiles_; - bool volatile MocAutoFileUpdated_; + bool volatile MocAutoFileUpdated_ = false; // -- Settings file std::string SettingsFile_; std::string SettingsStringMoc_; diff --git a/Source/cmQtAutoGeneratorRcc.cxx b/Source/cmQtAutoGeneratorRcc.cxx index 65c6741..29dc7a0 100644 --- a/Source/cmQtAutoGeneratorRcc.cxx +++ b/Source/cmQtAutoGeneratorRcc.cxx @@ -15,12 +15,6 @@ // -- Class methods cmQtAutoGeneratorRcc::cmQtAutoGeneratorRcc() - : MultiConfig_(false) - , SettingsChanged_(false) - , Stage_(StageT::SETTINGS_READ) - , Error_(false) - , Generate_(false) - , BuildFileChanged_(false) { // Initialize libuv asynchronous iteration request UVRequest().init(*UVLoop(), &cmQtAutoGeneratorRcc::UVPollStage, this); diff --git a/Source/cmQtAutoGeneratorRcc.h b/Source/cmQtAutoGeneratorRcc.h index 74cec36..1148071 100644 --- a/Source/cmQtAutoGeneratorRcc.h +++ b/Source/cmQtAutoGeneratorRcc.h @@ -70,7 +70,7 @@ private: private: // -- Config settings - bool MultiConfig_; + bool MultiConfig_ = false; // -- Directories std::string AutogenBuildDir_; std::string IncludeDir_; @@ -95,12 +95,12 @@ private: // -- Settings file std::string SettingsFile_; std::string SettingsString_; - bool SettingsChanged_; + bool SettingsChanged_ = false; // -- libuv loop - StageT Stage_; - bool Error_; - bool Generate_; - bool BuildFileChanged_; + StageT Stage_ = StageT::SETTINGS_READ; + bool Error_ = false; + bool Generate_ = false; + bool BuildFileChanged_ = false; }; #endif diff --git a/Source/cmRST.cxx b/Source/cmRST.cxx index 8a04c1f..f0f92aa 100644 --- a/Source/cmRST.cxx +++ b/Source/cmRST.cxx @@ -122,7 +122,7 @@ void cmRST::ProcessModule(std::istream& is) void cmRST::Reset() { if (!this->MarkupLines.empty()) { - this->UnindentLines(this->MarkupLines); + cmRST::UnindentLines(this->MarkupLines); } switch (this->Directive) { case DirectiveNone: diff --git a/Source/cmScriptGenerator.h b/Source/cmScriptGenerator.h index c8fed19..0bb388e 100644 --- a/Source/cmScriptGenerator.h +++ b/Source/cmScriptGenerator.h @@ -12,10 +12,7 @@ class cmScriptGeneratorIndent { public: - cmScriptGeneratorIndent() - : Level(0) - { - } + cmScriptGeneratorIndent() {} cmScriptGeneratorIndent(int level) : Level(level) { @@ -32,7 +29,7 @@ public: } private: - int Level; + int Level = 0; }; inline std::ostream& operator<<(std::ostream& os, cmScriptGeneratorIndent indent) diff --git a/Source/cmServer.cxx b/Source/cmServer.cxx index f15a14a..fe0bdc9 100644 --- a/Source/cmServer.cxx +++ b/Source/cmServer.cxx @@ -216,7 +216,7 @@ cmServerResponse cmServer::SetProtocolVersion(const cmServerRequest& request) } this->Protocol = - this->FindMatchingProtocol(this->SupportedProtocols, major, minor); + cmServer::FindMatchingProtocol(this->SupportedProtocols, major, minor); if (!this->Protocol) { return request.ReportError("Protocol version not supported."); } diff --git a/Source/cmServerProtocol.cxx b/Source/cmServerProtocol.cxx index f051fd9..6dbfd10 100644 --- a/Source/cmServerProtocol.cxx +++ b/Source/cmServerProtocol.cxx @@ -244,7 +244,7 @@ bool cmServerProtocol1::DoActivate(const cmServerRequest& request, return false; } - const std::string cachePath = cm->FindCacheFile(buildDirectory); + const std::string cachePath = cmake::FindCacheFile(buildDirectory); if (cm->LoadCache(cachePath)) { cmState* state = cm->GetState(); diff --git a/Source/cmSourceFileLocation.cxx b/Source/cmSourceFileLocation.cxx index 15433f9..90b9123 100644 --- a/Source/cmSourceFileLocation.cxx +++ b/Source/cmSourceFileLocation.cxx @@ -11,9 +11,6 @@ #include <assert.h> cmSourceFileLocation::cmSourceFileLocation() - : Makefile(nullptr) - , AmbiguousDirectory(true) - , AmbiguousExtension(true) { } diff --git a/Source/cmSourceFileLocation.h b/Source/cmSourceFileLocation.h index 886a184..82747ba 100644 --- a/Source/cmSourceFileLocation.h +++ b/Source/cmSourceFileLocation.h @@ -83,9 +83,9 @@ public: cmMakefile const* GetMakefile() const { return this->Makefile; } private: - cmMakefile const* const Makefile; - bool AmbiguousDirectory; - bool AmbiguousExtension; + cmMakefile const* const Makefile = nullptr; + bool AmbiguousDirectory = true; + bool AmbiguousExtension = true; std::string Directory; std::string Name; diff --git a/Source/cmState.cxx b/Source/cmState.cxx index 4bbd2e0..f664000 100644 --- a/Source/cmState.cxx +++ b/Source/cmState.cxx @@ -22,14 +22,6 @@ #include "cmake.h" cmState::cmState() - : IsInTryCompile(false) - , IsGeneratorMultiConfig(false) - , WindowsShell(false) - , WindowsVSIDE(false) - , WatcomWMake(false) - , MinGWMake(false) - , NMake(false) - , MSYSShell(false) { this->CacheManager = new cmCacheManager; this->GlobVerificationManager = new cmGlobVerificationManager; diff --git a/Source/cmState.h b/Source/cmState.h index 916985d..abe93ed 100644 --- a/Source/cmState.h +++ b/Source/cmState.h @@ -202,14 +202,14 @@ private: std::string SourceDirectory; std::string BinaryDirectory; - bool IsInTryCompile; - bool IsGeneratorMultiConfig; - bool WindowsShell; - bool WindowsVSIDE; - bool WatcomWMake; - bool MinGWMake; - bool NMake; - bool MSYSShell; + bool IsInTryCompile = false; + bool IsGeneratorMultiConfig = false; + bool WindowsShell = false; + bool WindowsVSIDE = false; + bool WatcomWMake = false; + bool MinGWMake = false; + bool NMake = false; + bool MSYSShell = false; }; #endif diff --git a/Source/cmStateDirectory.cxx b/Source/cmStateDirectory.cxx index f94e714..40f694c 100644 --- a/Source/cmStateDirectory.cxx +++ b/Source/cmStateDirectory.cxx @@ -138,6 +138,23 @@ void cmStateDirectory::SetRelativePathTopBinary(const char* dir) this->DirectoryState->RelativePathTopBinary = dir; } +bool cmStateDirectory::ContainsBoth(std::string const& local_path, + std::string const& remote_path) const +{ + auto PathEqOrSubDir = [](std::string const& a, std::string const& b) { + return (cmSystemTools::ComparePath(a, b) || + cmSystemTools::IsSubDirectory(a, b)); + }; + + bool bothInBinary = PathEqOrSubDir(local_path, GetRelativePathTopBinary()) && + PathEqOrSubDir(remote_path, GetRelativePathTopBinary()); + + bool bothInSource = PathEqOrSubDir(local_path, GetRelativePathTopSource()) && + PathEqOrSubDir(remote_path, GetRelativePathTopSource()); + + return bothInBinary || bothInSource; +} + cmStateDirectory::cmStateDirectory( cmLinkedTree<cmStateDetail::BuildsystemDirectoryStateType>::iterator iter, const cmStateSnapshot& snapshot) diff --git a/Source/cmStateDirectory.h b/Source/cmStateDirectory.h index e5f4d05..c4b18ad 100644 --- a/Source/cmStateDirectory.h +++ b/Source/cmStateDirectory.h @@ -32,6 +32,9 @@ public: void SetRelativePathTopSource(const char* dir); void SetRelativePathTopBinary(const char* dir); + bool ContainsBoth(std::string const& local_path, + std::string const& remote_path) const; + cmStringRange GetIncludeDirectoriesEntries() const; cmBacktraceRange GetIncludeDirectoriesEntryBacktraces() const; void AppendIncludeDirectoriesEntry(std::string const& vec, diff --git a/Source/cmStatePrivate.h b/Source/cmStatePrivate.h index e76f2af..ec0ed6c 100644 --- a/Source/cmStatePrivate.h +++ b/Source/cmStatePrivate.h @@ -50,8 +50,7 @@ struct cmStateDetail::PolicyStackEntry : public cmPolicies::PolicyMap { typedef cmPolicies::PolicyMap derived; PolicyStackEntry(bool w = false) - : derived() - , Weak(w) + : Weak(w) { } PolicyStackEntry(derived const& d, bool w) diff --git a/Source/cmStateSnapshot.cxx b/Source/cmStateSnapshot.cxx index c2510f3..a4305e6 100644 --- a/Source/cmStateSnapshot.cxx +++ b/Source/cmStateSnapshot.cxx @@ -28,7 +28,6 @@ cmStateSnapshot::cmStateSnapshot(cmState* state) : State(state) - , Position() { } @@ -66,6 +65,12 @@ bool cmStateSnapshot::IsValid() const : false; } +cmStateSnapshot cmStateSnapshot::GetBuildsystemDirectory() const +{ + return cmStateSnapshot(this->State, + this->Position->BuildSystemDirectory->DirectoryEnd); +} + cmStateSnapshot cmStateSnapshot::GetBuildsystemDirectoryParent() const { cmStateSnapshot snapshot; diff --git a/Source/cmStateSnapshot.h b/Source/cmStateSnapshot.h index 014c62e..c315f48 100644 --- a/Source/cmStateSnapshot.h +++ b/Source/cmStateSnapshot.h @@ -37,6 +37,7 @@ public: std::vector<cmStateSnapshot> GetChildren(); bool IsValid() const; + cmStateSnapshot GetBuildsystemDirectory() const; cmStateSnapshot GetBuildsystemDirectoryParent() const; cmStateSnapshot GetCallStackParent() const; cmStateSnapshot GetCallStackBottom() const; diff --git a/Source/cmString.cxx b/Source/cmString.cxx new file mode 100644 index 0000000..2a0c125 --- /dev/null +++ b/Source/cmString.cxx @@ -0,0 +1,152 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ +#define _SCL_SECURE_NO_WARNINGS + +#include "cmString.hxx" + +#include <memory> +#include <ostream> +#include <stdexcept> +#include <string> +#include <type_traits> + +namespace cm { + +static std::string const empty_string_; + +void String::internally_mutate_to_stable_string() +{ + // We assume that only one thread mutates this instance at + // a time even if we point to a shared string buffer refernced + // by other threads. + *this = String(data(), size()); +} + +bool String::is_stable() const +{ + return str_if_stable() != nullptr; +} + +void String::stabilize() +{ + if (is_stable()) { + return; + } + this->internally_mutate_to_stable_string(); +} + +std::string const* String::str_if_stable() const +{ + if (!data()) { + // We view no string. + // This is stable for the lifetime of our current value. + return &empty_string_; + } + + if (string_ && data() == string_->data() && size() == string_->size()) { + // We view an entire string. + // This is stable for the lifetime of our current value. + return string_.get(); + } + + return nullptr; +} + +std::string const& String::str() +{ + if (std::string const* s = str_if_stable()) { + return *s; + } + // Mutate to hold a std::string that is stable for the lifetime + // of our current value. + this->internally_mutate_to_stable_string(); + return *string_; +} + +const char* String::c_str() +{ + const char* c = data(); + if (c == nullptr) { + return c; + } + + // We always point into a null-terminated string so it is safe to + // access one past the end. If it is a null byte then we can use + // the pointer directly. + if (c[size()] == '\0') { + return c; + } + + // Mutate to hold a std::string so we can get a null terminator. + this->internally_mutate_to_stable_string(); + c = string_->c_str(); + return c; +} + +String& String::insert(size_type index, size_type count, char ch) +{ + std::string s; + s.reserve(size() + count); + s.assign(data(), size()); + s.insert(index, count, ch); + return *this = std::move(s); +} + +String& String::erase(size_type index, size_type count) +{ + if (index > size()) { + throw std::out_of_range("Index out of range in String::erase"); + } + size_type const rcount = std::min(count, size() - index); + size_type const rindex = index + rcount; + std::string s; + s.reserve(size() - rcount); + s.assign(data(), index); + s.append(data() + rindex, size() - rindex); + return *this = std::move(s); +} + +String String::substr(size_type pos, size_type count) const +{ + if (pos > size()) { + throw std::out_of_range("Index out of range in String::substr"); + } + return String(*this, pos, count); +} + +String::String(std::string&& s, Private) + : string_(std::make_shared<std::string>(std::move(s))) + , view_(string_->data(), string_->size()) +{ +} + +String::size_type String::copy(char* dest, size_type count, + size_type pos) const +{ + return view_.copy(dest, count, pos); +} + +std::ostream& operator<<(std::ostream& os, String const& s) +{ + return os.write(s.data(), s.size()); +} + +std::string& operator+=(std::string& self, String const& s) +{ + return self += s.view(); +} + +String IntoString<char*>::into_string(const char* s) +{ + if (!s) { + return String(); + } + return std::string(s); +} + +string_view AsStringView<String>::view(String const& s) +{ + return s.view(); +} + +} // namespace cm diff --git a/Source/cmString.hxx b/Source/cmString.hxx new file mode 100644 index 0000000..e5ece52 --- /dev/null +++ b/Source/cmString.hxx @@ -0,0 +1,814 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ +#ifndef cmString_hxx +#define cmString_hxx + +#include "cmConfigure.h" // IWYU pragma: keep + +#include "cm_static_string_view.hxx" +#include "cm_string_view.hxx" + +#include <algorithm> +#include <functional> +#include <initializer_list> +#include <memory> +#include <ostream> +#include <string> +#include <type_traits> + +namespace cm { + +class String; + +/** + * Trait to convert type T into a String. + * Implementations must derive from 'std::true_type' + * and define an 'into_string' member that accepts + * type T (by value or reference) and returns one of: + * + * - 'std::string' to construct an owned instance. + * - 'cm::string_view' to construct a borrowed or null instances. + * The buffer from which the view is borrowed must outlive + * all copies of the resulting String, e.g. static storage. + * - 'cm::String' for already-constructed instances. + */ +template <typename T> +struct IntoString : std::false_type +{ +}; + +template <typename T> +struct IntoString<T&> : IntoString<T> +{ +}; + +template <typename T> +struct IntoString<T const> : IntoString<T> +{ +}; + +template <typename T> +struct IntoString<T const*> : IntoString<T*> +{ +}; + +template <typename T, std::string::size_type N> +struct IntoString<T const[N]> : IntoString<T[N]> +{ +}; + +template <> +struct IntoString<char*> : std::true_type +{ + static String into_string(const char* s); +}; + +template <> +struct IntoString<std::nullptr_t> : std::true_type +{ + static string_view into_string(std::nullptr_t) { return string_view(); } +}; + +template <std::string::size_type N> +struct IntoString<char[N]> : std::true_type +{ + static std::string into_string(char const (&s)[N]) + { + return std::string(s, N - 1); + } +}; + +template <> +struct IntoString<std::string> : std::true_type +{ + static std::string into_string(std::string s) { return s; } +}; + +template <> +struct IntoString<string_view> : std::true_type +{ + static std::string into_string(string_view s) { return std::string(s); } +}; + +template <> +struct IntoString<static_string_view> : std::true_type +{ + static string_view into_string(static_string_view s) { return s; } +}; + +template <> +struct IntoString<char> : std::true_type +{ + static std::string into_string(char const& c) { return std::string(1, c); } +}; + +/** + * Trait to convert type T into a 'cm::string_view'. + * Implementations must derive from 'std::true_type' and + * define a 'view' member that accepts type T (by reference) + * and returns a 'cm::string_view'. + */ +template <typename T> +struct AsStringView : std::false_type +{ +}; + +template <typename T> +struct AsStringView<T&> : AsStringView<T> +{ +}; + +template <typename T> +struct AsStringView<T const> : AsStringView<T> +{ +}; + +template <typename T> +struct AsStringView<T const*> : AsStringView<T*> +{ +}; + +template <typename T, std::string::size_type N> +struct AsStringView<T const[N]> : AsStringView<T[N]> +{ +}; + +template <> +struct AsStringView<char*> : std::true_type +{ + static string_view view(const char* s) { return s; } +}; + +template <std::string::size_type N> +struct AsStringView<char[N]> : std::true_type +{ + static string_view view(char const (&s)[N]) { return string_view(s, N - 1); } +}; + +template <> +struct AsStringView<std::string> : std::true_type +{ + static string_view view(std::string const& s) { return s; } +}; + +template <> +struct AsStringView<char> : std::true_type +{ + static string_view view(const char& s) { return string_view(&s, 1); } +}; + +template <> +struct AsStringView<string_view> : std::true_type +{ + static string_view view(string_view const& s) { return s; } +}; + +template <> +struct AsStringView<static_string_view> : std::true_type +{ + static string_view view(static_string_view const& s) { return s; } +}; + +template <> +struct AsStringView<String> : std::true_type +{ + static string_view view(String const& s); +}; + +/** + * \class String + * + * A custom string type that holds a view of a string buffer + * and optionally shares ownership of the buffer. Instances + * may have one of the following states: + * + * - null: views and owns nothing. + * Conversion to 'bool' is 'false'. + * 'data()' and 'c_str()' return nullptr. + * 'size()' returns 0. + * 'str()' returns an empty string. + * + * - borrowed: views a string but does not own it. This is used + * to bind to static storage (e.g. string literals) or for + * temporary instances that do not outlive the borrowed buffer. + * Copies and substrings still borrow the original buffer. + * Mutation allocates a new internal string and converts to + * the 'owned' state. + * Conversion to 'bool' is 'true'. + * 'c_str()' may internally mutate to the 'owned' state. + * 'str()' internally mutates to the 'owned' state. + * + * - owned: views an immutable 'std::string' instance owned internally. + * Copies and substrings share ownership of the internal string. + * Mutation allocates a new internal string. + * Conversion to 'bool' is 'true'. + */ +class String +{ + enum class Private + { + }; + +public: + using traits_type = std::string::traits_type; + using value_type = string_view::value_type; + using pointer = string_view::pointer; + using const_pointer = string_view::const_pointer; + using reference = string_view::reference; + using const_reference = string_view::const_reference; + using const_iterator = string_view::const_iterator; + using iterator = string_view::const_iterator; + using const_reverse_iterator = string_view::const_reverse_iterator; + using reverse_iterator = string_view::const_reverse_iterator; + using difference_type = string_view::difference_type; + using size_type = string_view::size_type; + + static size_type const npos = string_view::npos; + + /** Construct a null string. */ + String() = default; + + /** Construct from any type implementing the IntoString trait. */ + template <typename T, + typename = typename std::enable_if<IntoString<T>::value>::type> + String(T&& s) + : String(IntoString<T>::into_string(std::forward<T>(s)), Private()) + { + } + + /** Construct via std::string initializer list constructor. */ + String(std::initializer_list<char> il) + : String(std::string(il)) + { + } + + /** Construct by copying the specified buffer. */ + String(const char* d, size_type s) + : String(std::string(d, s)) + { + } + + /** Construct by copying from input iterator range. */ + template <typename InputIterator> + String(InputIterator first, InputIterator last) + : String(std::string(first, last)) + { + } + + /** Construct a string with 'n' copies of character 'c'. */ + String(size_type n, char c) + : String(std::string(n, c)) + { + } + + /** Construct from a substring of another String instance. + This shares ownership of the other string's buffer + but views only a substring. */ + String(String const& s, size_type pos, size_type count = npos) + : string_(s.string_) + , view_(s.data() + pos, std::min(count, s.size() - pos)) + { + } + + /** Construct by moving from another String instance. + The other instance is left as a null string. */ + String(String&& s) noexcept + : string_(std::move(s.string_)) + , view_(s.view_) + { + s.view_ = string_view(); + } + + /** Construct by copying from another String instance. + This shares ownership of the other string's buffer. */ + String(String const&) noexcept = default; + + ~String() = default; + + /** Construct by borrowing an externally-owned buffer. The buffer + must outlive the returned instance and all copies of it. */ + static String borrow(string_view v) { return String(v, Private()); } + + /** Assign by moving from another String instance. + The other instance is left as a null string. */ + String& operator=(String&& s) noexcept + { + string_ = std::move(s.string_); + view_ = s.view_; + s.view_ = string_view(); + return *this; + } + + /** Assign by copying from another String instance. + This shares ownership of the other string's buffer. */ + String& operator=(String const&) noexcept = default; + + /** Assign from any type implementing the IntoString trait. */ + template <typename T> + typename // NOLINT(*) + std::enable_if<IntoString<T>::value, String&>::type + operator=(T&& s) + { + *this = String(std::forward<T>(s)); + return *this; + } + + /** Assign via std::string initializer list constructor. */ + String& operator=(std::initializer_list<char> il) + { + *this = String(il); + return *this; + } + + /** Return true if the instance is not a null string. */ + explicit operator bool() const noexcept { return data() != nullptr; } + + /** Return a view of the string. */ + string_view view() const noexcept { return view_; } + + /** Return true if the instance is an empty stringn or null string. */ + bool empty() const noexcept { return view_.empty(); } + + /** Return a pointer to the start of the string. */ + const char* data() const noexcept { return view_.data(); } + + /** Return the length of the string in bytes. */ + size_type size() const noexcept { return view_.size(); } + size_type length() const noexcept { return view_.length(); } + + /** Return the character at the given position. + No bounds checking is performed. */ + char operator[](size_type pos) const noexcept { return view_[pos]; } + + /** Return the character at the given position. + If the position is out of bounds, throws std::out_of_range. */ + char at(size_type pos) const { return view_.at(pos); } + + char front() const noexcept { return view_.front(); } + + char back() const noexcept { return view_.back(); } + + /** Return true if this instance is stable and otherwise false. + An instance is stable if it is in the 'null' state or if it is + an 'owned' state not produced by substring operations, or + after a call to 'stabilize()' or 'str()'. */ + bool is_stable() const; + + /** If 'is_stable()' does not return true, mutate so it does. */ + void stabilize(); + + /** Get a pointer to a normal std::string if 'is_stable()' returns + true and otherwise nullptr. The pointer is valid until this + instance is mutated or destroyed. */ + std::string const* str_if_stable() const; + + /** Get a refernce to a normal std::string. The reference + is valid until this instance is mutated or destroyed. */ + std::string const& str(); + + /** Get a pointer to a C-style null-terminated string + containing the same value as this instance. The pointer + is valid until this instance is mutated, destroyed, + or str() is called. */ + const char* c_str(); + + const_iterator begin() const noexcept { return view_.begin(); } + const_iterator end() const noexcept { return view_.end(); } + const_iterator cbegin() const noexcept { return begin(); } + const_iterator cend() const noexcept { return end(); } + + const_reverse_iterator rbegin() const noexcept { return view_.rbegin(); } + const_reverse_iterator rend() const noexcept { return view_.rend(); } + const_reverse_iterator crbegin() const noexcept { return rbegin(); } + const_reverse_iterator crend() const noexcept { return rend(); } + + /** Append to the string using any type that implements the + AsStringView trait. */ + template <typename T> + typename std::enable_if<AsStringView<T>::value, String&>::type operator+=( + T&& s) + { + string_view v = AsStringView<T>::view(std::forward<T>(s)); + std::string r; + r.reserve(size() + v.size()); + r.assign(data(), size()); + r.append(v.data(), v.size()); + return *this = std::move(r); + } + + /** Assign to an empty string. */ + void clear() { *this = ""_s; } + + /** Insert 'count' copies of 'ch' at position 'index'. */ + String& insert(size_type index, size_type count, char ch); + + /** Erase 'count' characters starting at position 'index'. */ + String& erase(size_type index = 0, size_type count = npos); + + void push_back(char ch) + { + std::string s; + s.reserve(size() + 1); + s.assign(data(), size()); + s.push_back(ch); + *this = std::move(s); + } + + void pop_back() { *this = String(*this, 0, size() - 1); } + + template <typename T> + typename std::enable_if<AsStringView<T>::value, String&>::type replace( + size_type pos, size_type count, T&& s) + { + const_iterator first = begin() + pos; + const_iterator last = first + count; + return replace(first, last, std::forward<T>(s)); + } + + template <typename InputIterator> + String& replace(const_iterator first, const_iterator last, + InputIterator first2, InputIterator last2) + { + std::string out; + out.append(view_.begin(), first); + out.append(first2, last2); + out.append(last, view_.end()); + return *this = std::move(out); + } + + template <typename T> + typename std::enable_if<AsStringView<T>::value, String&>::type replace( + const_iterator first, const_iterator last, T&& s) + { + string_view v = AsStringView<T>::view(std::forward<T>(s)); + std::string out; + out.reserve((first - view_.begin()) + v.size() + (view_.end() - last)); + out.append(view_.begin(), first); + out.append(v.data(), v.size()); + out.append(last, view_.end()); + return *this = std::move(out); + } + + template <typename T> + typename std::enable_if<AsStringView<T>::value, String&>::type replace( + size_type pos, size_type count, T&& s, size_type pos2, + size_type count2 = npos) + { + string_view v = AsStringView<T>::view(std::forward<T>(s)); + v = v.substr(pos2, count2); + return replace(pos, count, v); + } + + String& replace(size_type pos, size_type count, size_type count2, char ch) + { + const_iterator first = begin() + pos; + const_iterator last = first + count; + return replace(first, last, count2, ch); + } + + String& replace(const_iterator first, const_iterator last, size_type count2, + char ch) + { + std::string out; + out.reserve((first - view_.begin()) + count2 + (view_.end() - last)); + out.append(view_.begin(), first); + out.append(count2, ch); + out.append(last, view_.end()); + return *this = std::move(out); + } + + size_type copy(char* dest, size_type count, size_type pos = 0) const; + + void resize(size_type count) { resize(count, char()); } + + void resize(size_type count, char ch) + { + std::string s; + s.reserve(count); + if (count <= size()) { + s.assign(data(), count); + } else { + s.assign(data(), size()); + s.resize(count, ch); + } + *this = std::move(s); + } + + void swap(String& other) + { + std::swap(string_, other.string_); + std::swap(view_, other.view_); + } + + /** Return a substring starting at position 'pos' and + consisting of at most 'count' characters. */ + String substr(size_type pos = 0, size_type count = npos) const; + + template <typename T> + typename std::enable_if<AsStringView<T>::value, int>::type compare( + T&& s) const + { + return view_.compare(AsStringView<T>::view(std::forward<T>(s))); + } + + int compare(size_type pos1, size_type count1, string_view v) const + { + return view_.compare(pos1, count1, v); + } + + int compare(size_type pos1, size_type count1, string_view v, size_type pos2, + size_type count2) const + { + return view_.compare(pos1, count1, v, pos2, count2); + } + + int compare(size_type pos1, size_type count1, const char* s) const + { + return view_.compare(pos1, count1, s); + } + + int compare(size_type pos1, size_type count1, const char* s, + size_type count2) const + { + return view_.compare(pos1, count1, s, count2); + } + + template <typename T> + typename std::enable_if<AsStringView<T>::value, size_type>::type find( + T&& s, size_type pos = 0) const + { + string_view v = AsStringView<T>::view(std::forward<T>(s)); + return view_.find(v, pos); + } + + size_type find(const char* s, size_type pos, size_type count) const + { + return view_.find(s, pos, count); + } + + template <typename T> + typename std::enable_if<AsStringView<T>::value, size_type>::type rfind( + T&& s, size_type pos = npos) const + { + string_view v = AsStringView<T>::view(std::forward<T>(s)); + return view_.rfind(v, pos); + } + + size_type rfind(const char* s, size_type pos, size_type count) const + { + return view_.rfind(s, pos, count); + } + + template <typename T> + typename std::enable_if<AsStringView<T>::value, size_type>::type + find_first_of(T&& s, size_type pos = 0) const + { + string_view v = AsStringView<T>::view(std::forward<T>(s)); + return view_.find_first_of(v, pos); + } + + size_type find_first_of(const char* s, size_type pos, size_type count) const + { + return view_.find_first_of(s, pos, count); + } + + template <typename T> + typename std::enable_if<AsStringView<T>::value, size_type>::type + find_first_not_of(T&& s, size_type pos = 0) const + { + string_view v = AsStringView<T>::view(std::forward<T>(s)); + return view_.find_first_not_of(v, pos); + } + + size_type find_first_not_of(const char* s, size_type pos, + size_type count) const + { + return view_.find_first_not_of(s, pos, count); + } + + template <typename T> + typename std::enable_if<AsStringView<T>::value, size_type>::type + find_last_of(T&& s, size_type pos = npos) const + { + string_view v = AsStringView<T>::view(std::forward<T>(s)); + return view_.find_last_of(v, pos); + } + + size_type find_last_of(const char* s, size_type pos, size_type count) const + { + return view_.find_last_of(s, pos, count); + } + + template <typename T> + typename std::enable_if<AsStringView<T>::value, size_type>::type + find_last_not_of(T&& s, size_type pos = npos) const + { + string_view v = AsStringView<T>::view(std::forward<T>(s)); + return view_.find_last_not_of(v, pos); + } + + size_type find_last_not_of(const char* s, size_type pos, + size_type count) const + { + return view_.find_last_not_of(s, pos, count); + } + +private: + // Internal constructor to move from existing String. + String(String&& s, Private) noexcept + : String(std::move(s)) + { + } + + // Internal constructor for dynamically allocated string. + String(std::string&& s, Private); + + // Internal constructor for view of statically allocated string. + String(string_view v, Private) + : view_(v) + { + } + + void internally_mutate_to_stable_string(); + + std::shared_ptr<std::string const> string_; + string_view view_; +}; + +template <typename L, typename R> +typename std::enable_if<AsStringView<L>::value && AsStringView<R>::value, + bool>::type +operator==(L&& l, R&& r) +{ + return (AsStringView<L>::view(std::forward<L>(l)) == + AsStringView<R>::view(std::forward<R>(r))); +} + +template <typename L, typename R> +typename std::enable_if<AsStringView<L>::value && AsStringView<R>::value, + bool>::type +operator!=(L&& l, R&& r) +{ + return (AsStringView<L>::view(std::forward<L>(l)) != + AsStringView<R>::view(std::forward<R>(r))); +} + +template <typename L, typename R> +typename std::enable_if<AsStringView<L>::value && AsStringView<R>::value, + bool>::type +operator<(L&& l, R&& r) +{ + return (AsStringView<L>::view(std::forward<L>(l)) < + AsStringView<R>::view(std::forward<R>(r))); +} + +template <typename L, typename R> +typename std::enable_if<AsStringView<L>::value && AsStringView<R>::value, + bool>::type +operator<=(L&& l, R&& r) +{ + return (AsStringView<L>::view(std::forward<L>(l)) <= + AsStringView<R>::view(std::forward<R>(r))); +} + +template <typename L, typename R> +typename std::enable_if<AsStringView<L>::value && AsStringView<R>::value, + bool>::type +operator>(L&& l, R&& r) +{ + return (AsStringView<L>::view(std::forward<L>(l)) > + AsStringView<R>::view(std::forward<R>(r))); +} + +template <typename L, typename R> +typename std::enable_if<AsStringView<L>::value && AsStringView<R>::value, + bool>::type +operator>=(L&& l, R&& r) +{ + return (AsStringView<L>::view(std::forward<L>(l)) >= + AsStringView<R>::view(std::forward<R>(r))); +} + +std::ostream& operator<<(std::ostream& os, String const& s); +std::string& operator+=(std::string& self, String const& s); + +template <typename L, typename R> +struct StringOpPlus +{ + L l; + R r; +#if defined(__SUNPRO_CC) + StringOpPlus(L in_l, R in_r) + : l(in_l) + , r(in_r) + { + } +#endif + operator std::string() const; + std::string::size_type size() const { return l.size() + r.size(); } +}; + +template <typename T> +struct StringAdd +{ + static const bool value = AsStringView<T>::value; + typedef string_view temp_type; + template <typename S> + static temp_type temp(S&& s) + { + return AsStringView<T>::view(std::forward<S>(s)); + } +}; + +template <typename L, typename R> +struct StringAdd<StringOpPlus<L, R>> : std::true_type +{ + typedef StringOpPlus<L, R> const& temp_type; + static temp_type temp(temp_type s) { return s; } +}; + +template <typename L, typename R> +StringOpPlus<L, R>::operator std::string() const +{ + std::string s; + s.reserve(size()); + s += *this; + return s; +} + +template <typename L, typename R> +std::string& operator+=(std::string& s, StringOpPlus<L, R> const& a) +{ + s.reserve(s.size() + a.size()); + s += a.l; + s += a.r; + return s; +} + +template <typename L, typename R> +String& operator+=(String& s, StringOpPlus<L, R> const& a) +{ + std::string r; + r.reserve(s.size() + a.size()); + r.assign(s.data(), s.size()); + r += a.l; + r += a.r; + s = std::move(r); + return s; +} + +template <typename L, typename R> +std::ostream& operator<<(std::ostream& os, StringOpPlus<L, R> const& a) +{ + return os << a.l << a.r; +} + +template <typename L, typename R> +struct IntoString<StringOpPlus<L, R>> : std::true_type +{ + static std::string into_string(StringOpPlus<L, R> const& a) { return a; } +}; + +template <typename L, typename R> +typename std::enable_if<StringAdd<L>::value && StringAdd<R>::value, + StringOpPlus<typename StringAdd<L>::temp_type, + typename StringAdd<R>::temp_type>>::type +operator+(L&& l, R&& r) +{ + return { StringAdd<L>::temp(std::forward<L>(l)), + StringAdd<R>::temp(std::forward<R>(r)) }; +} + +template <typename LL, typename LR, typename R> +typename std::enable_if<AsStringView<R>::value, bool>::type operator==( + StringOpPlus<LL, LR> const& l, R&& r) +{ + return std::string(l) == AsStringView<R>::view(std::forward<R>(r)); +} + +template <typename L, typename RL, typename RR> +typename std::enable_if<AsStringView<L>::value, bool>::type operator==( + L&& l, StringOpPlus<RL, RR> const& r) +{ + return AsStringView<L>::view(std::forward<L>(l)) == std::string(r); +} + +} // namespace cm + +namespace std { + +template <> +struct hash<cm::String> +{ + typedef cm::String argument_type; + typedef size_t result_type; + + result_type operator()(argument_type const& s) const noexcept + { + result_type const h(std::hash<cm::string_view>{}(s.view())); + return h; + } +}; +} + +#endif diff --git a/Source/cmStringReplaceHelper.h b/Source/cmStringReplaceHelper.h index 938325a..3e76d86 100644 --- a/Source/cmStringReplaceHelper.h +++ b/Source/cmStringReplaceHelper.h @@ -46,7 +46,6 @@ private: } RegexReplacement(int n) : Number(n) - , Value() { } RegexReplacement() {} diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 9866d13..be65853 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -49,6 +49,7 @@ #include <string.h> #include <time.h> #include <utility> +#include <vector> #if defined(_WIN32) # include <windows.h> @@ -137,7 +138,10 @@ public: CloseHandle(this->handle_); } } - operator bool() const { return this->handle_ != INVALID_HANDLE_VALUE; } + explicit operator bool() const + { + return this->handle_ != INVALID_HANDLE_VALUE; + } bool operator!() const { return this->handle_ == INVALID_HANDLE_VALUE; } operator HANDLE() const { return this->handle_; } @@ -1460,6 +1464,80 @@ std::string cmSystemTools::RelativePath(std::string const& local, return cmsys::SystemTools::RelativePath(local, remote); } +std::string cmSystemTools::ForceToRelativePath(std::string const& local_path, + std::string const& remote_path) +{ + // The paths should never be quoted. + assert(local_path.front() != '\"'); + assert(remote_path.front() != '\"'); + + // The local path should never have a trailing slash. + assert(local_path.empty() || local_path.back() != '/'); + + // If the path is already relative then just return the path. + if (!cmSystemTools::FileIsFullPath(remote_path)) { + return remote_path; + } + + // Identify the longest shared path component between the remote + // path and the local path. + std::vector<std::string> local; + cmSystemTools::SplitPath(local_path, local); + std::vector<std::string> remote; + cmSystemTools::SplitPath(remote_path, remote); + unsigned int common = 0; + while (common < remote.size() && common < local.size() && + cmSystemTools::ComparePath(remote[common], local[common])) { + ++common; + } + + // If no part of the path is in common then return the full path. + if (common == 0) { + return remote_path; + } + + // If the entire path is in common then just return a ".". + if (common == remote.size() && common == local.size()) { + return "."; + } + + // If the entire path is in common except for a trailing slash then + // just return a "./". + if (common + 1 == remote.size() && remote[common].empty() && + common == local.size()) { + return "./"; + } + + // Construct the relative path. + std::string relative; + + // First add enough ../ to get up to the level of the shared portion + // of the path. Leave off the trailing slash. Note that the last + // component of local will never be empty because local should never + // have a trailing slash. + for (unsigned int i = common; i < local.size(); ++i) { + relative += ".."; + if (i < local.size() - 1) { + relative += "/"; + } + } + + // Now add the portion of the destination path that is not included + // in the shared portion of the path. Add a slash the first time + // only if there was already something in the path. If there was a + // trailing slash in the input then the last iteration of the loop + // will add a slash followed by an empty string which will preserve + // the trailing slash in the output. + + if (!relative.empty() && !remote.empty()) { + relative += "/"; + } + relative += cmJoin(cmMakeRange(remote).advance(common), "/"); + + // Finally return the path. + return relative; +} + std::string cmSystemTools::CollapseCombinedPath(std::string const& dir, std::string const& file) { @@ -3006,6 +3084,35 @@ bool cmSystemTools::StringToULong(const char* str, unsigned long* value) return (*endp == '\0') && (endp != str) && (errno == 0); } +std::string cmSystemTools::EncodeURL(std::string const& in, bool escapeSlashes) +{ + std::string out; + for (char c : in) { + char hexCh[4] = { 0, 0, 0, 0 }; + hexCh[0] = c; + switch (c) { + case '+': + case '?': + case '\\': + case '&': + case ' ': + case '=': + case '%': + sprintf(hexCh, "%%%02X", static_cast<int>(c)); + break; + case '/': + if (escapeSlashes) { + strcpy(hexCh, "%2F"); + } + break; + default: + break; + } + out.append(hexCh); + } + return out; +} + bool cmSystemTools::CreateSymlink(const std::string& origName, const std::string& newName) { diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h index 98300eb..c0999e7 100644 --- a/Source/cmSystemTools.h +++ b/Source/cmSystemTools.h @@ -375,6 +375,14 @@ public: static std::string RelativePath(std::string const& local, std::string const& remote); + /** + * Convert the given remote path to a relative path with respect to + * the given local path. Both paths must use forward slashes and not + * already be escaped or quoted. + */ + static std::string ForceToRelativePath(std::string const& local_path, + std::string const& remote_path); + /** Joins two paths while collapsing x/../ parts * For example CollapseCombinedPath("a/b/c", "../../d") results in "a/d" */ @@ -495,6 +503,10 @@ public: static bool StringToLong(const char* str, long* value); static bool StringToULong(const char* str, unsigned long* value); + /** Encode a string as a URL. */ + static std::string EncodeURL(std::string const& in, + bool escapeSlashes = true); + #ifdef _WIN32 struct WindowsFileRetry { diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 92d5505..688f73b 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -6,7 +6,6 @@ #include <algorithm> #include <assert.h> #include <iterator> -#include <map> #include <set> #include <sstream> #include <string.h> diff --git a/Source/cmTarget.h b/Source/cmTarget.h index aa2859d..655cefd 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -6,7 +6,6 @@ #include "cmConfigure.h" // IWYU pragma: keep #include <iosfwd> -#include <map> #include <set> #include <string> #include <unordered_map> @@ -344,11 +343,4 @@ private: typedef std::unordered_map<std::string, cmTarget> cmTargets; -class cmTargetSet : public std::set<std::string> -{ -}; -class cmTargetManifest : public std::map<std::string, cmTargetSet> -{ -}; - #endif diff --git a/Source/cmTargetLinkLibrariesCommand.cxx b/Source/cmTargetLinkLibrariesCommand.cxx index ad33f98..eebf7a0 100644 --- a/Source/cmTargetLinkLibrariesCommand.cxx +++ b/Source/cmTargetLinkLibrariesCommand.cxx @@ -256,7 +256,7 @@ bool cmTargetLinkLibrariesCommand::InitialPass( // Make sure the last argument was not a library type specifier. if (haveLLT) { std::ostringstream e; - e << "The \"" << this->LinkLibraryTypeNames[llt] + e << "The \"" << cmTargetLinkLibrariesCommand::LinkLibraryTypeNames[llt] << "\" argument must be followed by a library."; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); cmSystemTools::SetFatalErrorOccured(); @@ -284,8 +284,10 @@ void cmTargetLinkLibrariesCommand::LinkLibraryTypeSpecifierWarning(int left, int right) { std::ostringstream w; - w << "Link library type specifier \"" << this->LinkLibraryTypeNames[left] - << "\" is followed by specifier \"" << this->LinkLibraryTypeNames[right] + w << "Link library type specifier \"" + << cmTargetLinkLibrariesCommand::LinkLibraryTypeNames[left] + << "\" is followed by specifier \"" + << cmTargetLinkLibrariesCommand::LinkLibraryTypeNames[right] << "\" instead of a library name. " << "The first specifier will be ignored."; this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, w.str()); @@ -449,7 +451,8 @@ bool cmTargetLinkLibrariesCommand::HandleLibrary(const std::string& lib, // STATIC library.) if (this->CurrentProcessingState == ProcessingKeywordPrivateInterface || this->CurrentProcessingState == ProcessingPlainPrivateInterface) { - if (this->Target->GetType() == cmStateEnums::STATIC_LIBRARY) { + if (this->Target->GetType() == cmStateEnums::STATIC_LIBRARY || + this->Target->GetType() == cmStateEnums::OBJECT_LIBRARY) { std::string configLib = this->Target->GetDebugGeneratorExpressions(libRef, llt); if (cmGeneratorExpression::IsValidTargetName(libRef) || diff --git a/Source/cmTimestamp.h b/Source/cmTimestamp.h index 8dd499a..2f75acb 100644 --- a/Source/cmTimestamp.h +++ b/Source/cmTimestamp.h @@ -23,12 +23,12 @@ public: const std::string& formatString, bool utcFlag); -private: - time_t CreateUtcTimeTFromTm(struct tm& timeStruct) const; - std::string CreateTimestampFromTimeT(time_t timeT, std::string formatString, bool utcFlag) const; +private: + time_t CreateUtcTimeTFromTm(struct tm& timeStruct) const; + std::string AddTimestampComponent(char flag, struct tm& timeStruct, time_t timeT) const; }; diff --git a/Source/cmTryRunCommand.cxx b/Source/cmTryRunCommand.cxx index 9396138..fafbd24 100644 --- a/Source/cmTryRunCommand.cxx +++ b/Source/cmTryRunCommand.cxx @@ -45,7 +45,8 @@ bool cmTryRunCommand::InitialPass(std::vector<std::string> const& argv, if (argv[i] == "ARGS") { ++i; while (i < argv.size() && argv[i] != "COMPILE_DEFINITIONS" && - argv[i] != "CMAKE_FLAGS" && argv[i] != "LINK_LIBRARIES") { + argv[i] != "CMAKE_FLAGS" && argv[i] != "LINK_OPTIONS" && + argv[i] != "LINK_LIBRARIES") { runArgs += " "; runArgs += argv[i]; ++i; diff --git a/Source/cmUVHandlePtr.h b/Source/cmUVHandlePtr.h index 2937e0d..73ee334 100644 --- a/Source/cmUVHandlePtr.h +++ b/Source/cmUVHandlePtr.h @@ -3,7 +3,6 @@ #pragma once #include "cmConfigure.h" // IWYU pragma: keep -#include <algorithm> #include <cstddef> #include <cstdint> #include <memory> @@ -11,12 +10,22 @@ #include "cm_uv.h" -#define CM_PERFECT_FWD_CTOR(Class, FwdTo) \ - template <typename... Args> \ - Class(Args&&... args) \ - : FwdTo(std::forward<Args>(args)...) \ - { \ - } +#if defined(__SUNPRO_CC) + +# include <utility> + +# define CM_INHERIT_CTOR(Class, Base, Tpl) \ + template <typename... Args> \ + Class(Args&&... args) \ + : Base Tpl(std::forward<Args>(args)...) \ + { \ + } + +#else + +# define CM_INHERIT_CTOR(Class, Base, Tpl) using Base Tpl ::Base; + +#endif namespace cm { @@ -116,7 +125,7 @@ class uv_handle_ptr_ : public uv_handle_ptr_base_<T> friend class uv_handle_ptr_; public: - CM_PERFECT_FWD_CTOR(uv_handle_ptr_, uv_handle_ptr_base_<T>); + CM_INHERIT_CTOR(uv_handle_ptr_, uv_handle_ptr_base_, <T>); /*** * Allow less verbose calling of uv_<T> functions @@ -133,13 +142,13 @@ template <> class uv_handle_ptr_<uv_handle_t> : public uv_handle_ptr_base_<uv_handle_t> { public: - CM_PERFECT_FWD_CTOR(uv_handle_ptr_, uv_handle_ptr_base_<uv_handle_t>); + CM_INHERIT_CTOR(uv_handle_ptr_, uv_handle_ptr_base_, <uv_handle_t>); }; class uv_async_ptr : public uv_handle_ptr_<uv_async_t> { public: - CM_PERFECT_FWD_CTOR(uv_async_ptr, uv_handle_ptr_<uv_async_t>); + CM_INHERIT_CTOR(uv_async_ptr, uv_handle_ptr_, <uv_async_t>); int init(uv_loop_t& loop, uv_async_cb async_cb, void* data = nullptr); @@ -148,7 +157,7 @@ public: struct uv_signal_ptr : public uv_handle_ptr_<uv_signal_t> { - CM_PERFECT_FWD_CTOR(uv_signal_ptr, uv_handle_ptr_<uv_signal_t>); + CM_INHERIT_CTOR(uv_signal_ptr, uv_handle_ptr_, <uv_signal_t>); int init(uv_loop_t& loop, void* data = nullptr); @@ -159,7 +168,7 @@ struct uv_signal_ptr : public uv_handle_ptr_<uv_signal_t> struct uv_pipe_ptr : public uv_handle_ptr_<uv_pipe_t> { - CM_PERFECT_FWD_CTOR(uv_pipe_ptr, uv_handle_ptr_<uv_pipe_t>); + CM_INHERIT_CTOR(uv_pipe_ptr, uv_handle_ptr_, <uv_pipe_t>); operator uv_stream_t*() const; @@ -168,7 +177,7 @@ struct uv_pipe_ptr : public uv_handle_ptr_<uv_pipe_t> struct uv_process_ptr : public uv_handle_ptr_<uv_process_t> { - CM_PERFECT_FWD_CTOR(uv_process_ptr, uv_handle_ptr_<uv_process_t>); + CM_INHERIT_CTOR(uv_process_ptr, uv_handle_ptr_, <uv_process_t>); int spawn(uv_loop_t& loop, uv_process_options_t const& options, void* data = nullptr); @@ -176,7 +185,7 @@ struct uv_process_ptr : public uv_handle_ptr_<uv_process_t> struct uv_timer_ptr : public uv_handle_ptr_<uv_timer_t> { - CM_PERFECT_FWD_CTOR(uv_timer_ptr, uv_handle_ptr_<uv_timer_t>); + CM_INHERIT_CTOR(uv_timer_ptr, uv_handle_ptr_, <uv_timer_t>); int init(uv_loop_t& loop, void* data = nullptr); @@ -185,7 +194,7 @@ struct uv_timer_ptr : public uv_handle_ptr_<uv_timer_t> struct uv_tty_ptr : public uv_handle_ptr_<uv_tty_t> { - CM_PERFECT_FWD_CTOR(uv_tty_ptr, uv_handle_ptr_<uv_tty_t>); + CM_INHERIT_CTOR(uv_tty_ptr, uv_handle_ptr_, <uv_tty_t>); operator uv_stream_t*() const; diff --git a/Source/cmVS10CLFlagTable.h b/Source/cmVS10CLFlagTable.h deleted file mode 100644 index df4d58c..0000000 --- a/Source/cmVS10CLFlagTable.h +++ /dev/null @@ -1,205 +0,0 @@ -static cmVS7FlagTable cmVS10CLFlagTable[] = { - - // Enum Properties - { "DebugInformationFormat", "Z7", "C7 compatible", "OldStyle", 0 }, - { "DebugInformationFormat", "Zi", "Program Database", "ProgramDatabase", 0 }, - { "DebugInformationFormat", "ZI", "Program Database for Edit And Continue", - "EditAndContinue", 0 }, - - { "WarningLevel", "W0", "Turn Off All Warnings", "TurnOffAllWarnings", 0 }, - { "WarningLevel", "W1", "Level1", "Level1", 0 }, - { "WarningLevel", "W2", "Level2", "Level2", 0 }, - { "WarningLevel", "W3", "Level3", "Level3", 0 }, - { "WarningLevel", "W4", "Level4", "Level4", 0 }, - { "WarningLevel", "Wall", "EnableAllWarnings", "EnableAllWarnings", 0 }, - - { "Optimization", "Od", "Disabled", "Disabled", 0 }, - { "Optimization", "O1", "Minimize Size", "MinSpace", 0 }, - { "Optimization", "O2", "Maximize Speed", "MaxSpeed", 0 }, - { "Optimization", "Ox", "Full Optimization", "Full", 0 }, - - { "InlineFunctionExpansion", "", "Default", "Default", 0 }, - { "InlineFunctionExpansion", "Ob0", "Disabled", "Disabled", 0 }, - { "InlineFunctionExpansion", "Ob1", "Only __inline", "OnlyExplicitInline", - 0 }, - { "InlineFunctionExpansion", "Ob2", "Any Suitable", "AnySuitable", 0 }, - - { "FavorSizeOrSpeed", "Os", "Favor small code", "Size", 0 }, - { "FavorSizeOrSpeed", "Ot", "Favor fast code", "Speed", 0 }, - { "FavorSizeOrSpeed", "", "Neither", "Neither", 0 }, - - { "ExceptionHandling", "EHa", "Yes with SEH Exceptions", "Async", 0 }, - { "ExceptionHandling", "EHsc", "Yes", "Sync", 0 }, - { "ExceptionHandling", "EHs", "Yes with Extern C functions", "SyncCThrow", - 0 }, - { "ExceptionHandling", "", "No", "false", 0 }, - - { "BasicRuntimeChecks", "RTCs", "Stack Frames", "StackFrameRuntimeCheck", - 0 }, - { "BasicRuntimeChecks", "RTCu", "Uninitialized variables", - "UninitializedLocalUsageCheck", 0 }, - { "BasicRuntimeChecks", "RTC1", "Both (/RTC1, equiv. to /RTCsu)", - "EnableFastChecks", 0 }, - { "BasicRuntimeChecks", "", "Default", "Default", 0 }, - - { "RuntimeLibrary", "MT", "Multi-threaded", "MultiThreaded", 0 }, - { "RuntimeLibrary", "MTd", "Multi-threaded Debug", "MultiThreadedDebug", 0 }, - { "RuntimeLibrary", "MD", "Multi-threaded DLL", "MultiThreadedDLL", 0 }, - { "RuntimeLibrary", "MDd", "Multi-threaded Debug DLL", - "MultiThreadedDebugDLL", 0 }, - - { "StructMemberAlignment", "Zp1", "1 Byte", "1Byte", 0 }, - { "StructMemberAlignment", "Zp2", "2 Bytes", "2Bytes", 0 }, - { "StructMemberAlignment", "Zp4", "4 Byte", "4Bytes", 0 }, - { "StructMemberAlignment", "Zp8", "8 Bytes", "8Bytes", 0 }, - { "StructMemberAlignment", "Zp16", "16 Bytes", "16Bytes", 0 }, - { "StructMemberAlignment", "", "Default", "Default", 0 }, - - { "EnableEnhancedInstructionSet", "arch:SSE", - "Streaming SIMD Extensions (/arch:SSE)", "StreamingSIMDExtensions", 0 }, - { "EnableEnhancedInstructionSet", "arch:SSE2", - "Streaming SIMD Extensions 2 (/arch:SSE2)", "StreamingSIMDExtensions2", - 0 }, - { "EnableEnhancedInstructionSet", "", "Not Set", "NotSet", 0 }, - - { "FloatingPointModel", "fp:precise", "Precise", "Precise", 0 }, - { "FloatingPointModel", "fp:strict", "Strict", "Strict", 0 }, - { "FloatingPointModel", "fp:fast", "Fast", "Fast", 0 }, - - { "PrecompiledHeader", "Yc", "Create", "Create", - cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue }, - { "PrecompiledHeader", "Yu", "Use", "Use", - cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue }, - { "PrecompiledHeader", "Y-", "Not Using Precompiled Headers", "NotUsing", - 0 }, - - { "AssemblerOutput", "", "No Listing", "NoListing", 0 }, - { "AssemblerOutput", "FA", "Assembly-Only Listing", "AssemblyCode", 0 }, - { "AssemblerOutput", "FAc", "Assembly With Machine Code", - "AssemblyAndMachineCode", 0 }, - { "AssemblerOutput", "FAs", "Assembly With Source Code", - "AssemblyAndSourceCode", 0 }, - { "AssemblerOutput", "FAcs", "Assembly, Machine Code and Source", "All", 0 }, - - { "CallingConvention", "Gd", "__cdecl", "Cdecl", 0 }, - { "CallingConvention", "Gr", "__fastcall", "FastCall", 0 }, - { "CallingConvention", "Gz", "__stdcall", "StdCall", 0 }, - - { "CompileAs", "", "Default", "Default", 0 }, - { "CompileAs", "TC", "Compile as C Code", "CompileAsC", 0 }, - { "CompileAs", "TP", "Compile as C++ Code", "CompileAsCpp", 0 }, - - { "ErrorReporting", "errorReport:none", "Do Not Send Report", "None", 0 }, - { "ErrorReporting", "errorReport:prompt", "Prompt Immediately", "Prompt", - 0 }, - { "ErrorReporting", "errorReport:queue", "Queue For Next Login", "Queue", - 0 }, - { "ErrorReporting", "errorReport:send", "Send Automatically", "Send", 0 }, - - { "CompileAsManaged", "", "No Common Language RunTime Support", "false", 0 }, - { "CompileAsManaged", "clr", "Common Language RunTime Support", "true", 0 }, - { "CompileAsManaged", "clr:pure", - "Pure MSIL Common Language RunTime Support", "Pure", 0 }, - { "CompileAsManaged", "clr:safe", - "Safe MSIL Common Language RunTime Support", "Safe", 0 }, - { "CompileAsManaged", "clr:oldSyntax", - "Common Language RunTime Support, Old Syntax", "OldSyntax", 0 }, - - // Bool Properties - { "SuppressStartupBanner", "nologo-", "", "false", 0 }, - { "SuppressStartupBanner", "nologo", "", "true", 0 }, - { "TreatWarningAsError", "WX-", "", "false", 0 }, - { "TreatWarningAsError", "WX", "", "true", 0 }, - { "IntrinsicFunctions", "Oi", "", "true", 0 }, - { "OmitFramePointers", "Oy-", "", "false", 0 }, - { "OmitFramePointers", "Oy", "", "true", 0 }, - { "EnableFiberSafeOptimizations", "GT", "", "true", 0 }, - { "WholeProgramOptimization", "GL", "", "true", 0 }, - { "UndefineAllPreprocessorDefinitions", "u", "", "true", 0 }, - { "IgnoreStandardIncludePath", "X", "", "true", 0 }, - { "PreprocessToFile", "P", "", "true", 0 }, - { "PreprocessSuppressLineNumbers", "EP", "", "true", 0 }, - { "PreprocessKeepComments", "C", "", "true", 0 }, - { "StringPooling", "GF-", "", "false", 0 }, - { "StringPooling", "GF", "", "true", 0 }, - { "MinimalRebuild", "Gm-", "", "false", 0 }, - { "MinimalRebuild", "Gm", "", "true", 0 }, - { "SmallerTypeCheck", "RTCc", "", "true", 0 }, - { "BufferSecurityCheck", "GS-", "", "false", 0 }, - { "BufferSecurityCheck", "GS", "", "true", 0 }, - { "FunctionLevelLinking", "Gy-", "", "false", 0 }, - { "FunctionLevelLinking", "Gy", "", "true", 0 }, - { "FloatingPointExceptions", "fp:except-", "", "false", 0 }, - { "FloatingPointExceptions", "fp:except", "", "true", 0 }, - { "CreateHotpatchableImage", "hotpatch", "", "true", 0 }, - { "DisableLanguageExtensions", "Za", "", "true", 0 }, - { "TreatWChar_tAsBuiltInType", "Zc:wchar_t-", "", "false", 0 }, - { "TreatWChar_tAsBuiltInType", "Zc:wchar_t", "", "true", 0 }, - { "ForceConformanceInForLoopScope", "Zc:forScope-", "", "false", 0 }, - { "ForceConformanceInForLoopScope", "Zc:forScope", "", "true", 0 }, - { "RuntimeTypeInfo", "GR-", "", "false", 0 }, - { "RuntimeTypeInfo", "GR", "", "true", 0 }, - { "OpenMPSupport", "openmp-", "", "false", 0 }, - { "OpenMPSupport", "openmp", "", "true", 0 }, - { "ExpandAttributedSource", "Fx", "", "true", 0 }, - { "ShowIncludes", "showIncludes", "", "true", 0 }, - { "EnablePREfast", "analyze-", "", "false", 0 }, - { "EnablePREfast", "analyze", "", "true", 0 }, - { "UseFullPaths", "FC", "", "true", 0 }, - { "OmitDefaultLibName", "Zl", "", "true", 0 }, - { "UseUnicodeForAssemblerListing", "FAu", "", "true", 0 }, - - // Bool Properties With Argument - { "MultiProcessorCompilation", "MP", "", "true", - cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue }, - { "ProcessorNumber", "MP", "Multi-processor Compilation", "", - cmVS7FlagTable::UserValueRequired }, - { "GenerateXMLDocumentationFiles", "doc", "", "true", - cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue }, - { "XMLDocumentationFileName", "doc", "Generate XML Documentation Files", "", - cmVS7FlagTable::UserValueRequired }, - { "BrowseInformation", "FR", "", "true", - cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue }, - { "BrowseInformationFile", "FR", "Enable Browse Information", "", - cmVS7FlagTable::UserValueRequired }, - - // String List Properties - { "AdditionalIncludeDirectories", "I", "Additional Include Directories", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "AdditionalUsingDirectories", "AI", "Resolve #using References", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "PreprocessorDefinitions", "D ", "Preprocessor Definitions", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "UndefinePreprocessorDefinitions", "U", - "Undefine Preprocessor Definitions", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "DisableSpecificWarnings", "wd", "Disable Specific Warnings", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "ForcedIncludeFiles", "FI", "Forced Include File", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "ForcedUsingFiles", "FU", "Forced #using File", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "TreatSpecificWarningsAsErrors", "we", "Treat Specific Warnings As Errors", - "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - - // String Properties - // Skip [TrackerLogDirectory] - no command line Switch. - { "PreprocessOutputPath", "Fi", "Preprocess Output Path", "", - cmVS7FlagTable::UserValue }, - { "PrecompiledHeaderFile", "Yc", "Precompiled Header Name", "", - cmVS7FlagTable::UserValueRequired }, - { "PrecompiledHeaderFile", "Yu", "Precompiled Header Name", "", - cmVS7FlagTable::UserValueRequired }, - { "PrecompiledHeaderOutputFile", "Fp", "Precompiled Header Output File", "", - cmVS7FlagTable::UserValue }, - { "AssemblerListingLocation", "Fa", "ASM List Location", "", - cmVS7FlagTable::UserValue }, - { "ObjectFileName", "Fo", "Object File Name", "", - cmVS7FlagTable::UserValue }, - { "ProgramDataBaseFileName", "Fd", "Program Database File Name", "", - cmVS7FlagTable::UserValue }, - // Skip [XMLDocumentationFileName] - no command line Switch. - // Skip [BrowseInformationFile] - no command line Switch. - // Skip [AdditionalOptions] - no command line Switch. - { 0, 0, 0, 0, 0 } -}; diff --git a/Source/cmVS10CSharpFlagTable.h b/Source/cmVS10CSharpFlagTable.h deleted file mode 100644 index 6ac7a76..0000000 --- a/Source/cmVS10CSharpFlagTable.h +++ /dev/null @@ -1,121 +0,0 @@ -static cmVS7FlagTable cmVS10CSharpFlagTable[] = { - { "ProjectName", "out:", "", "", cmIDEFlagTable::UserValueRequired }, - - { "OutputType", "target:exe", "", "Exe", 0 }, - { "OutputType", "target:winexe", "", "Winexe", 0 }, - { "OutputType", "target:library", "", "Library", 0 }, - { "OutputType", "target:module", "", "Module", 0 }, - - { "DocumentationFile", "doc", "", "", cmIDEFlagTable::UserValueRequired }, - - { "Platform", "platform:x86", "", "x86", 0 }, - { "Platform", "platform:Itanium", "", "Itanium", 0 }, - { "Platform", "platform:x64", "", "x64", 0 }, - { "Platform", "platform:arm", "", "arm", 0 }, - { "Platform", "platform:anycpu32bitpreferred", "", "anycpu32bitpreferred", - 0 }, - { "Platform", "platform:anycpu", "", "anycpu", 0 }, - - { "References", "reference:", "mit alias", "", 0 }, - { "References", "reference:", "dateiliste", "", 0 }, - { "AddModules", "addmodule:", "", "", cmIDEFlagTable::SemicolonAppendable }, - { "", "link", "", "", 0 }, - - { "Win32Resource", "win32res:", "", "", cmIDEFlagTable::UserValueRequired }, - { "ApplicationIcon", "win32icon:", "", "", - cmIDEFlagTable::UserValueRequired }, - - { "ApplicationManifest", "win32manifest:", "", "", - cmIDEFlagTable::UserValueRequired }, - - { "NoWin32Manifest", "nowin32manifest", "", "true", 0 }, - - { "DefineDebug", "debug", "", "true", cmIDEFlagTable::Continue }, - - { "DebugSymbols", "debug", "", "true", 0 }, - { "DebugSymbols", "debug-", "", "false", 0 }, - { "DebugSymbols", "debug+", "", "true", 0 }, - - { "DebugType", "debug:none", "", "none", 0 }, - { "DebugType", "debug:full", "", "full", 0 }, - { "DebugType", "debug:pdbonly", "", "pdbonly", 0 }, - - { "Optimize", "optimize", "", "true", 0 }, - { "Optimize", "optimize-", "", "false", 0 }, - { "Optimize", "optimize+", "", "true", 0 }, - - { "TreatWarningsAsErrors", "warnaserror", "", "true", 0 }, - { "TreatWarningsAsErrors", "warnaserror-", "", "false", 0 }, - { "TreatWarningsAsErrors", "warnaserror+", "", "true", 0 }, - - { "WarningsAsErrors", "warnaserror", "", "", 0 }, - { "WarningsAsErrors", "warnaserror-", "", "", 0 }, - { "WarningsAsErrors", "warnaserror+", "", "", 0 }, - - { "WarningLevel", "warn:0", "", "0", 0 }, - { "WarningLevel", "warn:1", "", "1", 0 }, - { "WarningLevel", "warn:2", "", "2", 0 }, - { "WarningLevel", "warn:3", "", "3", 0 }, - { "WarningLevel", "warn:4", "", "4", 0 }, - { "DisabledWarnings", "nowarn", "", "", 0 }, - - { "CheckForOverflowUnderflow", "checked", "", "true", 0 }, - { "CheckForOverflowUnderflow", "checked-", "", "false", 0 }, - { "CheckForOverflowUnderflow", "checked+", "", "true", 0 }, - - { "AllowUnsafeBlocks", "unsafe", "", "true", 0 }, - { "AllowUnsafeBlocks", "unsafe-", "", "false", 0 }, - { "AllowUnsafeBlocks", "unsafe+", "", "true", 0 }, - - { "DefineConstants", "define:", "", "", - cmIDEFlagTable::SemicolonAppendable | cmIDEFlagTable::UserValue }, - - { "LangVersion", "langversion:ISO-1", "", "ISO-1", 0 }, - { "LangVersion", "langversion:ISO-2", "", "ISO-2", 0 }, - { "LangVersion", "langversion:3", "", "3", 0 }, - { "LangVersion", "langversion:4", "", "4", 0 }, - { "LangVersion", "langversion:5", "", "5", 0 }, - { "LangVersion", "langversion:6", "", "6", 0 }, - { "LangVersion", "langversion:default", "", "default", 0 }, - - { "DelaySign", "delaysign", "", "true", 0 }, - { "DelaySign", "delaysign-", "", "false", 0 }, - { "DelaySign", "delaysign+", "", "true", 0 }, - - { "AssemblyOriginatorKeyFile", "keyfile", "", "", 0 }, - - { "KeyContainerName", "keycontainer", "", "", 0 }, - - { "NoLogo", "nologo", "", "", 0 }, - - { "NoConfig", "noconfig", "", "true", 0 }, - - { "BaseAddress", "baseaddress:", "", "", 0 }, - - { "CodePage", "codepage", "", "", 0 }, - - { "Utf8Output", "utf8output", "", "", 0 }, - - { "MainEntryPoint", "main:", "", "", 0 }, - - { "GenerateFullPaths", "fullpaths", "", "true", 0 }, - - { "FileAlignment", "filealign", "", "", 0 }, - - { "PdbFile", "pdb:", "", "", 0 }, - - { "NoStandardLib", "nostdlib", "", "true", 0 }, - { "NoStandardLib", "nostdlib-", "", "false", 0 }, - { "NoStandardLib", "nostdlib+", "", "true", 0 }, - - { "SubsystemVersion", "subsystemversion", "", "", 0 }, - - { "AdditionalLibPaths", "lib:", "", "", 0 }, - - { "ErrorReport", "errorreport:none", "Do Not Send Report", "none", 0 }, - { "ErrorReport", "errorreport:prompt", "Prompt Immediately", "prompt", 0 }, - { "ErrorReport", "errorreport:queue", "Queue For Next Login", "queue", 0 }, - { "ErrorReport", "errorreport:send", "Send Automatically", "send", 0 }, - - { 0, 0, 0, 0, 0 }, -}; diff --git a/Source/cmVS10CudaFlagTable.h b/Source/cmVS10CudaFlagTable.h deleted file mode 100644 index 2b57e08..0000000 --- a/Source/cmVS10CudaFlagTable.h +++ /dev/null @@ -1,54 +0,0 @@ -static cmVS7FlagTable cmVS10CudaFlagTable[] = { - // Collect options meant for the host compiler. - { "AdditionalCompilerOptions", "Xcompiler=", "Host compiler options", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SpaceAppendable }, - { "AdditionalCompilerOptions", "Xcompiler", "Host compiler options", "", - cmVS7FlagTable::UserFollowing | cmVS7FlagTable::SpaceAppendable }, - - // Select the CUDA runtime library. - { "CudaRuntime", "cudart=none", "No CUDA runtime library", "None", 0 }, - { "CudaRuntime", "cudart=shared", "Shared/dynamic CUDA runtime library", - "Shared", 0 }, - { "CudaRuntime", "cudart=static", "Static CUDA runtime library", "Static", - 0 }, - { "CudaRuntime", "cudart", "CUDA runtime library", "", - cmVS7FlagTable::UserFollowing }, - - // Capture arch/code arguments into temporaries for post-processing. - { "cmake-temp-gencode", "gencode=", "", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "cmake-temp-gencode", "gencode", "", "", - cmVS7FlagTable::UserFollowing | cmVS7FlagTable::SemicolonAppendable }, - { "cmake-temp-gencode", "-generate-code=", "", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "cmake-temp-gencode", "-generate-code", "", "", - cmVS7FlagTable::UserFollowing | cmVS7FlagTable::SemicolonAppendable }, - - { "cmake-temp-code", "code=", "", "", cmVS7FlagTable::UserValue }, - { "cmake-temp-code", "code", "", "", cmVS7FlagTable::UserFollowing }, - { "cmake-temp-code", "-gpu-code=", "", "", cmVS7FlagTable::UserValue }, - { "cmake-temp-code", "-gpu-code", "", "", cmVS7FlagTable::UserFollowing }, - - { "cmake-temp-arch", "arch=", "", "", cmVS7FlagTable::UserValue }, - { "cmake-temp-arch", "arch", "", "", cmVS7FlagTable::UserFollowing }, - { "cmake-temp-arch", "-gpu-architecture=", "", "", - cmVS7FlagTable::UserValue }, - { "cmake-temp-arch", "-gpu-architecture", "", "", - cmVS7FlagTable::UserFollowing }, - - // Other flags. - - { "FastMath", "use_fast_math", "", "true", 0 }, - { "FastMath", "-use_fast_math", "", "true", 0 }, - - { "GPUDebugInfo", "G", "", "true", 0 }, - { "GPUDebugInfo", "-device-debug", "", "true", 0 }, - - { "HostDebugInfo", "g", "", "true", 0 }, - { "HostDebugInfo", "-debug", "", "true", 0 }, - - { "MaxRegCount", "maxrregcount=", "", "", cmVS7FlagTable::UserValue }, - { "MaxRegCount", "maxrregcount", "", "", cmVS7FlagTable::UserFollowing }, - - { 0, 0, 0, 0, 0 } -}; diff --git a/Source/cmVS10CudaHostFlagTable.h b/Source/cmVS10CudaHostFlagTable.h deleted file mode 100644 index 5b61066..0000000 --- a/Source/cmVS10CudaHostFlagTable.h +++ /dev/null @@ -1,35 +0,0 @@ -static cmVS7FlagTable cmVS10CudaHostFlagTable[] = { - //{"Optimization", "", "<inherit from host>", "InheritFromHost", 0}, - { "Optimization", "Od", "Disabled", "Od", 0 }, - { "Optimization", "O1", "Minimize Size", "O1", 0 }, - { "Optimization", "O2", "Maximize Speed", "O2", 0 }, - { "Optimization", "Ox", "Full Optimization", "O3", 0 }, - - //{"Runtime", "", "<inherit from host>", "InheritFromHost", 0}, - { "Runtime", "MT", "Multi-Threaded", "MT", 0 }, - { "Runtime", "MTd", "Multi-Threaded Debug", "MTd", 0 }, - { "Runtime", "MD", "Multi-Threaded DLL", "MD", 0 }, - { "Runtime", "MDd", "Multi-threaded Debug DLL", "MDd", 0 }, - { "Runtime", "ML", "Single-Threaded", "ML", 0 }, - { "Runtime", "MLd", "Single-Threaded Debug", "MLd", 0 }, - - //{"RuntimeChecks", "", "<inherit from host>", "InheritFromHost", 0}, - //{"RuntimeChecks", "", "Default", "Default", 0}, - { "RuntimeChecks", "RTCs", "Stack Frames", "RTCs", 0 }, - { "RuntimeChecks", "RTCu", "Uninitialized Variables", "RTCu", 0 }, - { "RuntimeChecks", "RTC1", "Both", "RTC1", 0 }, - - //{"TypeInfo", "", "<inherit from host>", "InheritFromHost", 0}, - { "TypeInfo", "GR", "Yes", "true", 0 }, - { "TypeInfo", "GR-", "No", "false", 0 }, - - //{"Warning", "", "<inherit from host>", "InheritFromHost", 0}, - { "Warning", "W0", "Off: Turn Off All Warnings", "W0", 0 }, - { "Warning", "W1", "Level 1", "W1", 0 }, - { "Warning", "W2", "Level 2", "W2", 0 }, - { "Warning", "W3", "Level 3", "W3", 0 }, - { "Warning", "W4", "Level 4", "W4", 0 }, - { "Warning", "Wall", "Enable All Warnings", "Wall", 0 }, - - { 0, 0, 0, 0, 0 } -}; diff --git a/Source/cmVS10LibFlagTable.h b/Source/cmVS10LibFlagTable.h deleted file mode 100644 index be4f475..0000000 --- a/Source/cmVS10LibFlagTable.h +++ /dev/null @@ -1,76 +0,0 @@ -static cmVS7FlagTable cmVS10LibFlagTable[] = { - - // Enum Properties - { "ErrorReporting", "ERRORREPORT:PROMPT", "PromptImmediately", - "PromptImmediately", 0 }, - { "ErrorReporting", "ERRORREPORT:QUEUE", "Queue For Next Login", - "QueueForNextLogin", 0 }, - { "ErrorReporting", "ERRORREPORT:SEND", "Send Error Report", - "SendErrorReport", 0 }, - { "ErrorReporting", "ERRORREPORT:NONE", "No Error Report", "NoErrorReport", - 0 }, - - { "TargetMachine", "MACHINE:ARM", "MachineARM", "MachineARM", 0 }, - { "TargetMachine", "MACHINE:EBC", "MachineEBC", "MachineEBC", 0 }, - { "TargetMachine", "MACHINE:IA64", "MachineIA64", "MachineIA64", 0 }, - { "TargetMachine", "MACHINE:MIPS", "MachineMIPS", "MachineMIPS", 0 }, - { "TargetMachine", "MACHINE:MIPS16", "MachineMIPS16", "MachineMIPS16", 0 }, - { "TargetMachine", "MACHINE:MIPSFPU", "MachineMIPSFPU", "MachineMIPSFPU", - 0 }, - { "TargetMachine", "MACHINE:MIPSFPU16", "MachineMIPSFPU16", - "MachineMIPSFPU16", 0 }, - { "TargetMachine", "MACHINE:SH4", "MachineSH4", "MachineSH4", 0 }, - { "TargetMachine", "MACHINE:THUMB", "MachineTHUMB", "MachineTHUMB", 0 }, - { "TargetMachine", "MACHINE:X64", "MachineX64", "MachineX64", 0 }, - { "TargetMachine", "MACHINE:X86", "MachineX86", "MachineX86", 0 }, - - { "SubSystem", "SUBSYSTEM:CONSOLE", "Console", "Console", 0 }, - { "SubSystem", "SUBSYSTEM:WINDOWS", "Windows", "Windows", 0 }, - { "SubSystem", "SUBSYSTEM:NATIVE", "Native", "Native", 0 }, - { "SubSystem", "SUBSYSTEM:EFI_APPLICATION", "EFI Application", - "EFI Application", 0 }, - { "SubSystem", "SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER", - "EFI Boot Service Driver", "EFI Boot Service Driver", 0 }, - { "SubSystem", "SUBSYSTEM:EFI_ROM", "EFI ROM", "EFI ROM", 0 }, - { "SubSystem", "SUBSYSTEM:EFI_RUNTIME_DRIVER", "EFI Runtime", "EFI Runtime", - 0 }, - { "SubSystem", "SUBSYSTEM:WINDOWSCE", "WindowsCE", "WindowsCE", 0 }, - { "SubSystem", "SUBSYSTEM:POSIX", "POSIX", "POSIX", 0 }, - - // Bool Properties - { "SuppressStartupBanner", "NOLOGO", "", "true", 0 }, - { "IgnoreAllDefaultLibraries", "NODEFAULTLIB", "", "true", 0 }, - { "TreatLibWarningAsErrors", "WX:NO", "", "false", 0 }, - { "TreatLibWarningAsErrors", "WX", "", "true", 0 }, - { "Verbose", "VERBOSE", "", "true", 0 }, - { "LinkTimeCodeGeneration", "LTCG", "", "true", 0 }, - - // Bool Properties With Argument - - // String List Properties - // Skip [AdditionalDependencies] - no command line Switch. - { "AdditionalLibraryDirectories", - "LIBPATH:", "Additional Library Directories", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "IgnoreSpecificDefaultLibraries", - "NODEFAULTLIB:", "Ignore Specific Default Libraries", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "ExportNamedFunctions", "EXPORT:", "Export Named Functions", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "RemoveObjects", "REMOVE:", "Remove Objects", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - - // String Properties - { "OutputFile", "OUT:", "Output File", "", cmVS7FlagTable::UserValue }, - { "ModuleDefinitionFile", "DEF:", "Module Definition File Name", "", - cmVS7FlagTable::UserValue }, - { "ForceSymbolReferences", "INCLUDE:", "Force Symbol References", "", - cmVS7FlagTable::UserValue }, - { "DisplayLibrary", "LIST:", "Display Library to standard output", "", - cmVS7FlagTable::UserValue }, - // Skip [MinimumRequiredVersion] - no command line Switch. - { "Name", "NAME:", "Name", "", cmVS7FlagTable::UserValue }, - // Skip [TrackerLogDirectory] - no command line Switch. - // Skip [AdditionalOptions] - no command line Switch. - { 0, 0, 0, 0, 0 } -}; diff --git a/Source/cmVS10LinkFlagTable.h b/Source/cmVS10LinkFlagTable.h deleted file mode 100644 index 8f5b59b..0000000 --- a/Source/cmVS10LinkFlagTable.h +++ /dev/null @@ -1,247 +0,0 @@ -static cmVS7FlagTable cmVS10LinkFlagTable[] = { - - // Enum Properties - { "ShowProgress", "", "Not Set", "NotSet", 0 }, - { "ShowProgress", "VERBOSE", "Display all progress messages", "LinkVerbose", - 0 }, - { "ShowProgress", "VERBOSE:Lib", "For Libraries Searched", "LinkVerboseLib", - 0 }, - { "ShowProgress", "VERBOSE:ICF", - "About COMDAT folding during optimized linking", "LinkVerboseICF", 0 }, - { "ShowProgress", "VERBOSE:REF", - "About data removed during optimized linking", "LinkVerboseREF", 0 }, - { "ShowProgress", "VERBOSE:SAFESEH", "About Modules incompatible with SEH", - "LinkVerboseSAFESEH", 0 }, - { "ShowProgress", "VERBOSE:CLR", - "About linker activity related to managed code", "LinkVerboseCLR", 0 }, - - { "ForceFileOutput", "FORCE", "Enabled", "Enabled", 0 }, - { "ForceFileOutput", "FORCE:MULTIPLE", "Multiply Defined Symbol Only", - "MultiplyDefinedSymbolOnly", 0 }, - { "ForceFileOutput", "FORCE:UNRESOLVED", "Undefined Symbol Only", - "UndefinedSymbolOnly", 0 }, - - { "CreateHotPatchableImage", "FUNCTIONPADMIN", "Enabled", "Enabled", 0 }, - { "CreateHotPatchableImage", "FUNCTIONPADMIN:5", "X86 Image Only", - "X86Image", 0 }, - { "CreateHotPatchableImage", "FUNCTIONPADMIN:6", "X64 Image Only", - "X64Image", 0 }, - { "CreateHotPatchableImage", "FUNCTIONPADMIN:16", "Itanium Image Only", - "ItaniumImage", 0 }, - - // correct flags for uac should be /MANIFESTUAC, but some projects already - // use this bug to access uac field, so keep these for compatibility - { "UACExecutionLevel", "level='asInvoker'", "asInvoker", "AsInvoker", 0 }, - { "UACExecutionLevel", "level='highestAvailable'", "highestAvailable", - "HighestAvailable", 0 }, - { "UACExecutionLevel", "level='requireAdministrator'", - "requireAdministrator", "RequireAdministrator", 0 }, - - { "SubSystem", "", "Not Set", "NotSet", 0 }, - { "SubSystem", "SUBSYSTEM:CONSOLE", "Console", "Console", 0 }, - { "SubSystem", "SUBSYSTEM:WINDOWS", "Windows", "Windows", 0 }, - { "SubSystem", "SUBSYSTEM:NATIVE", "Native", "Native", 0 }, - { "SubSystem", "SUBSYSTEM:EFI_APPLICATION", "EFI Application", - "EFI Application", 0 }, - { "SubSystem", "SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER", - "EFI Boot Service Driver", "EFI Boot Service Driver", 0 }, - { "SubSystem", "SUBSYSTEM:EFI_ROM", "EFI ROM", "EFI ROM", 0 }, - { "SubSystem", "SUBSYSTEM:EFI_RUNTIME_DRIVER", "EFI Runtime", "EFI Runtime", - 0 }, - { "SubSystem", "SUBSYSTEM:WINDOWSCE", "WindowsCE", "WindowsCE", 0 }, - { "SubSystem", "SUBSYSTEM:POSIX", "POSIX", "POSIX", 0 }, - - { "Driver", "", "Not Set", "NotSet", 0 }, - { "Driver", "Driver", "Driver", "Driver", 0 }, - { "Driver", "DRIVER:UPONLY", "UP Only", "UpOnly", 0 }, - { "Driver", "DRIVER:WDM", "WDM", "WDM", 0 }, - - { "LinkTimeCodeGeneration", "", "Default", "Default", 0 }, - { "LinkTimeCodeGeneration", "LTCG", "Use Link Time Code Generation", - "UseLinkTimeCodeGeneration", 0 }, - { "LinkTimeCodeGeneration", "LTCG:PGInstrument", - "Profile Guided Optimization - Instrument", "PGInstrument", 0 }, - { "LinkTimeCodeGeneration", "LTCG:PGOptimize", - "Profile Guided Optimization - Optimization", "PGOptimization", 0 }, - { "LinkTimeCodeGeneration", "LTCG:PGUpdate", - "Profile Guided Optimization - Update", "PGUpdate", 0 }, - - { "TargetMachine", "", "Not Set", "NotSet", 0 }, - { "TargetMachine", "MACHINE:ARM", "MachineARM", "MachineARM", 0 }, - { "TargetMachine", "MACHINE:EBC", "MachineEBC", "MachineEBC", 0 }, - { "TargetMachine", "MACHINE:IA64", "MachineIA64", "MachineIA64", 0 }, - { "TargetMachine", "MACHINE:MIPS", "MachineMIPS", "MachineMIPS", 0 }, - { "TargetMachine", "MACHINE:MIPS16", "MachineMIPS16", "MachineMIPS16", 0 }, - { "TargetMachine", "MACHINE:MIPSFPU", "MachineMIPSFPU", "MachineMIPSFPU", - 0 }, - { "TargetMachine", "MACHINE:MIPSFPU16", "MachineMIPSFPU16", - "MachineMIPSFPU16", 0 }, - { "TargetMachine", "MACHINE:SH4", "MachineSH4", "MachineSH4", 0 }, - { "TargetMachine", "MACHINE:THUMB", "MachineTHUMB", "MachineTHUMB", 0 }, - { "TargetMachine", "MACHINE:X64", "MachineX64", "MachineX64", 0 }, - { "TargetMachine", "MACHINE:X86", "MachineX86", "MachineX86", 0 }, - - { "CLRThreadAttribute", "CLRTHREADATTRIBUTE:MTA", "MTA threading attribute", - "MTAThreadingAttribute", 0 }, - { "CLRThreadAttribute", "CLRTHREADATTRIBUTE:STA", "STA threading attribute", - "STAThreadingAttribute", 0 }, - { "CLRThreadAttribute", "CLRTHREADATTRIBUTE:NONE", - "Default threading attribute", "DefaultThreadingAttribute", 0 }, - - { "CLRImageType", "CLRIMAGETYPE:IJW", "Force IJW image", "ForceIJWImage", - 0 }, - { "CLRImageType", "CLRIMAGETYPE:PURE", "Force Pure IL Image", - "ForcePureILImage", 0 }, - { "CLRImageType", "CLRIMAGETYPE:SAFE", "Force Safe IL Image", - "ForceSafeILImage", 0 }, - { "CLRImageType", "", "Default image type", "Default", 0 }, - - { "LinkErrorReporting", "ERRORREPORT:PROMPT", "PromptImmediately", - "PromptImmediately", 0 }, - { "LinkErrorReporting", "ERRORREPORT:QUEUE", "Queue For Next Login", - "QueueForNextLogin", 0 }, - { "LinkErrorReporting", "ERRORREPORT:SEND", "Send Error Report", - "SendErrorReport", 0 }, - { "LinkErrorReporting", "ERRORREPORT:NONE", "No Error Report", - "NoErrorReport", 0 }, - - { "CLRSupportLastError", "CLRSupportLastError", "Enabled", "Enabled", 0 }, - { "CLRSupportLastError", "CLRSupportLastError:NO", "Disabled", "Disabled", - 0 }, - { "CLRSupportLastError", "CLRSupportLastError:SYSTEMDLL", "System Dlls Only", - "SystemDlls", 0 }, - - // Bool Properties - { "LinkIncremental", "INCREMENTAL:NO", "", "false", 0 }, - { "LinkIncremental", "INCREMENTAL", "", "true", 0 }, - { "SuppressStartupBanner", "NOLOGO", "", "true", 0 }, - { "LinkStatus", "LTCG:NOSTATUS", "", "false", 0 }, - { "LinkStatus", "LTCG:STATUS", "", "true", 0 }, - { "PreventDllBinding", "ALLOWBIND:NO", "", "false", 0 }, - { "PreventDllBinding", "ALLOWBIND", "", "true", 0 }, - { "TreatLinkerWarningAsErrors", "WX:NO", "", "false", 0 }, - { "TreatLinkerWarningAsErrors", "WX", "", "true", 0 }, - { "IgnoreAllDefaultLibraries", "NODEFAULTLIB", "", "true", 0 }, - { "GenerateManifest", "MANIFEST:NO", "", "false", 0 }, - { "GenerateManifest", "MANIFEST", "", "true", 0 }, - { "AllowIsolation", "ALLOWISOLATION:NO", "", "false", 0 }, - - // correct flags for uac should be /MANIFESTUAC, but some projects already - // use this bug to access uac field, so keep these for compatibility - { "UACUIAccess", "uiAccess='false'", "", "false", 0 }, - { "UACUIAccess", "uiAccess='true'", "", "true", 0 }, - - { "GenerateDebugInformation", "DEBUG", "", "true", - cmVS7FlagTable::CaseInsensitive }, - { "MapExports", "MAPINFO:EXPORTS", "", "true", 0 }, - { "AssemblyDebug", "ASSEMBLYDEBUG:DISABLE", "", "false", 0 }, - { "AssemblyDebug", "ASSEMBLYDEBUG", "", "true", 0 }, - { "LargeAddressAware", "LARGEADDRESSAWARE:NO", "", "false", 0 }, - { "LargeAddressAware", "LARGEADDRESSAWARE", "", "true", 0 }, - { "TerminalServerAware", "TSAWARE:NO", "", "false", 0 }, - { "TerminalServerAware", "TSAWARE", "", "true", 0 }, - { "SwapRunFromCD", "SWAPRUN:CD", "", "true", 0 }, - { "SwapRunFromNET", "SWAPRUN:NET", "", "true", 0 }, - { "OptimizeReferences", "OPT:NOREF", "", "false", 0 }, - { "OptimizeReferences", "OPT:REF", "", "true", 0 }, - { "EnableCOMDATFolding", "OPT:NOICF", "", "false", 0 }, - { "EnableCOMDATFolding", "OPT:ICF", "", "true", 0 }, - { "IgnoreEmbeddedIDL", "IGNOREIDL", "", "true", 0 }, - { "NoEntryPoint", "NOENTRY", "", "true", 0 }, - { "SetChecksum", "RELEASE", "", "true", 0 }, - { "RandomizedBaseAddress", "DYNAMICBASE:NO", "", "false", 0 }, - { "RandomizedBaseAddress", "DYNAMICBASE", "", "true", 0 }, - { "FixedBaseAddress", "FIXED:NO", "", "false", 0 }, - { "FixedBaseAddress", "FIXED", "", "true", 0 }, - { "DataExecutionPrevention", "NXCOMPAT:NO", "", "false", 0 }, - { "DataExecutionPrevention", "NXCOMPAT", "", "true", 0 }, - { "TurnOffAssemblyGeneration", "NOASSEMBLY", "", "true", 0 }, - { "SupportUnloadOfDelayLoadedDLL", "DELAY:UNLOAD", "", "true", 0 }, - { "SupportNobindOfDelayLoadedDLL", "DELAY:NOBIND", "", "true", 0 }, - { "Profile", "PROFILE", "", "true", 0 }, - { "LinkDelaySign", "DELAYSIGN:NO", "", "false", 0 }, - { "LinkDelaySign", "DELAYSIGN", "", "true", 0 }, - { "CLRUnmanagedCodeCheck", "CLRUNMANAGEDCODECHECK:NO", "", "false", 0 }, - { "CLRUnmanagedCodeCheck", "CLRUNMANAGEDCODECHECK", "", "true", 0 }, - { "ImageHasSafeExceptionHandlers", "SAFESEH:NO", "", "false", 0 }, - { "ImageHasSafeExceptionHandlers", "SAFESEH", "", "true", 0 }, - { "LinkDLL", "DLL", "", "true", 0 }, - - // Bool Properties With Argument - { "EnableUAC", "MANIFESTUAC:", "", "", - cmVS7FlagTable::UserValueRequired | cmVS7FlagTable::SpaceAppendable }, - { "GenerateMapFile", "MAP", "", "true", - cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue }, - { "MapFileName", "MAP:", "Generate Map File", "", - cmVS7FlagTable::UserValueRequired }, - - // String List Properties - { "AdditionalLibraryDirectories", - "LIBPATH:", "Additional Library Directories", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - // Skip [AdditionalDependencies] - no command line Switch. - { "IgnoreSpecificDefaultLibraries", - "NODEFAULTLIB:", "Ignore Specific Default Libraries", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "AddModuleNamesToAssembly", "ASSEMBLYMODULE:", "Add Module to Assembly", - "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "EmbedManagedResourceFile", - "ASSEMBLYRESOURCE:", "Embed Managed Resource File", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "ForceSymbolReferences", "INCLUDE:", "Force Symbol References", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "DelayLoadDLLs", "DELAYLOAD:", "Delay Loaded Dlls", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "AssemblyLinkResource", "ASSEMBLYLINKRESOURCE:", "Assembly Link Resource", - "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "AdditionalManifestDependencies", - "MANIFESTDEPENDENCY:", "Additional Manifest Dependencies", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - - // String Properties - { "OutputFile", "OUT:", "Output File", "", cmVS7FlagTable::UserValue }, - { "Version", "VERSION:", "Version", "", cmVS7FlagTable::UserValue }, - { "SpecifySectionAttributes", "SECTION:", "Specify Section Attributes", "", - cmVS7FlagTable::UserValue }, - { "MSDOSStubFileName", "STUB:", "MS-DOS Stub File Name", "", - cmVS7FlagTable::UserValue }, - // Skip [TrackerLogDirectory] - no command line Switch. - { "ModuleDefinitionFile", "DEF:", "Module Definition File", "", - cmVS7FlagTable::UserValue }, - { "ManifestFile", "ManifestFile:", "Manifest File", "", - cmVS7FlagTable::UserValue }, - { "ProgramDatabaseFile", "PDB:", "Generate Program Database File", "", - cmVS7FlagTable::UserValue }, - { "StripPrivateSymbols", "PDBSTRIPPED:", "Strip Private Symbols", "", - cmVS7FlagTable::UserValue }, - // Skip [MapFileName] - no command line Switch. - // Skip [MinimumRequiredVersion] - no command line Switch. - { "HeapReserveSize", "HEAP:", "Heap Reserve Size", "", - cmVS7FlagTable::UserValue }, - // Skip [HeapCommitSize] - no command line Switch. - { "StackReserveSize", "STACK:", "Stack Reserve Size", "", - cmVS7FlagTable::UserValue }, - // Skip [StackCommitSize] - no command line Switch. - { "FunctionOrder", "ORDER:@", "Function Order", "", - cmVS7FlagTable::UserValue }, - { "ProfileGuidedDatabase", "PGD:", "Profile Guided Database", "", - cmVS7FlagTable::UserValue }, - { "MidlCommandFile", "MIDL:@", "MIDL Commands", "", - cmVS7FlagTable::UserValue }, - { "MergedIDLBaseFileName", "IDLOUT:", "Merged IDL Base File Name", "", - cmVS7FlagTable::UserValue }, - { "TypeLibraryFile", "TLBOUT:", "Type Library", "", - cmVS7FlagTable::UserValue }, - { "EntryPointSymbol", "ENTRY:", "Entry Point", "", - cmVS7FlagTable::UserValue }, - { "BaseAddress", "BASE:", "Base Address", "", cmVS7FlagTable::UserValue }, - { "ImportLibrary", "IMPLIB:", "Import Library", "", - cmVS7FlagTable::UserValue }, - { "MergeSections", "MERGE:", "Merge Sections", "", - cmVS7FlagTable::UserValue }, - { "LinkKeyFile", "KEYFILE:", "Key File", "", cmVS7FlagTable::UserValue }, - { "KeyContainer", "KEYCONTAINER:", "Key Container", "", - cmVS7FlagTable::UserValue }, - // Skip [AdditionalOptions] - no command line Switch. - { 0, 0, 0, 0, 0 } -}; diff --git a/Source/cmVS10MASMFlagTable.h b/Source/cmVS10MASMFlagTable.h deleted file mode 100644 index 0a45245..0000000 --- a/Source/cmVS10MASMFlagTable.h +++ /dev/null @@ -1,76 +0,0 @@ -static cmVS7FlagTable cmVS10MASMFlagTable[] = { - - // Enum Properties - { "PreserveIdentifierCase", "", "Default", "0", 0 }, - { "PreserveIdentifierCase", "Cp", "Preserves Identifier Case (/Cp)", "1", - 0 }, - { "PreserveIdentifierCase", "Cu", - "Maps all identifiers to upper case. (/Cu)", "2", 0 }, - { "PreserveIdentifierCase", "Cx", - "Preserves case in public and extern symbols. (/Cx)", "3", 0 }, - - { "WarningLevel", "W0", "Warning Level 0 (/W0)", "0", 0 }, - { "WarningLevel", "W1", "Warning Level 1 (/W1)", "1", 0 }, - { "WarningLevel", "W2", "Warning Level 2 (/W2)", "2", 0 }, - { "WarningLevel", "W3", "Warning Level 3 (/W3)", "3", 0 }, - - { "PackAlignmentBoundary", "", "Default", "0", 0 }, - { "PackAlignmentBoundary", "Zp1", "One Byte Boundary (/Zp1)", "1", 0 }, - { "PackAlignmentBoundary", "Zp2", "Two Byte Boundary (/Zp2)", "2", 0 }, - { "PackAlignmentBoundary", "Zp4", "Four Byte Boundary (/Zp4)", "3", 0 }, - { "PackAlignmentBoundary", "Zp8", "Eight Byte Boundary (/Zp8)", "4", 0 }, - { "PackAlignmentBoundary", "Zp16", "Sixteen Byte Boundary (/Zp16)", "5", 0 }, - - { "CallingConvention", "", "Default", "0", 0 }, - { "CallingConvention", "Gd", "Use C-style Calling Convention (/Gd)", "1", - 0 }, - { "CallingConvention", "Gz", "Use stdcall Calling Convention (/Gz)", "2", - 0 }, - { "CallingConvention", "Gc", "Use Pascal Calling Convention (/Gc)", "3", 0 }, - - { "ErrorReporting", "errorReport:prompt", - "Prompt to send report immediately (/errorReport:prompt)", "0", 0 }, - { "ErrorReporting", "errorReport:queue", - "Prompt to send report at the next logon (/errorReport:queue)", "1", 0 }, - { "ErrorReporting", "errorReport:send", - "Automatically send report (/errorReport:send)", "2", 0 }, - { "ErrorReporting", "errorReport:none", - "Do not send report (/errorReport:none)", "3", 0 }, - - // Bool Properties - { "NoLogo", "nologo", "", "true", 0 }, - { "GeneratePreprocessedSourceListing", "EP", "", "true", 0 }, - { "ListAllAvailableInformation", "Sa", "", "true", 0 }, - { "UseSafeExceptionHandlers", "safeseh", "", "true", 0 }, - { "AddFirstPassListing", "Sf", "", "true", 0 }, - { "EnableAssemblyGeneratedCodeListing", "Sg", "", "true", 0 }, - { "DisableSymbolTable", "Sn", "", "true", 0 }, - { "EnableFalseConditionalsInListing", "Sx", "", "true", 0 }, - { "TreatWarningsAsErrors", "WX", "", "true", 0 }, - { "MakeAllSymbolsPublic", "Zf", "", "true", 0 }, - { "GenerateDebugInformation", "Zi", "", "true", 0 }, - { "EnableMASM51Compatibility", "Zm", "", "true", 0 }, - { "PerformSyntaxCheckOnly", "Zs", "", "true", 0 }, - - // Bool Properties With Argument - - // String List Properties - { "PreprocessorDefinitions", "D", "Preprocessor Definitions", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "IncludePaths", "I", "Include Paths", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "BrowseFile", "FR", "Generate Browse Information File", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - // Skip [AdditionalDependencies] - no command line Switch. - - // String Properties - // Skip [Inputs] - no command line Switch. - { "ObjectFileName", "Fo", "Object File Name", "", - cmVS7FlagTable::UserValue }, - { "AssembledCodeListingFile", "Fl", "Assembled Code Listing File", "", - cmVS7FlagTable::UserValue }, - // Skip [CommandLineTemplate] - no command line Switch. - // Skip [ExecutionDescription] - no command line Switch. - // Skip [AdditionalOptions] - no command line Switch. - { 0, 0, 0, 0, 0 } -}; diff --git a/Source/cmVS10NASMFlagTable.h b/Source/cmVS10NASMFlagTable.h deleted file mode 100644 index b91af92..0000000 --- a/Source/cmVS10NASMFlagTable.h +++ /dev/null @@ -1,50 +0,0 @@ -static cmVS7FlagTable cmVS10NASMFlagTable[] = { - - // Enum Properties - { "Outputswitch", "fwin32", "", "0", 0 }, - { "Outputswitch", "fwin", "", "0", 0 }, - { "Outputswitch", "fwin64", "", "1", 0 }, - { "Outputswitch", "felf", "", "2", 0 }, - { "Outputswitch", "felf32", "", "2", 0 }, - { "Outputswitch", "felf64", "", "3", 0 }, - - { "ErrorReportingFormat", "Xgnu", "", "-Xgnu GNU format: Default format", - 0 }, - { "ErrorReportingFormat", "Xvc", "", - "-Xvc Style used by Microsoft Visual C++", 0 }, - - // Bool Properties - { "TreatWarningsAsErrors", "Werror", "", "true", 0 }, - { "GenerateDebugInformation", "g", "", "true", 0 }, - { "floatunderflow", "w+float-underflow", "", "true", 0 }, - { "macrodefaults", "w-macro-defaults", "", "true", 0 }, - { "user", "w-user", "%warning directives (default on)", "true", 0 }, - { "floatoverflow", "w-float-overflow", "", "true", 0 }, - { "floatdenorm", "w+float-denorm", "", "true", 0 }, - { "numberoverflow", "w-number-overflow", "", "true", 0 }, - { "macroselfref", "w+macro-selfref", "", "true", 0 }, - { "floattoolong", "w-float-toolong", "", "true", 0 }, - { "orphanlabels", "w-orphan-labels", "", "true", 0 }, - { "tasmmode", "t", "", "true", 0 }, - - // Bool Properties With Argument - - // String List Properties - { "PreprocessorDefinitions", "D", "Preprocessor Definitions", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "UndefinePreprocessorDefinitions", "U", - "Undefine Preprocessor Definitions", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "IncludePaths", "I", "Include Paths", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "AssembledCodeListingFile", "l", - "Generates an assembled code listing file.", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - - // String Properties - // Skip [Inputs] - no command line Switch. - // Skip [CommandLineTemplate] - no command line Switch. - // Skip [ExecutionDescription] - no command line Switch. - // Skip [AdditionalOptions] - no command line Switch. - { 0, 0, 0, 0, 0 } -}; diff --git a/Source/cmVS10RCFlagTable.h b/Source/cmVS10RCFlagTable.h deleted file mode 100644 index 6e2b834..0000000 --- a/Source/cmVS10RCFlagTable.h +++ /dev/null @@ -1,7 +0,0 @@ -static cmVS7FlagTable cmVS10RCFlagTable[] = { - // Bool Properties - { "NullTerminateStrings", "n", "", "true", 0 }, - { "SuppressStartupBanner", "nologo", "", "true", 0 }, - - { 0, 0, 0, 0, 0 } -}; diff --git a/Source/cmVS11CLFlagTable.h b/Source/cmVS11CLFlagTable.h deleted file mode 100644 index d156938..0000000 --- a/Source/cmVS11CLFlagTable.h +++ /dev/null @@ -1,220 +0,0 @@ -static cmVS7FlagTable cmVS11CLFlagTable[] = { - - // Enum Properties - { "DebugInformationFormat", "", "None", "None", 0 }, - { "DebugInformationFormat", "Z7", "C7 compatible", "OldStyle", 0 }, - { "DebugInformationFormat", "Zi", "Program Database", "ProgramDatabase", 0 }, - { "DebugInformationFormat", "ZI", "Program Database for Edit And Continue", - "EditAndContinue", 0 }, - - { "WarningLevel", "W0", "Turn Off All Warnings", "TurnOffAllWarnings", 0 }, - { "WarningLevel", "W1", "Level1", "Level1", 0 }, - { "WarningLevel", "W2", "Level2", "Level2", 0 }, - { "WarningLevel", "W3", "Level3", "Level3", 0 }, - { "WarningLevel", "W4", "Level4", "Level4", 0 }, - { "WarningLevel", "Wall", "EnableAllWarnings", "EnableAllWarnings", 0 }, - - { "Optimization", "Od", "Disabled", "Disabled", 0 }, - { "Optimization", "O1", "Minimize Size", "MinSpace", 0 }, - { "Optimization", "O2", "Maximize Speed", "MaxSpeed", 0 }, - { "Optimization", "Ox", "Full Optimization", "Full", 0 }, - - { "InlineFunctionExpansion", "", "Default", "Default", 0 }, - { "InlineFunctionExpansion", "Ob0", "Disabled", "Disabled", 0 }, - { "InlineFunctionExpansion", "Ob1", "Only __inline", "OnlyExplicitInline", - 0 }, - { "InlineFunctionExpansion", "Ob2", "Any Suitable", "AnySuitable", 0 }, - - { "FavorSizeOrSpeed", "Os", "Favor small code", "Size", 0 }, - { "FavorSizeOrSpeed", "Ot", "Favor fast code", "Speed", 0 }, - { "FavorSizeOrSpeed", "", "Neither", "Neither", 0 }, - - { "ExceptionHandling", "EHa", "Yes with SEH Exceptions", "Async", 0 }, - { "ExceptionHandling", "EHsc", "Yes", "Sync", 0 }, - { "ExceptionHandling", "EHs", "Yes with Extern C functions", "SyncCThrow", - 0 }, - { "ExceptionHandling", "", "No", "false", 0 }, - - { "BasicRuntimeChecks", "RTCs", "Stack Frames", "StackFrameRuntimeCheck", - 0 }, - { "BasicRuntimeChecks", "RTCu", "Uninitialized variables", - "UninitializedLocalUsageCheck", 0 }, - { "BasicRuntimeChecks", "RTC1", "Both (/RTC1, equiv. to /RTCsu)", - "EnableFastChecks", 0 }, - { "BasicRuntimeChecks", "", "Default", "Default", 0 }, - - { "RuntimeLibrary", "MT", "Multi-threaded", "MultiThreaded", 0 }, - { "RuntimeLibrary", "MTd", "Multi-threaded Debug", "MultiThreadedDebug", 0 }, - { "RuntimeLibrary", "MD", "Multi-threaded DLL", "MultiThreadedDLL", 0 }, - { "RuntimeLibrary", "MDd", "Multi-threaded Debug DLL", - "MultiThreadedDebugDLL", 0 }, - - { "StructMemberAlignment", "Zp1", "1 Byte", "1Byte", 0 }, - { "StructMemberAlignment", "Zp2", "2 Bytes", "2Bytes", 0 }, - { "StructMemberAlignment", "Zp4", "4 Byte", "4Bytes", 0 }, - { "StructMemberAlignment", "Zp8", "8 Bytes", "8Bytes", 0 }, - { "StructMemberAlignment", "Zp16", "16 Bytes", "16Bytes", 0 }, - { "StructMemberAlignment", "", "Default", "Default", 0 }, - - { "EnableEnhancedInstructionSet", "arch:SSE", "Streaming SIMD Extensions", - "StreamingSIMDExtensions", 0 }, - { "EnableEnhancedInstructionSet", "arch:SSE2", "Streaming SIMD Extensions 2", - "StreamingSIMDExtensions2", 0 }, - { "EnableEnhancedInstructionSet", "arch:AVX", "Advanced Vector Extensions", - "AdvancedVectorExtensions", 0 }, - { "EnableEnhancedInstructionSet", "arch:IA32", "No Enhanced Instructions", - "NoExtensions", 0 }, - { "EnableEnhancedInstructionSet", "", "Not Set", "NotSet", 0 }, - - { "FloatingPointModel", "fp:precise", "Precise", "Precise", 0 }, - { "FloatingPointModel", "fp:strict", "Strict", "Strict", 0 }, - { "FloatingPointModel", "fp:fast", "Fast", "Fast", 0 }, - - { "PrecompiledHeader", "Yc", "Create", "Create", - cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue }, - { "PrecompiledHeader", "Yu", "Use", "Use", - cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue }, - { "PrecompiledHeader", "Y-", "Not Using Precompiled Headers", "NotUsing", - 0 }, - - { "AssemblerOutput", "", "No Listing", "NoListing", 0 }, - { "AssemblerOutput", "FA", "Assembly-Only Listing", "AssemblyCode", 0 }, - { "AssemblerOutput", "FAc", "Assembly With Machine Code", - "AssemblyAndMachineCode", 0 }, - { "AssemblerOutput", "FAs", "Assembly With Source Code", - "AssemblyAndSourceCode", 0 }, - { "AssemblerOutput", "FAcs", "Assembly, Machine Code and Source", "All", 0 }, - - { "CallingConvention", "Gd", "__cdecl", "Cdecl", 0 }, - { "CallingConvention", "Gr", "__fastcall", "FastCall", 0 }, - { "CallingConvention", "Gz", "__stdcall", "StdCall", 0 }, - - { "CompileAs", "", "Default", "Default", 0 }, - { "CompileAs", "TC", "Compile as C Code", "CompileAsC", 0 }, - { "CompileAs", "TP", "Compile as C++ Code", "CompileAsCpp", 0 }, - - { "ErrorReporting", "errorReport:none", "Do Not Send Report", "None", 0 }, - { "ErrorReporting", "errorReport:prompt", "Prompt Immediately", "Prompt", - 0 }, - { "ErrorReporting", "errorReport:queue", "Queue For Next Login", "Queue", - 0 }, - { "ErrorReporting", "errorReport:send", "Send Automatically", "Send", 0 }, - - { "CompileAsManaged", "", "No Common Language RunTime Support", "false", 0 }, - { "CompileAsManaged", "clr", "Common Language RunTime Support", "true", 0 }, - { "CompileAsManaged", "clr:pure", - "Pure MSIL Common Language RunTime Support", "Pure", 0 }, - { "CompileAsManaged", "clr:safe", - "Safe MSIL Common Language RunTime Support", "Safe", 0 }, - { "CompileAsManaged", "clr:oldSyntax", - "Common Language RunTime Support, Old Syntax", "OldSyntax", 0 }, - - // Bool Properties - { "CompileAsWinRT", "ZW", "", "true", 0 }, - { "WinRTNoStdLib", "ZW:nostdlib", "", "true", 0 }, - { "SuppressStartupBanner", "nologo-", "", "false", 0 }, - { "SuppressStartupBanner", "nologo", "", "true", 0 }, - { "TreatWarningAsError", "WX-", "", "false", 0 }, - { "TreatWarningAsError", "WX", "", "true", 0 }, - { "SDLCheck", "sdl-", "", "false", 0 }, - { "SDLCheck", "sdl", "", "true", 0 }, - { "IntrinsicFunctions", "Oi", "", "true", 0 }, - { "OmitFramePointers", "Oy-", "", "false", 0 }, - { "OmitFramePointers", "Oy", "", "true", 0 }, - { "EnableFiberSafeOptimizations", "GT", "", "true", 0 }, - { "WholeProgramOptimization", "GL", "", "true", 0 }, - { "UndefineAllPreprocessorDefinitions", "u", "", "true", 0 }, - { "IgnoreStandardIncludePath", "X", "", "true", 0 }, - { "PreprocessToFile", "P", "", "true", 0 }, - { "PreprocessSuppressLineNumbers", "EP", "", "true", 0 }, - { "PreprocessKeepComments", "C", "", "true", 0 }, - { "StringPooling", "GF-", "", "false", 0 }, - { "StringPooling", "GF", "", "true", 0 }, - { "MinimalRebuild", "Gm-", "", "false", 0 }, - { "MinimalRebuild", "Gm", "", "true", 0 }, - { "SmallerTypeCheck", "RTCc", "", "true", 0 }, - { "BufferSecurityCheck", "GS-", "", "false", 0 }, - { "BufferSecurityCheck", "GS", "", "true", 0 }, - { "FunctionLevelLinking", "Gy-", "", "false", 0 }, - { "FunctionLevelLinking", "Gy", "", "true", 0 }, - { "EnableParallelCodeGeneration", "Qpar-", "", "false", 0 }, - { "EnableParallelCodeGeneration", "Qpar", "", "true", 0 }, - { "FloatingPointExceptions", "fp:except-", "", "false", 0 }, - { "FloatingPointExceptions", "fp:except", "", "true", 0 }, - { "CreateHotpatchableImage", "hotpatch", "", "true", 0 }, - { "DisableLanguageExtensions", "Za", "", "true", 0 }, - { "TreatWChar_tAsBuiltInType", "Zc:wchar_t-", "", "false", 0 }, - { "TreatWChar_tAsBuiltInType", "Zc:wchar_t", "", "true", 0 }, - { "ForceConformanceInForLoopScope", "Zc:forScope-", "", "false", 0 }, - { "ForceConformanceInForLoopScope", "Zc:forScope", "", "true", 0 }, - { "RuntimeTypeInfo", "GR-", "", "false", 0 }, - { "RuntimeTypeInfo", "GR", "", "true", 0 }, - { "OpenMPSupport", "openmp-", "", "false", 0 }, - { "OpenMPSupport", "openmp", "", "true", 0 }, - { "ExpandAttributedSource", "Fx", "", "true", 0 }, - { "UseUnicodeForAssemblerListing", "FAu", "", "true", 0 }, - { "ShowIncludes", "showIncludes", "", "true", 0 }, - { "EnablePREfast", "analyze-", "", "false", 0 }, - { "EnablePREfast", "analyze", "", "true", 0 }, - { "UseFullPaths", "FC", "", "true", 0 }, - { "OmitDefaultLibName", "Zl", "", "true", 0 }, - - // Bool Properties With Argument - { "MultiProcessorCompilation", "MP", "", "true", - cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue }, - { "ProcessorNumber", "MP", "Multi-processor Compilation", "", - cmVS7FlagTable::UserValueRequired }, - { "GenerateXMLDocumentationFiles", "doc", "", "true", - cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue }, - { "XMLDocumentationFileName", "doc", "Generate XML Documentation Files", "", - cmVS7FlagTable::UserValueRequired }, - { "BrowseInformation", "FR", "", "true", - cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue }, - { "BrowseInformationFile", "FR", "Enable Browse Information", "", - cmVS7FlagTable::UserValueRequired }, - - // String List Properties - { "AdditionalIncludeDirectories", "I", "Additional Include Directories", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "AdditionalUsingDirectories", "AI", "Additional #using Directories", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "PreprocessorDefinitions", "D ", "Preprocessor Definitions", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "UndefinePreprocessorDefinitions", "U", - "Undefine Preprocessor Definitions", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "DisableSpecificWarnings", "wd", "Disable Specific Warnings", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "ForcedIncludeFiles", "FI", "Forced Include File", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "ForcedUsingFiles", "FU", "Forced #using File", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "PREfastLog", "analyze:log", "Code Analysis Log", "", - cmVS7FlagTable::UserFollowing }, - { "PREfastAdditionalPlugins", "analyze:plugin", - "Additional Code Analysis Native plugins", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "TreatSpecificWarningsAsErrors", "we", "Treat Specific Warnings As Errors", - "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - - // String Properties - // Skip [TrackerLogDirectory] - no command line Switch. - { "PreprocessOutputPath", "Fi", "Preprocess Output Path", "", - cmVS7FlagTable::UserValue }, - { "PrecompiledHeaderFile", "Yc", "Precompiled Header Name", "", - cmVS7FlagTable::UserValueRequired }, - { "PrecompiledHeaderFile", "Yu", "Precompiled Header Name", "", - cmVS7FlagTable::UserValueRequired }, - { "PrecompiledHeaderOutputFile", "Fp", "Precompiled Header Output File", "", - cmVS7FlagTable::UserValue }, - { "AssemblerListingLocation", "Fa", "ASM List Location", "", - cmVS7FlagTable::UserValue }, - { "ObjectFileName", "Fo", "Object File Name", "", - cmVS7FlagTable::UserValue }, - { "ProgramDataBaseFileName", "Fd", "Program Database File Name", "", - cmVS7FlagTable::UserValue }, - // Skip [XMLDocumentationFileName] - no command line Switch. - // Skip [BrowseInformationFile] - no command line Switch. - // Skip [AdditionalOptions] - no command line Switch. - { 0, 0, 0, 0, 0 } -}; diff --git a/Source/cmVS11CSharpFlagTable.h b/Source/cmVS11CSharpFlagTable.h deleted file mode 100644 index 18b804a..0000000 --- a/Source/cmVS11CSharpFlagTable.h +++ /dev/null @@ -1,121 +0,0 @@ -static cmVS7FlagTable cmVS11CSharpFlagTable[] = { - { "ProjectName", "out:", "", "", cmIDEFlagTable::UserValueRequired }, - - { "OutputType", "target:exe", "", "Exe", 0 }, - { "OutputType", "target:winexe", "", "Winexe", 0 }, - { "OutputType", "target:library", "", "Library", 0 }, - { "OutputType", "target:module", "", "Module", 0 }, - - { "DocumentationFile", "doc", "", "", cmIDEFlagTable::UserValueRequired }, - - { "Platform", "platform:x86", "", "x86", 0 }, - { "Platform", "platform:Itanium", "", "Itanium", 0 }, - { "Platform", "platform:x64", "", "x64", 0 }, - { "Platform", "platform:arm", "", "arm", 0 }, - { "Platform", "platform:anycpu32bitpreferred", "", "anycpu32bitpreferred", - 0 }, - { "Platform", "platform:anycpu", "", "anycpu", 0 }, - - { "References", "reference:", "mit alias", "", 0 }, - { "References", "reference:", "dateiliste", "", 0 }, - { "AddModules", "addmodule:", "", "", cmIDEFlagTable::SemicolonAppendable }, - { "", "link", "", "", 0 }, - - { "Win32Resource", "win32res:", "", "", cmIDEFlagTable::UserValueRequired }, - { "ApplicationIcon", "win32icon:", "", "", - cmIDEFlagTable::UserValueRequired }, - - { "ApplicationManifest", "win32manifest:", "", "", - cmIDEFlagTable::UserValueRequired }, - - { "NoWin32Manifest", "nowin32manifest", "", "true", 0 }, - - { "DefineDebug", "debug", "", "true", cmIDEFlagTable::Continue }, - - { "DebugSymbols", "debug", "", "true", 0 }, - { "DebugSymbols", "debug-", "", "false", 0 }, - { "DebugSymbols", "debug+", "", "true", 0 }, - - { "DebugType", "debug:none", "", "none", 0 }, - { "DebugType", "debug:full", "", "full", 0 }, - { "DebugType", "debug:pdbonly", "", "pdbonly", 0 }, - - { "Optimize", "optimize", "", "true", 0 }, - { "Optimize", "optimize-", "", "false", 0 }, - { "Optimize", "optimize+", "", "true", 0 }, - - { "TreatWarningsAsErrors", "warnaserror", "", "true", 0 }, - { "TreatWarningsAsErrors", "warnaserror-", "", "false", 0 }, - { "TreatWarningsAsErrors", "warnaserror+", "", "true", 0 }, - - { "WarningsAsErrors", "warnaserror", "", "", 0 }, - { "WarningsAsErrors", "warnaserror-", "", "", 0 }, - { "WarningsAsErrors", "warnaserror+", "", "", 0 }, - - { "WarningLevel", "warn:0", "", "0", 0 }, - { "WarningLevel", "warn:1", "", "1", 0 }, - { "WarningLevel", "warn:2", "", "2", 0 }, - { "WarningLevel", "warn:3", "", "3", 0 }, - { "WarningLevel", "warn:4", "", "4", 0 }, - { "DisabledWarnings", "nowarn", "", "", 0 }, - - { "CheckForOverflowUnderflow", "checked", "", "true", 0 }, - { "CheckForOverflowUnderflow", "checked-", "", "false", 0 }, - { "CheckForOverflowUnderflow", "checked+", "", "true", 0 }, - - { "AllowUnsafeBlocks", "unsafe", "", "true", 0 }, - { "AllowUnsafeBlocks", "unsafe-", "", "false", 0 }, - { "AllowUnsafeBlocks", "unsafe+", "", "true", 0 }, - - { "DefineConstants", "define:", "", "", - cmIDEFlagTable::SemicolonAppendable | cmIDEFlagTable::UserValue }, - - { "LangVersion", "langversion:ISO-1", "", "ISO-1", 0 }, - { "LangVersion", "langversion:ISO-2", "", "ISO-2", 0 }, - { "LangVersion", "langversion:3", "", "3", 0 }, - { "LangVersion", "langversion:4", "", "4", 0 }, - { "LangVersion", "langversion:5", "", "5", 0 }, - { "LangVersion", "langversion:6", "", "6", 0 }, - { "LangVersion", "langversion:default", "", "default", 0 }, - - { "DelaySign", "delaysign", "", "true", 0 }, - { "DelaySign", "delaysign-", "", "false", 0 }, - { "DelaySign", "delaysign+", "", "true", 0 }, - - { "AssemblyOriginatorKeyFile", "keyfile", "", "", 0 }, - - { "KeyContainerName", "keycontainer", "", "", 0 }, - - { "NoLogo", "nologo", "", "", 0 }, - - { "NoConfig", "noconfig", "", "true", 0 }, - - { "BaseAddress", "baseaddress:", "", "", 0 }, - - { "CodePage", "codepage", "", "", 0 }, - - { "Utf8Output", "utf8output", "", "", 0 }, - - { "MainEntryPoint", "main:", "", "", 0 }, - - { "GenerateFullPaths", "fullpaths", "", "true", 0 }, - - { "FileAlignment", "filealign", "", "", 0 }, - - { "PdbFile", "pdb:", "", "", 0 }, - - { "NoStandardLib", "nostdlib", "", "true", 0 }, - { "NoStandardLib", "nostdlib-", "", "false", 0 }, - { "NoStandardLib", "nostdlib+", "", "true", 0 }, - - { "SubsystemVersion", "subsystemversion", "", "", 0 }, - - { "AdditionalLibPaths", "lib:", "", "", 0 }, - - { "ErrorReport", "errorreport:none", "Do Not Send Report", "none", 0 }, - { "ErrorReport", "errorreport:prompt", "Prompt Immediately", "prompt", 0 }, - { "ErrorReport", "errorreport:queue", "Queue For Next Login", "queue", 0 }, - { "ErrorReport", "errorreport:send", "Send Automatically", "send", 0 }, - - { 0, 0, 0, 0, 0 }, -}; diff --git a/Source/cmVS11LibFlagTable.h b/Source/cmVS11LibFlagTable.h deleted file mode 100644 index 15c8ddd..0000000 --- a/Source/cmVS11LibFlagTable.h +++ /dev/null @@ -1,76 +0,0 @@ -static cmVS7FlagTable cmVS11LibFlagTable[] = { - - // Enum Properties - { "ErrorReporting", "ERRORREPORT:PROMPT", "PromptImmediately", - "PromptImmediately", 0 }, - { "ErrorReporting", "ERRORREPORT:QUEUE", "Queue For Next Login", - "QueueForNextLogin", 0 }, - { "ErrorReporting", "ERRORREPORT:SEND", "Send Error Report", - "SendErrorReport", 0 }, - { "ErrorReporting", "ERRORREPORT:NONE", "No Error Report", "NoErrorReport", - 0 }, - - { "TargetMachine", "MACHINE:ARM", "MachineARM", "MachineARM", 0 }, - { "TargetMachine", "MACHINE:EBC", "MachineEBC", "MachineEBC", 0 }, - { "TargetMachine", "MACHINE:IA64", "MachineIA64", "MachineIA64", 0 }, - { "TargetMachine", "MACHINE:MIPS", "MachineMIPS", "MachineMIPS", 0 }, - { "TargetMachine", "MACHINE:MIPS16", "MachineMIPS16", "MachineMIPS16", 0 }, - { "TargetMachine", "MACHINE:MIPSFPU", "MachineMIPSFPU", "MachineMIPSFPU", - 0 }, - { "TargetMachine", "MACHINE:MIPSFPU16", "MachineMIPSFPU16", - "MachineMIPSFPU16", 0 }, - { "TargetMachine", "MACHINE:SH4", "MachineSH4", "MachineSH4", 0 }, - { "TargetMachine", "MACHINE:THUMB", "MachineTHUMB", "MachineTHUMB", 0 }, - { "TargetMachine", "MACHINE:X64", "MachineX64", "MachineX64", 0 }, - { "TargetMachine", "MACHINE:X86", "MachineX86", "MachineX86", 0 }, - - { "SubSystem", "SUBSYSTEM:CONSOLE", "Console", "Console", 0 }, - { "SubSystem", "SUBSYSTEM:WINDOWS", "Windows", "Windows", 0 }, - { "SubSystem", "SUBSYSTEM:NATIVE", "Native", "Native", 0 }, - { "SubSystem", "SUBSYSTEM:EFI_APPLICATION", "EFI Application", - "EFI Application", 0 }, - { "SubSystem", "SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER", - "EFI Boot Service Driver", "EFI Boot Service Driver", 0 }, - { "SubSystem", "SUBSYSTEM:EFI_ROM", "EFI ROM", "EFI ROM", 0 }, - { "SubSystem", "SUBSYSTEM:EFI_RUNTIME_DRIVER", "EFI Runtime", "EFI Runtime", - 0 }, - { "SubSystem", "SUBSYSTEM:WINDOWSCE", "WindowsCE", "WindowsCE", 0 }, - { "SubSystem", "SUBSYSTEM:POSIX", "POSIX", "POSIX", 0 }, - - // Bool Properties - { "SuppressStartupBanner", "NOLOGO", "", "true", 0 }, - { "IgnoreAllDefaultLibraries", "NODEFAULTLIB", "", "true", 0 }, - { "TreatLibWarningAsErrors", "WX:NO", "", "false", 0 }, - { "TreatLibWarningAsErrors", "WX", "", "true", 0 }, - { "Verbose", "VERBOSE", "", "true", 0 }, - { "LinkTimeCodeGeneration", "LTCG", "", "true", 0 }, - - // Bool Properties With Argument - - // String List Properties - // Skip [AdditionalDependencies] - no command line Switch. - { "AdditionalLibraryDirectories", - "LIBPATH:", "Additional Library Directories", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "IgnoreSpecificDefaultLibraries", - "NODEFAULTLIB:", "Ignore Specific Default Libraries", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "ExportNamedFunctions", "EXPORT:", "Export Named Functions", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "RemoveObjects", "REMOVE:", "Remove Objects", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - - // String Properties - { "OutputFile", "OUT:", "Output File", "", cmVS7FlagTable::UserValue }, - { "ModuleDefinitionFile", "DEF:", "Module Definition File Name", "", - cmVS7FlagTable::UserValue }, - { "ForceSymbolReferences", "INCLUDE:", "Force Symbol References", "", - cmVS7FlagTable::UserValue }, - { "DisplayLibrary", "LIST:", "Display Library to standard output", "", - cmVS7FlagTable::UserValue }, - // Skip [MinimumRequiredVersion] - no command line Switch. - { "Name", "NAME:", "Name", "", cmVS7FlagTable::UserValue }, - // Skip [AdditionalOptions] - no command line Switch. - // Skip [TrackerLogDirectory] - no command line Switch. - { 0, 0, 0, 0, 0 } -}; diff --git a/Source/cmVS11LinkFlagTable.h b/Source/cmVS11LinkFlagTable.h deleted file mode 100644 index 53f1139..0000000 --- a/Source/cmVS11LinkFlagTable.h +++ /dev/null @@ -1,272 +0,0 @@ -static cmVS7FlagTable cmVS11LinkFlagTable[] = { - - // Enum Properties - { "ShowProgress", "", "Not Set", "NotSet", 0 }, - { "ShowProgress", "VERBOSE", "Display all progress messages", "LinkVerbose", - 0 }, - { "ShowProgress", "VERBOSE:Lib", "For Libraries Searched", "LinkVerboseLib", - 0 }, - { "ShowProgress", "VERBOSE:ICF", - "About COMDAT folding during optimized linking", "LinkVerboseICF", 0 }, - { "ShowProgress", "VERBOSE:REF", - "About data removed during optimized linking", "LinkVerboseREF", 0 }, - { "ShowProgress", "VERBOSE:SAFESEH", "About Modules incompatible with SEH", - "LinkVerboseSAFESEH", 0 }, - { "ShowProgress", "VERBOSE:CLR", - "About linker activity related to managed code", "LinkVerboseCLR", 0 }, - - { "ForceFileOutput", "FORCE", "Enabled", "Enabled", 0 }, - { "ForceFileOutput", "FORCE:MULTIPLE", "Multiply Defined Symbol Only", - "MultiplyDefinedSymbolOnly", 0 }, - { "ForceFileOutput", "FORCE:UNRESOLVED", "Undefined Symbol Only", - "UndefinedSymbolOnly", 0 }, - - { "CreateHotPatchableImage", "FUNCTIONPADMIN", "Enabled", "Enabled", 0 }, - { "CreateHotPatchableImage", "FUNCTIONPADMIN:5", "X86 Image Only", - "X86Image", 0 }, - { "CreateHotPatchableImage", "FUNCTIONPADMIN:6", "X64 Image Only", - "X64Image", 0 }, - { "CreateHotPatchableImage", "FUNCTIONPADMIN:16", "Itanium Image Only", - "ItaniumImage", 0 }, - - // correct flags for uac should be /MANIFESTUAC, but some projects already - // use this bug to access uac field, so keep these for compatibility - { "UACExecutionLevel", "level='asInvoker'", "asInvoker", "AsInvoker", 0 }, - { "UACExecutionLevel", "level='highestAvailable'", "highestAvailable", - "HighestAvailable", 0 }, - { "UACExecutionLevel", "level='requireAdministrator'", - "requireAdministrator", "RequireAdministrator", 0 }, - - { "SubSystem", "", "Not Set", "NotSet", 0 }, - { "SubSystem", "SUBSYSTEM:CONSOLE", "Console", "Console", 0 }, - { "SubSystem", "SUBSYSTEM:WINDOWS", "Windows", "Windows", 0 }, - { "SubSystem", "SUBSYSTEM:NATIVE", "Native", "Native", 0 }, - { "SubSystem", "SUBSYSTEM:EFI_APPLICATION", "EFI Application", - "EFI Application", 0 }, - { "SubSystem", "SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER", - "EFI Boot Service Driver", "EFI Boot Service Driver", 0 }, - { "SubSystem", "SUBSYSTEM:EFI_ROM", "EFI ROM", "EFI ROM", 0 }, - { "SubSystem", "SUBSYSTEM:EFI_RUNTIME_DRIVER", "EFI Runtime", "EFI Runtime", - 0 }, - { "SubSystem", "SUBSYSTEM:POSIX", "POSIX", "POSIX", 0 }, - - { "Driver", "", "Not Set", "NotSet", 0 }, - { "Driver", "Driver", "Driver", "Driver", 0 }, - { "Driver", "DRIVER:UPONLY", "UP Only", "UpOnly", 0 }, - { "Driver", "DRIVER:WDM", "WDM", "WDM", 0 }, - - { "LinkTimeCodeGeneration", "", "Default", "Default", 0 }, - { "LinkTimeCodeGeneration", "LTCG", "Use Link Time Code Generation", - "UseLinkTimeCodeGeneration", 0 }, - { "LinkTimeCodeGeneration", "LTCG:PGInstrument", - "Profile Guided Optimization - Instrument", "PGInstrument", 0 }, - { "LinkTimeCodeGeneration", "LTCG:PGOptimize", - "Profile Guided Optimization - Optimization", "PGOptimization", 0 }, - { "LinkTimeCodeGeneration", "LTCG:PGUpdate", - "Profile Guided Optimization - Update", "PGUpdate", 0 }, - - { "GenerateWindowsMetadata", "WINMD", "Yes", "true", 0 }, - { "GenerateWindowsMetadata", "WINMD:NO", "No", "false", 0 }, - - { "WindowsMetadataSignHash", "WINMDSIGNHASH:SHA1", "SHA1", "SHA1", 0 }, - { "WindowsMetadataSignHash", "WINMDSIGNHASH:SHA256", "SHA256", "SHA256", 0 }, - { "WindowsMetadataSignHash", "WINMDSIGNHASH:SHA384", "SHA384", "SHA384", 0 }, - { "WindowsMetadataSignHash", "WINMDSIGNHASH:SHA512", "SHA512", "SHA512", 0 }, - - { "TargetMachine", "", "Not Set", "NotSet", 0 }, - { "TargetMachine", "MACHINE:ARM", "MachineARM", "MachineARM", 0 }, - { "TargetMachine", "MACHINE:EBC", "MachineEBC", "MachineEBC", 0 }, - { "TargetMachine", "MACHINE:IA64", "MachineIA64", "MachineIA64", 0 }, - { "TargetMachine", "MACHINE:MIPS", "MachineMIPS", "MachineMIPS", 0 }, - { "TargetMachine", "MACHINE:MIPS16", "MachineMIPS16", "MachineMIPS16", 0 }, - { "TargetMachine", "MACHINE:MIPSFPU", "MachineMIPSFPU", "MachineMIPSFPU", - 0 }, - { "TargetMachine", "MACHINE:MIPSFPU16", "MachineMIPSFPU16", - "MachineMIPSFPU16", 0 }, - { "TargetMachine", "MACHINE:SH4", "MachineSH4", "MachineSH4", 0 }, - { "TargetMachine", "MACHINE:THUMB", "MachineTHUMB", "MachineTHUMB", 0 }, - { "TargetMachine", "MACHINE:X64", "MachineX64", "MachineX64", 0 }, - { "TargetMachine", "MACHINE:X86", "MachineX86", "MachineX86", 0 }, - - { "CLRThreadAttribute", "CLRTHREADATTRIBUTE:MTA", "MTA threading attribute", - "MTAThreadingAttribute", 0 }, - { "CLRThreadAttribute", "CLRTHREADATTRIBUTE:STA", "STA threading attribute", - "STAThreadingAttribute", 0 }, - { "CLRThreadAttribute", "CLRTHREADATTRIBUTE:NONE", - "Default threading attribute", "DefaultThreadingAttribute", 0 }, - - { "CLRImageType", "CLRIMAGETYPE:IJW", "Force IJW image", "ForceIJWImage", - 0 }, - { "CLRImageType", "CLRIMAGETYPE:PURE", "Force Pure IL Image", - "ForcePureILImage", 0 }, - { "CLRImageType", "CLRIMAGETYPE:SAFE", "Force Safe IL Image", - "ForceSafeILImage", 0 }, - { "CLRImageType", "", "Default image type", "Default", 0 }, - - { "SignHash", "CLRSIGNHASH:SHA1", "SHA1", "SHA1", 0 }, - { "SignHash", "CLRSIGNHASH:SHA256", "SHA256", "SHA256", 0 }, - { "SignHash", "CLRSIGNHASH:SHA384", "SHA384", "SHA384", 0 }, - { "SignHash", "CLRSIGNHASH:SHA512", "SHA512", "SHA512", 0 }, - - { "LinkErrorReporting", "ERRORREPORT:PROMPT", "PromptImmediately", - "PromptImmediately", 0 }, - { "LinkErrorReporting", "ERRORREPORT:QUEUE", "Queue For Next Login", - "QueueForNextLogin", 0 }, - { "LinkErrorReporting", "ERRORREPORT:SEND", "Send Error Report", - "SendErrorReport", 0 }, - { "LinkErrorReporting", "ERRORREPORT:NONE", "No Error Report", - "NoErrorReport", 0 }, - - { "CLRSupportLastError", "CLRSupportLastError", "Enabled", "Enabled", 0 }, - { "CLRSupportLastError", "CLRSupportLastError:NO", "Disabled", "Disabled", - 0 }, - { "CLRSupportLastError", "CLRSupportLastError:SYSTEMDLL", "System Dlls Only", - "SystemDlls", 0 }, - - // Bool Properties - { "LinkIncremental", "INCREMENTAL:NO", "", "false", 0 }, - { "LinkIncremental", "INCREMENTAL", "", "true", 0 }, - { "SuppressStartupBanner", "NOLOGO", "", "true", 0 }, - { "LinkStatus", "LTCG:NOSTATUS", "", "false", 0 }, - { "LinkStatus", "LTCG:STATUS", "", "true", 0 }, - { "PreventDllBinding", "ALLOWBIND:NO", "", "false", 0 }, - { "PreventDllBinding", "ALLOWBIND", "", "true", 0 }, - { "TreatLinkerWarningAsErrors", "WX:NO", "", "false", 0 }, - { "TreatLinkerWarningAsErrors", "WX", "", "true", 0 }, - { "IgnoreAllDefaultLibraries", "NODEFAULTLIB", "", "true", 0 }, - { "GenerateManifest", "MANIFEST:NO", "", "false", 0 }, - { "GenerateManifest", "MANIFEST", "", "true", 0 }, - { "AllowIsolation", "ALLOWISOLATION:NO", "", "false", 0 }, - - // correct flags for uac should be /MANIFESTUAC, but some projects already - // use this bug to access uac field, so keep these for compatibility - { "UACUIAccess", "uiAccess='false'", "", "false", 0 }, - { "UACUIAccess", "uiAccess='true'", "", "true", 0 }, - - { "ManifestEmbed", "manifest:embed", "", "true", 0 }, - { "GenerateDebugInformation", "DEBUG", "", "true", - cmVS7FlagTable::CaseInsensitive }, - { "MapExports", "MAPINFO:EXPORTS", "", "true", 0 }, - { "AssemblyDebug", "ASSEMBLYDEBUG:DISABLE", "", "false", 0 }, - { "AssemblyDebug", "ASSEMBLYDEBUG", "", "true", 0 }, - { "LargeAddressAware", "LARGEADDRESSAWARE:NO", "", "false", 0 }, - { "LargeAddressAware", "LARGEADDRESSAWARE", "", "true", 0 }, - { "TerminalServerAware", "TSAWARE:NO", "", "false", 0 }, - { "TerminalServerAware", "TSAWARE", "", "true", 0 }, - { "SwapRunFromCD", "SWAPRUN:CD", "", "true", 0 }, - { "SwapRunFromNET", "SWAPRUN:NET", "", "true", 0 }, - { "OptimizeReferences", "OPT:NOREF", "", "false", 0 }, - { "OptimizeReferences", "OPT:REF", "", "true", 0 }, - { "EnableCOMDATFolding", "OPT:NOICF", "", "false", 0 }, - { "EnableCOMDATFolding", "OPT:ICF", "", "true", 0 }, - { "IgnoreEmbeddedIDL", "IGNOREIDL", "", "true", 0 }, - { "AppContainer", "APPCONTAINER", "", "true", 0 }, - { "WindowsMetadataLinkDelaySign", "WINMDDELAYSIGN:NO", "", "false", 0 }, - { "WindowsMetadataLinkDelaySign", "WINMDDELAYSIGN", "", "true", 0 }, - { "NoEntryPoint", "NOENTRY", "", "true", 0 }, - { "SetChecksum", "RELEASE", "", "true", 0 }, - { "RandomizedBaseAddress", "DYNAMICBASE:NO", "", "false", 0 }, - { "RandomizedBaseAddress", "DYNAMICBASE", "", "true", 0 }, - { "FixedBaseAddress", "FIXED:NO", "", "false", 0 }, - { "FixedBaseAddress", "FIXED", "", "true", 0 }, - { "DataExecutionPrevention", "NXCOMPAT:NO", "", "false", 0 }, - { "DataExecutionPrevention", "NXCOMPAT", "", "true", 0 }, - { "TurnOffAssemblyGeneration", "NOASSEMBLY", "", "true", 0 }, - { "SupportUnloadOfDelayLoadedDLL", "DELAY:UNLOAD", "", "true", 0 }, - { "SupportNobindOfDelayLoadedDLL", "DELAY:NOBIND", "", "true", 0 }, - { "Profile", "PROFILE", "", "true", 0 }, - { "LinkDelaySign", "DELAYSIGN:NO", "", "false", 0 }, - { "LinkDelaySign", "DELAYSIGN", "", "true", 0 }, - { "CLRUnmanagedCodeCheck", "CLRUNMANAGEDCODECHECK:NO", "", "false", 0 }, - { "CLRUnmanagedCodeCheck", "CLRUNMANAGEDCODECHECK", "", "true", 0 }, - { "DetectOneDefinitionRule", "ODR", "", "true", 0 }, - { "ImageHasSafeExceptionHandlers", "SAFESEH:NO", "", "false", 0 }, - { "ImageHasSafeExceptionHandlers", "SAFESEH", "", "true", 0 }, - { "LinkDLL", "DLL", "", "true", 0 }, - - // Bool Properties With Argument - { "EnableUAC", "MANIFESTUAC:", "", "", - cmVS7FlagTable::UserValueRequired | cmVS7FlagTable::SpaceAppendable }, - { "GenerateMapFile", "MAP", "", "true", - cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue }, - { "MapFileName", "MAP:", "Generate Map File", "", - cmVS7FlagTable::UserValueRequired }, - - // String List Properties - { "AdditionalLibraryDirectories", - "LIBPATH:", "Additional Library Directories", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - // Skip [AdditionalDependencies] - no command line Switch. - { "IgnoreSpecificDefaultLibraries", - "NODEFAULTLIB:", "Ignore Specific Default Libraries", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "AddModuleNamesToAssembly", "ASSEMBLYMODULE:", "Add Module to Assembly", - "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "EmbedManagedResourceFile", - "ASSEMBLYRESOURCE:", "Embed Managed Resource File", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "ForceSymbolReferences", "INCLUDE:", "Force Symbol References", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "DelayLoadDLLs", "DELAYLOAD:", "Delay Loaded Dlls", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "AssemblyLinkResource", "ASSEMBLYLINKRESOURCE:", "Assembly Link Resource", - "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "AdditionalManifestDependencies", - "MANIFESTDEPENDENCY:", "Additional Manifest Dependencies", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "ManifestInput", "manifestinput:", "Manifest Input", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - - // String Properties - { "OutputFile", "OUT:", "Output File", "", cmVS7FlagTable::UserValue }, - { "Version", "VERSION:", "Version", "", cmVS7FlagTable::UserValue }, - { "SpecifySectionAttributes", "SECTION:", "Specify Section Attributes", "", - cmVS7FlagTable::UserValue }, - { "MSDOSStubFileName", "STUB:", "MS-DOS Stub File Name", "", - cmVS7FlagTable::UserValue }, - // Skip [TrackerLogDirectory] - no command line Switch. - { "ModuleDefinitionFile", "DEF:", "Module Definition File", "", - cmVS7FlagTable::UserValue }, - { "ManifestFile", "ManifestFile:", "Manifest File", "", - cmVS7FlagTable::UserValue }, - { "ProgramDatabaseFile", "PDB:", "Generate Program Database File", "", - cmVS7FlagTable::UserValue }, - { "StripPrivateSymbols", "PDBSTRIPPED:", "Strip Private Symbols", "", - cmVS7FlagTable::UserValue }, - // Skip [MapFileName] - no command line Switch. - // Skip [MinimumRequiredVersion] - no command line Switch. - { "HeapReserveSize", "HEAP:", "Heap Reserve Size", "", - cmVS7FlagTable::UserValue }, - // Skip [HeapCommitSize] - no command line Switch. - { "StackReserveSize", "STACK:", "Stack Reserve Size", "", - cmVS7FlagTable::UserValue }, - // Skip [StackCommitSize] - no command line Switch. - { "FunctionOrder", "ORDER:@", "Function Order", "", - cmVS7FlagTable::UserValue }, - { "ProfileGuidedDatabase", "PGD:", "Profile Guided Database", "", - cmVS7FlagTable::UserValue }, - { "MidlCommandFile", "MIDL:@", "MIDL Commands", "", - cmVS7FlagTable::UserValue }, - { "MergedIDLBaseFileName", "IDLOUT:", "Merged IDL Base File Name", "", - cmVS7FlagTable::UserValue }, - { "TypeLibraryFile", "TLBOUT:", "Type Library", "", - cmVS7FlagTable::UserValue }, - { "WindowsMetadataFile", "WINMDFILE:", "Windows Metadata File", "", - cmVS7FlagTable::UserValue }, - { "WindowsMetadataLinkKeyFile", "WINMDKEYFILE:", "Windows Metadata Key File", - "", cmVS7FlagTable::UserValue }, - { "WindowsMetadataKeyContainer", "WINMDKEYCONTAINER:", - "Windows Metadata Key Container", "", cmVS7FlagTable::UserValue }, - { "EntryPointSymbol", "ENTRY:", "Entry Point", "", - cmVS7FlagTable::UserValue }, - { "BaseAddress", "BASE:", "Base Address", "", cmVS7FlagTable::UserValue }, - { "ImportLibrary", "IMPLIB:", "Import Library", "", - cmVS7FlagTable::UserValue }, - { "MergeSections", "MERGE:", "Merge Sections", "", - cmVS7FlagTable::UserValue }, - { "LinkKeyFile", "KEYFILE:", "Key File", "", cmVS7FlagTable::UserValue }, - { "KeyContainer", "KEYCONTAINER:", "Key Container", "", - cmVS7FlagTable::UserValue }, - // Skip [AdditionalOptions] - no command line Switch. - { 0, 0, 0, 0, 0 } -}; diff --git a/Source/cmVS11MASMFlagTable.h b/Source/cmVS11MASMFlagTable.h deleted file mode 100644 index fdf8239..0000000 --- a/Source/cmVS11MASMFlagTable.h +++ /dev/null @@ -1,76 +0,0 @@ -static cmVS7FlagTable cmVS11MASMFlagTable[] = { - - // Enum Properties - { "PreserveIdentifierCase", "", "Default", "0", 0 }, - { "PreserveIdentifierCase", "Cp", "Preserves Identifier Case (/Cp)", "1", - 0 }, - { "PreserveIdentifierCase", "Cu", - "Maps all identifiers to upper case. (/Cu)", "2", 0 }, - { "PreserveIdentifierCase", "Cx", - "Preserves case in public and extern symbols. (/Cx)", "3", 0 }, - - { "WarningLevel", "W0", "Warning Level 0 (/W0)", "0", 0 }, - { "WarningLevel", "W1", "Warning Level 1 (/W1)", "1", 0 }, - { "WarningLevel", "W2", "Warning Level 2 (/W2)", "2", 0 }, - { "WarningLevel", "W3", "Warning Level 3 (/W3)", "3", 0 }, - - { "PackAlignmentBoundary", "", "Default", "0", 0 }, - { "PackAlignmentBoundary", "Zp1", "One Byte Boundary (/Zp1)", "1", 0 }, - { "PackAlignmentBoundary", "Zp2", "Two Byte Boundary (/Zp2)", "2", 0 }, - { "PackAlignmentBoundary", "Zp4", "Four Byte Boundary (/Zp4)", "3", 0 }, - { "PackAlignmentBoundary", "Zp8", "Eight Byte Boundary (/Zp8)", "4", 0 }, - { "PackAlignmentBoundary", "Zp16", "Sixteen Byte Boundary (/Zp16)", "5", 0 }, - - { "CallingConvention", "", "Default", "0", 0 }, - { "CallingConvention", "Gd", "Use C-style Calling Convention (/Gd)", "1", - 0 }, - { "CallingConvention", "Gz", "Use stdcall Calling Convention (/Gz)", "2", - 0 }, - { "CallingConvention", "Gc", "Use Pascal Calling Convention (/Gc)", "3", 0 }, - - { "ErrorReporting", "errorReport:prompt", - "Prompt to send report immediately (/errorReport:prompt)", "0", 0 }, - { "ErrorReporting", "errorReport:queue", - "Prompt to send report at the next logon (/errorReport:queue)", "1", 0 }, - { "ErrorReporting", "errorReport:send", - "Automatically send report (/errorReport:send)", "2", 0 }, - { "ErrorReporting", "errorReport:none", - "Do not send report (/errorReport:none)", "3", 0 }, - - // Bool Properties - { "NoLogo", "nologo", "", "true", 0 }, - { "GeneratePreprocessedSourceListing", "EP", "", "true", 0 }, - { "ListAllAvailableInformation", "Sa", "", "true", 0 }, - { "UseSafeExceptionHandlers", "safeseh", "", "true", 0 }, - { "AddFirstPassListing", "Sf", "", "true", 0 }, - { "EnableAssemblyGeneratedCodeListing", "Sg", "", "true", 0 }, - { "DisableSymbolTable", "Sn", "", "true", 0 }, - { "EnableFalseConditionalsInListing", "Sx", "", "true", 0 }, - { "TreatWarningsAsErrors", "WX", "", "true", 0 }, - { "MakeAllSymbolsPublic", "Zf", "", "true", 0 }, - { "GenerateDebugInformation", "Zi", "", "true", 0 }, - { "EnableMASM51Compatibility", "Zm", "", "true", 0 }, - { "PerformSyntaxCheckOnly", "Zs", "", "true", 0 }, - - // Bool Properties With Argument - - // String List Properties - { "PreprocessorDefinitions", "D", "Preprocessor Definitions", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "IncludePaths", "I", "Include Paths", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "BrowseFile", "FR", "Generate Browse Information File", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - // Skip [AdditionalDependencies] - no command line Switch. - - // String Properties - // Skip [Inputs] - no command line Switch. - { "ObjectFileName", "Fo", "Object File Name", "", - cmVS7FlagTable::UserValue }, - { "AssembledCodeListingFile", "Fl", "Assembled Code Listing File", "", - cmVS7FlagTable::UserValue }, - // Skip [CommandLineTemplate] - no command line Switch. - // Skip [ExecutionDescription] - no command line Switch. - // Skip [AdditionalOptions] - no command line Switch. - { 0, 0, 0, 0, 0 } -}; diff --git a/Source/cmVS11RCFlagTable.h b/Source/cmVS11RCFlagTable.h deleted file mode 100644 index 4997fe1..0000000 --- a/Source/cmVS11RCFlagTable.h +++ /dev/null @@ -1,7 +0,0 @@ -static cmVS7FlagTable cmVS11RCFlagTable[] = { - // Bool Properties - { "NullTerminateStrings", "n", "", "true", 0 }, - { "SuppressStartupBanner", "nologo", "", "true", 0 }, - - { 0, 0, 0, 0, 0 } -}; diff --git a/Source/cmVS12CLFlagTable.h b/Source/cmVS12CLFlagTable.h deleted file mode 100644 index a4f2518..0000000 --- a/Source/cmVS12CLFlagTable.h +++ /dev/null @@ -1,222 +0,0 @@ -static cmVS7FlagTable cmVS12CLFlagTable[] = { - - // Enum Properties - { "DebugInformationFormat", "", "None", "None", 0 }, - { "DebugInformationFormat", "Z7", "C7 compatible", "OldStyle", 0 }, - { "DebugInformationFormat", "Zi", "Program Database", "ProgramDatabase", 0 }, - { "DebugInformationFormat", "ZI", "Program Database for Edit And Continue", - "EditAndContinue", 0 }, - - { "WarningLevel", "W0", "Turn Off All Warnings", "TurnOffAllWarnings", 0 }, - { "WarningLevel", "W1", "Level1", "Level1", 0 }, - { "WarningLevel", "W2", "Level2", "Level2", 0 }, - { "WarningLevel", "W3", "Level3", "Level3", 0 }, - { "WarningLevel", "W4", "Level4", "Level4", 0 }, - { "WarningLevel", "Wall", "EnableAllWarnings", "EnableAllWarnings", 0 }, - - { "Optimization", "", "Custom", "Custom", 0 }, - { "Optimization", "Od", "Disabled", "Disabled", 0 }, - { "Optimization", "O1", "Minimize Size", "MinSpace", 0 }, - { "Optimization", "O2", "Maximize Speed", "MaxSpeed", 0 }, - { "Optimization", "Ox", "Full Optimization", "Full", 0 }, - - { "InlineFunctionExpansion", "", "Default", "Default", 0 }, - { "InlineFunctionExpansion", "Ob0", "Disabled", "Disabled", 0 }, - { "InlineFunctionExpansion", "Ob1", "Only __inline", "OnlyExplicitInline", - 0 }, - { "InlineFunctionExpansion", "Ob2", "Any Suitable", "AnySuitable", 0 }, - - { "FavorSizeOrSpeed", "Os", "Favor small code", "Size", 0 }, - { "FavorSizeOrSpeed", "Ot", "Favor fast code", "Speed", 0 }, - { "FavorSizeOrSpeed", "", "Neither", "Neither", 0 }, - - { "ExceptionHandling", "EHa", "Yes with SEH Exceptions", "Async", 0 }, - { "ExceptionHandling", "EHsc", "Yes", "Sync", 0 }, - { "ExceptionHandling", "EHs", "Yes with Extern C functions", "SyncCThrow", - 0 }, - { "ExceptionHandling", "", "No", "false", 0 }, - - { "BasicRuntimeChecks", "RTCs", "Stack Frames", "StackFrameRuntimeCheck", - 0 }, - { "BasicRuntimeChecks", "RTCu", "Uninitialized variables", - "UninitializedLocalUsageCheck", 0 }, - { "BasicRuntimeChecks", "RTC1", "Both (/RTC1, equiv. to /RTCsu)", - "EnableFastChecks", 0 }, - { "BasicRuntimeChecks", "", "Default", "Default", 0 }, - - { "RuntimeLibrary", "MT", "Multi-threaded", "MultiThreaded", 0 }, - { "RuntimeLibrary", "MTd", "Multi-threaded Debug", "MultiThreadedDebug", 0 }, - { "RuntimeLibrary", "MD", "Multi-threaded DLL", "MultiThreadedDLL", 0 }, - { "RuntimeLibrary", "MDd", "Multi-threaded Debug DLL", - "MultiThreadedDebugDLL", 0 }, - - { "StructMemberAlignment", "Zp1", "1 Byte", "1Byte", 0 }, - { "StructMemberAlignment", "Zp2", "2 Bytes", "2Bytes", 0 }, - { "StructMemberAlignment", "Zp4", "4 Byte", "4Bytes", 0 }, - { "StructMemberAlignment", "Zp8", "8 Bytes", "8Bytes", 0 }, - { "StructMemberAlignment", "Zp16", "16 Bytes", "16Bytes", 0 }, - { "StructMemberAlignment", "", "Default", "Default", 0 }, - - { "BufferSecurityCheck", "GS-", "Disable Security Check", "false", 0 }, - { "BufferSecurityCheck", "GS", "Enable Security Check", "true", 0 }, - - { "EnableEnhancedInstructionSet", "arch:SSE", "Streaming SIMD Extensions", - "StreamingSIMDExtensions", 0 }, - { "EnableEnhancedInstructionSet", "arch:SSE2", "Streaming SIMD Extensions 2", - "StreamingSIMDExtensions2", 0 }, - { "EnableEnhancedInstructionSet", "arch:AVX", "Advanced Vector Extensions", - "AdvancedVectorExtensions", 0 }, - { "EnableEnhancedInstructionSet", "arch:IA32", "No Enhanced Instructions", - "NoExtensions", 0 }, - { "EnableEnhancedInstructionSet", "", "Not Set", "NotSet", 0 }, - - { "FloatingPointModel", "fp:precise", "Precise", "Precise", 0 }, - { "FloatingPointModel", "fp:strict", "Strict", "Strict", 0 }, - { "FloatingPointModel", "fp:fast", "Fast", "Fast", 0 }, - - { "PrecompiledHeader", "Yc", "Create", "Create", - cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue }, - { "PrecompiledHeader", "Yu", "Use", "Use", - cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue }, - { "PrecompiledHeader", "Y-", "Not Using Precompiled Headers", "NotUsing", - 0 }, - - { "AssemblerOutput", "", "No Listing", "NoListing", 0 }, - { "AssemblerOutput", "FA", "Assembly-Only Listing", "AssemblyCode", 0 }, - { "AssemblerOutput", "FAc", "Assembly With Machine Code", - "AssemblyAndMachineCode", 0 }, - { "AssemblerOutput", "FAs", "Assembly With Source Code", - "AssemblyAndSourceCode", 0 }, - { "AssemblerOutput", "FAcs", "Assembly, Machine Code and Source", "All", 0 }, - - { "CallingConvention", "Gd", "__cdecl", "Cdecl", 0 }, - { "CallingConvention", "Gr", "__fastcall", "FastCall", 0 }, - { "CallingConvention", "Gz", "__stdcall", "StdCall", 0 }, - { "CallingConvention", "Gv", "__vectorcall", "VectorCall", 0 }, - - { "CompileAs", "", "Default", "Default", 0 }, - { "CompileAs", "TC", "Compile as C Code", "CompileAsC", 0 }, - { "CompileAs", "TP", "Compile as C++ Code", "CompileAsCpp", 0 }, - - { "ErrorReporting", "errorReport:none", "Do Not Send Report", "None", 0 }, - { "ErrorReporting", "errorReport:prompt", "Prompt Immediately", "Prompt", - 0 }, - { "ErrorReporting", "errorReport:queue", "Queue For Next Login", "Queue", - 0 }, - { "ErrorReporting", "errorReport:send", "Send Automatically", "Send", 0 }, - - { "CompileAsManaged", "", "No Common Language RunTime Support", "false", 0 }, - { "CompileAsManaged", "clr", "Common Language RunTime Support", "true", 0 }, - { "CompileAsManaged", "clr:pure", - "Pure MSIL Common Language RunTime Support", "Pure", 0 }, - { "CompileAsManaged", "clr:safe", - "Safe MSIL Common Language RunTime Support", "Safe", 0 }, - { "CompileAsManaged", "clr:oldSyntax", - "Common Language RunTime Support, Old Syntax", "OldSyntax", 0 }, - - // Bool Properties - { "CompileAsWinRT", "ZW", "", "true", 0 }, - { "WinRTNoStdLib", "ZW:nostdlib", "", "true", 0 }, - { "SuppressStartupBanner", "nologo", "", "true", 0 }, - { "TreatWarningAsError", "WX-", "", "false", 0 }, - { "TreatWarningAsError", "WX", "", "true", 0 }, - { "SDLCheck", "sdl-", "", "false", 0 }, - { "SDLCheck", "sdl", "", "true", 0 }, - { "IntrinsicFunctions", "Oi", "", "true", 0 }, - { "OmitFramePointers", "Oy-", "", "false", 0 }, - { "OmitFramePointers", "Oy", "", "true", 0 }, - { "EnableFiberSafeOptimizations", "GT", "", "true", 0 }, - { "WholeProgramOptimization", "GL", "", "true", 0 }, - { "UndefineAllPreprocessorDefinitions", "u", "", "true", 0 }, - { "IgnoreStandardIncludePath", "X", "", "true", 0 }, - { "PreprocessToFile", "P", "", "true", 0 }, - { "PreprocessSuppressLineNumbers", "EP", "", "true", 0 }, - { "PreprocessKeepComments", "C", "", "true", 0 }, - { "StringPooling", "GF-", "", "false", 0 }, - { "StringPooling", "GF", "", "true", 0 }, - { "MinimalRebuild", "Gm-", "", "false", 0 }, - { "MinimalRebuild", "Gm", "", "true", 0 }, - { "SmallerTypeCheck", "RTCc", "", "true", 0 }, - { "FunctionLevelLinking", "Gy-", "", "false", 0 }, - { "FunctionLevelLinking", "Gy", "", "true", 0 }, - { "EnableParallelCodeGeneration", "Qpar-", "", "false", 0 }, - { "EnableParallelCodeGeneration", "Qpar", "", "true", 0 }, - { "FloatingPointExceptions", "fp:except-", "", "false", 0 }, - { "FloatingPointExceptions", "fp:except", "", "true", 0 }, - { "CreateHotpatchableImage", "hotpatch", "", "true", 0 }, - { "DisableLanguageExtensions", "Za", "", "true", 0 }, - { "TreatWChar_tAsBuiltInType", "Zc:wchar_t-", "", "false", 0 }, - { "TreatWChar_tAsBuiltInType", "Zc:wchar_t", "", "true", 0 }, - { "ForceConformanceInForLoopScope", "Zc:forScope-", "", "false", 0 }, - { "ForceConformanceInForLoopScope", "Zc:forScope", "", "true", 0 }, - { "RuntimeTypeInfo", "GR-", "", "false", 0 }, - { "RuntimeTypeInfo", "GR", "", "true", 0 }, - { "OpenMPSupport", "openmp-", "", "false", 0 }, - { "OpenMPSupport", "openmp", "", "true", 0 }, - { "ExpandAttributedSource", "Fx", "", "true", 0 }, - { "UseUnicodeForAssemblerListing", "FAu", "", "true", 0 }, - { "ShowIncludes", "showIncludes", "", "true", 0 }, - { "EnablePREfast", "analyze-", "", "false", 0 }, - { "EnablePREfast", "analyze", "", "true", 0 }, - { "UseFullPaths", "FC", "", "true", 0 }, - { "OmitDefaultLibName", "Zl", "", "true", 0 }, - - // Bool Properties With Argument - { "MultiProcessorCompilation", "MP", "", "true", - cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue }, - { "ProcessorNumber", "MP", "Multi-processor Compilation", "", - cmVS7FlagTable::UserValueRequired }, - { "GenerateXMLDocumentationFiles", "doc", "", "true", - cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue }, - { "XMLDocumentationFileName", "doc", "Generate XML Documentation Files", "", - cmVS7FlagTable::UserValueRequired }, - { "BrowseInformation", "FR", "", "true", - cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue }, - { "BrowseInformationFile", "FR", "Enable Browse Information", "", - cmVS7FlagTable::UserValueRequired }, - - // String List Properties - { "AdditionalIncludeDirectories", "I", "Additional Include Directories", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "AdditionalUsingDirectories", "AI", "Additional #using Directories", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "PreprocessorDefinitions", "D ", "Preprocessor Definitions", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "UndefinePreprocessorDefinitions", "U", - "Undefine Preprocessor Definitions", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "DisableSpecificWarnings", "wd", "Disable Specific Warnings", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "ForcedIncludeFiles", "FI", "Forced Include File", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "ForcedUsingFiles", "FU", "Forced #using File", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "PREfastLog", "analyze:log", "Code Analysis Log", "", - cmVS7FlagTable::UserFollowing }, - { "PREfastAdditionalPlugins", "analyze:plugin", - "Additional Code Analysis Native plugins", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "TreatSpecificWarningsAsErrors", "we", "Treat Specific Warnings As Errors", - "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - - // String Properties - // Skip [TrackerLogDirectory] - no command line Switch. - { "PreprocessOutputPath", "Fi", "Preprocess Output Path", "", - cmVS7FlagTable::UserValue }, - { "PrecompiledHeaderFile", "Yc", "Precompiled Header Name", "", - cmVS7FlagTable::UserValueRequired }, - { "PrecompiledHeaderFile", "Yu", "Precompiled Header Name", "", - cmVS7FlagTable::UserValueRequired }, - { "PrecompiledHeaderOutputFile", "Fp", "Precompiled Header Output File", "", - cmVS7FlagTable::UserValue }, - { "AssemblerListingLocation", "Fa", "ASM List Location", "", - cmVS7FlagTable::UserValue }, - { "ObjectFileName", "Fo", "Object File Name", "", - cmVS7FlagTable::UserValue }, - { "ProgramDataBaseFileName", "Fd", "Program Database File Name", "", - cmVS7FlagTable::UserValue }, - // Skip [XMLDocumentationFileName] - no command line Switch. - // Skip [BrowseInformationFile] - no command line Switch. - // Skip [AdditionalOptions] - no command line Switch. - { 0, 0, 0, 0, 0 } -}; diff --git a/Source/cmVS12CSharpFlagTable.h b/Source/cmVS12CSharpFlagTable.h deleted file mode 100644 index 0370499..0000000 --- a/Source/cmVS12CSharpFlagTable.h +++ /dev/null @@ -1,121 +0,0 @@ -static cmVS7FlagTable cmVS12CSharpFlagTable[] = { - { "ProjectName", "out:", "", "", cmIDEFlagTable::UserValueRequired }, - - { "OutputType", "target:exe", "", "Exe", 0 }, - { "OutputType", "target:winexe", "", "Winexe", 0 }, - { "OutputType", "target:library", "", "Library", 0 }, - { "OutputType", "target:module", "", "Module", 0 }, - - { "DocumentationFile", "doc", "", "", cmIDEFlagTable::UserValueRequired }, - - { "Platform", "platform:x86", "", "x86", 0 }, - { "Platform", "platform:Itanium", "", "Itanium", 0 }, - { "Platform", "platform:x64", "", "x64", 0 }, - { "Platform", "platform:arm", "", "arm", 0 }, - { "Platform", "platform:anycpu32bitpreferred", "", "anycpu32bitpreferred", - 0 }, - { "Platform", "platform:anycpu", "", "anycpu", 0 }, - - { "References", "reference:", "mit alias", "", 0 }, - { "References", "reference:", "dateiliste", "", 0 }, - { "AddModules", "addmodule:", "", "", cmIDEFlagTable::SemicolonAppendable }, - { "", "link", "", "", 0 }, - - { "Win32Resource", "win32res:", "", "", cmIDEFlagTable::UserValueRequired }, - { "ApplicationIcon", "win32icon:", "", "", - cmIDEFlagTable::UserValueRequired }, - - { "ApplicationManifest", "win32manifest:", "", "", - cmIDEFlagTable::UserValueRequired }, - - { "NoWin32Manifest", "nowin32manifest", "", "true", 0 }, - - { "DefineDebug", "debug", "", "true", cmIDEFlagTable::Continue }, - - { "DebugSymbols", "debug", "", "true", 0 }, - { "DebugSymbols", "debug-", "", "false", 0 }, - { "DebugSymbols", "debug+", "", "true", 0 }, - - { "DebugType", "debug:none", "", "none", 0 }, - { "DebugType", "debug:full", "", "full", 0 }, - { "DebugType", "debug:pdbonly", "", "pdbonly", 0 }, - - { "Optimize", "optimize", "", "true", 0 }, - { "Optimize", "optimize-", "", "false", 0 }, - { "Optimize", "optimize+", "", "true", 0 }, - - { "TreatWarningsAsErrors", "warnaserror", "", "true", 0 }, - { "TreatWarningsAsErrors", "warnaserror-", "", "false", 0 }, - { "TreatWarningsAsErrors", "warnaserror+", "", "true", 0 }, - - { "WarningsAsErrors", "warnaserror", "", "", 0 }, - { "WarningsAsErrors", "warnaserror-", "", "", 0 }, - { "WarningsAsErrors", "warnaserror+", "", "", 0 }, - - { "WarningLevel", "warn:0", "", "0", 0 }, - { "WarningLevel", "warn:1", "", "1", 0 }, - { "WarningLevel", "warn:2", "", "2", 0 }, - { "WarningLevel", "warn:3", "", "3", 0 }, - { "WarningLevel", "warn:4", "", "4", 0 }, - { "DisabledWarnings", "nowarn", "", "", 0 }, - - { "CheckForOverflowUnderflow", "checked", "", "true", 0 }, - { "CheckForOverflowUnderflow", "checked-", "", "false", 0 }, - { "CheckForOverflowUnderflow", "checked+", "", "true", 0 }, - - { "AllowUnsafeBlocks", "unsafe", "", "true", 0 }, - { "AllowUnsafeBlocks", "unsafe-", "", "false", 0 }, - { "AllowUnsafeBlocks", "unsafe+", "", "true", 0 }, - - { "DefineConstants", "define:", "", "", - cmIDEFlagTable::SemicolonAppendable | cmIDEFlagTable::UserValue }, - - { "LangVersion", "langversion:ISO-1", "", "ISO-1", 0 }, - { "LangVersion", "langversion:ISO-2", "", "ISO-2", 0 }, - { "LangVersion", "langversion:3", "", "3", 0 }, - { "LangVersion", "langversion:4", "", "4", 0 }, - { "LangVersion", "langversion:5", "", "5", 0 }, - { "LangVersion", "langversion:6", "", "6", 0 }, - { "LangVersion", "langversion:default", "", "default", 0 }, - - { "DelaySign", "delaysign", "", "true", 0 }, - { "DelaySign", "delaysign-", "", "false", 0 }, - { "DelaySign", "delaysign+", "", "true", 0 }, - - { "AssemblyOriginatorKeyFile", "keyfile", "", "", 0 }, - - { "KeyContainerName", "keycontainer", "", "", 0 }, - - { "NoLogo", "nologo", "", "", 0 }, - - { "NoConfig", "noconfig", "", "true", 0 }, - - { "BaseAddress", "baseaddress:", "", "", 0 }, - - { "CodePage", "codepage", "", "", 0 }, - - { "Utf8Output", "utf8output", "", "", 0 }, - - { "MainEntryPoint", "main:", "", "", 0 }, - - { "GenerateFullPaths", "fullpaths", "", "true", 0 }, - - { "FileAlignment", "filealign", "", "", 0 }, - - { "PdbFile", "pdb:", "", "", 0 }, - - { "NoStandardLib", "nostdlib", "", "true", 0 }, - { "NoStandardLib", "nostdlib-", "", "false", 0 }, - { "NoStandardLib", "nostdlib+", "", "true", 0 }, - - { "SubsystemVersion", "subsystemversion", "", "", 0 }, - - { "AdditionalLibPaths", "lib:", "", "", 0 }, - - { "ErrorReport", "errorreport:none", "Do Not Send Report", "none", 0 }, - { "ErrorReport", "errorreport:prompt", "Prompt Immediately", "prompt", 0 }, - { "ErrorReport", "errorreport:queue", "Queue For Next Login", "queue", 0 }, - { "ErrorReport", "errorreport:send", "Send Automatically", "send", 0 }, - - { 0, 0, 0, 0, 0 }, -}; diff --git a/Source/cmVS12LibFlagTable.h b/Source/cmVS12LibFlagTable.h deleted file mode 100644 index 2229b97..0000000 --- a/Source/cmVS12LibFlagTable.h +++ /dev/null @@ -1,76 +0,0 @@ -static cmVS7FlagTable cmVS12LibFlagTable[] = { - - // Enum Properties - { "ErrorReporting", "ERRORREPORT:PROMPT", "PromptImmediately", - "PromptImmediately", 0 }, - { "ErrorReporting", "ERRORREPORT:QUEUE", "Queue For Next Login", - "QueueForNextLogin", 0 }, - { "ErrorReporting", "ERRORREPORT:SEND", "Send Error Report", - "SendErrorReport", 0 }, - { "ErrorReporting", "ERRORREPORT:NONE", "No Error Report", "NoErrorReport", - 0 }, - - { "TargetMachine", "MACHINE:ARM", "MachineARM", "MachineARM", 0 }, - { "TargetMachine", "MACHINE:EBC", "MachineEBC", "MachineEBC", 0 }, - { "TargetMachine", "MACHINE:IA64", "MachineIA64", "MachineIA64", 0 }, - { "TargetMachine", "MACHINE:MIPS", "MachineMIPS", "MachineMIPS", 0 }, - { "TargetMachine", "MACHINE:MIPS16", "MachineMIPS16", "MachineMIPS16", 0 }, - { "TargetMachine", "MACHINE:MIPSFPU", "MachineMIPSFPU", "MachineMIPSFPU", - 0 }, - { "TargetMachine", "MACHINE:MIPSFPU16", "MachineMIPSFPU16", - "MachineMIPSFPU16", 0 }, - { "TargetMachine", "MACHINE:SH4", "MachineSH4", "MachineSH4", 0 }, - { "TargetMachine", "MACHINE:THUMB", "MachineTHUMB", "MachineTHUMB", 0 }, - { "TargetMachine", "MACHINE:X64", "MachineX64", "MachineX64", 0 }, - { "TargetMachine", "MACHINE:X86", "MachineX86", "MachineX86", 0 }, - - { "SubSystem", "SUBSYSTEM:CONSOLE", "Console", "Console", 0 }, - { "SubSystem", "SUBSYSTEM:WINDOWS", "Windows", "Windows", 0 }, - { "SubSystem", "SUBSYSTEM:NATIVE", "Native", "Native", 0 }, - { "SubSystem", "SUBSYSTEM:EFI_APPLICATION", "EFI Application", - "EFI Application", 0 }, - { "SubSystem", "SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER", - "EFI Boot Service Driver", "EFI Boot Service Driver", 0 }, - { "SubSystem", "SUBSYSTEM:EFI_ROM", "EFI ROM", "EFI ROM", 0 }, - { "SubSystem", "SUBSYSTEM:EFI_RUNTIME_DRIVER", "EFI Runtime", "EFI Runtime", - 0 }, - { "SubSystem", "SUBSYSTEM:WINDOWSCE", "WindowsCE", "WindowsCE", 0 }, - { "SubSystem", "SUBSYSTEM:POSIX", "POSIX", "POSIX", 0 }, - - // Bool Properties - { "SuppressStartupBanner", "NOLOGO", "", "true", 0 }, - { "IgnoreAllDefaultLibraries", "NODEFAULTLIB", "", "true", 0 }, - { "TreatLibWarningAsErrors", "WX:NO", "", "false", 0 }, - { "TreatLibWarningAsErrors", "WX", "", "true", 0 }, - { "Verbose", "VERBOSE", "", "true", 0 }, - { "LinkTimeCodeGeneration", "LTCG", "", "true", 0 }, - - // Bool Properties With Argument - - // String List Properties - // Skip [AdditionalDependencies] - no command line Switch. - { "AdditionalLibraryDirectories", - "LIBPATH:", "Additional Library Directories", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "IgnoreSpecificDefaultLibraries", - "NODEFAULTLIB:", "Ignore Specific Default Libraries", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "ExportNamedFunctions", "EXPORT:", "Export Named Functions", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "RemoveObjects", "REMOVE:", "Remove Objects", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - - // String Properties - { "OutputFile", "OUT:", "Output File", "", cmVS7FlagTable::UserValue }, - { "ModuleDefinitionFile", "DEF:", "Module Definition File Name", "", - cmVS7FlagTable::UserValue }, - { "ForceSymbolReferences", "INCLUDE:", "Force Symbol References", "", - cmVS7FlagTable::UserValue }, - { "DisplayLibrary", "LIST:", "Display Library to standard output", "", - cmVS7FlagTable::UserValue }, - // Skip [MinimumRequiredVersion] - no command line Switch. - { "Name", "NAME:", "Name", "", cmVS7FlagTable::UserValue }, - // Skip [AdditionalOptions] - no command line Switch. - // Skip [TrackerLogDirectory] - no command line Switch. - { 0, 0, 0, 0, 0 } -}; diff --git a/Source/cmVS12LinkFlagTable.h b/Source/cmVS12LinkFlagTable.h deleted file mode 100644 index ddc3ea1..0000000 --- a/Source/cmVS12LinkFlagTable.h +++ /dev/null @@ -1,272 +0,0 @@ -static cmVS7FlagTable cmVS12LinkFlagTable[] = { - - // Enum Properties - { "ShowProgress", "", "Not Set", "NotSet", 0 }, - { "ShowProgress", "VERBOSE", "Display all progress messages", "LinkVerbose", - 0 }, - { "ShowProgress", "VERBOSE:Lib", "For Libraries Searched", "LinkVerboseLib", - 0 }, - { "ShowProgress", "VERBOSE:ICF", - "About COMDAT folding during optimized linking", "LinkVerboseICF", 0 }, - { "ShowProgress", "VERBOSE:REF", - "About data removed during optimized linking", "LinkVerboseREF", 0 }, - { "ShowProgress", "VERBOSE:SAFESEH", "About Modules incompatible with SEH", - "LinkVerboseSAFESEH", 0 }, - { "ShowProgress", "VERBOSE:CLR", - "About linker activity related to managed code", "LinkVerboseCLR", 0 }, - - { "ForceFileOutput", "FORCE", "Enabled", "Enabled", 0 }, - { "ForceFileOutput", "FORCE:MULTIPLE", "Multiply Defined Symbol Only", - "MultiplyDefinedSymbolOnly", 0 }, - { "ForceFileOutput", "FORCE:UNRESOLVED", "Undefined Symbol Only", - "UndefinedSymbolOnly", 0 }, - - { "CreateHotPatchableImage", "FUNCTIONPADMIN", "Enabled", "Enabled", 0 }, - { "CreateHotPatchableImage", "FUNCTIONPADMIN:5", "X86 Image Only", - "X86Image", 0 }, - { "CreateHotPatchableImage", "FUNCTIONPADMIN:6", "X64 Image Only", - "X64Image", 0 }, - { "CreateHotPatchableImage", "FUNCTIONPADMIN:16", "Itanium Image Only", - "ItaniumImage", 0 }, - - // correct flags for uac should be /MANIFESTUAC, but some projects already - // use this bug to access uac field, so keep these for compatibility - { "UACExecutionLevel", "level='asInvoker'", "asInvoker", "AsInvoker", 0 }, - { "UACExecutionLevel", "level='highestAvailable'", "highestAvailable", - "HighestAvailable", 0 }, - { "UACExecutionLevel", "level='requireAdministrator'", - "requireAdministrator", "RequireAdministrator", 0 }, - - { "SubSystem", "", "Not Set", "NotSet", 0 }, - { "SubSystem", "SUBSYSTEM:CONSOLE", "Console", "Console", 0 }, - { "SubSystem", "SUBSYSTEM:WINDOWS", "Windows", "Windows", 0 }, - { "SubSystem", "SUBSYSTEM:NATIVE", "Native", "Native", 0 }, - { "SubSystem", "SUBSYSTEM:EFI_APPLICATION", "EFI Application", - "EFI Application", 0 }, - { "SubSystem", "SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER", - "EFI Boot Service Driver", "EFI Boot Service Driver", 0 }, - { "SubSystem", "SUBSYSTEM:EFI_ROM", "EFI ROM", "EFI ROM", 0 }, - { "SubSystem", "SUBSYSTEM:EFI_RUNTIME_DRIVER", "EFI Runtime", "EFI Runtime", - 0 }, - { "SubSystem", "SUBSYSTEM:POSIX", "POSIX", "POSIX", 0 }, - - { "Driver", "", "Not Set", "NotSet", 0 }, - { "Driver", "Driver", "Driver", "Driver", 0 }, - { "Driver", "DRIVER:UPONLY", "UP Only", "UpOnly", 0 }, - { "Driver", "DRIVER:WDM", "WDM", "WDM", 0 }, - - { "LinkTimeCodeGeneration", "", "Default", "Default", 0 }, - { "LinkTimeCodeGeneration", "LTCG", "Use Link Time Code Generation", - "UseLinkTimeCodeGeneration", 0 }, - { "LinkTimeCodeGeneration", "LTCG:PGInstrument", - "Profile Guided Optimization - Instrument", "PGInstrument", 0 }, - { "LinkTimeCodeGeneration", "LTCG:PGOptimize", - "Profile Guided Optimization - Optimization", "PGOptimization", 0 }, - { "LinkTimeCodeGeneration", "LTCG:PGUpdate", - "Profile Guided Optimization - Update", "PGUpdate", 0 }, - - { "GenerateWindowsMetadata", "WINMD", "Yes", "true", 0 }, - { "GenerateWindowsMetadata", "WINMD:NO", "No", "false", 0 }, - - { "WindowsMetadataSignHash", "WINMDSIGNHASH:SHA1", "SHA1", "SHA1", 0 }, - { "WindowsMetadataSignHash", "WINMDSIGNHASH:SHA256", "SHA256", "SHA256", 0 }, - { "WindowsMetadataSignHash", "WINMDSIGNHASH:SHA384", "SHA384", "SHA384", 0 }, - { "WindowsMetadataSignHash", "WINMDSIGNHASH:SHA512", "SHA512", "SHA512", 0 }, - - { "TargetMachine", "", "Not Set", "NotSet", 0 }, - { "TargetMachine", "MACHINE:ARM", "MachineARM", "MachineARM", 0 }, - { "TargetMachine", "MACHINE:EBC", "MachineEBC", "MachineEBC", 0 }, - { "TargetMachine", "MACHINE:IA64", "MachineIA64", "MachineIA64", 0 }, - { "TargetMachine", "MACHINE:MIPS", "MachineMIPS", "MachineMIPS", 0 }, - { "TargetMachine", "MACHINE:MIPS16", "MachineMIPS16", "MachineMIPS16", 0 }, - { "TargetMachine", "MACHINE:MIPSFPU", "MachineMIPSFPU", "MachineMIPSFPU", - 0 }, - { "TargetMachine", "MACHINE:MIPSFPU16", "MachineMIPSFPU16", - "MachineMIPSFPU16", 0 }, - { "TargetMachine", "MACHINE:SH4", "MachineSH4", "MachineSH4", 0 }, - { "TargetMachine", "MACHINE:THUMB", "MachineTHUMB", "MachineTHUMB", 0 }, - { "TargetMachine", "MACHINE:X64", "MachineX64", "MachineX64", 0 }, - { "TargetMachine", "MACHINE:X86", "MachineX86", "MachineX86", 0 }, - - { "CLRThreadAttribute", "CLRTHREADATTRIBUTE:MTA", "MTA threading attribute", - "MTAThreadingAttribute", 0 }, - { "CLRThreadAttribute", "CLRTHREADATTRIBUTE:STA", "STA threading attribute", - "STAThreadingAttribute", 0 }, - { "CLRThreadAttribute", "CLRTHREADATTRIBUTE:NONE", - "Default threading attribute", "DefaultThreadingAttribute", 0 }, - - { "CLRImageType", "CLRIMAGETYPE:IJW", "Force IJW image", "ForceIJWImage", - 0 }, - { "CLRImageType", "CLRIMAGETYPE:PURE", "Force Pure IL Image", - "ForcePureILImage", 0 }, - { "CLRImageType", "CLRIMAGETYPE:SAFE", "Force Safe IL Image", - "ForceSafeILImage", 0 }, - { "CLRImageType", "", "Default image type", "Default", 0 }, - - { "SignHash", "CLRSIGNHASH:SHA1", "SHA1", "SHA1", 0 }, - { "SignHash", "CLRSIGNHASH:SHA256", "SHA256", "SHA256", 0 }, - { "SignHash", "CLRSIGNHASH:SHA384", "SHA384", "SHA384", 0 }, - { "SignHash", "CLRSIGNHASH:SHA512", "SHA512", "SHA512", 0 }, - - { "LinkErrorReporting", "ERRORREPORT:PROMPT", "PromptImmediately", - "PromptImmediately", 0 }, - { "LinkErrorReporting", "ERRORREPORT:QUEUE", "Queue For Next Login", - "QueueForNextLogin", 0 }, - { "LinkErrorReporting", "ERRORREPORT:SEND", "Send Error Report", - "SendErrorReport", 0 }, - { "LinkErrorReporting", "ERRORREPORT:NONE", "No Error Report", - "NoErrorReport", 0 }, - - { "CLRSupportLastError", "CLRSupportLastError", "Enabled", "Enabled", 0 }, - { "CLRSupportLastError", "CLRSupportLastError:NO", "Disabled", "Disabled", - 0 }, - { "CLRSupportLastError", "CLRSupportLastError:SYSTEMDLL", "System Dlls Only", - "SystemDlls", 0 }, - - // Bool Properties - { "LinkIncremental", "INCREMENTAL:NO", "", "false", 0 }, - { "LinkIncremental", "INCREMENTAL", "", "true", 0 }, - { "SuppressStartupBanner", "NOLOGO", "", "true", 0 }, - { "LinkStatus", "LTCG:NOSTATUS", "", "false", 0 }, - { "LinkStatus", "LTCG:STATUS", "", "true", 0 }, - { "PreventDllBinding", "ALLOWBIND:NO", "", "false", 0 }, - { "PreventDllBinding", "ALLOWBIND", "", "true", 0 }, - { "TreatLinkerWarningAsErrors", "WX:NO", "", "false", 0 }, - { "TreatLinkerWarningAsErrors", "WX", "", "true", 0 }, - { "IgnoreAllDefaultLibraries", "NODEFAULTLIB", "", "true", 0 }, - { "GenerateManifest", "MANIFEST:NO", "", "false", 0 }, - { "GenerateManifest", "MANIFEST", "", "true", 0 }, - { "AllowIsolation", "ALLOWISOLATION:NO", "", "false", 0 }, - - // correct flags for uac should be /MANIFESTUAC, but some projects already - // use this bug to access uac field, so keep these for compatibility - { "UACUIAccess", "uiAccess='false'", "", "false", 0 }, - { "UACUIAccess", "uiAccess='true'", "", "true", 0 }, - - { "ManifestEmbed", "manifest:embed", "", "true", 0 }, - { "GenerateDebugInformation", "DEBUG", "", "true", - cmVS7FlagTable::CaseInsensitive }, - { "MapExports", "MAPINFO:EXPORTS", "", "true", 0 }, - { "AssemblyDebug", "ASSEMBLYDEBUG:DISABLE", "", "false", 0 }, - { "AssemblyDebug", "ASSEMBLYDEBUG", "", "true", 0 }, - { "LargeAddressAware", "LARGEADDRESSAWARE:NO", "", "false", 0 }, - { "LargeAddressAware", "LARGEADDRESSAWARE", "", "true", 0 }, - { "TerminalServerAware", "TSAWARE:NO", "", "false", 0 }, - { "TerminalServerAware", "TSAWARE", "", "true", 0 }, - { "SwapRunFromCD", "SWAPRUN:CD", "", "true", 0 }, - { "SwapRunFromNET", "SWAPRUN:NET", "", "true", 0 }, - { "OptimizeReferences", "OPT:NOREF", "", "false", 0 }, - { "OptimizeReferences", "OPT:REF", "", "true", 0 }, - { "EnableCOMDATFolding", "OPT:NOICF", "", "false", 0 }, - { "EnableCOMDATFolding", "OPT:ICF", "", "true", 0 }, - { "IgnoreEmbeddedIDL", "IGNOREIDL", "", "true", 0 }, - { "AppContainer", "APPCONTAINER", "", "true", 0 }, - { "WindowsMetadataLinkDelaySign", "WINMDDELAYSIGN:NO", "", "false", 0 }, - { "WindowsMetadataLinkDelaySign", "WINMDDELAYSIGN", "", "true", 0 }, - { "NoEntryPoint", "NOENTRY", "", "true", 0 }, - { "SetChecksum", "RELEASE", "", "true", 0 }, - { "RandomizedBaseAddress", "DYNAMICBASE:NO", "", "false", 0 }, - { "RandomizedBaseAddress", "DYNAMICBASE", "", "true", 0 }, - { "FixedBaseAddress", "FIXED:NO", "", "false", 0 }, - { "FixedBaseAddress", "FIXED", "", "true", 0 }, - { "DataExecutionPrevention", "NXCOMPAT:NO", "", "false", 0 }, - { "DataExecutionPrevention", "NXCOMPAT", "", "true", 0 }, - { "TurnOffAssemblyGeneration", "NOASSEMBLY", "", "true", 0 }, - { "SupportUnloadOfDelayLoadedDLL", "DELAY:UNLOAD", "", "true", 0 }, - { "SupportNobindOfDelayLoadedDLL", "DELAY:NOBIND", "", "true", 0 }, - { "Profile", "PROFILE", "", "true", 0 }, - { "LinkDelaySign", "DELAYSIGN:NO", "", "false", 0 }, - { "LinkDelaySign", "DELAYSIGN", "", "true", 0 }, - { "CLRUnmanagedCodeCheck", "CLRUNMANAGEDCODECHECK:NO", "", "false", 0 }, - { "CLRUnmanagedCodeCheck", "CLRUNMANAGEDCODECHECK", "", "true", 0 }, - { "DetectOneDefinitionRule", "ODR", "", "true", 0 }, - { "ImageHasSafeExceptionHandlers", "SAFESEH:NO", "", "false", 0 }, - { "ImageHasSafeExceptionHandlers", "SAFESEH", "", "true", 0 }, - { "LinkDLL", "DLL", "", "true", 0 }, - - // Bool Properties With Argument - { "EnableUAC", "MANIFESTUAC:", "", "", - cmVS7FlagTable::UserValueRequired | cmVS7FlagTable::SpaceAppendable }, - { "GenerateMapFile", "MAP", "", "true", - cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue }, - { "MapFileName", "MAP:", "Generate Map File", "", - cmVS7FlagTable::UserValueRequired }, - - // String List Properties - { "AdditionalLibraryDirectories", - "LIBPATH:", "Additional Library Directories", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - // Skip [AdditionalDependencies] - no command line Switch. - { "IgnoreSpecificDefaultLibraries", - "NODEFAULTLIB:", "Ignore Specific Default Libraries", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "AddModuleNamesToAssembly", "ASSEMBLYMODULE:", "Add Module to Assembly", - "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "EmbedManagedResourceFile", - "ASSEMBLYRESOURCE:", "Embed Managed Resource File", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "ForceSymbolReferences", "INCLUDE:", "Force Symbol References", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "DelayLoadDLLs", "DELAYLOAD:", "Delay Loaded Dlls", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "AssemblyLinkResource", "ASSEMBLYLINKRESOURCE:", "Assembly Link Resource", - "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "AdditionalManifestDependencies", - "MANIFESTDEPENDENCY:", "Additional Manifest Dependencies", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "ManifestInput", "manifestinput:", "Manifest Input", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - - // String Properties - { "OutputFile", "OUT:", "Output File", "", cmVS7FlagTable::UserValue }, - { "Version", "VERSION:", "Version", "", cmVS7FlagTable::UserValue }, - { "SpecifySectionAttributes", "SECTION:", "Specify Section Attributes", "", - cmVS7FlagTable::UserValue }, - { "MSDOSStubFileName", "STUB:", "MS-DOS Stub File Name", "", - cmVS7FlagTable::UserValue }, - // Skip [TrackerLogDirectory] - no command line Switch. - { "ModuleDefinitionFile", "DEF:", "Module Definition File", "", - cmVS7FlagTable::UserValue }, - { "ManifestFile", "ManifestFile:", "Manifest File", "", - cmVS7FlagTable::UserValue }, - { "ProgramDatabaseFile", "PDB:", "Generate Program Database File", "", - cmVS7FlagTable::UserValue }, - { "StripPrivateSymbols", "PDBSTRIPPED:", "Strip Private Symbols", "", - cmVS7FlagTable::UserValue }, - // Skip [MapFileName] - no command line Switch. - // Skip [MinimumRequiredVersion] - no command line Switch. - { "HeapReserveSize", "HEAP:", "Heap Reserve Size", "", - cmVS7FlagTable::UserValue }, - // Skip [HeapCommitSize] - no command line Switch. - { "StackReserveSize", "STACK:", "Stack Reserve Size", "", - cmVS7FlagTable::UserValue }, - // Skip [StackCommitSize] - no command line Switch. - { "FunctionOrder", "ORDER:@", "Function Order", "", - cmVS7FlagTable::UserValue }, - { "ProfileGuidedDatabase", "PGD:", "Profile Guided Database", "", - cmVS7FlagTable::UserValue }, - { "MidlCommandFile", "MIDL:@", "MIDL Commands", "", - cmVS7FlagTable::UserValue }, - { "MergedIDLBaseFileName", "IDLOUT:", "Merged IDL Base File Name", "", - cmVS7FlagTable::UserValue }, - { "TypeLibraryFile", "TLBOUT:", "Type Library", "", - cmVS7FlagTable::UserValue }, - { "WindowsMetadataFile", "WINMDFILE:", "Windows Metadata File", "", - cmVS7FlagTable::UserValue }, - { "WindowsMetadataLinkKeyFile", "WINMDKEYFILE:", "Windows Metadata Key File", - "", cmVS7FlagTable::UserValue }, - { "WindowsMetadataKeyContainer", "WINMDKEYCONTAINER:", - "Windows Metadata Key Container", "", cmVS7FlagTable::UserValue }, - { "EntryPointSymbol", "ENTRY:", "Entry Point", "", - cmVS7FlagTable::UserValue }, - { "BaseAddress", "BASE:", "Base Address", "", cmVS7FlagTable::UserValue }, - { "ImportLibrary", "IMPLIB:", "Import Library", "", - cmVS7FlagTable::UserValue }, - { "MergeSections", "MERGE:", "Merge Sections", "", - cmVS7FlagTable::UserValue }, - { "LinkKeyFile", "KEYFILE:", "Key File", "", cmVS7FlagTable::UserValue }, - { "KeyContainer", "KEYCONTAINER:", "Key Container", "", - cmVS7FlagTable::UserValue }, - // Skip [AdditionalOptions] - no command line Switch. - { 0, 0, 0, 0, 0 } -}; diff --git a/Source/cmVS12MASMFlagTable.h b/Source/cmVS12MASMFlagTable.h deleted file mode 100644 index acc0d48..0000000 --- a/Source/cmVS12MASMFlagTable.h +++ /dev/null @@ -1,76 +0,0 @@ -static cmVS7FlagTable cmVS12MASMFlagTable[] = { - - // Enum Properties - { "PreserveIdentifierCase", "", "Default", "0", 0 }, - { "PreserveIdentifierCase", "Cp", "Preserves Identifier Case (/Cp)", "1", - 0 }, - { "PreserveIdentifierCase", "Cu", - "Maps all identifiers to upper case. (/Cu)", "2", 0 }, - { "PreserveIdentifierCase", "Cx", - "Preserves case in public and extern symbols. (/Cx)", "3", 0 }, - - { "WarningLevel", "W0", "Warning Level 0 (/W0)", "0", 0 }, - { "WarningLevel", "W1", "Warning Level 1 (/W1)", "1", 0 }, - { "WarningLevel", "W2", "Warning Level 2 (/W2)", "2", 0 }, - { "WarningLevel", "W3", "Warning Level 3 (/W3)", "3", 0 }, - - { "PackAlignmentBoundary", "", "Default", "0", 0 }, - { "PackAlignmentBoundary", "Zp1", "One Byte Boundary (/Zp1)", "1", 0 }, - { "PackAlignmentBoundary", "Zp2", "Two Byte Boundary (/Zp2)", "2", 0 }, - { "PackAlignmentBoundary", "Zp4", "Four Byte Boundary (/Zp4)", "3", 0 }, - { "PackAlignmentBoundary", "Zp8", "Eight Byte Boundary (/Zp8)", "4", 0 }, - { "PackAlignmentBoundary", "Zp16", "Sixteen Byte Boundary (/Zp16)", "5", 0 }, - - { "CallingConvention", "", "Default", "0", 0 }, - { "CallingConvention", "Gd", "Use C-style Calling Convention (/Gd)", "1", - 0 }, - { "CallingConvention", "Gz", "Use stdcall Calling Convention (/Gz)", "2", - 0 }, - { "CallingConvention", "Gc", "Use Pascal Calling Convention (/Gc)", "3", 0 }, - - { "ErrorReporting", "errorReport:prompt", - "Prompt to send report immediately (/errorReport:prompt)", "0", 0 }, - { "ErrorReporting", "errorReport:queue", - "Prompt to send report at the next logon (/errorReport:queue)", "1", 0 }, - { "ErrorReporting", "errorReport:send", - "Automatically send report (/errorReport:send)", "2", 0 }, - { "ErrorReporting", "errorReport:none", - "Do not send report (/errorReport:none)", "3", 0 }, - - // Bool Properties - { "NoLogo", "nologo", "", "true", 0 }, - { "GeneratePreprocessedSourceListing", "EP", "", "true", 0 }, - { "ListAllAvailableInformation", "Sa", "", "true", 0 }, - { "UseSafeExceptionHandlers", "safeseh", "", "true", 0 }, - { "AddFirstPassListing", "Sf", "", "true", 0 }, - { "EnableAssemblyGeneratedCodeListing", "Sg", "", "true", 0 }, - { "DisableSymbolTable", "Sn", "", "true", 0 }, - { "EnableFalseConditionalsInListing", "Sx", "", "true", 0 }, - { "TreatWarningsAsErrors", "WX", "", "true", 0 }, - { "MakeAllSymbolsPublic", "Zf", "", "true", 0 }, - { "GenerateDebugInformation", "Zi", "", "true", 0 }, - { "EnableMASM51Compatibility", "Zm", "", "true", 0 }, - { "PerformSyntaxCheckOnly", "Zs", "", "true", 0 }, - - // Bool Properties With Argument - - // String List Properties - { "PreprocessorDefinitions", "D", "Preprocessor Definitions", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "IncludePaths", "I", "Include Paths", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "BrowseFile", "FR", "Generate Browse Information File", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - // Skip [AdditionalDependencies] - no command line Switch. - - // String Properties - // Skip [Inputs] - no command line Switch. - { "ObjectFileName", "Fo", "Object File Name", "", - cmVS7FlagTable::UserValue }, - { "AssembledCodeListingFile", "Fl", "Assembled Code Listing File", "", - cmVS7FlagTable::UserValue }, - // Skip [CommandLineTemplate] - no command line Switch. - // Skip [ExecutionDescription] - no command line Switch. - // Skip [AdditionalOptions] - no command line Switch. - { 0, 0, 0, 0, 0 } -}; diff --git a/Source/cmVS12RCFlagTable.h b/Source/cmVS12RCFlagTable.h deleted file mode 100644 index a650f85..0000000 --- a/Source/cmVS12RCFlagTable.h +++ /dev/null @@ -1,7 +0,0 @@ -static cmVS7FlagTable cmVS12RCFlagTable[] = { - // Bool Properties - { "NullTerminateStrings", "n", "", "true", 0 }, - { "SuppressStartupBanner", "nologo", "", "true", 0 }, - - { 0, 0, 0, 0, 0 } -}; diff --git a/Source/cmVS140CLFlagTable.h b/Source/cmVS140CLFlagTable.h deleted file mode 100644 index 2b89042..0000000 --- a/Source/cmVS140CLFlagTable.h +++ /dev/null @@ -1,240 +0,0 @@ -static cmVS7FlagTable cmVS140CLFlagTable[] = { - - // Enum Properties - { "DebugInformationFormat", "", "None", "None", 0 }, - { "DebugInformationFormat", "Z7", "C7 compatible", "OldStyle", 0 }, - { "DebugInformationFormat", "Zi", "Program Database", "ProgramDatabase", 0 }, - { "DebugInformationFormat", "ZI", "Program Database for Edit And Continue", - "EditAndContinue", 0 }, - - { "WarningLevel", "W0", "Turn Off All Warnings", "TurnOffAllWarnings", 0 }, - { "WarningLevel", "W1", "Level1", "Level1", 0 }, - { "WarningLevel", "W2", "Level2", "Level2", 0 }, - { "WarningLevel", "W3", "Level3", "Level3", 0 }, - { "WarningLevel", "W4", "Level4", "Level4", 0 }, - { "WarningLevel", "Wall", "EnableAllWarnings", "EnableAllWarnings", 0 }, - - { "Optimization", "", "Custom", "Custom", 0 }, - { "Optimization", "Od", "Disabled", "Disabled", 0 }, - { "Optimization", "O1", "Minimize Size", "MinSpace", 0 }, - { "Optimization", "O2", "Maximize Speed", "MaxSpeed", 0 }, - { "Optimization", "Ox", "Full Optimization", "Full", 0 }, - - { "InlineFunctionExpansion", "", "Default", "Default", 0 }, - { "InlineFunctionExpansion", "Ob0", "Disabled", "Disabled", 0 }, - { "InlineFunctionExpansion", "Ob1", "Only __inline", "OnlyExplicitInline", - 0 }, - { "InlineFunctionExpansion", "Ob2", "Any Suitable", "AnySuitable", 0 }, - - { "FavorSizeOrSpeed", "Os", "Favor small code", "Size", 0 }, - { "FavorSizeOrSpeed", "Ot", "Favor fast code", "Speed", 0 }, - { "FavorSizeOrSpeed", "", "Neither", "Neither", 0 }, - - { "ExceptionHandling", "EHa", "Yes with SEH Exceptions", "Async", 0 }, - { "ExceptionHandling", "EHsc", "Yes", "Sync", 0 }, - { "ExceptionHandling", "EHs", "Yes with Extern C functions", "SyncCThrow", - 0 }, - { "ExceptionHandling", "", "No", "false", 0 }, - - { "BasicRuntimeChecks", "RTCs", "Stack Frames", "StackFrameRuntimeCheck", - 0 }, - { "BasicRuntimeChecks", "RTCu", "Uninitialized variables", - "UninitializedLocalUsageCheck", 0 }, - { "BasicRuntimeChecks", "RTC1", "Both (/RTC1, equiv. to /RTCsu)", - "EnableFastChecks", 0 }, - { "BasicRuntimeChecks", "", "Default", "Default", 0 }, - - { "RuntimeLibrary", "MT", "Multi-threaded", "MultiThreaded", 0 }, - { "RuntimeLibrary", "MTd", "Multi-threaded Debug", "MultiThreadedDebug", 0 }, - { "RuntimeLibrary", "MD", "Multi-threaded DLL", "MultiThreadedDLL", 0 }, - { "RuntimeLibrary", "MDd", "Multi-threaded Debug DLL", - "MultiThreadedDebugDLL", 0 }, - - { "StructMemberAlignment", "Zp1", "1 Byte", "1Byte", 0 }, - { "StructMemberAlignment", "Zp2", "2 Bytes", "2Bytes", 0 }, - { "StructMemberAlignment", "Zp4", "4 Byte", "4Bytes", 0 }, - { "StructMemberAlignment", "Zp8", "8 Bytes", "8Bytes", 0 }, - { "StructMemberAlignment", "Zp16", "16 Bytes", "16Bytes", 0 }, - { "StructMemberAlignment", "", "Default", "Default", 0 }, - - { "BufferSecurityCheck", "GS-", "Disable Security Check", "false", 0 }, - { "BufferSecurityCheck", "GS", "Enable Security Check", "true", 0 }, - - { "EnableEnhancedInstructionSet", "arch:SSE", "Streaming SIMD Extensions", - "StreamingSIMDExtensions", 0 }, - { "EnableEnhancedInstructionSet", "arch:SSE2", "Streaming SIMD Extensions 2", - "StreamingSIMDExtensions2", 0 }, - { "EnableEnhancedInstructionSet", "arch:AVX", "Advanced Vector Extensions", - "AdvancedVectorExtensions", 0 }, - { "EnableEnhancedInstructionSet", "arch:AVX2", - "Advanced Vector Extensions 2", "AdvancedVectorExtensions2", 0 }, - { "EnableEnhancedInstructionSet", "arch:IA32", "No Enhanced Instructions", - "NoExtensions", 0 }, - { "EnableEnhancedInstructionSet", "", "Not Set", "NotSet", 0 }, - - { "FloatingPointModel", "fp:precise", "Precise", "Precise", 0 }, - { "FloatingPointModel", "fp:strict", "Strict", "Strict", 0 }, - { "FloatingPointModel", "fp:fast", "Fast", "Fast", 0 }, - - { "PrecompiledHeader", "Yc", "Create", "Create", - cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue }, - { "PrecompiledHeader", "Yu", "Use", "Use", - cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue }, - { "PrecompiledHeader", "Y-", "Not Using Precompiled Headers", "NotUsing", - 0 }, - - { "AssemblerOutput", "", "No Listing", "NoListing", 0 }, - { "AssemblerOutput", "FA", "Assembly-Only Listing", "AssemblyCode", 0 }, - { "AssemblerOutput", "FAc", "Assembly With Machine Code", - "AssemblyAndMachineCode", 0 }, - { "AssemblerOutput", "FAs", "Assembly With Source Code", - "AssemblyAndSourceCode", 0 }, - { "AssemblerOutput", "FAcs", "Assembly, Machine Code and Source", "All", 0 }, - - { "CallingConvention", "Gd", "__cdecl", "Cdecl", 0 }, - { "CallingConvention", "Gr", "__fastcall", "FastCall", 0 }, - { "CallingConvention", "Gz", "__stdcall", "StdCall", 0 }, - { "CallingConvention", "Gv", "__vectorcall", "VectorCall", 0 }, - - { "CompileAs", "", "Default", "Default", 0 }, - { "CompileAs", "TC", "Compile as C Code", "CompileAsC", 0 }, - { "CompileAs", "TP", "Compile as C++ Code", "CompileAsCpp", 0 }, - - { "ErrorReporting", "errorReport:none", "Do Not Send Report", "None", 0 }, - { "ErrorReporting", "errorReport:prompt", "Prompt Immediately", "Prompt", - 0 }, - { "ErrorReporting", "errorReport:queue", "Queue For Next Login", "Queue", - 0 }, - { "ErrorReporting", "errorReport:send", "Send Automatically", "Send", 0 }, - - { "CompileAsManaged", "", "No Common Language RunTime Support", "false", 0 }, - { "CompileAsManaged", "clr", "Common Language RunTime Support", "true", 0 }, - { "CompileAsManaged", "clr:pure", - "Pure MSIL Common Language RunTime Support", "Pure", 0 }, - { "CompileAsManaged", "clr:safe", - "Safe MSIL Common Language RunTime Support", "Safe", 0 }, - { "CompileAsManaged", "clr:oldSyntax", - "Common Language RunTime Support, Old Syntax", "OldSyntax", 0 }, - - { "CppLanguageStandard", "", "Default", "Default", 0 }, - { "CppLanguageStandard", "std=c++98", "C++03", "c++98", 0 }, - { "CppLanguageStandard", "std=c++11", "C++11", "c++11", 0 }, - { "CppLanguageStandard", "std=c++1y", "C++14", "c++1y", 0 }, - { "CppLanguageStandard", "std=c++14", "C++14", "c++1y", 0 }, - { "CppLanguageStandard", "std=gnu++98", "C++03 (GNU Dialect)", "gnu++98", - 0 }, - { "CppLanguageStandard", "std=gnu++11", "C++11 (GNU Dialect)", "gnu++11", - 0 }, - { "CppLanguageStandard", "std=gnu++1y", "C++14 (GNU Dialect)", "gnu++1y", - 0 }, - { "CppLanguageStandard", "std=gnu++14", "C++14 (GNU Dialect)", "gnu++1y", - 0 }, - - // Bool Properties - { "CompileAsWinRT", "ZW", "", "true", 0 }, - { "WinRTNoStdLib", "ZW:nostdlib", "", "true", 0 }, - { "SuppressStartupBanner", "nologo", "", "true", 0 }, - { "TreatWarningAsError", "WX-", "", "false", 0 }, - { "TreatWarningAsError", "WX", "", "true", 0 }, - { "SDLCheck", "sdl-", "", "false", 0 }, - { "SDLCheck", "sdl", "", "true", 0 }, - { "IntrinsicFunctions", "Oi", "", "true", 0 }, - { "OmitFramePointers", "Oy-", "", "false", 0 }, - { "OmitFramePointers", "Oy", "", "true", 0 }, - { "EnableFiberSafeOptimizations", "GT", "", "true", 0 }, - { "WholeProgramOptimization", "GL", "", "true", 0 }, - { "UndefineAllPreprocessorDefinitions", "u", "", "true", 0 }, - { "IgnoreStandardIncludePath", "X", "", "true", 0 }, - { "PreprocessToFile", "P", "", "true", 0 }, - { "PreprocessSuppressLineNumbers", "EP", "", "true", 0 }, - { "PreprocessKeepComments", "C", "", "true", 0 }, - { "StringPooling", "GF-", "", "false", 0 }, - { "StringPooling", "GF", "", "true", 0 }, - { "MinimalRebuild", "Gm-", "", "false", 0 }, - { "MinimalRebuild", "Gm", "", "true", 0 }, - { "SmallerTypeCheck", "RTCc", "", "true", 0 }, - { "FunctionLevelLinking", "Gy-", "", "false", 0 }, - { "FunctionLevelLinking", "Gy", "", "true", 0 }, - { "EnableParallelCodeGeneration", "Qpar-", "", "false", 0 }, - { "EnableParallelCodeGeneration", "Qpar", "", "true", 0 }, - { "FloatingPointExceptions", "fp:except-", "", "false", 0 }, - { "FloatingPointExceptions", "fp:except", "", "true", 0 }, - { "CreateHotpatchableImage", "hotpatch", "", "true", 0 }, - { "DisableLanguageExtensions", "Za", "", "true", 0 }, - { "TreatWChar_tAsBuiltInType", "Zc:wchar_t-", "", "false", 0 }, - { "TreatWChar_tAsBuiltInType", "Zc:wchar_t", "", "true", 0 }, - { "ForceConformanceInForLoopScope", "Zc:forScope-", "", "false", 0 }, - { "ForceConformanceInForLoopScope", "Zc:forScope", "", "true", 0 }, - { "RemoveUnreferencedCodeData", "Zc:inline-", "", "false", 0 }, - { "RemoveUnreferencedCodeData", "Zc:inline", "", "true", 0 }, - { "RuntimeTypeInfo", "GR-", "", "false", 0 }, - { "RuntimeTypeInfo", "GR", "", "true", 0 }, - { "OpenMPSupport", "openmp-", "", "false", 0 }, - { "OpenMPSupport", "openmp", "", "true", 0 }, - { "ExpandAttributedSource", "Fx", "", "true", 0 }, - { "UseUnicodeForAssemblerListing", "FAu", "", "true", 0 }, - { "ShowIncludes", "showIncludes", "", "true", 0 }, - { "EnablePREfast", "analyze-", "", "false", 0 }, - { "EnablePREfast", "analyze", "", "true", 0 }, - { "UseFullPaths", "FC", "", "true", 0 }, - { "OmitDefaultLibName", "Zl", "", "true", 0 }, - - // Bool Properties With Argument - { "MultiProcessorCompilation", "MP", "", "true", - cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue }, - { "ProcessorNumber", "MP", "Multi-processor Compilation", "", - cmVS7FlagTable::UserValueRequired }, - { "GenerateXMLDocumentationFiles", "doc", "", "true", - cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue }, - { "XMLDocumentationFileName", "doc", "Generate XML Documentation Files", "", - cmVS7FlagTable::UserValueRequired }, - { "BrowseInformation", "FR", "", "true", - cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue }, - { "BrowseInformationFile", "FR", "Enable Browse Information", "", - cmVS7FlagTable::UserValueRequired }, - - // String List Properties - { "AdditionalIncludeDirectories", "I", "Additional Include Directories", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "AdditionalUsingDirectories", "AI", "Additional #using Directories", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "PreprocessorDefinitions", "D ", "Preprocessor Definitions", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "UndefinePreprocessorDefinitions", "U", - "Undefine Preprocessor Definitions", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "DisableSpecificWarnings", "wd", "Disable Specific Warnings", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "ForcedIncludeFiles", "FI", "Forced Include File", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "ForcedUsingFiles", "FU", "Forced #using File", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "PREfastLog", "analyze:log", "Code Analysis Log", "", - cmVS7FlagTable::UserFollowing }, - { "PREfastAdditionalPlugins", "analyze:plugin", - "Additional Code Analysis Native plugins", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "TreatSpecificWarningsAsErrors", "we", "Treat Specific Warnings As Errors", - "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - - // String Properties - // Skip [TrackerLogDirectory] - no command line Switch. - { "PreprocessOutputPath", "Fi", "Preprocess Output Path", "", - cmVS7FlagTable::UserValue }, - { "PrecompiledHeaderFile", "Yc", "Precompiled Header Name", "", - cmVS7FlagTable::UserValueRequired }, - { "PrecompiledHeaderFile", "Yu", "Precompiled Header Name", "", - cmVS7FlagTable::UserValueRequired }, - { "PrecompiledHeaderOutputFile", "Fp", "Precompiled Header Output File", "", - cmVS7FlagTable::UserValue }, - { "AssemblerListingLocation", "Fa", "ASM List Location", "", - cmVS7FlagTable::UserValue }, - { "ObjectFileName", "Fo", "Object File Name", "", - cmVS7FlagTable::UserValue }, - { "ProgramDataBaseFileName", "Fd", "Program Database File Name", "", - cmVS7FlagTable::UserValue }, - // Skip [XMLDocumentationFileName] - no command line Switch. - // Skip [BrowseInformationFile] - no command line Switch. - // Skip [AdditionalOptions] - no command line Switch. - { 0, 0, 0, 0, 0 } -}; diff --git a/Source/cmVS140CSharpFlagTable.h b/Source/cmVS140CSharpFlagTable.h deleted file mode 100644 index f695f45..0000000 --- a/Source/cmVS140CSharpFlagTable.h +++ /dev/null @@ -1,121 +0,0 @@ -static cmVS7FlagTable cmVS140CSharpFlagTable[] = { - { "ProjectName", "out:", "", "", cmIDEFlagTable::UserValueRequired }, - - { "OutputType", "target:exe", "", "Exe", 0 }, - { "OutputType", "target:winexe", "", "Winexe", 0 }, - { "OutputType", "target:library", "", "Library", 0 }, - { "OutputType", "target:module", "", "Module", 0 }, - - { "DocumentationFile", "doc", "", "", cmIDEFlagTable::UserValueRequired }, - - { "Platform", "platform:x86", "", "x86", 0 }, - { "Platform", "platform:Itanium", "", "Itanium", 0 }, - { "Platform", "platform:x64", "", "x64", 0 }, - { "Platform", "platform:arm", "", "arm", 0 }, - { "Platform", "platform:anycpu32bitpreferred", "", "anycpu32bitpreferred", - 0 }, - { "Platform", "platform:anycpu", "", "anycpu", 0 }, - - { "References", "reference:", "mit alias", "", 0 }, - { "References", "reference:", "dateiliste", "", 0 }, - { "AddModules", "addmodule:", "", "", cmIDEFlagTable::SemicolonAppendable }, - { "", "link", "", "", 0 }, - - { "Win32Resource", "win32res:", "", "", cmIDEFlagTable::UserValueRequired }, - { "ApplicationIcon", "win32icon:", "", "", - cmIDEFlagTable::UserValueRequired }, - - { "ApplicationManifest", "win32manifest:", "", "", - cmIDEFlagTable::UserValueRequired }, - - { "NoWin32Manifest", "nowin32manifest", "", "true", 0 }, - - { "DefineDebug", "debug", "", "true", cmIDEFlagTable::Continue }, - - { "DebugSymbols", "debug", "", "true", 0 }, - { "DebugSymbols", "debug-", "", "false", 0 }, - { "DebugSymbols", "debug+", "", "true", 0 }, - - { "DebugType", "debug:none", "", "none", 0 }, - { "DebugType", "debug:full", "", "full", 0 }, - { "DebugType", "debug:pdbonly", "", "pdbonly", 0 }, - - { "Optimize", "optimize", "", "true", 0 }, - { "Optimize", "optimize-", "", "false", 0 }, - { "Optimize", "optimize+", "", "true", 0 }, - - { "TreatWarningsAsErrors", "warnaserror", "", "true", 0 }, - { "TreatWarningsAsErrors", "warnaserror-", "", "false", 0 }, - { "TreatWarningsAsErrors", "warnaserror+", "", "true", 0 }, - - { "WarningsAsErrors", "warnaserror", "", "", 0 }, - { "WarningsAsErrors", "warnaserror-", "", "", 0 }, - { "WarningsAsErrors", "warnaserror+", "", "", 0 }, - - { "WarningLevel", "warn:0", "", "0", 0 }, - { "WarningLevel", "warn:1", "", "1", 0 }, - { "WarningLevel", "warn:2", "", "2", 0 }, - { "WarningLevel", "warn:3", "", "3", 0 }, - { "WarningLevel", "warn:4", "", "4", 0 }, - { "DisabledWarnings", "nowarn", "", "", 0 }, - - { "CheckForOverflowUnderflow", "checked", "", "true", 0 }, - { "CheckForOverflowUnderflow", "checked-", "", "false", 0 }, - { "CheckForOverflowUnderflow", "checked+", "", "true", 0 }, - - { "AllowUnsafeBlocks", "unsafe", "", "true", 0 }, - { "AllowUnsafeBlocks", "unsafe-", "", "false", 0 }, - { "AllowUnsafeBlocks", "unsafe+", "", "true", 0 }, - - { "DefineConstants", "define:", "", "", - cmIDEFlagTable::SemicolonAppendable | cmIDEFlagTable::UserValue }, - - { "LangVersion", "langversion:ISO-1", "", "ISO-1", 0 }, - { "LangVersion", "langversion:ISO-2", "", "ISO-2", 0 }, - { "LangVersion", "langversion:3", "", "3", 0 }, - { "LangVersion", "langversion:4", "", "4", 0 }, - { "LangVersion", "langversion:5", "", "5", 0 }, - { "LangVersion", "langversion:6", "", "6", 0 }, - { "LangVersion", "langversion:default", "", "default", 0 }, - - { "DelaySign", "delaysign", "", "true", 0 }, - { "DelaySign", "delaysign-", "", "false", 0 }, - { "DelaySign", "delaysign+", "", "true", 0 }, - - { "AssemblyOriginatorKeyFile", "keyfile", "", "", 0 }, - - { "KeyContainerName", "keycontainer", "", "", 0 }, - - { "NoLogo", "nologo", "", "", 0 }, - - { "NoConfig", "noconfig", "", "true", 0 }, - - { "BaseAddress", "baseaddress:", "", "", 0 }, - - { "CodePage", "codepage", "", "", 0 }, - - { "Utf8Output", "utf8output", "", "", 0 }, - - { "MainEntryPoint", "main:", "", "", 0 }, - - { "GenerateFullPaths", "fullpaths", "", "true", 0 }, - - { "FileAlignment", "filealign", "", "", 0 }, - - { "PdbFile", "pdb:", "", "", 0 }, - - { "NoStandardLib", "nostdlib", "", "true", 0 }, - { "NoStandardLib", "nostdlib-", "", "false", 0 }, - { "NoStandardLib", "nostdlib+", "", "true", 0 }, - - { "SubsystemVersion", "subsystemversion", "", "", 0 }, - - { "AdditionalLibPaths", "lib:", "", "", 0 }, - - { "ErrorReport", "errorreport:none", "Do Not Send Report", "none", 0 }, - { "ErrorReport", "errorreport:prompt", "Prompt Immediately", "prompt", 0 }, - { "ErrorReport", "errorreport:queue", "Queue For Next Login", "queue", 0 }, - { "ErrorReport", "errorreport:send", "Send Automatically", "send", 0 }, - - { 0, 0, 0, 0, 0 }, -}; diff --git a/Source/cmVS140LinkFlagTable.h b/Source/cmVS140LinkFlagTable.h deleted file mode 100644 index fe03153..0000000 --- a/Source/cmVS140LinkFlagTable.h +++ /dev/null @@ -1,285 +0,0 @@ -static cmVS7FlagTable cmVS140LinkFlagTable[] = { - - // Enum Properties - { "ShowProgress", "", "Not Set", "NotSet", 0 }, - { "ShowProgress", "VERBOSE", "Display all progress messages", "LinkVerbose", - 0 }, - { "ShowProgress", "VERBOSE:Lib", "For Libraries Searched", "LinkVerboseLib", - 0 }, - { "ShowProgress", "VERBOSE:ICF", - "About COMDAT folding during optimized linking", "LinkVerboseICF", 0 }, - { "ShowProgress", "VERBOSE:REF", - "About data removed during optimized linking", "LinkVerboseREF", 0 }, - { "ShowProgress", "VERBOSE:SAFESEH", "About Modules incompatible with SEH", - "LinkVerboseSAFESEH", 0 }, - { "ShowProgress", "VERBOSE:CLR", - "About linker activity related to managed code", "LinkVerboseCLR", 0 }, - - { "ForceFileOutput", "FORCE", "Enabled", "Enabled", 0 }, - { "ForceFileOutput", "FORCE:MULTIPLE", "Multiply Defined Symbol Only", - "MultiplyDefinedSymbolOnly", 0 }, - { "ForceFileOutput", "FORCE:UNRESOLVED", "Undefined Symbol Only", - "UndefinedSymbolOnly", 0 }, - - { "CreateHotPatchableImage", "FUNCTIONPADMIN", "Enabled", "Enabled", 0 }, - { "CreateHotPatchableImage", "FUNCTIONPADMIN:5", "X86 Image Only", - "X86Image", 0 }, - { "CreateHotPatchableImage", "FUNCTIONPADMIN:6", "X64 Image Only", - "X64Image", 0 }, - { "CreateHotPatchableImage", "FUNCTIONPADMIN:16", "Itanium Image Only", - "ItaniumImage", 0 }, - - // correct flags for uac should be /MANIFESTUAC, but some projects already - // use this bug to access uac field, so keep these for compatibility - { "UACExecutionLevel", "level='asInvoker'", "asInvoker", "AsInvoker", 0 }, - { "UACExecutionLevel", "level='highestAvailable'", "highestAvailable", - "HighestAvailable", 0 }, - { "UACExecutionLevel", "level='requireAdministrator'", - "requireAdministrator", "RequireAdministrator", 0 }, - - { "GenerateDebugInformation", "DEBUG:FASTLINK", - "Optimize for faster linking", "DebugFastLink", - cmVS7FlagTable::CaseInsensitive }, - { "GenerateDebugInformation", "DEBUG:FULL", "Optimize for debugging", "true", - cmVS7FlagTable::CaseInsensitive }, - { "GenerateDebugInformation", "DEBUG:NONE", - "Produces no debugging information", "false", - cmVS7FlagTable::CaseInsensitive }, - { "GenerateDebugInformation", "DEBUG", "Optimize for debugging", "true", - cmVS7FlagTable::CaseInsensitive }, - - { "SubSystem", "", "Not Set", "NotSet", 0 }, - { "SubSystem", "SUBSYSTEM:CONSOLE", "Console", "Console", 0 }, - { "SubSystem", "SUBSYSTEM:WINDOWS", "Windows", "Windows", 0 }, - { "SubSystem", "SUBSYSTEM:NATIVE", "Native", "Native", 0 }, - { "SubSystem", "SUBSYSTEM:EFI_APPLICATION", "EFI Application", - "EFI Application", 0 }, - { "SubSystem", "SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER", - "EFI Boot Service Driver", "EFI Boot Service Driver", 0 }, - { "SubSystem", "SUBSYSTEM:EFI_ROM", "EFI ROM", "EFI ROM", 0 }, - { "SubSystem", "SUBSYSTEM:EFI_RUNTIME_DRIVER", "EFI Runtime", "EFI Runtime", - 0 }, - { "SubSystem", "SUBSYSTEM:POSIX", "POSIX", "POSIX", 0 }, - - { "Driver", "", "Not Set", "NotSet", 0 }, - { "Driver", "Driver", "Driver", "Driver", 0 }, - { "Driver", "DRIVER:UPONLY", "UP Only", "UpOnly", 0 }, - { "Driver", "DRIVER:WDM", "WDM", "WDM", 0 }, - - { "LinkTimeCodeGeneration", "", "Default", "Default", 0 }, - { "LinkTimeCodeGeneration", "LTCG:incremental", - "Use Fast Link Time Code Generation", "UseFastLinkTimeCodeGeneration", 0 }, - { "LinkTimeCodeGeneration", "LTCG", "Use Link Time Code Generation", - "UseLinkTimeCodeGeneration", 0 }, - { "LinkTimeCodeGeneration", "LTCG:PGInstrument", - "Profile Guided Optimization - Instrument", "PGInstrument", 0 }, - { "LinkTimeCodeGeneration", "LTCG:PGOptimize", - "Profile Guided Optimization - Optimization", "PGOptimization", 0 }, - { "LinkTimeCodeGeneration", "LTCG:PGUpdate", - "Profile Guided Optimization - Update", "PGUpdate", 0 }, - - { "GenerateWindowsMetadata", "WINMD", "Yes", "true", 0 }, - { "GenerateWindowsMetadata", "WINMD:NO", "No", "false", 0 }, - - { "WindowsMetadataSignHash", "WINMDSIGNHASH:SHA1", "SHA1", "SHA1", 0 }, - { "WindowsMetadataSignHash", "WINMDSIGNHASH:SHA256", "SHA256", "SHA256", 0 }, - { "WindowsMetadataSignHash", "WINMDSIGNHASH:SHA384", "SHA384", "SHA384", 0 }, - { "WindowsMetadataSignHash", "WINMDSIGNHASH:SHA512", "SHA512", "SHA512", 0 }, - - { "TargetMachine", "", "Not Set", "NotSet", 0 }, - { "TargetMachine", "MACHINE:ARM", "MachineARM", "MachineARM", 0 }, - { "TargetMachine", "MACHINE:EBC", "MachineEBC", "MachineEBC", 0 }, - { "TargetMachine", "MACHINE:IA64", "MachineIA64", "MachineIA64", 0 }, - { "TargetMachine", "MACHINE:MIPS", "MachineMIPS", "MachineMIPS", 0 }, - { "TargetMachine", "MACHINE:MIPS16", "MachineMIPS16", "MachineMIPS16", 0 }, - { "TargetMachine", "MACHINE:MIPSFPU", "MachineMIPSFPU", "MachineMIPSFPU", - 0 }, - { "TargetMachine", "MACHINE:MIPSFPU16", "MachineMIPSFPU16", - "MachineMIPSFPU16", 0 }, - { "TargetMachine", "MACHINE:SH4", "MachineSH4", "MachineSH4", 0 }, - { "TargetMachine", "MACHINE:THUMB", "MachineTHUMB", "MachineTHUMB", 0 }, - { "TargetMachine", "MACHINE:X64", "MachineX64", "MachineX64", 0 }, - { "TargetMachine", "MACHINE:X86", "MachineX86", "MachineX86", 0 }, - - { "CLRThreadAttribute", "CLRTHREADATTRIBUTE:MTA", "MTA threading attribute", - "MTAThreadingAttribute", 0 }, - { "CLRThreadAttribute", "CLRTHREADATTRIBUTE:STA", "STA threading attribute", - "STAThreadingAttribute", 0 }, - { "CLRThreadAttribute", "CLRTHREADATTRIBUTE:NONE", - "Default threading attribute", "DefaultThreadingAttribute", 0 }, - - { "CLRImageType", "CLRIMAGETYPE:IJW", "Force IJW image", "ForceIJWImage", - 0 }, - { "CLRImageType", "CLRIMAGETYPE:PURE", "Force Pure IL Image", - "ForcePureILImage", 0 }, - { "CLRImageType", "CLRIMAGETYPE:SAFE", "Force Safe IL Image", - "ForceSafeILImage", 0 }, - { "CLRImageType", "", "Default image type", "Default", 0 }, - - { "SignHash", "CLRSIGNHASH:SHA1", "SHA1", "SHA1", 0 }, - { "SignHash", "CLRSIGNHASH:SHA256", "SHA256", "SHA256", 0 }, - { "SignHash", "CLRSIGNHASH:SHA384", "SHA384", "SHA384", 0 }, - { "SignHash", "CLRSIGNHASH:SHA512", "SHA512", "SHA512", 0 }, - - { "LinkErrorReporting", "ERRORREPORT:PROMPT", "PromptImmediately", - "PromptImmediately", 0 }, - { "LinkErrorReporting", "ERRORREPORT:QUEUE", "Queue For Next Login", - "QueueForNextLogin", 0 }, - { "LinkErrorReporting", "ERRORREPORT:SEND", "Send Error Report", - "SendErrorReport", 0 }, - { "LinkErrorReporting", "ERRORREPORT:NONE", "No Error Report", - "NoErrorReport", 0 }, - - { "CLRSupportLastError", "CLRSupportLastError", "Enabled", "Enabled", 0 }, - { "CLRSupportLastError", "CLRSupportLastError:NO", "Disabled", "Disabled", - 0 }, - { "CLRSupportLastError", "CLRSupportLastError:SYSTEMDLL", "System Dlls Only", - "SystemDlls", 0 }, - - // Bool Properties - { "LinkIncremental", "INCREMENTAL:NO", "", "false", 0 }, - { "LinkIncremental", "INCREMENTAL", "", "true", 0 }, - { "SuppressStartupBanner", "NOLOGO", "", "true", 0 }, - { "LinkStatus", "LTCG:NOSTATUS", "", "false", 0 }, - { "LinkStatus", "LTCG:STATUS", "", "true", 0 }, - { "PreventDllBinding", "ALLOWBIND:NO", "", "false", 0 }, - { "PreventDllBinding", "ALLOWBIND", "", "true", 0 }, - { "TreatLinkerWarningAsErrors", "WX:NO", "", "false", 0 }, - { "TreatLinkerWarningAsErrors", "WX", "", "true", 0 }, - { "IgnoreAllDefaultLibraries", "NODEFAULTLIB", "", "true", 0 }, - { "GenerateManifest", "MANIFEST:NO", "", "false", 0 }, - { "GenerateManifest", "MANIFEST", "", "true", 0 }, - { "AllowIsolation", "ALLOWISOLATION:NO", "", "false", 0 }, - - // correct flags for uac should be /MANIFESTUAC, but some projects already - // use this bug to access uac field, so keep these for compatibility - { "UACUIAccess", "uiAccess='false'", "", "false", 0 }, - { "UACUIAccess", "uiAccess='true'", "", "true", 0 }, - - { "ManifestEmbed", "manifest:embed", "", "true", 0 }, - { "MapExports", "MAPINFO:EXPORTS", "", "true", 0 }, - { "AssemblyDebug", "ASSEMBLYDEBUG:DISABLE", "", "false", 0 }, - { "AssemblyDebug", "ASSEMBLYDEBUG", "", "true", 0 }, - { "LargeAddressAware", "LARGEADDRESSAWARE:NO", "", "false", 0 }, - { "LargeAddressAware", "LARGEADDRESSAWARE", "", "true", 0 }, - { "TerminalServerAware", "TSAWARE:NO", "", "false", 0 }, - { "TerminalServerAware", "TSAWARE", "", "true", 0 }, - { "SwapRunFromCD", "SWAPRUN:CD", "", "true", 0 }, - { "SwapRunFromNET", "SWAPRUN:NET", "", "true", 0 }, - { "OptimizeReferences", "OPT:NOREF", "", "false", 0 }, - { "OptimizeReferences", "OPT:REF", "", "true", 0 }, - { "EnableCOMDATFolding", "OPT:NOICF", "", "false", 0 }, - { "EnableCOMDATFolding", "OPT:ICF", "", "true", 0 }, - { "IgnoreEmbeddedIDL", "IGNOREIDL", "", "true", 0 }, - { "AppContainer", "APPCONTAINER", "", "true", 0 }, - { "WindowsMetadataLinkDelaySign", "WINMDDELAYSIGN:NO", "", "false", 0 }, - { "WindowsMetadataLinkDelaySign", "WINMDDELAYSIGN", "", "true", 0 }, - { "NoEntryPoint", "NOENTRY", "", "true", 0 }, - { "SetChecksum", "RELEASE", "", "true", 0 }, - { "RandomizedBaseAddress", "DYNAMICBASE:NO", "", "false", 0 }, - { "RandomizedBaseAddress", "DYNAMICBASE", "", "true", 0 }, - { "FixedBaseAddress", "FIXED:NO", "", "false", 0 }, - { "FixedBaseAddress", "FIXED", "", "true", 0 }, - { "DataExecutionPrevention", "NXCOMPAT:NO", "", "false", 0 }, - { "DataExecutionPrevention", "NXCOMPAT", "", "true", 0 }, - { "TurnOffAssemblyGeneration", "NOASSEMBLY", "", "true", 0 }, - { "SupportUnloadOfDelayLoadedDLL", "DELAY:UNLOAD", "", "true", 0 }, - { "SupportNobindOfDelayLoadedDLL", "DELAY:NOBIND", "", "true", 0 }, - { "Profile", "PROFILE", "", "true", 0 }, - { "LinkDelaySign", "DELAYSIGN:NO", "", "false", 0 }, - { "LinkDelaySign", "DELAYSIGN", "", "true", 0 }, - { "CLRUnmanagedCodeCheck", "CLRUNMANAGEDCODECHECK:NO", "", "false", 0 }, - { "CLRUnmanagedCodeCheck", "CLRUNMANAGEDCODECHECK", "", "true", 0 }, - { "DetectOneDefinitionRule", "ODR", "", "true", 0 }, - { "ImageHasSafeExceptionHandlers", "SAFESEH:NO", "", "false", 0 }, - { "ImageHasSafeExceptionHandlers", "SAFESEH", "", "true", 0 }, - { "LinkDLL", "DLL", "", "true", 0 }, - - // Bool Properties With Argument - { "EnableUAC", "MANIFESTUAC:", "", "", - cmVS7FlagTable::UserValueRequired | cmVS7FlagTable::SpaceAppendable }, - { "GenerateMapFile", "MAP", "", "true", - cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue }, - { "MapFileName", "MAP:", "Generate Map File", "", - cmVS7FlagTable::UserValueRequired }, - - // String List Properties - { "AdditionalLibraryDirectories", - "LIBPATH:", "Additional Library Directories", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "Natvis", "NATVIS:", "Natvis files", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - // Skip [AdditionalDependencies] - no command line Switch. - { "IgnoreSpecificDefaultLibraries", - "NODEFAULTLIB:", "Ignore Specific Default Libraries", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "AddModuleNamesToAssembly", "ASSEMBLYMODULE:", "Add Module to Assembly", - "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "EmbedManagedResourceFile", - "ASSEMBLYRESOURCE:", "Embed Managed Resource File", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "ForceSymbolReferences", "INCLUDE:", "Force Symbol References", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "DelayLoadDLLs", "DELAYLOAD:", "Delay Loaded Dlls", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "AssemblyLinkResource", "ASSEMBLYLINKRESOURCE:", "Assembly Link Resource", - "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "AdditionalManifestDependencies", - "MANIFESTDEPENDENCY:", "Additional Manifest Dependencies", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "ManifestInput", "manifestinput:", "Manifest Input", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - - // String Properties - { "OutputFile", "OUT:", "Output File", "", cmVS7FlagTable::UserValue }, - { "Version", "VERSION:", "Version", "", cmVS7FlagTable::UserValue }, - { "SpecifySectionAttributes", "SECTION:", "Specify Section Attributes", "", - cmVS7FlagTable::UserValue }, - { "MSDOSStubFileName", "STUB:", "MS-DOS Stub File Name", "", - cmVS7FlagTable::UserValue }, - // Skip [TrackerLogDirectory] - no command line Switch. - { "ModuleDefinitionFile", "DEF:", "Module Definition File", "", - cmVS7FlagTable::UserValue }, - { "ManifestFile", "ManifestFile:", "Manifest File", "", - cmVS7FlagTable::UserValue }, - { "ProgramDatabaseFile", "PDB:", "Generate Program Database File", "", - cmVS7FlagTable::UserValue }, - { "StripPrivateSymbols", "PDBSTRIPPED:", "Strip Private Symbols", "", - cmVS7FlagTable::UserValue }, - // Skip [MapFileName] - no command line Switch. - // Skip [MinimumRequiredVersion] - no command line Switch. - { "HeapReserveSize", "HEAP:", "Heap Reserve Size", "", - cmVS7FlagTable::UserValue }, - // Skip [HeapCommitSize] - no command line Switch. - { "StackReserveSize", "STACK:", "Stack Reserve Size", "", - cmVS7FlagTable::UserValue }, - // Skip [StackCommitSize] - no command line Switch. - { "FunctionOrder", "ORDER:@", "Function Order", "", - cmVS7FlagTable::UserValue }, - { "ProfileGuidedDatabase", "PGD:", "Profile Guided Database", "", - cmVS7FlagTable::UserValue }, - { "MidlCommandFile", "MIDL:@", "MIDL Commands", "", - cmVS7FlagTable::UserValue }, - { "MergedIDLBaseFileName", "IDLOUT:", "Merged IDL Base File Name", "", - cmVS7FlagTable::UserValue }, - { "TypeLibraryFile", "TLBOUT:", "Type Library", "", - cmVS7FlagTable::UserValue }, - { "WindowsMetadataFile", "WINMDFILE:", "Windows Metadata File", "", - cmVS7FlagTable::UserValue }, - { "WindowsMetadataLinkKeyFile", "WINMDKEYFILE:", "Windows Metadata Key File", - "", cmVS7FlagTable::UserValue }, - { "WindowsMetadataKeyContainer", "WINMDKEYCONTAINER:", - "Windows Metadata Key Container", "", cmVS7FlagTable::UserValue }, - { "EntryPointSymbol", "ENTRY:", "Entry Point", "", - cmVS7FlagTable::UserValue }, - { "BaseAddress", "BASE:", "Base Address", "", cmVS7FlagTable::UserValue }, - { "ImportLibrary", "IMPLIB:", "Import Library", "", - cmVS7FlagTable::UserValue }, - { "MergeSections", "MERGE:", "Merge Sections", "", - cmVS7FlagTable::UserValue }, - { "LinkKeyFile", "KEYFILE:", "Key File", "", cmVS7FlagTable::UserValue }, - { "KeyContainer", "KEYCONTAINER:", "Key Container", "", - cmVS7FlagTable::UserValue }, - // Skip [AdditionalOptions] - no command line Switch. - { 0, 0, 0, 0, 0 } -}; diff --git a/Source/cmVS141CLFlagTable.h b/Source/cmVS141CLFlagTable.h deleted file mode 100644 index 7d219be..0000000 --- a/Source/cmVS141CLFlagTable.h +++ /dev/null @@ -1,260 +0,0 @@ -static cmVS7FlagTable cmVS141CLFlagTable[] = { - - // Enum Properties - { "DiagnosticsFormat", "diagnostics:classic", "Classic", "Classic", 0 }, - { "DiagnosticsFormat", "diagnostics:column", "Column", "Column", 0 }, - { "DiagnosticsFormat", "diagnostics:caret", "Caret", "Caret", 0 }, - - { "DebugInformationFormat", "", "None", "None", 0 }, - { "DebugInformationFormat", "Z7", "C7 compatible", "OldStyle", 0 }, - { "DebugInformationFormat", "Zi", "Program Database", "ProgramDatabase", 0 }, - { "DebugInformationFormat", "ZI", "Program Database for Edit And Continue", - "EditAndContinue", 0 }, - - { "WarningLevel", "W0", "Turn Off All Warnings", "TurnOffAllWarnings", 0 }, - { "WarningLevel", "W1", "Level1", "Level1", 0 }, - { "WarningLevel", "W2", "Level2", "Level2", 0 }, - { "WarningLevel", "W3", "Level3", "Level3", 0 }, - { "WarningLevel", "W4", "Level4", "Level4", 0 }, - { "WarningLevel", "Wall", "EnableAllWarnings", "EnableAllWarnings", 0 }, - - { "Optimization", "", "Custom", "Custom", 0 }, - { "Optimization", "Od", "Disabled", "Disabled", 0 }, - { "Optimization", "O1", "Minimize Size", "MinSpace", 0 }, - { "Optimization", "O2", "Maximize Speed", "MaxSpeed", 0 }, - { "Optimization", "Ox", "Full Optimization", "Full", 0 }, - - { "InlineFunctionExpansion", "", "Default", "Default", 0 }, - { "InlineFunctionExpansion", "Ob0", "Disabled", "Disabled", 0 }, - { "InlineFunctionExpansion", "Ob1", "Only __inline", "OnlyExplicitInline", - 0 }, - { "InlineFunctionExpansion", "Ob2", "Any Suitable", "AnySuitable", 0 }, - - { "FavorSizeOrSpeed", "Os", "Favor small code", "Size", 0 }, - { "FavorSizeOrSpeed", "Ot", "Favor fast code", "Speed", 0 }, - { "FavorSizeOrSpeed", "", "Neither", "Neither", 0 }, - - { "ExceptionHandling", "EHa", "Yes with SEH Exceptions", "Async", 0 }, - { "ExceptionHandling", "EHsc", "Yes", "Sync", 0 }, - { "ExceptionHandling", "EHs", "Yes with Extern C functions", "SyncCThrow", - 0 }, - { "ExceptionHandling", "", "No", "false", 0 }, - - { "BasicRuntimeChecks", "RTCs", "Stack Frames", "StackFrameRuntimeCheck", - 0 }, - { "BasicRuntimeChecks", "RTCu", "Uninitialized variables", - "UninitializedLocalUsageCheck", 0 }, - { "BasicRuntimeChecks", "RTC1", "Both (/RTC1, equiv. to /RTCsu)", - "EnableFastChecks", 0 }, - { "BasicRuntimeChecks", "", "Default", "Default", 0 }, - - { "RuntimeLibrary", "MT", "Multi-threaded", "MultiThreaded", 0 }, - { "RuntimeLibrary", "MTd", "Multi-threaded Debug", "MultiThreadedDebug", 0 }, - { "RuntimeLibrary", "MD", "Multi-threaded DLL", "MultiThreadedDLL", 0 }, - { "RuntimeLibrary", "MDd", "Multi-threaded Debug DLL", - "MultiThreadedDebugDLL", 0 }, - - { "StructMemberAlignment", "Zp1", "1 Byte", "1Byte", 0 }, - { "StructMemberAlignment", "Zp2", "2 Bytes", "2Bytes", 0 }, - { "StructMemberAlignment", "Zp4", "4 Byte", "4Bytes", 0 }, - { "StructMemberAlignment", "Zp8", "8 Bytes", "8Bytes", 0 }, - { "StructMemberAlignment", "Zp16", "16 Bytes", "16Bytes", 0 }, - { "StructMemberAlignment", "", "Default", "Default", 0 }, - - { "BufferSecurityCheck", "GS-", "Disable Security Check", "false", 0 }, - { "BufferSecurityCheck", "GS", "Enable Security Check", "true", 0 }, - - { "ControlFlowGuard", "guard:cf", "Yes", "Guard", 0 }, - { "ControlFlowGuard", "", "No", "false", 0 }, - - { "EnableEnhancedInstructionSet", "arch:SSE", "Streaming SIMD Extensions", - "StreamingSIMDExtensions", 0 }, - { "EnableEnhancedInstructionSet", "arch:SSE2", "Streaming SIMD Extensions 2", - "StreamingSIMDExtensions2", 0 }, - { "EnableEnhancedInstructionSet", "arch:AVX", "Advanced Vector Extensions", - "AdvancedVectorExtensions", 0 }, - { "EnableEnhancedInstructionSet", "arch:AVX2", - "Advanced Vector Extensions 2", "AdvancedVectorExtensions2", 0 }, - { "EnableEnhancedInstructionSet", "arch:IA32", "No Enhanced Instructions", - "NoExtensions", 0 }, - { "EnableEnhancedInstructionSet", "", "Not Set", "NotSet", 0 }, - - { "FloatingPointModel", "fp:precise", "Precise", "Precise", 0 }, - { "FloatingPointModel", "fp:strict", "Strict", "Strict", 0 }, - { "FloatingPointModel", "fp:fast", "Fast", "Fast", 0 }, - - { "SpectreMitigation", "Qspectre", "Spectre mitigations", "Spectre", 0 }, - - { "LanguageStandard", "std:c++17", "ISO C++17 Standard", "stdcpp17", 0 }, - { "LanguageStandard", "std:c++14", "ISO C++14 Standard", "stdcpp14", 0 }, - { "LanguageStandard", "std:c++latest", "ISO C++ Latest Draft Standard", - "stdcpplatest", 0 }, - - { "PrecompiledHeader", "Yc", "Create", "Create", - cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue }, - { "PrecompiledHeader", "Yu", "Use", "Use", - cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue }, - { "PrecompiledHeader", "Y-", "Not Using Precompiled Headers", "NotUsing", - 0 }, - - { "AssemblerOutput", "", "No Listing", "NoListing", 0 }, - { "AssemblerOutput", "FA", "Assembly-Only Listing", "AssemblyCode", 0 }, - { "AssemblerOutput", "FAc", "Assembly With Machine Code", - "AssemblyAndMachineCode", 0 }, - { "AssemblerOutput", "FAs", "Assembly With Source Code", - "AssemblyAndSourceCode", 0 }, - { "AssemblerOutput", "FAcs", "Assembly, Machine Code and Source", "All", 0 }, - - { "CallingConvention", "Gd", "__cdecl", "Cdecl", 0 }, - { "CallingConvention", "Gr", "__fastcall", "FastCall", 0 }, - { "CallingConvention", "Gz", "__stdcall", "StdCall", 0 }, - { "CallingConvention", "Gv", "__vectorcall", "VectorCall", 0 }, - - { "CompileAs", "", "Default", "Default", 0 }, - { "CompileAs", "TC", "Compile as C Code", "CompileAsC", 0 }, - { "CompileAs", "TP", "Compile as C++ Code", "CompileAsCpp", 0 }, - - { "ErrorReporting", "errorReport:none", "Do Not Send Report", "None", 0 }, - { "ErrorReporting", "errorReport:prompt", "Prompt Immediately", "Prompt", - 0 }, - { "ErrorReporting", "errorReport:queue", "Queue For Next Login", "Queue", - 0 }, - { "ErrorReporting", "errorReport:send", "Send Automatically", "Send", 0 }, - - { "CompileAsManaged", "", "No Common Language RunTime Support", "false", 0 }, - { "CompileAsManaged", "clr", "Common Language RunTime Support", "true", 0 }, - { "CompileAsManaged", "clr:pure", - "Pure MSIL Common Language RunTime Support", "Pure", 0 }, - { "CompileAsManaged", "clr:safe", - "Safe MSIL Common Language RunTime Support", "Safe", 0 }, - { "CompileAsManaged", "clr:oldSyntax", - "Common Language RunTime Support, Old Syntax", "OldSyntax", 0 }, - - { "CppLanguageStandard", "", "Default", "Default", 0 }, - { "CppLanguageStandard", "std=c++98", "C++03", "c++98", 0 }, - { "CppLanguageStandard", "std=c++11", "C++11", "c++11", 0 }, - { "CppLanguageStandard", "std=c++1y", "C++14", "c++1y", 0 }, - { "CppLanguageStandard", "std=c++14", "C++14", "c++1y", 0 }, - { "CppLanguageStandard", "std=gnu++98", "C++03 (GNU Dialect)", "gnu++98", - 0 }, - { "CppLanguageStandard", "std=gnu++11", "C++11 (GNU Dialect)", "gnu++11", - 0 }, - { "CppLanguageStandard", "std=gnu++1y", "C++14 (GNU Dialect)", "gnu++1y", - 0 }, - { "CppLanguageStandard", "std=gnu++14", "C++14 (GNU Dialect)", "gnu++1y", - 0 }, - - // Bool Properties - { "CompileAsWinRT", "ZW", "", "true", 0 }, - { "WinRTNoStdLib", "ZW:nostdlib", "", "true", 0 }, - { "SuppressStartupBanner", "nologo", "", "true", 0 }, - { "TreatWarningAsError", "WX-", "", "false", 0 }, - { "TreatWarningAsError", "WX", "", "true", 0 }, - { "SDLCheck", "sdl-", "", "false", 0 }, - { "SDLCheck", "sdl", "", "true", 0 }, - { "IntrinsicFunctions", "Oi", "", "true", 0 }, - { "OmitFramePointers", "Oy-", "", "false", 0 }, - { "OmitFramePointers", "Oy", "", "true", 0 }, - { "EnableFiberSafeOptimizations", "GT", "", "true", 0 }, - { "WholeProgramOptimization", "GL", "", "true", 0 }, - { "UndefineAllPreprocessorDefinitions", "u", "", "true", 0 }, - { "IgnoreStandardIncludePath", "X", "", "true", 0 }, - { "PreprocessToFile", "P", "", "true", 0 }, - { "PreprocessSuppressLineNumbers", "EP", "", "true", 0 }, - { "PreprocessKeepComments", "C", "", "true", 0 }, - { "StringPooling", "GF-", "", "false", 0 }, - { "StringPooling", "GF", "", "true", 0 }, - { "MinimalRebuild", "Gm-", "", "false", 0 }, - { "MinimalRebuild", "Gm", "", "true", 0 }, - { "SmallerTypeCheck", "RTCc", "", "true", 0 }, - { "FunctionLevelLinking", "Gy-", "", "false", 0 }, - { "FunctionLevelLinking", "Gy", "", "true", 0 }, - { "EnableParallelCodeGeneration", "Qpar-", "", "false", 0 }, - { "EnableParallelCodeGeneration", "Qpar", "", "true", 0 }, - { "FloatingPointExceptions", "fp:except-", "", "false", 0 }, - { "FloatingPointExceptions", "fp:except", "", "true", 0 }, - { "CreateHotpatchableImage", "hotpatch", "", "true", 0 }, - { "DisableLanguageExtensions", "Za", "", "true", 0 }, - { "TreatWChar_tAsBuiltInType", "Zc:wchar_t-", "", "false", 0 }, - { "TreatWChar_tAsBuiltInType", "Zc:wchar_t", "", "true", 0 }, - { "ForceConformanceInForLoopScope", "Zc:forScope-", "", "false", 0 }, - { "ForceConformanceInForLoopScope", "Zc:forScope", "", "true", 0 }, - { "RemoveUnreferencedCodeData", "Zc:inline-", "", "false", 0 }, - { "RemoveUnreferencedCodeData", "Zc:inline", "", "true", 0 }, - { "EnforceTypeConversionRules", "Zc:rvalueCast-", "", "false", 0 }, - { "EnforceTypeConversionRules", "Zc:rvalueCast", "", "true", 0 }, - { "RuntimeTypeInfo", "GR-", "", "false", 0 }, - { "RuntimeTypeInfo", "GR", "", "true", 0 }, - { "OpenMPSupport", "openmp-", "", "false", 0 }, - { "OpenMPSupport", "openmp", "", "true", 0 }, - { "ExpandAttributedSource", "Fx", "", "true", 0 }, - { "UseUnicodeForAssemblerListing", "FAu", "", "true", 0 }, - { "ShowIncludes", "showIncludes", "", "true", 0 }, - { "EnablePREfast", "analyze-", "", "false", 0 }, - { "EnablePREfast", "analyze", "", "true", 0 }, - { "UseFullPaths", "FC", "", "true", 0 }, - { "OmitDefaultLibName", "Zl", "", "true", 0 }, - { "SupportJustMyCode", "JMC-", "", "false", 0 }, - { "SupportJustMyCode", "JMC", "", "true", 0 }, - - // Bool Properties With Argument - { "MultiProcessorCompilation", "MP", "", "true", - cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue }, - { "ProcessorNumber", "MP", "Multi-processor Compilation", "", - cmVS7FlagTable::UserValueRequired }, - { "GenerateXMLDocumentationFiles", "doc", "", "true", - cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue }, - { "XMLDocumentationFileName", "doc", "Generate XML Documentation Files", "", - cmVS7FlagTable::UserValueRequired }, - { "BrowseInformation", "FR", "", "true", - cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue }, - { "BrowseInformationFile", "FR", "Enable Browse Information", "", - cmVS7FlagTable::UserValueRequired }, - - // String List Properties - { "AdditionalIncludeDirectories", "I", "Additional Include Directories", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "AdditionalUsingDirectories", "AI", "Additional #using Directories", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "PreprocessorDefinitions", "D ", "Preprocessor Definitions", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "UndefinePreprocessorDefinitions", "U", - "Undefine Preprocessor Definitions", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "DisableSpecificWarnings", "wd", "Disable Specific Warnings", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "ForcedIncludeFiles", "FI", "Forced Include File", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "ForcedUsingFiles", "FU", "Forced #using File", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "PREfastLog", "analyze:log", "Code Analysis Log", "", - cmVS7FlagTable::UserFollowing }, - { "PREfastAdditionalPlugins", "analyze:plugin", - "Additional Code Analysis Native plugins", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "TreatSpecificWarningsAsErrors", "we", "Treat Specific Warnings As Errors", - "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - - // String Properties - { "WarningVersion", "Wv:", "Warning Version", "", - cmVS7FlagTable::UserValue }, - // Skip [TrackerLogDirectory] - no command line Switch. - { "PreprocessOutputPath", "Fi", "Preprocess Output Path", "", - cmVS7FlagTable::UserValue }, - { "PrecompiledHeaderFile", "Yc", "Precompiled Header Name", "", - cmVS7FlagTable::UserValueRequired }, - { "PrecompiledHeaderFile", "Yu", "Precompiled Header Name", "", - cmVS7FlagTable::UserValueRequired }, - { "PrecompiledHeaderOutputFile", "Fp", "Precompiled Header Output File", "", - cmVS7FlagTable::UserValue }, - { "AssemblerListingLocation", "Fa", "ASM List Location", "", - cmVS7FlagTable::UserValue }, - { "ObjectFileName", "Fo", "Object File Name", "", - cmVS7FlagTable::UserValue }, - { "ProgramDataBaseFileName", "Fd", "Program Database File Name", "", - cmVS7FlagTable::UserValue }, - // Skip [XMLDocumentationFileName] - no command line Switch. - // Skip [BrowseInformationFile] - no command line Switch. - // Skip [AdditionalOptions] - no command line Switch. - { 0, 0, 0, 0, 0 } -}; diff --git a/Source/cmVS141CSharpFlagTable.h b/Source/cmVS141CSharpFlagTable.h deleted file mode 100644 index 1f84097..0000000 --- a/Source/cmVS141CSharpFlagTable.h +++ /dev/null @@ -1,126 +0,0 @@ -static cmVS7FlagTable cmVS141CSharpFlagTable[] = { - { "ProjectName", "out:", "", "", cmIDEFlagTable::UserValueRequired }, - - { "OutputType", "target:exe", "", "Exe", 0 }, - { "OutputType", "target:winexe", "", "Winexe", 0 }, - { "OutputType", "target:library", "", "Library", 0 }, - { "OutputType", "target:module", "", "Module", 0 }, - - { "DocumentationFile", "doc", "", "", cmIDEFlagTable::UserValueRequired }, - - { "Platform", "platform:x86", "", "x86", 0 }, - { "Platform", "platform:Itanium", "", "Itanium", 0 }, - { "Platform", "platform:x64", "", "x64", 0 }, - { "Platform", "platform:arm", "", "arm", 0 }, - { "Platform", "platform:anycpu32bitpreferred", "", "anycpu32bitpreferred", - 0 }, - { "Platform", "platform:anycpu", "", "anycpu", 0 }, - - { "References", "reference:", "mit alias", "", 0 }, - { "References", "reference:", "dateiliste", "", 0 }, - { "AddModules", "addmodule:", "", "", cmIDEFlagTable::SemicolonAppendable }, - { "", "link", "", "", 0 }, - - { "Win32Resource", "win32res:", "", "", cmIDEFlagTable::UserValueRequired }, - { "ApplicationIcon", "win32icon:", "", "", - cmIDEFlagTable::UserValueRequired }, - - { "ApplicationManifest", "win32manifest:", "", "", - cmIDEFlagTable::UserValueRequired }, - - { "NoWin32Manifest", "nowin32manifest", "", "true", 0 }, - - { "DefineDebug", "debug", "", "true", cmIDEFlagTable::Continue }, - - { "DebugSymbols", "debug", "", "true", 0 }, - { "DebugSymbols", "debug-", "", "false", 0 }, - { "DebugSymbols", "debug+", "", "true", 0 }, - - { "DebugType", "debug:none", "", "none", 0 }, - { "DebugType", "debug:full", "", "full", 0 }, - { "DebugType", "debug:pdbonly", "", "pdbonly", 0 }, - - { "Optimize", "optimize", "", "true", 0 }, - { "Optimize", "optimize-", "", "false", 0 }, - { "Optimize", "optimize+", "", "true", 0 }, - - { "TreatWarningsAsErrors", "warnaserror", "", "true", 0 }, - { "TreatWarningsAsErrors", "warnaserror-", "", "false", 0 }, - { "TreatWarningsAsErrors", "warnaserror+", "", "true", 0 }, - - { "WarningsAsErrors", "warnaserror", "", "", 0 }, - { "WarningsAsErrors", "warnaserror-", "", "", 0 }, - { "WarningsAsErrors", "warnaserror+", "", "", 0 }, - - { "WarningLevel", "warn:0", "", "0", 0 }, - { "WarningLevel", "warn:1", "", "1", 0 }, - { "WarningLevel", "warn:2", "", "2", 0 }, - { "WarningLevel", "warn:3", "", "3", 0 }, - { "WarningLevel", "warn:4", "", "4", 0 }, - { "DisabledWarnings", "nowarn", "", "", 0 }, - - { "CheckForOverflowUnderflow", "checked", "", "true", 0 }, - { "CheckForOverflowUnderflow", "checked-", "", "false", 0 }, - { "CheckForOverflowUnderflow", "checked+", "", "true", 0 }, - - { "AllowUnsafeBlocks", "unsafe", "", "true", 0 }, - { "AllowUnsafeBlocks", "unsafe-", "", "false", 0 }, - { "AllowUnsafeBlocks", "unsafe+", "", "true", 0 }, - - { "DefineConstants", "define:", "", "", - cmIDEFlagTable::SemicolonAppendable | cmIDEFlagTable::UserValue }, - - { "LangVersion", "langversion:ISO-1", "", "ISO-1", 0 }, - { "LangVersion", "langversion:ISO-2", "", "ISO-2", 0 }, - { "LangVersion", "langversion:3", "", "3", 0 }, - { "LangVersion", "langversion:4", "", "4", 0 }, - { "LangVersion", "langversion:5", "", "5", 0 }, - { "LangVersion", "langversion:6", "", "6", 0 }, - { "LangVersion", "langversion:7.0", "", "7.0", 0 }, - { "LangVersion", "langversion:7.1", "", "7.1", 0 }, - { "LangVersion", "langversion:7.2", "", "7.2", 0 }, - { "LangVersion", "langversion:7.3", "", "7.3", 0 }, - { "LangVersion", "langversion:default", "", "default", 0 }, - { "LangVersion", "langversion:latest", "", "latest", 0 }, - - { "DelaySign", "delaysign", "", "true", 0 }, - { "DelaySign", "delaysign-", "", "false", 0 }, - { "DelaySign", "delaysign+", "", "true", 0 }, - - { "AssemblyOriginatorKeyFile", "keyfile", "", "", 0 }, - - { "KeyContainerName", "keycontainer", "", "", 0 }, - - { "NoLogo", "nologo", "", "", 0 }, - - { "NoConfig", "noconfig", "", "true", 0 }, - - { "BaseAddress", "baseaddress:", "", "", 0 }, - - { "CodePage", "codepage", "", "", 0 }, - - { "Utf8Output", "utf8output", "", "", 0 }, - - { "MainEntryPoint", "main:", "", "", 0 }, - - { "GenerateFullPaths", "fullpaths", "", "true", 0 }, - - { "FileAlignment", "filealign", "", "", 0 }, - - { "PdbFile", "pdb:", "", "", 0 }, - - { "NoStandardLib", "nostdlib", "", "true", 0 }, - { "NoStandardLib", "nostdlib-", "", "false", 0 }, - { "NoStandardLib", "nostdlib+", "", "true", 0 }, - - { "SubsystemVersion", "subsystemversion", "", "", 0 }, - - { "AdditionalLibPaths", "lib:", "", "", 0 }, - - { "ErrorReport", "errorreport:none", "Do Not Send Report", "none", 0 }, - { "ErrorReport", "errorreport:prompt", "Prompt Immediately", "prompt", 0 }, - { "ErrorReport", "errorreport:queue", "Queue For Next Login", "queue", 0 }, - { "ErrorReport", "errorreport:send", "Send Automatically", "send", 0 }, - - { 0, 0, 0, 0, 0 }, -}; diff --git a/Source/cmVS141LinkFlagTable.h b/Source/cmVS141LinkFlagTable.h deleted file mode 100644 index 7e56c8e..0000000 --- a/Source/cmVS141LinkFlagTable.h +++ /dev/null @@ -1,287 +0,0 @@ -static cmVS7FlagTable cmVS141LinkFlagTable[] = { - - // Enum Properties - { "ShowProgress", "", "Not Set", "NotSet", 0 }, - { "ShowProgress", "VERBOSE", "Display all progress messages", "LinkVerbose", - 0 }, - { "ShowProgress", "VERBOSE:Lib", "For Libraries Searched", "LinkVerboseLib", - 0 }, - { "ShowProgress", "VERBOSE:ICF", - "About COMDAT folding during optimized linking", "LinkVerboseICF", 0 }, - { "ShowProgress", "VERBOSE:REF", - "About data removed during optimized linking", "LinkVerboseREF", 0 }, - { "ShowProgress", "VERBOSE:SAFESEH", "About Modules incompatible with SEH", - "LinkVerboseSAFESEH", 0 }, - { "ShowProgress", "VERBOSE:CLR", - "About linker activity related to managed code", "LinkVerboseCLR", 0 }, - - { "ForceFileOutput", "FORCE", "Enabled", "Enabled", 0 }, - { "ForceFileOutput", "FORCE:MULTIPLE", "Multiply Defined Symbol Only", - "MultiplyDefinedSymbolOnly", 0 }, - { "ForceFileOutput", "FORCE:UNRESOLVED", "Undefined Symbol Only", - "UndefinedSymbolOnly", 0 }, - - { "CreateHotPatchableImage", "FUNCTIONPADMIN", "Enabled", "Enabled", 0 }, - { "CreateHotPatchableImage", "FUNCTIONPADMIN:5", "X86 Image Only", - "X86Image", 0 }, - { "CreateHotPatchableImage", "FUNCTIONPADMIN:6", "X64 Image Only", - "X64Image", 0 }, - { "CreateHotPatchableImage", "FUNCTIONPADMIN:16", "Itanium Image Only", - "ItaniumImage", 0 }, - - // correct flags for uac should be /MANIFESTUAC, but some projects already - // use this bug to access uac field, so keep these for compatibility - { "UACExecutionLevel", "level='asInvoker'", "asInvoker", "AsInvoker", 0 }, - { "UACExecutionLevel", "level='highestAvailable'", "highestAvailable", - "HighestAvailable", 0 }, - { "UACExecutionLevel", "level='requireAdministrator'", - "requireAdministrator", "RequireAdministrator", 0 }, - - { "GenerateDebugInformation", "DEBUG:FASTLINK", - "Generate Debug Information optimized for faster links", "DebugFastLink", - cmVS7FlagTable::CaseInsensitive }, - { "GenerateDebugInformation", "DEBUG:FULL", - "Generate Debug Information optimized for sharing and publishing", - "DebugFull", cmVS7FlagTable::CaseInsensitive }, - { "GenerateDebugInformation", "DEBUG:NONE", - "Produces no debugging information", "false", - cmVS7FlagTable::CaseInsensitive }, - { "GenerateDebugInformation", "DEBUG", "Generate Debug Information", "true", - cmVS7FlagTable::CaseInsensitive }, - - { "SubSystem", "", "Not Set", "NotSet", 0 }, - { "SubSystem", "SUBSYSTEM:CONSOLE", "Console", "Console", 0 }, - { "SubSystem", "SUBSYSTEM:WINDOWS", "Windows", "Windows", 0 }, - { "SubSystem", "SUBSYSTEM:NATIVE", "Native", "Native", 0 }, - { "SubSystem", "SUBSYSTEM:EFI_APPLICATION", "EFI Application", - "EFI Application", 0 }, - { "SubSystem", "SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER", - "EFI Boot Service Driver", "EFI Boot Service Driver", 0 }, - { "SubSystem", "SUBSYSTEM:EFI_ROM", "EFI ROM", "EFI ROM", 0 }, - { "SubSystem", "SUBSYSTEM:EFI_RUNTIME_DRIVER", "EFI Runtime", "EFI Runtime", - 0 }, - { "SubSystem", "SUBSYSTEM:POSIX", "POSIX", "POSIX", 0 }, - - { "Driver", "", "Not Set", "NotSet", 0 }, - { "Driver", "Driver", "Driver", "Driver", 0 }, - { "Driver", "DRIVER:UPONLY", "UP Only", "UpOnly", 0 }, - { "Driver", "DRIVER:WDM", "WDM", "WDM", 0 }, - - { "LinkTimeCodeGeneration", "", "Default", "Default", 0 }, - { "LinkTimeCodeGeneration", "LTCG:incremental", - "Use Fast Link Time Code Generation", "UseFastLinkTimeCodeGeneration", 0 }, - { "LinkTimeCodeGeneration", "LTCG", "Use Link Time Code Generation", - "UseLinkTimeCodeGeneration", 0 }, - { "LinkTimeCodeGeneration", "LTCG:PGInstrument", - "Profile Guided Optimization - Instrument", "PGInstrument", 0 }, - { "LinkTimeCodeGeneration", "LTCG:PGOptimize", - "Profile Guided Optimization - Optimization", "PGOptimization", 0 }, - { "LinkTimeCodeGeneration", "LTCG:PGUpdate", - "Profile Guided Optimization - Update", "PGUpdate", 0 }, - - { "GenerateWindowsMetadata", "WINMD", "Yes", "true", 0 }, - { "GenerateWindowsMetadata", "WINMD:NO", "No", "false", 0 }, - - { "WindowsMetadataSignHash", "WINMDSIGNHASH:SHA1", "SHA1", "SHA1", 0 }, - { "WindowsMetadataSignHash", "WINMDSIGNHASH:SHA256", "SHA256", "SHA256", 0 }, - { "WindowsMetadataSignHash", "WINMDSIGNHASH:SHA384", "SHA384", "SHA384", 0 }, - { "WindowsMetadataSignHash", "WINMDSIGNHASH:SHA512", "SHA512", "SHA512", 0 }, - - { "TargetMachine", "", "Not Set", "NotSet", 0 }, - { "TargetMachine", "MACHINE:ARM", "MachineARM", "MachineARM", 0 }, - { "TargetMachine", "MACHINE:ARM64", "MachineARM64", "MachineARM64", 0 }, - { "TargetMachine", "MACHINE:EBC", "MachineEBC", "MachineEBC", 0 }, - { "TargetMachine", "MACHINE:IA64", "MachineIA64", "MachineIA64", 0 }, - { "TargetMachine", "MACHINE:MIPS", "MachineMIPS", "MachineMIPS", 0 }, - { "TargetMachine", "MACHINE:MIPS16", "MachineMIPS16", "MachineMIPS16", 0 }, - { "TargetMachine", "MACHINE:MIPSFPU", "MachineMIPSFPU", "MachineMIPSFPU", - 0 }, - { "TargetMachine", "MACHINE:MIPSFPU16", "MachineMIPSFPU16", - "MachineMIPSFPU16", 0 }, - { "TargetMachine", "MACHINE:SH4", "MachineSH4", "MachineSH4", 0 }, - { "TargetMachine", "MACHINE:THUMB", "MachineTHUMB", "MachineTHUMB", 0 }, - { "TargetMachine", "MACHINE:X64", "MachineX64", "MachineX64", 0 }, - { "TargetMachine", "MACHINE:X86", "MachineX86", "MachineX86", 0 }, - - { "CLRThreadAttribute", "CLRTHREADATTRIBUTE:MTA", "MTA threading attribute", - "MTAThreadingAttribute", 0 }, - { "CLRThreadAttribute", "CLRTHREADATTRIBUTE:STA", "STA threading attribute", - "STAThreadingAttribute", 0 }, - { "CLRThreadAttribute", "CLRTHREADATTRIBUTE:NONE", - "Default threading attribute", "DefaultThreadingAttribute", 0 }, - - { "CLRImageType", "CLRIMAGETYPE:IJW", "Force IJW image", "ForceIJWImage", - 0 }, - { "CLRImageType", "CLRIMAGETYPE:PURE", "Force Pure IL Image", - "ForcePureILImage", 0 }, - { "CLRImageType", "CLRIMAGETYPE:SAFE", "Force Safe IL Image", - "ForceSafeILImage", 0 }, - { "CLRImageType", "", "Default image type", "Default", 0 }, - - { "SignHash", "CLRSIGNHASH:SHA1", "SHA1", "SHA1", 0 }, - { "SignHash", "CLRSIGNHASH:SHA256", "SHA256", "SHA256", 0 }, - { "SignHash", "CLRSIGNHASH:SHA384", "SHA384", "SHA384", 0 }, - { "SignHash", "CLRSIGNHASH:SHA512", "SHA512", "SHA512", 0 }, - - { "LinkErrorReporting", "ERRORREPORT:PROMPT", "PromptImmediately", - "PromptImmediately", 0 }, - { "LinkErrorReporting", "ERRORREPORT:QUEUE", "Queue For Next Login", - "QueueForNextLogin", 0 }, - { "LinkErrorReporting", "ERRORREPORT:SEND", "Send Error Report", - "SendErrorReport", 0 }, - { "LinkErrorReporting", "ERRORREPORT:NONE", "No Error Report", - "NoErrorReport", 0 }, - - { "CLRSupportLastError", "CLRSupportLastError", "Enabled", "Enabled", 0 }, - { "CLRSupportLastError", "CLRSupportLastError:NO", "Disabled", "Disabled", - 0 }, - { "CLRSupportLastError", "CLRSupportLastError:SYSTEMDLL", "System Dlls Only", - "SystemDlls", 0 }, - - // Bool Properties - { "LinkIncremental", "INCREMENTAL:NO", "", "false", 0 }, - { "LinkIncremental", "INCREMENTAL", "", "true", 0 }, - { "SuppressStartupBanner", "NOLOGO", "", "true", 0 }, - { "LinkStatus", "LTCG:NOSTATUS", "", "false", 0 }, - { "LinkStatus", "LTCG:STATUS", "", "true", 0 }, - { "PreventDllBinding", "ALLOWBIND:NO", "", "false", 0 }, - { "PreventDllBinding", "ALLOWBIND", "", "true", 0 }, - { "TreatLinkerWarningAsErrors", "WX:NO", "", "false", 0 }, - { "TreatLinkerWarningAsErrors", "WX", "", "true", 0 }, - { "IgnoreAllDefaultLibraries", "NODEFAULTLIB", "", "true", 0 }, - { "GenerateManifest", "MANIFEST:NO", "", "false", 0 }, - { "GenerateManifest", "MANIFEST", "", "true", 0 }, - { "AllowIsolation", "ALLOWISOLATION:NO", "", "false", 0 }, - - // correct flags for uac should be /MANIFESTUAC, but some projects already - // use this bug to access uac field, so keep these for compatibility - { "UACUIAccess", "uiAccess='false'", "", "false", 0 }, - { "UACUIAccess", "uiAccess='true'", "", "true", 0 }, - - { "ManifestEmbed", "manifest:embed", "", "true", 0 }, - { "MapExports", "MAPINFO:EXPORTS", "", "true", 0 }, - { "AssemblyDebug", "ASSEMBLYDEBUG:DISABLE", "", "false", 0 }, - { "AssemblyDebug", "ASSEMBLYDEBUG", "", "true", 0 }, - { "LargeAddressAware", "LARGEADDRESSAWARE:NO", "", "false", 0 }, - { "LargeAddressAware", "LARGEADDRESSAWARE", "", "true", 0 }, - { "TerminalServerAware", "TSAWARE:NO", "", "false", 0 }, - { "TerminalServerAware", "TSAWARE", "", "true", 0 }, - { "SwapRunFromCD", "SWAPRUN:CD", "", "true", 0 }, - { "SwapRunFromNET", "SWAPRUN:NET", "", "true", 0 }, - { "OptimizeReferences", "OPT:NOREF", "", "false", 0 }, - { "OptimizeReferences", "OPT:REF", "", "true", 0 }, - { "EnableCOMDATFolding", "OPT:NOICF", "", "false", 0 }, - { "EnableCOMDATFolding", "OPT:ICF", "", "true", 0 }, - { "IgnoreEmbeddedIDL", "IGNOREIDL", "", "true", 0 }, - { "AppContainer", "APPCONTAINER", "", "true", 0 }, - { "WindowsMetadataLinkDelaySign", "WINMDDELAYSIGN:NO", "", "false", 0 }, - { "WindowsMetadataLinkDelaySign", "WINMDDELAYSIGN", "", "true", 0 }, - { "NoEntryPoint", "NOENTRY", "", "true", 0 }, - { "SetChecksum", "RELEASE", "", "true", 0 }, - { "RandomizedBaseAddress", "DYNAMICBASE:NO", "", "false", 0 }, - { "RandomizedBaseAddress", "DYNAMICBASE", "", "true", 0 }, - { "FixedBaseAddress", "FIXED:NO", "", "false", 0 }, - { "FixedBaseAddress", "FIXED", "", "true", 0 }, - { "DataExecutionPrevention", "NXCOMPAT:NO", "", "false", 0 }, - { "DataExecutionPrevention", "NXCOMPAT", "", "true", 0 }, - { "TurnOffAssemblyGeneration", "NOASSEMBLY", "", "true", 0 }, - { "SupportUnloadOfDelayLoadedDLL", "DELAY:UNLOAD", "", "true", 0 }, - { "SupportNobindOfDelayLoadedDLL", "DELAY:NOBIND", "", "true", 0 }, - { "Profile", "PROFILE", "", "true", 0 }, - { "LinkDelaySign", "DELAYSIGN:NO", "", "false", 0 }, - { "LinkDelaySign", "DELAYSIGN", "", "true", 0 }, - { "CLRUnmanagedCodeCheck", "CLRUNMANAGEDCODECHECK:NO", "", "false", 0 }, - { "CLRUnmanagedCodeCheck", "CLRUNMANAGEDCODECHECK", "", "true", 0 }, - { "DetectOneDefinitionRule", "ODR", "", "true", 0 }, - { "ImageHasSafeExceptionHandlers", "SAFESEH:NO", "", "false", 0 }, - { "ImageHasSafeExceptionHandlers", "SAFESEH", "", "true", 0 }, - { "LinkDLL", "DLL", "", "true", 0 }, - - // Bool Properties With Argument - { "EnableUAC", "MANIFESTUAC:", "", "", - cmVS7FlagTable::UserValueRequired | cmVS7FlagTable::SpaceAppendable }, - { "GenerateMapFile", "MAP", "", "true", - cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue }, - { "MapFileName", "MAP:", "Generate Map File", "", - cmVS7FlagTable::UserValueRequired }, - - // String List Properties - { "AdditionalLibraryDirectories", - "LIBPATH:", "Additional Library Directories", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "Natvis", "NATVIS:", "Natvis files", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - // Skip [AdditionalDependencies] - no command line Switch. - { "IgnoreSpecificDefaultLibraries", - "NODEFAULTLIB:", "Ignore Specific Default Libraries", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "AddModuleNamesToAssembly", "ASSEMBLYMODULE:", "Add Module to Assembly", - "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "EmbedManagedResourceFile", - "ASSEMBLYRESOURCE:", "Embed Managed Resource File", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "ForceSymbolReferences", "INCLUDE:", "Force Symbol References", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "DelayLoadDLLs", "DELAYLOAD:", "Delay Loaded Dlls", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "AssemblyLinkResource", "ASSEMBLYLINKRESOURCE:", "Assembly Link Resource", - "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "AdditionalManifestDependencies", - "MANIFESTDEPENDENCY:", "Additional Manifest Dependencies", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "ManifestInput", "manifestinput:", "Manifest Input", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - - // String Properties - { "OutputFile", "OUT:", "Output File", "", cmVS7FlagTable::UserValue }, - { "Version", "VERSION:", "Version", "", cmVS7FlagTable::UserValue }, - { "SpecifySectionAttributes", "SECTION:", "Specify Section Attributes", "", - cmVS7FlagTable::UserValue }, - { "MSDOSStubFileName", "STUB:", "MS-DOS Stub File Name", "", - cmVS7FlagTable::UserValue }, - // Skip [TrackerLogDirectory] - no command line Switch. - { "ModuleDefinitionFile", "DEF:", "Module Definition File", "", - cmVS7FlagTable::UserValue }, - { "ManifestFile", "ManifestFile:", "Manifest File", "", - cmVS7FlagTable::UserValue }, - { "ProgramDatabaseFile", "PDB:", "Generate Program Database File", "", - cmVS7FlagTable::UserValue }, - { "StripPrivateSymbols", "PDBSTRIPPED:", "Strip Private Symbols", "", - cmVS7FlagTable::UserValue }, - // Skip [MapFileName] - no command line Switch. - // Skip [MinimumRequiredVersion] - no command line Switch. - { "HeapReserveSize", "HEAP:", "Heap Reserve Size", "", - cmVS7FlagTable::UserValue }, - // Skip [HeapCommitSize] - no command line Switch. - { "StackReserveSize", "STACK:", "Stack Reserve Size", "", - cmVS7FlagTable::UserValue }, - // Skip [StackCommitSize] - no command line Switch. - { "FunctionOrder", "ORDER:@", "Function Order", "", - cmVS7FlagTable::UserValue }, - { "ProfileGuidedDatabase", "PGD:", "Profile Guided Database", "", - cmVS7FlagTable::UserValue }, - { "MidlCommandFile", "MIDL:@", "MIDL Commands", "", - cmVS7FlagTable::UserValue }, - { "MergedIDLBaseFileName", "IDLOUT:", "Merged IDL Base File Name", "", - cmVS7FlagTable::UserValue }, - { "TypeLibraryFile", "TLBOUT:", "Type Library", "", - cmVS7FlagTable::UserValue }, - { "WindowsMetadataFile", "WINMDFILE:", "Windows Metadata File", "", - cmVS7FlagTable::UserValue }, - { "WindowsMetadataLinkKeyFile", "WINMDKEYFILE:", "Windows Metadata Key File", - "", cmVS7FlagTable::UserValue }, - { "WindowsMetadataKeyContainer", "WINMDKEYCONTAINER:", - "Windows Metadata Key Container", "", cmVS7FlagTable::UserValue }, - { "EntryPointSymbol", "ENTRY:", "Entry Point", "", - cmVS7FlagTable::UserValue }, - { "BaseAddress", "BASE:", "Base Address", "", cmVS7FlagTable::UserValue }, - { "ImportLibrary", "IMPLIB:", "Import Library", "", - cmVS7FlagTable::UserValue }, - { "MergeSections", "MERGE:", "Merge Sections", "", - cmVS7FlagTable::UserValue }, - { "LinkKeyFile", "KEYFILE:", "Key File", "", cmVS7FlagTable::UserValue }, - { "KeyContainer", "KEYCONTAINER:", "Key Container", "", - cmVS7FlagTable::UserValue }, - // Skip [AdditionalOptions] - no command line Switch. - { 0, 0, 0, 0, 0 } -}; diff --git a/Source/cmVS14LibFlagTable.h b/Source/cmVS14LibFlagTable.h deleted file mode 100644 index adce075..0000000 --- a/Source/cmVS14LibFlagTable.h +++ /dev/null @@ -1,77 +0,0 @@ -static cmVS7FlagTable cmVS14LibFlagTable[] = { - - // Enum Properties - { "ErrorReporting", "ERRORREPORT:PROMPT", "PromptImmediately", - "PromptImmediately", 0 }, - { "ErrorReporting", "ERRORREPORT:QUEUE", "Queue For Next Login", - "QueueForNextLogin", 0 }, - { "ErrorReporting", "ERRORREPORT:SEND", "Send Error Report", - "SendErrorReport", 0 }, - { "ErrorReporting", "ERRORREPORT:NONE", "No Error Report", "NoErrorReport", - 0 }, - - { "TargetMachine", "MACHINE:ARM", "MachineARM", "MachineARM", 0 }, - { "TargetMachine", "MACHINE:ARM64", "MachineARM64", "MachineARM64", 0 }, - { "TargetMachine", "MACHINE:EBC", "MachineEBC", "MachineEBC", 0 }, - { "TargetMachine", "MACHINE:IA64", "MachineIA64", "MachineIA64", 0 }, - { "TargetMachine", "MACHINE:MIPS", "MachineMIPS", "MachineMIPS", 0 }, - { "TargetMachine", "MACHINE:MIPS16", "MachineMIPS16", "MachineMIPS16", 0 }, - { "TargetMachine", "MACHINE:MIPSFPU", "MachineMIPSFPU", "MachineMIPSFPU", - 0 }, - { "TargetMachine", "MACHINE:MIPSFPU16", "MachineMIPSFPU16", - "MachineMIPSFPU16", 0 }, - { "TargetMachine", "MACHINE:SH4", "MachineSH4", "MachineSH4", 0 }, - { "TargetMachine", "MACHINE:THUMB", "MachineTHUMB", "MachineTHUMB", 0 }, - { "TargetMachine", "MACHINE:X64", "MachineX64", "MachineX64", 0 }, - { "TargetMachine", "MACHINE:X86", "MachineX86", "MachineX86", 0 }, - - { "SubSystem", "SUBSYSTEM:CONSOLE", "Console", "Console", 0 }, - { "SubSystem", "SUBSYSTEM:WINDOWS", "Windows", "Windows", 0 }, - { "SubSystem", "SUBSYSTEM:NATIVE", "Native", "Native", 0 }, - { "SubSystem", "SUBSYSTEM:EFI_APPLICATION", "EFI Application", - "EFI Application", 0 }, - { "SubSystem", "SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER", - "EFI Boot Service Driver", "EFI Boot Service Driver", 0 }, - { "SubSystem", "SUBSYSTEM:EFI_ROM", "EFI ROM", "EFI ROM", 0 }, - { "SubSystem", "SUBSYSTEM:EFI_RUNTIME_DRIVER", "EFI Runtime", "EFI Runtime", - 0 }, - { "SubSystem", "SUBSYSTEM:WINDOWSCE", "WindowsCE", "WindowsCE", 0 }, - { "SubSystem", "SUBSYSTEM:POSIX", "POSIX", "POSIX", 0 }, - - // Bool Properties - { "SuppressStartupBanner", "NOLOGO", "", "true", 0 }, - { "IgnoreAllDefaultLibraries", "NODEFAULTLIB", "", "true", 0 }, - { "TreatLibWarningAsErrors", "WX:NO", "", "false", 0 }, - { "TreatLibWarningAsErrors", "WX", "", "true", 0 }, - { "Verbose", "VERBOSE", "", "true", 0 }, - { "LinkTimeCodeGeneration", "LTCG", "", "true", 0 }, - - // Bool Properties With Argument - - // String List Properties - // Skip [AdditionalDependencies] - no command line Switch. - { "AdditionalLibraryDirectories", - "LIBPATH:", "Additional Library Directories", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "IgnoreSpecificDefaultLibraries", - "NODEFAULTLIB:", "Ignore Specific Default Libraries", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "ExportNamedFunctions", "EXPORT:", "Export Named Functions", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "RemoveObjects", "REMOVE:", "Remove Objects", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - - // String Properties - { "OutputFile", "OUT:", "Output File", "", cmVS7FlagTable::UserValue }, - { "ModuleDefinitionFile", "DEF:", "Module Definition File Name", "", - cmVS7FlagTable::UserValue }, - { "ForceSymbolReferences", "INCLUDE:", "Force Symbol References", "", - cmVS7FlagTable::UserValue }, - { "DisplayLibrary", "LIST:", "Display Library to standard output", "", - cmVS7FlagTable::UserValue }, - // Skip [MinimumRequiredVersion] - no command line Switch. - { "Name", "NAME:", "Name", "", cmVS7FlagTable::UserValue }, - // Skip [AdditionalOptions] - no command line Switch. - // Skip [TrackerLogDirectory] - no command line Switch. - { 0, 0, 0, 0, 0 } -}; diff --git a/Source/cmVS14MASMFlagTable.h b/Source/cmVS14MASMFlagTable.h deleted file mode 100644 index 82ec9f1..0000000 --- a/Source/cmVS14MASMFlagTable.h +++ /dev/null @@ -1,76 +0,0 @@ -static cmVS7FlagTable cmVS14MASMFlagTable[] = { - - // Enum Properties - { "PreserveIdentifierCase", "", "Default", "0", 0 }, - { "PreserveIdentifierCase", "Cp", "Preserves Identifier Case (/Cp)", "1", - 0 }, - { "PreserveIdentifierCase", "Cu", - "Maps all identifiers to upper case. (/Cu)", "2", 0 }, - { "PreserveIdentifierCase", "Cx", - "Preserves case in public and extern symbols. (/Cx)", "3", 0 }, - - { "WarningLevel", "W0", "Warning Level 0 (/W0)", "0", 0 }, - { "WarningLevel", "W1", "Warning Level 1 (/W1)", "1", 0 }, - { "WarningLevel", "W2", "Warning Level 2 (/W2)", "2", 0 }, - { "WarningLevel", "W3", "Warning Level 3 (/W3)", "3", 0 }, - - { "PackAlignmentBoundary", "", "Default", "0", 0 }, - { "PackAlignmentBoundary", "Zp1", "One Byte Boundary (/Zp1)", "1", 0 }, - { "PackAlignmentBoundary", "Zp2", "Two Byte Boundary (/Zp2)", "2", 0 }, - { "PackAlignmentBoundary", "Zp4", "Four Byte Boundary (/Zp4)", "3", 0 }, - { "PackAlignmentBoundary", "Zp8", "Eight Byte Boundary (/Zp8)", "4", 0 }, - { "PackAlignmentBoundary", "Zp16", "Sixteen Byte Boundary (/Zp16)", "5", 0 }, - - { "CallingConvention", "", "Default", "0", 0 }, - { "CallingConvention", "Gd", "Use C-style Calling Convention (/Gd)", "1", - 0 }, - { "CallingConvention", "Gz", "Use stdcall Calling Convention (/Gz)", "2", - 0 }, - { "CallingConvention", "Gc", "Use Pascal Calling Convention (/Gc)", "3", 0 }, - - { "ErrorReporting", "errorReport:prompt", - "Prompt to send report immediately (/errorReport:prompt)", "0", 0 }, - { "ErrorReporting", "errorReport:queue", - "Prompt to send report at the next logon (/errorReport:queue)", "1", 0 }, - { "ErrorReporting", "errorReport:send", - "Automatically send report (/errorReport:send)", "2", 0 }, - { "ErrorReporting", "errorReport:none", - "Do not send report (/errorReport:none)", "3", 0 }, - - // Bool Properties - { "NoLogo", "nologo", "", "true", 0 }, - { "GeneratePreprocessedSourceListing", "EP", "", "true", 0 }, - { "ListAllAvailableInformation", "Sa", "", "true", 0 }, - { "UseSafeExceptionHandlers", "safeseh", "", "true", 0 }, - { "AddFirstPassListing", "Sf", "", "true", 0 }, - { "EnableAssemblyGeneratedCodeListing", "Sg", "", "true", 0 }, - { "DisableSymbolTable", "Sn", "", "true", 0 }, - { "EnableFalseConditionalsInListing", "Sx", "", "true", 0 }, - { "TreatWarningsAsErrors", "WX", "", "true", 0 }, - { "MakeAllSymbolsPublic", "Zf", "", "true", 0 }, - { "GenerateDebugInformation", "Zi", "", "true", 0 }, - { "EnableMASM51Compatibility", "Zm", "", "true", 0 }, - { "PerformSyntaxCheckOnly", "Zs", "", "true", 0 }, - - // Bool Properties With Argument - - // String List Properties - { "PreprocessorDefinitions", "D", "Preprocessor Definitions", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "IncludePaths", "I", "Include Paths", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - { "BrowseFile", "FR", "Generate Browse Information File", "", - cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable }, - // Skip [AdditionalDependencies] - no command line Switch. - - // String Properties - // Skip [Inputs] - no command line Switch. - { "ObjectFileName", "Fo", "Object File Name", "", - cmVS7FlagTable::UserValue }, - { "AssembledCodeListingFile", "Fl", "Assembled Code Listing File", "", - cmVS7FlagTable::UserValue }, - // Skip [CommandLineTemplate] - no command line Switch. - // Skip [ExecutionDescription] - no command line Switch. - // Skip [AdditionalOptions] - no command line Switch. - { 0, 0, 0, 0, 0 } -}; diff --git a/Source/cmVS14RCFlagTable.h b/Source/cmVS14RCFlagTable.h deleted file mode 100644 index 5dc8d5a..0000000 --- a/Source/cmVS14RCFlagTable.h +++ /dev/null @@ -1,7 +0,0 @@ -static cmVS7FlagTable cmVS14RCFlagTable[] = { - // Bool Properties - { "NullTerminateStrings", "n", "", "true", 0 }, - { "SuppressStartupBanner", "nologo", "", "true", 0 }, - - { 0, 0, 0, 0, 0 } -}; diff --git a/Source/cmVSSetupHelper.cxx b/Source/cmVSSetupHelper.cxx index 22fe007..7a54e12 100644 --- a/Source/cmVSSetupHelper.cxx +++ b/Source/cmVSSetupHelper.cxx @@ -267,6 +267,19 @@ bool cmVSSetupAPIHelper::GetVCToolsetVersion(std::string& vsToolsetVersion) return isInstalled && !vsToolsetVersion.empty(); } +bool cmVSSetupAPIHelper::IsEWDKEnabled() +{ + std::string envEnterpriseWDK, envDisableRegistryUse; + cmSystemTools::GetEnv("EnterpriseWDK", envEnterpriseWDK); + cmSystemTools::GetEnv("DisableRegistryUse", envDisableRegistryUse); + if (!cmSystemTools::Strucmp(envEnterpriseWDK.c_str(), "True") && + !cmSystemTools::Strucmp(envDisableRegistryUse.c_str(), "True")) { + return true; + } + + return false; +} + bool cmVSSetupAPIHelper::EnumerateAndChooseVSInstance() { bool isVSInstanceExists = false; @@ -274,6 +287,26 @@ bool cmVSSetupAPIHelper::EnumerateAndChooseVSInstance() return true; } + if (this->IsEWDKEnabled()) { + std::string envWindowsSdkDir81, envVSVersion, envVsInstallDir; + + cmSystemTools::GetEnv("WindowsSdkDir_81", envWindowsSdkDir81); + cmSystemTools::GetEnv("VisualStudioVersion", envVSVersion); + cmSystemTools::GetEnv("VSINSTALLDIR", envVsInstallDir); + if (envVSVersion.empty() || envVsInstallDir.empty()) + return false; + + chosenInstanceInfo.VSInstallLocation = + std::wstring(envVsInstallDir.begin(), envVsInstallDir.end()); + chosenInstanceInfo.Version = + std::wstring(envVSVersion.begin(), envVSVersion.end()); + chosenInstanceInfo.VCToolsetVersion = envVSVersion; + chosenInstanceInfo.ullVersion = std::stoi(envVSVersion); + chosenInstanceInfo.IsWin10SDKInstalled = true; + chosenInstanceInfo.IsWin81SDKInstalled = !envWindowsSdkDir81.empty(); + return true; + } + if (initializationFailure || setupConfig == NULL || setupConfig2 == NULL || setupHelper == NULL) return false; diff --git a/Source/cmVSSetupHelper.h b/Source/cmVSSetupHelper.h index 4144c15..b9cca45 100644 --- a/Source/cmVSSetupHelper.h +++ b/Source/cmVSSetupHelper.h @@ -150,6 +150,7 @@ private: HRESULT comInitialized; // current best instance of VS selected VSInstanceInfo chosenInstanceInfo; + bool IsEWDKEnabled(); std::string SpecifiedVSInstallLocation; }; diff --git a/Source/cmVariableWatch.h b/Source/cmVariableWatch.h index 27d1b12..2f444ed 100644 --- a/Source/cmVariableWatch.h +++ b/Source/cmVariableWatch.h @@ -63,15 +63,10 @@ public: protected: struct Pair { - WatchMethod Method; - void* ClientData; - DeleteData DeleteDataCall; - Pair() - : Method(nullptr) - , ClientData(nullptr) - , DeleteDataCall(nullptr) - { - } + WatchMethod Method = nullptr; + void* ClientData = nullptr; + DeleteData DeleteDataCall = nullptr; + Pair() {} ~Pair() { if (this->DeleteDataCall && this->ClientData) { diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index e9a1a67..6d54c12 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -723,7 +723,8 @@ void cmVisualStudio10TargetGenerator::WriteDotNetReferences(Elem& e0) // if the entry from VS_DOTNET_REFERENCES is an existing file, generate // a new hint-reference and name it from the filename if (cmsys::SystemTools::FileExists(ri, true)) { - std::string name = cmsys::SystemTools::GetFilenameWithoutExtension(ri); + std::string name = + cmsys::SystemTools::GetFilenameWithoutLastExtension(ri); std::string path = ri; ConvertToWindowsSlash(path); this->DotNetHintReferences[""].push_back( @@ -1680,6 +1681,7 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource(Elem& e1, subType = "Designer"; } if (const char* c = sf->GetProperty("VS_COPY_TO_OUT_DIR")) { + tool = "Content"; copyToOutDir = c; toolHasSettings = true; } @@ -3319,7 +3321,8 @@ bool cmVisualStudio10TargetGenerator::ComputeLinkOptions( std::vector<std::string> vsTargetVec; this->AddLibraries(cli, libVec, vsTargetVec, config); if (std::find(linkClosure->Languages.begin(), linkClosure->Languages.end(), - "CUDA") != linkClosure->Languages.end()) { + "CUDA") != linkClosure->Languages.end() && + this->CudaOptions[config] != nullptr) { switch (this->CudaOptions[config]->GetCudaRuntime()) { case cmVisualStudioGeneratorOptions::CudaRuntimeStatic: libVec.push_back("cudadevrt.lib"); diff --git a/Source/cmVisualStudio10ToolsetOptions.cxx b/Source/cmVisualStudio10ToolsetOptions.cxx index 9a1d950..f71b8b7 100644 --- a/Source/cmVisualStudio10ToolsetOptions.cxx +++ b/Source/cmVisualStudio10ToolsetOptions.cxx @@ -6,145 +6,123 @@ #include "cmIDEFlagTable.h" #include "cmVisualStudioGeneratorOptions.h" -#include "cmVS10CLFlagTable.h" -#include "cmVS10CSharpFlagTable.h" -#include "cmVS10LibFlagTable.h" -#include "cmVS10LinkFlagTable.h" -#include "cmVS10MASMFlagTable.h" -#include "cmVS10RCFlagTable.h" -#include "cmVS11CLFlagTable.h" -#include "cmVS11CSharpFlagTable.h" -#include "cmVS11LibFlagTable.h" -#include "cmVS11LinkFlagTable.h" -#include "cmVS11MASMFlagTable.h" -#include "cmVS11RCFlagTable.h" -#include "cmVS12CLFlagTable.h" -#include "cmVS12CSharpFlagTable.h" -#include "cmVS12LibFlagTable.h" -#include "cmVS12LinkFlagTable.h" -#include "cmVS12MASMFlagTable.h" -#include "cmVS12RCFlagTable.h" -#include "cmVS140CLFlagTable.h" -#include "cmVS140CSharpFlagTable.h" -#include "cmVS140LinkFlagTable.h" -#include "cmVS141CLFlagTable.h" -#include "cmVS141CSharpFlagTable.h" -#include "cmVS141LinkFlagTable.h" -#include "cmVS14LibFlagTable.h" -#include "cmVS14MASMFlagTable.h" -#include "cmVS14RCFlagTable.h" - -cmIDEFlagTable const* cmVisualStudio10ToolsetOptions::GetClFlagTable( - std::string const& name, std::string const& toolset) const +std::string cmVisualStudio10ToolsetOptions::GetClFlagTableName( + std::string const& name, std::string const& toolset, + std::string const& defaultToolset) const { std::string const useToolset = this->GetToolsetName(name, toolset); if (toolset == "v141") { - return cmVS141CLFlagTable; + return "v141"; } else if (useToolset == "v140") { - return cmVS140CLFlagTable; + return "v140"; } else if (useToolset == "v120") { - return cmVS12CLFlagTable; + return "v12"; } else if (useToolset == "v110") { - return cmVS11CLFlagTable; + return "v11"; } else if (useToolset == "v100") { - return cmVS10CLFlagTable; + return "v10"; } else { - return 0; + return this->GetToolsetName(name, defaultToolset); } } -cmIDEFlagTable const* cmVisualStudio10ToolsetOptions::GetCSharpFlagTable( - std::string const& name, std::string const& toolset) const +std::string cmVisualStudio10ToolsetOptions::GetCSharpFlagTableName( + std::string const& name, std::string const& toolset, + std::string const& defaultToolset) const { std::string const useToolset = this->GetToolsetName(name, toolset); if ((useToolset == "v141")) { - return cmVS141CSharpFlagTable; + return "v141"; } else if (useToolset == "v140") { - return cmVS140CSharpFlagTable; + return "v140"; } else if (useToolset == "v120") { - return cmVS12CSharpFlagTable; + return "v12"; } else if (useToolset == "v110") { - return cmVS11CSharpFlagTable; + return "v11"; } else if (useToolset == "v100") { - return cmVS10CSharpFlagTable; + return "v10"; } else { - return 0; + return this->GetToolsetName(name, defaultToolset); } } -cmIDEFlagTable const* cmVisualStudio10ToolsetOptions::GetRcFlagTable( - std::string const& name, std::string const& toolset) const +std::string cmVisualStudio10ToolsetOptions::GetRcFlagTableName( + std::string const& name, std::string const& toolset, + std::string const& defaultToolset) const { std::string const useToolset = this->GetToolsetName(name, toolset); if ((useToolset == "v140") || (useToolset == "v141")) { - return cmVS14RCFlagTable; + return "v14"; } else if (useToolset == "v120") { - return cmVS12RCFlagTable; + return "v12"; } else if (useToolset == "v110") { - return cmVS11RCFlagTable; + return "v11"; } else if (useToolset == "v100") { - return cmVS10RCFlagTable; + return "v10"; } else { - return 0; + return this->GetToolsetName(name, defaultToolset); } } -cmIDEFlagTable const* cmVisualStudio10ToolsetOptions::GetLibFlagTable( - std::string const& name, std::string const& toolset) const +std::string cmVisualStudio10ToolsetOptions::GetLibFlagTableName( + std::string const& name, std::string const& toolset, + std::string const& defaultToolset) const { std::string const useToolset = this->GetToolsetName(name, toolset); if ((useToolset == "v140") || (useToolset == "v141")) { - return cmVS14LibFlagTable; + return "v14"; } else if (useToolset == "v120") { - return cmVS12LibFlagTable; + return "v12"; } else if (useToolset == "v110") { - return cmVS11LibFlagTable; + return "v11"; } else if (useToolset == "v100") { - return cmVS10LibFlagTable; + return "v10"; } else { - return 0; + return this->GetToolsetName(name, defaultToolset); } } -cmIDEFlagTable const* cmVisualStudio10ToolsetOptions::GetLinkFlagTable( - std::string const& name, std::string const& toolset) const +std::string cmVisualStudio10ToolsetOptions::GetLinkFlagTableName( + std::string const& name, std::string const& toolset, + std::string const& defaultToolset) const { std::string const useToolset = this->GetToolsetName(name, toolset); if (useToolset == "v141") { - return cmVS141LinkFlagTable; + return "v141"; } else if (useToolset == "v140") { - return cmVS140LinkFlagTable; + return "v140"; } else if (useToolset == "v120") { - return cmVS12LinkFlagTable; + return "v12"; } else if (useToolset == "v110") { - return cmVS11LinkFlagTable; + return "v11"; } else if (useToolset == "v100") { - return cmVS10LinkFlagTable; + return "v10"; } else { - return 0; + return this->GetToolsetName(name, defaultToolset); } } -cmIDEFlagTable const* cmVisualStudio10ToolsetOptions::GetMasmFlagTable( - std::string const& name, std::string const& toolset) const +std::string cmVisualStudio10ToolsetOptions::GetMasmFlagTableName( + std::string const& name, std::string const& toolset, + std::string const& defaultToolset) const { std::string const useToolset = this->GetToolsetName(name, toolset); if ((useToolset == "v140") || (useToolset == "v141")) { - return cmVS14MASMFlagTable; + return "v14"; } else if (useToolset == "v120") { - return cmVS12MASMFlagTable; + return "v12"; } else if (useToolset == "v110") { - return cmVS11MASMFlagTable; + return "v11"; } else if (useToolset == "v100") { - return cmVS10MASMFlagTable; + return "v10"; } else { - return 0; + return this->GetToolsetName(name, defaultToolset); } } diff --git a/Source/cmVisualStudio10ToolsetOptions.h b/Source/cmVisualStudio10ToolsetOptions.h index c736a49..43946f0 100644 --- a/Source/cmVisualStudio10ToolsetOptions.h +++ b/Source/cmVisualStudio10ToolsetOptions.h @@ -7,8 +7,6 @@ #include <string> -struct cmIDEFlagTable; - /** \class cmVisualStudio10ToolsetOptions * \brief Retrieves toolset options for MSBuild. * @@ -17,18 +15,24 @@ struct cmIDEFlagTable; class cmVisualStudio10ToolsetOptions { public: - cmIDEFlagTable const* GetClFlagTable(std::string const& name, - std::string const& toolset) const; - cmIDEFlagTable const* GetCSharpFlagTable(std::string const& name, - std::string const& toolset) const; - cmIDEFlagTable const* GetRcFlagTable(std::string const& name, - std::string const& toolset) const; - cmIDEFlagTable const* GetLibFlagTable(std::string const& name, - std::string const& toolset) const; - cmIDEFlagTable const* GetLinkFlagTable(std::string const& name, - std::string const& toolset) const; - cmIDEFlagTable const* GetMasmFlagTable(std::string const& name, - std::string const& toolset) const; + std::string GetClFlagTableName(std::string const& name, + std::string const& toolset, + std::string const& defaultToolset) const; + std::string GetCSharpFlagTableName(std::string const& name, + std::string const& toolset, + std::string const& defaultToolset) const; + std::string GetRcFlagTableName(std::string const& name, + std::string const& toolset, + std::string const& defaultToolset) const; + std::string GetLibFlagTableName(std::string const& name, + std::string const& toolset, + std::string const& defaultToolset) const; + std::string GetLinkFlagTableName(std::string const& name, + std::string const& toolset, + std::string const& defaultToolset) const; + std::string GetMasmFlagTableName(std::string const& name, + std::string const& toolset, + std::string const& defaultToolset) const; private: std::string GetToolsetName(std::string const& name, diff --git a/Source/cmWhileCommand.cxx b/Source/cmWhileCommand.cxx index d5bcfc2..9d43d19 100644 --- a/Source/cmWhileCommand.cxx +++ b/Source/cmWhileCommand.cxx @@ -37,7 +37,7 @@ bool cmWhileFunctionBlocker::IsFunctionBlocked(const cmListFileFunction& lff, // Remove the function blocker for this scope or bail. std::unique_ptr<cmFunctionBlocker> fb( mf.RemoveFunctionBlocker(this, lff)); - if (!fb.get()) { + if (!fb) { return false; } diff --git a/Source/cmXCodeScheme.cxx b/Source/cmXCodeScheme.cxx index 58cb9c9..d301ad0 100644 --- a/Source/cmXCodeScheme.cxx +++ b/Source/cmXCodeScheme.cxx @@ -35,7 +35,7 @@ void cmXCodeScheme::WriteXCodeSharedScheme(const std::string& xcProjDir, xcodeSchemeFile += this->TargetName; xcodeSchemeFile += ".xcscheme"; - cmGeneratedFileStream fout(xcodeSchemeFile.c_str()); + cmGeneratedFileStream fout(xcodeSchemeFile); fout.SetCopyIfDifferent(true); if (!fout) { return; @@ -216,7 +216,7 @@ void cmXCodeScheme::WriteLaunchAction(cmXMLWriter& xout, if (!arguments.empty()) { xout.StartElement("CommandLineArguments"); - for (auto argument : arguments) { + for (auto const& argument : arguments) { xout.StartElement("CommandLineArgument"); xout.BreakAttributes(); diff --git a/Source/cm_static_string_view.hxx b/Source/cm_static_string_view.hxx new file mode 100644 index 0000000..1bef0c6 --- /dev/null +++ b/Source/cm_static_string_view.hxx @@ -0,0 +1,41 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ +#ifndef cm_static_string_view_hxx +#define cm_static_string_view_hxx + +#include "cmConfigure.h" // IWYU pragma: keep + +#include "cm_string_view.hxx" + +#include <cstddef> + +namespace cm { + +/** A string_view that only binds to static storage. + * + * This is used together with the `""_s` user-defined literal operator + * to construct a type-safe abstraction of a string_view that only views + * statically allocated strings. These strings are const and available + * for the entire lifetime of the program. + */ +class static_string_view : public string_view +{ + static_string_view(string_view v) + : string_view(v) + { + } + + friend static_string_view operator"" _s(const char* data, size_t size); +}; + +/** Create a static_string_view using `""_s` literal syntax. */ +inline static_string_view operator"" _s(const char* data, size_t size) +{ + return string_view(data, size); +} + +} // namespace cm + +using cm::operator"" _s; + +#endif diff --git a/Source/cm_string_view.cxx b/Source/cm_string_view.cxx new file mode 100644 index 0000000..61fa80e --- /dev/null +++ b/Source/cm_string_view.cxx @@ -0,0 +1,301 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ + +#include "cm_string_view.hxx" + +#ifndef CMake_HAVE_CXX_STRING_VIEW + +# include "cm_kwiml.h" + +# include <algorithm> +# include <ostream> +# include <stdexcept> + +namespace cm { + +string_view::const_reference string_view::at(size_type pos) const +{ + if (pos >= size_) { + throw std::out_of_range("Index out of range in string_view::at"); + } + return data_[pos]; +} + +string_view::size_type string_view::copy(char* dest, size_type count, + size_type pos) const +{ + if (pos > size_) { + throw std::out_of_range("Index out of range in string_view::copy"); + } + size_type const rcount = std::min(count, size_ - pos); + traits_type::copy(dest, data_ + pos, rcount); + return rcount; +} + +string_view string_view::substr(size_type pos, size_type count) const +{ + if (pos > size_) { + throw std::out_of_range("Index out of range in string_view::substr"); + } + size_type const rcount = std::min(count, size_ - pos); + return string_view(data_ + pos, rcount); +} + +int string_view::compare(string_view v) const noexcept +{ + size_type const rlen = std::min(size_, v.size_); + int c = traits_type::compare(data_, v.data_, rlen); + if (c == 0) { + if (size_ < v.size_) { + c = -1; + } else if (size_ > v.size_) { + c = 1; + } + } + return c; +} + +int string_view::compare(size_type pos1, size_type count1, string_view v) const +{ + return substr(pos1, count1).compare(v); +} + +int string_view::compare(size_type pos1, size_type count1, string_view v, + size_type pos2, size_type count2) const +{ + return substr(pos1, count1).compare(v.substr(pos2, count2)); +} + +int string_view::compare(const char* s) const +{ + return compare(string_view(s)); +} + +int string_view::compare(size_type pos1, size_type count1, const char* s) const +{ + return substr(pos1, count1).compare(string_view(s)); +} + +int string_view::compare(size_type pos1, size_type count1, const char* s, + size_type count2) const +{ + return substr(pos1, count1).compare(string_view(s, count2)); +} + +string_view::size_type string_view::find(string_view v, size_type pos) const + noexcept +{ + for (; pos + v.size_ <= size_; ++pos) { + if (std::char_traits<char>::compare(data_ + pos, v.data_, v.size_) == 0) { + return pos; + } + } + return npos; +} + +string_view::size_type string_view::find(char c, size_type pos) const noexcept +{ + return find(string_view(&c, 1), pos); +} + +string_view::size_type string_view::find(const char* s, size_type pos, + size_type count) const +{ + return find(string_view(s, count), pos); +} + +string_view::size_type string_view::find(const char* s, size_type pos) const +{ + return find(string_view(s), pos); +} + +string_view::size_type string_view::rfind(string_view v, size_type pos) const + noexcept +{ + if (size_ >= v.size_) { + for (pos = std::min(pos, size_ - v.size_) + 1; pos > 0;) { + --pos; + if (std::char_traits<char>::compare(data_ + pos, v.data_, v.size_) == + 0) { + return pos; + } + } + } + return npos; +} + +string_view::size_type string_view::rfind(char c, size_type pos) const noexcept +{ + return rfind(string_view(&c, 1), pos); +} + +string_view::size_type string_view::rfind(const char* s, size_type pos, + size_type count) const +{ + return rfind(string_view(s, count), pos); +} + +string_view::size_type string_view::rfind(const char* s, size_type pos) const +{ + return rfind(string_view(s), pos); +} + +string_view::size_type string_view::find_first_of(string_view v, + size_type pos) const noexcept +{ + for (; pos < size_; ++pos) { + if (traits_type::find(v.data_, v.size_, data_[pos])) { + return pos; + } + } + return npos; +} + +string_view::size_type string_view::find_first_of(char c, size_type pos) const + noexcept +{ + return find_first_of(string_view(&c, 1), pos); +} + +string_view::size_type string_view::find_first_of(const char* s, size_type pos, + size_type count) const +{ + return find_first_of(string_view(s, count), pos); +} + +string_view::size_type string_view::find_first_of(const char* s, + size_type pos) const +{ + return find_first_of(string_view(s), pos); +} + +string_view::size_type string_view::find_last_of(string_view v, + size_type pos) const noexcept +{ + if (size_ > 0) { + for (pos = std::min(pos, size_ - 1) + 1; pos > 0;) { + --pos; + if (traits_type::find(v.data_, v.size_, data_[pos])) { + return pos; + } + } + } + return npos; +} + +string_view::size_type string_view::find_last_of(char c, size_type pos) const + noexcept +{ + return find_last_of(string_view(&c, 1), pos); +} + +string_view::size_type string_view::find_last_of(const char* s, size_type pos, + size_type count) const +{ + return find_last_of(string_view(s, count), pos); +} + +string_view::size_type string_view::find_last_of(const char* s, + size_type pos) const +{ + return find_last_of(string_view(s), pos); +} + +string_view::size_type string_view::find_first_not_of(string_view v, + size_type pos) const + noexcept +{ + for (; pos < size_; ++pos) { + if (!traits_type::find(v.data_, v.size_, data_[pos])) { + return pos; + } + } + return npos; +} + +string_view::size_type string_view::find_first_not_of(char c, + size_type pos) const + noexcept +{ + return find_first_not_of(string_view(&c, 1), pos); +} + +string_view::size_type string_view::find_first_not_of(const char* s, + size_type pos, + size_type count) const +{ + return find_first_not_of(string_view(s, count), pos); +} + +string_view::size_type string_view::find_first_not_of(const char* s, + size_type pos) const +{ + return find_first_not_of(string_view(s), pos); +} + +string_view::size_type string_view::find_last_not_of(string_view v, + size_type pos) const + noexcept +{ + if (size_ > 0) { + for (pos = std::min(pos, size_ - 1) + 1; pos > 0;) { + --pos; + if (!traits_type::find(v.data_, v.size_, data_[pos])) { + return pos; + } + } + } + return npos; +} + +string_view::size_type string_view::find_last_not_of(char c, + size_type pos) const + noexcept +{ + return find_last_not_of(string_view(&c, 1), pos); +} + +string_view::size_type string_view::find_last_not_of(const char* s, + size_type pos, + size_type count) const +{ + return find_last_not_of(string_view(s, count), pos); +} + +string_view::size_type string_view::find_last_not_of(const char* s, + size_type pos) const +{ + return find_last_not_of(string_view(s), pos); +} + +std::ostream& operator<<(std::ostream& o, string_view v) +{ + return o.write(v.data(), v.size()); +} + +std::string& operator+=(std::string& s, string_view v) +{ + s.append(v.data(), v.size()); + return s; +} +} + +std::hash<cm::string_view>::result_type std::hash<cm::string_view>::operator()( + argument_type const& s) const noexcept +{ + // FNV-1a hash. + static KWIML_INT_uint64_t const fnv_offset_basis = 0xcbf29ce484222325; + static KWIML_INT_uint64_t const fnv_prime = 0x100000001b3; + KWIML_INT_uint64_t h = fnv_offset_basis; + for (char const& c : s) { + h = h ^ KWIML_INT_uint64_t(KWIML_INT_uint8_t(c)); + h = h * fnv_prime; + } + return result_type(h); +} +#else +// Avoid empty translation unit. +void cm_string_view_cxx() +{ +} +#endif diff --git a/Source/cm_string_view.hxx b/Source/cm_string_view.hxx new file mode 100644 index 0000000..d368ed8 --- /dev/null +++ b/Source/cm_string_view.hxx @@ -0,0 +1,217 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ +#ifndef cm_string_view_hxx +#define cm_string_view_hxx + +#include "cmConfigure.h" // IWYU pragma: keep + +#if __cplusplus >= 201703L || defined(_MSVC_LANG) && _MSVC_LANG >= 201703L +# define CMake_HAVE_CXX_STRING_VIEW +#endif + +#ifdef CMake_HAVE_CXX_STRING_VIEW +# include <string_view> +namespace cm { +using std::string_view; +} +#else +# include <cstddef> +# include <functional> +# include <iosfwd> +# include <iterator> +# include <string> + +namespace cm { + +class string_view +{ +public: + using traits_type = std::string::traits_type; + using value_type = char; + using pointer = char*; + using const_pointer = const char*; + using reference = char&; + using const_reference = char const&; + using const_iterator = const char*; + using iterator = const_iterator; + using const_reverse_iterator = std::reverse_iterator<const_iterator>; + using reverse_iterator = const_reverse_iterator; + using size_type = std::string::size_type; + using difference_type = std::string::difference_type; + + static size_type const npos = static_cast<size_type>(-1); + + string_view() noexcept = default; + string_view(string_view const&) noexcept = default; + + string_view(const char* s, size_t count) noexcept + : data_(s) + , size_(count) + { + } + + string_view(const char* s) noexcept + : data_(s) + , size_(traits_type::length(s)) + { + } + + // C++17 does not define this constructor. Instead it defines + // a conversion operator on std::string to create a string_view. + // Since this implementation is used in C++11, std::string does + // not have that conversion. + string_view(std::string const& s) noexcept + : data_(s.data()) + , size_(s.size()) + { + } + + // C++17 does not define this conversion. Instead it defines + // a constructor on std::string that can take a string_view. + // Since this implementation is used in C++11, std::string does + // not have that constructor. + explicit operator std::string() const { return std::string(data_, size_); } + + string_view& operator=(string_view const&) = default; + + const_iterator begin() const noexcept { return data_; } + const_iterator end() const noexcept { return data_ + size_; } + const_iterator cbegin() const noexcept { return begin(); } + const_iterator cend() const noexcept { return end(); } + + const_reverse_iterator rbegin() const noexcept + { + return const_reverse_iterator(end()); + } + const_reverse_iterator rend() const noexcept + { + return const_reverse_iterator(begin()); + } + const_reverse_iterator crbegin() const noexcept { return rbegin(); } + const_reverse_iterator crend() const noexcept { return rend(); } + + const_reference operator[](size_type pos) const noexcept + { + return data_[pos]; + } + const_reference at(size_type pos) const; + const_reference front() const noexcept { return data_[0]; } + const_reference back() const noexcept { return data_[size_ - 1]; } + const_pointer data() const noexcept { return data_; } + + size_type size() const noexcept { return size_; } + size_type length() const noexcept { return size_; } + size_type max_size() const noexcept { return npos - 1; } + bool empty() const noexcept { return size_ == 0; } + + void remove_prefix(size_type n) noexcept + { + data_ += n; + size_ -= n; + } + void remove_suffix(size_type n) noexcept { size_ -= n; } + void swap(string_view& v) noexcept + { + string_view tmp = v; + v = *this; + *this = tmp; + } + + size_type copy(char* dest, size_type count, size_type pos = 0) const; + string_view substr(size_type pos = 0, size_type count = npos) const; + + int compare(string_view v) const noexcept; + int compare(size_type pos1, size_type count1, string_view v) const; + int compare(size_type pos1, size_type count1, string_view v, size_type pos2, + size_type count2) const; + int compare(const char* s) const; + int compare(size_type pos1, size_type count1, const char* s) const; + int compare(size_type pos1, size_type count1, const char* s, + size_type count2) const; + + size_type find(string_view v, size_type pos = 0) const noexcept; + size_type find(char c, size_type pos = 0) const noexcept; + size_type find(const char* s, size_type pos, size_type count) const; + size_type find(const char* s, size_type pos = 0) const; + + size_type rfind(string_view v, size_type pos = npos) const noexcept; + size_type rfind(char c, size_type pos = npos) const noexcept; + size_type rfind(const char* s, size_type pos, size_type count) const; + size_type rfind(const char* s, size_type pos = npos) const; + + size_type find_first_of(string_view v, size_type pos = 0) const noexcept; + size_type find_first_of(char c, size_type pos = 0) const noexcept; + size_type find_first_of(const char* s, size_type pos, size_type count) const; + size_type find_first_of(const char* s, size_type pos = 0) const; + + size_type find_last_of(string_view v, size_type pos = npos) const noexcept; + size_type find_last_of(char c, size_type pos = npos) const noexcept; + size_type find_last_of(const char* s, size_type pos, size_type count) const; + size_type find_last_of(const char* s, size_type pos = npos) const; + + size_type find_first_not_of(string_view v, size_type pos = 0) const noexcept; + size_type find_first_not_of(char c, size_type pos = 0) const noexcept; + size_type find_first_not_of(const char* s, size_type pos, + size_type count) const; + size_type find_first_not_of(const char* s, size_type pos = 0) const; + + size_type find_last_not_of(string_view v, size_type pos = npos) const + noexcept; + size_type find_last_not_of(char c, size_type pos = npos) const noexcept; + size_type find_last_not_of(const char* s, size_type pos, + size_type count) const; + size_type find_last_not_of(const char* s, size_type pos = npos) const; + +private: + const char* data_ = nullptr; + size_type size_ = 0; +}; + +std::ostream& operator<<(std::ostream& o, string_view v); + +std::string& operator+=(std::string& s, string_view v); + +inline bool operator==(string_view l, string_view r) noexcept +{ + return l.compare(r) == 0; +} + +inline bool operator!=(string_view l, string_view r) noexcept +{ + return l.compare(r) != 0; +} + +inline bool operator<(string_view l, string_view r) noexcept +{ + return l.compare(r) < 0; +} + +inline bool operator<=(string_view l, string_view r) noexcept +{ + return l.compare(r) <= 0; +} + +inline bool operator>(string_view l, string_view r) noexcept +{ + return l.compare(r) > 0; +} + +inline bool operator>=(string_view l, string_view r) noexcept +{ + return l.compare(r) >= 0; +} +} + +namespace std { + +template <> +struct hash<cm::string_view> +{ + typedef cm::string_view argument_type; + typedef size_t result_type; + result_type operator()(argument_type const& s) const noexcept; +}; +} + +#endif +#endif diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 35730b8..1bc36cc 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -30,6 +30,7 @@ #if defined(CMAKE_BUILD_WITH_CMAKE) # include "cm_jsoncpp_writer.h" +# include "cmFileAPI.h" # include "cmGraphVizWriter.h" # include "cmVariableWatch.h" # include <unordered_map> @@ -140,7 +141,7 @@ cmake::cmake(Role role) this->State = new cmState; this->CurrentSnapshot = this->State->CreateBaseSnapshot(); - this->Messenger = new cmMessenger(this->State); + this->Messenger = new cmMessenger; #ifdef __APPLE__ struct rlimit rlp; @@ -1299,6 +1300,23 @@ int cmake::Configure() } } + // Cache variables may have already been set by a previous invocation, + // so we cannot rely on command line options alone. Always ensure our + // messenger is in sync with the cache. + const char* value = this->State->GetCacheEntryValue("CMAKE_WARN_DEPRECATED"); + this->Messenger->SetSuppressDeprecatedWarnings(value && + cmSystemTools::IsOff(value)); + + value = this->State->GetCacheEntryValue("CMAKE_ERROR_DEPRECATED"); + this->Messenger->SetDeprecatedWarningsAsErrors(cmSystemTools::IsOn(value)); + + value = this->State->GetCacheEntryValue("CMAKE_SUPPRESS_DEVELOPER_WARNINGS"); + this->Messenger->SetSuppressDevWarnings(cmSystemTools::IsOn(value)); + + value = this->State->GetCacheEntryValue("CMAKE_SUPPRESS_DEVELOPER_ERRORS"); + this->Messenger->SetDevWarningsAsErrors(value && + cmSystemTools::IsOff(value)); + int ret = this->ActualConfigure(); const char* delCacheVars = this->State->GetGlobalProperty("__CMAKE_DELETE_CACHE_CHANGE_VARS_"); @@ -1443,6 +1461,11 @@ int cmake::ActualConfigure() this->TruncateOutputLog("CMakeError.log"); } +#if defined(CMAKE_BUILD_WITH_CMAKE) + this->FileAPI = cm::make_unique<cmFileAPI>(this); + this->FileAPI->ReadQueries(); +#endif + // actually do the configure this->GlobalGenerator->Configure(); // Before saving the cache @@ -1682,6 +1705,10 @@ int cmake::Generate() // for the Visual Studio and Xcode generators.) this->SaveCache(this->GetHomeOutputDirectory()); +#if defined(CMAKE_BUILD_WITH_CMAKE) + this->FileAPI->WriteReplies(); +#endif + return 0; } @@ -1691,6 +1718,18 @@ void cmake::AddCacheEntry(const std::string& key, const char* value, this->State->AddCacheEntry(key, value, helpString, cmStateEnums::CacheEntryType(type)); this->UnwatchUnusedCli(key); + + if (key == "CMAKE_WARN_DEPRECATED") { + this->Messenger->SetSuppressDeprecatedWarnings( + value && cmSystemTools::IsOff(value)); + } else if (key == "CMAKE_ERROR_DEPRECATED") { + this->Messenger->SetDeprecatedWarningsAsErrors(cmSystemTools::IsOn(value)); + } else if (key == "CMAKE_SUPPRESS_DEVELOPER_WARNINGS") { + this->Messenger->SetSuppressDevWarnings(cmSystemTools::IsOn(value)); + } else if (key == "CMAKE_SUPPRESS_DEVELOPER_ERRORS") { + this->Messenger->SetDevWarningsAsErrors(value && + cmSystemTools::IsOff(value)); + } } bool cmake::DoWriteGlobVerifyTarget() const @@ -2596,7 +2635,7 @@ bool cmake::Open(const std::string& dir, bool dryRun) std::unique_ptr<cmGlobalGenerator> gen( this->CreateGlobalGenerator(fullName)); - if (!gen.get()) { + if (!gen) { std::cerr << "Error: could create CMAKE_GENERATOR \"" << fullName << "\"\n"; return false; diff --git a/Source/cmake.h b/Source/cmake.h index d3d0e80..d00acc7 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -6,6 +6,7 @@ #include "cmConfigure.h" // IWYU pragma: keep #include <map> +#include <memory> // IWYU pragma: keep #include <set> #include <string> #include <unordered_set> @@ -21,6 +22,7 @@ #endif class cmExternalMakefileProjectGeneratorFactory; +class cmFileAPI; class cmFileTimeComparison; class cmGlobalGenerator; class cmGlobalGeneratorFactory; @@ -528,6 +530,7 @@ private: #if defined(CMAKE_BUILD_WITH_CMAKE) cmVariableWatch* VariableWatch; + std::unique_ptr<cmFileAPI> FileAPI; #endif cmState* State; diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx index 45881aa..930ced9 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -691,6 +691,8 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args) if (args[1] == "touch" && args.size() > 2) { for (std::string::size_type cc = 2; cc < args.size(); cc++) { if (!cmSystemTools::Touch(args[cc], true)) { + std::cerr << "cmake -E touch: failed to update \""; + std::cerr << args[cc] << "\".\n"; return 1; } } @@ -701,6 +703,8 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args) if (args[1] == "touch_nocreate" && args.size() > 2) { for (std::string::size_type cc = 2; cc < args.size(); cc++) { if (!cmSystemTools::Touch(args[cc], false)) { + std::cerr << "cmake -E touch_nocreate: failed to update \""; + std::cerr << args[cc] << "\".\n"; return 1; } } diff --git a/Source/ctest.cxx b/Source/ctest.cxx index ca8a776..ca412ae 100644 --- a/Source/ctest.cxx +++ b/Source/ctest.cxx @@ -128,7 +128,7 @@ static const char* cmDocumentationOptions[][2] = { { "--schedule-random", "Use a random order for scheduling tests" }, { "--submit-index", "Submit individual dashboard tests with specific index" }, - { "--timeout <seconds>", "Set a global timeout on all tests." }, + { "--timeout <seconds>", "Set the default test timeout." }, { "--stop-time <time>", "Set a time at which all tests should stop running." }, { "--http1.0", "Submit using HTTP 1.0." }, diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx index 0a4ad7a..c5160a9 100644 --- a/Source/kwsys/SystemTools.cxx +++ b/Source/kwsys/SystemTools.cxx @@ -82,6 +82,10 @@ # include <signal.h> /* sigprocmask */ #endif +#ifdef __linux +# include <linux/fs.h> +#endif + // Windows API. #if defined(_WIN32) # include <windows.h> @@ -1355,39 +1359,15 @@ bool SystemTools::Touch(const std::string& filename, bool create) } CloseHandle(h); #elif KWSYS_CXX_HAS_UTIMENSAT - struct timespec times[2] = { { 0, UTIME_OMIT }, { 0, UTIME_NOW } }; - if (utimensat(AT_FDCWD, filename.c_str(), times, 0) < 0) { + // utimensat is only available on newer Unixes and macOS 10.13+ + if (utimensat(AT_FDCWD, filename.c_str(), NULL, 0) < 0) { return false; } #else - struct stat st; - if (stat(filename.c_str(), &st) < 0) { + // fall back to utimes + if (utimes(filename.c_str(), NULL) < 0) { return false; } - struct timeval mtime; - gettimeofday(&mtime, 0); -# if KWSYS_CXX_HAS_UTIMES - struct timeval atime; -# if KWSYS_CXX_STAT_HAS_ST_MTIM - atime.tv_sec = st.st_atim.tv_sec; - atime.tv_usec = st.st_atim.tv_nsec / 1000; -# elif KWSYS_CXX_STAT_HAS_ST_MTIMESPEC - atime.tv_sec = st.st_atimespec.tv_sec; - atime.tv_usec = st.st_atimespec.tv_nsec / 1000; -# else - atime.tv_sec = st.st_atime; - atime.tv_usec = 0; -# endif - struct timeval times[2] = { atime, mtime }; - if (utimes(filename.c_str(), times) < 0) { - return false; - } -# else - struct utimbuf times = { st.st_atime, mtime.tv_sec }; - if (utime(filename.c_str(), ×) < 0) { - return false; - } -# endif #endif return true; } @@ -2182,6 +2162,120 @@ bool SystemTools::FilesDiffer(const std::string& source, } /** + * Blockwise copy source to destination file + */ +static bool CopyFileContentBlockwise(const std::string& source, + const std::string& destination) +{ +// Open files +#if defined(_WIN32) + kwsys::ifstream fin( + Encoding::ToNarrow(Encoding::ToWindowsExtendedPath(source)).c_str(), + std::ios::in | std::ios::binary); +#else + kwsys::ifstream fin(source.c_str(), std::ios::in | std::ios::binary); +#endif + if (!fin) { + return false; + } + + // try and remove the destination file so that read only destination files + // can be written to. + // If the remove fails continue so that files in read only directories + // that do not allow file removal can be modified. + SystemTools::RemoveFile(destination); + +#if defined(_WIN32) + kwsys::ofstream fout( + Encoding::ToNarrow(Encoding::ToWindowsExtendedPath(destination)).c_str(), + std::ios::out | std::ios::trunc | std::ios::binary); +#else + kwsys::ofstream fout(destination.c_str(), + std::ios::out | std::ios::trunc | std::ios::binary); +#endif + if (!fout) { + return false; + } + + // This copy loop is very sensitive on certain platforms with + // slightly broken stream libraries (like HPUX). Normally, it is + // incorrect to not check the error condition on the fin.read() + // before using the data, but the fin.gcount() will be zero if an + // error occurred. Therefore, the loop should be safe everywhere. + while (fin) { + const int bufferSize = 4096; + char buffer[bufferSize]; + + fin.read(buffer, bufferSize); + if (fin.gcount()) { + fout.write(buffer, fin.gcount()); + } else { + break; + } + } + + // Make sure the operating system has finished writing the file + // before closing it. This will ensure the file is finished before + // the check below. + fout.flush(); + + fin.close(); + fout.close(); + + if (!fout) { + return false; + } + + return true; +} + +/** + * Clone the source file to the destination file + * + * If available, the Linux FICLONE ioctl is used to create a check + * copy-on-write clone of the source file. + * + * The method returns false for the following cases: + * - The code has not been compiled on Linux or the ioctl was unknown + * - The source and destination is on different file systems + * - The underlying filesystem does not support file cloning + * - An unspecified error occurred + */ +static bool CloneFileContent(const std::string& source, + const std::string& destination) +{ +#if defined(__linux) && defined(FICLONE) + int in = open(source.c_str(), O_RDONLY); + if (in < 0) { + return false; + } + + SystemTools::RemoveFile(destination); + + int out = + open(destination.c_str(), O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR); + if (out < 0) { + close(in); + return false; + } + + int result = ioctl(out, FICLONE, in); + close(in); + close(out); + + if (result < 0) { + return false; + } + + return true; +#else + (void)source; + (void)destination; + return false; +#endif +} + +/** * Copy a file named by "source" to the file named by "destination". */ bool SystemTools::CopyFileAlways(const std::string& source, @@ -2198,9 +2292,6 @@ bool SystemTools::CopyFileAlways(const std::string& source, if (SystemTools::FileIsDirectory(source)) { SystemTools::MakeDirectory(destination); } else { - const int bufferSize = 4096; - char buffer[bufferSize]; - // If destination is a directory, try to create a file with the same // name as the source in that directory. @@ -2219,62 +2310,12 @@ bool SystemTools::CopyFileAlways(const std::string& source, SystemTools::MakeDirectory(destination_dir); -// Open files -#if defined(_WIN32) - kwsys::ifstream fin( - Encoding::ToNarrow(Encoding::ToWindowsExtendedPath(source)).c_str(), - std::ios::in | std::ios::binary); -#else - kwsys::ifstream fin(source.c_str(), std::ios::in | std::ios::binary); -#endif - if (!fin) { - return false; - } - - // try and remove the destination file so that read only destination files - // can be written to. - // If the remove fails continue so that files in read only directories - // that do not allow file removal can be modified. - SystemTools::RemoveFile(real_destination); - -#if defined(_WIN32) - kwsys::ofstream fout( - Encoding::ToNarrow(Encoding::ToWindowsExtendedPath(real_destination)) - .c_str(), - std::ios::out | std::ios::trunc | std::ios::binary); -#else - kwsys::ofstream fout(real_destination.c_str(), - std::ios::out | std::ios::trunc | std::ios::binary); -#endif - if (!fout) { - return false; - } - - // This copy loop is very sensitive on certain platforms with - // slightly broken stream libraries (like HPUX). Normally, it is - // incorrect to not check the error condition on the fin.read() - // before using the data, but the fin.gcount() will be zero if an - // error occurred. Therefore, the loop should be safe everywhere. - while (fin) { - fin.read(buffer, bufferSize); - if (fin.gcount()) { - fout.write(buffer, fin.gcount()); - } else { - break; + if (!CloneFileContent(source, real_destination)) { + // if cloning did not succeed, fall back to blockwise copy + if (!CopyFileContentBlockwise(source, real_destination)) { + return false; } } - - // Make sure the operating system has finished writing the file - // before closing it. This will ensure the file is finished before - // the check below. - fout.flush(); - - fin.close(); - fout.close(); - - if (!fout) { - return false; - } } if (perms) { if (!SystemTools::SetPermissions(real_destination, perm)) { diff --git a/Templates/MSBuild/FlagTables/v10_CL.json b/Templates/MSBuild/FlagTables/v10_CL.json new file mode 100644 index 0000000..06158be --- /dev/null +++ b/Templates/MSBuild/FlagTables/v10_CL.json @@ -0,0 +1,981 @@ +[ + { + "name": "DebugInformationFormat", + "switch": "Z7", + "comment": "C7 compatible", + "value": "OldStyle", + "flags": [] + }, + { + "name": "DebugInformationFormat", + "switch": "Zi", + "comment": "Program Database", + "value": "ProgramDatabase", + "flags": [] + }, + { + "name": "DebugInformationFormat", + "switch": "ZI", + "comment": "Program Database for Edit And Continue", + "value": "EditAndContinue", + "flags": [] + }, + { + "name": "CompileAsManaged", + "switch": "", + "comment": "No Common Language RunTime Support", + "value": "false", + "flags": [] + }, + { + "name": "CompileAsManaged", + "switch": "clr", + "comment": "Common Language RunTime Support", + "value": "true", + "flags": [] + }, + { + "name": "CompileAsManaged", + "switch": "clr:pure", + "comment": "Pure MSIL Common Language RunTime Support", + "value": "Pure", + "flags": [] + }, + { + "name": "CompileAsManaged", + "switch": "clr:safe", + "comment": "Safe MSIL Common Language RunTime Support", + "value": "Safe", + "flags": [] + }, + { + "name": "CompileAsManaged", + "switch": "clr:oldSyntax", + "comment": "Common Language RunTime Support, Old Syntax", + "value": "OldSyntax", + "flags": [] + }, + { + "name": "WarningLevel", + "switch": "W0", + "comment": "Turn Off All Warnings", + "value": "TurnOffAllWarnings", + "flags": [] + }, + { + "name": "WarningLevel", + "switch": "W1", + "comment": "Level1", + "value": "Level1", + "flags": [] + }, + { + "name": "WarningLevel", + "switch": "W2", + "comment": "Level2", + "value": "Level2", + "flags": [] + }, + { + "name": "WarningLevel", + "switch": "W3", + "comment": "Level3", + "value": "Level3", + "flags": [] + }, + { + "name": "WarningLevel", + "switch": "W4", + "comment": "Level4", + "value": "Level4", + "flags": [] + }, + { + "name": "WarningLevel", + "switch": "Wall", + "comment": "EnableAllWarnings", + "value": "EnableAllWarnings", + "flags": [] + }, + { + "name": "Optimization", + "switch": "Od", + "comment": "Disabled", + "value": "Disabled", + "flags": [] + }, + { + "name": "Optimization", + "switch": "O1", + "comment": "Minimize Size", + "value": "MinSpace", + "flags": [] + }, + { + "name": "Optimization", + "switch": "O2", + "comment": "Maximize Speed", + "value": "MaxSpeed", + "flags": [] + }, + { + "name": "Optimization", + "switch": "Ox", + "comment": "Full Optimization", + "value": "Full", + "flags": [] + }, + { + "name": "InlineFunctionExpansion", + "switch": "", + "comment": "Default", + "value": "Default", + "flags": [] + }, + { + "name": "InlineFunctionExpansion", + "switch": "Ob0", + "comment": "Disabled", + "value": "Disabled", + "flags": [] + }, + { + "name": "InlineFunctionExpansion", + "switch": "Ob1", + "comment": "Only __inline", + "value": "OnlyExplicitInline", + "flags": [] + }, + { + "name": "InlineFunctionExpansion", + "switch": "Ob2", + "comment": "Any Suitable", + "value": "AnySuitable", + "flags": [] + }, + { + "name": "FavorSizeOrSpeed", + "switch": "Os", + "comment": "Favor small code", + "value": "Size", + "flags": [] + }, + { + "name": "FavorSizeOrSpeed", + "switch": "Ot", + "comment": "Favor fast code", + "value": "Speed", + "flags": [] + }, + { + "name": "FavorSizeOrSpeed", + "switch": "", + "comment": "Neither", + "value": "Neither", + "flags": [] + }, + { + "name": "ExceptionHandling", + "switch": "EHa", + "comment": "Yes with SEH Exceptions", + "value": "Async", + "flags": [] + }, + { + "name": "ExceptionHandling", + "switch": "EHsc", + "comment": "Yes", + "value": "Sync", + "flags": [] + }, + { + "name": "ExceptionHandling", + "switch": "EHs", + "comment": "Yes with Extern C functions", + "value": "SyncCThrow", + "flags": [] + }, + { + "name": "ExceptionHandling", + "switch": "", + "comment": "No", + "value": "false", + "flags": [] + }, + { + "name": "BasicRuntimeChecks", + "switch": "RTCs", + "comment": "Stack Frames", + "value": "StackFrameRuntimeCheck", + "flags": [] + }, + { + "name": "BasicRuntimeChecks", + "switch": "RTCu", + "comment": "Uninitialized variables", + "value": "UninitializedLocalUsageCheck", + "flags": [] + }, + { + "name": "BasicRuntimeChecks", + "switch": "RTC1", + "comment": "Both (/RTC1, equiv. to /RTCsu)", + "value": "EnableFastChecks", + "flags": [] + }, + { + "name": "BasicRuntimeChecks", + "switch": "", + "comment": "Default", + "value": "Default", + "flags": [] + }, + { + "name": "RuntimeLibrary", + "switch": "MT", + "comment": "Multi-threaded", + "value": "MultiThreaded", + "flags": [] + }, + { + "name": "RuntimeLibrary", + "switch": "MTd", + "comment": "Multi-threaded Debug", + "value": "MultiThreadedDebug", + "flags": [] + }, + { + "name": "RuntimeLibrary", + "switch": "MD", + "comment": "Multi-threaded DLL", + "value": "MultiThreadedDLL", + "flags": [] + }, + { + "name": "RuntimeLibrary", + "switch": "MDd", + "comment": "Multi-threaded Debug DLL", + "value": "MultiThreadedDebugDLL", + "flags": [] + }, + { + "name": "StructMemberAlignment", + "switch": "Zp1", + "comment": "1 Byte", + "value": "1Byte", + "flags": [] + }, + { + "name": "StructMemberAlignment", + "switch": "Zp2", + "comment": "2 Bytes", + "value": "2Bytes", + "flags": [] + }, + { + "name": "StructMemberAlignment", + "switch": "Zp4", + "comment": "4 Byte", + "value": "4Bytes", + "flags": [] + }, + { + "name": "StructMemberAlignment", + "switch": "Zp8", + "comment": "8 Bytes", + "value": "8Bytes", + "flags": [] + }, + { + "name": "StructMemberAlignment", + "switch": "Zp16", + "comment": "16 Bytes", + "value": "16Bytes", + "flags": [] + }, + { + "name": "StructMemberAlignment", + "switch": "", + "comment": "Default", + "value": "Default", + "flags": [] + }, + { + "name": "EnableEnhancedInstructionSet", + "switch": "arch:SSE", + "comment": "Streaming SIMD Extensions (/arch:SSE)", + "value": "StreamingSIMDExtensions", + "flags": [] + }, + { + "name": "EnableEnhancedInstructionSet", + "switch": "arch:SSE2", + "comment": "Streaming SIMD Extensions 2 (/arch:SSE2)", + "value": "StreamingSIMDExtensions2", + "flags": [] + }, + { + "name": "EnableEnhancedInstructionSet", + "switch": "", + "comment": "Not Set", + "value": "NotSet", + "flags": [] + }, + { + "name": "FloatingPointModel", + "switch": "fp:precise", + "comment": "Precise", + "value": "Precise", + "flags": [] + }, + { + "name": "FloatingPointModel", + "switch": "fp:strict", + "comment": "Strict", + "value": "Strict", + "flags": [] + }, + { + "name": "FloatingPointModel", + "switch": "fp:fast", + "comment": "Fast", + "value": "Fast", + "flags": [] + }, + { + "name": "PrecompiledHeader", + "switch": "Yc", + "comment": "Create", + "value": "Create", + "flags": [ + "UserValue", + "UserIgnored", + "Continue" + ] + }, + { + "name": "PrecompiledHeader", + "switch": "Yu", + "comment": "Use", + "value": "Use", + "flags": [ + "UserValue", + "UserIgnored", + "Continue" + ] + }, + { + "name": "PrecompiledHeader", + "switch": "Y-", + "comment": "Not Using Precompiled Headers", + "value": "NotUsing", + "flags": [] + }, + { + "name": "AssemblerOutput", + "switch": "", + "comment": "No Listing", + "value": "NoListing", + "flags": [] + }, + { + "name": "AssemblerOutput", + "switch": "FA", + "comment": "Assembly-Only Listing", + "value": "AssemblyCode", + "flags": [] + }, + { + "name": "AssemblerOutput", + "switch": "FAc", + "comment": "Assembly With Machine Code", + "value": "AssemblyAndMachineCode", + "flags": [] + }, + { + "name": "AssemblerOutput", + "switch": "FAs", + "comment": "Assembly With Source Code", + "value": "AssemblyAndSourceCode", + "flags": [] + }, + { + "name": "AssemblerOutput", + "switch": "FAcs", + "comment": "Assembly, Machine Code and Source", + "value": "All", + "flags": [] + }, + { + "name": "CallingConvention", + "switch": "Gd", + "comment": "__cdecl", + "value": "Cdecl", + "flags": [] + }, + { + "name": "CallingConvention", + "switch": "Gr", + "comment": "__fastcall", + "value": "FastCall", + "flags": [] + }, + { + "name": "CallingConvention", + "switch": "Gz", + "comment": "__stdcall", + "value": "StdCall", + "flags": [] + }, + { + "name": "CompileAs", + "switch": "", + "comment": "Default", + "value": "Default", + "flags": [] + }, + { + "name": "CompileAs", + "switch": "TC", + "comment": "Compile as C Code", + "value": "CompileAsC", + "flags": [] + }, + { + "name": "CompileAs", + "switch": "TP", + "comment": "Compile as C++ Code", + "value": "CompileAsCpp", + "flags": [] + }, + { + "name": "ErrorReporting", + "switch": "errorReport:none", + "comment": "Do Not Send Report", + "value": "None", + "flags": [] + }, + { + "name": "ErrorReporting", + "switch": "errorReport:prompt", + "comment": "Prompt Immediately", + "value": "Prompt", + "flags": [] + }, + { + "name": "ErrorReporting", + "switch": "errorReport:queue", + "comment": "Queue For Next Login", + "value": "Queue", + "flags": [] + }, + { + "name": "ErrorReporting", + "switch": "errorReport:send", + "comment": "Send Automatically", + "value": "Send", + "flags": [] + }, + { + "name": "SuppressStartupBanner", + "switch": "nologo-", + "comment": "Suppress Startup Banner", + "value": "false", + "flags": [] + }, + { + "name": "SuppressStartupBanner", + "switch": "nologo", + "comment": "Suppress Startup Banner", + "value": "true", + "flags": [] + }, + { + "name": "TreatWarningAsError", + "switch": "WX-", + "comment": "Treat Warnings As Errors", + "value": "false", + "flags": [] + }, + { + "name": "TreatWarningAsError", + "switch": "WX", + "comment": "Treat Warnings As Errors", + "value": "true", + "flags": [] + }, + { + "name": "MultiProcessorCompilation", + "switch": "MP", + "comment": "Multi-processor Compilation", + "value": "true", + "flags": [ + "UserValue", + "UserIgnored", + "Continue" + ] + }, + { + "name": "IntrinsicFunctions", + "switch": "Oi", + "comment": "Enable Intrinsic Functions", + "value": "true", + "flags": [] + }, + { + "name": "OmitFramePointers", + "switch": "Oy-", + "comment": "Omit Frame Pointers", + "value": "false", + "flags": [] + }, + { + "name": "OmitFramePointers", + "switch": "Oy", + "comment": "Omit Frame Pointers", + "value": "true", + "flags": [] + }, + { + "name": "EnableFiberSafeOptimizations", + "switch": "GT", + "comment": "Enable Fiber-Safe Optimizations", + "value": "true", + "flags": [] + }, + { + "name": "WholeProgramOptimization", + "switch": "GL", + "comment": "Whole Program Optimization", + "value": "true", + "flags": [] + }, + { + "name": "UndefineAllPreprocessorDefinitions", + "switch": "u", + "comment": "Undefine All Preprocessor Definitions", + "value": "true", + "flags": [] + }, + { + "name": "IgnoreStandardIncludePath", + "switch": "X", + "comment": "Ignore Standard Include Paths", + "value": "true", + "flags": [] + }, + { + "name": "PreprocessToFile", + "switch": "P", + "comment": "Preprocess to a File", + "value": "true", + "flags": [] + }, + { + "name": "PreprocessSuppressLineNumbers", + "switch": "EP", + "comment": "Preprocess Suppress Line Numbers", + "value": "true", + "flags": [] + }, + { + "name": "PreprocessKeepComments", + "switch": "C", + "comment": "Keep Comments", + "value": "true", + "flags": [] + }, + { + "name": "StringPooling", + "switch": "GF-", + "comment": "Enable String Pooling", + "value": "false", + "flags": [] + }, + { + "name": "StringPooling", + "switch": "GF", + "comment": "Enable String Pooling", + "value": "true", + "flags": [] + }, + { + "name": "MinimalRebuild", + "switch": "Gm-", + "comment": "Enable Minimal Rebuild", + "value": "false", + "flags": [] + }, + { + "name": "MinimalRebuild", + "switch": "Gm", + "comment": "Enable Minimal Rebuild", + "value": "true", + "flags": [] + }, + { + "name": "SmallerTypeCheck", + "switch": "RTCc", + "comment": "Smaller Type Check", + "value": "true", + "flags": [] + }, + { + "name": "BufferSecurityCheck", + "switch": "GS-", + "comment": "Buffer Security Check", + "value": "false", + "flags": [] + }, + { + "name": "BufferSecurityCheck", + "switch": "GS", + "comment": "Buffer Security Check", + "value": "true", + "flags": [] + }, + { + "name": "FunctionLevelLinking", + "switch": "Gy-", + "comment": "Enable Function-Level Linking", + "value": "false", + "flags": [] + }, + { + "name": "FunctionLevelLinking", + "switch": "Gy", + "comment": "Enable Function-Level Linking", + "value": "true", + "flags": [] + }, + { + "name": "FloatingPointExceptions", + "switch": "fp:except-", + "comment": "Enable Floating Point Exceptions", + "value": "false", + "flags": [] + }, + { + "name": "FloatingPointExceptions", + "switch": "fp:except", + "comment": "Enable Floating Point Exceptions", + "value": "true", + "flags": [] + }, + { + "name": "CreateHotpatchableImage", + "switch": "hotpatch", + "comment": "Create Hotpatchable Image", + "value": "true", + "flags": [] + }, + { + "name": "DisableLanguageExtensions", + "switch": "Za", + "comment": "Disable Language Extensions", + "value": "true", + "flags": [] + }, + { + "name": "TreatWChar_tAsBuiltInType", + "switch": "Zc:wchar_t-", + "comment": "Treat WChar_t As Built in Type", + "value": "false", + "flags": [] + }, + { + "name": "TreatWChar_tAsBuiltInType", + "switch": "Zc:wchar_t", + "comment": "Treat WChar_t As Built in Type", + "value": "true", + "flags": [] + }, + { + "name": "ForceConformanceInForLoopScope", + "switch": "Zc:forScope-", + "comment": "Force Conformance in For Loop Scope", + "value": "false", + "flags": [] + }, + { + "name": "ForceConformanceInForLoopScope", + "switch": "Zc:forScope", + "comment": "Force Conformance in For Loop Scope", + "value": "true", + "flags": [] + }, + { + "name": "RuntimeTypeInfo", + "switch": "GR-", + "comment": "Enable Run-Time Type Information", + "value": "false", + "flags": [] + }, + { + "name": "RuntimeTypeInfo", + "switch": "GR", + "comment": "Enable Run-Time Type Information", + "value": "true", + "flags": [] + }, + { + "name": "OpenMPSupport", + "switch": "openmp-", + "comment": "Open MP Support", + "value": "false", + "flags": [] + }, + { + "name": "OpenMPSupport", + "switch": "openmp", + "comment": "Open MP Support", + "value": "true", + "flags": [] + }, + { + "name": "ExpandAttributedSource", + "switch": "Fx", + "comment": "Expand Attributed Source", + "value": "true", + "flags": [] + }, + { + "name": "GenerateXMLDocumentationFiles", + "switch": "doc", + "comment": "Generate XML Documentation Files", + "value": "true", + "flags": [ + "UserValue", + "UserIgnored", + "Continue" + ] + }, + { + "name": "BrowseInformation", + "switch": "FR", + "comment": "Enable Browse Information", + "value": "true", + "flags": [ + "UserValue", + "UserIgnored", + "Continue" + ] + }, + { + "name": "ShowIncludes", + "switch": "showIncludes", + "comment": "Show Includes", + "value": "true", + "flags": [] + }, + { + "name": "EnablePREfast", + "switch": "analyze-", + "comment": "Enable Code Analysis", + "value": "false", + "flags": [] + }, + { + "name": "EnablePREfast", + "switch": "analyze", + "comment": "Enable Code Analysis", + "value": "true", + "flags": [] + }, + { + "name": "UseFullPaths", + "switch": "FC", + "comment": "Use Full Paths", + "value": "true", + "flags": [] + }, + { + "name": "OmitDefaultLibName", + "switch": "Zl", + "comment": "Omit Default Library Name", + "value": "true", + "flags": [] + }, + { + "name": "UseUnicodeForAssemblerListing", + "switch": "FAu", + "comment": "Use Unicode For Assembler Listing", + "value": "true", + "flags": [] + }, + { + "name": "AdditionalIncludeDirectories", + "switch": "I", + "comment": "Additional Include Directories", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "AdditionalUsingDirectories", + "switch": "AI", + "comment": "Resolve #using References", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "PreprocessorDefinitions", + "switch": "D", + "comment": "Preprocessor Definitions", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "UndefinePreprocessorDefinitions", + "switch": "U", + "comment": "Undefine Preprocessor Definitions", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "DisableSpecificWarnings", + "switch": "wd", + "comment": "Disable Specific Warnings", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "ForcedIncludeFiles", + "switch": "FI", + "comment": "Forced Include File", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "ForcedUsingFiles", + "switch": "FU", + "comment": "Forced #using File", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "TreatSpecificWarningsAsErrors", + "switch": "we", + "comment": "Treat Specific Warnings As Errors", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "PreprocessOutputPath", + "switch": "Fi", + "comment": "Preprocess Output Path", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "PrecompiledHeaderFile", + "switch": "Yu", + "comment": "Precompiled Header File", + "value": "", + "flags": [ + "UserValue", + "UserRequired" + ] + }, + { + "name": "PrecompiledHeaderFile", + "switch": "Yc", + "comment": "Precompiled Header File", + "value": "", + "flags": [ + "UserValue", + "UserRequired" + ] + }, + { + "name": "PrecompiledHeaderOutputFile", + "switch": "Fp", + "comment": "Precompiled Header Output File", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "AssemblerListingLocation", + "switch": "Fa", + "comment": "ASM List Location", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "ObjectFileName", + "switch": "Fo", + "comment": "Object File Name", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "ProgramDataBaseFileName", + "switch": "Fd", + "comment": "Program Database File Name", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "XMLDocumentationFileName", + "switch": "doc", + "comment": "XML Documentation File Name", + "value": "", + "flags": [ + "UserValue", + "UserRequired" + ] + }, + { + "name": "BrowseInformationFile", + "switch": "FR", + "comment": "Browse Information File", + "value": "", + "flags": [ + "UserValue", + "UserRequired" + ] + }, + { + "name": "ProcessorNumber", + "switch": "MP", + "comment": "Number of processors", + "value": "", + "flags": [ + "UserValue", + "UserRequired" + ] + } +] diff --git a/Templates/MSBuild/FlagTables/v10_CSharp.json b/Templates/MSBuild/FlagTables/v10_CSharp.json new file mode 100644 index 0000000..a0780a4 --- /dev/null +++ b/Templates/MSBuild/FlagTables/v10_CSharp.json @@ -0,0 +1,570 @@ +[ + { + "name": "ProjectName", + "switch": "out:", + "comment": "", + "value": "", + "flags": [ + "UserValue", + "UserRequired" + ] + }, + { + "name": "OutputType", + "switch": "target:exe", + "comment": "", + "value": "Exe", + "flags": [] + }, + { + "name": "OutputType", + "switch": "target:winexe", + "comment": "", + "value": "Winexe", + "flags": [] + }, + { + "name": "OutputType", + "switch": "target:library", + "comment": "", + "value": "Library", + "flags": [] + }, + { + "name": "OutputType", + "switch": "target:module", + "comment": "", + "value": "Module", + "flags": [] + }, + { + "name": "DocumentationFile", + "switch": "doc", + "comment": "", + "value": "", + "flags": [ + "UserValue", + "UserRequired" + ] + }, + { + "name": "Platform", + "switch": "platform:x86", + "comment": "", + "value": "x86", + "flags": [] + }, + { + "name": "Platform", + "switch": "platform:Itanium", + "comment": "", + "value": "Itanium", + "flags": [] + }, + { + "name": "Platform", + "switch": "platform:x64", + "comment": "", + "value": "x64", + "flags": [] + }, + { + "name": "Platform", + "switch": "platform:arm", + "comment": "", + "value": "arm", + "flags": [] + }, + { + "name": "Platform", + "switch": "platform:anycpu32bitpreferred", + "comment": "", + "value": "anycpu32bitpreferred", + "flags": [] + }, + { + "name": "Platform", + "switch": "platform:anycpu", + "comment": "", + "value": "anycpu", + "flags": [] + }, + { + "name": "References", + "switch": "reference:", + "comment": "mit alias", + "value": "", + "flags": [] + }, + { + "name": "References", + "switch": "reference:", + "comment": "dateiliste", + "value": "", + "flags": [] + }, + { + "name": "AddModules", + "switch": "addmodule:", + "comment": "", + "value": "", + "flags": [ + "SemicolonAppendable" + ] + }, + { + "name": "Win32Resource", + "switch": "win32res:", + "comment": "", + "value": "", + "flags": [ + "UserValue", + "UserRequired" + ] + }, + { + "name": "ApplicationIcon", + "switch": "win32icon:", + "comment": "", + "value": "", + "flags": [ + "UserValue", + "UserRequired" + ] + }, + { + "name": "ApplicationManifest", + "switch": "win32manifest:", + "comment": "", + "value": "", + "flags": [ + "UserValue", + "UserRequired" + ] + }, + { + "name": "NoWin32Manifest", + "switch": "nowin32manifest", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "DefineDebug", + "switch": "debug", + "comment": "", + "value": "true", + "flags": [ + "Continue" + ] + }, + { + "name": "DebugSymbols", + "switch": "debug", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "DebugSymbols", + "switch": "debug-", + "comment": "", + "value": "false", + "flags": [] + }, + { + "name": "DebugSymbols", + "switch": "debug+", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "DebugType", + "switch": "debug:none", + "comment": "", + "value": "none", + "flags": [] + }, + { + "name": "DebugType", + "switch": "debug:full", + "comment": "", + "value": "full", + "flags": [] + }, + { + "name": "DebugType", + "switch": "debug:pdbonly", + "comment": "", + "value": "pdbonly", + "flags": [] + }, + { + "name": "Optimize", + "switch": "optimize", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "Optimize", + "switch": "optimize-", + "comment": "", + "value": "false", + "flags": [] + }, + { + "name": "Optimize", + "switch": "optimize+", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "TreatWarningsAsErrors", + "switch": "warnaserror", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "TreatWarningsAsErrors", + "switch": "warnaserror-", + "comment": "", + "value": "false", + "flags": [] + }, + { + "name": "TreatWarningsAsErrors", + "switch": "warnaserror+", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "WarningsAsErrors", + "switch": "warnaserror", + "comment": "", + "value": "", + "flags": [] + }, + { + "name": "WarningsAsErrors", + "switch": "warnaserror-", + "comment": "", + "value": "", + "flags": [] + }, + { + "name": "WarningsAsErrors", + "switch": "warnaserror+", + "comment": "", + "value": "", + "flags": [] + }, + { + "name": "WarningLevel", + "switch": "warn:0", + "comment": "", + "value": "0", + "flags": [] + }, + { + "name": "WarningLevel", + "switch": "warn:1", + "comment": "", + "value": "1", + "flags": [] + }, + { + "name": "WarningLevel", + "switch": "warn:2", + "comment": "", + "value": "2", + "flags": [] + }, + { + "name": "WarningLevel", + "switch": "warn:3", + "comment": "", + "value": "3", + "flags": [] + }, + { + "name": "WarningLevel", + "switch": "warn:4", + "comment": "", + "value": "4", + "flags": [] + }, + { + "name": "DisabledWarnings", + "switch": "nowarn", + "comment": "", + "value": "", + "flags": [] + }, + { + "name": "CheckForOverflowUnderflow", + "switch": "checked", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "CheckForOverflowUnderflow", + "switch": "checked-", + "comment": "", + "value": "false", + "flags": [] + }, + { + "name": "CheckForOverflowUnderflow", + "switch": "checked+", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "AllowUnsafeBlocks", + "switch": "unsafe", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "AllowUnsafeBlocks", + "switch": "unsafe-", + "comment": "", + "value": "false", + "flags": [] + }, + { + "name": "AllowUnsafeBlocks", + "switch": "unsafe+", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "DefineConstants", + "switch": "define:", + "comment": "", + "value": "", + "flags": [ + "SemicolonAppendable", + "UserValue" + ] + }, + { + "name": "LangVersion", + "switch": "langversion:ISO-1", + "comment": "", + "value": "ISO-1", + "flags": [] + }, + { + "name": "LangVersion", + "switch": "langversion:ISO-2", + "comment": "", + "value": "ISO-2", + "flags": [] + }, + { + "name": "LangVersion", + "switch": "langversion:3", + "comment": "", + "value": "3", + "flags": [] + }, + { + "name": "LangVersion", + "switch": "langversion:4", + "comment": "", + "value": "4", + "flags": [] + }, + { + "name": "LangVersion", + "switch": "langversion:5", + "comment": "", + "value": "5", + "flags": [] + }, + { + "name": "LangVersion", + "switch": "langversion:6", + "comment": "", + "value": "6", + "flags": [] + }, + { + "name": "LangVersion", + "switch": "langversion:default", + "comment": "", + "value": "default", + "flags": [] + }, + { + "name": "DelaySign", + "switch": "delaysign", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "DelaySign", + "switch": "delaysign-", + "comment": "", + "value": "false", + "flags": [] + }, + { + "name": "DelaySign", + "switch": "delaysign+", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "AssemblyOriginatorKeyFile", + "switch": "keyfile", + "comment": "", + "value": "", + "flags": [] + }, + { + "name": "KeyContainerName", + "switch": "keycontainer", + "comment": "", + "value": "", + "flags": [] + }, + { + "name": "NoLogo", + "switch": "nologo", + "comment": "", + "value": "", + "flags": [] + }, + { + "name": "NoConfig", + "switch": "noconfig", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "BaseAddress", + "switch": "baseaddress:", + "comment": "", + "value": "", + "flags": [] + }, + { + "name": "CodePage", + "switch": "codepage", + "comment": "", + "value": "", + "flags": [] + }, + { + "name": "Utf8Output", + "switch": "utf8output", + "comment": "", + "value": "", + "flags": [] + }, + { + "name": "MainEntryPoint", + "switch": "main:", + "comment": "", + "value": "", + "flags": [] + }, + { + "name": "GenerateFullPaths", + "switch": "fullpaths", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "FileAlignment", + "switch": "filealign", + "comment": "", + "value": "", + "flags": [] + }, + { + "name": "PdbFile", + "switch": "pdb:", + "comment": "", + "value": "", + "flags": [] + }, + { + "name": "NoStandardLib", + "switch": "nostdlib", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "NoStandardLib", + "switch": "nostdlib-", + "comment": "", + "value": "false", + "flags": [] + }, + { + "name": "NoStandardLib", + "switch": "nostdlib+", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "SubsystemVersion", + "switch": "subsystemversion", + "comment": "", + "value": "", + "flags": [] + }, + { + "name": "AdditionalLibPaths", + "switch": "lib:", + "comment": "", + "value": "", + "flags": [] + }, + { + "name": "ErrorReport", + "switch": "errorreport:none", + "comment": "Do Not Send Report", + "value": "none", + "flags": [] + }, + { + "name": "ErrorReport", + "switch": "errorreport:prompt", + "comment": "Prompt Immediately", + "value": "prompt", + "flags": [] + }, + { + "name": "ErrorReport", + "switch": "errorreport:queue", + "comment": "Queue For Next Login", + "value": "queue", + "flags": [] + }, + { + "name": "ErrorReport", + "switch": "errorreport:send", + "comment": "Send Automatically", + "value": "send", + "flags": [] + } +] diff --git a/Templates/MSBuild/FlagTables/v10_Cuda.json b/Templates/MSBuild/FlagTables/v10_Cuda.json new file mode 100644 index 0000000..1831b8a --- /dev/null +++ b/Templates/MSBuild/FlagTables/v10_Cuda.json @@ -0,0 +1,224 @@ +[ + { + "name": "AdditionalCompilerOptions", + "switch": "Xcompiler=", + "comment": "Host compiler options", + "value": "", + "flags": [ + "UserValue", + "SpaceAppendable" + ] + }, + { + "name": "AdditionalCompilerOptions", + "switch": "Xcompiler", + "comment": "Host compiler options", + "value": "", + "flags": [ + "UserFollowing", + "SpaceAppendable" + ] + }, + { + "name": "CudaRuntime", + "switch": "cudart=none", + "comment": "No CUDA runtime library", + "value": "None", + "flags": [] + }, + { + "name": "CudaRuntime", + "switch": "cudart=shared", + "comment": "Shared/dynamic CUDA runtime library", + "value": "Shared", + "flags": [] + }, + { + "name": "CudaRuntime", + "switch": "cudart=static", + "comment": "Static CUDA runtime library", + "value": "Static", + "flags": [] + }, + { + "name": "CudaRuntime", + "switch": "cudart", + "comment": "CUDA runtime library", + "value": "", + "flags": [ + "UserFollowing" + ] + }, + { + "name": "cmake-temp-gencode", + "switch": "gencode=", + "comment": "", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "cmake-temp-gencode", + "switch": "gencode", + "comment": "", + "value": "", + "flags": [ + "UserFollowing", + "SemicolonAppendable" + ] + }, + { + "name": "cmake-temp-gencode", + "switch": "-generate-code=", + "comment": "", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "cmake-temp-gencode", + "switch": "-generate-code", + "comment": "", + "value": "", + "flags": [ + "UserFollowing", + "SemicolonAppendable" + ] + }, + { + "name": "cmake-temp-code", + "switch": "code=", + "comment": "", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "cmake-temp-code", + "switch": "code", + "comment": "", + "value": "", + "flags": [ + "UserFollowing" + ] + }, + { + "name": "cmake-temp-code", + "switch": "-gpu-code=", + "comment": "", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "cmake-temp-code", + "switch": "-gpu-code", + "comment": "", + "value": "", + "flags": [ + "UserFollowing" + ] + }, + { + "name": "cmake-temp-arch", + "switch": "arch=", + "comment": "", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "cmake-temp-arch", + "switch": "arch", + "comment": "", + "value": "", + "flags": [ + "UserFollowing" + ] + }, + { + "name": "cmake-temp-arch", + "switch": "-gpu-architecture=", + "comment": "", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "cmake-temp-arch", + "switch": "-gpu-architecture", + "comment": "", + "value": "", + "flags": [ + "UserFollowing" + ] + }, + { + "name": "FastMath", + "switch": "use_fast_math", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "FastMath", + "switch": "-use_fast_math", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "GPUDebugInfo", + "switch": "G", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "GPUDebugInfo", + "switch": "-device-debug", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "HostDebugInfo", + "switch": "g", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "HostDebugInfo", + "switch": "-debug", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "MaxRegCount", + "switch": "maxrregcount=", + "comment": "", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "MaxRegCount", + "switch": "maxrregcount", + "comment": "", + "value": "", + "flags": [ + "UserFollowing" + ] + } +] diff --git a/Templates/MSBuild/FlagTables/v10_CudaHost.json b/Templates/MSBuild/FlagTables/v10_CudaHost.json new file mode 100644 index 0000000..2593ff1 --- /dev/null +++ b/Templates/MSBuild/FlagTables/v10_CudaHost.json @@ -0,0 +1,149 @@ +[ + { + "name": "Optimization", + "switch": "Od", + "comment": "Disabled", + "value": "Od", + "flags": [] + }, + { + "name": "Optimization", + "switch": "O1", + "comment": "Minimize Size", + "value": "O1", + "flags": [] + }, + { + "name": "Optimization", + "switch": "O2", + "comment": "Maximize Speed", + "value": "O2", + "flags": [] + }, + { + "name": "Optimization", + "switch": "Ox", + "comment": "Full Optimization", + "value": "O3", + "flags": [] + }, + { + "name": "Runtime", + "switch": "MT", + "comment": "Multi-Threaded", + "value": "MT", + "flags": [] + }, + { + "name": "Runtime", + "switch": "MTd", + "comment": "Multi-Threaded Debug", + "value": "MTd", + "flags": [] + }, + { + "name": "Runtime", + "switch": "MD", + "comment": "Multi-Threaded DLL", + "value": "MD", + "flags": [] + }, + { + "name": "Runtime", + "switch": "MDd", + "comment": "Multi-threaded Debug DLL", + "value": "MDd", + "flags": [] + }, + { + "name": "Runtime", + "switch": "ML", + "comment": "Single-Threaded", + "value": "ML", + "flags": [] + }, + { + "name": "Runtime", + "switch": "MLd", + "comment": "Single-Threaded Debug", + "value": "MLd", + "flags": [] + }, + { + "name": "RuntimeChecks", + "switch": "RTCs", + "comment": "Stack Frames", + "value": "RTCs", + "flags": [] + }, + { + "name": "RuntimeChecks", + "switch": "RTCu", + "comment": "Uninitialized Variables", + "value": "RTCu", + "flags": [] + }, + { + "name": "RuntimeChecks", + "switch": "RTC1", + "comment": "Both", + "value": "RTC1", + "flags": [] + }, + { + "name": "TypeInfo", + "switch": "GR", + "comment": "Yes", + "value": "true", + "flags": [] + }, + { + "name": "TypeInfo", + "switch": "GR-", + "comment": "No", + "value": "false", + "flags": [] + }, + { + "name": "Warning", + "switch": "W0", + "comment": "Off: Turn Off All Warnings", + "value": "W0", + "flags": [] + }, + { + "name": "Warning", + "switch": "W1", + "comment": "Level 1", + "value": "W1", + "flags": [] + }, + { + "name": "Warning", + "switch": "W2", + "comment": "Level 2", + "value": "W2", + "flags": [] + }, + { + "name": "Warning", + "switch": "W3", + "comment": "Level 3", + "value": "W3", + "flags": [] + }, + { + "name": "Warning", + "switch": "W4", + "comment": "Level 4", + "value": "W4", + "flags": [] + }, + { + "name": "Warning", + "switch": "Wall", + "comment": "Enable All Warnings", + "value": "Wall", + "flags": [] + } +] diff --git a/Templates/MSBuild/FlagTables/v10_LIB.json b/Templates/MSBuild/FlagTables/v10_LIB.json new file mode 100644 index 0000000..58a238c --- /dev/null +++ b/Templates/MSBuild/FlagTables/v10_LIB.json @@ -0,0 +1,297 @@ +[ + { + "name": "ErrorReporting", + "switch": "ERRORREPORT:PROMPT", + "comment": "PromptImmediately", + "value": "PromptImmediately", + "flags": [] + }, + { + "name": "ErrorReporting", + "switch": "ERRORREPORT:QUEUE", + "comment": "Queue For Next Login", + "value": "QueueForNextLogin", + "flags": [] + }, + { + "name": "ErrorReporting", + "switch": "ERRORREPORT:SEND", + "comment": "Send Error Report", + "value": "SendErrorReport", + "flags": [] + }, + { + "name": "ErrorReporting", + "switch": "ERRORREPORT:NONE", + "comment": "No Error Report", + "value": "NoErrorReport", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:ARM", + "comment": "MachineARM", + "value": "MachineARM", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:EBC", + "comment": "MachineEBC", + "value": "MachineEBC", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:IA64", + "comment": "MachineIA64", + "value": "MachineIA64", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:MIPS", + "comment": "MachineMIPS", + "value": "MachineMIPS", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:MIPS16", + "comment": "MachineMIPS16", + "value": "MachineMIPS16", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:MIPSFPU", + "comment": "MachineMIPSFPU", + "value": "MachineMIPSFPU", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:MIPSFPU16", + "comment": "MachineMIPSFPU16", + "value": "MachineMIPSFPU16", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:SH4", + "comment": "MachineSH4", + "value": "MachineSH4", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:THUMB", + "comment": "MachineTHUMB", + "value": "MachineTHUMB", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:X64", + "comment": "MachineX64", + "value": "MachineX64", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:X86", + "comment": "MachineX86", + "value": "MachineX86", + "flags": [] + }, + { + "name": "SubSystem", + "switch": "SUBSYSTEM:CONSOLE", + "comment": "Console", + "value": "Console", + "flags": [] + }, + { + "name": "SubSystem", + "switch": "SUBSYSTEM:WINDOWS", + "comment": "Windows", + "value": "Windows", + "flags": [] + }, + { + "name": "SubSystem", + "switch": "SUBSYSTEM:NATIVE", + "comment": "Native", + "value": "Native", + "flags": [] + }, + { + "name": "SubSystem", + "switch": "SUBSYSTEM:EFI_APPLICATION", + "comment": "EFI Application", + "value": "EFI Application", + "flags": [] + }, + { + "name": "SubSystem", + "switch": "SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER", + "comment": "EFI Boot Service Driver", + "value": "EFI Boot Service Driver", + "flags": [] + }, + { + "name": "SubSystem", + "switch": "SUBSYSTEM:EFI_ROM", + "comment": "EFI ROM", + "value": "EFI ROM", + "flags": [] + }, + { + "name": "SubSystem", + "switch": "SUBSYSTEM:EFI_RUNTIME_DRIVER", + "comment": "EFI Runtime", + "value": "EFI Runtime", + "flags": [] + }, + { + "name": "SubSystem", + "switch": "SUBSYSTEM:WINDOWSCE", + "comment": "WindowsCE", + "value": "WindowsCE", + "flags": [] + }, + { + "name": "SubSystem", + "switch": "SUBSYSTEM:POSIX", + "comment": "POSIX", + "value": "POSIX", + "flags": [] + }, + { + "name": "SuppressStartupBanner", + "switch": "NOLOGO", + "comment": "Suppress Startup Banner", + "value": "true", + "flags": [] + }, + { + "name": "IgnoreAllDefaultLibraries", + "switch": "NODEFAULTLIB", + "comment": "Ignore All Default Libraries", + "value": "true", + "flags": [] + }, + { + "name": "TreatLibWarningAsErrors", + "switch": "WX:NO", + "comment": "Treat Lib Warning As Errors", + "value": "false", + "flags": [] + }, + { + "name": "TreatLibWarningAsErrors", + "switch": "WX", + "comment": "Treat Lib Warning As Errors", + "value": "true", + "flags": [] + }, + { + "name": "Verbose", + "switch": "VERBOSE", + "comment": "Verbose", + "value": "true", + "flags": [] + }, + { + "name": "LinkTimeCodeGeneration", + "switch": "LTCG", + "comment": "Link Time Code Generation", + "value": "true", + "flags": [] + }, + { + "name": "AdditionalLibraryDirectories", + "switch": "LIBPATH:", + "comment": "Additional Library Directories", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "IgnoreSpecificDefaultLibraries", + "switch": "NODEFAULTLIB:", + "comment": "Ignore Specific Default Libraries", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "ExportNamedFunctions", + "switch": "EXPORT:", + "comment": "Export Named Functions", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "RemoveObjects", + "switch": "REMOVE:", + "comment": "Remove Objects", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "OutputFile", + "switch": "OUT:", + "comment": "Output File", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "ModuleDefinitionFile", + "switch": "DEF:", + "comment": "Module Definition File Name", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "ForceSymbolReferences", + "switch": "INCLUDE:", + "comment": "Force Symbol References", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "DisplayLibrary", + "switch": "LIST:", + "comment": "Display Library to standard output", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "Name", + "switch": "NAME:", + "comment": "Name", + "value": "", + "flags": [ + "UserValue" + ] + } +] diff --git a/Templates/MSBuild/FlagTables/v10_Link.json b/Templates/MSBuild/FlagTables/v10_Link.json new file mode 100644 index 0000000..ac5b8b1 --- /dev/null +++ b/Templates/MSBuild/FlagTables/v10_Link.json @@ -0,0 +1,1137 @@ +[ + { + "name": "ShowProgress", + "switch": "", + "comment": "Not Set", + "value": "NotSet", + "flags": [] + }, + { + "name": "ShowProgress", + "switch": "VERBOSE", + "comment": "Display all progress messages", + "value": "LinkVerbose", + "flags": [] + }, + { + "name": "ShowProgress", + "switch": "VERBOSE:Lib", + "comment": "For Libraries Searched", + "value": "LinkVerboseLib", + "flags": [] + }, + { + "name": "ShowProgress", + "switch": "VERBOSE:ICF", + "comment": "About COMDAT folding during optimized linking", + "value": "LinkVerboseICF", + "flags": [] + }, + { + "name": "ShowProgress", + "switch": "VERBOSE:REF", + "comment": "About data removed during optimized linking", + "value": "LinkVerboseREF", + "flags": [] + }, + { + "name": "ShowProgress", + "switch": "VERBOSE:SAFESEH", + "comment": "About Modules incompatible with SEH", + "value": "LinkVerboseSAFESEH", + "flags": [] + }, + { + "name": "ShowProgress", + "switch": "VERBOSE:CLR", + "comment": "About linker activity related to managed code", + "value": "LinkVerboseCLR", + "flags": [] + }, + { + "name": "ForceFileOutput", + "switch": "FORCE", + "comment": "Enabled", + "value": "Enabled", + "flags": [] + }, + { + "name": "ForceFileOutput", + "switch": "FORCE:MULTIPLE", + "comment": "Multiply Defined Symbol Only", + "value": "MultiplyDefinedSymbolOnly", + "flags": [] + }, + { + "name": "ForceFileOutput", + "switch": "FORCE:UNRESOLVED", + "comment": "Undefined Symbol Only", + "value": "UndefinedSymbolOnly", + "flags": [] + }, + { + "name": "CreateHotPatchableImage", + "switch": "FUNCTIONPADMIN", + "comment": "Enabled", + "value": "Enabled", + "flags": [] + }, + { + "name": "CreateHotPatchableImage", + "switch": "FUNCTIONPADMIN:5", + "comment": "X86 Image Only", + "value": "X86Image", + "flags": [] + }, + { + "name": "CreateHotPatchableImage", + "switch": "FUNCTIONPADMIN:6", + "comment": "X64 Image Only", + "value": "X64Image", + "flags": [] + }, + { + "name": "CreateHotPatchableImage", + "switch": "FUNCTIONPADMIN:16", + "comment": "Itanium Image Only", + "value": "ItaniumImage", + "flags": [] + }, + { + "name": "UACExecutionLevel", + "switch": "level='asInvoker'", + "comment": "asInvoker", + "value": "AsInvoker", + "flags": [] + }, + { + "name": "UACExecutionLevel", + "switch": "level='highestAvailable'", + "comment": "highestAvailable", + "value": "HighestAvailable", + "flags": [] + }, + { + "name": "UACExecutionLevel", + "switch": "level='requireAdministrator'", + "comment": "requireAdministrator", + "value": "RequireAdministrator", + "flags": [] + }, + { + "name": "SubSystem", + "switch": "", + "comment": "Not Set", + "value": "NotSet", + "flags": [] + }, + { + "name": "SubSystem", + "switch": "SUBSYSTEM:CONSOLE", + "comment": "Console", + "value": "Console", + "flags": [] + }, + { + "name": "SubSystem", + "switch": "SUBSYSTEM:WINDOWS", + "comment": "Windows", + "value": "Windows", + "flags": [] + }, + { + "name": "SubSystem", + "switch": "SUBSYSTEM:NATIVE", + "comment": "Native", + "value": "Native", + "flags": [] + }, + { + "name": "SubSystem", + "switch": "SUBSYSTEM:EFI_APPLICATION", + "comment": "EFI Application", + "value": "EFI Application", + "flags": [] + }, + { + "name": "SubSystem", + "switch": "SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER", + "comment": "EFI Boot Service Driver", + "value": "EFI Boot Service Driver", + "flags": [] + }, + { + "name": "SubSystem", + "switch": "SUBSYSTEM:EFI_ROM", + "comment": "EFI ROM", + "value": "EFI ROM", + "flags": [] + }, + { + "name": "SubSystem", + "switch": "SUBSYSTEM:EFI_RUNTIME_DRIVER", + "comment": "EFI Runtime", + "value": "EFI Runtime", + "flags": [] + }, + { + "name": "SubSystem", + "switch": "SUBSYSTEM:WINDOWSCE", + "comment": "WindowsCE", + "value": "WindowsCE", + "flags": [] + }, + { + "name": "SubSystem", + "switch": "SUBSYSTEM:POSIX", + "comment": "POSIX", + "value": "POSIX", + "flags": [] + }, + { + "name": "Driver", + "switch": "", + "comment": "Not Set", + "value": "NotSet", + "flags": [] + }, + { + "name": "Driver", + "switch": "Driver", + "comment": "Driver", + "value": "Driver", + "flags": [] + }, + { + "name": "Driver", + "switch": "DRIVER:UPONLY", + "comment": "UP Only", + "value": "UpOnly", + "flags": [] + }, + { + "name": "Driver", + "switch": "DRIVER:WDM", + "comment": "WDM", + "value": "WDM", + "flags": [] + }, + { + "name": "LinkTimeCodeGeneration", + "switch": "", + "comment": "Default", + "value": "Default", + "flags": [] + }, + { + "name": "LinkTimeCodeGeneration", + "switch": "LTCG", + "comment": "Use Link Time Code Generation", + "value": "UseLinkTimeCodeGeneration", + "flags": [] + }, + { + "name": "LinkTimeCodeGeneration", + "switch": "LTCG:PGInstrument", + "comment": "Profile Guided Optimization - Instrument", + "value": "PGInstrument", + "flags": [] + }, + { + "name": "LinkTimeCodeGeneration", + "switch": "LTCG:PGOptimize", + "comment": "Profile Guided Optimization - Optimization", + "value": "PGOptimization", + "flags": [] + }, + { + "name": "LinkTimeCodeGeneration", + "switch": "LTCG:PGUpdate", + "comment": "Profile Guided Optimization - Update", + "value": "PGUpdate", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "", + "comment": "Not Set", + "value": "NotSet", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:ARM", + "comment": "MachineARM", + "value": "MachineARM", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:EBC", + "comment": "MachineEBC", + "value": "MachineEBC", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:IA64", + "comment": "MachineIA64", + "value": "MachineIA64", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:MIPS", + "comment": "MachineMIPS", + "value": "MachineMIPS", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:MIPS16", + "comment": "MachineMIPS16", + "value": "MachineMIPS16", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:MIPSFPU", + "comment": "MachineMIPSFPU", + "value": "MachineMIPSFPU", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:MIPSFPU16", + "comment": "MachineMIPSFPU16", + "value": "MachineMIPSFPU16", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:SH4", + "comment": "MachineSH4", + "value": "MachineSH4", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:THUMB", + "comment": "MachineTHUMB", + "value": "MachineTHUMB", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:X64", + "comment": "MachineX64", + "value": "MachineX64", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:X86", + "comment": "MachineX86", + "value": "MachineX86", + "flags": [] + }, + { + "name": "CLRThreadAttribute", + "switch": "CLRTHREADATTRIBUTE:MTA", + "comment": "MTA threading attribute", + "value": "MTAThreadingAttribute", + "flags": [] + }, + { + "name": "CLRThreadAttribute", + "switch": "CLRTHREADATTRIBUTE:STA", + "comment": "STA threading attribute", + "value": "STAThreadingAttribute", + "flags": [] + }, + { + "name": "CLRThreadAttribute", + "switch": "CLRTHREADATTRIBUTE:NONE", + "comment": "Default threading attribute", + "value": "DefaultThreadingAttribute", + "flags": [] + }, + { + "name": "CLRImageType", + "switch": "CLRIMAGETYPE:IJW", + "comment": "Force IJW image", + "value": "ForceIJWImage", + "flags": [] + }, + { + "name": "CLRImageType", + "switch": "CLRIMAGETYPE:PURE", + "comment": "Force Pure IL Image", + "value": "ForcePureILImage", + "flags": [] + }, + { + "name": "CLRImageType", + "switch": "CLRIMAGETYPE:SAFE", + "comment": "Force Safe IL Image", + "value": "ForceSafeILImage", + "flags": [] + }, + { + "name": "CLRImageType", + "switch": "", + "comment": "Default image type", + "value": "Default", + "flags": [] + }, + { + "name": "LinkErrorReporting", + "switch": "ERRORREPORT:PROMPT", + "comment": "PromptImmediately", + "value": "PromptImmediately", + "flags": [] + }, + { + "name": "LinkErrorReporting", + "switch": "ERRORREPORT:QUEUE", + "comment": "Queue For Next Login", + "value": "QueueForNextLogin", + "flags": [] + }, + { + "name": "LinkErrorReporting", + "switch": "ERRORREPORT:SEND", + "comment": "Send Error Report", + "value": "SendErrorReport", + "flags": [] + }, + { + "name": "LinkErrorReporting", + "switch": "ERRORREPORT:NONE", + "comment": "No Error Report", + "value": "NoErrorReport", + "flags": [] + }, + { + "name": "CLRSupportLastError", + "switch": "CLRSupportLastError", + "comment": "Enabled", + "value": "Enabled", + "flags": [] + }, + { + "name": "CLRSupportLastError", + "switch": "CLRSupportLastError:NO", + "comment": "Disabled", + "value": "Disabled", + "flags": [] + }, + { + "name": "CLRSupportLastError", + "switch": "CLRSupportLastError:SYSTEMDLL", + "comment": "System Dlls Only", + "value": "SystemDlls", + "flags": [] + }, + { + "name": "LinkIncremental", + "switch": "INCREMENTAL:NO", + "comment": "Enable Incremental Linking", + "value": "false", + "flags": [] + }, + { + "name": "LinkIncremental", + "switch": "INCREMENTAL", + "comment": "Enable Incremental Linking", + "value": "true", + "flags": [] + }, + { + "name": "SuppressStartupBanner", + "switch": "NOLOGO", + "comment": "Suppress Startup Banner", + "value": "true", + "flags": [] + }, + { + "name": "LinkStatus", + "switch": "LTCG:NOSTATUS", + "comment": "Link Status", + "value": "false", + "flags": [] + }, + { + "name": "LinkStatus", + "switch": "LTCG:STATUS", + "comment": "Link Status", + "value": "true", + "flags": [] + }, + { + "name": "PreventDllBinding", + "switch": "ALLOWBIND:NO", + "comment": "Prevent Dll Binding", + "value": "false", + "flags": [] + }, + { + "name": "PreventDllBinding", + "switch": "ALLOWBIND", + "comment": "Prevent Dll Binding", + "value": "true", + "flags": [] + }, + { + "name": "TreatLinkerWarningAsErrors", + "switch": "WX:NO", + "comment": "Treat Linker Warning As Errors", + "value": "false", + "flags": [] + }, + { + "name": "TreatLinkerWarningAsErrors", + "switch": "WX", + "comment": "Treat Linker Warning As Errors", + "value": "true", + "flags": [] + }, + { + "name": "IgnoreAllDefaultLibraries", + "switch": "NODEFAULTLIB", + "comment": "Ignore All Default Libraries", + "value": "true", + "flags": [] + }, + { + "name": "GenerateManifest", + "switch": "MANIFEST:NO", + "comment": "Generate Manifest", + "value": "false", + "flags": [] + }, + { + "name": "GenerateManifest", + "switch": "MANIFEST", + "comment": "Generate Manifest", + "value": "true", + "flags": [] + }, + { + "name": "AllowIsolation", + "switch": "ALLOWISOLATION:NO", + "comment": "Allow Isolation", + "value": "false", + "flags": [] + }, + { + "name": "AllowIsolation", + "switch": "ALLOWISOLATION", + "comment": "Allow Isolation", + "value": "true", + "flags": [] + }, + { + "name": "EnableUAC", + "switch": "MANIFESTUAC:", + "comment": "", + "value": "", + "flags": [ + "UserValue", + "UserRequired", + "SpaceAppendable" + ] + }, + { + "name": "UACUIAccess", + "switch": "uiAccess='false'", + "comment": "UAC Bypass UI Protection", + "value": "false", + "flags": [ + "UserValue", + "UserRequired" + ] + }, + { + "name": "UACUIAccess", + "switch": "uiAccess='false'", + "comment": "UAC Bypass UI Protection", + "value": "false", + "flags": [] + }, + { + "name": "UACUIAccess", + "switch": "uiAccess='true'", + "comment": "UAC Bypass UI Protection", + "value": "true", + "flags": [] + }, + { + "name": "GenerateDebugInformation", + "switch": "DEBUG", + "comment": "Generate Debug Info", + "value": "true", + "flags": [ + "CaseInsensitive" + ] + }, + { + "name": "GenerateMapFile", + "switch": "MAP", + "comment": "Generate Map File", + "value": "true", + "flags": [ + "UserValue", + "UserIgnored", + "Continue" + ] + }, + { + "name": "MapExports", + "switch": "MAPINFO:EXPORTS", + "comment": "Map Exports", + "value": "true", + "flags": [] + }, + { + "name": "AssemblyDebug", + "switch": "ASSEMBLYDEBUG:DISABLE", + "comment": "Debuggable Assembly", + "value": "false", + "flags": [] + }, + { + "name": "AssemblyDebug", + "switch": "ASSEMBLYDEBUG", + "comment": "Debuggable Assembly", + "value": "true", + "flags": [] + }, + { + "name": "LargeAddressAware", + "switch": "LARGEADDRESSAWARE:NO", + "comment": "Enable Large Addresses", + "value": "false", + "flags": [] + }, + { + "name": "LargeAddressAware", + "switch": "LARGEADDRESSAWARE", + "comment": "Enable Large Addresses", + "value": "true", + "flags": [] + }, + { + "name": "TerminalServerAware", + "switch": "TSAWARE:NO", + "comment": "Terminal Server", + "value": "false", + "flags": [] + }, + { + "name": "TerminalServerAware", + "switch": "TSAWARE", + "comment": "Terminal Server", + "value": "true", + "flags": [] + }, + { + "name": "SwapRunFromCD", + "switch": "SWAPRUN:CD", + "comment": "Swap Run From CD", + "value": "true", + "flags": [] + }, + { + "name": "SwapRunFromNET", + "switch": "SWAPRUN:NET", + "comment": "Swap Run From Network", + "value": "true", + "flags": [] + }, + { + "name": "OptimizeReferences", + "switch": "OPT:NOREF", + "comment": "References", + "value": "false", + "flags": [] + }, + { + "name": "OptimizeReferences", + "switch": "OPT:REF", + "comment": "References", + "value": "true", + "flags": [] + }, + { + "name": "EnableCOMDATFolding", + "switch": "OPT:NOICF", + "comment": "Enable COMDAT Folding", + "value": "false", + "flags": [] + }, + { + "name": "EnableCOMDATFolding", + "switch": "OPT:ICF", + "comment": "Enable COMDAT Folding", + "value": "true", + "flags": [] + }, + { + "name": "IgnoreEmbeddedIDL", + "switch": "IGNOREIDL", + "comment": "Ignore Embedded IDL", + "value": "true", + "flags": [] + }, + { + "name": "NoEntryPoint", + "switch": "NOENTRY", + "comment": "No Entry Point", + "value": "true", + "flags": [] + }, + { + "name": "SetChecksum", + "switch": "RELEASE", + "comment": "Set Checksum", + "value": "true", + "flags": [] + }, + { + "name": "RandomizedBaseAddress", + "switch": "DYNAMICBASE:NO", + "comment": "Randomized Base Address", + "value": "false", + "flags": [] + }, + { + "name": "RandomizedBaseAddress", + "switch": "DYNAMICBASE", + "comment": "Randomized Base Address", + "value": "true", + "flags": [] + }, + { + "name": "FixedBaseAddress", + "switch": "FIXED:NO", + "comment": "Fixed Base Address", + "value": "false", + "flags": [] + }, + { + "name": "FixedBaseAddress", + "switch": "FIXED", + "comment": "Fixed Base Address", + "value": "true", + "flags": [] + }, + { + "name": "DataExecutionPrevention", + "switch": "NXCOMPAT:NO", + "comment": "Data Execution Prevention (DEP)", + "value": "false", + "flags": [] + }, + { + "name": "DataExecutionPrevention", + "switch": "NXCOMPAT", + "comment": "Data Execution Prevention (DEP)", + "value": "true", + "flags": [] + }, + { + "name": "TurnOffAssemblyGeneration", + "switch": "NOASSEMBLY", + "comment": "Turn Off Assembly Generation", + "value": "true", + "flags": [] + }, + { + "name": "SupportUnloadOfDelayLoadedDLL", + "switch": "DELAY:UNLOAD", + "comment": "Unload delay loaded DLL", + "value": "true", + "flags": [] + }, + { + "name": "SupportNobindOfDelayLoadedDLL", + "switch": "DELAY:NOBIND", + "comment": "Nobind delay loaded DLL", + "value": "true", + "flags": [] + }, + { + "name": "Profile", + "switch": "PROFILE", + "comment": "Profile", + "value": "true", + "flags": [] + }, + { + "name": "LinkDelaySign", + "switch": "DELAYSIGN:NO", + "comment": "Delay Sign", + "value": "false", + "flags": [] + }, + { + "name": "LinkDelaySign", + "switch": "DELAYSIGN", + "comment": "Delay Sign", + "value": "true", + "flags": [] + }, + { + "name": "CLRUnmanagedCodeCheck", + "switch": "CLRUNMANAGEDCODECHECK:NO", + "comment": "CLR Unmanaged Code Check", + "value": "false", + "flags": [] + }, + { + "name": "CLRUnmanagedCodeCheck", + "switch": "CLRUNMANAGEDCODECHECK", + "comment": "CLR Unmanaged Code Check", + "value": "true", + "flags": [] + }, + { + "name": "ImageHasSafeExceptionHandlers", + "switch": "SAFESEH:NO", + "comment": "Image Has Safe Exception Handlers", + "value": "false", + "flags": [] + }, + { + "name": "ImageHasSafeExceptionHandlers", + "switch": "SAFESEH", + "comment": "Image Has Safe Exception Handlers", + "value": "true", + "flags": [] + }, + { + "name": "LinkDLL", + "switch": "DLL", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "AdditionalLibraryDirectories", + "switch": "LIBPATH:", + "comment": "Additional Library Directories", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "IgnoreSpecificDefaultLibraries", + "switch": "NODEFAULTLIB:", + "comment": "Ignore Specific Default Libraries", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "AddModuleNamesToAssembly", + "switch": "ASSEMBLYMODULE:", + "comment": "Add Module to Assembly", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "EmbedManagedResourceFile", + "switch": "ASSEMBLYRESOURCE:", + "comment": "Embed Managed Resource File", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "ForceSymbolReferences", + "switch": "INCLUDE:", + "comment": "Force Symbol References", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "DelayLoadDLLs", + "switch": "DELAYLOAD:", + "comment": "Delay Loaded Dlls", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "AssemblyLinkResource", + "switch": "ASSEMBLYLINKRESOURCE:", + "comment": "Assembly Link Resource", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "AdditionalManifestDependencies", + "switch": "MANIFESTDEPENDENCY:", + "comment": "Additional Manifest Dependencies", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "OutputFile", + "switch": "OUT:", + "comment": "Output File", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "Version", + "switch": "VERSION:", + "comment": "Version", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "SpecifySectionAttributes", + "switch": "SECTION:", + "comment": "Specify Section Attributes", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "MSDOSStubFileName", + "switch": "STUB:", + "comment": "MS-DOS Stub File Name", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "ModuleDefinitionFile", + "switch": "DEF:", + "comment": "Module Definition File", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "ManifestFile", + "switch": "ManifestFile:", + "comment": "Manifest File", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "ProgramDatabaseFile", + "switch": "PDB:", + "comment": "Generate Program Database File", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "StripPrivateSymbols", + "switch": "PDBSTRIPPED:", + "comment": "Strip Private Symbols", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "MapFileName", + "switch": "MAP:", + "comment": "Map File Name", + "value": "", + "flags": [ + "UserValue", + "UserRequired" + ] + }, + { + "name": "HeapReserveSize", + "switch": "HEAP:", + "comment": "Heap Reserve Size", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "HeapCommitSize", + "switch": "HEAP", + "comment": "Heap Commit Size", + "value": "", + "flags": [ + "UserValue", + "UserRequired" + ] + }, + { + "name": "StackReserveSize", + "switch": "STACK:", + "comment": "Stack Reserve Size", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "StackCommitSize", + "switch": "STACK", + "comment": "Stack Commit Size", + "value": "", + "flags": [ + "UserValue", + "UserRequired" + ] + }, + { + "name": "FunctionOrder", + "switch": "ORDER:@", + "comment": "Function Order", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "ProfileGuidedDatabase", + "switch": "PGD:", + "comment": "Profile Guided Database", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "MidlCommandFile", + "switch": "MIDL:@", + "comment": "MIDL Commands", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "MergedIDLBaseFileName", + "switch": "IDLOUT:", + "comment": "Merged IDL Base File Name", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "TypeLibraryFile", + "switch": "TLBOUT:", + "comment": "Type Library", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "EntryPointSymbol", + "switch": "ENTRY:", + "comment": "Entry Point", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "BaseAddress", + "switch": "BASE:", + "comment": "Base Address", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "ImportLibrary", + "switch": "IMPLIB:", + "comment": "Import Library", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "MergeSections", + "switch": "MERGE:", + "comment": "Merge Sections", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "LinkKeyFile", + "switch": "KEYFILE:", + "comment": "Key File", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "KeyContainer", + "switch": "KEYCONTAINER:", + "comment": "Key Container", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "TypeLibraryResourceID", + "switch": "TLBID:", + "comment": "TypeLib Resource ID", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "SectionAlignment", + "switch": "ALIGN:", + "comment": "SectionAlignment", + "value": "", + "flags": [ + "UserValue" + ] + } +] diff --git a/Templates/MSBuild/FlagTables/v10_MASM.json b/Templates/MSBuild/FlagTables/v10_MASM.json new file mode 100644 index 0000000..4634306 --- /dev/null +++ b/Templates/MSBuild/FlagTables/v10_MASM.json @@ -0,0 +1,295 @@ +[ + { + "name": "PreserveIdentifierCase", + "switch": "", + "comment": "Default", + "value": "0", + "flags": [] + }, + { + "name": "PreserveIdentifierCase", + "switch": "Cp", + "comment": "Preserves Identifier Case (/Cp)", + "value": "1", + "flags": [] + }, + { + "name": "PreserveIdentifierCase", + "switch": "Cu", + "comment": "Maps all identifiers to upper case. (/Cu)", + "value": "2", + "flags": [] + }, + { + "name": "PreserveIdentifierCase", + "switch": "Cx", + "comment": "Preserves case in public and extern symbols. (/Cx)", + "value": "3", + "flags": [] + }, + { + "name": "WarningLevel", + "switch": "W0", + "comment": "Warning Level 0 (/W0)", + "value": "0", + "flags": [] + }, + { + "name": "WarningLevel", + "switch": "W1", + "comment": "Warning Level 1 (/W1)", + "value": "1", + "flags": [] + }, + { + "name": "WarningLevel", + "switch": "W2", + "comment": "Warning Level 2 (/W2)", + "value": "2", + "flags": [] + }, + { + "name": "WarningLevel", + "switch": "W3", + "comment": "Warning Level 3 (/W3)", + "value": "3", + "flags": [] + }, + { + "name": "PackAlignmentBoundary", + "switch": "", + "comment": "Default", + "value": "0", + "flags": [] + }, + { + "name": "PackAlignmentBoundary", + "switch": "Zp1", + "comment": "One Byte Boundary (/Zp1)", + "value": "1", + "flags": [] + }, + { + "name": "PackAlignmentBoundary", + "switch": "Zp2", + "comment": "Two Byte Boundary (/Zp2)", + "value": "2", + "flags": [] + }, + { + "name": "PackAlignmentBoundary", + "switch": "Zp4", + "comment": "Four Byte Boundary (/Zp4)", + "value": "3", + "flags": [] + }, + { + "name": "PackAlignmentBoundary", + "switch": "Zp8", + "comment": "Eight Byte Boundary (/Zp8)", + "value": "4", + "flags": [] + }, + { + "name": "PackAlignmentBoundary", + "switch": "Zp16", + "comment": "Sixteen Byte Boundary (/Zp16)", + "value": "5", + "flags": [] + }, + { + "name": "CallingConvention", + "switch": "", + "comment": "Default", + "value": "0", + "flags": [] + }, + { + "name": "CallingConvention", + "switch": "Gd", + "comment": "Use C-style Calling Convention (/Gd)", + "value": "1", + "flags": [] + }, + { + "name": "CallingConvention", + "switch": "Gz", + "comment": "Use stdcall Calling Convention (/Gz)", + "value": "2", + "flags": [] + }, + { + "name": "CallingConvention", + "switch": "Gc", + "comment": "Use Pascal Calling Convention (/Gc)", + "value": "3", + "flags": [] + }, + { + "name": "ErrorReporting", + "switch": "errorReport:prompt", + "comment": "Prompt to send report immediately (/errorReport:prompt)", + "value": "0", + "flags": [] + }, + { + "name": "ErrorReporting", + "switch": "errorReport:queue", + "comment": "Prompt to send report at the next logon (/errorReport:queue)", + "value": "1", + "flags": [] + }, + { + "name": "ErrorReporting", + "switch": "errorReport:send", + "comment": "Automatically send report (/errorReport:send)", + "value": "2", + "flags": [] + }, + { + "name": "ErrorReporting", + "switch": "errorReport:none", + "comment": "Do not send report (/errorReport:none)", + "value": "3", + "flags": [] + }, + { + "name": "NoLogo", + "switch": "nologo", + "comment": "Suppress Startup Banner", + "value": "true", + "flags": [] + }, + { + "name": "GeneratePreprocessedSourceListing", + "switch": "EP", + "comment": "Generate Preprocessed Source Listing", + "value": "true", + "flags": [] + }, + { + "name": "ListAllAvailableInformation", + "switch": "Sa", + "comment": "List All Available Information", + "value": "true", + "flags": [] + }, + { + "name": "UseSafeExceptionHandlers", + "switch": "safeseh", + "comment": "Use Safe Exception Handlers", + "value": "true", + "flags": [] + }, + { + "name": "AddFirstPassListing", + "switch": "Sf", + "comment": "Add First Pass Listing", + "value": "true", + "flags": [] + }, + { + "name": "EnableAssemblyGeneratedCodeListing", + "switch": "Sg", + "comment": "Enable Assembly Generated Code Listing", + "value": "true", + "flags": [] + }, + { + "name": "DisableSymbolTable", + "switch": "Sn", + "comment": "Disable Symbol Table", + "value": "true", + "flags": [] + }, + { + "name": "EnableFalseConditionalsInListing", + "switch": "Sx", + "comment": "Enable False Conditionals In Listing", + "value": "true", + "flags": [] + }, + { + "name": "TreatWarningsAsErrors", + "switch": "WX", + "comment": "Treat Warnings As Errors", + "value": "true", + "flags": [] + }, + { + "name": "MakeAllSymbolsPublic", + "switch": "Zf", + "comment": "Make All Symbols Public", + "value": "true", + "flags": [] + }, + { + "name": "GenerateDebugInformation", + "switch": "Zi", + "comment": "Generate Debug Information", + "value": "true", + "flags": [] + }, + { + "name": "EnableMASM51Compatibility", + "switch": "Zm", + "comment": "Enable MASM 5.1 Compatibility", + "value": "true", + "flags": [] + }, + { + "name": "PerformSyntaxCheckOnly", + "switch": "Zs", + "comment": "Perform Syntax Check Only", + "value": "true", + "flags": [] + }, + { + "name": "PreprocessorDefinitions", + "switch": "D", + "comment": "Preprocessor Definitions", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "IncludePaths", + "switch": "I", + "comment": "Include Paths", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "BrowseFile", + "switch": "FR", + "comment": "Generate Browse Information File", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "ObjectFileName", + "switch": "Fo", + "comment": "Object File Name", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "AssembledCodeListingFile", + "switch": "Fl", + "comment": "Assembled Code Listing File", + "value": "", + "flags": [ + "UserValue" + ] + } +] diff --git a/Templates/MSBuild/FlagTables/v10_NASM.json b/Templates/MSBuild/FlagTables/v10_NASM.json new file mode 100644 index 0000000..434cd63 --- /dev/null +++ b/Templates/MSBuild/FlagTables/v10_NASM.json @@ -0,0 +1,201 @@ +[ + { + "name": "Outputswitch", + "switch": "fwin", + "comment": "Object File win32", + "value": "0", + "flags": [] + }, + { + "name": "Outputswitch", + "switch": "fwin32", + "comment": "Object File win32", + "value": "0", + "flags": [] + }, + { + "name": "Outputswitch", + "switch": "fwin64", + "comment": "Object File win64", + "value": "1", + "flags": [] + }, + { + "name": "Outputswitch", + "switch": "felf", + "comment": "ELF32 (i386) object files (e.g. Linux)", + "value": "2", + "flags": [] + }, + { + "name": "Outputswitch", + "switch": "felf32", + "comment": "ELF32 (i386) object files (e.g. Linux)", + "value": "2", + "flags": [] + }, + { + "name": "Outputswitch", + "switch": "felf64", + "comment": "ELF64 (x86_64) object files (e.g. Linux)", + "value": "3", + "flags": [] + }, + { + "name": "ErrorReportingFormat", + "switch": "Xgnu", + "comment": "-Xgnu GNU format: Default format", + "value": "0", + "flags": [] + }, + { + "name": "ErrorReportingFormat", + "switch": "Xvc", + "comment": "-Xvc Style used by Microsoft Visual C++", + "value": "1", + "flags": [] + }, + { + "name": "tasmmode", + "switch": "t", + "comment": "SciTech TASM compatible mode", + "value": "true", + "flags": [] + }, + { + "name": "GenerateDebugInformation", + "switch": "g", + "comment": "Generate Debug Information", + "value": "true", + "flags": [] + }, + { + "name": "TreatWarningsAsErrors", + "switch": "Werror", + "comment": "Treat Warnings As Errors", + "value": "true", + "flags": [] + }, + { + "name": "floatunderflow", + "switch": "w+float-underflow", + "comment": "float-underflow", + "value": "true", + "flags": [] + }, + { + "name": "macrodefaults", + "switch": "w-macro-defaults", + "comment": "Disable macro-defaults", + "value": "true", + "flags": [] + }, + { + "name": "user", + "switch": "w-user", + "comment": "Disable user", + "value": "true", + "flags": [] + }, + { + "name": "floatoverflow", + "switch": "w-float-overflow", + "comment": "Disable float-overflow", + "value": "true", + "flags": [] + }, + { + "name": "floatdenorm", + "switch": "w+float-denorm", + "comment": "float-denorm", + "value": "true", + "flags": [] + }, + { + "name": "numberoverflow", + "switch": "w-number-overflow", + "comment": "Disable number-overflow", + "value": "true", + "flags": [] + }, + { + "name": "macroselfref", + "switch": "w+macro-selfref", + "comment": "macro-selfref", + "value": "true", + "flags": [] + }, + { + "name": "floattoolong", + "switch": "w-float-toolong", + "comment": "Disable float-toolong", + "value": "true", + "flags": [] + }, + { + "name": "orphanlabels", + "switch": "w-orphan-labels", + "comment": "Disable orphan-labels", + "value": "true", + "flags": [] + }, + { + "name": "AssembledCodeListingFile", + "switch": "l", + "comment": "Assembled Code Listing File", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "ErrorReporting", + "switch": "Z", + "comment": "Redirect Error Messages to File", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "IncludePaths", + "switch": "I", + "comment": "Include Paths", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "PreprocessorDefinitions", + "switch": "D", + "comment": "Preprocessor Definitions", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "UndefinePreprocessorDefinitions", + "switch": "U", + "comment": "Undefine Preprocessor Definitions", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "OutputFormat", + "switch": "o", + "comment": "Output File Name", + "value": "", + "flags": [ + "UserValue" + ] + } +] diff --git a/Templates/MSBuild/FlagTables/v10_RC.json b/Templates/MSBuild/FlagTables/v10_RC.json new file mode 100644 index 0000000..b8c0127 --- /dev/null +++ b/Templates/MSBuild/FlagTables/v10_RC.json @@ -0,0 +1,69 @@ +[ + { + "name": "IgnoreStandardIncludePath", + "switch": "X", + "comment": "Ignore Standard Include Paths", + "value": "true", + "flags": [] + }, + { + "name": "ShowProgress", + "switch": "v", + "comment": "Show Progress", + "value": "true", + "flags": [] + }, + { + "name": "SuppressStartupBanner", + "switch": "nologo", + "comment": "Suppress Startup Banner", + "value": "true", + "flags": [] + }, + { + "name": "NullTerminateStrings", + "switch": "n", + "comment": "Null Terminate Strings", + "value": "true", + "flags": [] + }, + { + "name": "PreprocessorDefinitions", + "switch": "D", + "comment": "Preprocessor Definitions", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "UndefinePreprocessorDefinitions", + "switch": "u", + "comment": "Undefine Preprocessor Definitions", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "AdditionalIncludeDirectories", + "switch": "I", + "comment": "Additional Include Directories", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "ResourceOutputFileName", + "switch": "fo", + "comment": "Resource File Name", + "value": "", + "flags": [ + "UserValue" + ] + } +] diff --git a/Templates/MSBuild/FlagTables/v11_CL.json b/Templates/MSBuild/FlagTables/v11_CL.json new file mode 100644 index 0000000..b47ab2e --- /dev/null +++ b/Templates/MSBuild/FlagTables/v11_CL.json @@ -0,0 +1,1063 @@ +[ + { + "name": "DebugInformationFormat", + "switch": "", + "comment": "None", + "value": "None", + "flags": [] + }, + { + "name": "DebugInformationFormat", + "switch": "Z7", + "comment": "C7 compatible", + "value": "OldStyle", + "flags": [] + }, + { + "name": "DebugInformationFormat", + "switch": "Zi", + "comment": "Program Database", + "value": "ProgramDatabase", + "flags": [] + }, + { + "name": "DebugInformationFormat", + "switch": "ZI", + "comment": "Program Database for Edit And Continue", + "value": "EditAndContinue", + "flags": [] + }, + { + "name": "CompileAsManaged", + "switch": "", + "comment": "No Common Language RunTime Support", + "value": "false", + "flags": [] + }, + { + "name": "CompileAsManaged", + "switch": "clr", + "comment": "Common Language RunTime Support", + "value": "true", + "flags": [] + }, + { + "name": "CompileAsManaged", + "switch": "clr:pure", + "comment": "Pure MSIL Common Language RunTime Support", + "value": "Pure", + "flags": [] + }, + { + "name": "CompileAsManaged", + "switch": "clr:safe", + "comment": "Safe MSIL Common Language RunTime Support", + "value": "Safe", + "flags": [] + }, + { + "name": "CompileAsManaged", + "switch": "clr:oldSyntax", + "comment": "Common Language RunTime Support, Old Syntax", + "value": "OldSyntax", + "flags": [] + }, + { + "name": "WarningLevel", + "switch": "W0", + "comment": "Turn Off All Warnings", + "value": "TurnOffAllWarnings", + "flags": [] + }, + { + "name": "WarningLevel", + "switch": "W1", + "comment": "Level1", + "value": "Level1", + "flags": [] + }, + { + "name": "WarningLevel", + "switch": "W2", + "comment": "Level2", + "value": "Level2", + "flags": [] + }, + { + "name": "WarningLevel", + "switch": "W3", + "comment": "Level3", + "value": "Level3", + "flags": [] + }, + { + "name": "WarningLevel", + "switch": "W4", + "comment": "Level4", + "value": "Level4", + "flags": [] + }, + { + "name": "WarningLevel", + "switch": "Wall", + "comment": "EnableAllWarnings", + "value": "EnableAllWarnings", + "flags": [] + }, + { + "name": "Optimization", + "switch": "Od", + "comment": "Disabled", + "value": "Disabled", + "flags": [] + }, + { + "name": "Optimization", + "switch": "O1", + "comment": "Minimize Size", + "value": "MinSpace", + "flags": [] + }, + { + "name": "Optimization", + "switch": "O2", + "comment": "Maximize Speed", + "value": "MaxSpeed", + "flags": [] + }, + { + "name": "Optimization", + "switch": "Ox", + "comment": "Full Optimization", + "value": "Full", + "flags": [] + }, + { + "name": "InlineFunctionExpansion", + "switch": "", + "comment": "Default", + "value": "Default", + "flags": [] + }, + { + "name": "InlineFunctionExpansion", + "switch": "Ob0", + "comment": "Disabled", + "value": "Disabled", + "flags": [] + }, + { + "name": "InlineFunctionExpansion", + "switch": "Ob1", + "comment": "Only __inline", + "value": "OnlyExplicitInline", + "flags": [] + }, + { + "name": "InlineFunctionExpansion", + "switch": "Ob2", + "comment": "Any Suitable", + "value": "AnySuitable", + "flags": [] + }, + { + "name": "FavorSizeOrSpeed", + "switch": "Os", + "comment": "Favor small code", + "value": "Size", + "flags": [] + }, + { + "name": "FavorSizeOrSpeed", + "switch": "Ot", + "comment": "Favor fast code", + "value": "Speed", + "flags": [] + }, + { + "name": "FavorSizeOrSpeed", + "switch": "", + "comment": "Neither", + "value": "Neither", + "flags": [] + }, + { + "name": "ExceptionHandling", + "switch": "EHa", + "comment": "Yes with SEH Exceptions", + "value": "Async", + "flags": [] + }, + { + "name": "ExceptionHandling", + "switch": "EHsc", + "comment": "Yes", + "value": "Sync", + "flags": [] + }, + { + "name": "ExceptionHandling", + "switch": "EHs", + "comment": "Yes with Extern C functions", + "value": "SyncCThrow", + "flags": [] + }, + { + "name": "ExceptionHandling", + "switch": "", + "comment": "No", + "value": "false", + "flags": [] + }, + { + "name": "BasicRuntimeChecks", + "switch": "RTCs", + "comment": "Stack Frames", + "value": "StackFrameRuntimeCheck", + "flags": [] + }, + { + "name": "BasicRuntimeChecks", + "switch": "RTCu", + "comment": "Uninitialized variables", + "value": "UninitializedLocalUsageCheck", + "flags": [] + }, + { + "name": "BasicRuntimeChecks", + "switch": "RTC1", + "comment": "Both (/RTC1, equiv. to /RTCsu)", + "value": "EnableFastChecks", + "flags": [] + }, + { + "name": "BasicRuntimeChecks", + "switch": "", + "comment": "Default", + "value": "Default", + "flags": [] + }, + { + "name": "RuntimeLibrary", + "switch": "MT", + "comment": "Multi-threaded", + "value": "MultiThreaded", + "flags": [] + }, + { + "name": "RuntimeLibrary", + "switch": "MTd", + "comment": "Multi-threaded Debug", + "value": "MultiThreadedDebug", + "flags": [] + }, + { + "name": "RuntimeLibrary", + "switch": "MD", + "comment": "Multi-threaded DLL", + "value": "MultiThreadedDLL", + "flags": [] + }, + { + "name": "RuntimeLibrary", + "switch": "MDd", + "comment": "Multi-threaded Debug DLL", + "value": "MultiThreadedDebugDLL", + "flags": [] + }, + { + "name": "StructMemberAlignment", + "switch": "Zp1", + "comment": "1 Byte", + "value": "1Byte", + "flags": [] + }, + { + "name": "StructMemberAlignment", + "switch": "Zp2", + "comment": "2 Bytes", + "value": "2Bytes", + "flags": [] + }, + { + "name": "StructMemberAlignment", + "switch": "Zp4", + "comment": "4 Byte", + "value": "4Bytes", + "flags": [] + }, + { + "name": "StructMemberAlignment", + "switch": "Zp8", + "comment": "8 Bytes", + "value": "8Bytes", + "flags": [] + }, + { + "name": "StructMemberAlignment", + "switch": "Zp16", + "comment": "16 Bytes", + "value": "16Bytes", + "flags": [] + }, + { + "name": "StructMemberAlignment", + "switch": "", + "comment": "Default", + "value": "Default", + "flags": [] + }, + { + "name": "EnableEnhancedInstructionSet", + "switch": "arch:SSE", + "comment": "Streaming SIMD Extensions", + "value": "StreamingSIMDExtensions", + "flags": [] + }, + { + "name": "EnableEnhancedInstructionSet", + "switch": "arch:SSE2", + "comment": "Streaming SIMD Extensions 2", + "value": "StreamingSIMDExtensions2", + "flags": [] + }, + { + "name": "EnableEnhancedInstructionSet", + "switch": "arch:AVX", + "comment": "Advanced Vector Extensions", + "value": "AdvancedVectorExtensions", + "flags": [] + }, + { + "name": "EnableEnhancedInstructionSet", + "switch": "arch:IA32", + "comment": "No Enhanced Instructions", + "value": "NoExtensions", + "flags": [] + }, + { + "name": "EnableEnhancedInstructionSet", + "switch": "", + "comment": "Not Set", + "value": "NotSet", + "flags": [] + }, + { + "name": "FloatingPointModel", + "switch": "fp:precise", + "comment": "Precise", + "value": "Precise", + "flags": [] + }, + { + "name": "FloatingPointModel", + "switch": "fp:strict", + "comment": "Strict", + "value": "Strict", + "flags": [] + }, + { + "name": "FloatingPointModel", + "switch": "fp:fast", + "comment": "Fast", + "value": "Fast", + "flags": [] + }, + { + "name": "PrecompiledHeader", + "switch": "Yc", + "comment": "Create", + "value": "Create", + "flags": [ + "UserValue", + "UserIgnored", + "Continue" + ] + }, + { + "name": "PrecompiledHeader", + "switch": "Yu", + "comment": "Use", + "value": "Use", + "flags": [ + "UserValue", + "UserIgnored", + "Continue" + ] + }, + { + "name": "PrecompiledHeader", + "switch": "Y-", + "comment": "Not Using Precompiled Headers", + "value": "NotUsing", + "flags": [] + }, + { + "name": "AssemblerOutput", + "switch": "", + "comment": "No Listing", + "value": "NoListing", + "flags": [] + }, + { + "name": "AssemblerOutput", + "switch": "FA", + "comment": "Assembly-Only Listing", + "value": "AssemblyCode", + "flags": [] + }, + { + "name": "AssemblerOutput", + "switch": "FAc", + "comment": "Assembly With Machine Code", + "value": "AssemblyAndMachineCode", + "flags": [] + }, + { + "name": "AssemblerOutput", + "switch": "FAs", + "comment": "Assembly With Source Code", + "value": "AssemblyAndSourceCode", + "flags": [] + }, + { + "name": "AssemblerOutput", + "switch": "FAcs", + "comment": "Assembly, Machine Code and Source", + "value": "All", + "flags": [] + }, + { + "name": "CallingConvention", + "switch": "Gd", + "comment": "__cdecl", + "value": "Cdecl", + "flags": [] + }, + { + "name": "CallingConvention", + "switch": "Gr", + "comment": "__fastcall", + "value": "FastCall", + "flags": [] + }, + { + "name": "CallingConvention", + "switch": "Gz", + "comment": "__stdcall", + "value": "StdCall", + "flags": [] + }, + { + "name": "CompileAs", + "switch": "", + "comment": "Default", + "value": "Default", + "flags": [] + }, + { + "name": "CompileAs", + "switch": "TC", + "comment": "Compile as C Code", + "value": "CompileAsC", + "flags": [] + }, + { + "name": "CompileAs", + "switch": "TP", + "comment": "Compile as C++ Code", + "value": "CompileAsCpp", + "flags": [] + }, + { + "name": "ErrorReporting", + "switch": "errorReport:none", + "comment": "Do Not Send Report", + "value": "None", + "flags": [] + }, + { + "name": "ErrorReporting", + "switch": "errorReport:prompt", + "comment": "Prompt Immediately", + "value": "Prompt", + "flags": [] + }, + { + "name": "ErrorReporting", + "switch": "errorReport:queue", + "comment": "Queue For Next Login", + "value": "Queue", + "flags": [] + }, + { + "name": "ErrorReporting", + "switch": "errorReport:send", + "comment": "Send Automatically", + "value": "Send", + "flags": [] + }, + { + "name": "CompileAsWinRT", + "switch": "ZW", + "comment": "Consume Windows Runtime Extension", + "value": "true", + "flags": [] + }, + { + "name": "WinRTNoStdLib", + "switch": "ZW:nostdlib", + "comment": "No Standard WinRT Libraries", + "value": "true", + "flags": [] + }, + { + "name": "SuppressStartupBanner", + "switch": "nologo-", + "comment": "Suppress Startup Banner", + "value": "false", + "flags": [] + }, + { + "name": "SuppressStartupBanner", + "switch": "nologo", + "comment": "Suppress Startup Banner", + "value": "true", + "flags": [] + }, + { + "name": "TreatWarningAsError", + "switch": "WX-", + "comment": "Treat Warnings As Errors", + "value": "false", + "flags": [] + }, + { + "name": "TreatWarningAsError", + "switch": "WX", + "comment": "Treat Warnings As Errors", + "value": "true", + "flags": [] + }, + { + "name": "SDLCheck", + "switch": "sdl-", + "comment": "SDL checks", + "value": "false", + "flags": [] + }, + { + "name": "SDLCheck", + "switch": "sdl", + "comment": "SDL checks", + "value": "true", + "flags": [] + }, + { + "name": "MultiProcessorCompilation", + "switch": "MP", + "comment": "Multi-processor Compilation", + "value": "true", + "flags": [ + "UserValue", + "UserIgnored", + "Continue" + ] + }, + { + "name": "IntrinsicFunctions", + "switch": "Oi", + "comment": "Enable Intrinsic Functions", + "value": "true", + "flags": [] + }, + { + "name": "OmitFramePointers", + "switch": "Oy-", + "comment": "Omit Frame Pointers", + "value": "false", + "flags": [] + }, + { + "name": "OmitFramePointers", + "switch": "Oy", + "comment": "Omit Frame Pointers", + "value": "true", + "flags": [] + }, + { + "name": "EnableFiberSafeOptimizations", + "switch": "GT", + "comment": "Enable Fiber-Safe Optimizations", + "value": "true", + "flags": [] + }, + { + "name": "WholeProgramOptimization", + "switch": "GL", + "comment": "Whole Program Optimization", + "value": "true", + "flags": [] + }, + { + "name": "UndefineAllPreprocessorDefinitions", + "switch": "u", + "comment": "Undefine All Preprocessor Definitions", + "value": "true", + "flags": [] + }, + { + "name": "IgnoreStandardIncludePath", + "switch": "X", + "comment": "Ignore Standard Include Paths", + "value": "true", + "flags": [] + }, + { + "name": "PreprocessToFile", + "switch": "P", + "comment": "Preprocess to a File", + "value": "true", + "flags": [] + }, + { + "name": "PreprocessSuppressLineNumbers", + "switch": "EP", + "comment": "Preprocess Suppress Line Numbers", + "value": "true", + "flags": [] + }, + { + "name": "PreprocessKeepComments", + "switch": "C", + "comment": "Keep Comments", + "value": "true", + "flags": [] + }, + { + "name": "StringPooling", + "switch": "GF-", + "comment": "Enable String Pooling", + "value": "false", + "flags": [] + }, + { + "name": "StringPooling", + "switch": "GF", + "comment": "Enable String Pooling", + "value": "true", + "flags": [] + }, + { + "name": "MinimalRebuild", + "switch": "Gm-", + "comment": "Enable Minimal Rebuild", + "value": "false", + "flags": [] + }, + { + "name": "MinimalRebuild", + "switch": "Gm", + "comment": "Enable Minimal Rebuild", + "value": "true", + "flags": [] + }, + { + "name": "SmallerTypeCheck", + "switch": "RTCc", + "comment": "Smaller Type Check", + "value": "true", + "flags": [] + }, + { + "name": "BufferSecurityCheck", + "switch": "GS-", + "comment": "Security Check", + "value": "false", + "flags": [] + }, + { + "name": "BufferSecurityCheck", + "switch": "GS", + "comment": "Security Check", + "value": "true", + "flags": [] + }, + { + "name": "FunctionLevelLinking", + "switch": "Gy-", + "comment": "Enable Function-Level Linking", + "value": "false", + "flags": [] + }, + { + "name": "FunctionLevelLinking", + "switch": "Gy", + "comment": "Enable Function-Level Linking", + "value": "true", + "flags": [] + }, + { + "name": "EnableParallelCodeGeneration", + "switch": "Qpar-", + "comment": "Enable Parallel Code Generation", + "value": "false", + "flags": [] + }, + { + "name": "EnableParallelCodeGeneration", + "switch": "Qpar", + "comment": "Enable Parallel Code Generation", + "value": "true", + "flags": [] + }, + { + "name": "FloatingPointExceptions", + "switch": "fp:except-", + "comment": "Enable Floating Point Exceptions", + "value": "false", + "flags": [] + }, + { + "name": "FloatingPointExceptions", + "switch": "fp:except", + "comment": "Enable Floating Point Exceptions", + "value": "true", + "flags": [] + }, + { + "name": "CreateHotpatchableImage", + "switch": "hotpatch", + "comment": "Create Hotpatchable Image", + "value": "true", + "flags": [] + }, + { + "name": "DisableLanguageExtensions", + "switch": "Za", + "comment": "Disable Language Extensions", + "value": "true", + "flags": [] + }, + { + "name": "TreatWChar_tAsBuiltInType", + "switch": "Zc:wchar_t-", + "comment": "Treat WChar_t As Built in Type", + "value": "false", + "flags": [] + }, + { + "name": "TreatWChar_tAsBuiltInType", + "switch": "Zc:wchar_t", + "comment": "Treat WChar_t As Built in Type", + "value": "true", + "flags": [] + }, + { + "name": "ForceConformanceInForLoopScope", + "switch": "Zc:forScope-", + "comment": "Force Conformance in For Loop Scope", + "value": "false", + "flags": [] + }, + { + "name": "ForceConformanceInForLoopScope", + "switch": "Zc:forScope", + "comment": "Force Conformance in For Loop Scope", + "value": "true", + "flags": [] + }, + { + "name": "RuntimeTypeInfo", + "switch": "GR-", + "comment": "Enable Run-Time Type Information", + "value": "false", + "flags": [] + }, + { + "name": "RuntimeTypeInfo", + "switch": "GR", + "comment": "Enable Run-Time Type Information", + "value": "true", + "flags": [] + }, + { + "name": "OpenMPSupport", + "switch": "openmp-", + "comment": "Open MP Support", + "value": "false", + "flags": [] + }, + { + "name": "OpenMPSupport", + "switch": "openmp", + "comment": "Open MP Support", + "value": "true", + "flags": [] + }, + { + "name": "ExpandAttributedSource", + "switch": "Fx", + "comment": "Expand Attributed Source", + "value": "true", + "flags": [] + }, + { + "name": "UseUnicodeForAssemblerListing", + "switch": "FAu", + "comment": "Use Unicode For Assembler Listing", + "value": "true", + "flags": [] + }, + { + "name": "GenerateXMLDocumentationFiles", + "switch": "doc", + "comment": "Generate XML Documentation Files", + "value": "true", + "flags": [ + "UserValue", + "UserIgnored", + "Continue" + ] + }, + { + "name": "BrowseInformation", + "switch": "FR", + "comment": "Enable Browse Information", + "value": "true", + "flags": [ + "UserValue", + "UserIgnored", + "Continue" + ] + }, + { + "name": "ShowIncludes", + "switch": "showIncludes", + "comment": "Show Includes", + "value": "true", + "flags": [] + }, + { + "name": "EnablePREfast", + "switch": "analyze-", + "comment": "Enable Code Analysis", + "value": "false", + "flags": [] + }, + { + "name": "EnablePREfast", + "switch": "analyze", + "comment": "Enable Code Analysis", + "value": "true", + "flags": [] + }, + { + "name": "UseFullPaths", + "switch": "FC", + "comment": "Use Full Paths", + "value": "true", + "flags": [] + }, + { + "name": "OmitDefaultLibName", + "switch": "Zl", + "comment": "Omit Default Library Name", + "value": "true", + "flags": [] + }, + { + "name": "AdditionalIncludeDirectories", + "switch": "I", + "comment": "Additional Include Directories", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "AdditionalUsingDirectories", + "switch": "AI", + "comment": "Additional #using Directories", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "PreprocessorDefinitions", + "switch": "D", + "comment": "Preprocessor Definitions", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "UndefinePreprocessorDefinitions", + "switch": "U", + "comment": "Undefine Preprocessor Definitions", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "DisableSpecificWarnings", + "switch": "wd", + "comment": "Disable Specific Warnings", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "ForcedIncludeFiles", + "switch": "FI", + "comment": "Forced Include File", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "ForcedUsingFiles", + "switch": "FU", + "comment": "Forced #using File", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "PREfastLog", + "switch": "analyze:log", + "comment": "Code Analysis Log", + "value": "", + "flags": [ + "UserFollowing" + ] + }, + { + "name": "PREfastAdditionalPlugins", + "switch": "analyze:plugin", + "comment": "Additional Code Analysis Native plugins", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "TreatSpecificWarningsAsErrors", + "switch": "we", + "comment": "Treat Specific Warnings As Errors", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "PreprocessOutputPath", + "switch": "Fi", + "comment": "Preprocess Output Path", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "PrecompiledHeaderFile", + "switch": "Yu", + "comment": "Precompiled Header File", + "value": "", + "flags": [ + "UserValue", + "UserRequired" + ] + }, + { + "name": "PrecompiledHeaderFile", + "switch": "Yc", + "comment": "Precompiled Header File", + "value": "", + "flags": [ + "UserValue", + "UserRequired" + ] + }, + { + "name": "PrecompiledHeaderOutputFile", + "switch": "Fp", + "comment": "Precompiled Header Output File", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "AssemblerListingLocation", + "switch": "Fa", + "comment": "ASM List Location", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "ObjectFileName", + "switch": "Fo", + "comment": "Object File Name", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "ProgramDataBaseFileName", + "switch": "Fd", + "comment": "Program Database File Name", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "XMLDocumentationFileName", + "switch": "doc", + "comment": "XML Documentation File Name", + "value": "", + "flags": [ + "UserValue", + "UserRequired" + ] + }, + { + "name": "BrowseInformationFile", + "switch": "FR", + "comment": "Browse Information File", + "value": "", + "flags": [ + "UserValue", + "UserRequired" + ] + }, + { + "name": "ProcessorNumber", + "switch": "MP", + "comment": "Number of processors", + "value": "", + "flags": [ + "UserValue", + "UserRequired" + ] + } +] diff --git a/Templates/MSBuild/FlagTables/v11_CSharp.json b/Templates/MSBuild/FlagTables/v11_CSharp.json new file mode 100644 index 0000000..a0780a4 --- /dev/null +++ b/Templates/MSBuild/FlagTables/v11_CSharp.json @@ -0,0 +1,570 @@ +[ + { + "name": "ProjectName", + "switch": "out:", + "comment": "", + "value": "", + "flags": [ + "UserValue", + "UserRequired" + ] + }, + { + "name": "OutputType", + "switch": "target:exe", + "comment": "", + "value": "Exe", + "flags": [] + }, + { + "name": "OutputType", + "switch": "target:winexe", + "comment": "", + "value": "Winexe", + "flags": [] + }, + { + "name": "OutputType", + "switch": "target:library", + "comment": "", + "value": "Library", + "flags": [] + }, + { + "name": "OutputType", + "switch": "target:module", + "comment": "", + "value": "Module", + "flags": [] + }, + { + "name": "DocumentationFile", + "switch": "doc", + "comment": "", + "value": "", + "flags": [ + "UserValue", + "UserRequired" + ] + }, + { + "name": "Platform", + "switch": "platform:x86", + "comment": "", + "value": "x86", + "flags": [] + }, + { + "name": "Platform", + "switch": "platform:Itanium", + "comment": "", + "value": "Itanium", + "flags": [] + }, + { + "name": "Platform", + "switch": "platform:x64", + "comment": "", + "value": "x64", + "flags": [] + }, + { + "name": "Platform", + "switch": "platform:arm", + "comment": "", + "value": "arm", + "flags": [] + }, + { + "name": "Platform", + "switch": "platform:anycpu32bitpreferred", + "comment": "", + "value": "anycpu32bitpreferred", + "flags": [] + }, + { + "name": "Platform", + "switch": "platform:anycpu", + "comment": "", + "value": "anycpu", + "flags": [] + }, + { + "name": "References", + "switch": "reference:", + "comment": "mit alias", + "value": "", + "flags": [] + }, + { + "name": "References", + "switch": "reference:", + "comment": "dateiliste", + "value": "", + "flags": [] + }, + { + "name": "AddModules", + "switch": "addmodule:", + "comment": "", + "value": "", + "flags": [ + "SemicolonAppendable" + ] + }, + { + "name": "Win32Resource", + "switch": "win32res:", + "comment": "", + "value": "", + "flags": [ + "UserValue", + "UserRequired" + ] + }, + { + "name": "ApplicationIcon", + "switch": "win32icon:", + "comment": "", + "value": "", + "flags": [ + "UserValue", + "UserRequired" + ] + }, + { + "name": "ApplicationManifest", + "switch": "win32manifest:", + "comment": "", + "value": "", + "flags": [ + "UserValue", + "UserRequired" + ] + }, + { + "name": "NoWin32Manifest", + "switch": "nowin32manifest", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "DefineDebug", + "switch": "debug", + "comment": "", + "value": "true", + "flags": [ + "Continue" + ] + }, + { + "name": "DebugSymbols", + "switch": "debug", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "DebugSymbols", + "switch": "debug-", + "comment": "", + "value": "false", + "flags": [] + }, + { + "name": "DebugSymbols", + "switch": "debug+", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "DebugType", + "switch": "debug:none", + "comment": "", + "value": "none", + "flags": [] + }, + { + "name": "DebugType", + "switch": "debug:full", + "comment": "", + "value": "full", + "flags": [] + }, + { + "name": "DebugType", + "switch": "debug:pdbonly", + "comment": "", + "value": "pdbonly", + "flags": [] + }, + { + "name": "Optimize", + "switch": "optimize", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "Optimize", + "switch": "optimize-", + "comment": "", + "value": "false", + "flags": [] + }, + { + "name": "Optimize", + "switch": "optimize+", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "TreatWarningsAsErrors", + "switch": "warnaserror", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "TreatWarningsAsErrors", + "switch": "warnaserror-", + "comment": "", + "value": "false", + "flags": [] + }, + { + "name": "TreatWarningsAsErrors", + "switch": "warnaserror+", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "WarningsAsErrors", + "switch": "warnaserror", + "comment": "", + "value": "", + "flags": [] + }, + { + "name": "WarningsAsErrors", + "switch": "warnaserror-", + "comment": "", + "value": "", + "flags": [] + }, + { + "name": "WarningsAsErrors", + "switch": "warnaserror+", + "comment": "", + "value": "", + "flags": [] + }, + { + "name": "WarningLevel", + "switch": "warn:0", + "comment": "", + "value": "0", + "flags": [] + }, + { + "name": "WarningLevel", + "switch": "warn:1", + "comment": "", + "value": "1", + "flags": [] + }, + { + "name": "WarningLevel", + "switch": "warn:2", + "comment": "", + "value": "2", + "flags": [] + }, + { + "name": "WarningLevel", + "switch": "warn:3", + "comment": "", + "value": "3", + "flags": [] + }, + { + "name": "WarningLevel", + "switch": "warn:4", + "comment": "", + "value": "4", + "flags": [] + }, + { + "name": "DisabledWarnings", + "switch": "nowarn", + "comment": "", + "value": "", + "flags": [] + }, + { + "name": "CheckForOverflowUnderflow", + "switch": "checked", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "CheckForOverflowUnderflow", + "switch": "checked-", + "comment": "", + "value": "false", + "flags": [] + }, + { + "name": "CheckForOverflowUnderflow", + "switch": "checked+", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "AllowUnsafeBlocks", + "switch": "unsafe", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "AllowUnsafeBlocks", + "switch": "unsafe-", + "comment": "", + "value": "false", + "flags": [] + }, + { + "name": "AllowUnsafeBlocks", + "switch": "unsafe+", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "DefineConstants", + "switch": "define:", + "comment": "", + "value": "", + "flags": [ + "SemicolonAppendable", + "UserValue" + ] + }, + { + "name": "LangVersion", + "switch": "langversion:ISO-1", + "comment": "", + "value": "ISO-1", + "flags": [] + }, + { + "name": "LangVersion", + "switch": "langversion:ISO-2", + "comment": "", + "value": "ISO-2", + "flags": [] + }, + { + "name": "LangVersion", + "switch": "langversion:3", + "comment": "", + "value": "3", + "flags": [] + }, + { + "name": "LangVersion", + "switch": "langversion:4", + "comment": "", + "value": "4", + "flags": [] + }, + { + "name": "LangVersion", + "switch": "langversion:5", + "comment": "", + "value": "5", + "flags": [] + }, + { + "name": "LangVersion", + "switch": "langversion:6", + "comment": "", + "value": "6", + "flags": [] + }, + { + "name": "LangVersion", + "switch": "langversion:default", + "comment": "", + "value": "default", + "flags": [] + }, + { + "name": "DelaySign", + "switch": "delaysign", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "DelaySign", + "switch": "delaysign-", + "comment": "", + "value": "false", + "flags": [] + }, + { + "name": "DelaySign", + "switch": "delaysign+", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "AssemblyOriginatorKeyFile", + "switch": "keyfile", + "comment": "", + "value": "", + "flags": [] + }, + { + "name": "KeyContainerName", + "switch": "keycontainer", + "comment": "", + "value": "", + "flags": [] + }, + { + "name": "NoLogo", + "switch": "nologo", + "comment": "", + "value": "", + "flags": [] + }, + { + "name": "NoConfig", + "switch": "noconfig", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "BaseAddress", + "switch": "baseaddress:", + "comment": "", + "value": "", + "flags": [] + }, + { + "name": "CodePage", + "switch": "codepage", + "comment": "", + "value": "", + "flags": [] + }, + { + "name": "Utf8Output", + "switch": "utf8output", + "comment": "", + "value": "", + "flags": [] + }, + { + "name": "MainEntryPoint", + "switch": "main:", + "comment": "", + "value": "", + "flags": [] + }, + { + "name": "GenerateFullPaths", + "switch": "fullpaths", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "FileAlignment", + "switch": "filealign", + "comment": "", + "value": "", + "flags": [] + }, + { + "name": "PdbFile", + "switch": "pdb:", + "comment": "", + "value": "", + "flags": [] + }, + { + "name": "NoStandardLib", + "switch": "nostdlib", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "NoStandardLib", + "switch": "nostdlib-", + "comment": "", + "value": "false", + "flags": [] + }, + { + "name": "NoStandardLib", + "switch": "nostdlib+", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "SubsystemVersion", + "switch": "subsystemversion", + "comment": "", + "value": "", + "flags": [] + }, + { + "name": "AdditionalLibPaths", + "switch": "lib:", + "comment": "", + "value": "", + "flags": [] + }, + { + "name": "ErrorReport", + "switch": "errorreport:none", + "comment": "Do Not Send Report", + "value": "none", + "flags": [] + }, + { + "name": "ErrorReport", + "switch": "errorreport:prompt", + "comment": "Prompt Immediately", + "value": "prompt", + "flags": [] + }, + { + "name": "ErrorReport", + "switch": "errorreport:queue", + "comment": "Queue For Next Login", + "value": "queue", + "flags": [] + }, + { + "name": "ErrorReport", + "switch": "errorreport:send", + "comment": "Send Automatically", + "value": "send", + "flags": [] + } +] diff --git a/Templates/MSBuild/FlagTables/v11_LIB.json b/Templates/MSBuild/FlagTables/v11_LIB.json new file mode 100644 index 0000000..58a238c --- /dev/null +++ b/Templates/MSBuild/FlagTables/v11_LIB.json @@ -0,0 +1,297 @@ +[ + { + "name": "ErrorReporting", + "switch": "ERRORREPORT:PROMPT", + "comment": "PromptImmediately", + "value": "PromptImmediately", + "flags": [] + }, + { + "name": "ErrorReporting", + "switch": "ERRORREPORT:QUEUE", + "comment": "Queue For Next Login", + "value": "QueueForNextLogin", + "flags": [] + }, + { + "name": "ErrorReporting", + "switch": "ERRORREPORT:SEND", + "comment": "Send Error Report", + "value": "SendErrorReport", + "flags": [] + }, + { + "name": "ErrorReporting", + "switch": "ERRORREPORT:NONE", + "comment": "No Error Report", + "value": "NoErrorReport", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:ARM", + "comment": "MachineARM", + "value": "MachineARM", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:EBC", + "comment": "MachineEBC", + "value": "MachineEBC", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:IA64", + "comment": "MachineIA64", + "value": "MachineIA64", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:MIPS", + "comment": "MachineMIPS", + "value": "MachineMIPS", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:MIPS16", + "comment": "MachineMIPS16", + "value": "MachineMIPS16", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:MIPSFPU", + "comment": "MachineMIPSFPU", + "value": "MachineMIPSFPU", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:MIPSFPU16", + "comment": "MachineMIPSFPU16", + "value": "MachineMIPSFPU16", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:SH4", + "comment": "MachineSH4", + "value": "MachineSH4", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:THUMB", + "comment": "MachineTHUMB", + "value": "MachineTHUMB", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:X64", + "comment": "MachineX64", + "value": "MachineX64", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:X86", + "comment": "MachineX86", + "value": "MachineX86", + "flags": [] + }, + { + "name": "SubSystem", + "switch": "SUBSYSTEM:CONSOLE", + "comment": "Console", + "value": "Console", + "flags": [] + }, + { + "name": "SubSystem", + "switch": "SUBSYSTEM:WINDOWS", + "comment": "Windows", + "value": "Windows", + "flags": [] + }, + { + "name": "SubSystem", + "switch": "SUBSYSTEM:NATIVE", + "comment": "Native", + "value": "Native", + "flags": [] + }, + { + "name": "SubSystem", + "switch": "SUBSYSTEM:EFI_APPLICATION", + "comment": "EFI Application", + "value": "EFI Application", + "flags": [] + }, + { + "name": "SubSystem", + "switch": "SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER", + "comment": "EFI Boot Service Driver", + "value": "EFI Boot Service Driver", + "flags": [] + }, + { + "name": "SubSystem", + "switch": "SUBSYSTEM:EFI_ROM", + "comment": "EFI ROM", + "value": "EFI ROM", + "flags": [] + }, + { + "name": "SubSystem", + "switch": "SUBSYSTEM:EFI_RUNTIME_DRIVER", + "comment": "EFI Runtime", + "value": "EFI Runtime", + "flags": [] + }, + { + "name": "SubSystem", + "switch": "SUBSYSTEM:WINDOWSCE", + "comment": "WindowsCE", + "value": "WindowsCE", + "flags": [] + }, + { + "name": "SubSystem", + "switch": "SUBSYSTEM:POSIX", + "comment": "POSIX", + "value": "POSIX", + "flags": [] + }, + { + "name": "SuppressStartupBanner", + "switch": "NOLOGO", + "comment": "Suppress Startup Banner", + "value": "true", + "flags": [] + }, + { + "name": "IgnoreAllDefaultLibraries", + "switch": "NODEFAULTLIB", + "comment": "Ignore All Default Libraries", + "value": "true", + "flags": [] + }, + { + "name": "TreatLibWarningAsErrors", + "switch": "WX:NO", + "comment": "Treat Lib Warning As Errors", + "value": "false", + "flags": [] + }, + { + "name": "TreatLibWarningAsErrors", + "switch": "WX", + "comment": "Treat Lib Warning As Errors", + "value": "true", + "flags": [] + }, + { + "name": "Verbose", + "switch": "VERBOSE", + "comment": "Verbose", + "value": "true", + "flags": [] + }, + { + "name": "LinkTimeCodeGeneration", + "switch": "LTCG", + "comment": "Link Time Code Generation", + "value": "true", + "flags": [] + }, + { + "name": "AdditionalLibraryDirectories", + "switch": "LIBPATH:", + "comment": "Additional Library Directories", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "IgnoreSpecificDefaultLibraries", + "switch": "NODEFAULTLIB:", + "comment": "Ignore Specific Default Libraries", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "ExportNamedFunctions", + "switch": "EXPORT:", + "comment": "Export Named Functions", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "RemoveObjects", + "switch": "REMOVE:", + "comment": "Remove Objects", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "OutputFile", + "switch": "OUT:", + "comment": "Output File", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "ModuleDefinitionFile", + "switch": "DEF:", + "comment": "Module Definition File Name", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "ForceSymbolReferences", + "switch": "INCLUDE:", + "comment": "Force Symbol References", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "DisplayLibrary", + "switch": "LIST:", + "comment": "Display Library to standard output", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "Name", + "switch": "NAME:", + "comment": "Name", + "value": "", + "flags": [ + "UserValue" + ] + } +] diff --git a/Templates/MSBuild/FlagTables/v11_Link.json b/Templates/MSBuild/FlagTables/v11_Link.json new file mode 100644 index 0000000..5d5c13f --- /dev/null +++ b/Templates/MSBuild/FlagTables/v11_Link.json @@ -0,0 +1,1272 @@ +[ + { + "name": "ShowProgress", + "switch": "", + "comment": "Not Set", + "value": "NotSet", + "flags": [] + }, + { + "name": "ShowProgress", + "switch": "VERBOSE", + "comment": "Display all progress messages", + "value": "LinkVerbose", + "flags": [] + }, + { + "name": "ShowProgress", + "switch": "VERBOSE:Lib", + "comment": "For Libraries Searched", + "value": "LinkVerboseLib", + "flags": [] + }, + { + "name": "ShowProgress", + "switch": "VERBOSE:ICF", + "comment": "About COMDAT folding during optimized linking", + "value": "LinkVerboseICF", + "flags": [] + }, + { + "name": "ShowProgress", + "switch": "VERBOSE:REF", + "comment": "About data removed during optimized linking", + "value": "LinkVerboseREF", + "flags": [] + }, + { + "name": "ShowProgress", + "switch": "VERBOSE:SAFESEH", + "comment": "About Modules incompatible with SEH", + "value": "LinkVerboseSAFESEH", + "flags": [] + }, + { + "name": "ShowProgress", + "switch": "VERBOSE:CLR", + "comment": "About linker activity related to managed code", + "value": "LinkVerboseCLR", + "flags": [] + }, + { + "name": "ForceFileOutput", + "switch": "FORCE", + "comment": "Enabled", + "value": "Enabled", + "flags": [] + }, + { + "name": "ForceFileOutput", + "switch": "FORCE:MULTIPLE", + "comment": "Multiply Defined Symbol Only", + "value": "MultiplyDefinedSymbolOnly", + "flags": [] + }, + { + "name": "ForceFileOutput", + "switch": "FORCE:UNRESOLVED", + "comment": "Undefined Symbol Only", + "value": "UndefinedSymbolOnly", + "flags": [] + }, + { + "name": "CreateHotPatchableImage", + "switch": "FUNCTIONPADMIN", + "comment": "Enabled", + "value": "Enabled", + "flags": [] + }, + { + "name": "CreateHotPatchableImage", + "switch": "FUNCTIONPADMIN:5", + "comment": "X86 Image Only", + "value": "X86Image", + "flags": [] + }, + { + "name": "CreateHotPatchableImage", + "switch": "FUNCTIONPADMIN:6", + "comment": "X64 Image Only", + "value": "X64Image", + "flags": [] + }, + { + "name": "CreateHotPatchableImage", + "switch": "FUNCTIONPADMIN:16", + "comment": "Itanium Image Only", + "value": "ItaniumImage", + "flags": [] + }, + { + "name": "UACExecutionLevel", + "switch": "level='asInvoker'", + "comment": "asInvoker", + "value": "AsInvoker", + "flags": [] + }, + { + "name": "UACExecutionLevel", + "switch": "level='highestAvailable'", + "comment": "highestAvailable", + "value": "HighestAvailable", + "flags": [] + }, + { + "name": "UACExecutionLevel", + "switch": "level='requireAdministrator'", + "comment": "requireAdministrator", + "value": "RequireAdministrator", + "flags": [] + }, + { + "name": "SubSystem", + "switch": "", + "comment": "Not Set", + "value": "NotSet", + "flags": [] + }, + { + "name": "SubSystem", + "switch": "SUBSYSTEM:CONSOLE", + "comment": "Console", + "value": "Console", + "flags": [] + }, + { + "name": "SubSystem", + "switch": "SUBSYSTEM:WINDOWS", + "comment": "Windows", + "value": "Windows", + "flags": [] + }, + { + "name": "SubSystem", + "switch": "SUBSYSTEM:NATIVE", + "comment": "Native", + "value": "Native", + "flags": [] + }, + { + "name": "SubSystem", + "switch": "SUBSYSTEM:EFI_APPLICATION", + "comment": "EFI Application", + "value": "EFI Application", + "flags": [] + }, + { + "name": "SubSystem", + "switch": "SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER", + "comment": "EFI Boot Service Driver", + "value": "EFI Boot Service Driver", + "flags": [] + }, + { + "name": "SubSystem", + "switch": "SUBSYSTEM:EFI_ROM", + "comment": "EFI ROM", + "value": "EFI ROM", + "flags": [] + }, + { + "name": "SubSystem", + "switch": "SUBSYSTEM:EFI_RUNTIME_DRIVER", + "comment": "EFI Runtime", + "value": "EFI Runtime", + "flags": [] + }, + { + "name": "SubSystem", + "switch": "SUBSYSTEM:POSIX", + "comment": "POSIX", + "value": "POSIX", + "flags": [] + }, + { + "name": "Driver", + "switch": "", + "comment": "Not Set", + "value": "NotSet", + "flags": [] + }, + { + "name": "Driver", + "switch": "Driver", + "comment": "Driver", + "value": "Driver", + "flags": [] + }, + { + "name": "Driver", + "switch": "DRIVER:UPONLY", + "comment": "UP Only", + "value": "UpOnly", + "flags": [] + }, + { + "name": "Driver", + "switch": "DRIVER:WDM", + "comment": "WDM", + "value": "WDM", + "flags": [] + }, + { + "name": "LinkTimeCodeGeneration", + "switch": "", + "comment": "Default", + "value": "Default", + "flags": [] + }, + { + "name": "LinkTimeCodeGeneration", + "switch": "LTCG", + "comment": "Use Link Time Code Generation", + "value": "UseLinkTimeCodeGeneration", + "flags": [] + }, + { + "name": "LinkTimeCodeGeneration", + "switch": "LTCG:PGInstrument", + "comment": "Profile Guided Optimization - Instrument", + "value": "PGInstrument", + "flags": [] + }, + { + "name": "LinkTimeCodeGeneration", + "switch": "LTCG:PGOptimize", + "comment": "Profile Guided Optimization - Optimization", + "value": "PGOptimization", + "flags": [] + }, + { + "name": "LinkTimeCodeGeneration", + "switch": "LTCG:PGUpdate", + "comment": "Profile Guided Optimization - Update", + "value": "PGUpdate", + "flags": [] + }, + { + "name": "GenerateWindowsMetadata", + "switch": "WINMD", + "comment": "Yes", + "value": "true", + "flags": [] + }, + { + "name": "GenerateWindowsMetadata", + "switch": "WINMD:NO", + "comment": "No", + "value": "false", + "flags": [] + }, + { + "name": "WindowsMetadataSignHash", + "switch": "WINMDSIGNHASH:SHA1", + "comment": "SHA1", + "value": "SHA1", + "flags": [] + }, + { + "name": "WindowsMetadataSignHash", + "switch": "WINMDSIGNHASH:SHA256", + "comment": "SHA256", + "value": "SHA256", + "flags": [] + }, + { + "name": "WindowsMetadataSignHash", + "switch": "WINMDSIGNHASH:SHA384", + "comment": "SHA384", + "value": "SHA384", + "flags": [] + }, + { + "name": "WindowsMetadataSignHash", + "switch": "WINMDSIGNHASH:SHA512", + "comment": "SHA512", + "value": "SHA512", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "", + "comment": "Not Set", + "value": "NotSet", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:ARM", + "comment": "MachineARM", + "value": "MachineARM", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:EBC", + "comment": "MachineEBC", + "value": "MachineEBC", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:IA64", + "comment": "MachineIA64", + "value": "MachineIA64", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:MIPS", + "comment": "MachineMIPS", + "value": "MachineMIPS", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:MIPS16", + "comment": "MachineMIPS16", + "value": "MachineMIPS16", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:MIPSFPU", + "comment": "MachineMIPSFPU", + "value": "MachineMIPSFPU", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:MIPSFPU16", + "comment": "MachineMIPSFPU16", + "value": "MachineMIPSFPU16", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:SH4", + "comment": "MachineSH4", + "value": "MachineSH4", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:THUMB", + "comment": "MachineTHUMB", + "value": "MachineTHUMB", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:X64", + "comment": "MachineX64", + "value": "MachineX64", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:X86", + "comment": "MachineX86", + "value": "MachineX86", + "flags": [] + }, + { + "name": "CLRThreadAttribute", + "switch": "CLRTHREADATTRIBUTE:MTA", + "comment": "MTA threading attribute", + "value": "MTAThreadingAttribute", + "flags": [] + }, + { + "name": "CLRThreadAttribute", + "switch": "CLRTHREADATTRIBUTE:STA", + "comment": "STA threading attribute", + "value": "STAThreadingAttribute", + "flags": [] + }, + { + "name": "CLRThreadAttribute", + "switch": "CLRTHREADATTRIBUTE:NONE", + "comment": "Default threading attribute", + "value": "DefaultThreadingAttribute", + "flags": [] + }, + { + "name": "CLRImageType", + "switch": "CLRIMAGETYPE:IJW", + "comment": "Force IJW image", + "value": "ForceIJWImage", + "flags": [] + }, + { + "name": "CLRImageType", + "switch": "CLRIMAGETYPE:PURE", + "comment": "Force Pure IL Image", + "value": "ForcePureILImage", + "flags": [] + }, + { + "name": "CLRImageType", + "switch": "CLRIMAGETYPE:SAFE", + "comment": "Force Safe IL Image", + "value": "ForceSafeILImage", + "flags": [] + }, + { + "name": "CLRImageType", + "switch": "", + "comment": "Default image type", + "value": "Default", + "flags": [] + }, + { + "name": "SignHash", + "switch": "CLRSIGNHASH:SHA1", + "comment": "SHA1", + "value": "SHA1", + "flags": [] + }, + { + "name": "SignHash", + "switch": "CLRSIGNHASH:SHA256", + "comment": "SHA256", + "value": "SHA256", + "flags": [] + }, + { + "name": "SignHash", + "switch": "CLRSIGNHASH:SHA384", + "comment": "SHA384", + "value": "SHA384", + "flags": [] + }, + { + "name": "SignHash", + "switch": "CLRSIGNHASH:SHA512", + "comment": "SHA512", + "value": "SHA512", + "flags": [] + }, + { + "name": "LinkErrorReporting", + "switch": "ERRORREPORT:PROMPT", + "comment": "PromptImmediately", + "value": "PromptImmediately", + "flags": [] + }, + { + "name": "LinkErrorReporting", + "switch": "ERRORREPORT:QUEUE", + "comment": "Queue For Next Login", + "value": "QueueForNextLogin", + "flags": [] + }, + { + "name": "LinkErrorReporting", + "switch": "ERRORREPORT:SEND", + "comment": "Send Error Report", + "value": "SendErrorReport", + "flags": [] + }, + { + "name": "LinkErrorReporting", + "switch": "ERRORREPORT:NONE", + "comment": "No Error Report", + "value": "NoErrorReport", + "flags": [] + }, + { + "name": "CLRSupportLastError", + "switch": "CLRSupportLastError", + "comment": "Enabled", + "value": "Enabled", + "flags": [] + }, + { + "name": "CLRSupportLastError", + "switch": "CLRSupportLastError:NO", + "comment": "Disabled", + "value": "Disabled", + "flags": [] + }, + { + "name": "CLRSupportLastError", + "switch": "CLRSupportLastError:SYSTEMDLL", + "comment": "System Dlls Only", + "value": "SystemDlls", + "flags": [] + }, + { + "name": "LinkIncremental", + "switch": "INCREMENTAL:NO", + "comment": "Enable Incremental Linking", + "value": "false", + "flags": [] + }, + { + "name": "LinkIncremental", + "switch": "INCREMENTAL", + "comment": "Enable Incremental Linking", + "value": "true", + "flags": [] + }, + { + "name": "SuppressStartupBanner", + "switch": "NOLOGO", + "comment": "Suppress Startup Banner", + "value": "true", + "flags": [] + }, + { + "name": "LinkStatus", + "switch": "LTCG:NOSTATUS", + "comment": "Link Status", + "value": "false", + "flags": [] + }, + { + "name": "LinkStatus", + "switch": "LTCG:STATUS", + "comment": "Link Status", + "value": "true", + "flags": [] + }, + { + "name": "PreventDllBinding", + "switch": "ALLOWBIND:NO", + "comment": "Prevent Dll Binding", + "value": "false", + "flags": [] + }, + { + "name": "PreventDllBinding", + "switch": "ALLOWBIND", + "comment": "Prevent Dll Binding", + "value": "true", + "flags": [] + }, + { + "name": "TreatLinkerWarningAsErrors", + "switch": "WX:NO", + "comment": "Treat Linker Warning As Errors", + "value": "false", + "flags": [] + }, + { + "name": "TreatLinkerWarningAsErrors", + "switch": "WX", + "comment": "Treat Linker Warning As Errors", + "value": "true", + "flags": [] + }, + { + "name": "IgnoreAllDefaultLibraries", + "switch": "NODEFAULTLIB", + "comment": "Ignore All Default Libraries", + "value": "true", + "flags": [] + }, + { + "name": "GenerateManifest", + "switch": "MANIFEST:NO", + "comment": "Generate Manifest", + "value": "false", + "flags": [] + }, + { + "name": "GenerateManifest", + "switch": "MANIFEST", + "comment": "Generate Manifest", + "value": "true", + "flags": [] + }, + { + "name": "AllowIsolation", + "switch": "ALLOWISOLATION:NO", + "comment": "Allow Isolation", + "value": "false", + "flags": [] + }, + { + "name": "AllowIsolation", + "switch": "", + "comment": "Allow Isolation", + "value": "true", + "flags": [] + }, + { + "name": "EnableUAC", + "switch": "MANIFESTUAC:", + "comment": "", + "value": "", + "flags": [ + "UserValue", + "UserRequired", + "SpaceAppendable" + ] + }, + { + "name": "UACUIAccess", + "switch": "uiAccess='false'", + "comment": "UAC Bypass UI Protection", + "value": "false", + "flags": [ + "UserValue", + "UserRequired" + ] + }, + { + "name": "UACUIAccess", + "switch": "uiAccess='false'", + "comment": "UAC Bypass UI Protection", + "value": "false", + "flags": [] + }, + { + "name": "UACUIAccess", + "switch": "uiAccess='true'", + "comment": "UAC Bypass UI Protection", + "value": "true", + "flags": [] + }, + { + "name": "ManifestEmbed", + "switch": "manifest:embed", + "comment": "Embed Manifest", + "value": "true", + "flags": [] + }, + { + "name": "GenerateDebugInformation", + "switch": "DEBUG", + "comment": "Generate Debug Info", + "value": "true", + "flags": [ + "CaseInsensitive" + ] + }, + { + "name": "GenerateMapFile", + "switch": "MAP", + "comment": "Generate Map File", + "value": "true", + "flags": [ + "UserValue", + "UserIgnored", + "Continue" + ] + }, + { + "name": "MapExports", + "switch": "MAPINFO:EXPORTS", + "comment": "Map Exports", + "value": "true", + "flags": [] + }, + { + "name": "AssemblyDebug", + "switch": "ASSEMBLYDEBUG:DISABLE", + "comment": "Debuggable Assembly", + "value": "false", + "flags": [] + }, + { + "name": "AssemblyDebug", + "switch": "ASSEMBLYDEBUG", + "comment": "Debuggable Assembly", + "value": "true", + "flags": [] + }, + { + "name": "LargeAddressAware", + "switch": "LARGEADDRESSAWARE:NO", + "comment": "Enable Large Addresses", + "value": "false", + "flags": [] + }, + { + "name": "LargeAddressAware", + "switch": "LARGEADDRESSAWARE", + "comment": "Enable Large Addresses", + "value": "true", + "flags": [] + }, + { + "name": "TerminalServerAware", + "switch": "TSAWARE:NO", + "comment": "Terminal Server", + "value": "false", + "flags": [] + }, + { + "name": "TerminalServerAware", + "switch": "TSAWARE", + "comment": "Terminal Server", + "value": "true", + "flags": [] + }, + { + "name": "SwapRunFromCD", + "switch": "SWAPRUN:CD", + "comment": "Swap Run From CD", + "value": "true", + "flags": [] + }, + { + "name": "SwapRunFromNET", + "switch": "SWAPRUN:NET", + "comment": "Swap Run From Network", + "value": "true", + "flags": [] + }, + { + "name": "OptimizeReferences", + "switch": "OPT:NOREF", + "comment": "References", + "value": "false", + "flags": [] + }, + { + "name": "OptimizeReferences", + "switch": "OPT:REF", + "comment": "References", + "value": "true", + "flags": [] + }, + { + "name": "EnableCOMDATFolding", + "switch": "OPT:NOICF", + "comment": "Enable COMDAT Folding", + "value": "false", + "flags": [] + }, + { + "name": "EnableCOMDATFolding", + "switch": "OPT:ICF", + "comment": "Enable COMDAT Folding", + "value": "true", + "flags": [] + }, + { + "name": "IgnoreEmbeddedIDL", + "switch": "IGNOREIDL", + "comment": "Ignore Embedded IDL", + "value": "true", + "flags": [] + }, + { + "name": "AppContainer", + "switch": "APPCONTAINER", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "WindowsMetadataLinkDelaySign", + "switch": "WINMDDELAYSIGN:NO", + "comment": "Windows Metadata Delay Sign", + "value": "false", + "flags": [] + }, + { + "name": "WindowsMetadataLinkDelaySign", + "switch": "WINMDDELAYSIGN", + "comment": "Windows Metadata Delay Sign", + "value": "true", + "flags": [] + }, + { + "name": "NoEntryPoint", + "switch": "NOENTRY", + "comment": "No Entry Point", + "value": "true", + "flags": [] + }, + { + "name": "SetChecksum", + "switch": "RELEASE", + "comment": "Set Checksum", + "value": "true", + "flags": [] + }, + { + "name": "RandomizedBaseAddress", + "switch": "DYNAMICBASE:NO", + "comment": "Randomized Base Address", + "value": "false", + "flags": [] + }, + { + "name": "RandomizedBaseAddress", + "switch": "DYNAMICBASE", + "comment": "Randomized Base Address", + "value": "true", + "flags": [] + }, + { + "name": "FixedBaseAddress", + "switch": "FIXED:NO", + "comment": "Fixed Base Address", + "value": "false", + "flags": [] + }, + { + "name": "FixedBaseAddress", + "switch": "FIXED", + "comment": "Fixed Base Address", + "value": "true", + "flags": [] + }, + { + "name": "DataExecutionPrevention", + "switch": "NXCOMPAT:NO", + "comment": "Data Execution Prevention (DEP)", + "value": "false", + "flags": [] + }, + { + "name": "DataExecutionPrevention", + "switch": "NXCOMPAT", + "comment": "Data Execution Prevention (DEP)", + "value": "true", + "flags": [] + }, + { + "name": "TurnOffAssemblyGeneration", + "switch": "NOASSEMBLY", + "comment": "Turn Off Assembly Generation", + "value": "true", + "flags": [] + }, + { + "name": "SupportUnloadOfDelayLoadedDLL", + "switch": "DELAY:UNLOAD", + "comment": "Unload delay loaded DLL", + "value": "true", + "flags": [] + }, + { + "name": "SupportNobindOfDelayLoadedDLL", + "switch": "DELAY:NOBIND", + "comment": "Nobind delay loaded DLL", + "value": "true", + "flags": [] + }, + { + "name": "Profile", + "switch": "PROFILE", + "comment": "Profile", + "value": "true", + "flags": [] + }, + { + "name": "LinkDelaySign", + "switch": "DELAYSIGN:NO", + "comment": "Delay Sign", + "value": "false", + "flags": [] + }, + { + "name": "LinkDelaySign", + "switch": "DELAYSIGN", + "comment": "Delay Sign", + "value": "true", + "flags": [] + }, + { + "name": "CLRUnmanagedCodeCheck", + "switch": "CLRUNMANAGEDCODECHECK:NO", + "comment": "CLR Unmanaged Code Check", + "value": "false", + "flags": [] + }, + { + "name": "CLRUnmanagedCodeCheck", + "switch": "CLRUNMANAGEDCODECHECK", + "comment": "CLR Unmanaged Code Check", + "value": "true", + "flags": [] + }, + { + "name": "DetectOneDefinitionRule", + "switch": "ODR", + "comment": "Detect One Definition Rule violations", + "value": "true", + "flags": [] + }, + { + "name": "ImageHasSafeExceptionHandlers", + "switch": "SAFESEH:NO", + "comment": "Image Has Safe Exception Handlers", + "value": "false", + "flags": [] + }, + { + "name": "ImageHasSafeExceptionHandlers", + "switch": "SAFESEH", + "comment": "Image Has Safe Exception Handlers", + "value": "true", + "flags": [] + }, + { + "name": "LinkDLL", + "switch": "DLL", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "AdditionalLibraryDirectories", + "switch": "LIBPATH:", + "comment": "Additional Library Directories", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "IgnoreSpecificDefaultLibraries", + "switch": "NODEFAULTLIB:", + "comment": "Ignore Specific Default Libraries", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "AddModuleNamesToAssembly", + "switch": "ASSEMBLYMODULE:", + "comment": "Add Module to Assembly", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "EmbedManagedResourceFile", + "switch": "ASSEMBLYRESOURCE:", + "comment": "Embed Managed Resource File", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "ForceSymbolReferences", + "switch": "INCLUDE:", + "comment": "Force Symbol References", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "DelayLoadDLLs", + "switch": "DELAYLOAD:", + "comment": "Delay Loaded Dlls", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "AssemblyLinkResource", + "switch": "ASSEMBLYLINKRESOURCE:", + "comment": "Assembly Link Resource", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "AdditionalManifestDependencies", + "switch": "MANIFESTDEPENDENCY:", + "comment": "Additional Manifest Dependencies", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "ManifestInput", + "switch": "manifestinput:", + "comment": "Manifest Input", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "OutputFile", + "switch": "OUT:", + "comment": "Output File", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "Version", + "switch": "VERSION:", + "comment": "Version", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "SpecifySectionAttributes", + "switch": "SECTION:", + "comment": "Specify Section Attributes", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "MSDOSStubFileName", + "switch": "STUB:", + "comment": "MS-DOS Stub File Name", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "ModuleDefinitionFile", + "switch": "DEF:", + "comment": "Module Definition File", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "ManifestFile", + "switch": "ManifestFile:", + "comment": "Manifest File", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "ProgramDatabaseFile", + "switch": "PDB:", + "comment": "Generate Program Database File", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "StripPrivateSymbols", + "switch": "PDBSTRIPPED:", + "comment": "Strip Private Symbols", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "MapFileName", + "switch": "MAP:", + "comment": "Map File Name", + "value": "", + "flags": [ + "UserValue", + "UserRequired" + ] + }, + { + "name": "HeapReserveSize", + "switch": "HEAP:", + "comment": "Heap Reserve Size", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "HeapCommitSize", + "switch": "HEAP", + "comment": "Heap Commit Size", + "value": "", + "flags": [ + "UserValue", + "UserRequired" + ] + }, + { + "name": "StackReserveSize", + "switch": "STACK:", + "comment": "Stack Reserve Size", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "StackCommitSize", + "switch": "STACK", + "comment": "Stack Commit Size", + "value": "", + "flags": [ + "UserValue", + "UserRequired" + ] + }, + { + "name": "FunctionOrder", + "switch": "ORDER:@", + "comment": "Function Order", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "ProfileGuidedDatabase", + "switch": "PGD:", + "comment": "Profile Guided Database", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "MidlCommandFile", + "switch": "MIDL:@", + "comment": "MIDL Commands", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "MergedIDLBaseFileName", + "switch": "IDLOUT:", + "comment": "Merged IDL Base File Name", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "TypeLibraryFile", + "switch": "TLBOUT:", + "comment": "Type Library", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "WindowsMetadataFile", + "switch": "WINMDFILE:", + "comment": "Windows Metadata File", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "WindowsMetadataLinkKeyFile", + "switch": "WINMDKEYFILE:", + "comment": "Windows Metadata Key File", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "WindowsMetadataKeyContainer", + "switch": "WINMDKEYCONTAINER:", + "comment": "Windows Metadata Key Container", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "EntryPointSymbol", + "switch": "ENTRY:", + "comment": "Entry Point", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "BaseAddress", + "switch": "BASE:", + "comment": "Base Address", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "ImportLibrary", + "switch": "IMPLIB:", + "comment": "Import Library", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "MergeSections", + "switch": "MERGE:", + "comment": "Merge Sections", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "LinkKeyFile", + "switch": "KEYFILE:", + "comment": "Key File", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "KeyContainer", + "switch": "KEYCONTAINER:", + "comment": "Key Container", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "TypeLibraryResourceID", + "switch": "TLBID:", + "comment": "TypeLib Resource ID", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "SectionAlignment", + "switch": "ALIGN:", + "comment": "SectionAlignment", + "value": "", + "flags": [ + "UserValue" + ] + } +] diff --git a/Templates/MSBuild/FlagTables/v11_MASM.json b/Templates/MSBuild/FlagTables/v11_MASM.json new file mode 100644 index 0000000..4634306 --- /dev/null +++ b/Templates/MSBuild/FlagTables/v11_MASM.json @@ -0,0 +1,295 @@ +[ + { + "name": "PreserveIdentifierCase", + "switch": "", + "comment": "Default", + "value": "0", + "flags": [] + }, + { + "name": "PreserveIdentifierCase", + "switch": "Cp", + "comment": "Preserves Identifier Case (/Cp)", + "value": "1", + "flags": [] + }, + { + "name": "PreserveIdentifierCase", + "switch": "Cu", + "comment": "Maps all identifiers to upper case. (/Cu)", + "value": "2", + "flags": [] + }, + { + "name": "PreserveIdentifierCase", + "switch": "Cx", + "comment": "Preserves case in public and extern symbols. (/Cx)", + "value": "3", + "flags": [] + }, + { + "name": "WarningLevel", + "switch": "W0", + "comment": "Warning Level 0 (/W0)", + "value": "0", + "flags": [] + }, + { + "name": "WarningLevel", + "switch": "W1", + "comment": "Warning Level 1 (/W1)", + "value": "1", + "flags": [] + }, + { + "name": "WarningLevel", + "switch": "W2", + "comment": "Warning Level 2 (/W2)", + "value": "2", + "flags": [] + }, + { + "name": "WarningLevel", + "switch": "W3", + "comment": "Warning Level 3 (/W3)", + "value": "3", + "flags": [] + }, + { + "name": "PackAlignmentBoundary", + "switch": "", + "comment": "Default", + "value": "0", + "flags": [] + }, + { + "name": "PackAlignmentBoundary", + "switch": "Zp1", + "comment": "One Byte Boundary (/Zp1)", + "value": "1", + "flags": [] + }, + { + "name": "PackAlignmentBoundary", + "switch": "Zp2", + "comment": "Two Byte Boundary (/Zp2)", + "value": "2", + "flags": [] + }, + { + "name": "PackAlignmentBoundary", + "switch": "Zp4", + "comment": "Four Byte Boundary (/Zp4)", + "value": "3", + "flags": [] + }, + { + "name": "PackAlignmentBoundary", + "switch": "Zp8", + "comment": "Eight Byte Boundary (/Zp8)", + "value": "4", + "flags": [] + }, + { + "name": "PackAlignmentBoundary", + "switch": "Zp16", + "comment": "Sixteen Byte Boundary (/Zp16)", + "value": "5", + "flags": [] + }, + { + "name": "CallingConvention", + "switch": "", + "comment": "Default", + "value": "0", + "flags": [] + }, + { + "name": "CallingConvention", + "switch": "Gd", + "comment": "Use C-style Calling Convention (/Gd)", + "value": "1", + "flags": [] + }, + { + "name": "CallingConvention", + "switch": "Gz", + "comment": "Use stdcall Calling Convention (/Gz)", + "value": "2", + "flags": [] + }, + { + "name": "CallingConvention", + "switch": "Gc", + "comment": "Use Pascal Calling Convention (/Gc)", + "value": "3", + "flags": [] + }, + { + "name": "ErrorReporting", + "switch": "errorReport:prompt", + "comment": "Prompt to send report immediately (/errorReport:prompt)", + "value": "0", + "flags": [] + }, + { + "name": "ErrorReporting", + "switch": "errorReport:queue", + "comment": "Prompt to send report at the next logon (/errorReport:queue)", + "value": "1", + "flags": [] + }, + { + "name": "ErrorReporting", + "switch": "errorReport:send", + "comment": "Automatically send report (/errorReport:send)", + "value": "2", + "flags": [] + }, + { + "name": "ErrorReporting", + "switch": "errorReport:none", + "comment": "Do not send report (/errorReport:none)", + "value": "3", + "flags": [] + }, + { + "name": "NoLogo", + "switch": "nologo", + "comment": "Suppress Startup Banner", + "value": "true", + "flags": [] + }, + { + "name": "GeneratePreprocessedSourceListing", + "switch": "EP", + "comment": "Generate Preprocessed Source Listing", + "value": "true", + "flags": [] + }, + { + "name": "ListAllAvailableInformation", + "switch": "Sa", + "comment": "List All Available Information", + "value": "true", + "flags": [] + }, + { + "name": "UseSafeExceptionHandlers", + "switch": "safeseh", + "comment": "Use Safe Exception Handlers", + "value": "true", + "flags": [] + }, + { + "name": "AddFirstPassListing", + "switch": "Sf", + "comment": "Add First Pass Listing", + "value": "true", + "flags": [] + }, + { + "name": "EnableAssemblyGeneratedCodeListing", + "switch": "Sg", + "comment": "Enable Assembly Generated Code Listing", + "value": "true", + "flags": [] + }, + { + "name": "DisableSymbolTable", + "switch": "Sn", + "comment": "Disable Symbol Table", + "value": "true", + "flags": [] + }, + { + "name": "EnableFalseConditionalsInListing", + "switch": "Sx", + "comment": "Enable False Conditionals In Listing", + "value": "true", + "flags": [] + }, + { + "name": "TreatWarningsAsErrors", + "switch": "WX", + "comment": "Treat Warnings As Errors", + "value": "true", + "flags": [] + }, + { + "name": "MakeAllSymbolsPublic", + "switch": "Zf", + "comment": "Make All Symbols Public", + "value": "true", + "flags": [] + }, + { + "name": "GenerateDebugInformation", + "switch": "Zi", + "comment": "Generate Debug Information", + "value": "true", + "flags": [] + }, + { + "name": "EnableMASM51Compatibility", + "switch": "Zm", + "comment": "Enable MASM 5.1 Compatibility", + "value": "true", + "flags": [] + }, + { + "name": "PerformSyntaxCheckOnly", + "switch": "Zs", + "comment": "Perform Syntax Check Only", + "value": "true", + "flags": [] + }, + { + "name": "PreprocessorDefinitions", + "switch": "D", + "comment": "Preprocessor Definitions", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "IncludePaths", + "switch": "I", + "comment": "Include Paths", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "BrowseFile", + "switch": "FR", + "comment": "Generate Browse Information File", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "ObjectFileName", + "switch": "Fo", + "comment": "Object File Name", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "AssembledCodeListingFile", + "switch": "Fl", + "comment": "Assembled Code Listing File", + "value": "", + "flags": [ + "UserValue" + ] + } +] diff --git a/Templates/MSBuild/FlagTables/v11_RC.json b/Templates/MSBuild/FlagTables/v11_RC.json new file mode 100644 index 0000000..b8c0127 --- /dev/null +++ b/Templates/MSBuild/FlagTables/v11_RC.json @@ -0,0 +1,69 @@ +[ + { + "name": "IgnoreStandardIncludePath", + "switch": "X", + "comment": "Ignore Standard Include Paths", + "value": "true", + "flags": [] + }, + { + "name": "ShowProgress", + "switch": "v", + "comment": "Show Progress", + "value": "true", + "flags": [] + }, + { + "name": "SuppressStartupBanner", + "switch": "nologo", + "comment": "Suppress Startup Banner", + "value": "true", + "flags": [] + }, + { + "name": "NullTerminateStrings", + "switch": "n", + "comment": "Null Terminate Strings", + "value": "true", + "flags": [] + }, + { + "name": "PreprocessorDefinitions", + "switch": "D", + "comment": "Preprocessor Definitions", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "UndefinePreprocessorDefinitions", + "switch": "u", + "comment": "Undefine Preprocessor Definitions", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "AdditionalIncludeDirectories", + "switch": "I", + "comment": "Additional Include Directories", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "ResourceOutputFileName", + "switch": "fo", + "comment": "Resource File Name", + "value": "", + "flags": [ + "UserValue" + ] + } +] diff --git a/Templates/MSBuild/FlagTables/v12_CL.json b/Templates/MSBuild/FlagTables/v12_CL.json new file mode 100644 index 0000000..771a555 --- /dev/null +++ b/Templates/MSBuild/FlagTables/v12_CL.json @@ -0,0 +1,1077 @@ +[ + { + "name": "DebugInformationFormat", + "switch": "", + "comment": "None", + "value": "None", + "flags": [] + }, + { + "name": "DebugInformationFormat", + "switch": "Z7", + "comment": "C7 compatible", + "value": "OldStyle", + "flags": [] + }, + { + "name": "DebugInformationFormat", + "switch": "Zi", + "comment": "Program Database", + "value": "ProgramDatabase", + "flags": [] + }, + { + "name": "DebugInformationFormat", + "switch": "ZI", + "comment": "Program Database for Edit And Continue", + "value": "EditAndContinue", + "flags": [] + }, + { + "name": "CompileAsManaged", + "switch": "", + "comment": "No Common Language RunTime Support", + "value": "false", + "flags": [] + }, + { + "name": "CompileAsManaged", + "switch": "clr", + "comment": "Common Language RunTime Support", + "value": "true", + "flags": [] + }, + { + "name": "CompileAsManaged", + "switch": "clr:pure", + "comment": "Pure MSIL Common Language RunTime Support", + "value": "Pure", + "flags": [] + }, + { + "name": "CompileAsManaged", + "switch": "clr:safe", + "comment": "Safe MSIL Common Language RunTime Support", + "value": "Safe", + "flags": [] + }, + { + "name": "CompileAsManaged", + "switch": "clr:oldSyntax", + "comment": "Common Language RunTime Support, Old Syntax", + "value": "OldSyntax", + "flags": [] + }, + { + "name": "WarningLevel", + "switch": "W0", + "comment": "Turn Off All Warnings", + "value": "TurnOffAllWarnings", + "flags": [] + }, + { + "name": "WarningLevel", + "switch": "W1", + "comment": "Level1", + "value": "Level1", + "flags": [] + }, + { + "name": "WarningLevel", + "switch": "W2", + "comment": "Level2", + "value": "Level2", + "flags": [] + }, + { + "name": "WarningLevel", + "switch": "W3", + "comment": "Level3", + "value": "Level3", + "flags": [] + }, + { + "name": "WarningLevel", + "switch": "W4", + "comment": "Level4", + "value": "Level4", + "flags": [] + }, + { + "name": "WarningLevel", + "switch": "Wall", + "comment": "EnableAllWarnings", + "value": "EnableAllWarnings", + "flags": [] + }, + { + "name": "Optimization", + "switch": "", + "comment": "Custom", + "value": "Custom", + "flags": [] + }, + { + "name": "Optimization", + "switch": "Od", + "comment": "Disabled", + "value": "Disabled", + "flags": [] + }, + { + "name": "Optimization", + "switch": "O1", + "comment": "Minimize Size", + "value": "MinSpace", + "flags": [] + }, + { + "name": "Optimization", + "switch": "O2", + "comment": "Maximize Speed", + "value": "MaxSpeed", + "flags": [] + }, + { + "name": "Optimization", + "switch": "Ox", + "comment": "Full Optimization", + "value": "Full", + "flags": [] + }, + { + "name": "InlineFunctionExpansion", + "switch": "", + "comment": "Default", + "value": "Default", + "flags": [] + }, + { + "name": "InlineFunctionExpansion", + "switch": "Ob0", + "comment": "Disabled", + "value": "Disabled", + "flags": [] + }, + { + "name": "InlineFunctionExpansion", + "switch": "Ob1", + "comment": "Only __inline", + "value": "OnlyExplicitInline", + "flags": [] + }, + { + "name": "InlineFunctionExpansion", + "switch": "Ob2", + "comment": "Any Suitable", + "value": "AnySuitable", + "flags": [] + }, + { + "name": "FavorSizeOrSpeed", + "switch": "Os", + "comment": "Favor small code", + "value": "Size", + "flags": [] + }, + { + "name": "FavorSizeOrSpeed", + "switch": "Ot", + "comment": "Favor fast code", + "value": "Speed", + "flags": [] + }, + { + "name": "FavorSizeOrSpeed", + "switch": "", + "comment": "Neither", + "value": "Neither", + "flags": [] + }, + { + "name": "ExceptionHandling", + "switch": "EHa", + "comment": "Yes with SEH Exceptions", + "value": "Async", + "flags": [] + }, + { + "name": "ExceptionHandling", + "switch": "EHsc", + "comment": "Yes", + "value": "Sync", + "flags": [] + }, + { + "name": "ExceptionHandling", + "switch": "EHs", + "comment": "Yes with Extern C functions", + "value": "SyncCThrow", + "flags": [] + }, + { + "name": "ExceptionHandling", + "switch": "", + "comment": "No", + "value": "false", + "flags": [] + }, + { + "name": "BasicRuntimeChecks", + "switch": "RTCs", + "comment": "Stack Frames", + "value": "StackFrameRuntimeCheck", + "flags": [] + }, + { + "name": "BasicRuntimeChecks", + "switch": "RTCu", + "comment": "Uninitialized variables", + "value": "UninitializedLocalUsageCheck", + "flags": [] + }, + { + "name": "BasicRuntimeChecks", + "switch": "RTC1", + "comment": "Both (/RTC1, equiv. to /RTCsu)", + "value": "EnableFastChecks", + "flags": [] + }, + { + "name": "BasicRuntimeChecks", + "switch": "", + "comment": "Default", + "value": "Default", + "flags": [] + }, + { + "name": "RuntimeLibrary", + "switch": "MT", + "comment": "Multi-threaded", + "value": "MultiThreaded", + "flags": [] + }, + { + "name": "RuntimeLibrary", + "switch": "MTd", + "comment": "Multi-threaded Debug", + "value": "MultiThreadedDebug", + "flags": [] + }, + { + "name": "RuntimeLibrary", + "switch": "MD", + "comment": "Multi-threaded DLL", + "value": "MultiThreadedDLL", + "flags": [] + }, + { + "name": "RuntimeLibrary", + "switch": "MDd", + "comment": "Multi-threaded Debug DLL", + "value": "MultiThreadedDebugDLL", + "flags": [] + }, + { + "name": "StructMemberAlignment", + "switch": "Zp1", + "comment": "1 Byte", + "value": "1Byte", + "flags": [] + }, + { + "name": "StructMemberAlignment", + "switch": "Zp2", + "comment": "2 Bytes", + "value": "2Bytes", + "flags": [] + }, + { + "name": "StructMemberAlignment", + "switch": "Zp4", + "comment": "4 Byte", + "value": "4Bytes", + "flags": [] + }, + { + "name": "StructMemberAlignment", + "switch": "Zp8", + "comment": "8 Bytes", + "value": "8Bytes", + "flags": [] + }, + { + "name": "StructMemberAlignment", + "switch": "Zp16", + "comment": "16 Bytes", + "value": "16Bytes", + "flags": [] + }, + { + "name": "StructMemberAlignment", + "switch": "", + "comment": "Default", + "value": "Default", + "flags": [] + }, + { + "name": "BufferSecurityCheck", + "switch": "GS-", + "comment": "Disable Security Check", + "value": "false", + "flags": [] + }, + { + "name": "BufferSecurityCheck", + "switch": "GS", + "comment": "Enable Security Check", + "value": "true", + "flags": [] + }, + { + "name": "EnableEnhancedInstructionSet", + "switch": "arch:SSE", + "comment": "Streaming SIMD Extensions", + "value": "StreamingSIMDExtensions", + "flags": [] + }, + { + "name": "EnableEnhancedInstructionSet", + "switch": "arch:SSE2", + "comment": "Streaming SIMD Extensions 2", + "value": "StreamingSIMDExtensions2", + "flags": [] + }, + { + "name": "EnableEnhancedInstructionSet", + "switch": "arch:AVX", + "comment": "Advanced Vector Extensions", + "value": "AdvancedVectorExtensions", + "flags": [] + }, + { + "name": "EnableEnhancedInstructionSet", + "switch": "arch:AVX2", + "comment": "Advanced Vector Extensions 2", + "value": "AdvancedVectorExtensions2", + "flags": [] + }, + { + "name": "EnableEnhancedInstructionSet", + "switch": "arch:IA32", + "comment": "No Enhanced Instructions", + "value": "NoExtensions", + "flags": [] + }, + { + "name": "EnableEnhancedInstructionSet", + "switch": "", + "comment": "Not Set", + "value": "NotSet", + "flags": [] + }, + { + "name": "FloatingPointModel", + "switch": "fp:precise", + "comment": "Precise", + "value": "Precise", + "flags": [] + }, + { + "name": "FloatingPointModel", + "switch": "fp:strict", + "comment": "Strict", + "value": "Strict", + "flags": [] + }, + { + "name": "FloatingPointModel", + "switch": "fp:fast", + "comment": "Fast", + "value": "Fast", + "flags": [] + }, + { + "name": "PrecompiledHeader", + "switch": "Yc", + "comment": "Create", + "value": "Create", + "flags": [ + "UserValue", + "UserIgnored", + "Continue" + ] + }, + { + "name": "PrecompiledHeader", + "switch": "Yu", + "comment": "Use", + "value": "Use", + "flags": [ + "UserValue", + "UserIgnored", + "Continue" + ] + }, + { + "name": "PrecompiledHeader", + "switch": "Y-", + "comment": "Not Using Precompiled Headers", + "value": "NotUsing", + "flags": [] + }, + { + "name": "AssemblerOutput", + "switch": "", + "comment": "No Listing", + "value": "NoListing", + "flags": [] + }, + { + "name": "AssemblerOutput", + "switch": "FA", + "comment": "Assembly-Only Listing", + "value": "AssemblyCode", + "flags": [] + }, + { + "name": "AssemblerOutput", + "switch": "FAc", + "comment": "Assembly With Machine Code", + "value": "AssemblyAndMachineCode", + "flags": [] + }, + { + "name": "AssemblerOutput", + "switch": "FAs", + "comment": "Assembly With Source Code", + "value": "AssemblyAndSourceCode", + "flags": [] + }, + { + "name": "AssemblerOutput", + "switch": "FAcs", + "comment": "Assembly, Machine Code and Source", + "value": "All", + "flags": [] + }, + { + "name": "CallingConvention", + "switch": "Gd", + "comment": "__cdecl", + "value": "Cdecl", + "flags": [] + }, + { + "name": "CallingConvention", + "switch": "Gr", + "comment": "__fastcall", + "value": "FastCall", + "flags": [] + }, + { + "name": "CallingConvention", + "switch": "Gz", + "comment": "__stdcall", + "value": "StdCall", + "flags": [] + }, + { + "name": "CallingConvention", + "switch": "Gv", + "comment": "__vectorcall", + "value": "VectorCall", + "flags": [] + }, + { + "name": "CompileAs", + "switch": "", + "comment": "Default", + "value": "Default", + "flags": [] + }, + { + "name": "CompileAs", + "switch": "TC", + "comment": "Compile as C Code", + "value": "CompileAsC", + "flags": [] + }, + { + "name": "CompileAs", + "switch": "TP", + "comment": "Compile as C++ Code", + "value": "CompileAsCpp", + "flags": [] + }, + { + "name": "ErrorReporting", + "switch": "errorReport:none", + "comment": "Do Not Send Report", + "value": "None", + "flags": [] + }, + { + "name": "ErrorReporting", + "switch": "errorReport:prompt", + "comment": "Prompt Immediately", + "value": "Prompt", + "flags": [] + }, + { + "name": "ErrorReporting", + "switch": "errorReport:queue", + "comment": "Queue For Next Login", + "value": "Queue", + "flags": [] + }, + { + "name": "ErrorReporting", + "switch": "errorReport:send", + "comment": "Send Automatically", + "value": "Send", + "flags": [] + }, + { + "name": "CompileAsWinRT", + "switch": "ZW", + "comment": "Consume Windows Runtime Extension", + "value": "true", + "flags": [] + }, + { + "name": "WinRTNoStdLib", + "switch": "ZW:nostdlib", + "comment": "No Standard WinRT Libraries", + "value": "true", + "flags": [] + }, + { + "name": "SuppressStartupBanner", + "switch": "nologo", + "comment": "Suppress Startup Banner", + "value": "true", + "flags": [] + }, + { + "name": "TreatWarningAsError", + "switch": "WX-", + "comment": "Treat Warnings As Errors", + "value": "false", + "flags": [] + }, + { + "name": "TreatWarningAsError", + "switch": "WX", + "comment": "Treat Warnings As Errors", + "value": "true", + "flags": [] + }, + { + "name": "SDLCheck", + "switch": "sdl-", + "comment": "SDL checks", + "value": "false", + "flags": [] + }, + { + "name": "SDLCheck", + "switch": "sdl", + "comment": "SDL checks", + "value": "true", + "flags": [] + }, + { + "name": "MultiProcessorCompilation", + "switch": "MP", + "comment": "Multi-processor Compilation", + "value": "true", + "flags": [ + "UserValue", + "UserIgnored", + "Continue" + ] + }, + { + "name": "IntrinsicFunctions", + "switch": "Oi", + "comment": "Enable Intrinsic Functions", + "value": "true", + "flags": [] + }, + { + "name": "OmitFramePointers", + "switch": "Oy-", + "comment": "Omit Frame Pointers", + "value": "false", + "flags": [] + }, + { + "name": "OmitFramePointers", + "switch": "Oy", + "comment": "Omit Frame Pointers", + "value": "true", + "flags": [] + }, + { + "name": "EnableFiberSafeOptimizations", + "switch": "GT", + "comment": "Enable Fiber-Safe Optimizations", + "value": "true", + "flags": [] + }, + { + "name": "WholeProgramOptimization", + "switch": "GL", + "comment": "Whole Program Optimization", + "value": "true", + "flags": [] + }, + { + "name": "UndefineAllPreprocessorDefinitions", + "switch": "u", + "comment": "Undefine All Preprocessor Definitions", + "value": "true", + "flags": [] + }, + { + "name": "IgnoreStandardIncludePath", + "switch": "X", + "comment": "Ignore Standard Include Paths", + "value": "true", + "flags": [] + }, + { + "name": "PreprocessToFile", + "switch": "P", + "comment": "Preprocess to a File", + "value": "true", + "flags": [] + }, + { + "name": "PreprocessSuppressLineNumbers", + "switch": "EP", + "comment": "Preprocess Suppress Line Numbers", + "value": "true", + "flags": [] + }, + { + "name": "PreprocessKeepComments", + "switch": "C", + "comment": "Keep Comments", + "value": "true", + "flags": [] + }, + { + "name": "StringPooling", + "switch": "GF-", + "comment": "Enable String Pooling", + "value": "false", + "flags": [] + }, + { + "name": "StringPooling", + "switch": "GF", + "comment": "Enable String Pooling", + "value": "true", + "flags": [] + }, + { + "name": "MinimalRebuild", + "switch": "Gm-", + "comment": "Enable Minimal Rebuild", + "value": "false", + "flags": [] + }, + { + "name": "MinimalRebuild", + "switch": "Gm", + "comment": "Enable Minimal Rebuild", + "value": "true", + "flags": [] + }, + { + "name": "SmallerTypeCheck", + "switch": "RTCc", + "comment": "Smaller Type Check", + "value": "true", + "flags": [] + }, + { + "name": "FunctionLevelLinking", + "switch": "Gy-", + "comment": "Enable Function-Level Linking", + "value": "false", + "flags": [] + }, + { + "name": "FunctionLevelLinking", + "switch": "Gy", + "comment": "Enable Function-Level Linking", + "value": "true", + "flags": [] + }, + { + "name": "EnableParallelCodeGeneration", + "switch": "Qpar-", + "comment": "Enable Parallel Code Generation", + "value": "false", + "flags": [] + }, + { + "name": "EnableParallelCodeGeneration", + "switch": "Qpar", + "comment": "Enable Parallel Code Generation", + "value": "true", + "flags": [] + }, + { + "name": "FloatingPointExceptions", + "switch": "fp:except-", + "comment": "Enable Floating Point Exceptions", + "value": "false", + "flags": [] + }, + { + "name": "FloatingPointExceptions", + "switch": "fp:except", + "comment": "Enable Floating Point Exceptions", + "value": "true", + "flags": [] + }, + { + "name": "CreateHotpatchableImage", + "switch": "hotpatch", + "comment": "Create Hotpatchable Image", + "value": "true", + "flags": [] + }, + { + "name": "DisableLanguageExtensions", + "switch": "Za", + "comment": "Disable Language Extensions", + "value": "true", + "flags": [] + }, + { + "name": "TreatWChar_tAsBuiltInType", + "switch": "Zc:wchar_t-", + "comment": "Treat WChar_t As Built in Type", + "value": "false", + "flags": [] + }, + { + "name": "TreatWChar_tAsBuiltInType", + "switch": "Zc:wchar_t", + "comment": "Treat WChar_t As Built in Type", + "value": "true", + "flags": [] + }, + { + "name": "ForceConformanceInForLoopScope", + "switch": "Zc:forScope-", + "comment": "Force Conformance in For Loop Scope", + "value": "false", + "flags": [] + }, + { + "name": "ForceConformanceInForLoopScope", + "switch": "Zc:forScope", + "comment": "Force Conformance in For Loop Scope", + "value": "true", + "flags": [] + }, + { + "name": "RuntimeTypeInfo", + "switch": "GR-", + "comment": "Enable Run-Time Type Information", + "value": "false", + "flags": [] + }, + { + "name": "RuntimeTypeInfo", + "switch": "GR", + "comment": "Enable Run-Time Type Information", + "value": "true", + "flags": [] + }, + { + "name": "OpenMPSupport", + "switch": "openmp-", + "comment": "Open MP Support", + "value": "false", + "flags": [] + }, + { + "name": "OpenMPSupport", + "switch": "openmp", + "comment": "Open MP Support", + "value": "true", + "flags": [] + }, + { + "name": "ExpandAttributedSource", + "switch": "Fx", + "comment": "Expand Attributed Source", + "value": "true", + "flags": [] + }, + { + "name": "UseUnicodeForAssemblerListing", + "switch": "FAu", + "comment": "Use Unicode For Assembler Listing", + "value": "true", + "flags": [] + }, + { + "name": "GenerateXMLDocumentationFiles", + "switch": "doc", + "comment": "Generate XML Documentation Files", + "value": "true", + "flags": [ + "UserValue", + "UserIgnored", + "Continue" + ] + }, + { + "name": "BrowseInformation", + "switch": "FR", + "comment": "Enable Browse Information", + "value": "true", + "flags": [ + "UserValue", + "UserIgnored", + "Continue" + ] + }, + { + "name": "ShowIncludes", + "switch": "showIncludes", + "comment": "Show Includes", + "value": "true", + "flags": [] + }, + { + "name": "EnablePREfast", + "switch": "analyze-", + "comment": "Enable Code Analysis", + "value": "false", + "flags": [] + }, + { + "name": "EnablePREfast", + "switch": "analyze", + "comment": "Enable Code Analysis", + "value": "true", + "flags": [] + }, + { + "name": "UseFullPaths", + "switch": "FC", + "comment": "Use Full Paths", + "value": "true", + "flags": [] + }, + { + "name": "OmitDefaultLibName", + "switch": "Zl", + "comment": "Omit Default Library Name", + "value": "true", + "flags": [] + }, + { + "name": "AdditionalIncludeDirectories", + "switch": "I", + "comment": "Additional Include Directories", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "AdditionalUsingDirectories", + "switch": "AI", + "comment": "Additional #using Directories", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "PreprocessorDefinitions", + "switch": "D", + "comment": "Preprocessor Definitions", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "UndefinePreprocessorDefinitions", + "switch": "U", + "comment": "Undefine Preprocessor Definitions", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "DisableSpecificWarnings", + "switch": "wd", + "comment": "Disable Specific Warnings", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "ForcedIncludeFiles", + "switch": "FI", + "comment": "Forced Include File", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "ForcedUsingFiles", + "switch": "FU", + "comment": "Forced #using File", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "PREfastLog", + "switch": "analyze:log", + "comment": "Code Analysis Log", + "value": "", + "flags": [ + "UserFollowing" + ] + }, + { + "name": "PREfastAdditionalPlugins", + "switch": "analyze:plugin", + "comment": "Additional Code Analysis Native plugins", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "TreatSpecificWarningsAsErrors", + "switch": "we", + "comment": "Treat Specific Warnings As Errors", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "PreprocessOutputPath", + "switch": "Fi", + "comment": "Preprocess Output Path", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "PrecompiledHeaderFile", + "switch": "Yu", + "comment": "Precompiled Header File", + "value": "", + "flags": [ + "UserValue", + "UserRequired" + ] + }, + { + "name": "PrecompiledHeaderFile", + "switch": "Yc", + "comment": "Precompiled Header File", + "value": "", + "flags": [ + "UserValue", + "UserRequired" + ] + }, + { + "name": "PrecompiledHeaderOutputFile", + "switch": "Fp", + "comment": "Precompiled Header Output File", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "AssemblerListingLocation", + "switch": "Fa", + "comment": "ASM List Location", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "ObjectFileName", + "switch": "Fo", + "comment": "Object File Name", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "ProgramDataBaseFileName", + "switch": "Fd", + "comment": "Program Database File Name", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "XMLDocumentationFileName", + "switch": "doc", + "comment": "XML Documentation File Name", + "value": "", + "flags": [ + "UserValue", + "UserRequired" + ] + }, + { + "name": "BrowseInformationFile", + "switch": "FR", + "comment": "Browse Information File", + "value": "", + "flags": [ + "UserValue", + "UserRequired" + ] + }, + { + "name": "ProcessorNumber", + "switch": "MP", + "comment": "Number of processors", + "value": "", + "flags": [ + "UserValue", + "UserRequired" + ] + } +] diff --git a/Templates/MSBuild/FlagTables/v12_CSharp.json b/Templates/MSBuild/FlagTables/v12_CSharp.json new file mode 100644 index 0000000..a0780a4 --- /dev/null +++ b/Templates/MSBuild/FlagTables/v12_CSharp.json @@ -0,0 +1,570 @@ +[ + { + "name": "ProjectName", + "switch": "out:", + "comment": "", + "value": "", + "flags": [ + "UserValue", + "UserRequired" + ] + }, + { + "name": "OutputType", + "switch": "target:exe", + "comment": "", + "value": "Exe", + "flags": [] + }, + { + "name": "OutputType", + "switch": "target:winexe", + "comment": "", + "value": "Winexe", + "flags": [] + }, + { + "name": "OutputType", + "switch": "target:library", + "comment": "", + "value": "Library", + "flags": [] + }, + { + "name": "OutputType", + "switch": "target:module", + "comment": "", + "value": "Module", + "flags": [] + }, + { + "name": "DocumentationFile", + "switch": "doc", + "comment": "", + "value": "", + "flags": [ + "UserValue", + "UserRequired" + ] + }, + { + "name": "Platform", + "switch": "platform:x86", + "comment": "", + "value": "x86", + "flags": [] + }, + { + "name": "Platform", + "switch": "platform:Itanium", + "comment": "", + "value": "Itanium", + "flags": [] + }, + { + "name": "Platform", + "switch": "platform:x64", + "comment": "", + "value": "x64", + "flags": [] + }, + { + "name": "Platform", + "switch": "platform:arm", + "comment": "", + "value": "arm", + "flags": [] + }, + { + "name": "Platform", + "switch": "platform:anycpu32bitpreferred", + "comment": "", + "value": "anycpu32bitpreferred", + "flags": [] + }, + { + "name": "Platform", + "switch": "platform:anycpu", + "comment": "", + "value": "anycpu", + "flags": [] + }, + { + "name": "References", + "switch": "reference:", + "comment": "mit alias", + "value": "", + "flags": [] + }, + { + "name": "References", + "switch": "reference:", + "comment": "dateiliste", + "value": "", + "flags": [] + }, + { + "name": "AddModules", + "switch": "addmodule:", + "comment": "", + "value": "", + "flags": [ + "SemicolonAppendable" + ] + }, + { + "name": "Win32Resource", + "switch": "win32res:", + "comment": "", + "value": "", + "flags": [ + "UserValue", + "UserRequired" + ] + }, + { + "name": "ApplicationIcon", + "switch": "win32icon:", + "comment": "", + "value": "", + "flags": [ + "UserValue", + "UserRequired" + ] + }, + { + "name": "ApplicationManifest", + "switch": "win32manifest:", + "comment": "", + "value": "", + "flags": [ + "UserValue", + "UserRequired" + ] + }, + { + "name": "NoWin32Manifest", + "switch": "nowin32manifest", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "DefineDebug", + "switch": "debug", + "comment": "", + "value": "true", + "flags": [ + "Continue" + ] + }, + { + "name": "DebugSymbols", + "switch": "debug", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "DebugSymbols", + "switch": "debug-", + "comment": "", + "value": "false", + "flags": [] + }, + { + "name": "DebugSymbols", + "switch": "debug+", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "DebugType", + "switch": "debug:none", + "comment": "", + "value": "none", + "flags": [] + }, + { + "name": "DebugType", + "switch": "debug:full", + "comment": "", + "value": "full", + "flags": [] + }, + { + "name": "DebugType", + "switch": "debug:pdbonly", + "comment": "", + "value": "pdbonly", + "flags": [] + }, + { + "name": "Optimize", + "switch": "optimize", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "Optimize", + "switch": "optimize-", + "comment": "", + "value": "false", + "flags": [] + }, + { + "name": "Optimize", + "switch": "optimize+", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "TreatWarningsAsErrors", + "switch": "warnaserror", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "TreatWarningsAsErrors", + "switch": "warnaserror-", + "comment": "", + "value": "false", + "flags": [] + }, + { + "name": "TreatWarningsAsErrors", + "switch": "warnaserror+", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "WarningsAsErrors", + "switch": "warnaserror", + "comment": "", + "value": "", + "flags": [] + }, + { + "name": "WarningsAsErrors", + "switch": "warnaserror-", + "comment": "", + "value": "", + "flags": [] + }, + { + "name": "WarningsAsErrors", + "switch": "warnaserror+", + "comment": "", + "value": "", + "flags": [] + }, + { + "name": "WarningLevel", + "switch": "warn:0", + "comment": "", + "value": "0", + "flags": [] + }, + { + "name": "WarningLevel", + "switch": "warn:1", + "comment": "", + "value": "1", + "flags": [] + }, + { + "name": "WarningLevel", + "switch": "warn:2", + "comment": "", + "value": "2", + "flags": [] + }, + { + "name": "WarningLevel", + "switch": "warn:3", + "comment": "", + "value": "3", + "flags": [] + }, + { + "name": "WarningLevel", + "switch": "warn:4", + "comment": "", + "value": "4", + "flags": [] + }, + { + "name": "DisabledWarnings", + "switch": "nowarn", + "comment": "", + "value": "", + "flags": [] + }, + { + "name": "CheckForOverflowUnderflow", + "switch": "checked", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "CheckForOverflowUnderflow", + "switch": "checked-", + "comment": "", + "value": "false", + "flags": [] + }, + { + "name": "CheckForOverflowUnderflow", + "switch": "checked+", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "AllowUnsafeBlocks", + "switch": "unsafe", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "AllowUnsafeBlocks", + "switch": "unsafe-", + "comment": "", + "value": "false", + "flags": [] + }, + { + "name": "AllowUnsafeBlocks", + "switch": "unsafe+", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "DefineConstants", + "switch": "define:", + "comment": "", + "value": "", + "flags": [ + "SemicolonAppendable", + "UserValue" + ] + }, + { + "name": "LangVersion", + "switch": "langversion:ISO-1", + "comment": "", + "value": "ISO-1", + "flags": [] + }, + { + "name": "LangVersion", + "switch": "langversion:ISO-2", + "comment": "", + "value": "ISO-2", + "flags": [] + }, + { + "name": "LangVersion", + "switch": "langversion:3", + "comment": "", + "value": "3", + "flags": [] + }, + { + "name": "LangVersion", + "switch": "langversion:4", + "comment": "", + "value": "4", + "flags": [] + }, + { + "name": "LangVersion", + "switch": "langversion:5", + "comment": "", + "value": "5", + "flags": [] + }, + { + "name": "LangVersion", + "switch": "langversion:6", + "comment": "", + "value": "6", + "flags": [] + }, + { + "name": "LangVersion", + "switch": "langversion:default", + "comment": "", + "value": "default", + "flags": [] + }, + { + "name": "DelaySign", + "switch": "delaysign", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "DelaySign", + "switch": "delaysign-", + "comment": "", + "value": "false", + "flags": [] + }, + { + "name": "DelaySign", + "switch": "delaysign+", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "AssemblyOriginatorKeyFile", + "switch": "keyfile", + "comment": "", + "value": "", + "flags": [] + }, + { + "name": "KeyContainerName", + "switch": "keycontainer", + "comment": "", + "value": "", + "flags": [] + }, + { + "name": "NoLogo", + "switch": "nologo", + "comment": "", + "value": "", + "flags": [] + }, + { + "name": "NoConfig", + "switch": "noconfig", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "BaseAddress", + "switch": "baseaddress:", + "comment": "", + "value": "", + "flags": [] + }, + { + "name": "CodePage", + "switch": "codepage", + "comment": "", + "value": "", + "flags": [] + }, + { + "name": "Utf8Output", + "switch": "utf8output", + "comment": "", + "value": "", + "flags": [] + }, + { + "name": "MainEntryPoint", + "switch": "main:", + "comment": "", + "value": "", + "flags": [] + }, + { + "name": "GenerateFullPaths", + "switch": "fullpaths", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "FileAlignment", + "switch": "filealign", + "comment": "", + "value": "", + "flags": [] + }, + { + "name": "PdbFile", + "switch": "pdb:", + "comment": "", + "value": "", + "flags": [] + }, + { + "name": "NoStandardLib", + "switch": "nostdlib", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "NoStandardLib", + "switch": "nostdlib-", + "comment": "", + "value": "false", + "flags": [] + }, + { + "name": "NoStandardLib", + "switch": "nostdlib+", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "SubsystemVersion", + "switch": "subsystemversion", + "comment": "", + "value": "", + "flags": [] + }, + { + "name": "AdditionalLibPaths", + "switch": "lib:", + "comment": "", + "value": "", + "flags": [] + }, + { + "name": "ErrorReport", + "switch": "errorreport:none", + "comment": "Do Not Send Report", + "value": "none", + "flags": [] + }, + { + "name": "ErrorReport", + "switch": "errorreport:prompt", + "comment": "Prompt Immediately", + "value": "prompt", + "flags": [] + }, + { + "name": "ErrorReport", + "switch": "errorreport:queue", + "comment": "Queue For Next Login", + "value": "queue", + "flags": [] + }, + { + "name": "ErrorReport", + "switch": "errorreport:send", + "comment": "Send Automatically", + "value": "send", + "flags": [] + } +] diff --git a/Templates/MSBuild/FlagTables/v12_LIB.json b/Templates/MSBuild/FlagTables/v12_LIB.json new file mode 100644 index 0000000..58a238c --- /dev/null +++ b/Templates/MSBuild/FlagTables/v12_LIB.json @@ -0,0 +1,297 @@ +[ + { + "name": "ErrorReporting", + "switch": "ERRORREPORT:PROMPT", + "comment": "PromptImmediately", + "value": "PromptImmediately", + "flags": [] + }, + { + "name": "ErrorReporting", + "switch": "ERRORREPORT:QUEUE", + "comment": "Queue For Next Login", + "value": "QueueForNextLogin", + "flags": [] + }, + { + "name": "ErrorReporting", + "switch": "ERRORREPORT:SEND", + "comment": "Send Error Report", + "value": "SendErrorReport", + "flags": [] + }, + { + "name": "ErrorReporting", + "switch": "ERRORREPORT:NONE", + "comment": "No Error Report", + "value": "NoErrorReport", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:ARM", + "comment": "MachineARM", + "value": "MachineARM", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:EBC", + "comment": "MachineEBC", + "value": "MachineEBC", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:IA64", + "comment": "MachineIA64", + "value": "MachineIA64", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:MIPS", + "comment": "MachineMIPS", + "value": "MachineMIPS", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:MIPS16", + "comment": "MachineMIPS16", + "value": "MachineMIPS16", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:MIPSFPU", + "comment": "MachineMIPSFPU", + "value": "MachineMIPSFPU", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:MIPSFPU16", + "comment": "MachineMIPSFPU16", + "value": "MachineMIPSFPU16", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:SH4", + "comment": "MachineSH4", + "value": "MachineSH4", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:THUMB", + "comment": "MachineTHUMB", + "value": "MachineTHUMB", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:X64", + "comment": "MachineX64", + "value": "MachineX64", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:X86", + "comment": "MachineX86", + "value": "MachineX86", + "flags": [] + }, + { + "name": "SubSystem", + "switch": "SUBSYSTEM:CONSOLE", + "comment": "Console", + "value": "Console", + "flags": [] + }, + { + "name": "SubSystem", + "switch": "SUBSYSTEM:WINDOWS", + "comment": "Windows", + "value": "Windows", + "flags": [] + }, + { + "name": "SubSystem", + "switch": "SUBSYSTEM:NATIVE", + "comment": "Native", + "value": "Native", + "flags": [] + }, + { + "name": "SubSystem", + "switch": "SUBSYSTEM:EFI_APPLICATION", + "comment": "EFI Application", + "value": "EFI Application", + "flags": [] + }, + { + "name": "SubSystem", + "switch": "SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER", + "comment": "EFI Boot Service Driver", + "value": "EFI Boot Service Driver", + "flags": [] + }, + { + "name": "SubSystem", + "switch": "SUBSYSTEM:EFI_ROM", + "comment": "EFI ROM", + "value": "EFI ROM", + "flags": [] + }, + { + "name": "SubSystem", + "switch": "SUBSYSTEM:EFI_RUNTIME_DRIVER", + "comment": "EFI Runtime", + "value": "EFI Runtime", + "flags": [] + }, + { + "name": "SubSystem", + "switch": "SUBSYSTEM:WINDOWSCE", + "comment": "WindowsCE", + "value": "WindowsCE", + "flags": [] + }, + { + "name": "SubSystem", + "switch": "SUBSYSTEM:POSIX", + "comment": "POSIX", + "value": "POSIX", + "flags": [] + }, + { + "name": "SuppressStartupBanner", + "switch": "NOLOGO", + "comment": "Suppress Startup Banner", + "value": "true", + "flags": [] + }, + { + "name": "IgnoreAllDefaultLibraries", + "switch": "NODEFAULTLIB", + "comment": "Ignore All Default Libraries", + "value": "true", + "flags": [] + }, + { + "name": "TreatLibWarningAsErrors", + "switch": "WX:NO", + "comment": "Treat Lib Warning As Errors", + "value": "false", + "flags": [] + }, + { + "name": "TreatLibWarningAsErrors", + "switch": "WX", + "comment": "Treat Lib Warning As Errors", + "value": "true", + "flags": [] + }, + { + "name": "Verbose", + "switch": "VERBOSE", + "comment": "Verbose", + "value": "true", + "flags": [] + }, + { + "name": "LinkTimeCodeGeneration", + "switch": "LTCG", + "comment": "Link Time Code Generation", + "value": "true", + "flags": [] + }, + { + "name": "AdditionalLibraryDirectories", + "switch": "LIBPATH:", + "comment": "Additional Library Directories", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "IgnoreSpecificDefaultLibraries", + "switch": "NODEFAULTLIB:", + "comment": "Ignore Specific Default Libraries", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "ExportNamedFunctions", + "switch": "EXPORT:", + "comment": "Export Named Functions", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "RemoveObjects", + "switch": "REMOVE:", + "comment": "Remove Objects", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "OutputFile", + "switch": "OUT:", + "comment": "Output File", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "ModuleDefinitionFile", + "switch": "DEF:", + "comment": "Module Definition File Name", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "ForceSymbolReferences", + "switch": "INCLUDE:", + "comment": "Force Symbol References", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "DisplayLibrary", + "switch": "LIST:", + "comment": "Display Library to standard output", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "Name", + "switch": "NAME:", + "comment": "Name", + "value": "", + "flags": [ + "UserValue" + ] + } +] diff --git a/Templates/MSBuild/FlagTables/v12_Link.json b/Templates/MSBuild/FlagTables/v12_Link.json new file mode 100644 index 0000000..5d5c13f --- /dev/null +++ b/Templates/MSBuild/FlagTables/v12_Link.json @@ -0,0 +1,1272 @@ +[ + { + "name": "ShowProgress", + "switch": "", + "comment": "Not Set", + "value": "NotSet", + "flags": [] + }, + { + "name": "ShowProgress", + "switch": "VERBOSE", + "comment": "Display all progress messages", + "value": "LinkVerbose", + "flags": [] + }, + { + "name": "ShowProgress", + "switch": "VERBOSE:Lib", + "comment": "For Libraries Searched", + "value": "LinkVerboseLib", + "flags": [] + }, + { + "name": "ShowProgress", + "switch": "VERBOSE:ICF", + "comment": "About COMDAT folding during optimized linking", + "value": "LinkVerboseICF", + "flags": [] + }, + { + "name": "ShowProgress", + "switch": "VERBOSE:REF", + "comment": "About data removed during optimized linking", + "value": "LinkVerboseREF", + "flags": [] + }, + { + "name": "ShowProgress", + "switch": "VERBOSE:SAFESEH", + "comment": "About Modules incompatible with SEH", + "value": "LinkVerboseSAFESEH", + "flags": [] + }, + { + "name": "ShowProgress", + "switch": "VERBOSE:CLR", + "comment": "About linker activity related to managed code", + "value": "LinkVerboseCLR", + "flags": [] + }, + { + "name": "ForceFileOutput", + "switch": "FORCE", + "comment": "Enabled", + "value": "Enabled", + "flags": [] + }, + { + "name": "ForceFileOutput", + "switch": "FORCE:MULTIPLE", + "comment": "Multiply Defined Symbol Only", + "value": "MultiplyDefinedSymbolOnly", + "flags": [] + }, + { + "name": "ForceFileOutput", + "switch": "FORCE:UNRESOLVED", + "comment": "Undefined Symbol Only", + "value": "UndefinedSymbolOnly", + "flags": [] + }, + { + "name": "CreateHotPatchableImage", + "switch": "FUNCTIONPADMIN", + "comment": "Enabled", + "value": "Enabled", + "flags": [] + }, + { + "name": "CreateHotPatchableImage", + "switch": "FUNCTIONPADMIN:5", + "comment": "X86 Image Only", + "value": "X86Image", + "flags": [] + }, + { + "name": "CreateHotPatchableImage", + "switch": "FUNCTIONPADMIN:6", + "comment": "X64 Image Only", + "value": "X64Image", + "flags": [] + }, + { + "name": "CreateHotPatchableImage", + "switch": "FUNCTIONPADMIN:16", + "comment": "Itanium Image Only", + "value": "ItaniumImage", + "flags": [] + }, + { + "name": "UACExecutionLevel", + "switch": "level='asInvoker'", + "comment": "asInvoker", + "value": "AsInvoker", + "flags": [] + }, + { + "name": "UACExecutionLevel", + "switch": "level='highestAvailable'", + "comment": "highestAvailable", + "value": "HighestAvailable", + "flags": [] + }, + { + "name": "UACExecutionLevel", + "switch": "level='requireAdministrator'", + "comment": "requireAdministrator", + "value": "RequireAdministrator", + "flags": [] + }, + { + "name": "SubSystem", + "switch": "", + "comment": "Not Set", + "value": "NotSet", + "flags": [] + }, + { + "name": "SubSystem", + "switch": "SUBSYSTEM:CONSOLE", + "comment": "Console", + "value": "Console", + "flags": [] + }, + { + "name": "SubSystem", + "switch": "SUBSYSTEM:WINDOWS", + "comment": "Windows", + "value": "Windows", + "flags": [] + }, + { + "name": "SubSystem", + "switch": "SUBSYSTEM:NATIVE", + "comment": "Native", + "value": "Native", + "flags": [] + }, + { + "name": "SubSystem", + "switch": "SUBSYSTEM:EFI_APPLICATION", + "comment": "EFI Application", + "value": "EFI Application", + "flags": [] + }, + { + "name": "SubSystem", + "switch": "SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER", + "comment": "EFI Boot Service Driver", + "value": "EFI Boot Service Driver", + "flags": [] + }, + { + "name": "SubSystem", + "switch": "SUBSYSTEM:EFI_ROM", + "comment": "EFI ROM", + "value": "EFI ROM", + "flags": [] + }, + { + "name": "SubSystem", + "switch": "SUBSYSTEM:EFI_RUNTIME_DRIVER", + "comment": "EFI Runtime", + "value": "EFI Runtime", + "flags": [] + }, + { + "name": "SubSystem", + "switch": "SUBSYSTEM:POSIX", + "comment": "POSIX", + "value": "POSIX", + "flags": [] + }, + { + "name": "Driver", + "switch": "", + "comment": "Not Set", + "value": "NotSet", + "flags": [] + }, + { + "name": "Driver", + "switch": "Driver", + "comment": "Driver", + "value": "Driver", + "flags": [] + }, + { + "name": "Driver", + "switch": "DRIVER:UPONLY", + "comment": "UP Only", + "value": "UpOnly", + "flags": [] + }, + { + "name": "Driver", + "switch": "DRIVER:WDM", + "comment": "WDM", + "value": "WDM", + "flags": [] + }, + { + "name": "LinkTimeCodeGeneration", + "switch": "", + "comment": "Default", + "value": "Default", + "flags": [] + }, + { + "name": "LinkTimeCodeGeneration", + "switch": "LTCG", + "comment": "Use Link Time Code Generation", + "value": "UseLinkTimeCodeGeneration", + "flags": [] + }, + { + "name": "LinkTimeCodeGeneration", + "switch": "LTCG:PGInstrument", + "comment": "Profile Guided Optimization - Instrument", + "value": "PGInstrument", + "flags": [] + }, + { + "name": "LinkTimeCodeGeneration", + "switch": "LTCG:PGOptimize", + "comment": "Profile Guided Optimization - Optimization", + "value": "PGOptimization", + "flags": [] + }, + { + "name": "LinkTimeCodeGeneration", + "switch": "LTCG:PGUpdate", + "comment": "Profile Guided Optimization - Update", + "value": "PGUpdate", + "flags": [] + }, + { + "name": "GenerateWindowsMetadata", + "switch": "WINMD", + "comment": "Yes", + "value": "true", + "flags": [] + }, + { + "name": "GenerateWindowsMetadata", + "switch": "WINMD:NO", + "comment": "No", + "value": "false", + "flags": [] + }, + { + "name": "WindowsMetadataSignHash", + "switch": "WINMDSIGNHASH:SHA1", + "comment": "SHA1", + "value": "SHA1", + "flags": [] + }, + { + "name": "WindowsMetadataSignHash", + "switch": "WINMDSIGNHASH:SHA256", + "comment": "SHA256", + "value": "SHA256", + "flags": [] + }, + { + "name": "WindowsMetadataSignHash", + "switch": "WINMDSIGNHASH:SHA384", + "comment": "SHA384", + "value": "SHA384", + "flags": [] + }, + { + "name": "WindowsMetadataSignHash", + "switch": "WINMDSIGNHASH:SHA512", + "comment": "SHA512", + "value": "SHA512", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "", + "comment": "Not Set", + "value": "NotSet", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:ARM", + "comment": "MachineARM", + "value": "MachineARM", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:EBC", + "comment": "MachineEBC", + "value": "MachineEBC", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:IA64", + "comment": "MachineIA64", + "value": "MachineIA64", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:MIPS", + "comment": "MachineMIPS", + "value": "MachineMIPS", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:MIPS16", + "comment": "MachineMIPS16", + "value": "MachineMIPS16", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:MIPSFPU", + "comment": "MachineMIPSFPU", + "value": "MachineMIPSFPU", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:MIPSFPU16", + "comment": "MachineMIPSFPU16", + "value": "MachineMIPSFPU16", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:SH4", + "comment": "MachineSH4", + "value": "MachineSH4", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:THUMB", + "comment": "MachineTHUMB", + "value": "MachineTHUMB", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:X64", + "comment": "MachineX64", + "value": "MachineX64", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:X86", + "comment": "MachineX86", + "value": "MachineX86", + "flags": [] + }, + { + "name": "CLRThreadAttribute", + "switch": "CLRTHREADATTRIBUTE:MTA", + "comment": "MTA threading attribute", + "value": "MTAThreadingAttribute", + "flags": [] + }, + { + "name": "CLRThreadAttribute", + "switch": "CLRTHREADATTRIBUTE:STA", + "comment": "STA threading attribute", + "value": "STAThreadingAttribute", + "flags": [] + }, + { + "name": "CLRThreadAttribute", + "switch": "CLRTHREADATTRIBUTE:NONE", + "comment": "Default threading attribute", + "value": "DefaultThreadingAttribute", + "flags": [] + }, + { + "name": "CLRImageType", + "switch": "CLRIMAGETYPE:IJW", + "comment": "Force IJW image", + "value": "ForceIJWImage", + "flags": [] + }, + { + "name": "CLRImageType", + "switch": "CLRIMAGETYPE:PURE", + "comment": "Force Pure IL Image", + "value": "ForcePureILImage", + "flags": [] + }, + { + "name": "CLRImageType", + "switch": "CLRIMAGETYPE:SAFE", + "comment": "Force Safe IL Image", + "value": "ForceSafeILImage", + "flags": [] + }, + { + "name": "CLRImageType", + "switch": "", + "comment": "Default image type", + "value": "Default", + "flags": [] + }, + { + "name": "SignHash", + "switch": "CLRSIGNHASH:SHA1", + "comment": "SHA1", + "value": "SHA1", + "flags": [] + }, + { + "name": "SignHash", + "switch": "CLRSIGNHASH:SHA256", + "comment": "SHA256", + "value": "SHA256", + "flags": [] + }, + { + "name": "SignHash", + "switch": "CLRSIGNHASH:SHA384", + "comment": "SHA384", + "value": "SHA384", + "flags": [] + }, + { + "name": "SignHash", + "switch": "CLRSIGNHASH:SHA512", + "comment": "SHA512", + "value": "SHA512", + "flags": [] + }, + { + "name": "LinkErrorReporting", + "switch": "ERRORREPORT:PROMPT", + "comment": "PromptImmediately", + "value": "PromptImmediately", + "flags": [] + }, + { + "name": "LinkErrorReporting", + "switch": "ERRORREPORT:QUEUE", + "comment": "Queue For Next Login", + "value": "QueueForNextLogin", + "flags": [] + }, + { + "name": "LinkErrorReporting", + "switch": "ERRORREPORT:SEND", + "comment": "Send Error Report", + "value": "SendErrorReport", + "flags": [] + }, + { + "name": "LinkErrorReporting", + "switch": "ERRORREPORT:NONE", + "comment": "No Error Report", + "value": "NoErrorReport", + "flags": [] + }, + { + "name": "CLRSupportLastError", + "switch": "CLRSupportLastError", + "comment": "Enabled", + "value": "Enabled", + "flags": [] + }, + { + "name": "CLRSupportLastError", + "switch": "CLRSupportLastError:NO", + "comment": "Disabled", + "value": "Disabled", + "flags": [] + }, + { + "name": "CLRSupportLastError", + "switch": "CLRSupportLastError:SYSTEMDLL", + "comment": "System Dlls Only", + "value": "SystemDlls", + "flags": [] + }, + { + "name": "LinkIncremental", + "switch": "INCREMENTAL:NO", + "comment": "Enable Incremental Linking", + "value": "false", + "flags": [] + }, + { + "name": "LinkIncremental", + "switch": "INCREMENTAL", + "comment": "Enable Incremental Linking", + "value": "true", + "flags": [] + }, + { + "name": "SuppressStartupBanner", + "switch": "NOLOGO", + "comment": "Suppress Startup Banner", + "value": "true", + "flags": [] + }, + { + "name": "LinkStatus", + "switch": "LTCG:NOSTATUS", + "comment": "Link Status", + "value": "false", + "flags": [] + }, + { + "name": "LinkStatus", + "switch": "LTCG:STATUS", + "comment": "Link Status", + "value": "true", + "flags": [] + }, + { + "name": "PreventDllBinding", + "switch": "ALLOWBIND:NO", + "comment": "Prevent Dll Binding", + "value": "false", + "flags": [] + }, + { + "name": "PreventDllBinding", + "switch": "ALLOWBIND", + "comment": "Prevent Dll Binding", + "value": "true", + "flags": [] + }, + { + "name": "TreatLinkerWarningAsErrors", + "switch": "WX:NO", + "comment": "Treat Linker Warning As Errors", + "value": "false", + "flags": [] + }, + { + "name": "TreatLinkerWarningAsErrors", + "switch": "WX", + "comment": "Treat Linker Warning As Errors", + "value": "true", + "flags": [] + }, + { + "name": "IgnoreAllDefaultLibraries", + "switch": "NODEFAULTLIB", + "comment": "Ignore All Default Libraries", + "value": "true", + "flags": [] + }, + { + "name": "GenerateManifest", + "switch": "MANIFEST:NO", + "comment": "Generate Manifest", + "value": "false", + "flags": [] + }, + { + "name": "GenerateManifest", + "switch": "MANIFEST", + "comment": "Generate Manifest", + "value": "true", + "flags": [] + }, + { + "name": "AllowIsolation", + "switch": "ALLOWISOLATION:NO", + "comment": "Allow Isolation", + "value": "false", + "flags": [] + }, + { + "name": "AllowIsolation", + "switch": "", + "comment": "Allow Isolation", + "value": "true", + "flags": [] + }, + { + "name": "EnableUAC", + "switch": "MANIFESTUAC:", + "comment": "", + "value": "", + "flags": [ + "UserValue", + "UserRequired", + "SpaceAppendable" + ] + }, + { + "name": "UACUIAccess", + "switch": "uiAccess='false'", + "comment": "UAC Bypass UI Protection", + "value": "false", + "flags": [ + "UserValue", + "UserRequired" + ] + }, + { + "name": "UACUIAccess", + "switch": "uiAccess='false'", + "comment": "UAC Bypass UI Protection", + "value": "false", + "flags": [] + }, + { + "name": "UACUIAccess", + "switch": "uiAccess='true'", + "comment": "UAC Bypass UI Protection", + "value": "true", + "flags": [] + }, + { + "name": "ManifestEmbed", + "switch": "manifest:embed", + "comment": "Embed Manifest", + "value": "true", + "flags": [] + }, + { + "name": "GenerateDebugInformation", + "switch": "DEBUG", + "comment": "Generate Debug Info", + "value": "true", + "flags": [ + "CaseInsensitive" + ] + }, + { + "name": "GenerateMapFile", + "switch": "MAP", + "comment": "Generate Map File", + "value": "true", + "flags": [ + "UserValue", + "UserIgnored", + "Continue" + ] + }, + { + "name": "MapExports", + "switch": "MAPINFO:EXPORTS", + "comment": "Map Exports", + "value": "true", + "flags": [] + }, + { + "name": "AssemblyDebug", + "switch": "ASSEMBLYDEBUG:DISABLE", + "comment": "Debuggable Assembly", + "value": "false", + "flags": [] + }, + { + "name": "AssemblyDebug", + "switch": "ASSEMBLYDEBUG", + "comment": "Debuggable Assembly", + "value": "true", + "flags": [] + }, + { + "name": "LargeAddressAware", + "switch": "LARGEADDRESSAWARE:NO", + "comment": "Enable Large Addresses", + "value": "false", + "flags": [] + }, + { + "name": "LargeAddressAware", + "switch": "LARGEADDRESSAWARE", + "comment": "Enable Large Addresses", + "value": "true", + "flags": [] + }, + { + "name": "TerminalServerAware", + "switch": "TSAWARE:NO", + "comment": "Terminal Server", + "value": "false", + "flags": [] + }, + { + "name": "TerminalServerAware", + "switch": "TSAWARE", + "comment": "Terminal Server", + "value": "true", + "flags": [] + }, + { + "name": "SwapRunFromCD", + "switch": "SWAPRUN:CD", + "comment": "Swap Run From CD", + "value": "true", + "flags": [] + }, + { + "name": "SwapRunFromNET", + "switch": "SWAPRUN:NET", + "comment": "Swap Run From Network", + "value": "true", + "flags": [] + }, + { + "name": "OptimizeReferences", + "switch": "OPT:NOREF", + "comment": "References", + "value": "false", + "flags": [] + }, + { + "name": "OptimizeReferences", + "switch": "OPT:REF", + "comment": "References", + "value": "true", + "flags": [] + }, + { + "name": "EnableCOMDATFolding", + "switch": "OPT:NOICF", + "comment": "Enable COMDAT Folding", + "value": "false", + "flags": [] + }, + { + "name": "EnableCOMDATFolding", + "switch": "OPT:ICF", + "comment": "Enable COMDAT Folding", + "value": "true", + "flags": [] + }, + { + "name": "IgnoreEmbeddedIDL", + "switch": "IGNOREIDL", + "comment": "Ignore Embedded IDL", + "value": "true", + "flags": [] + }, + { + "name": "AppContainer", + "switch": "APPCONTAINER", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "WindowsMetadataLinkDelaySign", + "switch": "WINMDDELAYSIGN:NO", + "comment": "Windows Metadata Delay Sign", + "value": "false", + "flags": [] + }, + { + "name": "WindowsMetadataLinkDelaySign", + "switch": "WINMDDELAYSIGN", + "comment": "Windows Metadata Delay Sign", + "value": "true", + "flags": [] + }, + { + "name": "NoEntryPoint", + "switch": "NOENTRY", + "comment": "No Entry Point", + "value": "true", + "flags": [] + }, + { + "name": "SetChecksum", + "switch": "RELEASE", + "comment": "Set Checksum", + "value": "true", + "flags": [] + }, + { + "name": "RandomizedBaseAddress", + "switch": "DYNAMICBASE:NO", + "comment": "Randomized Base Address", + "value": "false", + "flags": [] + }, + { + "name": "RandomizedBaseAddress", + "switch": "DYNAMICBASE", + "comment": "Randomized Base Address", + "value": "true", + "flags": [] + }, + { + "name": "FixedBaseAddress", + "switch": "FIXED:NO", + "comment": "Fixed Base Address", + "value": "false", + "flags": [] + }, + { + "name": "FixedBaseAddress", + "switch": "FIXED", + "comment": "Fixed Base Address", + "value": "true", + "flags": [] + }, + { + "name": "DataExecutionPrevention", + "switch": "NXCOMPAT:NO", + "comment": "Data Execution Prevention (DEP)", + "value": "false", + "flags": [] + }, + { + "name": "DataExecutionPrevention", + "switch": "NXCOMPAT", + "comment": "Data Execution Prevention (DEP)", + "value": "true", + "flags": [] + }, + { + "name": "TurnOffAssemblyGeneration", + "switch": "NOASSEMBLY", + "comment": "Turn Off Assembly Generation", + "value": "true", + "flags": [] + }, + { + "name": "SupportUnloadOfDelayLoadedDLL", + "switch": "DELAY:UNLOAD", + "comment": "Unload delay loaded DLL", + "value": "true", + "flags": [] + }, + { + "name": "SupportNobindOfDelayLoadedDLL", + "switch": "DELAY:NOBIND", + "comment": "Nobind delay loaded DLL", + "value": "true", + "flags": [] + }, + { + "name": "Profile", + "switch": "PROFILE", + "comment": "Profile", + "value": "true", + "flags": [] + }, + { + "name": "LinkDelaySign", + "switch": "DELAYSIGN:NO", + "comment": "Delay Sign", + "value": "false", + "flags": [] + }, + { + "name": "LinkDelaySign", + "switch": "DELAYSIGN", + "comment": "Delay Sign", + "value": "true", + "flags": [] + }, + { + "name": "CLRUnmanagedCodeCheck", + "switch": "CLRUNMANAGEDCODECHECK:NO", + "comment": "CLR Unmanaged Code Check", + "value": "false", + "flags": [] + }, + { + "name": "CLRUnmanagedCodeCheck", + "switch": "CLRUNMANAGEDCODECHECK", + "comment": "CLR Unmanaged Code Check", + "value": "true", + "flags": [] + }, + { + "name": "DetectOneDefinitionRule", + "switch": "ODR", + "comment": "Detect One Definition Rule violations", + "value": "true", + "flags": [] + }, + { + "name": "ImageHasSafeExceptionHandlers", + "switch": "SAFESEH:NO", + "comment": "Image Has Safe Exception Handlers", + "value": "false", + "flags": [] + }, + { + "name": "ImageHasSafeExceptionHandlers", + "switch": "SAFESEH", + "comment": "Image Has Safe Exception Handlers", + "value": "true", + "flags": [] + }, + { + "name": "LinkDLL", + "switch": "DLL", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "AdditionalLibraryDirectories", + "switch": "LIBPATH:", + "comment": "Additional Library Directories", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "IgnoreSpecificDefaultLibraries", + "switch": "NODEFAULTLIB:", + "comment": "Ignore Specific Default Libraries", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "AddModuleNamesToAssembly", + "switch": "ASSEMBLYMODULE:", + "comment": "Add Module to Assembly", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "EmbedManagedResourceFile", + "switch": "ASSEMBLYRESOURCE:", + "comment": "Embed Managed Resource File", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "ForceSymbolReferences", + "switch": "INCLUDE:", + "comment": "Force Symbol References", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "DelayLoadDLLs", + "switch": "DELAYLOAD:", + "comment": "Delay Loaded Dlls", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "AssemblyLinkResource", + "switch": "ASSEMBLYLINKRESOURCE:", + "comment": "Assembly Link Resource", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "AdditionalManifestDependencies", + "switch": "MANIFESTDEPENDENCY:", + "comment": "Additional Manifest Dependencies", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "ManifestInput", + "switch": "manifestinput:", + "comment": "Manifest Input", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "OutputFile", + "switch": "OUT:", + "comment": "Output File", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "Version", + "switch": "VERSION:", + "comment": "Version", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "SpecifySectionAttributes", + "switch": "SECTION:", + "comment": "Specify Section Attributes", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "MSDOSStubFileName", + "switch": "STUB:", + "comment": "MS-DOS Stub File Name", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "ModuleDefinitionFile", + "switch": "DEF:", + "comment": "Module Definition File", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "ManifestFile", + "switch": "ManifestFile:", + "comment": "Manifest File", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "ProgramDatabaseFile", + "switch": "PDB:", + "comment": "Generate Program Database File", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "StripPrivateSymbols", + "switch": "PDBSTRIPPED:", + "comment": "Strip Private Symbols", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "MapFileName", + "switch": "MAP:", + "comment": "Map File Name", + "value": "", + "flags": [ + "UserValue", + "UserRequired" + ] + }, + { + "name": "HeapReserveSize", + "switch": "HEAP:", + "comment": "Heap Reserve Size", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "HeapCommitSize", + "switch": "HEAP", + "comment": "Heap Commit Size", + "value": "", + "flags": [ + "UserValue", + "UserRequired" + ] + }, + { + "name": "StackReserveSize", + "switch": "STACK:", + "comment": "Stack Reserve Size", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "StackCommitSize", + "switch": "STACK", + "comment": "Stack Commit Size", + "value": "", + "flags": [ + "UserValue", + "UserRequired" + ] + }, + { + "name": "FunctionOrder", + "switch": "ORDER:@", + "comment": "Function Order", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "ProfileGuidedDatabase", + "switch": "PGD:", + "comment": "Profile Guided Database", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "MidlCommandFile", + "switch": "MIDL:@", + "comment": "MIDL Commands", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "MergedIDLBaseFileName", + "switch": "IDLOUT:", + "comment": "Merged IDL Base File Name", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "TypeLibraryFile", + "switch": "TLBOUT:", + "comment": "Type Library", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "WindowsMetadataFile", + "switch": "WINMDFILE:", + "comment": "Windows Metadata File", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "WindowsMetadataLinkKeyFile", + "switch": "WINMDKEYFILE:", + "comment": "Windows Metadata Key File", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "WindowsMetadataKeyContainer", + "switch": "WINMDKEYCONTAINER:", + "comment": "Windows Metadata Key Container", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "EntryPointSymbol", + "switch": "ENTRY:", + "comment": "Entry Point", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "BaseAddress", + "switch": "BASE:", + "comment": "Base Address", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "ImportLibrary", + "switch": "IMPLIB:", + "comment": "Import Library", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "MergeSections", + "switch": "MERGE:", + "comment": "Merge Sections", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "LinkKeyFile", + "switch": "KEYFILE:", + "comment": "Key File", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "KeyContainer", + "switch": "KEYCONTAINER:", + "comment": "Key Container", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "TypeLibraryResourceID", + "switch": "TLBID:", + "comment": "TypeLib Resource ID", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "SectionAlignment", + "switch": "ALIGN:", + "comment": "SectionAlignment", + "value": "", + "flags": [ + "UserValue" + ] + } +] diff --git a/Templates/MSBuild/FlagTables/v12_MASM.json b/Templates/MSBuild/FlagTables/v12_MASM.json new file mode 100644 index 0000000..4634306 --- /dev/null +++ b/Templates/MSBuild/FlagTables/v12_MASM.json @@ -0,0 +1,295 @@ +[ + { + "name": "PreserveIdentifierCase", + "switch": "", + "comment": "Default", + "value": "0", + "flags": [] + }, + { + "name": "PreserveIdentifierCase", + "switch": "Cp", + "comment": "Preserves Identifier Case (/Cp)", + "value": "1", + "flags": [] + }, + { + "name": "PreserveIdentifierCase", + "switch": "Cu", + "comment": "Maps all identifiers to upper case. (/Cu)", + "value": "2", + "flags": [] + }, + { + "name": "PreserveIdentifierCase", + "switch": "Cx", + "comment": "Preserves case in public and extern symbols. (/Cx)", + "value": "3", + "flags": [] + }, + { + "name": "WarningLevel", + "switch": "W0", + "comment": "Warning Level 0 (/W0)", + "value": "0", + "flags": [] + }, + { + "name": "WarningLevel", + "switch": "W1", + "comment": "Warning Level 1 (/W1)", + "value": "1", + "flags": [] + }, + { + "name": "WarningLevel", + "switch": "W2", + "comment": "Warning Level 2 (/W2)", + "value": "2", + "flags": [] + }, + { + "name": "WarningLevel", + "switch": "W3", + "comment": "Warning Level 3 (/W3)", + "value": "3", + "flags": [] + }, + { + "name": "PackAlignmentBoundary", + "switch": "", + "comment": "Default", + "value": "0", + "flags": [] + }, + { + "name": "PackAlignmentBoundary", + "switch": "Zp1", + "comment": "One Byte Boundary (/Zp1)", + "value": "1", + "flags": [] + }, + { + "name": "PackAlignmentBoundary", + "switch": "Zp2", + "comment": "Two Byte Boundary (/Zp2)", + "value": "2", + "flags": [] + }, + { + "name": "PackAlignmentBoundary", + "switch": "Zp4", + "comment": "Four Byte Boundary (/Zp4)", + "value": "3", + "flags": [] + }, + { + "name": "PackAlignmentBoundary", + "switch": "Zp8", + "comment": "Eight Byte Boundary (/Zp8)", + "value": "4", + "flags": [] + }, + { + "name": "PackAlignmentBoundary", + "switch": "Zp16", + "comment": "Sixteen Byte Boundary (/Zp16)", + "value": "5", + "flags": [] + }, + { + "name": "CallingConvention", + "switch": "", + "comment": "Default", + "value": "0", + "flags": [] + }, + { + "name": "CallingConvention", + "switch": "Gd", + "comment": "Use C-style Calling Convention (/Gd)", + "value": "1", + "flags": [] + }, + { + "name": "CallingConvention", + "switch": "Gz", + "comment": "Use stdcall Calling Convention (/Gz)", + "value": "2", + "flags": [] + }, + { + "name": "CallingConvention", + "switch": "Gc", + "comment": "Use Pascal Calling Convention (/Gc)", + "value": "3", + "flags": [] + }, + { + "name": "ErrorReporting", + "switch": "errorReport:prompt", + "comment": "Prompt to send report immediately (/errorReport:prompt)", + "value": "0", + "flags": [] + }, + { + "name": "ErrorReporting", + "switch": "errorReport:queue", + "comment": "Prompt to send report at the next logon (/errorReport:queue)", + "value": "1", + "flags": [] + }, + { + "name": "ErrorReporting", + "switch": "errorReport:send", + "comment": "Automatically send report (/errorReport:send)", + "value": "2", + "flags": [] + }, + { + "name": "ErrorReporting", + "switch": "errorReport:none", + "comment": "Do not send report (/errorReport:none)", + "value": "3", + "flags": [] + }, + { + "name": "NoLogo", + "switch": "nologo", + "comment": "Suppress Startup Banner", + "value": "true", + "flags": [] + }, + { + "name": "GeneratePreprocessedSourceListing", + "switch": "EP", + "comment": "Generate Preprocessed Source Listing", + "value": "true", + "flags": [] + }, + { + "name": "ListAllAvailableInformation", + "switch": "Sa", + "comment": "List All Available Information", + "value": "true", + "flags": [] + }, + { + "name": "UseSafeExceptionHandlers", + "switch": "safeseh", + "comment": "Use Safe Exception Handlers", + "value": "true", + "flags": [] + }, + { + "name": "AddFirstPassListing", + "switch": "Sf", + "comment": "Add First Pass Listing", + "value": "true", + "flags": [] + }, + { + "name": "EnableAssemblyGeneratedCodeListing", + "switch": "Sg", + "comment": "Enable Assembly Generated Code Listing", + "value": "true", + "flags": [] + }, + { + "name": "DisableSymbolTable", + "switch": "Sn", + "comment": "Disable Symbol Table", + "value": "true", + "flags": [] + }, + { + "name": "EnableFalseConditionalsInListing", + "switch": "Sx", + "comment": "Enable False Conditionals In Listing", + "value": "true", + "flags": [] + }, + { + "name": "TreatWarningsAsErrors", + "switch": "WX", + "comment": "Treat Warnings As Errors", + "value": "true", + "flags": [] + }, + { + "name": "MakeAllSymbolsPublic", + "switch": "Zf", + "comment": "Make All Symbols Public", + "value": "true", + "flags": [] + }, + { + "name": "GenerateDebugInformation", + "switch": "Zi", + "comment": "Generate Debug Information", + "value": "true", + "flags": [] + }, + { + "name": "EnableMASM51Compatibility", + "switch": "Zm", + "comment": "Enable MASM 5.1 Compatibility", + "value": "true", + "flags": [] + }, + { + "name": "PerformSyntaxCheckOnly", + "switch": "Zs", + "comment": "Perform Syntax Check Only", + "value": "true", + "flags": [] + }, + { + "name": "PreprocessorDefinitions", + "switch": "D", + "comment": "Preprocessor Definitions", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "IncludePaths", + "switch": "I", + "comment": "Include Paths", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "BrowseFile", + "switch": "FR", + "comment": "Generate Browse Information File", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "ObjectFileName", + "switch": "Fo", + "comment": "Object File Name", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "AssembledCodeListingFile", + "switch": "Fl", + "comment": "Assembled Code Listing File", + "value": "", + "flags": [ + "UserValue" + ] + } +] diff --git a/Templates/MSBuild/FlagTables/v12_RC.json b/Templates/MSBuild/FlagTables/v12_RC.json new file mode 100644 index 0000000..b8c0127 --- /dev/null +++ b/Templates/MSBuild/FlagTables/v12_RC.json @@ -0,0 +1,69 @@ +[ + { + "name": "IgnoreStandardIncludePath", + "switch": "X", + "comment": "Ignore Standard Include Paths", + "value": "true", + "flags": [] + }, + { + "name": "ShowProgress", + "switch": "v", + "comment": "Show Progress", + "value": "true", + "flags": [] + }, + { + "name": "SuppressStartupBanner", + "switch": "nologo", + "comment": "Suppress Startup Banner", + "value": "true", + "flags": [] + }, + { + "name": "NullTerminateStrings", + "switch": "n", + "comment": "Null Terminate Strings", + "value": "true", + "flags": [] + }, + { + "name": "PreprocessorDefinitions", + "switch": "D", + "comment": "Preprocessor Definitions", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "UndefinePreprocessorDefinitions", + "switch": "u", + "comment": "Undefine Preprocessor Definitions", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "AdditionalIncludeDirectories", + "switch": "I", + "comment": "Additional Include Directories", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "ResourceOutputFileName", + "switch": "fo", + "comment": "Resource File Name", + "value": "", + "flags": [ + "UserValue" + ] + } +] diff --git a/Templates/MSBuild/FlagTables/v140_CL.json b/Templates/MSBuild/FlagTables/v140_CL.json new file mode 100644 index 0000000..3dc9f35 --- /dev/null +++ b/Templates/MSBuild/FlagTables/v140_CL.json @@ -0,0 +1,1184 @@ +[ + { + "name": "DebugInformationFormat", + "switch": "", + "comment": "None", + "value": "None", + "flags": [] + }, + { + "name": "DebugInformationFormat", + "switch": "Z7", + "comment": "C7 compatible", + "value": "OldStyle", + "flags": [] + }, + { + "name": "DebugInformationFormat", + "switch": "Zi", + "comment": "Program Database", + "value": "ProgramDatabase", + "flags": [] + }, + { + "name": "DebugInformationFormat", + "switch": "ZI", + "comment": "Program Database for Edit And Continue", + "value": "EditAndContinue", + "flags": [] + }, + { + "name": "CompileAsManaged", + "switch": "", + "comment": "No Common Language RunTime Support", + "value": "false", + "flags": [] + }, + { + "name": "CompileAsManaged", + "switch": "clr", + "comment": "Common Language RunTime Support", + "value": "true", + "flags": [] + }, + { + "name": "CompileAsManaged", + "switch": "clr:pure", + "comment": "Pure MSIL Common Language RunTime Support", + "value": "Pure", + "flags": [] + }, + { + "name": "CompileAsManaged", + "switch": "clr:safe", + "comment": "Safe MSIL Common Language RunTime Support", + "value": "Safe", + "flags": [] + }, + { + "name": "WarningLevel", + "switch": "W0", + "comment": "Turn Off All Warnings", + "value": "TurnOffAllWarnings", + "flags": [] + }, + { + "name": "WarningLevel", + "switch": "W1", + "comment": "Level1", + "value": "Level1", + "flags": [] + }, + { + "name": "WarningLevel", + "switch": "W2", + "comment": "Level2", + "value": "Level2", + "flags": [] + }, + { + "name": "WarningLevel", + "switch": "W3", + "comment": "Level3", + "value": "Level3", + "flags": [] + }, + { + "name": "WarningLevel", + "switch": "W4", + "comment": "Level4", + "value": "Level4", + "flags": [] + }, + { + "name": "WarningLevel", + "switch": "Wall", + "comment": "EnableAllWarnings", + "value": "EnableAllWarnings", + "flags": [] + }, + { + "name": "Optimization", + "switch": "", + "comment": "Custom", + "value": "Custom", + "flags": [] + }, + { + "name": "Optimization", + "switch": "Od", + "comment": "Disabled", + "value": "Disabled", + "flags": [] + }, + { + "name": "Optimization", + "switch": "O1", + "comment": "Minimize Size", + "value": "MinSpace", + "flags": [] + }, + { + "name": "Optimization", + "switch": "O2", + "comment": "Maximize Speed", + "value": "MaxSpeed", + "flags": [] + }, + { + "name": "Optimization", + "switch": "Ox", + "comment": "Full Optimization", + "value": "Full", + "flags": [] + }, + { + "name": "InlineFunctionExpansion", + "switch": "", + "comment": "Default", + "value": "Default", + "flags": [] + }, + { + "name": "InlineFunctionExpansion", + "switch": "Ob0", + "comment": "Disabled", + "value": "Disabled", + "flags": [] + }, + { + "name": "InlineFunctionExpansion", + "switch": "Ob1", + "comment": "Only __inline", + "value": "OnlyExplicitInline", + "flags": [] + }, + { + "name": "InlineFunctionExpansion", + "switch": "Ob2", + "comment": "Any Suitable", + "value": "AnySuitable", + "flags": [] + }, + { + "name": "FavorSizeOrSpeed", + "switch": "Os", + "comment": "Favor small code", + "value": "Size", + "flags": [] + }, + { + "name": "FavorSizeOrSpeed", + "switch": "Ot", + "comment": "Favor fast code", + "value": "Speed", + "flags": [] + }, + { + "name": "FavorSizeOrSpeed", + "switch": "", + "comment": "Neither", + "value": "Neither", + "flags": [] + }, + { + "name": "ExceptionHandling", + "switch": "EHa", + "comment": "Yes with SEH Exceptions", + "value": "Async", + "flags": [] + }, + { + "name": "ExceptionHandling", + "switch": "EHsc", + "comment": "Yes", + "value": "Sync", + "flags": [] + }, + { + "name": "ExceptionHandling", + "switch": "EHs", + "comment": "Yes with Extern C functions", + "value": "SyncCThrow", + "flags": [] + }, + { + "name": "ExceptionHandling", + "switch": "", + "comment": "No", + "value": "false", + "flags": [] + }, + { + "name": "BasicRuntimeChecks", + "switch": "RTCs", + "comment": "Stack Frames", + "value": "StackFrameRuntimeCheck", + "flags": [] + }, + { + "name": "BasicRuntimeChecks", + "switch": "RTCu", + "comment": "Uninitialized variables", + "value": "UninitializedLocalUsageCheck", + "flags": [] + }, + { + "name": "BasicRuntimeChecks", + "switch": "RTC1", + "comment": "Both (/RTC1, equiv. to /RTCsu)", + "value": "EnableFastChecks", + "flags": [] + }, + { + "name": "BasicRuntimeChecks", + "switch": "", + "comment": "Default", + "value": "Default", + "flags": [] + }, + { + "name": "RuntimeLibrary", + "switch": "MT", + "comment": "Multi-threaded", + "value": "MultiThreaded", + "flags": [] + }, + { + "name": "RuntimeLibrary", + "switch": "MTd", + "comment": "Multi-threaded Debug", + "value": "MultiThreadedDebug", + "flags": [] + }, + { + "name": "RuntimeLibrary", + "switch": "MD", + "comment": "Multi-threaded DLL", + "value": "MultiThreadedDLL", + "flags": [] + }, + { + "name": "RuntimeLibrary", + "switch": "MDd", + "comment": "Multi-threaded Debug DLL", + "value": "MultiThreadedDebugDLL", + "flags": [] + }, + { + "name": "StructMemberAlignment", + "switch": "Zp1", + "comment": "1 Byte", + "value": "1Byte", + "flags": [] + }, + { + "name": "StructMemberAlignment", + "switch": "Zp2", + "comment": "2 Bytes", + "value": "2Bytes", + "flags": [] + }, + { + "name": "StructMemberAlignment", + "switch": "Zp4", + "comment": "4 Byte", + "value": "4Bytes", + "flags": [] + }, + { + "name": "StructMemberAlignment", + "switch": "Zp8", + "comment": "8 Bytes", + "value": "8Bytes", + "flags": [] + }, + { + "name": "StructMemberAlignment", + "switch": "Zp16", + "comment": "16 Bytes", + "value": "16Bytes", + "flags": [] + }, + { + "name": "StructMemberAlignment", + "switch": "", + "comment": "Default", + "value": "Default", + "flags": [] + }, + { + "name": "BufferSecurityCheck", + "switch": "GS-", + "comment": "Disable Security Check", + "value": "false", + "flags": [] + }, + { + "name": "BufferSecurityCheck", + "switch": "GS", + "comment": "Enable Security Check", + "value": "true", + "flags": [] + }, + { + "name": "ControlFlowGuard", + "switch": "guard:cf", + "comment": "Yes", + "value": "Guard", + "flags": [] + }, + { + "name": "ControlFlowGuard", + "switch": "", + "comment": "No", + "value": "false", + "flags": [] + }, + { + "name": "EnableEnhancedInstructionSet", + "switch": "arch:SSE", + "comment": "Streaming SIMD Extensions", + "value": "StreamingSIMDExtensions", + "flags": [] + }, + { + "name": "EnableEnhancedInstructionSet", + "switch": "arch:SSE2", + "comment": "Streaming SIMD Extensions 2", + "value": "StreamingSIMDExtensions2", + "flags": [] + }, + { + "name": "EnableEnhancedInstructionSet", + "switch": "arch:AVX", + "comment": "Advanced Vector Extensions", + "value": "AdvancedVectorExtensions", + "flags": [] + }, + { + "name": "EnableEnhancedInstructionSet", + "switch": "arch:AVX2", + "comment": "Advanced Vector Extensions 2", + "value": "AdvancedVectorExtensions2", + "flags": [] + }, + { + "name": "EnableEnhancedInstructionSet", + "switch": "arch:IA32", + "comment": "No Enhanced Instructions", + "value": "NoExtensions", + "flags": [] + }, + { + "name": "EnableEnhancedInstructionSet", + "switch": "", + "comment": "Not Set", + "value": "NotSet", + "flags": [] + }, + { + "name": "FloatingPointModel", + "switch": "fp:precise", + "comment": "Precise", + "value": "Precise", + "flags": [] + }, + { + "name": "FloatingPointModel", + "switch": "fp:strict", + "comment": "Strict", + "value": "Strict", + "flags": [] + }, + { + "name": "FloatingPointModel", + "switch": "fp:fast", + "comment": "Fast", + "value": "Fast", + "flags": [] + }, + { + "name": "PrecompiledHeader", + "switch": "Yc", + "comment": "Create", + "value": "Create", + "flags": [ + "UserValue", + "UserIgnored", + "Continue" + ] + }, + { + "name": "PrecompiledHeader", + "switch": "Yu", + "comment": "Use", + "value": "Use", + "flags": [ + "UserValue", + "UserIgnored", + "Continue" + ] + }, + { + "name": "PrecompiledHeader", + "switch": "Y-", + "comment": "Not Using Precompiled Headers", + "value": "NotUsing", + "flags": [] + }, + { + "name": "AssemblerOutput", + "switch": "", + "comment": "No Listing", + "value": "NoListing", + "flags": [] + }, + { + "name": "AssemblerOutput", + "switch": "FA", + "comment": "Assembly-Only Listing", + "value": "AssemblyCode", + "flags": [] + }, + { + "name": "AssemblerOutput", + "switch": "FAc", + "comment": "Assembly With Machine Code", + "value": "AssemblyAndMachineCode", + "flags": [] + }, + { + "name": "AssemblerOutput", + "switch": "FAs", + "comment": "Assembly With Source Code", + "value": "AssemblyAndSourceCode", + "flags": [] + }, + { + "name": "AssemblerOutput", + "switch": "FAcs", + "comment": "Assembly, Machine Code and Source", + "value": "All", + "flags": [] + }, + { + "name": "CallingConvention", + "switch": "Gd", + "comment": "__cdecl", + "value": "Cdecl", + "flags": [] + }, + { + "name": "CallingConvention", + "switch": "Gr", + "comment": "__fastcall", + "value": "FastCall", + "flags": [] + }, + { + "name": "CallingConvention", + "switch": "Gz", + "comment": "__stdcall", + "value": "StdCall", + "flags": [] + }, + { + "name": "CallingConvention", + "switch": "Gv", + "comment": "__vectorcall", + "value": "VectorCall", + "flags": [] + }, + { + "name": "CompileAs", + "switch": "", + "comment": "Default", + "value": "Default", + "flags": [] + }, + { + "name": "CompileAs", + "switch": "TC", + "comment": "Compile as C Code", + "value": "CompileAsC", + "flags": [] + }, + { + "name": "CompileAs", + "switch": "TP", + "comment": "Compile as C++ Code", + "value": "CompileAsCpp", + "flags": [] + }, + { + "name": "ErrorReporting", + "switch": "errorReport:none", + "comment": "Do Not Send Report", + "value": "None", + "flags": [] + }, + { + "name": "ErrorReporting", + "switch": "errorReport:prompt", + "comment": "Prompt Immediately", + "value": "Prompt", + "flags": [] + }, + { + "name": "ErrorReporting", + "switch": "errorReport:queue", + "comment": "Queue For Next Login", + "value": "Queue", + "flags": [] + }, + { + "name": "ErrorReporting", + "switch": "errorReport:send", + "comment": "Send Automatically", + "value": "Send", + "flags": [] + }, + { + "name": "CompileAsWinRT", + "switch": "ZW", + "comment": "Consume Windows Runtime Extension", + "value": "true", + "flags": [] + }, + { + "name": "WinRTNoStdLib", + "switch": "ZW:nostdlib", + "comment": "No Standard WinRT Libraries", + "value": "true", + "flags": [] + }, + { + "name": "SuppressStartupBanner", + "switch": "nologo", + "comment": "Suppress Startup Banner", + "value": "true", + "flags": [] + }, + { + "name": "TreatWarningAsError", + "switch": "WX-", + "comment": "Treat Warnings As Errors", + "value": "false", + "flags": [] + }, + { + "name": "TreatWarningAsError", + "switch": "WX", + "comment": "Treat Warnings As Errors", + "value": "true", + "flags": [] + }, + { + "name": "SDLCheck", + "switch": "sdl-", + "comment": "SDL checks", + "value": "false", + "flags": [] + }, + { + "name": "SDLCheck", + "switch": "sdl", + "comment": "SDL checks", + "value": "true", + "flags": [] + }, + { + "name": "MultiProcessorCompilation", + "switch": "MP", + "comment": "Multi-processor Compilation", + "value": "true", + "flags": [ + "UserValue", + "UserIgnored", + "Continue" + ] + }, + { + "name": "IntrinsicFunctions", + "switch": "Oi", + "comment": "Enable Intrinsic Functions", + "value": "true", + "flags": [] + }, + { + "name": "OmitFramePointers", + "switch": "Oy-", + "comment": "Omit Frame Pointers", + "value": "false", + "flags": [] + }, + { + "name": "OmitFramePointers", + "switch": "Oy", + "comment": "Omit Frame Pointers", + "value": "true", + "flags": [] + }, + { + "name": "EnableFiberSafeOptimizations", + "switch": "GT", + "comment": "Enable Fiber-Safe Optimizations", + "value": "true", + "flags": [] + }, + { + "name": "WholeProgramOptimization", + "switch": "GL", + "comment": "Whole Program Optimization", + "value": "true", + "flags": [] + }, + { + "name": "UndefineAllPreprocessorDefinitions", + "switch": "u", + "comment": "Undefine All Preprocessor Definitions", + "value": "true", + "flags": [] + }, + { + "name": "IgnoreStandardIncludePath", + "switch": "X", + "comment": "Ignore Standard Include Paths", + "value": "true", + "flags": [] + }, + { + "name": "PreprocessToFile", + "switch": "P", + "comment": "Preprocess to a File", + "value": "true", + "flags": [] + }, + { + "name": "PreprocessSuppressLineNumbers", + "switch": "EP", + "comment": "Preprocess Suppress Line Numbers", + "value": "true", + "flags": [] + }, + { + "name": "PreprocessKeepComments", + "switch": "C", + "comment": "Keep Comments", + "value": "true", + "flags": [] + }, + { + "name": "StringPooling", + "switch": "GF-", + "comment": "Enable String Pooling", + "value": "false", + "flags": [] + }, + { + "name": "StringPooling", + "switch": "GF", + "comment": "Enable String Pooling", + "value": "true", + "flags": [] + }, + { + "name": "MinimalRebuild", + "switch": "Gm-", + "comment": "Enable Minimal Rebuild", + "value": "false", + "flags": [] + }, + { + "name": "MinimalRebuild", + "switch": "Gm", + "comment": "Enable Minimal Rebuild", + "value": "true", + "flags": [] + }, + { + "name": "SmallerTypeCheck", + "switch": "RTCc", + "comment": "Smaller Type Check", + "value": "true", + "flags": [] + }, + { + "name": "FunctionLevelLinking", + "switch": "Gy-", + "comment": "Enable Function-Level Linking", + "value": "false", + "flags": [] + }, + { + "name": "FunctionLevelLinking", + "switch": "Gy", + "comment": "Enable Function-Level Linking", + "value": "true", + "flags": [] + }, + { + "name": "EnableParallelCodeGeneration", + "switch": "Qpar-", + "comment": "Enable Parallel Code Generation", + "value": "false", + "flags": [] + }, + { + "name": "EnableParallelCodeGeneration", + "switch": "Qpar", + "comment": "Enable Parallel Code Generation", + "value": "true", + "flags": [] + }, + { + "name": "FloatingPointExceptions", + "switch": "fp:except-", + "comment": "Enable Floating Point Exceptions", + "value": "false", + "flags": [] + }, + { + "name": "FloatingPointExceptions", + "switch": "fp:except", + "comment": "Enable Floating Point Exceptions", + "value": "true", + "flags": [] + }, + { + "name": "CreateHotpatchableImage", + "switch": "hotpatch", + "comment": "Create Hotpatchable Image", + "value": "true", + "flags": [] + }, + { + "name": "DisableLanguageExtensions", + "switch": "Za", + "comment": "Disable Language Extensions", + "value": "true", + "flags": [] + }, + { + "name": "TreatWChar_tAsBuiltInType", + "switch": "Zc:wchar_t-", + "comment": "Treat WChar_t As Built in Type", + "value": "false", + "flags": [] + }, + { + "name": "TreatWChar_tAsBuiltInType", + "switch": "Zc:wchar_t", + "comment": "Treat WChar_t As Built in Type", + "value": "true", + "flags": [] + }, + { + "name": "ForceConformanceInForLoopScope", + "switch": "Zc:forScope-", + "comment": "Force Conformance in For Loop Scope", + "value": "false", + "flags": [] + }, + { + "name": "ForceConformanceInForLoopScope", + "switch": "Zc:forScope", + "comment": "Force Conformance in For Loop Scope", + "value": "true", + "flags": [] + }, + { + "name": "RemoveUnreferencedCodeData", + "switch": "Zc:inline-", + "comment": "Remove unreferenced code and data", + "value": "false", + "flags": [] + }, + { + "name": "RemoveUnreferencedCodeData", + "switch": "Zc:inline", + "comment": "Remove unreferenced code and data", + "value": "true", + "flags": [] + }, + { + "name": "EnforceTypeConversionRules", + "switch": "Zc:rvalueCast-", + "comment": "Enforce type conversion rules", + "value": "false", + "flags": [] + }, + { + "name": "EnforceTypeConversionRules", + "switch": "Zc:rvalueCast", + "comment": "Enforce type conversion rules", + "value": "true", + "flags": [] + }, + { + "name": "RuntimeTypeInfo", + "switch": "GR-", + "comment": "Enable Run-Time Type Information", + "value": "false", + "flags": [] + }, + { + "name": "RuntimeTypeInfo", + "switch": "GR", + "comment": "Enable Run-Time Type Information", + "value": "true", + "flags": [] + }, + { + "name": "OpenMPSupport", + "switch": "openmp-", + "comment": "Open MP Support", + "value": "false", + "flags": [] + }, + { + "name": "OpenMPSupport", + "switch": "openmp", + "comment": "Open MP Support", + "value": "true", + "flags": [] + }, + { + "name": "ExpandAttributedSource", + "switch": "Fx", + "comment": "Expand Attributed Source", + "value": "true", + "flags": [] + }, + { + "name": "UseUnicodeForAssemblerListing", + "switch": "FAu", + "comment": "Use Unicode For Assembler Listing", + "value": "true", + "flags": [] + }, + { + "name": "GenerateXMLDocumentationFiles", + "switch": "doc", + "comment": "Generate XML Documentation Files", + "value": "true", + "flags": [ + "UserValue", + "UserIgnored", + "Continue" + ] + }, + { + "name": "BrowseInformation", + "switch": "FR", + "comment": "Enable Browse Information", + "value": "true", + "flags": [ + "UserValue", + "UserIgnored", + "Continue" + ] + }, + { + "name": "ShowIncludes", + "switch": "showIncludes", + "comment": "Show Includes", + "value": "true", + "flags": [] + }, + { + "name": "EnablePREfast", + "switch": "analyze-", + "comment": "Enable Code Analysis", + "value": "false", + "flags": [] + }, + { + "name": "EnablePREfast", + "switch": "analyze", + "comment": "Enable Code Analysis", + "value": "true", + "flags": [] + }, + { + "name": "UseFullPaths", + "switch": "FC", + "comment": "Use Full Paths", + "value": "true", + "flags": [] + }, + { + "name": "OmitDefaultLibName", + "switch": "Zl", + "comment": "Omit Default Library Name", + "value": "true", + "flags": [] + }, + { + "name": "AdditionalIncludeDirectories", + "switch": "I", + "comment": "Additional Include Directories", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "AdditionalUsingDirectories", + "switch": "AI", + "comment": "Additional #using Directories", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "PreprocessorDefinitions", + "switch": "D", + "comment": "Preprocessor Definitions", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "UndefinePreprocessorDefinitions", + "switch": "U", + "comment": "Undefine Preprocessor Definitions", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "DisableSpecificWarnings", + "switch": "wd", + "comment": "Disable Specific Warnings", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "ForcedIncludeFiles", + "switch": "FI", + "comment": "Forced Include File", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "ForcedUsingFiles", + "switch": "FU", + "comment": "Forced #using File", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "PREfastLog", + "switch": "analyze:log", + "comment": "Code Analysis Log", + "value": "", + "flags": [ + "UserFollowing" + ] + }, + { + "name": "PREfastAdditionalPlugins", + "switch": "analyze:plugin", + "comment": "Additional Code Analysis Native plugins", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "TreatSpecificWarningsAsErrors", + "switch": "we", + "comment": "Treat Specific Warnings As Errors", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "WarningVersion", + "switch": "Wv:", + "comment": "Warning Version", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "PreprocessOutputPath", + "switch": "Fi", + "comment": "Preprocess Output Path", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "PrecompiledHeaderFile", + "switch": "Yu", + "comment": "Precompiled Header File", + "value": "", + "flags": [ + "UserValue", + "UserRequired" + ] + }, + { + "name": "PrecompiledHeaderFile", + "switch": "Yc", + "comment": "Precompiled Header File", + "value": "", + "flags": [ + "UserValue", + "UserRequired" + ] + }, + { + "name": "PrecompiledHeaderOutputFile", + "switch": "Fp", + "comment": "Precompiled Header Output File", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "AssemblerListingLocation", + "switch": "Fa", + "comment": "ASM List Location", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "ObjectFileName", + "switch": "Fo", + "comment": "Object File Name", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "ProgramDataBaseFileName", + "switch": "Fd", + "comment": "Program Database File Name", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "XMLDocumentationFileName", + "switch": "doc", + "comment": "XML Documentation File Name", + "value": "", + "flags": [ + "UserValue", + "UserRequired" + ] + }, + { + "name": "BrowseInformationFile", + "switch": "FR", + "comment": "Browse Information File", + "value": "", + "flags": [ + "UserValue", + "UserRequired" + ] + }, + { + "name": "ProcessorNumber", + "switch": "MP", + "comment": "Number of processors", + "value": "", + "flags": [ + "UserValue", + "UserRequired" + ] + }, + { + "name": "CppLanguageStandard", + "switch": "", + "comment": "Default", + "value": "Default", + "flags": [] + }, + { + "name": "CppLanguageStandard", + "switch": "std=c++98", + "comment": "C++03", + "value": "c++98", + "flags": [] + }, + { + "name": "CppLanguageStandard", + "switch": "std=c++11", + "comment": "C++11", + "value": "c++11", + "flags": [] + }, + { + "name": "CppLanguageStandard", + "switch": "std=c++1y", + "comment": "C++14", + "value": "c++1y", + "flags": [] + }, + { + "name": "CppLanguageStandard", + "switch": "std=c++14", + "comment": "C++14", + "value": "c++1y", + "flags": [] + }, + { + "name": "CppLanguageStandard", + "switch": "std=gnu++98", + "comment": "C++03 (GNU Dialect)", + "value": "gnu++98", + "flags": [] + }, + { + "name": "CppLanguageStandard", + "switch": "std=gnu++11", + "comment": "C++11 (GNU Dialect)", + "value": "gnu++11", + "flags": [] + }, + { + "name": "CppLanguageStandard", + "switch": "std=gnu++1y", + "comment": "C++14 (GNU Dialect)", + "value": "gnu++1y", + "flags": [] + }, + { + "name": "CppLanguageStandard", + "switch": "std=gnu++14", + "comment": "C++14 (GNU Dialect)", + "value": "gnu++1y", + "flags": [] + } +] diff --git a/Templates/MSBuild/FlagTables/v140_CSharp.json b/Templates/MSBuild/FlagTables/v140_CSharp.json new file mode 100644 index 0000000..a0780a4 --- /dev/null +++ b/Templates/MSBuild/FlagTables/v140_CSharp.json @@ -0,0 +1,570 @@ +[ + { + "name": "ProjectName", + "switch": "out:", + "comment": "", + "value": "", + "flags": [ + "UserValue", + "UserRequired" + ] + }, + { + "name": "OutputType", + "switch": "target:exe", + "comment": "", + "value": "Exe", + "flags": [] + }, + { + "name": "OutputType", + "switch": "target:winexe", + "comment": "", + "value": "Winexe", + "flags": [] + }, + { + "name": "OutputType", + "switch": "target:library", + "comment": "", + "value": "Library", + "flags": [] + }, + { + "name": "OutputType", + "switch": "target:module", + "comment": "", + "value": "Module", + "flags": [] + }, + { + "name": "DocumentationFile", + "switch": "doc", + "comment": "", + "value": "", + "flags": [ + "UserValue", + "UserRequired" + ] + }, + { + "name": "Platform", + "switch": "platform:x86", + "comment": "", + "value": "x86", + "flags": [] + }, + { + "name": "Platform", + "switch": "platform:Itanium", + "comment": "", + "value": "Itanium", + "flags": [] + }, + { + "name": "Platform", + "switch": "platform:x64", + "comment": "", + "value": "x64", + "flags": [] + }, + { + "name": "Platform", + "switch": "platform:arm", + "comment": "", + "value": "arm", + "flags": [] + }, + { + "name": "Platform", + "switch": "platform:anycpu32bitpreferred", + "comment": "", + "value": "anycpu32bitpreferred", + "flags": [] + }, + { + "name": "Platform", + "switch": "platform:anycpu", + "comment": "", + "value": "anycpu", + "flags": [] + }, + { + "name": "References", + "switch": "reference:", + "comment": "mit alias", + "value": "", + "flags": [] + }, + { + "name": "References", + "switch": "reference:", + "comment": "dateiliste", + "value": "", + "flags": [] + }, + { + "name": "AddModules", + "switch": "addmodule:", + "comment": "", + "value": "", + "flags": [ + "SemicolonAppendable" + ] + }, + { + "name": "Win32Resource", + "switch": "win32res:", + "comment": "", + "value": "", + "flags": [ + "UserValue", + "UserRequired" + ] + }, + { + "name": "ApplicationIcon", + "switch": "win32icon:", + "comment": "", + "value": "", + "flags": [ + "UserValue", + "UserRequired" + ] + }, + { + "name": "ApplicationManifest", + "switch": "win32manifest:", + "comment": "", + "value": "", + "flags": [ + "UserValue", + "UserRequired" + ] + }, + { + "name": "NoWin32Manifest", + "switch": "nowin32manifest", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "DefineDebug", + "switch": "debug", + "comment": "", + "value": "true", + "flags": [ + "Continue" + ] + }, + { + "name": "DebugSymbols", + "switch": "debug", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "DebugSymbols", + "switch": "debug-", + "comment": "", + "value": "false", + "flags": [] + }, + { + "name": "DebugSymbols", + "switch": "debug+", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "DebugType", + "switch": "debug:none", + "comment": "", + "value": "none", + "flags": [] + }, + { + "name": "DebugType", + "switch": "debug:full", + "comment": "", + "value": "full", + "flags": [] + }, + { + "name": "DebugType", + "switch": "debug:pdbonly", + "comment": "", + "value": "pdbonly", + "flags": [] + }, + { + "name": "Optimize", + "switch": "optimize", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "Optimize", + "switch": "optimize-", + "comment": "", + "value": "false", + "flags": [] + }, + { + "name": "Optimize", + "switch": "optimize+", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "TreatWarningsAsErrors", + "switch": "warnaserror", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "TreatWarningsAsErrors", + "switch": "warnaserror-", + "comment": "", + "value": "false", + "flags": [] + }, + { + "name": "TreatWarningsAsErrors", + "switch": "warnaserror+", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "WarningsAsErrors", + "switch": "warnaserror", + "comment": "", + "value": "", + "flags": [] + }, + { + "name": "WarningsAsErrors", + "switch": "warnaserror-", + "comment": "", + "value": "", + "flags": [] + }, + { + "name": "WarningsAsErrors", + "switch": "warnaserror+", + "comment": "", + "value": "", + "flags": [] + }, + { + "name": "WarningLevel", + "switch": "warn:0", + "comment": "", + "value": "0", + "flags": [] + }, + { + "name": "WarningLevel", + "switch": "warn:1", + "comment": "", + "value": "1", + "flags": [] + }, + { + "name": "WarningLevel", + "switch": "warn:2", + "comment": "", + "value": "2", + "flags": [] + }, + { + "name": "WarningLevel", + "switch": "warn:3", + "comment": "", + "value": "3", + "flags": [] + }, + { + "name": "WarningLevel", + "switch": "warn:4", + "comment": "", + "value": "4", + "flags": [] + }, + { + "name": "DisabledWarnings", + "switch": "nowarn", + "comment": "", + "value": "", + "flags": [] + }, + { + "name": "CheckForOverflowUnderflow", + "switch": "checked", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "CheckForOverflowUnderflow", + "switch": "checked-", + "comment": "", + "value": "false", + "flags": [] + }, + { + "name": "CheckForOverflowUnderflow", + "switch": "checked+", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "AllowUnsafeBlocks", + "switch": "unsafe", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "AllowUnsafeBlocks", + "switch": "unsafe-", + "comment": "", + "value": "false", + "flags": [] + }, + { + "name": "AllowUnsafeBlocks", + "switch": "unsafe+", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "DefineConstants", + "switch": "define:", + "comment": "", + "value": "", + "flags": [ + "SemicolonAppendable", + "UserValue" + ] + }, + { + "name": "LangVersion", + "switch": "langversion:ISO-1", + "comment": "", + "value": "ISO-1", + "flags": [] + }, + { + "name": "LangVersion", + "switch": "langversion:ISO-2", + "comment": "", + "value": "ISO-2", + "flags": [] + }, + { + "name": "LangVersion", + "switch": "langversion:3", + "comment": "", + "value": "3", + "flags": [] + }, + { + "name": "LangVersion", + "switch": "langversion:4", + "comment": "", + "value": "4", + "flags": [] + }, + { + "name": "LangVersion", + "switch": "langversion:5", + "comment": "", + "value": "5", + "flags": [] + }, + { + "name": "LangVersion", + "switch": "langversion:6", + "comment": "", + "value": "6", + "flags": [] + }, + { + "name": "LangVersion", + "switch": "langversion:default", + "comment": "", + "value": "default", + "flags": [] + }, + { + "name": "DelaySign", + "switch": "delaysign", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "DelaySign", + "switch": "delaysign-", + "comment": "", + "value": "false", + "flags": [] + }, + { + "name": "DelaySign", + "switch": "delaysign+", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "AssemblyOriginatorKeyFile", + "switch": "keyfile", + "comment": "", + "value": "", + "flags": [] + }, + { + "name": "KeyContainerName", + "switch": "keycontainer", + "comment": "", + "value": "", + "flags": [] + }, + { + "name": "NoLogo", + "switch": "nologo", + "comment": "", + "value": "", + "flags": [] + }, + { + "name": "NoConfig", + "switch": "noconfig", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "BaseAddress", + "switch": "baseaddress:", + "comment": "", + "value": "", + "flags": [] + }, + { + "name": "CodePage", + "switch": "codepage", + "comment": "", + "value": "", + "flags": [] + }, + { + "name": "Utf8Output", + "switch": "utf8output", + "comment": "", + "value": "", + "flags": [] + }, + { + "name": "MainEntryPoint", + "switch": "main:", + "comment": "", + "value": "", + "flags": [] + }, + { + "name": "GenerateFullPaths", + "switch": "fullpaths", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "FileAlignment", + "switch": "filealign", + "comment": "", + "value": "", + "flags": [] + }, + { + "name": "PdbFile", + "switch": "pdb:", + "comment": "", + "value": "", + "flags": [] + }, + { + "name": "NoStandardLib", + "switch": "nostdlib", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "NoStandardLib", + "switch": "nostdlib-", + "comment": "", + "value": "false", + "flags": [] + }, + { + "name": "NoStandardLib", + "switch": "nostdlib+", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "SubsystemVersion", + "switch": "subsystemversion", + "comment": "", + "value": "", + "flags": [] + }, + { + "name": "AdditionalLibPaths", + "switch": "lib:", + "comment": "", + "value": "", + "flags": [] + }, + { + "name": "ErrorReport", + "switch": "errorreport:none", + "comment": "Do Not Send Report", + "value": "none", + "flags": [] + }, + { + "name": "ErrorReport", + "switch": "errorreport:prompt", + "comment": "Prompt Immediately", + "value": "prompt", + "flags": [] + }, + { + "name": "ErrorReport", + "switch": "errorreport:queue", + "comment": "Queue For Next Login", + "value": "queue", + "flags": [] + }, + { + "name": "ErrorReport", + "switch": "errorreport:send", + "comment": "Send Automatically", + "value": "send", + "flags": [] + } +] diff --git a/Templates/MSBuild/FlagTables/v140_Link.json b/Templates/MSBuild/FlagTables/v140_Link.json new file mode 100644 index 0000000..3fb072c --- /dev/null +++ b/Templates/MSBuild/FlagTables/v140_Link.json @@ -0,0 +1,1316 @@ +[ + { + "name": "ShowProgress", + "switch": "", + "comment": "Not Set", + "value": "NotSet", + "flags": [] + }, + { + "name": "ShowProgress", + "switch": "VERBOSE", + "comment": "Display all progress messages", + "value": "LinkVerbose", + "flags": [] + }, + { + "name": "ShowProgress", + "switch": "VERBOSE:Lib", + "comment": "For Libraries Searched", + "value": "LinkVerboseLib", + "flags": [] + }, + { + "name": "ShowProgress", + "switch": "VERBOSE:ICF", + "comment": "About COMDAT folding during optimized linking", + "value": "LinkVerboseICF", + "flags": [] + }, + { + "name": "ShowProgress", + "switch": "VERBOSE:REF", + "comment": "About data removed during optimized linking", + "value": "LinkVerboseREF", + "flags": [] + }, + { + "name": "ShowProgress", + "switch": "VERBOSE:SAFESEH", + "comment": "About Modules incompatible with SEH", + "value": "LinkVerboseSAFESEH", + "flags": [] + }, + { + "name": "ShowProgress", + "switch": "VERBOSE:CLR", + "comment": "About linker activity related to managed code", + "value": "LinkVerboseCLR", + "flags": [] + }, + { + "name": "ForceFileOutput", + "switch": "FORCE", + "comment": "Enabled", + "value": "Enabled", + "flags": [] + }, + { + "name": "ForceFileOutput", + "switch": "FORCE:MULTIPLE", + "comment": "Multiply Defined Symbol Only", + "value": "MultiplyDefinedSymbolOnly", + "flags": [] + }, + { + "name": "ForceFileOutput", + "switch": "FORCE:UNRESOLVED", + "comment": "Undefined Symbol Only", + "value": "UndefinedSymbolOnly", + "flags": [] + }, + { + "name": "CreateHotPatchableImage", + "switch": "FUNCTIONPADMIN", + "comment": "Enabled", + "value": "Enabled", + "flags": [] + }, + { + "name": "CreateHotPatchableImage", + "switch": "FUNCTIONPADMIN:5", + "comment": "X86 Image Only", + "value": "X86Image", + "flags": [] + }, + { + "name": "CreateHotPatchableImage", + "switch": "FUNCTIONPADMIN:6", + "comment": "X64 Image Only", + "value": "X64Image", + "flags": [] + }, + { + "name": "CreateHotPatchableImage", + "switch": "FUNCTIONPADMIN:16", + "comment": "Itanium Image Only", + "value": "ItaniumImage", + "flags": [] + }, + { + "name": "UACExecutionLevel", + "switch": "level='asInvoker'", + "comment": "asInvoker", + "value": "AsInvoker", + "flags": [] + }, + { + "name": "UACExecutionLevel", + "switch": "level='highestAvailable'", + "comment": "highestAvailable", + "value": "HighestAvailable", + "flags": [] + }, + { + "name": "UACExecutionLevel", + "switch": "level='requireAdministrator'", + "comment": "requireAdministrator", + "value": "RequireAdministrator", + "flags": [] + }, + { + "name": "GenerateDebugInformation", + "switch": "DEBUG", + "comment": "Optimize for debugging", + "value": "true", + "flags": [ + "CaseInsensitive" + ] + }, + { + "name": "GenerateDebugInformation", + "switch": "DEBUG:FASTLINK", + "comment": "Optimize for faster linking", + "value": "DebugFastLink", + "flags": [ + "CaseInsensitive" + ] + }, + { + "name": "GenerateDebugInformation", + "switch": "DEBUG:FULL", + "comment": "Optimize for debugging", + "value": "true", + "flags": [ + "CaseInsensitive" + ] + }, + { + "name": "GenerateDebugInformation", + "switch": "DEBUG:NONE", + "comment": "Produces no debugging information", + "value": "false", + "flags": [ + "CaseInsensitive" + ] + }, + { + "name": "SubSystem", + "switch": "", + "comment": "Not Set", + "value": "NotSet", + "flags": [] + }, + { + "name": "SubSystem", + "switch": "SUBSYSTEM:CONSOLE", + "comment": "Console", + "value": "Console", + "flags": [] + }, + { + "name": "SubSystem", + "switch": "SUBSYSTEM:WINDOWS", + "comment": "Windows", + "value": "Windows", + "flags": [] + }, + { + "name": "SubSystem", + "switch": "SUBSYSTEM:NATIVE", + "comment": "Native", + "value": "Native", + "flags": [] + }, + { + "name": "SubSystem", + "switch": "SUBSYSTEM:EFI_APPLICATION", + "comment": "EFI Application", + "value": "EFI Application", + "flags": [] + }, + { + "name": "SubSystem", + "switch": "SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER", + "comment": "EFI Boot Service Driver", + "value": "EFI Boot Service Driver", + "flags": [] + }, + { + "name": "SubSystem", + "switch": "SUBSYSTEM:EFI_ROM", + "comment": "EFI ROM", + "value": "EFI ROM", + "flags": [] + }, + { + "name": "SubSystem", + "switch": "SUBSYSTEM:EFI_RUNTIME_DRIVER", + "comment": "EFI Runtime", + "value": "EFI Runtime", + "flags": [] + }, + { + "name": "SubSystem", + "switch": "SUBSYSTEM:POSIX", + "comment": "POSIX", + "value": "POSIX", + "flags": [] + }, + { + "name": "Driver", + "switch": "", + "comment": "Not Set", + "value": "NotSet", + "flags": [] + }, + { + "name": "Driver", + "switch": "Driver", + "comment": "Driver", + "value": "Driver", + "flags": [] + }, + { + "name": "Driver", + "switch": "DRIVER:UPONLY", + "comment": "UP Only", + "value": "UpOnly", + "flags": [] + }, + { + "name": "Driver", + "switch": "DRIVER:WDM", + "comment": "WDM", + "value": "WDM", + "flags": [] + }, + { + "name": "LinkTimeCodeGeneration", + "switch": "", + "comment": "Default", + "value": "Default", + "flags": [] + }, + { + "name": "LinkTimeCodeGeneration", + "switch": "LTCG:incremental", + "comment": "Use Fast Link Time Code Generation", + "value": "UseFastLinkTimeCodeGeneration", + "flags": [] + }, + { + "name": "LinkTimeCodeGeneration", + "switch": "LTCG", + "comment": "Use Link Time Code Generation", + "value": "UseLinkTimeCodeGeneration", + "flags": [] + }, + { + "name": "LinkTimeCodeGeneration", + "switch": "LTCG:PGInstrument", + "comment": "Profile Guided Optimization - Instrument", + "value": "PGInstrument", + "flags": [] + }, + { + "name": "LinkTimeCodeGeneration", + "switch": "LTCG:PGOptimize", + "comment": "Profile Guided Optimization - Optimization", + "value": "PGOptimization", + "flags": [] + }, + { + "name": "LinkTimeCodeGeneration", + "switch": "LTCG:PGUpdate", + "comment": "Profile Guided Optimization - Update", + "value": "PGUpdate", + "flags": [] + }, + { + "name": "GenerateWindowsMetadata", + "switch": "WINMD", + "comment": "Yes", + "value": "true", + "flags": [] + }, + { + "name": "GenerateWindowsMetadata", + "switch": "WINMD:NO", + "comment": "No", + "value": "false", + "flags": [] + }, + { + "name": "WindowsMetadataSignHash", + "switch": "WINMDSIGNHASH:SHA1", + "comment": "SHA1", + "value": "SHA1", + "flags": [] + }, + { + "name": "WindowsMetadataSignHash", + "switch": "WINMDSIGNHASH:SHA256", + "comment": "SHA256", + "value": "SHA256", + "flags": [] + }, + { + "name": "WindowsMetadataSignHash", + "switch": "WINMDSIGNHASH:SHA384", + "comment": "SHA384", + "value": "SHA384", + "flags": [] + }, + { + "name": "WindowsMetadataSignHash", + "switch": "WINMDSIGNHASH:SHA512", + "comment": "SHA512", + "value": "SHA512", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "", + "comment": "Not Set", + "value": "NotSet", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:ARM", + "comment": "MachineARM", + "value": "MachineARM", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:EBC", + "comment": "MachineEBC", + "value": "MachineEBC", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:IA64", + "comment": "MachineIA64", + "value": "MachineIA64", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:MIPS", + "comment": "MachineMIPS", + "value": "MachineMIPS", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:MIPS16", + "comment": "MachineMIPS16", + "value": "MachineMIPS16", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:MIPSFPU", + "comment": "MachineMIPSFPU", + "value": "MachineMIPSFPU", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:MIPSFPU16", + "comment": "MachineMIPSFPU16", + "value": "MachineMIPSFPU16", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:SH4", + "comment": "MachineSH4", + "value": "MachineSH4", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:THUMB", + "comment": "MachineTHUMB", + "value": "MachineTHUMB", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:X64", + "comment": "MachineX64", + "value": "MachineX64", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:X86", + "comment": "MachineX86", + "value": "MachineX86", + "flags": [] + }, + { + "name": "CLRThreadAttribute", + "switch": "CLRTHREADATTRIBUTE:MTA", + "comment": "MTA threading attribute", + "value": "MTAThreadingAttribute", + "flags": [] + }, + { + "name": "CLRThreadAttribute", + "switch": "CLRTHREADATTRIBUTE:STA", + "comment": "STA threading attribute", + "value": "STAThreadingAttribute", + "flags": [] + }, + { + "name": "CLRThreadAttribute", + "switch": "CLRTHREADATTRIBUTE:NONE", + "comment": "Default threading attribute", + "value": "DefaultThreadingAttribute", + "flags": [] + }, + { + "name": "CLRImageType", + "switch": "CLRIMAGETYPE:IJW", + "comment": "Force IJW image", + "value": "ForceIJWImage", + "flags": [] + }, + { + "name": "CLRImageType", + "switch": "CLRIMAGETYPE:PURE", + "comment": "Force Pure IL Image", + "value": "ForcePureILImage", + "flags": [] + }, + { + "name": "CLRImageType", + "switch": "CLRIMAGETYPE:SAFE", + "comment": "Force Safe IL Image", + "value": "ForceSafeILImage", + "flags": [] + }, + { + "name": "CLRImageType", + "switch": "", + "comment": "Default image type", + "value": "Default", + "flags": [] + }, + { + "name": "SignHash", + "switch": "CLRSIGNHASH:SHA1", + "comment": "SHA1", + "value": "SHA1", + "flags": [] + }, + { + "name": "SignHash", + "switch": "CLRSIGNHASH:SHA256", + "comment": "SHA256", + "value": "SHA256", + "flags": [] + }, + { + "name": "SignHash", + "switch": "CLRSIGNHASH:SHA384", + "comment": "SHA384", + "value": "SHA384", + "flags": [] + }, + { + "name": "SignHash", + "switch": "CLRSIGNHASH:SHA512", + "comment": "SHA512", + "value": "SHA512", + "flags": [] + }, + { + "name": "LinkErrorReporting", + "switch": "ERRORREPORT:PROMPT", + "comment": "PromptImmediately", + "value": "PromptImmediately", + "flags": [] + }, + { + "name": "LinkErrorReporting", + "switch": "ERRORREPORT:QUEUE", + "comment": "Queue For Next Login", + "value": "QueueForNextLogin", + "flags": [] + }, + { + "name": "LinkErrorReporting", + "switch": "ERRORREPORT:SEND", + "comment": "Send Error Report", + "value": "SendErrorReport", + "flags": [] + }, + { + "name": "LinkErrorReporting", + "switch": "ERRORREPORT:NONE", + "comment": "No Error Report", + "value": "NoErrorReport", + "flags": [] + }, + { + "name": "CLRSupportLastError", + "switch": "CLRSupportLastError", + "comment": "Enabled", + "value": "Enabled", + "flags": [] + }, + { + "name": "CLRSupportLastError", + "switch": "CLRSupportLastError:NO", + "comment": "Disabled", + "value": "Disabled", + "flags": [] + }, + { + "name": "CLRSupportLastError", + "switch": "CLRSupportLastError:SYSTEMDLL", + "comment": "System Dlls Only", + "value": "SystemDlls", + "flags": [] + }, + { + "name": "LinkIncremental", + "switch": "INCREMENTAL:NO", + "comment": "Enable Incremental Linking", + "value": "false", + "flags": [] + }, + { + "name": "LinkIncremental", + "switch": "INCREMENTAL", + "comment": "Enable Incremental Linking", + "value": "true", + "flags": [] + }, + { + "name": "SuppressStartupBanner", + "switch": "NOLOGO", + "comment": "Suppress Startup Banner", + "value": "true", + "flags": [] + }, + { + "name": "LinkStatus", + "switch": "LTCG:NOSTATUS", + "comment": "Link Status", + "value": "false", + "flags": [] + }, + { + "name": "LinkStatus", + "switch": "LTCG:STATUS", + "comment": "Link Status", + "value": "true", + "flags": [] + }, + { + "name": "PreventDllBinding", + "switch": "ALLOWBIND:NO", + "comment": "Prevent Dll Binding", + "value": "false", + "flags": [] + }, + { + "name": "PreventDllBinding", + "switch": "ALLOWBIND", + "comment": "Prevent Dll Binding", + "value": "true", + "flags": [] + }, + { + "name": "TreatLinkerWarningAsErrors", + "switch": "WX:NO", + "comment": "Treat Linker Warning As Errors", + "value": "false", + "flags": [] + }, + { + "name": "TreatLinkerWarningAsErrors", + "switch": "WX", + "comment": "Treat Linker Warning As Errors", + "value": "true", + "flags": [] + }, + { + "name": "IgnoreAllDefaultLibraries", + "switch": "NODEFAULTLIB", + "comment": "Ignore All Default Libraries", + "value": "true", + "flags": [] + }, + { + "name": "GenerateManifest", + "switch": "MANIFEST:NO", + "comment": "Generate Manifest", + "value": "false", + "flags": [] + }, + { + "name": "GenerateManifest", + "switch": "MANIFEST", + "comment": "Generate Manifest", + "value": "true", + "flags": [] + }, + { + "name": "AllowIsolation", + "switch": "ALLOWISOLATION:NO", + "comment": "Allow Isolation", + "value": "false", + "flags": [] + }, + { + "name": "AllowIsolation", + "switch": "", + "comment": "Allow Isolation", + "value": "true", + "flags": [] + }, + { + "name": "EnableUAC", + "switch": "MANIFESTUAC:", + "comment": "", + "value": "", + "flags": [ + "UserValue", + "UserRequired", + "SpaceAppendable" + ] + }, + { + "name": "UACUIAccess", + "switch": "uiAccess='false'", + "comment": "UAC Bypass UI Protection", + "value": "false", + "flags": [ + "UserValue", + "UserRequired" + ] + }, + { + "name": "UACUIAccess", + "switch": "uiAccess='false'", + "comment": "UAC Bypass UI Protection", + "value": "false", + "flags": [] + }, + { + "name": "UACUIAccess", + "switch": "uiAccess='true'", + "comment": "UAC Bypass UI Protection", + "value": "true", + "flags": [] + }, + { + "name": "ManifestEmbed", + "switch": "manifest:embed", + "comment": "Embed Manifest", + "value": "true", + "flags": [] + }, + { + "name": "GenerateMapFile", + "switch": "MAP", + "comment": "Generate Map File", + "value": "true", + "flags": [ + "UserValue", + "UserIgnored", + "Continue" + ] + }, + { + "name": "MapExports", + "switch": "MAPINFO:EXPORTS", + "comment": "Map Exports", + "value": "true", + "flags": [] + }, + { + "name": "AssemblyDebug", + "switch": "ASSEMBLYDEBUG:DISABLE", + "comment": "Debuggable Assembly", + "value": "false", + "flags": [] + }, + { + "name": "AssemblyDebug", + "switch": "ASSEMBLYDEBUG", + "comment": "Debuggable Assembly", + "value": "true", + "flags": [] + }, + { + "name": "LargeAddressAware", + "switch": "LARGEADDRESSAWARE:NO", + "comment": "Enable Large Addresses", + "value": "false", + "flags": [] + }, + { + "name": "LargeAddressAware", + "switch": "LARGEADDRESSAWARE", + "comment": "Enable Large Addresses", + "value": "true", + "flags": [] + }, + { + "name": "TerminalServerAware", + "switch": "TSAWARE:NO", + "comment": "Terminal Server", + "value": "false", + "flags": [] + }, + { + "name": "TerminalServerAware", + "switch": "TSAWARE", + "comment": "Terminal Server", + "value": "true", + "flags": [] + }, + { + "name": "SwapRunFromCD", + "switch": "SWAPRUN:CD", + "comment": "Swap Run From CD", + "value": "true", + "flags": [] + }, + { + "name": "SwapRunFromNET", + "switch": "SWAPRUN:NET", + "comment": "Swap Run From Network", + "value": "true", + "flags": [] + }, + { + "name": "OptimizeReferences", + "switch": "OPT:NOREF", + "comment": "References", + "value": "false", + "flags": [] + }, + { + "name": "OptimizeReferences", + "switch": "OPT:REF", + "comment": "References", + "value": "true", + "flags": [] + }, + { + "name": "EnableCOMDATFolding", + "switch": "OPT:NOICF", + "comment": "Enable COMDAT Folding", + "value": "false", + "flags": [] + }, + { + "name": "EnableCOMDATFolding", + "switch": "OPT:ICF", + "comment": "Enable COMDAT Folding", + "value": "true", + "flags": [] + }, + { + "name": "IgnoreEmbeddedIDL", + "switch": "IGNOREIDL", + "comment": "Ignore Embedded IDL", + "value": "true", + "flags": [] + }, + { + "name": "AppContainer", + "switch": "APPCONTAINER", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "WindowsMetadataLinkDelaySign", + "switch": "WINMDDELAYSIGN:NO", + "comment": "Windows Metadata Delay Sign", + "value": "false", + "flags": [] + }, + { + "name": "WindowsMetadataLinkDelaySign", + "switch": "WINMDDELAYSIGN", + "comment": "Windows Metadata Delay Sign", + "value": "true", + "flags": [] + }, + { + "name": "NoEntryPoint", + "switch": "NOENTRY", + "comment": "No Entry Point", + "value": "true", + "flags": [] + }, + { + "name": "SetChecksum", + "switch": "RELEASE", + "comment": "Set Checksum", + "value": "true", + "flags": [] + }, + { + "name": "RandomizedBaseAddress", + "switch": "DYNAMICBASE:NO", + "comment": "Randomized Base Address", + "value": "false", + "flags": [] + }, + { + "name": "RandomizedBaseAddress", + "switch": "DYNAMICBASE", + "comment": "Randomized Base Address", + "value": "true", + "flags": [] + }, + { + "name": "FixedBaseAddress", + "switch": "FIXED:NO", + "comment": "Fixed Base Address", + "value": "false", + "flags": [] + }, + { + "name": "FixedBaseAddress", + "switch": "FIXED", + "comment": "Fixed Base Address", + "value": "true", + "flags": [] + }, + { + "name": "DataExecutionPrevention", + "switch": "NXCOMPAT:NO", + "comment": "Data Execution Prevention (DEP)", + "value": "false", + "flags": [] + }, + { + "name": "DataExecutionPrevention", + "switch": "NXCOMPAT", + "comment": "Data Execution Prevention (DEP)", + "value": "true", + "flags": [] + }, + { + "name": "TurnOffAssemblyGeneration", + "switch": "NOASSEMBLY", + "comment": "Turn Off Assembly Generation", + "value": "true", + "flags": [] + }, + { + "name": "SupportUnloadOfDelayLoadedDLL", + "switch": "DELAY:UNLOAD", + "comment": "Unload delay loaded DLL", + "value": "true", + "flags": [] + }, + { + "name": "SupportNobindOfDelayLoadedDLL", + "switch": "DELAY:NOBIND", + "comment": "Nobind delay loaded DLL", + "value": "true", + "flags": [] + }, + { + "name": "Profile", + "switch": "PROFILE", + "comment": "Profile", + "value": "true", + "flags": [] + }, + { + "name": "LinkDelaySign", + "switch": "DELAYSIGN:NO", + "comment": "Delay Sign", + "value": "false", + "flags": [] + }, + { + "name": "LinkDelaySign", + "switch": "DELAYSIGN", + "comment": "Delay Sign", + "value": "true", + "flags": [] + }, + { + "name": "CLRUnmanagedCodeCheck", + "switch": "CLRUNMANAGEDCODECHECK:NO", + "comment": "CLR Unmanaged Code Check", + "value": "false", + "flags": [] + }, + { + "name": "CLRUnmanagedCodeCheck", + "switch": "CLRUNMANAGEDCODECHECK", + "comment": "CLR Unmanaged Code Check", + "value": "true", + "flags": [] + }, + { + "name": "DetectOneDefinitionRule", + "switch": "ODR", + "comment": "Detect One Definition Rule violations", + "value": "true", + "flags": [] + }, + { + "name": "ImageHasSafeExceptionHandlers", + "switch": "SAFESEH:NO", + "comment": "Image Has Safe Exception Handlers", + "value": "false", + "flags": [] + }, + { + "name": "ImageHasSafeExceptionHandlers", + "switch": "SAFESEH", + "comment": "Image Has Safe Exception Handlers", + "value": "true", + "flags": [] + }, + { + "name": "LinkDLL", + "switch": "DLL", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "AdditionalLibraryDirectories", + "switch": "LIBPATH:", + "comment": "Additional Library Directories", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "Natvis", + "switch": "NATVIS:", + "comment": "Natvis files", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "IgnoreSpecificDefaultLibraries", + "switch": "NODEFAULTLIB:", + "comment": "Ignore Specific Default Libraries", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "AddModuleNamesToAssembly", + "switch": "ASSEMBLYMODULE:", + "comment": "Add Module to Assembly", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "EmbedManagedResourceFile", + "switch": "ASSEMBLYRESOURCE:", + "comment": "Embed Managed Resource File", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "ForceSymbolReferences", + "switch": "INCLUDE:", + "comment": "Force Symbol References", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "DelayLoadDLLs", + "switch": "DELAYLOAD:", + "comment": "Delay Loaded Dlls", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "AssemblyLinkResource", + "switch": "ASSEMBLYLINKRESOURCE:", + "comment": "Assembly Link Resource", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "AdditionalManifestDependencies", + "switch": "MANIFESTDEPENDENCY:", + "comment": "Additional Manifest Dependencies", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "ManifestInput", + "switch": "manifestinput:", + "comment": "Manifest Input", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "OutputFile", + "switch": "OUT:", + "comment": "Output File", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "Version", + "switch": "VERSION:", + "comment": "Version", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "SpecifySectionAttributes", + "switch": "SECTION:", + "comment": "Specify Section Attributes", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "MSDOSStubFileName", + "switch": "STUB:", + "comment": "MS-DOS Stub File Name", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "ModuleDefinitionFile", + "switch": "DEF:", + "comment": "Module Definition File", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "ManifestFile", + "switch": "ManifestFile:", + "comment": "Manifest File", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "ProgramDatabaseFile", + "switch": "PDB:", + "comment": "Generate Program Database File", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "StripPrivateSymbols", + "switch": "PDBSTRIPPED:", + "comment": "Strip Private Symbols", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "MapFileName", + "switch": "MAP:", + "comment": "Map File Name", + "value": "", + "flags": [ + "UserValue", + "UserRequired" + ] + }, + { + "name": "HeapReserveSize", + "switch": "HEAP:", + "comment": "Heap Reserve Size", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "HeapCommitSize", + "switch": "HEAP", + "comment": "Heap Commit Size", + "value": "", + "flags": [ + "UserValue", + "UserRequired" + ] + }, + { + "name": "StackReserveSize", + "switch": "STACK:", + "comment": "Stack Reserve Size", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "StackCommitSize", + "switch": "STACK", + "comment": "Stack Commit Size", + "value": "", + "flags": [ + "UserValue", + "UserRequired" + ] + }, + { + "name": "FunctionOrder", + "switch": "ORDER:@", + "comment": "Function Order", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "ProfileGuidedDatabase", + "switch": "PGD:", + "comment": "Profile Guided Database", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "MidlCommandFile", + "switch": "MIDL:@", + "comment": "MIDL Commands", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "MergedIDLBaseFileName", + "switch": "IDLOUT:", + "comment": "Merged IDL Base File Name", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "TypeLibraryFile", + "switch": "TLBOUT:", + "comment": "Type Library", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "WindowsMetadataFile", + "switch": "WINMDFILE:", + "comment": "Windows Metadata File", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "WindowsMetadataLinkKeyFile", + "switch": "WINMDKEYFILE:", + "comment": "Windows Metadata Key File", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "WindowsMetadataKeyContainer", + "switch": "WINMDKEYCONTAINER:", + "comment": "Windows Metadata Key Container", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "EntryPointSymbol", + "switch": "ENTRY:", + "comment": "Entry Point", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "BaseAddress", + "switch": "BASE:", + "comment": "Base Address", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "ImportLibrary", + "switch": "IMPLIB:", + "comment": "Import Library", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "MergeSections", + "switch": "MERGE:", + "comment": "Merge Sections", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "LinkKeyFile", + "switch": "KEYFILE:", + "comment": "Key File", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "KeyContainer", + "switch": "KEYCONTAINER:", + "comment": "Key Container", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "TypeLibraryResourceID", + "switch": "TLBID:", + "comment": "TypeLib Resource ID", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "SectionAlignment", + "switch": "ALIGN:", + "comment": "SectionAlignment", + "value": "", + "flags": [ + "UserValue" + ] + } +] diff --git a/Templates/MSBuild/FlagTables/v141_CL.json b/Templates/MSBuild/FlagTables/v141_CL.json new file mode 100644 index 0000000..01fafe4 --- /dev/null +++ b/Templates/MSBuild/FlagTables/v141_CL.json @@ -0,0 +1,1268 @@ +[ + { + "name": "DebugInformationFormat", + "switch": "", + "comment": "None", + "value": "None", + "flags": [] + }, + { + "name": "DebugInformationFormat", + "switch": "Z7", + "comment": "C7 compatible", + "value": "OldStyle", + "flags": [] + }, + { + "name": "DebugInformationFormat", + "switch": "Zi", + "comment": "Program Database", + "value": "ProgramDatabase", + "flags": [] + }, + { + "name": "DebugInformationFormat", + "switch": "ZI", + "comment": "Program Database for Edit And Continue", + "value": "EditAndContinue", + "flags": [] + }, + { + "name": "CompileAsManaged", + "switch": "", + "comment": "No Common Language RunTime Support", + "value": "false", + "flags": [] + }, + { + "name": "CompileAsManaged", + "switch": "clr", + "comment": "Common Language RunTime Support", + "value": "true", + "flags": [] + }, + { + "name": "CompileAsManaged", + "switch": "clr:pure", + "comment": "Pure MSIL Common Language RunTime Support", + "value": "Pure", + "flags": [] + }, + { + "name": "CompileAsManaged", + "switch": "clr:safe", + "comment": "Safe MSIL Common Language RunTime Support", + "value": "Safe", + "flags": [] + }, + { + "name": "WarningLevel", + "switch": "W0", + "comment": "Turn Off All Warnings", + "value": "TurnOffAllWarnings", + "flags": [] + }, + { + "name": "WarningLevel", + "switch": "W1", + "comment": "Level1", + "value": "Level1", + "flags": [] + }, + { + "name": "WarningLevel", + "switch": "W2", + "comment": "Level2", + "value": "Level2", + "flags": [] + }, + { + "name": "WarningLevel", + "switch": "W3", + "comment": "Level3", + "value": "Level3", + "flags": [] + }, + { + "name": "WarningLevel", + "switch": "W4", + "comment": "Level4", + "value": "Level4", + "flags": [] + }, + { + "name": "WarningLevel", + "switch": "Wall", + "comment": "EnableAllWarnings", + "value": "EnableAllWarnings", + "flags": [] + }, + { + "name": "DiagnosticsFormat", + "switch": "diagnostics:caret", + "comment": "Caret", + "value": "Caret", + "flags": [] + }, + { + "name": "DiagnosticsFormat", + "switch": "diagnostics:column", + "comment": "Column Info", + "value": "Column", + "flags": [] + }, + { + "name": "DiagnosticsFormat", + "switch": "diagnostics:classic", + "comment": "Classic", + "value": "Classic", + "flags": [] + }, + { + "name": "Optimization", + "switch": "", + "comment": "Custom", + "value": "Custom", + "flags": [] + }, + { + "name": "Optimization", + "switch": "Od", + "comment": "Disabled", + "value": "Disabled", + "flags": [] + }, + { + "name": "Optimization", + "switch": "O1", + "comment": "Maximum Optimization (Favor Size)", + "value": "MinSpace", + "flags": [] + }, + { + "name": "Optimization", + "switch": "O2", + "comment": "Maximum Optimization (Favor Speed)", + "value": "MaxSpeed", + "flags": [] + }, + { + "name": "Optimization", + "switch": "Ox", + "comment": "Optimizations (Favor Speed)", + "value": "Full", + "flags": [] + }, + { + "name": "InlineFunctionExpansion", + "switch": "", + "comment": "Default", + "value": "Default", + "flags": [] + }, + { + "name": "InlineFunctionExpansion", + "switch": "Ob0", + "comment": "Disabled", + "value": "Disabled", + "flags": [] + }, + { + "name": "InlineFunctionExpansion", + "switch": "Ob1", + "comment": "Only __inline", + "value": "OnlyExplicitInline", + "flags": [] + }, + { + "name": "InlineFunctionExpansion", + "switch": "Ob2", + "comment": "Any Suitable", + "value": "AnySuitable", + "flags": [] + }, + { + "name": "FavorSizeOrSpeed", + "switch": "Os", + "comment": "Favor small code", + "value": "Size", + "flags": [] + }, + { + "name": "FavorSizeOrSpeed", + "switch": "Ot", + "comment": "Favor fast code", + "value": "Speed", + "flags": [] + }, + { + "name": "FavorSizeOrSpeed", + "switch": "", + "comment": "Neither", + "value": "Neither", + "flags": [] + }, + { + "name": "ExceptionHandling", + "switch": "EHa", + "comment": "Yes with SEH Exceptions", + "value": "Async", + "flags": [] + }, + { + "name": "ExceptionHandling", + "switch": "EHsc", + "comment": "Yes", + "value": "Sync", + "flags": [] + }, + { + "name": "ExceptionHandling", + "switch": "EHs", + "comment": "Yes with Extern C functions", + "value": "SyncCThrow", + "flags": [] + }, + { + "name": "ExceptionHandling", + "switch": "", + "comment": "No", + "value": "false", + "flags": [] + }, + { + "name": "BasicRuntimeChecks", + "switch": "RTCs", + "comment": "Stack Frames", + "value": "StackFrameRuntimeCheck", + "flags": [] + }, + { + "name": "BasicRuntimeChecks", + "switch": "RTCu", + "comment": "Uninitialized variables", + "value": "UninitializedLocalUsageCheck", + "flags": [] + }, + { + "name": "BasicRuntimeChecks", + "switch": "RTC1", + "comment": "Both (/RTC1, equiv. to /RTCsu)", + "value": "EnableFastChecks", + "flags": [] + }, + { + "name": "BasicRuntimeChecks", + "switch": "", + "comment": "Default", + "value": "Default", + "flags": [] + }, + { + "name": "RuntimeLibrary", + "switch": "MT", + "comment": "Multi-threaded", + "value": "MultiThreaded", + "flags": [] + }, + { + "name": "RuntimeLibrary", + "switch": "MTd", + "comment": "Multi-threaded Debug", + "value": "MultiThreadedDebug", + "flags": [] + }, + { + "name": "RuntimeLibrary", + "switch": "MD", + "comment": "Multi-threaded DLL", + "value": "MultiThreadedDLL", + "flags": [] + }, + { + "name": "RuntimeLibrary", + "switch": "MDd", + "comment": "Multi-threaded Debug DLL", + "value": "MultiThreadedDebugDLL", + "flags": [] + }, + { + "name": "StructMemberAlignment", + "switch": "Zp1", + "comment": "1 Byte", + "value": "1Byte", + "flags": [] + }, + { + "name": "StructMemberAlignment", + "switch": "Zp2", + "comment": "2 Bytes", + "value": "2Bytes", + "flags": [] + }, + { + "name": "StructMemberAlignment", + "switch": "Zp4", + "comment": "4 Byte", + "value": "4Bytes", + "flags": [] + }, + { + "name": "StructMemberAlignment", + "switch": "Zp8", + "comment": "8 Bytes", + "value": "8Bytes", + "flags": [] + }, + { + "name": "StructMemberAlignment", + "switch": "Zp16", + "comment": "16 Bytes", + "value": "16Bytes", + "flags": [] + }, + { + "name": "StructMemberAlignment", + "switch": "", + "comment": "Default", + "value": "Default", + "flags": [] + }, + { + "name": "BufferSecurityCheck", + "switch": "GS-", + "comment": "Disable Security Check", + "value": "false", + "flags": [] + }, + { + "name": "BufferSecurityCheck", + "switch": "GS", + "comment": "Enable Security Check", + "value": "true", + "flags": [] + }, + { + "name": "ControlFlowGuard", + "switch": "guard:cf", + "comment": "Yes", + "value": "Guard", + "flags": [] + }, + { + "name": "ControlFlowGuard", + "switch": "", + "comment": "No", + "value": "false", + "flags": [] + }, + { + "name": "EnableEnhancedInstructionSet", + "switch": "arch:SSE", + "comment": "Streaming SIMD Extensions", + "value": "StreamingSIMDExtensions", + "flags": [] + }, + { + "name": "EnableEnhancedInstructionSet", + "switch": "arch:SSE2", + "comment": "Streaming SIMD Extensions 2", + "value": "StreamingSIMDExtensions2", + "flags": [] + }, + { + "name": "EnableEnhancedInstructionSet", + "switch": "arch:AVX", + "comment": "Advanced Vector Extensions", + "value": "AdvancedVectorExtensions", + "flags": [] + }, + { + "name": "EnableEnhancedInstructionSet", + "switch": "arch:AVX2", + "comment": "Advanced Vector Extensions 2", + "value": "AdvancedVectorExtensions2", + "flags": [] + }, + { + "name": "EnableEnhancedInstructionSet", + "switch": "arch:IA32", + "comment": "No Enhanced Instructions", + "value": "NoExtensions", + "flags": [] + }, + { + "name": "EnableEnhancedInstructionSet", + "switch": "", + "comment": "Not Set", + "value": "NotSet", + "flags": [] + }, + { + "name": "FloatingPointModel", + "switch": "fp:precise", + "comment": "Precise", + "value": "Precise", + "flags": [] + }, + { + "name": "FloatingPointModel", + "switch": "fp:strict", + "comment": "Strict", + "value": "Strict", + "flags": [] + }, + { + "name": "FloatingPointModel", + "switch": "fp:fast", + "comment": "Fast", + "value": "Fast", + "flags": [] + }, + { + "name": "SpectreMitigation", + "switch": "Qspectre", + "comment": "Spectre mitigations", + "value": "Spectre", + "flags": [] + }, + { + "name": "LanguageStandard", + "switch": "std:c++14", + "comment": "ISO C++14 Standard", + "value": "stdcpp14", + "flags": [] + }, + { + "name": "LanguageStandard", + "switch": "std:c++17", + "comment": "ISO C++17 Standard", + "value": "stdcpp17", + "flags": [] + }, + { + "name": "LanguageStandard", + "switch": "std:c++latest", + "comment": "ISO C++ Latest Draft Standard", + "value": "stdcpplatest", + "flags": [] + }, + { + "name": "PrecompiledHeader", + "switch": "Yc", + "comment": "Create", + "value": "Create", + "flags": [ + "UserValue", + "UserIgnored", + "Continue" + ] + }, + { + "name": "PrecompiledHeader", + "switch": "Yu", + "comment": "Use", + "value": "Use", + "flags": [ + "UserValue", + "UserIgnored", + "Continue" + ] + }, + { + "name": "PrecompiledHeader", + "switch": "Y-", + "comment": "Not Using Precompiled Headers", + "value": "NotUsing", + "flags": [] + }, + { + "name": "AssemblerOutput", + "switch": "", + "comment": "No Listing", + "value": "NoListing", + "flags": [] + }, + { + "name": "AssemblerOutput", + "switch": "FA", + "comment": "Assembly-Only Listing", + "value": "AssemblyCode", + "flags": [] + }, + { + "name": "AssemblerOutput", + "switch": "FAc", + "comment": "Assembly With Machine Code", + "value": "AssemblyAndMachineCode", + "flags": [] + }, + { + "name": "AssemblerOutput", + "switch": "FAs", + "comment": "Assembly With Source Code", + "value": "AssemblyAndSourceCode", + "flags": [] + }, + { + "name": "AssemblerOutput", + "switch": "FAcs", + "comment": "Assembly, Machine Code and Source", + "value": "All", + "flags": [] + }, + { + "name": "CallingConvention", + "switch": "Gd", + "comment": "__cdecl", + "value": "Cdecl", + "flags": [] + }, + { + "name": "CallingConvention", + "switch": "Gr", + "comment": "__fastcall", + "value": "FastCall", + "flags": [] + }, + { + "name": "CallingConvention", + "switch": "Gz", + "comment": "__stdcall", + "value": "StdCall", + "flags": [] + }, + { + "name": "CallingConvention", + "switch": "Gv", + "comment": "__vectorcall", + "value": "VectorCall", + "flags": [] + }, + { + "name": "CompileAs", + "switch": "", + "comment": "Default", + "value": "Default", + "flags": [] + }, + { + "name": "CompileAs", + "switch": "TC", + "comment": "Compile as C Code", + "value": "CompileAsC", + "flags": [] + }, + { + "name": "CompileAs", + "switch": "TP", + "comment": "Compile as C++ Code", + "value": "CompileAsCpp", + "flags": [] + }, + { + "name": "ErrorReporting", + "switch": "errorReport:none", + "comment": "Do Not Send Report", + "value": "None", + "flags": [] + }, + { + "name": "ErrorReporting", + "switch": "errorReport:prompt", + "comment": "Prompt Immediately", + "value": "Prompt", + "flags": [] + }, + { + "name": "ErrorReporting", + "switch": "errorReport:queue", + "comment": "Queue For Next Login", + "value": "Queue", + "flags": [] + }, + { + "name": "ErrorReporting", + "switch": "errorReport:send", + "comment": "Send Automatically", + "value": "Send", + "flags": [] + }, + { + "name": "CompileAsWinRT", + "switch": "ZW", + "comment": "Consume Windows Runtime Extension", + "value": "true", + "flags": [] + }, + { + "name": "WinRTNoStdLib", + "switch": "ZW:nostdlib", + "comment": "No Standard WinRT Libraries", + "value": "true", + "flags": [] + }, + { + "name": "SuppressStartupBanner", + "switch": "nologo", + "comment": "Suppress Startup Banner", + "value": "true", + "flags": [] + }, + { + "name": "TreatWarningAsError", + "switch": "WX-", + "comment": "Treat Warnings As Errors", + "value": "false", + "flags": [] + }, + { + "name": "TreatWarningAsError", + "switch": "WX", + "comment": "Treat Warnings As Errors", + "value": "true", + "flags": [] + }, + { + "name": "SDLCheck", + "switch": "sdl-", + "comment": "SDL checks", + "value": "false", + "flags": [] + }, + { + "name": "SDLCheck", + "switch": "sdl", + "comment": "SDL checks", + "value": "true", + "flags": [] + }, + { + "name": "MultiProcessorCompilation", + "switch": "MP", + "comment": "Multi-processor Compilation", + "value": "true", + "flags": [ + "UserValue", + "UserIgnored", + "Continue" + ] + }, + { + "name": "IntrinsicFunctions", + "switch": "Oi", + "comment": "Enable Intrinsic Functions", + "value": "true", + "flags": [] + }, + { + "name": "OmitFramePointers", + "switch": "Oy-", + "comment": "Omit Frame Pointers", + "value": "false", + "flags": [] + }, + { + "name": "OmitFramePointers", + "switch": "Oy", + "comment": "Omit Frame Pointers", + "value": "true", + "flags": [] + }, + { + "name": "EnableFiberSafeOptimizations", + "switch": "GT", + "comment": "Enable Fiber-Safe Optimizations", + "value": "true", + "flags": [] + }, + { + "name": "WholeProgramOptimization", + "switch": "GL", + "comment": "Whole Program Optimization", + "value": "true", + "flags": [] + }, + { + "name": "UndefineAllPreprocessorDefinitions", + "switch": "u", + "comment": "Undefine All Preprocessor Definitions", + "value": "true", + "flags": [] + }, + { + "name": "IgnoreStandardIncludePath", + "switch": "X", + "comment": "Ignore Standard Include Paths", + "value": "true", + "flags": [] + }, + { + "name": "PreprocessToFile", + "switch": "P", + "comment": "Preprocess to a File", + "value": "true", + "flags": [] + }, + { + "name": "PreprocessSuppressLineNumbers", + "switch": "EP", + "comment": "Preprocess Suppress Line Numbers", + "value": "true", + "flags": [] + }, + { + "name": "PreprocessKeepComments", + "switch": "C", + "comment": "Keep Comments", + "value": "true", + "flags": [] + }, + { + "name": "StringPooling", + "switch": "GF-", + "comment": "Enable String Pooling", + "value": "false", + "flags": [] + }, + { + "name": "StringPooling", + "switch": "GF", + "comment": "Enable String Pooling", + "value": "true", + "flags": [] + }, + { + "name": "MinimalRebuild", + "switch": "Gm-", + "comment": "Enable Minimal Rebuild", + "value": "false", + "flags": [] + }, + { + "name": "MinimalRebuild", + "switch": "Gm", + "comment": "Enable Minimal Rebuild", + "value": "true", + "flags": [] + }, + { + "name": "SmallerTypeCheck", + "switch": "RTCc", + "comment": "Smaller Type Check", + "value": "true", + "flags": [] + }, + { + "name": "FunctionLevelLinking", + "switch": "Gy-", + "comment": "Enable Function-Level Linking", + "value": "false", + "flags": [] + }, + { + "name": "FunctionLevelLinking", + "switch": "Gy", + "comment": "Enable Function-Level Linking", + "value": "true", + "flags": [] + }, + { + "name": "EnableParallelCodeGeneration", + "switch": "Qpar-", + "comment": "Enable Parallel Code Generation", + "value": "false", + "flags": [] + }, + { + "name": "EnableParallelCodeGeneration", + "switch": "Qpar", + "comment": "Enable Parallel Code Generation", + "value": "true", + "flags": [] + }, + { + "name": "FloatingPointExceptions", + "switch": "fp:except-", + "comment": "Enable Floating Point Exceptions", + "value": "false", + "flags": [] + }, + { + "name": "FloatingPointExceptions", + "switch": "fp:except", + "comment": "Enable Floating Point Exceptions", + "value": "true", + "flags": [] + }, + { + "name": "CreateHotpatchableImage", + "switch": "hotpatch", + "comment": "Create Hotpatchable Image", + "value": "true", + "flags": [] + }, + { + "name": "DisableLanguageExtensions", + "switch": "Za", + "comment": "Disable Language Extensions", + "value": "true", + "flags": [] + }, + { + "name": "ConformanceMode", + "switch": "permissive-", + "comment": "Conformance mode enabled", + "value": "true", + "flags": [] + }, + { + "name": "ConformanceMode", + "switch": "permissive", + "comment": "Conformance mode disabled", + "value": "false", + "flags": [] + }, + { + "name": "TreatWChar_tAsBuiltInType", + "switch": "Zc:wchar_t-", + "comment": "Treat WChar_t As Built in Type", + "value": "false", + "flags": [] + }, + { + "name": "TreatWChar_tAsBuiltInType", + "switch": "Zc:wchar_t", + "comment": "Treat WChar_t As Built in Type", + "value": "true", + "flags": [] + }, + { + "name": "ForceConformanceInForLoopScope", + "switch": "Zc:forScope-", + "comment": "Force Conformance in For Loop Scope", + "value": "false", + "flags": [] + }, + { + "name": "ForceConformanceInForLoopScope", + "switch": "Zc:forScope", + "comment": "Force Conformance in For Loop Scope", + "value": "true", + "flags": [] + }, + { + "name": "RemoveUnreferencedCodeData", + "switch": "Zc:inline-", + "comment": "Remove unreferenced code and data", + "value": "false", + "flags": [] + }, + { + "name": "RemoveUnreferencedCodeData", + "switch": "Zc:inline", + "comment": "Remove unreferenced code and data", + "value": "true", + "flags": [] + }, + { + "name": "EnforceTypeConversionRules", + "switch": "Zc:rvalueCast-", + "comment": "Enforce type conversion rules", + "value": "false", + "flags": [] + }, + { + "name": "EnforceTypeConversionRules", + "switch": "Zc:rvalueCast", + "comment": "Enforce type conversion rules", + "value": "true", + "flags": [] + }, + { + "name": "RuntimeTypeInfo", + "switch": "GR-", + "comment": "Enable Run-Time Type Information", + "value": "false", + "flags": [] + }, + { + "name": "RuntimeTypeInfo", + "switch": "GR", + "comment": "Enable Run-Time Type Information", + "value": "true", + "flags": [] + }, + { + "name": "OpenMPSupport", + "switch": "openmp-", + "comment": "Open MP Support", + "value": "false", + "flags": [] + }, + { + "name": "OpenMPSupport", + "switch": "openmp", + "comment": "Open MP Support", + "value": "true", + "flags": [] + }, + { + "name": "EnableModules", + "switch": "experimental:module", + "comment": "Enable C++ Modules (experimental)", + "value": "true", + "flags": [] + }, + { + "name": "ExpandAttributedSource", + "switch": "Fx", + "comment": "Expand Attributed Source", + "value": "true", + "flags": [] + }, + { + "name": "UseUnicodeForAssemblerListing", + "switch": "FAu", + "comment": "Use Unicode For Assembler Listing", + "value": "true", + "flags": [] + }, + { + "name": "GenerateXMLDocumentationFiles", + "switch": "doc", + "comment": "Generate XML Documentation Files", + "value": "true", + "flags": [ + "UserValue", + "UserIgnored", + "Continue" + ] + }, + { + "name": "BrowseInformation", + "switch": "FR", + "comment": "Enable Browse Information", + "value": "true", + "flags": [ + "UserValue", + "UserIgnored", + "Continue" + ] + }, + { + "name": "ShowIncludes", + "switch": "showIncludes", + "comment": "Show Includes", + "value": "true", + "flags": [] + }, + { + "name": "EnablePREfast", + "switch": "analyze-", + "comment": "Enable Code Analysis", + "value": "false", + "flags": [] + }, + { + "name": "EnablePREfast", + "switch": "analyze", + "comment": "Enable Code Analysis", + "value": "true", + "flags": [] + }, + { + "name": "UseFullPaths", + "switch": "FC", + "comment": "Use Full Paths", + "value": "true", + "flags": [] + }, + { + "name": "OmitDefaultLibName", + "switch": "Zl", + "comment": "Omit Default Library Name", + "value": "true", + "flags": [] + }, + { + "name": "AdditionalIncludeDirectories", + "switch": "I", + "comment": "Additional Include Directories", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "AdditionalUsingDirectories", + "switch": "AI", + "comment": "Additional #using Directories", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "PreprocessorDefinitions", + "switch": "D", + "comment": "Preprocessor Definitions", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "UndefinePreprocessorDefinitions", + "switch": "U", + "comment": "Undefine Preprocessor Definitions", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "DisableSpecificWarnings", + "switch": "wd", + "comment": "Disable Specific Warnings", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "ForcedIncludeFiles", + "switch": "FI", + "comment": "Forced Include File", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "ForcedUsingFiles", + "switch": "FU", + "comment": "Forced #using File", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "PREfastLog", + "switch": "analyze:log", + "comment": "Code Analysis Log", + "value": "", + "flags": [ + "UserFollowing" + ] + }, + { + "name": "PREfastAdditionalPlugins", + "switch": "analyze:plugin", + "comment": "Additional Code Analysis Native plugins", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "TreatSpecificWarningsAsErrors", + "switch": "we", + "comment": "Treat Specific Warnings As Errors", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "WarningVersion", + "switch": "Wv:", + "comment": "Warning Version", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "PreprocessOutputPath", + "switch": "Fi", + "comment": "Preprocess Output Path", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "PrecompiledHeaderFile", + "switch": "Yu", + "comment": "Precompiled Header File", + "value": "", + "flags": [ + "UserValue", + "UserRequired" + ] + }, + { + "name": "PrecompiledHeaderFile", + "switch": "Yc", + "comment": "Precompiled Header File", + "value": "", + "flags": [ + "UserValue", + "UserRequired" + ] + }, + { + "name": "PrecompiledHeaderOutputFile", + "switch": "Fp", + "comment": "Precompiled Header Output File", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "AssemblerListingLocation", + "switch": "Fa", + "comment": "ASM List Location", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "ObjectFileName", + "switch": "Fo", + "comment": "Object File Name", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "ProgramDataBaseFileName", + "switch": "Fd", + "comment": "Program Database File Name", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "XMLDocumentationFileName", + "switch": "doc", + "comment": "XML Documentation File Name", + "value": "", + "flags": [ + "UserValue", + "UserRequired" + ] + }, + { + "name": "BrowseInformationFile", + "switch": "FR", + "comment": "Browse Information File", + "value": "", + "flags": [ + "UserValue", + "UserRequired" + ] + }, + { + "name": "ProcessorNumber", + "switch": "MP", + "comment": "Number of processors", + "value": "", + "flags": [ + "UserValue", + "UserRequired" + ] + }, + { + "name": "CppLanguageStandard", + "switch": "", + "comment": "Default", + "value": "Default", + "flags": [] + }, + { + "name": "CppLanguageStandard", + "switch": "std=c++98", + "comment": "C++03", + "value": "c++98", + "flags": [] + }, + { + "name": "CppLanguageStandard", + "switch": "std=c++11", + "comment": "C++11", + "value": "c++11", + "flags": [] + }, + { + "name": "CppLanguageStandard", + "switch": "std=c++1y", + "comment": "C++14", + "value": "c++1y", + "flags": [] + }, + { + "name": "CppLanguageStandard", + "switch": "std=c++14", + "comment": "C++14", + "value": "c++1y", + "flags": [] + }, + { + "name": "CppLanguageStandard", + "switch": "std=gnu++98", + "comment": "C++03 (GNU Dialect)", + "value": "gnu++98", + "flags": [] + }, + { + "name": "CppLanguageStandard", + "switch": "std=gnu++11", + "comment": "C++11 (GNU Dialect)", + "value": "gnu++11", + "flags": [] + }, + { + "name": "CppLanguageStandard", + "switch": "std=gnu++1y", + "comment": "C++14 (GNU Dialect)", + "value": "gnu++1y", + "flags": [] + }, + { + "name": "CppLanguageStandard", + "switch": "std=gnu++14", + "comment": "C++14 (GNU Dialect)", + "value": "gnu++1y", + "flags": [] + }, + { + "name": "SupportJustMyCode", + "switch": "JMC-", + "comment": "", + "value": "false", + "flags": [] + }, + { + "name": "SupportJustMyCode", + "switch": "JMC", + "comment": "", + "value": "true", + "flags": [] + } +] diff --git a/Templates/MSBuild/FlagTables/v141_CSharp.json b/Templates/MSBuild/FlagTables/v141_CSharp.json new file mode 100644 index 0000000..a0780a4 --- /dev/null +++ b/Templates/MSBuild/FlagTables/v141_CSharp.json @@ -0,0 +1,570 @@ +[ + { + "name": "ProjectName", + "switch": "out:", + "comment": "", + "value": "", + "flags": [ + "UserValue", + "UserRequired" + ] + }, + { + "name": "OutputType", + "switch": "target:exe", + "comment": "", + "value": "Exe", + "flags": [] + }, + { + "name": "OutputType", + "switch": "target:winexe", + "comment": "", + "value": "Winexe", + "flags": [] + }, + { + "name": "OutputType", + "switch": "target:library", + "comment": "", + "value": "Library", + "flags": [] + }, + { + "name": "OutputType", + "switch": "target:module", + "comment": "", + "value": "Module", + "flags": [] + }, + { + "name": "DocumentationFile", + "switch": "doc", + "comment": "", + "value": "", + "flags": [ + "UserValue", + "UserRequired" + ] + }, + { + "name": "Platform", + "switch": "platform:x86", + "comment": "", + "value": "x86", + "flags": [] + }, + { + "name": "Platform", + "switch": "platform:Itanium", + "comment": "", + "value": "Itanium", + "flags": [] + }, + { + "name": "Platform", + "switch": "platform:x64", + "comment": "", + "value": "x64", + "flags": [] + }, + { + "name": "Platform", + "switch": "platform:arm", + "comment": "", + "value": "arm", + "flags": [] + }, + { + "name": "Platform", + "switch": "platform:anycpu32bitpreferred", + "comment": "", + "value": "anycpu32bitpreferred", + "flags": [] + }, + { + "name": "Platform", + "switch": "platform:anycpu", + "comment": "", + "value": "anycpu", + "flags": [] + }, + { + "name": "References", + "switch": "reference:", + "comment": "mit alias", + "value": "", + "flags": [] + }, + { + "name": "References", + "switch": "reference:", + "comment": "dateiliste", + "value": "", + "flags": [] + }, + { + "name": "AddModules", + "switch": "addmodule:", + "comment": "", + "value": "", + "flags": [ + "SemicolonAppendable" + ] + }, + { + "name": "Win32Resource", + "switch": "win32res:", + "comment": "", + "value": "", + "flags": [ + "UserValue", + "UserRequired" + ] + }, + { + "name": "ApplicationIcon", + "switch": "win32icon:", + "comment": "", + "value": "", + "flags": [ + "UserValue", + "UserRequired" + ] + }, + { + "name": "ApplicationManifest", + "switch": "win32manifest:", + "comment": "", + "value": "", + "flags": [ + "UserValue", + "UserRequired" + ] + }, + { + "name": "NoWin32Manifest", + "switch": "nowin32manifest", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "DefineDebug", + "switch": "debug", + "comment": "", + "value": "true", + "flags": [ + "Continue" + ] + }, + { + "name": "DebugSymbols", + "switch": "debug", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "DebugSymbols", + "switch": "debug-", + "comment": "", + "value": "false", + "flags": [] + }, + { + "name": "DebugSymbols", + "switch": "debug+", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "DebugType", + "switch": "debug:none", + "comment": "", + "value": "none", + "flags": [] + }, + { + "name": "DebugType", + "switch": "debug:full", + "comment": "", + "value": "full", + "flags": [] + }, + { + "name": "DebugType", + "switch": "debug:pdbonly", + "comment": "", + "value": "pdbonly", + "flags": [] + }, + { + "name": "Optimize", + "switch": "optimize", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "Optimize", + "switch": "optimize-", + "comment": "", + "value": "false", + "flags": [] + }, + { + "name": "Optimize", + "switch": "optimize+", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "TreatWarningsAsErrors", + "switch": "warnaserror", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "TreatWarningsAsErrors", + "switch": "warnaserror-", + "comment": "", + "value": "false", + "flags": [] + }, + { + "name": "TreatWarningsAsErrors", + "switch": "warnaserror+", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "WarningsAsErrors", + "switch": "warnaserror", + "comment": "", + "value": "", + "flags": [] + }, + { + "name": "WarningsAsErrors", + "switch": "warnaserror-", + "comment": "", + "value": "", + "flags": [] + }, + { + "name": "WarningsAsErrors", + "switch": "warnaserror+", + "comment": "", + "value": "", + "flags": [] + }, + { + "name": "WarningLevel", + "switch": "warn:0", + "comment": "", + "value": "0", + "flags": [] + }, + { + "name": "WarningLevel", + "switch": "warn:1", + "comment": "", + "value": "1", + "flags": [] + }, + { + "name": "WarningLevel", + "switch": "warn:2", + "comment": "", + "value": "2", + "flags": [] + }, + { + "name": "WarningLevel", + "switch": "warn:3", + "comment": "", + "value": "3", + "flags": [] + }, + { + "name": "WarningLevel", + "switch": "warn:4", + "comment": "", + "value": "4", + "flags": [] + }, + { + "name": "DisabledWarnings", + "switch": "nowarn", + "comment": "", + "value": "", + "flags": [] + }, + { + "name": "CheckForOverflowUnderflow", + "switch": "checked", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "CheckForOverflowUnderflow", + "switch": "checked-", + "comment": "", + "value": "false", + "flags": [] + }, + { + "name": "CheckForOverflowUnderflow", + "switch": "checked+", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "AllowUnsafeBlocks", + "switch": "unsafe", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "AllowUnsafeBlocks", + "switch": "unsafe-", + "comment": "", + "value": "false", + "flags": [] + }, + { + "name": "AllowUnsafeBlocks", + "switch": "unsafe+", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "DefineConstants", + "switch": "define:", + "comment": "", + "value": "", + "flags": [ + "SemicolonAppendable", + "UserValue" + ] + }, + { + "name": "LangVersion", + "switch": "langversion:ISO-1", + "comment": "", + "value": "ISO-1", + "flags": [] + }, + { + "name": "LangVersion", + "switch": "langversion:ISO-2", + "comment": "", + "value": "ISO-2", + "flags": [] + }, + { + "name": "LangVersion", + "switch": "langversion:3", + "comment": "", + "value": "3", + "flags": [] + }, + { + "name": "LangVersion", + "switch": "langversion:4", + "comment": "", + "value": "4", + "flags": [] + }, + { + "name": "LangVersion", + "switch": "langversion:5", + "comment": "", + "value": "5", + "flags": [] + }, + { + "name": "LangVersion", + "switch": "langversion:6", + "comment": "", + "value": "6", + "flags": [] + }, + { + "name": "LangVersion", + "switch": "langversion:default", + "comment": "", + "value": "default", + "flags": [] + }, + { + "name": "DelaySign", + "switch": "delaysign", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "DelaySign", + "switch": "delaysign-", + "comment": "", + "value": "false", + "flags": [] + }, + { + "name": "DelaySign", + "switch": "delaysign+", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "AssemblyOriginatorKeyFile", + "switch": "keyfile", + "comment": "", + "value": "", + "flags": [] + }, + { + "name": "KeyContainerName", + "switch": "keycontainer", + "comment": "", + "value": "", + "flags": [] + }, + { + "name": "NoLogo", + "switch": "nologo", + "comment": "", + "value": "", + "flags": [] + }, + { + "name": "NoConfig", + "switch": "noconfig", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "BaseAddress", + "switch": "baseaddress:", + "comment": "", + "value": "", + "flags": [] + }, + { + "name": "CodePage", + "switch": "codepage", + "comment": "", + "value": "", + "flags": [] + }, + { + "name": "Utf8Output", + "switch": "utf8output", + "comment": "", + "value": "", + "flags": [] + }, + { + "name": "MainEntryPoint", + "switch": "main:", + "comment": "", + "value": "", + "flags": [] + }, + { + "name": "GenerateFullPaths", + "switch": "fullpaths", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "FileAlignment", + "switch": "filealign", + "comment": "", + "value": "", + "flags": [] + }, + { + "name": "PdbFile", + "switch": "pdb:", + "comment": "", + "value": "", + "flags": [] + }, + { + "name": "NoStandardLib", + "switch": "nostdlib", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "NoStandardLib", + "switch": "nostdlib-", + "comment": "", + "value": "false", + "flags": [] + }, + { + "name": "NoStandardLib", + "switch": "nostdlib+", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "SubsystemVersion", + "switch": "subsystemversion", + "comment": "", + "value": "", + "flags": [] + }, + { + "name": "AdditionalLibPaths", + "switch": "lib:", + "comment": "", + "value": "", + "flags": [] + }, + { + "name": "ErrorReport", + "switch": "errorreport:none", + "comment": "Do Not Send Report", + "value": "none", + "flags": [] + }, + { + "name": "ErrorReport", + "switch": "errorreport:prompt", + "comment": "Prompt Immediately", + "value": "prompt", + "flags": [] + }, + { + "name": "ErrorReport", + "switch": "errorreport:queue", + "comment": "Queue For Next Login", + "value": "queue", + "flags": [] + }, + { + "name": "ErrorReport", + "switch": "errorreport:send", + "comment": "Send Automatically", + "value": "send", + "flags": [] + } +] diff --git a/Templates/MSBuild/FlagTables/v141_Link.json b/Templates/MSBuild/FlagTables/v141_Link.json new file mode 100644 index 0000000..66ee76f --- /dev/null +++ b/Templates/MSBuild/FlagTables/v141_Link.json @@ -0,0 +1,1323 @@ +[ + { + "name": "ShowProgress", + "switch": "", + "comment": "Not Set", + "value": "NotSet", + "flags": [] + }, + { + "name": "ShowProgress", + "switch": "VERBOSE", + "comment": "Display all progress messages", + "value": "LinkVerbose", + "flags": [] + }, + { + "name": "ShowProgress", + "switch": "VERBOSE:Lib", + "comment": "For Libraries Searched", + "value": "LinkVerboseLib", + "flags": [] + }, + { + "name": "ShowProgress", + "switch": "VERBOSE:ICF", + "comment": "About COMDAT folding during optimized linking", + "value": "LinkVerboseICF", + "flags": [] + }, + { + "name": "ShowProgress", + "switch": "VERBOSE:REF", + "comment": "About data removed during optimized linking", + "value": "LinkVerboseREF", + "flags": [] + }, + { + "name": "ShowProgress", + "switch": "VERBOSE:SAFESEH", + "comment": "About Modules incompatible with SEH", + "value": "LinkVerboseSAFESEH", + "flags": [] + }, + { + "name": "ShowProgress", + "switch": "VERBOSE:CLR", + "comment": "About linker activity related to managed code", + "value": "LinkVerboseCLR", + "flags": [] + }, + { + "name": "ForceFileOutput", + "switch": "FORCE", + "comment": "Enabled", + "value": "Enabled", + "flags": [] + }, + { + "name": "ForceFileOutput", + "switch": "FORCE:MULTIPLE", + "comment": "Multiply Defined Symbol Only", + "value": "MultiplyDefinedSymbolOnly", + "flags": [] + }, + { + "name": "ForceFileOutput", + "switch": "FORCE:UNRESOLVED", + "comment": "Undefined Symbol Only", + "value": "UndefinedSymbolOnly", + "flags": [] + }, + { + "name": "CreateHotPatchableImage", + "switch": "FUNCTIONPADMIN", + "comment": "Enabled", + "value": "Enabled", + "flags": [] + }, + { + "name": "CreateHotPatchableImage", + "switch": "FUNCTIONPADMIN:5", + "comment": "X86 Image Only", + "value": "X86Image", + "flags": [] + }, + { + "name": "CreateHotPatchableImage", + "switch": "FUNCTIONPADMIN:6", + "comment": "X64 Image Only", + "value": "X64Image", + "flags": [] + }, + { + "name": "CreateHotPatchableImage", + "switch": "FUNCTIONPADMIN:16", + "comment": "Itanium Image Only", + "value": "ItaniumImage", + "flags": [] + }, + { + "name": "UACExecutionLevel", + "switch": "level='asInvoker'", + "comment": "asInvoker", + "value": "AsInvoker", + "flags": [] + }, + { + "name": "UACExecutionLevel", + "switch": "level='highestAvailable'", + "comment": "highestAvailable", + "value": "HighestAvailable", + "flags": [] + }, + { + "name": "UACExecutionLevel", + "switch": "level='requireAdministrator'", + "comment": "requireAdministrator", + "value": "RequireAdministrator", + "flags": [] + }, + { + "name": "GenerateDebugInformation", + "switch": "DEBUG", + "comment": "Generate Debug Information", + "value": "true", + "flags": [ + "CaseInsensitive" + ] + }, + { + "name": "GenerateDebugInformation", + "switch": "DEBUG:FASTLINK", + "comment": "Generate Debug Information optimized for faster links", + "value": "DebugFastLink", + "flags": [ + "CaseInsensitive" + ] + }, + { + "name": "GenerateDebugInformation", + "switch": "DEBUG:FULL", + "comment": "Generate Debug Information optimized for sharing and publishing", + "value": "DebugFull", + "flags": [ + "CaseInsensitive" + ] + }, + { + "name": "GenerateDebugInformation", + "switch": "DEBUG:NONE", + "comment": "Produces no debugging information", + "value": "false", + "flags": [ + "CaseInsensitive" + ] + }, + { + "name": "SubSystem", + "switch": "", + "comment": "Not Set", + "value": "NotSet", + "flags": [] + }, + { + "name": "SubSystem", + "switch": "SUBSYSTEM:CONSOLE", + "comment": "Console", + "value": "Console", + "flags": [] + }, + { + "name": "SubSystem", + "switch": "SUBSYSTEM:WINDOWS", + "comment": "Windows", + "value": "Windows", + "flags": [] + }, + { + "name": "SubSystem", + "switch": "SUBSYSTEM:NATIVE", + "comment": "Native", + "value": "Native", + "flags": [] + }, + { + "name": "SubSystem", + "switch": "SUBSYSTEM:EFI_APPLICATION", + "comment": "EFI Application", + "value": "EFI Application", + "flags": [] + }, + { + "name": "SubSystem", + "switch": "SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER", + "comment": "EFI Boot Service Driver", + "value": "EFI Boot Service Driver", + "flags": [] + }, + { + "name": "SubSystem", + "switch": "SUBSYSTEM:EFI_ROM", + "comment": "EFI ROM", + "value": "EFI ROM", + "flags": [] + }, + { + "name": "SubSystem", + "switch": "SUBSYSTEM:EFI_RUNTIME_DRIVER", + "comment": "EFI Runtime", + "value": "EFI Runtime", + "flags": [] + }, + { + "name": "SubSystem", + "switch": "SUBSYSTEM:POSIX", + "comment": "POSIX", + "value": "POSIX", + "flags": [] + }, + { + "name": "Driver", + "switch": "", + "comment": "Not Set", + "value": "NotSet", + "flags": [] + }, + { + "name": "Driver", + "switch": "Driver", + "comment": "Driver", + "value": "Driver", + "flags": [] + }, + { + "name": "Driver", + "switch": "DRIVER:UPONLY", + "comment": "UP Only", + "value": "UpOnly", + "flags": [] + }, + { + "name": "Driver", + "switch": "DRIVER:WDM", + "comment": "WDM", + "value": "WDM", + "flags": [] + }, + { + "name": "LinkTimeCodeGeneration", + "switch": "", + "comment": "Default", + "value": "Default", + "flags": [] + }, + { + "name": "LinkTimeCodeGeneration", + "switch": "LTCG:incremental", + "comment": "Use Fast Link Time Code Generation", + "value": "UseFastLinkTimeCodeGeneration", + "flags": [] + }, + { + "name": "LinkTimeCodeGeneration", + "switch": "LTCG", + "comment": "Use Link Time Code Generation", + "value": "UseLinkTimeCodeGeneration", + "flags": [] + }, + { + "name": "LinkTimeCodeGeneration", + "switch": "LTCG:PGInstrument", + "comment": "Profile Guided Optimization - Instrument", + "value": "PGInstrument", + "flags": [] + }, + { + "name": "LinkTimeCodeGeneration", + "switch": "LTCG:PGOptimize", + "comment": "Profile Guided Optimization - Optimization", + "value": "PGOptimization", + "flags": [] + }, + { + "name": "LinkTimeCodeGeneration", + "switch": "LTCG:PGUpdate", + "comment": "Profile Guided Optimization - Update", + "value": "PGUpdate", + "flags": [] + }, + { + "name": "GenerateWindowsMetadata", + "switch": "WINMD", + "comment": "Yes", + "value": "true", + "flags": [] + }, + { + "name": "GenerateWindowsMetadata", + "switch": "WINMD:NO", + "comment": "No", + "value": "false", + "flags": [] + }, + { + "name": "WindowsMetadataSignHash", + "switch": "WINMDSIGNHASH:SHA1", + "comment": "SHA1", + "value": "SHA1", + "flags": [] + }, + { + "name": "WindowsMetadataSignHash", + "switch": "WINMDSIGNHASH:SHA256", + "comment": "SHA256", + "value": "SHA256", + "flags": [] + }, + { + "name": "WindowsMetadataSignHash", + "switch": "WINMDSIGNHASH:SHA384", + "comment": "SHA384", + "value": "SHA384", + "flags": [] + }, + { + "name": "WindowsMetadataSignHash", + "switch": "WINMDSIGNHASH:SHA512", + "comment": "SHA512", + "value": "SHA512", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "", + "comment": "Not Set", + "value": "NotSet", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:ARM", + "comment": "MachineARM", + "value": "MachineARM", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:ARM64", + "comment": "MachineARM64", + "value": "MachineARM64", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:EBC", + "comment": "MachineEBC", + "value": "MachineEBC", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:IA64", + "comment": "MachineIA64", + "value": "MachineIA64", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:MIPS", + "comment": "MachineMIPS", + "value": "MachineMIPS", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:MIPS16", + "comment": "MachineMIPS16", + "value": "MachineMIPS16", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:MIPSFPU", + "comment": "MachineMIPSFPU", + "value": "MachineMIPSFPU", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:MIPSFPU16", + "comment": "MachineMIPSFPU16", + "value": "MachineMIPSFPU16", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:SH4", + "comment": "MachineSH4", + "value": "MachineSH4", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:THUMB", + "comment": "MachineTHUMB", + "value": "MachineTHUMB", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:X64", + "comment": "MachineX64", + "value": "MachineX64", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:X86", + "comment": "MachineX86", + "value": "MachineX86", + "flags": [] + }, + { + "name": "CLRThreadAttribute", + "switch": "CLRTHREADATTRIBUTE:MTA", + "comment": "MTA threading attribute", + "value": "MTAThreadingAttribute", + "flags": [] + }, + { + "name": "CLRThreadAttribute", + "switch": "CLRTHREADATTRIBUTE:STA", + "comment": "STA threading attribute", + "value": "STAThreadingAttribute", + "flags": [] + }, + { + "name": "CLRThreadAttribute", + "switch": "CLRTHREADATTRIBUTE:NONE", + "comment": "Default threading attribute", + "value": "DefaultThreadingAttribute", + "flags": [] + }, + { + "name": "CLRImageType", + "switch": "CLRIMAGETYPE:IJW", + "comment": "Force IJW image", + "value": "ForceIJWImage", + "flags": [] + }, + { + "name": "CLRImageType", + "switch": "CLRIMAGETYPE:PURE", + "comment": "Force Pure IL Image", + "value": "ForcePureILImage", + "flags": [] + }, + { + "name": "CLRImageType", + "switch": "CLRIMAGETYPE:SAFE", + "comment": "Force Safe IL Image", + "value": "ForceSafeILImage", + "flags": [] + }, + { + "name": "CLRImageType", + "switch": "", + "comment": "Default image type", + "value": "Default", + "flags": [] + }, + { + "name": "SignHash", + "switch": "CLRSIGNHASH:SHA1", + "comment": "SHA1", + "value": "SHA1", + "flags": [] + }, + { + "name": "SignHash", + "switch": "CLRSIGNHASH:SHA256", + "comment": "SHA256", + "value": "SHA256", + "flags": [] + }, + { + "name": "SignHash", + "switch": "CLRSIGNHASH:SHA384", + "comment": "SHA384", + "value": "SHA384", + "flags": [] + }, + { + "name": "SignHash", + "switch": "CLRSIGNHASH:SHA512", + "comment": "SHA512", + "value": "SHA512", + "flags": [] + }, + { + "name": "LinkErrorReporting", + "switch": "ERRORREPORT:PROMPT", + "comment": "PromptImmediately", + "value": "PromptImmediately", + "flags": [] + }, + { + "name": "LinkErrorReporting", + "switch": "ERRORREPORT:QUEUE", + "comment": "Queue For Next Login", + "value": "QueueForNextLogin", + "flags": [] + }, + { + "name": "LinkErrorReporting", + "switch": "ERRORREPORT:SEND", + "comment": "Send Error Report", + "value": "SendErrorReport", + "flags": [] + }, + { + "name": "LinkErrorReporting", + "switch": "ERRORREPORT:NONE", + "comment": "No Error Report", + "value": "NoErrorReport", + "flags": [] + }, + { + "name": "CLRSupportLastError", + "switch": "CLRSupportLastError", + "comment": "Enabled", + "value": "Enabled", + "flags": [] + }, + { + "name": "CLRSupportLastError", + "switch": "CLRSupportLastError:NO", + "comment": "Disabled", + "value": "Disabled", + "flags": [] + }, + { + "name": "CLRSupportLastError", + "switch": "CLRSupportLastError:SYSTEMDLL", + "comment": "System Dlls Only", + "value": "SystemDlls", + "flags": [] + }, + { + "name": "LinkIncremental", + "switch": "INCREMENTAL:NO", + "comment": "Enable Incremental Linking", + "value": "false", + "flags": [] + }, + { + "name": "LinkIncremental", + "switch": "INCREMENTAL", + "comment": "Enable Incremental Linking", + "value": "true", + "flags": [] + }, + { + "name": "SuppressStartupBanner", + "switch": "NOLOGO", + "comment": "Suppress Startup Banner", + "value": "true", + "flags": [] + }, + { + "name": "LinkStatus", + "switch": "LTCG:NOSTATUS", + "comment": "Link Status", + "value": "false", + "flags": [] + }, + { + "name": "LinkStatus", + "switch": "LTCG:STATUS", + "comment": "Link Status", + "value": "true", + "flags": [] + }, + { + "name": "PreventDllBinding", + "switch": "ALLOWBIND:NO", + "comment": "Prevent Dll Binding", + "value": "false", + "flags": [] + }, + { + "name": "PreventDllBinding", + "switch": "ALLOWBIND", + "comment": "Prevent Dll Binding", + "value": "true", + "flags": [] + }, + { + "name": "TreatLinkerWarningAsErrors", + "switch": "WX:NO", + "comment": "Treat Linker Warning As Errors", + "value": "false", + "flags": [] + }, + { + "name": "TreatLinkerWarningAsErrors", + "switch": "WX", + "comment": "Treat Linker Warning As Errors", + "value": "true", + "flags": [] + }, + { + "name": "IgnoreAllDefaultLibraries", + "switch": "NODEFAULTLIB", + "comment": "Ignore All Default Libraries", + "value": "true", + "flags": [] + }, + { + "name": "GenerateManifest", + "switch": "MANIFEST:NO", + "comment": "Generate Manifest", + "value": "false", + "flags": [] + }, + { + "name": "GenerateManifest", + "switch": "MANIFEST", + "comment": "Generate Manifest", + "value": "true", + "flags": [] + }, + { + "name": "AllowIsolation", + "switch": "ALLOWISOLATION:NO", + "comment": "Allow Isolation", + "value": "false", + "flags": [] + }, + { + "name": "AllowIsolation", + "switch": "", + "comment": "Allow Isolation", + "value": "true", + "flags": [] + }, + { + "name": "EnableUAC", + "switch": "MANIFESTUAC:", + "comment": "", + "value": "", + "flags": [ + "UserValue", + "UserRequired", + "SpaceAppendable" + ] + }, + { + "name": "UACUIAccess", + "switch": "uiAccess='false'", + "comment": "UAC Bypass UI Protection", + "value": "false", + "flags": [ + "UserValue", + "UserRequired" + ] + }, + { + "name": "UACUIAccess", + "switch": "uiAccess='false'", + "comment": "UAC Bypass UI Protection", + "value": "false", + "flags": [] + }, + { + "name": "UACUIAccess", + "switch": "uiAccess='true'", + "comment": "UAC Bypass UI Protection", + "value": "true", + "flags": [] + }, + { + "name": "ManifestEmbed", + "switch": "manifest:embed", + "comment": "Embed Manifest", + "value": "true", + "flags": [] + }, + { + "name": "GenerateMapFile", + "switch": "MAP", + "comment": "Generate Map File", + "value": "true", + "flags": [ + "UserValue", + "UserIgnored", + "Continue" + ] + }, + { + "name": "MapExports", + "switch": "MAPINFO:EXPORTS", + "comment": "Map Exports", + "value": "true", + "flags": [] + }, + { + "name": "AssemblyDebug", + "switch": "ASSEMBLYDEBUG:DISABLE", + "comment": "Debuggable Assembly", + "value": "false", + "flags": [] + }, + { + "name": "AssemblyDebug", + "switch": "ASSEMBLYDEBUG", + "comment": "Debuggable Assembly", + "value": "true", + "flags": [] + }, + { + "name": "LargeAddressAware", + "switch": "LARGEADDRESSAWARE:NO", + "comment": "Enable Large Addresses", + "value": "false", + "flags": [] + }, + { + "name": "LargeAddressAware", + "switch": "LARGEADDRESSAWARE", + "comment": "Enable Large Addresses", + "value": "true", + "flags": [] + }, + { + "name": "TerminalServerAware", + "switch": "TSAWARE:NO", + "comment": "Terminal Server", + "value": "false", + "flags": [] + }, + { + "name": "TerminalServerAware", + "switch": "TSAWARE", + "comment": "Terminal Server", + "value": "true", + "flags": [] + }, + { + "name": "SwapRunFromCD", + "switch": "SWAPRUN:CD", + "comment": "Swap Run From CD", + "value": "true", + "flags": [] + }, + { + "name": "SwapRunFromNET", + "switch": "SWAPRUN:NET", + "comment": "Swap Run From Network", + "value": "true", + "flags": [] + }, + { + "name": "OptimizeReferences", + "switch": "OPT:NOREF", + "comment": "References", + "value": "false", + "flags": [] + }, + { + "name": "OptimizeReferences", + "switch": "OPT:REF", + "comment": "References", + "value": "true", + "flags": [] + }, + { + "name": "EnableCOMDATFolding", + "switch": "OPT:NOICF", + "comment": "Enable COMDAT Folding", + "value": "false", + "flags": [] + }, + { + "name": "EnableCOMDATFolding", + "switch": "OPT:ICF", + "comment": "Enable COMDAT Folding", + "value": "true", + "flags": [] + }, + { + "name": "IgnoreEmbeddedIDL", + "switch": "IGNOREIDL", + "comment": "Ignore Embedded IDL", + "value": "true", + "flags": [] + }, + { + "name": "AppContainer", + "switch": "APPCONTAINER", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "WindowsMetadataLinkDelaySign", + "switch": "WINMDDELAYSIGN:NO", + "comment": "Windows Metadata Delay Sign", + "value": "false", + "flags": [] + }, + { + "name": "WindowsMetadataLinkDelaySign", + "switch": "WINMDDELAYSIGN", + "comment": "Windows Metadata Delay Sign", + "value": "true", + "flags": [] + }, + { + "name": "NoEntryPoint", + "switch": "NOENTRY", + "comment": "No Entry Point", + "value": "true", + "flags": [] + }, + { + "name": "SetChecksum", + "switch": "RELEASE", + "comment": "Set Checksum", + "value": "true", + "flags": [] + }, + { + "name": "RandomizedBaseAddress", + "switch": "DYNAMICBASE:NO", + "comment": "Randomized Base Address", + "value": "false", + "flags": [] + }, + { + "name": "RandomizedBaseAddress", + "switch": "DYNAMICBASE", + "comment": "Randomized Base Address", + "value": "true", + "flags": [] + }, + { + "name": "FixedBaseAddress", + "switch": "FIXED:NO", + "comment": "Fixed Base Address", + "value": "false", + "flags": [] + }, + { + "name": "FixedBaseAddress", + "switch": "FIXED", + "comment": "Fixed Base Address", + "value": "true", + "flags": [] + }, + { + "name": "DataExecutionPrevention", + "switch": "NXCOMPAT:NO", + "comment": "Data Execution Prevention (DEP)", + "value": "false", + "flags": [] + }, + { + "name": "DataExecutionPrevention", + "switch": "NXCOMPAT", + "comment": "Data Execution Prevention (DEP)", + "value": "true", + "flags": [] + }, + { + "name": "TurnOffAssemblyGeneration", + "switch": "NOASSEMBLY", + "comment": "Turn Off Assembly Generation", + "value": "true", + "flags": [] + }, + { + "name": "SupportUnloadOfDelayLoadedDLL", + "switch": "DELAY:UNLOAD", + "comment": "Unload delay loaded DLL", + "value": "true", + "flags": [] + }, + { + "name": "SupportNobindOfDelayLoadedDLL", + "switch": "DELAY:NOBIND", + "comment": "Nobind delay loaded DLL", + "value": "true", + "flags": [] + }, + { + "name": "Profile", + "switch": "PROFILE", + "comment": "Profile", + "value": "true", + "flags": [] + }, + { + "name": "LinkDelaySign", + "switch": "DELAYSIGN:NO", + "comment": "Delay Sign", + "value": "false", + "flags": [] + }, + { + "name": "LinkDelaySign", + "switch": "DELAYSIGN", + "comment": "Delay Sign", + "value": "true", + "flags": [] + }, + { + "name": "CLRUnmanagedCodeCheck", + "switch": "CLRUNMANAGEDCODECHECK:NO", + "comment": "CLR Unmanaged Code Check", + "value": "false", + "flags": [] + }, + { + "name": "CLRUnmanagedCodeCheck", + "switch": "CLRUNMANAGEDCODECHECK", + "comment": "CLR Unmanaged Code Check", + "value": "true", + "flags": [] + }, + { + "name": "DetectOneDefinitionRule", + "switch": "ODR", + "comment": "Detect One Definition Rule violations", + "value": "true", + "flags": [] + }, + { + "name": "ImageHasSafeExceptionHandlers", + "switch": "SAFESEH:NO", + "comment": "Image Has Safe Exception Handlers", + "value": "false", + "flags": [] + }, + { + "name": "ImageHasSafeExceptionHandlers", + "switch": "SAFESEH", + "comment": "Image Has Safe Exception Handlers", + "value": "true", + "flags": [] + }, + { + "name": "LinkDLL", + "switch": "DLL", + "comment": "", + "value": "true", + "flags": [] + }, + { + "name": "AdditionalLibraryDirectories", + "switch": "LIBPATH:", + "comment": "Additional Library Directories", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "Natvis", + "switch": "NATVIS:", + "comment": "Natvis files", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "IgnoreSpecificDefaultLibraries", + "switch": "NODEFAULTLIB:", + "comment": "Ignore Specific Default Libraries", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "AddModuleNamesToAssembly", + "switch": "ASSEMBLYMODULE:", + "comment": "Add Module to Assembly", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "EmbedManagedResourceFile", + "switch": "ASSEMBLYRESOURCE:", + "comment": "Embed Managed Resource File", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "ForceSymbolReferences", + "switch": "INCLUDE:", + "comment": "Force Symbol References", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "DelayLoadDLLs", + "switch": "DELAYLOAD:", + "comment": "Delay Loaded Dlls", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "AssemblyLinkResource", + "switch": "ASSEMBLYLINKRESOURCE:", + "comment": "Assembly Link Resource", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "AdditionalManifestDependencies", + "switch": "MANIFESTDEPENDENCY:", + "comment": "Additional Manifest Dependencies", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "ManifestInput", + "switch": "manifestinput:", + "comment": "Manifest Input", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "OutputFile", + "switch": "OUT:", + "comment": "Output File", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "Version", + "switch": "VERSION:", + "comment": "Version", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "SpecifySectionAttributes", + "switch": "SECTION:", + "comment": "Specify Section Attributes", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "MSDOSStubFileName", + "switch": "STUB:", + "comment": "MS-DOS Stub File Name", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "ModuleDefinitionFile", + "switch": "DEF:", + "comment": "Module Definition File", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "ManifestFile", + "switch": "ManifestFile:", + "comment": "Manifest File", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "ProgramDatabaseFile", + "switch": "PDB:", + "comment": "Generate Program Database File", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "StripPrivateSymbols", + "switch": "PDBSTRIPPED:", + "comment": "Strip Private Symbols", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "MapFileName", + "switch": "MAP:", + "comment": "Map File Name", + "value": "", + "flags": [ + "UserValue", + "UserRequired" + ] + }, + { + "name": "HeapReserveSize", + "switch": "HEAP:", + "comment": "Heap Reserve Size", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "HeapCommitSize", + "switch": "HEAP", + "comment": "Heap Commit Size", + "value": "", + "flags": [ + "UserValue", + "UserRequired" + ] + }, + { + "name": "StackReserveSize", + "switch": "STACK:", + "comment": "Stack Reserve Size", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "StackCommitSize", + "switch": "STACK", + "comment": "Stack Commit Size", + "value": "", + "flags": [ + "UserValue", + "UserRequired" + ] + }, + { + "name": "FunctionOrder", + "switch": "ORDER:@", + "comment": "Function Order", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "ProfileGuidedDatabase", + "switch": "PGD:", + "comment": "Profile Guided Database", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "MidlCommandFile", + "switch": "MIDL:@", + "comment": "MIDL Commands", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "MergedIDLBaseFileName", + "switch": "IDLOUT:", + "comment": "Merged IDL Base File Name", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "TypeLibraryFile", + "switch": "TLBOUT:", + "comment": "Type Library", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "WindowsMetadataFile", + "switch": "WINMDFILE:", + "comment": "Windows Metadata File", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "WindowsMetadataLinkKeyFile", + "switch": "WINMDKEYFILE:", + "comment": "Windows Metadata Key File", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "WindowsMetadataKeyContainer", + "switch": "WINMDKEYCONTAINER:", + "comment": "Windows Metadata Key Container", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "EntryPointSymbol", + "switch": "ENTRY:", + "comment": "Entry Point", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "BaseAddress", + "switch": "BASE:", + "comment": "Base Address", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "ImportLibrary", + "switch": "IMPLIB:", + "comment": "Import Library", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "MergeSections", + "switch": "MERGE:", + "comment": "Merge Sections", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "LinkKeyFile", + "switch": "KEYFILE:", + "comment": "Key File", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "KeyContainer", + "switch": "KEYCONTAINER:", + "comment": "Key Container", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "TypeLibraryResourceID", + "switch": "TLBID:", + "comment": "TypeLib Resource ID", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "SectionAlignment", + "switch": "ALIGN:", + "comment": "SectionAlignment", + "value": "", + "flags": [ + "UserValue" + ] + } +] diff --git a/Templates/MSBuild/FlagTables/v14_LIB.json b/Templates/MSBuild/FlagTables/v14_LIB.json new file mode 100644 index 0000000..5990ed1 --- /dev/null +++ b/Templates/MSBuild/FlagTables/v14_LIB.json @@ -0,0 +1,304 @@ +[ + { + "name": "ErrorReporting", + "switch": "ERRORREPORT:PROMPT", + "comment": "PromptImmediately", + "value": "PromptImmediately", + "flags": [] + }, + { + "name": "ErrorReporting", + "switch": "ERRORREPORT:QUEUE", + "comment": "Queue For Next Login", + "value": "QueueForNextLogin", + "flags": [] + }, + { + "name": "ErrorReporting", + "switch": "ERRORREPORT:SEND", + "comment": "Send Error Report", + "value": "SendErrorReport", + "flags": [] + }, + { + "name": "ErrorReporting", + "switch": "ERRORREPORT:NONE", + "comment": "No Error Report", + "value": "NoErrorReport", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:ARM", + "comment": "MachineARM", + "value": "MachineARM", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:ARM64", + "comment": "MachineARM64", + "value": "MachineARM64", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:EBC", + "comment": "MachineEBC", + "value": "MachineEBC", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:IA64", + "comment": "MachineIA64", + "value": "MachineIA64", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:MIPS", + "comment": "MachineMIPS", + "value": "MachineMIPS", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:MIPS16", + "comment": "MachineMIPS16", + "value": "MachineMIPS16", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:MIPSFPU", + "comment": "MachineMIPSFPU", + "value": "MachineMIPSFPU", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:MIPSFPU16", + "comment": "MachineMIPSFPU16", + "value": "MachineMIPSFPU16", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:SH4", + "comment": "MachineSH4", + "value": "MachineSH4", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:THUMB", + "comment": "MachineTHUMB", + "value": "MachineTHUMB", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:X64", + "comment": "MachineX64", + "value": "MachineX64", + "flags": [] + }, + { + "name": "TargetMachine", + "switch": "MACHINE:X86", + "comment": "MachineX86", + "value": "MachineX86", + "flags": [] + }, + { + "name": "SubSystem", + "switch": "SUBSYSTEM:CONSOLE", + "comment": "Console", + "value": "Console", + "flags": [] + }, + { + "name": "SubSystem", + "switch": "SUBSYSTEM:WINDOWS", + "comment": "Windows", + "value": "Windows", + "flags": [] + }, + { + "name": "SubSystem", + "switch": "SUBSYSTEM:NATIVE", + "comment": "Native", + "value": "Native", + "flags": [] + }, + { + "name": "SubSystem", + "switch": "SUBSYSTEM:EFI_APPLICATION", + "comment": "EFI Application", + "value": "EFI Application", + "flags": [] + }, + { + "name": "SubSystem", + "switch": "SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER", + "comment": "EFI Boot Service Driver", + "value": "EFI Boot Service Driver", + "flags": [] + }, + { + "name": "SubSystem", + "switch": "SUBSYSTEM:EFI_ROM", + "comment": "EFI ROM", + "value": "EFI ROM", + "flags": [] + }, + { + "name": "SubSystem", + "switch": "SUBSYSTEM:EFI_RUNTIME_DRIVER", + "comment": "EFI Runtime", + "value": "EFI Runtime", + "flags": [] + }, + { + "name": "SubSystem", + "switch": "SUBSYSTEM:WINDOWSCE", + "comment": "WindowsCE", + "value": "WindowsCE", + "flags": [] + }, + { + "name": "SubSystem", + "switch": "SUBSYSTEM:POSIX", + "comment": "POSIX", + "value": "POSIX", + "flags": [] + }, + { + "name": "SuppressStartupBanner", + "switch": "NOLOGO", + "comment": "Suppress Startup Banner", + "value": "true", + "flags": [] + }, + { + "name": "IgnoreAllDefaultLibraries", + "switch": "NODEFAULTLIB", + "comment": "Ignore All Default Libraries", + "value": "true", + "flags": [] + }, + { + "name": "TreatLibWarningAsErrors", + "switch": "WX:NO", + "comment": "Treat Lib Warning As Errors", + "value": "false", + "flags": [] + }, + { + "name": "TreatLibWarningAsErrors", + "switch": "WX", + "comment": "Treat Lib Warning As Errors", + "value": "true", + "flags": [] + }, + { + "name": "Verbose", + "switch": "VERBOSE", + "comment": "Verbose", + "value": "true", + "flags": [] + }, + { + "name": "LinkTimeCodeGeneration", + "switch": "LTCG", + "comment": "Link Time Code Generation", + "value": "true", + "flags": [] + }, + { + "name": "AdditionalLibraryDirectories", + "switch": "LIBPATH:", + "comment": "Additional Library Directories", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "IgnoreSpecificDefaultLibraries", + "switch": "NODEFAULTLIB:", + "comment": "Ignore Specific Default Libraries", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "ExportNamedFunctions", + "switch": "EXPORT:", + "comment": "Export Named Functions", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "RemoveObjects", + "switch": "REMOVE:", + "comment": "Remove Objects", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "OutputFile", + "switch": "OUT:", + "comment": "Output File", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "ModuleDefinitionFile", + "switch": "DEF:", + "comment": "Module Definition File Name", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "ForceSymbolReferences", + "switch": "INCLUDE:", + "comment": "Force Symbol References", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "DisplayLibrary", + "switch": "LIST:", + "comment": "Display Library to standard output", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "Name", + "switch": "NAME:", + "comment": "Name", + "value": "", + "flags": [ + "UserValue" + ] + } +] diff --git a/Templates/MSBuild/FlagTables/v14_MASM.json b/Templates/MSBuild/FlagTables/v14_MASM.json new file mode 100644 index 0000000..4634306 --- /dev/null +++ b/Templates/MSBuild/FlagTables/v14_MASM.json @@ -0,0 +1,295 @@ +[ + { + "name": "PreserveIdentifierCase", + "switch": "", + "comment": "Default", + "value": "0", + "flags": [] + }, + { + "name": "PreserveIdentifierCase", + "switch": "Cp", + "comment": "Preserves Identifier Case (/Cp)", + "value": "1", + "flags": [] + }, + { + "name": "PreserveIdentifierCase", + "switch": "Cu", + "comment": "Maps all identifiers to upper case. (/Cu)", + "value": "2", + "flags": [] + }, + { + "name": "PreserveIdentifierCase", + "switch": "Cx", + "comment": "Preserves case in public and extern symbols. (/Cx)", + "value": "3", + "flags": [] + }, + { + "name": "WarningLevel", + "switch": "W0", + "comment": "Warning Level 0 (/W0)", + "value": "0", + "flags": [] + }, + { + "name": "WarningLevel", + "switch": "W1", + "comment": "Warning Level 1 (/W1)", + "value": "1", + "flags": [] + }, + { + "name": "WarningLevel", + "switch": "W2", + "comment": "Warning Level 2 (/W2)", + "value": "2", + "flags": [] + }, + { + "name": "WarningLevel", + "switch": "W3", + "comment": "Warning Level 3 (/W3)", + "value": "3", + "flags": [] + }, + { + "name": "PackAlignmentBoundary", + "switch": "", + "comment": "Default", + "value": "0", + "flags": [] + }, + { + "name": "PackAlignmentBoundary", + "switch": "Zp1", + "comment": "One Byte Boundary (/Zp1)", + "value": "1", + "flags": [] + }, + { + "name": "PackAlignmentBoundary", + "switch": "Zp2", + "comment": "Two Byte Boundary (/Zp2)", + "value": "2", + "flags": [] + }, + { + "name": "PackAlignmentBoundary", + "switch": "Zp4", + "comment": "Four Byte Boundary (/Zp4)", + "value": "3", + "flags": [] + }, + { + "name": "PackAlignmentBoundary", + "switch": "Zp8", + "comment": "Eight Byte Boundary (/Zp8)", + "value": "4", + "flags": [] + }, + { + "name": "PackAlignmentBoundary", + "switch": "Zp16", + "comment": "Sixteen Byte Boundary (/Zp16)", + "value": "5", + "flags": [] + }, + { + "name": "CallingConvention", + "switch": "", + "comment": "Default", + "value": "0", + "flags": [] + }, + { + "name": "CallingConvention", + "switch": "Gd", + "comment": "Use C-style Calling Convention (/Gd)", + "value": "1", + "flags": [] + }, + { + "name": "CallingConvention", + "switch": "Gz", + "comment": "Use stdcall Calling Convention (/Gz)", + "value": "2", + "flags": [] + }, + { + "name": "CallingConvention", + "switch": "Gc", + "comment": "Use Pascal Calling Convention (/Gc)", + "value": "3", + "flags": [] + }, + { + "name": "ErrorReporting", + "switch": "errorReport:prompt", + "comment": "Prompt to send report immediately (/errorReport:prompt)", + "value": "0", + "flags": [] + }, + { + "name": "ErrorReporting", + "switch": "errorReport:queue", + "comment": "Prompt to send report at the next logon (/errorReport:queue)", + "value": "1", + "flags": [] + }, + { + "name": "ErrorReporting", + "switch": "errorReport:send", + "comment": "Automatically send report (/errorReport:send)", + "value": "2", + "flags": [] + }, + { + "name": "ErrorReporting", + "switch": "errorReport:none", + "comment": "Do not send report (/errorReport:none)", + "value": "3", + "flags": [] + }, + { + "name": "NoLogo", + "switch": "nologo", + "comment": "Suppress Startup Banner", + "value": "true", + "flags": [] + }, + { + "name": "GeneratePreprocessedSourceListing", + "switch": "EP", + "comment": "Generate Preprocessed Source Listing", + "value": "true", + "flags": [] + }, + { + "name": "ListAllAvailableInformation", + "switch": "Sa", + "comment": "List All Available Information", + "value": "true", + "flags": [] + }, + { + "name": "UseSafeExceptionHandlers", + "switch": "safeseh", + "comment": "Use Safe Exception Handlers", + "value": "true", + "flags": [] + }, + { + "name": "AddFirstPassListing", + "switch": "Sf", + "comment": "Add First Pass Listing", + "value": "true", + "flags": [] + }, + { + "name": "EnableAssemblyGeneratedCodeListing", + "switch": "Sg", + "comment": "Enable Assembly Generated Code Listing", + "value": "true", + "flags": [] + }, + { + "name": "DisableSymbolTable", + "switch": "Sn", + "comment": "Disable Symbol Table", + "value": "true", + "flags": [] + }, + { + "name": "EnableFalseConditionalsInListing", + "switch": "Sx", + "comment": "Enable False Conditionals In Listing", + "value": "true", + "flags": [] + }, + { + "name": "TreatWarningsAsErrors", + "switch": "WX", + "comment": "Treat Warnings As Errors", + "value": "true", + "flags": [] + }, + { + "name": "MakeAllSymbolsPublic", + "switch": "Zf", + "comment": "Make All Symbols Public", + "value": "true", + "flags": [] + }, + { + "name": "GenerateDebugInformation", + "switch": "Zi", + "comment": "Generate Debug Information", + "value": "true", + "flags": [] + }, + { + "name": "EnableMASM51Compatibility", + "switch": "Zm", + "comment": "Enable MASM 5.1 Compatibility", + "value": "true", + "flags": [] + }, + { + "name": "PerformSyntaxCheckOnly", + "switch": "Zs", + "comment": "Perform Syntax Check Only", + "value": "true", + "flags": [] + }, + { + "name": "PreprocessorDefinitions", + "switch": "D", + "comment": "Preprocessor Definitions", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "IncludePaths", + "switch": "I", + "comment": "Include Paths", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "BrowseFile", + "switch": "FR", + "comment": "Generate Browse Information File", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "ObjectFileName", + "switch": "Fo", + "comment": "Object File Name", + "value": "", + "flags": [ + "UserValue" + ] + }, + { + "name": "AssembledCodeListingFile", + "switch": "Fl", + "comment": "Assembled Code Listing File", + "value": "", + "flags": [ + "UserValue" + ] + } +] diff --git a/Templates/MSBuild/FlagTables/v14_RC.json b/Templates/MSBuild/FlagTables/v14_RC.json new file mode 100644 index 0000000..b8c0127 --- /dev/null +++ b/Templates/MSBuild/FlagTables/v14_RC.json @@ -0,0 +1,69 @@ +[ + { + "name": "IgnoreStandardIncludePath", + "switch": "X", + "comment": "Ignore Standard Include Paths", + "value": "true", + "flags": [] + }, + { + "name": "ShowProgress", + "switch": "v", + "comment": "Show Progress", + "value": "true", + "flags": [] + }, + { + "name": "SuppressStartupBanner", + "switch": "nologo", + "comment": "Suppress Startup Banner", + "value": "true", + "flags": [] + }, + { + "name": "NullTerminateStrings", + "switch": "n", + "comment": "Null Terminate Strings", + "value": "true", + "flags": [] + }, + { + "name": "PreprocessorDefinitions", + "switch": "D", + "comment": "Preprocessor Definitions", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "UndefinePreprocessorDefinitions", + "switch": "u", + "comment": "Undefine Preprocessor Definitions", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "AdditionalIncludeDirectories", + "switch": "I", + "comment": "Additional Include Directories", + "value": "", + "flags": [ + "UserValue", + "SemicolonAppendable" + ] + }, + { + "name": "ResourceOutputFileName", + "switch": "fo", + "comment": "Resource File Name", + "value": "", + "flags": [ + "UserValue" + ] + } +] diff --git a/Tests/CMakeLib/CMakeLists.txt b/Tests/CMakeLib/CMakeLists.txt index 126076d..f6a9153 100644 --- a/Tests/CMakeLib/CMakeLists.txt +++ b/Tests/CMakeLib/CMakeLists.txt @@ -7,6 +7,7 @@ include_directories( set(CMakeLib_TESTS testGeneratedFileStream.cxx testRST.cxx + testString.cxx testSystemTools.cxx testUTF8.cxx testXMLParser.cxx diff --git a/Tests/CMakeLib/PseudoMemcheck/memtester.cxx.in b/Tests/CMakeLib/PseudoMemcheck/memtester.cxx.in index b4c6fae4..3183bc0 100644 --- a/Tests/CMakeLib/PseudoMemcheck/memtester.cxx.in +++ b/Tests/CMakeLib/PseudoMemcheck/memtester.cxx.in @@ -15,15 +15,15 @@ int main(int ac, char** av) std::string logarg; bool nextarg = false; - if (exename.find("valgrind") != exename.npos) { + if (exename.find("valgrind") != std::string::npos) { logarg = "--log-file="; - } else if (exename.find("purify") != exename.npos) { + } else if (exename.find("purify") != std::string::npos) { #ifdef _WIN32 logarg = "/SAVETEXTDATA="; #else logarg = "-log-file="; #endif - } else if (exename.find("BC") != exename.npos) { + } else if (exename.find("BC") != std::string::npos) { nextarg = true; logarg = "/X"; } diff --git a/Tests/CMakeLib/testString.cxx b/Tests/CMakeLib/testString.cxx new file mode 100644 index 0000000..2aa1459 --- /dev/null +++ b/Tests/CMakeLib/testString.cxx @@ -0,0 +1,1347 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ + +#include "cmString.hxx" + +#include "cm_static_string_view.hxx" +#include "cm_string_view.hxx" + +#include <cstring> +#include <iostream> +#include <iterator> +#include <sstream> +#include <stdexcept> +#include <string> +#include <type_traits> +#include <utility> + +#define ASSERT_TRUE(x) \ + if (!(x)) { \ + std::cout << "ASSERT_TRUE(" #x ") failed on line " << __LINE__ << "\n"; \ + return false; \ + } + +static bool testConstructDefault() +{ + std::cout << "testConstructDefault()\n"; + cm::String str; + cm::String const& str_const = str; + ASSERT_TRUE(bool(str_const) == false); + ASSERT_TRUE(str_const.data() == nullptr); + ASSERT_TRUE(str_const.size() == 0); + ASSERT_TRUE(str_const.empty()); + ASSERT_TRUE(str_const.is_stable()); + ASSERT_TRUE(str.c_str() == nullptr); + ASSERT_TRUE(str.str().empty()); + ASSERT_TRUE(str.is_stable()); + return true; +} + +static bool testFromNullPtr(cm::String str) +{ + cm::String const& str_const = str; + ASSERT_TRUE(bool(str_const) == false); + ASSERT_TRUE(str_const.data() == nullptr); + ASSERT_TRUE(str_const.size() == 0); + ASSERT_TRUE(str_const.empty()); + ASSERT_TRUE(str_const.is_stable()); + ASSERT_TRUE(str.c_str() == nullptr); + ASSERT_TRUE(str.str().empty()); + ASSERT_TRUE(str.is_stable()); + return true; +} + +static bool testConstructFromNullPtr() +{ + std::cout << "testConstructFromNullPtr()\n"; + return testFromNullPtr(nullptr); +} + +static bool testAssignFromNullPtr() +{ + std::cout << "testAssignFromNullPtr()\n"; + cm::String str; + str = nullptr; + return testFromNullPtr(str); +} + +static bool testFromCStrNull(cm::String str) +{ + cm::String const& str_const = str; + ASSERT_TRUE(bool(str_const) == false); + ASSERT_TRUE(str_const.data() == nullptr); + ASSERT_TRUE(str_const.size() == 0); + ASSERT_TRUE(str_const.empty()); + ASSERT_TRUE(str_const.is_stable()); + ASSERT_TRUE(str.c_str() == nullptr); + ASSERT_TRUE(str.str().empty()); + ASSERT_TRUE(str.is_stable()); + return true; +} + +static bool testConstructFromCStrNull() +{ + std::cout << "testConstructFromCStrNull()\n"; + const char* null = nullptr; + return testFromCStrNull(null); +} + +static bool testAssignFromCStrNull() +{ + std::cout << "testAssignFromCStrNull()\n"; + const char* null = nullptr; + cm::String str; + str = null; + return testFromCStrNull(str); +} + +static char const charArray[] = "abc"; + +static bool testFromCharArray(cm::String str) +{ + cm::String const& str_const = str; + ASSERT_TRUE(str_const.data() != charArray); + ASSERT_TRUE(str_const.size() == sizeof(charArray) - 1); + ASSERT_TRUE(str_const.is_stable()); + ASSERT_TRUE(str.c_str() != charArray); + ASSERT_TRUE(str.is_stable()); + cm::String substr = str.substr(1); + cm::String const& substr_const = substr; + ASSERT_TRUE(substr_const.data() != &charArray[1]); + ASSERT_TRUE(substr_const.size() == 2); + ASSERT_TRUE(!substr_const.is_stable()); + ASSERT_TRUE(substr.c_str() != &charArray[1]); + ASSERT_TRUE(!substr.is_stable()); + return true; +} + +static bool testConstructFromCharArray() +{ + std::cout << "testConstructFromCharArray()\n"; + return testFromCharArray(charArray); +} + +static bool testAssignFromCharArray() +{ + std::cout << "testAssignFromCharArray()\n"; + cm::String str; + str = charArray; + return testFromCharArray(str); +} + +static const char* cstr = "abc"; + +static bool testFromCStr(cm::String const& str) +{ + ASSERT_TRUE(str.data() != cstr); + ASSERT_TRUE(str.size() == 3); + ASSERT_TRUE(std::strncmp(str.data(), cstr, 3) == 0); + ASSERT_TRUE(str.is_stable()); + return true; +} + +static bool testConstructFromCStr() +{ + std::cout << "testConstructFromCStr()\n"; + return testFromCStr(cstr); + ; +} + +static bool testAssignFromCStr() +{ + std::cout << "testAssignFromCStr()\n"; + cm::String str; + str = cstr; + return testFromCStr(str); + ; +} + +static const std::string stdstr = "abc"; + +static bool testFromStdString(cm::String const& str) +{ +#if defined(_GLIBCXX_USE_CXX11_ABI) && _GLIBCXX_USE_CXX11_ABI + // It would be nice to check this everywhere, but several platforms + // still use a CoW implementation even in C++11. + ASSERT_TRUE(str.data() != stdstr.data()); +#endif + ASSERT_TRUE(str.size() == 3); + ASSERT_TRUE(std::strncmp(str.data(), stdstr.data(), 3) == 0); + ASSERT_TRUE(str.is_stable()); + return true; +} + +static bool testConstructFromStdString() +{ + std::cout << "testConstructFromStdString()\n"; + return testFromStdString(stdstr); +} + +static bool testAssignFromStdString() +{ + std::cout << "testAssignFromStdString()\n"; + cm::String str; + str = stdstr; + return testFromStdString(str); +} + +static bool testConstructFromView() +{ + std::cout << "testConstructFromView()\n"; + cm::string_view view = cstr; + return testFromCStr(view); +} + +static bool testAssignFromView() +{ + std::cout << "testAssignFromView()\n"; + cm::string_view view = cstr; + cm::String str; + str = view; + return testFromCStr(str); +} + +static bool testFromChar(cm::String const& str) +{ + ASSERT_TRUE(str.size() == 1); + ASSERT_TRUE(std::strncmp(str.data(), "a", 1) == 0); + ASSERT_TRUE(str.is_stable()); + return true; +} + +static bool testConstructFromChar() +{ + std::cout << "testConstructFromChar()\n"; + return testFromChar('a'); +} + +static bool testAssignFromChar() +{ + std::cout << "testAssignFromChar()\n"; + cm::String str; + str = 'a'; + return testFromChar(str); +} + +static bool testConstructFromInitList() +{ + std::cout << "testConstructFromInitList()\n"; + cm::String const str{ 'a', 'b', 'c' }; + ASSERT_TRUE(str.size() == 3); + ASSERT_TRUE(std::strncmp(str.data(), "abc", 3) == 0); + ASSERT_TRUE(str.is_stable()); + return true; +} + +static bool testAssignFromInitList() +{ + std::cout << "testAssignFromInitList()\n"; + cm::String str; + str = { 'a', 'b', 'c' }; + ASSERT_TRUE(str.size() == 3); + ASSERT_TRUE(std::strncmp(str.data(), "abc", 3) == 0); + ASSERT_TRUE(str.is_stable()); + return true; +} + +static bool testConstructFromBuffer() +{ + std::cout << "testConstructFromBuffer()\n"; + cm::String const str(cstr, 3); + return testFromCStr(str); +} + +static bool testConstructFromInputIterator() +{ + std::cout << "testConstructFromInputIterator()\n"; + cm::String const str(cstr, cstr + 3); + ASSERT_TRUE(str.data() != cstr); + ASSERT_TRUE(str.size() == 3); + ASSERT_TRUE(std::strncmp(str.data(), cstr, 3) == 0); + ASSERT_TRUE(str.is_stable()); + return true; +} + +static bool testConstructFromN() +{ + std::cout << "testConstructFromN()\n"; + cm::String const str(3, 'a'); + ASSERT_TRUE(str.size() == 3); + ASSERT_TRUE(std::strncmp(str.data(), "aaa", 3) == 0); + ASSERT_TRUE(str.is_stable()); + return true; +} + +static const auto staticStringView = "abc"_s; + +static bool testFromStaticStringView(cm::String str) +{ + cm::String const& str_const = str; + ASSERT_TRUE(str_const.data() == staticStringView.data()); + ASSERT_TRUE(str_const.size() == staticStringView.size()); + ASSERT_TRUE(!str_const.is_stable()); + ASSERT_TRUE(str.c_str() == staticStringView); + ASSERT_TRUE(!str.is_stable()); + cm::String substr = str.substr(1); + cm::String const& substr_const = substr; + ASSERT_TRUE(substr_const.data() == &staticStringView[1]); + ASSERT_TRUE(substr_const.size() == 2); + ASSERT_TRUE(!substr_const.is_stable()); + ASSERT_TRUE(substr.c_str() == &staticStringView[1]); + ASSERT_TRUE(!substr.is_stable()); + return true; +} + +static bool testConstructFromStaticStringView() +{ + std::cout << "testConstructFromStaticStringView()\n"; + return testFromStaticStringView(staticStringView); +} + +static bool testAssignFromStaticStringView() +{ + std::cout << "testAssignFromStaticStringView()\n"; + cm::String str; + str = staticStringView; + return testFromStaticStringView(str); +} + +static bool testConstructCopy() +{ + std::cout << "testConstructCopy()\n"; + cm::String s1 = std::string("abc"); + cm::String s2 = s1; + ASSERT_TRUE(s1.data() == s2.data()); + ASSERT_TRUE(s1.size() == 3); + ASSERT_TRUE(s2.size() == 3); + ASSERT_TRUE(std::strncmp(s2.data(), "abc", 3) == 0); + ASSERT_TRUE(s1.is_stable()); + ASSERT_TRUE(s2.is_stable()); + return true; +} + +static bool testConstructMove() +{ + std::cout << "testConstructMove()\n"; + cm::String s1 = std::string("abc"); + cm::String s2 = std::move(s1); + ASSERT_TRUE(s1.data() == nullptr); + ASSERT_TRUE(s1.size() == 0); + ASSERT_TRUE(s2.size() == 3); + ASSERT_TRUE(std::strncmp(s2.data(), "abc", 3) == 0); + ASSERT_TRUE(s1.is_stable()); + ASSERT_TRUE(s2.is_stable()); + return true; +} + +static bool testAssignCopy() +{ + std::cout << "testAssignCopy()\n"; + cm::String s1 = std::string("abc"); + cm::String s2; + s2 = s1; + ASSERT_TRUE(s1.data() == s2.data()); + ASSERT_TRUE(s1.size() == 3); + ASSERT_TRUE(s2.size() == 3); + ASSERT_TRUE(std::strncmp(s2.data(), "abc", 3) == 0); + ASSERT_TRUE(s1.is_stable()); + ASSERT_TRUE(s2.is_stable()); + return true; +} + +static bool testAssignMove() +{ + std::cout << "testAssignMove()\n"; + cm::String s1 = std::string("abc"); + cm::String s2; + s2 = std::move(s1); + ASSERT_TRUE(s1.data() == nullptr); + ASSERT_TRUE(s1.size() == 0); + ASSERT_TRUE(s2.size() == 3); + ASSERT_TRUE(std::strncmp(s2.data(), "abc", 3) == 0); + ASSERT_TRUE(s1.is_stable()); + ASSERT_TRUE(s2.is_stable()); + return true; +} + +static bool testOperatorBool() +{ + std::cout << "testOperatorBool()\n"; + cm::String str; + ASSERT_TRUE(!str); + str = ""; + ASSERT_TRUE(str); + str = static_cast<const char*>(nullptr); + ASSERT_TRUE(!str); + str = std::string(); + ASSERT_TRUE(str); + str = nullptr; + ASSERT_TRUE(!str); + return true; +} + +static bool testOperatorIndex() +{ + std::cout << "testOperatorIndex()\n"; + cm::String str = "abc"; + ASSERT_TRUE(str[0] == 'a'); + ASSERT_TRUE(str[1] == 'b'); + ASSERT_TRUE(str[2] == 'c'); + return true; +} + +static bool testOperatorPlusEqual() +{ + std::cout << "testOperatorPlusEqual()\n"; + cm::String str = "a"; + str += "b"; + { + const char* c = "c"; + str += c; + } + str += 'd'; + str += std::string("e"); + str += cm::string_view("f", 1); + str += cm::String("g"); + ASSERT_TRUE(str.size() == 7); + ASSERT_TRUE(std::strncmp(str.data(), "abcdefg", 7) == 0); + ASSERT_TRUE(str.is_stable()); + return true; +} + +static bool testOperatorCompare() +{ + std::cout << "testOperatorCompare()\n"; + cm::String str = "b"; + { + ASSERT_TRUE(str == "b"); + ASSERT_TRUE("b" == str); + ASSERT_TRUE(str != "a"); + ASSERT_TRUE("a" != str); + ASSERT_TRUE(str < "c"); + ASSERT_TRUE("a" < str); + ASSERT_TRUE(str > "a"); + ASSERT_TRUE("c" > str); + ASSERT_TRUE(str <= "b"); + ASSERT_TRUE("b" <= str); + ASSERT_TRUE(str >= "b"); + ASSERT_TRUE("b" >= str); + } + { + const char* a = "a"; + const char* b = "b"; + const char* c = "c"; + ASSERT_TRUE(str == b); + ASSERT_TRUE(b == str); + ASSERT_TRUE(str != a); + ASSERT_TRUE(a != str); + ASSERT_TRUE(str < c); + ASSERT_TRUE(a < str); + ASSERT_TRUE(str > a); + ASSERT_TRUE(c > str); + ASSERT_TRUE(str <= b); + ASSERT_TRUE(b <= str); + ASSERT_TRUE(str >= b); + ASSERT_TRUE(b >= str); + } + { + ASSERT_TRUE(str == 'b'); + ASSERT_TRUE('b' == str); + ASSERT_TRUE(str != 'a'); + ASSERT_TRUE('a' != str); + ASSERT_TRUE(str < 'c'); + ASSERT_TRUE('a' < str); + ASSERT_TRUE(str > 'a'); + ASSERT_TRUE('c' > str); + ASSERT_TRUE(str <= 'b'); + ASSERT_TRUE('b' <= str); + ASSERT_TRUE(str >= 'b'); + ASSERT_TRUE('b' >= str); + } + { + std::string const a = "a"; + std::string const b = "b"; + std::string const c = "c"; + ASSERT_TRUE(str == b); + ASSERT_TRUE(b == str); + ASSERT_TRUE(str != a); + ASSERT_TRUE(a != str); + ASSERT_TRUE(str < c); + ASSERT_TRUE(a < str); + ASSERT_TRUE(str > a); + ASSERT_TRUE(c > str); + ASSERT_TRUE(str <= b); + ASSERT_TRUE(b <= str); + ASSERT_TRUE(str >= b); + ASSERT_TRUE(b >= str); + } + { + cm::string_view const a("a", 1); + cm::string_view const b("b", 1); + cm::string_view const c("c", 1); + ASSERT_TRUE(str == b); + ASSERT_TRUE(b == str); + ASSERT_TRUE(str != a); + ASSERT_TRUE(a != str); + ASSERT_TRUE(str < c); + ASSERT_TRUE(a < str); + ASSERT_TRUE(str > a); + ASSERT_TRUE(c > str); + ASSERT_TRUE(str <= b); + ASSERT_TRUE(b <= str); + ASSERT_TRUE(str >= b); + ASSERT_TRUE(b >= str); + } + { + cm::String const a("a"); + cm::String const b("b"); + cm::String const c("c"); + ASSERT_TRUE(str == b); + ASSERT_TRUE(b == str); + ASSERT_TRUE(str != a); + ASSERT_TRUE(a != str); + ASSERT_TRUE(str < c); + ASSERT_TRUE(a < str); + ASSERT_TRUE(str > a); + ASSERT_TRUE(c > str); + ASSERT_TRUE(str <= b); + ASSERT_TRUE(b <= str); + ASSERT_TRUE(str >= b); + ASSERT_TRUE(b >= str); + } + return true; +} + +static bool testOperatorStream() +{ + std::cout << "testOperatorStream()\n"; + std::ostringstream ss; + ss << "a" << cm::String("b") << 'c'; + ASSERT_TRUE(ss.str() == "abc"); + return true; +} + +static bool testOperatorStdStringPlusEqual() +{ + std::cout << "testOperatorStdStringPlusEqual()\n"; + std::string s = "a"; + s += cm::String("b"); + ASSERT_TRUE(s == "ab"); + return true; +} + +static bool testMethod_borrow() +{ + std::cout << "testMethod_borrow()\n"; + std::string s = "abc"; + cm::String str = cm::String::borrow(s); + ASSERT_TRUE(str.data() == s.data()); + ASSERT_TRUE(str.size() == s.size()); + ASSERT_TRUE(str == s); + return true; +} + +static bool testMethod_view() +{ + std::cout << "testMethod_view()\n"; + cm::String str; + ASSERT_TRUE(str.view().data() == nullptr); + ASSERT_TRUE(str.view().size() == 0); + str = charArray; + ASSERT_TRUE(str.view().data() != charArray); + ASSERT_TRUE(str.view().size() == sizeof(charArray) - 1); + str = std::string("abc"); + ASSERT_TRUE(str.view().size() == 3); + ASSERT_TRUE(strncmp(str.view().data(), "abc", 3) == 0); + return true; +} + +static bool testMethod_empty() +{ + std::cout << "testMethod_empty()\n"; + cm::String str; + ASSERT_TRUE(str.empty()); + str = ""; + ASSERT_TRUE(str.empty()); + str = "abc"; + ASSERT_TRUE(!str.empty()); + str = std::string(); + ASSERT_TRUE(str.empty()); + str = std::string("abc"); + ASSERT_TRUE(!str.empty()); + return true; +} + +static bool testMethod_length() +{ + std::cout << "testMethod_length()\n"; + cm::String str; + ASSERT_TRUE(str.length() == 0); + str = ""; + ASSERT_TRUE(str.length() == 0); + str = "abc"; + ASSERT_TRUE(str.length() == 3); + str = std::string(); + ASSERT_TRUE(str.length() == 0); + str = std::string("abc"); + ASSERT_TRUE(str.length() == 3); + return true; +} + +static bool testMethod_at() +{ + std::cout << "testMethod_at()\n"; + cm::String str = "abc"; + ASSERT_TRUE(str.at(0) == 'a'); + ASSERT_TRUE(str.at(1) == 'b'); + ASSERT_TRUE(str.at(2) == 'c'); + bool except_out_of_range = false; + try { + str.at(3); + } catch (std::out_of_range&) { + except_out_of_range = true; + } + ASSERT_TRUE(except_out_of_range); + return true; +} + +static bool testMethod_front_back() +{ + std::cout << "testMethod_front_back()\n"; + cm::String str = "abc"; + ASSERT_TRUE(str.front() == 'a'); + ASSERT_TRUE(str.back() == 'c'); + return true; +} + +static bool testMethodIterators() +{ + std::cout << "testMethodIterators()\n"; + cm::String str = "abc"; + ASSERT_TRUE(*str.begin() == 'a'); + ASSERT_TRUE(*(str.end() - 1) == 'c'); + ASSERT_TRUE(str.end() - str.begin() == 3); + ASSERT_TRUE(*str.cbegin() == 'a'); + ASSERT_TRUE(*(str.cend() - 1) == 'c'); + ASSERT_TRUE(str.cend() - str.cbegin() == 3); + ASSERT_TRUE(*str.rbegin() == 'c'); + ASSERT_TRUE(*(str.rend() - 1) == 'a'); + ASSERT_TRUE(str.rend() - str.rbegin() == 3); + ASSERT_TRUE(*str.crbegin() == 'c'); + ASSERT_TRUE(*(str.crend() - 1) == 'a'); + ASSERT_TRUE(str.crend() - str.crbegin() == 3); + return true; +} + +static bool testMethod_clear() +{ + std::cout << "testMethod_clear()\n"; + cm::String str = "abc"; + ASSERT_TRUE(!str.empty()); + str.clear(); + ASSERT_TRUE(str.empty()); + return true; +} + +static bool testMethod_insert() +{ + std::cout << "testMethod_insert()\n"; + cm::String str = "abc"; + str.insert(1, 2, 'd').insert(0, 1, '_'); + ASSERT_TRUE(str.size() == 6); + ASSERT_TRUE(std::strncmp(str.data(), "_addbc", 6) == 0); + return true; +} + +static bool testMethod_erase() +{ + std::cout << "testMethod_erase()\n"; + cm::String str = "abcdefg"; + str.erase(5).erase(1, 2); + ASSERT_TRUE(str.size() == 3); + ASSERT_TRUE(std::strncmp(str.data(), "ade", 3) == 0); + return true; +} + +static bool testMethod_push_back() +{ + std::cout << "testMethod_push_back()\n"; + cm::String str = "abc"; + str.push_back('d'); + ASSERT_TRUE(str == "abcd"); + return true; +} + +static bool testMethod_pop_back() +{ + std::cout << "testMethod_pop_back()\n"; + cm::String str = "abc"; + str.pop_back(); + ASSERT_TRUE(str == "ab"); + return true; +} + +static bool testMethod_replace() +{ + std::cout << "testMethod_replace()\n"; + { + cm::String str = "abcd"; + const char* bc = "bc"; + ASSERT_TRUE(str.replace(1, 2, "BC") == "aBCd"); + ASSERT_TRUE(str.replace(1, 2, bc) == "abcd"); + ASSERT_TRUE(str.replace(1, 2, 'x') == "axd"); + ASSERT_TRUE(str.replace(1, 1, std::string("bc")) == "abcd"); + ASSERT_TRUE(str.replace(1, 2, cm::string_view("BC", 2)) == "aBCd"); + ASSERT_TRUE(str.replace(1, 2, cm::String("bc")) == "abcd"); + } + { + cm::String str = "abcd"; + const char* bc = "bc"; + ASSERT_TRUE(str.replace(str.begin() + 1, str.begin() + 3, "BC") == "aBCd"); + ASSERT_TRUE(str.replace(str.begin() + 1, str.begin() + 3, bc) == "abcd"); + ASSERT_TRUE(str.replace(str.begin() + 1, str.begin() + 3, 'x') == "axd"); + ASSERT_TRUE(str.replace(str.begin() + 1, str.begin() + 2, + std::string("bc")) == "abcd"); + ASSERT_TRUE(str.replace(str.begin() + 1, str.begin() + 3, + cm::string_view("BC", 2)) == "aBCd"); + ASSERT_TRUE(str.replace(str.begin() + 1, str.begin() + 3, + cm::String("bc")) == "abcd"); + } + { + cm::String str = "abcd"; + const char* bc = "_bc"; + ASSERT_TRUE(str.replace(1, 2, "_BC_", 1, 2) == "aBCd"); + ASSERT_TRUE(str.replace(1, 2, bc, 1) == "abcd"); + ASSERT_TRUE(str.replace(1, 2, 'x', 0) == "axd"); + ASSERT_TRUE(str.replace(1, 1, std::string("_bc_"), 1, 2) == "abcd"); + ASSERT_TRUE(str.replace(1, 2, cm::string_view("_BC", 3), 1) == "aBCd"); + ASSERT_TRUE(str.replace(1, 2, cm::String("_bc_"), 1, 2) == "abcd"); + } + { + cm::String str = "abcd"; + const char* bc = "_bc_"; + ASSERT_TRUE(str.replace(1, 2, 2, 'x') == "axxd"); + ASSERT_TRUE(str.replace(str.begin() + 1, str.begin() + 3, 2, 'y') == + "ayyd"); + ASSERT_TRUE( + str.replace(str.begin() + 1, str.begin() + 3, bc + 1, bc + 3) == "abcd"); + } + return true; +} + +static bool testMethod_copy() +{ + std::cout << "testMethod_copy()\n"; + cm::String str = "abc"; + char dest[2]; + cm::String::size_type n = str.copy(dest, 2, 1); + ASSERT_TRUE(n == 2); + ASSERT_TRUE(std::strncmp(dest, "bc", 2) == 0); + n = str.copy(dest, 2); + ASSERT_TRUE(n == 2); + ASSERT_TRUE(std::strncmp(dest, "ab", 2) == 0); + return true; +} + +static bool testMethod_resize() +{ + std::cout << "testMethod_resize()\n"; + cm::String str = "abc"; + str.resize(3); + ASSERT_TRUE(str == "abc"); + str.resize(2); + ASSERT_TRUE(str == "ab"); + str.resize(3, 'c'); + ASSERT_TRUE(str == "abc"); + return true; +} + +static bool testMethod_swap() +{ + std::cout << "testMethod_swap()\n"; + cm::String str1 = std::string("1"); + cm::String str2 = std::string("2"); + str1.swap(str2); + ASSERT_TRUE(str1 == "2"); + ASSERT_TRUE(str2 == "1"); + return true; +} + +static bool testMethod_substr_AtEnd(cm::String str) +{ + cm::String substr = str.substr(1); + ASSERT_TRUE(substr.data() == str.data() + 1); + ASSERT_TRUE(substr.size() == 2); + ASSERT_TRUE(!substr.is_stable()); + + // c_str() at the end of the buffer does not internally mutate. + ASSERT_TRUE(std::strcmp(substr.c_str(), "bc") == 0); + ASSERT_TRUE(substr.c_str() == str.data() + 1); + ASSERT_TRUE(substr.data() == str.data() + 1); + ASSERT_TRUE(substr.size() == 2); + ASSERT_TRUE(!substr.is_stable()); + + // str() internally mutates. + ASSERT_TRUE(substr.str() == "bc"); + ASSERT_TRUE(substr.is_stable()); + ASSERT_TRUE(substr.data() != str.data() + 1); + ASSERT_TRUE(substr.size() == 2); + ASSERT_TRUE(substr.c_str() != str.data() + 1); + ASSERT_TRUE(std::strcmp(substr.c_str(), "bc") == 0); + return true; +} + +static bool testMethod_substr_AtEndBorrowed() +{ + std::cout << "testMethod_substr_AtEndBorrowed()\n"; + return testMethod_substr_AtEnd("abc"_s); +} + +static bool testMethod_substr_AtEndOwned() +{ + std::cout << "testMethod_substr_AtEndOwned()\n"; + return testMethod_substr_AtEnd(std::string("abc")); +} + +static bool testMethod_substr_AtStart(cm::String str) +{ + { + cm::String substr = str.substr(0, 2); + ASSERT_TRUE(substr.data() == str.data()); + ASSERT_TRUE(substr.size() == 2); + + // c_str() not at the end of the buffer internally mutates. + const char* substr_c = substr.c_str(); + ASSERT_TRUE(std::strcmp(substr_c, "ab") == 0); + ASSERT_TRUE(substr_c != str.data()); + ASSERT_TRUE(substr.data() != str.data()); + ASSERT_TRUE(substr.size() == 2); + ASSERT_TRUE(substr.is_stable()); + + // str() does not need to internally mutate after c_str() did so + ASSERT_TRUE(substr.str() == "ab"); + ASSERT_TRUE(substr.is_stable()); + ASSERT_TRUE(substr.data() == substr_c); + ASSERT_TRUE(substr.size() == 2); + ASSERT_TRUE(substr.c_str() == substr_c); + } + + { + cm::String substr = str.substr(0, 2); + ASSERT_TRUE(substr.data() == str.data()); + ASSERT_TRUE(substr.size() == 2); + ASSERT_TRUE(!substr.is_stable()); + + // str() internally mutates. + ASSERT_TRUE(substr.str() == "ab"); + ASSERT_TRUE(substr.is_stable()); + ASSERT_TRUE(substr.data() != str.data()); + ASSERT_TRUE(substr.size() == 2); + ASSERT_TRUE(substr.c_str() != str.data()); + + // c_str() does not internally after str() did so + const char* substr_c = substr.c_str(); + ASSERT_TRUE(std::strcmp(substr_c, "ab") == 0); + ASSERT_TRUE(substr_c == substr.data()); + ASSERT_TRUE(substr.size() == 2); + ASSERT_TRUE(substr.is_stable()); + } + + return true; +} + +static bool testMethod_substr_AtStartBorrowed() +{ + std::cout << "testMethod_substr_AtStartBorrowed()\n"; + return testMethod_substr_AtStart("abc"_s); +} + +static bool testMethod_substr_AtStartOwned() +{ + std::cout << "testMethod_substr_AtStartOwned()\n"; + return testMethod_substr_AtStart(std::string("abc")); +} + +static bool testMethod_compare() +{ + std::cout << "testMethod_compare()\n"; + cm::String str = "b"; + ASSERT_TRUE(str.compare("a") > 0); + ASSERT_TRUE(str.compare("b") == 0); + ASSERT_TRUE(str.compare("c") < 0); + { + const char* a = "a"; + const char* b = "b"; + const char* c = "c"; + ASSERT_TRUE(str.compare(a) > 0); + ASSERT_TRUE(str.compare(b) == 0); + ASSERT_TRUE(str.compare(c) < 0); + } + ASSERT_TRUE(str.compare('a') > 0); + ASSERT_TRUE(str.compare('b') == 0); + ASSERT_TRUE(str.compare('c') < 0); + ASSERT_TRUE(str.compare(std::string("a")) > 0); + ASSERT_TRUE(str.compare(std::string("b")) == 0); + ASSERT_TRUE(str.compare(std::string("c")) < 0); + ASSERT_TRUE(str.compare(cm::string_view("a_", 1)) > 0); + ASSERT_TRUE(str.compare(cm::string_view("b_", 1)) == 0); + ASSERT_TRUE(str.compare(cm::string_view("c_", 1)) < 0); + ASSERT_TRUE(str.compare(cm::String("a")) > 0); + ASSERT_TRUE(str.compare(cm::String("b")) == 0); + ASSERT_TRUE(str.compare(cm::String("c")) < 0); + ASSERT_TRUE(str.compare(0, 1, cm::string_view("a", 1)) > 0); + ASSERT_TRUE(str.compare(1, 0, cm::string_view("", 0)) == 0); + ASSERT_TRUE(str.compare(0, 1, cm::string_view("ac", 2), 1, 1) < 0); + ASSERT_TRUE(str.compare(1, 0, "") == 0); + ASSERT_TRUE(str.compare(1, 0, "_", 0) == 0); + return true; +} + +static bool testMethod_find() +{ + std::cout << "testMethod_find()\n"; + cm::String str = "abcabc"; + ASSERT_TRUE(str.find("a") == 0); + ASSERT_TRUE(str.find("a", 1) == 3); + { + const char* a = "a"; + ASSERT_TRUE(str.find(a) == 0); + ASSERT_TRUE(str.find(a, 1) == 3); + } + ASSERT_TRUE(str.find('a') == 0); + ASSERT_TRUE(str.find('a', 1) == 3); + ASSERT_TRUE(str.find(std::string("a")) == 0); + ASSERT_TRUE(str.find(std::string("a"), 1) == 3); + ASSERT_TRUE(str.find(cm::string_view("a_", 1)) == 0); + ASSERT_TRUE(str.find(cm::string_view("a_", 1), 1) == 3); + ASSERT_TRUE(str.find(cm::String("a")) == 0); + ASSERT_TRUE(str.find(cm::String("a"), 1) == 3); + ASSERT_TRUE(str.find("ab_", 1, 2) == 3); + return true; +} + +static bool testMethod_rfind() +{ + std::cout << "testMethod_rfind()\n"; + cm::String str = "abcabc"; + ASSERT_TRUE(str.rfind("a") == 3); + ASSERT_TRUE(str.rfind("a", 1) == 0); + { + const char* a = "a"; + ASSERT_TRUE(str.rfind(a) == 3); + ASSERT_TRUE(str.rfind(a, 1) == 0); + } + ASSERT_TRUE(str.rfind('a') == 3); + ASSERT_TRUE(str.rfind('a', 1) == 0); + ASSERT_TRUE(str.rfind(std::string("a")) == 3); + ASSERT_TRUE(str.rfind(std::string("a"), 1) == 0); + ASSERT_TRUE(str.rfind(cm::string_view("a_", 1)) == 3); + ASSERT_TRUE(str.rfind(cm::string_view("a_", 1), 1) == 0); + ASSERT_TRUE(str.rfind(cm::String("a")) == 3); + ASSERT_TRUE(str.rfind(cm::String("a"), 1) == 0); + ASSERT_TRUE(str.rfind("ab_", 1, 2) == 0); + return true; +} + +static bool testMethod_find_first_of() +{ + std::cout << "testMethod_find_first_of()\n"; + cm::String str = "abcabc"; + ASSERT_TRUE(str.find_first_of("_a") == 0); + ASSERT_TRUE(str.find_first_of("_a", 1) == 3); + { + const char* a = "_a"; + ASSERT_TRUE(str.find_first_of(a) == 0); + ASSERT_TRUE(str.find_first_of(a, 1) == 3); + } + ASSERT_TRUE(str.find_first_of('a') == 0); + ASSERT_TRUE(str.find_first_of('a', 1) == 3); + ASSERT_TRUE(str.find_first_of(std::string("_a")) == 0); + ASSERT_TRUE(str.find_first_of(std::string("_a"), 1) == 3); + ASSERT_TRUE(str.find_first_of(cm::string_view("ba_", 1)) == 1); + ASSERT_TRUE(str.find_first_of(cm::string_view("ba_", 1), 2) == 4); + ASSERT_TRUE(str.find_first_of(cm::String("ab")) == 0); + ASSERT_TRUE(str.find_first_of(cm::String("ab"), 2) == 3); + ASSERT_TRUE(str.find_first_of("_ab", 1, 2) == 3); + return true; +} + +static bool testMethod_find_first_not_of() +{ + std::cout << "testMethod_find_first_not_of()\n"; + cm::String str = "abcabc"; + ASSERT_TRUE(str.find_first_not_of("_a") == 1); + ASSERT_TRUE(str.find_first_not_of("_a", 2) == 2); + { + const char* a = "_a"; + ASSERT_TRUE(str.find_first_not_of(a) == 1); + ASSERT_TRUE(str.find_first_not_of(a, 2) == 2); + } + ASSERT_TRUE(str.find_first_not_of('a') == 1); + ASSERT_TRUE(str.find_first_not_of('a', 2) == 2); + ASSERT_TRUE(str.find_first_not_of(std::string("_a")) == 1); + ASSERT_TRUE(str.find_first_not_of(std::string("_a"), 2) == 2); + ASSERT_TRUE(str.find_first_not_of(cm::string_view("ba_", 1)) == 0); + ASSERT_TRUE(str.find_first_not_of(cm::string_view("ba_", 1), 1) == 2); + ASSERT_TRUE(str.find_first_not_of(cm::String("_a")) == 1); + ASSERT_TRUE(str.find_first_not_of(cm::String("_a"), 2) == 2); + ASSERT_TRUE(str.find_first_not_of("_bca", 1, 3) == 3); + return true; +} + +static bool testMethod_find_last_of() +{ + std::cout << "testMethod_find_last_of()\n"; + cm::String str = "abcabc"; + ASSERT_TRUE(str.find_last_of("_a") == 3); + ASSERT_TRUE(str.find_last_of("_a", 1) == 0); + { + const char* a = "_a"; + ASSERT_TRUE(str.find_last_of(a) == 3); + ASSERT_TRUE(str.find_last_of(a, 1) == 0); + } + ASSERT_TRUE(str.find_last_of('a') == 3); + ASSERT_TRUE(str.find_last_of('a', 1) == 0); + ASSERT_TRUE(str.find_last_of(std::string("_a")) == 3); + ASSERT_TRUE(str.find_last_of(std::string("_a"), 1) == 0); + ASSERT_TRUE(str.find_last_of(cm::string_view("ba_", 1)) == 4); + ASSERT_TRUE(str.find_last_of(cm::string_view("ba_", 1), 2) == 1); + ASSERT_TRUE(str.find_last_of(cm::String("ab")) == 4); + ASSERT_TRUE(str.find_last_of(cm::String("ab"), 2) == 1); + ASSERT_TRUE(str.find_last_of("_ab", 1, 2) == 0); + return true; +} + +static bool testMethod_find_last_not_of() +{ + std::cout << "testMethod_find_last_not_of()\n"; + cm::String str = "abcabc"; + ASSERT_TRUE(str.find_last_not_of("_a") == 5); + ASSERT_TRUE(str.find_last_not_of("_a", 1) == 1); + { + const char* a = "_a"; + ASSERT_TRUE(str.find_last_not_of(a) == 5); + ASSERT_TRUE(str.find_last_not_of(a, 1) == 1); + } + ASSERT_TRUE(str.find_last_not_of('a') == 5); + ASSERT_TRUE(str.find_last_not_of('a', 1) == 1); + ASSERT_TRUE(str.find_last_not_of(std::string("_a")) == 5); + ASSERT_TRUE(str.find_last_not_of(std::string("_a"), 1) == 1); + ASSERT_TRUE(str.find_last_not_of(cm::string_view("cb_", 1)) == 4); + ASSERT_TRUE(str.find_last_not_of(cm::string_view("cb_", 1), 2) == 1); + ASSERT_TRUE(str.find_last_not_of(cm::String("_a")) == 5); + ASSERT_TRUE(str.find_last_not_of(cm::String("_a"), 1) == 1); + ASSERT_TRUE(str.find_last_not_of("cb_", 2, 2) == 0); + return true; +} + +static bool testAddition() +{ + std::cout << "testAddition()\n"; + { + ASSERT_TRUE(cm::String("a") + "b" == "ab"); + ASSERT_TRUE("ab" == "a" + cm::String("b")); + ASSERT_TRUE("a" + cm::String("b") + "c" == "abc"); + ASSERT_TRUE("abc" == "a" + cm::String("b") + "c"); + ASSERT_TRUE("a" + (cm::String("b") + "c") + "d" == "abcd"); + ASSERT_TRUE("abcd" == "a" + (cm::String("b") + "c") + "d"); + } + { + ASSERT_TRUE(cm::String("a"_s) + "b"_s == "ab"_s); + ASSERT_TRUE("ab"_s == "a"_s + cm::String("b"_s)); + ASSERT_TRUE("a"_s + cm::String("b"_s) + "c"_s == "abc"_s); + ASSERT_TRUE("abc"_s == "a"_s + cm::String("b"_s) + "c"_s); + ASSERT_TRUE("a"_s + (cm::String("b"_s) + "c"_s) + "d"_s == "abcd"_s); + ASSERT_TRUE("abcd"_s == "a"_s + (cm::String("b"_s) + "c"_s) + "d"_s); + } + { + const char* a = "a"; + const char* b = "b"; + const char* ab = "ab"; + ASSERT_TRUE(cm::String(a) + b == ab); + ASSERT_TRUE(ab == a + cm::String(b)); + const char* c = "c"; + const char* abc = "abc"; + ASSERT_TRUE(a + cm::String(b) + c == abc); + ASSERT_TRUE(abc == a + cm::String(b) + c); + const char* d = "d"; + const char* abcd = "abcd"; + ASSERT_TRUE(a + (cm::String(b) + c) + d == abcd); + ASSERT_TRUE(abcd == a + (cm::String(b) + c) + d); + } + { + ASSERT_TRUE(cm::String('a') + 'b' == "ab"); + ASSERT_TRUE("ab" == 'a' + cm::String('b')); + ASSERT_TRUE('a' + cm::String('b') + 'c' == "abc"); + ASSERT_TRUE("abc" == 'a' + cm::String('b') + 'c'); + ASSERT_TRUE('a' + (cm::String('b') + 'c') + 'd' == "abcd"); + ASSERT_TRUE("abcd" == 'a' + (cm::String('b') + 'c') + 'd'); + } + { + std::string a = "a"; + std::string b = "b"; + std::string ab = "ab"; + ASSERT_TRUE(cm::String(a) + b == ab); + ASSERT_TRUE(ab == a + cm::String(b)); + std::string c = "c"; + std::string abc = "abc"; + ASSERT_TRUE(a + cm::String(b) + c == abc); + ASSERT_TRUE(abc == a + cm::String(b) + c); + std::string d = "d"; + std::string abcd = "abcd"; + ASSERT_TRUE(a + (cm::String(b) + c) + d == abcd); + ASSERT_TRUE(abcd == a + (cm::String(b) + c) + d); + } + { + cm::string_view a("a", 1); + cm::string_view b("b", 1); + cm::string_view ab("ab", 2); + ASSERT_TRUE(cm::String(a) + b == ab); + ASSERT_TRUE(ab == a + cm::String(b)); + cm::string_view c("c", 1); + cm::string_view abc("abc", 3); + ASSERT_TRUE(a + cm::String(b) + c == abc); + ASSERT_TRUE(abc == a + cm::String(b) + c); + cm::string_view d("d", 1); + cm::string_view abcd("abcd", 4); + ASSERT_TRUE(a + (cm::String(b) + c) + d == abcd); + ASSERT_TRUE(abcd == a + (cm::String(b) + c) + d); + } + { + cm::String a = "a"; + cm::String b = "b"; + cm::String ab = "ab"; + ASSERT_TRUE(a + b == ab); + ASSERT_TRUE(ab == a + b); + cm::String c = "c"; + cm::String abc = "abc"; + ASSERT_TRUE(a + cm::String(b) + c == abc); + ASSERT_TRUE(abc == a + cm::String(b) + c); + cm::String d = "d"; + cm::String abcd = "abcd"; + ASSERT_TRUE(a + (cm::String(b) + c) + d == abcd); + ASSERT_TRUE(abcd == a + (cm::String(b) + c) + d); + } + { + cm::String str; + str += "a" + cm::String("b") + 'c'; + ASSERT_TRUE(str == "abc"); + ASSERT_TRUE(str.is_stable()); + } + { + std::string s; + s += "a" + cm::String("b") + 'c'; + ASSERT_TRUE(s == "abc"); + } + { + std::ostringstream ss; + ss << ("a" + cm::String("b") + 'c'); + ASSERT_TRUE(ss.str() == "abc"); + } + return true; +} + +static bool testStability() +{ + std::cout << "testStability()\n"; + cm::String str = "abc"_s; + ASSERT_TRUE(!str.is_stable()); + ASSERT_TRUE(str.str_if_stable() == nullptr); + str.stabilize(); + ASSERT_TRUE(str.is_stable()); + std::string const* str_if_stable = str.str_if_stable(); + ASSERT_TRUE(str_if_stable != nullptr); + ASSERT_TRUE(*str_if_stable == "abc"); + str.stabilize(); + ASSERT_TRUE(str.is_stable()); + ASSERT_TRUE(str.str_if_stable() == str_if_stable); + return true; +} + +int testString(int /*unused*/, char* /*unused*/ []) +{ + if (!testConstructDefault()) { + return 1; + } + if (!testConstructFromNullPtr()) { + return 1; + } + if (!testConstructFromCStrNull()) { + return 1; + } + if (!testConstructFromCharArray()) { + return 1; + } + if (!testConstructFromCStr()) { + return 1; + } + if (!testConstructFromStdString()) { + return 1; + } + if (!testConstructFromView()) { + return 1; + } + if (!testConstructFromChar()) { + return 1; + } + if (!testConstructFromInitList()) { + return 1; + } + if (!testConstructFromBuffer()) { + return 1; + } + if (!testConstructFromInputIterator()) { + return 1; + } + if (!testConstructFromN()) { + return 1; + } + if (!testConstructFromStaticStringView()) { + return 1; + } + if (!testConstructCopy()) { + return 1; + } + if (!testConstructMove()) { + return 1; + } + if (!testAssignCopy()) { + return 1; + } + if (!testAssignMove()) { + return 1; + } + if (!testAssignFromChar()) { + return 1; + } + if (!testAssignFromView()) { + return 1; + } + if (!testAssignFromStdString()) { + return 1; + } + if (!testAssignFromCStr()) { + return 1; + } + if (!testAssignFromCharArray()) { + return 1; + } + if (!testAssignFromCStrNull()) { + return 1; + } + if (!testAssignFromNullPtr()) { + return 1; + } + if (!testAssignFromInitList()) { + return 1; + } + if (!testAssignFromStaticStringView()) { + return 1; + } + if (!testOperatorBool()) { + return 1; + } + if (!testOperatorIndex()) { + return 1; + } + if (!testOperatorPlusEqual()) { + return 1; + } + if (!testOperatorCompare()) { + return 1; + } + if (!testOperatorStream()) { + return 1; + } + if (!testOperatorStdStringPlusEqual()) { + return 1; + } + if (!testMethod_borrow()) { + return 1; + } + if (!testMethod_view()) { + return 1; + } + if (!testMethod_empty()) { + return 1; + } + if (!testMethod_length()) { + return 1; + } + if (!testMethod_at()) { + return 1; + } + if (!testMethod_front_back()) { + return 1; + } + if (!testMethod_clear()) { + return 1; + } + if (!testMethod_insert()) { + return 1; + } + if (!testMethod_erase()) { + return 1; + } + if (!testMethod_push_back()) { + return 1; + } + if (!testMethod_pop_back()) { + return 1; + } + if (!testMethod_replace()) { + return 1; + } + if (!testMethod_copy()) { + return 1; + } + if (!testMethod_resize()) { + return 1; + } + if (!testMethod_swap()) { + return 1; + } + if (!testMethodIterators()) { + return 1; + } + if (!testMethod_substr_AtEndBorrowed()) { + return 1; + } + if (!testMethod_substr_AtEndOwned()) { + return 1; + } + if (!testMethod_substr_AtStartBorrowed()) { + return 1; + } + if (!testMethod_substr_AtStartOwned()) { + return 1; + } + if (!testMethod_compare()) { + return 1; + } + if (!testMethod_find()) { + return 1; + } + if (!testMethod_rfind()) { + return 1; + } + if (!testMethod_find_first_of()) { + return 1; + } + if (!testMethod_find_first_not_of()) { + return 1; + } + if (!testMethod_find_last_of()) { + return 1; + } + if (!testMethod_find_last_not_of()) { + return 1; + } + if (!testAddition()) { + return 1; + } + if (!testStability()) { + return 1; + } + return 0; +} diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 132855b..2a8d3e6 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -1388,6 +1388,10 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release add_subdirectory(FindGDAL) endif() + if(CMake_TEST_FindGIF) + add_subdirectory(FindGIF) + endif() + if(CMake_TEST_FindGSL) add_subdirectory(FindGSL) endif() @@ -1413,6 +1417,10 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release add_subdirectory(FindJsonCpp) endif() + if(CMake_TEST_FindLibLZMA) + add_subdirectory(FindLibLZMA) + endif() + if(CMake_TEST_FindLibRHash) add_subdirectory(FindLibRHash) endif() @@ -1437,6 +1445,10 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release add_subdirectory(FindODBC) endif() + if(CMake_TEST_FindOctave) + add_subdirectory(FindOctave) + endif() + if(CMake_TEST_FindOpenCL) add_subdirectory(FindOpenCL) endif() @@ -1485,6 +1497,10 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release add_subdirectory(FindVulkan) endif() + if(CMake_TEST_FindX11) + add_subdirectory(FindX11) + endif() + if(CMake_TEST_FindXalanC) add_subdirectory(FindXalanC) endif() diff --git a/Tests/CMakeOnly/CMakeLists.txt b/Tests/CMakeOnly/CMakeLists.txt index 204d54c..f40524f 100644 --- a/Tests/CMakeOnly/CMakeLists.txt +++ b/Tests/CMakeOnly/CMakeLists.txt @@ -56,7 +56,7 @@ add_test(CMakeOnly.ProjectInclude ${CMAKE_CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/Test.cmake ) -include(${CMAKE_SOURCE_DIR}/Modules/CMakeParseArguments.cmake) +include(CMakeParseArguments) function(add_major_test module) cmake_parse_arguments(MAJOR_TEST "NOLANG" "VERSION_VAR" "VERSIONS" ${ARGN}) diff --git a/Tests/CMakeTests/StringTest.cmake.in b/Tests/CMakeTests/StringTest.cmake.in index 566f4b1..154afa7 100644 --- a/Tests/CMakeTests/StringTest.cmake.in +++ b/Tests/CMakeTests/StringTest.cmake.in @@ -81,7 +81,7 @@ check_cmake_test(String # Execute each test listed in StringTestScript.cmake: # set(scriptname "@CMAKE_CURRENT_SOURCE_DIR@/StringTestScript.cmake") -set(number_of_tests_expected 70) +set(number_of_tests_expected 74) include("@CMAKE_CURRENT_SOURCE_DIR@/ExecuteScriptTests.cmake") execute_all_script_tests(${scriptname} number_of_tests_executed) diff --git a/Tests/CMakeTests/StringTestScript.cmake b/Tests/CMakeTests/StringTestScript.cmake index 44d5653..e069897 100644 --- a/Tests/CMakeTests/StringTestScript.cmake +++ b/Tests/CMakeTests/StringTestScript.cmake @@ -1,5 +1,18 @@ message(STATUS "testname='${testname}'") +function(test_configure_line_number EXPRESSION POLICY) + cmake_policy(PUSH) + cmake_policy(SET CMP0053 ${POLICY}) + string(CONFIGURE + "${EXPRESSION}" v) # line should indicate string() call + math(EXPR vplus3 "${v} + 3") + if(NOT ${CMAKE_CURRENT_LIST_LINE} EQUAL ${vplus3}) + message(SEND_ERROR "Couldn't configure CMAKE_CURRENT_LIST_LINE, evaluated into '${v}'") + endif() + message(STATUS "v='${v}'") + cmake_policy(POP) +endfunction() + if(testname STREQUAL empty) # fail string() @@ -32,6 +45,18 @@ elseif(testname STREQUAL configure_escape_quotes) # pass string(CONFIGURE "this is @testname@" v ESCAPE_QUOTES) message(STATUS "v='${v}'") +elseif(testname STREQUAL configure_line_number_CMP0053_old) # pass + test_configure_line_number("\${CMAKE_CURRENT_LIST_LINE}" OLD) + +elseif(testname STREQUAL configure_line_number_CMP0053_new) # pass + test_configure_line_number("\${CMAKE_CURRENT_LIST_LINE}" NEW) + +elseif(testname STREQUAL configure_line_number_CMP0053_old_use_at) # pass + test_configure_line_number("\@CMAKE_CURRENT_LIST_LINE\@" OLD) + +elseif(testname STREQUAL configure_line_number_CMP0053_new_use_at) # pass + test_configure_line_number("\@CMAKE_CURRENT_LIST_LINE\@" NEW) + elseif(testname STREQUAL configure_bogus) # fail string(CONFIGURE "this is @testname@" v ESCAPE_QUOTES BOGUS) diff --git a/Tests/CTestBuildCommandProjectInSubdir/CTestBuildCommandProjectInSubdir.cmake.in b/Tests/CTestBuildCommandProjectInSubdir/CTestBuildCommandProjectInSubdir.cmake.in index 670a874..0f56781 100644 --- a/Tests/CTestBuildCommandProjectInSubdir/CTestBuildCommandProjectInSubdir.cmake.in +++ b/Tests/CTestBuildCommandProjectInSubdir/CTestBuildCommandProjectInSubdir.cmake.in @@ -3,7 +3,6 @@ cmake_minimum_required(VERSION 2.8.10) set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/VSProjectInSubdir") set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestBuildCommandProjectInSubdir/Nested") set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") -set(CTEST_PROJECT_NAME "VSProjectInSubdir") set(CTEST_BUILD_CONFIGURATION "@CTestTest_CONFIG@") ctest_empty_binary_directory(${CTEST_BINARY_DIRECTORY}) diff --git a/Tests/CTestConfig/script.cmake.in b/Tests/CTestConfig/script.cmake.in index b6ccedb..973c7b8 100644 --- a/Tests/CTestConfig/script.cmake.in +++ b/Tests/CTestConfig/script.cmake.in @@ -1,7 +1,6 @@ set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") set(CTEST_CMAKE_GENERATOR_PLATFORM "@CMAKE_GENERATOR_PLATFORM@") set(CTEST_CMAKE_GENERATOR_TOOLSET "@CMAKE_GENERATOR_TOOLSET@") -set(CTEST_PROJECT_NAME "CTestConfig") set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestConfig") set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestConfig/@cfg@-script") diff --git a/Tests/CTestCoverageCollectGCOV/test.cmake.in b/Tests/CTestCoverageCollectGCOV/test.cmake.in index d48ef61..2c98876 100644 --- a/Tests/CTestCoverageCollectGCOV/test.cmake.in +++ b/Tests/CTestCoverageCollectGCOV/test.cmake.in @@ -1,5 +1,4 @@ cmake_minimum_required(VERSION 2.8.12) -set(CTEST_PROJECT_NAME "TestProject") set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestCoverageCollectGCOV/TestProject") set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestCoverageCollectGCOV/TestProject") set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") diff --git a/Tests/CTestTestBadExe/CTestConfig.cmake b/Tests/CTestTestBadExe/CTestConfig.cmake index c7286e2..5bc1e9e 100644 --- a/Tests/CTestTestBadExe/CTestConfig.cmake +++ b/Tests/CTestTestBadExe/CTestConfig.cmake @@ -1,7 +1,4 @@ -set (CTEST_PROJECT_NAME "CTestTestBadExe") set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT") -set (CTEST_DART_SERVER_VERSION "2") set(CTEST_DROP_METHOD "http") set(CTEST_DROP_SITE "open.cdash.org") set(CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard") -set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestBadGenerator/CTestConfig.cmake b/Tests/CTestTestBadGenerator/CTestConfig.cmake index 1e61bf4..5bc1e9e 100644 --- a/Tests/CTestTestBadGenerator/CTestConfig.cmake +++ b/Tests/CTestTestBadGenerator/CTestConfig.cmake @@ -1,7 +1,4 @@ -set (CTEST_PROJECT_NAME "CTestTestBadGenerator") set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT") -set (CTEST_DART_SERVER_VERSION "2") set(CTEST_DROP_METHOD "http") set(CTEST_DROP_SITE "open.cdash.org") set(CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard") -set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestCostSerial/CTestConfig.cmake b/Tests/CTestTestCostSerial/CTestConfig.cmake index 3ab99ac..bd265f9 100644 --- a/Tests/CTestTestCostSerial/CTestConfig.cmake +++ b/Tests/CTestTestCostSerial/CTestConfig.cmake @@ -1,7 +1,4 @@ -set(CTEST_PROJECT_NAME "CTestTestCostSerial") set(CTEST_NIGHTLY_START_TIME "21:00:00 EDT") -set(CTEST_DART_SERVER_VERSION "2") set(CTEST_DROP_METHOD "http") set(CTEST_DROP_SITE "open.cdash.org") set(CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard") -set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestCrash/CTestConfig.cmake b/Tests/CTestTestCrash/CTestConfig.cmake index 5c2ca0e..5bc1e9e 100644 --- a/Tests/CTestTestCrash/CTestConfig.cmake +++ b/Tests/CTestTestCrash/CTestConfig.cmake @@ -1,7 +1,4 @@ -set (CTEST_PROJECT_NAME "CTestTestCrash") set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT") -set (CTEST_DART_SERVER_VERSION "2") set(CTEST_DROP_METHOD "http") set(CTEST_DROP_SITE "open.cdash.org") set(CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard") -set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestCycle/CTestConfig.cmake b/Tests/CTestTestCycle/CTestConfig.cmake index 8aeb09b..5bc1e9e 100644 --- a/Tests/CTestTestCycle/CTestConfig.cmake +++ b/Tests/CTestTestCycle/CTestConfig.cmake @@ -1,7 +1,4 @@ -set (CTEST_PROJECT_NAME "CTestTestCycle") set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT") -set (CTEST_DART_SERVER_VERSION "2") set(CTEST_DROP_METHOD "http") set(CTEST_DROP_SITE "open.cdash.org") set(CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard") -set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestDepends/CTestConfig.cmake b/Tests/CTestTestDepends/CTestConfig.cmake index 7af9200..5bc1e9e 100644 --- a/Tests/CTestTestDepends/CTestConfig.cmake +++ b/Tests/CTestTestDepends/CTestConfig.cmake @@ -1,7 +1,4 @@ -set (CTEST_PROJECT_NAME "CTestTestDepends") set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT") -set (CTEST_DART_SERVER_VERSION "2") set(CTEST_DROP_METHOD "http") set(CTEST_DROP_SITE "open.cdash.org") set(CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard") -set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestFailure/CTestConfig.cmake b/Tests/CTestTestFailure/CTestConfig.cmake index 07e1be0..5bc1e9e 100644 --- a/Tests/CTestTestFailure/CTestConfig.cmake +++ b/Tests/CTestTestFailure/CTestConfig.cmake @@ -1,7 +1,4 @@ -set (CTEST_PROJECT_NAME "CTestTestFailure") set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT") -set (CTEST_DART_SERVER_VERSION "2") set(CTEST_DROP_METHOD "http") set(CTEST_DROP_SITE "open.cdash.org") set(CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard") -set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestFdSetSize/CTestConfig.cmake b/Tests/CTestTestFdSetSize/CTestConfig.cmake deleted file mode 100644 index b5f3c33..0000000 --- a/Tests/CTestTestFdSetSize/CTestConfig.cmake +++ /dev/null @@ -1 +0,0 @@ -set(CTEST_PROJECT_NAME "CTestTestFdSetSize") diff --git a/Tests/CTestTestLaunchers/launcher_compiler_test_project/CTestConfig.cmake b/Tests/CTestTestLaunchers/launcher_compiler_test_project/CTestConfig.cmake index 669b0fb..c08eded 100644 --- a/Tests/CTestTestLaunchers/launcher_compiler_test_project/CTestConfig.cmake +++ b/Tests/CTestTestLaunchers/launcher_compiler_test_project/CTestConfig.cmake @@ -1,8 +1,5 @@ set(CTEST_USE_LAUNCHERS 1) -set(CTEST_PROJECT_NAME "CTestTestLaunchers") set(CTEST_NIGHTLY_START_TIME "21:00:00 EDT") -set(CTEST_DART_SERVER_VERSION "2") set(CTEST_DROP_METHOD "http") set(CTEST_DROP_SITE "open.cdash.org") set(CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard") -set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestLaunchers/launcher_custom_command_test_project/CTestConfig.cmake b/Tests/CTestTestLaunchers/launcher_custom_command_test_project/CTestConfig.cmake index 669b0fb..c08eded 100644 --- a/Tests/CTestTestLaunchers/launcher_custom_command_test_project/CTestConfig.cmake +++ b/Tests/CTestTestLaunchers/launcher_custom_command_test_project/CTestConfig.cmake @@ -1,8 +1,5 @@ set(CTEST_USE_LAUNCHERS 1) -set(CTEST_PROJECT_NAME "CTestTestLaunchers") set(CTEST_NIGHTLY_START_TIME "21:00:00 EDT") -set(CTEST_DART_SERVER_VERSION "2") set(CTEST_DROP_METHOD "http") set(CTEST_DROP_SITE "open.cdash.org") set(CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard") -set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestLaunchers/launcher_linker_test_project/CTestConfig.cmake b/Tests/CTestTestLaunchers/launcher_linker_test_project/CTestConfig.cmake index 669b0fb..c08eded 100644 --- a/Tests/CTestTestLaunchers/launcher_linker_test_project/CTestConfig.cmake +++ b/Tests/CTestTestLaunchers/launcher_linker_test_project/CTestConfig.cmake @@ -1,8 +1,5 @@ set(CTEST_USE_LAUNCHERS 1) -set(CTEST_PROJECT_NAME "CTestTestLaunchers") set(CTEST_NIGHTLY_START_TIME "21:00:00 EDT") -set(CTEST_DART_SERVER_VERSION "2") set(CTEST_DROP_METHOD "http") set(CTEST_DROP_SITE "open.cdash.org") set(CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard") -set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestParallel/CTestConfig.cmake b/Tests/CTestTestParallel/CTestConfig.cmake index fc5b666..bd265f9 100644 --- a/Tests/CTestTestParallel/CTestConfig.cmake +++ b/Tests/CTestTestParallel/CTestConfig.cmake @@ -1,7 +1,4 @@ -set(CTEST_PROJECT_NAME "CTestTestParallel") set(CTEST_NIGHTLY_START_TIME "21:00:00 EDT") -set(CTEST_DART_SERVER_VERSION "2") set(CTEST_DROP_METHOD "http") set(CTEST_DROP_SITE "open.cdash.org") set(CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard") -set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestResourceLock/CTestConfig.cmake b/Tests/CTestTestResourceLock/CTestConfig.cmake index c118777..bd265f9 100644 --- a/Tests/CTestTestResourceLock/CTestConfig.cmake +++ b/Tests/CTestTestResourceLock/CTestConfig.cmake @@ -1,7 +1,4 @@ -set(CTEST_PROJECT_NAME "CTestTestResourceLock") set(CTEST_NIGHTLY_START_TIME "21:00:00 EDT") -set(CTEST_DART_SERVER_VERSION "2") set(CTEST_DROP_METHOD "http") set(CTEST_DROP_SITE "open.cdash.org") set(CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard") -set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestScheduler/CTestConfig.cmake b/Tests/CTestTestScheduler/CTestConfig.cmake index 797387b..bd265f9 100644 --- a/Tests/CTestTestScheduler/CTestConfig.cmake +++ b/Tests/CTestTestScheduler/CTestConfig.cmake @@ -1,7 +1,4 @@ -set(CTEST_PROJECT_NAME "CTestTestScheduler") set(CTEST_NIGHTLY_START_TIME "21:00:00 EDT") -set(CTEST_DART_SERVER_VERSION "2") set(CTEST_DROP_METHOD "http") set(CTEST_DROP_SITE "open.cdash.org") set(CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard") -set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestSkipReturnCode/CTestConfig.cmake b/Tests/CTestTestSkipReturnCode/CTestConfig.cmake index da0c76b..5bc1e9e 100644 --- a/Tests/CTestTestSkipReturnCode/CTestConfig.cmake +++ b/Tests/CTestTestSkipReturnCode/CTestConfig.cmake @@ -1,7 +1,4 @@ -set (CTEST_PROJECT_NAME "CTestTestSkipReturnCode") set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT") -set (CTEST_DART_SERVER_VERSION "2") set(CTEST_DROP_METHOD "http") set(CTEST_DROP_SITE "open.cdash.org") set(CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard") -set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestStopTime/CTestConfig.cmake b/Tests/CTestTestStopTime/CTestConfig.cmake index 412283e..5bc1e9e 100644 --- a/Tests/CTestTestStopTime/CTestConfig.cmake +++ b/Tests/CTestTestStopTime/CTestConfig.cmake @@ -1,7 +1,4 @@ -set (CTEST_PROJECT_NAME "CTestTestStopTime") set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT") -set (CTEST_DART_SERVER_VERSION "2") set(CTEST_DROP_METHOD "http") set(CTEST_DROP_SITE "open.cdash.org") set(CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard") -set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestSubdir/CTestConfig.cmake b/Tests/CTestTestSubdir/CTestConfig.cmake index 47ebb92..bd265f9 100644 --- a/Tests/CTestTestSubdir/CTestConfig.cmake +++ b/Tests/CTestTestSubdir/CTestConfig.cmake @@ -1,7 +1,4 @@ -set(CTEST_PROJECT_NAME "CTestTestSubdir") set(CTEST_NIGHTLY_START_TIME "21:00:00 EDT") -set(CTEST_DART_SERVER_VERSION "2") set(CTEST_DROP_METHOD "http") set(CTEST_DROP_SITE "open.cdash.org") set(CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard") -set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestTimeout/CTestConfig.cmake b/Tests/CTestTestTimeout/CTestConfig.cmake index 13114f1..bd265f9 100644 --- a/Tests/CTestTestTimeout/CTestConfig.cmake +++ b/Tests/CTestTestTimeout/CTestConfig.cmake @@ -1,7 +1,4 @@ -set(CTEST_PROJECT_NAME "CTestTestTimeout") set(CTEST_NIGHTLY_START_TIME "21:00:00 EDT") -set(CTEST_DART_SERVER_VERSION "2") set(CTEST_DROP_METHOD "http") set(CTEST_DROP_SITE "open.cdash.org") set(CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard") -set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestUpload/CTestConfig.cmake b/Tests/CTestTestUpload/CTestConfig.cmake index a547088..21318b4 100644 --- a/Tests/CTestTestUpload/CTestConfig.cmake +++ b/Tests/CTestTestUpload/CTestConfig.cmake @@ -1,7 +1,4 @@ -set (CTEST_PROJECT_NAME "CTestTestUpload") set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT") -set (CTEST_DART_SERVER_VERSION "2") set (CTEST_DROP_METHOD "http") set (CTEST_DROP_SITE "open.cdash.org") set (CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard") -set (CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestVerboseOutput/CTestConfig.cmake b/Tests/CTestTestVerboseOutput/CTestConfig.cmake index 4f96c79..bd265f9 100644 --- a/Tests/CTestTestVerboseOutput/CTestConfig.cmake +++ b/Tests/CTestTestVerboseOutput/CTestConfig.cmake @@ -1,7 +1,4 @@ -set(CTEST_PROJECT_NAME "CTestTestVerboseOutput") set(CTEST_NIGHTLY_START_TIME "21:00:00 EDT") -set(CTEST_DART_SERVER_VERSION "2") set(CTEST_DROP_METHOD "http") set(CTEST_DROP_SITE "open.cdash.org") set(CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard") -set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestZeroTimeout/CTestConfig.cmake b/Tests/CTestTestZeroTimeout/CTestConfig.cmake index 6094864..bd265f9 100644 --- a/Tests/CTestTestZeroTimeout/CTestConfig.cmake +++ b/Tests/CTestTestZeroTimeout/CTestConfig.cmake @@ -1,7 +1,4 @@ -set(CTEST_PROJECT_NAME "CTestTestZeroTimeout") set(CTEST_NIGHTLY_START_TIME "21:00:00 EDT") -set(CTEST_DART_SERVER_VERSION "2") set(CTEST_DROP_METHOD "http") set(CTEST_DROP_SITE "open.cdash.org") set(CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard") -set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestUpdateCommon.cmake b/Tests/CTestUpdateCommon.cmake index 61aa13b..0f8ec8e 100644 --- a/Tests/CTestUpdateCommon.cmake +++ b/Tests/CTestUpdateCommon.cmake @@ -130,7 +130,6 @@ function(create_content dir) # An example CTest project configuration file. file(WRITE ${TOP}/${dir}/CTestConfig.cmake "# CTest Configuration File -set(CTEST_PROJECT_NAME TestProject) set(CTEST_NIGHTLY_START_TIME \"21:00:00 EDT\") ") diff --git a/Tests/FindBoost/Test/CMakeLists.txt b/Tests/FindBoost/Test/CMakeLists.txt index 663f414..39e92c1 100644 --- a/Tests/FindBoost/Test/CMakeLists.txt +++ b/Tests/FindBoost/Test/CMakeLists.txt @@ -13,6 +13,9 @@ if(NOT Boost_PROGRAM_OPTIONS_FOUND) message(FATAL_ERROR "Optional Boost component \"program_options\" not found which is unexpected") endif(NOT Boost_PROGRAM_OPTIONS_FOUND) +add_definitions(-DCMAKE_EXPECTED_BOOST_VERSION="${Boost_VERSION}") +add_definitions(-DCMAKE_EXPECTED_BOOST_VERSION_COMPONENTS="${Boost_VERSION_STRING}") + add_executable(test_boost_tgt main.cxx) target_link_libraries(test_boost_tgt Boost::dynamic_linking diff --git a/Tests/FindBoost/Test/main.cxx b/Tests/FindBoost/Test/main.cxx index 6e8b5da..50ddadf 100644 --- a/Tests/FindBoost/Test/main.cxx +++ b/Tests/FindBoost/Test/main.cxx @@ -20,5 +20,20 @@ int main() boost::thread foo(threadmain); foo.join(); - return 0; + int version = BOOST_VERSION; + int major = version / 100000; + int minor = version / 100 % 1000; + int patch = version % 100; + char version_string[100]; + snprintf(version_string, sizeof(version_string), "%d.%d.%d", major, minor, + patch); + printf("Found Boost version %s, expected version %s\n", version_string, + CMAKE_EXPECTED_BOOST_VERSION_COMPONENTS); + int ret = strcmp(version_string, CMAKE_EXPECTED_BOOST_VERSION_COMPONENTS); + char raw_version_string[100]; + snprintf(raw_version_string, sizeof(raw_version_string), "%d", + BOOST_VERSION); + printf("Found Boost version %s, expected version %s\n", raw_version_string, + CMAKE_EXPECTED_BOOST_VERSION); + return ret | strcmp(raw_version_string, CMAKE_EXPECTED_BOOST_VERSION); } diff --git a/Tests/FindCURL/Test/CMakeLists.txt b/Tests/FindCURL/Test/CMakeLists.txt index c3c719b..cbf2866 100644 --- a/Tests/FindCURL/Test/CMakeLists.txt +++ b/Tests/FindCURL/Test/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.10) project(TestFindCURL C) include(CTest) -find_package(CURL REQUIRED) +find_package(CURL REQUIRED COMPONENTS HTTP) add_definitions(-DCMAKE_EXPECTED_CURL_VERSION="${CURL_VERSION_STRING}") diff --git a/Tests/FindGIF/CMakeLists.txt b/Tests/FindGIF/CMakeLists.txt new file mode 100644 index 0000000..bac64af --- /dev/null +++ b/Tests/FindGIF/CMakeLists.txt @@ -0,0 +1,10 @@ +add_test(NAME FindGIF.Test COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindGIF/Test" + "${CMake_BINARY_DIR}/Tests/FindGIF/Test" + ${build_generator_args} + --build-project TestFindGIF + --build-options ${build_options} + --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> + ) diff --git a/Tests/FindGIF/Test/CMakeLists.txt b/Tests/FindGIF/Test/CMakeLists.txt new file mode 100644 index 0000000..961e636 --- /dev/null +++ b/Tests/FindGIF/Test/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.4) +project(TestFindGIF C) +include(CTest) + +find_package(GIF REQUIRED) + +add_definitions(-DCMAKE_EXPECTED_GIF_VERSION="${GIF_VERSION}") + +add_executable(test_tgt main.c) +target_link_libraries(test_tgt GIF::GIF) +add_test(NAME test_tgt COMMAND test_tgt) + +add_executable(test_var main.c) +target_include_directories(test_var PRIVATE ${GIF_INCLUDE_DIRS}) +target_link_libraries(test_var PRIVATE ${GIF_LIBRARIES}) +add_test(NAME test_var COMMAND test_var) diff --git a/Tests/FindGIF/Test/main.c b/Tests/FindGIF/Test/main.c new file mode 100644 index 0000000..4ed72ec --- /dev/null +++ b/Tests/FindGIF/Test/main.c @@ -0,0 +1,35 @@ +#include <assert.h> +#include <stdio.h> +#include <string.h> + +#include <gif_lib.h> + +// GIFLIB before version 5 didn't know this macro +#ifndef GIFLIB_MAJOR +# define GIFLIB_MAJOR 4 +#endif + +int main() +{ + // because of the API changes we have to test different functions depending + // on the version of GIFLIB +#if GIFLIB_MAJOR >= 5 + // test the linker + GifErrorString(D_GIF_SUCCEEDED); + + // check the version + char gif_version_string[16]; + snprintf(gif_version_string, 16, "%i.%i.%i", GIFLIB_MAJOR, GIFLIB_MINOR, + GIFLIB_RELEASE); + + assert(strcmp(gif_version_string, CMAKE_EXPECTED_GIF_VERSION) == 0); +#else + // test the linker + GifLastError(); + + // unfortunately there is no way to check the version in older version of + // GIFLIB +#endif + + return 0; +} diff --git a/Tests/FindLibLZMA/CMakeLists.txt b/Tests/FindLibLZMA/CMakeLists.txt new file mode 100644 index 0000000..6dff0ef --- /dev/null +++ b/Tests/FindLibLZMA/CMakeLists.txt @@ -0,0 +1,10 @@ +add_test(NAME FindLibLZMA.Test COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindLibLZMA/Test" + "${CMake_BINARY_DIR}/Tests/FindLibLZMA/Test" + ${build_generator_args} + --build-project TestFindLibLZMA + --build-options ${build_options} + --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> + ) diff --git a/Tests/FindLibLZMA/Test/CMakeLists.txt b/Tests/FindLibLZMA/Test/CMakeLists.txt new file mode 100644 index 0000000..c59dcdb --- /dev/null +++ b/Tests/FindLibLZMA/Test/CMakeLists.txt @@ -0,0 +1,14 @@ +cmake_minimum_required(VERSION 3.4) +project(TestFindLZMA C) +include(CTest) + +find_package(LibLZMA REQUIRED) + +add_executable(test_tgt main.c) +target_link_libraries(test_tgt LibLZMA::LibLZMA) +add_test(NAME test_tgt COMMAND test_tgt) + +add_executable(test_var main.c) +target_include_directories(test_var PRIVATE ${LIBLZMA_INCLUDE_DIRS}) +target_link_libraries(test_var PRIVATE ${LIBLZMA_LIBRARIES}) +add_test(NAME test_var COMMAND test_var) diff --git a/Tests/FindLibLZMA/Test/main.c b/Tests/FindLibLZMA/Test/main.c new file mode 100644 index 0000000..06e8065 --- /dev/null +++ b/Tests/FindLibLZMA/Test/main.c @@ -0,0 +1,15 @@ +#include <assert.h> +#include <lzma.h> +#include <string.h> + +static const uint8_t test_string[9] = "123456789"; + +int main() +{ + static const uint32_t test_vector = 0xCBF43926; + + uint32_t crc = lzma_crc32(test_string, sizeof(test_string), 0); + assert(crc == test_vector); + + return 0; +} diff --git a/Tests/FindOctave/CMakeLists.txt b/Tests/FindOctave/CMakeLists.txt new file mode 100644 index 0000000..1acc966 --- /dev/null +++ b/Tests/FindOctave/CMakeLists.txt @@ -0,0 +1,10 @@ +add_test(NAME FindOctave.Test COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindOctave/Test" + "${CMake_BINARY_DIR}/Tests/FindOctave/Test" + ${build_generator_args} + --build-project TestFindOctave + --build-options ${build_options} + --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> + ) diff --git a/Tests/FindOctave/Test/CMakeLists.txt b/Tests/FindOctave/Test/CMakeLists.txt new file mode 100644 index 0000000..ce33fcd --- /dev/null +++ b/Tests/FindOctave/Test/CMakeLists.txt @@ -0,0 +1,20 @@ +cmake_minimum_required(VERSION 3.3) +project(TestFindOctave CXX) +enable_testing() + +find_package(Octave REQUIRED COMPONENTS Development Interpreter) + +add_definitions(-DCMAKE_EXPECTED_Octave_VERSION=${Octave_VERSION}) + +add_executable(test_tgt main.cpp) +target_link_libraries(test_tgt Octave::Octave) +add_test(NAME test_tgt COMMAND test_tgt) + +add_test(NAME test_tgt_exe + COMMAND Octave::Interpreter -q --eval "runtests('.')" + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) + +add_executable(test_var main.cpp) +target_include_directories(test_var PRIVATE ${Octave_INCLUDE_DIRS}) +target_link_libraries(test_var PRIVATE ${Octave_LIBRARIES}) +add_test(NAME test_var COMMAND test_var) diff --git a/Tests/FindOctave/Test/main.cpp b/Tests/FindOctave/Test/main.cpp new file mode 100644 index 0000000..68270b1 --- /dev/null +++ b/Tests/FindOctave/Test/main.cpp @@ -0,0 +1,18 @@ +#include <iostream> +#include <oct.h> + +// http://www.dm.unibo.it/~achilles/calc/octave.html/Standalone-Programs.html +int main(void) +{ + int n = 2; + Matrix a_matrix = Matrix(n, n); + for (octave_idx_type i = 0; i < n; i++) { + for (octave_idx_type j = 0; j < n; j++) { + a_matrix(i, j) = (i + 1) * 10 + (j + 1); + } + } + + std::cout << a_matrix << std::endl; + + return EXIT_SUCCESS; +} diff --git a/Tests/FindOctave/Test/testtrue.m b/Tests/FindOctave/Test/testtrue.m new file mode 100644 index 0000000..0c28a9e --- /dev/null +++ b/Tests/FindOctave/Test/testtrue.m @@ -0,0 +1 @@ +%!assert(true) diff --git a/Tests/FindThreads/C-only/CMakeLists.txt b/Tests/FindThreads/C-only/CMakeLists.txt index ab4ca0d..ee2a5f9 100644 --- a/Tests/FindThreads/C-only/CMakeLists.txt +++ b/Tests/FindThreads/C-only/CMakeLists.txt @@ -1,7 +1,6 @@ cmake_minimum_required(VERSION 3.3 FATAL_ERROR) project(FindThreads_C-only C) -set(CMAKE_THREAD_PREFER_PTHREAD On) find_package(Threads REQUIRED) if (NOT WIN32) diff --git a/Tests/FindThreads/CXX-only/CMakeLists.txt b/Tests/FindThreads/CXX-only/CMakeLists.txt index 9993123..3c6cc1e 100644 --- a/Tests/FindThreads/CXX-only/CMakeLists.txt +++ b/Tests/FindThreads/CXX-only/CMakeLists.txt @@ -1,7 +1,6 @@ cmake_minimum_required(VERSION 3.3 FATAL_ERROR) project(FindThreads_CXX-only CXX) -set(CMAKE_THREAD_PREFER_PTHREAD On) find_package(Threads REQUIRED) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/../../../Modules/CheckForPthreads.c diff --git a/Tests/FindX11/CMakeLists.txt b/Tests/FindX11/CMakeLists.txt new file mode 100644 index 0000000..cc931a1 --- /dev/null +++ b/Tests/FindX11/CMakeLists.txt @@ -0,0 +1,10 @@ +add_test(NAME FindX11.Test COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindX11/Test" + "${CMake_BINARY_DIR}/Tests/FindX11/Test" + ${build_generator_args} + --build-project TestFindX11 + --build-options ${build_options} + --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> + ) diff --git a/Tests/FindX11/Test/CMakeLists.txt b/Tests/FindX11/Test/CMakeLists.txt new file mode 100644 index 0000000..769271f --- /dev/null +++ b/Tests/FindX11/Test/CMakeLists.txt @@ -0,0 +1,89 @@ +cmake_minimum_required(VERSION 3.10) +project(TestFindX11 C) +include(CTest) + +find_package(X11 REQUIRED) + +function (test_x11_component have_var component) + if (NOT X11_${component}_FOUND) + message("Skipping ${component} because it was not found.") + return () + endif () + + add_executable(test_tgt_${component} main.c) + target_link_libraries(test_tgt_${component} PRIVATE X11::${component}) + target_compile_definitions(test_tgt_${component} PRIVATE HAVE_X11_${component}) + add_test(NAME test_tgt_${component} COMMAND test_tgt_${component}) + + # Add to the list of components to test for the parent. + set(${have_var} + ${${have_var}} + HAVE_X11_${component} + PARENT_SCOPE) +endfunction () + +set(x11_components) +test_x11_component(x11_components ICE) +test_x11_component(x11_components SM) +# Not a component; hack it up. +set(X11_X11_FOUND ${X11_FOUND}) +test_x11_component(x11_components X11) +test_x11_component(x11_components Xau) +test_x11_component(x11_components Xcomposite) +test_x11_component(x11_components Xdamage) +test_x11_component(x11_components Xdmcp) +test_x11_component(x11_components Xext) +test_x11_component(x11_components Xxf86misc) +test_x11_component(x11_components Xxf86vm) +test_x11_component(x11_components Xfixes) +# We ignore the Xft component because the variables do not provide the required +# dependency information (Freetype and Fontconfig). +test_x11_component(x11_components_ignore Xft) +test_x11_component(x11_components Xi) +test_x11_component(x11_components Xinerama) +test_x11_component(x11_components Xkb) +test_x11_component(x11_components xkbfile) +test_x11_component(x11_components Xmu) +test_x11_component(x11_components Xpm) +test_x11_component(x11_components Xtst) +test_x11_component(x11_components Xrandr) +test_x11_component(x11_components Xrender) +test_x11_component(x11_components XRes) +test_x11_component(x11_components Xss) +test_x11_component(x11_components Xt) +test_x11_component(x11_components Xutil) +test_x11_component(x11_components Xv) + +# The variables do not include dependency information. Just test "everything". +add_executable(test_var main.c) +target_include_directories(test_var PRIVATE ${X11_INCLUDE_DIRS}) +target_link_libraries(test_var PRIVATE ${X11_LIBRARIES}) +# Not included in X11_LIBRARIES. +foreach(lib + Xau + Xcomposite + Xdamage + Xdmcp + Xxf86misc + Xxf86vm + Xfixes + Xi + Xinerama + Xkb + xkbfile + Xmu + Xpm + Xtst + Xrandr + Xrender + XRes + Xss + Xt + Xv + ) + if (X11_${lib}_FOUND) + target_link_libraries(test_var PRIVATE ${X11_${lib}_LIB}) + endif () +endforeach() +target_compile_definitions(test_var PRIVATE ${x11_components}) +add_test(NAME test_var COMMAND test_var) diff --git a/Tests/FindX11/Test/main.c b/Tests/FindX11/Test/main.c new file mode 100644 index 0000000..044bfa2 --- /dev/null +++ b/Tests/FindX11/Test/main.c @@ -0,0 +1,405 @@ +#ifdef HAVE_X11_ICE +# include <X11/ICE/ICElib.h> + +static Status test_ICE(void) +{ + return IceInitThreads(); +} +#endif + +#ifdef HAVE_X11_SM +# include <X11/SM/SMlib.h> +# include <stdlib.h> + +static void test_SM(void) +{ + SmcProtocolVersion(NULL); +} +#endif + +#ifdef HAVE_X11_X11 +# include <X11/Xlib.h> + +static Status test_X11(void) +{ + return XInitThreads(); +} +#endif + +#ifdef HAVE_X11_Xau +# include <X11/Xauth.h> + +static char* test_Xau(void) +{ + return XauFileName(); +} +#endif + +#ifdef HAVE_X11_Xcomposite +# include <X11/extensions/Xcomposite.h> + +static int test_Xcomposite(void) +{ + return XCompositeVersion(); +} +#endif + +#ifdef HAVE_X11_Xdamage +# include <X11/extensions/Xdamage.h> + +static Bool test_Xdamage(void) +{ + Display* dpy = XOpenDisplay(NULL); + int ev_base; + int err_base; + Bool ret = XDamageQueryExtension(dpy, &ev_base, &err_base); + XCloseDisplay(dpy); + return ret; +} +#endif + +#ifdef HAVE_X11_Xdmcp +# include <X11/Xdmcp.h> + +static int test_Xdmcp(void) +{ + BYTE data[1024]; + XdmcpBuffer buf = { data, sizeof(data), 0, 0 }; + return XdmcpReadRemaining(&buf); +} +#endif + +#ifdef HAVE_X11_Xext +# include <X11/Xlib.h> +# include <X11/extensions/Xext.h> + +static int test_Xext(void) +{ + Display* dpy = XOpenDisplay(NULL); + int ret = XMissingExtension(dpy, "cmake"); + XCloseDisplay(dpy); + return ret; +} +#endif + +#ifdef HAVE_X11_Xxf86misc +# include <X11/Xlib.h> +# include <X11/extensions/xf86misc.h> + +static Bool test_Xxf86misc(void) +{ + Display* dpy = XOpenDisplay(NULL); + Bool ret = XF86MiscSetClientVersion(dpy); + XCloseDisplay(dpy); + return ret; +} +#endif + +#ifdef HAVE_X11_Xxf86vm +# include <X11/Xlib.h> +# include <X11/extensions/xf86vmode.h> + +static Bool test_Xxf86vm(void) +{ + Display* dpy = XOpenDisplay(NULL); + Bool ret = XF86VidModeSetClientVersion(dpy); + XCloseDisplay(dpy); + return ret; +} +#endif + +#ifdef HAVE_X11_Xfixes +# include <X11/extensions/Xfixes.h> + +static Bool test_Xfixes(void) +{ + Display* dpy = XOpenDisplay(NULL); + int ev_base; + int err_base; + Bool ret = XFixesQueryExtension(dpy, &ev_base, &err_base); + XCloseDisplay(dpy); + return ret; +} +#endif + +#ifdef HAVE_X11_Xft +# include <X11/Xft/Xft.h> + +static FcBool test_Xft(void) +{ + return XftInitFtLibrary(); +} +#endif + +#ifdef HAVE_X11_Xi +# include <X11/extensions/XInput.h> + +static XExtensionVersion* test_Xi(void) +{ + Display* dpy = XOpenDisplay(NULL); + XExtensionVersion* ret = XGetExtensionVersion(dpy, "cmake"); + XCloseDisplay(dpy); + return ret; +} +#endif + +#ifdef HAVE_X11_Xinerama +# include <X11/extensions/Xinerama.h> + +static Bool test_Xinerama(void) +{ + Display* dpy = XOpenDisplay(NULL); + int ev_base; + int err_base; + Bool ret = XineramaQueryExtension(dpy, &ev_base, &err_base); + XCloseDisplay(dpy); + return ret; +} +#endif + +#ifdef HAVE_X11_Xkb +# include <X11/XKBlib.h> + +static Bool test_Xkb(void) +{ + return XkbIgnoreExtension(0); +} +#endif + +#ifdef HAVE_X11_xkbfile +# include <stdio.h> + +# include <X11/XKBlib.h> +# include <X11/extensions/XKBfile.h> + +# include <stdlib.h> + +static void test_xkbfile(void) +{ + Display* dpy = XOpenDisplay(NULL); + XkbInitAtoms(dpy); + XCloseDisplay(dpy); +} +#endif + +#ifdef HAVE_X11_Xmu +# include <X11/Xmu/Xmu.h> + +# include <stdlib.h> + +static Bool test_Xmu(void) +{ + return XmuValidArea(NULL); +} +#endif + +#ifdef HAVE_X11_Xpm +# include <X11/xpm.h> + +static int test_Xpm(void) +{ + return XpmAttributesSize(); +} +#endif + +#ifdef HAVE_X11_Xtst +# include <X11/extensions/XTest.h> + +static Status test_Xtst(void) +{ + Display* dpy = XOpenDisplay(NULL); + Status ret = XTestDiscard(dpy); + XCloseDisplay(dpy); + return ret; +} +#endif + +#ifdef HAVE_X11_Xrandr +# include <X11/extensions/Xrandr.h> + +static Bool test_Xrandr(void) +{ + Display* dpy = XOpenDisplay(NULL); + int ev_base; + int err_base; + Bool ret = XRRQueryExtension(dpy, &ev_base, &err_base); + XCloseDisplay(dpy); + return ret; +} +#endif + +#ifdef HAVE_X11_Xrender +# include <X11/extensions/Xrender.h> + +static Bool test_Xrender(void) +{ + Display* dpy = XOpenDisplay(NULL); + int ev_base; + int err_base; + Bool ret = XRenderQueryExtension(dpy, &ev_base, &err_base); + XCloseDisplay(dpy); + return ret; +} +#endif + +#ifdef HAVE_X11_XRes +# include <X11/Xlib.h> +# include <X11/extensions/XRes.h> + +static Bool test_XRes(void) +{ + Display* dpy = XOpenDisplay(NULL); + int ev_base; + int err_base; + Bool ret = XResQueryExtension(dpy, &ev_base, &err_base); + XCloseDisplay(dpy); + return ret; +} +#endif + +#ifdef HAVE_X11_Xss +# include <X11/extensions/scrnsaver.h> + +static Bool test_Xss(void) +{ + Display* dpy = XOpenDisplay(NULL); + int ev_base; + int err_base; + Bool ret = XScreenSaverQueryExtension(dpy, &ev_base, &err_base); + XCloseDisplay(dpy); + return ret; +} +#endif + +#ifdef HAVE_X11_Xt +# include <X11/Intrinsic.h> + +static void test_Xt(void) +{ + return XtToolkitInitialize(); +} +#endif + +#ifdef HAVE_X11_Xutil +# include <X11/Xutil.h> + +static int test_Xutil(void) +{ + Region r = XCreateRegion(); + return XDestroyRegion(r); +} +#endif + +#ifdef HAVE_X11_Xv +# include <X11/Xlib.h> +# include <X11/extensions/Xvlib.h> + +static int test_Xv(void) +{ + Display* dpy = XOpenDisplay(NULL); + unsigned int version; + unsigned int revision; + unsigned int req_base; + unsigned int ev_base; + unsigned int err_base; + int ret = + XvQueryExtension(dpy, &version, &revision, &req_base, &ev_base, &err_base); + XCloseDisplay(dpy); + return ret; +} +#endif + +#include <stddef.h> + +int main(int argc, char* argv[]) +{ + (void)argv; + void* fptrs[] = { +#ifdef HAVE_X11_ICE + test_ICE, +#endif +#ifdef HAVE_X11_SM + test_SM, +#endif +#ifdef HAVE_X11_X11 + test_X11, +#endif +#ifdef HAVE_X11_Xau + test_Xau, +#endif +#ifdef HAVE_X11_Xcomposite + test_Xcomposite, +#endif +#ifdef HAVE_X11_Xdamage + test_Xdamage, +#endif +#ifdef HAVE_X11_Xdmcp + test_Xdmcp, +#endif +#ifdef HAVE_X11_Xext + test_Xext, +#endif +#ifdef HAVE_X11_Xxf86misc + test_Xxf86misc, +#endif +#ifdef HAVE_X11_Xxf86vm + test_Xxf86vm, +#endif +#ifdef HAVE_X11_Xfixes + test_Xfixes, +#endif +#ifdef HAVE_X11_Xft + test_Xft, +#endif +#ifdef HAVE_X11_Xi + test_Xi, +#endif +#ifdef HAVE_X11_Xinerama + test_Xinerama, +#endif +#ifdef HAVE_X11_Xkb + test_Xkb, +#endif +#ifdef HAVE_X11_xkbfile + test_xkbfile, +#endif +#ifdef HAVE_X11_Xmu + test_Xmu, +#endif +#ifdef HAVE_X11_Xpm + test_Xpm, +#endif +#ifdef HAVE_X11_Xtst + test_Xtst, +#endif +#ifdef HAVE_X11_Xrandr + test_Xrandr, +#endif +#ifdef HAVE_X11_Xrender + test_Xrender, +#endif +#ifdef HAVE_X11_XRes + test_XRes, +#endif +#ifdef HAVE_X11_Xss + test_Xss, +#endif +#ifdef HAVE_X11_Xt + test_Xt, +#endif +#ifdef HAVE_X11_Xutil + test_Xutil, +#endif +#ifdef HAVE_X11_Xv + test_Xv, +#endif + NULL, + }; + + // The code here is to convince the compiler to keep the static functions but + // without calling them. This ends up always being "0" because `argc` is + // always 1 in the test harness which always returns the sentinel at the end + // of the array. The array logic is there to ensure that the contents of + // `fptrs` is not optimized out. + return (int)fptrs[(sizeof(fptrs) / sizeof(*fptrs)) - argc]; +} diff --git a/Tests/FortranModules/Submodules/child.f90 b/Tests/FortranModules/Submodules/child.f90 index 838ab61..c314835 100644 --- a/Tests/FortranModules/Submodules/child.f90 +++ b/Tests/FortranModules/Submodules/child.f90 @@ -1,10 +1,10 @@ ! Test the notation for a 1st-generation direct ! descendant of a parent module -submodule ( parent ) child +SUBMODULE ( parent ) child implicit none -contains +CONTAINS module function child_function() result(child_stuff) logical :: child_stuff child_stuff=.true. end function -end submodule child +END SUBMODULE child diff --git a/Tests/QtAutogen/AutogenCoreTest.cmake b/Tests/QtAutogen/AutogenCoreTest.cmake new file mode 100644 index 0000000..5803859 --- /dev/null +++ b/Tests/QtAutogen/AutogenCoreTest.cmake @@ -0,0 +1,55 @@ + +# Tell find_package(Qt5) where to find Qt. +if(QT_QMAKE_EXECUTABLE) + get_filename_component(Qt_BIN_DIR "${QT_QMAKE_EXECUTABLE}" PATH) + get_filename_component(Qt_PREFIX_DIR "${Qt_BIN_DIR}" PATH) + list(APPEND CMAKE_PREFIX_PATH ${Qt_PREFIX_DIR}) +endif() + +if (QT_TEST_VERSION EQUAL 4) + + find_package(Qt4 REQUIRED QtCore) + include(UseQt4) + + set(QT_QTCORE_TARGET Qt4::QtCore) + + # Qt macros + macro(qtx_wrap_cpp) + qt4_wrap_cpp(${ARGN}) + endmacro() + macro(qtx_generate_moc) + qt4_generate_moc(${ARGN}) + endmacro() + +elseif(QT_TEST_VERSION EQUAL 5) + + find_package(Qt5Core REQUIRED) + + set(QT_QTCORE_TARGET Qt5::Core) + set(QT_LIBRARIES Qt5::Core) + + # Include directories + include_directories(${Qt5Core_INCLUDE_DIRS}) + + # Definitions + if(Qt5_POSITION_INDEPENDENT_CODE AND CMAKE_CXX_COMPILE_OPTIONS_PIC) + add_definitions(${CMAKE_CXX_COMPILE_OPTIONS_PIC}) + endif() + + # Qt macros + macro(qtx_wrap_cpp) + qt5_wrap_cpp(${ARGN}) + endmacro() + macro(qtx_generate_moc) + qt5_generate_moc(${ARGN}) + endmacro() + +else() + message(SEND_ERROR "Invalid Qt version specified: ${QT_TEST_VERSION}") +endif() + +# Get Qt compile features +get_property(QT_COMPILE_FEATURES + TARGET ${QT_QTCORE_TARGET} + PROPERTY INTERFACE_COMPILE_FEATURES +) diff --git a/Tests/QtAutogen/AutogenTest.cmake b/Tests/QtAutogen/AutogenGuiTest.cmake index 3969a89..b76d341 100644 --- a/Tests/QtAutogen/AutogenTest.cmake +++ b/Tests/QtAutogen/AutogenGuiTest.cmake @@ -7,11 +7,11 @@ if(QT_QMAKE_EXECUTABLE) endif() if (QT_TEST_VERSION EQUAL 4) + find_package(Qt4 REQUIRED) include(UseQt4) set(QT_QTCORE_TARGET Qt4::QtCore) - set(QT_QTGUI_TARGET Qt4::QtGui) # Qt macros macro(qtx_wrap_cpp) @@ -22,14 +22,16 @@ if (QT_TEST_VERSION EQUAL 4) endmacro() elseif(QT_TEST_VERSION EQUAL 5) + find_package(Qt5Widgets REQUIRED) set(QT_QTCORE_TARGET Qt5::Core) - set(QT_QTGUI_TARGET Qt5::Widgets) + set(QT_LIBRARIES Qt5::Widgets) + # Include directories include_directories(${Qt5Widgets_INCLUDE_DIRS}) - set(QT_LIBRARIES Qt5::Widgets) + # Definitions if(Qt5_POSITION_INDEPENDENT_CODE AND CMAKE_CXX_COMPILE_OPTIONS_PIC) add_definitions(${CMAKE_CXX_COMPILE_OPTIONS_PIC}) endif() diff --git a/Tests/QtAutogen/AutogenOriginDependsOff/CMakeLists.txt b/Tests/QtAutogen/AutogenOriginDependsOff/CMakeLists.txt index 1c2271a..9e6fe8b 100644 --- a/Tests/QtAutogen/AutogenOriginDependsOff/CMakeLists.txt +++ b/Tests/QtAutogen/AutogenOriginDependsOff/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.11) project(AutogenOriginDependsOff) -include("../AutogenTest.cmake") +include("../AutogenCoreTest.cmake") set(CSD ${CMAKE_CURRENT_SOURCE_DIR}) set(CBD ${CMAKE_CURRENT_BINARY_DIR}) diff --git a/Tests/QtAutogen/AutogenOriginDependsOn/CMakeLists.txt b/Tests/QtAutogen/AutogenOriginDependsOn/CMakeLists.txt index 60869eb..5aabe0e 100644 --- a/Tests/QtAutogen/AutogenOriginDependsOn/CMakeLists.txt +++ b/Tests/QtAutogen/AutogenOriginDependsOn/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.10) project(AutogenOriginDependsOn) -include("../AutogenTest.cmake") +include("../AutogenCoreTest.cmake") include_directories(${CMAKE_CURRENT_BINARY_DIR}) set(CSD ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/Tests/QtAutogen/AutogenTargetDepends/CMakeLists.txt b/Tests/QtAutogen/AutogenTargetDepends/CMakeLists.txt index 63b7c98..492b5db 100644 --- a/Tests/QtAutogen/AutogenTargetDepends/CMakeLists.txt +++ b/Tests/QtAutogen/AutogenTargetDepends/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.10) project(AutogenTargetDepends) -include("../AutogenTest.cmake") +include("../AutogenCoreTest.cmake") include_directories(${CMAKE_CURRENT_BINARY_DIR}) set(CSD ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/Tests/QtAutogen/Complex/CMakeLists.txt b/Tests/QtAutogen/Complex/CMakeLists.txt index a18cc04..d9fdf5c 100644 --- a/Tests/QtAutogen/Complex/CMakeLists.txt +++ b/Tests/QtAutogen/Complex/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.10) project(Complex) -include("../AutogenTest.cmake") +include("../AutogenGuiTest.cmake") # -- Test: AUTOMOC AUTORCC AUTOUIC add_definitions(-DFOO -DSomeDefine="Barx") diff --git a/Tests/QtAutogen/GlobalAutogenTarget/CMakeLists.txt b/Tests/QtAutogen/GlobalAutogenTarget/CMakeLists.txt index e020673..cff7022 100644 --- a/Tests/QtAutogen/GlobalAutogenTarget/CMakeLists.txt +++ b/Tests/QtAutogen/GlobalAutogenTarget/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.12) project(GlobalAutogenTarget) -include("../AutogenTest.cmake") +include("../AutogenCoreTest.cmake") # This tests # CMAKE_GLOBAL_AUTOGEN_TARGET, diff --git a/Tests/QtAutogen/GlobalAutogenTarget/GAT/CMakeLists.txt b/Tests/QtAutogen/GlobalAutogenTarget/GAT/CMakeLists.txt index b1008e8..3925197 100644 --- a/Tests/QtAutogen/GlobalAutogenTarget/GAT/CMakeLists.txt +++ b/Tests/QtAutogen/GlobalAutogenTarget/GAT/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.12) project(GAT) -include("../../AutogenTest.cmake") +include("../../AutogenCoreTest.cmake") # Include directories include_directories(${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/Tests/QtAutogen/LowMinimumVersion/CMakeLists.txt b/Tests/QtAutogen/LowMinimumVersion/CMakeLists.txt index a6ac338..e1af3d8 100644 --- a/Tests/QtAutogen/LowMinimumVersion/CMakeLists.txt +++ b/Tests/QtAutogen/LowMinimumVersion/CMakeLists.txt @@ -1,7 +1,7 @@ # Use a low minimum version cmake_minimum_required(VERSION 3.0) project(LowMinimumVersion) -include("../AutogenTest.cmake") +include("../AutogenGuiTest.cmake") set(CMAKE_AUTOMOC ON) set(CMAKE_AUTOUIC ON) diff --git a/Tests/QtAutogen/MacOsFW/CMakeLists.txt b/Tests/QtAutogen/MacOsFW/CMakeLists.txt index 26d2019..c08efc4 100644 --- a/Tests/QtAutogen/MacOsFW/CMakeLists.txt +++ b/Tests/QtAutogen/MacOsFW/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.10) project(MacOsFW) -include("../AutogenTest.cmake") +include("../AutogenGuiTest.cmake") find_package(Qt5Test REQUIRED) diff --git a/Tests/QtAutogen/MocCMP0071/CMakeLists.txt b/Tests/QtAutogen/MocCMP0071/CMakeLists.txt index a79f36e..5c58a82 100644 --- a/Tests/QtAutogen/MocCMP0071/CMakeLists.txt +++ b/Tests/QtAutogen/MocCMP0071/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.10) project(MocCMP0071) -include("../AutogenTest.cmake") +include("../AutogenCoreTest.cmake") add_subdirectory(OLD) add_subdirectory(NEW) diff --git a/Tests/QtAutogen/MocIncludeRelaxed/CMakeLists.txt b/Tests/QtAutogen/MocIncludeRelaxed/CMakeLists.txt index 1ad6238..8b4da34 100644 --- a/Tests/QtAutogen/MocIncludeRelaxed/CMakeLists.txt +++ b/Tests/QtAutogen/MocIncludeRelaxed/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.10) project(MocIncludeRelaxed) -include("../AutogenTest.cmake") +include("../AutogenCoreTest.cmake") # Test moc include patterns set(CMAKE_AUTOMOC_RELAXED_MODE TRUE) diff --git a/Tests/QtAutogen/MocIncludeStrict/CMakeLists.txt b/Tests/QtAutogen/MocIncludeStrict/CMakeLists.txt index 2cf0fed..d0aaebf 100644 --- a/Tests/QtAutogen/MocIncludeStrict/CMakeLists.txt +++ b/Tests/QtAutogen/MocIncludeStrict/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.10) project(MocIncludeStrict) -include("../AutogenTest.cmake") +include("../AutogenCoreTest.cmake") # Test moc include patterns set(CMAKE_AUTOMOC_RELAXED_MODE FALSE) diff --git a/Tests/QtAutogen/MocMacroName/CMakeLists.txt b/Tests/QtAutogen/MocMacroName/CMakeLists.txt index f0251a2..bf13d18 100644 --- a/Tests/QtAutogen/MocMacroName/CMakeLists.txt +++ b/Tests/QtAutogen/MocMacroName/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.10) project(MocMacroName) -include("../AutogenTest.cmake") +include("../AutogenCoreTest.cmake") # Test CMAKE_AUTOMOC_MACRO_NAMES and AUTOMOC_MACRO_NAMES list(APPEND CMAKE_AUTOMOC_MACRO_NAMES "QO1_ALIAS") diff --git a/Tests/QtAutogen/MocOnly/CMakeLists.txt b/Tests/QtAutogen/MocOnly/CMakeLists.txt index 5377728..e109154 100644 --- a/Tests/QtAutogen/MocOnly/CMakeLists.txt +++ b/Tests/QtAutogen/MocOnly/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.10) project(MocOnly) -include("../AutogenTest.cmake") +include("../AutogenCoreTest.cmake") add_executable(mocOnly main.cpp diff --git a/Tests/QtAutogen/MocOptions/CMakeLists.txt b/Tests/QtAutogen/MocOptions/CMakeLists.txt index f64b37b..19ee658 100644 --- a/Tests/QtAutogen/MocOptions/CMakeLists.txt +++ b/Tests/QtAutogen/MocOptions/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.10) project(MocOptions) -include("../AutogenTest.cmake") +include("../AutogenCoreTest.cmake") # Test extra options passed to moc via AUTOMOC_MOC_OPTIONS add_executable(mocOptions Object.cpp main.cpp) diff --git a/Tests/QtAutogen/MocOsMacros/CMakeLists.txt b/Tests/QtAutogen/MocOsMacros/CMakeLists.txt index e7b670e..b0125f6 100644 --- a/Tests/QtAutogen/MocOsMacros/CMakeLists.txt +++ b/Tests/QtAutogen/MocOsMacros/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.11) project(MocOsMacros) -include("../AutogenTest.cmake") +include("../AutogenCoreTest.cmake") # Tests if moc processes Q_OS_XXX macros diff --git a/Tests/QtAutogen/MocSkipSource/CMakeLists.txt b/Tests/QtAutogen/MocSkipSource/CMakeLists.txt index 8d1fa6a..454e896 100644 --- a/Tests/QtAutogen/MocSkipSource/CMakeLists.txt +++ b/Tests/QtAutogen/MocSkipSource/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.10) project(MocSkipSource) -include("../AutogenTest.cmake") +include("../AutogenCoreTest.cmake") # Test for SKIP_AUTOMOC and SKIP_AUTOGEN on an AUTOMOC enabled target diff --git a/Tests/QtAutogen/ObjectLibrary/CMakeLists.txt b/Tests/QtAutogen/ObjectLibrary/CMakeLists.txt index 088a24c..ec204e7 100644 --- a/Tests/QtAutogen/ObjectLibrary/CMakeLists.txt +++ b/Tests/QtAutogen/ObjectLibrary/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.10) project(ObjectLibrary) -include("../AutogenTest.cmake") +include("../AutogenCoreTest.cmake") set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) diff --git a/Tests/QtAutogen/Parallel/CMakeLists.txt b/Tests/QtAutogen/Parallel/CMakeLists.txt index 9c64804..299bcbf 100644 --- a/Tests/QtAutogen/Parallel/CMakeLists.txt +++ b/Tests/QtAutogen/Parallel/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.10) project(Parallel) -include("../AutogenTest.cmake") +include("../AutogenGuiTest.cmake") # Test different values for AUTOGEN_PARALLEL include("../Parallel/parallel.cmake") diff --git a/Tests/QtAutogen/Parallel1/CMakeLists.txt b/Tests/QtAutogen/Parallel1/CMakeLists.txt index 9c0b4e5..5c7d547 100644 --- a/Tests/QtAutogen/Parallel1/CMakeLists.txt +++ b/Tests/QtAutogen/Parallel1/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.10) project(Parallel1) -include("../AutogenTest.cmake") +include("../AutogenGuiTest.cmake") # Test different values for AUTOGEN_PARALLEL include("../Parallel/parallel.cmake") diff --git a/Tests/QtAutogen/Parallel2/CMakeLists.txt b/Tests/QtAutogen/Parallel2/CMakeLists.txt index 74c38f1..668aea4 100644 --- a/Tests/QtAutogen/Parallel2/CMakeLists.txt +++ b/Tests/QtAutogen/Parallel2/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.10) project(Parallel2) -include("../AutogenTest.cmake") +include("../AutogenGuiTest.cmake") # Test different values for AUTOGEN_PARALLEL include("../Parallel/parallel.cmake") diff --git a/Tests/QtAutogen/Parallel3/CMakeLists.txt b/Tests/QtAutogen/Parallel3/CMakeLists.txt index c735531..5c50f5e 100644 --- a/Tests/QtAutogen/Parallel3/CMakeLists.txt +++ b/Tests/QtAutogen/Parallel3/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.10) project(Parallel3) -include("../AutogenTest.cmake") +include("../AutogenGuiTest.cmake") # Test different values for AUTOGEN_PARALLEL include("../Parallel/parallel.cmake") diff --git a/Tests/QtAutogen/Parallel4/CMakeLists.txt b/Tests/QtAutogen/Parallel4/CMakeLists.txt index c012ccd..2c40c6a 100644 --- a/Tests/QtAutogen/Parallel4/CMakeLists.txt +++ b/Tests/QtAutogen/Parallel4/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.10) project(Parallel4) -include("../AutogenTest.cmake") +include("../AutogenGuiTest.cmake") # Test different values for AUTOGEN_PARALLEL include("../Parallel/parallel.cmake") diff --git a/Tests/QtAutogen/ParallelAUTO/CMakeLists.txt b/Tests/QtAutogen/ParallelAUTO/CMakeLists.txt index 3fd3ebc..cddece3 100644 --- a/Tests/QtAutogen/ParallelAUTO/CMakeLists.txt +++ b/Tests/QtAutogen/ParallelAUTO/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.10) project(ParallelAUTO) -include("../AutogenTest.cmake") +include("../AutogenGuiTest.cmake") # Test different values for AUTOGEN_PARALLEL include("../Parallel/parallel.cmake") diff --git a/Tests/QtAutogen/RccEmpty/CMakeLists.txt b/Tests/QtAutogen/RccEmpty/CMakeLists.txt index 3b16edc..a8e2af1 100644 --- a/Tests/QtAutogen/RccEmpty/CMakeLists.txt +++ b/Tests/QtAutogen/RccEmpty/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.10) project(RccEmpty) -include("../AutogenTest.cmake") +include("../AutogenCoreTest.cmake") # Test AUTORCC on a .qrc file with no resource files add_executable(rccEmpty rccEmpty.cpp rccEmptyRes.qrc) diff --git a/Tests/QtAutogen/RccOffMocLibrary/CMakeLists.txt b/Tests/QtAutogen/RccOffMocLibrary/CMakeLists.txt index 7f7432e..61b9601 100644 --- a/Tests/QtAutogen/RccOffMocLibrary/CMakeLists.txt +++ b/Tests/QtAutogen/RccOffMocLibrary/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.10) project(RccOffMocLibrary) -include("../AutogenTest.cmake") +include("../AutogenCoreTest.cmake") # Add not_generated_file.qrc to the source list to get the file-level # dependency, but don't generate a c++ file from it. Disable the AUTORCC diff --git a/Tests/QtAutogen/RccOnly/CMakeLists.txt b/Tests/QtAutogen/RccOnly/CMakeLists.txt index a65dee4..f3776f5 100644 --- a/Tests/QtAutogen/RccOnly/CMakeLists.txt +++ b/Tests/QtAutogen/RccOnly/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.10) project(RccOnly) -include("../AutogenTest.cmake") +include("../AutogenCoreTest.cmake") # Test AUTORCC being enabled only add_executable(rccOnly rccOnly.cpp rccOnlyRes.qrc) diff --git a/Tests/QtAutogen/RccSkipSource/CMakeLists.txt b/Tests/QtAutogen/RccSkipSource/CMakeLists.txt index f8a8032..4223274 100644 --- a/Tests/QtAutogen/RccSkipSource/CMakeLists.txt +++ b/Tests/QtAutogen/RccSkipSource/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.10) project(RccSkipSource) -include("../AutogenTest.cmake") +include("../AutogenCoreTest.cmake") # Test for SKIP_AUTORCC and SKIP_AUTOGEN on an AUTORCC enabled target set(skipRccSources diff --git a/Tests/QtAutogen/RerunMocBasic/CMakeLists.txt b/Tests/QtAutogen/RerunMocBasic/CMakeLists.txt index 6fad80c..f4b726f 100644 --- a/Tests/QtAutogen/RerunMocBasic/CMakeLists.txt +++ b/Tests/QtAutogen/RerunMocBasic/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.10) project(RerunMocBasic) -include("../AutogenTest.cmake") +include("../AutogenCoreTest.cmake") # Dummy executable to generate a clean target add_executable(dummy dummy.cpp) diff --git a/Tests/QtAutogen/RerunMocBasic/MocBasic/CMakeLists.txt b/Tests/QtAutogen/RerunMocBasic/MocBasic/CMakeLists.txt index cec60a4..6a9f550 100644 --- a/Tests/QtAutogen/RerunMocBasic/MocBasic/CMakeLists.txt +++ b/Tests/QtAutogen/RerunMocBasic/MocBasic/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.10) project(MocBasic) -include("../../AutogenTest.cmake") +include("../../AutogenCoreTest.cmake") set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) diff --git a/Tests/QtAutogen/RerunMocPlugin/CMakeLists.txt b/Tests/QtAutogen/RerunMocPlugin/CMakeLists.txt index b5287c1..b83e994 100644 --- a/Tests/QtAutogen/RerunMocPlugin/CMakeLists.txt +++ b/Tests/QtAutogen/RerunMocPlugin/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.10) project(RerunMocPlugin) -include("../AutogenTest.cmake") +include("../AutogenCoreTest.cmake") # Tests Q_PLUGIN_METADATA and CMAKE_AUTOMOC_DEPEND_FILTERS # json file change detection diff --git a/Tests/QtAutogen/RerunMocPlugin/MocPlugin/CMakeLists.txt b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/CMakeLists.txt index ca22aeb..5068289 100644 --- a/Tests/QtAutogen/RerunMocPlugin/MocPlugin/CMakeLists.txt +++ b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.10) project(MocPlugin) -include("../../AutogenTest.cmake") +include("../../AutogenGuiTest.cmake") if (QT_TEST_VERSION LESS 5) message(SEND_ERROR "Qt 5 or higher required.") diff --git a/Tests/QtAutogen/RerunRccConfigChange/CMakeLists.txt b/Tests/QtAutogen/RerunRccConfigChange/CMakeLists.txt index 4dc24fe..dcb7a79 100644 --- a/Tests/QtAutogen/RerunRccConfigChange/CMakeLists.txt +++ b/Tests/QtAutogen/RerunRccConfigChange/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.11.2) project(RerunRccConfigChange) -include("../AutogenTest.cmake") +include("../AutogenCoreTest.cmake") # Tests rcc rebuilding after a configuration change diff --git a/Tests/QtAutogen/RerunRccConfigChange/RccConfigChange/CMakeLists.txt b/Tests/QtAutogen/RerunRccConfigChange/RccConfigChange/CMakeLists.txt index 3cddf5c..e2dd0ac 100644 --- a/Tests/QtAutogen/RerunRccConfigChange/RccConfigChange/CMakeLists.txt +++ b/Tests/QtAutogen/RerunRccConfigChange/RccConfigChange/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.11.2) project(RccConfigChange) -include("../../AutogenTest.cmake") +include("../../AutogenCoreTest.cmake") # Enable AUTORCC for all targets set(CMAKE_AUTORCC ON) diff --git a/Tests/QtAutogen/RerunRccDepends/CMakeLists.txt b/Tests/QtAutogen/RerunRccDepends/CMakeLists.txt index 4268de2..80c5cf0 100644 --- a/Tests/QtAutogen/RerunRccDepends/CMakeLists.txt +++ b/Tests/QtAutogen/RerunRccDepends/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.10) project(RerunRccDepends) -include("../AutogenTest.cmake") +include("../AutogenCoreTest.cmake") # Tests rcc rebuilding when a resource file changes diff --git a/Tests/QtAutogen/RerunRccDepends/RccDepends/CMakeLists.txt b/Tests/QtAutogen/RerunRccDepends/RccDepends/CMakeLists.txt index 0507e61..150f849 100644 --- a/Tests/QtAutogen/RerunRccDepends/RccDepends/CMakeLists.txt +++ b/Tests/QtAutogen/RerunRccDepends/RccDepends/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.10) project(RccDepends) -include("../../AutogenTest.cmake") +include("../../AutogenCoreTest.cmake") # Enable AUTORCC for all targets set(CMAKE_AUTORCC ON) diff --git a/Tests/QtAutogen/SameName/CMakeLists.txt b/Tests/QtAutogen/SameName/CMakeLists.txt index 931e40f..6d42499 100644 --- a/Tests/QtAutogen/SameName/CMakeLists.txt +++ b/Tests/QtAutogen/SameName/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.10) project(SameName) -include("../AutogenTest.cmake") +include("../AutogenGuiTest.cmake") # Test AUTOMOC and AUTORCC on source files with the same name # but in different subdirectories diff --git a/Tests/QtAutogen/StaticLibraryCycle/CMakeLists.txt b/Tests/QtAutogen/StaticLibraryCycle/CMakeLists.txt index 0c2f987..f3536ba 100644 --- a/Tests/QtAutogen/StaticLibraryCycle/CMakeLists.txt +++ b/Tests/QtAutogen/StaticLibraryCycle/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.10) project(StaticLibraryCycle) -include("../AutogenTest.cmake") +include("../AutogenCoreTest.cmake") # Test AUTOMOC on cyclic static libraries diff --git a/Tests/QtAutogen/Tests.cmake b/Tests/QtAutogen/Tests.cmake index 5025d43..c53fb4f 100644 --- a/Tests/QtAutogen/Tests.cmake +++ b/Tests/QtAutogen/Tests.cmake @@ -25,6 +25,7 @@ ADD_AUTOGEN_TEST(SameName sameName) ADD_AUTOGEN_TEST(StaticLibraryCycle slc) ADD_AUTOGEN_TEST(UicInclude uicInclude) ADD_AUTOGEN_TEST(UicInterface QtAutoUicInterface) +ADD_AUTOGEN_TEST(UicNoGui uicNoGui) ADD_AUTOGEN_TEST(UicOnly uicOnly) ADD_AUTOGEN_TEST(UicSkipSource) @@ -38,7 +39,8 @@ endif() # Qt5 only tests if(QT_TEST_VERSION GREATER 4) ADD_AUTOGEN_TEST(MocMacroName mocMacroName) - ADD_AUTOGEN_TEST(MocOsMacros) + # Disabled for issue #18669 + #ADD_AUTOGEN_TEST(MocOsMacros) ADD_AUTOGEN_TEST(RerunMocPlugin) if(APPLE) ADD_AUTOGEN_TEST(MacOsFW) diff --git a/Tests/QtAutogen/UicInclude/CMakeLists.txt b/Tests/QtAutogen/UicInclude/CMakeLists.txt index 56f76fb..929868b 100644 --- a/Tests/QtAutogen/UicInclude/CMakeLists.txt +++ b/Tests/QtAutogen/UicInclude/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.10) project(UicInclude) -include("../AutogenTest.cmake") +include("../AutogenGuiTest.cmake") # Test uic include patterns set(CMAKE_AUTOUIC_SEARCH_PATHS "dirA") diff --git a/Tests/QtAutogen/UicInterface/CMakeLists.txt b/Tests/QtAutogen/UicInterface/CMakeLists.txt index e0421a2..e022764 100644 --- a/Tests/QtAutogen/UicInterface/CMakeLists.txt +++ b/Tests/QtAutogen/UicInterface/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.10) project(UicInterface) -include("../AutogenTest.cmake") +include("../AutogenGuiTest.cmake") set(CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON) set(CMAKE_AUTOMOC ON) @@ -43,12 +43,12 @@ set(INC_DIR "include" ) endif() add_library(LibWidget libwidget.cpp) -target_link_libraries(LibWidget KI18n ${QT_QTGUI_TARGET}) +target_link_libraries(LibWidget KI18n ${QT_LIBRARIES}) set_property(TARGET LibWidget PROPERTY NO_KUIT_SEMANTIC ON) set_property(TARGET LibWidget PROPERTY TRANSLATION_DOMAIN customdomain) add_library(MyWidget mywidget.cpp) -target_link_libraries(MyWidget KI18n ${QT_QTGUI_TARGET}) +target_link_libraries(MyWidget KI18n ${QT_LIBRARIES}) add_executable(QtAutoUicInterface main.cpp) target_compile_definitions(QtAutoUicInterface diff --git a/Tests/QtAutogen/UicNoGui/CMakeLists.txt b/Tests/QtAutogen/UicNoGui/CMakeLists.txt new file mode 100644 index 0000000..076299d --- /dev/null +++ b/Tests/QtAutogen/UicNoGui/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.13) +project(UicNoGui) +include("../AutogenCoreTest.cmake") + +# This tests creates a target that has AUTOUIC enabled but does not +# link against QtXWidgets. + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTOUIC ON) +set(CMAKE_AUTORCC ON) + +add_subdirectory(MocOnly) +add_subdirectory(NoQt) + +add_executable(uicNoGui main.cpp) +target_link_libraries(uicNoGui mocOnly noQt) diff --git a/Tests/QtAutogen/UicNoGui/MocOnly/CMakeLists.txt b/Tests/QtAutogen/UicNoGui/MocOnly/CMakeLists.txt new file mode 100644 index 0000000..4fcd75f --- /dev/null +++ b/Tests/QtAutogen/UicNoGui/MocOnly/CMakeLists.txt @@ -0,0 +1,3 @@ +# Library uses QtCore only (no Widgets) +add_library(mocOnly main.cpp) +target_link_libraries(mocOnly ${QT_QTCORE_TARGET}) diff --git a/Tests/QtAutogen/UicNoGui/MocOnly/main.cpp b/Tests/QtAutogen/UicNoGui/MocOnly/main.cpp new file mode 100644 index 0000000..3091845 --- /dev/null +++ b/Tests/QtAutogen/UicNoGui/MocOnly/main.cpp @@ -0,0 +1,15 @@ +#include <QObject> + +class LocalObject : public QObject +{ + Q_OBJECT +public: + LocalObject(){}; +}; + +void mocOnly() +{ + LocalObject obj; +} + +#include "main.moc" diff --git a/Tests/QtAutogen/UicNoGui/NoQt/CMakeLists.txt b/Tests/QtAutogen/UicNoGui/NoQt/CMakeLists.txt new file mode 100644 index 0000000..f2bf3ee --- /dev/null +++ b/Tests/QtAutogen/UicNoGui/NoQt/CMakeLists.txt @@ -0,0 +1,2 @@ +# Library doesn't use or link against Qt at all +add_library(noQt main.cpp) diff --git a/Tests/QtAutogen/UicNoGui/NoQt/main.cpp b/Tests/QtAutogen/UicNoGui/NoQt/main.cpp new file mode 100644 index 0000000..0052cc8 --- /dev/null +++ b/Tests/QtAutogen/UicNoGui/NoQt/main.cpp @@ -0,0 +1,4 @@ + +void noQt() +{ +} diff --git a/Tests/QtAutogen/UicNoGui/main.cpp b/Tests/QtAutogen/UicNoGui/main.cpp new file mode 100644 index 0000000..e90c60a --- /dev/null +++ b/Tests/QtAutogen/UicNoGui/main.cpp @@ -0,0 +1,9 @@ +extern void mocOnly(); +extern void noQt(); + +int main(int argc, char* argv[]) +{ + mocOnly(); + noQt(); + return 0; +} diff --git a/Tests/QtAutogen/UicOnly/CMakeLists.txt b/Tests/QtAutogen/UicOnly/CMakeLists.txt index f927f72..b163254 100644 --- a/Tests/QtAutogen/UicOnly/CMakeLists.txt +++ b/Tests/QtAutogen/UicOnly/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.10) project(UicOnly) -include("../AutogenTest.cmake") +include("../AutogenGuiTest.cmake") # Test AUTOUIC being enabled only add_executable(uicOnly main.cpp UicOnly.cpp) diff --git a/Tests/QtAutogen/UicSkipSource/CMakeLists.txt b/Tests/QtAutogen/UicSkipSource/CMakeLists.txt index e94864d..dc3b7d4e 100644 --- a/Tests/QtAutogen/UicSkipSource/CMakeLists.txt +++ b/Tests/QtAutogen/UicSkipSource/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.10) project(UicSkipSource) -include("../AutogenTest.cmake") +include("../AutogenGuiTest.cmake") # Test for SKIP_AUTOUIC and SKIP_AUTOGEN on an AUTOUIC enabled target set(skipUicSources diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 748314d..67fd65a 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -66,6 +66,9 @@ function(add_RunCMake_test_group test types) endforeach() endfunction() +# Some tests use python for extra checks. +find_package(PythonInterp QUIET) + if(XCODE_VERSION AND "${XCODE_VERSION}" VERSION_LESS 6.1) set(Swift_ARGS -DXCODE_BELOW_6_1=1) endif() @@ -155,11 +158,12 @@ add_RunCMake_test(DisallowedCommands) add_RunCMake_test(ExternalData) add_RunCMake_test(FeatureSummary) add_RunCMake_test(FPHSA) +add_RunCMake_test(FileAPI -DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE}) add_RunCMake_test(FindBoost) add_RunCMake_test(FindLua) add_RunCMake_test(FindOpenGL) if(CMake_TEST_UseSWIG) - add_RunCMake_test(UseSWIG) + add_RunCMake_test(UseSWIG -DCMake_TEST_FindPython=${CMake_TEST_FindPython}) endif() if(NOT CMAKE_C_COMPILER_ID MATCHES "Watcom") add_RunCMake_test(GenerateExportHeader) @@ -275,6 +279,7 @@ function(add_RunCMake_test_try_compile) endif() endif() foreach(var + CMAKE_SYSTEM_NAME CMAKE_C_COMPILER_ID CMAKE_C_COMPILER_VERSION CMAKE_C_STANDARD_DEFAULT @@ -291,7 +296,8 @@ function(add_RunCMake_test_try_compile) endfunction() add_RunCMake_test_try_compile() -add_RunCMake_test(try_run) +add_RunCMake_test(try_run -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME} + -DCMAKE_C_COMPILER_ID=${CMAKE_C_COMPILER_ID}) add_RunCMake_test(set) add_RunCMake_test(variable_watch) add_RunCMake_test(while) @@ -382,7 +388,8 @@ add_RunCMake_test(FetchContent) if(NOT CMake_TEST_EXTERNAL_CMAKE) set(CTestCommandLine_ARGS -DTEST_AFFINITY=$<TARGET_FILE:testAffinity>) endif() -add_RunCMake_test(CTestCommandLine) +add_executable(print_stdin print_stdin.c) +add_RunCMake_test(CTestCommandLine -DTEST_PRINT_STDIN=$<TARGET_FILE:print_stdin>) add_RunCMake_test(CacheNewline) # Only run this test on unix platforms that support # symbolic links diff --git a/Tests/RunCMake/CPack/tests/EXTERNAL/create_package.cmake b/Tests/RunCMake/CPack/tests/EXTERNAL/create_package.cmake index e308ccb..2d7f993 100644 --- a/Tests/RunCMake/CPack/tests/EXTERNAL/create_package.cmake +++ b/Tests/RunCMake/CPack/tests/EXTERNAL/create_package.cmake @@ -22,3 +22,5 @@ expect_file(${CPACK_TEMPORARY_DIRECTORY}/f1/share/cpack-test/f1.txt) expect_file(${CPACK_TEMPORARY_DIRECTORY}/f2/share/cpack-test/f2.txt) expect_file(${CPACK_TEMPORARY_DIRECTORY}/f3/share/cpack-test/f3.txt) expect_file(${CPACK_TEMPORARY_DIRECTORY}/f4/share/cpack-test/f4.txt) + +message(STATUS "This status message is expected to be visible") diff --git a/Tests/RunCMake/CPack/tests/EXTERNAL/stage_and_package-stdout.txt b/Tests/RunCMake/CPack/tests/EXTERNAL/stage_and_package-stdout.txt new file mode 100644 index 0000000..37d635f --- /dev/null +++ b/Tests/RunCMake/CPack/tests/EXTERNAL/stage_and_package-stdout.txt @@ -0,0 +1 @@ +-- This status message is expected to be visible diff --git a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake index 9e8d050..750ae50 100644 --- a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake +++ b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake @@ -161,3 +161,15 @@ endfunction() if(TEST_AFFINITY) run_TestAffinity() endif() + +function(run_TestStdin) + set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/TestStdin) + set(RunCMake_TEST_NO_CLEAN 1) + file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}") + file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}") + file(WRITE "${RunCMake_TEST_BINARY_DIR}/CTestTestfile.cmake" " + add_test(TestStdin \"${TEST_PRINT_STDIN}\") + ") + run_cmake_command(TestStdin ${CMAKE_CTEST_COMMAND} -V) +endfunction() +run_TestStdin() diff --git a/Tests/RunCMake/CTestCommandLine/TestStdin-stdin.txt b/Tests/RunCMake/CTestCommandLine/TestStdin-stdin.txt new file mode 100644 index 0000000..d83b50a --- /dev/null +++ b/Tests/RunCMake/CTestCommandLine/TestStdin-stdin.txt @@ -0,0 +1 @@ +Content for TestStdin diff --git a/Tests/RunCMake/CTestCommandLine/TestStdin-stdout.txt b/Tests/RunCMake/CTestCommandLine/TestStdin-stdout.txt new file mode 100644 index 0000000..d83b50a --- /dev/null +++ b/Tests/RunCMake/CTestCommandLine/TestStdin-stdout.txt @@ -0,0 +1 @@ +Content for TestStdin diff --git a/Tests/RunCMake/CTestTimeoutAfterMatch/CTestConfig.cmake.in b/Tests/RunCMake/CTestTimeoutAfterMatch/CTestConfig.cmake.in deleted file mode 100644 index 58b11af..0000000 --- a/Tests/RunCMake/CTestTimeoutAfterMatch/CTestConfig.cmake.in +++ /dev/null @@ -1 +0,0 @@ -set(CTEST_PROJECT_NAME "TimeoutAfterMatch@CASE_NAME@") diff --git a/Tests/RunCMake/CommandLine/E_touch-nonexistent-dir-result.txt b/Tests/RunCMake/CommandLine/E_touch-nonexistent-dir-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_touch-nonexistent-dir-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLine/E_touch-nonexistent-dir-stderr.txt b/Tests/RunCMake/CommandLine/E_touch-nonexistent-dir-stderr.txt new file mode 100644 index 0000000..470d811 --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_touch-nonexistent-dir-stderr.txt @@ -0,0 +1 @@ +^cmake -E touch: failed to update ".+/touch-nonexistent-dir/foo"\.$ diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake index ef48852..a37b7f1 100644 --- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake +++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake @@ -22,7 +22,9 @@ run_cmake_command(E_echo_append ${CMAKE_COMMAND} -E echo_append) run_cmake_command(E_rename-no-arg ${CMAKE_COMMAND} -E rename) run_cmake_command(E_server-arg ${CMAKE_COMMAND} -E server --extra-arg) run_cmake_command(E_server-pipe ${CMAKE_COMMAND} -E server --pipe=) + run_cmake_command(E_touch_nocreate-no-arg ${CMAKE_COMMAND} -E touch_nocreate) +run_cmake_command(E_touch-nonexistent-dir ${CMAKE_COMMAND} -E touch "${RunCMake_BINARY_DIR}/touch-nonexistent-dir/foo") run_cmake_command(E_time ${CMAKE_COMMAND} -E time ${CMAKE_COMMAND} -E echo "hello world") run_cmake_command(E_time-no-arg ${CMAKE_COMMAND} -E time) diff --git a/Tests/RunCMake/ExternalProject/LogOutputOnFailure-build-result.txt b/Tests/RunCMake/ExternalProject/LogOutputOnFailure-build-result.txt new file mode 100644 index 0000000..c20fd86 --- /dev/null +++ b/Tests/RunCMake/ExternalProject/LogOutputOnFailure-build-result.txt @@ -0,0 +1 @@ +^[^0] diff --git a/Tests/RunCMake/ExternalProject/LogOutputOnFailure-build-stderr.txt b/Tests/RunCMake/ExternalProject/LogOutputOnFailure-build-stderr.txt new file mode 100644 index 0000000..8d98f9d --- /dev/null +++ b/Tests/RunCMake/ExternalProject/LogOutputOnFailure-build-stderr.txt @@ -0,0 +1 @@ +.* diff --git a/Tests/RunCMake/ExternalProject/LogOutputOnFailure-build-stdout.txt b/Tests/RunCMake/ExternalProject/LogOutputOnFailure-build-stdout.txt new file mode 100644 index 0000000..87e5384 --- /dev/null +++ b/Tests/RunCMake/ExternalProject/LogOutputOnFailure-build-stdout.txt @@ -0,0 +1,8 @@ +( )?-- stdout output is: +( )?This is some dummy output with some long lines to ensure formatting is preserved +( )? Including lines with leading spaces +( )? +( )?And also blank lines[ + ]+ +( )?-- stderr output is: +( )?cmake -E env: no command given diff --git a/Tests/RunCMake/ExternalProject/LogOutputOnFailure.cmake b/Tests/RunCMake/ExternalProject/LogOutputOnFailure.cmake new file mode 100644 index 0000000..863bbef --- /dev/null +++ b/Tests/RunCMake/ExternalProject/LogOutputOnFailure.cmake @@ -0,0 +1,20 @@ +include(ExternalProject) + +set(dummyOutput [[ +This is some dummy output with some long lines to ensure formatting is preserved + Including lines with leading spaces + +And also blank lines +]]) + +ExternalProject_Add(FailsWithOutput + SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR} + CONFIGURE_COMMAND "" + BUILD_COMMAND ${CMAKE_COMMAND} -E echo ${dummyOutput} + COMMAND ${CMAKE_COMMAND} -E env # missing command, forces fail + TEST_COMMAND "" + INSTALL_COMMAND "" + LOG_BUILD YES + LOG_OUTPUT_ON_FAILURE YES + USES_TERMINAL_BUILD YES +) diff --git a/Tests/RunCMake/ExternalProject/LogOutputOnFailureMerged-build-result.txt b/Tests/RunCMake/ExternalProject/LogOutputOnFailureMerged-build-result.txt new file mode 100644 index 0000000..c20fd86 --- /dev/null +++ b/Tests/RunCMake/ExternalProject/LogOutputOnFailureMerged-build-result.txt @@ -0,0 +1 @@ +^[^0] diff --git a/Tests/RunCMake/ExternalProject/LogOutputOnFailureMerged-build-stderr.txt b/Tests/RunCMake/ExternalProject/LogOutputOnFailureMerged-build-stderr.txt new file mode 100644 index 0000000..8d98f9d --- /dev/null +++ b/Tests/RunCMake/ExternalProject/LogOutputOnFailureMerged-build-stderr.txt @@ -0,0 +1 @@ +.* diff --git a/Tests/RunCMake/ExternalProject/LogOutputOnFailureMerged-build-stdout.txt b/Tests/RunCMake/ExternalProject/LogOutputOnFailureMerged-build-stdout.txt new file mode 100644 index 0000000..11c7317 --- /dev/null +++ b/Tests/RunCMake/ExternalProject/LogOutputOnFailureMerged-build-stdout.txt @@ -0,0 +1,7 @@ +( )?-- Log output is: +( )?This is some dummy output with some long lines to ensure formatting is preserved +( )? Including lines with leading spaces +( )? +( )?And also blank lines[ + ]+ +( )?cmake -E env: no command given diff --git a/Tests/RunCMake/ExternalProject/LogOutputOnFailureMerged.cmake b/Tests/RunCMake/ExternalProject/LogOutputOnFailureMerged.cmake new file mode 100644 index 0000000..116448b --- /dev/null +++ b/Tests/RunCMake/ExternalProject/LogOutputOnFailureMerged.cmake @@ -0,0 +1,21 @@ +include(ExternalProject) + +set(dummyOutput [[ +This is some dummy output with some long lines to ensure formatting is preserved + Including lines with leading spaces + +And also blank lines +]]) + +ExternalProject_Add(FailsWithOutput + SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR} + CONFIGURE_COMMAND "" + BUILD_COMMAND ${CMAKE_COMMAND} -E echo ${dummyOutput} + COMMAND ${CMAKE_COMMAND} -E env # missing command, forces fail + TEST_COMMAND "" + INSTALL_COMMAND "" + LOG_BUILD YES + LOG_OUTPUT_ON_FAILURE YES + LOG_MERGED_STDOUTERR YES + USES_TERMINAL_BUILD YES +) diff --git a/Tests/RunCMake/ExternalProject/RunCMakeTest.cmake b/Tests/RunCMake/ExternalProject/RunCMakeTest.cmake index bf11381..caaf0d2 100644 --- a/Tests/RunCMake/ExternalProject/RunCMakeTest.cmake +++ b/Tests/RunCMake/ExternalProject/RunCMakeTest.cmake @@ -29,6 +29,13 @@ endfunction() __ep_test_with_build(MultiCommand) +# Output is not predictable enough to be able to verify it reliably +# when using the various different Visual Studio generators +if(NOT RunCMake_GENERATOR MATCHES "Visual Studio") + __ep_test_with_build(LogOutputOnFailure) + __ep_test_with_build(LogOutputOnFailureMerged) +endif() + # We can't test the substitution when using the old MSYS due to # make/sh mangling the paths (substitution is performed correctly, # but the mangling means we can't reliably test the output). diff --git a/Tests/RunCMake/FileAPI/CMakeLists.txt b/Tests/RunCMake/FileAPI/CMakeLists.txt new file mode 100644 index 0000000..44025d3 --- /dev/null +++ b/Tests/RunCMake/FileAPI/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 3.12) +project(${RunCMake_TEST} NONE) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/FileAPI/ClientStateful-check.cmake b/Tests/RunCMake/FileAPI/ClientStateful-check.cmake new file mode 100644 index 0000000..1e9aab6 --- /dev/null +++ b/Tests/RunCMake/FileAPI/ClientStateful-check.cmake @@ -0,0 +1,68 @@ +set(expect + query + query/client-client-member + query/client-client-member/query.json + query/client-empty-array + query/client-empty-array/query.json + query/client-empty-object + query/client-empty-object/query.json + query/client-json-bad-root + query/client-json-bad-root/query.json + query/client-json-empty + query/client-json-empty/query.json + query/client-json-extra + query/client-json-extra/query.json + query/client-not-file + query/client-not-file/query.json + query/client-request-array-negative-major-version + query/client-request-array-negative-major-version/query.json + query/client-request-array-negative-minor-version + query/client-request-array-negative-minor-version/query.json + query/client-request-array-negative-version + query/client-request-array-negative-version/query.json + query/client-request-array-no-major-version + query/client-request-array-no-major-version/query.json + query/client-request-array-no-supported-version + query/client-request-array-no-supported-version-among + query/client-request-array-no-supported-version-among/query.json + query/client-request-array-no-supported-version/query.json + query/client-request-array-version-1 + query/client-request-array-version-1-1 + query/client-request-array-version-1-1/query.json + query/client-request-array-version-1/query.json + query/client-request-array-version-2 + query/client-request-array-version-2/query.json + query/client-request-negative-major-version + query/client-request-negative-major-version/query.json + query/client-request-negative-minor-version + query/client-request-negative-minor-version/query.json + query/client-request-negative-version + query/client-request-negative-version/query.json + query/client-request-no-major-version + query/client-request-no-major-version/query.json + query/client-request-no-version + query/client-request-no-version/query.json + query/client-request-version-1 + query/client-request-version-1-1 + query/client-request-version-1-1/query.json + query/client-request-version-1/query.json + query/client-request-version-2 + query/client-request-version-2/query.json + query/client-requests-bad + query/client-requests-bad/query.json + query/client-requests-empty + query/client-requests-empty/query.json + query/client-requests-not-kinded + query/client-requests-not-kinded/query.json + query/client-requests-not-objects + query/client-requests-not-objects/query.json + query/client-requests-unknown + query/client-requests-unknown/query.json + reply + reply/__test-v1-[0-9a-f]+.json + reply/__test-v2-[0-9a-f]+.json + reply/index-[0-9.T-]+.json + ) +check_api("^${expect}$") + +check_python(ClientStateful) diff --git a/Tests/RunCMake/FileAPI/ClientStateful-check.py b/Tests/RunCMake/FileAPI/ClientStateful-check.py new file mode 100644 index 0000000..f3d20d1 --- /dev/null +++ b/Tests/RunCMake/FileAPI/ClientStateful-check.py @@ -0,0 +1,258 @@ +from check_index import * + +def check_reply(q): + assert is_dict(q) + assert sorted(q.keys()) == [ + "client-client-member", + "client-empty-array", + "client-empty-object", + "client-json-bad-root", + "client-json-empty", + "client-json-extra", + "client-not-file", + "client-request-array-negative-major-version", + "client-request-array-negative-minor-version", + "client-request-array-negative-version", + "client-request-array-no-major-version", + "client-request-array-no-supported-version", + "client-request-array-no-supported-version-among", + "client-request-array-version-1", + "client-request-array-version-1-1", + "client-request-array-version-2", + "client-request-negative-major-version", + "client-request-negative-minor-version", + "client-request-negative-version", + "client-request-no-major-version", + "client-request-no-version", + "client-request-version-1", + "client-request-version-1-1", + "client-request-version-2", + "client-requests-bad", + "client-requests-empty", + "client-requests-not-kinded", + "client-requests-not-objects", + "client-requests-unknown", + ] + expected = [ + (check_query_client_member, "client-client-member"), + (check_query_empty_array, "client-empty-array"), + (check_query_empty_object, "client-empty-object"), + (check_query_json_bad_root, "client-json-bad-root"), + (check_query_json_empty, "client-json-empty"), + (check_query_json_extra, "client-json-extra"), + (check_query_not_file, "client-not-file"), + (check_query_requests_bad, "client-requests-bad"), + (check_query_requests_empty, "client-requests-empty"), + (check_query_requests_not_kinded, "client-requests-not-kinded"), + (check_query_requests_not_objects, "client-requests-not-objects"), + (check_query_requests_unknown, "client-requests-unknown"), + ] + for (f, k) in expected: + assert is_dict(q[k]) + assert sorted(q[k].keys()) == ["query.json"] + f(q[k]["query.json"]) + expected = [ + (check_query_response_array_negative_major_version, "client-request-array-negative-major-version"), + (check_query_response_array_negative_minor_version, "client-request-array-negative-minor-version"), + (check_query_response_array_negative_version, "client-request-array-negative-version"), + (check_query_response_array_no_major_version, "client-request-array-no-major-version"), + (check_query_response_array_no_supported_version, "client-request-array-no-supported-version"), + (check_query_response_array_no_supported_version_among, "client-request-array-no-supported-version-among"), + (check_query_response_array_version_1, "client-request-array-version-1"), + (check_query_response_array_version_1_1, "client-request-array-version-1-1"), + (check_query_response_array_version_2, "client-request-array-version-2"), + (check_query_response_negative_major_version, "client-request-negative-major-version"), + (check_query_response_negative_minor_version, "client-request-negative-minor-version"), + (check_query_response_negative_version, "client-request-negative-version"), + (check_query_response_no_major_version, "client-request-no-major-version"), + (check_query_response_no_version, "client-request-no-version"), + (check_query_response_version_1, "client-request-version-1"), + (check_query_response_version_1_1, "client-request-version-1-1"), + (check_query_response_version_2, "client-request-version-2"), + ] + for (f, k) in expected: + assert is_dict(q[k]) + assert sorted(q[k].keys()) == ["query.json"] + assert is_dict(q[k]["query.json"]) + assert sorted(q[k]["query.json"].keys()) == ["requests", "responses"] + r = q[k]["query.json"]["requests"] + assert is_list(r) + assert len(r) == 1 + assert is_dict(r[0]) + assert r[0]["kind"] == "__test" + r = q[k]["query.json"]["responses"] + assert is_list(r) + assert len(r) == 1 + assert is_dict(r[0]) + f(r[0]) + +def check_query_client_member(q): + assert is_dict(q) + assert sorted(q.keys()) == ["client", "responses"] + assert is_dict(q["client"]) + assert sorted(q["client"].keys()) == [] + check_error(q["responses"], "'requests' member missing") + +def check_query_empty_array(q): + check_error(q, "query root is not an object") + +def check_query_empty_object(q): + assert is_dict(q) + assert sorted(q.keys()) == ["responses"] + check_error(q["responses"], "'requests' member missing") + +def check_query_json_bad_root(q): + check_error_re(q, "A valid JSON document must be either an array or an object value") + +def check_query_json_empty(q): + check_error_re(q, "value, object or array expected") + +def check_query_json_extra(q): + check_error_re(q, "Extra non-whitespace after JSON value") + +def check_query_not_file(q): + check_error_re(q, "failed to read from file") + +def check_query_requests_bad(q): + assert is_dict(q) + assert sorted(q.keys()) == ["requests", "responses"] + r = q["requests"] + assert is_dict(r) + assert sorted(r.keys()) == [] + check_error(q["responses"], "'requests' member is not an array") + +def check_query_requests_empty(q): + assert is_dict(q) + assert sorted(q.keys()) == ["requests", "responses"] + r = q["requests"] + assert is_list(r) + assert len(r) == 0 + r = q["responses"] + assert is_list(r) + assert len(r) == 0 + +def check_query_requests_not_kinded(q): + assert is_dict(q) + assert sorted(q.keys()) == ["requests", "responses"] + r = q["requests"] + assert is_list(r) + assert len(r) == 4 + assert is_dict(r[0]) + assert sorted(r[0].keys()) == [] + assert is_dict(r[1]) + assert sorted(r[1].keys()) == ["kind"] + assert is_dict(r[1]["kind"]) + assert is_dict(r[2]) + assert sorted(r[2].keys()) == ["kind"] + assert is_list(r[2]["kind"]) + assert is_dict(r[3]) + assert sorted(r[3].keys()) == ["kind"] + assert is_int(r[3]["kind"]) + r = q["responses"] + assert is_list(r) + assert len(r) == 4 + check_error(r[0], "'kind' member missing") + check_error(r[1], "'kind' member is not a string") + check_error(r[2], "'kind' member is not a string") + check_error(r[3], "'kind' member is not a string") + +def check_query_requests_not_objects(q): + assert is_dict(q) + assert sorted(q.keys()) == ["requests", "responses"] + r = q["requests"] + assert is_list(r) + assert len(r) == 3 + assert is_int(r[0]) + assert is_string(r[1]) + assert is_list(r[2]) + r = q["responses"] + assert is_list(r) + assert len(r) == 3 + check_error(r[0], "request is not an object") + check_error(r[1], "request is not an object") + check_error(r[2], "request is not an object") + +def check_query_requests_unknown(q): + assert is_dict(q) + assert sorted(q.keys()) == ["requests", "responses"] + r = q["requests"] + assert is_list(r) + assert len(r) == 3 + assert is_dict(r[0]) + assert sorted(r[0].keys()) == ["kind"] + assert r[0]["kind"] == "unknownC" + assert is_dict(r[1]) + assert sorted(r[1].keys()) == ["kind"] + assert r[1]["kind"] == "unknownB" + assert is_dict(r[2]) + assert sorted(r[2].keys()) == ["kind"] + assert r[2]["kind"] == "unknownA" + r = q["responses"] + assert is_list(r) + assert len(r) == 3 + check_error(r[0], "unknown request kind 'unknownC'") + check_error(r[1], "unknown request kind 'unknownB'") + check_error(r[2], "unknown request kind 'unknownA'") + +def check_query_response_array_negative_major_version(r): + check_error(r, "'version' object 'major' member is not a non-negative integer") + +def check_query_response_array_negative_minor_version(r): + check_error(r, "'version' object 'minor' member is not a non-negative integer") + +def check_query_response_array_negative_version(r): + check_error(r, "'version' array entry is not a non-negative integer or object") + +def check_query_response_array_no_major_version(r): + check_error(r, "'version' object 'major' member missing") + +def check_query_response_array_no_supported_version(r): + check_error(r, "no supported version specified") + +def check_query_response_array_no_supported_version_among(r): + check_error(r, "no supported version specified among: 4.0 3.0") + +def check_query_response_array_version_1(r): + check_index__test(r, 1, 3) + +def check_query_response_array_version_1_1(r): + check_index__test(r, 1, 3) # always uses latest minor version + +def check_query_response_array_version_2(r): + check_index__test(r, 2, 0) + +def check_query_response_negative_major_version(r): + check_error(r, "'version' object 'major' member is not a non-negative integer") + +def check_query_response_negative_minor_version(r): + check_error(r, "'version' object 'minor' member is not a non-negative integer") + +def check_query_response_negative_version(r): + check_error(r, "'version' member is not a non-negative integer, object, or array") + +def check_query_response_no_major_version(r): + check_error(r, "'version' object 'major' member missing") + +def check_query_response_no_version(r): + check_error(r, "'version' member missing") + +def check_query_response_version_1(r): + check_index__test(r, 1, 3) + +def check_query_response_version_1_1(r): + check_index__test(r, 1, 3) # always uses latest minor version + +def check_query_response_version_2(r): + check_index__test(r, 2, 0) + +def check_objects(o): + assert is_list(o) + assert len(o) == 2 + check_index__test(o[0], 1, 3) + check_index__test(o[1], 2, 0) + +assert is_dict(index) +assert sorted(index.keys()) == ["cmake", "objects", "reply"] +check_cmake(index["cmake"]) +check_reply(index["reply"]) +check_objects(index["objects"]) diff --git a/Tests/RunCMake/FileAPI/ClientStateful-prep.cmake b/Tests/RunCMake/FileAPI/ClientStateful-prep.cmake new file mode 100644 index 0000000..5b41d7a --- /dev/null +++ b/Tests/RunCMake/FileAPI/ClientStateful-prep.cmake @@ -0,0 +1,73 @@ +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-client-member/query.json" [[{ "client": {} }]]) +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-empty-array/query.json" "[]") +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-empty-object/query.json" "{}") +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-json-bad-root/query.json" [["invalid root"]]) +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-json-empty/query.json" "") +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-json-extra/query.json" "{}x") +file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-not-file/query.json") + +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-requests-bad/query.json" [[{ "requests": {} }]]) +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-requests-empty/query.json" [[{ "requests": [] }]]) + +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-requests-not-objects/query.json" [[ +{ "requests": [ 0, "", [] ] } +]]) +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-requests-not-kinded/query.json" [[ +{ "requests": [ {}, { "kind": {} }, { "kind": [] }, { "kind": 0 } ] } +]]) +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-requests-unknown/query.json" [[ +{ "requests": [ { "kind": "unknownC" }, { "kind": "unknownB" }, { "kind": "unknownA" } ] } +]]) +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-request-no-version/query.json" [[ +{ "requests": [ { "kind": "__test" } ] } +]]) +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-request-negative-version/query.json" [[ +{ "requests": [ { "kind": "__test", "version" : -1 } ] } +]]) +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-request-no-major-version/query.json" [[ +{ "requests": [ { "kind": "__test", "version" : {} } ] } +]]) +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-request-negative-major-version/query.json" [[ +{ "requests": [ { "kind": "__test", "version" : { "major": -1 } } ] } +]]) +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-request-negative-minor-version/query.json" [[ +{ "requests": [ { "kind": "__test", "version" : { "major": 0, "minor": -1 } } ] } +]]) +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-request-array-negative-version/query.json" [[ +{ "requests": [ { "kind": "__test", "version" : [ 1, -1 ] } ] } +]]) +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-request-array-no-major-version/query.json" [[ +{ "requests": [ { "kind": "__test", "version" : [ 1, {} ] } ] } +]]) +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-request-array-negative-major-version/query.json" [[ +{ "requests": [ { "kind": "__test", "version" : [ 1, { "major": -1 } ] } ] } +]]) +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-request-array-negative-minor-version/query.json" [[ +{ "requests": [ { "kind": "__test", "version" : [ 1, { "major": 0, "minor": -1 } ] } ] } +]]) +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-request-array-no-supported-version/query.json" [[ +{ "requests": [ { "kind": "__test", "version" : [] } ] } +]]) +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-request-array-no-supported-version-among/query.json" [[ +{ "requests": [ { "kind": "__test", "version" : [4, 3] } ] } +]]) +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-request-version-1/query.json" [[ +{ "requests": [ { "kind": "__test", "version" : 1 } ] } +]]) +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-request-version-1-1/query.json" [[ +{ "requests": [ { "kind": "__test", "version" : { "major": 1, "minor": 1 } } ] } +]]) +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-request-version-2/query.json" [[ +{ "requests": [ { "kind": "__test", "version" : { "major": 2 } } ] } +]]) +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-request-array-version-1/query.json" [[ +{ "requests": [ { "kind": "__test", "version" : [3, 1] } ] } +]]) +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-request-array-version-1-1/query.json" [[ +{ "requests": [ { "kind": "__test", "version" : [3, { "major": 1, "minor": 1 }, 2 ] } ] } +]]) +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-request-array-version-2/query.json" [[ +{ "requests": [ { "kind": "__test", "version" : [3, { "major": 2 } ] } ] } +]]) + +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/reply/object-to-be-deleted.json" "") diff --git a/Tests/RunCMake/FileAPI/ClientStateful.cmake b/Tests/RunCMake/FileAPI/ClientStateful.cmake new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/FileAPI/ClientStateful.cmake diff --git a/Tests/RunCMake/FileAPI/ClientStateless-check.cmake b/Tests/RunCMake/FileAPI/ClientStateless-check.cmake new file mode 100644 index 0000000..955d9be --- /dev/null +++ b/Tests/RunCMake/FileAPI/ClientStateless-check.cmake @@ -0,0 +1,15 @@ +set(expect + query + query/client-foo + query/client-foo/__test-v1 + query/client-foo/__test-v2 + query/client-foo/__test-v3 + query/client-foo/unknown + reply + reply/__test-v1-[0-9a-f]+.json + reply/__test-v2-[0-9a-f]+.json + reply/index-[0-9.T-]+.json + ) +check_api("^${expect}$") + +check_python(ClientStateless) diff --git a/Tests/RunCMake/FileAPI/ClientStateless-check.py b/Tests/RunCMake/FileAPI/ClientStateless-check.py new file mode 100644 index 0000000..b7da314 --- /dev/null +++ b/Tests/RunCMake/FileAPI/ClientStateless-check.py @@ -0,0 +1,26 @@ +from check_index import * + +def check_reply(r): + assert is_dict(r) + assert sorted(r.keys()) == ["client-foo"] + check_reply_client_foo(r["client-foo"]) + +def check_reply_client_foo(r): + assert is_dict(r) + assert sorted(r.keys()) == ["__test-v1", "__test-v2", "__test-v3", "unknown"] + check_index__test(r["__test-v1"], 1, 3) + check_index__test(r["__test-v2"], 2, 0) + check_error(r["__test-v3"], "unknown query file") + check_error(r["unknown"], "unknown query file") + +def check_objects(o): + assert is_list(o) + assert len(o) == 2 + check_index__test(o[0], 1, 3) + check_index__test(o[1], 2, 0) + +assert is_dict(index) +assert sorted(index.keys()) == ["cmake", "objects", "reply"] +check_cmake(index["cmake"]) +check_reply(index["reply"]) +check_objects(index["objects"]) diff --git a/Tests/RunCMake/FileAPI/ClientStateless-prep.cmake b/Tests/RunCMake/FileAPI/ClientStateless-prep.cmake new file mode 100644 index 0000000..1b8d772 --- /dev/null +++ b/Tests/RunCMake/FileAPI/ClientStateless-prep.cmake @@ -0,0 +1,5 @@ +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-foo/__test-v1" "") +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-foo/__test-v2" "") +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-foo/__test-v3" "") +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-foo/unknown" "") +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/reply/object-to-be-deleted.json" "") diff --git a/Tests/RunCMake/FileAPI/ClientStateless.cmake b/Tests/RunCMake/FileAPI/ClientStateless.cmake new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/FileAPI/ClientStateless.cmake diff --git a/Tests/RunCMake/FileAPI/DuplicateStateless-check.cmake b/Tests/RunCMake/FileAPI/DuplicateStateless-check.cmake new file mode 100644 index 0000000..4959c1e --- /dev/null +++ b/Tests/RunCMake/FileAPI/DuplicateStateless-check.cmake @@ -0,0 +1,20 @@ +set(expect + query + query/__test-v1 + query/__test-v2 + query/__test-v3 + query/client-foo + query/client-foo/__test-v1 + query/client-foo/__test-v2 + query/client-foo/__test-v3 + query/client-foo/unknown + query/query.json + query/unknown + reply + reply/__test-v1-[0-9a-f]+.json + reply/__test-v2-[0-9a-f]+.json + reply/index-[0-9.T-]+.json + ) +check_api("^${expect}$") + +check_python(DuplicateStateless) diff --git a/Tests/RunCMake/FileAPI/DuplicateStateless-check.py b/Tests/RunCMake/FileAPI/DuplicateStateless-check.py new file mode 100644 index 0000000..3335479 --- /dev/null +++ b/Tests/RunCMake/FileAPI/DuplicateStateless-check.py @@ -0,0 +1,31 @@ +from check_index import * + +def check_reply(r): + assert is_dict(r) + assert sorted(r.keys()) == ["__test-v1", "__test-v2", "__test-v3", "client-foo", "query.json", "unknown"] + check_index__test(r["__test-v1"], 1, 3) + check_index__test(r["__test-v2"], 2, 0) + check_error(r["__test-v3"], "unknown query file") + check_reply_client_foo(r["client-foo"]) + check_error(r["query.json"], "unknown query file") + check_error(r["unknown"], "unknown query file") + +def check_reply_client_foo(r): + assert is_dict(r) + assert sorted(r.keys()) == ["__test-v1", "__test-v2", "__test-v3", "unknown"] + check_index__test(r["__test-v1"], 1, 3) + check_index__test(r["__test-v2"], 2, 0) + check_error(r["__test-v3"], "unknown query file") + check_error(r["unknown"], "unknown query file") + +def check_objects(o): + assert is_list(o) + assert len(o) == 2 + check_index__test(o[0], 1, 3) + check_index__test(o[1], 2, 0) + +assert is_dict(index) +assert sorted(index.keys()) == ["cmake", "objects", "reply"] +check_cmake(index["cmake"]) +check_reply(index["reply"]) +check_objects(index["objects"]) diff --git a/Tests/RunCMake/FileAPI/DuplicateStateless-prep.cmake b/Tests/RunCMake/FileAPI/DuplicateStateless-prep.cmake new file mode 100644 index 0000000..51b9852 --- /dev/null +++ b/Tests/RunCMake/FileAPI/DuplicateStateless-prep.cmake @@ -0,0 +1,10 @@ +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/__test-v1" "") +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/__test-v2" "") +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/__test-v3" "") +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/query.json" "") +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/unknown" "") +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-foo/__test-v1" "") +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-foo/__test-v2" "") +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-foo/__test-v3" "") +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-foo/unknown" "") +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/reply/object-to-be-deleted.json" "") diff --git a/Tests/RunCMake/FileAPI/DuplicateStateless.cmake b/Tests/RunCMake/FileAPI/DuplicateStateless.cmake new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/FileAPI/DuplicateStateless.cmake diff --git a/Tests/RunCMake/FileAPI/Empty-check.cmake b/Tests/RunCMake/FileAPI/Empty-check.cmake new file mode 100644 index 0000000..2764b42 --- /dev/null +++ b/Tests/RunCMake/FileAPI/Empty-check.cmake @@ -0,0 +1,8 @@ +set(expect + query + reply + reply/index-[0-9.T-]+.json + ) +check_api("^${expect}$") + +check_python(Empty) diff --git a/Tests/RunCMake/FileAPI/Empty-check.py b/Tests/RunCMake/FileAPI/Empty-check.py new file mode 100644 index 0000000..75bf096 --- /dev/null +++ b/Tests/RunCMake/FileAPI/Empty-check.py @@ -0,0 +1,15 @@ +from check_index import * + +def check_reply(r): + assert is_dict(r) + assert sorted(r.keys()) == [] + +def check_objects(o): + assert is_list(o) + assert len(o) == 0 + +assert is_dict(index) +assert sorted(index.keys()) == ["cmake", "objects", "reply"] +check_cmake(index["cmake"]) +check_reply(index["reply"]) +check_objects(index["objects"]) diff --git a/Tests/RunCMake/FileAPI/Empty-prep.cmake b/Tests/RunCMake/FileAPI/Empty-prep.cmake new file mode 100644 index 0000000..1d1f69e --- /dev/null +++ b/Tests/RunCMake/FileAPI/Empty-prep.cmake @@ -0,0 +1 @@ +file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query") diff --git a/Tests/RunCMake/FileAPI/Empty.cmake b/Tests/RunCMake/FileAPI/Empty.cmake new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/FileAPI/Empty.cmake diff --git a/Tests/RunCMake/FileAPI/EmptyClient-check.cmake b/Tests/RunCMake/FileAPI/EmptyClient-check.cmake new file mode 100644 index 0000000..4e5745c --- /dev/null +++ b/Tests/RunCMake/FileAPI/EmptyClient-check.cmake @@ -0,0 +1,9 @@ +set(expect + query + query/client-foo + reply + reply/index-[0-9.T-]+.json + ) +check_api("^${expect}$") + +check_python(EmptyClient) diff --git a/Tests/RunCMake/FileAPI/EmptyClient-check.py b/Tests/RunCMake/FileAPI/EmptyClient-check.py new file mode 100644 index 0000000..f887908 --- /dev/null +++ b/Tests/RunCMake/FileAPI/EmptyClient-check.py @@ -0,0 +1,20 @@ +from check_index import * + +def check_reply(r): + assert is_dict(r) + assert sorted(r.keys()) == ["client-foo"] + check_reply_client_foo(r["client-foo"]) + +def check_reply_client_foo(r): + assert is_dict(r) + assert sorted(r.keys()) == [] + +def check_objects(o): + assert is_list(o) + assert len(o) == 0 + +assert is_dict(index) +assert sorted(index.keys()) == ["cmake", "objects", "reply"] +check_cmake(index["cmake"]) +check_reply(index["reply"]) +check_objects(index["objects"]) diff --git a/Tests/RunCMake/FileAPI/EmptyClient-prep.cmake b/Tests/RunCMake/FileAPI/EmptyClient-prep.cmake new file mode 100644 index 0000000..31512fd --- /dev/null +++ b/Tests/RunCMake/FileAPI/EmptyClient-prep.cmake @@ -0,0 +1,2 @@ +file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-foo" "") +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/reply/object-to-be-deleted.json" "") diff --git a/Tests/RunCMake/FileAPI/EmptyClient.cmake b/Tests/RunCMake/FileAPI/EmptyClient.cmake new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/FileAPI/EmptyClient.cmake diff --git a/Tests/RunCMake/FileAPI/MixedStateless-check.cmake b/Tests/RunCMake/FileAPI/MixedStateless-check.cmake new file mode 100644 index 0000000..5795614 --- /dev/null +++ b/Tests/RunCMake/FileAPI/MixedStateless-check.cmake @@ -0,0 +1,16 @@ +set(expect + query + query/__test-v1 + query/__test-v3 + query/client-foo + query/client-foo/__test-v2 + query/client-foo/unknown + query/query.json + reply + reply/__test-v1-[0-9a-f]+.json + reply/__test-v2-[0-9a-f]+.json + reply/index-[0-9.T-]+.json + ) +check_api("^${expect}$") + +check_python(MixedStateless) diff --git a/Tests/RunCMake/FileAPI/MixedStateless-check.py b/Tests/RunCMake/FileAPI/MixedStateless-check.py new file mode 100644 index 0000000..be019ab --- /dev/null +++ b/Tests/RunCMake/FileAPI/MixedStateless-check.py @@ -0,0 +1,27 @@ +from check_index import * + +def check_reply(r): + assert is_dict(r) + assert sorted(r.keys()) == ["__test-v1", "__test-v3", "client-foo", "query.json"] + check_index__test(r["__test-v1"], 1, 3) + check_error(r["__test-v3"], "unknown query file") + check_reply_client_foo(r["client-foo"]) + check_error(r["query.json"], "unknown query file") + +def check_reply_client_foo(r): + assert is_dict(r) + assert sorted(r.keys()) == ["__test-v2", "unknown"] + check_index__test(r["__test-v2"], 2, 0) + check_error(r["unknown"], "unknown query file") + +def check_objects(o): + assert is_list(o) + assert len(o) == 2 + check_index__test(o[0], 1, 3) + check_index__test(o[1], 2, 0) + +assert is_dict(index) +assert sorted(index.keys()) == ["cmake", "objects", "reply"] +check_cmake(index["cmake"]) +check_reply(index["reply"]) +check_objects(index["objects"]) diff --git a/Tests/RunCMake/FileAPI/MixedStateless-prep.cmake b/Tests/RunCMake/FileAPI/MixedStateless-prep.cmake new file mode 100644 index 0000000..030baac --- /dev/null +++ b/Tests/RunCMake/FileAPI/MixedStateless-prep.cmake @@ -0,0 +1,6 @@ +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/__test-v1" "") +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-foo/__test-v2" "") +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/__test-v3" "") +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/query.json" "") +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-foo/unknown" "") +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/reply/object-to-be-deleted.json" "") diff --git a/Tests/RunCMake/FileAPI/MixedStateless.cmake b/Tests/RunCMake/FileAPI/MixedStateless.cmake new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/FileAPI/MixedStateless.cmake diff --git a/Tests/RunCMake/FileAPI/Nothing-check.cmake b/Tests/RunCMake/FileAPI/Nothing-check.cmake new file mode 100644 index 0000000..cd4f42e --- /dev/null +++ b/Tests/RunCMake/FileAPI/Nothing-check.cmake @@ -0,0 +1 @@ +check_api("^$") diff --git a/Tests/RunCMake/FileAPI/Nothing-prep.cmake b/Tests/RunCMake/FileAPI/Nothing-prep.cmake new file mode 100644 index 0000000..b850d47 --- /dev/null +++ b/Tests/RunCMake/FileAPI/Nothing-prep.cmake @@ -0,0 +1 @@ +file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1") diff --git a/Tests/RunCMake/FileAPI/Nothing.cmake b/Tests/RunCMake/FileAPI/Nothing.cmake new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/FileAPI/Nothing.cmake diff --git a/Tests/RunCMake/FileAPI/RunCMakeTest.cmake b/Tests/RunCMake/FileAPI/RunCMakeTest.cmake new file mode 100644 index 0000000..f8adb64 --- /dev/null +++ b/Tests/RunCMake/FileAPI/RunCMakeTest.cmake @@ -0,0 +1,58 @@ +include(RunCMake) + +# Function called in *-check.cmake scripts to check api files. +function(check_api expect) + file(GLOB_RECURSE actual + LIST_DIRECTORIES TRUE + RELATIVE ${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1 + ${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/* + ) + if(NOT "${actual}" MATCHES "${expect}") + set(RunCMake_TEST_FAILED "API files: + ${actual} +do not match what we expected: + ${expect} +in directory: + ${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1" PARENT_SCOPE) + endif() +endfunction() + +function(check_python case) + if(RunCMake_TEST_FAILED OR NOT PYTHON_EXECUTABLE) + return() + endif() + file(GLOB index ${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/reply/index-*.json) + execute_process( + COMMAND ${PYTHON_EXECUTABLE} "${RunCMake_SOURCE_DIR}/${case}-check.py" "${index}" + RESULT_VARIABLE result + OUTPUT_VARIABLE output + ERROR_VARIABLE output + ) + if(NOT result EQUAL 0) + string(REPLACE "\n" "\n " output " ${output}") + set(RunCMake_TEST_FAILED "Unexpected index:\n${output}" PARENT_SCOPE) + endif() +endfunction() + +run_cmake(Nothing) +run_cmake(Empty) +run_cmake(EmptyClient) +run_cmake(Stale) +run_cmake(SharedStateless) +run_cmake(ClientStateless) +run_cmake(MixedStateless) +run_cmake(DuplicateStateless) +run_cmake(ClientStateful) + +function(run_object object) + set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${object}-build) + run_cmake(${object}) + set(RunCMake_TEST_NO_CLEAN 1) + run_cmake_command(${object}-SharedStateless ${CMAKE_COMMAND} .) + run_cmake_command(${object}-ClientStateless ${CMAKE_COMMAND} .) + run_cmake_command(${object}-ClientStateful ${CMAKE_COMMAND} .) +endfunction() + +run_object(codemodel-v2) +run_object(cache-v2) +run_object(cmakeFiles-v1) diff --git a/Tests/RunCMake/FileAPI/SharedStateless-check.cmake b/Tests/RunCMake/FileAPI/SharedStateless-check.cmake new file mode 100644 index 0000000..7f3bb23 --- /dev/null +++ b/Tests/RunCMake/FileAPI/SharedStateless-check.cmake @@ -0,0 +1,15 @@ +set(expect + query + query/__test-v1 + query/__test-v2 + query/__test-v3 + query/query.json + query/unknown + reply + reply/__test-v1-[0-9a-f]+.json + reply/__test-v2-[0-9a-f]+.json + reply/index-[0-9.T-]+.json + ) +check_api("^${expect}$") + +check_python(SharedStateless) diff --git a/Tests/RunCMake/FileAPI/SharedStateless-check.py b/Tests/RunCMake/FileAPI/SharedStateless-check.py new file mode 100644 index 0000000..79f52d7 --- /dev/null +++ b/Tests/RunCMake/FileAPI/SharedStateless-check.py @@ -0,0 +1,22 @@ +from check_index import * + +def check_reply(r): + assert is_dict(r) + assert sorted(r.keys()) == ["__test-v1", "__test-v2", "__test-v3", "query.json", "unknown"] + check_index__test(r["__test-v1"], 1, 3) + check_index__test(r["__test-v2"], 2, 0) + check_error(r["__test-v3"], "unknown query file") + check_error(r["query.json"], "unknown query file") + check_error(r["unknown"], "unknown query file") + +def check_objects(o): + assert is_list(o) + assert len(o) == 2 + check_index__test(o[0], 1, 3) + check_index__test(o[1], 2, 0) + +assert is_dict(index) +assert sorted(index.keys()) == ["cmake", "objects", "reply"] +check_cmake(index["cmake"]) +check_reply(index["reply"]) +check_objects(index["objects"]) diff --git a/Tests/RunCMake/FileAPI/SharedStateless-prep.cmake b/Tests/RunCMake/FileAPI/SharedStateless-prep.cmake new file mode 100644 index 0000000..b280414 --- /dev/null +++ b/Tests/RunCMake/FileAPI/SharedStateless-prep.cmake @@ -0,0 +1,6 @@ +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/__test-v1" "") +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/__test-v2" "") +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/__test-v3" "") +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/query.json" "") +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/unknown" "") +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/reply/object-to-be-deleted.json" "") diff --git a/Tests/RunCMake/FileAPI/SharedStateless.cmake b/Tests/RunCMake/FileAPI/SharedStateless.cmake new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/FileAPI/SharedStateless.cmake diff --git a/Tests/RunCMake/FileAPI/Stale-check.cmake b/Tests/RunCMake/FileAPI/Stale-check.cmake new file mode 100644 index 0000000..7ee2c9e --- /dev/null +++ b/Tests/RunCMake/FileAPI/Stale-check.cmake @@ -0,0 +1,4 @@ +set(expect + reply + ) +check_api("^${expect}$") diff --git a/Tests/RunCMake/FileAPI/Stale-prep.cmake b/Tests/RunCMake/FileAPI/Stale-prep.cmake new file mode 100644 index 0000000..e920925 --- /dev/null +++ b/Tests/RunCMake/FileAPI/Stale-prep.cmake @@ -0,0 +1 @@ +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/reply/object-to-be-deleted.json" "") diff --git a/Tests/RunCMake/FileAPI/Stale.cmake b/Tests/RunCMake/FileAPI/Stale.cmake new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/FileAPI/Stale.cmake diff --git a/Tests/RunCMake/FileAPI/alias/CMakeLists.txt b/Tests/RunCMake/FileAPI/alias/CMakeLists.txt new file mode 100644 index 0000000..549307d --- /dev/null +++ b/Tests/RunCMake/FileAPI/alias/CMakeLists.txt @@ -0,0 +1,10 @@ +project(Alias) +enable_language(CXX) + +add_library(c_alias_lib ALIAS c_lib) +add_executable(c_alias_exe ../empty.c) +target_link_libraries(c_alias_exe PRIVATE c_alias_lib) + +add_library(cxx_alias_lib ALIAS cxx_lib) +add_executable(cxx_alias_exe ../empty.cxx) +target_link_libraries(cxx_alias_exe PRIVATE cxx_alias_lib) diff --git a/Tests/RunCMake/FileAPI/cache-v2-ClientStateful-check.cmake b/Tests/RunCMake/FileAPI/cache-v2-ClientStateful-check.cmake new file mode 100644 index 0000000..0f5ef28 --- /dev/null +++ b/Tests/RunCMake/FileAPI/cache-v2-ClientStateful-check.cmake @@ -0,0 +1,11 @@ +set(expect + query + query/client-foo + query/client-foo/query.json + reply + reply/cache-v2-[0-9a-f]+.json + reply/index-[0-9.T-]+.json + ) +check_api("^${expect}$") + +check_python(cache-v2) diff --git a/Tests/RunCMake/FileAPI/cache-v2-ClientStateful-prep.cmake b/Tests/RunCMake/FileAPI/cache-v2-ClientStateful-prep.cmake new file mode 100644 index 0000000..9329280 --- /dev/null +++ b/Tests/RunCMake/FileAPI/cache-v2-ClientStateful-prep.cmake @@ -0,0 +1,4 @@ +file(REMOVE_RECURSE ${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query) +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-foo/query.json" [[ +{ "requests": [ { "kind": "cache", "version" : 2 } ] } +]]) diff --git a/Tests/RunCMake/FileAPI/cache-v2-ClientStateless-check.cmake b/Tests/RunCMake/FileAPI/cache-v2-ClientStateless-check.cmake new file mode 100644 index 0000000..c406ec8 --- /dev/null +++ b/Tests/RunCMake/FileAPI/cache-v2-ClientStateless-check.cmake @@ -0,0 +1,11 @@ +set(expect + query + query/client-foo + query/client-foo/cache-v2 + reply + reply/cache-v2-[0-9a-f]+.json + reply/index-[0-9.T-]+.json + ) +check_api("^${expect}$") + +check_python(cache-v2) diff --git a/Tests/RunCMake/FileAPI/cache-v2-ClientStateless-prep.cmake b/Tests/RunCMake/FileAPI/cache-v2-ClientStateless-prep.cmake new file mode 100644 index 0000000..dccafa5 --- /dev/null +++ b/Tests/RunCMake/FileAPI/cache-v2-ClientStateless-prep.cmake @@ -0,0 +1,2 @@ +file(REMOVE_RECURSE ${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query) +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-foo/cache-v2" "") diff --git a/Tests/RunCMake/FileAPI/cache-v2-SharedStateless-check.cmake b/Tests/RunCMake/FileAPI/cache-v2-SharedStateless-check.cmake new file mode 100644 index 0000000..f8337eb --- /dev/null +++ b/Tests/RunCMake/FileAPI/cache-v2-SharedStateless-check.cmake @@ -0,0 +1,10 @@ +set(expect + query + query/cache-v2 + reply + reply/cache-v2-[0-9a-f]+.json + reply/index-[0-9.T-]+.json + ) +check_api("^${expect}$") + +check_python(cache-v2) diff --git a/Tests/RunCMake/FileAPI/cache-v2-SharedStateless-prep.cmake b/Tests/RunCMake/FileAPI/cache-v2-SharedStateless-prep.cmake new file mode 100644 index 0000000..ee5ac57 --- /dev/null +++ b/Tests/RunCMake/FileAPI/cache-v2-SharedStateless-prep.cmake @@ -0,0 +1,2 @@ +file(REMOVE_RECURSE ${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query) +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/cache-v2" "") diff --git a/Tests/RunCMake/FileAPI/cache-v2-check.py b/Tests/RunCMake/FileAPI/cache-v2-check.py new file mode 100644 index 0000000..756ef80 --- /dev/null +++ b/Tests/RunCMake/FileAPI/cache-v2-check.py @@ -0,0 +1,134 @@ +from check_index import * + +def check_objects(o): + assert is_list(o) + assert len(o) == 1 + check_index_object(o[0], "cache", 2, 0, check_object_cache) + +def check_cache_entry(actual, expected): + assert is_dict(actual) + assert sorted(actual.keys()) == ["name", "properties", "type", "value"] + + assert is_string(actual["type"], expected["type"]) + assert is_string(actual["value"], expected["value"]) + + def check_property(actual, expected): + assert is_dict(actual) + assert sorted(actual.keys()) == ["name", "value"] + assert is_string(actual["value"], expected["value"]) + + check_list_match(lambda a, e: is_string(a["name"], e["name"]), actual["properties"], expected["properties"], check=check_property) + +def check_object_cache(o): + assert sorted(o.keys()) == ["entries", "kind", "version"] + # The "kind" and "version" members are handled by check_index_object. + check_list_match(lambda a, e: is_string(a["name"], e["name"]), o["entries"], [ + { + "name": "CM_OPTION_BOOL", + "type": "BOOL", + "value": "OFF", + "properties": [ + { + "name": "HELPSTRING", + "value": "Testing option()", + }, + ], + }, + { + "name": "CM_SET_BOOL", + "type": "BOOL", + "value": "ON", + "properties": [ + { + "name": "HELPSTRING", + "value": "Testing set(CACHE BOOL)", + }, + { + "name": "ADVANCED", + "value": "1", + }, + ], + }, + { + "name": "CM_SET_FILEPATH", + "type": "FILEPATH", + "value": "dir1/dir2/empty.txt", + "properties": [ + { + "name": "HELPSTRING", + "value": "Testing set(CACHE FILEPATH)", + }, + ], + }, + { + "name": "CM_SET_PATH", + "type": "PATH", + "value": "dir1/dir2", + "properties": [ + { + "name": "HELPSTRING", + "value": "Testing set(CACHE PATH)", + }, + { + "name": "ADVANCED", + "value": "ON", + }, + ], + }, + { + "name": "CM_SET_STRING", + "type": "STRING", + "value": "test", + "properties": [ + { + "name": "HELPSTRING", + "value": "Testing set(CACHE STRING)", + }, + ], + }, + { + "name": "CM_SET_STRINGS", + "type": "STRING", + "value": "1", + "properties": [ + { + "name": "HELPSTRING", + "value": "Testing set(CACHE STRING) with STRINGS", + }, + { + "name": "STRINGS", + "value": "1;2;3;4", + }, + ], + }, + { + "name": "CM_SET_INTERNAL", + "type": "INTERNAL", + "value": "int2", + "properties": [ + { + "name": "HELPSTRING", + "value": "Testing set(CACHE INTERNAL)", + }, + ], + }, + { + "name": "CM_SET_TYPE", + "type": "STRING", + "value": "1", + "properties": [ + { + "name": "HELPSTRING", + "value": "Testing set(CACHE INTERNAL) with set_property(TYPE)", + }, + { + "name": "ADVANCED", + "value": "0", + }, + ], + }, + ], check=check_cache_entry, allow_extra=True) + +assert is_dict(index) +assert sorted(index.keys()) == ["cmake", "objects", "reply"] +check_objects(index["objects"]) diff --git a/Tests/RunCMake/FileAPI/cache-v2.cmake b/Tests/RunCMake/FileAPI/cache-v2.cmake new file mode 100644 index 0000000..45b402d --- /dev/null +++ b/Tests/RunCMake/FileAPI/cache-v2.cmake @@ -0,0 +1,14 @@ +option(CM_OPTION_BOOL "Testing option()" "OFF") +set(CM_SET_BOOL "ON" CACHE BOOL "Testing set(CACHE BOOL)") +mark_as_advanced(CM_SET_BOOL) +set(CM_SET_FILEPATH "dir1/dir2/empty.txt" CACHE FILEPATH "Testing set(CACHE FILEPATH)") +set(CM_SET_PATH "dir1/dir2" CACHE PATH "Testing set(CACHE PATH)") +set_property(CACHE CM_SET_PATH PROPERTY ADVANCED ON) +set(CM_SET_STRING "test" CACHE STRING "Testing set(CACHE STRING)") +set(CM_SET_STRINGS "1" CACHE STRING "Testing set(CACHE STRING) with STRINGS") +set_property(CACHE CM_SET_STRINGS PROPERTY STRINGS "1;2;3;4") +set(CM_SET_INTERNAL "int" CACHE INTERNAL "Testing set(CACHE INTERNAL)") +set_property(CACHE CM_SET_INTERNAL PROPERTY VALUE "int2") +set(CM_SET_TYPE "1" CACHE INTERNAL "Testing set(CACHE INTERNAL) with set_property(TYPE)") +set_property(CACHE CM_SET_TYPE PROPERTY TYPE "STRING") +set_property(CACHE CM_SET_TYPE PROPERTY ADVANCED "0") diff --git a/Tests/RunCMake/FileAPI/check_index.py b/Tests/RunCMake/FileAPI/check_index.py new file mode 100644 index 0000000..cda7234 --- /dev/null +++ b/Tests/RunCMake/FileAPI/check_index.py @@ -0,0 +1,163 @@ +import sys +import os +import json +import re + +if sys.version_info[0] >= 3: + unicode = str + +def is_bool(x, val=None): + return isinstance(x, bool) and (val is None or x == val) + +def is_dict(x): + return isinstance(x, dict) + +def is_list(x): + return isinstance(x, list) + +def is_int(x, val=None): + return (isinstance(x, int) or isinstance(x, long)) and (val is None or x == val) + +def is_string(x, val=None): + return (isinstance(x, str) or isinstance(x, unicode)) and (val is None or x == val) + +def matches(s, pattern): + return is_string(s) and bool(re.search(pattern, s)) + +def check_list_match(match, actual, expected, check=None, check_exception=None, missing_exception=None, extra_exception=None, allow_extra=False): + """ + Handle the common pattern of making sure every actual item "matches" some + item in the expected list, and that neither list has extra items after + matching is completed. + + @param match: Callback to check if an actual item matches an expected + item. Return True if the item matches, return False if the item doesn't + match. + @param actual: List of actual items to search. + @param expected: List of expected items to match. + @param check: Optional function to check that the actual item is valid by + comparing it to the expected item. + @param check_exception: Optional function that returns an argument to + append to any exception thrown by the check function. + @param missing_exception: Optional function that returns an argument to + append to the exception thrown when an item is not found. + @param extra_exception: Optional function that returns an argument to + append to the exception thrown when an extra item is found. + @param allow_extra: Optional parameter allowing there to be extra actual + items after all the expected items have been found. + """ + assert is_list(actual) + _actual = actual[:] + for expected_item in expected: + found = False + for i, actual_item in enumerate(_actual): + if match(actual_item, expected_item): + if check: + try: + check(actual_item, expected_item) + except BaseException as e: + if check_exception: + e.args += (check_exception(actual_item, expected_item),) + raise + found = True + del _actual[i] + break + if missing_exception: + assert found, missing_exception(expected_item) + else: + assert found + if not allow_extra: + if extra_exception: + assert len(_actual) == 0, [extra_exception(a) for a in _actual] + else: + assert len(_actual) == 0 + +def filter_list(f, l): + if l is not None: + l = list(filter(f, l)) + if l == []: + l = None + return l + +def check_cmake(cmake): + assert is_dict(cmake) + assert sorted(cmake.keys()) == ["generator", "paths", "version"] + check_cmake_version(cmake["version"]) + check_cmake_paths(cmake["paths"]) + check_cmake_generator(cmake["generator"]) + +def check_cmake_version(v): + assert is_dict(v) + assert sorted(v.keys()) == ["isDirty", "major", "minor", "patch", "string", "suffix"] + assert is_string(v["string"]) + assert is_int(v["major"]) + assert is_int(v["minor"]) + assert is_int(v["patch"]) + assert is_string(v["suffix"]) + assert is_bool(v["isDirty"]) + +def check_cmake_paths(v): + assert is_dict(v) + assert sorted(v.keys()) == ["cmake", "cpack", "ctest", "root"] + assert is_string(v["cmake"]) + assert is_string(v["cpack"]) + assert is_string(v["ctest"]) + assert is_string(v["root"]) + +def check_cmake_generator(g): + assert is_dict(g) + name = g.get("name", None) + assert is_string(name) + if name.startswith("Visual Studio"): + assert sorted(g.keys()) == ["name", "platform"] + assert is_string(g["platform"]) + else: + assert sorted(g.keys()) == ["name"] + +def check_index_object(indexEntry, kind, major, minor, check): + assert is_dict(indexEntry) + assert sorted(indexEntry.keys()) == ["jsonFile", "kind", "version"] + assert is_string(indexEntry["kind"]) + assert indexEntry["kind"] == kind + assert is_dict(indexEntry["version"]) + assert sorted(indexEntry["version"].keys()) == ["major", "minor"] + assert indexEntry["version"]["major"] == major + assert indexEntry["version"]["minor"] == minor + assert is_string(indexEntry["jsonFile"]) + filepath = os.path.join(reply_dir, indexEntry["jsonFile"]) + with open(filepath) as f: + object = json.load(f) + assert is_dict(object) + assert "kind" in object + assert is_string(object["kind"]) + assert object["kind"] == kind + assert "version" in object + assert is_dict(object["version"]) + assert sorted(object["version"].keys()) == ["major", "minor"] + assert object["version"]["major"] == major + assert object["version"]["minor"] == minor + if check: + check(object) + +def check_index__test(indexEntry, major, minor): + def check(object): + assert sorted(object.keys()) == ["kind", "version"] + check_index_object(indexEntry, "__test", major, minor, check) + +def check_error(value, error): + assert is_dict(value) + assert sorted(value.keys()) == ["error"] + assert is_string(value["error"]) + assert value["error"] == error + +def check_error_re(value, error): + assert is_dict(value) + assert sorted(value.keys()) == ["error"] + assert is_string(value["error"]) + assert re.search(error, value["error"]) + +reply_index = sys.argv[1] +reply_dir = os.path.dirname(reply_index) + +with open(reply_index) as f: + index = json.load(f) diff --git a/Tests/RunCMake/FileAPI/cmakeFiles-v1-ClientStateful-check.cmake b/Tests/RunCMake/FileAPI/cmakeFiles-v1-ClientStateful-check.cmake new file mode 100644 index 0000000..21e931e --- /dev/null +++ b/Tests/RunCMake/FileAPI/cmakeFiles-v1-ClientStateful-check.cmake @@ -0,0 +1,11 @@ +set(expect + query + query/client-foo + query/client-foo/query.json + reply + reply/cmakeFiles-v1-[0-9a-f]+.json + reply/index-[0-9.T-]+.json + ) +check_api("^${expect}$") + +check_python(cmakeFiles-v1) diff --git a/Tests/RunCMake/FileAPI/cmakeFiles-v1-ClientStateful-prep.cmake b/Tests/RunCMake/FileAPI/cmakeFiles-v1-ClientStateful-prep.cmake new file mode 100644 index 0000000..7a72696 --- /dev/null +++ b/Tests/RunCMake/FileAPI/cmakeFiles-v1-ClientStateful-prep.cmake @@ -0,0 +1,4 @@ +file(REMOVE_RECURSE ${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query) +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-foo/query.json" [[ +{ "requests": [ { "kind": "cmakeFiles", "version" : 1 } ] } +]]) diff --git a/Tests/RunCMake/FileAPI/cmakeFiles-v1-ClientStateless-check.cmake b/Tests/RunCMake/FileAPI/cmakeFiles-v1-ClientStateless-check.cmake new file mode 100644 index 0000000..2ce2e79 --- /dev/null +++ b/Tests/RunCMake/FileAPI/cmakeFiles-v1-ClientStateless-check.cmake @@ -0,0 +1,11 @@ +set(expect + query + query/client-foo + query/client-foo/cmakeFiles-v1 + reply + reply/cmakeFiles-v1-[0-9a-f]+.json + reply/index-[0-9.T-]+.json + ) +check_api("^${expect}$") + +check_python(cmakeFiles-v1) diff --git a/Tests/RunCMake/FileAPI/cmakeFiles-v1-ClientStateless-prep.cmake b/Tests/RunCMake/FileAPI/cmakeFiles-v1-ClientStateless-prep.cmake new file mode 100644 index 0000000..eb96491 --- /dev/null +++ b/Tests/RunCMake/FileAPI/cmakeFiles-v1-ClientStateless-prep.cmake @@ -0,0 +1,2 @@ +file(REMOVE_RECURSE ${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query) +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-foo/cmakeFiles-v1" "") diff --git a/Tests/RunCMake/FileAPI/cmakeFiles-v1-SharedStateless-check.cmake b/Tests/RunCMake/FileAPI/cmakeFiles-v1-SharedStateless-check.cmake new file mode 100644 index 0000000..6e3b49a --- /dev/null +++ b/Tests/RunCMake/FileAPI/cmakeFiles-v1-SharedStateless-check.cmake @@ -0,0 +1,10 @@ +set(expect + query + query/cmakeFiles-v1 + reply + reply/cmakeFiles-v1-[0-9a-f]+.json + reply/index-[0-9.T-]+.json + ) +check_api("^${expect}$") + +check_python(cmakeFiles-v1) diff --git a/Tests/RunCMake/FileAPI/cmakeFiles-v1-SharedStateless-prep.cmake b/Tests/RunCMake/FileAPI/cmakeFiles-v1-SharedStateless-prep.cmake new file mode 100644 index 0000000..8c8bdef --- /dev/null +++ b/Tests/RunCMake/FileAPI/cmakeFiles-v1-SharedStateless-prep.cmake @@ -0,0 +1,2 @@ +file(REMOVE_RECURSE ${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query) +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/cmakeFiles-v1" "") diff --git a/Tests/RunCMake/FileAPI/cmakeFiles-v1-check.py b/Tests/RunCMake/FileAPI/cmakeFiles-v1-check.py new file mode 100644 index 0000000..49dfe87 --- /dev/null +++ b/Tests/RunCMake/FileAPI/cmakeFiles-v1-check.py @@ -0,0 +1,94 @@ +from check_index import * + +def check_objects(o): + assert is_list(o) + assert len(o) == 1 + check_index_object(o[0], "cmakeFiles", 1, 0, check_object_cmakeFiles) + +def check_input(actual, expected): + assert is_dict(actual) + expected_keys = ["path"] + + if expected["isGenerated"] is not None: + expected_keys.append("isGenerated") + assert is_bool(actual["isGenerated"], expected["isGenerated"]) + + if expected["isExternal"] is not None: + expected_keys.append("isExternal") + assert is_bool(actual["isExternal"], expected["isExternal"]) + + if expected["isCMake"] is not None: + expected_keys.append("isCMake") + assert is_bool(actual["isCMake"], expected["isCMake"]) + + assert sorted(actual.keys()) == sorted(expected_keys) + +def check_object_cmakeFiles(o): + assert sorted(o.keys()) == ["inputs", "kind", "paths", "version"] + # The "kind" and "version" members are handled by check_index_object. + assert is_dict(o["paths"]) + assert sorted(o["paths"].keys()) == ["build", "source"] + assert matches(o["paths"]["build"], "^.*/Tests/RunCMake/FileAPI/cmakeFiles-v1-build$") + assert matches(o["paths"]["source"], "^.*/Tests/RunCMake/FileAPI$") + + expected = [ + { + "path": "^CMakeLists\\.txt$", + "isGenerated": None, + "isExternal": None, + "isCMake": None, + }, + { + "path": "^cmakeFiles-v1\\.cmake$", + "isGenerated": None, + "isExternal": None, + "isCMake": None, + }, + { + "path": "^dir/CMakeLists\\.txt$", + "isGenerated": None, + "isExternal": None, + "isCMake": None, + }, + { + "path": "^dir/dir/CMakeLists\\.txt$", + "isGenerated": None, + "isExternal": None, + "isCMake": None, + }, + { + "path": "^dir/dirtest\\.cmake$", + "isGenerated": None, + "isExternal": None, + "isCMake": None, + }, + { + "path": "^.*/Tests/RunCMake/FileAPIDummyFile\\.cmake$", + "isGenerated": None, + "isExternal": True, + "isCMake": None, + }, + { + "path": "^.*/Tests/RunCMake/FileAPI/cmakeFiles-v1-build/generated\\.cmake", + "isGenerated": True, + "isExternal": None, + "isCMake": None, + }, + { + "path": "^.*/Modules/CMakeParseArguments\\.cmake$", + "isGenerated": None, + "isExternal": True, + "isCMake": True, + }, + ] + + inSource = os.path.dirname(o["paths"]["build"]) == o["paths"]["source"] + if inSource: + for e in expected: + e["path"] = e["path"].replace("^.*/Tests/RunCMake/FileAPI/", "^", 1) + + check_list_match(lambda a, e: matches(a["path"], e["path"]), o["inputs"], expected, check=check_input, allow_extra=True) + +assert is_dict(index) +assert sorted(index.keys()) == ["cmake", "objects", "reply"] +check_objects(index["objects"]) diff --git a/Tests/RunCMake/FileAPI/cmakeFiles-v1.cmake b/Tests/RunCMake/FileAPI/cmakeFiles-v1.cmake new file mode 100644 index 0000000..4d4d757 --- /dev/null +++ b/Tests/RunCMake/FileAPI/cmakeFiles-v1.cmake @@ -0,0 +1,8 @@ +include("${CMAKE_CURRENT_LIST_DIR}/dir/dirtest.cmake") +include(CMakeParseArguments) + +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/generated.cmake" "") +include("${CMAKE_CURRENT_BINARY_DIR}/generated.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/../FileAPIDummyFile.cmake") + +add_subdirectory(dir) diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-ClientStateful-check.cmake b/Tests/RunCMake/FileAPI/codemodel-v2-ClientStateful-check.cmake new file mode 100644 index 0000000..fb78e87 --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-ClientStateful-check.cmake @@ -0,0 +1,12 @@ +set(expect + query + query/client-foo + query/client-foo/query.json + reply + reply/codemodel-v2-[0-9a-f]+\\.json + reply/index-[0-9.T-]+\\.json + .* + ) +check_api("^${expect}$") + +check_python(codemodel-v2) diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-ClientStateful-prep.cmake b/Tests/RunCMake/FileAPI/codemodel-v2-ClientStateful-prep.cmake new file mode 100644 index 0000000..e2b38ff --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-ClientStateful-prep.cmake @@ -0,0 +1,4 @@ +file(REMOVE_RECURSE ${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query) +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-foo/query.json" [[ +{ "requests": [ { "kind": "codemodel", "version" : 2 } ] } +]]) diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-ClientStateless-check.cmake b/Tests/RunCMake/FileAPI/codemodel-v2-ClientStateless-check.cmake new file mode 100644 index 0000000..7c6a35a --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-ClientStateless-check.cmake @@ -0,0 +1,12 @@ +set(expect + query + query/client-foo + query/client-foo/codemodel-v2 + reply + reply/codemodel-v2-[0-9a-f]+\\.json + reply/index-[0-9.T-]+\\.json + .* + ) +check_api("^${expect}$") + +check_python(codemodel-v2) diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-ClientStateless-prep.cmake b/Tests/RunCMake/FileAPI/codemodel-v2-ClientStateless-prep.cmake new file mode 100644 index 0000000..d1ce292 --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-ClientStateless-prep.cmake @@ -0,0 +1,2 @@ +file(REMOVE_RECURSE ${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query) +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-foo/codemodel-v2" "") diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-SharedStateless-check.cmake b/Tests/RunCMake/FileAPI/codemodel-v2-SharedStateless-check.cmake new file mode 100644 index 0000000..cc2f31b --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-SharedStateless-check.cmake @@ -0,0 +1,11 @@ +set(expect + query + query/codemodel-v2 + reply + reply/codemodel-v2-[0-9a-f]+\\.json + reply/index-[0-9.T-]+\\.json + .* + ) +check_api("^${expect}$") + +check_python(codemodel-v2) diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-SharedStateless-prep.cmake b/Tests/RunCMake/FileAPI/codemodel-v2-SharedStateless-prep.cmake new file mode 100644 index 0000000..8a519d5 --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-SharedStateless-prep.cmake @@ -0,0 +1,2 @@ +file(REMOVE_RECURSE ${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query) +file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/codemodel-v2" "") diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-check.py b/Tests/RunCMake/FileAPI/codemodel-v2-check.py new file mode 100644 index 0000000..18b9347 --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-check.py @@ -0,0 +1,5085 @@ +from check_index import * + +import sys +import os + +def check_objects(o, g): + assert is_list(o) + assert len(o) == 1 + check_index_object(o[0], "codemodel", 2, 0, check_object_codemodel(g)) + +def check_backtrace(t, b, backtrace): + btg = t["backtraceGraph"] + for expected in backtrace: + assert is_int(b) + node = btg["nodes"][b] + expected_keys = ["file"] + assert matches(btg["files"][node["file"]], expected["file"]) + + if expected["line"] is not None: + expected_keys.append("line") + assert is_int(node["line"], expected["line"]) + + if expected["command"] is not None: + expected_keys.append("command") + assert is_int(node["command"]) + assert is_string(btg["commands"][node["command"]], expected["command"]) + + if expected["hasParent"]: + expected_keys.append("parent") + assert is_int(node["parent"]) + b = node["parent"] + else: + b = None + + assert sorted(node.keys()) == sorted(expected_keys) + + assert b is None + +def check_directory(c): + def _check(actual, expected): + assert is_dict(actual) + expected_keys = ["build", "source", "projectIndex"] + assert matches(actual["build"], expected["build"]) + + assert is_int(actual["projectIndex"]) + assert is_string(c["projects"][actual["projectIndex"]]["name"], expected["projectName"]) + + if expected["parentSource"] is not None: + expected_keys.append("parentIndex") + assert is_int(actual["parentIndex"]) + assert matches(c["directories"][actual["parentIndex"]]["source"], expected["parentSource"]) + + if expected["childSources"] is not None: + expected_keys.append("childIndexes") + check_list_match(lambda a, e: matches(c["directories"][a]["source"], e), + actual["childIndexes"], expected["childSources"], + missing_exception=lambda e: "Child source: %s" % e, + extra_exception=lambda a: "Child source: %s" % a["source"]) + + if expected["targetIds"] is not None: + expected_keys.append("targetIndexes") + check_list_match(lambda a, e: matches(c["targets"][a]["id"], e), + actual["targetIndexes"], expected["targetIds"], + missing_exception=lambda e: "Target ID: %s" % e, + extra_exception=lambda a: "Target ID: %s" % c["targets"][a]["id"]) + + if expected["minimumCMakeVersion"] is not None: + expected_keys.append("minimumCMakeVersion") + assert is_dict(actual["minimumCMakeVersion"]) + assert sorted(actual["minimumCMakeVersion"].keys()) == ["string"] + assert is_string(actual["minimumCMakeVersion"]["string"], expected["minimumCMakeVersion"]) + + if expected["hasInstallRule"] is not None: + expected_keys.append("hasInstallRule") + assert is_bool(actual["hasInstallRule"], expected["hasInstallRule"]) + + assert sorted(actual.keys()) == sorted(expected_keys) + + return _check + +def check_target_backtrace_graph(t): + btg = t["backtraceGraph"] + assert is_dict(btg) + assert sorted(btg.keys()) == ["commands", "files", "nodes"] + assert is_list(btg["commands"]) + + for c in btg["commands"]: + assert is_string(c) + + for f in btg["files"]: + assert is_string(f) + + for n in btg["nodes"]: + expected_keys = ["file"] + assert is_dict(n) + assert is_int(n["file"]) + assert 0 <= n["file"] < len(btg["files"]) + + if "line" in n: + expected_keys.append("line") + assert is_int(n["line"]) + + if "command" in n: + expected_keys.append("command") + assert is_int(n["command"]) + assert 0 <= n["command"] < len(btg["commands"]) + + if "parent" in n: + expected_keys.append("parent") + assert is_int(n["parent"]) + assert 0 <= n["parent"] < len(btg["nodes"]) + + assert sorted(n.keys()) == sorted(expected_keys) + +def check_target(c): + def _check(actual, expected): + assert is_dict(actual) + assert sorted(actual.keys()) == ["directoryIndex", "id", "jsonFile", "name", "projectIndex"] + assert is_int(actual["directoryIndex"]) + assert matches(c["directories"][actual["directoryIndex"]]["source"], expected["directorySource"]) + assert is_string(actual["name"], expected["name"]) + assert is_string(actual["jsonFile"]) + assert is_int(actual["projectIndex"]) + assert is_string(c["projects"][actual["projectIndex"]]["name"], expected["projectName"]) + + filepath = os.path.join(reply_dir, actual["jsonFile"]) + with open(filepath) as f: + obj = json.load(f) + + expected_keys = ["name", "id", "type", "backtraceGraph", "paths", "sources"] + assert is_dict(obj) + assert is_string(obj["name"], expected["name"]) + assert matches(obj["id"], expected["id"]) + assert is_string(obj["type"], expected["type"]) + check_target_backtrace_graph(obj) + + assert is_dict(obj["paths"]) + assert sorted(obj["paths"].keys()) == ["build", "source"] + assert matches(obj["paths"]["build"], expected["build"]) + assert matches(obj["paths"]["source"], expected["source"]) + + def check_source(actual, expected): + assert is_dict(actual) + expected_keys = ["path"] + + if expected["compileGroupLanguage"] is not None: + expected_keys.append("compileGroupIndex") + assert is_string(obj["compileGroups"][actual["compileGroupIndex"]]["language"], expected["compileGroupLanguage"]) + + if expected["sourceGroupName"] is not None: + expected_keys.append("sourceGroupIndex") + assert is_string(obj["sourceGroups"][actual["sourceGroupIndex"]]["name"], expected["sourceGroupName"]) + + if expected["isGenerated"] is not None: + expected_keys.append("isGenerated") + assert is_bool(actual["isGenerated"], expected["isGenerated"]) + + if expected["backtrace"] is not None: + expected_keys.append("backtrace") + check_backtrace(obj, actual["backtrace"], expected["backtrace"]) + + assert sorted(actual.keys()) == sorted(expected_keys) + + check_list_match(lambda a, e: matches(a["path"], e["path"]), obj["sources"], + expected["sources"], check=check_source, + check_exception=lambda a, e: "Source file: %s" % a["path"], + missing_exception=lambda e: "Source file: %s" % e["path"], + extra_exception=lambda a: "Source file: %s" % a["path"]) + + if expected["backtrace"] is not None: + expected_keys.append("backtrace") + check_backtrace(obj, obj["backtrace"], expected["backtrace"]) + + if expected["folder"] is not None: + expected_keys.append("folder") + assert is_dict(obj["folder"]) + assert sorted(obj["folder"].keys()) == ["name"] + assert is_string(obj["folder"]["name"], expected["folder"]) + + if expected["nameOnDisk"] is not None: + expected_keys.append("nameOnDisk") + assert matches(obj["nameOnDisk"], expected["nameOnDisk"]) + + if expected["artifacts"] is not None: + expected_keys.append("artifacts") + + def check_artifact(actual, expected): + assert is_dict(actual) + assert sorted(actual.keys()) == ["path"] + + check_list_match(lambda a, e: matches(a["path"], e["path"]), + obj["artifacts"], expected["artifacts"], + check=check_artifact, + check_exception=lambda a, e: "Artifact: %s" % a["path"], + missing_exception=lambda e: "Artifact: %s" % e["path"], + extra_exception=lambda a: "Artifact: %s" % a["path"]) + + if expected["isGeneratorProvided"] is not None: + expected_keys.append("isGeneratorProvided") + assert is_bool(obj["isGeneratorProvided"], expected["isGeneratorProvided"]) + + if expected["install"] is not None: + expected_keys.append("install") + assert is_dict(obj["install"]) + assert sorted(obj["install"].keys()) == ["destinations", "prefix"] + + assert is_dict(obj["install"]["prefix"]) + assert sorted(obj["install"]["prefix"].keys()) == ["path"] + assert matches(obj["install"]["prefix"]["path"], expected["install"]["prefix"]) + + def check_install_destination(actual, expected): + assert is_dict(actual) + expected_keys = ["path"] + + if expected["backtrace"] is not None: + expected_keys.append("backtrace") + check_backtrace(obj, actual["backtrace"], expected["backtrace"]) + + assert sorted(actual.keys()) == sorted(expected_keys) + + check_list_match(lambda a, e: matches(a["path"], e["path"]), + obj["install"]["destinations"], expected["install"]["destinations"], + check=check_install_destination, + check_exception=lambda a, e: "Install path: %s" % a["path"], + missing_exception=lambda e: "Install path: %s" % e["path"], + extra_exception=lambda a: "Install path: %s" % a["path"]) + + if expected["link"] is not None: + expected_keys.append("link") + assert is_dict(obj["link"]) + link_keys = ["language"] + + assert is_string(obj["link"]["language"], expected["link"]["language"]) + + # FIXME: Properly test commandFragments + if "commandFragments" in obj["link"]: + link_keys.append("commandFragments") + assert is_list(obj["link"]["commandFragments"]) + for f in obj["link"]["commandFragments"]: + assert is_dict(f) + assert sorted(f.keys()) == ["fragment", "role"] + assert is_string(f["fragment"]) + assert is_string(f["role"]) + assert f["role"] in ("flags", "libraries", "libraryPath", "frameworkPath") + + if expected["link"]["lto"] is not None: + link_keys.append("lto") + assert is_bool(obj["link"]["lto"], expected["link"]["lto"]) + + # FIXME: Properly test sysroot + if "sysroot" in obj["link"]: + link_keys.append("sysroot") + assert is_string(obj["link"]["sysroot"]) + + assert sorted(obj["link"].keys()) == sorted(link_keys) + + if expected["archive"] is not None: + expected_keys.append("archive") + assert is_dict(obj["archive"]) + archive_keys = [] + + # FIXME: Properly test commandFragments + if "commandFragments" in obj["archive"]: + archive_keys.append("commandFragments") + assert is_list(obj["archive"]["commandFragments"]) + for f in obj["archive"]["commandFragments"]: + assert is_dict(f) + assert sorted(f.keys()) == ["fragment", "role"] + assert is_string(f["fragment"]) + assert is_string(f["role"]) + assert f["role"] in ("flags") + + if expected["archive"]["lto"] is not None: + archive_keys.append("lto") + assert is_bool(obj["archive"]["lto"], expected["archive"]["lto"]) + + assert sorted(obj["archive"].keys()) == sorted(archive_keys) + + if expected["dependencies"] is not None: + expected_keys.append("dependencies") + + def check_dependency(actual, expected): + assert is_dict(actual) + expected_keys = ["id"] + + if expected["backtrace"] is not None: + expected_keys.append("backtrace") + check_backtrace(obj, actual["backtrace"], expected["backtrace"]) + + assert sorted(actual.keys()) == sorted(expected_keys) + + check_list_match(lambda a, e: matches(a["id"], e["id"]), + obj["dependencies"], expected["dependencies"], + check=check_dependency, + check_exception=lambda a, e: "Dependency ID: %s" % a["id"], + missing_exception=lambda e: "Dependency ID: %s" % e["id"], + extra_exception=lambda a: "Dependency ID: %s" % a["id"]) + + if expected["sourceGroups"] is not None: + expected_keys.append("sourceGroups") + + def check_source_group(actual, expected): + assert is_dict(actual) + assert sorted(actual.keys()) == ["name", "sourceIndexes"] + + check_list_match(lambda a, e: matches(obj["sources"][a]["path"], e), + actual["sourceIndexes"], expected["sourcePaths"], + missing_exception=lambda e: "Source path: %s" % e, + extra_exception=lambda a: "Source path: %s" % obj["sources"][a]["path"]) + + check_list_match(lambda a, e: is_string(a["name"], e["name"]), + obj["sourceGroups"], expected["sourceGroups"], + check=check_source_group, + check_exception=lambda a, e: "Source group: %s" % a["name"], + missing_exception=lambda e: "Source group: %s" % e["name"], + extra_exception=lambda a: "Source group: %s" % a["name"]) + + if expected["compileGroups"] is not None: + expected_keys.append("compileGroups") + + def check_compile_group(actual, expected): + assert is_dict(actual) + expected_keys = ["sourceIndexes", "language"] + + check_list_match(lambda a, e: matches(obj["sources"][a]["path"], e), + actual["sourceIndexes"], expected["sourcePaths"], + missing_exception=lambda e: "Source path: %s" % e, + extra_exception=lambda a: "Source path: %s" % obj["sources"][a]["path"]) + + # FIXME: Properly test compileCommandFragments + if "compileCommandFragments" in actual: + expected_keys.append("compileCommandFragments") + assert is_list(actual["compileCommandFragments"]) + for f in actual["compileCommandFragments"]: + assert is_dict(f) + assert sorted(f.keys()) == ["fragment"] + assert is_string(f["fragment"]) + + if expected["includes"] is not None: + expected_keys.append("includes") + + def check_include(actual, expected): + assert is_dict(actual) + expected_keys = ["path"] + + if expected["isSystem"] is not None: + expected_keys.append("isSystem") + assert is_bool(actual["isSystem"], expected["isSystem"]) + + if expected["backtrace"] is not None: + expected_keys.append("backtrace") + check_backtrace(obj, actual["backtrace"], expected["backtrace"]) + + assert sorted(actual.keys()) == sorted(expected_keys) + + check_list_match(lambda a, e: matches(a["path"], e["path"]), + actual["includes"], expected["includes"], + check=check_include, + check_exception=lambda a, e: "Include path: %s" % a["path"], + missing_exception=lambda e: "Include path: %s" % e["path"], + extra_exception=lambda a: "Include path: %s" % a["path"]) + + if expected["defines"] is not None: + expected_keys.append("defines") + + def check_define(actual, expected): + assert is_dict(actual) + expected_keys = ["define"] + + if expected["backtrace"] is not None: + expected_keys.append("backtrace") + check_backtrace(obj, actual["backtrace"], expected["backtrace"]) + + assert sorted(actual.keys()) == sorted(expected_keys) + + check_list_match(lambda a, e: is_string(a["define"], e["define"]), + actual["defines"], expected["defines"], + check=check_define, + check_exception=lambda a, e: "Define: %s" % a["define"], + missing_exception=lambda e: "Define: %s" % e["define"], + extra_exception=lambda a: "Define: %s" % a["define"]) + + # FIXME: Properly test sysroot + if "sysroot" in actual: + expected_keys.append("sysroot") + assert is_string(actual["sysroot"]) + + assert sorted(actual.keys()) == sorted(expected_keys) + + check_list_match(lambda a, e: is_string(a["language"], e["language"]), + obj["compileGroups"], expected["compileGroups"], + check=check_compile_group, + check_exception=lambda a, e: "Compile group: %s" % a["language"], + missing_exception=lambda e: "Compile group: %s" % e["language"], + extra_exception=lambda a: "Compile group: %s" % a["language"]) + + assert sorted(obj.keys()) == sorted(expected_keys) + + return _check + +def check_project(c): + def _check(actual, expected): + assert is_dict(actual) + expected_keys = ["name", "directoryIndexes"] + + check_list_match(lambda a, e: matches(c["directories"][a]["source"], e), + actual["directoryIndexes"], expected["directorySources"], + missing_exception=lambda e: "Directory source: %s" % e, + extra_exception=lambda a: "Directory source: %s" % c["directories"][a]["source"]) + + if expected["parentName"] is not None: + expected_keys.append("parentIndex") + assert is_int(actual["parentIndex"]) + assert is_string(c["projects"][actual["parentIndex"]]["name"], expected["parentName"]) + + if expected["childNames"] is not None: + expected_keys.append("childIndexes") + check_list_match(lambda a, e: is_string(c["projects"][a]["name"], e), + actual["childIndexes"], expected["childNames"], + missing_exception=lambda e: "Child name: %s" % e, + extra_exception=lambda a: "Child name: %s" % c["projects"][a]["name"]) + + if expected["targetIds"] is not None: + expected_keys.append("targetIndexes") + check_list_match(lambda a, e: matches(c["targets"][a]["id"], e), + actual["targetIndexes"], expected["targetIds"], + missing_exception=lambda e: "Target ID: %s" % e, + extra_exception=lambda a: "Target ID: %s" % c["targets"][a]["id"]) + + assert sorted(actual.keys()) == sorted(expected_keys) + + return _check + +def gen_check_directories(c, g): + expected = [ + { + "source": "^\\.$", + "build": "^\\.$", + "parentSource": None, + "childSources": [ + "^alias$", + "^custom$", + "^cxx$", + "^imported$", + "^object$", + "^.*/Tests/RunCMake/FileAPIExternalSource$", + "^dir$", + ], + "targetIds": [ + "^ALL_BUILD::@6890427a1f51a3e7e1df$", + "^ZERO_CHECK::@6890427a1f51a3e7e1df$", + "^c_exe::@6890427a1f51a3e7e1df$", + "^c_lib::@6890427a1f51a3e7e1df$", + "^c_shared_exe::@6890427a1f51a3e7e1df$", + "^c_shared_lib::@6890427a1f51a3e7e1df$", + "^c_static_exe::@6890427a1f51a3e7e1df$", + "^c_static_lib::@6890427a1f51a3e7e1df$", + "^interface_exe::@6890427a1f51a3e7e1df$", + ], + "projectName": "codemodel-v2", + "minimumCMakeVersion": "3.12", + "hasInstallRule": True, + }, + { + "source": "^alias$", + "build": "^alias$", + "parentSource": "^\\.$", + "childSources": None, + "targetIds": [ + "^ALL_BUILD::@53632cba2752272bb008$", + "^ZERO_CHECK::@53632cba2752272bb008$", + "^c_alias_exe::@53632cba2752272bb008$", + "^cxx_alias_exe::@53632cba2752272bb008$", + ], + "projectName": "Alias", + "minimumCMakeVersion": "3.12", + "hasInstallRule": None, + }, + { + "source": "^custom$", + "build": "^custom$", + "parentSource": "^\\.$", + "childSources": None, + "targetIds": [ + "^ALL_BUILD::@c11385ffed57b860da63$", + "^ZERO_CHECK::@c11385ffed57b860da63$", + "^custom_exe::@c11385ffed57b860da63$", + "^custom_tgt::@c11385ffed57b860da63$", + ], + "projectName": "Custom", + "minimumCMakeVersion": "3.12", + "hasInstallRule": None, + }, + { + "source": "^cxx$", + "build": "^cxx$", + "parentSource": "^\\.$", + "childSources": None, + "targetIds": [ + "^ALL_BUILD::@a56b12a3f5c0529fb296$", + "^ZERO_CHECK::@a56b12a3f5c0529fb296$", + "^cxx_exe::@a56b12a3f5c0529fb296$", + "^cxx_lib::@a56b12a3f5c0529fb296$", + "^cxx_shared_exe::@a56b12a3f5c0529fb296$", + "^cxx_shared_lib::@a56b12a3f5c0529fb296$", + "^cxx_static_exe::@a56b12a3f5c0529fb296$", + "^cxx_static_lib::@a56b12a3f5c0529fb296$", + ], + "projectName": "Cxx", + "minimumCMakeVersion": "3.12", + "hasInstallRule": None, + }, + { + "source": "^imported$", + "build": "^imported$", + "parentSource": "^\\.$", + "childSources": None, + "targetIds": [ + "^ALL_BUILD::@ba7eb709d0b48779c6c8$", + "^ZERO_CHECK::@ba7eb709d0b48779c6c8$", + "^link_imported_exe::@ba7eb709d0b48779c6c8$", + "^link_imported_interface_exe::@ba7eb709d0b48779c6c8$", + "^link_imported_object_exe::@ba7eb709d0b48779c6c8$", + "^link_imported_shared_exe::@ba7eb709d0b48779c6c8$", + "^link_imported_static_exe::@ba7eb709d0b48779c6c8$", + ], + "projectName": "Imported", + "minimumCMakeVersion": "3.12", + "hasInstallRule": None, + }, + { + "source": "^object$", + "build": "^object$", + "parentSource": "^\\.$", + "childSources": None, + "targetIds": [ + "^ALL_BUILD::@5ed5358f70faf8d8af7a$", + "^ZERO_CHECK::@5ed5358f70faf8d8af7a$", + "^c_object_exe::@5ed5358f70faf8d8af7a$", + "^c_object_lib::@5ed5358f70faf8d8af7a$", + "^cxx_object_exe::@5ed5358f70faf8d8af7a$", + "^cxx_object_lib::@5ed5358f70faf8d8af7a$", + ], + "projectName": "Object", + "minimumCMakeVersion": "3.13", + "hasInstallRule": True, + }, + { + "source": "^dir$", + "build": "^dir$", + "parentSource": "^\\.$", + "childSources": [ + "^dir/dir$", + ], + "targetIds": None, + "projectName": "codemodel-v2", + "minimumCMakeVersion": "3.12", + "hasInstallRule": None, + }, + { + "source": "^dir/dir$", + "build": "^dir/dir$", + "parentSource": "^dir$", + "childSources": None, + "targetIds": None, + "projectName": "codemodel-v2", + "minimumCMakeVersion": "3.12", + "hasInstallRule": None, + }, + { + "source": "^.*/Tests/RunCMake/FileAPIExternalSource$", + "build": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild$", + "parentSource": "^\\.$", + "childSources": None, + "targetIds": [ + "^ALL_BUILD::@[0-9a-f]+$", + "^ZERO_CHECK::@[0-9a-f]+$", + "^generated_exe::@[0-9a-f]+$", + ], + "projectName": "External", + "minimumCMakeVersion": "3.12", + "hasInstallRule": None, + }, + ] + + if matches(g, "^Visual Studio "): + for e in expected: + if e["parentSource"] is not None: + e["targetIds"] = filter_list(lambda t: not matches(t, "^\\^ZERO_CHECK"), e["targetIds"]) + + elif g == "Xcode": + if ';' in os.environ.get("CMAKE_OSX_ARCHITECTURES", ""): + for e in expected: + e["targetIds"] = filter_list(lambda t: not matches(t, "^\\^(link_imported_object_exe)"), e["targetIds"]) + + else: + for e in expected: + e["targetIds"] = filter_list(lambda t: not matches(t, "^\\^(ALL_BUILD|ZERO_CHECK)"), e["targetIds"]) + + return expected + +def check_directories(c, g): + check_list_match(lambda a, e: matches(a["source"], e["source"]), c["directories"], gen_check_directories(c, g), + check=check_directory(c), + check_exception=lambda a, e: "Directory source: %s" % a["source"], + missing_exception=lambda e: "Directory source: %s" % e["source"], + extra_exception=lambda a: "Directory source: %s" % a["source"]) + +def gen_check_targets(c, g, inSource): + expected = [ + { + "name": "ALL_BUILD", + "id": "^ALL_BUILD::@6890427a1f51a3e7e1df$", + "directorySource": "^\\.$", + "projectName": "codemodel-v2", + "type": "UTILITY", + "isGeneratorProvided": True, + "sources": [ + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/CMakeFiles/ALL_BUILD$", + "isGenerated": True, + "sourceGroupName": "", + "compileGroupLanguage": None, + "backtrace": [ + { + "file": "^CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/CMakeFiles/ALL_BUILD\\.rule$", + "isGenerated": True, + "sourceGroupName": "CMake Rules", + "compileGroupLanguage": None, + "backtrace": [ + { + "file": "^CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "sourceGroups": [ + { + "name": "", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/CMakeFiles/ALL_BUILD$", + ], + }, + { + "name": "CMake Rules", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/CMakeFiles/ALL_BUILD\\.rule$", + ], + }, + ], + "compileGroups": None, + "backtrace": [ + { + "file": "^CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + "folder": None, + "nameOnDisk": None, + "artifacts": None, + "build": "^\\.$", + "source": "^\\.$", + "install": None, + "link": None, + "archive": None, + "dependencies": [ + { + "id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$", + "backtrace": None, + }, + { + "id": "^interface_exe::@6890427a1f51a3e7e1df$", + "backtrace": None, + }, + { + "id": "^c_lib::@6890427a1f51a3e7e1df$", + "backtrace": None, + }, + { + "id": "^c_exe::@6890427a1f51a3e7e1df$", + "backtrace": None, + }, + { + "id": "^c_shared_lib::@6890427a1f51a3e7e1df$", + "backtrace": None, + }, + { + "id": "^c_shared_exe::@6890427a1f51a3e7e1df$", + "backtrace": None, + }, + { + "id": "^c_static_lib::@6890427a1f51a3e7e1df$", + "backtrace": None, + }, + { + "id": "^c_static_exe::@6890427a1f51a3e7e1df$", + "backtrace": None, + }, + { + "id": "^c_alias_exe::@53632cba2752272bb008$", + "backtrace": None, + }, + { + "id": "^cxx_alias_exe::@53632cba2752272bb008$", + "backtrace": None, + }, + { + "id": "^cxx_lib::@a56b12a3f5c0529fb296$", + "backtrace": None, + }, + { + "id": "^cxx_exe::@a56b12a3f5c0529fb296$", + "backtrace": None, + }, + { + "id": "^cxx_shared_lib::@a56b12a3f5c0529fb296$", + "backtrace": None, + }, + { + "id": "^cxx_shared_exe::@a56b12a3f5c0529fb296$", + "backtrace": None, + }, + { + "id": "^cxx_static_lib::@a56b12a3f5c0529fb296$", + "backtrace": None, + }, + { + "id": "^cxx_static_exe::@a56b12a3f5c0529fb296$", + "backtrace": None, + }, + { + "id": "^c_object_lib::@5ed5358f70faf8d8af7a$", + "backtrace": None, + }, + { + "id": "^c_object_exe::@5ed5358f70faf8d8af7a$", + "backtrace": None, + }, + { + "id": "^cxx_object_lib::@5ed5358f70faf8d8af7a$", + "backtrace": None, + }, + { + "id": "^cxx_object_exe::@5ed5358f70faf8d8af7a$", + "backtrace": None, + }, + { + "id": "^link_imported_exe::@ba7eb709d0b48779c6c8$", + "backtrace": None, + }, + { + "id": "^link_imported_shared_exe::@ba7eb709d0b48779c6c8$", + "backtrace": None, + }, + { + "id": "^link_imported_static_exe::@ba7eb709d0b48779c6c8$", + "backtrace": None, + }, + { + "id": "^link_imported_object_exe::@ba7eb709d0b48779c6c8$", + "backtrace": None, + }, + { + "id": "^link_imported_interface_exe::@ba7eb709d0b48779c6c8$", + "backtrace": None, + }, + { + "id": "^custom_exe::@c11385ffed57b860da63$", + "backtrace": None, + }, + { + "id": "^generated_exe::@[0-9a-f]+$", + "backtrace": None, + }, + ], + }, + { + "name": "ZERO_CHECK", + "id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$", + "directorySource": "^\\.$", + "projectName": "codemodel-v2", + "type": "UTILITY", + "isGeneratorProvided": True, + "sources": [ + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/CMakeFiles/ZERO_CHECK$", + "isGenerated": True, + "sourceGroupName": "", + "compileGroupLanguage": None, + "backtrace": [ + { + "file": "^CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/CMakeFiles/ZERO_CHECK\\.rule$", + "isGenerated": True, + "sourceGroupName": "CMake Rules", + "compileGroupLanguage": None, + "backtrace": [ + { + "file": "^CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "sourceGroups": [ + { + "name": "", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/CMakeFiles/ZERO_CHECK$", + ], + }, + { + "name": "CMake Rules", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/CMakeFiles/ZERO_CHECK\\.rule$", + ], + }, + ], + "compileGroups": None, + "backtrace": [ + { + "file": "^CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + "folder": None, + "nameOnDisk": None, + "artifacts": None, + "build": "^\\.$", + "source": "^\\.$", + "install": None, + "link": None, + "archive": None, + "dependencies": None, + }, + { + "name": "interface_exe", + "id": "^interface_exe::@6890427a1f51a3e7e1df$", + "directorySource": "^\\.$", + "projectName": "codemodel-v2", + "type": "EXECUTABLE", + "isGeneratorProvided": None, + "sources": [ + { + "path": "^empty\\.c$", + "isGenerated": None, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "C", + "backtrace": [ + { + "file": "^include_test\\.cmake$", + "line": 3, + "command": "add_executable", + "hasParent": True, + }, + { + "file": "^include_test\\.cmake$", + "line": None, + "command": None, + "hasParent": True, + }, + { + "file": "^codemodel-v2\\.cmake$", + "line": 3, + "command": "include", + "hasParent": True, + }, + { + "file": "^codemodel-v2\\.cmake$", + "line": None, + "command": None, + "hasParent": True, + }, + { + "file": "^CMakeLists\\.txt$", + "line": 3, + "command": "include", + "hasParent": True, + }, + { + "file": "^CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^empty\\.c$", + ], + }, + ], + "compileGroups": [ + { + "language": "C", + "sourcePaths": [ + "^empty\\.c$", + ], + "includes": None, + "defines": [ + { + "define": "interface_exe_EXPORTS", + "backtrace": None, + }, + ], + }, + ], + "backtrace": [ + { + "file": "^include_test\\.cmake$", + "line": 3, + "command": "add_executable", + "hasParent": True, + }, + { + "file": "^include_test\\.cmake$", + "line": None, + "command": None, + "hasParent": True, + }, + { + "file": "^codemodel-v2\\.cmake$", + "line": 3, + "command": "include", + "hasParent": True, + }, + { + "file": "^codemodel-v2\\.cmake$", + "line": None, + "command": None, + "hasParent": True, + }, + { + "file": "^CMakeLists\\.txt$", + "line": 3, + "command": "include", + "hasParent": True, + }, + { + "file": "^CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + "folder": None, + "nameOnDisk": "^my_interface_exe\\.myexe$", + "artifacts": [ + { + "path": "^bin/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?my_interface_exe\\.myexe$", + "_dllExtra": False, + }, + { + "path": "^lib/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?my_interface_exe\\.(dll\\.a|lib)$", + "_dllExtra": True, + }, + { + "path": "^bin/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?my_interface_exe\\.pdb$", + "_dllExtra": True, + }, + ], + "build": "^\\.$", + "source": "^\\.$", + "install": None, + "link": { + "language": "C", + "lto": None, + }, + "archive": None, + "dependencies": [ + { + "id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$", + "backtrace": None, + }, + ], + }, + { + "name": "c_lib", + "id": "^c_lib::@6890427a1f51a3e7e1df$", + "directorySource": "^\\.$", + "projectName": "codemodel-v2", + "type": "STATIC_LIBRARY", + "isGeneratorProvided": None, + "sources": [ + { + "path": "^empty\\.c$", + "isGenerated": None, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "C", + "backtrace": [ + { + "file": "^codemodel-v2\\.cmake$", + "line": 5, + "command": "add_library", + "hasParent": True, + }, + { + "file": "^codemodel-v2\\.cmake$", + "line": None, + "command": None, + "hasParent": True, + }, + { + "file": "^CMakeLists\\.txt$", + "line": 3, + "command": "include", + "hasParent": True, + }, + { + "file": "^CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^empty\\.c$", + ], + }, + ], + "compileGroups": [ + { + "language": "C", + "sourcePaths": [ + "^empty\\.c$", + ], + "includes": None, + "defines": None, + }, + ], + "backtrace": [ + { + "file": "^codemodel-v2\\.cmake$", + "line": 5, + "command": "add_library", + "hasParent": True, + }, + { + "file": "^codemodel-v2\\.cmake$", + "line": None, + "command": None, + "hasParent": True, + }, + { + "file": "^CMakeLists\\.txt$", + "line": 3, + "command": "include", + "hasParent": True, + }, + { + "file": "^CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + "folder": None, + "nameOnDisk": "^(lib)?c_lib\\.(a|lib)$", + "artifacts": [ + { + "path": "^((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?c_lib\\.(a|lib)$", + "_dllExtra": False, + }, + ], + "build": "^\\.$", + "source": "^\\.$", + "install": None, + "link": None, + "archive": { + "lto": None, + }, + "dependencies": [ + { + "id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$", + "backtrace": None, + }, + ], + }, + { + "name": "c_exe", + "id": "^c_exe::@6890427a1f51a3e7e1df$", + "directorySource": "^\\.$", + "projectName": "codemodel-v2", + "type": "EXECUTABLE", + "isGeneratorProvided": None, + "sources": [ + { + "path": "^empty\\.c$", + "isGenerated": None, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "C", + "backtrace": [ + { + "file": "^codemodel-v2\\.cmake$", + "line": 6, + "command": "add_executable", + "hasParent": True, + }, + { + "file": "^codemodel-v2\\.cmake$", + "line": None, + "command": None, + "hasParent": True, + }, + { + "file": "^CMakeLists\\.txt$", + "line": 3, + "command": "include", + "hasParent": True, + }, + { + "file": "^CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^empty\\.c$", + ], + }, + ], + "compileGroups": [ + { + "language": "C", + "sourcePaths": [ + "^empty\\.c$", + ], + "includes": None, + "defines": None, + }, + ], + "backtrace": [ + { + "file": "^codemodel-v2\\.cmake$", + "line": 6, + "command": "add_executable", + "hasParent": True, + }, + { + "file": "^codemodel-v2\\.cmake$", + "line": None, + "command": None, + "hasParent": True, + }, + { + "file": "^CMakeLists\\.txt$", + "line": 3, + "command": "include", + "hasParent": True, + }, + { + "file": "^CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + "folder": None, + "nameOnDisk": "^c_exe(\\.exe)?$", + "artifacts": [ + { + "path": "^((Debug|Release|RelWithDebInfo|MinSizeRel)/)?c_exe(\\.exe)?$", + "_dllExtra": False, + }, + { + "path": "^((Debug|Release|RelWithDebInfo|MinSizeRel)/)?c_exe\\.pdb$", + "_dllExtra": True, + }, + ], + "build": "^\\.$", + "source": "^\\.$", + "install": None, + "link": { + "language": "C", + "lto": None, + }, + "archive": None, + "dependencies": [ + { + "id": "^c_lib::@6890427a1f51a3e7e1df$", + "backtrace": [ + { + "file": "^codemodel-v2\\.cmake$", + "line": 7, + "command": "target_link_libraries", + "hasParent": True, + }, + { + "file": "^codemodel-v2\\.cmake$", + "line": None, + "command": None, + "hasParent": True, + }, + { + "file": "^CMakeLists\\.txt$", + "line": 3, + "command": "include", + "hasParent": True, + }, + { + "file": "^CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + { + "id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$", + "backtrace": None, + }, + ], + }, + { + "name": "c_shared_lib", + "id": "^c_shared_lib::@6890427a1f51a3e7e1df$", + "directorySource": "^\\.$", + "projectName": "codemodel-v2", + "type": "SHARED_LIBRARY", + "isGeneratorProvided": None, + "sources": [ + { + "path": "^empty\\.c$", + "isGenerated": None, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "C", + "backtrace": [ + { + "file": "^codemodel-v2\\.cmake$", + "line": 9, + "command": "add_library", + "hasParent": True, + }, + { + "file": "^codemodel-v2\\.cmake$", + "line": None, + "command": None, + "hasParent": True, + }, + { + "file": "^CMakeLists\\.txt$", + "line": 3, + "command": "include", + "hasParent": True, + }, + { + "file": "^CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^empty\\.c$", + ], + }, + ], + "compileGroups": [ + { + "language": "C", + "sourcePaths": [ + "^empty\\.c$", + ], + "includes": None, + "defines": [ + { + "define": "c_shared_lib_EXPORTS", + "backtrace": None, + }, + ], + }, + ], + "backtrace": [ + { + "file": "^codemodel-v2\\.cmake$", + "line": 9, + "command": "add_library", + "hasParent": True, + }, + { + "file": "^codemodel-v2\\.cmake$", + "line": None, + "command": None, + "hasParent": True, + }, + { + "file": "^CMakeLists\\.txt$", + "line": 3, + "command": "include", + "hasParent": True, + }, + { + "file": "^CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + "folder": None, + "nameOnDisk": "^(lib|cyg)?c_shared_lib\\.(so|dylib|dll)$", + "artifacts": [ + { + "path": "^lib/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib|cyg)?c_shared_lib\\.(so|dylib|dll)$", + "_dllExtra": False, + }, + { + "path": "^((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?c_shared_lib\\.(dll\\.a|lib)$", + "_dllExtra": True, + }, + { + "path": "^lib/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib|cyg)?c_shared_lib\\.pdb$", + "_dllExtra": True, + }, + ], + "build": "^\\.$", + "source": "^\\.$", + "install": None, + "link": { + "language": "C", + "lto": True, + }, + "archive": None, + "dependencies": [ + { + "id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$", + "backtrace": None, + }, + ], + }, + { + "name": "c_shared_exe", + "id": "^c_shared_exe::@6890427a1f51a3e7e1df$", + "directorySource": "^\\.$", + "projectName": "codemodel-v2", + "type": "EXECUTABLE", + "isGeneratorProvided": None, + "sources": [ + { + "path": "^empty\\.c$", + "isGenerated": None, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "C", + "backtrace": [ + { + "file": "^codemodel-v2\\.cmake$", + "line": 10, + "command": "add_executable", + "hasParent": True, + }, + { + "file": "^codemodel-v2\\.cmake$", + "line": None, + "command": None, + "hasParent": True, + }, + { + "file": "^CMakeLists\\.txt$", + "line": 3, + "command": "include", + "hasParent": True, + }, + { + "file": "^CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^empty\\.c$", + ], + }, + ], + "compileGroups": [ + { + "language": "C", + "sourcePaths": [ + "^empty\\.c$", + ], + "includes": None, + "defines": None, + }, + ], + "backtrace": [ + { + "file": "^codemodel-v2\\.cmake$", + "line": 10, + "command": "add_executable", + "hasParent": True, + }, + { + "file": "^codemodel-v2\\.cmake$", + "line": None, + "command": None, + "hasParent": True, + }, + { + "file": "^CMakeLists\\.txt$", + "line": 3, + "command": "include", + "hasParent": True, + }, + { + "file": "^CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + "folder": None, + "nameOnDisk": "^c_shared_exe(\\.exe)?$", + "artifacts": [ + { + "path": "^((Debug|Release|RelWithDebInfo|MinSizeRel)/)?c_shared_exe(\\.exe)?$", + "_dllExtra": False, + }, + { + "path": "^((Debug|Release|RelWithDebInfo|MinSizeRel)/)?c_shared_exe\\.pdb$", + "_dllExtra": True, + }, + ], + "build": "^\\.$", + "source": "^\\.$", + "install": None, + "link": { + "language": "C", + "lto": True, + }, + "archive": None, + "dependencies": [ + { + "id": "^c_shared_lib::@6890427a1f51a3e7e1df$", + "backtrace": [ + { + "file": "^codemodel-v2\\.cmake$", + "line": 11, + "command": "target_link_libraries", + "hasParent": True, + }, + { + "file": "^codemodel-v2\\.cmake$", + "line": None, + "command": None, + "hasParent": True, + }, + { + "file": "^CMakeLists\\.txt$", + "line": 3, + "command": "include", + "hasParent": True, + }, + { + "file": "^CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + { + "id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$", + "backtrace": None, + }, + ], + }, + { + "name": "c_static_lib", + "id": "^c_static_lib::@6890427a1f51a3e7e1df$", + "directorySource": "^\\.$", + "projectName": "codemodel-v2", + "type": "STATIC_LIBRARY", + "isGeneratorProvided": None, + "sources": [ + { + "path": "^empty\\.c$", + "isGenerated": None, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "C", + "backtrace": [ + { + "file": "^codemodel-v2\\.cmake$", + "line": 13, + "command": "add_library", + "hasParent": True, + }, + { + "file": "^codemodel-v2\\.cmake$", + "line": None, + "command": None, + "hasParent": True, + }, + { + "file": "^CMakeLists\\.txt$", + "line": 3, + "command": "include", + "hasParent": True, + }, + { + "file": "^CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^empty\\.c$", + ], + }, + ], + "compileGroups": [ + { + "language": "C", + "sourcePaths": [ + "^empty\\.c$", + ], + "includes": None, + "defines": None, + }, + ], + "backtrace": [ + { + "file": "^codemodel-v2\\.cmake$", + "line": 13, + "command": "add_library", + "hasParent": True, + }, + { + "file": "^codemodel-v2\\.cmake$", + "line": None, + "command": None, + "hasParent": True, + }, + { + "file": "^CMakeLists\\.txt$", + "line": 3, + "command": "include", + "hasParent": True, + }, + { + "file": "^CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + "folder": None, + "nameOnDisk": "^(lib)?c_static_lib\\.(a|lib)$", + "artifacts": [ + { + "path": "^((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?c_static_lib\\.(a|lib)$", + "_dllExtra": False, + }, + ], + "build": "^\\.$", + "source": "^\\.$", + "install": None, + "link": None, + "archive": { + "lto": True, + }, + "dependencies": [ + { + "id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$", + "backtrace": None, + }, + ], + }, + { + "name": "c_static_exe", + "id": "^c_static_exe::@6890427a1f51a3e7e1df$", + "directorySource": "^\\.$", + "projectName": "codemodel-v2", + "type": "EXECUTABLE", + "isGeneratorProvided": None, + "sources": [ + { + "path": "^empty\\.c$", + "isGenerated": None, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "C", + "backtrace": [ + { + "file": "^codemodel-v2\\.cmake$", + "line": 14, + "command": "add_executable", + "hasParent": True, + }, + { + "file": "^codemodel-v2\\.cmake$", + "line": None, + "command": None, + "hasParent": True, + }, + { + "file": "^CMakeLists\\.txt$", + "line": 3, + "command": "include", + "hasParent": True, + }, + { + "file": "^CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^empty\\.c$", + ], + }, + ], + "compileGroups": [ + { + "language": "C", + "sourcePaths": [ + "^empty\\.c$", + ], + "includes": None, + "defines": None, + }, + ], + "backtrace": [ + { + "file": "^codemodel-v2\\.cmake$", + "line": 14, + "command": "add_executable", + "hasParent": True, + }, + { + "file": "^codemodel-v2\\.cmake$", + "line": None, + "command": None, + "hasParent": True, + }, + { + "file": "^CMakeLists\\.txt$", + "line": 3, + "command": "include", + "hasParent": True, + }, + { + "file": "^CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + "folder": None, + "nameOnDisk": "^c_static_exe(\\.exe)?$", + "artifacts": [ + { + "path": "^((Debug|Release|RelWithDebInfo|MinSizeRel)/)?c_static_exe(\\.exe)?$", + "_dllExtra": False, + }, + { + "path": "^((Debug|Release|RelWithDebInfo|MinSizeRel)/)?c_static_exe\\.pdb$", + "_dllExtra": True, + }, + ], + "build": "^\\.$", + "source": "^\\.$", + "install": None, + "link": { + "language": "C", + "lto": None, + }, + "archive": None, + "dependencies": [ + { + "id": "^c_static_lib::@6890427a1f51a3e7e1df$", + "backtrace": [ + { + "file": "^codemodel-v2\\.cmake$", + "line": 15, + "command": "target_link_libraries", + "hasParent": True, + }, + { + "file": "^codemodel-v2\\.cmake$", + "line": None, + "command": None, + "hasParent": True, + }, + { + "file": "^CMakeLists\\.txt$", + "line": 3, + "command": "include", + "hasParent": True, + }, + { + "file": "^CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + { + "id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$", + "backtrace": None, + }, + ], + }, + { + "name": "ALL_BUILD", + "id": "^ALL_BUILD::@a56b12a3f5c0529fb296$", + "directorySource": "^cxx$", + "projectName": "Cxx", + "type": "UTILITY", + "isGeneratorProvided": True, + "sources": [ + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/cxx/CMakeFiles/ALL_BUILD$", + "isGenerated": True, + "sourceGroupName": "", + "compileGroupLanguage": None, + "backtrace": [ + { + "file": "^cxx/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/cxx/CMakeFiles/ALL_BUILD\\.rule$", + "isGenerated": True, + "sourceGroupName": "CMake Rules", + "compileGroupLanguage": None, + "backtrace": [ + { + "file": "^cxx/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "sourceGroups": [ + { + "name": "", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/cxx/CMakeFiles/ALL_BUILD$", + ], + }, + { + "name": "CMake Rules", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/cxx/CMakeFiles/ALL_BUILD\\.rule$", + ], + }, + ], + "compileGroups": None, + "backtrace": [ + { + "file": "^cxx/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + "folder": None, + "nameOnDisk": None, + "artifacts": None, + "build": "^cxx$", + "source": "^cxx$", + "install": None, + "link": None, + "archive": None, + "dependencies": [ + { + "id": "^ZERO_CHECK::@a56b12a3f5c0529fb296$", + "backtrace": None, + }, + { + "id": "^cxx_lib::@a56b12a3f5c0529fb296$", + "backtrace": None, + }, + { + "id": "^cxx_exe::@a56b12a3f5c0529fb296$", + "backtrace": None, + }, + { + "id": "^cxx_shared_lib::@a56b12a3f5c0529fb296$", + "backtrace": None, + }, + { + "id": "^cxx_shared_exe::@a56b12a3f5c0529fb296$", + "backtrace": None, + }, + { + "id": "^cxx_static_lib::@a56b12a3f5c0529fb296$", + "backtrace": None, + }, + { + "id": "^cxx_static_exe::@a56b12a3f5c0529fb296$", + "backtrace": None, + }, + ], + }, + { + "name": "ZERO_CHECK", + "id": "^ZERO_CHECK::@a56b12a3f5c0529fb296$", + "directorySource": "^cxx$", + "projectName": "Cxx", + "type": "UTILITY", + "isGeneratorProvided": True, + "sources": [ + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/cxx/CMakeFiles/ZERO_CHECK$", + "isGenerated": True, + "sourceGroupName": "", + "compileGroupLanguage": None, + "backtrace": [ + { + "file": "^cxx/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/cxx/CMakeFiles/ZERO_CHECK\\.rule$", + "isGenerated": True, + "sourceGroupName": "CMake Rules", + "compileGroupLanguage": None, + "backtrace": [ + { + "file": "^cxx/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "sourceGroups": [ + { + "name": "", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/cxx/CMakeFiles/ZERO_CHECK$", + ], + }, + { + "name": "CMake Rules", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/cxx/CMakeFiles/ZERO_CHECK\\.rule$", + ], + }, + ], + "compileGroups": None, + "backtrace": [ + { + "file": "^cxx/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + "folder": None, + "nameOnDisk": None, + "artifacts": None, + "build": "^cxx$", + "source": "^cxx$", + "install": None, + "link": None, + "archive": None, + "dependencies": None, + }, + { + "name": "cxx_lib", + "id": "^cxx_lib::@a56b12a3f5c0529fb296$", + "directorySource": "^cxx$", + "projectName": "Cxx", + "type": "STATIC_LIBRARY", + "isGeneratorProvided": None, + "sources": [ + { + "path": "^empty\\.cxx$", + "isGenerated": None, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "CXX", + "backtrace": [ + { + "file": "^cxx/CMakeLists\\.txt$", + "line": 4, + "command": "add_library", + "hasParent": True, + }, + { + "file": "^cxx/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^empty\\.cxx$", + ], + }, + ], + "compileGroups": [ + { + "language": "CXX", + "sourcePaths": [ + "^empty\\.cxx$", + ], + "includes": None, + "defines": None, + }, + ], + "backtrace": [ + { + "file": "^cxx/CMakeLists\\.txt$", + "line": 4, + "command": "add_library", + "hasParent": True, + }, + { + "file": "^cxx/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + "folder": None, + "nameOnDisk": "^(lib)?cxx_lib\\.(a|lib)$", + "artifacts": [ + { + "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?cxx_lib\\.(a|lib)$", + "_dllExtra": False, + }, + ], + "build": "^cxx$", + "source": "^cxx$", + "install": None, + "link": None, + "archive": { + "lto": None, + }, + "dependencies": [ + { + "id": "^ZERO_CHECK::@a56b12a3f5c0529fb296$", + "backtrace": None, + }, + ], + }, + { + "name": "cxx_exe", + "id": "^cxx_exe::@a56b12a3f5c0529fb296$", + "directorySource": "^cxx$", + "projectName": "Cxx", + "type": "EXECUTABLE", + "isGeneratorProvided": None, + "sources": [ + { + "path": "^empty\\.cxx$", + "isGenerated": None, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "CXX", + "backtrace": [ + { + "file": "^cxx/CMakeLists\\.txt$", + "line": 5, + "command": "add_executable", + "hasParent": True, + }, + { + "file": "^cxx/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^empty\\.cxx$", + ], + }, + ], + "compileGroups": [ + { + "language": "CXX", + "sourcePaths": [ + "^empty\\.cxx$", + ], + "includes": None, + "defines": None, + }, + ], + "backtrace": [ + { + "file": "^cxx/CMakeLists\\.txt$", + "line": 5, + "command": "add_executable", + "hasParent": True, + }, + { + "file": "^cxx/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + "folder": "bin", + "nameOnDisk": "^cxx_exe(\\.exe)?$", + "artifacts": [ + { + "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_exe(\\.exe)?$", + "_dllExtra": False, + }, + { + "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_exe\\.pdb$", + "_dllExtra": True, + }, + ], + "build": "^cxx$", + "source": "^cxx$", + "install": None, + "link": { + "language": "CXX", + "lto": None, + }, + "archive": None, + "dependencies": [ + { + "id": "^cxx_lib::@a56b12a3f5c0529fb296$", + "backtrace": [ + { + "file": "^cxx/CMakeLists\\.txt$", + "line": 6, + "command": "target_link_libraries", + "hasParent": True, + }, + { + "file": "^cxx/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + { + "id": "^ZERO_CHECK::@a56b12a3f5c0529fb296$", + "backtrace": None, + }, + ], + }, + { + "name": "cxx_shared_lib", + "id": "^cxx_shared_lib::@a56b12a3f5c0529fb296$", + "directorySource": "^cxx$", + "projectName": "Cxx", + "type": "SHARED_LIBRARY", + "isGeneratorProvided": None, + "sources": [ + { + "path": "^empty\\.cxx$", + "isGenerated": None, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "CXX", + "backtrace": [ + { + "file": "^cxx/CMakeLists\\.txt$", + "line": 9, + "command": "add_library", + "hasParent": True, + }, + { + "file": "^cxx/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^empty\\.cxx$", + ], + }, + ], + "compileGroups": [ + { + "language": "CXX", + "sourcePaths": [ + "^empty\\.cxx$", + ], + "includes": None, + "defines": [ + { + "define": "cxx_shared_lib_EXPORTS", + "backtrace": None, + }, + ], + }, + ], + "backtrace": [ + { + "file": "^cxx/CMakeLists\\.txt$", + "line": 9, + "command": "add_library", + "hasParent": True, + }, + { + "file": "^cxx/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + "folder": None, + "nameOnDisk": "^(lib|cyg)?cxx_shared_lib\\.(so|dylib|dll)$", + "artifacts": [ + { + "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib|cyg)?cxx_shared_lib\\.(so|dylib|dll)$", + "_dllExtra": False, + }, + { + "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?cxx_shared_lib\\.(dll\\.a|lib)$", + "_dllExtra": True, + }, + { + "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib|cyg)?cxx_shared_lib\\.pdb$", + "_dllExtra": True, + }, + ], + "build": "^cxx$", + "source": "^cxx$", + "install": None, + "link": { + "language": "CXX", + "lto": None, + }, + "archive": None, + "dependencies": [ + { + "id": "^ZERO_CHECK::@a56b12a3f5c0529fb296$", + "backtrace": None, + }, + ], + }, + { + "name": "cxx_shared_exe", + "id": "^cxx_shared_exe::@a56b12a3f5c0529fb296$", + "directorySource": "^cxx$", + "projectName": "Cxx", + "type": "EXECUTABLE", + "isGeneratorProvided": None, + "sources": [ + { + "path": "^empty\\.cxx$", + "isGenerated": None, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "CXX", + "backtrace": [ + { + "file": "^cxx/CMakeLists\\.txt$", + "line": 10, + "command": "add_executable", + "hasParent": True, + }, + { + "file": "^cxx/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^empty\\.cxx$", + ], + }, + ], + "compileGroups": [ + { + "language": "CXX", + "sourcePaths": [ + "^empty\\.cxx$", + ], + "includes": None, + "defines": None, + }, + ], + "backtrace": [ + { + "file": "^cxx/CMakeLists\\.txt$", + "line": 10, + "command": "add_executable", + "hasParent": True, + }, + { + "file": "^cxx/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + "folder": None, + "nameOnDisk": "^cxx_shared_exe(\\.exe)?$", + "artifacts": [ + { + "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_shared_exe(\\.exe)?$", + "_dllExtra": False, + }, + { + "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_shared_exe\\.pdb$", + "_dllExtra": True, + }, + ], + "build": "^cxx$", + "source": "^cxx$", + "install": None, + "link": { + "language": "CXX", + "lto": None, + }, + "archive": None, + "dependencies": [ + { + "id": "^cxx_shared_lib::@a56b12a3f5c0529fb296$", + "backtrace": [ + { + "file": "^cxx/CMakeLists\\.txt$", + "line": 11, + "command": "target_link_libraries", + "hasParent": True, + }, + { + "file": "^cxx/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + { + "id": "^ZERO_CHECK::@a56b12a3f5c0529fb296$", + "backtrace": None, + }, + ], + }, + { + "name": "cxx_static_lib", + "id": "^cxx_static_lib::@a56b12a3f5c0529fb296$", + "directorySource": "^cxx$", + "projectName": "Cxx", + "type": "STATIC_LIBRARY", + "isGeneratorProvided": None, + "sources": [ + { + "path": "^empty\\.cxx$", + "isGenerated": None, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "CXX", + "backtrace": [ + { + "file": "^cxx/CMakeLists\\.txt$", + "line": 13, + "command": "add_library", + "hasParent": True, + }, + { + "file": "^cxx/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^empty\\.cxx$", + ], + }, + ], + "compileGroups": [ + { + "language": "CXX", + "sourcePaths": [ + "^empty\\.cxx$", + ], + "includes": None, + "defines": None, + }, + ], + "backtrace": [ + { + "file": "^cxx/CMakeLists\\.txt$", + "line": 13, + "command": "add_library", + "hasParent": True, + }, + { + "file": "^cxx/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + "folder": None, + "nameOnDisk": "^(lib)?cxx_static_lib\\.(a|lib)$", + "artifacts": [ + { + "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?cxx_static_lib\\.(a|lib)$", + "_dllExtra": False, + }, + ], + "build": "^cxx$", + "source": "^cxx$", + "install": None, + "link": None, + "archive": { + "lto": None, + }, + "dependencies": [ + { + "id": "^ZERO_CHECK::@a56b12a3f5c0529fb296$", + "backtrace": None, + }, + ], + }, + { + "name": "cxx_static_exe", + "id": "^cxx_static_exe::@a56b12a3f5c0529fb296$", + "directorySource": "^cxx$", + "projectName": "Cxx", + "type": "EXECUTABLE", + "isGeneratorProvided": None, + "sources": [ + { + "path": "^empty\\.cxx$", + "isGenerated": None, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "CXX", + "backtrace": [ + { + "file": "^cxx/CMakeLists\\.txt$", + "line": 14, + "command": "add_executable", + "hasParent": True, + }, + { + "file": "^cxx/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^empty\\.cxx$", + ], + }, + ], + "compileGroups": [ + { + "language": "CXX", + "sourcePaths": [ + "^empty\\.cxx$", + ], + "includes": None, + "defines": None, + }, + ], + "backtrace": [ + { + "file": "^cxx/CMakeLists\\.txt$", + "line": 14, + "command": "add_executable", + "hasParent": True, + }, + { + "file": "^cxx/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + "folder": None, + "nameOnDisk": "^cxx_static_exe(\\.exe)?$", + "artifacts": [ + { + "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_static_exe(\\.exe)?$", + "_dllExtra": False, + }, + { + "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_static_exe\\.pdb$", + "_dllExtra": True, + }, + ], + "build": "^cxx$", + "source": "^cxx$", + "install": None, + "link": { + "language": "CXX", + "lto": None, + }, + "archive": None, + "dependencies": [ + { + "id": "^cxx_static_lib::@a56b12a3f5c0529fb296$", + "backtrace": [ + { + "file": "^cxx/CMakeLists\\.txt$", + "line": 15, + "command": "target_link_libraries", + "hasParent": True, + }, + { + "file": "^cxx/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + { + "id": "^ZERO_CHECK::@a56b12a3f5c0529fb296$", + "backtrace": None, + }, + ], + }, + { + "name": "ALL_BUILD", + "id": "^ALL_BUILD::@53632cba2752272bb008$", + "directorySource": "^alias$", + "projectName": "Alias", + "type": "UTILITY", + "isGeneratorProvided": True, + "sources": [ + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/alias/CMakeFiles/ALL_BUILD$", + "isGenerated": True, + "sourceGroupName": "", + "compileGroupLanguage": None, + "backtrace": [ + { + "file": "^alias/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/alias/CMakeFiles/ALL_BUILD\\.rule$", + "isGenerated": True, + "sourceGroupName": "CMake Rules", + "compileGroupLanguage": None, + "backtrace": [ + { + "file": "^alias/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "sourceGroups": [ + { + "name": "", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/alias/CMakeFiles/ALL_BUILD$", + ], + }, + { + "name": "CMake Rules", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/alias/CMakeFiles/ALL_BUILD\\.rule$", + ], + }, + ], + "compileGroups": None, + "backtrace": [ + { + "file": "^alias/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + "folder": None, + "nameOnDisk": None, + "artifacts": None, + "build": "^alias$", + "source": "^alias$", + "install": None, + "link": None, + "archive": None, + "dependencies": [ + { + "id": "^ZERO_CHECK::@53632cba2752272bb008$", + "backtrace": None, + }, + { + "id": "^c_alias_exe::@53632cba2752272bb008$", + "backtrace": None, + }, + { + "id": "^cxx_alias_exe::@53632cba2752272bb008$", + "backtrace": None, + }, + ], + }, + { + "name": "ZERO_CHECK", + "id": "^ZERO_CHECK::@53632cba2752272bb008$", + "directorySource": "^alias$", + "projectName": "Alias", + "type": "UTILITY", + "isGeneratorProvided": True, + "sources": [ + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/alias/CMakeFiles/ZERO_CHECK$", + "isGenerated": True, + "sourceGroupName": "", + "compileGroupLanguage": None, + "backtrace": [ + { + "file": "^alias/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/alias/CMakeFiles/ZERO_CHECK\\.rule$", + "isGenerated": True, + "sourceGroupName": "CMake Rules", + "compileGroupLanguage": None, + "backtrace": [ + { + "file": "^alias/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "sourceGroups": [ + { + "name": "", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/alias/CMakeFiles/ZERO_CHECK$", + ], + }, + { + "name": "CMake Rules", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/alias/CMakeFiles/ZERO_CHECK\\.rule$", + ], + }, + ], + "compileGroups": None, + "backtrace": [ + { + "file": "^alias/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + "folder": None, + "nameOnDisk": None, + "artifacts": None, + "build": "^alias$", + "source": "^alias$", + "install": None, + "link": None, + "archive": None, + "dependencies": None, + }, + { + "name": "c_alias_exe", + "id": "^c_alias_exe::@53632cba2752272bb008$", + "directorySource": "^alias$", + "projectName": "Alias", + "type": "EXECUTABLE", + "isGeneratorProvided": None, + "sources": [ + { + "path": "^empty\\.c$", + "isGenerated": None, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "C", + "backtrace": [ + { + "file": "^alias/CMakeLists\\.txt$", + "line": 5, + "command": "add_executable", + "hasParent": True, + }, + { + "file": "^alias/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^empty\\.c$", + ], + }, + ], + "compileGroups": [ + { + "language": "C", + "sourcePaths": [ + "^empty\\.c$", + ], + "includes": None, + "defines": None, + }, + ], + "backtrace": [ + { + "file": "^alias/CMakeLists\\.txt$", + "line": 5, + "command": "add_executable", + "hasParent": True, + }, + { + "file": "^alias/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + "folder": None, + "nameOnDisk": "^c_alias_exe(\\.exe)?$", + "artifacts": [ + { + "path": "^alias/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?c_alias_exe(\\.exe)?$", + "_dllExtra": False, + }, + { + "path": "^alias/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?c_alias_exe\\.pdb$", + "_dllExtra": True, + }, + ], + "build": "^alias$", + "source": "^alias$", + "install": None, + "link": { + "language": "C", + "lto": None, + }, + "archive": None, + "dependencies": [ + { + "id": "^c_lib::@6890427a1f51a3e7e1df$", + "backtrace": [ + { + "file": "^alias/CMakeLists\\.txt$", + "line": 6, + "command": "target_link_libraries", + "hasParent": True, + }, + { + "file": "^alias/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + { + "id": "^ZERO_CHECK::@53632cba2752272bb008$", + "backtrace": None, + }, + ], + }, + { + "name": "cxx_alias_exe", + "id": "^cxx_alias_exe::@53632cba2752272bb008$", + "directorySource": "^alias$", + "projectName": "Alias", + "type": "EXECUTABLE", + "isGeneratorProvided": None, + "sources": [ + { + "path": "^empty\\.cxx$", + "isGenerated": None, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "CXX", + "backtrace": [ + { + "file": "^alias/CMakeLists\\.txt$", + "line": 9, + "command": "add_executable", + "hasParent": True, + }, + { + "file": "^alias/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^empty\\.cxx$", + ], + }, + ], + "compileGroups": [ + { + "language": "CXX", + "sourcePaths": [ + "^empty\\.cxx$", + ], + "includes": None, + "defines": None, + }, + ], + "backtrace": [ + { + "file": "^alias/CMakeLists\\.txt$", + "line": 9, + "command": "add_executable", + "hasParent": True, + }, + { + "file": "^alias/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + "folder": None, + "nameOnDisk": "^cxx_alias_exe(\\.exe)?$", + "artifacts": [ + { + "path": "^alias/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_alias_exe(\\.exe)?$", + "_dllExtra": False, + }, + { + "path": "^alias/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_alias_exe\\.pdb$", + "_dllExtra": True, + }, + ], + "build": "^alias$", + "source": "^alias$", + "install": None, + "link": { + "language": "CXX", + "lto": None, + }, + "archive": None, + "dependencies": [ + { + "id": "^cxx_lib::@a56b12a3f5c0529fb296$", + "backtrace": [ + { + "file": "^alias/CMakeLists\\.txt$", + "line": 10, + "command": "target_link_libraries", + "hasParent": True, + }, + { + "file": "^alias/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + { + "id": "^ZERO_CHECK::@53632cba2752272bb008$", + "backtrace": None, + }, + ], + }, + { + "name": "ALL_BUILD", + "id": "^ALL_BUILD::@5ed5358f70faf8d8af7a$", + "directorySource": "^object$", + "projectName": "Object", + "type": "UTILITY", + "isGeneratorProvided": True, + "sources": [ + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/CMakeFiles/ALL_BUILD$", + "isGenerated": True, + "sourceGroupName": "", + "compileGroupLanguage": None, + "backtrace": [ + { + "file": "^object/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/CMakeFiles/ALL_BUILD\\.rule$", + "isGenerated": True, + "sourceGroupName": "CMake Rules", + "compileGroupLanguage": None, + "backtrace": [ + { + "file": "^object/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "sourceGroups": [ + { + "name": "", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/CMakeFiles/ALL_BUILD$", + ], + }, + { + "name": "CMake Rules", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/CMakeFiles/ALL_BUILD\\.rule$", + ], + }, + ], + "compileGroups": None, + "backtrace": [ + { + "file": "^object/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + "folder": None, + "nameOnDisk": None, + "artifacts": None, + "build": "^object$", + "source": "^object$", + "install": None, + "link": None, + "archive": None, + "dependencies": [ + { + "id": "^ZERO_CHECK::@5ed5358f70faf8d8af7a$", + "backtrace": None, + }, + { + "id": "^c_object_lib::@5ed5358f70faf8d8af7a$", + "backtrace": None, + }, + { + "id": "^c_object_exe::@5ed5358f70faf8d8af7a$", + "backtrace": None, + }, + { + "id": "^cxx_object_lib::@5ed5358f70faf8d8af7a$", + "backtrace": None, + }, + { + "id": "^cxx_object_exe::@5ed5358f70faf8d8af7a$", + "backtrace": None, + }, + ], + }, + { + "name": "ZERO_CHECK", + "id": "^ZERO_CHECK::@5ed5358f70faf8d8af7a$", + "directorySource": "^object$", + "projectName": "Object", + "type": "UTILITY", + "isGeneratorProvided": True, + "sources": [ + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/CMakeFiles/ZERO_CHECK$", + "isGenerated": True, + "sourceGroupName": "", + "compileGroupLanguage": None, + "backtrace": [ + { + "file": "^object/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/CMakeFiles/ZERO_CHECK\\.rule$", + "isGenerated": True, + "sourceGroupName": "CMake Rules", + "compileGroupLanguage": None, + "backtrace": [ + { + "file": "^object/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "sourceGroups": [ + { + "name": "", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/CMakeFiles/ZERO_CHECK$", + ], + }, + { + "name": "CMake Rules", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/CMakeFiles/ZERO_CHECK\\.rule$", + ], + }, + ], + "compileGroups": None, + "backtrace": [ + { + "file": "^object/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + "folder": None, + "nameOnDisk": None, + "artifacts": None, + "build": "^object$", + "source": "^object$", + "install": None, + "link": None, + "archive": None, + "dependencies": None, + }, + { + "name": "c_object_lib", + "id": "^c_object_lib::@5ed5358f70faf8d8af7a$", + "directorySource": "^object$", + "projectName": "Object", + "type": "OBJECT_LIBRARY", + "isGeneratorProvided": None, + "sources": [ + { + "path": "^empty\\.c$", + "isGenerated": None, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "C", + "backtrace": [ + { + "file": "^object/CMakeLists\\.txt$", + "line": 5, + "command": "add_library", + "hasParent": True, + }, + { + "file": "^object/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^empty\\.c$", + ], + }, + ], + "compileGroups": [ + { + "language": "C", + "sourcePaths": [ + "^empty\\.c$", + ], + "includes": None, + "defines": None, + }, + ], + "backtrace": [ + { + "file": "^object/CMakeLists\\.txt$", + "line": 5, + "command": "add_library", + "hasParent": True, + }, + { + "file": "^object/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + "folder": None, + "nameOnDisk": None, + "artifacts": [ + { + "path": "^object/.*/empty(\\.c)?\\.o(bj)?$", + "_dllExtra": False, + }, + ], + "build": "^object$", + "source": "^object$", + "install": None, + "link": None, + "archive": None, + "dependencies": [ + { + "id": "^ZERO_CHECK::@5ed5358f70faf8d8af7a$", + "backtrace": None, + }, + ], + }, + { + "name": "c_object_exe", + "id": "^c_object_exe::@5ed5358f70faf8d8af7a$", + "directorySource": "^object$", + "projectName": "Object", + "type": "EXECUTABLE", + "isGeneratorProvided": None, + "sources": [ + { + "path": "^empty\\.c$", + "isGenerated": None, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "C", + "backtrace": [ + { + "file": "^object/CMakeLists\\.txt$", + "line": 6, + "command": "add_executable", + "hasParent": True, + }, + { + "file": "^object/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/.*/empty(\\.c)?\\.o(bj)?$", + "isGenerated": True, + "sourceGroupName": "Object Libraries", + "compileGroupLanguage": None, + "backtrace": [ + { + "file": "^object/CMakeLists\\.txt$", + "line": 7, + "command": "target_link_libraries", + "hasParent": True, + }, + { + "file": "^object/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^empty\\.c$", + ], + }, + { + "name": "Object Libraries", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/.*/empty(\\.c)?\\.o(bj)?$", + ], + }, + ], + "compileGroups": [ + { + "language": "C", + "sourcePaths": [ + "^empty\\.c$", + ], + "includes": None, + "defines": None, + }, + ], + "backtrace": [ + { + "file": "^object/CMakeLists\\.txt$", + "line": 6, + "command": "add_executable", + "hasParent": True, + }, + { + "file": "^object/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + "folder": None, + "nameOnDisk": "^c_object_exe(\\.exe)?$", + "artifacts": [ + { + "path": "^object/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?c_object_exe(\\.exe)?$", + "_dllExtra": False, + }, + { + "path": "^object/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?c_object_exe\\.pdb$", + "_dllExtra": True, + }, + ], + "build": "^object$", + "source": "^object$", + "install": { + "prefix": "^(/usr/local|[A-Za-z]:.*/codemodel-v2)$", + "destinations": [ + { + "path": "bin", + "backtrace": [ + { + "file": "^object/CMakeLists\\.txt$", + "line": 13, + "command": "install", + "hasParent": True, + }, + { + "file": "^object/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + }, + "link": { + "language": "C", + "lto": None, + }, + "archive": None, + "dependencies": [ + { + "id": "^c_object_lib::@5ed5358f70faf8d8af7a$", + # FIXME: Add a backtrace here when it becomes available. + # You'll know when it's available, because this test will + # fail. + "backtrace": None, + }, + { + "id": "^ZERO_CHECK::@5ed5358f70faf8d8af7a$", + "backtrace": None, + }, + ], + }, + { + "name": "cxx_object_lib", + "id": "^cxx_object_lib::@5ed5358f70faf8d8af7a$", + "directorySource": "^object$", + "projectName": "Object", + "type": "OBJECT_LIBRARY", + "isGeneratorProvided": None, + "sources": [ + { + "path": "^empty\\.cxx$", + "isGenerated": None, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "CXX", + "backtrace": [ + { + "file": "^object/CMakeLists\\.txt$", + "line": 9, + "command": "add_library", + "hasParent": True, + }, + { + "file": "^object/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^empty\\.cxx$", + ], + }, + ], + "compileGroups": [ + { + "language": "CXX", + "sourcePaths": [ + "^empty\\.cxx$", + ], + "includes": None, + "defines": None, + }, + ], + "backtrace": [ + { + "file": "^object/CMakeLists\\.txt$", + "line": 9, + "command": "add_library", + "hasParent": True, + }, + { + "file": "^object/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + "folder": None, + "nameOnDisk": None, + "artifacts": [ + { + "path": "^object/.*/empty(\\.cxx)?\\.o(bj)?$", + "_dllExtra": False, + }, + ], + "build": "^object$", + "source": "^object$", + "install": None, + "link": None, + "archive": None, + "dependencies": [ + { + "id": "^ZERO_CHECK::@5ed5358f70faf8d8af7a$", + "backtrace": None, + }, + ], + }, + { + "name": "cxx_object_exe", + "id": "^cxx_object_exe::@5ed5358f70faf8d8af7a$", + "directorySource": "^object$", + "projectName": "Object", + "type": "EXECUTABLE", + "isGeneratorProvided": None, + "sources": [ + { + "path": "^empty\\.cxx$", + "isGenerated": None, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "CXX", + "backtrace": [ + { + "file": "^object/CMakeLists\\.txt$", + "line": 10, + "command": "add_executable", + "hasParent": True, + }, + { + "file": "^object/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/.*/empty(\\.cxx)?\\.o(bj)?$", + "isGenerated": True, + "sourceGroupName": "Object Libraries", + "compileGroupLanguage": None, + "backtrace": [ + { + "file": "^object/CMakeLists\\.txt$", + "line": 11, + "command": "target_link_libraries", + "hasParent": True, + }, + { + "file": "^object/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^empty\\.cxx$", + ], + }, + { + "name": "Object Libraries", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/.*/empty(\\.cxx)?\\.o(bj)?$", + ], + }, + ], + "compileGroups": [ + { + "language": "CXX", + "sourcePaths": [ + "^empty\\.cxx$", + ], + "includes": None, + "defines": None, + }, + ], + "backtrace": [ + { + "file": "^object/CMakeLists\\.txt$", + "line": 10, + "command": "add_executable", + "hasParent": True, + }, + { + "file": "^object/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + "folder": None, + "nameOnDisk": "^cxx_object_exe(\\.exe)?$", + "artifacts": [ + { + "path": "^object/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_object_exe(\\.exe)?$", + "_dllExtra": False, + }, + { + "path": "^object/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_object_exe\\.pdb$", + "_dllExtra": True, + }, + ], + "build": "^object$", + "source": "^object$", + "install": { + "prefix": "^(/usr/local|[A-Za-z]:.*/codemodel-v2)$", + "destinations": [ + { + "path": "bin", + "backtrace": [ + { + "file": "^object/CMakeLists\\.txt$", + "line": 13, + "command": "install", + "hasParent": True, + }, + { + "file": "^object/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + }, + "link": { + "language": "CXX", + "lto": None, + }, + "archive": None, + "dependencies": [ + { + "id": "^cxx_object_lib::@5ed5358f70faf8d8af7a$", + # FIXME: Add a backtrace here when it becomes available. + # You'll know when it's available, because this test will + # fail. + "backtrace": None, + }, + { + "id": "^ZERO_CHECK::@5ed5358f70faf8d8af7a$", + "backtrace": None, + }, + ], + }, + { + "name": "ALL_BUILD", + "id": "^ALL_BUILD::@ba7eb709d0b48779c6c8$", + "directorySource": "^imported$", + "projectName": "Imported", + "type": "UTILITY", + "isGeneratorProvided": True, + "sources": [ + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/imported/CMakeFiles/ALL_BUILD$", + "isGenerated": True, + "sourceGroupName": "", + "compileGroupLanguage": None, + "backtrace": [ + { + "file": "^imported/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/imported/CMakeFiles/ALL_BUILD\\.rule$", + "isGenerated": True, + "sourceGroupName": "CMake Rules", + "compileGroupLanguage": None, + "backtrace": [ + { + "file": "^imported/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "sourceGroups": [ + { + "name": "", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/imported/CMakeFiles/ALL_BUILD$", + ], + }, + { + "name": "CMake Rules", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/imported/CMakeFiles/ALL_BUILD\\.rule$", + ], + }, + ], + "compileGroups": None, + "backtrace": [ + { + "file": "^imported/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + "folder": None, + "nameOnDisk": None, + "artifacts": None, + "build": "^imported$", + "source": "^imported$", + "install": None, + "link": None, + "archive": None, + "dependencies": [ + { + "id": "^ZERO_CHECK::@ba7eb709d0b48779c6c8$", + "backtrace": None, + }, + { + "id": "^link_imported_exe::@ba7eb709d0b48779c6c8$", + "backtrace": None, + }, + { + "id": "^link_imported_shared_exe::@ba7eb709d0b48779c6c8$", + "backtrace": None, + }, + { + "id": "^link_imported_static_exe::@ba7eb709d0b48779c6c8$", + "backtrace": None, + }, + { + "id": "^link_imported_object_exe::@ba7eb709d0b48779c6c8$", + "backtrace": None, + }, + { + "id": "^link_imported_interface_exe::@ba7eb709d0b48779c6c8$", + "backtrace": None, + }, + ], + }, + { + "name": "ZERO_CHECK", + "id": "^ZERO_CHECK::@ba7eb709d0b48779c6c8$", + "directorySource": "^imported$", + "projectName": "Imported", + "type": "UTILITY", + "isGeneratorProvided": True, + "sources": [ + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/imported/CMakeFiles/ZERO_CHECK$", + "isGenerated": True, + "sourceGroupName": "", + "compileGroupLanguage": None, + "backtrace": [ + { + "file": "^imported/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/imported/CMakeFiles/ZERO_CHECK\\.rule$", + "isGenerated": True, + "sourceGroupName": "CMake Rules", + "compileGroupLanguage": None, + "backtrace": [ + { + "file": "^imported/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "sourceGroups": [ + { + "name": "", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/imported/CMakeFiles/ZERO_CHECK$", + ], + }, + { + "name": "CMake Rules", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/imported/CMakeFiles/ZERO_CHECK\\.rule$", + ], + }, + ], + "compileGroups": None, + "backtrace": [ + { + "file": "^imported/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + "folder": None, + "nameOnDisk": None, + "artifacts": None, + "build": "^imported$", + "source": "^imported$", + "install": None, + "link": None, + "archive": None, + "dependencies": None, + }, + { + "name": "link_imported_exe", + "id": "^link_imported_exe::@ba7eb709d0b48779c6c8$", + "directorySource": "^imported$", + "projectName": "Imported", + "type": "EXECUTABLE", + "isGeneratorProvided": None, + "sources": [ + { + "path": "^empty\\.c$", + "isGenerated": None, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "C", + "backtrace": [ + { + "file": "^imported/CMakeLists\\.txt$", + "line": 5, + "command": "add_executable", + "hasParent": True, + }, + { + "file": "^imported/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^empty\\.c$", + ], + }, + ], + "compileGroups": [ + { + "language": "C", + "sourcePaths": [ + "^empty\\.c$", + ], + "includes": None, + "defines": None, + }, + ], + "backtrace": [ + { + "file": "^imported/CMakeLists\\.txt$", + "line": 5, + "command": "add_executable", + "hasParent": True, + }, + { + "file": "^imported/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + "folder": None, + "nameOnDisk": "^link_imported_exe(\\.exe)?$", + "artifacts": [ + { + "path": "^imported/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?link_imported_exe(\\.exe)?$", + "_dllExtra": False, + }, + { + "path": "^imported/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?link_imported_exe\\.pdb$", + "_dllExtra": True, + }, + ], + "build": "^imported$", + "source": "^imported$", + "install": None, + "link": { + "language": "C", + "lto": None, + }, + "archive": None, + "dependencies": [ + { + "id": "^ZERO_CHECK::@ba7eb709d0b48779c6c8$", + "backtrace": None, + }, + ], + }, + { + "name": "link_imported_shared_exe", + "id": "^link_imported_shared_exe::@ba7eb709d0b48779c6c8$", + "directorySource": "^imported$", + "projectName": "Imported", + "type": "EXECUTABLE", + "isGeneratorProvided": None, + "sources": [ + { + "path": "^empty\\.c$", + "isGenerated": None, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "C", + "backtrace": [ + { + "file": "^imported/CMakeLists\\.txt$", + "line": 9, + "command": "add_executable", + "hasParent": True, + }, + { + "file": "^imported/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^empty\\.c$", + ], + }, + ], + "compileGroups": [ + { + "language": "C", + "sourcePaths": [ + "^empty\\.c$", + ], + "includes": None, + "defines": None, + }, + ], + "backtrace": [ + { + "file": "^imported/CMakeLists\\.txt$", + "line": 9, + "command": "add_executable", + "hasParent": True, + }, + { + "file": "^imported/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + "folder": None, + "nameOnDisk": "^link_imported_shared_exe(\\.exe)?$", + "artifacts": [ + { + "path": "^imported/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?link_imported_shared_exe(\\.exe)?$", + "_dllExtra": False, + }, + { + "path": "^imported/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?link_imported_shared_exe\\.pdb$", + "_dllExtra": True, + }, + ], + "build": "^imported$", + "source": "^imported$", + "install": None, + "link": { + "language": "C", + "lto": None, + }, + "archive": None, + "dependencies": [ + { + "id": "^ZERO_CHECK::@ba7eb709d0b48779c6c8$", + "backtrace": None, + }, + ], + }, + { + "name": "link_imported_static_exe", + "id": "^link_imported_static_exe::@ba7eb709d0b48779c6c8$", + "directorySource": "^imported$", + "projectName": "Imported", + "type": "EXECUTABLE", + "isGeneratorProvided": None, + "sources": [ + { + "path": "^empty\\.c$", + "isGenerated": None, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "C", + "backtrace": [ + { + "file": "^imported/CMakeLists\\.txt$", + "line": 13, + "command": "add_executable", + "hasParent": True, + }, + { + "file": "^imported/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^empty\\.c$", + ], + }, + ], + "compileGroups": [ + { + "language": "C", + "sourcePaths": [ + "^empty\\.c$", + ], + "includes": None, + "defines": None, + }, + ], + "backtrace": [ + { + "file": "^imported/CMakeLists\\.txt$", + "line": 13, + "command": "add_executable", + "hasParent": True, + }, + { + "file": "^imported/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + "folder": None, + "nameOnDisk": "^link_imported_static_exe(\\.exe)?$", + "artifacts": [ + { + "path": "^imported/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?link_imported_static_exe(\\.exe)?$", + "_dllExtra": False, + }, + { + "path": "^imported/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?link_imported_static_exe\\.pdb$", + "_dllExtra": True, + }, + ], + "build": "^imported$", + "source": "^imported$", + "install": None, + "link": { + "language": "C", + "lto": None, + }, + "archive": None, + "dependencies": [ + { + "id": "^ZERO_CHECK::@ba7eb709d0b48779c6c8$", + "backtrace": None, + }, + ], + }, + { + "name": "link_imported_object_exe", + "id": "^link_imported_object_exe::@ba7eb709d0b48779c6c8$", + "directorySource": "^imported$", + "projectName": "Imported", + "type": "EXECUTABLE", + "isGeneratorProvided": None, + "sources": [ + { + "path": "^empty\\.c$", + "isGenerated": None, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "C", + "backtrace": [ + { + "file": "^imported/CMakeLists\\.txt$", + "line": 18, + "command": "add_executable", + "hasParent": True, + }, + { + "file": "^imported/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^empty\\.c$", + ], + }, + ], + "compileGroups": [ + { + "language": "C", + "sourcePaths": [ + "^empty\\.c$", + ], + "includes": None, + "defines": None, + }, + ], + "backtrace": [ + { + "file": "^imported/CMakeLists\\.txt$", + "line": 18, + "command": "add_executable", + "hasParent": True, + }, + { + "file": "^imported/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + "folder": None, + "nameOnDisk": "^link_imported_object_exe(\\.exe)?$", + "artifacts": [ + { + "path": "^imported/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?link_imported_object_exe(\\.exe)?$", + "_dllExtra": False, + }, + { + "path": "^imported/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?link_imported_object_exe\\.pdb$", + "_dllExtra": True, + }, + ], + "build": "^imported$", + "source": "^imported$", + "install": None, + "link": { + "language": "C", + "lto": None, + }, + "archive": None, + "dependencies": [ + { + "id": "^ZERO_CHECK::@ba7eb709d0b48779c6c8$", + "backtrace": None, + }, + ], + }, + { + "name": "link_imported_interface_exe", + "id": "^link_imported_interface_exe::@ba7eb709d0b48779c6c8$", + "directorySource": "^imported$", + "projectName": "Imported", + "type": "EXECUTABLE", + "isGeneratorProvided": None, + "sources": [ + { + "path": "^empty\\.c$", + "isGenerated": None, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "C", + "backtrace": [ + { + "file": "^imported/CMakeLists\\.txt$", + "line": 23, + "command": "add_executable", + "hasParent": True, + }, + { + "file": "^imported/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^empty\\.c$", + ], + }, + ], + "compileGroups": [ + { + "language": "C", + "sourcePaths": [ + "^empty\\.c$", + ], + "includes": None, + "defines": None, + }, + ], + "backtrace": [ + { + "file": "^imported/CMakeLists\\.txt$", + "line": 23, + "command": "add_executable", + "hasParent": True, + }, + { + "file": "^imported/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + "folder": None, + "nameOnDisk": "^link_imported_interface_exe(\\.exe)?$", + "artifacts": [ + { + "path": "^imported/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?link_imported_interface_exe(\\.exe)?$", + "_dllExtra": False, + }, + { + "path": "^imported/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?link_imported_interface_exe\\.pdb$", + "_dllExtra": True, + }, + ], + "build": "^imported$", + "source": "^imported$", + "install": None, + "link": { + "language": "C", + "lto": None, + }, + "archive": None, + "dependencies": [ + { + "id": "^ZERO_CHECK::@ba7eb709d0b48779c6c8$", + "backtrace": None, + }, + ], + }, + { + "name": "ALL_BUILD", + "id": "^ALL_BUILD::@c11385ffed57b860da63$", + "directorySource": "^custom$", + "projectName": "Custom", + "type": "UTILITY", + "isGeneratorProvided": True, + "sources": [ + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/custom/CMakeFiles/ALL_BUILD$", + "isGenerated": True, + "sourceGroupName": "", + "compileGroupLanguage": None, + "backtrace": [ + { + "file": "^custom/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/custom/CMakeFiles/ALL_BUILD\\.rule$", + "isGenerated": True, + "sourceGroupName": "CMake Rules", + "compileGroupLanguage": None, + "backtrace": [ + { + "file": "^custom/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "sourceGroups": [ + { + "name": "", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/custom/CMakeFiles/ALL_BUILD$", + ], + }, + { + "name": "CMake Rules", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/custom/CMakeFiles/ALL_BUILD\\.rule$", + ], + }, + ], + "compileGroups": None, + "backtrace": [ + { + "file": "^custom/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + "folder": None, + "nameOnDisk": None, + "artifacts": None, + "build": "^custom$", + "source": "^custom$", + "install": None, + "link": None, + "archive": None, + "dependencies": [ + { + "id": "^ZERO_CHECK::@c11385ffed57b860da63$", + "backtrace": None, + }, + { + "id": "^custom_exe::@c11385ffed57b860da63$", + "backtrace": None, + }, + ], + }, + { + "name": "ZERO_CHECK", + "id": "^ZERO_CHECK::@c11385ffed57b860da63$", + "directorySource": "^custom$", + "projectName": "Custom", + "type": "UTILITY", + "isGeneratorProvided": True, + "sources": [ + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/custom/CMakeFiles/ZERO_CHECK$", + "isGenerated": True, + "sourceGroupName": "", + "compileGroupLanguage": None, + "backtrace": [ + { + "file": "^custom/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/custom/CMakeFiles/ZERO_CHECK\\.rule$", + "isGenerated": True, + "sourceGroupName": "CMake Rules", + "compileGroupLanguage": None, + "backtrace": [ + { + "file": "^custom/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "sourceGroups": [ + { + "name": "", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/custom/CMakeFiles/ZERO_CHECK$", + ], + }, + { + "name": "CMake Rules", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/custom/CMakeFiles/ZERO_CHECK\\.rule$", + ], + }, + ], + "compileGroups": None, + "backtrace": [ + { + "file": "^custom/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + "folder": None, + "nameOnDisk": None, + "artifacts": None, + "build": "^custom$", + "source": "^custom$", + "install": None, + "link": None, + "archive": None, + "dependencies": None, + }, + { + "name": "custom_tgt", + "id": "^custom_tgt::@c11385ffed57b860da63$", + "directorySource": "^custom$", + "projectName": "Custom", + "type": "UTILITY", + "isGeneratorProvided": None, + "sources": [ + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/custom/CMakeFiles/custom_tgt$", + "isGenerated": True, + "sourceGroupName": "", + "compileGroupLanguage": None, + "backtrace": [ + { + "file": "^custom/CMakeLists\\.txt$", + "line": 3, + "command": "add_custom_target", + "hasParent": True, + }, + { + "file": "^custom/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/(custom/)?CMakeFiles/([0-9a-f]+/)?custom_tgt\\.rule$", + "isGenerated": True, + "sourceGroupName": "CMake Rules", + "compileGroupLanguage": None, + "backtrace": [ + { + "file": "^custom/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "sourceGroups": [ + { + "name": "", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/custom/CMakeFiles/custom_tgt$", + ], + }, + { + "name": "CMake Rules", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/(custom/)?CMakeFiles/([0-9a-f]+/)?custom_tgt\\.rule$", + ], + }, + ], + "compileGroups": None, + "backtrace": [ + { + "file": "^custom/CMakeLists\\.txt$", + "line": 3, + "command": "add_custom_target", + "hasParent": True, + }, + { + "file": "^custom/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + "folder": None, + "nameOnDisk": None, + "artifacts": None, + "build": "^custom$", + "source": "^custom$", + "install": None, + "link": None, + "archive": None, + "dependencies": [ + { + "id": "^ZERO_CHECK::@c11385ffed57b860da63$", + "backtrace": None, + }, + ], + }, + { + "name": "custom_exe", + "id": "^custom_exe::@c11385ffed57b860da63$", + "directorySource": "^custom$", + "projectName": "Custom", + "type": "EXECUTABLE", + "isGeneratorProvided": None, + "sources": [ + { + "path": "^empty\\.c$", + "isGenerated": None, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "C", + "backtrace": [ + { + "file": "^custom/CMakeLists\\.txt$", + "line": 4, + "command": "add_executable", + "hasParent": True, + }, + { + "file": "^custom/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^empty\\.c$", + ], + }, + ], + "compileGroups": [ + { + "language": "C", + "sourcePaths": [ + "^empty\\.c$", + ], + "includes": None, + "defines": None, + }, + ], + "backtrace": [ + { + "file": "^custom/CMakeLists\\.txt$", + "line": 4, + "command": "add_executable", + "hasParent": True, + }, + { + "file": "^custom/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + "folder": None, + "nameOnDisk": "^custom_exe(\\.exe)?$", + "artifacts": [ + { + "path": "^custom/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?custom_exe(\\.exe)?$", + "_dllExtra": False, + }, + { + "path": "^custom/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?custom_exe\\.pdb$", + "_dllExtra": True, + }, + ], + "build": "^custom$", + "source": "^custom$", + "install": None, + "link": { + "language": "C", + "lto": None, + }, + "archive": None, + "dependencies": [ + { + "id": "^custom_tgt::@c11385ffed57b860da63$", + "backtrace": [ + { + "file": "^custom/CMakeLists\\.txt$", + "line": 5, + "command": "add_dependencies", + "hasParent": True, + }, + { + "file": "^custom/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + { + "id": "^ZERO_CHECK::@c11385ffed57b860da63$", + "backtrace": None, + }, + ], + }, + { + "name": "ALL_BUILD", + "id": "^ALL_BUILD::@[0-9a-f]+$", + "directorySource": "^.*/Tests/RunCMake/FileAPIExternalSource$", + "projectName": "External", + "type": "UTILITY", + "isGeneratorProvided": True, + "sources": [ + { + "path": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/CMakeFiles/ALL_BUILD$", + "isGenerated": True, + "sourceGroupName": "", + "compileGroupLanguage": None, + "backtrace": [ + { + "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + { + "path": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/CMakeFiles/ALL_BUILD\\.rule$", + "isGenerated": True, + "sourceGroupName": "CMake Rules", + "compileGroupLanguage": None, + "backtrace": [ + { + "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "sourceGroups": [ + { + "name": "", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/CMakeFiles/ALL_BUILD$", + ], + }, + { + "name": "CMake Rules", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/CMakeFiles/ALL_BUILD\\.rule$", + ], + }, + ], + "compileGroups": None, + "backtrace": [ + { + "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + "folder": None, + "nameOnDisk": None, + "artifacts": None, + "build": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild$", + "source": "^.*/Tests/RunCMake/FileAPIExternalSource$", + "install": None, + "link": None, + "archive": None, + "dependencies": [ + { + "id": "^ZERO_CHECK::@[0-9a-f]+$", + "backtrace": None, + }, + { + "id": "^generated_exe::@[0-9a-f]+$", + "backtrace": None, + }, + ], + }, + { + "name": "ZERO_CHECK", + "id": "^ZERO_CHECK::@[0-9a-f]+$", + "directorySource": "^.*/Tests/RunCMake/FileAPIExternalSource$", + "projectName": "External", + "type": "UTILITY", + "isGeneratorProvided": True, + "sources": [ + { + "path": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/CMakeFiles/ZERO_CHECK$", + "isGenerated": True, + "sourceGroupName": "", + "compileGroupLanguage": None, + "backtrace": [ + { + "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + { + "path": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/CMakeFiles/ZERO_CHECK\\.rule$", + "isGenerated": True, + "sourceGroupName": "CMake Rules", + "compileGroupLanguage": None, + "backtrace": [ + { + "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "sourceGroups": [ + { + "name": "", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/CMakeFiles/ZERO_CHECK$", + ], + }, + { + "name": "CMake Rules", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/CMakeFiles/ZERO_CHECK\\.rule$", + ], + }, + ], + "compileGroups": None, + "backtrace": [ + { + "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + "folder": None, + "nameOnDisk": None, + "artifacts": None, + "build": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild$", + "source": "^.*/Tests/RunCMake/FileAPIExternalSource$", + "install": None, + "link": None, + "archive": None, + "dependencies": None, + }, + { + "name": "generated_exe", + "id": "^generated_exe::@[0-9a-f]+$", + "directorySource": "^.*/Tests/RunCMake/FileAPIExternalSource$", + "projectName": "External", + "type": "EXECUTABLE", + "isGeneratorProvided": None, + "sources": [ + { + "path": "^.*/Tests/RunCMake/FileAPIExternalSource/empty\\.c$", + "isGenerated": None, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "C", + "backtrace": [ + { + "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", + "line": 5, + "command": "add_executable", + "hasParent": True, + }, + { + "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + { + "path": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/generated\\.cxx$", + "isGenerated": True, + "sourceGroupName": "Generated Source Files", + "compileGroupLanguage": "CXX", + "backtrace": [ + { + "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", + "line": 6, + "command": "target_sources", + "hasParent": True, + }, + { + "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPIExternalSource/empty\\.c$", + ], + }, + { + "name": "Generated Source Files", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/generated\\.cxx$", + ], + }, + ], + "compileGroups": [ + { + "language": "C", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPIExternalSource/empty\\.c$", + ], + "includes": [ + { + "path": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild$", + "isSystem": None, + "backtrace": None, + }, + { + "path": "^.*/Tests/RunCMake/FileAPIExternalSource$", + "isSystem": True, + "backtrace": [ + { + "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", + "line": 11, + "command": "target_include_directories", + "hasParent": True, + }, + { + "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "defines": [ + { + "define": "EMPTY_C=1", + "backtrace": None, + }, + { + "define": "SRC_DUMMY", + "backtrace": None, + }, + { + "define": "GENERATED_EXE=1", + "backtrace": [ + { + "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", + "line": 12, + "command": "target_compile_definitions", + "hasParent": True, + }, + { + "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + { + "define": "TGT_DUMMY", + "backtrace": [ + { + "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", + "line": 12, + "command": "target_compile_definitions", + "hasParent": True, + }, + { + "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + }, + { + "language": "CXX", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/generated\\.cxx$", + ], + "includes": [ + { + "path": "^.*/Tests/RunCMake/FileAPIExternalSource$", + "isSystem": True, + "backtrace": [ + { + "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", + "line": 11, + "command": "target_include_directories", + "hasParent": True, + }, + { + "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + "defines": [ + { + "define": "GENERATED_EXE=1", + "backtrace": [ + { + "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", + "line": 12, + "command": "target_compile_definitions", + "hasParent": True, + }, + { + "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + { + "define": "TGT_DUMMY", + "backtrace": [ + { + "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", + "line": 12, + "command": "target_compile_definitions", + "hasParent": True, + }, + { + "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ], + }, + ], + "backtrace": [ + { + "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", + "line": 5, + "command": "add_executable", + "hasParent": True, + }, + { + "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + "folder": None, + "nameOnDisk": "^generated_exe(\\.exe)?$", + "artifacts": [ + { + "path": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?generated_exe(\\.exe)?$", + "_dllExtra": False, + }, + { + "path": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?generated_exe\\.pdb$", + "_dllExtra": True, + }, + ], + "build": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild$", + "source": "^.*/Tests/RunCMake/FileAPIExternalSource$", + "install": None, + "link": { + "language": "CXX", + "lto": None, + }, + "archive": None, + "dependencies": [ + { + "id": "^ZERO_CHECK::@[0-9a-f]+$", + "backtrace": None, + }, + ], + }, + ] + + if not os.path.exists(os.path.join(reply_dir, "..", "..", "..", "..", "ipo_enabled.txt")): + for e in expected: + try: + e["link"]["lto"] = None + except TypeError: # "link" is not a dict, no problem. + pass + try: + e["archive"]["lto"] = None + except TypeError: # "archive" is not a dict, no problem. + pass + + if inSource: + for e in expected: + if e["sources"] is not None: + for s in e["sources"]: + s["path"] = s["path"].replace("^.*/Tests/RunCMake/FileAPI/", "^", 1) + if e["sourceGroups"] is not None: + for g in e["sourceGroups"]: + g["sourcePaths"] = [p.replace("^.*/Tests/RunCMake/FileAPI/", "^", 1) for p in g["sourcePaths"]] + if e["compileGroups"] is not None: + for g in e["compileGroups"]: + g["sourcePaths"] = [p.replace("^.*/Tests/RunCMake/FileAPI/", "^", 1) for p in g["sourcePaths"]] + + if matches(g, "^Visual Studio "): + expected = filter_list(lambda e: e["name"] not in ("ZERO_CHECK") or e["id"] == "^ZERO_CHECK::@6890427a1f51a3e7e1df$", expected) + for e in expected: + if e["type"] == "UTILITY": + if e["id"] == "^ZERO_CHECK::@6890427a1f51a3e7e1df$": + e["sources"] = [ + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/CMakeFiles/([0-9a-f]+/)?generate\\.stamp\\.rule$", + "isGenerated": True, + "sourceGroupName": "CMake Rules", + "compileGroupLanguage": None, + "backtrace": [ + { + "file": "^CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + ] + e["sourceGroups"] = [ + { + "name": "CMake Rules", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/CMakeFiles/([0-9a-f]+/)?generate\\.stamp\\.rule$", + ], + }, + ] + elif e["name"] in ("ALL_BUILD"): + e["sources"] = [] + e["sourceGroups"] = None + if e["dependencies"] is not None: + for d in e["dependencies"]: + if matches(d["id"], "^\\^ZERO_CHECK::@"): + d["id"] = "^ZERO_CHECK::@6890427a1f51a3e7e1df$" + + elif g == "Xcode": + if ';' in os.environ.get("CMAKE_OSX_ARCHITECTURES", ""): + expected = filter_list(lambda e: e["name"] not in ("link_imported_object_exe"), expected) + for e in expected: + e["dependencies"] = filter_list(lambda d: not matches(d["id"], "^\\^link_imported_object_exe::@"), e["dependencies"]) + if e["name"] in ("c_object_lib", "cxx_object_lib"): + e["artifacts"] = None + + else: + for e in expected: + e["dependencies"] = filter_list(lambda d: not matches(d["id"], "^\\^ZERO_CHECK::@"), e["dependencies"]) + + expected = filter_list(lambda t: t["name"] not in ("ALL_BUILD", "ZERO_CHECK"), expected) + + if sys.platform not in ("win32", "cygwin", "msys"): + for e in expected: + e["artifacts"] = filter_list(lambda a: not a["_dllExtra"], e["artifacts"]) + + return expected + +def check_targets(c, g, inSource): + check_list_match(lambda a, e: matches(a["id"], e["id"]), + c["targets"], gen_check_targets(c, g, inSource), + check=check_target(c), + check_exception=lambda a, e: "Target ID: %s" % a["id"], + missing_exception=lambda e: "Target ID: %s" % e["id"], + extra_exception=lambda a: "Target ID: %s" % a["id"]) + +def gen_check_projects(c, g): + expected = [ + { + "name": "codemodel-v2", + "parentName": None, + "childNames": [ + "Alias", + "Custom", + "Cxx", + "Imported", + "Object", + "External", + ], + "directorySources": [ + "^\\.$", + "^dir$", + "^dir/dir$", + ], + "targetIds": [ + "^ALL_BUILD::@6890427a1f51a3e7e1df$", + "^ZERO_CHECK::@6890427a1f51a3e7e1df$", + "^interface_exe::@6890427a1f51a3e7e1df$", + "^c_lib::@6890427a1f51a3e7e1df$", + "^c_exe::@6890427a1f51a3e7e1df$", + "^c_shared_lib::@6890427a1f51a3e7e1df$", + "^c_shared_exe::@6890427a1f51a3e7e1df$", + "^c_static_lib::@6890427a1f51a3e7e1df$", + "^c_static_exe::@6890427a1f51a3e7e1df$", + ], + }, + { + "name": "Cxx", + "parentName": "codemodel-v2", + "childNames": None, + "directorySources": [ + "^cxx$", + ], + "targetIds": [ + "^ALL_BUILD::@a56b12a3f5c0529fb296$", + "^ZERO_CHECK::@a56b12a3f5c0529fb296$", + "^cxx_lib::@a56b12a3f5c0529fb296$", + "^cxx_exe::@a56b12a3f5c0529fb296$", + "^cxx_shared_lib::@a56b12a3f5c0529fb296$", + "^cxx_shared_exe::@a56b12a3f5c0529fb296$", + "^cxx_static_lib::@a56b12a3f5c0529fb296$", + "^cxx_static_exe::@a56b12a3f5c0529fb296$", + ], + }, + { + "name": "Alias", + "parentName": "codemodel-v2", + "childNames": None, + "directorySources": [ + "^alias$", + ], + "targetIds": [ + "^ALL_BUILD::@53632cba2752272bb008$", + "^ZERO_CHECK::@53632cba2752272bb008$", + "^c_alias_exe::@53632cba2752272bb008$", + "^cxx_alias_exe::@53632cba2752272bb008$", + ], + }, + { + "name": "Object", + "parentName": "codemodel-v2", + "childNames": None, + "directorySources": [ + "^object$", + ], + "targetIds": [ + "^ALL_BUILD::@5ed5358f70faf8d8af7a$", + "^ZERO_CHECK::@5ed5358f70faf8d8af7a$", + "^c_object_lib::@5ed5358f70faf8d8af7a$", + "^c_object_exe::@5ed5358f70faf8d8af7a$", + "^cxx_object_lib::@5ed5358f70faf8d8af7a$", + "^cxx_object_exe::@5ed5358f70faf8d8af7a$", + ], + }, + { + "name": "Imported", + "parentName": "codemodel-v2", + "childNames": None, + "directorySources": [ + "^imported$", + ], + "targetIds": [ + "^ALL_BUILD::@ba7eb709d0b48779c6c8$", + "^ZERO_CHECK::@ba7eb709d0b48779c6c8$", + "^link_imported_exe::@ba7eb709d0b48779c6c8$", + "^link_imported_shared_exe::@ba7eb709d0b48779c6c8$", + "^link_imported_static_exe::@ba7eb709d0b48779c6c8$", + "^link_imported_object_exe::@ba7eb709d0b48779c6c8$", + "^link_imported_interface_exe::@ba7eb709d0b48779c6c8$", + ], + }, + { + "name": "Custom", + "parentName": "codemodel-v2", + "childNames": None, + "directorySources": [ + "^custom$", + ], + "targetIds": [ + "^ALL_BUILD::@c11385ffed57b860da63$", + "^ZERO_CHECK::@c11385ffed57b860da63$", + "^custom_tgt::@c11385ffed57b860da63$", + "^custom_exe::@c11385ffed57b860da63$", + ], + }, + { + "name": "External", + "parentName": "codemodel-v2", + "childNames": None, + "directorySources": [ + "^.*/Tests/RunCMake/FileAPIExternalSource$", + ], + "targetIds": [ + "^ALL_BUILD::@[0-9a-f]+$", + "^ZERO_CHECK::@[0-9a-f]+$", + "^generated_exe::@[0-9a-f]+$", + ], + }, + ] + + if matches(g, "^Visual Studio "): + for e in expected: + if e["parentName"] is not None: + e["targetIds"] = filter_list(lambda t: not matches(t, "^\\^ZERO_CHECK"), e["targetIds"]) + + elif g == "Xcode": + if ';' in os.environ.get("CMAKE_OSX_ARCHITECTURES", ""): + for e in expected: + e["targetIds"] = filter_list(lambda t: not matches(t, "^\\^(link_imported_object_exe)"), e["targetIds"]) + + else: + for e in expected: + e["targetIds"] = filter_list(lambda t: not matches(t, "^\\^(ALL_BUILD|ZERO_CHECK)"), e["targetIds"]) + + return expected + +def check_projects(c, g): + check_list_match(lambda a, e: is_string(a["name"], e["name"]), c["projects"], gen_check_projects(c, g), + check=check_project(c), + check_exception=lambda a, e: "Project name: %s" % a["name"], + missing_exception=lambda e: "Project name: %s" % e["name"], + extra_exception=lambda a: "Project name: %s" % a["name"]) + +def check_object_codemodel_configuration(c, g, inSource): + assert sorted(c.keys()) == ["directories", "name", "projects", "targets"] + assert is_string(c["name"]) + check_directories(c, g) + check_targets(c, g, inSource) + check_projects(c, g) + +def check_object_codemodel(g): + def _check(o): + assert sorted(o.keys()) == ["configurations", "kind", "paths", "version"] + # The "kind" and "version" members are handled by check_index_object. + assert is_dict(o["paths"]) + assert sorted(o["paths"].keys()) == ["build", "source"] + assert matches(o["paths"]["build"], "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build$") + assert matches(o["paths"]["source"], "^.*/Tests/RunCMake/FileAPI$") + + inSource = os.path.dirname(o["paths"]["build"]) == o["paths"]["source"] + + if matches(g, "^(Visual Studio |Xcode$)"): + assert sorted([c["name"] for c in o["configurations"]]) == ["Debug", "MinSizeRel", "RelWithDebInfo", "Release"] + else: + assert len(o["configurations"]) == 1 + assert o["configurations"][0]["name"] in ("", "Debug", "Release", "RelWithDebInfo", "MinSizeRel") + + for c in o["configurations"]: + check_object_codemodel_configuration(c, g, inSource) + return _check + +assert is_dict(index) +assert sorted(index.keys()) == ["cmake", "objects", "reply"] +check_objects(index["objects"], index["cmake"]["generator"]["name"]) diff --git a/Tests/RunCMake/FileAPI/codemodel-v2.cmake b/Tests/RunCMake/FileAPI/codemodel-v2.cmake new file mode 100644 index 0000000..72073d5 --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2.cmake @@ -0,0 +1,35 @@ +enable_language(C) + +include("${CMAKE_CURRENT_LIST_DIR}/include_test.cmake") + +add_library(c_lib empty.c) +add_executable(c_exe empty.c) +target_link_libraries(c_exe PRIVATE c_lib) + +add_library(c_shared_lib SHARED empty.c) +add_executable(c_shared_exe empty.c) +target_link_libraries(c_shared_exe PRIVATE c_shared_lib) + +add_library(c_static_lib STATIC empty.c) +add_executable(c_static_exe empty.c) +target_link_libraries(c_static_exe PRIVATE c_static_lib) + +add_subdirectory(cxx) +add_subdirectory(alias) +add_subdirectory(object) +add_subdirectory(imported) +add_subdirectory(custom) +add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/../FileAPIExternalSource" "${CMAKE_CURRENT_BINARY_DIR}/../FileAPIExternalBuild") +add_subdirectory(dir) + +set_property(TARGET c_shared_lib PROPERTY LIBRARY_OUTPUT_DIRECTORY lib) +set_property(TARGET c_shared_lib PROPERTY RUNTIME_OUTPUT_DIRECTORY lib) + +include(CheckIPOSupported) +check_ipo_supported(RESULT _ipo LANGUAGES C) +if(_ipo) + set_property(TARGET c_shared_lib PROPERTY INTERPROCEDURAL_OPTIMIZATION ON) + set_property(TARGET c_shared_exe PROPERTY INTERPROCEDURAL_OPTIMIZATION ON) + set_property(TARGET c_static_lib PROPERTY INTERPROCEDURAL_OPTIMIZATION ON) + file(WRITE "${CMAKE_BINARY_DIR}/ipo_enabled.txt" "") +endif() diff --git a/Tests/RunCMake/FileAPI/custom/CMakeLists.txt b/Tests/RunCMake/FileAPI/custom/CMakeLists.txt new file mode 100644 index 0000000..1cdf5c2 --- /dev/null +++ b/Tests/RunCMake/FileAPI/custom/CMakeLists.txt @@ -0,0 +1,5 @@ +project(Custom) + +add_custom_target(custom_tgt COMMAND ${CMAKE_COMMAND} -E echo "Building custom_tgt") +add_executable(custom_exe ../empty.c) +add_dependencies(custom_exe custom_tgt) diff --git a/Tests/RunCMake/FileAPI/cxx/CMakeLists.txt b/Tests/RunCMake/FileAPI/cxx/CMakeLists.txt new file mode 100644 index 0000000..29b61b8 --- /dev/null +++ b/Tests/RunCMake/FileAPI/cxx/CMakeLists.txt @@ -0,0 +1,15 @@ +project(Cxx) +enable_language(CXX) + +add_library(cxx_lib ../empty.cxx) +add_executable(cxx_exe ../empty.cxx) +target_link_libraries(cxx_exe PRIVATE cxx_lib) +set_property(TARGET cxx_exe PROPERTY FOLDER bin) + +add_library(cxx_shared_lib SHARED ../empty.cxx) +add_executable(cxx_shared_exe ../empty.cxx) +target_link_libraries(cxx_shared_exe PRIVATE cxx_shared_lib) + +add_library(cxx_static_lib STATIC ../empty.cxx) +add_executable(cxx_static_exe ../empty.cxx) +target_link_libraries(cxx_static_exe PRIVATE cxx_static_lib) diff --git a/Tests/RunCMake/FileAPI/dir/CMakeLists.txt b/Tests/RunCMake/FileAPI/dir/CMakeLists.txt new file mode 100644 index 0000000..780445d --- /dev/null +++ b/Tests/RunCMake/FileAPI/dir/CMakeLists.txt @@ -0,0 +1 @@ +add_subdirectory(dir) diff --git a/Tests/RunCMake/FileAPI/dir/dir/CMakeLists.txt b/Tests/RunCMake/FileAPI/dir/dir/CMakeLists.txt new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/FileAPI/dir/dir/CMakeLists.txt diff --git a/Tests/RunCMake/FileAPI/dir/dirtest.cmake b/Tests/RunCMake/FileAPI/dir/dirtest.cmake new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/FileAPI/dir/dirtest.cmake diff --git a/Tests/RunCMake/FileAPI/empty.c b/Tests/RunCMake/FileAPI/empty.c new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/FileAPI/empty.c diff --git a/Tests/RunCMake/FileAPI/empty.cxx b/Tests/RunCMake/FileAPI/empty.cxx new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/FileAPI/empty.cxx diff --git a/Tests/RunCMake/FileAPI/imported/CMakeLists.txt b/Tests/RunCMake/FileAPI/imported/CMakeLists.txt new file mode 100644 index 0000000..d36d88b --- /dev/null +++ b/Tests/RunCMake/FileAPI/imported/CMakeLists.txt @@ -0,0 +1,24 @@ +project(Imported) + +add_library(imported_lib UNKNOWN IMPORTED) +add_executable(imported_exe IMPORTED) +add_executable(link_imported_exe ../empty.c) +target_link_libraries(link_imported_exe PRIVATE imported_lib) + +add_library(imported_shared_lib SHARED IMPORTED) +add_executable(link_imported_shared_exe ../empty.c) +target_link_libraries(link_imported_shared_exe PRIVATE imported_shared_lib) + +add_library(imported_static_lib STATIC IMPORTED) +add_executable(link_imported_static_exe ../empty.c) +target_link_libraries(link_imported_static_exe PRIVATE imported_static_lib) + +if(NOT CMAKE_GENERATOR STREQUAL "Xcode" OR NOT CMAKE_OSX_ARCHITECTURES MATCHES "[;$]") + add_library(imported_object_lib OBJECT IMPORTED) + add_executable(link_imported_object_exe ../empty.c) + target_link_libraries(link_imported_object_exe PRIVATE imported_object_lib) +endif() + +add_library(imported_interface_lib INTERFACE IMPORTED) +add_executable(link_imported_interface_exe ../empty.c) +target_link_libraries(link_imported_interface_exe PRIVATE imported_interface_lib) diff --git a/Tests/RunCMake/FileAPI/include_test.cmake b/Tests/RunCMake/FileAPI/include_test.cmake new file mode 100644 index 0000000..c74d264 --- /dev/null +++ b/Tests/RunCMake/FileAPI/include_test.cmake @@ -0,0 +1,9 @@ +add_library(interface_lib INTERFACE) +target_compile_definitions(interface_lib INTERFACE COMPILED_WITH_INTERFACE_LIB) +add_executable(interface_exe empty.c) +target_link_libraries(interface_exe PRIVATE inteface_lib) +set_property(TARGET interface_exe PROPERTY ENABLE_EXPORTS ON) +set_property(TARGET interface_exe PROPERTY RUNTIME_OUTPUT_DIRECTORY bin) +set_property(TARGET interface_exe PROPERTY ARCHIVE_OUTPUT_DIRECTORY lib) +set_property(TARGET interface_exe PROPERTY OUTPUT_NAME my_interface_exe) +set_property(TARGET interface_exe PROPERTY SUFFIX .myexe) diff --git a/Tests/RunCMake/FileAPI/object/CMakeLists.txt b/Tests/RunCMake/FileAPI/object/CMakeLists.txt new file mode 100644 index 0000000..9773b81 --- /dev/null +++ b/Tests/RunCMake/FileAPI/object/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_minimum_required(VERSION 3.13) +project(Object) +enable_language(CXX) + +add_library(c_object_lib OBJECT ../empty.c) +add_executable(c_object_exe ../empty.c) +target_link_libraries(c_object_exe PRIVATE c_object_lib) + +add_library(cxx_object_lib OBJECT ../empty.cxx) +add_executable(cxx_object_exe ../empty.cxx) +target_link_libraries(cxx_object_exe PRIVATE cxx_object_lib) + +install(TARGETS c_object_exe cxx_object_exe DESTINATION bin) diff --git a/Tests/RunCMake/FileAPIDummyFile.cmake b/Tests/RunCMake/FileAPIDummyFile.cmake new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/FileAPIDummyFile.cmake diff --git a/Tests/RunCMake/FileAPIExternalSource/CMakeLists.txt b/Tests/RunCMake/FileAPIExternalSource/CMakeLists.txt new file mode 100644 index 0000000..f5670a7 --- /dev/null +++ b/Tests/RunCMake/FileAPIExternalSource/CMakeLists.txt @@ -0,0 +1,12 @@ +project(External) +enable_language(CXX) + +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/generated.cxx" "") +add_executable(generated_exe empty.c) +target_sources(generated_exe PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/generated.cxx") +source_group("Generated Source Files" FILES "${CMAKE_CURRENT_BINARY_DIR}/generated.cxx") +set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/generated.cxx" PROPERTY GENERATED ON) +set_property(SOURCE empty.c PROPERTY COMPILE_DEFINITIONS EMPTY_C=1 SRC_DUMMY) +set_property(SOURCE empty.c PROPERTY INCLUDE_DIRECTORIES "${CMAKE_CURRENT_BINARY_DIR}") +target_include_directories(generated_exe SYSTEM PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") +target_compile_definitions(generated_exe PRIVATE GENERATED_EXE=1 -DTGT_DUMMY) diff --git a/Tests/RunCMake/FileAPIExternalSource/empty.c b/Tests/RunCMake/FileAPIExternalSource/empty.c new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/FileAPIExternalSource/empty.c diff --git a/Tests/RunCMake/FindBoost/NoCXX-stderr.txt b/Tests/RunCMake/FindBoost/NoCXX-stderr.txt new file mode 100644 index 0000000..8d98f9d --- /dev/null +++ b/Tests/RunCMake/FindBoost/NoCXX-stderr.txt @@ -0,0 +1 @@ +.* diff --git a/Tests/RunCMake/FindBoost/NoCXX.cmake b/Tests/RunCMake/FindBoost/NoCXX.cmake new file mode 100644 index 0000000..04b9cac --- /dev/null +++ b/Tests/RunCMake/FindBoost/NoCXX.cmake @@ -0,0 +1 @@ +find_package(Boost) diff --git a/Tests/RunCMake/FindBoost/RunCMakeTest.cmake b/Tests/RunCMake/FindBoost/RunCMakeTest.cmake index a153ae1..5d0577b 100644 --- a/Tests/RunCMake/FindBoost/RunCMakeTest.cmake +++ b/Tests/RunCMake/FindBoost/RunCMakeTest.cmake @@ -1,3 +1,4 @@ include(RunCMake) run_cmake(CMakePackage) +run_cmake(NoCXX) diff --git a/Tests/RunCMake/GeneratorExpression/CMP0085-NEW-check.cmake b/Tests/RunCMake/GeneratorExpression/CMP0085-NEW-check.cmake new file mode 100644 index 0000000..520bf3d --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/CMP0085-NEW-check.cmake @@ -0,0 +1,6 @@ +file(READ "${RunCMake_TEST_BINARY_DIR}/CMP0085-NEW-generated.txt" content) + +set(expected "101011") +if(NOT content STREQUAL expected) + set(RunCMake_TEST_FAILED "actual content:\n [[${content}]]\nbut expected:\n [[${expected}]]") +endif() diff --git a/Tests/RunCMake/GeneratorExpression/CMP0085-NEW.cmake b/Tests/RunCMake/GeneratorExpression/CMP0085-NEW.cmake new file mode 100644 index 0000000..ee85c0d --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/CMP0085-NEW.cmake @@ -0,0 +1,4 @@ +cmake_policy(SET CMP0070 NEW) +file(GENERATE OUTPUT CMP0085-NEW-generated.txt CONTENT + "$<IN_LIST:,>$<IN_LIST:,a>$<IN_LIST:,;a>$<IN_LIST:a,>$<IN_LIST:a,a>$<IN_LIST:a,;a>" + ) diff --git a/Tests/RunCMake/GeneratorExpression/CMP0085-OLD-check.cmake b/Tests/RunCMake/GeneratorExpression/CMP0085-OLD-check.cmake new file mode 100644 index 0000000..c387db7 --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/CMP0085-OLD-check.cmake @@ -0,0 +1,6 @@ +file(READ "${RunCMake_TEST_BINARY_DIR}/CMP0085-OLD-generated.txt" content) + +set(expected "000011") +if(NOT content STREQUAL expected) + set(RunCMake_TEST_FAILED "actual content:\n [[${content}]]\nbut expected:\n [[${expected}]]") +endif() diff --git a/Tests/RunCMake/GeneratorExpression/CMP0085-OLD.cmake b/Tests/RunCMake/GeneratorExpression/CMP0085-OLD.cmake new file mode 100644 index 0000000..31b6a51 --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/CMP0085-OLD.cmake @@ -0,0 +1,4 @@ +cmake_policy(SET CMP0070 NEW) +file(GENERATE OUTPUT CMP0085-OLD-generated.txt CONTENT + "$<IN_LIST:,>$<IN_LIST:,a>$<IN_LIST:,;a>$<IN_LIST:a,>$<IN_LIST:a,a>$<IN_LIST:a,;a>" + ) diff --git a/Tests/RunCMake/GeneratorExpression/CMP0085-WARN-check.cmake b/Tests/RunCMake/GeneratorExpression/CMP0085-WARN-check.cmake new file mode 100644 index 0000000..f7bcf0f --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/CMP0085-WARN-check.cmake @@ -0,0 +1,6 @@ +file(READ "${RunCMake_TEST_BINARY_DIR}/CMP0085-WARN-generated.txt" content) + +set(expected "000011") +if(NOT content STREQUAL expected) + set(RunCMake_TEST_FAILED "actual content:\n [[${content}]]\nbut expected:\n [[${expected}]]") +endif() diff --git a/Tests/RunCMake/GeneratorExpression/CMP0085-WARN-stderr.txt b/Tests/RunCMake/GeneratorExpression/CMP0085-WARN-stderr.txt new file mode 100644 index 0000000..81bd450 --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/CMP0085-WARN-stderr.txt @@ -0,0 +1,33 @@ +CMake Warning \(dev\) at CMP0085-WARN\.cmake:[0-9]+ \(file\): + Policy CMP0085 is not set: \$<IN_LIST:\.\.\.> handles empty list items\. Run + "cmake --help-policy CMP0085" for policy details\. Use the cmake_policy + command to set the policy and suppress this warning\. + + Search Item: + + "" + + List: + + "" + +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\) +This warning is for project developers\. Use -Wno-dev to suppress it\. + +CMake Warning \(dev\) at CMP0085-WARN\.cmake:[0-9]+ \(file\): + Policy CMP0085 is not set: \$<IN_LIST:\.\.\.> handles empty list items\. Run + "cmake --help-policy CMP0085" for policy details\. Use the cmake_policy + command to set the policy and suppress this warning\. + + Search Item: + + "" + + List: + + ";a" + +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\) +This warning is for project developers\. Use -Wno-dev to suppress it\. diff --git a/Tests/RunCMake/GeneratorExpression/CMP0085-WARN.cmake b/Tests/RunCMake/GeneratorExpression/CMP0085-WARN.cmake new file mode 100644 index 0000000..59c7826 --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/CMP0085-WARN.cmake @@ -0,0 +1,4 @@ +cmake_policy(SET CMP0070 NEW) +file(GENERATE OUTPUT CMP0085-WARN-generated.txt CONTENT + "$<IN_LIST:,>$<IN_LIST:,a>$<IN_LIST:,;a>$<IN_LIST:a,>$<IN_LIST:a,a>$<IN_LIST:a,;a>" + ) diff --git a/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake b/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake index 3905c5f..013117e 100644 --- a/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake +++ b/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake @@ -61,3 +61,13 @@ if(LINKER_SUPPORTS_PDB) else() run_cmake(NonValidCompiler-TARGET_PDB_FILE) endif() + +set(RunCMake_TEST_OPTIONS -DCMAKE_POLICY_DEFAULT_CMP0085:STRING=OLD) +run_cmake(CMP0085-OLD) +unset(RunCMake_TEST_OPTIONS) + +run_cmake(CMP0085-WARN) + +set(RunCMake_TEST_OPTIONS -DCMAKE_POLICY_DEFAULT_CMP0085:STRING=NEW) +run_cmake(CMP0085-NEW) +unset(RunCMake_TEST_OPTIONS) diff --git a/Tests/RunCMake/GetPrerequisites/ExecutableScripts-stdout.txt b/Tests/RunCMake/GetPrerequisites/ExecutableScripts-stdout.txt new file mode 100644 index 0000000..5a353d8 --- /dev/null +++ b/Tests/RunCMake/GetPrerequisites/ExecutableScripts-stdout.txt @@ -0,0 +1,3 @@ +-- GetPrequisites\(.*script.sh\) : ignoring script file +-- GetPrequisites\(.*script.bat\) : ignoring script file +-- GetPrequisites\(.*script\) : ignoring script file diff --git a/Tests/RunCMake/GetPrerequisites/ExecutableScripts.cmake b/Tests/RunCMake/GetPrerequisites/ExecutableScripts.cmake new file mode 100644 index 0000000..d1bc9b1 --- /dev/null +++ b/Tests/RunCMake/GetPrerequisites/ExecutableScripts.cmake @@ -0,0 +1,19 @@ +include(GetPrerequisites) + +function(check_script script) + set(prereqs "") + get_prerequisites(${script} prereqs 1 1 "" "") + if(NOT "${prereqs}" STREQUAL "") + message(FATAL_ERROR "Prerequisites for ${script} not empty") + endif() +endfunction() + +# Should not throw any errors +# Regular executable +get_prerequisites(${CMAKE_COMMAND} cmake_prereqs 1 1 "" "") +# Shell script +check_script(${CMAKE_CURRENT_LIST_DIR}/script.sh) +# Batch script +check_script(${CMAKE_CURRENT_LIST_DIR}/script.bat) +# Shell script without extension +check_script(${CMAKE_CURRENT_LIST_DIR}/script) diff --git a/Tests/RunCMake/GetPrerequisites/RunCMakeTest.cmake b/Tests/RunCMake/GetPrerequisites/RunCMakeTest.cmake index 3856c54..a635e38 100644 --- a/Tests/RunCMake/GetPrerequisites/RunCMakeTest.cmake +++ b/Tests/RunCMake/GetPrerequisites/RunCMakeTest.cmake @@ -1,3 +1,4 @@ include(RunCMake) run_cmake_command(TargetMissing ${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR}/TargetMissing.cmake) +run_cmake_command(ExecutableScripts ${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR}/ExecutableScripts.cmake) diff --git a/Tests/RunCMake/GetPrerequisites/script b/Tests/RunCMake/GetPrerequisites/script new file mode 100755 index 0000000..23bf47c --- /dev/null +++ b/Tests/RunCMake/GetPrerequisites/script @@ -0,0 +1,3 @@ +#!/bin/bash + +echo "Hello World" diff --git a/Tests/RunCMake/GetPrerequisites/script.bat b/Tests/RunCMake/GetPrerequisites/script.bat new file mode 100755 index 0000000..dbb0ec2 --- /dev/null +++ b/Tests/RunCMake/GetPrerequisites/script.bat @@ -0,0 +1,3 @@ +@echo off + +echo "Hello world" diff --git a/Tests/RunCMake/GetPrerequisites/script.sh b/Tests/RunCMake/GetPrerequisites/script.sh new file mode 100755 index 0000000..23bf47c --- /dev/null +++ b/Tests/RunCMake/GetPrerequisites/script.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +echo "Hello World" diff --git a/Tests/RunCMake/Languages/ExternalCUDA.cmake b/Tests/RunCMake/Languages/ExternalCUDA.cmake new file mode 100644 index 0000000..3afa93e --- /dev/null +++ b/Tests/RunCMake/Languages/ExternalCUDA.cmake @@ -0,0 +1,8 @@ +enable_language(C) + +add_library(ext_cuda IMPORTED STATIC) +set_property(TARGET ext_cuda PROPERTY IMPORTED_LOCATION "/does_not_exist") +set_property(TARGET ext_cuda PROPERTY IMPORTED_LINK_INTERFACE_LANGUAGES "CUDA") + +add_executable(main empty.c) +target_link_libraries(main ext_cuda) diff --git a/Tests/RunCMake/Languages/RunCMakeTest.cmake b/Tests/RunCMake/Languages/RunCMakeTest.cmake index 732baae..2a534b3 100644 --- a/Tests/RunCMake/Languages/RunCMakeTest.cmake +++ b/Tests/RunCMake/Languages/RunCMakeTest.cmake @@ -6,3 +6,5 @@ run_cmake(link-libraries-TARGET_FILE-genex) run_cmake(link-libraries-TARGET_FILE-genex-ok) run_cmake(DetermineFail) + +run_cmake(ExternalCUDA) diff --git a/Tests/RunCMake/Languages/empty.c b/Tests/RunCMake/Languages/empty.c new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/Languages/empty.c diff --git a/Tests/RunCMake/ObjectLibrary/RunCMakeTest.cmake b/Tests/RunCMake/ObjectLibrary/RunCMakeTest.cmake index c73732f..6ca33b8 100644 --- a/Tests/RunCMake/ObjectLibrary/RunCMakeTest.cmake +++ b/Tests/RunCMake/ObjectLibrary/RunCMakeTest.cmake @@ -45,6 +45,7 @@ run_object_lib_build2(LinkObjRHSObject) run_object_lib_build(LinkObjRHSShared2) run_object_lib_build(LinkObjRHSStatic2) run_object_lib_build2(LinkObjRHSObject2) +run_object_lib_build(TransitiveDependencies) run_cmake(MissingSource) run_cmake(ObjWithObj) diff --git a/Tests/RunCMake/ObjectLibrary/TransitiveDependencies.cmake b/Tests/RunCMake/ObjectLibrary/TransitiveDependencies.cmake new file mode 100644 index 0000000..e41cf2e --- /dev/null +++ b/Tests/RunCMake/ObjectLibrary/TransitiveDependencies.cmake @@ -0,0 +1,7 @@ +add_library(lib1 STATIC depends_obj0.c) +add_library(lib2 OBJECT a.c) +target_link_libraries(lib2 PRIVATE lib1) + +add_executable(test exe2.c) + +target_link_libraries(test PUBLIC lib2) diff --git a/Tests/RunCMake/ObjectLibrary/exe2.c b/Tests/RunCMake/ObjectLibrary/exe2.c new file mode 100644 index 0000000..66e0caf --- /dev/null +++ b/Tests/RunCMake/ObjectLibrary/exe2.c @@ -0,0 +1,6 @@ +extern int myobj_foo(void); + +int main(void) +{ + return myobj_foo(); +} diff --git a/Tests/RunCMake/PositionIndependentCode/CMP0083.cmake b/Tests/RunCMake/PositionIndependentCode/CMP0083.cmake index 9713ea4..749ac79 100644 --- a/Tests/RunCMake/PositionIndependentCode/CMP0083.cmake +++ b/Tests/RunCMake/PositionIndependentCode/CMP0083.cmake @@ -6,6 +6,8 @@ add_executable (cmp0083_ref main.cpp) set (CMAKE_POSITION_INDEPENDENT_CODE ON) cmake_policy(SET CMP0083 NEW) +include(CheckPIESupported) +check_pie_supported() add_executable (cmp0083_new_pie main.cpp) diff --git a/Tests/RunCMake/PositionIndependentCode/CheckPIESupported.cmake b/Tests/RunCMake/PositionIndependentCode/CheckPIESupported.cmake index 1e0a2c9..61e1b6d 100644 --- a/Tests/RunCMake/PositionIndependentCode/CheckPIESupported.cmake +++ b/Tests/RunCMake/PositionIndependentCode/CheckPIESupported.cmake @@ -1,11 +1,17 @@ -if (CMAKE_CXX_LINK_OPTIONS_PIE) +cmake_policy(SET CMP0083 NEW) + +include (CheckPIESupported) + +check_pie_supported() + +if (CMAKE_CXX_LINK_PIE_SUPPORTED) file(WRITE "${PIE_SUPPORTED}" "\nset(PIE_SUPPORTED TRUE)\n") else() file(WRITE "${PIE_SUPPORTED}" "\nset(PIE_SUPPORTED FALSE)\n") endif() -if (CMAKE_CXX_LINK_OPTIONS_NO_PIE) +if (CMAKE_CXX_LINK_NO_PIE_SUPPORTED) file(APPEND "${PIE_SUPPORTED}" "\nset(NO_PIE_SUPPORTED TRUE)\n") else() file(APPEND "${PIE_SUPPORTED}" "\nset(NO_PIE_SUPPORTED FALSE)\n") diff --git a/Tests/RunCMake/PositionIndependentCode/PIE.cmake b/Tests/RunCMake/PositionIndependentCode/PIE.cmake index a9d579d..16ed89c 100644 --- a/Tests/RunCMake/PositionIndependentCode/PIE.cmake +++ b/Tests/RunCMake/PositionIndependentCode/PIE.cmake @@ -1,6 +1,9 @@ cmake_policy(SET CMP0083 NEW) +include(CheckPIESupported) +check_pie_supported() + add_executable (pie_on main.cpp) set_property(TARGET pie_on PROPERTY POSITION_INDEPENDENT_CODE ON) diff --git a/Tests/RunCMake/README.rst b/Tests/RunCMake/README.rst index 08b51d9..d8b43fe 100644 --- a/Tests/RunCMake/README.rst +++ b/Tests/RunCMake/README.rst @@ -65,3 +65,14 @@ but do not actually build anything. To add a test: Top of test binary tree and an failure must store a message in ``RunCMake_TEST_FAILED``. + +To speed up local testing, you can choose to run only a subset of +``run_cmake()`` tests in a ``RunCMakeTest.cmake`` script by using the +``RunCMake_TEST_FILTER`` environment variable. If this variable is set, +it is treated as a regular expression, and any tests whose names don't +match the regular expression are not run. For example:: + + $ RunCMake_TEST_FILTER="^example" ctest -R '^RunCMake\.Example$' + +This will only run subtests in ``RunCMake.Example`` that start with +``example``. diff --git a/Tests/RunCMake/RunCMake.cmake b/Tests/RunCMake/RunCMake.cmake index 69c96cc..ce71677 100644 --- a/Tests/RunCMake/RunCMake.cmake +++ b/Tests/RunCMake/RunCMake.cmake @@ -9,6 +9,10 @@ foreach(arg endforeach() function(run_cmake test) + if(DEFINED ENV{RunCMake_TEST_FILTER} AND NOT test MATCHES "$ENV{RunCMake_TEST_FILTER}") + return() + endif() + set(top_src "${RunCMake_SOURCE_DIR}") set(top_bin "${RunCMake_BINARY_DIR}") if(EXISTS ${top_src}/${test}-result.txt) @@ -45,6 +49,11 @@ function(run_cmake test) file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}") endif() file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}") + if(RunCMake-prep-file AND EXISTS ${top_src}/${RunCMake-prep-file}) + include(${top_src}/${RunCMake-prep-file}) + else() + include(${top_src}/${test}-prep.cmake OPTIONAL) + endif() if(NOT DEFINED RunCMake_TEST_OPTIONS) set(RunCMake_TEST_OPTIONS "") endif() @@ -65,6 +74,13 @@ function(run_cmake test) else() set(maybe_timeout "") endif() + if(RunCMake-stdin-file AND EXISTS ${top_src}/${RunCMake-stdin-file}) + set(maybe_input_file INPUT_FILE ${top_src}/${RunCMake-stdin-file}) + elseif(EXISTS ${top_src}/${test}-stdin.txt) + set(maybe_input_file INPUT_FILE ${top_src}/${test}-stdin.txt) + else() + set(maybe_input_file "") + endif() if(RunCMake_TEST_COMMAND) execute_process( COMMAND ${RunCMake_TEST_COMMAND} @@ -74,6 +90,7 @@ function(run_cmake test) RESULT_VARIABLE actual_result ENCODING UTF8 ${maybe_timeout} + ${maybe_input_file} ) else() if(RunCMake_GENERATOR_INSTANCE) @@ -96,6 +113,7 @@ function(run_cmake test) RESULT_VARIABLE actual_result ENCODING UTF8 ${maybe_timeout} + ${maybe_input_file} ) endif() set(msg "") diff --git a/Tests/RunCMake/RunCTest.cmake b/Tests/RunCMake/RunCTest.cmake index 89e16ee..98fdf20 100644 --- a/Tests/RunCMake/RunCTest.cmake +++ b/Tests/RunCMake/RunCTest.cmake @@ -3,8 +3,12 @@ include(RunCMake) function(run_ctest CASE_NAME) configure_file(${RunCMake_SOURCE_DIR}/test.cmake.in ${RunCMake_BINARY_DIR}/${CASE_NAME}/test.cmake @ONLY) - configure_file(${RunCMake_SOURCE_DIR}/CTestConfig.cmake.in - ${RunCMake_BINARY_DIR}/${CASE_NAME}/CTestConfig.cmake @ONLY) + if(EXISTS "${RunCMake_SOURCE_DIR}/CTestConfig.cmake.in") + configure_file(${RunCMake_SOURCE_DIR}/CTestConfig.cmake.in + ${RunCMake_BINARY_DIR}/${CASE_NAME}/CTestConfig.cmake @ONLY) + else() + file(REMOVE ${RunCMake_BINARY_DIR}/${CASE_NAME}/CTestConfig.cmake) + endif() configure_file(${RunCMake_SOURCE_DIR}/CMakeLists.txt.in ${RunCMake_BINARY_DIR}/${CASE_NAME}/CMakeLists.txt @ONLY) run_cmake_command(${CASE_NAME} ${CMAKE_CTEST_COMMAND} diff --git a/Tests/RunCMake/UseSWIG/CMP0078-WARN-stderr.txt b/Tests/RunCMake/UseSWIG/CMP0078-WARN-stderr.txt index f0ed577..d89d174 100644 --- a/Tests/RunCMake/UseSWIG/CMP0078-WARN-stderr.txt +++ b/Tests/RunCMake/UseSWIG/CMP0078-WARN-stderr.txt @@ -4,7 +4,7 @@ CMake Warning \(dev\) at .*/Modules/UseSWIG\.cmake:[0-9]+ \(message\): command to set the policy and suppress this warning\. Call Stack \(most recent call first\): - CMP0078-common\.cmake:6 \(swig_add_library\) + CMP0078-common\.cmake:8 \(swig_add_library\) CMP0078-WARN\.cmake:1 \(include\) CMakeLists\.txt:3 \(include\) This warning is for project developers. Use -Wno-dev to suppress it.$ diff --git a/Tests/RunCMake/UseSWIG/CMP0078-common.cmake b/Tests/RunCMake/UseSWIG/CMP0078-common.cmake index 6cf39dc..b13796b 100644 --- a/Tests/RunCMake/UseSWIG/CMP0078-common.cmake +++ b/Tests/RunCMake/UseSWIG/CMP0078-common.cmake @@ -1,4 +1,6 @@ +cmake_policy(SET CMP0086 NEW) + set(SWIG_EXECUTABLE "swig") set(SWIG_DIR "/swig") include(UseSWIG) diff --git a/Tests/RunCMake/UseSWIG/CMP0086-NEW-nuild-check.cmake b/Tests/RunCMake/UseSWIG/CMP0086-NEW-nuild-check.cmake new file mode 100644 index 0000000..ea8b2cd --- /dev/null +++ b/Tests/RunCMake/UseSWIG/CMP0086-NEW-nuild-check.cmake @@ -0,0 +1,4 @@ + +if (NOT EXISTS "${RunCMake_TEST_BINARY_DIR}/new_example.py") + set (RunCMake_TEST_FAILED "Not found expected file: '${RunCMake_TEST_BINARY_DIR}/new_example.py'.") +endif() diff --git a/Tests/RunCMake/UseSWIG/CMP0086-NEW.cmake b/Tests/RunCMake/UseSWIG/CMP0086-NEW.cmake new file mode 100644 index 0000000..b54338d --- /dev/null +++ b/Tests/RunCMake/UseSWIG/CMP0086-NEW.cmake @@ -0,0 +1,2 @@ +cmake_policy(SET CMP0086 NEW) +include(CMP0086-common.cmake) diff --git a/Tests/RunCMake/UseSWIG/CMP0086-OLD-build-check.cmake b/Tests/RunCMake/UseSWIG/CMP0086-OLD-build-check.cmake new file mode 100644 index 0000000..96b5295 --- /dev/null +++ b/Tests/RunCMake/UseSWIG/CMP0086-OLD-build-check.cmake @@ -0,0 +1,4 @@ + +if (NOT EXISTS "${RunCMake_TEST_BINARY_DIR}/example.py") + set (RunCMake_TEST_FAILED "Not found expected file: '${RunCMake_TEST_BINARY_DIR}/example.py'.") +endif() diff --git a/Tests/RunCMake/UseSWIG/CMP0086-OLD.cmake b/Tests/RunCMake/UseSWIG/CMP0086-OLD.cmake new file mode 100644 index 0000000..6a63d4c --- /dev/null +++ b/Tests/RunCMake/UseSWIG/CMP0086-OLD.cmake @@ -0,0 +1,2 @@ +cmake_policy(SET CMP0086 OLD) +include(CMP0086-common.cmake) diff --git a/Tests/RunCMake/UseSWIG/CMP0086-WARN-stderr.txt b/Tests/RunCMake/UseSWIG/CMP0086-WARN-stderr.txt new file mode 100644 index 0000000..af41021 --- /dev/null +++ b/Tests/RunCMake/UseSWIG/CMP0086-WARN-stderr.txt @@ -0,0 +1,11 @@ +CMake Warning \(dev\) at .*/Modules/UseSWIG.cmake:[0-9]+ \(message\): + Policy CMP0086 is not set: UseSWIG honors SWIG_MODULE_NAME via -module + flag. Run "cmake --help-policy CMP0086" for policy details\. Use the + cmake_policy command to set the policy and suppress this warning\. + +Call Stack \(most recent call first\): + .*/Modules/UseSWIG.cmake:[0-9]+ \(SWIG_ADD_SOURCE_TO_MODULE\) + CMP0086-common\.cmake:[0-9]+ \(swig_add_library\) + CMP0086-WARN\.cmake:1 \(include\) + CMakeLists\.txt:3 \(include\) +This warning is for project developers\. Use -Wno-dev to suppress it\.$ diff --git a/Tests/RunCMake/UseSWIG/CMP0086-WARN.cmake b/Tests/RunCMake/UseSWIG/CMP0086-WARN.cmake new file mode 100644 index 0000000..69c2d9d --- /dev/null +++ b/Tests/RunCMake/UseSWIG/CMP0086-WARN.cmake @@ -0,0 +1 @@ +include(CMP0086-common.cmake) diff --git a/Tests/RunCMake/UseSWIG/CMP0086-common.cmake b/Tests/RunCMake/UseSWIG/CMP0086-common.cmake new file mode 100644 index 0000000..c02592a --- /dev/null +++ b/Tests/RunCMake/UseSWIG/CMP0086-common.cmake @@ -0,0 +1,11 @@ + +cmake_policy(SET CMP0078 NEW) + +find_package(Python REQUIRED COMPONENTS Development) +find_package (SWIG REQUIRED) +include(UseSWIG) + +set_property (SOURCE example.i PROPERTY SWIG_MODULE_NAME "new_example") + +swig_add_library(example LANGUAGE python TYPE MODULE SOURCES example.i) +target_link_libraries(example PRIVATE Python::Python) diff --git a/Tests/RunCMake/UseSWIG/RunCMakeTest.cmake b/Tests/RunCMake/UseSWIG/RunCMakeTest.cmake index b96622a..6acf719 100644 --- a/Tests/RunCMake/UseSWIG/RunCMakeTest.cmake +++ b/Tests/RunCMake/UseSWIG/RunCMakeTest.cmake @@ -3,3 +3,23 @@ include(RunCMake) run_cmake(CMP0078-WARN) run_cmake(CMP0078-OLD) run_cmake(CMP0078-NEW) + +run_cmake(CMP0086-WARN) + +if (CMake_TEST_FindPython) + + macro(run_cmake_target test subtest target) + set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${test}-build) + set(RunCMake_TEST_NO_CLEAN 1) + run_cmake_command(${test}-${subtest} ${CMAKE_COMMAND} --build . --target ${target} ${ARGN}) + + unset(RunCMake_TEST_BINARY_DIR) + unset(RunCMake_TEST_NO_CLEAN) + endmacro() + + run_cmake(CMP0086-OLD) + run_cmake_target(CMP0086-OLD build example) + run_cmake(CMP0086-NEW) + run_cmake_target(CMP0086-NEW build example) + +endif() diff --git a/Tests/RunCMake/VS10Project/RunCMakeTest.cmake b/Tests/RunCMake/VS10Project/RunCMakeTest.cmake index 4bfb2f2..db375ae 100644 --- a/Tests/RunCMake/VS10Project/RunCMakeTest.cmake +++ b/Tests/RunCMake/VS10Project/RunCMakeTest.cmake @@ -12,5 +12,6 @@ run_cmake(VsDebuggerEnvironment) run_cmake(VsCSharpCustomTags) run_cmake(VsCSharpReferenceProps) run_cmake(VsCSharpWithoutSources) +run_cmake(VsCSharpDeployFiles) run_cmake(VsSdkDirectories) run_cmake(VsGlobals) diff --git a/Tests/RunCMake/VS10Project/VsCSharpDeployFiles-check.cmake b/Tests/RunCMake/VS10Project/VsCSharpDeployFiles-check.cmake new file mode 100644 index 0000000..c29f2ae --- /dev/null +++ b/Tests/RunCMake/VS10Project/VsCSharpDeployFiles-check.cmake @@ -0,0 +1,67 @@ +set(csProjectFile "${RunCMake_TEST_BINARY_DIR}/foo.csproj") +if(NOT EXISTS "${csProjectFile}") + set(RunCMake_TEST_FAILED "Project file ${csProjectFile} does not exist.") + return() +endif() + + +set(inNode1 FALSE) +set(foundNode1 FALSE) +set(foundCopyDirective1 FALSE) + +set(inNode2 FALSE) +set(foundNode2 FALSE) +set(foundCopyDirective2 FALSE) + +set(foundNode3 FALSE) + +file(STRINGS "${csProjectFile}" lines) + +foreach(line IN LISTS lines) + if( inNode1 ) + if(line MATCHES " *<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> *$") + set(foundCopyDirective1 TRUE) + elseif( line MATCHES " *</Content> *$") + set(inNode1 FALSE) + endif() + elseif( inNode2 ) + if(line MATCHES " *<CopyToOutputDirectory>Always</CopyToOutputDirectory> *$") + set(foundCopyDirective2 TRUE) + elseif( line MATCHES " *</Content> *$") + set(inNode2 FALSE) + endif() + elseif(line MATCHES "^ *<Content *Include *= *\".*content1\\.txt\"> *") + set(foundNode1 TRUE) + set(inNode1 TRUE) + elseif(line MATCHES "^ *<Content *Include *= *\".*content2\\.txt\"> *") + set(foundNode2 TRUE) + set(inNode2 TRUE) + elseif(line MATCHES "^ *<None *Include *= *\".*content3\\.txt\"> *") + set(foundNode3 TRUE) + endif() +endforeach() + +if(NOT foundNode1) + set(RunCMake_TEST_FAILED "Did not find <Content> item content1.txt.") + return() +endif() + +if(NOT foundCopyDirective1) + set(RunCMake_TEST_FAILED "Did not find PreserveNewest for <Content> item content1.txt.") + return() +endif() + +if(NOT foundNode2) + set(RunCMake_TEST_FAILED "Did not find <Content> item content2.txt.") + return() +endif() + +if(NOT foundCopyDirective2) + set(RunCMake_TEST_FAILED "Did not find Always for <Content> item content2.txt.") + return() +endif() + +if(NOT foundNode3) + set(RunCMake_TEST_FAILED "Did not find <None> item content3.txt.") + return() +endif() diff --git a/Tests/RunCMake/VS10Project/VsCSharpDeployFiles.cmake b/Tests/RunCMake/VS10Project/VsCSharpDeployFiles.cmake new file mode 100644 index 0000000..cb77fa7 --- /dev/null +++ b/Tests/RunCMake/VS10Project/VsCSharpDeployFiles.cmake @@ -0,0 +1,27 @@ +enable_language(CSharp) + +set(fileNames + "${CMAKE_CURRENT_BINARY_DIR}/content1.txt" + "${CMAKE_CURRENT_BINARY_DIR}/content2.txt" + "${CMAKE_CURRENT_BINARY_DIR}/content3.txt") + +foreach(f ${fileNames}) + message(STATUS "touch ${f}") + file(TOUCH ${f}) +endforeach() + +set_source_files_properties( "${CMAKE_CURRENT_BINARY_DIR}/content1.txt" + PROPERTIES + VS_COPY_TO_OUT_DIR PreserveNewest +) + +set_source_files_properties( "${CMAKE_CURRENT_BINARY_DIR}/content2.txt" + PROPERTIES + VS_COPY_TO_OUT_DIR Always +) + + +add_library(foo SHARED + foo.cs + ${fileNames} +) diff --git a/Tests/RunCMake/WorkingDirectory/CTestConfig.cmake.in b/Tests/RunCMake/WorkingDirectory/CTestConfig.cmake.in deleted file mode 100644 index 0226230..0000000 --- a/Tests/RunCMake/WorkingDirectory/CTestConfig.cmake.in +++ /dev/null @@ -1 +0,0 @@ -set(CTEST_PROJECT_NAME "CTestTestWorkingDir.@CASE_NAME@") diff --git a/Tests/RunCMake/WriteBasicConfigVersionFile/ArchIndependent.cmake b/Tests/RunCMake/WriteBasicConfigVersionFile/ArchIndependent.cmake new file mode 100644 index 0000000..13ec5d1 --- /dev/null +++ b/Tests/RunCMake/WriteBasicConfigVersionFile/ArchIndependent.cmake @@ -0,0 +1,63 @@ +# Hard-code architecture for test without a real compiler. +set(CMAKE_SIZEOF_VOID_P 4) + +include(WriteBasicConfigVersionFile) + +set(_dummy_version 1.0.0) + +set(_compatibilities AnyNewerVersion + SameMajorVersion + SameMinorVersion + ExactVersion) + +function(test_write_basic_config_version_file_arch_prepare filename_out compat arch_independent arch) + if(arch_independent) + set(arch_arg ARCH_INDEPENDENT) + else() + set(arch_arg ) + endif() + + set(filename "${CMAKE_CURRENT_BINARY_DIR}/${compat}Arch${arch_arg}ConfigVersion.cmake") + + set(CMAKE_SIZEOF_VOID_P "${arch}") + + write_basic_config_version_file("${filename}" + VERSION "${_dummy_version}" + COMPATIBILITY "${compat}" + ${arch_arg}) + + set("${filename_out}" "${filename}" PARENT_SCOPE) +endfunction() + +function(test_write_basic_config_version_file_arch_check unsuitable_out filename arch) + set(CMAKE_SIZEOF_VOID_P "${arch}") + set(PACKAGE_FIND_VERSION "${_dummy_version}") + + include("${filename}") + + set("${unsuitable_out}" "${PACKAGE_VERSION_UNSUITABLE}" PARENT_SCOPE) +endfunction() + +function(test_write_basic_config_version_file_arch_test expected_unsuitable compat arch_independent source_arch user_arch) + test_write_basic_config_version_file_arch_prepare(filename "${compat}" "${arch_independent}" "${source_arch}") + test_write_basic_config_version_file_arch_check(unsuitable "${filename}" "${user_arch}") + if(unsuitable AND NOT expected_unsuitable) + message(SEND_ERROR "Architecture was checked when it shouldn't have been. Compatibility: ${compat} ARCH_INDEPENDENT: ${arch_independent}.") + elseif(expected_unsuitable AND NOT unsuitable) + message(SEND_ERROR "Requested architecture check not performed. Compatibility: ${compat} ARCH_INDEPENDENT: ${arch_independent}.") + endif() +endfunction() + +set(_unsuitable TRUE) +set(_suitable FALSE) + +foreach(compat ${_compatibilities}) + test_write_basic_config_version_file_arch_test("${_suitable}" "${compat}" TRUE 4 4) + test_write_basic_config_version_file_arch_test("${_suitable}" "${compat}" FALSE 4 4) + test_write_basic_config_version_file_arch_test("${_suitable}" "${compat}" TRUE 4 8) + test_write_basic_config_version_file_arch_test("${_unsuitable}" "${compat}" FALSE 4 8) + test_write_basic_config_version_file_arch_test("${_suitable}" "${compat}" TRUE 8 4) + test_write_basic_config_version_file_arch_test("${_unsuitable}" "${compat}" FALSE 8 4) + test_write_basic_config_version_file_arch_test("${_suitable}" "${compat}" TRUE 8 8) + test_write_basic_config_version_file_arch_test("${_suitable}" "${compat}" FALSE 8 8) +endforeach() diff --git a/Tests/RunCMake/WriteBasicConfigVersionFile/RunCMakeTest.cmake b/Tests/RunCMake/WriteBasicConfigVersionFile/RunCMakeTest.cmake index e956f4f..5db33f7 100644 --- a/Tests/RunCMake/WriteBasicConfigVersionFile/RunCMakeTest.cmake +++ b/Tests/RunCMake/WriteBasicConfigVersionFile/RunCMakeTest.cmake @@ -1,3 +1,4 @@ include(RunCMake) run_cmake(All) +run_cmake(ArchIndependent) diff --git a/Tests/RunCMake/ctest_build/BuildQuiet-stdout.txt b/Tests/RunCMake/ctest_build/BuildQuiet-stdout.txt index 2e59d99..cc9085f 100644 --- a/Tests/RunCMake/ctest_build/BuildQuiet-stdout.txt +++ b/Tests/RunCMake/ctest_build/BuildQuiet-stdout.txt @@ -1,7 +1,6 @@ Run dashboard with model Experimental Source directory: .*/Tests/RunCMake/ctest_build/BuildQuiet Build directory: .*/Tests/RunCMake/ctest_build/BuildQuiet-build - Reading ctest configuration file: .*/Tests/RunCMake/ctest_build/BuildQuiet/CTestConfig.cmake Site: test-site Build name: test-build-name Use Experimental tag: [0-9-]+ diff --git a/Tests/RunCMake/ctest_build/CTestConfig.cmake.in b/Tests/RunCMake/ctest_build/CTestConfig.cmake.in deleted file mode 100644 index 097f82c..0000000 --- a/Tests/RunCMake/ctest_build/CTestConfig.cmake.in +++ /dev/null @@ -1 +0,0 @@ -set(CTEST_PROJECT_NAME "CTestBuild@CASE_NAME@") diff --git a/Tests/RunCMake/ctest_cmake_error/CTestConfig.cmake.in b/Tests/RunCMake/ctest_cmake_error/CTestConfig.cmake.in deleted file mode 100644 index 1f679d5..0000000 --- a/Tests/RunCMake/ctest_cmake_error/CTestConfig.cmake.in +++ /dev/null @@ -1 +0,0 @@ -set(CTEST_PROJECT_NAME "CTestCoverage@CASE_NAME@") diff --git a/Tests/RunCMake/ctest_configure/CTestConfig.cmake.in b/Tests/RunCMake/ctest_configure/CTestConfig.cmake.in deleted file mode 100644 index 7e30ab9..0000000 --- a/Tests/RunCMake/ctest_configure/CTestConfig.cmake.in +++ /dev/null @@ -1 +0,0 @@ -set(CTEST_PROJECT_NAME "CTestConfigure@CASE_NAME@") diff --git a/Tests/RunCMake/ctest_configure/ConfigureQuiet-stdout.txt b/Tests/RunCMake/ctest_configure/ConfigureQuiet-stdout.txt index 015644d..98f5a4c 100644 --- a/Tests/RunCMake/ctest_configure/ConfigureQuiet-stdout.txt +++ b/Tests/RunCMake/ctest_configure/ConfigureQuiet-stdout.txt @@ -1,7 +1,6 @@ Run dashboard with model Experimental Source directory: .*/Tests/RunCMake/ctest_configure/ConfigureQuiet Build directory: .*/Tests/RunCMake/ctest_configure/ConfigureQuiet-build - Reading ctest configuration file: .*/Tests/RunCMake/ctest_configure/ConfigureQuiet/CTestConfig.cmake Site: test-site Build name: test-build-name Use Experimental tag: [0-9-]+ diff --git a/Tests/RunCMake/ctest_coverage/CTestConfig.cmake.in b/Tests/RunCMake/ctest_coverage/CTestConfig.cmake.in deleted file mode 100644 index 1f679d5..0000000 --- a/Tests/RunCMake/ctest_coverage/CTestConfig.cmake.in +++ /dev/null @@ -1 +0,0 @@ -set(CTEST_PROJECT_NAME "CTestCoverage@CASE_NAME@") diff --git a/Tests/RunCMake/ctest_disabled_test/CTestConfig.cmake.in b/Tests/RunCMake/ctest_disabled_test/CTestConfig.cmake.in deleted file mode 100644 index c0d7e42..0000000 --- a/Tests/RunCMake/ctest_disabled_test/CTestConfig.cmake.in +++ /dev/null @@ -1 +0,0 @@ -set(CTEST_PROJECT_NAME "@CASE_NAME@") diff --git a/Tests/RunCMake/ctest_fixtures/CTestConfig.cmake.in b/Tests/RunCMake/ctest_fixtures/CTestConfig.cmake.in deleted file mode 100644 index 9823562..0000000 --- a/Tests/RunCMake/ctest_fixtures/CTestConfig.cmake.in +++ /dev/null @@ -1 +0,0 @@ -set(CTEST_PROJECT_NAME "CTestTestFixtures.@CASE_NAME@") diff --git a/Tests/RunCMake/ctest_labels_for_subprojects/CTestConfig.cmake.in b/Tests/RunCMake/ctest_labels_for_subprojects/CTestConfig.cmake.in index 1e1905b..5d83530 100644 --- a/Tests/RunCMake/ctest_labels_for_subprojects/CTestConfig.cmake.in +++ b/Tests/RunCMake/ctest_labels_for_subprojects/CTestConfig.cmake.in @@ -1,2 +1 @@ -set(CTEST_PROJECT_NAME "CTestLabelsForSubprojects@CASE_NAME@") @CTEST_EXTRA_CONFIG@ diff --git a/Tests/RunCMake/ctest_memcheck/CTestConfig.cmake.in b/Tests/RunCMake/ctest_memcheck/CTestConfig.cmake.in index 6d4a718..53bdd20 100644 --- a/Tests/RunCMake/ctest_memcheck/CTestConfig.cmake.in +++ b/Tests/RunCMake/ctest_memcheck/CTestConfig.cmake.in @@ -1,9 +1,6 @@ -set (CTEST_PROJECT_NAME "CTestTestMemcheck@CASE_NAME@") set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT") -set (CTEST_DART_SERVER_VERSION "2") set(CTEST_DROP_METHOD "http") set(CTEST_DROP_SITE "open.cdash.org") set(CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard") -set(CTEST_DROP_SITE_CDASH TRUE) @CTEST_EXTRA_CONFIG@ diff --git a/Tests/RunCMake/ctest_skipped_test/CTestConfig.cmake.in b/Tests/RunCMake/ctest_skipped_test/CTestConfig.cmake.in deleted file mode 100644 index c0d7e42..0000000 --- a/Tests/RunCMake/ctest_skipped_test/CTestConfig.cmake.in +++ /dev/null @@ -1 +0,0 @@ -set(CTEST_PROJECT_NAME "@CASE_NAME@") diff --git a/Tests/RunCMake/ctest_start/AppendDifferentModel-stdout.txt b/Tests/RunCMake/ctest_start/AppendDifferentModel-stdout.txt index bc9a4c8..78f36a1 100644 --- a/Tests/RunCMake/ctest_start/AppendDifferentModel-stdout.txt +++ b/Tests/RunCMake/ctest_start/AppendDifferentModel-stdout.txt @@ -1,7 +1,6 @@ Run dashboard with model Experimental Source directory: .*/Tests/RunCMake/ctest_start/AppendDifferentModel Build directory: .*/Tests/RunCMake/ctest_start/AppendDifferentModel-build - Reading ctest configuration file: .*/Tests/RunCMake/ctest_start/AppendDifferentModel/CTestConfig.cmake Site: test-site Build name: test-build-name Use existing tag: 19551112-2204 - ContinuousTrack diff --git a/Tests/RunCMake/ctest_start/AppendDifferentTrack-stdout.txt b/Tests/RunCMake/ctest_start/AppendDifferentTrack-stdout.txt index ab1c1f7..25085ef 100644 --- a/Tests/RunCMake/ctest_start/AppendDifferentTrack-stdout.txt +++ b/Tests/RunCMake/ctest_start/AppendDifferentTrack-stdout.txt @@ -2,7 +2,6 @@ Run dashboard with to-be-determined model Source directory: .*/Tests/RunCMake/ctest_start/AppendDifferentTrack Build directory: .*/Tests/RunCMake/ctest_start/AppendDifferentTrack-build Track: ExperimentalDifferent - Reading ctest configuration file: .*/Tests/RunCMake/ctest_start/AppendDifferentTrack/CTestConfig.cmake Site: test-site Build name: test-build-name Use existing tag: 19551112-2204 - ExperimentalDifferent diff --git a/Tests/RunCMake/ctest_start/AppendNoMatchingTrack-stdout.txt b/Tests/RunCMake/ctest_start/AppendNoMatchingTrack-stdout.txt index 55f2d8e..5780629 100644 --- a/Tests/RunCMake/ctest_start/AppendNoMatchingTrack-stdout.txt +++ b/Tests/RunCMake/ctest_start/AppendNoMatchingTrack-stdout.txt @@ -1,7 +1,6 @@ Run dashboard with model Continuous Source directory: .*/Tests/RunCMake/ctest_start/AppendNoMatchingTrack Build directory: .*/Tests/RunCMake/ctest_start/AppendNoMatchingTrack-build - Reading ctest configuration file: .*/Tests/RunCMake/ctest_start/AppendNoMatchingTrack/CTestConfig.cmake Site: test-site Build name: test-build-name Use existing tag: 19551112-2204 - SomeWeirdTrackName diff --git a/Tests/RunCMake/ctest_start/AppendNoModel-stdout.txt b/Tests/RunCMake/ctest_start/AppendNoModel-stdout.txt index f909a44..bcd0125 100644 --- a/Tests/RunCMake/ctest_start/AppendNoModel-stdout.txt +++ b/Tests/RunCMake/ctest_start/AppendNoModel-stdout.txt @@ -1,7 +1,6 @@ Run dashboard with to-be-determined model Source directory: .*/Tests/RunCMake/ctest_start/AppendNoModel Build directory: .*/Tests/RunCMake/ctest_start/AppendNoModel-build - Reading ctest configuration file: .*/Tests/RunCMake/ctest_start/AppendNoModel/CTestConfig.cmake Site: test-site Build name: test-build-name Use existing tag: 19551112-2204 - ContinuousTrack diff --git a/Tests/RunCMake/ctest_start/AppendOldContinuous-stdout.txt b/Tests/RunCMake/ctest_start/AppendOldContinuous-stdout.txt index 0660f5d..e58cd9c 100644 --- a/Tests/RunCMake/ctest_start/AppendOldContinuous-stdout.txt +++ b/Tests/RunCMake/ctest_start/AppendOldContinuous-stdout.txt @@ -1,7 +1,6 @@ Run dashboard with model Continuous Source directory: .*/Tests/RunCMake/ctest_start/AppendOldContinuous Build directory: .*/Tests/RunCMake/ctest_start/AppendOldContinuous-build - Reading ctest configuration file: .*/Tests/RunCMake/ctest_start/AppendOldContinuous/CTestConfig.cmake Site: test-site Build name: test-build-name Use existing tag: 19551112-2204 - ContinuousTrack diff --git a/Tests/RunCMake/ctest_start/AppendOldNoModel-stdout.txt b/Tests/RunCMake/ctest_start/AppendOldNoModel-stdout.txt index 0bdf9e4..47331e6 100644 --- a/Tests/RunCMake/ctest_start/AppendOldNoModel-stdout.txt +++ b/Tests/RunCMake/ctest_start/AppendOldNoModel-stdout.txt @@ -1,6 +1,5 @@ Run dashboard with to-be-determined model Source directory: .*/Tests/RunCMake/ctest_start/AppendOldNoModel Build directory: .*/Tests/RunCMake/ctest_start/AppendOldNoModel-build - Reading ctest configuration file: .*/Tests/RunCMake/ctest_start/AppendOldNoModel/CTestConfig.cmake Site: test-site Build name: test-build-name diff --git a/Tests/RunCMake/ctest_start/AppendSameModel-stdout.txt b/Tests/RunCMake/ctest_start/AppendSameModel-stdout.txt index 4f43626..3abd51e 100644 --- a/Tests/RunCMake/ctest_start/AppendSameModel-stdout.txt +++ b/Tests/RunCMake/ctest_start/AppendSameModel-stdout.txt @@ -1,7 +1,6 @@ Run dashboard with model Continuous Source directory: .*/Tests/RunCMake/ctest_start/AppendSameModel Build directory: .*/Tests/RunCMake/ctest_start/AppendSameModel-build - Reading ctest configuration file: .*/Tests/RunCMake/ctest_start/AppendSameModel/CTestConfig.cmake Site: test-site Build name: test-build-name Use existing tag: 19551112-2204 - ContinuousTrack diff --git a/Tests/RunCMake/ctest_start/CTestConfig.cmake.in b/Tests/RunCMake/ctest_start/CTestConfig.cmake.in deleted file mode 100644 index e75d14f..0000000 --- a/Tests/RunCMake/ctest_start/CTestConfig.cmake.in +++ /dev/null @@ -1 +0,0 @@ -set(CTEST_PROJECT_NAME "CTestStart@CASE_NAME@") diff --git a/Tests/RunCMake/ctest_start/ConfigInBuild-stdout.txt b/Tests/RunCMake/ctest_start/ConfigInBuild-stdout.txt index 7e94b8a..f4a0ba3 100644 --- a/Tests/RunCMake/ctest_start/ConfigInBuild-stdout.txt +++ b/Tests/RunCMake/ctest_start/ConfigInBuild-stdout.txt @@ -1,7 +1,6 @@ Run dashboard with model Experimental Source directory: .*/Tests/RunCMake/ctest_start/ConfigInBuild Build directory: .*/Tests/RunCMake/ctest_start/ConfigInBuild-build - Reading ctest configuration file: .*/Tests/RunCMake/ctest_start/ConfigInBuild-build/CTestConfig.cmake Site: test-site Build name: test-build-name Use Experimental tag: [0-9-]+ diff --git a/Tests/RunCMake/ctest_start/ConfigInSource-stdout.txt b/Tests/RunCMake/ctest_start/ConfigInSource-stdout.txt index c390372..5f98b4e 100644 --- a/Tests/RunCMake/ctest_start/ConfigInSource-stdout.txt +++ b/Tests/RunCMake/ctest_start/ConfigInSource-stdout.txt @@ -1,7 +1,6 @@ Run dashboard with model Experimental Source directory: .*/Tests/RunCMake/ctest_start/ConfigInSource Build directory: .*/Tests/RunCMake/ctest_start/ConfigInSource-build - Reading ctest configuration file: .*/Tests/RunCMake/ctest_start/ConfigInSource/CTestConfig.cmake Site: test-site Build name: test-build-name Use Experimental tag: [0-9-]+ diff --git a/Tests/RunCMake/ctest_start/NoAppendDifferentTrack-stdout.txt b/Tests/RunCMake/ctest_start/NoAppendDifferentTrack-stdout.txt index 4a6f1e9..20a29be 100644 --- a/Tests/RunCMake/ctest_start/NoAppendDifferentTrack-stdout.txt +++ b/Tests/RunCMake/ctest_start/NoAppendDifferentTrack-stdout.txt @@ -2,7 +2,6 @@ Run dashboard with model Experimental Source directory: .*/Tests/RunCMake/ctest_start/NoAppendDifferentTrack Build directory: .*/Tests/RunCMake/ctest_start/NoAppendDifferentTrack-build Track: ExperimentalDifferent - Reading ctest configuration file: .*/Tests/RunCMake/ctest_start/NoAppendDifferentTrack/CTestConfig.cmake Site: test-site Build name: test-build-name Use ExperimentalDifferent tag: [0-9-]+ diff --git a/Tests/RunCMake/ctest_start/RunCMakeTest.cmake b/Tests/RunCMake/ctest_start/RunCMakeTest.cmake index 9b57b1b..905ad00 100644 --- a/Tests/RunCMake/ctest_start/RunCMakeTest.cmake +++ b/Tests/RunCMake/ctest_start/RunCMakeTest.cmake @@ -48,8 +48,6 @@ function(run_ConfigInBuild) set(RunCMake_TEST_NO_CLEAN 1) file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}") file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}") - configure_file(${RunCMake_SOURCE_DIR}/CTestConfig.cmake.in - ${RunCMake_BINARY_DIR}/ConfigInBuild-build/CTestConfig.cmake @ONLY) run_ctest_start(ConfigInBuild Experimental) endfunction() run_ConfigInBuild() diff --git a/Tests/RunCMake/ctest_submit/CTestConfig.cmake.in b/Tests/RunCMake/ctest_submit/CTestConfig.cmake.in index 378a85a..140e4be 100644 --- a/Tests/RunCMake/ctest_submit/CTestConfig.cmake.in +++ b/Tests/RunCMake/ctest_submit/CTestConfig.cmake.in @@ -1,4 +1,3 @@ -set(CTEST_PROJECT_NAME "CTestSubmit@CASE_NAME@") # Intentionally leave out other upload-related CTestConfig.cmake settings # so that any ctest_submit calls fail with an error message. diff --git a/Tests/RunCMake/ctest_submit/FailDrop-cp-result.txt b/Tests/RunCMake/ctest_submit/FailDrop-cp-result.txt deleted file mode 100644 index b57e2de..0000000 --- a/Tests/RunCMake/ctest_submit/FailDrop-cp-result.txt +++ /dev/null @@ -1 +0,0 @@ -(-1|255) diff --git a/Tests/RunCMake/ctest_submit/FailDrop-cp-stderr.txt b/Tests/RunCMake/ctest_submit/FailDrop-cp-stderr.txt deleted file mode 100644 index 00a60ac..0000000 --- a/Tests/RunCMake/ctest_submit/FailDrop-cp-stderr.txt +++ /dev/null @@ -1,3 +0,0 @@ -Missing arguments for submit via cp: -.* - Problems when submitting via CP diff --git a/Tests/RunCMake/ctest_submit/FailDrop-cp-stdout.txt b/Tests/RunCMake/ctest_submit/FailDrop-cp-stdout.txt deleted file mode 100644 index fa6e004..0000000 --- a/Tests/RunCMake/ctest_submit/FailDrop-cp-stdout.txt +++ /dev/null @@ -1 +0,0 @@ -Submit files \(using cp\) diff --git a/Tests/RunCMake/ctest_submit/FailDrop-ftp-result.txt b/Tests/RunCMake/ctest_submit/FailDrop-ftp-result.txt deleted file mode 100644 index b57e2de..0000000 --- a/Tests/RunCMake/ctest_submit/FailDrop-ftp-result.txt +++ /dev/null @@ -1 +0,0 @@ -(-1|255) diff --git a/Tests/RunCMake/ctest_submit/FailDrop-ftp-stderr.txt b/Tests/RunCMake/ctest_submit/FailDrop-ftp-stderr.txt deleted file mode 100644 index b9d9394..0000000 --- a/Tests/RunCMake/ctest_submit/FailDrop-ftp-stderr.txt +++ /dev/null @@ -1,2 +0,0 @@ -Error message was: ([Cc]ould *n.t resolve host:? '?-no-site-'?.*|The requested URL returned error:.*) - Problems when submitting via FTP diff --git a/Tests/RunCMake/ctest_submit/FailDrop-ftp-stdout.txt b/Tests/RunCMake/ctest_submit/FailDrop-ftp-stdout.txt deleted file mode 100644 index 345bb62..0000000 --- a/Tests/RunCMake/ctest_submit/FailDrop-ftp-stdout.txt +++ /dev/null @@ -1,3 +0,0 @@ -Submit files \(using ftp\) - Using FTP submit method - Drop site: ftp:// diff --git a/Tests/RunCMake/ctest_submit/FailDrop-scp-result.txt b/Tests/RunCMake/ctest_submit/FailDrop-scp-result.txt deleted file mode 100644 index b57e2de..0000000 --- a/Tests/RunCMake/ctest_submit/FailDrop-scp-result.txt +++ /dev/null @@ -1 +0,0 @@ -(-1|255) diff --git a/Tests/RunCMake/ctest_submit/FailDrop-scp-stderr.txt b/Tests/RunCMake/ctest_submit/FailDrop-scp-stderr.txt deleted file mode 100644 index ef67149..0000000 --- a/Tests/RunCMake/ctest_submit/FailDrop-scp-stderr.txt +++ /dev/null @@ -1 +0,0 @@ - Problems when submitting via SCP diff --git a/Tests/RunCMake/ctest_submit/FailDrop-scp-stdout.txt b/Tests/RunCMake/ctest_submit/FailDrop-scp-stdout.txt deleted file mode 100644 index ec2ce92..0000000 --- a/Tests/RunCMake/ctest_submit/FailDrop-scp-stdout.txt +++ /dev/null @@ -1 +0,0 @@ -Submit files \(using scp\) diff --git a/Tests/RunCMake/ctest_submit/FailDrop-xmlrpc-result.txt b/Tests/RunCMake/ctest_submit/FailDrop-xmlrpc-result.txt deleted file mode 100644 index b57e2de..0000000 --- a/Tests/RunCMake/ctest_submit/FailDrop-xmlrpc-result.txt +++ /dev/null @@ -1 +0,0 @@ -(-1|255) diff --git a/Tests/RunCMake/ctest_submit/FailDrop-xmlrpc-stderr.txt b/Tests/RunCMake/ctest_submit/FailDrop-xmlrpc-stderr.txt deleted file mode 100644 index c0f718e..0000000 --- a/Tests/RunCMake/ctest_submit/FailDrop-xmlrpc-stderr.txt +++ /dev/null @@ -1 +0,0 @@ - (Problems when submitting via XML-RPC|Submission method "xmlrpc" not compiled into CTest!) diff --git a/Tests/RunCMake/ctest_submit/FailDrop-xmlrpc-stdout.txt b/Tests/RunCMake/ctest_submit/FailDrop-xmlrpc-stdout.txt deleted file mode 100644 index ed2acb5..0000000 --- a/Tests/RunCMake/ctest_submit/FailDrop-xmlrpc-stdout.txt +++ /dev/null @@ -1 +0,0 @@ -Submit files \(using xmlrpc\) diff --git a/Tests/RunCMake/ctest_submit/RunCMakeTest.cmake b/Tests/RunCMake/ctest_submit/RunCMakeTest.cmake index 178f0cb..4d7d29b 100644 --- a/Tests/RunCMake/ctest_submit/RunCMakeTest.cmake +++ b/Tests/RunCMake/ctest_submit/RunCMakeTest.cmake @@ -49,9 +49,5 @@ function(run_ctest_submit_FailDrop CASE_DROP_METHOD) run_ctest(FailDrop-${CASE_DROP_METHOD}) endfunction() -run_ctest_submit_FailDrop(cp) -run_ctest_submit_FailDrop(ftp) run_ctest_submit_FailDrop(http) run_ctest_submit_FailDrop(https) -run_ctest_submit_FailDrop(scp) -run_ctest_submit_FailDrop(xmlrpc) diff --git a/Tests/RunCMake/ctest_test/CTestConfig.cmake.in b/Tests/RunCMake/ctest_test/CTestConfig.cmake.in deleted file mode 100644 index 9004419..0000000 --- a/Tests/RunCMake/ctest_test/CTestConfig.cmake.in +++ /dev/null @@ -1 +0,0 @@ -set(CTEST_PROJECT_NAME "CTestTest@CASE_NAME@") diff --git a/Tests/RunCMake/ctest_upload/CTestConfig.cmake.in b/Tests/RunCMake/ctest_upload/CTestConfig.cmake.in deleted file mode 100644 index 52665a8..0000000 --- a/Tests/RunCMake/ctest_upload/CTestConfig.cmake.in +++ /dev/null @@ -1 +0,0 @@ -set(CTEST_PROJECT_NAME "CTestUpload@CASE_NAME@") diff --git a/Tests/RunCMake/file/READ_SYMLINK-noexist-result.txt b/Tests/RunCMake/file/READ_SYMLINK-noexist-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/file/READ_SYMLINK-noexist-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/file/READ_SYMLINK-noexist-stderr.txt b/Tests/RunCMake/file/READ_SYMLINK-noexist-stderr.txt new file mode 100644 index 0000000..32b3e85 --- /dev/null +++ b/Tests/RunCMake/file/READ_SYMLINK-noexist-stderr.txt @@ -0,0 +1,6 @@ +^CMake Error at READ_SYMLINK-noexist\.cmake:[0-9]+ \(file\): + file READ_SYMLINK requested of path that is not a symlink: + + .*/Tests/RunCMake/file/READ_SYMLINK-noexist-build/rel\.sym +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/file/READ_SYMLINK-noexist.cmake b/Tests/RunCMake/file/READ_SYMLINK-noexist.cmake new file mode 100644 index 0000000..9e57e4b --- /dev/null +++ b/Tests/RunCMake/file/READ_SYMLINK-noexist.cmake @@ -0,0 +1 @@ +file(READ_SYMLINK "${CMAKE_CURRENT_BINARY_DIR}/rel.sym" result) diff --git a/Tests/RunCMake/file/READ_SYMLINK-notsymlink-result.txt b/Tests/RunCMake/file/READ_SYMLINK-notsymlink-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/file/READ_SYMLINK-notsymlink-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/file/READ_SYMLINK-notsymlink-stderr.txt b/Tests/RunCMake/file/READ_SYMLINK-notsymlink-stderr.txt new file mode 100644 index 0000000..63e32ed --- /dev/null +++ b/Tests/RunCMake/file/READ_SYMLINK-notsymlink-stderr.txt @@ -0,0 +1,6 @@ +^CMake Error at READ_SYMLINK-notsymlink\.cmake:[0-9]+ \(file\): + file READ_SYMLINK requested of path that is not a symlink: + + .*/Tests/RunCMake/file/READ_SYMLINK-notsymlink-build/rel\.sym +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/file/READ_SYMLINK-notsymlink.cmake b/Tests/RunCMake/file/READ_SYMLINK-notsymlink.cmake new file mode 100644 index 0000000..a9798b6 --- /dev/null +++ b/Tests/RunCMake/file/READ_SYMLINK-notsymlink.cmake @@ -0,0 +1,2 @@ +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/rel.sym" "") +file(READ_SYMLINK "${CMAKE_CURRENT_BINARY_DIR}/rel.sym" result) diff --git a/Tests/RunCMake/file/READ_SYMLINK.cmake b/Tests/RunCMake/file/READ_SYMLINK.cmake new file mode 100644 index 0000000..865a2e9 --- /dev/null +++ b/Tests/RunCMake/file/READ_SYMLINK.cmake @@ -0,0 +1,13 @@ +execute_process(COMMAND + ${CMAKE_COMMAND} -E create_symlink "test.txt" "${CMAKE_CURRENT_BINARY_DIR}/rel.sym") +file(READ_SYMLINK "${CMAKE_CURRENT_BINARY_DIR}/rel.sym" result) +if(NOT result STREQUAL "test.txt") + message(SEND_ERROR "Relative symlink is \"${result}\", should be \"test.txt\"") +endif() + +execute_process(COMMAND + ${CMAKE_COMMAND} -E create_symlink "${CMAKE_CURRENT_BINARY_DIR}/test.txt" "${CMAKE_CURRENT_BINARY_DIR}/abs.sym") +file(READ_SYMLINK "${CMAKE_CURRENT_BINARY_DIR}/abs.sym" result) +if(NOT result MATCHES "^.*/Tests/RunCMake/file/READ_SYMLINK-build/test\\.txt$") + message(SEND_ERROR "Absolute symlink is \"${result}\", should be \"*/Tests/RunCMake/file/READ_SYMLINK-build/test.txt\"") +endif() diff --git a/Tests/RunCMake/file/RunCMakeTest.cmake b/Tests/RunCMake/file/RunCMakeTest.cmake index b383230..b872824 100644 --- a/Tests/RunCMake/file/RunCMakeTest.cmake +++ b/Tests/RunCMake/file/RunCMakeTest.cmake @@ -36,6 +36,8 @@ run_cmake(READ_ELF) run_cmake(GLOB) run_cmake(GLOB_RECURSE) run_cmake(GLOB_RECURSE-noexp-FOLLOW_SYMLINKS) +run_cmake(SIZE) +run_cmake(SIZE-error-does-not-exist) # tests are valid both for GLOB and GLOB_RECURSE run_cmake(GLOB-sort-dedup) @@ -53,6 +55,9 @@ run_cmake_command(GLOB-error-CONFIGURE_DEPENDS-SCRIPT_MODE ${CMAKE_COMMAND} -P if(NOT WIN32 OR CYGWIN) run_cmake(GLOB_RECURSE-cyclic-recursion) run_cmake(INSTALL-SYMLINK) + run_cmake(READ_SYMLINK) + run_cmake(READ_SYMLINK-noexist) + run_cmake(READ_SYMLINK-notsymlink) endif() if(RunCMake_GENERATOR STREQUAL "Ninja") diff --git a/Tests/RunCMake/file/SIZE-error-does-not-exist-result.txt b/Tests/RunCMake/file/SIZE-error-does-not-exist-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/file/SIZE-error-does-not-exist-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/file/SIZE-error-does-not-exist-stderr.txt b/Tests/RunCMake/file/SIZE-error-does-not-exist-stderr.txt new file mode 100644 index 0000000..842cf89 --- /dev/null +++ b/Tests/RunCMake/file/SIZE-error-does-not-exist-stderr.txt @@ -0,0 +1,6 @@ +^CMake Error at SIZE-error-does-not-exist.cmake:[0-9]+ \(file\): + file SIZE requested of path that is not readable: + + .*/Tests/RunCMake/file/SIZE-error-does-not-exist-build/does-not-exist +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/file/SIZE-error-does-not-exist.cmake b/Tests/RunCMake/file/SIZE-error-does-not-exist.cmake new file mode 100644 index 0000000..ebac737 --- /dev/null +++ b/Tests/RunCMake/file/SIZE-error-does-not-exist.cmake @@ -0,0 +1,3 @@ +set(file "${CMAKE_CURRENT_BINARY_DIR}/does-not-exist") + +file(SIZE "${file}" CALCULATED_SIZE) diff --git a/Tests/RunCMake/file/SIZE.cmake b/Tests/RunCMake/file/SIZE.cmake new file mode 100644 index 0000000..4d9dbd2 --- /dev/null +++ b/Tests/RunCMake/file/SIZE.cmake @@ -0,0 +1,9 @@ +set(file "${CMAKE_CURRENT_BINARY_DIR}/a-test-file") + +file(WRITE "${file}" "test") + +file(SIZE "${file}" CALCULATED_SIZE) + +if (NOT CALCULATED_SIZE EQUAL 4) + message(FATAL_ERROR "Unexpected file size") +endif() diff --git a/Tests/RunCMake/install/CMP0087-NEW-check.cmake b/Tests/RunCMake/install/CMP0087-NEW-check.cmake new file mode 100644 index 0000000..422c532 --- /dev/null +++ b/Tests/RunCMake/install/CMP0087-NEW-check.cmake @@ -0,0 +1,7 @@ +execute_process(COMMAND ${CMAKE_COMMAND} -P ${RunCMake_TEST_BINARY_DIR}/cmake_install.cmake + OUTPUT_VARIABLE out ERROR_VARIABLE err) +if(NOT out MATCHES "-- Install configuration: .*-- codegenexlib") + string(REGEX REPLACE "\n" "\n " out " ${out}") + string(APPEND RunCMake_TEST_FAILED + "\"-- codegenexlib\" was not found:\n${out}") +endif() diff --git a/Tests/RunCMake/install/CMP0087-NEW.cmake b/Tests/RunCMake/install/CMP0087-NEW.cmake new file mode 100644 index 0000000..0177960 --- /dev/null +++ b/Tests/RunCMake/install/CMP0087-NEW.cmake @@ -0,0 +1,3 @@ +# Need a new directory scope, not just a new policy scope +# to test this correctly +add_subdirectory(CMP0087-NEW) diff --git a/Tests/RunCMake/install/CMP0087-NEW/CMakeLists.txt b/Tests/RunCMake/install/CMP0087-NEW/CMakeLists.txt new file mode 100644 index 0000000..07b4589 --- /dev/null +++ b/Tests/RunCMake/install/CMP0087-NEW/CMakeLists.txt @@ -0,0 +1,7 @@ +# Note that it is the policy settings at the end of the directory +# scope that will be used when deciding whether or not generator +# expressions should be evaluated in the installed code. +cmake_policy(VERSION 3.13) +cmake_policy(SET CMP0087 NEW) +add_library( codegenexlib INTERFACE ) +install(CODE "message( STATUS \"$<TARGET_PROPERTY:codegenexlib,NAME>\")") diff --git a/Tests/RunCMake/install/CMP0087-OLD-check.cmake b/Tests/RunCMake/install/CMP0087-OLD-check.cmake new file mode 100644 index 0000000..c5984bc --- /dev/null +++ b/Tests/RunCMake/install/CMP0087-OLD-check.cmake @@ -0,0 +1,8 @@ +execute_process(COMMAND ${CMAKE_COMMAND} -P ${RunCMake_TEST_BINARY_DIR}/cmake_install.cmake + OUTPUT_VARIABLE out ERROR_VARIABLE err) + +if(NOT out MATCHES "-- Install configuration: .*-- \\$<TARGET_PROPERTY:codegenexlib,NAME>") + string(REGEX REPLACE "\n" "\n " out " ${out}") + string(APPEND RunCMake_TEST_FAILED + "\"-- $<TARGET_PROPERTY:codegenexlib,NAME>\" was not found:\n${out}") +endif() diff --git a/Tests/RunCMake/install/CMP0087-OLD.cmake b/Tests/RunCMake/install/CMP0087-OLD.cmake new file mode 100644 index 0000000..e7ed4ee --- /dev/null +++ b/Tests/RunCMake/install/CMP0087-OLD.cmake @@ -0,0 +1,3 @@ +# Need a new directory scope, not just a new policy scope +# to test this correctly +add_subdirectory(CMP0087-OLD) diff --git a/Tests/RunCMake/install/CMP0087-OLD/CMakeLists.txt b/Tests/RunCMake/install/CMP0087-OLD/CMakeLists.txt new file mode 100644 index 0000000..b1d4e2e --- /dev/null +++ b/Tests/RunCMake/install/CMP0087-OLD/CMakeLists.txt @@ -0,0 +1,6 @@ +# Note that it is the policy settings at the end of the directory +# scope that will be used when deciding whether or not generator +# expressions should be evaluated in the installed code. +cmake_policy(VERSION 3.13) +cmake_policy(SET CMP0087 OLD) +install(CODE "message( STATUS \"$<TARGET_PROPERTY:codegenexlib,NAME>\")") diff --git a/Tests/RunCMake/install/CMP0087-WARN-stderr.txt b/Tests/RunCMake/install/CMP0087-WARN-stderr.txt new file mode 100644 index 0000000..75fbf2c --- /dev/null +++ b/Tests/RunCMake/install/CMP0087-WARN-stderr.txt @@ -0,0 +1,5 @@ +CMake Warning (dev) in CMakeLists.txt: + Policy CMP0087 is not set: Install CODE|SCRIPT allow the use of generator + expressions. Run "cmake --help-policy CMP0087" 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/install/CMP0087-WARN.cmake b/Tests/RunCMake/install/CMP0087-WARN.cmake new file mode 100644 index 0000000..3b8513d --- /dev/null +++ b/Tests/RunCMake/install/CMP0087-WARN.cmake @@ -0,0 +1,2 @@ +add_library( codegenexlib INTERFACE ) +install(CODE "message( STATUS \"$<TARGET_PROPERTY:codegenexlib,NAME>\")") diff --git a/Tests/RunCMake/install/RunCMakeTest.cmake b/Tests/RunCMake/install/RunCMakeTest.cmake index f7e1dee..28e8ec4 100644 --- a/Tests/RunCMake/install/RunCMakeTest.cmake +++ b/Tests/RunCMake/install/RunCMakeTest.cmake @@ -63,6 +63,9 @@ run_cmake(EXPORT-OldIFace) run_cmake(CMP0062-OLD) run_cmake(CMP0062-NEW) run_cmake(CMP0062-WARN) +run_cmake(CMP0087-OLD) +run_cmake(CMP0087-NEW) +run_cmake(CMP0087-WARN) run_cmake(TARGETS-NAMELINK_COMPONENT-bad-all) run_cmake(TARGETS-NAMELINK_COMPONENT-bad-exc) run_cmake(FILES-DESTINATION-TYPE) diff --git a/Tests/RunCMake/install/TARGETS-Defaults-Cache-all-check.cmake b/Tests/RunCMake/install/TARGETS-Defaults-Cache-all-check.cmake index 6fc735c..57ad6e1 100644 --- a/Tests/RunCMake/install/TARGETS-Defaults-Cache-all-check.cmake +++ b/Tests/RunCMake/install/TARGETS-Defaults-Cache-all-check.cmake @@ -21,8 +21,8 @@ elseif(CYGWIN) [[lib4]] [[lib4/cyglib4\.dll]] [[mybin]] - [[mybin/exe\.exe]] [[mybin/cyglib1\.dll]] + [[mybin/exe\.exe]] [[myinclude]] [[myinclude/obj4\.h]] [[myinclude/obj5\.h]] diff --git a/Tests/RunCMake/install/TARGETS-Defaults-all-check.cmake b/Tests/RunCMake/install/TARGETS-Defaults-all-check.cmake index 59209e6..c41cb2a 100644 --- a/Tests/RunCMake/install/TARGETS-Defaults-all-check.cmake +++ b/Tests/RunCMake/install/TARGETS-Defaults-all-check.cmake @@ -17,8 +17,8 @@ if(WIN32) elseif(CYGWIN) set(_check_files [[bin]] - [[bin/exe\.exe]] [[bin/cyglib1\.dll]] + [[bin/exe\.exe]] [[include]] [[include/obj4\.h]] [[include/obj5\.h]] diff --git a/Tests/RunCMake/print_stdin.c b/Tests/RunCMake/print_stdin.c new file mode 100644 index 0000000..e083e62 --- /dev/null +++ b/Tests/RunCMake/print_stdin.c @@ -0,0 +1,18 @@ +#include <stdio.h> + +int main() +{ + char buf[1024]; + size_t nIn = sizeof(buf); + while (nIn == sizeof(buf)) { + nIn = fread(buf, 1, sizeof(buf), stdin); + if (nIn > 0) { + size_t nOut; + nOut = fwrite(buf, 1, nIn, stdout); + if (nOut != nIn) { + return 1; + } + } + } + return 0; +} diff --git a/Tests/RunCMake/try_compile/LinkOptions.cmake b/Tests/RunCMake/try_compile/LinkOptions.cmake new file mode 100644 index 0000000..9b246c4 --- /dev/null +++ b/Tests/RunCMake/try_compile/LinkOptions.cmake @@ -0,0 +1,38 @@ + +enable_language(C) + +cmake_policy(SET CMP0054 NEW) + +set (lib_name "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}lib${CMAKE_STATIC_LIBRARY_SUFFIX}") +if (CMAKE_SYSTEM_NAME STREQUAL "Windows") + if (RunCMake_C_COMPILER_ID STREQUAL "MSVC") + if (CMAKE_SIZEOF_VOID_P EQUAL 4) + set (undef_flag /INCLUDE:_func) + else() + set (undef_flag /INCLUDE:func) + endif() + else() + if (CMAKE_SIZEOF_VOID_P EQUAL 4) + set (undef_flag -u _func) + else() + set (undef_flag -u func) + endif() + endif() +elseif (CMAKE_SYSTEM_NAME STREQUAL "Darwin") + set (undef_flag -u _func) +else() + set (undef_flag -u func) +endif() + +set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY) +try_compile(result ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/lib.c + COPY_FILE "${lib_name}") + +set(CMAKE_TRY_COMPILE_TARGET_TYPE EXECUTABLE) +try_compile(result ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/main.c + OUTPUT_VARIABLE out + LINK_OPTIONS ${undef_flag} "${lib_name}") + +if(NOT result) + message(FATAL_ERROR "try_compile(... LINK_OPTIONS ...) failed:\n${out}") +endif() diff --git a/Tests/RunCMake/try_compile/RunCMakeTest.cmake b/Tests/RunCMake/try_compile/RunCMakeTest.cmake index 6a1bc64..77fb7a0 100644 --- a/Tests/RunCMake/try_compile/RunCMakeTest.cmake +++ b/Tests/RunCMake/try_compile/RunCMakeTest.cmake @@ -25,6 +25,13 @@ run_cmake(TargetTypeExe) run_cmake(TargetTypeInvalid) run_cmake(TargetTypeStatic) +if (CMAKE_SYSTEM_NAME MATCHES "^(Linux|Darwin|Windows)$" AND + CMAKE_C_COMPILER_ID MATCHES "^(MSVC|GNU|Clang|AppleClang)$") + set (RunCMake_TEST_OPTIONS -DRunCMake_C_COMPILER_ID=${CMAKE_C_COMPILER_ID}) + run_cmake(LinkOptions) + unset (RunCMake_TEST_OPTIONS) +endif() + if(CMAKE_C_STANDARD_DEFAULT) run_cmake(CStandard) elseif(DEFINED CMAKE_C_STANDARD_DEFAULT) diff --git a/Tests/RunCMake/try_compile/lib.c b/Tests/RunCMake/try_compile/lib.c new file mode 100644 index 0000000..b00c576 --- /dev/null +++ b/Tests/RunCMake/try_compile/lib.c @@ -0,0 +1,4 @@ + +void func() +{ +} diff --git a/Tests/RunCMake/try_compile/main.c b/Tests/RunCMake/try_compile/main.c new file mode 100644 index 0000000..2128ead --- /dev/null +++ b/Tests/RunCMake/try_compile/main.c @@ -0,0 +1,8 @@ +extern void func(); + +int main(void) +{ + func(); + + return 0; +} diff --git a/Tests/RunCMake/try_run/LinkOptions.cmake b/Tests/RunCMake/try_run/LinkOptions.cmake new file mode 100644 index 0000000..17af2f7 --- /dev/null +++ b/Tests/RunCMake/try_run/LinkOptions.cmake @@ -0,0 +1,42 @@ + +enable_language(C) + +cmake_policy(SET CMP0054 NEW) + +set (lib_name "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}lib${CMAKE_STATIC_LIBRARY_SUFFIX}") +if (CMAKE_SYSTEM_NAME STREQUAL "Windows") + if (RunCMake_C_COMPILER_ID STREQUAL "MSVC") + if (CMAKE_SIZEOF_VOID_P EQUAL 4) + set (undef_flag /INCLUDE:_func) + else() + set (undef_flag /INCLUDE:func) + endif() + else() + if (CMAKE_SIZEOF_VOID_P EQUAL 4) + set (undef_flag -u _func) + else() + set (undef_flag -u func) + endif() + endif() +elseif (CMAKE_SYSTEM_NAME STREQUAL "Darwin") + set (undef_flag -u _func) +else() + set (undef_flag -u func) +endif() + +set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY) +try_compile(result ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/lib.c + COPY_FILE "${lib_name}") + +set(CMAKE_TRY_COMPILE_TARGET_TYPE EXECUTABLE) +try_run(run_result compile_result ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/main.c + COMPILE_OUTPUT_VARIABLE compile_out + RUN_OUTPUT_VARIABLE run_out + LINK_OPTIONS ${undef_flag} "${lib_name}") + +if(NOT compile_result) + message(FATAL_ERROR "try_run(... LINK_OPTIONS ...) compilation failed:\n${compile_out}") +endif() +if(run_result STREQUAL "FAILED_TO_RUN") + message(FATAL_ERROR "try_run(... LINK_OPTIONS ...) execution failed:\n${run_out}") +endif() diff --git a/Tests/RunCMake/try_run/RunCMakeTest.cmake b/Tests/RunCMake/try_run/RunCMakeTest.cmake index 1ec9a55..3689562 100644 --- a/Tests/RunCMake/try_run/RunCMakeTest.cmake +++ b/Tests/RunCMake/try_run/RunCMakeTest.cmake @@ -1,3 +1,10 @@ include(RunCMake) run_cmake(BadLinkLibraries) + +if (CMAKE_SYSTEM_NAME MATCHES "^(Linux|Darwin|Windows)$" AND + CMAKE_C_COMPILER_ID MATCHES "^(MSVC|GNU|Clang|AppleClang)$") + set (RunCMake_TEST_OPTIONS -DRunCMake_C_COMPILER_ID=${CMAKE_C_COMPILER_ID}) + run_cmake(LinkOptions) + unset (RunCMake_TEST_OPTIONS) +endif() diff --git a/Tests/RunCMake/try_run/lib.c b/Tests/RunCMake/try_run/lib.c new file mode 100644 index 0000000..b00c576 --- /dev/null +++ b/Tests/RunCMake/try_run/lib.c @@ -0,0 +1,4 @@ + +void func() +{ +} diff --git a/Tests/RunCMake/try_run/main.c b/Tests/RunCMake/try_run/main.c new file mode 100644 index 0000000..2128ead --- /dev/null +++ b/Tests/RunCMake/try_run/main.c @@ -0,0 +1,8 @@ +extern void func(); + +int main(void) +{ + func(); + + return 0; +} diff --git a/Tests/Tutorial/Step7/CTestConfig.cmake b/Tests/Tutorial/Step7/CTestConfig.cmake deleted file mode 100644 index d8f5c44..0000000 --- a/Tests/Tutorial/Step7/CTestConfig.cmake +++ /dev/null @@ -1 +0,0 @@ -set (CTEST_PROJECT_NAME "Tutorial") diff --git a/Tests/UseSWIG/CMakeLists.txt b/Tests/UseSWIG/CMakeLists.txt index 4c3d901..434895e 100644 --- a/Tests/UseSWIG/CMakeLists.txt +++ b/Tests/UseSWIG/CMakeLists.txt @@ -96,6 +96,30 @@ add_test(NAME UseSWIG.UseTargetINCLUDE_DIRECTORIES COMMAND "${CMake_SOURCE_DIR}/Tests/UseSWIG/UseTargetINCLUDE_DIRECTORIES" "${CMake_BINARY_DIR}/Tests/UseSWIG/UseTargetINCLUDE_DIRECTORIES" ${build_generator_args} - --build-project TestModuleVersion2 + --build-project TestUseTargetINCLUDE_DIRECTORIES --build-options ${build_options} ) + + +add_test(NAME UseSWIG.ModuleName COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/UseSWIG/ModuleName" + "${CMake_BINARY_DIR}/Tests/UseSWIG/ModuleName" + ${build_generator_args} + --build-project TestModuleName + --build-options ${build_options} + --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> + ) + + +add_test(NAME UseSWIG.SwigSrcFileExtension COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/UseSWIG/SwigSrcFileExtension" + "${CMake_BINARY_DIR}/Tests/UseSWIG/SwigSrcFileExtension" + ${build_generator_args} + --build-project SwigSrcFileExtension + --build-options ${build_options} + --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> + ) diff --git a/Tests/UseSWIG/ModuleName/CMakeLists.txt b/Tests/UseSWIG/ModuleName/CMakeLists.txt new file mode 100644 index 0000000..de63883 --- /dev/null +++ b/Tests/UseSWIG/ModuleName/CMakeLists.txt @@ -0,0 +1,42 @@ +cmake_minimum_required(VERSION 3.1...3.14) + +project(TestModuleName CXX) + +include(CTest) + +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() + +unset(CMAKE_SWIG_FLAGS) + +set_property(SOURCE "example.i" PROPERTY CPLUSPLUS ON) +set_property(SOURCE "example.i" PROPERTY COMPILE_OPTIONS -includeall) +set_property(SOURCE "example.i" PROPERTY SWIG_MODULE_NAME new_example) + +swig_add_library(example1 + LANGUAGE python + OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/example1" + SOURCES example.i ../example.cxx) +set_target_properties (example1 PROPERTIES + INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/.." + SWIG_USE_TARGET_INCLUDE_DIRECTORIES TRUE + OUTPUT_NAME new_example + 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::Python) + + +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") diff --git a/Tests/UseSWIG/ModuleName/example.i b/Tests/UseSWIG/ModuleName/example.i new file mode 100644 index 0000000..fbdf724 --- /dev/null +++ b/Tests/UseSWIG/ModuleName/example.i @@ -0,0 +1,9 @@ +/* File : example.i */ +%module example + +%{ +#include "example.h" +%} + +/* Let's just grab the original header file here */ +%include "example.h" diff --git a/Tests/UseSWIG/ModuleName/runme.py b/Tests/UseSWIG/ModuleName/runme.py new file mode 100644 index 0000000..c37e4a7 --- /dev/null +++ b/Tests/UseSWIG/ModuleName/runme.py @@ -0,0 +1,52 @@ +# file: runme.py + +# This file illustrates the shadow-class C++ interface generated +# by SWIG. + +from __future__ import print_function + +import new_example + +# ----- Object creation ----- + +print ("Creating some objects:") +c = new_example.Circle(10) +print (" Created circle", c) +s = new_example.Square(10) +print (" Created square", s) + +# ----- Access a static member ----- + +print ("\nA total of", new_example.cvar.Shape_nshapes,"shapes were created") + +# ----- Member data access ----- + +# Set the location of the object + +c.x = 20 +c.y = 30 + +s.x = -10 +s.y = 5 + +print ("\nHere is their current position:") +print (" Circle = (%f, %f)" % (c.x,c.y)) +print (" Square = (%f, %f)" % (s.x,s.y)) + +# ----- Call some methods ----- + +print ("\nHere are some properties of the shapes:") +for o in [c,s]: + print (" ", o) + print (" area = ", o.area()) + print (" perimeter = ", o.perimeter()) + +print ("\nGuess I'll clean up now") + +# Note: this invokes the virtual destructor +del c +del s + +s = 3 +print (new_example.cvar.Shape_nshapes,"shapes remain") +print ("Goodbye") diff --git a/Tests/UseSWIG/SwigSrcFileExtension/CMakeLists.txt b/Tests/UseSWIG/SwigSrcFileExtension/CMakeLists.txt new file mode 100644 index 0000000..7eb73d4 --- /dev/null +++ b/Tests/UseSWIG/SwigSrcFileExtension/CMakeLists.txt @@ -0,0 +1,28 @@ +cmake_minimum_required(VERSION 3.1...3.14) + +project(SwigSrcFileExtension C) + +include(CTest) +find_package(SWIG REQUIRED) +find_package(Python COMPONENTS Interpreter Development REQUIRED) + +include(${SWIG_USE_FILE}) + +# Use the newer target name preference +set(UseSWIG_TARGET_NAME_PREFERENCE "STANDARD") + +# Set the custom source file extension to both .i and .swg +set(SWIG_SOURCE_FILE_EXTENSIONS ".i" ".swg") + +# Generate a Python module out of `.i` +swig_add_library(my_add LANGUAGE python SOURCES my_add.i) +target_link_libraries(my_add Python::Python) + +# Generate a Python module out of `.swg` +swig_add_library(my_sub LANGUAGE python SOURCES my_sub.swg) +target_link_libraries(my_sub Python::Python) + +# Add a test +add_test(NAME SwigSrcFileExtension + COMMAND "${CMAKE_COMMAND}" -E env "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}" + "${Python_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/runme.py") diff --git a/Tests/UseSWIG/SwigSrcFileExtension/my_add.i b/Tests/UseSWIG/SwigSrcFileExtension/my_add.i new file mode 100644 index 0000000..d087ab5 --- /dev/null +++ b/Tests/UseSWIG/SwigSrcFileExtension/my_add.i @@ -0,0 +1,9 @@ +%module my_add + +%{ +int add(int a, int b) { + return a + b; +} +%} + +int add(int a, int b); diff --git a/Tests/UseSWIG/SwigSrcFileExtension/my_sub.swg b/Tests/UseSWIG/SwigSrcFileExtension/my_sub.swg new file mode 100644 index 0000000..df34b44 --- /dev/null +++ b/Tests/UseSWIG/SwigSrcFileExtension/my_sub.swg @@ -0,0 +1,9 @@ +%module my_sub + +%{ +int sub(int a, int b) { + return a - b; +} +%} + +int sub(int a, int b); diff --git a/Tests/UseSWIG/SwigSrcFileExtension/runme.py b/Tests/UseSWIG/SwigSrcFileExtension/runme.py new file mode 100755 index 0000000..290175b --- /dev/null +++ b/Tests/UseSWIG/SwigSrcFileExtension/runme.py @@ -0,0 +1,24 @@ +#!/usr/bin/env python + +from __future__ import print_function +import random + +import my_add +import my_sub + + +# These can be changed, but make sure not to overflow `int` +a = random.randint(1, 1024) +b = random.randint(1, 1024) + +if my_add.add(a, b) == a + b: + print ("Test 1 Passed for SWIG custom source file extension") +else: + print ("Test 1 FAILED for SWIG custom source file extension") + exit(1) + +if my_sub.sub(a, b) == a - b: + print ("Test 2 Passed for SWIG custom source file extension") +else: + print ("Test 2 FAILED for SWIG custom source file extension") + exit(1) diff --git a/Utilities/IWYU/mapping.imp b/Utilities/IWYU/mapping.imp index 5af8b85..c5231bb 100644 --- a/Utilities/IWYU/mapping.imp +++ b/Utilities/IWYU/mapping.imp @@ -97,9 +97,6 @@ { include: [ "@<uv-.+\\.h>", private, "\"cm_uv.h\"", public ] }, { include: [ "<kwiml/abi.h>", private, "\"cm_kwiml.h\"", public ] }, { include: [ "<kwiml/int.h>", private, "\"cm_kwiml.h\"", public ] }, - { include: [ "<xmlrpc.h>", private, "\"cm_xmlrpc.h\"", public ] }, - { include: [ "<xmlrpc_client.h>", private, "\"cm_xmlrpc.h\"", public ] }, - { include: [ "@<xmlrpc-c/.+\\.h>", private, "\"cm_xmlrpc.h\"", public ] }, { include: [ "<zconf.h>", private, "\"cm_zlib.h\"", public ] }, { include: [ "<zlib.h>", private, "\"cm_zlib.h\"", public ] }, @@ -126,6 +123,8 @@ { symbol: [ "SIGINT", private, "\"cm_uv.h\"", public ] }, { symbol: [ "ssize_t", private, "\"cm_uv.h\"", public ] }, + { symbol: [ "Json::ArrayIndex", private, "\"cm_jsoncpp_value.h\"", public ] }, + { symbol: [ "std::ifstream", private, "\"cmsys/FStream.hxx\"", public ] }, { symbol: [ "std::ofstream", private, "\"cmsys/FStream.hxx\"", public ] }, { symbol: [ "cmsys::ifstream", private, "\"cmsys/FStream.hxx\"", public ] }, diff --git a/Utilities/cmThirdParty.h.in b/Utilities/cmThirdParty.h.in index a547f0d..46e0490 100644 --- a/Utilities/cmThirdParty.h.in +++ b/Utilities/cmThirdParty.h.in @@ -15,6 +15,5 @@ #cmakedefine CMAKE_USE_SYSTEM_JSONCPP #cmakedefine CMAKE_USE_SYSTEM_LIBRHASH #cmakedefine CMAKE_USE_SYSTEM_LIBUV -#cmakedefine CTEST_USE_XMLRPC #endif diff --git a/Utilities/cm_xmlrpc.h b/Utilities/cm_xmlrpc.h deleted file mode 100644 index 932066a..0000000 --- a/Utilities/cm_xmlrpc.h +++ /dev/null @@ -1,13 +0,0 @@ -/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying - file Copyright.txt or https://cmake.org/licensing for details. */ -#ifndef cm_xmlrpc_h -#define cm_xmlrpc_h - -/* Use the xmlrpc library configured for CMake. */ -#include "cmThirdParty.h" -#ifdef CTEST_USE_XMLRPC -# include <xmlrpc.h> -# include <xmlrpc_client.h> -#endif - -#endif diff --git a/Utilities/cmjsoncpp/src/lib_json/json_reader.cpp b/Utilities/cmjsoncpp/src/lib_json/json_reader.cpp index 0249cc9..6eeba0e 100644 --- a/Utilities/cmjsoncpp/src/lib_json/json_reader.cpp +++ b/Utilities/cmjsoncpp/src/lib_json/json_reader.cpp @@ -1581,7 +1581,7 @@ bool OurReader::decodeNumber(Token& token, Value& decoded) { ++current; // TODO: Help the compiler do the div and mod at compile time or get rid of them. Value::LargestUInt maxIntegerValue = - isNegative ? Value::LargestUInt(-Value::minLargestInt) + isNegative ? Value::LargestUInt(Value::minLargestInt) : Value::maxLargestUInt; Value::LargestUInt threshold = maxIntegerValue / 10; Value::LargestUInt value = 0; @@ -430,6 +430,7 @@ CMAKE_CXX_SOURCES="\ cmake \ cmakemain \ cmcmd \ + cm_string_view \ " if ${cmake_system_mingw}; then |