1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-10-19 11:18:40 +08:00

fileapi: Add test launcher to codemodel-v2

We do not need to bump the minor version because it was recently bumped
by addition of the cross-compiling emulator as another kind of launcher.
This commit is contained in:
Ralf Habacker
2023-11-29 20:39:23 +01:00
committed by Brad King
parent 1ec0372ed4
commit 88863d83d6
13 changed files with 257 additions and 6 deletions

View File

@@ -1022,6 +1022,10 @@ with members:
An emulator for the target platform when cross-compiling.
See the :prop_tgt:`CROSSCOMPILING_EMULATOR` target property.
``test``
A start program for the execution of tests.
See the :prop_tgt:`TEST_LAUNCHER` target property.
This field was added in codemodel version 2.7.
``link``

View File

@@ -2112,15 +2112,18 @@ Json::Value Target::DumpLauncher(const char* name, const char* type)
Json::Value Target::DumpLaunchers()
{
Json::Value launchers;
bool allow =
this->GT->Makefile->GetDefinition("CMAKE_CROSSCOMPILING").IsOn();
Json::Value launcher;
if (allow) {
launcher = DumpLauncher("CROSSCOMPILING_EMULATOR", "emulator");
{
Json::Value launcher = DumpLauncher("TEST_LAUNCHER", "test");
if (!launcher.empty()) {
launchers.append(std::move(launcher));
}
}
if (this->GT->Makefile->IsOn("CMAKE_CROSSCOMPILING")) {
Json::Value emulator = DumpLauncher("CROSSCOMPILING_EMULATOR", "emulator");
if (!emulator.empty()) {
launchers.append(std::move(emulator));
}
}
return launchers;
}
}

View File

@@ -809,6 +809,8 @@ def gen_check_targets(c, g, inSource):
read_codemodel_json_data("targets/cxx_exe.json"),
read_codemodel_json_data("targets/cxx_exe_cross_emulator.json"),
read_codemodel_json_data("targets/cxx_exe_cross_emulator_args.json"),
read_codemodel_json_data("targets/cxx_exe_test_launcher_and_cross_emulator.json"),
read_codemodel_json_data("targets/cxx_exe_test_launcher.json"),
read_codemodel_json_data("targets/cxx_standard_compile_feature_exe.json"),
read_codemodel_json_data("targets/cxx_standard_exe.json"),
read_codemodel_json_data("targets/cxx_shared_lib.json"),

View File

@@ -6,7 +6,8 @@
"childSources": null,
"targetIds": [
"^cxx_exe_cross_emulator::@ee4a268216d1f53c4e2e$",
"^cxx_exe_cross_emulator_args::@ee4a268216d1f53c4e2e$"
"^cxx_exe_cross_emulator_args::@ee4a268216d1f53c4e2e$",
"^cxx_exe_test_launcher_and_cross_emulator::@ee4a268216d1f53c4e2e$"
],
"projectName": "Cxx",
"minimumCMakeVersion": "3.13",

View File

@@ -9,6 +9,7 @@
"^ALL_BUILD::@a56b12a3f5c0529fb296$",
"^ZERO_CHECK::@a56b12a3f5c0529fb296$",
"^cxx_exe::@a56b12a3f5c0529fb296$",
"^cxx_exe_test_launcher::@a56b12a3f5c0529fb296$",
"^cxx_standard_compile_feature_exe::@a56b12a3f5c0529fb296$",
"^cxx_standard_exe::@a56b12a3f5c0529fb296$",
"^cxx_lib::@a56b12a3f5c0529fb296$",

View File

@@ -13,6 +13,8 @@
"^cxx_exe::@a56b12a3f5c0529fb296$",
"^cxx_exe_cross_emulator::@ee4a268216d1f53c4e2e$",
"^cxx_exe_cross_emulator_args::@ee4a268216d1f53c4e2e$",
"^cxx_exe_test_launcher_and_cross_emulator::@ee4a268216d1f53c4e2e$",
"^cxx_exe_test_launcher::@a56b12a3f5c0529fb296$",
"^cxx_standard_compile_feature_exe::@a56b12a3f5c0529fb296$",
"^cxx_standard_exe::@a56b12a3f5c0529fb296$",
"^cxx_shared_lib::@a56b12a3f5c0529fb296$",

View File

@@ -90,6 +90,14 @@
"id": "^cxx_exe_cross_emulator_args::@ee4a268216d1f53c4e2e$",
"backtrace": null
},
{
"id": "^cxx_exe_test_launcher_and_cross_emulator::@ee4a268216d1f53c4e2e$",
"backtrace": null
},
{
"id": "^cxx_exe_test_launcher::@a56b12a3f5c0529fb296$",
"backtrace": null
},
{
"id": "^cxx_standard_compile_feature_exe::@a56b12a3f5c0529fb296$",
"backtrace": null

View File

@@ -130,6 +130,14 @@
"id": "^cxx_exe_cross_emulator_args::@ee4a268216d1f53c4e2e$",
"backtrace": null
},
{
"id": "^cxx_exe_test_launcher_and_cross_emulator::@ee4a268216d1f53c4e2e$",
"backtrace": null
},
{
"id": "^cxx_exe_test_launcher::@a56b12a3f5c0529fb296$",
"backtrace": null
},
{
"id": "^cxx_standard_compile_feature_exe::@a56b12a3f5c0529fb296$",
"backtrace": null

View File

@@ -0,0 +1,105 @@
{
"name": "cxx_exe_test_launcher",
"id": "^cxx_exe_test_launcher::@a56b12a3f5c0529fb296$",
"directorySource": "^cxx$",
"projectName": "Cxx",
"type": "EXECUTABLE",
"isGeneratorProvided": null,
"fileSets": null,
"sources": [
{
"path": "^empty\\.cxx$",
"isGenerated": null,
"fileSetName": null,
"sourceGroupName": "Source Files",
"compileGroupLanguage": "CXX",
"backtrace": [
{
"file": "^cxx/CMakeLists\\.txt$",
"line": 49,
"command": "add_executable",
"hasParent": true
},
{
"file": "^cxx/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": "^cxx/CMakeLists\\.txt$",
"line": 49,
"command": "add_executable",
"hasParent": true
},
{
"file": "^cxx/CMakeLists\\.txt$",
"line": null,
"command": null,
"hasParent": false
}
],
"folder": null,
"nameOnDisk": "^cxx_exe_test_launcher(\\.exe)?$",
"artifacts": [
{
"path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_exe_test_launcher(\\.exe)?$",
"_dllExtra": false
},
{
"path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_exe_test_launcher\\.pdb$",
"_dllExtra": true
}
],
"build": "^cxx$",
"source": "^cxx$",
"install": null,
"launchers" : [
{
"command": "^no-such-launcher(\\.exe)?$",
"type" : "test"
}
],
"link": {
"language": "CXX",
"lto": null,
"commandFragments": [
{
"fragment" : ".*",
"role" : "flags",
"backtrace": null
}
]
},
"archive": null,
"dependencies": [
{
"id": "^ZERO_CHECK::@a56b12a3f5c0529fb296$",
"backtrace": null
}
]
}

View File

@@ -0,0 +1,109 @@
{
"name": "cxx_exe_test_launcher_and_cross_emulator",
"id": "^cxx_exe_test_launcher_and_cross_emulator::@ee4a268216d1f53c4e2e$",
"directorySource": "^cxx/cross$",
"projectName": "Cxx",
"type": "EXECUTABLE",
"isGeneratorProvided": null,
"fileSets": null,
"sources": [
{
"path": "^empty\\.cxx$",
"isGenerated": null,
"fileSetName": null,
"sourceGroupName": "Source Files",
"compileGroupLanguage": "CXX",
"backtrace": [
{
"file": "^cxx/cross/CMakeLists\\.txt$",
"line": 9,
"command": "add_executable",
"hasParent": true
},
{
"file": "^cxx/cross/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": "^cxx/cross/CMakeLists\\.txt$",
"line": 9,
"command": "add_executable",
"hasParent": true
},
{
"file": "^cxx/cross/CMakeLists\\.txt$",
"line": null,
"command": null,
"hasParent": false
}
],
"folder": null,
"nameOnDisk": "^cxx_exe_test_launcher_and_cross_emulator(\\.exe)?$",
"artifacts": [
{
"path": "^cxx/cross/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_exe_test_launcher_and_cross_emulator(\\.exe)?$",
"_dllExtra": false
},
{
"path": "^cxx/cross/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_exe_test_launcher_and_cross_emulator\\.pdb$",
"_dllExtra": true
}
],
"build": "^cxx/cross$",
"source": "^cxx/cross$",
"install": null,
"launchers" : [
{
"command": "^no-such-launcher(\\.exe)?$",
"type" : "test"
},
{
"command": "^no-such-emulator(\\.exe)?$",
"type" : "emulator"
}
],
"link": {
"language": "CXX",
"lto": null,
"commandFragments": [
{
"fragment" : ".*",
"role" : "flags",
"backtrace": null
}
]
},
"archive": null,
"dependencies": [
{
"id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$",
"backtrace": null
}
]
}

View File

@@ -46,4 +46,7 @@ if(_rdeps)
)
endif()
add_executable(cxx_exe_test_launcher ../empty.cxx)
set_property(TARGET cxx_exe_test_launcher PROPERTY TEST_LAUNCHER no-such-launcher)
add_subdirectory(cross)

View File

@@ -5,3 +5,7 @@ set_property(TARGET cxx_exe_cross_emulator PROPERTY CROSSCOMPILING_EMULATOR no-s
add_executable(cxx_exe_cross_emulator_args ../../empty.cxx)
set_property(TARGET cxx_exe_cross_emulator_args PROPERTY CROSSCOMPILING_EMULATOR "no-such-emulator;arg1;arg2 with space")
add_executable(cxx_exe_test_launcher_and_cross_emulator ../../empty.cxx)
set_property(TARGET cxx_exe_test_launcher_and_cross_emulator PROPERTY TEST_LAUNCHER "no-such-launcher")
set_property(TARGET cxx_exe_test_launcher_and_cross_emulator PROPERTY CROSSCOMPILING_EMULATOR "no-such-emulator")

View File

@@ -17,6 +17,7 @@ set(properties
# Metadata
"CROSSCOMPILING_EMULATOR" "emu" "<SAME>"
"TEST_LAUNCHER" "test" "<SAME>"
)
prepare_target_types(executable