summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/FileAPI
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-07-20 19:30:31 (GMT)
committerBrad King <brad.king@kitware.com>2020-08-07 12:46:34 (GMT)
commitbafa9fe8876387fa16cc8c03832d27df81238af1 (patch)
treeceacc9bc2f52d38411937d99363cfc9697ec3300 /Tests/RunCMake/FileAPI
parent439191313363caea225a508634495c50d4cc60dd (diff)
downloadCMake-bafa9fe8876387fa16cc8c03832d27df81238af1.zip
CMake-bafa9fe8876387fa16cc8c03832d27df81238af1.tar.gz
CMake-bafa9fe8876387fa16cc8c03832d27df81238af1.tar.bz2
fileapi: Add INTERFACE libraries with SOURCES to codemodel-v2
INTERFACE libraries with SOURCES now appear in the generated buildsystem, so include them in the codemodel output too. We do not need to bump the `codemodel-v2` object kind minor version because that was already done in post-3.18 development by commit 7d6861f367 (fileapi: Extend codemodel targets with language standard, 2020-06-18). Fixes: #18608
Diffstat (limited to 'Tests/RunCMake/FileAPI')
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-check.py6
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/directories/interface.json14
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/directories/top.json1
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/projects/codemodel-v2.json1
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/projects/interface.json13
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_interface.json79
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_top.json4
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe.json2
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/targets/iface_srcs.json67
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_interface.json70
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2.cmake1
-rw-r--r--Tests/RunCMake/FileAPI/interface/CMakeLists.txt3
12 files changed, 260 insertions, 1 deletions
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-check.py b/Tests/RunCMake/FileAPI/codemodel-v2-check.py
index b567bf1..c66757f 100644
--- a/Tests/RunCMake/FileAPI/codemodel-v2-check.py
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-check.py
@@ -522,6 +522,7 @@ def gen_check_directories(c, g):
read_codemodel_json_data("directories/custom.json"),
read_codemodel_json_data("directories/cxx.json"),
read_codemodel_json_data("directories/imported.json"),
+ read_codemodel_json_data("directories/interface.json"),
read_codemodel_json_data("directories/object.json"),
read_codemodel_json_data("directories/dir.json"),
read_codemodel_json_data("directories/dir_dir.json"),
@@ -594,6 +595,10 @@ def gen_check_targets(c, g, inSource):
read_codemodel_json_data("targets/link_imported_object_exe.json"),
read_codemodel_json_data("targets/link_imported_interface_exe.json"),
+ read_codemodel_json_data("targets/all_build_interface.json"),
+ read_codemodel_json_data("targets/zero_check_interface.json"),
+ read_codemodel_json_data("targets/iface_srcs.json"),
+
read_codemodel_json_data("targets/all_build_custom.json"),
read_codemodel_json_data("targets/zero_check_custom.json"),
read_codemodel_json_data("targets/custom_tgt.json"),
@@ -722,6 +727,7 @@ def gen_check_projects(c, g):
read_codemodel_json_data("projects/alias.json"),
read_codemodel_json_data("projects/object.json"),
read_codemodel_json_data("projects/imported.json"),
+ read_codemodel_json_data("projects/interface.json"),
read_codemodel_json_data("projects/custom.json"),
read_codemodel_json_data("projects/external.json"),
]
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/interface.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/interface.json
new file mode 100644
index 0000000..b10d496
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/interface.json
@@ -0,0 +1,14 @@
+{
+ "source": "^interface$",
+ "build": "^interface$",
+ "parentSource": "^\\.$",
+ "childSources": null,
+ "targetIds": [
+ "^ALL_BUILD::@25b7fa8ea00134654b85$",
+ "^ZERO_CHECK::@25b7fa8ea00134654b85$",
+ "^iface_srcs::@25b7fa8ea00134654b85$"
+ ],
+ "projectName": "Interface",
+ "minimumCMakeVersion": "3.12",
+ "hasInstallRule": null
+}
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/top.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/top.json
index c144953..736d1f5 100644
--- a/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/top.json
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/top.json
@@ -7,6 +7,7 @@
"^custom$",
"^cxx$",
"^imported$",
+ "^interface$",
"^object$",
"^.*/Tests/RunCMake/FileAPIExternalSource$",
"^dir$"
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 f3aac63..4d0cdc0 100644
--- a/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/codemodel-v2.json
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/codemodel-v2.json
@@ -6,6 +6,7 @@
"Custom",
"Cxx",
"Imported",
+ "Interface",
"Object",
"External"
],
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/interface.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/interface.json
new file mode 100644
index 0000000..2a22767
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/interface.json
@@ -0,0 +1,13 @@
+{
+ "name": "Interface",
+ "parentName": "codemodel-v2",
+ "childNames": null,
+ "directorySources": [
+ "^interface$"
+ ],
+ "targetIds": [
+ "^ALL_BUILD::@25b7fa8ea00134654b85$",
+ "^ZERO_CHECK::@25b7fa8ea00134654b85$",
+ "^iface_srcs::@25b7fa8ea00134654b85$"
+ ]
+}
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_interface.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_interface.json
new file mode 100644
index 0000000..fa2a6e5
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_interface.json
@@ -0,0 +1,79 @@
+{
+ "name": "ALL_BUILD",
+ "id": "^ALL_BUILD::@25b7fa8ea00134654b85$",
+ "directorySource": "^interface$",
+ "projectName": "Interface",
+ "type": "UTILITY",
+ "isGeneratorProvided": true,
+ "sources": [
+ {
+ "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/interface/CMakeFiles/ALL_BUILD$",
+ "isGenerated": true,
+ "sourceGroupName": "",
+ "compileGroupLanguage": null,
+ "backtrace": [
+ {
+ "file": "^interface/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ },
+ {
+ "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/interface/CMakeFiles/ALL_BUILD\\.rule$",
+ "isGenerated": true,
+ "sourceGroupName": "CMake Rules",
+ "compileGroupLanguage": null,
+ "backtrace": [
+ {
+ "file": "^interface/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ }
+ ],
+ "sourceGroups": [
+ {
+ "name": "",
+ "sourcePaths": [
+ "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/interface/CMakeFiles/ALL_BUILD$"
+ ]
+ },
+ {
+ "name": "CMake Rules",
+ "sourcePaths": [
+ "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/interface/CMakeFiles/ALL_BUILD\\.rule$"
+ ]
+ }
+ ],
+ "compileGroups": null,
+ "backtrace": [
+ {
+ "file": "^interface/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ],
+ "folder": null,
+ "nameOnDisk": null,
+ "artifacts": null,
+ "build": "^interface$",
+ "source": "^interface$",
+ "install": null,
+ "link": null,
+ "archive": null,
+ "dependencies": [
+ {
+ "id": "^ZERO_CHECK::@25b7fa8ea00134654b85$",
+ "backtrace": null
+ },
+ {
+ "id": "^iface_srcs::@25b7fa8ea00134654b85$",
+ "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 59bd750..d023f99 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
@@ -176,6 +176,10 @@
"backtrace": null
},
{
+ "id": "^iface_srcs::@25b7fa8ea00134654b85$",
+ "backtrace": null
+ },
+ {
"id": "^custom_exe::@c11385ffed57b860da63$",
"backtrace": 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 e7ab55b..c9e652b 100644
--- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe.json
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe.json
@@ -119,7 +119,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
- "line": 37,
+ "line": 38,
"command": "install",
"hasParent": true
},
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/iface_srcs.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/iface_srcs.json
new file mode 100644
index 0000000..97d7ccd
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/iface_srcs.json
@@ -0,0 +1,67 @@
+{
+ "name": "iface_srcs",
+ "id": "^iface_srcs::@25b7fa8ea00134654b85$",
+ "directorySource": "^interface$",
+ "projectName": "Interface",
+ "type": "INTERFACE_LIBRARY",
+ "isGeneratorProvided": null,
+ "sources": [
+ {
+ "path": "^empty\\.c$",
+ "isGenerated": null,
+ "sourceGroupName": "Source Files",
+ "compileGroupLanguage": null,
+ "backtrace": [
+ {
+ "file": "^interface/CMakeLists\\.txt$",
+ "line": 3,
+ "command": "add_library",
+ "hasParent": true
+ },
+ {
+ "file": "^interface/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ }
+ ],
+ "sourceGroups": [
+ {
+ "name": "Source Files",
+ "sourcePaths": [
+ "^empty\\.c$"
+ ]
+ }
+ ],
+ "compileGroups": null,
+ "backtrace": [
+ {
+ "file": "^interface/CMakeLists\\.txt$",
+ "line": 3,
+ "command": "add_library",
+ "hasParent": true
+ },
+ {
+ "file": "^interface/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ],
+ "folder": null,
+ "nameOnDisk": null,
+ "artifacts": null,
+ "build": "^interface$",
+ "source": "^interface$",
+ "install": null,
+ "link": null,
+ "archive": null,
+ "dependencies": [
+ {
+ "id": "^ZERO_CHECK::@25b7fa8ea00134654b85$",
+ "backtrace": null
+ }
+ ]
+}
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_interface.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_interface.json
new file mode 100644
index 0000000..fdd4b2a
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_interface.json
@@ -0,0 +1,70 @@
+{
+ "name": "ZERO_CHECK",
+ "id": "^ZERO_CHECK::@25b7fa8ea00134654b85$",
+ "directorySource": "^interface$",
+ "projectName": "Interface",
+ "type": "UTILITY",
+ "isGeneratorProvided": true,
+ "sources": [
+ {
+ "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/interface/CMakeFiles/ZERO_CHECK$",
+ "isGenerated": true,
+ "sourceGroupName": "",
+ "compileGroupLanguage": null,
+ "backtrace": [
+ {
+ "file": "^interface/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ },
+ {
+ "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/interface/CMakeFiles/ZERO_CHECK\\.rule$",
+ "isGenerated": true,
+ "sourceGroupName": "CMake Rules",
+ "compileGroupLanguage": null,
+ "backtrace": [
+ {
+ "file": "^interface/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ }
+ ],
+ "sourceGroups": [
+ {
+ "name": "",
+ "sourcePaths": [
+ "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/interface/CMakeFiles/ZERO_CHECK$"
+ ]
+ },
+ {
+ "name": "CMake Rules",
+ "sourcePaths": [
+ "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/interface/CMakeFiles/ZERO_CHECK\\.rule$"
+ ]
+ }
+ ],
+ "compileGroups": null,
+ "backtrace": [
+ {
+ "file": "^interface/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ],
+ "folder": null,
+ "nameOnDisk": null,
+ "artifacts": null,
+ "build": "^interface$",
+ "source": "^interface$",
+ "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 c98a84c..2405954 100644
--- a/Tests/RunCMake/FileAPI/codemodel-v2.cmake
+++ b/Tests/RunCMake/FileAPI/codemodel-v2.cmake
@@ -18,6 +18,7 @@ add_subdirectory(cxx)
add_subdirectory(alias)
add_subdirectory(object)
add_subdirectory(imported)
+add_subdirectory(interface)
add_subdirectory(custom)
add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/../FileAPIExternalSource" "${CMAKE_CURRENT_BINARY_DIR}/../FileAPIExternalBuild")
add_subdirectory(dir)
diff --git a/Tests/RunCMake/FileAPI/interface/CMakeLists.txt b/Tests/RunCMake/FileAPI/interface/CMakeLists.txt
new file mode 100644
index 0000000..97948c5
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/interface/CMakeLists.txt
@@ -0,0 +1,3 @@
+project(Interface)
+add_library(iface_none INTERFACE)
+add_library(iface_srcs INTERFACE ../empty.c)