From 6b7c0616b22ea4f40047addd32d396eba97f07ba Mon Sep 17 00:00:00 2001 From: Sing_chan <51314274+betterpig@users.noreply.github.com> Date: Fri, 26 Nov 2021 10:54:31 +0800 Subject: [PATCH] block xxhash warning of c4711 (#37442) * block xxhash warning of c4711 * modify according to zhouwei's comment * fix syntax error --- cmake/external/xxhash.cmake | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cmake/external/xxhash.cmake b/cmake/external/xxhash.cmake index d0af472c3e1..fe17806e362 100644 --- a/cmake/external/xxhash.cmake +++ b/cmake/external/xxhash.cmake @@ -31,8 +31,12 @@ ENDIF() if (WIN32) set(XXHASH_LIBRARIES "${XXHASH_INSTALL_DIR}/lib/xxhash.lib") + set(XXHASH_CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4710 /wd4711") + set(XXHASH_CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4710 /wd4711") else() set(XXHASH_LIBRARIES "${XXHASH_INSTALL_DIR}/lib/libxxhash.a") + set(XXHASH_CMAKE_C_FLAGS ${CMAKE_C_FLAGS}) + set(XXHASH_CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) endif () if(WIN32) @@ -55,6 +59,12 @@ if(WIN32) -DCMAKE_GENERATOR=${CMAKE_GENERATOR} -DCMAKE_GENERATOR_PLATFORM=${CMAKE_GENERATOR_PLATFORM} -DBUILD_SHARED_LIBS=OFF + -DCMAKE_CXX_FLAGS=${XXHASH_CMAKE_CXX_FLAGS} + -DCMAKE_CXX_FLAGS_RELEASE=${CMAKE_CXX_FLAGS_RELEASE} + -DCMAKE_CXX_FLAGS_DEBUG=${CMAKE_CXX_FLAGS_DEBUG} + -DCMAKE_C_FLAGS=${XXHASH_CMAKE_C_FLAGS} + -DCMAKE_C_FLAGS_DEBUG=${CMAKE_C_FLAGS_DEBUG} + -DCMAKE_C_FLAGS_RELEASE=${CMAKE_C_FLAGS_RELEASE} ${OPTIONAL_CACHE_ARGS} TEST_COMMAND "" BUILD_BYPRODUCTS ${XXHASH_LIBRARIES} -- GitLab