mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-02 04:39:08 +08:00
37 lines
1.3 KiB
Diff
37 lines
1.3 KiB
Diff
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||
|
index 4c796ea..684f48f 100644
|
||
|
--- a/CMakeLists.txt
|
||
|
+++ b/CMakeLists.txt
|
||
|
@@ -1,13 +1,5 @@
|
||
|
cmake_minimum_required(VERSION 3.4.0 FATAL_ERROR)
|
||
|
|
||
|
-if ("${CMAKE_GENERATOR}" MATCHES "Visual Studio 15( 2017)? Win64")
|
||
|
- set(MSVC_IS_2017 ON)
|
||
|
-elseif ("${CMAKE_GENERATOR}" STREQUAL "Visual Studio 14 2015 Win64")
|
||
|
- set(MSVC_IS_2017 OFF)
|
||
|
-else()
|
||
|
- message(FATAL_ERROR "This build script only supports building Folly on 64-bit Windows with Visual Studio 2015 or Visual Studio 2017.")
|
||
|
-endif()
|
||
|
-
|
||
|
# includes
|
||
|
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake" ${CMAKE_MODULE_PATH})
|
||
|
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
|
||
|
@@ -24,10 +16,14 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
||
|
|
||
|
project(${PACKAGE_NAME} CXX)
|
||
|
|
||
|
-# Check architecture OS
|
||
|
-if (NOT CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||
|
- message(FATAL_ERROR "Folly requires a 64bit OS")
|
||
|
+if (NOT MSVC_VERSION LESS 1910)
|
||
|
+ set(MSVC_IS_2017 ON)
|
||
|
+elseif (NOT MSVC_VERSION LESS 1900)
|
||
|
+ set(MSVC_IS_2017 OFF)
|
||
|
+else()
|
||
|
+ message(FATAL_ERROR "This build script only supports building Folly on 64-bit Windows with Visual Studio 2015 or Visual Studio 2017.")
|
||
|
endif()
|
||
|
+
|
||
|
if(NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
|
||
|
message(FATAL_ERROR "You should only be using CMake to build Folly if you are on Windows!")
|
||
|
endif()
|