diff options
55 files changed, 877 insertions, 31 deletions
diff --git a/Help/manual/cmake-file-api.7.rst b/Help/manual/cmake-file-api.7.rst index 7ff9728..0bdb419 100644 --- a/Help/manual/cmake-file-api.7.rst +++ b/Help/manual/cmake-file-api.7.rst @@ -425,7 +425,7 @@ Version 1 does not exist to avoid confusion with that from { "kind": "codemodel", - "version": { "major": 2, "minor": 5 }, + "version": { "major": 2, "minor": 6 }, "paths": { "source": "/path/to/top-level-source-dir", "build": "/path/to/top-level-build-dir" @@ -1211,6 +1211,28 @@ with members: an unsigned integer 0-based index into the ``backtraceGraph`` member's ``nodes`` array. + ``frameworks`` + Optional member that is present when, on Apple platforms, there are + frameworks. The value is a JSON array with an entry for each directory. + Each entry is a JSON object with members: + + ``path`` + A string specifying the path to the framework directory, + represented with forward slashes. + + ``isSystem`` + Optional member that is present with boolean value ``true`` if + the framework is marked as a system one. + + ``backtrace`` + Optional member that is present when a CMake language backtrace to + the :command:`target_link_libraries` or other command invocation + that added this framework is available. The value is + an unsigned integer 0-based index into the ``backtraceGraph`` + member's ``nodes`` array. + + This field was added in codemodel version 2.6. + ``precompileHeaders`` Optional member that is present when :command:`target_precompile_headers` or other command invocations set :prop_tgt:`PRECOMPILE_HEADERS` on the diff --git a/Help/release/dev/FileAPI-Frameworks.rst b/Help/release/dev/FileAPI-Frameworks.rst new file mode 100644 index 0000000..65cf043 --- /dev/null +++ b/Help/release/dev/FileAPI-Frameworks.rst @@ -0,0 +1,7 @@ +FileAPI-Frameworks +------------------ + +* The :manual:`cmake-file-api(7)` "codemodel" version 2 ``version`` field has + been updated to 2.6. +* The :manual:`cmake-file-api(7)` "codemodel" version 2 "target" object gained + a new "frameworks" field in the "compileGroups" objects. diff --git a/Source/cmFileAPI.cxx b/Source/cmFileAPI.cxx index d1d3d25..8b98916 100644 --- a/Source/cmFileAPI.cxx +++ b/Source/cmFileAPI.cxx @@ -728,7 +728,7 @@ std::string cmFileAPI::NoSupportedVersion( // The "codemodel" object kind. // Update Help/manual/cmake-file-api.7.rst when updating this constant. -static unsigned int const CodeModelV2Minor = 5; +static unsigned int const CodeModelV2Minor = 6; void cmFileAPI::BuildClientRequestCodeModel( ClientRequest& r, std::vector<RequestVersion> const& versions) diff --git a/Source/cmFileAPICodemodel.cxx b/Source/cmFileAPICodemodel.cxx index 4a8716f..280ebb0 100644 --- a/Source/cmFileAPICodemodel.cxx +++ b/Source/cmFileAPICodemodel.cxx @@ -328,6 +328,7 @@ struct CompileData std::vector<JBT<std::string>> Defines; std::vector<JBT<std::string>> PrecompileHeaders; std::vector<IncludeEntry> Includes; + std::vector<IncludeEntry> Frameworks; friend bool operator==(CompileData const& l, CompileData const& r) { @@ -335,7 +336,7 @@ struct CompileData l.Flags == r.Flags && l.Defines == r.Defines && l.PrecompileHeaders == r.PrecompileHeaders && l.LanguageStandard == r.LanguageStandard && - l.Includes == r.Includes); + l.Includes == r.Includes && l.Frameworks == r.Frameworks); } }; } @@ -356,6 +357,12 @@ struct hash<CompileData> hash<Json::ArrayIndex>()(i.Path.Backtrace.Index) ^ (i.IsSystem ? std::numeric_limits<size_t>::max() : 0)); } + for (auto const& i : in.Frameworks) { + result = result ^ + (hash<std::string>()(i.Path.Value) ^ + hash<Json::ArrayIndex>()(i.Path.Backtrace.Index) ^ + (i.IsSystem ? std::numeric_limits<size_t>::max() : 0)); + } for (auto const& i : in.Flags) { result = result ^ hash<std::string>()(i.Value) ^ hash<Json::ArrayIndex>()(i.Backtrace.Index); @@ -468,6 +475,7 @@ class Target Json::Value DumpPaths(); Json::Value DumpCompileData(CompileData const& cd); Json::Value DumpInclude(CompileData::IncludeEntry const& inc); + Json::Value DumpFramework(CompileData::IncludeEntry const& fw); Json::Value DumpPrecompileHeader(JBT<std::string> const& header); Json::Value DumpLanguageStandard(JBTs<std::string> const& standard); Json::Value DumpDefine(JBT<std::string> const& def); @@ -1294,9 +1302,15 @@ void Target::ProcessLanguage(std::string const& lang) std::vector<BT<std::string>> includePathList = lg->GetIncludeDirectories(this->GT, lang, this->Config); for (BT<std::string> const& i : includePathList) { - cd.Includes.emplace_back( - this->ToJBT(i), - this->GT->IsSystemIncludeDirectory(i.Value, this->Config, lang)); + if (this->GT->IsApple() && cmSystemTools::IsPathToFramework(i.Value)) { + cd.Frameworks.emplace_back( + this->ToJBT(i), + this->GT->IsSystemIncludeDirectory(i.Value, this->Config, lang)); + } else { + cd.Includes.emplace_back( + this->ToJBT(i), + this->GT->IsSystemIncludeDirectory(i.Value, this->Config, lang)); + } } std::vector<BT<std::string>> precompileHeaders = this->GT->GetPrecompileHeaders(this->Config, lang); @@ -1408,7 +1422,11 @@ CompileData Target::BuildCompileData(cmSourceFile* sf) bool const isSystemInclude = this->GT->IsSystemIncludeDirectory(i, this->Config, fd.Language); BT<std::string> include(i, tmpInclude.Backtrace); - fd.Includes.emplace_back(this->ToJBT(include), isSystemInclude); + if (this->GT->IsApple() && cmSystemTools::IsPathToFramework(i)) { + fd.Frameworks.emplace_back(this->ToJBT(include), isSystemInclude); + } else { + fd.Includes.emplace_back(this->ToJBT(include), isSystemInclude); + } } } } @@ -1481,6 +1499,13 @@ CompileData Target::MergeCompileData(CompileData const& fd) cd.Includes.insert(cd.Includes.end(), td.Includes.begin(), td.Includes.end()); + // Use source-specific frameworks followed by target-wide frameworks. + cd.Frameworks.reserve(fd.Frameworks.size() + td.Frameworks.size()); + cd.Frameworks.insert(cd.Frameworks.end(), fd.Frameworks.begin(), + fd.Frameworks.end()); + cd.Frameworks.insert(cd.Frameworks.end(), td.Frameworks.begin(), + td.Frameworks.end()); + // Use target-wide defines followed by source-specific defines. cd.Defines.reserve(td.Defines.size() + fd.Defines.size()); cd.Defines.insert(cd.Defines.end(), td.Defines.begin(), td.Defines.end()); @@ -1696,6 +1721,13 @@ Json::Value Target::DumpCompileData(CompileData const& cd) } result["includes"] = includes; } + if (!cd.Frameworks.empty()) { + Json::Value frameworks = Json::arrayValue; + for (auto const& i : cd.Frameworks) { + frameworks.append(this->DumpFramework(i)); + } + result["frameworks"] = frameworks; + } if (!cd.Defines.empty()) { Json::Value defines = Json::arrayValue; for (JBT<std::string> const& d : cd.Defines) { @@ -1729,6 +1761,12 @@ Json::Value Target::DumpInclude(CompileData::IncludeEntry const& inc) return include; } +Json::Value Target::DumpFramework(CompileData::IncludeEntry const& fw) +{ + // for now, idem as include + return this->DumpInclude(fw); +} + Json::Value Target::DumpPrecompileHeader(JBT<std::string> const& header) { Json::Value precompileHeader = Json::objectValue; diff --git a/Tests/RunCMake/CommandLine/E_capabilities-stdout.txt b/Tests/RunCMake/CommandLine/E_capabilities-stdout.txt index 597dbd4..e2f63cd 100644 --- a/Tests/RunCMake/CommandLine/E_capabilities-stdout.txt +++ b/Tests/RunCMake/CommandLine/E_capabilities-stdout.txt @@ -1 +1 @@ -^{"fileApi":{"requests":\[{"kind":"codemodel","version":\[{"major":2,"minor":5}]},{"kind":"configureLog","version":\[{"major":1,"minor":0}]},{"kind":"cache","version":\[{"major":2,"minor":0}]},{"kind":"cmakeFiles","version":\[{"major":1,"minor":0}]},{"kind":"toolchains","version":\[{"major":1,"minor":0}]}]},"generators":\[.*\],"serverMode":false,"tls":(true|false),"version":{.*}}$ +^{"fileApi":{"requests":\[{"kind":"codemodel","version":\[{"major":2,"minor":6}]},{"kind":"configureLog","version":\[{"major":1,"minor":0}]},{"kind":"cache","version":\[{"major":2,"minor":0}]},{"kind":"cmakeFiles","version":\[{"major":1,"minor":0}]},{"kind":"toolchains","version":\[{"major":1,"minor":0}]}]},"generators":\[.*\],"serverMode":false,"tls":(true|false),"version":{.*}}$ diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-check.py b/Tests/RunCMake/FileAPI/codemodel-v2-check.py index eb52975..b669543 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-check.py +++ b/Tests/RunCMake/FileAPI/codemodel-v2-check.py @@ -12,7 +12,7 @@ def read_codemodel_json_data(filename): def check_objects(o, g): assert is_list(o) assert len(o) == 1 - check_index_object(o[0], "codemodel", 2, 5, check_object_codemodel(g)) + check_index_object(o[0], "codemodel", 2, 6, check_object_codemodel(g)) def check_backtrace(t, b, backtrace): btg = t["backtraceGraph"] @@ -578,6 +578,30 @@ def check_target(c): missing_exception=lambda e: "Include path: %s" % e["path"], extra_exception=lambda a: "Include path: %s" % a["path"]) + if expected["frameworks"] is not None: + expected_keys.append("frameworks") + + def check_include(actual, expected): + assert is_dict(actual) + expected_keys = ["path"] + + if expected["isSystem"] is not None: + expected_keys.append("isSystem") + assert is_bool(actual["isSystem"], expected["isSystem"]) + + if expected["backtrace"] is not None: + expected_keys.append("backtrace") + check_backtrace(obj, actual["backtrace"], expected["backtrace"]) + + assert sorted(actual.keys()) == sorted(expected_keys) + + check_list_match(lambda a, e: matches(a["path"], e["path"]), + actual["frameworks"], expected["frameworks"], + check=check_include, + check_exception=lambda a, e: "Framework path: %s" % a["path"], + missing_exception=lambda e: "Framework path: %s" % e["path"], + extra_exception=lambda a: "Framework path: %s" % a["path"]) + if "precompileHeaders" in expected: expected_keys.append("precompileHeaders") @@ -693,6 +717,7 @@ def gen_check_directories(c, g): read_codemodel_json_data("directories/external.json"), read_codemodel_json_data("directories/fileset.json"), read_codemodel_json_data("directories/subdir.json"), + read_codemodel_json_data("directories/framework.json"), ] if matches(g["name"], "^Visual Studio "): @@ -776,6 +801,12 @@ def gen_check_targets(c, g, inSource): read_codemodel_json_data("targets/cxx_object_lib.json"), read_codemodel_json_data("targets/cxx_object_exe.json"), + read_codemodel_json_data("targets/all_build_framework.json"), + read_codemodel_json_data("targets/zero_check_framework.json"), + read_codemodel_json_data("targets/static_framework.json"), + read_codemodel_json_data("targets/shared_framework.json"), + read_codemodel_json_data("targets/exe_framework.json"), + read_codemodel_json_data("targets/all_build_imported.json"), read_codemodel_json_data("targets/zero_check_imported.json"), read_codemodel_json_data("targets/link_imported_exe.json"), @@ -800,6 +831,21 @@ def gen_check_targets(c, g, inSource): read_codemodel_json_data("targets/c_headers_2.json"), ] + if sys.platform == "darwin": + for e in expected: + if e["name"] == "static_framework": + apple_static_framework = read_codemodel_json_data("targets/apple_static_framework.json") + e["artifacts"] = apple_static_framework["artifacts"] + e["nameOnDisk"] = apple_static_framework["nameOnDisk"] + elif e["name"] == "shared_framework": + apple_shared_framework = read_codemodel_json_data("targets/apple_shared_framework.json") + e["artifacts"] = apple_shared_framework["artifacts"] + e["nameOnDisk"] = apple_shared_framework["nameOnDisk"] + elif e["name"] == "exe_framework": + apple_exe_framework = read_codemodel_json_data("targets/apple_exe_framework.json") + e["compileGroups"] = apple_exe_framework["compileGroups"] + e["link"] = apple_exe_framework["link"] + if cxx_compiler_id in ['Clang', 'AppleClang', 'LCC', 'GNU', 'Intel', 'IntelLLVM', 'MSVC', 'Embarcadero', 'IBMClang'] and g["name"] != "Xcode": for e in expected: if e["name"] == "cxx_exe": @@ -926,6 +972,21 @@ def gen_check_targets(c, g, inSource): ], }, { + "path": "^framework/CMakeLists\\.txt$", + "isGenerated": None, + "fileSetName": None, + "sourceGroupName": "", + "compileGroupLanguage": None, + "backtrace": [ + { + "file": "^CMakeLists\\.txt$", + "line": None, + "command": None, + "hasParent": False, + }, + ], + }, + { "path": "^dir/CMakeLists\\.txt$", "isGenerated": None, "fileSetName": None, @@ -1070,6 +1131,7 @@ def gen_check_targets(c, g, inSource): "^codemodel-v2\\.cmake$", "^custom/CMakeLists\\.txt$", "^cxx/CMakeLists\\.txt$", + "^framework/CMakeLists\\.txt$", "^dir/CMakeLists\\.txt$", "^dir/dir/CMakeLists\\.txt$", "^fileset/CMakeLists\\.txt$", @@ -1144,6 +1206,7 @@ def gen_check_projects(c, g): read_codemodel_json_data("projects/interface.json"), read_codemodel_json_data("projects/custom.json"), read_codemodel_json_data("projects/external.json"), + read_codemodel_json_data("projects/framework.json"), ] if matches(g["name"], "^Visual Studio "): diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/framework.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/framework.json new file mode 100644 index 0000000..3affc02 --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/framework.json @@ -0,0 +1,17 @@ +{ + "source": "^framework$", + "build": "^framework$", + "parentSource": "^\\.$", + "childSources": null, + "targetIds": [ + "^ALL_BUILD::@217a96c3a62328a73ef4$", + "^ZERO_CHECK::@217a96c3a62328a73ef4$", + "^shared_framework::@217a96c3a62328a73ef4$", + "^static_framework::@217a96c3a62328a73ef4$", + "^exe_framework::@217a96c3a62328a73ef4$" + ], + "projectName": "Framework", + "minimumCMakeVersion": "3.13", + "hasInstallRule": null, + "installers": [] +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/top.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/top.json index aed07e2..a35d5e2 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/top.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/top.json @@ -12,7 +12,8 @@ "^.*/Tests/RunCMake/FileAPIExternalSource$", "^dir$", "^fileset$", - "^subdir$" + "^subdir$", + "^framework$" ], "targetIds": [ "^ALL_BUILD::@6890427a1f51a3e7e1df$", @@ -50,7 +51,7 @@ "backtrace": [ { "file": "^codemodel-v2\\.cmake$", - "line": 42, + "line": 43, "command": "install", "hasParent": true }, @@ -95,7 +96,7 @@ "backtrace": [ { "file": "^codemodel-v2\\.cmake$", - "line": 45, + "line": 46, "command": "install", "hasParent": true }, @@ -143,7 +144,7 @@ "backtrace": [ { "file": "^codemodel-v2\\.cmake$", - "line": 45, + "line": 46, "command": "install", "hasParent": true }, @@ -188,7 +189,7 @@ "backtrace": [ { "file": "^codemodel-v2\\.cmake$", - "line": 45, + "line": 46, "command": "install", "hasParent": true }, @@ -232,7 +233,7 @@ "backtrace": [ { "file": "^codemodel-v2\\.cmake$", - "line": 45, + "line": 46, "command": "install", "hasParent": true }, @@ -276,7 +277,7 @@ "backtrace": [ { "file": "^codemodel-v2\\.cmake$", - "line": 50, + "line": 51, "command": "install", "hasParent": true }, @@ -323,7 +324,7 @@ "backtrace": [ { "file": "^codemodel-v2\\.cmake$", - "line": 52, + "line": 53, "command": "install", "hasParent": true }, @@ -368,7 +369,7 @@ "backtrace": [ { "file": "^codemodel-v2\\.cmake$", - "line": 53, + "line": 54, "command": "install", "hasParent": true }, @@ -417,7 +418,7 @@ "backtrace": [ { "file": "^codemodel-v2\\.cmake$", - "line": 54, + "line": 55, "command": "install", "hasParent": true }, @@ -469,7 +470,7 @@ "backtrace": [ { "file": "^codemodel-v2\\.cmake$", - "line": 55, + "line": 56, "command": "install", "hasParent": true }, @@ -518,7 +519,7 @@ "backtrace": [ { "file": "^codemodel-v2\\.cmake$", - "line": 56, + "line": 57, "command": "install", "hasParent": true }, @@ -560,7 +561,7 @@ "backtrace": [ { "file": "^codemodel-v2\\.cmake$", - "line": 57, + "line": 58, "command": "install", "hasParent": true }, @@ -602,7 +603,7 @@ "backtrace": [ { "file": "^codemodel-v2\\.cmake$", - "line": 58, + "line": 59, "command": "install", "hasParent": true }, diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/codemodel-v2.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/codemodel-v2.json index 151c0a8..8d2712d 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/codemodel-v2.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/codemodel-v2.json @@ -8,7 +8,8 @@ "Imported", "Interface", "Object", - "External" + "External", + "Framework" ], "directorySources": [ "^\\.$", diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/framework.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/framework.json new file mode 100644 index 0000000..259ead1 --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/framework.json @@ -0,0 +1,15 @@ +{ + "name": "Framework", + "parentName": "codemodel-v2", + "childNames": null, + "directorySources": [ + "^framework$" + ], + "targetIds": [ + "^ALL_BUILD::@217a96c3a62328a73ef4$", + "^ZERO_CHECK::@217a96c3a62328a73ef4$", + "^shared_framework::@217a96c3a62328a73ef4$", + "^static_framework::@217a96c3a62328a73ef4$", + "^exe_framework::@217a96c3a62328a73ef4$" + ] +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_framework.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_framework.json new file mode 100644 index 0000000..a4d806a --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_framework.json @@ -0,0 +1,90 @@ +{ + "name": "ALL_BUILD", + "id": "^ALL_BUILD::@217a96c3a62328a73ef4$", + "directorySource": "^framework$", + "projectName": "Framework", + "type": "UTILITY", + "isGeneratorProvided": true, + "fileSets": null, + "sources": [ + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/framework/CMakeFiles/ALL_BUILD$", + "isGenerated": true, + "fileSetName": null, + "sourceGroupName": "", + "compileGroupLanguage": null, + "backtrace": [ + { + "file": "^framework/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + }, + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/framework/CMakeFiles/ALL_BUILD\\.rule$", + "isGenerated": true, + "fileSetName": null, + "sourceGroupName": "CMake Rules", + "compileGroupLanguage": null, + "backtrace": [ + { + "file": "^framework/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + } + ], + "sourceGroups": [ + { + "name": "", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/framework/CMakeFiles/ALL_BUILD$" + ] + }, + { + "name": "CMake Rules", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/framework/CMakeFiles/ALL_BUILD\\.rule$" + ] + } + ], + "compileGroups": null, + "backtrace": [ + { + "file": "^framework/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ], + "folder": null, + "nameOnDisk": null, + "artifacts": null, + "build": "^framework$", + "source": "^framework$", + "install": null, + "link": null, + "archive": null, + "dependencies": [ + { + "id": "^ZERO_CHECK::@217a96c3a62328a73ef4$", + "backtrace": null + }, + { + "id": "^shared_framework::@217a96c3a62328a73ef4$", + "backtrace": null + }, + { + "id": "^static_framework::@217a96c3a62328a73ef4$", + "backtrace": null + }, + { + "id": "^exe_framework::@217a96c3a62328a73ef4$", + "backtrace": null + } + ] +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_top.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_top.json index 46495ac..9d0007f 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_top.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_top.json @@ -201,6 +201,18 @@ { "id": "^c_headers_2::@6b8db101d64c125f29fe$", "backtrace": null + }, + { + "id": "^static_framework::@217a96c3a62328a73ef4$", + "backtrace": null + }, + { + "id": "^shared_framework::@217a96c3a62328a73ef4$", + "backtrace": null + }, + { + "id": "^exe_framework::@217a96c3a62328a73ef4$", + "backtrace": null } ] } diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/apple_exe_framework.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/apple_exe_framework.json new file mode 100644 index 0000000..6d320f4 --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/apple_exe_framework.json @@ -0,0 +1,79 @@ +{ + "compileGroups": + [ + { + "language": "CXX", + "sourcePaths": [ + "^empty\\.cxx$" + ], + "includes": null, + "defines": null, + "frameworks": + [ + { + "isSystem": null, + "path": "^.*/framework/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?static_framework.framework", + "backtrace": null + }, + { + "isSystem": true, + "path": "^.+/framework/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?shared_framework.framework", + "backtrace": null + }, + { + "isSystem": true, + "path": "/usr/Frameworks/Foo.framework", + "backtrace": null + } + ], + "compileCommandFragments": [] + } + ], + "link": { + "language": "CXX", + "lto": null, + "commandFragments": [ + { + "fragment": "-iframework .+/framework(/(Debug|Release|RelWithDebInfo|MinSizeRel))?\"? -iframework /usr/Frameworks$", + "role": "frameworkPath", + "backtrace": null + }, + { + "fragment": ".*static_framework\\.framework/.+/static_framework", + "role": "libraries", + "backtrace": [ + { + "file": "^framework/CMakeLists\\.txt$", + "line": 17, + "command": "target_link_libraries", + "hasParent": true + }, + { + "file": "^framework/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + }, + { + "fragment": ".*shared_framework\\.framework/.+/shared_framework", + "role": "libraries", + "backtrace": [ + { + "file": "^framework/CMakeLists\\.txt$", + "line": 17, + "command": "target_link_libraries", + "hasParent": true + }, + { + "file": "^framework/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + } + ] + } +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/apple_shared_framework.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/apple_shared_framework.json new file mode 100644 index 0000000..31104cf --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/apple_shared_framework.json @@ -0,0 +1,9 @@ +{ + "nameOnDisk": "^shared_framework\\.framework/shared_framework$", + "artifacts": [ + { + "path": "^framework/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?shared_framework\\.framework/shared_framework$", + "_dllExtra": false + } + ] +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/apple_static_framework.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/apple_static_framework.json new file mode 100644 index 0000000..25ffd1a --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/apple_static_framework.json @@ -0,0 +1,9 @@ +{ + "nameOnDisk": "^static_framework\\.framework/static_framework$", + "artifacts": [ + { + "path": "^framework/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?static_framework\\.framework/static_framework$", + "_dllExtra": false + } + ] +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_alias_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_alias_exe.json index a27d328..74b3287 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_alias_exe.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_alias_exe.json @@ -45,6 +45,7 @@ ], "includes": null, "defines": null, + "frameworks": null, "compileCommandFragments": null } ], diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_exe.json index 7cfc0f2..c6ff37a 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_exe.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_exe.json @@ -57,6 +57,7 @@ ], "includes": null, "defines": null, + "frameworks": null, "compileCommandFragments": null } ], diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_headers_1.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_headers_1.json index 715514d..f6cfa9c 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_headers_1.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_headers_1.json @@ -199,6 +199,7 @@ ] } ], + "frameworks": null, "defines": null, "compileCommandFragments": null } diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_headers_2.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_headers_2.json index 4757a9c..591ba4f 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_headers_2.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_headers_2.json @@ -51,6 +51,7 @@ "^fileset/empty\\.c$" ], "includes": null, + "frameworks": null, "defines": null, "compileCommandFragments": null } diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_lib.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_lib.json index 2bfc63f..dc74fdf 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_lib.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_lib.json @@ -56,6 +56,7 @@ "^empty\\.c$" ], "includes": null, + "frameworks": null, "defines": null, "compileCommandFragments": null } diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_object_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_object_exe.json index 6342191..3034e98 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_object_exe.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_object_exe.json @@ -71,6 +71,7 @@ "^empty\\.c$" ], "includes": null, + "frameworks": null, "defines": null, "compileCommandFragments": null } diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_object_lib.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_object_lib.json index 3e1b03b..ec0fdc6 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_object_lib.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_object_lib.json @@ -44,6 +44,7 @@ "^empty\\.c$" ], "includes": null, + "frameworks": null, "defines": null, "compileCommandFragments": null } diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_shared_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_shared_exe.json index f7a8db4..5e92840 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_shared_exe.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_shared_exe.json @@ -56,6 +56,7 @@ "^empty\\.c$" ], "includes": null, + "frameworks": null, "defines": null, "compileCommandFragments": null } diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_shared_lib.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_shared_lib.json index 9066053..85b5108 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_shared_lib.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_shared_lib.json @@ -56,6 +56,7 @@ "^empty\\.c$" ], "includes": null, + "frameworks": null, "defines": [ { "define": "c_shared_lib_EXPORTS", @@ -117,7 +118,7 @@ "backtrace": [ { "file": "^codemodel-v2\\.cmake$", - "line": 45, + "line": 46, "command": "install", "hasParent": true }, @@ -147,7 +148,7 @@ "backtrace": [ { "file": "^codemodel-v2\\.cmake$", - "line": 45, + "line": 46, "command": "install", "hasParent": true }, @@ -177,7 +178,7 @@ "backtrace": [ { "file": "^codemodel-v2\\.cmake$", - "line": 50, + "line": 51, "command": "install", "hasParent": true }, diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_static_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_static_exe.json index 46c5bfe..df43319 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_static_exe.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_static_exe.json @@ -56,6 +56,7 @@ "^empty\\.c$" ], "includes": null, + "frameworks": null, "defines": null, "compileCommandFragments": null } diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_static_lib.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_static_lib.json index df28479..6a51295 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_static_lib.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_static_lib.json @@ -56,6 +56,7 @@ "^empty\\.c$" ], "includes": null, + "frameworks": null, "defines": null, "compileCommandFragments": null } diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_subdir.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_subdir.json index 4fa62e3..362caf9 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_subdir.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_subdir.json @@ -63,6 +63,7 @@ ] } ], + "frameworks": null, "defines": [ { "define": "SUBDIR", diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/custom_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/custom_exe.json index 8d52ab8..449c261 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/custom_exe.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/custom_exe.json @@ -44,6 +44,7 @@ "^empty\\.c$" ], "includes": null, + "frameworks": null, "defines": null, "compileCommandFragments": null } diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_alias_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_alias_exe.json index b27fc5b..a2d3ca4 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_alias_exe.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_alias_exe.json @@ -44,6 +44,7 @@ "^empty\\.cxx$" ], "includes": null, + "frameworks": null, "defines": null, "compileCommandFragments": null } diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe.json index 12b2551..73f9346 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe.json @@ -44,6 +44,7 @@ "^empty\\.cxx$" ], "includes": null, + "frameworks": null, "defines": null, "precompileHeaders": [ { @@ -138,7 +139,7 @@ "backtrace": [ { "file": "^codemodel-v2\\.cmake$", - "line": 42, + "line": 43, "command": "install", "hasParent": true }, diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_precompileheader.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_precompileheader.json index 3251777..ac6a1c0 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_precompileheader.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_precompileheader.json @@ -6,6 +6,7 @@ ".*cmake_pch(_[^.]+)?(\\.hxx)?\\.cxx$" ], "includes": null, + "frameworks": null, "defines": null, "precompileHeaders": [ { @@ -52,6 +53,7 @@ "^empty\\.cxx$" ], "includes": null, + "frameworks": null, "defines": null, "precompileHeaders": [ { diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_precompileheader_2arch.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_precompileheader_2arch.json index 0ac40c2..311fe7a 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_precompileheader_2arch.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_precompileheader_2arch.json @@ -6,6 +6,7 @@ ".*cmake_pch(_[^.]+)?(\\.hxx)?\\.cxx$" ], "includes": null, + "frameworks": null, "defines": null, "precompileHeaders": [ { @@ -52,6 +53,7 @@ ".*cmake_pch(_[^.]+)?(\\.hxx)?\\.cxx$" ], "includes": null, + "frameworks": null, "defines": null, "precompileHeaders": [ { @@ -98,6 +100,7 @@ "^empty\\.cxx$" ], "includes": null, + "frameworks": null, "defines": null, "precompileHeaders": [ { diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_precompileheader_multigen.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_precompileheader_multigen.json index 86168f1..adf979e 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_precompileheader_multigen.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_precompileheader_multigen.json @@ -6,6 +6,7 @@ ".*cmake_pch(_[^.]+)?(\\.hxx)?\\.cxx$" ], "includes": null, + "frameworks": null, "defines": null, "precompileHeaders": [ { @@ -52,6 +53,7 @@ "^empty\\.cxx$" ], "includes": null, + "frameworks": null, "defines": null, "precompileHeaders": [ { diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_lib.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_lib.json index f665004..725cad9 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_lib.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_lib.json @@ -44,6 +44,7 @@ "^empty\\.cxx$" ], "includes": null, + "frameworks": null, "defines": null, "compileCommandFragments": null } diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_object_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_object_exe.json index 68c5dcc..6655215 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_object_exe.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_object_exe.json @@ -71,6 +71,7 @@ "^empty\\.cxx$" ], "includes": null, + "frameworks": null, "defines": null, "compileCommandFragments": null } diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_object_lib.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_object_lib.json index 0438a49..cc2deeb 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_object_lib.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_object_lib.json @@ -44,6 +44,7 @@ "^empty\\.cxx$" ], "includes": null, + "frameworks": null, "defines": null, "compileCommandFragments": null } diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_shared_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_shared_exe.json index bb9989e..1858df7 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_shared_exe.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_shared_exe.json @@ -44,6 +44,7 @@ "^empty\\.cxx$" ], "includes": null, + "frameworks": null, "defines": null, "compileCommandFragments": null } diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_shared_lib.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_shared_lib.json index d6d59a4..c92e573 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_shared_lib.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_shared_lib.json @@ -44,6 +44,7 @@ "^empty\\.cxx$" ], "includes": null, + "frameworks": null, "defines": [ { "define": "cxx_shared_lib_EXPORTS", @@ -93,7 +94,7 @@ "backtrace": [ { "file": "^codemodel-v2\\.cmake$", - "line": 45, + "line": 46, "command": "install", "hasParent": true }, @@ -123,7 +124,7 @@ "backtrace": [ { "file": "^codemodel-v2\\.cmake$", - "line": 45, + "line": 46, "command": "install", "hasParent": true }, @@ -153,7 +154,7 @@ "backtrace": [ { "file": "^codemodel-v2\\.cmake$", - "line": 50, + "line": 51, "command": "install", "hasParent": true }, diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_standard_compile_feature_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_standard_compile_feature_exe.json index a6bacf7..5b07d5a 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_standard_compile_feature_exe.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_standard_compile_feature_exe.json @@ -64,6 +64,7 @@ "^empty\\.cxx$" ], "includes": null, + "frameworks": null, "defines": null, "compileCommandFragments": null } diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_standard_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_standard_exe.json index fe884e0..d9554f1 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_standard_exe.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_standard_exe.json @@ -64,6 +64,7 @@ "^empty\\.cxx$" ], "includes": null, + "frameworks": null, "defines": null, "compileCommandFragments": null } diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_static_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_static_exe.json index d904bd9..001eb8d 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_static_exe.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_static_exe.json @@ -44,6 +44,7 @@ "^empty\\.cxx$" ], "includes": null, + "frameworks": null, "defines": null, "compileCommandFragments": null } diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_static_lib.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_static_lib.json index bced68a..38790dd 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_static_lib.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_static_lib.json @@ -44,6 +44,7 @@ "^empty\\.cxx$" ], "includes": null, + "frameworks": null, "defines": null, "compileCommandFragments": null } diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/exe_framework.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/exe_framework.json new file mode 100644 index 0000000..d5d6522 --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/exe_framework.json @@ -0,0 +1,164 @@ +{ + "name": "exe_framework", + "id": "^exe_framework::@217a96c3a62328a73ef4$", + "directorySource": "^framework$", + "projectName": "Framework", + "type": "EXECUTABLE", + "isGeneratorProvided": null, + "fileSets": null, + "sources": [ + { + "path": "^empty\\.cxx$", + "isGenerated": null, + "fileSetName": null, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "CXX", + "backtrace": [ + { + "file": "^framework/CMakeLists\\.txt$", + "line": 16, + "command": "add_executable", + "hasParent": true + }, + { + "file": "^framework/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + } + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^empty\\.cxx$" + ] + } + ], + "compileGroups": [ + { + "language": "CXX", + "sourcePaths": [ + "^empty\\.cxx$" + ], + "includes": null, + "frameworks": null, + "defines": null, + "compileCommandFragments": null + } + ], + "backtrace": [ + { + "file": "^framework/CMakeLists\\.txt$", + "line": 16, + "command": "add_executable", + "hasParent": true + }, + { + "file": "^framework/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ], + "folder": null, + "nameOnDisk": "^exe_framework(\\.exe)?$", + "artifacts": [ + { + "path": "^framework/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?exe_framework(\\.exe)?$", + "_dllExtra": false + }, + { + "path": "^framework/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?exe_framework\\.pdb$", + "_dllExtra": true + } + ], + "build": "^framework$", + "source": "^framework$", + "install": null, + "link": { + "language": "CXX", + "lto": null, + "commandFragments": [ + { + "fragment": ".*static_framework.*", + "role": "libraries", + "backtrace": [ + { + "file": "^framework/CMakeLists\\.txt$", + "line": 17, + "command": "target_link_libraries", + "hasParent": true + }, + { + "file": "^framework/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + }, + { + "fragment": ".*shared_framework.*", + "role": "libraries", + "backtrace": [ + { + "file": "^framework/CMakeLists\\.txt$", + "line": 17, + "command": "target_link_libraries", + "hasParent": true + }, + { + "file": "^framework/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + } + ] + }, + "archive": null, + "dependencies": [ + { + "id": "^static_framework::@217a96c3a62328a73ef4$", + "backtrace": [ + { + "file": "^framework/CMakeLists\\.txt$", + "line": 17, + "command": "target_link_libraries", + "hasParent": true + }, + { + "file": "^framework/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + }, + { + "id": "^shared_framework::@217a96c3a62328a73ef4$", + "backtrace": [ + { + "file": "^framework/CMakeLists\\.txt$", + "line": 17, + "command": "target_link_libraries", + "hasParent": true + }, + { + "file": "^framework/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + }, + { + "id": "^ZERO_CHECK::@217a96c3a62328a73ef4$", + "backtrace": null + } + ] +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/generated_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/generated_exe.json index 4b69682..f1ef8dd 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/generated_exe.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/generated_exe.json @@ -108,6 +108,7 @@ ] } ], + "frameworks": null, "defines": [ { "define": "EMPTY_C=1", @@ -223,6 +224,7 @@ ] } ], + "frameworks": null, "defines": [ { "define": "GENERATED_EXE=1", diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/interface_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/interface_exe.json index c0c3e79..521e464 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/interface_exe.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/interface_exe.json @@ -68,6 +68,7 @@ "^empty\\.c$" ], "includes": null, + "frameworks": null, "defines": [ { "define": "interface_exe_EXPORTS", diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_exe.json index 45fb0a5..531d8dc 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_exe.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_exe.json @@ -44,6 +44,7 @@ "^empty\\.c$" ], "includes": null, + "frameworks": null, "defines": null, "compileCommandFragments": null } diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_interface_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_interface_exe.json index 74c179c..691edff 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_interface_exe.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_interface_exe.json @@ -44,6 +44,7 @@ "^empty\\.c$" ], "includes": null, + "frameworks": null, "defines": null, "compileCommandFragments": null } diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_object_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_object_exe.json index 6771747..555accc 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_object_exe.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_object_exe.json @@ -44,6 +44,7 @@ "^empty\\.c$" ], "includes": null, + "frameworks": null, "defines": null, "compileCommandFragments": null } diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_shared_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_shared_exe.json index 659e3fb..ead2362 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_shared_exe.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_shared_exe.json @@ -44,6 +44,7 @@ "^empty\\.c$" ], "includes": null, + "frameworks": null, "defines": null, "compileCommandFragments": null } diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_static_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_static_exe.json index 7bdaffb..26dc9db 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_static_exe.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_static_exe.json @@ -44,6 +44,7 @@ "^empty\\.c$" ], "includes": null, + "frameworks": null, "defines": null, "compileCommandFragments": null } diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/shared_framework.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/shared_framework.json new file mode 100644 index 0000000..41b5605 --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/shared_framework.json @@ -0,0 +1,102 @@ +{ + "name": "shared_framework", + "id": "^shared_framework::@217a96c3a62328a73ef4$", + "directorySource": "^framework$", + "projectName": "Framework", + "type": "SHARED_LIBRARY", + "isGeneratorProvided": null, + "fileSets": null, + "sources": [ + { + "path": "^empty\\.cxx$", + "isGenerated": null, + "fileSetName": null, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "CXX", + "backtrace": [ + { + "file": "^framework/CMakeLists\\.txt$", + "line": 7, + "command": "add_library", + "hasParent": true + }, + { + "file": "^framework/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + } + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^empty\\.cxx$" + ] + } + ], + "compileGroups": [ + { + "language": "CXX", + "sourcePaths": [ + "^empty\\.cxx$" + ], + "includes": null, + "frameworks": null, + "defines": [ + { + "define": "shared_framework_EXPORTS", + "backtrace": null + } + ], + "compileCommandFragments": null + } + ], + "backtrace": [ + { + "file": "^framework/CMakeLists\\.txt$", + "line": 7, + "command": "add_library", + "hasParent": true + }, + { + "file": "^framework/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ], + "folder": null, + "nameOnDisk": "^(lib|cyg|msys-)?shared_framework\\.(so|dylib|dll)$", + "artifacts": [ + { + "path": "^framework/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib|cyg|msys-)?shared_framework\\.(so|dylib|dll)$", + "_dllExtra": false + }, + { + "path": "^framework/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?shared_framework\\.(dll\\.a|lib)$", + "_dllExtra": true + }, + { + "path": "^framework/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib|cyg|msys-)?shared_framework\\.pdb$", + "_dllExtra": true + } + ], + "build": "^framework$", + "source": "^framework$", + "install": null, + "link": { + "language": "CXX", + "lto": null, + "commandFragments": null + }, + "archive": null, + "dependencies": [ + { + "id": "^ZERO_CHECK::@217a96c3a62328a73ef4$", + "backtrace": null + } + ] +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/static_framework.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/static_framework.json new file mode 100644 index 0000000..00dd11e --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/static_framework.json @@ -0,0 +1,87 @@ +{ + "name": "static_framework", + "id": "^static_framework::@217a96c3a62328a73ef4$", + "directorySource": "^framework$", + "projectName": "Framework", + "type": "STATIC_LIBRARY", + "isGeneratorProvided": null, + "fileSets": null, + "sources": [ + { + "path": "^empty\\.cxx$", + "isGenerated": null, + "fileSetName": null, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "CXX", + "backtrace": [ + { + "file": "^framework/CMakeLists\\.txt$", + "line": 4, + "command": "add_library", + "hasParent": true + }, + { + "file": "^framework/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + } + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^empty\\.cxx$" + ] + } + ], + "compileGroups": [ + { + "language": "CXX", + "sourcePaths": [ + "^empty\\.cxx$" + ], + "includes": null, + "frameworks": null, + "defines": null, + "compileCommandFragments": null + } + ], + "backtrace": [ + { + "file": "^framework/CMakeLists\\.txt$", + "line": 4, + "command": "add_library", + "hasParent": true + }, + { + "file": "^framework/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ], + "folder": null, + "nameOnDisk": "^(lib)?static_framework\\.(a|lib)$", + "artifacts": [ + { + "path": "^framework/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?static_framework\\.(a|lib)$", + "_dllExtra": false + } + ], + "build": "^framework$", + "source": "^framework$", + "install": null, + "link": null, + "archive": { + "lto": null + }, + "dependencies": [ + { + "id": "^ZERO_CHECK::@217a96c3a62328a73ef4$", + "backtrace": null + } + ] +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_framework.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_framework.json new file mode 100644 index 0000000..6206517 --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_framework.json @@ -0,0 +1,73 @@ +{ + "name": "ZERO_CHECK", + "id": "^ZERO_CHECK::@217a96c3a62328a73ef4$", + "directorySource": "^framework$", + "projectName": "Framework", + "type": "UTILITY", + "isGeneratorProvided": true, + "fileSets": null, + "sources": [ + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/framework/CMakeFiles/ZERO_CHECK$", + "isGenerated": true, + "fileSetName": null, + "sourceGroupName": "", + "compileGroupLanguage": null, + "backtrace": [ + { + "file": "^framework/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + }, + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/framework/CMakeFiles/ZERO_CHECK\\.rule$", + "isGenerated": true, + "fileSetName": null, + "sourceGroupName": "CMake Rules", + "compileGroupLanguage": null, + "backtrace": [ + { + "file": "^framework/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + } + ], + "sourceGroups": [ + { + "name": "", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/framework/CMakeFiles/ZERO_CHECK$" + ] + }, + { + "name": "CMake Rules", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/framework/CMakeFiles/ZERO_CHECK\\.rule$" + ] + } + ], + "compileGroups": null, + "backtrace": [ + { + "file": "^framework/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ], + "folder": null, + "nameOnDisk": null, + "artifacts": null, + "build": "^framework$", + "source": "^framework$", + "install": null, + "link": null, + "archive": null, + "dependencies": null +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2.cmake b/Tests/RunCMake/FileAPI/codemodel-v2.cmake index 09db216..5f4019d 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2.cmake +++ b/Tests/RunCMake/FileAPI/codemodel-v2.cmake @@ -26,6 +26,7 @@ add_subdirectory(custom) add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/../FileAPIExternalSource" "${CMAKE_CURRENT_BINARY_DIR}/../FileAPIExternalBuild") add_subdirectory(dir) add_subdirectory(fileset) +add_subdirectory(framework) set_property(TARGET c_shared_lib PROPERTY LIBRARY_OUTPUT_DIRECTORY lib) set_property(TARGET c_shared_lib PROPERTY RUNTIME_OUTPUT_DIRECTORY lib) diff --git a/Tests/RunCMake/FileAPI/framework/CMakeLists.txt b/Tests/RunCMake/FileAPI/framework/CMakeLists.txt new file mode 100644 index 0000000..d69efbb --- /dev/null +++ b/Tests/RunCMake/FileAPI/framework/CMakeLists.txt @@ -0,0 +1,17 @@ +project(Framework) +enable_language(CXX) + +add_library(static_framework STATIC ../empty.cxx) +set_property(TARGET static_framework PROPERTY FRAMEWORK ON) + +add_library(shared_framework SHARED ../empty.cxx) +set_property(TARGET shared_framework PROPERTY FRAMEWORK ON) +set_property(TARGET shared_framework PROPERTY SYSTEM ON) + +add_library(import_framework SHARED IMPORTED) +set_property(TARGET import_framework PROPERTY FRAMEWORK ON) +set_property(TARGET import_framework PROPERTY IMPORTED_LOCATION /usr/Frameworks/Foo.framework/Foo) +set_property(TARGET import_framework PROPERTY IMPORTED_IMPLIB /usr/Frameworks/Foo.framework/Foo.lib) + +add_executable(exe_framework ../empty.cxx) +target_link_libraries(exe_framework PRIVATE static_framework shared_framework import_framework) |