Tests: Refactor RunCMake.VisibilityPreset test setup
Enable languages only in the individual test case. Enable the test everywhere except Visual Studio generators (which do not implement the properties) and just set fake flags as needed to activate relevant code paths. Drop unneeded CMAKE_SUPPRESS_REGENERATION which seems to have been copied from an unrelated test when this test was created.
This commit is contained in:
parent
d0f59d3598
commit
ab55b3b5fa
|
@ -105,23 +105,10 @@ add_RunCMake_test(CompileFeatures)
|
||||||
add_RunCMake_test(WriteCompilerDetectionHeader)
|
add_RunCMake_test(WriteCompilerDetectionHeader)
|
||||||
if(NOT WIN32)
|
if(NOT WIN32)
|
||||||
add_RunCMake_test(PositionIndependentCode)
|
add_RunCMake_test(PositionIndependentCode)
|
||||||
set(SKIP_VISIBILITY 0)
|
|
||||||
if("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU" AND "${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS 4.2)
|
|
||||||
set(SKIP_VISIBILITY 1)
|
|
||||||
endif()
|
endif()
|
||||||
|
if(NOT CMAKE_GENERATOR MATCHES "Visual Studio")
|
||||||
if (CMAKE_CXX_COMPILER_ID MATCHES Watcom
|
|
||||||
OR CMAKE_SYSTEM_NAME MATCHES IRIX64
|
|
||||||
OR CMAKE_CXX_COMPILER_ID MATCHES HP
|
|
||||||
OR CMAKE_CXX_COMPILER_ID MATCHES XL
|
|
||||||
OR CMAKE_CXX_COMPILER_ID MATCHES SunPro)
|
|
||||||
set(SKIP_VISIBILITY 1)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (NOT SKIP_VISIBILITY)
|
|
||||||
add_RunCMake_test(VisibilityPreset)
|
add_RunCMake_test(VisibilityPreset)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
|
||||||
if (QT4_FOUND)
|
if (QT4_FOUND)
|
||||||
set(CompatibleInterface_ARGS -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE})
|
set(CompatibleInterface_ARGS -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE})
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -1,8 +1,3 @@
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 2.8.4)
|
cmake_minimum_required(VERSION 2.8.4)
|
||||||
project(${RunCMake_TEST} CXX)
|
project(${RunCMake_TEST} NONE)
|
||||||
|
|
||||||
# MSVC creates extra targets which pollute the stderr unless we set this.
|
|
||||||
set(CMAKE_SUPPRESS_REGENERATION TRUE)
|
|
||||||
|
|
||||||
include(${RunCMake_TEST}.cmake)
|
include(${RunCMake_TEST}.cmake)
|
||||||
|
|
|
@ -1,3 +1,8 @@
|
||||||
|
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=")
|
||||||
|
|
||||||
add_library(visibility_preset SHARED lib.cpp)
|
add_library(visibility_preset SHARED lib.cpp)
|
||||||
set_property(TARGET visibility_preset PROPERTY CXX_VISIBILITY_PRESET hiden)
|
set_property(TARGET visibility_preset PROPERTY CXX_VISIBILITY_PRESET hiden)
|
||||||
|
|
Loading…
Reference in New Issue