On 09/12/2014 08:47 AM, Pascal Bach wrote:
> - If Windows CE is targeted set the Subsystem and EntryPointSymbol accordingly
> - For Windows CE 2013 (8.0) set the toolset to C800 by default

Great, thanks.

> +bool cmGlobalVisualStudio10Generator::InitializeWindowsCE(cmMakefile* mf)
> +  {

Here please add this check:

  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 code should no longer be called multiple times so it is safe to
check here now.

> +  // To preserve the old behaviour just keep the DefaultPlatformToolset
> +  // for unknown Windows CE versions, in the worst case the user has to set
> +  // CMAKE_GENERATOR_TOOLSET manually. In that case warn the user.
> +  std::string platformToolset = this->SelectWindowsCEToolset();
> +  if (!platformToolset.empty())
> +    {
> +    this->DefaultPlatformToolset = platformToolset;
> +    }
> +  else
> +    {
> +    cmOStringStream e;
> +    e << this->GetName() << " Windows CE version '" << this->SystemVersion
> +      << "' might require CMAKE_GENERATOR_TOOLSET to be set.";
> +    mf->IssueMessage(cmake::WARNING, e.str());
> +    }

I think this will always warn when CMAKE_SYSTEM_VERSION != 8.0
even if the user has set a CMAKE_GENERATOR_TOOLSET.  Instead,
cmGlobalVisualStudio10Generator::SetGeneratorToolset should
implement the warning:

* Have InitializeWindowsCE always do
  this->DefaultPlatformToolset = this->SelectWindowsCEToolset()
  even when it is empty.

* Teach SetGeneratorToolset to check for SystemIsWindowsCE *and*
  ts.empty() *and* DefaultPlatformToolset.empty().  If this is
  all true, then generate an error asking the user to specify
  the toolset, or perhaps just a warning if the toolset is not
  always required.

Thanks,
-Brad
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers

Reply via email to