CMP0063: Split unit test by target type.

Don't rely on the order of warnings for targets being deterministic.
This commit is contained in:
Stephen Kelly 2015-10-20 23:54:33 +02:00
parent 9afbb733ec
commit 726e461b38
8 changed files with 74 additions and 52 deletions

View File

@ -0,0 +1,15 @@
CMake Warning \(dev\) at CMP0063-WARN-exe.cmake:[0-9]+ \(add_executable\):
Policy CMP0063 is not set: Honor visibility properties for all target
types. Run "cmake --help-policy CMP0063" for policy details. Use the
cmake_policy command to set the policy and suppress this warning.
Target "myexe" of type "EXECUTABLE" has the following visibility properties
set for CXX:
CXX_VISIBILITY_PRESET
VISIBILITY_INLINES_HIDDEN
For compatibility CMake is not honoring them for this target.
Call Stack \(most recent call first\):
CMakeLists.txt:[0-9]+ \(include\)
This warning is for project developers. Use -Wno-dev to suppress it.

View File

@ -5,4 +5,7 @@ enable_language(CXX)
set(CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN "-fvisibility-inlines-hidden") set(CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN "-fvisibility-inlines-hidden")
set(CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY "-fvisibility=") set(CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY "-fvisibility=")
include(CMP0063-Common.cmake) set(CMAKE_VISIBILITY_INLINES_HIDDEN 1)
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
add_executable(myexe lib.cpp)

View File

@ -0,0 +1,15 @@
CMake Warning \(dev\) at CMP0063-WARN-obj.cmake:[0-9]+ \(add_library\):
Policy CMP0063 is not set: Honor visibility properties for all target
types. Run "cmake --help-policy CMP0063" for policy details. Use the
cmake_policy command to set the policy and suppress this warning.
Target "myobject" of type "OBJECT_LIBRARY" has the following visibility
properties set for CXX:
CXX_VISIBILITY_PRESET
VISIBILITY_INLINES_HIDDEN
For compatibility CMake is not honoring them for this target.
Call Stack \(most recent call first\):
CMakeLists.txt:[0-9]+ \(include\)
This warning is for project developers. Use -Wno-dev to suppress it.

View File

@ -0,0 +1,11 @@
enable_language(CXX)
# Ensure CMake warns even if toolchain does not really have these flags.
set(CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN "-fvisibility-inlines-hidden")
set(CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY "-fvisibility=")
set(CMAKE_VISIBILITY_INLINES_HIDDEN 1)
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
add_library(myobject OBJECT lib.cpp)

View File

@ -0,0 +1,15 @@
CMake Warning \(dev\) at CMP0063-WARN-sta.cmake:[0-9]+ \(add_library\):
Policy CMP0063 is not set: Honor visibility properties for all target
types. Run "cmake --help-policy CMP0063" for policy details. Use the
cmake_policy command to set the policy and suppress this warning.
Target "mystatic" of type "STATIC_LIBRARY" has the following visibility
properties set for CXX:
CXX_VISIBILITY_PRESET
VISIBILITY_INLINES_HIDDEN
For compatibility CMake is not honoring them for this target.
Call Stack \(most recent call first\):
CMakeLists.txt:[0-9]+ \(include\)
This warning is for project developers. Use -Wno-dev to suppress it.

View File

@ -0,0 +1,11 @@
enable_language(CXX)
# Ensure CMake warns even if toolchain does not really have these flags.
set(CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN "-fvisibility-inlines-hidden")
set(CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY "-fvisibility=")
set(CMAKE_VISIBILITY_INLINES_HIDDEN 1)
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
add_library(mystatic STATIC lib.cpp)

View File

@ -1,50 +0,0 @@
^CMake Warning \(dev\) at CMP0063-Common.cmake:[0-9]+ \(add_executable\):
Policy CMP0063 is not set: Honor visibility properties for all target
types. Run "cmake --help-policy CMP0063" for policy details. Use the
cmake_policy command to set the policy and suppress this warning.
Target "myexe" of type "EXECUTABLE" has the following visibility properties
set for CXX:
CXX_VISIBILITY_PRESET
VISIBILITY_INLINES_HIDDEN
For compatibility CMake is not honoring them for this target.
Call Stack \(most recent call first\):
CMP0063-WARN-yes.cmake:[0-9]+ \(include\)
CMakeLists.txt:[0-9]+ \(include\)
This warning is for project developers. Use -Wno-dev to suppress it.
+
CMake Warning \(dev\) at CMP0063-Common.cmake:[0-9]+ \(add_library\):
Policy CMP0063 is not set: Honor visibility properties for all target
types. Run "cmake --help-policy CMP0063" for policy details. Use the
cmake_policy command to set the policy and suppress this warning.
Target "myobject" of type "OBJECT_LIBRARY" has the following visibility
properties set for CXX:
CXX_VISIBILITY_PRESET
VISIBILITY_INLINES_HIDDEN
For compatibility CMake is not honoring them for this target.
Call Stack \(most recent call first\):
CMP0063-WARN-yes.cmake:[0-9]+ \(include\)
CMakeLists.txt:[0-9]+ \(include\)
This warning is for project developers. Use -Wno-dev to suppress it.
+
CMake Warning \(dev\) at CMP0063-Common.cmake:[0-9]+ \(add_library\):
Policy CMP0063 is not set: Honor visibility properties for all target
types. Run "cmake --help-policy CMP0063" for policy details. Use the
cmake_policy command to set the policy and suppress this warning.
Target "mystatic" of type "STATIC_LIBRARY" has the following visibility
properties set for CXX:
CXX_VISIBILITY_PRESET
VISIBILITY_INLINES_HIDDEN
For compatibility CMake is not honoring them for this target.
Call Stack \(most recent call first\):
CMP0063-WARN-yes.cmake:[0-9]+ \(include\)
CMakeLists.txt:[0-9]+ \(include\)
This warning is for project developers. Use -Wno-dev to suppress it.$

View File

@ -2,6 +2,8 @@ include(RunCMake)
run_cmake(PropertyTypo) run_cmake(PropertyTypo)
run_cmake(CMP0063-OLD) run_cmake(CMP0063-OLD)
run_cmake(CMP0063-WARN-yes) run_cmake(CMP0063-WARN-exe)
run_cmake(CMP0063-WARN-obj)
run_cmake(CMP0063-WARN-sta)
run_cmake(CMP0063-WARN-no) run_cmake(CMP0063-WARN-no)
run_cmake(CMP0063-NEW) run_cmake(CMP0063-NEW)