Ninja: add some hacks for Windows
This commit is contained in:
parent
895914881b
commit
adb54f3dbf
|
@ -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})
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue