Ninja: enable ninja support everywhere

This commit is contained in:
Peter Kümmel 2012-07-20 10:53:34 +02:00
parent d569f3ef15
commit 5d365b26ec
4 changed files with 20 additions and 43 deletions

View File

@ -359,40 +359,25 @@ IF (WIN32)
ENDIF(NOT UNIX) ENDIF(NOT UNIX)
ENDIF (WIN32) ENDIF (WIN32)
# Turn on Ninja by default, but disable it # Ninja support
# on platforms where it does not pass all tests. SET(SRCS ${SRCS}
# Enforce Ninja support by setting CMAKE_USE_NINJA cmGlobalNinjaGenerator.cxx
set(_CMAKE_DEFAULT_NINJA_VALUE TRUE) cmGlobalNinjaGenerator.h
if(APPLE) cmNinjaTypes.h
SET(_CMAKE_DEFAULT_NINJA_VALUE TRUE) cmLocalNinjaGenerator.cxx
endif() cmLocalNinjaGenerator.h
SET(CMAKE_ENABLE_NINJA ${_CMAKE_DEFAULT_NINJA_VALUE} CACHE BOOL cmNinjaTargetGenerator.cxx
"Enable the ninja generator for CMake. When enabled, some CMake tests still fail on OSX") cmNinjaTargetGenerator.h
MARK_AS_ADVANCED(CMAKE_ENABLE_NINJA) cmNinjaNormalTargetGenerator.cxx
IF(CMAKE_ENABLE_NINJA) cmNinjaNormalTargetGenerator.h
MESSAGE(STATUS "Ninja generator enabled.") cmNinjaUtilityTargetGenerator.cxx
SET(SRCS ${SRCS} cmNinjaUtilityTargetGenerator.h
cmGlobalNinjaGenerator.cxx )
cmGlobalNinjaGenerator.h IF(WIN32 AND NOT CYGWIN AND NOT BORLAND)
cmNinjaTypes.h SET_SOURCE_FILES_PROPERTIES(cmcldeps.cxx PROPERTIES COMPILE_DEFINITIONS _WIN32_WINNT=0x0501)
cmLocalNinjaGenerator.cxx ADD_EXECUTABLE(cmcldeps cmcldeps.cxx)
cmLocalNinjaGenerator.h TARGET_LINK_LIBRARIES(cmcldeps CMakeLib)
cmNinjaTargetGenerator.cxx INSTALL_TARGETS(/bin cmcldeps)
cmNinjaTargetGenerator.h
cmNinjaNormalTargetGenerator.cxx
cmNinjaNormalTargetGenerator.h
cmNinjaUtilityTargetGenerator.cxx
cmNinjaUtilityTargetGenerator.h
)
ADD_DEFINITIONS(-DCMAKE_USE_NINJA)
IF(WIN32 AND NOT CYGWIN AND NOT BORLAND)
SET_SOURCE_FILES_PROPERTIES(cmcldeps.cxx PROPERTIES COMPILE_DEFINITIONS _WIN32_WINNT=0x0501)
ADD_EXECUTABLE(cmcldeps cmcldeps.cxx)
TARGET_LINK_LIBRARIES(cmcldeps CMakeLib)
INSTALL_TARGETS(/bin cmcldeps)
ENDIF()
ELSE()
MESSAGE(STATUS "Ninja generator disabled, enable it with -DCMAKE_ENABLE_NINJA=ON")
ENDIF() ENDIF()
# create a library used by the command line and the GUI # create a library used by the command line and the GUI

View File

@ -60,9 +60,7 @@ cmExtraCodeBlocksGenerator::cmExtraCodeBlocksGenerator()
// disable until somebody actually tests it: // disable until somebody actually tests it:
// this->SupportedGlobalGenerators.push_back("MSYS Makefiles"); // this->SupportedGlobalGenerators.push_back("MSYS Makefiles");
#endif #endif
#ifdef CMAKE_USE_NINJA
this->SupportedGlobalGenerators.push_back("Ninja"); this->SupportedGlobalGenerators.push_back("Ninja");
#endif
this->SupportedGlobalGenerators.push_back("Unix Makefiles"); this->SupportedGlobalGenerators.push_back("Unix Makefiles");
} }

View File

@ -34,9 +34,7 @@ cmExtraEclipseCDT4Generator
this->SupportedGlobalGenerators.push_back("MinGW Makefiles"); this->SupportedGlobalGenerators.push_back("MinGW Makefiles");
// this->SupportedGlobalGenerators.push_back("MSYS Makefiles"); // this->SupportedGlobalGenerators.push_back("MSYS Makefiles");
#endif #endif
#ifdef CMAKE_USE_NINJA
this->SupportedGlobalGenerators.push_back("Ninja"); this->SupportedGlobalGenerators.push_back("Ninja");
#endif
this->SupportedGlobalGenerators.push_back("Unix Makefiles"); this->SupportedGlobalGenerators.push_back("Unix Makefiles");
this->SupportsVirtualFolders = true; this->SupportsVirtualFolders = true;

View File

@ -84,10 +84,8 @@
#else #else
#endif #endif
#include "cmGlobalUnixMakefileGenerator3.h" #include "cmGlobalUnixMakefileGenerator3.h"
#include "cmGlobalNinjaGenerator.h"
#ifdef CMAKE_USE_NINJA
# include "cmGlobalNinjaGenerator.h"
#endif
#if defined(CMAKE_HAVE_VS_GENERATORS) #if defined(CMAKE_HAVE_VS_GENERATORS)
#include "cmCallVisualStudioMacro.h" #include "cmCallVisualStudioMacro.h"
@ -2600,10 +2598,8 @@ void cmake::AddDefaultGenerators()
#endif #endif
this->Generators[cmGlobalUnixMakefileGenerator3::GetActualName()] = this->Generators[cmGlobalUnixMakefileGenerator3::GetActualName()] =
&cmGlobalUnixMakefileGenerator3::New; &cmGlobalUnixMakefileGenerator3::New;
#ifdef CMAKE_USE_NINJA
this->Generators[cmGlobalNinjaGenerator::GetActualName()] = this->Generators[cmGlobalNinjaGenerator::GetActualName()] =
&cmGlobalNinjaGenerator::New; &cmGlobalNinjaGenerator::New;
#endif
#ifdef CMAKE_USE_XCODE #ifdef CMAKE_USE_XCODE
this->Generators[cmGlobalXCodeGenerator::GetActualName()] = this->Generators[cmGlobalXCodeGenerator::GetActualName()] =
&cmGlobalXCodeGenerator::New; &cmGlobalXCodeGenerator::New;