summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Modules/FindBLAS.cmake6
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/cmGlobalNinjaGenerator.cxx12
-rw-r--r--Source/cmNinjaNormalTargetGenerator.cxx3
-rw-r--r--Source/cmNinjaTargetGenerator.cxx14
-rw-r--r--Source/cmcldeps.cxx12
-rw-r--r--Tests/BuildDepends/Project/CMakeLists.txt5
-rwxr-xr-xUtilities/Git/pre-commit20
8 files changed, 53 insertions, 21 deletions
diff --git a/Modules/FindBLAS.cmake b/Modules/FindBLAS.cmake
index 9eadfd1..1cf31c4 100644
--- a/Modules/FindBLAS.cmake
+++ b/Modules/FindBLAS.cmake
@@ -484,8 +484,7 @@ if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
# mkl >= 10.3
if (CMAKE_C_COMPILER MATCHES ".+gcc.*")
list(APPEND BLAS_SEARCH_LIBS
- "mkl_blas95_lp64 mkl_intel_lp64 mkl_gnu_thread mkl_core")
- set(LM "${LM};-lgomp")
+ "mkl_blas95_lp64 mkl_intel_lp64 mkl_gnu_thread mkl_core gomp")
else ()
list(APPEND BLAS_SEARCH_LIBS
"mkl_blas95_lp64 mkl_intel_lp64 mkl_intel_thread mkl_core iomp5")
@@ -516,8 +515,7 @@ if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
# mkl >= 10.3
if (CMAKE_C_COMPILER MATCHES ".+gcc.*")
list(APPEND BLAS_SEARCH_LIBS
- "mkl_intel_lp64 mkl_gnu_thread mkl_core")
- set(LM "${LM};-lgomp")
+ "mkl_intel_lp64 mkl_gnu_thread mkl_core gomp")
else ()
list(APPEND BLAS_SEARCH_LIBS
"mkl_intel_lp64 mkl_intel_thread mkl_core iomp5")
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index b5f60be..73f86b8 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -2,5 +2,5 @@
SET(CMake_VERSION_MAJOR 2)
SET(CMake_VERSION_MINOR 8)
SET(CMake_VERSION_PATCH 8)
-SET(CMake_VERSION_TWEAK 20120715)
+SET(CMake_VERSION_TWEAK 20120724)
#SET(CMake_VERSION_RC 1)
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index abf5c82..912e53e 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -479,22 +479,22 @@ void cmGlobalNinjaGenerator
std::string windres = cmSystemTools::FindProgram("windres");
if(windres.empty())
{
- std::string path;
+ std::string compiler_path;
std::string::size_type prefix = std::string::npos;
if (mf->GetDefinition("CMAKE_C_COMPILER"))
{
- path = mf->GetDefinition("CMAKE_C_COMPILER");
- prefix = path.rfind("gcc");
+ compiler_path = mf->GetDefinition("CMAKE_C_COMPILER");
+ prefix = compiler_path.rfind("gcc");
}
else if (mf->GetDefinition("CMAKE_CXX_COMPILER"))
{
- path = mf->GetDefinition("CMAKE_CXX_COMPILER");
- prefix = path.rfind("++");
+ compiler_path = mf->GetDefinition("CMAKE_CXX_COMPILER");
+ prefix = compiler_path.rfind("++");
prefix--;
}
if (prefix != std::string::npos)
{
- windres = path.substr(0, prefix) + "windres";
+ windres = compiler_path.substr(0, prefix) + "windres";
windres = cmSystemTools::FindProgram(windres.c_str());
}
}
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index 4c35d25..7805fe8 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -515,7 +515,8 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
int commandLineLengthLimit = 8000 - linkRuleLength;
#elif defined(__linux) || defined(__APPLE__)
// for instance ARG_MAX is 2096152 on Ubuntu or 262144 on Mac
- int commandLineLengthLimit = sysconf(_SC_ARG_MAX) - linkRuleLength - 1000;
+ int commandLineLengthLimit = ((int)sysconf(_SC_ARG_MAX))
+ - linkRuleLength - 1000;
#else
int commandLineLengthLimit = -1;
#endif
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index 4758989..0d02039 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -143,16 +143,18 @@ cmNinjaTargetGenerator::ComputeFlagsForObject(cmSourceFile *source,
this->LocalGenerator->AddCMP0018Flags(flags, this->Target,
language.c_str());
- // TODO: Handle response file.
// Add include directory flags.
{
std::vector<std::string> includes;
this->LocalGenerator->GetIncludeDirectories(includes, this->Target,
language.c_str());
std::string includeFlags =
- this->LocalGenerator->GetIncludeFlags(includes, language.c_str(), false);
+ this->LocalGenerator->GetIncludeFlags(includes, language.c_str(),
+ language == "RC" ? true : false); // full include paths for RC
+ // needed by cmcldeps
if(cmGlobalNinjaGenerator::IsMinGW())
cmSystemTools::ReplaceString(includeFlags, "\\", "/");
+
this->LocalGenerator->AppendFlags(flags, includeFlags.c_str());
}
@@ -467,7 +469,7 @@ cmNinjaTargetGenerator
cmNinjaDeps emptyDeps;
std::string comment;
- const char* language = source->GetLanguage();
+ const std::string language = source->GetLanguage();
std::string rule = this->LanguageCompilerRule(language);
cmNinjaDeps outputs;
@@ -477,7 +479,11 @@ cmNinjaTargetGenerator
this->Objects.push_back(objectFileName);
cmNinjaDeps explicitDeps;
- std::string sourceFileName = this->GetSourceFilePath(source);
+ std::string sourceFileName;
+ if (language == "RC")
+ sourceFileName = source->GetFullPath();
+ else
+ sourceFileName = this->GetSourceFilePath(source);
explicitDeps.push_back(sourceFileName);
// Ensure that the target dependencies are built before any source file in
diff --git a/Source/cmcldeps.cxx b/Source/cmcldeps.cxx
index ce64132..69df88d 100644
--- a/Source/cmcldeps.cxx
+++ b/Source/cmcldeps.cxx
@@ -206,7 +206,7 @@ static int process( const std::string& srcfilename,
includes.push_back(inc);
} else {
if (!isFirstLine || !startsWith(line, srcfilename)) {
- if (!quiet) {
+ if (!quiet || exit_code != 0) {
fprintf(stdout, "%s\n", line.c_str());
}
} else {
@@ -254,7 +254,10 @@ int main() {
// rc: /fo x.dir\x.rc.res -> cl: /out:x.dir\x.rc.res.dep.obj
clrest = replace(clrest, "/fo", "/out:");
clrest = replace(clrest, objfile, objfile + ".dep.obj ");
+
// rc: src\x\x.rc -> cl: /Tc src\x\x.rc
+ if (srcfile.find(" ") != std::string::npos)
+ srcfile = "\"" + srcfile + "\"";
clrest = replace(clrest, srcfile, "/Tc " + srcfile);
cl = "\"" + cl + "\" /P /DRC_INVOKED ";
@@ -267,8 +270,11 @@ int main() {
}
// extract dependencies with cl.exe
- process(srcfilename, dfile, objfile,
- prefix, cl + nol + show + clrest, objdir, true);
+ int exit_code = process(srcfilename, dfile, objfile,
+ prefix, cl + nol + show + clrest, objdir, true);
+
+ if (exit_code != 0)
+ return exit_code;
// compile rc file with rc.exe
return process(srcfilename, "" , objfile, prefix, binpath + " " + rest);
diff --git a/Tests/BuildDepends/Project/CMakeLists.txt b/Tests/BuildDepends/Project/CMakeLists.txt
index a977884..ed8b8bf 100644
--- a/Tests/BuildDepends/Project/CMakeLists.txt
+++ b/Tests/BuildDepends/Project/CMakeLists.txt
@@ -17,7 +17,8 @@ endfunction()
if(APPLE)
# only use multi-arch if the sysroot exists on this machine
- if(EXISTS "${CMAKE_OSX_SYSROOT}")
+ # Ninja needs -M which could not be used with multiple -arch flags
+ if(EXISTS "${CMAKE_OSX_SYSROOT}" AND NOT "${CMAKE_GENERATOR}" MATCHES "Ninja")
set(CMAKE_OSX_ARCHITECTURES "ppc;i386")
test_for_xcode4(is_xcode4)
if(is_xcode4)
@@ -25,7 +26,7 @@ if(APPLE)
# Arch 'ppc' no longer works: tools no longer available starting with Xcode 4
set(CMAKE_OSX_ARCHITECTURES i386 x86_64)
endif()
- endif(EXISTS "${CMAKE_OSX_SYSROOT}")
+ endif()
endif(APPLE)
add_library(foo STATIC ${testRebuild_BINARY_DIR}/foo.cxx)
diff --git a/Utilities/Git/pre-commit b/Utilities/Git/pre-commit
index 110e9ee..d308a81 100755
--- a/Utilities/Git/pre-commit
+++ b/Utilities/Git/pre-commit
@@ -19,6 +19,26 @@ die() {
exit 1
}
+#-------------------------------------------------------------------------------
+line_too_long=80
+bad=$(regex=".{$line_too_long}" &&
+git diff-index --cached HEAD --name-only --diff-filter=AM \
+ --pickaxe-regex -S"$regex" -- 'Source/*.h' 'Source/*.cxx' |
+while read file; do
+ lines_too_long=$(git diff-index -p --cached HEAD \
+ --pickaxe-regex -S"$regex" -- "$file")
+ if echo "$lines_too_long" | egrep -q '^\+'"$regex"; then
+ echo "$lines_too_long"
+ fi
+done)
+test -z "$bad" ||
+die 'The following changes add lines too long for our C++ style:
+
+'"$bad"'
+
+Use lines strictly less than '"$line_too_long"' characters in C++ code.'
+
+#-------------------------------------------------------------------------------
if test -z "$HOOKS_ALLOW_KWSYS"; then
# Disallow changes to KWSys
files=$(git diff-index --name-only --cached HEAD -- Source/kwsys) &&