Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
CMake
CMake
Commits
df32e564
Commit
df32e564
authored
Aug 19, 2016
by
Gregor Jasny
Committed by
Brad King
Aug 31, 2016
Browse files
Xcode: Add targets marked as EXCLUDE_FROM_ALL to project (
#16101
)
parent
ff88df48
Changes
9
Hide whitespace changes
Inline
Side-by-side
Source/cmGlobalXCodeGenerator.cxx
View file @
df32e564
...
...
@@ -2635,13 +2635,10 @@ void cmGlobalXCodeGenerator::AddDependAndLinkInformation(cmXCodeObject* target)
}
bool
cmGlobalXCodeGenerator
::
CreateGroups
(
cmLocalGenerator
*
root
,
std
::
vector
<
cmLocalGenerator
*>&
generators
)
std
::
vector
<
cmLocalGenerator
*>&
generators
)
{
for
(
std
::
vector
<
cmLocalGenerator
*>::
iterator
i
=
generators
.
begin
();
i
!=
generators
.
end
();
++
i
)
{
if
(
this
->
IsExcluded
(
root
,
*
i
))
{
continue
;
}
cmMakefile
*
mf
=
(
*
i
)
->
GetMakefile
();
std
::
vector
<
cmSourceGroup
>
sourceGroups
=
mf
->
GetSourceGroups
();
std
::
vector
<
cmGeneratorTarget
*>
tgts
=
(
*
i
)
->
GetGeneratorTargets
();
...
...
@@ -2873,7 +2870,7 @@ bool cmGlobalXCodeGenerator::CreateXCodeObjects(
this
->
MainGroupChildren
->
AddObject
(
resourcesGroup
);
// now create the cmake groups
if
(
!
this
->
CreateGroups
(
root
,
generators
))
{
if
(
!
this
->
CreateGroups
(
generators
))
{
return
false
;
}
...
...
@@ -3041,10 +3038,8 @@ bool cmGlobalXCodeGenerator::CreateXCodeObjects(
std
::
vector
<
cmXCodeObject
*>
targets
;
for
(
std
::
vector
<
cmLocalGenerator
*>::
iterator
i
=
generators
.
begin
();
i
!=
generators
.
end
();
++
i
)
{
if
(
!
this
->
IsExcluded
(
root
,
*
i
))
{
if
(
!
this
->
CreateXCodeTargets
(
*
i
,
targets
))
{
return
false
;
}
if
(
!
this
->
CreateXCodeTargets
(
*
i
,
targets
))
{
return
false
;
}
}
// loop over all targets and add link and depend info
...
...
Source/cmGlobalXCodeGenerator.h
View file @
df32e564
...
...
@@ -92,8 +92,7 @@ private:
cmXCodeObject
*
CreateOrGetPBXGroup
(
cmGeneratorTarget
*
gtgt
,
cmSourceGroup
*
sg
);
cmXCodeObject
*
CreatePBXGroup
(
cmXCodeObject
*
parent
,
std
::
string
name
);
bool
CreateGroups
(
cmLocalGenerator
*
root
,
std
::
vector
<
cmLocalGenerator
*>&
generators
);
bool
CreateGroups
(
std
::
vector
<
cmLocalGenerator
*>&
generators
);
std
::
string
XCodeEscapePath
(
const
std
::
string
&
p
);
std
::
string
RelativeToSource
(
const
char
*
p
);
std
::
string
RelativeToBinary
(
const
char
*
p
);
...
...
Tests/RunCMake/add_subdirectory/ExcludeFromAll.cmake
0 → 100644
View file @
df32e564
enable_language
(
CXX
)
add_subdirectory
(
ExcludeFromAll EXCLUDE_FROM_ALL
)
add_executable
(
main main.cpp
)
target_link_libraries
(
main PRIVATE foo
)
Tests/RunCMake/add_subdirectory/ExcludeFromAll/CMakeLists.txt
0 → 100644
View file @
df32e564
add_library
(
bar STATIC bar.cpp
)
add_library
(
foo STATIC foo.cpp
)
target_include_directories
(
foo PUBLIC .
)
Tests/RunCMake/add_subdirectory/ExcludeFromAll/bar.cpp
0 → 100644
View file @
df32e564
#error This should be excluded from all target
Tests/RunCMake/add_subdirectory/ExcludeFromAll/foo.cpp
0 → 100644
View file @
df32e564
#include
"foo.h"
int
foo
()
{
return
42
;
}
Tests/RunCMake/add_subdirectory/ExcludeFromAll/foo.h
0 → 100644
View file @
df32e564
int
foo
();
Tests/RunCMake/add_subdirectory/RunCMakeTest.cmake
View file @
df32e564
...
...
@@ -3,3 +3,15 @@ include(RunCMake)
run_cmake
(
DoesNotExist
)
run_cmake
(
Missing
)
run_cmake
(
Function
)
set
(
RunCMake_TEST_BINARY_DIR
${
RunCMake_BINARY_DIR
}
/ExcludeFromAll-build
)
set
(
RunCMake_TEST_NO_CLEAN 1
)
file
(
REMOVE_RECURSE
"
${
RunCMake_TEST_BINARY_DIR
}
"
)
file
(
MAKE_DIRECTORY
"
${
RunCMake_TEST_BINARY_DIR
}
"
)
run_cmake
(
ExcludeFromAll
)
run_cmake_command
(
ExcludeFromAll-build
${
CMAKE_COMMAND
}
--build .
)
unset
(
RunCMake_TEST_BINARY_DIR
)
unset
(
RunCMake_TEST_NO_CLEAN
)
Tests/RunCMake/add_subdirectory/main.cpp
0 → 100644
View file @
df32e564
#include
"foo.h"
int
main
(
int
,
char
**
)
{
return
foo
();
}
Brad King
@brad.king
mentioned in commit
0a2d0b12
·
Aug 31, 2016
mentioned in commit
0a2d0b12
mentioned in commit 0a2d0b126ca01a7d989a887c71693989e9d15224
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment