Commit 98a91856 authored by Orvid King's avatar Orvid King Committed by Facebook Github Bot

Fix build with vcpkg

Summary:
When building with MSVC and vcpkg, dependencies come in both debug and release versions. Fix the searching logic to search for both names and handle them appropriately.

Also silence a few warnings under MSVC 2015 Update 3.

Reviewed By: yfeldblum

Differential Revision: D7683367

fbshipit-source-id: 662fcc7170b260f129610ed47b6afedbe20933b7
parent 8202eccd
......@@ -13,7 +13,11 @@ ENDIF ()
FIND_PATH(LIBGFLAGS_INCLUDE_DIR gflags/gflags.h)
FIND_LIBRARY(LIBGFLAGS_LIBRARY NAMES gflags gflags_static)
FIND_LIBRARY(LIBGFLAGS_LIBRARY_DEBUG NAMES gflagsd gflags_staticd)
FIND_LIBRARY(LIBGFLAGS_LIBRARY_RELEASE NAMES gflags gflags_static)
INCLUDE(SelectLibraryConfigurations)
SELECT_LIBRARY_CONFIGURATIONS(LIBGFLAGS)
# handle the QUIETLY and REQUIRED arguments and set LIBGFLAGS_FOUND to TRUE if
# all listed variables are TRUE
......
......@@ -7,7 +7,12 @@
#
find_path(LZ4_INCLUDE_DIR NAMES lz4.h)
find_library(LZ4_LIBRARY NAMES lz4)
find_library(LZ4_LIBRARY_DEBUG NAMES lz4d)
find_library(LZ4_LIBRARY_RELEASE NAMES lz4)
include(SelectLibraryConfigurations)
SELECT_LIBRARY_CONFIGURATIONS(LZ4)
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(
......
......@@ -6,7 +6,12 @@
# SNAPPY_LIBRARY
find_path(SNAPPY_INCLUDE_DIR NAMES snappy.h)
find_library(SNAPPY_LIBRARY NAMES snappy)
find_library(SNAPPY_LIBRARY_DEBUG NAMES snappyd)
find_library(SNAPPY_LIBRARY_RELEASE NAMES snappy)
include(SelectLibraryConfigurations)
SELECT_LIBRARY_CONFIGURATIONS(SNAPPY)
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(
......
......@@ -180,6 +180,13 @@ function(apply_folly_compile_options_to_target THETARGET)
/wd4701 # Potentially uninitialized local variable used.
/wd4702 # Unreachable code.
# MSVC 2015 only:
$<$<BOOL:${MSVC_IS_2015}>:
/wd4268 # Static/global data initialized with compiler generated default constructor fills the object with zeros.
/wd4510 # Default constructor was implicitly defined as deleted.
/wd4814 # In C++14 'constexpr' will not imply 'const'.
>
# These warnings are disabled because we've
# enabled all warnings. If all warnings are
# not enabled, we still need to disable them
......
......@@ -50,8 +50,10 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
endif()
if (MSVC_VERSION GREATER_EQUAL 1910 AND MSVC_VERSION LESS 1920)
set(MSVC_IS_2015 OFF)
set(MSVC_IS_2017 ON)
elseif (MSVC_VERSION EQUAL 1900)
set(MSVC_IS_2015 ON)
set(MSVC_IS_2017 OFF)
else()
message(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment