Skip to content

Commit d9cb2a9

Browse files
committed
Bug#18675099: WINDOWSCACHE.CMAKE MUST BE UPDATED FOR VS2013
WindowsCache.cmake hardcodes results for CMake configure checks so they don't have to be performed on Windows (as this is very slow). The problem was that the cache file had several values which were no longer correct. The consequence that we were using Windows specific workarounds in cases where it was no longer needed. This patch removes the outdated values from the cache file so that the checks are actually made. It also reorganizes the cache file so that it matches config.h.cmake, removes duplicate entries, removes dead entries and adds missing entries. The patch also removes some unneeded Visual Studio version checks.
1 parent f3824c7 commit d9cb2a9

File tree

2 files changed

+240
-182
lines changed

2 files changed

+240
-182
lines changed

cmake/os/Windows.cmake

+3-13
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,7 @@ ADD_DEFINITIONS("-DWIN32_LEAN_AND_MEAN")
6060
ADD_DEFINITIONS("-DNOMINMAX")
6161

6262
# Should be available on Windows Server 2003 and above.
63-
CHECK_CXX_SOURCE_COMPILES(
64-
"#include <Windows.h>
65-
int main() {
66-
GetCurrentProcessorNumber();
67-
return 0;
68-
} " HAVE_GETCURRENTPROCESSORNUMBER)
69-
IF(HAVE_GETCURRENTPROCESSORNUMBER)
70-
ADD_DEFINITIONS(-DHAVE_GETCURRENTPROCESSORNUMBER=1)
71-
ENDIF()
63+
ADD_DEFINITIONS(-DHAVE_GETCURRENTPROCESSORNUMBER=1)
7264

7365
IF(MSVC)
7466
# Enable debug info also in Release build,
@@ -118,10 +110,8 @@ IF(MSVC)
118110
ENDIF()
119111

120112
# Speed up multiprocessor build
121-
IF (MSVC_VERSION GREATER 1400)
122-
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MP")
123-
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
124-
ENDIF()
113+
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MP")
114+
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
125115

126116
#TODO: update the code and remove the disabled warnings
127117
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4800 /wd4805 /wd4996")

0 commit comments

Comments
 (0)