mirror of
https://github.com/Kitware/CMake.git
synced 2025-12-31 10:50:16 -06:00
Xcode: Create Xcode schemes per target
This commit is contained in:
@@ -353,6 +353,7 @@ syn keyword cmakeProperty contained
|
||||
\ XCODE_EMIT_EFFECTIVE_PLATFORM_NAME
|
||||
\ XCODE_EXPLICIT_FILE_TYPE
|
||||
\ XCODE_FILE_ATTRIBUTES
|
||||
\ XCODE_GENERATE_SCHEME
|
||||
\ XCODE_LAST_KNOWN_FILE_TYPE
|
||||
\ XCODE_PRODUCT_TYPE
|
||||
\ XCODE_SCHEME_ADDRESS_SANITIZER
|
||||
|
||||
@@ -349,6 +349,7 @@ Properties on Targets
|
||||
/prop_tgt/WINDOWS_EXPORT_ALL_SYMBOLS
|
||||
/prop_tgt/XCODE_ATTRIBUTE_an-attribute
|
||||
/prop_tgt/XCODE_EXPLICIT_FILE_TYPE
|
||||
/prop_tgt/XCODE_GENERATE_SCHEME
|
||||
/prop_tgt/XCODE_PRODUCT_TYPE
|
||||
/prop_tgt/XCODE_SCHEME_ADDRESS_SANITIZER
|
||||
/prop_tgt/XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN
|
||||
|
||||
39
Help/prop_tgt/XCODE_GENERATE_SCHEME.rst
Normal file
39
Help/prop_tgt/XCODE_GENERATE_SCHEME.rst
Normal file
@@ -0,0 +1,39 @@
|
||||
XCODE_GENERATE_SCHEME
|
||||
---------------------
|
||||
|
||||
If enabled, the Xcode generator will generate schema files. These
|
||||
are useful to invoke analyze, archive, build-for-testing and test
|
||||
actions from the command line.
|
||||
|
||||
This property is initialized by the value of the variable
|
||||
:variable:`CMAKE_XCODE_GENERATE_SCHEME` if it is set when a target
|
||||
is created.
|
||||
|
||||
The following target properties overwrite the default of the
|
||||
corresponding settings on the "Diagnostic" tab for each schema file.
|
||||
Each of those is initialized by the respective ``CMAKE_`` variable
|
||||
at target creation time.
|
||||
|
||||
- :prop_tgt:`XCODE_SCHEME_ADDRESS_SANITIZER`
|
||||
- :prop_tgt:`XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN`
|
||||
- :prop_tgt:`XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER`
|
||||
- :prop_tgt:`XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS`
|
||||
- :prop_tgt:`XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE`
|
||||
- :prop_tgt:`XCODE_SCHEME_GUARD_MALLOC`
|
||||
- :prop_tgt:`XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP`
|
||||
- :prop_tgt:`XCODE_SCHEME_MALLOC_GUARD_EDGES`
|
||||
- :prop_tgt:`XCODE_SCHEME_MALLOC_SCRIBBLE`
|
||||
- :prop_tgt:`XCODE_SCHEME_MALLOC_STACK`
|
||||
- :prop_tgt:`XCODE_SCHEME_THREAD_SANITIZER`
|
||||
- :prop_tgt:`XCODE_SCHEME_THREAD_SANITIZER_STOP`
|
||||
- :prop_tgt:`XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER`
|
||||
- :prop_tgt:`XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP`
|
||||
- :prop_tgt:`XCODE_SCHEME_ZOMBIE_OBJECTS`
|
||||
|
||||
The following target properties will be applied on the
|
||||
"Info" and "Arguments" tab:
|
||||
|
||||
- :prop_tgt:`XCODE_SCHEME_ARGUMENTS`
|
||||
- :prop_tgt:`XCODE_SCHEME_DEBUG_AS_ROOT`
|
||||
- :prop_tgt:`XCODE_SCHEME_ENVIRONMENT`
|
||||
- :prop_tgt:`XCODE_SCHEME_EXECUTABLE`
|
||||
@@ -8,5 +8,5 @@ This property is initialized by the value of the variable
|
||||
:variable:`CMAKE_XCODE_SCHEME_ADDRESS_SANITIZER` if it is set
|
||||
when a target is created.
|
||||
|
||||
Please refer to the :variable:`CMAKE_XCODE_GENERATE_SCHEME` variable
|
||||
Please refer to the :prop_tgt:`XCODE_GENERATE_SCHEME` target property
|
||||
documentation to see all Xcode schema related properties.
|
||||
|
||||
@@ -8,5 +8,5 @@ This property is initialized by the value of the variable
|
||||
:variable:`CMAKE_XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN`
|
||||
if it is set when a target is created.
|
||||
|
||||
Please refer to the :variable:`CMAKE_XCODE_GENERATE_SCHEME` variable
|
||||
Please refer to the :prop_tgt:`XCODE_GENERATE_SCHEME` target property
|
||||
documentation to see all Xcode schema related properties.
|
||||
|
||||
@@ -6,5 +6,5 @@ section of the generated Xcode scheme.
|
||||
|
||||
If set to a list of arguments those will be added to the scheme.
|
||||
|
||||
Please refer to the :variable:`CMAKE_XCODE_GENERATE_SCHEME` variable
|
||||
Please refer to the :prop_tgt:`XCODE_GENERATE_SCHEME` target property
|
||||
documentation to see all Xcode schema related properties.
|
||||
|
||||
@@ -3,5 +3,5 @@ XCODE_SCHEME_DEBUG_AS_ROOT
|
||||
|
||||
Whether to debug the target as 'root'.
|
||||
|
||||
Please refer to the :variable:`CMAKE_XCODE_GENERATE_SCHEME` variable
|
||||
Please refer to the :prop_tgt:`XCODE_GENERATE_SCHEME` target property
|
||||
documentation to see all Xcode schema related properties.
|
||||
|
||||
@@ -8,5 +8,5 @@ This property is initialized by the value of the variable
|
||||
:variable:`CMAKE_XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER`
|
||||
if it is set when a target is created.
|
||||
|
||||
Please refer to the :variable:`CMAKE_XCODE_GENERATE_SCHEME` variable
|
||||
Please refer to the :prop_tgt:`XCODE_GENERATE_SCHEME` target property
|
||||
documentation to see all Xcode schema related properties.
|
||||
|
||||
@@ -8,5 +8,5 @@ This property is initialized by the value of the variable
|
||||
:variable:`CMAKE_XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS` if it is set
|
||||
when a target is created.
|
||||
|
||||
Please refer to the :variable:`CMAKE_XCODE_GENERATE_SCHEME` variable
|
||||
Please refer to the :prop_tgt:`XCODE_GENERATE_SCHEME` target property
|
||||
documentation to see all Xcode schema related properties.
|
||||
|
||||
@@ -8,5 +8,5 @@ This property is initialized by the value of the variable
|
||||
:variable:`CMAKE_XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE` if it is set
|
||||
when a target is created.
|
||||
|
||||
Please refer to the :variable:`CMAKE_XCODE_GENERATE_SCHEME` variable
|
||||
Please refer to the :prop_tgt:`XCODE_GENERATE_SCHEME` target property
|
||||
documentation to see all Xcode schema related properties.
|
||||
|
||||
@@ -8,5 +8,5 @@ If set to a list of environment variables and values of the form
|
||||
``MYVAR=value`` those environment variables will be added to the
|
||||
scheme.
|
||||
|
||||
Please refer to the :variable:`CMAKE_XCODE_GENERATE_SCHEME` variable
|
||||
Please refer to the :prop_tgt:`XCODE_GENERATE_SCHEME` target property
|
||||
documentation to see all Xcode schema related properties.
|
||||
|
||||
@@ -5,5 +5,5 @@ Specify path to executable in the Info section of the generated
|
||||
Xcode scheme. If not set the schema generator will select the
|
||||
current target if it is actually executable.
|
||||
|
||||
Please refer to the :variable:`CMAKE_XCODE_GENERATE_SCHEME` variable
|
||||
Please refer to the :prop_tgt:`XCODE_GENERATE_SCHEME` target property
|
||||
documentation to see all Xcode schema related properties.
|
||||
|
||||
@@ -8,5 +8,5 @@ This property is initialized by the value of the variable
|
||||
:variable:`CMAKE_XCODE_SCHEME_GUARD_MALLOC` if it is set
|
||||
when a target is created.
|
||||
|
||||
Please refer to the :variable:`CMAKE_XCODE_GENERATE_SCHEME` variable
|
||||
Please refer to the :prop_tgt:`XCODE_GENERATE_SCHEME` target property
|
||||
documentation to see all Xcode schema related properties.
|
||||
|
||||
@@ -9,5 +9,5 @@ This property is initialized by the value of the variable
|
||||
:variable:`CMAKE_XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP` if it is set
|
||||
when a target is created.
|
||||
|
||||
Please refer to the :variable:`CMAKE_XCODE_GENERATE_SCHEME` variable
|
||||
Please refer to the :prop_tgt:`XCODE_GENERATE_SCHEME` target property
|
||||
documentation to see all Xcode schema related properties.
|
||||
|
||||
@@ -8,5 +8,5 @@ This property is initialized by the value of the variable
|
||||
:variable:`CMAKE_XCODE_SCHEME_MALLOC_GUARD_EDGES` if it is set
|
||||
when a target is created.
|
||||
|
||||
Please refer to the :variable:`CMAKE_XCODE_GENERATE_SCHEME` variable
|
||||
Please refer to the :prop_tgt:`XCODE_GENERATE_SCHEME` target property
|
||||
documentation to see all Xcode schema related properties.
|
||||
|
||||
@@ -8,5 +8,5 @@ This property is initialized by the value of the variable
|
||||
:variable:`CMAKE_XCODE_SCHEME_MALLOC_SCRIBBLE` if it is set
|
||||
when a target is created.
|
||||
|
||||
Please refer to the :variable:`CMAKE_XCODE_GENERATE_SCHEME` variable
|
||||
Please refer to the :prop_tgt:`XCODE_GENERATE_SCHEME` target property
|
||||
documentation to see all Xcode schema related properties.
|
||||
|
||||
@@ -8,5 +8,5 @@ This property is initialized by the value of the variable
|
||||
:variable:`CMAKE_XCODE_SCHEME_MALLOC_STACK` if it is set
|
||||
when a target is created.
|
||||
|
||||
Please refer to the :variable:`CMAKE_XCODE_GENERATE_SCHEME` variable
|
||||
Please refer to the :prop_tgt:`XCODE_GENERATE_SCHEME` target property
|
||||
documentation to see all Xcode schema related properties.
|
||||
|
||||
@@ -8,5 +8,5 @@ This property is initialized by the value of the variable
|
||||
:variable:`CMAKE_XCODE_SCHEME_THREAD_SANITIZER` if it is set
|
||||
when a target is created.
|
||||
|
||||
Please refer to the :variable:`CMAKE_XCODE_GENERATE_SCHEME` variable
|
||||
Please refer to the :prop_tgt:`XCODE_GENERATE_SCHEME` target property
|
||||
documentation to see all Xcode schema related properties.
|
||||
|
||||
@@ -8,5 +8,5 @@ This property is initialized by the value of the variable
|
||||
:variable:`CMAKE_XCODE_SCHEME_THREAD_SANITIZER_STOP` if it is set
|
||||
when a target is created.
|
||||
|
||||
Please refer to the :variable:`CMAKE_XCODE_GENERATE_SCHEME` variable
|
||||
Please refer to the :prop_tgt:`XCODE_GENERATE_SCHEME` target property
|
||||
documentation to see all Xcode schema related properties.
|
||||
|
||||
@@ -8,5 +8,5 @@ This property is initialized by the value of the variable
|
||||
:variable:`CMAKE_XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER`
|
||||
if it is set when a target is created.
|
||||
|
||||
Please refer to the :variable:`CMAKE_XCODE_GENERATE_SCHEME` variable
|
||||
Please refer to the :prop_tgt:`XCODE_GENERATE_SCHEME` target property
|
||||
documentation to see all Xcode schema related properties.
|
||||
|
||||
@@ -9,5 +9,5 @@ This property is initialized by the value of the variable
|
||||
:variable:`CMAKE_XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP`
|
||||
if it is set when a target is created.
|
||||
|
||||
Please refer to the :variable:`CMAKE_XCODE_GENERATE_SCHEME` variable
|
||||
Please refer to the :prop_tgt:`XCODE_GENERATE_SCHEME` target property
|
||||
documentation to see all Xcode schema related properties.
|
||||
|
||||
@@ -8,5 +8,5 @@ This property is initialized by the value of the variable
|
||||
:variable:`CMAKE_XCODE_SCHEME_ZOMBIE_OBJECTS` if it is set
|
||||
when a target is created.
|
||||
|
||||
Please refer to the :variable:`CMAKE_XCODE_GENERATE_SCHEME` variable
|
||||
Please refer to the :prop_tgt:`XCODE_GENERATE_SCHEME` target property
|
||||
documentation to see all Xcode schema related properties.
|
||||
|
||||
6
Help/release/dev/xcode-scheme-per-target.rst
Normal file
6
Help/release/dev/xcode-scheme-per-target.rst
Normal file
@@ -0,0 +1,6 @@
|
||||
xcode-scheme-per-target
|
||||
-----------------------
|
||||
|
||||
* The :generator:`Xcode` generator now supports per-target schemes.
|
||||
See the :variable:`CMAKE_XCODE_GENERATE_SCHEME` variable and
|
||||
:prop_tgt:`XCODE_GENERATE_SCHEME` target property.
|
||||
@@ -5,31 +5,6 @@ If enabled, the Xcode generator will generate schema files. These
|
||||
are useful to invoke analyze, archive, build-for-testing and test
|
||||
actions from the command line.
|
||||
|
||||
The following target properties overwrite the default of the
|
||||
corresponding settings on the "Diagnostic" tab for each schema file.
|
||||
Each of those is initialized by the respective ``CMAKE_`` variable
|
||||
at target creation time.
|
||||
|
||||
- :prop_tgt:`XCODE_SCHEME_ADDRESS_SANITIZER`
|
||||
- :prop_tgt:`XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN`
|
||||
- :prop_tgt:`XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER`
|
||||
- :prop_tgt:`XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS`
|
||||
- :prop_tgt:`XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE`
|
||||
- :prop_tgt:`XCODE_SCHEME_GUARD_MALLOC`
|
||||
- :prop_tgt:`XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP`
|
||||
- :prop_tgt:`XCODE_SCHEME_MALLOC_GUARD_EDGES`
|
||||
- :prop_tgt:`XCODE_SCHEME_MALLOC_SCRIBBLE`
|
||||
- :prop_tgt:`XCODE_SCHEME_MALLOC_STACK`
|
||||
- :prop_tgt:`XCODE_SCHEME_THREAD_SANITIZER`
|
||||
- :prop_tgt:`XCODE_SCHEME_THREAD_SANITIZER_STOP`
|
||||
- :prop_tgt:`XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER`
|
||||
- :prop_tgt:`XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP`
|
||||
- :prop_tgt:`XCODE_SCHEME_ZOMBIE_OBJECTS`
|
||||
|
||||
The following target properties will be applied on the
|
||||
"Info" and "Arguments" tab:
|
||||
|
||||
- :prop_tgt:`XCODE_SCHEME_ARGUMENTS`
|
||||
- :prop_tgt:`XCODE_SCHEME_DEBUG_AS_ROOT`
|
||||
- :prop_tgt:`XCODE_SCHEME_ENVIRONMENT`
|
||||
- :prop_tgt:`XCODE_SCHEME_EXECUTABLE`
|
||||
This variable initializes the
|
||||
:prop_tgt:`XCODE_GENERATE_SCHEME`
|
||||
target property on all targets.
|
||||
|
||||
@@ -8,5 +8,5 @@ This variable initializes the
|
||||
:prop_tgt:`XCODE_SCHEME_ADDRESS_SANITIZER`
|
||||
property on all targets.
|
||||
|
||||
Please refer to the :variable:`CMAKE_XCODE_GENERATE_SCHEME` variable
|
||||
Please refer to the :prop_tgt:`XCODE_GENERATE_SCHEME` target property
|
||||
documentation to see all Xcode schema related properties.
|
||||
|
||||
@@ -8,5 +8,5 @@ This variable initializes the
|
||||
:prop_tgt:`XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN`
|
||||
property on all targets.
|
||||
|
||||
Please refer to the :variable:`CMAKE_XCODE_GENERATE_SCHEME` variable
|
||||
Please refer to the :prop_tgt:`XCODE_GENERATE_SCHEME` target property
|
||||
documentation to see all Xcode schema related properties.
|
||||
|
||||
@@ -8,5 +8,5 @@ This variable initializes the
|
||||
:prop_tgt:`XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER`
|
||||
property on all targets.
|
||||
|
||||
Please refer to the :variable:`CMAKE_XCODE_GENERATE_SCHEME` variable
|
||||
Please refer to the :prop_tgt:`XCODE_GENERATE_SCHEME` target property
|
||||
documentation to see all Xcode schema related properties.
|
||||
|
||||
@@ -8,5 +8,5 @@ This variable initializes the
|
||||
:prop_tgt:`XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS`
|
||||
property on all targets.
|
||||
|
||||
Please refer to the :variable:`CMAKE_XCODE_GENERATE_SCHEME` variable
|
||||
Please refer to the :prop_tgt:`XCODE_GENERATE_SCHEME` target property
|
||||
documentation to see all Xcode schema related properties.
|
||||
|
||||
@@ -8,5 +8,5 @@ This variable initializes the
|
||||
:prop_tgt:`XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE`
|
||||
property on all targets.
|
||||
|
||||
Please refer to the :variable:`CMAKE_XCODE_GENERATE_SCHEME` variable
|
||||
Please refer to the :prop_tgt:`XCODE_GENERATE_SCHEME` target property
|
||||
documentation to see all Xcode schema related properties.
|
||||
|
||||
@@ -8,5 +8,5 @@ This variable initializes the
|
||||
:prop_tgt:`XCODE_SCHEME_GUARD_MALLOC`
|
||||
property on all targets.
|
||||
|
||||
Please refer to the :variable:`CMAKE_XCODE_GENERATE_SCHEME` variable
|
||||
Please refer to the :prop_tgt:`XCODE_GENERATE_SCHEME` target property
|
||||
documentation to see all Xcode schema related properties.
|
||||
|
||||
@@ -9,5 +9,5 @@ This variable initializes the
|
||||
:prop_tgt:`XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP`
|
||||
property on all targets.
|
||||
|
||||
Please refer to the :variable:`CMAKE_XCODE_GENERATE_SCHEME` variable
|
||||
Please refer to the :prop_tgt:`XCODE_GENERATE_SCHEME` target property
|
||||
documentation to see all Xcode schema related properties.
|
||||
|
||||
@@ -8,5 +8,5 @@ This variable initializes the
|
||||
:prop_tgt:`XCODE_SCHEME_MALLOC_GUARD_EDGES`
|
||||
property on all targets.
|
||||
|
||||
Please refer to the :variable:`CMAKE_XCODE_GENERATE_SCHEME` variable
|
||||
Please refer to the :prop_tgt:`XCODE_GENERATE_SCHEME` target property
|
||||
documentation to see all Xcode schema related properties.
|
||||
|
||||
@@ -8,5 +8,5 @@ This variable initializes the
|
||||
:prop_tgt:`XCODE_SCHEME_MALLOC_SCRIBBLE`
|
||||
property on all targets.
|
||||
|
||||
Please refer to the :variable:`CMAKE_XCODE_GENERATE_SCHEME` variable
|
||||
Please refer to the :prop_tgt:`XCODE_GENERATE_SCHEME` target property
|
||||
documentation to see all Xcode schema related properties.
|
||||
|
||||
@@ -8,5 +8,5 @@ This variable initializes the
|
||||
:prop_tgt:`XCODE_SCHEME_MALLOC_STACK`
|
||||
property on all targets.
|
||||
|
||||
Please refer to the :variable:`CMAKE_XCODE_GENERATE_SCHEME` variable
|
||||
Please refer to the :prop_tgt:`XCODE_GENERATE_SCHEME` target property
|
||||
documentation to see all Xcode schema related properties.
|
||||
|
||||
@@ -8,5 +8,5 @@ This variable initializes the
|
||||
:prop_tgt:`XCODE_SCHEME_THREAD_SANITIZER`
|
||||
property on all targets.
|
||||
|
||||
Please refer to the :variable:`CMAKE_XCODE_GENERATE_SCHEME` variable
|
||||
Please refer to the :prop_tgt:`XCODE_GENERATE_SCHEME` target property
|
||||
documentation to see all Xcode schema related properties.
|
||||
|
||||
@@ -8,5 +8,5 @@ This variable initializes the
|
||||
:prop_tgt:`XCODE_SCHEME_THREAD_SANITIZER_STOP`
|
||||
property on all targets.
|
||||
|
||||
Please refer to the :variable:`CMAKE_XCODE_GENERATE_SCHEME` variable
|
||||
Please refer to the :prop_tgt:`XCODE_GENERATE_SCHEME` target property
|
||||
documentation to see all Xcode schema related properties.
|
||||
|
||||
@@ -8,5 +8,5 @@ This variable initializes the
|
||||
:prop_tgt:`XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER`
|
||||
property on all targets.
|
||||
|
||||
Please refer to the :variable:`CMAKE_XCODE_GENERATE_SCHEME` variable
|
||||
Please refer to the :prop_tgt:`XCODE_GENERATE_SCHEME` target property
|
||||
documentation to see all Xcode schema related properties.
|
||||
|
||||
@@ -9,5 +9,5 @@ This variable initializes the
|
||||
:prop_tgt:`XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP`
|
||||
property on all targets.
|
||||
|
||||
Please refer to the :variable:`CMAKE_XCODE_GENERATE_SCHEME` variable
|
||||
Please refer to the :prop_tgt:`XCODE_GENERATE_SCHEME` target property
|
||||
documentation to see all Xcode schema related properties.
|
||||
|
||||
@@ -8,5 +8,5 @@ This variable initializes the
|
||||
:prop_tgt:`XCODE_SCHEME_ZOMBIE_OBJECTS`
|
||||
property on all targets.
|
||||
|
||||
Please refer to the :variable:`CMAKE_XCODE_GENERATE_SCHEME` variable
|
||||
Please refer to the :prop_tgt:`XCODE_GENERATE_SCHEME` target property
|
||||
documentation to see all Xcode schema related properties.
|
||||
|
||||
@@ -3402,10 +3402,8 @@ void cmGlobalXCodeGenerator::OutputXCodeProject(
|
||||
}
|
||||
this->WriteXCodePBXProj(fout, root, generators);
|
||||
|
||||
if (this->IsGeneratingScheme(root)) {
|
||||
this->OutputXCodeSharedSchemes(xcodeDir);
|
||||
}
|
||||
this->OutputXCodeWorkspaceSettings(xcodeDir, root);
|
||||
bool hasGeneratedSchemes = this->OutputXCodeSharedSchemes(xcodeDir, root);
|
||||
this->OutputXCodeWorkspaceSettings(xcodeDir, hasGeneratedSchemes);
|
||||
|
||||
this->ClearXCodeObjects();
|
||||
|
||||
@@ -3415,17 +3413,8 @@ void cmGlobalXCodeGenerator::OutputXCodeProject(
|
||||
root->GetBinaryDirectory());
|
||||
}
|
||||
|
||||
bool cmGlobalXCodeGenerator::IsGeneratingScheme(cmLocalGenerator* root) const
|
||||
{
|
||||
// Since the lowest available Xcode version for testing was 6.4,
|
||||
// I'm setting this as a limit then
|
||||
return this->XcodeVersion >= 64 &&
|
||||
(root->GetMakefile()->GetCMakeInstance()->GetIsInTryCompile() ||
|
||||
root->GetMakefile()->IsOn("CMAKE_XCODE_GENERATE_SCHEME"));
|
||||
}
|
||||
|
||||
void cmGlobalXCodeGenerator::OutputXCodeSharedSchemes(
|
||||
const std::string& xcProjDir)
|
||||
bool cmGlobalXCodeGenerator::OutputXCodeSharedSchemes(
|
||||
const std::string& xcProjDir, cmLocalGenerator* root)
|
||||
{
|
||||
// collect all tests for the targets
|
||||
std::map<std::string, cmXCodeScheme::TestObjects> testables;
|
||||
@@ -3449,21 +3438,33 @@ void cmGlobalXCodeGenerator::OutputXCodeSharedSchemes(
|
||||
}
|
||||
|
||||
// generate scheme
|
||||
for (auto obj : this->XCodeObjects) {
|
||||
if (obj->GetType() == cmXCodeObject::OBJECT &&
|
||||
(obj->GetIsA() == cmXCodeObject::PBXNativeTarget ||
|
||||
obj->GetIsA() == cmXCodeObject::PBXAggregateTarget)) {
|
||||
const std::string& targetName = obj->GetTarget()->GetName();
|
||||
cmXCodeScheme schm(obj, testables[targetName],
|
||||
this->CurrentConfigurationTypes, this->XcodeVersion);
|
||||
schm.WriteXCodeSharedScheme(xcProjDir,
|
||||
this->RelativeToSource(xcProjDir));
|
||||
bool ret = false;
|
||||
|
||||
// Since the lowest available Xcode version for testing was 6.4,
|
||||
// I'm setting this as a limit then
|
||||
if (this->XcodeVersion >= 64) {
|
||||
for (auto obj : this->XCodeObjects) {
|
||||
if (obj->GetType() == cmXCodeObject::OBJECT &&
|
||||
(obj->GetIsA() == cmXCodeObject::PBXNativeTarget ||
|
||||
obj->GetIsA() == cmXCodeObject::PBXAggregateTarget) &&
|
||||
(root->GetMakefile()->GetCMakeInstance()->GetIsInTryCompile() ||
|
||||
obj->GetTarget()->GetPropertyAsBool("XCODE_GENERATE_SCHEME"))) {
|
||||
const std::string& targetName = obj->GetTarget()->GetName();
|
||||
cmXCodeScheme schm(obj, testables[targetName],
|
||||
this->CurrentConfigurationTypes,
|
||||
this->XcodeVersion);
|
||||
schm.WriteXCodeSharedScheme(xcProjDir,
|
||||
this->RelativeToSource(xcProjDir));
|
||||
ret = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void cmGlobalXCodeGenerator::OutputXCodeWorkspaceSettings(
|
||||
const std::string& xcProjDir, cmLocalGenerator* root)
|
||||
const std::string& xcProjDir, bool hasGeneratedSchemes)
|
||||
{
|
||||
std::string xcodeSharedDataDir = xcProjDir;
|
||||
xcodeSharedDataDir += "/project.xcworkspace/xcshareddata";
|
||||
@@ -3489,7 +3490,7 @@ void cmGlobalXCodeGenerator::OutputXCodeWorkspaceSettings(
|
||||
xout.Element("key", "BuildSystemType");
|
||||
xout.Element("string", "Original");
|
||||
}
|
||||
if (this->IsGeneratingScheme(root)) {
|
||||
if (hasGeneratedSchemes) {
|
||||
xout.Element("key",
|
||||
"IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded");
|
||||
xout.Element("false");
|
||||
|
||||
@@ -186,11 +186,12 @@ private:
|
||||
std::vector<cmLocalGenerator*>& generators);
|
||||
void OutputXCodeProject(cmLocalGenerator* root,
|
||||
std::vector<cmLocalGenerator*>& generators);
|
||||
bool IsGeneratingScheme(cmLocalGenerator* root) const;
|
||||
// Write shared scheme files for all the native targets
|
||||
void OutputXCodeSharedSchemes(const std::string& xcProjDir);
|
||||
// return true if any were written
|
||||
bool OutputXCodeSharedSchemes(const std::string& xcProjDir,
|
||||
cmLocalGenerator* root);
|
||||
void OutputXCodeWorkspaceSettings(const std::string& xcProjDir,
|
||||
cmLocalGenerator* root);
|
||||
bool hasGeneratedSchemes);
|
||||
void WriteXCodePBXProj(std::ostream& fout, cmLocalGenerator* root,
|
||||
std::vector<cmLocalGenerator*>& generators);
|
||||
cmXCodeObject* CreateXCodeFileReferenceFromPath(const std::string& fullpath,
|
||||
|
||||
@@ -283,6 +283,7 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type,
|
||||
this->SetPropertyDefault("FOLDER", nullptr);
|
||||
#ifdef __APPLE__
|
||||
if (this->GetGlobalGenerator()->IsXcode()) {
|
||||
this->SetPropertyDefault("XCODE_GENERATE_SCHEME", nullptr);
|
||||
this->SetPropertyDefault("XCODE_SCHEME_ADDRESS_SANITIZER", nullptr);
|
||||
this->SetPropertyDefault(
|
||||
"XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN", nullptr);
|
||||
|
||||
@@ -7,6 +7,13 @@ function(check_property property matcher)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function(expect_no_schema target)
|
||||
set(schema "${RunCMake_TEST_BINARY_DIR}/XcodeSchemaProperty.xcodeproj/xcshareddata/xcschemes/${target}.xcscheme")
|
||||
if(EXISTS ${schema})
|
||||
message(SEND_ERROR "Found unexpected schema ${schema}")
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
check_property("ADDRESS_SANITIZER" "enableAddressSanitizer")
|
||||
check_property("ADDRESS_SANITIZER_USE_AFTER_RETURN" "enableASanStackUseAfterReturn")
|
||||
check_property("THREAD_SANITIZER" "enableThreadSanitizer")
|
||||
@@ -31,3 +38,5 @@ check_property("ENVIRONMENT" [=[key="FOO"]=])
|
||||
check_property("ENVIRONMENT" [=[value="foo"]=])
|
||||
check_property("ENVIRONMENT" [=[key="BAR"]=])
|
||||
check_property("ENVIRONMENT" [=[value="bar"]=])
|
||||
|
||||
expect_no_schema("NoSchema")
|
||||
|
||||
@@ -35,3 +35,6 @@ endfunction()
|
||||
create_scheme_for_property(EXECUTABLE myExecutable)
|
||||
create_scheme_for_property(ARGUMENTS "--foo;--bar=baz")
|
||||
create_scheme_for_property(ENVIRONMENT "FOO=foo;BAR=bar")
|
||||
|
||||
add_executable(NoSchema main.cpp)
|
||||
set_target_properties(NoSchema PROPERTIES XCODE_GENERATE_SCHEME OFF)
|
||||
|
||||
Reference in New Issue
Block a user