[Cmake-commits] CMake branch, next, updated. v3.0.2-5337-g4edb08f
Brad King
brad.king at kitware.com
Mon Sep 15 11:02:01 EDT 2014
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via 4edb08f2c8806d8f9189127566ed956877b5d03a (commit)
via a3298f7790316322c60b7f2e618fb2ae01819a17 (commit)
from a7646f9e2d06f5145d8be7d3a1b93d3e4d9fe61b (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4edb08f2c8806d8f9189127566ed956877b5d03a
commit 4edb08f2c8806d8f9189127566ed956877b5d03a
Merge: a7646f9 a3298f7
Author: Brad King <brad.king at kitware.com>
AuthorDate: Mon Sep 15 11:02:00 2014 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Sep 15 11:02:00 2014 -0400
Merge topic 'vs10-wince' into next
a3298f77 VS: Teach VS >= 10 generator about Windows CE
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a3298f7790316322c60b7f2e618fb2ae01819a17
commit a3298f7790316322c60b7f2e618fb2ae01819a17
Author: Pascal Bach <pascal.bach at siemens.com>
AuthorDate: Mon Sep 15 15:46:43 2014 +0200
Commit: Brad King <brad.king at kitware.com>
CommitDate: Mon Sep 15 10:37:40 2014 -0400
VS: Teach VS >= 10 generator about Windows CE
When CMAKE_SYSTEM_NAME is 'WindowsCE':
* Set the Subsystem and EntryPointSymbol accordingly.
* When CMAKE_SYSTEM_VERSION is 8.0 (Windows CE 2013),
select the CE800 toolset by default.
diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx
index e2d4645..e947c54 100644
--- a/Source/cmGlobalVisualStudio10Generator.cxx
+++ b/Source/cmGlobalVisualStudio10Generator.cxx
@@ -97,6 +97,7 @@ cmGlobalVisualStudio10Generator::cmGlobalVisualStudio10Generator(
this->ExpressEdition = cmSystemTools::ReadRegistryValue(
"HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\10.0\\Setup\\VC;"
"ProductDir", vc10Express, cmSystemTools::KeyWOW64_32);
+ this->SystemIsWindowsCE = false;
this->SystemIsWindowsPhone = false;
this->SystemIsWindowsStore = false;
this->MSBuildCommandInitialized = false;
@@ -152,6 +153,16 @@ bool
cmGlobalVisualStudio10Generator::SetGeneratorToolset(std::string const& ts,
cmMakefile* mf)
{
+ if (this->SystemIsWindowsCE && ts.empty() &&
+ this->DefaultPlatformToolset.empty())
+ {
+ cmOStringStream e;
+ e << this->GetName() << " Windows CE version '" << this->SystemVersion
+ << "' requires CMAKE_GENERATOR_TOOLSET to be set.";
+ mf->IssueMessage(cmake::FATAL_ERROR, e.str());
+ return false;
+ }
+
this->GeneratorToolset = ts;
if(const char* toolset = this->GetPlatformToolset())
{
@@ -163,7 +174,15 @@ cmGlobalVisualStudio10Generator::SetGeneratorToolset(std::string const& ts,
//----------------------------------------------------------------------------
bool cmGlobalVisualStudio10Generator::InitializeSystem(cmMakefile* mf)
{
- if(this->SystemName == "WindowsPhone")
+ if (this->SystemName == "WindowsCE")
+ {
+ this->SystemIsWindowsCE = true;
+ if (!this->InitializeWindowsCE(mf))
+ {
+ return false;
+ }
+ }
+ else if(this->SystemName == "WindowsPhone")
{
this->SystemIsWindowsPhone = true;
if(!this->InitializeWindowsPhone(mf))
@@ -183,6 +202,23 @@ bool cmGlobalVisualStudio10Generator::InitializeSystem(cmMakefile* mf)
}
//----------------------------------------------------------------------------
+bool cmGlobalVisualStudio10Generator::InitializeWindowsCE(cmMakefile* mf)
+{
+ if (this->DefaultPlatformName != "Win32")
+ {
+ cmOStringStream e;
+ e << "CMAKE_SYSTEM_NAME is 'WindowsCE' but CMAKE_GENERATOR "
+ << "specifies a platform too: '" << this->GetName() << "'";
+ mf->IssueMessage(cmake::FATAL_ERROR, e.str());
+ return false;
+ }
+
+ this->DefaultPlatformToolset = this->SelectWindowsCEToolset();
+
+ return true;
+}
+
+//----------------------------------------------------------------------------
bool cmGlobalVisualStudio10Generator::InitializeWindowsPhone(cmMakefile* mf)
{
cmOStringStream e;
@@ -201,6 +237,16 @@ bool cmGlobalVisualStudio10Generator::InitializeWindowsStore(cmMakefile* mf)
}
//----------------------------------------------------------------------------
+std::string cmGlobalVisualStudio10Generator::SelectWindowsCEToolset() const
+{
+ if (this->SystemVersion == "8.0")
+ {
+ return "CE800";
+ }
+ return "";
+}
+
+//----------------------------------------------------------------------------
void cmGlobalVisualStudio10Generator::WriteSLNHeader(std::ostream& fout)
{
fout << "Microsoft Visual Studio Solution File, Format Version 11.00\n";
diff --git a/Source/cmGlobalVisualStudio10Generator.h b/Source/cmGlobalVisualStudio10Generator.h
index f1ff9a4..c02d204 100644
--- a/Source/cmGlobalVisualStudio10Generator.h
+++ b/Source/cmGlobalVisualStudio10Generator.h
@@ -68,6 +68,10 @@ public:
/** Return the CMAKE_SYSTEM_VERSION. */
std::string const& GetSystemVersion() const { return this->SystemVersion; }
+ /** Return true if building for WindowsCE */
+ bool TargetsWindowsCE() const
+ { return this->SystemIsWindowsCE; }
+
/** Return true if building for WindowsPhone */
bool TargetsWindowsPhone() const
{ return this->SystemIsWindowsPhone; }
@@ -105,8 +109,10 @@ public:
protected:
virtual void Generate();
virtual bool InitializeSystem(cmMakefile* mf);
+ virtual bool InitializeWindowsCE(cmMakefile* mf);
virtual bool InitializeWindowsPhone(cmMakefile* mf);
virtual bool InitializeWindowsStore(cmMakefile* mf);
+ virtual std::string SelectWindowsCEToolset() const;
virtual std::string SelectWindowsPhoneToolset() const { return ""; }
virtual std::string SelectWindowsStoreToolset() const { return ""; }
@@ -118,6 +124,7 @@ protected:
std::string DefaultPlatformToolset;
std::string SystemName;
std::string SystemVersion;
+ bool SystemIsWindowsCE;
bool SystemIsWindowsPhone;
bool SystemIsWindowsStore;
bool ExpressEdition;
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index c525b7c..4b5c83f 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -2115,11 +2115,27 @@ cmVisualStudio10TargetGenerator::ComputeLinkOptions(std::string const& config)
if ( this->Target->GetPropertyAsBool("WIN32_EXECUTABLE") )
{
- linkOptions.AddFlag("SubSystem", "Windows");
+ if (this->GlobalGenerator->TargetsWindowsCE())
+ {
+ linkOptions.AddFlag("SubSystem", "WindowsCE");
+ linkOptions.AddFlag("EntryPointSymbol", "WinMainCRTStartup");
+ }
+ else
+ {
+ linkOptions.AddFlag("SubSystem", "Windows");
+ }
}
else
{
- linkOptions.AddFlag("SubSystem", "Console");
+ if (this->GlobalGenerator->TargetsWindowsCE())
+ {
+ linkOptions.AddFlag("SubSystem", "WindowsCE");
+ linkOptions.AddFlag("EntryPointSymbol", "mainACRTStartup");
+ }
+ else
+ {
+ linkOptions.AddFlag("SubSystem", "Console");
+ };
}
if(const char* stackVal =
-----------------------------------------------------------------------
Summary of changes:
Source/cmGlobalVisualStudio10Generator.cxx | 48 +++++++++++++++++++++++++++-
Source/cmGlobalVisualStudio10Generator.h | 7 ++++
Source/cmVisualStudio10TargetGenerator.cxx | 20 ++++++++++--
3 files changed, 72 insertions(+), 3 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list