Ninja: add some hacks for Windows
This commit is contained in:
parent
895914881b
commit
adb54f3dbf
|
@ -367,6 +367,10 @@ SET(SRCS ${SRCS}
|
||||||
cmNinjaUtilityTargetGenerator.h
|
cmNinjaUtilityTargetGenerator.h
|
||||||
)
|
)
|
||||||
ADD_DEFINITIONS(-DCMAKE_USE_NINJA)
|
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
|
# create a library used by the command line and the GUI
|
||||||
ADD_LIBRARY(CMakeLib ${SRCS})
|
ADD_LIBRARY(CMakeLib ${SRCS})
|
||||||
|
|
|
@ -172,8 +172,7 @@ cmNinjaNormalTargetGenerator
|
||||||
i != linkCmds.end();
|
i != linkCmds.end();
|
||||||
++i)
|
++i)
|
||||||
{
|
{
|
||||||
#ifdef _WIN32
|
#ifdef ENABLE_WIN32_NINJA_HACKS
|
||||||
// HACK: no TARGET_IMPLIB here???
|
|
||||||
cmSystemTools::ReplaceString(*i, "/implib:", "");
|
cmSystemTools::ReplaceString(*i, "/implib:", "");
|
||||||
#endif
|
#endif
|
||||||
this->GetLocalGenerator()->ExpandRuleVariables(*i, vars);
|
this->GetLocalGenerator()->ExpandRuleVariables(*i, vars);
|
||||||
|
|
|
@ -223,9 +223,19 @@ cmNinjaDeps cmNinjaTargetGenerator::ComputeLinkDeps() const
|
||||||
if(!cli)
|
if(!cli)
|
||||||
return cmNinjaDeps();
|
return cmNinjaDeps();
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef ENABLE_WIN32_NINJA_HACKS
|
||||||
const std::vector<std::string> &deps = cli->GetDepends();
|
const std::vector<std::string> &deps = cli->GetDepends();
|
||||||
cmNinjaDeps result(deps.size());
|
cmNinjaDeps result(deps.size());
|
||||||
std::transform(deps.begin(), deps.end(), result.begin(), MapToNinjaPath());
|
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;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue