diff options
author | Peter Kuemmel <syntheticpp@gmx.net> | 2012-02-19 10:30:07 (GMT) |
---|---|---|
committer | Peter Kuemmel <syntheticpp@gmx.net> | 2012-02-19 10:30:07 (GMT) |
commit | adb54f3dbf802f643c8af9f8de6f67f24804dd22 (patch) | |
tree | aa1c66af0924c5f077de120655f444df2295b6b1 /Source | |
parent | 895914881be32f862dee638a0a86313366f9b7b4 (diff) | |
download | CMake-adb54f3dbf802f643c8af9f8de6f67f24804dd22.zip CMake-adb54f3dbf802f643c8af9f8de6f67f24804dd22.tar.gz CMake-adb54f3dbf802f643c8af9f8de6f67f24804dd22.tar.bz2 |
Ninja: add some hacks for Windows
Diffstat (limited to 'Source')
-rw-r--r-- | Source/CMakeLists.txt | 4 | ||||
-rw-r--r-- | Source/cmNinjaNormalTargetGenerator.cxx | 3 | ||||
-rw-r--r-- | Source/cmNinjaTargetGenerator.cxx | 10 |
3 files changed, 15 insertions, 2 deletions
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index e0a6f42..a53a0c1 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -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}) diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index 0174c3d..97b46bf 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -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); diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index 8a563b6..cc6024b 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -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; } |