Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: Kitware/CMake
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: microsoft/CMake
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: cmake-daemon
Choose a head ref
Can’t automatically merge. Don’t worry, you can still create the pull request.

Commits on Jun 8, 2016

  1. Add a server based on libuv

    At this point, it reads/writes on stdin/stdout. This can be changed to
    use local sockets/named pipes when appropriate.  At that point, the
    magic string wrapping is also not needed.
    steveire committed Jun 8, 2016
    Copy the full SHA
    593094b View commit details
  2. Server: Use TTY API instead of pipe API where needed

    This is needed on Windows at least, but this is something for a Windows
    expert to look into.
    steveire committed Jun 8, 2016
    Copy the full SHA
    30ff6ba View commit details
  3. Handle data input on Windows

    I must be missing something in libuv, because this should be easier.
    steveire committed Jun 8, 2016

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    01c2d03 View commit details
  4. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    f9e8cfe View commit details
  5. Copy the full SHA
    25fa3f6 View commit details
  6. Daemon: Add protocol for the querying the buildsystem

    A client request of
    
     [== CMake MetaMagic ==[
     {"type":"buildsystem"}
     ]== CMake MetaMagic ==]
    
    results in a response describing all targets.
    steveire committed Jun 8, 2016
    Copy the full SHA
    643f686 View commit details
  7. Copy the full SHA
    f29845e View commit details
  8. Daemon: Add protocol to provide buildsystem information for a file

    This should provide the compile definitions, include directories etc
    as JSON properties, but should also provide the full command line
    content (including ordering of include directories, content of
    CMAKE_CXX_FLAGS etc) which gets passed to the compiler, if that is
    possible to do.
    steveire committed Jun 8, 2016
    Copy the full SHA
    e0eae7e View commit details
  9. Add hacky python client to show how the protocol works

    Use the stdin and stdout features of the subprocess module to interact
    with the cmake process.
    
        $ ./daemon-client.py /path/to/kitemmodels/build
        Serving
    
          Source Dir: /path/to/kitemmodels
          Binary Dir: /path/to/kitemmodels/build
          Project: KItemModels
    
        Targets
            KF5ItemModels                    krecursivefilterproxymodeltest   proxymodeltestapp
            kdescendantsproxymodel_smoketest kselectionproxymodel_smoketest   proxymodeltestsuite
            klinkitemselectionmodeltest      kselectionproxymodeltest         testmodelqueuedconnections
    
        Select a target:
    
    User inputs: "KF5Item"
    
        Corrected "KF5Item" to "KF5ItemModels"
    
        Sources
            /path/to/kitemmodels/src/kbreadcrumbselectionmodel.cpp  /path/to/kitemmodels/src/kmodelindexproxymapper.cpp
            /path/to/kitemmodels/src/kcheckableproxymodel.cpp       /path/to/kitemmodels/src/krecursivefilterproxymodel.cpp
            /path/to/kitemmodels/src/kdescendantsproxymodel.cpp     /path/to/kitemmodels/src/kselectionproxymodel.cpp
            /path/to/kitemmodels/src/klinkitemselectionmodel.cpp
    
        Generated Sources
            /path/to/kitemmodels/build/src/KF5ItemModels_automoc.cpp
    
        Include Directories
            /path/to/kitemmodels/build/src       /path/to/qtbase/include           /path/to/qtbase/mkspecs/linux-g++
            /path/to/kitemmodels/src             /path/to/qtbase/include/QtCore
    
        Compile Definitions
            _GNU_SOURCE                  QT_NO_CAST_FROM_ASCII        QT_NO_SIGNALS_SLOTS_KEYWORDS QT_CORE_LIB
            _LARGEFILE64_SOURCE          QT_NO_URL_CAST_FROM_STRING   QT_USE_FAST_OPERATOR_PLUS    QT_NO_DEBUG
            QT_NO_CAST_TO_ASCII          QT_NO_CAST_FROM_BYTEARRAY    QT_USE_QSTRINGBUILDER
    
        Compile Options
            <None>
    steveire committed Jun 8, 2016
    Copy the full SHA
    36c652c View commit details
  10. cmIfCommand: Rewrite

    Make it easier to record which conditions were tested, and which were
    true.
    
    TODO: Is this needed at all?
    steveire committed Jun 8, 2016
    Copy the full SHA
    97766af View commit details
  11. Copy the full SHA
    fd7c71a View commit details
  12. Copy the full SHA
    5edc893 View commit details
  13. Copy the full SHA
    bae4cb6 View commit details
  14. cmState: Store whether conditionally executed blocks are executed

    TODO: I'm not sure this behaves correctly when a macro is defined in one
    file and called in another.  See eg the tool running on the llvm
    buildsystem.
    
    TODO: Properly handle aborting commands such as break(), continue(),
    return() etc so that following lines are marked not executed.
    steveire committed Jun 8, 2016
    Copy the full SHA
    08745cf View commit details
  15. cmake: Add a mode for recording snapshots

    Treat it as a normal mode.
    steveire committed Jun 8, 2016
    Copy the full SHA
    f9fd274 View commit details
  16. Copy the full SHA
    699ae3e View commit details
  17. Copy the full SHA
    bfb0b32 View commit details
  18. cmState: Make clearing snapshot data a client responsibility (#15854)

    Make different behavior possible for the cmake server.
    steveire committed Jun 8, 2016
    Copy the full SHA
    f336c42 View commit details
  19. Copy the full SHA
    d8c27fb View commit details
  20. Copy the full SHA
    8aca6ab View commit details
  21. cmState: Add concept of Arbitrary snapshots

    These can be made at an arbitrary point and do not create a scope.
    
    TODO: The cmState is getting unwieldy. Consider redesigning the data
    tracking based on shared_ptr per Sean Parent.
    steveire committed Jun 8, 2016
    Copy the full SHA
    5e6b9a2 View commit details
  22. Create snapshots arbitrarily at certain points

    These are:
    
     * Just after a project()
     * Just after a find_package()
     * Just after a include()
     * Just after a add_subdirectory()
     * Just inside a macro or function definition
     * Just outside a macro or function definition
     * Just after a macro or function invocation
    
    These can be used as starting points to provide recorded data through
    the server.
    
    Other places these should be created:
    
    * After any execute_process
    * After any file(WRITE)
    * After configure_file, or does that only have an effect on change?
    * After try_compile, or does that only have an effect on cache change?
    steveire committed Jun 8, 2016
    Copy the full SHA
    05ef639 View commit details
  23. DROPME? Create a snapshot at the start of files.

    This breaks the file_info protocol, but may be needed for code
    completion.
    steveire committed Jun 8, 2016
    Copy the full SHA
    4eec10a View commit details
  24. cmLinkedTree: Provide API for traversing from the Root

    This is so that the server can access all snapshots.
    
    Is this the right approach?
    steveire committed Jun 8, 2016
    Copy the full SHA
    4694aa3 View commit details
  25. cmState: Add API for traced snapshots.

    A particular context in a listfile may be executed multiple times, for
    example if inside a function which is executed multiple times. Provide
    all available snapshots for each context.
    steveire committed Jun 8, 2016
    Copy the full SHA
    9926b7c View commit details
  26. Copy the full SHA
    e3bff4b View commit details
  27. cmCommand: Add API for commands to return metadata

    Commands know the type of arguments expected. That can be used for
    code completion and contextual help.
    
    The level of completion of this is quite mixed. The API in cmCommand may
    not be the most ideal for what is needed.
    steveire committed Jun 8, 2016
    Copy the full SHA
    2ca0017 View commit details
  28. DROPME: workaround assert.

    At least at some point I hit this assert.
    steveire committed Jun 8, 2016
    Copy the full SHA
    272666c View commit details
  29. Add a hack to make parsing more failsafe.

    Needed for code completion.
    
    This is not acceptable for master. Instead the parser should be made
    failsafe in a more-deliberate way.
    steveire committed Jun 8, 2016
    Copy the full SHA
    e29fd27 View commit details
  30. Add a utility for diffing file content.

    Using the dtl: git@github.com:cubicdaiya/dtl.git
    
    I think the dtl::Diff object takes an unnecessary copy of each
    std::string line. Perhaps that can be avoided.
    steveire committed Jun 8, 2016
    Copy the full SHA
    60e428a View commit details
  31. Add ScanString.

    TODO: Edit cmListFileLexer.in.l and regenerate instead?
    steveire committed Jun 8, 2016
    Copy the full SHA
    e5d2398 View commit details
  32. Copy the full SHA
    dc980af View commit details
  33. Add Test infrastructure

    Coverage needs to be higher here.
    steveire committed Jun 8, 2016
    Copy the full SHA
    33893c6 View commit details
  34. cmMakefile: Add API for executing arbitrary commands

    The server needs to be able to execute commands as they exist in
    an editor buffer, not on the filesystem.  This allows executing them
    after parsing.
    steveire committed Jun 8, 2016
    Copy the full SHA
    caa9a30 View commit details
  35. Server: Add protocol for querying content in context

    The protocol currently requires the client to sent the entire editor
    content as a JSON value.  The protocol should be extended to accept a
    filepath where the editor content is stored.  Editors like vim keep such
    a file.
    
    Also to be considered is extending the protocol to allow editors to
    specify only changed lines.
    steveire committed Jun 8, 2016
    Copy the full SHA
    f4d0183 View commit details
  36. Server: Add protocol for parsing listfiles

    This works by first parsing the file on disk, and using the resulting
    parsed data to find the end of a command before a diff'd chunk.  That
    way the parser can read an entire command in the changed chunk instead
    of starting in the middle of an argument for example.
    
    TODO: Instead of duplicating the parser, refactor the existing parser
    into a visitor pattern or so to facilitate re-use in this context.
    steveire committed Jun 8, 2016
    Copy the full SHA
    0b00825 View commit details
  37. Server: Provide Help urls at given context

    Ugly levels of nesting in the code here.  Needs to be rewritten.
    steveire committed Jun 8, 2016
    Copy the full SHA
    bad7c5e View commit details
  38. Copy the full SHA
    71287c8 View commit details
  39. Copy the full SHA
    816d230 View commit details
  40. Add protocol to go to definition.

    This is only half done (needs to execute commands to find the correct
    line where the variable gets set) and uses a big hack of making use of
    the code completion infrastructure to find a variable. That should be
    refactored.
    steveire committed Jun 8, 2016
    Copy the full SHA
    c97b7af View commit details
  41. Copy the full SHA
    5ab1ae4 View commit details

Commits on Jun 28, 2016

  1. improve mDataBuffer.erase

    mengzhums committed Jun 28, 2016
    Copy the full SHA
    b82147a View commit details
  2. daemon returns errors when error occurs.

    currently daemon returns nothing, which effectively hangs the client
    if it permanently waits for daemon response. this adds error return
    in the daemon when error occurs, thus unblocking the client. another
    approach is to always have the client to use timed wait. but I think
    a good server should try to be responsive in all cases.
    mengzhums committed Jun 28, 2016
    Copy the full SHA
    dca1d0f View commit details
  3. Copy the full SHA
    4d08577 View commit details
  4. make deamon quitable.

    allow client to send {'type':'quit'} to quit the daemon.
    mengzhums committed Jun 28, 2016
    Copy the full SHA
    8cb126c View commit details
  5. Copy the full SHA
    a835c57 View commit details
  6. Copy the full SHA
    1a12270 View commit details

Commits on Jun 29, 2016

  1. fixed some bugs.

    mengzhums committed Jun 29, 2016
    Copy the full SHA
    f5cda89 View commit details
  2. Copy the full SHA
    81e3972 View commit details
  3. Copy the full SHA
    aee6855 View commit details
Showing with 1,965 additions and 409 deletions.
  1. +30 −0 .github/workflows/IntelliCode.yml
  2. +2 −0 Auxiliary/vim/syntax/cmake.vim
  3. +17 −1 Help/manual/cmake-file-api.7.rst
  4. +1 −0 Help/manual/cmake-properties.7.rst
  5. +1 −0 Help/manual/cmake-variables.7.rst
  6. +11 −0 Help/prop_tgt/DEBUGGER_WORKING_DIRECTORY.rst
  7. +15 −0 Help/release/dev/debugger-working-directory.rst
  8. +8 −0 Help/variable/CMAKE_DEBUGGER_WORKING_DIRECTORY.rst
  9. +4 −0 Modules/Platform/Windows-MSVC.cmake
  10. +1 −0 README.rst
  11. +41 −0 SECURITY.md
  12. +37 −0 Source/CMakeVersion.cmake
  13. +9 −4 Source/LexerParser/cmCTestResourceGroupsLexer.cxx
  14. +9 −4 Source/LexerParser/cmCommandArgumentLexer.cxx
  15. +9 −4 Source/LexerParser/cmFortranLexer.cxx
  16. +9 −4 Source/LexerParser/cmGccDepfileLexer.cxx
  17. +12 −7 Source/LexerParser/cmListFileLexer.c
  18. +2 −1 Source/cmDebuggerAdapter.cxx
  19. +6 −0 Source/cmDebuggerStackFrame.cxx
  20. +3 −0 Source/cmDebuggerStackFrame.h
  21. +41 −2 Source/cmDebuggerThread.cxx
  22. +7 −1 Source/cmDebuggerThread.h
  23. +5 −3 Source/cmDebuggerThreadManager.cxx
  24. +2 −1 Source/cmDebuggerThreadManager.h
  25. +1 −1 Source/cmFileAPI.cxx
  26. +20 −0 Source/cmFileAPICodemodel.cxx
  27. +6 −0 Source/cmGlobalGenerator.cxx
  28. +2 −0 Source/cmGlobalGenerator.h
  29. +45 −32 Source/cmGlobalVisualStudio8Generator.cxx
  30. +15 −0 Source/cmGlobalVisualStudioGenerator.cxx
  31. +7 −0 Source/cmGlobalVisualStudioGenerator.h
  32. +1 −1 Source/cmString.cxx
  33. +2 −0 Source/cmTarget.cxx
  34. +293 −234 Source/cmVisualStudio10TargetGenerator.cxx
  35. +6 −4 Source/cmVisualStudio10TargetGenerator.h
  36. +15 −5 Source/cmVisualStudioGeneratorOptions.cxx
  37. +5 −2 Source/cmVisualStudioGeneratorOptions.h
  38. +4 −0 Source/cmake.cxx
  39. +7 −0 Source/cmake.h
  40. +15 −0 Source/cmakemain.cxx
  41. +1 −1 Source/kwsys/ProcessWin32.c
  42. +2 −2 Source/kwsys/RegularExpression.cxx
  43. +1 −1 Source/kwsys/SystemTools.cxx
  44. +1 −1 Source/kwsys/Terminal.c
  45. +6 −3 Source/kwsys/testEncode.c
  46. +1 −1 Source/kwsys/testProcess.c
  47. +1 −0 Tests/CMakeLib/testDebuggerAdapter.cxx
  48. +38 −5 Tests/CMakeLib/testDebuggerThread.cxx
  49. +5 −0 Tests/GeneratorExpression/CMakeLists.txt
  50. +1 −1 Tests/RunCMake/CommandLine/E_capabilities-stdout.txt
  51. +1 −0 Tests/RunCMake/FileAPI/check_index.py
  52. +12 −2 Tests/RunCMake/FileAPI/codemodel-v2-check.py
  53. +6 −6 Tests/RunCMake/FileAPI/codemodel-v2-data/directories/cxx.json
  54. +13 −13 Tests/RunCMake/FileAPI/codemodel-v2-data/directories/top.json
  55. +4 −1 Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_exe.json
  56. +3 −3 Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_shared_exe.json
  57. +5 −5 Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_shared_lib.json
  58. +3 −3 Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_static_exe.json
  59. +2 −2 Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_static_lib.json
  60. +1 −1 Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_subdir.json
  61. +10 −7 Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe.json
  62. +4 −4 Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_precompileheader.json
  63. +6 −6 Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_precompileheader_2arch.json
  64. +4 −4 Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_precompileheader_multigen.json
  65. +2 −2 Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_test_launcher.json
  66. +3 −3 Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_shared_exe.json
  67. +5 −5 Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_shared_lib.json
  68. +3 −3 Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_standard_compile_feature_exe.json
  69. +2 −2 ...RunCMake/FileAPI/codemodel-v2-data/targets/cxx_standard_compile_feature_exe_languagestandard.json
  70. +3 −3 Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_standard_exe.json
  71. +3 −3 Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_static_exe.json
  72. +2 −2 Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_static_lib.json
  73. +1 −0 Tests/RunCMake/FileAPI/codemodel-v2.cmake
  74. +2 −0 Tests/RunCMake/FileAPI/cxx/CMakeLists.txt
  75. +2 −0 Tests/RunCMake/GoogleTest/test_launcher.c
  76. +10 −0 Tests/RunCMake/include_external_msproject/NuGet.config
  77. 0 Utilities/Scripts/clang-format.bash
  78. 0 Utilities/Scripts/update-librhash.bash
  79. +2 −1 Utilities/cmlibarchive/libarchive/archive_read_support_format_7zip.c
  80. +3 −0 Utilities/cmlibarchive/libarchive/archive_write_set_format_cpio_binary.c
  81. +4 −1 Utilities/cmlibarchive/libarchive/archive_write_set_format_cpio_odc.c
  82. +1 −1 Utilities/cmnghttp2/lib/nghttp2_map.c
  83. +1 −0 Utilities/cmzlib/gzlib.c
  84. +17 −0 VSInsertion/Packaging/CopyFiles.nuspec
  85. +13 −0 VSInsertion/Packaging/cgmanifest.json
  86. +825 −0 VSInsertion/Pipelines/build.yml
  87. +29 −0 VSInsertion/Signing/Common.props
  88. +10 −0 VSInsertion/Signing/NuGet.config
  89. +78 −0 VSInsertion/Signing/SignFiles.csproj
  90. +19 −0 VSInsertion/Signing/SigningSolution.sln
  91. +4 −0 VSInsertion/Signing/packages.config
  92. +49 −0 VSInsertion/credscan.gdnsuppress
  93. +1 −0 bootstrap
  94. +14 −0 cmake-3.19.4-SHA-256.txt
30 changes: 30 additions & 0 deletions .github/workflows/IntelliCode.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Train IntelliCode

on:
workflow_dispatch:

jobs:
Train:
runs-on: windows-latest

steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: setup-msbuild
uses: microsoft/setup-msbuild@v1.0.1

# Runs CMake generation for VS2019 to generate .vcxproj files (Optional, currently recommended if CMake uses any complex configurations)
- name: run-cmake
uses: lukka/run-cmake@v2.5
with:
cmakeGenerator: VS16Win64
buildDirectory: ${{ github.workspace }}\build

# Trains an IntelliCode model
- name: IntelliCode Team Completions
uses: microsoft/vs-intellicode@v1.0
with:
logs: debug
2 changes: 2 additions & 0 deletions Auxiliary/vim/syntax/cmake.vim
Original file line number Diff line number Diff line change
@@ -155,6 +155,7 @@ syn keyword cmakeProperty contained
\ C_STANDARD_REQUIRED
\ DEBUG_CONFIGURATIONS
\ DEBUG_POSTFIX
\ DEBUGGER_WORKING_DIRECTORY
\ DEFINE_SYMBOL
\ DEFINITIONS
\ DEPENDS
@@ -1139,6 +1140,7 @@ syn keyword cmakeVariable contained
\ CMAKE_C_VISIBILITY_PRESET
\ CMAKE_DEBUG_POSTFIX
\ CMAKE_DEBUG_TARGET_PROPERTIES
\ CMAKE_DEBUGGER_WORKING_DIRECTORY
\ CMAKE_DEFAULT_BUILD_TYPE
\ CMAKE_DEFAULT_CONFIGS
\ CMAKE_DEPENDS_IN_PROJECT_ONLY
18 changes: 17 additions & 1 deletion Help/manual/cmake-file-api.7.rst
Original file line number Diff line number Diff line change
@@ -431,7 +431,7 @@ Version 1 does not exist to avoid confusion with that from
{
"kind": "codemodel",
"version": { "major": 2, "minor": 7 },
"version": { "major": 2, "minor": 8 },
"paths": {
"source": "/path/to/top-level-source-dir",
"build": "/path/to/top-level-build-dir"
@@ -1091,6 +1091,22 @@ with members:
when link-time optimization (a.k.a. interprocedural optimization
or link-time code generation) is enabled.

``debugger``
Optional member that is present when the target has one of the
following fields set.
The value is a JSON object of entries corresponding to
debugger specific values set.

This field was added in codemodel version 2.8.

``workingDirectory``
Optional member that is present when the DEBUGGER_WORKING_DIRECTORY
target property is set.
The member will also be present in Visual Studio Generator
scenarios when VS_DEBUGGER_WORKING_DIRECTORY is set.

This field was added in codemodel version 2.8.

``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.
1 change: 1 addition & 0 deletions Help/manual/cmake-properties.7.rst
Original file line number Diff line number Diff line change
@@ -202,6 +202,7 @@ Properties on Targets
/prop_tgt/CXX_STANDARD
/prop_tgt/CXX_STANDARD_REQUIRED
/prop_tgt/DEBUG_POSTFIX
/prop_tgt/DEBUGGER_WORKING_DIRECTORY
/prop_tgt/DEFINE_SYMBOL
/prop_tgt/DEPLOYMENT_ADDITIONAL_FILES
/prop_tgt/DEPLOYMENT_REMOTE_DIRECTORY
1 change: 1 addition & 0 deletions Help/manual/cmake-variables.7.rst
Original file line number Diff line number Diff line change
@@ -427,6 +427,7 @@ Variables that Control the Build
/variable/CMAKE_CXX_MODULE_STD
/variable/CMAKE_CXX_SCAN_FOR_MODULES
/variable/CMAKE_DEBUG_POSTFIX
/variable/CMAKE_DEBUGGER_WORKING_DIRECTORY
/variable/CMAKE_DEFAULT_BUILD_TYPE
/variable/CMAKE_DEFAULT_CONFIGS
/variable/CMAKE_DEPENDS_USE_COMPILER
11 changes: 11 additions & 0 deletions Help/prop_tgt/DEBUGGER_WORKING_DIRECTORY.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
DEBUGGER_WORKING_DIRECTORY
--------------------------

.. versionadded:: 3.32

Sets the local debugger working directory for C++ targets.
The property value may use
:manual:`generator expressions <cmake-generator-expressions(7)>`.
This property is initialized by the value of the variable
:variable:`CMAKE_DEBUGGER_WORKING_DIRECTORY` if it is set when a target is
created.
15 changes: 15 additions & 0 deletions Help/release/dev/debugger-working-directory.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
debugger-working-directory
--------------------------

* The :variable:`CMAKE_DEBUGGER_WORKING_DIRECTORY` was added to
initialize the corresponding target property.

* The :prop_tgt:`DEBUGGER_WORKING_DIRECTORY` target property was added
to tell generators what debugger working directory should be set for
the target.

* The :manual:`cmake-file-api(7)` "codemodel" version 2 ``version`` field has
been updated to 2.8.

* The :manual:`cmake-file-api(7)` "codemodel" version 2 "target" object gained
a new "debugger" field.
8 changes: 8 additions & 0 deletions Help/variable/CMAKE_DEBUGGER_WORKING_DIRECTORY.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
CMAKE_DEBUGGER_WORKING_DIRECTORY
--------------------------------

.. versionadded:: 3.32

This variable is used to initialize the :prop_tgt:`DEBUGGER_WORKING_DIRECTORY`
property on each target as it is created. See that target property
for additional information.
4 changes: 4 additions & 0 deletions Modules/Platform/Windows-MSVC.cmake
Original file line number Diff line number Diff line change
@@ -264,6 +264,10 @@ else()
string(APPEND CMAKE_C_STANDARD_LIBRARIES_INIT " softintrin.lib")
endif()

if((_MSVC_C_ARCHITECTURE_FAMILY STREQUAL "ARM64EC") OR (_MSVC_CXX_ARCHITECTURE_FAMILY STREQUAL "ARM64EC"))
string(APPEND CMAKE_C_STANDARD_LIBRARIES_INIT " softintrin.lib")
endif()

if(MSVC_VERSION LESS 1310)
set(_FLAGS_C " /Zm1000${_FLAGS_C}")
set(_FLAGS_CXX " /Zm1000${_FLAGS_CXX}")
1 change: 1 addition & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -130,3 +130,4 @@ Contributing
See `CONTRIBUTING.rst`_ for instructions to contribute.

.. _`CONTRIBUTING.rst`: CONTRIBUTING.rst

41 changes: 41 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<!-- BEGIN MICROSOFT SECURITY.MD V0.0.8 BLOCK -->

## Security

Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/).

If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/opensource/security/definition), please report it to us as described below.

## Reporting Security Issues

**Please do not report security vulnerabilities through public GitHub issues.**

Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/opensource/security/create-report).

