From 31a132a9c58facbfde91de6119df8c4fbfa52d48 Mon Sep 17 00:00:00 2001 From: Swaroop Sridhar Date: Wed, 5 Dec 2018 12:55:39 -0800 Subject: [PATCH] Suppress a CMake Warning (#21147) MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit * Suppress a CMake Warning This change adds a local cmake_policy rule to suppress warnings about libraries with unicode names. ``` CMake Warning (dev) at tests/src/Interop/PInvoke/DllImportPath/CMakeLists.txt:14 (add_library): Policy CMP0037 is not set: Target names should not be reserved and should match a validity pattern. Run "cmake --help-policy CMP0037" for policy details. Use the cmake_policy command to set the policy and suppress this warning. The target name "DllImportPath_U�n�i�c�o�d�e" is reserved or not valid for certain CMake features, such as generator expressions, and may result in undefined behavior. This warning is for project developers. Use -Wno-dev to suppress it. ``` * Update tests/src/Interop/PInvoke/DllImportPath/CMakeLists.txt Co-Authored-By: swaroop-sridhar --- tests/src/Interop/PInvoke/DllImportPath/CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/src/Interop/PInvoke/DllImportPath/CMakeLists.txt b/tests/src/Interop/PInvoke/DllImportPath/CMakeLists.txt index a0d2992..34634b5 100644 --- a/tests/src/Interop/PInvoke/DllImportPath/CMakeLists.txt +++ b/tests/src/Interop/PInvoke/DllImportPath/CMakeLists.txt @@ -5,6 +5,13 @@ include_directories(${INC_PLATFORM_DIR}) set(SOURCES DllImportPathNative.cpp ) + +# Set CMP0037 to OLD for this directory, so that +# CMake doesn't complain about the libraries with Unicode characters. +if(NOT (CMAKE_MAJOR_VERSION LESS 3)) + cmake_policy(SET CMP0037 OLD) +endif() + # Additional files to reference: # add the executable add_library (DllImportPath_Local SHARED ${SOURCES}) -- 2.7.4