From 0a9fb88121607b96d1d14f3e0924ffa44344ae00 Mon Sep 17 00:00:00 2001 From: Garrett Campbell Date: Fri, 6 Dec 2024 13:54:01 -0500 Subject: [PATCH] fileapi: Report DEBUGGER_WORKING_DIRECTORY in codemodel-v2 target objects Closes: #16478 --- Help/manual/cmake-file-api.7.rst | 18 ++++++++++++- .../dev/debugger-working-directory.rst | 6 +++++ Source/cmFileAPI.cxx | 2 +- Source/cmFileAPICodemodel.cxx | 20 ++++++++++++++ .../CommandLine/E_capabilities-stdout.txt | 2 +- Tests/RunCMake/FileAPI/codemodel-v2-check.py | 12 ++++++++- .../codemodel-v2-data/directories/cxx.json | 12 ++++----- .../codemodel-v2-data/directories/top.json | 26 +++++++++---------- .../codemodel-v2-data/targets/c_exe.json | 5 +++- .../targets/c_shared_exe.json | 6 ++--- .../targets/c_shared_lib.json | 10 +++---- .../targets/c_static_exe.json | 6 ++--- .../targets/c_static_lib.json | 4 +-- .../codemodel-v2-data/targets/c_subdir.json | 2 +- .../codemodel-v2-data/targets/cxx_exe.json | 17 +++++++----- .../targets/cxx_exe_precompileheader.json | 8 +++--- .../cxx_exe_precompileheader_2arch.json | 12 ++++----- .../cxx_exe_precompileheader_multigen.json | 8 +++--- .../targets/cxx_exe_test_launcher.json | 4 +-- .../targets/cxx_shared_exe.json | 6 ++--- .../targets/cxx_shared_lib.json | 10 +++---- .../cxx_standard_compile_feature_exe.json | 6 ++--- ..._compile_feature_exe_languagestandard.json | 4 +-- .../targets/cxx_standard_exe.json | 6 ++--- .../targets/cxx_static_exe.json | 6 ++--- .../targets/cxx_static_lib.json | 4 +-- Tests/RunCMake/FileAPI/codemodel-v2.cmake | 1 + Tests/RunCMake/FileAPI/cxx/CMakeLists.txt | 2 ++ 28 files changed, 143 insertions(+), 82 deletions(-) diff --git a/Help/manual/cmake-file-api.7.rst b/Help/manual/cmake-file-api.7.rst index a4ce5de831..364be3e86d 100644 --- a/Help/manual/cmake-file-api.7.rst +++ b/Help/manual/cmake-file-api.7.rst @@ -435,7 +435,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" @@ -1095,6 +1095,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. diff --git a/Help/release/dev/debugger-working-directory.rst b/Help/release/dev/debugger-working-directory.rst index 314a021248..5fee86a379 100644 --- a/Help/release/dev/debugger-working-directory.rst +++ b/Help/release/dev/debugger-working-directory.rst @@ -7,3 +7,9 @@ debugger-working-directory * 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. diff --git a/Source/cmFileAPI.cxx b/Source/cmFileAPI.cxx index 1f15612210..b45c285698 100644 --- a/Source/cmFileAPI.cxx +++ b/Source/cmFileAPI.cxx @@ -746,7 +746,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 const& versions) diff --git a/Source/cmFileAPICodemodel.cxx b/Source/cmFileAPICodemodel.cxx index b9daffb53b..be256471e9 100644 --- a/Source/cmFileAPICodemodel.cxx +++ b/Source/cmFileAPICodemodel.cxx @@ -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); diff --git a/Tests/RunCMake/CommandLine/E_capabilities-stdout.txt b/Tests/RunCMake/CommandLine/E_capabilities-stdout.txt index 0c2a951728..51b7e259b4 100644 --- a/Tests/RunCMake/CommandLine/E_capabilities-stdout.txt +++ b/Tests/RunCMake/CommandLine/E_capabilities-stdout.txt @@ -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":{.*}}$ diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-check.py b/Tests/RunCMake/FileAPI/codemodel-v2-check.py index 834b2ca63b..36f9d33a02 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-check.py +++ b/Tests/RunCMake/FileAPI/codemodel-v2-check.py @@ -12,7 +12,7 @@ def read_codemodel_json_data(filename): def check_objects(o, g): assert is_list(o) assert len(o) == 1 - check_index_object(o[0], "codemodel", 2, 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"] @@ -429,6 +429,14 @@ def check_target(c): 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", ""): diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/cxx.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/cxx.json index 912d664537..0bc24877dd 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/cxx.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/cxx.json @@ -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 }, diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/top.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/top.json index 27a1c45904..f535822c15 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/top.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/top.json @@ -51,7 +51,7 @@ "backtrace": [ { "file": "^codemodel-v2\\.cmake$", - "line": 45, + "line": 46, "command": "install", "hasParent": true }, @@ -96,7 +96,7 @@ "backtrace": [ { "file": "^codemodel-v2\\.cmake$", - "line": 48, + "line": 49, "command": "install", "hasParent": true }, @@ -144,7 +144,7 @@ "backtrace": [ { "file": "^codemodel-v2\\.cmake$", - "line": 48, + "line": 49, "command": "install", "hasParent": true }, @@ -189,7 +189,7 @@ "backtrace": [ { "file": "^codemodel-v2\\.cmake$", - "line": 48, + "line": 49, "command": "install", "hasParent": true }, @@ -233,7 +233,7 @@ "backtrace": [ { "file": "^codemodel-v2\\.cmake$", - "line": 48, + "line": 49, "command": "install", "hasParent": true }, @@ -277,7 +277,7 @@ "backtrace": [ { "file": "^codemodel-v2\\.cmake$", - "line": 53, + "line": 54, "command": "install", "hasParent": true }, @@ -324,7 +324,7 @@ "backtrace": [ { "file": "^codemodel-v2\\.cmake$", - "line": 55, + "line": 56, "command": "install", "hasParent": true }, @@ -369,7 +369,7 @@ "backtrace": [ { "file": "^codemodel-v2\\.cmake$", - "line": 56, + "line": 57, "command": "install", "hasParent": true }, @@ -418,7 +418,7 @@ "backtrace": [ { "file": "^codemodel-v2\\.cmake$", - "line": 57, + "line": 58, "command": "install", "hasParent": true }, @@ -470,7 +470,7 @@ "backtrace": [ { "file": "^codemodel-v2\\.cmake$", - "line": 58, + "line": 59, "command": "install", "hasParent": true }, @@ -519,7 +519,7 @@ "backtrace": [ { "file": "^codemodel-v2\\.cmake$", - "line": 59, + "line": 60, "command": "install", "hasParent": true }, @@ -561,7 +561,7 @@ "backtrace": [ { "file": "^codemodel-v2\\.cmake$", - "line": 60, + "line": 61, "command": "install", "hasParent": true }, @@ -603,7 +603,7 @@ "backtrace": [ { "file": "^codemodel-v2\\.cmake$", - "line": 61, + "line": 62, "command": "install", "hasParent": true }, diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_exe.json index a9c313b75b..34e1cbf0b1 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_exe.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_exe.json @@ -142,5 +142,8 @@ "id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$", "backtrace": null } - ] + ], + "debugger": { + "workingDirectory": "^/test/debugger/workingDirectory$" + } } diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_shared_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_shared_exe.json index 09cbf2d1be..ad34f88fa6 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_shared_exe.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_shared_exe.json @@ -16,7 +16,7 @@ "backtrace": [ { "file": "^codemodel-v2\\.cmake$", - "line": 12, + "line": 13, "command": "add_executable", "hasParent": true }, @@ -64,7 +64,7 @@ "backtrace": [ { "file": "^codemodel-v2\\.cmake$", - "line": 12, + "line": 13, "command": "add_executable", "hasParent": true }, @@ -114,7 +114,7 @@ "backtrace": [ { "file": "^codemodel-v2\\.cmake$", - "line": 13, + "line": 14, "command": "target_link_libraries", "hasParent": true }, diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_shared_lib.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_shared_lib.json index 11738b80bf..9eee3dc195 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_shared_lib.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_shared_lib.json @@ -16,7 +16,7 @@ "backtrace": [ { "file": "^codemodel-v2\\.cmake$", - "line": 11, + "line": 12, "command": "add_library", "hasParent": true }, @@ -69,7 +69,7 @@ "backtrace": [ { "file": "^codemodel-v2\\.cmake$", - "line": 11, + "line": 12, "command": "add_library", "hasParent": true }, @@ -118,7 +118,7 @@ "backtrace": [ { "file": "^codemodel-v2\\.cmake$", - "line": 48, + "line": 49, "command": "install", "hasParent": true }, @@ -148,7 +148,7 @@ "backtrace": [ { "file": "^codemodel-v2\\.cmake$", - "line": 48, + "line": 49, "command": "install", "hasParent": true }, @@ -178,7 +178,7 @@ "backtrace": [ { "file": "^codemodel-v2\\.cmake$", - "line": 53, + "line": 54, "command": "install", "hasParent": true }, diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_static_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_static_exe.json index 6f636df4db..badeeb2bf8 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_static_exe.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_static_exe.json @@ -16,7 +16,7 @@ "backtrace": [ { "file": "^codemodel-v2\\.cmake$", - "line": 16, + "line": 17, "command": "add_executable", "hasParent": true }, @@ -64,7 +64,7 @@ "backtrace": [ { "file": "^codemodel-v2\\.cmake$", - "line": 16, + "line": 17, "command": "add_executable", "hasParent": true }, @@ -114,7 +114,7 @@ "backtrace": [ { "file": "^codemodel-v2\\.cmake$", - "line": 17, + "line": 18, "command": "target_link_libraries", "hasParent": true }, diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_static_lib.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_static_lib.json index 05312ca05b..a05cf59663 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_static_lib.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_static_lib.json @@ -16,7 +16,7 @@ "backtrace": [ { "file": "^codemodel-v2\\.cmake$", - "line": 15, + "line": 16, "command": "add_library", "hasParent": true }, @@ -64,7 +64,7 @@ "backtrace": [ { "file": "^codemodel-v2\\.cmake$", - "line": 15, + "line": 16, "command": "add_library", "hasParent": true }, diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_subdir.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_subdir.json index 2ab99c25f8..95c5e64237 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_subdir.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_subdir.json @@ -89,7 +89,7 @@ "backtrace": [ { "file": "^codemodel-v2\\.cmake$", - "line": 19, + "line": 20, "command": "add_library", "hasParent": true }, diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe.json index 16a86c7271..68ec736548 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe.json @@ -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": 45, + "line": 46, "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$" + } } diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_precompileheader.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_precompileheader.json index ac6a1c030c..86cfc8af01 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_precompileheader.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_precompileheader.json @@ -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 }, diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_precompileheader_2arch.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_precompileheader_2arch.json index 311fe7aa8e..f459e08c16 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_precompileheader_2arch.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_precompileheader_2arch.json @@ -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 }, diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_precompileheader_multigen.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_precompileheader_multigen.json index adf979e735..f5e06bff14 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_precompileheader_multigen.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_precompileheader_multigen.json @@ -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 }, diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_test_launcher.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_test_launcher.json index f5e365c336..4988f04962 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_test_launcher.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_test_launcher.json @@ -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 }, diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_shared_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_shared_exe.json index 1858df777e..9ac7b7c2f2 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_shared_exe.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_shared_exe.json @@ -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 }, diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_shared_lib.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_shared_lib.json index f3624d4d5e..45894c0952 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_shared_lib.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_shared_lib.json @@ -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": 48, + "line": 49, "command": "install", "hasParent": true }, @@ -124,7 +124,7 @@ "backtrace": [ { "file": "^codemodel-v2\\.cmake$", - "line": 48, + "line": 49, "command": "install", "hasParent": true }, @@ -154,7 +154,7 @@ "backtrace": [ { "file": "^codemodel-v2\\.cmake$", - "line": 53, + "line": 54, "command": "install", "hasParent": true }, diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_standard_compile_feature_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_standard_compile_feature_exe.json index 5b07d5ab3c..45ab35c199 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_standard_compile_feature_exe.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_standard_compile_feature_exe.json @@ -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 }, diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_standard_compile_feature_exe_languagestandard.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_standard_compile_feature_exe_languagestandard.json index 0c4eabb09c..98528cbc07 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_standard_compile_feature_exe_languagestandard.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_standard_compile_feature_exe_languagestandard.json @@ -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 }, diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_standard_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_standard_exe.json index d9554f1ffc..e04b988435 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_standard_exe.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_standard_exe.json @@ -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 }, diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_static_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_static_exe.json index 001eb8df28..080887703a 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_static_exe.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_static_exe.json @@ -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 }, diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_static_lib.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_static_lib.json index 2f322b0771..90ea0dffcf 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_static_lib.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_static_lib.json @@ -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 }, diff --git a/Tests/RunCMake/FileAPI/codemodel-v2.cmake b/Tests/RunCMake/FileAPI/codemodel-v2.cmake index c493ce1f8d..42bdceab28 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2.cmake +++ b/Tests/RunCMake/FileAPI/codemodel-v2.cmake @@ -7,6 +7,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) diff --git a/Tests/RunCMake/FileAPI/cxx/CMakeLists.txt b/Tests/RunCMake/FileAPI/cxx/CMakeLists.txt index d7d2e11bcb..d2ebeda304 100644 --- a/Tests/RunCMake/FileAPI/cxx/CMakeLists.txt +++ b/Tests/RunCMake/FileAPI/cxx/CMakeLists.txt @@ -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)