If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/opensource/security/pgpkey).

You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://aka.ms/opensource/security/msrc).

Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:

* Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
* Full paths of source file(s) related to the manifestation of the issue
* The location of the affected source code (tag/branch/commit or direct URL)
* Any special configuration required to reproduce the issue
* Step-by-step instructions to reproduce the issue
* Proof-of-concept or exploit code (if possible)
* Impact of the issue, including how an attacker might exploit the issue

This information will help us triage your report more quickly.

If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/opensource/security/bounty) page for more details about our active programs.

## Preferred Languages

We prefer all communications to be in English.

## Policy

Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/opensource/security/cvd).

<!-- END MICROSOFT SECURITY.MD BLOCK -->
37 changes: 37 additions & 0 deletions Source/CMakeVersion.cmake
Original file line number Diff line number Diff line change
@@ -12,6 +12,43 @@ if(DEFINED CMake_VERSION_RC)
string(APPEND CMake_VERSION "-rc${CMake_VERSION_RC}")
endif()

# Append Microsoft version suffix if enabled.
# Microsoft version looks like 3.25.0-msvc1, the -msvc1 indicates the revision.
# The corresponding git tag is v3.25.0-msvc1, this would be created in the pipeline.
# To determine the revision, first check if tags like v3.25.0-msvc* exist or not
# - none: we will start with 1.
# - 1 or more exist: the revision would be the max(revisions) + 1.
if(CMake_VERSION_MICROSOFT_SCHEME)
find_package(Git QUIET)
if(GIT_FOUND)
macro(_git)
execute_process(
COMMAND ${GIT_EXECUTABLE} ${ARGN}
WORKING_DIRECTORY ${CMake_SOURCE_DIR}
RESULT_VARIABLE _git_res
OUTPUT_VARIABLE _git_out OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_VARIABLE _git_err ERROR_STRIP_TRAILING_WHITESPACE
)
endmacro()
endif()
if(COMMAND _git)
# Get the Microsoft tags if any, and sort the tags so that the most recent tag listed first.
_git(tag --list "v${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}.${CMake_VERSION_PATCH}-msvc*" --sort -v:refname)
set(microsoft_tags "${_git_out}")
endif()

# Revision starts with 1 by default.
set(MICROSOFT_REVISION "1")

if(microsoft_tags MATCHES "^v${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}.${CMake_VERSION_PATCH}-msvc([0-9]*)")
# Increase revision if previous ones exist.
math(EXPR MICROSOFT_REVISION "${CMAKE_MATCH_1} + 1")
endif()

# Append the suffix.
string(APPEND CMake_VERSION "-msvc${MICROSOFT_REVISION}")
endif()

# Releases define a small patch level.
if("${CMake_VERSION_PATCH}" VERSION_LESS 20000000)
set(CMake_VERSION_IS_RELEASE 1)
13 changes: 9 additions & 4 deletions Source/LexerParser/cmCTestResourceGroupsLexer.cxx
Original file line number Diff line number Diff line change
@@ -596,7 +596,8 @@ static const YY_CHAR yy_ec[256] =
1, 1, 1, 1, 1
} ;

static const YY_CHAR yy_meta[8] =
#define YY_META_LENGTH 8
static const YY_CHAR yy_meta[YY_META_LENGTH] =
{ 0,
1, 1, 1, 2, 2, 1, 2
} ;
@@ -1352,9 +1353,13 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
}
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 29 )
yy_c = yy_meta[yy_c];
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 29 ) {
if (yy_c < 0 || yy_c >= YY_META_LENGTH) {
YY_FATAL_ERROR( "attempted to access an out of bounds location in yy_meta array" );
}
yy_c = yy_meta[yy_c];
}
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
}
13 changes: 9 additions & 4 deletions Source/LexerParser/cmCommandArgumentLexer.cxx
Original file line number Diff line number Diff line change
@@ -596,7 +596,8 @@ static const YY_CHAR yy_ec[256] =
1, 1, 1, 1, 1
} ;

static const YY_CHAR yy_meta[12] =
#define YY_META_LENGTH 12
static const YY_CHAR yy_meta[YY_META_LENGTH] =
{ 0,
1, 2, 3, 4, 3, 4, 4, 4, 3, 5,
3
@@ -1398,9 +1399,13 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
}
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 30 )
yy_c = yy_meta[yy_c];
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 30 ) {
if (yy_c < 0 || yy_c >= YY_META_LENGTH) {
YY_FATAL_ERROR( "attempted to access an out of bounds location in yy_meta array" );
}
yy_c = yy_meta[yy_c];
}
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
}
13 changes: 9 additions & 4 deletions Source/LexerParser/cmFortranLexer.cxx
Original file line number Diff line number Diff line change
@@ -617,7 +617,8 @@ static const YY_CHAR yy_ec[256] =
1, 1, 1, 1, 1
} ;

static const YY_CHAR yy_meta[50] =
#define YY_META_LENGTH 50
static const YY_CHAR yy_meta[YY_META_LENGTH] =
{ 0,
1, 2, 2, 2, 3, 4, 4, 1, 1, 4,
4, 4, 4, 1, 4, 5, 4, 4, 1, 4,
@@ -1745,9 +1746,13 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
}
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 216 )
yy_c = yy_meta[yy_c];
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 216 ) {
if (yy_c < 0 || yy_c >= YY_META_LENGTH) {
YY_FATAL_ERROR( "attempted to access an out of bounds location in yy_meta array" );
}
yy_c = yy_meta[yy_c];
}
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
}
13 changes: 9 additions & 4 deletions Source/LexerParser/cmGccDepfileLexer.cxx
Original file line number Diff line number Diff line change
@@ -597,7 +597,8 @@ static const YY_CHAR yy_ec[256] =
6, 6, 6, 6, 6
} ;

static const YY_CHAR yy_meta[11] =
#define YY_META_LENGTH 11
static const YY_CHAR yy_meta[YY_META_LENGTH] =
{ 0,
1, 2, 1, 1, 2, 1, 1, 1, 1, 3
} ;
@@ -1358,9 +1359,13 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
}
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 32 )
yy_c = yy_meta[yy_c];
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 32 ) {
if (yy_c < 0 || yy_c >= YY_META_LENGTH) {
YY_FATAL_ERROR( "attempted to access an out of bounds location in yy_meta array" );
}
yy_c = yy_meta[yy_c];
}
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
}
19 changes: 12 additions & 7 deletions Source/LexerParser/cmListFileLexer.c
Original file line number Diff line number Diff line change
@@ -620,7 +620,8 @@ static const YY_CHAR yy_ec[256] =
1, 1, 1, 1, 1
} ;

static const YY_CHAR yy_meta[17] =
#define YY_META_LENGTH 17
static const YY_CHAR yy_meta[YY_META_LENGTH] =
{ 0,
1, 1, 2, 3, 4, 3, 1, 3, 5, 6,
1, 6, 1, 1, 7, 2
@@ -1669,9 +1670,13 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
}
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 79 )
yy_c = yy_meta[yy_c];
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 79 ) {
if (yy_c < 0 || yy_c >= YY_META_LENGTH) {
YY_FATAL_ERROR( "attempted to access an out of bounds location in yy_meta array" );
}
yy_c = yy_meta[yy_c];
}
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
}
@@ -2598,7 +2603,7 @@ static void cmListFileLexerAppend(cmListFileLexer* lexer, const char* text,

/* We need to extend the buffer. */
temp = malloc(newSize);
if (lexer->token.text) {
if (temp != NULL && lexer->token.text) {
memcpy(temp, lexer->token.text, lexer->token.length);
free(lexer->token.text);
}
@@ -2722,11 +2727,11 @@ static cmListFileLexer_BOM cmListFileLexer_ReadBOM(FILE* f)
}
} else if (b[0] == 0xFF && b[1] == 0xFE) {
fpos_t p;
fgetpos(f, &p);
int getPosSuccess = fgetpos(f, &p);
if (fread(b, 1, 2, f) == 2 && b[0] == 0 && b[1] == 0) {
return cmListFileLexer_BOM_UTF32LE;
}
if (fsetpos(f, &p) != 0) {
if (getPosSuccess != 0 || fsetpos(f, &p) != 0) {
return cmListFileLexer_BOM_Broken;
}
return cmListFileLexer_BOM_UTF16LE;
3 changes: 2 additions & 1 deletion Source/cmDebuggerAdapter.cxx
Original file line number Diff line number Diff line change
@@ -148,6 +148,7 @@ cmDebuggerAdapter::cmDebuggerAdapter(
SupportsVariableType = req.supportsVariableType.value(false);
dap::CMakeInitializeResponse response;
response.supportsConfigurationDoneRequest = true;
response.supportsValueFormattingOptions = true;
response.cmakeVersion.major = CMake_VERSION_MAJOR;
response.cmakeVersion.minor = CMake_VERSION_MINOR;
response.cmakeVersion.patch = CMake_VERSION_PATCH;
@@ -186,7 +187,7 @@ cmDebuggerAdapter::cmDebuggerAdapter(
std::unique_lock<std::mutex> lock(Mutex);

cm::optional<dap::StackTraceResponse> response =
ThreadManager->GetThreadStackTraceResponse(request.threadId);
ThreadManager->GetThreadStackTraceResponse(request);
if (response.has_value()) {
return response.value();
}
6 changes: 6 additions & 0 deletions Source/cmDebuggerStackFrame.cxx
Original file line number Diff line number Diff line change
@@ -25,4 +25,10 @@ int64_t cmDebuggerStackFrame::GetLine() const noexcept
return this->Function.Line();
}

std::vector<cmListFileArgument> const& cmDebuggerStackFrame::GetArguments()
const noexcept
{
return this->Function.Arguments();
}

} // namespace cmDebugger
3 changes: 3 additions & 0 deletions Source/cmDebuggerStackFrame.h
Original file line number Diff line number Diff line change
@@ -7,8 +7,10 @@
#include <atomic>
#include <cstdint>
#include <string>
#include <vector>

class cmListFileFunction;
struct cmListFileArgument;
class cmMakefile;

namespace cmDebugger {
@@ -32,6 +34,7 @@ class cmDebuggerStackFrame
{
return this->Function;
}
std::vector<cmListFileArgument> const& GetArguments() const noexcept;
};

} // namespace cmDebugger
43 changes: 41 additions & 2 deletions Source/cmDebuggerThread.cxx
Original file line number Diff line number Diff line change
@@ -14,6 +14,7 @@
#include "cmDebuggerVariablesHelper.h"
#include "cmDebuggerVariablesManager.h"
#include "cmListFileCache.h"
#include "cmStringAlgorithms.h"

namespace cmDebugger {

@@ -117,8 +118,27 @@ dap::VariablesResponse cmDebuggerThread::GetVariablesResponse(
}

dap::StackTraceResponse GetStackTraceResponse(
std::shared_ptr<cmDebuggerThread> const& thread)
std::shared_ptr<cmDebuggerThread> const& thread,
dap::optional<dap::StackFrameFormat> format)
{
dap::boolean showParameters = false;
dap::boolean showParameterValues = false;
dap::boolean showLine = false;
if (format.has_value()) {
auto formatValue = format.value();
if (formatValue.parameters.has_value()) {
showParameters = formatValue.parameters.value();
}

if (formatValue.parameterValues.has_value()) {
showParameterValues = formatValue.parameterValues.value();
}

if (formatValue.line.has_value()) {
showLine = formatValue.line.value();
}
}

dap::StackTraceResponse response;
std::unique_lock<std::mutex> lock(thread->Mutex);
for (int i = static_cast<int>(thread->Frames.size()) - 1; i >= 0; --i) {
@@ -136,10 +156,29 @@ dap::StackTraceResponse GetStackTraceResponse(
#endif
stackFrame.line = thread->Frames[i]->GetLine();
stackFrame.column = 1;
stackFrame.name = thread->Frames[i]->GetFunction().OriginalName();
stackFrame.id = thread->Frames[i]->GetId();
stackFrame.source = source;

auto stackName = thread->Frames[i]->GetFunction().OriginalName();
if (showParameters) {
stackName.push_back('(');
if (showParameterValues && !thread->Frames[i]->GetArguments().empty()) {
for (auto const& arg : thread->Frames[i]->GetArguments()) {
stackName = cmStrCat(stackName, arg.Value, ", ");
}

stackName.erase(stackName.end() - 2, stackName.end());
}

stackName.push_back(')');
}

if (showLine) {
stackName =
cmStrCat(stackName, " Line: ", static_cast<int64_t>(stackFrame.line));
}

stackFrame.name = stackName;
response.stackFrames.push_back(stackFrame);
}

8 changes: 7 additions & 1 deletion Source/cmDebuggerThread.h
Original file line number Diff line number Diff line change
@@ -23,6 +23,11 @@ class cmDebuggerVariables;
class cmDebuggerVariablesManager;
}

namespace dap {
template <typename T>
class optional;
}

namespace cmDebugger {

class cmDebuggerThread
@@ -53,7 +58,8 @@ class cmDebuggerThread
dap::VariablesResponse GetVariablesResponse(
dap::VariablesRequest const& request);
friend dap::StackTraceResponse GetStackTraceResponse(
std::shared_ptr<cmDebuggerThread> const& thread);
std::shared_ptr<cmDebuggerThread> const& thread,
dap::optional<dap::StackFrameFormat> format);
};

} // namespace cmDebugger
8 changes: 5 additions & 3 deletions Source/cmDebuggerThreadManager.cxx
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@
#include <algorithm>

#include <cm3p/cppdap/protocol.h>
#include <cm3p/cppdap/types.h>

#include "cmDebuggerThread.h"

@@ -30,18 +31,19 @@ void cmDebuggerThreadManager::EndThread(
}

cm::optional<dap::StackTraceResponse>
cmDebuggerThreadManager::GetThreadStackTraceResponse(int64_t id)
cmDebuggerThreadManager::GetThreadStackTraceResponse(
const dap::StackTraceRequest& request)
{
auto it = find_if(Threads.begin(), Threads.end(),
[&](const std::shared_ptr<cmDebuggerThread>& t) {
return t->GetId() == id;
return t->GetId() == request.threadId;
});

if (it == Threads.end()) {
return {};
}

return GetStackTraceResponse(*it);
return GetStackTraceResponse(*it, request.format);
}

} // namespace cmDebugger
3 changes: 2 additions & 1 deletion Source/cmDebuggerThreadManager.h
Original file line number Diff line number Diff line change
@@ -17,6 +17,7 @@ class cmDebuggerThread;
}

namespace dap {
struct StackTraceRequest;
struct StackTraceResponse;
}

@@ -32,7 +33,7 @@ class cmDebuggerThreadManager
std::shared_ptr<cmDebuggerThread> StartThread(std::string const& name);
void EndThread(std::shared_ptr<cmDebuggerThread> const& thread);
cm::optional<dap::StackTraceResponse> GetThreadStackTraceResponse(
std::int64_t id);
const dap::StackTraceRequest& request);
};

} // namespace cmDebugger
2 changes: 1 addition & 1 deletion Source/cmFileAPI.cxx
Original file line number Diff line number Diff line change
@@ -727,7 +727,7 @@ std::string cmFileAPI::NoSupportedVersion(
// The "codemodel" object kind.

// Update Help/manual/cmake-file-api.7.rst when updating this constant.
static unsigned int const CodeModelV2Minor = 7;
static unsigned int const CodeModelV2Minor = 8;

void cmFileAPI::BuildClientRequestCodeModel(
ClientRequest& r, std::vector<RequestVersion> const& versions)
20 changes: 20 additions & 0 deletions Source/cmFileAPICodemodel.cxx
Original file line number Diff line number Diff line change
@@ -508,6 +508,8 @@ class Target
Json::Value DumpLauncher(const char* name, const char* type);
Json::Value DumpLaunchers();

Json::Value DumpDebugger();

public:
Target(cmGeneratorTarget* gt, std::string const& config);
Json::Value Dump();
@@ -1273,6 +1275,11 @@ Json::Value Target::Dump()

target["backtraceGraph"] = this->Backtraces.Dump();

Json::Value debugger = this->DumpDebugger();
if (!debugger.isNull()) {
target["debugger"] = std::move(debugger);
}

return target;
}

@@ -2134,6 +2141,19 @@ Json::Value Target::DumpLaunchers()
}
}

Json::Value Target::DumpDebugger()
{
Json::Value debuggerInformation;
if (cmValue debuggerWorkingDirectory =
this->GT->GetGlobalGenerator()->GetDebuggerWorkingDirectory(
this->GT)) {
debuggerInformation = Json::objectValue;
debuggerInformation["workingDirectory"] = *debuggerWorkingDirectory;
}

return debuggerInformation;
}

Json::Value cmFileAPICodemodelDump(cmFileAPI& fileAPI, unsigned long version)
{
Codemodel codemodel(fileAPI, version);
6 changes: 6 additions & 0 deletions Source/cmGlobalGenerator.cxx
Original file line number Diff line number Diff line change
@@ -3180,6 +3180,12 @@ void cmGlobalGenerator::AppendDirectoryForConfig(const std::string& /*unused*/,
// configuration.
}

cmValue cmGlobalGenerator::GetDebuggerWorkingDirectory(
cmGeneratorTarget* gt) const
{
return gt->GetProperty("DEBUGGER_WORKING_DIRECTORY");
}

cmGlobalGenerator::TargetDependSet const&
cmGlobalGenerator::GetTargetDirectDepends(cmGeneratorTarget const* target)
{
2 changes: 2 additions & 0 deletions Source/cmGlobalGenerator.h
Original file line number Diff line number Diff line change
@@ -506,6 +506,8 @@ class cmGlobalGenerator
// Default config to use for cmake --build
virtual std::string GetDefaultBuildConfig() const { return "Debug"; }

virtual cmValue GetDebuggerWorkingDirectory(cmGeneratorTarget* gt) const;

// Class to track a set of dependencies.
using TargetDependSet = cmTargetDependSet;

77 changes: 45 additions & 32 deletions Source/cmGlobalVisualStudio8Generator.cxx
Original file line number Diff line number Diff line change
@@ -370,9 +370,15 @@ void cmGlobalVisualStudio8Generator::WriteSolutionConfigurations(
std::ostream& fout, std::vector<std::string> const& configs)
{
fout << "\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n";
for (std::string const& i : configs) {
fout << "\t\t" << i << '|' << this->GetPlatformName() << " = " << i << '|'
<< this->GetPlatformName() << '\n';
std::vector<std::string> platforms = { this->GetPlatformName() };
if (this->GetBuildAsX()) {
platforms.push_back("ARM64");
}
for (std::string const& p : platforms) {
for (std::string const& i : configs) {
fout << "\t\t" << i << "|" << p << " = " << i << "|"
<< p << "\n";
}
}
fout << "\tEndGlobalSection\n";
}
@@ -384,37 +390,44 @@ void cmGlobalVisualStudio8Generator::WriteProjectConfigurations(
std::string const& platformMapping)
{
std::string guid = this->GetGUID(name);
for (std::string const& i : configs) {
cmList mapConfig;
const char* dstConfig = i.c_str();
if (target.GetProperty("EXTERNAL_MSPROJECT")) {
if (cmValue m = target.GetProperty(
cmStrCat("MAP_IMPORTED_CONFIG_", cmSystemTools::UpperCase(i)))) {
mapConfig.assign(*m);
if (!mapConfig.empty()) {
dstConfig = mapConfig[0].c_str();
std::vector<std::string> platforms = { this->GetPlatformName() };
if (this->GetBuildAsX()) {
platforms.push_back("ARM64");
}

for (std::string const& p : platforms) {
for (std::string const& i : configs) {
std::vector<std::string> mapConfig;
const char* dstConfig = i.c_str();
if (target.GetProperty("EXTERNAL_MSPROJECT")) {
if (cmValue m = target.GetProperty("MAP_IMPORTED_CONFIG_" +
cmSystemTools::UpperCase(i))) {
cmExpandList(*m, mapConfig);
if (!mapConfig.empty()) {
dstConfig = mapConfig[0].c_str();
}
}
}
}
fout << "\t\t{" << guid << "}." << i << '|' << this->GetPlatformName()
<< ".ActiveCfg = " << dstConfig << '|'
<< (!platformMapping.empty() ? platformMapping
: this->GetPlatformName())
<< '\n';
auto ci = configsPartOfDefaultBuild.find(i);
if (!(ci == configsPartOfDefaultBuild.end())) {
fout << "\t\t{" << guid << "}." << i << '|' << this->GetPlatformName()
<< ".Build.0 = " << dstConfig << '|'
<< (!platformMapping.empty() ? platformMapping
: this->GetPlatformName())
<< '\n';
}
if (this->NeedsDeploy(target, dstConfig)) {
fout << "\t\t{" << guid << "}." << i << '|' << this->GetPlatformName()
<< ".Deploy.0 = " << dstConfig << '|'
<< (!platformMapping.empty() ? platformMapping
: this->GetPlatformName())
<< '\n';
fout << "\t\t{" << guid << "}." << i << "|" << p
<< ".ActiveCfg = " << dstConfig << "|"
<< (!platformMapping.empty() ? platformMapping
: p)
<< "\n";
auto ci = configsPartOfDefaultBuild.find(i);
if (!(ci == configsPartOfDefaultBuild.end())) {
fout << "\t\t{" << guid << "}." << i << "|" << p
<< ".Build.0 = " << dstConfig << "|"
<< (!platformMapping.empty() ? platformMapping
: p)
<< "\n";
}
if (this->NeedsDeploy(target, dstConfig)) {
fout << "\t\t{" << guid << "}." << i << "|" << p
<< ".Deploy.0 = " << dstConfig << "|"
<< (!platformMapping.empty() ? platformMapping
: p)
<< "\n";
}
}
}
}
15 changes: 15 additions & 0 deletions Source/cmGlobalVisualStudioGenerator.cxx
Original file line number Diff line number Diff line change
@@ -93,6 +93,16 @@ bool cmGlobalVisualStudioGenerator::InitializePlatform(cmMakefile*)
return true;
}

cmValue cmGlobalVisualStudioGenerator::GetDebuggerWorkingDirectory(
cmGeneratorTarget* gt) const
{
if (cmValue ret = gt->GetProperty("VS_DEBUGGER_WORKING_DIRECTORY")) {
return ret;
} else {
return cmGlobalGenerator::GetDebuggerWorkingDirectory(gt);
}
}

std::string const& cmGlobalVisualStudioGenerator::GetPlatformName() const
{
if (!this->GeneratorPlatform.empty()) {
@@ -101,6 +111,11 @@ std::string const& cmGlobalVisualStudioGenerator::GetPlatformName() const
return this->DefaultPlatformName;
}

bool cmGlobalVisualStudioGenerator::GetBuildAsX() const
{
return this->CMakeInstance->GetBuildAsX();
}

const char* cmGlobalVisualStudioGenerator::GetIDEVersion() const
{
switch (this->Version) {
7 changes: 7 additions & 0 deletions Source/cmGlobalVisualStudioGenerator.h
Original file line number Diff line number Diff line change
@@ -61,6 +61,11 @@ class cmGlobalVisualStudioGenerator : public cmGlobalGenerator
*/
std::string const& GetPlatformName() const;

/**
* Get if the BuildAsX Variable is passed in.
*/
bool cmGlobalVisualStudioGenerator::GetBuildAsX() const;

/**
* Configure CMake's Visual Studio macros file into the user's Visual
* Studio macros directory.
@@ -80,6 +85,8 @@ class cmGlobalVisualStudioGenerator : public cmGlobalGenerator
*/
virtual std::string GetUserMacrosRegKeyBase();

cmValue GetDebuggerWorkingDirectory(cmGeneratorTarget* gt) const override;

enum MacroName
{
MacroReload,
2 changes: 1 addition & 1 deletion Source/cmString.cxx
Original file line number Diff line number Diff line change
@@ -56,7 +56,7 @@ std::string const* String::str_if_stable() const
std::string const& String::str()
{
if (std::string const* s = this->str_if_stable()) {
return *s;
return *s; // CodeQL [SM02311] False Positive: CodeQL wrongly detected because the above if statement checks for NULL
}
// Mutate to hold a std::string that is stable for the lifetime
// of our current value.
2 changes: 2 additions & 0 deletions Source/cmTarget.cxx
Original file line number Diff line number Diff line change
@@ -373,6 +373,8 @@ struct TargetProperty

TargetProperty const StaticTargetProperties[] = {
/* clang-format off */
// -- Debugger Properties
{ "DEBUGGER_WORKING_DIRECTORY"_s, IC::ExecutableTarget },
// Compilation properties
{ "COMPILE_WARNING_AS_ERROR"_s, IC::CanCompileSources },
{ "INTERPROCEDURAL_OPTIMIZATION"_s, IC::CanCompileSources },
527 changes: 293 additions & 234 deletions Source/cmVisualStudio10TargetGenerator.cxx

Large diffs are not rendered by default.

10 changes: 6 additions & 4 deletions Source/cmVisualStudio10TargetGenerator.h
Original file line number Diff line number Diff line change
@@ -65,7 +65,7 @@ class cmVisualStudio10TargetGenerator
std::unordered_map<std::string, std::string>>;

std::string ConvertPath(std::string const& path, bool forceRelative);
std::string CalcCondition(const std::string& config) const;
std::string CalcCondition(const std::string& config, const std::string& platform = "") const;
void WriteProjectConfigurations(Elem& e0);
void WriteProjectConfigurationValues(Elem& e0);
void WriteMSToolConfigurationValues(Elem& e1, std::string const& config);
@@ -124,10 +124,10 @@ class cmVisualStudio10TargetGenerator

bool ComputeClOptions();
bool ComputeClOptions(std::string const& configName);
void WriteClOptions(Elem& e1, std::string const& config);
void WriteClOptions(Elem& e1, std::string const& config, std::string const& platform = "");
bool ComputeRcOptions();
bool ComputeRcOptions(std::string const& config);
void WriteRCOptions(Elem& e1, std::string const& config);
void WriteRCOptions(Elem& e1, std::string const& config, std::string const& platform = "");
bool ComputeCudaOptions();
bool ComputeCudaOptions(std::string const& config);
void WriteCudaOptions(Elem& e1, std::string const& config);
@@ -153,7 +153,8 @@ class cmVisualStudio10TargetGenerator
void WriteLinkOptions(Elem& e1, std::string const& config);
void WriteMidlOptions(Elem& e1, std::string const& config);
void WriteAntBuildOptions(Elem& e1, std::string const& config);
void OutputLinkIncremental(Elem& e1, std::string const& configName);
void OutputLinkIncremental(Elem& e1, std::string const& configName,
std::string const& platName);
void WriteCustomRule(Elem& e0, cmSourceFile const* source,
cmCustomCommand const& command);
enum class BuildInParallel
@@ -238,6 +239,7 @@ class cmVisualStudio10TargetGenerator
bool MSTools;
bool Managed;
bool NsightTegra;
bool BuildAsX;
bool Android;
bool HaveCustomCommandDepfile = false;
std::map<std::string, bool> ScanSourceForModuleDependencies;
20 changes: 15 additions & 5 deletions Source/cmVisualStudioGeneratorOptions.cxx
Original file line number Diff line number Diff line change
@@ -23,10 +23,11 @@ static void cmVS10EscapeForMSBuild(std::string& ret)

cmVisualStudioGeneratorOptions::cmVisualStudioGeneratorOptions(
cmLocalVisualStudioGenerator* lg, Tool tool, cmVS7FlagTable const* table,
cmVS7FlagTable const* extraTable)
cmVS7FlagTable const* extraTable, bool buildAsX)
: cmIDEOptions()
, LocalGenerator(lg)
, CurrentTool(tool)
, BuildAsX(buildAsX)
{
// Store the given flag tables.
this->AddTable(table);
@@ -326,7 +327,11 @@ void cmVisualStudioGeneratorOptions::StoreUnknownFlag(std::string const& flag)
flag.c_str(),
cmOutputConverter::Shell_Flag_AllowMakeVariables |
cmOutputConverter::Shell_Flag_VSIDE);
this->AppendFlagString(this->UnknownFlagField, opts);
if (!((this->BuildAsX && opts.find("machine:") != std::string::npos) ||
(opts.find("machine:ARM64X") != std::string::npos)))
{
this->AppendFlagString(this->UnknownFlagField, opts);
}
}

cmIDEOptions::FlagValue cmVisualStudioGeneratorOptions::TakeFlag(
@@ -353,11 +358,13 @@ const std::string& cmVisualStudioGeneratorOptions::GetConfiguration() const
}

void cmVisualStudioGeneratorOptions::OutputPreprocessorDefinitions(
std::ostream& fout, int indent, const std::string& lang)
std::ostream& fout, int indent, const std::string& lang, std::string const& platform)
{
if (this->Defines.empty()) {
return;
}
std::vector<std::string> arm64ecDefines = { "_AMD64_", "AMD64", "_ARM64EC_",
"ARM64EC" };
std::string tag = "PreprocessorDefinitions";
if (lang == "CUDA"_s) {
tag = "Defines";
@@ -381,8 +388,11 @@ void cmVisualStudioGeneratorOptions::OutputPreprocessorDefinitions(
// Escape the definition for the compiler.
define = this->LocalGenerator->EscapeForShell(di, true);
}
// Store the flag in the project file.
oss << ';' << define;
if (!(this->BuildAsX && platform == "ARM64" &&
std::find(arm64ecDefines.begin(), arm64ecDefines.end(), define) != arm64ecDefines.end())) {
// Store the flag in the project file.
oss << ';' << define;
}
}

this->OutputFlag(fout, indent, tag, oss.str());
7 changes: 5 additions & 2 deletions Source/cmVisualStudioGeneratorOptions.h
Original file line number Diff line number Diff line change
@@ -35,7 +35,8 @@ class cmVisualStudioGeneratorOptions : public cmIDEOptions
};
cmVisualStudioGeneratorOptions(cmLocalVisualStudioGenerator* lg, Tool tool,
cmVS7FlagTable const* table = nullptr,
cmVS7FlagTable const* extraTable = nullptr);
cmVS7FlagTable const* extraTable = nullptr,
bool buildAsX = false);

// Add a table of flags.
void AddTable(cmVS7FlagTable const* table);
@@ -73,7 +74,8 @@ class cmVisualStudioGeneratorOptions : public cmIDEOptions
bool IsManaged() const;
// Write options to output.
void OutputPreprocessorDefinitions(std::ostream& fout, int indent,
const std::string& lang);
const std::string& lang,
std::string const& platform = "");
void OutputAdditionalIncludeDirectories(std::ostream& fout, int indent,
const std::string& lang);
void OutputFlagMap(std::ostream& fout, int indent);
@@ -91,6 +93,7 @@ class cmVisualStudioGeneratorOptions : public cmIDEOptions
std::string Configuration;
Tool CurrentTool;

bool BuildAsX;
bool FortranRuntimeDebug;
bool FortranRuntimeDLL;
bool FortranRuntimeMT;
4 changes: 4 additions & 0 deletions Source/cmake.cxx
Original file line number Diff line number Diff line change
@@ -747,6 +747,10 @@ void cmake::ProcessCacheArg(const std::string& var, const std::string& value,
}
}

if (var == "MSVC_BUILD_AS_X") {
this->BuildAsX = true;
}

this->AddCacheEntry(
var, value, "No help, variable specified on the command line.", type);

7 changes: 7 additions & 0 deletions Source/cmake.h
Original file line number Diff line number Diff line change
@@ -371,6 +371,12 @@ class cmake
//! Is this cmake running as a result of a TRY_COMPILE command
bool GetIsInTryCompile() const;

//! Return if building as ARM64X is set
bool GetBuildAsX()
{
return this->BuildAsX;
}

#ifndef CMAKE_BOOTSTRAP
void SetWarningFromPreset(const std::string& name,
const cm::optional<bool>& warning,
@@ -706,6 +712,7 @@ class cmake
std::string GeneratorInstance;
std::string GeneratorPlatform;
std::string GeneratorToolset;
bool BuildAsX = false;
bool GeneratorInstanceSet = false;
bool GeneratorPlatformSet = false;
bool GeneratorToolsetSet = false;
15 changes: 15 additions & 0 deletions Source/cmakemain.cxx
Original file line number Diff line number Diff line change
@@ -1042,6 +1042,21 @@ int do_open(int ac, char const* const* av)

int main(int ac, char const* const* av)
{
#if defined(_WIN32) && !defined(__CYGWIN__)
// Debugging aid. This allows us to set up a registry
// key indicating a sleep period when the process starts,
// giving us enough time to attach the debugger.
std::string sleepval;
if (cmSystemTools::ReadRegistryValue(
"HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\"
"VCCMake;Sleep",
sleepval, cmSystemTools::KeyWOW64_32))
{
int sleepinMS = atoi(sleepval.c_str());
Sleep(sleepinMS);
}
#endif

cmSystemTools::EnsureStdPipes();

// Replace streambuf so we can output Unicode to console
2 changes: 1 addition & 1 deletion Source/kwsys/ProcessWin32.c
Original file line number Diff line number Diff line change
@@ -2671,7 +2671,7 @@ static int kwsysProcessesAdd(HANDLE hProcess, DWORD dwProcessid,
if ((newArray = (kwsysProcessInstance*)malloc(
newSize * sizeof(kwsysProcessInstance)))) {
/* Copy the old process handles to the new memory. */
if (kwsysProcesses.Count > 0) {
if (newArray != NULL && kwsysProcesses.Count > 0) {
memcpy(newArray, kwsysProcesses.Processes,
kwsysProcesses.Count * sizeof(kwsysProcessInstance));
}
4 changes: 2 additions & 2 deletions Source/kwsys/RegularExpression.cxx
Original file line number Diff line number Diff line change
@@ -1120,7 +1120,7 @@ int RegExpFind::regmatch(const char* prog)

const char* save;

if (OP(next) != BRANCH) // No choice.
if (next != NULL && OP(next) != BRANCH) // No choice.
next = OPERAND(scan); // Avoid recursion.
else {
do {
@@ -1146,7 +1146,7 @@ int RegExpFind::regmatch(const char* prog)
// what character comes next.
//
nextch = '\0';
if (OP(next) == EXACTLY)
if (next != NULL && OP(next) == EXACTLY)
nextch = *OPERAND(next);
min_no = (OP(scan) == STAR) ? 0 : 1;
save = reginput;
2 changes: 1 addition & 1 deletion Source/kwsys/SystemTools.cxx
Original file line number Diff line number Diff line change
@@ -4122,7 +4122,7 @@ bool SystemTools::FileHasSignature(const char* filename, const char* signature,

bool res = false;
size_t signature_len = strlen(signature);
char* buffer = new char[signature_len];
char* buffer = new char[signature_len+1]; // We need to add one to the string length to store the null terminator

if (fread(buffer, 1, signature_len, fp) == signature_len) {
res = (!strncmp(buffer, signature, signature_len) ? true : false);
2 changes: 1 addition & 1 deletion Source/kwsys/Terminal.c
Original file line number Diff line number Diff line change
@@ -172,7 +172,7 @@ static int kwsysTerminalStreamIsVT100(FILE* stream, int default_vt100,
{
const char* clicolor_force = getenv("CLICOLOR_FORCE");
if (clicolor_force && *clicolor_force &&
strcmp(clicolor_force, "0") != 0) {
strcmp(clicolor_force, "0") != 0) { // CodeQL [SM02345] False Positive: CodeQL wrongly detected because the if conditions check for NULL
return 1;
}
}
9 changes: 6 additions & 3 deletions Source/kwsys/testEncode.c
Original file line number Diff line number Diff line change
@@ -58,9 +58,12 @@ int testEncode(int argc, char* argv[])
/* Test MD5 digest. */
{
kwsysMD5* md5 = kwsysMD5_New();
result |= testMD5_1(md5);
result |= testMD5_2(md5);
kwsysMD5_Delete(md5);
if (md5 != NULL)
{
result |= testMD5_1(md5);
result |= testMD5_2(md5);
kwsysMD5_Delete(md5);
}
}

return result;
2 changes: 1 addition & 1 deletion Source/kwsys/testProcess.c
Original file line number Diff line number Diff line change
@@ -712,7 +712,7 @@ int main(int argc, const char* argv[])
#endif
return r;
}
if (argc > 2 && strcmp(argv[1], "0") == 0) {
if (argc > 2 && strcmp(argv[1], "0") == 0) { // CodeQL [SM02345] False Positive: CodeQL wrongly detected because the check for argc confirms argv[1] isn't NULL
/* This is the special debugging test to run a given command
line. */
const char** cmd = argv + 2;
1 change: 1 addition & 0 deletions Tests/CMakeLib/testDebuggerAdapter.cxx
Original file line number Diff line number Diff line change
@@ -134,6 +134,7 @@ bool runTest(std::function<bool(dap::Session&)> onThreadExitedEvent)
ASSERT_TRUE(initializeResponse.response.supportsExceptionInfoRequest);
ASSERT_TRUE(
initializeResponse.response.exceptionBreakpointFilters.has_value());
ASSERT_TRUE(initializeResponse.response.supportsValueFormattingOptions);

dap::LaunchRequest launchRequest;
auto launchResponse = client->send(launchRequest).get();
43 changes: 38 additions & 5 deletions Tests/CMakeLib/testDebuggerThread.cxx
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@
#include <string>
#include <vector>

#include <cm3p/cppdap/optional.h>
#include <cm3p/cppdap/protocol.h>
#include <cm3p/cppdap/types.h>

@@ -11,23 +12,55 @@

#include "testCommon.h"

static bool testStackFrameFunctionName()
static bool testStackFrameFunctionName(
dap::optional<dap::StackFrameFormat> format, const char* expectedName)
{
auto thread = std::make_shared<cmDebugger::cmDebuggerThread>(0, "name");
const auto* functionName = "function_name";
auto arguments = std::vector<cmListFileArgument>{};
auto arguments = std::vector<cmListFileArgument>{ cmListFileArgument(
"arg", cmListFileArgument::Delimiter::Unquoted, 0) };
cmListFileFunction func(functionName, 10, 20, arguments);
thread->PushStackFrame(nullptr, "CMakeLists.txt", func);

auto stackTrace = GetStackTraceResponse(thread);
auto stackTrace = GetStackTraceResponse(thread, format);

ASSERT_TRUE(stackTrace.stackFrames[0].name == functionName);
ASSERT_TRUE(stackTrace.stackFrames[0].name == expectedName);
return true;
}

bool testStackFrameNoFormatting()
{
return testStackFrameFunctionName({}, "function_name");
}

bool testStackFrameFormatParameters()
{
dap::StackFrameFormat format;
format.parameters = true;
return testStackFrameFunctionName(format, "function_name()");
}

bool testStackFrameFormatParameterValues()
{
dap::StackFrameFormat format;
format.parameters = true;
format.parameterValues = true;
return testStackFrameFunctionName(format, "function_name(arg)");
}

bool testStackFrameFormatLine()
{
dap::StackFrameFormat format;
format.line = true;
return testStackFrameFunctionName(format, "function_name Line: 10");
}

int testDebuggerThread(int, char*[])
{
return runTests(std::vector<std::function<bool()>>{
testStackFrameFunctionName,
testStackFrameNoFormatting,
testStackFrameFormatParameters,
testStackFrameFormatParameterValues,
testStackFrameFormatLine
});
}
5 changes: 5 additions & 0 deletions Tests/GeneratorExpression/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -232,6 +232,11 @@ set_property(TARGET importedFallback4 PROPERTY IMPORTED_IMPLIB imp_loc)
add_library(importedFallback5 SHARED IMPORTED)
set_property(TARGET importedFallback5 PROPERTY IMPORTED_IMPLIB imp_loc)

# START MICROSOFT CHANGE
# We build RelWithDebInfo, but Kitware only builds Debug and Release for tests.
set_property(TARGET importedFallback2 PROPERTY MAP_IMPORTED_CONFIG_RELWITHDEBINFO SPECIAL "")
# END MICROSOFT CHANGE

add_library(importedFallback_genex STATIC IMPORTED)
set_property(TARGET importedFallback_genex PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
set_property(TARGET importedFallback_genex PROPERTY IMPORTED_LOCATION_RELEASE release_loc)
2 changes: 1 addition & 1 deletion Tests/RunCMake/CommandLine/E_capabilities-stdout.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
^{"debugger":(true|false),"fileApi":{"requests":\[{"kind":"codemodel","version":\[{"major":2,"minor":7}]},{"kind":"configureLog","version":\[{"major":1,"minor":0}]},{"kind":"cache","version":\[{"major":2,"minor":0}]},{"kind":"cmakeFiles","version":\[{"major":1,"minor":1}]},{"kind":"toolchains","version":\[{"major":1,"minor":0}]}]},"generators":\[.*\],"serverMode":false,"tls":(true|false),"version":{.*}}$
^{"debugger":(true|false),"fileApi":{"requests":\[{"kind":"codemodel","version":\[{"major":2,"minor":8}]},{"kind":"configureLog","version":\[{"major":1,"minor":0}]},{"kind":"cache","version":\[{"major":2,"minor":0}]},{"kind":"cmakeFiles","version":\[{"major":1,"minor":1}]},{"kind":"toolchains","version":\[{"major":1,"minor":0}]}]},"generators":\[.*\],"serverMode":false,"tls":(true|false),"version":{.*}}$
1 change: 1 addition & 0 deletions Tests/RunCMake/FileAPI/check_index.py
Original file line number Diff line number Diff line change
@@ -5,6 +5,7 @@

if sys.version_info[0] >= 3:
unicode = str
long = int

def is_bool(x, val=None):
return isinstance(x, bool) and (val is None or x == val)
14 changes: 12 additions & 2 deletions Tests/RunCMake/FileAPI/codemodel-v2-check.py
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@ def read_codemodel_json_data(filename):
def check_objects(o, g):
assert is_list(o)
assert len(o) == 1
check_index_object(o[0], "codemodel", 2, 7, check_object_codemodel(g))
check_index_object(o[0], "codemodel", 2, 8, check_object_codemodel(g))

def check_backtrace(t, b, backtrace):
btg = t["backtraceGraph"]
@@ -24,7 +24,7 @@ def check_backtrace(t, b, backtrace):

if expected["line"] is not None:
expected_keys.append("line")
assert is_int(node["line"], expected["line"])
assert is_int(node["line"], expected["line"]), repr(node["line"]) + " != " + repr(expected["line"])

if expected["command"] is not None:
expected_keys.append("command")
@@ -429,6 +429,14 @@ def check_launcher(actual, expected):
missing_exception=lambda e: "launchers: %s" % e,
extra_exception=lambda a: "launchers: %s" % a)

if "debugger" in expected:
if expected["debugger"] is not None:
expected_keys.append("debugger")
assert is_dict(obj["debugger"])
debugger_keys = ["workingDirectory"]
assert sorted(obj["debugger"].keys()) == sorted(debugger_keys)
assert matches(obj["debugger"]["workingDirectory"], expected["debugger"]["workingDirectory"])

if expected["link"] is not None:
expected_keys.append("link")
assert is_dict(obj["link"])
@@ -956,6 +964,8 @@ def gen_check_targets(c, g, inSource):
for d in e["dependencies"]:
if matches(d["id"], "^\\^ZERO_CHECK::@"):
d["id"] = "^ZERO_CHECK::@6890427a1f51a3e7e1df$"
if e["name"] == "cxx_exe":
e["debugger"]["workingDirectory"] = "^/test/debugger/workingDirectoryVS$"

elif g["name"] == "Xcode":
if ';' in os.environ.get("CMAKE_OSX_ARCHITECTURES", ""):
12 changes: 6 additions & 6 deletions Tests/RunCMake/FileAPI/codemodel-v2-data/directories/cxx.json
Original file line number Diff line number Diff line change
@@ -42,7 +42,7 @@
"backtrace": [
{
"file": "^cxx/CMakeLists\\.txt$",
"line": 38,
"line": 40,
"command": "install",
"hasParent": true
},
@@ -76,7 +76,7 @@
"backtrace": [
{
"file": "^cxx/CMakeLists\\.txt$",
"line": 38,
"line": 40,
"command": "install",
"hasParent": true
},
@@ -107,7 +107,7 @@
"backtrace": [
{
"file": "^cxx/CMakeLists\\.txt$",
"line": 38,
"line": 40,
"command": "install",
"hasParent": true
},
@@ -138,7 +138,7 @@
"backtrace": [
{
"file": "^cxx/CMakeLists\\.txt$",
"line": 38,
"line": 40,
"command": "install",
"hasParent": true
},
@@ -170,7 +170,7 @@
"backtrace": [
{
"file": "^cxx/CMakeLists\\.txt$",
"line": 43,
"line": 45,
"command": "install",
"hasParent": true
},
@@ -202,7 +202,7 @@
"backtrace": [
{
"file": "^cxx/CMakeLists\\.txt$",
"line": 43,
"line": 45,
"command": "install",
"hasParent": true
},
26 changes: 13 additions & 13 deletions Tests/RunCMake/FileAPI/codemodel-v2-data/directories/top.json
Original file line number Diff line number Diff line change
@@ -51,7 +51,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
"line": 43,
"line": 44,
"command": "install",
"hasParent": true
},
@@ -96,7 +96,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
"line": 46,
"line": 47,
"command": "install",
"hasParent": true
},
@@ -144,7 +144,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
"line": 46,
"line": 47,
"command": "install",
"hasParent": true
},
@@ -189,7 +189,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
"line": 46,
"line": 47,
"command": "install",
"hasParent": true
},
@@ -233,7 +233,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
"line": 46,
"line": 47,
"command": "install",
"hasParent": true
},
@@ -277,7 +277,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
"line": 51,
"line": 52,
"command": "install",
"hasParent": true
},
@@ -324,7 +324,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
"line": 53,
"line": 54,
"command": "install",
"hasParent": true
},
@@ -369,7 +369,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
"line": 54,
"line": 55,
"command": "install",
"hasParent": true
},
@@ -418,7 +418,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
"line": 55,
"line": 56,
"command": "install",
"hasParent": true
},
@@ -470,7 +470,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
"line": 56,
"line": 57,
"command": "install",
"hasParent": true
},
@@ -519,7 +519,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
"line": 57,
"line": 58,
"command": "install",
"hasParent": true
},
@@ -561,7 +561,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
"line": 58,
"line": 59,
"command": "install",
"hasParent": true
},
@@ -603,7 +603,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
"line": 59,
"line": 60,
"command": "install",
"hasParent": true
},
5 changes: 4 additions & 1 deletion Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_exe.json
Original file line number Diff line number Diff line change
@@ -142,5 +142,8 @@
"id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$",
"backtrace": null
}
]
],
"debugger": {
"workingDirectory": "^/test/debugger/workingDirectory$"
}
}
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
"line": 10,
"line": 11,
"command": "add_executable",
"hasParent": true
},
@@ -64,7 +64,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
"line": 10,
"line": 11,
"command": "add_executable",
"hasParent": true
},
@@ -114,7 +114,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
"line": 11,
"line": 12,
"command": "target_link_libraries",
"hasParent": true
},
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
"line": 9,
"line": 10,
"command": "add_library",
"hasParent": true
},
@@ -69,7 +69,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
"line": 9,
"line": 10,
"command": "add_library",
"hasParent": true
},
@@ -118,7 +118,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
"line": 46,
"line": 47,
"command": "install",
"hasParent": true
},
@@ -148,7 +148,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
"line": 46,
"line": 47,
"command": "install",
"hasParent": true
},
@@ -178,7 +178,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
"line": 51,
"line": 52,
"command": "install",
"hasParent": true
},
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
"line": 14,
"line": 15,
"command": "add_executable",
"hasParent": true
},
@@ -64,7 +64,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
"line": 14,
"line": 15,
"command": "add_executable",
"hasParent": true
},
@@ -114,7 +114,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
"line": 15,
"line": 16,
"command": "target_link_libraries",
"hasParent": true
},
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
"line": 13,
"line": 14,
"command": "add_library",
"hasParent": true
},
@@ -64,7 +64,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
"line": 13,
"line": 14,
"command": "add_library",
"hasParent": true
},
Original file line number Diff line number Diff line change
@@ -89,7 +89,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
"line": 17,
"line": 18,
"command": "add_library",
"hasParent": true
},
17 changes: 10 additions & 7 deletions Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe.json
Original file line number Diff line number Diff line change
@@ -52,7 +52,7 @@
"backtrace": [
{
"file": "^cxx/CMakeLists\\.txt$",
"line": 21,
"line": 23,
"command": "target_precompile_headers",
"hasParent": true
},
@@ -71,7 +71,7 @@
"backtrace": [
{
"file": "^cxx/CMakeLists\\.txt$",
"line": 17,
"line": 19,
"command": "target_compile_options",
"hasParent": true
},
@@ -122,7 +122,7 @@
"backtrace": [
{
"file": "^cxx/CMakeLists\\.txt$",
"line": 38,
"line": 40,
"command": "install",
"hasParent": true
},
@@ -139,7 +139,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
"line": 43,
"line": 44,
"command": "install",
"hasParent": true
},
@@ -175,7 +175,7 @@
"backtrace": [
{
"file": "^cxx/CMakeLists\\.txt$",
"line": 18,
"line": 20,
"command": "target_link_options",
"hasParent": true
},
@@ -193,7 +193,7 @@
"backtrace": [
{
"file": "^cxx/CMakeLists\\.txt$",
"line": 19,
"line": 21,
"command": "target_link_directories",
"hasParent": true
},
@@ -248,5 +248,8 @@
"id": "^ZERO_CHECK::@a56b12a3f5c0529fb296$",
"backtrace": null
}
]
],
"debugger": {
"workingDirectory": "^/test/debugger/workingDirectory$"
}
}
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@
"backtrace": [
{
"file": "^cxx/CMakeLists\\.txt$",
"line": 21,
"line": 23,
"command": "target_precompile_headers",
"hasParent": true
},
@@ -33,7 +33,7 @@
"backtrace": [
{
"file": "^cxx/CMakeLists\\.txt$",
"line": 17,
"line": 19,
"command": "target_compile_options",
"hasParent": true
},
@@ -61,7 +61,7 @@
"backtrace": [
{
"file": "^cxx/CMakeLists\\.txt$",
"line": 21,
"line": 23,
"command": "target_precompile_headers",
"hasParent": true
},
@@ -80,7 +80,7 @@
"backtrace": [
{
"file": "^cxx/CMakeLists\\.txt$",
"line": 17,
"line": 19,
"command": "target_compile_options",
"hasParent": true
},
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@
"backtrace": [
{
"file": "^cxx/CMakeLists\\.txt$",
"line": 21,
"line": 23,
"command": "target_precompile_headers",
"hasParent": true
},
@@ -33,7 +33,7 @@
"backtrace": [
{
"file": "^cxx/CMakeLists\\.txt$",
"line": 17,
"line": 19,
"command": "target_compile_options",
"hasParent": true
},
@@ -61,7 +61,7 @@
"backtrace": [
{
"file": "^cxx/CMakeLists\\.txt$",
"line": 21,
"line": 23,
"command": "target_precompile_headers",
"hasParent": true
},
@@ -80,7 +80,7 @@
"backtrace": [
{
"file": "^cxx/CMakeLists\\.txt$",
"line": 17,
"line": 19,
"command": "target_compile_options",
"hasParent": true
},
@@ -108,7 +108,7 @@
"backtrace": [
{
"file": "^cxx/CMakeLists\\.txt$",
"line": 21,
"line": 23,
"command": "target_precompile_headers",
"hasParent": true
},
@@ -127,7 +127,7 @@
"backtrace": [
{
"file": "^cxx/CMakeLists\\.txt$",
"line": 17,
"line": 19,
"command": "target_compile_options",
"hasParent": true
},
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@
"backtrace": [
{
"file": "^cxx/CMakeLists\\.txt$",
"line": 21,
"line": 23,
"command": "target_precompile_headers",
"hasParent": true
},
@@ -33,7 +33,7 @@
"backtrace": [
{
"file": "^cxx/CMakeLists\\.txt$",
"line": 17,
"line": 19,
"command": "target_compile_options",
"hasParent": true
},
@@ -61,7 +61,7 @@
"backtrace": [
{
"file": "^cxx/CMakeLists\\.txt$",
"line": 21,
"line": 23,
"command": "target_precompile_headers",
"hasParent": true
},
@@ -80,7 +80,7 @@
"backtrace": [
{
"file": "^cxx/CMakeLists\\.txt$",
"line": 17,
"line": 19,
"command": "target_compile_options",
"hasParent": true
},
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@
"backtrace": [
{
"file": "^cxx/CMakeLists\\.txt$",
"line": 49,
"line": 51,
"command": "add_executable",
"hasParent": true
},
@@ -52,7 +52,7 @@
"backtrace": [
{
"file": "^cxx/CMakeLists\\.txt$",
"line": 49,
"line": 51,
"command": "add_executable",
"hasParent": true
},
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@
"backtrace": [
{
"file": "^cxx/CMakeLists\\.txt$",
"line": 10,
"line": 12,
"command": "add_executable",
"hasParent": true
},
@@ -52,7 +52,7 @@
"backtrace": [
{
"file": "^cxx/CMakeLists\\.txt$",
"line": 10,
"line": 12,
"command": "add_executable",
"hasParent": true
},
@@ -90,7 +90,7 @@
"backtrace": [
{
"file": "^cxx/CMakeLists\\.txt$",
"line": 11,
"line": 13,
"command": "target_link_libraries",
"hasParent": true
},
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@
"backtrace": [
{
"file": "^cxx/CMakeLists\\.txt$",
"line": 9,
"line": 11,
"command": "add_library",
"hasParent": true
},
@@ -57,7 +57,7 @@
"backtrace": [
{
"file": "^cxx/CMakeLists\\.txt$",
"line": 9,
"line": 11,
"command": "add_library",
"hasParent": true
},
@@ -94,7 +94,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
"line": 46,
"line": 47,
"command": "install",
"hasParent": true
},
@@ -124,7 +124,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
"line": 46,
"line": 47,
"command": "install",
"hasParent": true
},
@@ -154,7 +154,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
"line": 51,
"line": 52,
"command": "install",
"hasParent": true
},
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@
"backtrace": [
{
"file": "^cxx/CMakeLists\\.txt$",
"line": 26,
"line": 28,
"command": "add_executable",
"hasParent": true
},
@@ -46,7 +46,7 @@
[
{
"file": "^cxx/CMakeLists\\.txt$",
"line": 27,
"line": 29,
"command": "set_property",
"hasParent": true
},
@@ -72,7 +72,7 @@
"backtrace": [
{
"file": "^cxx/CMakeLists\\.txt$",
"line": 26,
"line": 28,
"command": "add_executable",
"hasParent": true
},
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
[
{
"file": "^cxx/CMakeLists\\.txt$",
"line": 29,
"line": 31,
"command": "target_compile_features",
"hasParent": true
},
@@ -19,7 +19,7 @@
[
{
"file": "^cxx/CMakeLists\\.txt$",
"line": 30,
"line": 32,
"command": "target_compile_features",
"hasParent": true
},
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@
"backtrace": [
{
"file": "^cxx/CMakeLists\\.txt$",
"line": 23,
"line": 25,
"command": "add_executable",
"hasParent": true
},
@@ -46,7 +46,7 @@
[
{
"file": "^cxx/CMakeLists\\.txt$",
"line": 24,
"line": 26,
"command": "set_property",
"hasParent": true
},
@@ -72,7 +72,7 @@
"backtrace": [
{
"file": "^cxx/CMakeLists\\.txt$",
"line": 23,
"line": 25,
"command": "add_executable",
"hasParent": true
},
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@
"backtrace": [
{
"file": "^cxx/CMakeLists\\.txt$",
"line": 14,
"line": 16,
"command": "add_executable",
"hasParent": true
},
@@ -52,7 +52,7 @@
"backtrace": [
{
"file": "^cxx/CMakeLists\\.txt$",
"line": 14,
"line": 16,
"command": "add_executable",
"hasParent": true
},
@@ -90,7 +90,7 @@
"backtrace": [
{
"file": "^cxx/CMakeLists\\.txt$",
"line": 15,
"line": 17,
"command": "target_link_libraries",
"hasParent": true
},
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@
"backtrace": [
{
"file": "^cxx/CMakeLists\\.txt$",
"line": 13,
"line": 15,
"command": "add_library",
"hasParent": true
},
@@ -52,7 +52,7 @@
"backtrace": [
{
"file": "^cxx/CMakeLists\\.txt$",
"line": 13,
"line": 15,
"command": "add_library",
"hasParent": true
},
1 change: 1 addition & 0 deletions Tests/RunCMake/FileAPI/codemodel-v2.cmake
Original file line number Diff line number Diff line change
@@ -5,6 +5,7 @@ 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)
set_property(TARGET c_exe PROPERTY DEBUGGER_WORKING_DIRECTORY "/test/debugger/workingDirectory")

add_library(c_shared_lib SHARED empty.c)
add_executable(c_shared_exe empty.c)
2 changes: 2 additions & 0 deletions Tests/RunCMake/FileAPI/cxx/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -5,6 +5,8 @@ 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)
set_property(TARGET cxx_exe PROPERTY DEBUGGER_WORKING_DIRECTORY "/test/debugger/workingDirectory")
set_property(TARGET cxx_exe PROPERTY VS_DEBUGGER_WORKING_DIRECTORY "/test/debugger/workingDirectoryVS")

add_library(cxx_shared_lib SHARED ../empty.cxx)
add_executable(cxx_shared_exe ../empty.cxx)
2 changes: 2 additions & 0 deletions Tests/RunCMake/GoogleTest/test_launcher.c
Original file line number Diff line number Diff line change
@@ -52,6 +52,8 @@ static int launch(int argc, const char* argv[])
printf("launching: %s\n", cmd);
#endif
fflush(stdout);

// CodeQL [SM01921] CodeQL wrongly detected that we don't escape the command line arguments. They are escaped by the snprintf calls above (see line 34). // CodeQL [SM01925] False Positive: Wrongly detected that we use externally controlled strings without verifying user-input, it gets verified above
return system(cmd);
}

10 changes: 10 additions & 0 deletions Tests/RunCMake/include_external_msproject/NuGet.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<config>
<add key="repositoryPath" value="NuGetPackages" />
</config>
<packageSources>
<clear />
<add key="cpp_PublicPackages" value="https://pkgs.dev.azure.com/azure-public/VisualCpp/_packaging/cpp_PublicPackages/nuget/v3/index.json" protocolVersion="3" />
</packageSources>
</configuration>
Empty file modified Utilities/Scripts/clang-format.bash
100755 → 100644
Empty file.
Empty file modified Utilities/Scripts/update-librhash.bash
100755 → 100644
Empty file.
Original file line number Diff line number Diff line change
@@ -1072,7 +1072,8 @@ ppmd_read(void *p)
ssize_t bytes_avail = 0;
const uint8_t* data = __archive_read_ahead(a,
zip->ppstream.stream_in+1, &bytes_avail);
if(bytes_avail < zip->ppstream.stream_in+1) {
// CodeQL [SM02311] Added NULL check for data to check for unguarded NULL reference
if(data == NULL || bytes_avail < zip->ppstream.stream_in+1) {
archive_set_error(&a->archive,
ARCHIVE_ERRNO_FILE_FORMAT,
"Truncated 7z file data");
Original file line number Diff line number Diff line change
@@ -578,6 +578,9 @@ archive_write_binary_close(struct archive_write *a)
struct archive_entry *trailer;

trailer = archive_entry_new2(NULL);
if (trailer == NULL) {
return ARCHIVE_FATAL;
}
/* nlink = 1 here for GNU cpio compat. */
archive_entry_set_nlink(trailer, 1);
archive_entry_set_size(trailer, 0);
Original file line number Diff line number Diff line change
@@ -466,7 +466,10 @@ archive_write_odc_close(struct archive_write *a)
{
int er;
struct archive_entry *trailer;

trailer = archive_entry_new2(NULL);
if (trailer == NULL) {
return ARCHIVE_FATAL;
}
trailer = archive_entry_new2(NULL);
/* nlink = 1 here for GNU cpio compat. */
archive_entry_set_nlink(trailer, 1);
2 changes: 1 addition & 1 deletion Utilities/cmnghttp2/lib/nghttp2_map.c
Original file line number Diff line number Diff line change
@@ -144,7 +144,7 @@ void nghttp2_map_print_distance(nghttp2_map *map) {

idx = h2idx(bkt->hash, map->tablelenbits);
fprintf(stderr, "@%u hash=%08x key=%d base=%zu distance=%zu\n", i,
bkt->hash, bkt->key, idx,
bkt->hash, (uint32_t)(bkt->key), idx,
distance(map->tablelen, map->tablelenbits, bkt, idx));
}
}
1 change: 1 addition & 0 deletions Utilities/cmzlib/gzlib.c
Original file line number Diff line number Diff line change
@@ -101,6 +101,7 @@ local gzFile gz_open(const void *path, int fd, const char *mode) {
state = (gz_statep)malloc(sizeof(gz_state));
if (state == NULL)
return NULL;
memset(state, 0, sizeof(gz_state));
state->size = 0; /* no buffers allocated yet */
state->want = GZBUFSIZE; /* requested buffer size */
state->msg = NULL; /* no error message yet */
17 changes: 17 additions & 0 deletions VSInsertion/Packaging/CopyFiles.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<package>
<metadata>
<id>VS.ExternalAPIs.Microsoft.CMake</id>
<version>$version$</version>
<authors>cmakeworks</authors>
<owners>cmakeworks</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Package containing VS.ExternalAPIs.Microsoft.CMake artifacts</description>
<releaseNotes></releaseNotes>
<copyright>Copyright 2022</copyright>
<tags></tags>
</metadata>
<files>
<file src="**\*" target="" exclude="CopyFiles.*;logs\**;obj\**;VersionSeed.xml;bin\**" />
</files>
</package>
13 changes: 13 additions & 0 deletions VSInsertion/Packaging/cgmanifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"Registrations": [
{
"Component": {
"Type": "git",
"Git": {
"RepositoryUrl": "https://github.com/microsoft/CMake.git",
"CommitHash": "9bb8f4ec779915df76968fb085c582bb54495e54"
}
}
}
]
}
825 changes: 825 additions & 0 deletions VSInsertion/Pipelines/build.yml

Large diffs are not rendered by default.

29 changes: 29 additions & 0 deletions VSInsertion/Signing/Common.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<EnlistmentRoot>$(MSBuildThisFileDirectory)</EnlistmentRoot>

<InternalAPIs>$(EnlistmentRoot)InternalAPIs\</InternalAPIs>
<OutDir>$(EnlistmentRoot)out\Signed\</OutDir>
<OutputPath>$(OutDir)</OutputPath>

<IntDir>$(EnlistmentRoot)out\intermediate\$(SolutionName)\$(Configuration)\$(ProjectName)\</IntDir>
<IntermediateOutputPath>$(IntDir)</IntermediateOutputPath>
<BaseIntermediateOutputPath>$(IntDir)</BaseIntermediateOutputPath>

<NuGetPackages>$(EnlistmentRoot)NuGetPackages\</NuGetPackages>

<UseCommonOutputDirectory>True</UseCommonOutputDirectory>
</PropertyGroup>

<ItemDefinitionGroup>
<Reference>
<Private>False</Private>
<UseInBuild>True</UseInBuild>
<CopyLocalSatelliteAssemblies>True</CopyLocalSatelliteAssemblies>
<CopyLocalDependencies>True</CopyLocalDependencies>
<UseDependenciesInBuild>True</UseDependenciesInBuild>
</Reference>
</ItemDefinitionGroup>

</Project>
10 changes: 10 additions & 0 deletions VSInsertion/Signing/NuGet.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<config>
<add key="repositoryPath" value="NuGetPackages" />
</config>
<packageSources>
<clear />
<add key="cpp_PublicPackages" value="https://pkgs.dev.azure.com/azure-public/VisualCpp/_packaging/cpp_PublicPackages/nuget/v3/index.json" protocolVersion="3" />
</packageSources>
</configuration>
78 changes: 78 additions & 0 deletions VSInsertion/Signing/SignFiles.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="NuGetPackages\Microsoft.VisualStudioEng.Microbuild.Core.0.4.1\build\Microsoft.VisualStudioEng.MicroBuild.Core.props" Condition="Exists('NuGetPackages\Microsoft.VisualStudioEng.Microbuild.Core.0.4.1\build\Microsoft.VisualStudioEng.MicroBuild.Core.props')" />
<PropertyGroup>
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
<TargetFrameworkProfile />
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Release</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<SchemaVersion>2.0</SchemaVersion>
<ProjectTypeGuids>{82b43b9b-a64c-4715-b499-d71e9ca2bd60};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<ProjectGuid>{31D3F5B8-BAF2-4919-B020-CB6E6FEF6BEE}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>SignFiles</RootNamespace>
<AssemblyName>SignFiles</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<GeneratePkgDefFile>false</GeneratePkgDefFile>
<IncludeAssemblyInVSIXContainer>false</IncludeAssemblyInVSIXContainer>
<IncludeDebugSymbolsInVSIXContainer>false</IncludeDebugSymbolsInVSIXContainer>
<IncludeDebugSymbolsInLocalVSIXDeployment>false</IncludeDebugSymbolsInLocalVSIXDeployment>
<CopyBuildOutputToOutputDirectory>false</CopyBuildOutputToOutputDirectory>
<CopyOutputSymbolsToOutputDirectory>false</CopyOutputSymbolsToOutputDirectory>
<DeployExtension>False</DeployExtension>
<CreateVsixContainer>False</CreateVsixContainer>
</PropertyGroup>
<Import Project="Common.props" />
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>

<ItemGroup>
<FilesToCopy Include="$(EnlistmentRoot)input\*.exe">
<Visible>false</Visible>
</FilesToCopy>
<CatalogsToCopy Include="$(EnlistmentRoot)input\*.cat">
<Visible>false</Visible>
</CatalogsToCopy>
<PackagesToCopy Include="$(EnlistmentRoot)input\*.nupkg">
<Visible>false</Visible>
</PackagesToCopy>
</ItemGroup>

<Target Name="CopyFiles" BeforeTargets="AfterBuild">
<Copy SourceFiles="@(FilesToCopy)" DestinationFolder="$(OutDir)" />
<Copy SourceFiles="@(CatalogsToCopy)" DestinationFolder="$(OutDir)" />
<Copy SourceFiles="@(PackagesToCopy)" DestinationFolder="$(OutDir)" />

<ItemGroup>
<FilesToSign Include="@(FilesToCopy->'$(OutDir)%(Filename)%(Extension)')">
<Authenticode>3PartySHA2</Authenticode>
</FilesToSign>
<FilesToSign Include="@(CatalogsToCopy->'$(OutDir)%(Filename)%(Extension)')">
<Authenticode>Microsoft400</Authenticode>
</FilesToSign>
<FilesToSign Include="@(PackagesToCopy->'$(OutDir)%(Filename)%(Extension)')">
<Authenticode>NuGet</Authenticode>
</FilesToSign>
</ItemGroup>
</Target>

<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(VSToolsPath)\VSSDK\Microsoft.VsSDK.targets" Condition="'$(VSToolsPath)' != ''" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('NuGetPackages\Microsoft.VisualStudioEng.Microbuild.Core.0.4.1\build\Microsoft.VisualStudioEng.MicroBuild.Core.props')" Text="$([System.String]::Format('$(ErrorText)', 'NuGetPackages\Microsoft.VisualStudioEng.Microbuild.Core.0.4.1\build\Microsoft.VisualStudioEng.MicroBuild.Core.props'))" />
<Error Condition="!Exists('NuGetPackages\Microsoft.VisualStudioEng.Microbuild.Core.0.4.1\build\Microsoft.VisualStudioEng.MicroBuild.Core.targets')" Text="$([System.String]::Format('$(ErrorText)', 'NuGetPackages\Microsoft.VisualStudioEng.Microbuild.Core.0.4.1\build\Microsoft.VisualStudioEng.MicroBuild.Core.targets'))" />
</Target>
<Import Project="NuGetPackages\Microsoft.VisualStudioEng.Microbuild.Core.0.4.1\build\Microsoft.VisualStudioEng.MicroBuild.Core.targets" Condition="Exists('NuGetPackages\Microsoft.VisualStudioEng.Microbuild.Core.0.4.1\build\Microsoft.VisualStudioEng.MicroBuild.Core.targets')" />

</Project>
19 changes: 19 additions & 0 deletions VSInsertion/Signing/SigningSolution.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25123.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SignFiles", "SignFiles.csproj", "{31D3F5B8-BAF2-4919-B020-CB6E6FEF6BEE}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{31D3F5B8-BAF2-4919-B020-CB6E6FEF6BEE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{31D3F5B8-BAF2-4919-B020-CB6E6FEF6BEE}.Debug|Any CPU.Build.0 = Debug|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
4 changes: 4 additions & 0 deletions VSInsertion/Signing/packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.VisualStudioEng.MicroBuild.Core" version="0.4.1" targetFramework="net46" developmentDependency="true" />
</packages>
49 changes: 49 additions & 0 deletions VSInsertion/credscan.gdnsuppress
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"hydrated": false,
"properties": {
"helpUri": "https://eng.ms/docs/microsoft-security/security/azure-security/cloudai-security-fundamentals-engineering/security-integration/guardian-wiki/microsoft-guardian/general/suppressions",
"hydrationStatus": "This file does not contain identifying data. It is safe to check into your repo. To hydrate this file with identifying data, run `guardian hydrate --help` and follow the guidance."
},
"version": "1.0.0",
"suppressionSets": {
"default": {
"name": "default",
"createdDate": "2024-02-10 01:15:10Z",
"lastUpdatedDate": "2024-02-10 01:15:10Z"
}
},
"results": {
"39ad2f58e4ef88ebee6241a72ce64b05dca265d4c87234e9e2c22ca10678f9e6": {
"signature": "39ad2f58e4ef88ebee6241a72ce64b05dca265d4c87234e9e2c22ca10678f9e6",
"alternativeSignatures": [],
"memberOf": [
"default"
],
"createdDate": "2024-02-10 01:15:10Z"
},
"f0e7e2ed6ef4c5c9cc84e67dfde945e693374040d6166f12be9b6af99a16539b": {
"signature": "f0e7e2ed6ef4c5c9cc84e67dfde945e693374040d6166f12be9b6af99a16539b",
"alternativeSignatures": [],
"memberOf": [
"default"
],
"createdDate": "2024-02-10 01:15:10Z"
},
"63685d2096b957493b40c31c13c957082bf93fec5a27a022c3640affe9a3c809": {
"signature": "63685d2096b957493b40c31c13c957082bf93fec5a27a022c3640affe9a3c809",
"alternativeSignatures": [],
"memberOf": [
"default"
],
"createdDate": "2024-02-10 01:15:10Z"
},
"bd232d19a5631ec97bd83e91aa6571274ac67c574fc4e3d99d9121c246c544e4": {
"signature": "bd232d19a5631ec97bd83e91aa6571274ac67c574fc4e3d99d9121c246c544e4",
"alternativeSignatures": [],
"memberOf": [
"default"
],
"createdDate": "2024-02-10 01:15:10Z"
}
}
}
1 change: 1 addition & 0 deletions bootstrap
Original file line number Diff line number Diff line change
@@ -490,6 +490,7 @@ CMAKE_CXX_SOURCES="\
cmSubcommandTable \
cmSubdirCommand \
cmSystemTools \
cmStringTable \
cmTarget \
cmTargetCompileDefinitionsCommand \
cmTargetCompileFeaturesCommand \
14 changes: 14 additions & 0 deletions cmake-3.19.4-SHA-256.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
0c3de05513444ea9f160b254875f26036c366234aa6a3d83aafd38e32b92d404 cmake-3.19.4-Linux-aarch64.sh
c6c6e5d7a1b8745a6780e04804d5cbae5cc1bb04c89a3b8a6c1d8ccf24f5cdaf cmake-3.19.4-Linux-aarch64.tar.gz
5896e6d8a5175c4b49a2b71cc55b0be7cdd5a5bb3a161c528cf2cf2dc5d4de46 cmake-3.19.4-Linux-x86_64.sh
ff23e1f53c53e8ef1fa87568345031d86c504e53efb52fa487db0b8e0ee4d3ff cmake-3.19.4-Linux-x86_64.tar.gz
89989707d2227fed3139dfb98dea234d8910b232f5b6b83c8bdf02bd746ec565 cmake-3.19.4-macos-universal.dmg
eb1f52996632c1e71a1051c9e2c30cc8df869fb5a213b1a0d3b202744c6c5758 cmake-3.19.4-macos-universal.tar.gz
04d0ff5c32182a8000f3a5b171b3cb9f11c95c41dbb2953b24af5eebd53bff68 cmake-3.19.4-macos10.10-universal.dmg
4adcc124ce4c3044b224ca17f2c763469da1b0d32816c95d4053c7780581292b cmake-3.19.4-macos10.10-universal.tar.gz
2dce32e37c161441a899735c3398ea21aff2745e2f3db516ceb0085817a657ed cmake-3.19.4-win32-x86.msi
4d940a0e45bea2b07525add804184f3434684efa2ad72c22b3960933006929e4 cmake-3.19.4-win32-x86.zip
e531812198235ac51c846dba636d719e6f6870523a423b7b993377e91ee57ef8 cmake-3.19.4-win64-x64.msi
24b03daf75ce59b542da38c829fe6944d3bf7cf99afaa8225cf29f7876823899 cmake-3.19.4-win64-x64.zip
7d0232b9f1c57e8de81f38071ef8203e6820fe7eec8ae46a1df125d88dbcc2e1 cmake-3.19.4.tar.gz
49f66f867be0761ed7429c8824ce6e7bf926970f6efc16406ca55374ffa65689 cmake-3.19.4.zip