aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/cmake
diff options
context:
space:
mode:
authorBilly O'Neal <bion@microsoft.com>2021-02-03 11:11:27 -0800
committerGitHub <noreply@github.com>2021-02-03 11:11:27 -0800
commitba03ad7c9d2f3b0467229055bebf5b7251f15045 (patch)
tree2296cc734c7f2667910d81455dce5fe4780a2778 /toolsrc/cmake
parentdc4d1b735aca2aa3ef0582ab2e420031fd24a402 (diff)
downloadvcpkg-ba03ad7c9d2f3b0467229055bebf5b7251f15045.tar.gz
vcpkg-ba03ad7c9d2f3b0467229055bebf5b7251f15045.zip
[vcpkg] Apply fixes needed to extract vcpkg-tool (#16012)
utilities.cmake: Disable warnings that are firing on Azure Pipelines CI machines due to different Clang version. expected.h: Fix a bug I introduced in https://github.com/microsoft/vcpkg/pull/15638/ because I was under the impression expected worked like optional (in that value_or_exit for it should be treated as a program bug) build.cpp: Add (void)s to silence warnings. binarycaching.cpp: Repair assumption that the current directory is C: which isn't true on the Hosted Azure Pipelines agents. others: Make unit tests respect %VCPKG_ROOT%, as necessary in the vcpkg_tool repo. Note that this required splitting vcpkgcmdarguments::ImbueFromEnvironment into the once-only process modifying part and the just imbue from environment part.
Diffstat (limited to 'toolsrc/cmake')
-rw-r--r--toolsrc/cmake/utilities.cmake22
1 files changed, 18 insertions, 4 deletions
diff --git a/toolsrc/cmake/utilities.cmake b/toolsrc/cmake/utilities.cmake
index 9523b9d97..4b434a9c7 100644
--- a/toolsrc/cmake/utilities.cmake
+++ b/toolsrc/cmake/utilities.cmake
@@ -204,7 +204,13 @@ function(vcpkg_target_add_warning_options TARGET)
if(VCPKG_DEVELOPMENT_WARNINGS)
target_compile_options(${TARGET} PRIVATE -W4)
if(VCPKG_COMPILER STREQUAL "clang")
- target_compile_options(${TARGET} PRIVATE -Wmissing-prototypes -Wno-missing-field-initializers)
+ # -Wno-range-loop-analysis is due to an LLVM bug which will be fixed in a
+ # future version of clang https://reviews.llvm.org/D73007
+ target_compile_options(${TARGET} PRIVATE
+ -Wmissing-prototypes
+ -Wno-missing-field-initializers
+ -Wno-range-loop-analysis
+ )
else()
target_compile_options(${TARGET} PRIVATE -analyze)
endif()
@@ -219,13 +225,21 @@ function(vcpkg_target_add_warning_options TARGET)
if(VCPKG_DEVELOPMENT_WARNINGS)
target_compile_options(${TARGET} PRIVATE
-Wall -Wextra -Wpedantic
- -Wno-unknown-pragmas -Wno-missing-field-initializers -Wno-redundant-move)
+ -Wno-unknown-pragmas
+ -Wno-missing-field-initializers
+ -Wno-redundant-move
+ )
# GCC and clang have different names for the same warning
if(VCPKG_COMPILER STREQUAL "gcc")
- target_compile_options(${TARGET} PRIVATE -Wmissing-declarations)
+ target_compile_options(${TARGET} PRIVATE
+ -Wmissing-declarations
+ )
elseif(VCPKG_COMPILER STREQUAL "clang")
- target_compile_options(${TARGET} PRIVATE -Wmissing-prototypes)
+ target_compile_options(${TARGET} PRIVATE
+ -Wmissing-prototypes
+ -Wno-range-loop-analysis
+ )
endif()
endif()