summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/CPack/cmCPackGenerator.cxx11
-rw-r--r--Source/cmCTest.cxx6
-rw-r--r--Source/cmDocumentVariables.cxx1
-rw-r--r--Source/cmExportCommand.cxx14
-rw-r--r--Source/cmFindPackageCommand.cxx18
-rw-r--r--Source/cmGlobalGenerator.cxx41
-rw-r--r--Source/cmGlobalGenerator.h2
-rw-r--r--Source/cmLocalGenerator.cxx12
-rw-r--r--Source/cmPolicies.cxx17
-rw-r--r--Source/cmPolicies.h1
-rw-r--r--Source/cmUnsetCommand.cxx8
-rw-r--r--Source/cmUnsetCommand.h5
-rw-r--r--Source/kwsys/CMakeLists.txt3
-rw-r--r--Source/kwsys/SystemInformation.cxx7
-rw-r--r--Source/kwsys/SystemTools.cxx5
-rw-r--r--Source/kwsys/testDynamicLoader.cxx6
17 files changed, 115 insertions, 44 deletions
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index e4efb51..6298218 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 12)
-set(CMake_VERSION_TWEAK 20131008)
+set(CMake_VERSION_TWEAK 20131009)
#set(CMake_VERSION_RC 1)
diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx
index 3c685bd..63a7596 100644
--- a/Source/CPack/cmCPackGenerator.cxx
+++ b/Source/CPack/cmCPackGenerator.cxx
@@ -26,7 +26,8 @@
#include <algorithm>
#if defined(__HAIKU__)
-#include <StorageKit.h>
+#include <FindDirectory.h>
+#include <StorageDefs.h>
#endif
//----------------------------------------------------------------------
@@ -1263,14 +1264,14 @@ const char* cmCPackGenerator::GetInstallPath()
this->InstallPath += "-";
this->InstallPath += this->GetOption("CPACK_PACKAGE_VERSION");
#elif defined(__HAIKU__)
- BPath dir;
- if (find_directory(B_COMMON_DIRECTORY, &dir) == B_OK)
+ char dir[B_PATH_NAME_LENGTH];
+ if (find_directory(B_SYSTEM_DIRECTORY, -1, false, dir, sizeof(dir)) == B_OK)
{
- this->InstallPath = dir.Path();
+ this->InstallPath = dir;
}
else
{
- this->InstallPath = "/boot/common";
+ this->InstallPath = "/boot/system";
}
#else
this->InstallPath = "/usr/local/";
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index feae61a..98f19cc 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -53,14 +53,10 @@
#include <cm_zlib.h>
#include <cmsys/Base64.h>
-#if defined(__BEOS__)
+#if defined(__BEOS__) || defined(__HAIKU__)
#include <be/kernel/OS.h> /* disable_debugger() API. */
#endif
-#if defined(__HAIKU__)
-#include <os/kernel/OS.h> /* disable_debugger() API. */
-#endif
-
#define DEBUGOUT std::cout << __LINE__ << " "; std::cout
#define DEBUGERR std::cerr << __LINE__ << " "; std::cerr
diff --git a/Source/cmDocumentVariables.cxx b/Source/cmDocumentVariables.cxx
index 8b5f851..58634ea 100644
--- a/Source/cmDocumentVariables.cxx
+++ b/Source/cmDocumentVariables.cxx
@@ -1622,6 +1622,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
"Possible values include:\n"
" Absoft = Absoft Fortran (absoft.com)\n"
" ADSP = Analog VisualDSP++ (analog.com)\n"
+ " AppleClang = Apple Clang (apple.com)\n"
" Clang = LLVM Clang (clang.llvm.org)\n"
" Cray = Cray Compiler (cray.com)\n"
" Embarcadero, Borland = Embarcadero (embarcadero.com)\n"
diff --git a/Source/cmExportCommand.cxx b/Source/cmExportCommand.cxx
index 837bb39..422b038 100644
--- a/Source/cmExportCommand.cxx
+++ b/Source/cmExportCommand.cxx
@@ -20,7 +20,8 @@
#include "cmExportBuildFileGenerator.h"
#if defined(__HAIKU__)
-#include <StorageKit.h>
+#include <FindDirectory.h>
+#include <StorageDefs.h>
#endif
cmExportCommand::cmExportCommand()
@@ -319,14 +320,15 @@ void cmExportCommand::StorePackageRegistryDir(std::string const& package,
const char* hash)
{
#if defined(__HAIKU__)
- BPath dir;
- if (find_directory(B_USER_SETTINGS_DIRECTORY, &dir) != B_OK)
+ char dir[B_PATH_NAME_LENGTH];
+ if (find_directory(B_USER_SETTINGS_DIRECTORY, -1, false, dir, sizeof(dir)) !=
+ B_OK)
{
return;
}
- dir.Append("cmake/packages");
- dir.Append(package.c_str());
- std::string fname = dir.Path();
+ std::string fname = dir;
+ fname += "/cmake/packages/";
+ fname += package;
#else
const char* home = cmSystemTools::GetEnv("HOME");
if(!home)
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx
index aa3a73d..1d6530f 100644
--- a/Source/cmFindPackageCommand.cxx
+++ b/Source/cmFindPackageCommand.cxx
@@ -19,7 +19,9 @@
#endif
#if defined(__HAIKU__)
-#include <StorageKit.h>
+#include <string.h>
+#include <FindDirectory.h>
+#include <StorageDefs.h>
#endif
void cmFindPackageNeedBackwardsCompatibility(const std::string& variable,
@@ -1584,12 +1586,14 @@ void cmFindPackageCommand::AddPrefixesUserRegistry()
#if defined(_WIN32) && !defined(__CYGWIN__)
this->LoadPackageRegistryWinUser();
#elif defined(__HAIKU__)
- BPath dir;
- if (find_directory(B_USER_SETTINGS_DIRECTORY, &dir) == B_OK)
- {
- dir.Append("cmake/packages");
- dir.Append(this->Name.c_str());
- this->LoadPackageRegistryDir(dir.Path());
+ char dir[B_PATH_NAME_LENGTH];
+ if (find_directory(B_USER_SETTINGS_DIRECTORY, -1, false, dir, sizeof(dir)) ==
+ B_OK)
+ {
+ std::string fname = dir;
+ fname += "/cmake/packages/";
+ fname += Name;
+ this->LoadPackageRegistryDir(fname);
}
#else
if(const char* home = cmSystemTools::GetEnv("HOME"))
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index dc4bf50..eacf85b 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -624,6 +624,9 @@ cmGlobalGenerator::EnableLanguage(std::vector<std::string>const& languages,
{
this->LanguageToOriginalSharedLibFlags[lang] = sharedLibFlags;
}
+
+ // Translate compiler ids for compatibility.
+ this->CheckCompilerIdCompatibility(mf, lang);
} // end for each language
// Now load files that can override any settings on the platform or for
@@ -640,6 +643,44 @@ cmGlobalGenerator::EnableLanguage(std::vector<std::string>const& languages,
}
//----------------------------------------------------------------------------
+void cmGlobalGenerator::CheckCompilerIdCompatibility(cmMakefile* mf,
+ std::string lang)
+{
+ std::string compilerIdVar = "CMAKE_" + lang + "_COMPILER_ID";
+ const char* compilerId = mf->GetDefinition(compilerIdVar.c_str());
+ if(compilerId && strcmp(compilerId, "AppleClang") == 0)
+ {
+ cmPolicies* policies = this->CMakeInstance->GetPolicies();
+ switch(mf->GetPolicyStatus(cmPolicies::CMP0025))
+ {
+ case cmPolicies::WARN:
+ if(!this->CMakeInstance->GetIsInTryCompile())
+ {
+ cmOStringStream w;
+ w << policies->GetPolicyWarning(cmPolicies::CMP0025) << "\n"
+ "Converting " << lang <<
+ " compiler id \"AppleClang\" to \"Clang\" for compatibility."
+ ;
+ mf->IssueMessage(cmake::AUTHOR_WARNING, w.str());
+ }
+ case cmPolicies::OLD:
+ // OLD behavior is to convert AppleClang to Clang.
+ mf->AddDefinition(compilerIdVar.c_str(), "Clang");
+ break;
+ case cmPolicies::REQUIRED_IF_USED:
+ case cmPolicies::REQUIRED_ALWAYS:
+ mf->IssueMessage(
+ cmake::FATAL_ERROR,
+ policies->GetRequiredPolicyError(cmPolicies::CMP0025)
+ );
+ case cmPolicies::NEW:
+ // NEW behavior is to keep AppleClang.
+ break;
+ }
+ }
+}
+
+//----------------------------------------------------------------------------
const char*
cmGlobalGenerator::GetLanguageOutputExtension(cmSourceFile const& source)
{
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index 18aba24..70f6e32 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -383,6 +383,8 @@ private:
void WriteSummary();
void WriteSummary(cmTarget* target);
+ void CheckCompilerIdCompatibility(cmMakefile* mf, std::string lang);
+
cmExternalMakefileProjectGenerator* ExtraGenerator;
// track files replaced during a Generate
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index b4cb5bd..9174e26 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -37,7 +37,8 @@
#include <assert.h>
#if defined(__HAIKU__)
-#include <StorageKit.h>
+#include <FindDirectory.h>
+#include <StorageDefs.h>
#endif
cmLocalGenerator::cmLocalGenerator()
@@ -349,16 +350,17 @@ void cmLocalGenerator::GenerateInstallRules()
prefix = prefix_win32.c_str();
}
#elif defined(__HAIKU__)
+ char dir[B_PATH_NAME_LENGTH];
if (!prefix)
{
- BPath dir;
- if (find_directory(B_COMMON_DIRECTORY, &dir) == B_OK)
+ if (find_directory(B_SYSTEM_DIRECTORY, -1, false, dir, sizeof(dir))
+ == B_OK)
{
- prefix = dir.Path();
+ prefix = dir;
}
else
{
- prefix = "/boot/common";
+ prefix = "/boot/system";
}
}
#else
diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx
index 9e5e6e0..1d3469f 100644
--- a/Source/cmPolicies.cxx
+++ b/Source/cmPolicies.cxx
@@ -620,6 +620,23 @@ cmPolicies::cmPolicies()
"The NEW behavior for this policy is to not to allow including the "
"result of an export() command.",
2,8,13,0, cmPolicies::WARN);
+
+ this->DefinePolicy(
+ CMP0025, "CMP0025",
+ "Compiler id for Apple Clang is now AppleClang.",
+ "CMake >= 2.8.13 recognize that Apple Clang is a different compiler "
+ "than upstream Clang and that they have different version numbers. "
+ "CMake now prefers to present this to projects by setting "
+ "CMAKE_<LANG>_COMPILER_ID to \"AppleClang\" instead of \"Clang\". "
+ "However, existing projects may assume the compiler id for Apple Clang "
+ "is just \"Clang\" as it was in CMake < 2.8.13. "
+ "Therefore this policy determines for Apple Clang which compiler id "
+ "to report in CMAKE_<LANG>_COMPILER_ID after <LANG> is enabled by "
+ "the project() or enable_language() command."
+ "\n"
+ "The OLD behavior for this policy is to use compiler id \"Clang\". "
+ "The NEW behavior for this policy is to use compiler id \"AppleClang\".",
+ 2,8,13,0, cmPolicies::WARN);
}
cmPolicies::~cmPolicies()
diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h
index bafe5b2..ec8959d 100644
--- a/Source/cmPolicies.h
+++ b/Source/cmPolicies.h
@@ -75,6 +75,7 @@ public:
CMP0022, ///< INTERFACE_LINK_LIBRARIES defines the link interface
CMP0023, ///< Disallow mixing keyword and plain tll signatures
CMP0024, ///< Disallow including export() result.
+ CMP0025, ///< Compiler id for Apple Clang is now AppleClang
/** \brief Always the last entry.
*
diff --git a/Source/cmUnsetCommand.cxx b/Source/cmUnsetCommand.cxx
index 5c0cfaa..84f3029 100644
--- a/Source/cmUnsetCommand.cxx
+++ b/Source/cmUnsetCommand.cxx
@@ -49,7 +49,13 @@ bool cmUnsetCommand::InitialPass(std::vector<std::string> const& args,
this->Makefile->RemoveCacheDefinition(variable);
return true;
}
- // ERROR: second argument isn't CACHE
+ // unset(VAR PARENT_SCOPE)
+ else if ((args.size() == 2) && (args[1] == "PARENT_SCOPE"))
+ {
+ this->Makefile->RaiseScope(variable, 0);
+ return true;
+ }
+ // ERROR: second argument isn't CACHE or PARENT_SCOPE
else
{
this->SetError("called with an invalid second argument");
diff --git a/Source/cmUnsetCommand.h b/Source/cmUnsetCommand.h
index 9cf95d9..a477f19 100644
--- a/Source/cmUnsetCommand.h
+++ b/Source/cmUnsetCommand.h
@@ -61,10 +61,13 @@ public:
virtual const char* GetFullDocumentation() const
{
return
- " unset(<variable> [CACHE])\n"
+ " unset(<variable> [CACHE | PARENT_SCOPE])\n"
"Removes the specified variable causing it to become undefined. "
"If CACHE is present then the variable is removed from the cache "
"instead of the current scope.\n"
+ "If PARENT_SCOPE is present then the variable is removed from the "
+ "scope above the current scope. See the same option in the set() "
+ "command for further details.\n"
"<variable> can be an environment variable such as:\n"
" unset(ENV{LD_LIBRARY_PATH})\n"
"in which case the variable will be removed from the current "
diff --git a/Source/kwsys/CMakeLists.txt b/Source/kwsys/CMakeLists.txt
index 0f27836..a9d89d4 100644
--- a/Source/kwsys/CMakeLists.txt
+++ b/Source/kwsys/CMakeLists.txt
@@ -85,6 +85,9 @@
# written.
CMAKE_MINIMUM_REQUIRED(VERSION 2.6.3 FATAL_ERROR)
+IF(POLICY CMP0025)
+ CMAKE_POLICY(SET CMP0025 NEW)
+ENDIF()
#-----------------------------------------------------------------------------
# If a namespace is not specified, use "kwsys" and enable testing.
diff --git a/Source/kwsys/SystemInformation.cxx b/Source/kwsys/SystemInformation.cxx
index beefd7d..7c31f3a 100644
--- a/Source/kwsys/SystemInformation.cxx
+++ b/Source/kwsys/SystemInformation.cxx
@@ -1734,12 +1734,12 @@ int SystemInformationImplementation::GetFullyQualifiedDomainName(
{
char host[NI_MAXHOST]={'\0'};
- socklen_t addrlen
+ const size_t addrlen
= (fam==AF_INET?sizeof(struct sockaddr_in):sizeof(struct sockaddr_in6));
ierr=getnameinfo(
ifa->ifa_addr,
- addrlen,
+ static_cast<socklen_t>(addrlen),
host,
NI_MAXHOST,
NULL,
@@ -3836,7 +3836,8 @@ bool SystemInformationImplementation::QueryLinuxMemory()
unsigned long temp;
unsigned long cachedMem;
unsigned long buffersMem;
- char *r=fgets(buffer, sizeof(buffer), fd); // Skip "total: used:..."
+ // Skip "total: used:..."
+ char *r=fgets(buffer, static_cast<int>(sizeof(buffer)), fd);
int status=0;
if(r==buffer)
{
diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx
index e9a1fd3..749002d 100644
--- a/Source/kwsys/SystemTools.cxx
+++ b/Source/kwsys/SystemTools.cxx
@@ -152,11 +152,6 @@ public:
#define _chdir chdir
#endif
-#if defined(__HAIKU__)
-#include <os/kernel/OS.h>
-#include <os/storage/Path.h>
-#endif
-
#if defined(__BEOS__) && !defined(__ZETA__)
#include <be/kernel/OS.h>
#include <be/storage/Path.h>
diff --git a/Source/kwsys/testDynamicLoader.cxx b/Source/kwsys/testDynamicLoader.cxx
index dd6d603..1bff707 100644
--- a/Source/kwsys/testDynamicLoader.cxx
+++ b/Source/kwsys/testDynamicLoader.cxx
@@ -15,14 +15,10 @@
#include KWSYS_HEADER(ios/iostream)
#include KWSYS_HEADER(stl/string)
-#if defined(__BEOS__)
+#if defined(__BEOS__) || defined(__HAIKU__)
#include <be/kernel/OS.h> /* disable_debugger() API. */
#endif
-#if defined(__HAIKU__)
-#include <os/kernel/OS.h> /* disable_debugger() API. */
-#endif
-
// Work-around CMake dependency scanning limitation. This must
// duplicate the above list of headers.
#if 0