Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Daniel Pfeifer
CMake
Commits
5c2fd97d
Commit
5c2fd97d
authored
Nov 02, 2015
by
Daniel Pfeifer
Browse files
PCH: implementation for Visual Studio 10.0
parent
56ee545f
Pipeline
#62471
passed with stage
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Source/cmVisualStudio10TargetGenerator.cxx
View file @
5c2fd97d
...
...
@@ -1897,6 +1897,18 @@ void cmVisualStudio10TargetGenerator::WriteAllSources()
this
->
WriteMissingFiles
();
}
// Precompile Headers
const
std
::
string
&
linkLanguage
=
this
->
GeneratorTarget
->
GetLinkerLanguage
();
std
::
string
pchSource
=
this
->
GeneratorTarget
->
GetPchSource
(
""
,
linkLanguage
);
if
(
!
pchSource
.
empty
())
{
this
->
ConvertToWindowsSlash
(
pchSource
);
this
->
WriteString
(
"<ClCompile Include=
\"
"
,
2
);
(
*
this
->
BuildFileStream
)
<<
cmVS10EscapeXML
(
pchSource
)
<<
"
\"
>
\n
"
;
this
->
WriteString
(
"<PrecompiledHeader>Create</PrecompiledHeader>
\n
"
,
3
);
this
->
WriteString
(
"</ClCompile>
\n
"
,
2
);
}
this
->
WriteString
(
"</ItemGroup>
\n
"
,
1
);
}
...
...
@@ -2271,13 +2283,24 @@ bool cmVisualStudio10TargetGenerator::ComputeClOptions(
// Check IPO related warning/error.
this
->
GeneratorTarget
->
IsIPOEnabled
(
linkLanguage
,
configName
);
// Precompile Headers
std
::
string
pchHeader
=
this
->
GeneratorTarget
->
GetPchHeader
(
configName
,
linkLanguage
);
if
(
!
pchHeader
.
empty
())
{
this
->
ConvertToWindowsSlash
(
pchHeader
);
clOptions
.
AddFlag
(
"PrecompiledHeader"
,
"Use"
);
clOptions
.
AddFlag
(
"PrecompiledHeaderFile"
,
pchHeader
.
c_str
());
clOptions
.
AddFlag
(
"ForcedIncludeFiles"
,
pchHeader
.
c_str
());
}
else
if
(
this
->
MSTools
&&
vcxproj
==
this
->
ProjectType
)
{
clOptions
.
AddFlag
(
"PrecompiledHeader"
,
"NotUsing"
);
}
// Get preprocessor definitions for this directory.
std
::
string
defineFlags
=
this
->
GeneratorTarget
->
Target
->
GetMakefile
()
->
GetDefineFlags
();
if
(
this
->
MSTools
)
{
if
(
vcxproj
==
this
->
ProjectType
)
{
clOptions
.
FixExceptionHandlingDefault
();
clOptions
.
AddFlag
(
"PrecompiledHeader"
,
"NotUsing"
);
std
::
string
asmLocation
=
configName
+
"/"
;
clOptions
.
AddFlag
(
"AssemblerListingLocation"
,
asmLocation
.
c_str
());
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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