Merge topic 'fix-INTERFACE-with-no-SHARED-libs'

64f73b0 add_library: Fix INTERFACE on platforms with no shared libs (#14561)
This commit is contained in:
Brad King 2013-11-13 09:57:20 -05:00 committed by CMake Topic Stage
commit 3c4071bec4
4 changed files with 8 additions and 0 deletions

View File

@ -229,6 +229,7 @@ bool cmAddLibraryCommand
yet its linker language. */
if ((type != cmTarget::STATIC_LIBRARY) &&
(type != cmTarget::OBJECT_LIBRARY) &&
(type != cmTarget::INTERFACE_LIBRARY) &&
(this->Makefile->GetCMakeInstance()->GetPropertyAsBool(
"TARGET_SUPPORTS_SHARED_LIBS") == false))
{

View File

@ -2,3 +2,4 @@ include(RunCMake)
run_cmake(invalid_name)
run_cmake(target_commands)
run_cmake(no_shared_libs)

View File

@ -0,0 +1 @@
^$

View File

@ -0,0 +1,5 @@
cmake_minimum_required(VERSION 2.8.12.20131009)
set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS FALSE)
add_library(foo INTERFACE)
target_compile_definitions(foo INTERFACE FOO_DEFINE)