Ninja: add some hacks for Windows

This commit is contained in:
Peter Kuemmel 2012-02-19 11:30:07 +01:00
parent 895914881b
commit adb54f3dbf
3 changed files with 15 additions and 2 deletions

View File

@ -367,6 +367,10 @@ SET(SRCS ${SRCS}
cmNinjaUtilityTargetGenerator.h
)
ADD_DEFINITIONS(-DCMAKE_USE_NINJA)
IF(WIN32)
# TODO remove
ADD_DEFINITIONS(-DENABLE_WIN32_NINJA_HACKS)
endif()
# create a library used by the command line and the GUI
ADD_LIBRARY(CMakeLib ${SRCS})

View File

@ -172,8 +172,7 @@ cmNinjaNormalTargetGenerator
i != linkCmds.end();
++i)
{
#ifdef _WIN32
// HACK: no TARGET_IMPLIB here???
#ifdef ENABLE_WIN32_NINJA_HACKS
cmSystemTools::ReplaceString(*i, "/implib:", "");
#endif
this->GetLocalGenerator()->ExpandRuleVariables(*i, vars);

View File

@ -223,9 +223,19 @@ cmNinjaDeps cmNinjaTargetGenerator::ComputeLinkDeps() const
if(!cli)
return cmNinjaDeps();
#ifndef ENABLE_WIN32_NINJA_HACKS
const std::vector<std::string> &deps = cli->GetDepends();
cmNinjaDeps result(deps.size());
std::transform(deps.begin(), deps.end(), result.begin(), MapToNinjaPath());
#else
cmNinjaDeps result;
for(unsigned i = 0; i < cli->GetItems().size(); ++i) {
if( cli->GetItems()[i].Target ) {
result.push_back( cli->GetItems()[i].Target->GetName() );
}
}
#endif
return result;
}