add_library: Fix INTERFACE on platforms with no shared libs (#14561)
This commit is contained in:
parent
13da9f0024
commit
64f73b0fb6
|
@ -229,6 +229,7 @@ bool cmAddLibraryCommand
|
||||||
yet its linker language. */
|
yet its linker language. */
|
||||||
if ((type != cmTarget::STATIC_LIBRARY) &&
|
if ((type != cmTarget::STATIC_LIBRARY) &&
|
||||||
(type != cmTarget::OBJECT_LIBRARY) &&
|
(type != cmTarget::OBJECT_LIBRARY) &&
|
||||||
|
(type != cmTarget::INTERFACE_LIBRARY) &&
|
||||||
(this->Makefile->GetCMakeInstance()->GetPropertyAsBool(
|
(this->Makefile->GetCMakeInstance()->GetPropertyAsBool(
|
||||||
"TARGET_SUPPORTS_SHARED_LIBS") == false))
|
"TARGET_SUPPORTS_SHARED_LIBS") == false))
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,3 +2,4 @@ include(RunCMake)
|
||||||
|
|
||||||
run_cmake(invalid_name)
|
run_cmake(invalid_name)
|
||||||
run_cmake(target_commands)
|
run_cmake(target_commands)
|
||||||
|
run_cmake(no_shared_libs)
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
^$
|
|
@ -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)
|
Loading…
Reference in New Issue