diff options
author | Brad King <brad.king@kitware.com> | 2019-05-30 13:31:35 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-05-30 13:31:35 (GMT) |
commit | 3a7f493b7b92eeead6841c393d7bbed62b52cbc9 (patch) | |
tree | 2933710b08894d7edbca39cf7d66c72689fe4af5 | |
parent | c68efd196eace176bed5216573d99fabba66df84 (diff) | |
parent | 9ef1e13bcccd46c822ee813017601781bbe9a43d (diff) | |
download | CMake-3a7f493b7b92eeead6841c393d7bbed62b52cbc9.zip CMake-3a7f493b7b92eeead6841c393d7bbed62b52cbc9.tar.gz CMake-3a7f493b7b92eeead6841c393d7bbed62b52cbc9.tar.bz2 |
Merge branch 'upstream-KWSys' into update-kwsys
* upstream-KWSys:
KWSys 2019-05-30 (f892bacf)
-rw-r--r-- | Source/kwsys/CMakeLists.txt | 12 | ||||
-rw-r--r-- | Source/kwsys/ProcessWin32.c | 23 | ||||
-rw-r--r-- | Source/kwsys/SystemInformation.cxx | 9 | ||||
-rw-r--r-- | Source/kwsys/SystemTools.cxx | 9 | ||||
-rw-r--r-- | Source/kwsys/testConsoleBuf.cxx | 9 |
5 files changed, 52 insertions, 10 deletions
diff --git a/Source/kwsys/CMakeLists.txt b/Source/kwsys/CMakeLists.txt index 120b5de..79e813e 100644 --- a/Source/kwsys/CMakeLists.txt +++ b/Source/kwsys/CMakeLists.txt @@ -120,7 +120,14 @@ SET_PROPERTY(DIRECTORY if(KWSYS_CXX_STANDARD) set(CMAKE_CXX_STANDARD "${KWSYS_CXX_STANDARD}") elseif(NOT DEFINED CMAKE_CXX_STANDARD AND NOT DEFINED KWSYS_CXX_STANDARD) - set(CMAKE_CXX_STANDARD 11) + if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" + AND "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC" + AND "x${CMAKE_CXX_COMPILER_FRONTEND_VARIANT}" STREQUAL "xGNU" + ) + set(CMAKE_CXX_STANDARD 14) + else() + set(CMAKE_CXX_STANDARD 11) + endif() endif() # Select library components. @@ -1005,7 +1012,8 @@ ENDIF() ADD_DEFINITIONS("-DKWSYS_NAMESPACE=${KWSYS_NAMESPACE}") # Disable deprecation warnings for standard C functions. -IF(MSVC OR (WIN32 AND CMAKE_C_COMPILER_ID STREQUAL "Intel")) +IF(MSVC OR (WIN32 AND (CMAKE_C_COMPILER_ID STREQUAL "Intel" OR + (CMAKE_C_COMPILER_ID STREQUAL "Clang" AND "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC")))) ADD_DEFINITIONS( -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_SECURE_NO_DEPRECATE diff --git a/Source/kwsys/ProcessWin32.c b/Source/kwsys/ProcessWin32.c index 2a2e737..68c5218 100644 --- a/Source/kwsys/ProcessWin32.c +++ b/Source/kwsys/ProcessWin32.c @@ -117,7 +117,6 @@ static kwsysProcessTime kwsysProcessTimeAdd(kwsysProcessTime in1, kwsysProcessTime in2); static kwsysProcessTime kwsysProcessTimeSubtract(kwsysProcessTime in1, kwsysProcessTime in2); -static void kwsysProcessSetExitException(kwsysProcess* cp, int code); static void kwsysProcessSetExitExceptionByIndex(kwsysProcess* cp, int code, int idx); static void kwsysProcessKillTree(int pid); @@ -358,13 +357,20 @@ kwsysProcess* kwsysProcess_New(void) # pragma warning(push) # ifdef __INTEL_COMPILER # pragma warning(disable : 1478) +# elif defined __clang__ +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wdeprecated-declarations" # else # pragma warning(disable : 4996) # endif #endif GetVersionEx(&osv); #ifdef KWSYS_WINDOWS_DEPRECATED_GetVersionEx -# pragma warning(pop) +# ifdef __clang__ +# pragma clang diagnostic pop +# else +# pragma warning(pop) +# endif #endif if (osv.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) { /* Win9x no longer supported. */ @@ -2269,13 +2275,20 @@ static kwsysProcess_List* kwsysProcess_List_New(void) # pragma warning(push) # ifdef __INTEL_COMPILER # pragma warning(disable : 1478) +# elif defined __clang__ +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wdeprecated-declarations" # else # pragma warning(disable : 4996) # endif #endif GetVersionEx(&osv); #ifdef KWSYS_WINDOWS_DEPRECATED_GetVersionEx -# pragma warning(pop) +# ifdef __clang__ +# pragma clang diagnostic pop +# else +# pragma warning(pop) +# endif #endif self->NT4 = (osv.dwPlatformId == VER_PLATFORM_WIN32_NT && osv.dwMajorVersion < 5) ? 1 @@ -2659,8 +2672,8 @@ static int kwsysProcessesAdd(HANDLE hProcess, DWORD dwProcessid, newSize = kwsysProcesses.Size ? kwsysProcesses.Size * 2 : 4; /* Try allocating the new block of memory. */ - if (newArray = (kwsysProcessInstance*)malloc( - newSize * sizeof(kwsysProcessInstance))) { + if ((newArray = (kwsysProcessInstance*)malloc( + newSize * sizeof(kwsysProcessInstance)))) { /* Copy the old process handles to the new memory. */ if (kwsysProcesses.Count > 0) { memcpy(newArray, kwsysProcesses.Processes, diff --git a/Source/kwsys/SystemInformation.cxx b/Source/kwsys/SystemInformation.cxx index 7b697c4..7dc6cf4 100644 --- a/Source/kwsys/SystemInformation.cxx +++ b/Source/kwsys/SystemInformation.cxx @@ -5205,6 +5205,9 @@ bool SystemInformationImplementation::QueryOSInformation() # pragma warning(push) # ifdef __INTEL_COMPILER # pragma warning(disable : 1478) +# elif defined __clang__ +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wdeprecated-declarations" # else # pragma warning(disable : 4996) # endif @@ -5217,7 +5220,11 @@ bool SystemInformationImplementation::QueryOSInformation() } } # ifdef KWSYS_WINDOWS_DEPRECATED_GetVersionEx -# pragma warning(pop) +# ifdef __clang__ +# pragma clang diagnostic pop +# else +# pragma warning(pop) +# endif # endif switch (osvi.dwPlatformId) { diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx index e756cdc..2135913 100644 --- a/Source/kwsys/SystemTools.cxx +++ b/Source/kwsys/SystemTools.cxx @@ -4366,6 +4366,9 @@ std::string SystemTools::GetOperatingSystemNameAndVersion() # pragma warning(push) # ifdef __INTEL_COMPILER # pragma warning(disable : 1478) +# elif defined __clang__ +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wdeprecated-declarations" # else # pragma warning(disable : 4996) # endif @@ -4375,7 +4378,11 @@ std::string SystemTools::GetOperatingSystemNameAndVersion() return 0; } # ifdef KWSYS_WINDOWS_DEPRECATED_GetVersionEx -# pragma warning(pop) +# ifdef __clang__ +# pragma clang diagnostic pop +# else +# pragma warning(pop) +# endif # endif switch (osvi.dwPlatformId) { diff --git a/Source/kwsys/testConsoleBuf.cxx b/Source/kwsys/testConsoleBuf.cxx index 1549440..b6ad118 100644 --- a/Source/kwsys/testConsoleBuf.cxx +++ b/Source/kwsys/testConsoleBuf.cxx @@ -499,6 +499,9 @@ static int testConsole() # pragma warning(push) # ifdef __INTEL_COMPILER # pragma warning(disable : 1478) +# elif defined __clang__ +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wdeprecated-declarations" # else # pragma warning(disable : 4996) # endif @@ -506,7 +509,11 @@ static int testConsole() const bool isVistaOrGreater = LOBYTE(LOWORD(GetVersion())) >= HIBYTE(_WIN32_WINNT_VISTA); # ifdef KWSYS_WINDOWS_DEPRECATED_GetVersion -# pragma warning(pop) +# ifdef __clang__ +# pragma clang diagnostic pop +# else +# pragma warning(pop) +# endif # endif if (!isVistaOrGreater) { if (RegOpenKeyExW(HKEY_CURRENT_USER, L"Console", 0, KEY_READ | KEY_WRITE, |