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
Dennis Klein
CMake
Commits
2d6fba67
Commit
2d6fba67
authored
Oct 13, 2016
by
Brad King
Browse files
Merge branch 'backport-LINK_WHAT_YOU_USE-allow-OFF' into release
parents
f6386a76
933e54d3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Source/cmMakefileExecutableTargetGenerator.cxx
View file @
2d6fba67
...
...
@@ -192,7 +192,7 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
this
->
LocalGenerator
->
AppendFlags
(
linkFlags
,
this
->
Makefile
->
GetDefinition
(
export_flag_var
));
}
if
(
this
->
GeneratorTarget
->
GetProperty
(
"LINK_WHAT_YOU_USE"
))
{
if
(
this
->
GeneratorTarget
->
GetProperty
AsBool
(
"LINK_WHAT_YOU_USE"
))
{
this
->
LocalGenerator
->
AppendFlags
(
linkFlags
,
" -Wl,--no-as-needed"
);
}
...
...
@@ -354,7 +354,7 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
vars
.
LinkFlags
=
linkFlags
.
c_str
();
vars
.
Manifests
=
manifests
.
c_str
();
if
(
this
->
GeneratorTarget
->
GetProperty
(
"LINK_WHAT_YOU_USE"
))
{
if
(
this
->
GeneratorTarget
->
GetProperty
AsBool
(
"LINK_WHAT_YOU_USE"
))
{
std
::
string
cmakeCommand
=
this
->
LocalGenerator
->
ConvertToOutputFormat
(
cmSystemTools
::
GetCMakeCommand
(),
cmLocalGenerator
::
SHELL
);
cmakeCommand
+=
" -E __run_iwyu --lwyu="
;
...
...
Source/cmMakefileLibraryTargetGenerator.cxx
View file @
2d6fba67
...
...
@@ -161,7 +161,7 @@ void cmMakefileLibraryTargetGenerator::WriteSharedLibraryRules(bool relink)
extraFlags
,
"CMAKE_SHARED_LINKER_FLAGS"
,
this
->
ConfigName
);
this
->
AddModuleDefinitionFlag
(
extraFlags
);
if
(
this
->
GeneratorTarget
->
GetProperty
(
"LINK_WHAT_YOU_USE"
))
{
if
(
this
->
GeneratorTarget
->
GetProperty
AsBool
(
"LINK_WHAT_YOU_USE"
))
{
this
->
LocalGenerator
->
AppendFlags
(
extraFlags
,
" -Wl,--no-as-needed"
);
}
this
->
WriteLibraryRules
(
linkRuleVar
,
extraFlags
,
relink
);
...
...
@@ -638,7 +638,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules(
// Get the set of commands.
std
::
string
linkRule
=
this
->
GetLinkRule
(
linkRuleVar
);
cmSystemTools
::
ExpandListArgument
(
linkRule
,
real_link_commands
);
if
(
this
->
GeneratorTarget
->
GetProperty
(
"LINK_WHAT_YOU_USE"
)
&&
if
(
this
->
GeneratorTarget
->
GetProperty
AsBool
(
"LINK_WHAT_YOU_USE"
)
&&
(
this
->
GeneratorTarget
->
GetType
()
==
cmState
::
SHARED_LIBRARY
))
{
std
::
string
cmakeCommand
=
this
->
LocalGenerator
->
ConvertToOutputFormat
(
cmSystemTools
::
GetCMakeCommand
(),
cmLocalGenerator
::
SHELL
);
...
...
Source/cmNinjaNormalTargetGenerator.cxx
View file @
2d6fba67
...
...
@@ -315,7 +315,7 @@ std::vector<std::string> cmNinjaNormalTargetGenerator::ComputeLinkCmd()
const
char
*
linkCmd
=
mf
->
GetDefinition
(
linkCmdVar
);
if
(
linkCmd
)
{
cmSystemTools
::
ExpandListArgument
(
linkCmd
,
linkCmds
);
if
(
this
->
GetGeneratorTarget
()
->
GetProperty
(
"LINK_WHAT_YOU_USE"
))
{
if
(
this
->
GetGeneratorTarget
()
->
GetProperty
AsBool
(
"LINK_WHAT_YOU_USE"
))
{
std
::
string
cmakeCommand
=
this
->
GetLocalGenerator
()
->
ConvertToOutputFormat
(
cmSystemTools
::
GetCMakeCommand
(),
cmLocalGenerator
::
SHELL
);
...
...
@@ -505,7 +505,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
vars
[
"LINK_PATH"
]
=
frameworkPath
+
linkPath
;
std
::
string
lwyuFlags
;
if
(
genTarget
.
GetProperty
(
"LINK_WHAT_YOU_USE"
))
{
if
(
genTarget
.
GetProperty
AsBool
(
"LINK_WHAT_YOU_USE"
))
{
lwyuFlags
=
" -Wl,--no-as-needed"
;
}
...
...
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