Merge topic 'export-COMPILE_OPTIONS-property'
77ff352 Generate INTERFACE_COMPILE_OPTIONS on export.
This commit is contained in:
commit
22fbeaa14b
@ -72,6 +72,9 @@ bool cmExportBuildFileGenerator::GenerateMainFile(std::ostream& os)
|
|||||||
this->PopulateInterfaceProperty("INTERFACE_COMPILE_DEFINITIONS", te,
|
this->PopulateInterfaceProperty("INTERFACE_COMPILE_DEFINITIONS", te,
|
||||||
cmGeneratorExpression::BuildInterface,
|
cmGeneratorExpression::BuildInterface,
|
||||||
properties, missingTargets);
|
properties, missingTargets);
|
||||||
|
this->PopulateInterfaceProperty("INTERFACE_COMPILE_OPTIONS", te,
|
||||||
|
cmGeneratorExpression::BuildInterface,
|
||||||
|
properties, missingTargets);
|
||||||
this->PopulateInterfaceProperty("INTERFACE_POSITION_INDEPENDENT_CODE",
|
this->PopulateInterfaceProperty("INTERFACE_POSITION_INDEPENDENT_CODE",
|
||||||
te, properties);
|
te, properties);
|
||||||
this->PopulateCompatibleInterfaceProperties(te, properties);
|
this->PopulateCompatibleInterfaceProperties(te, properties);
|
||||||
|
@ -130,6 +130,10 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os)
|
|||||||
te,
|
te,
|
||||||
cmGeneratorExpression::InstallInterface,
|
cmGeneratorExpression::InstallInterface,
|
||||||
properties, missingTargets);
|
properties, missingTargets);
|
||||||
|
this->PopulateInterfaceProperty("INTERFACE_COMPILE_OPTIONS",
|
||||||
|
te,
|
||||||
|
cmGeneratorExpression::InstallInterface,
|
||||||
|
properties, missingTargets);
|
||||||
this->PopulateInterfaceProperty("INTERFACE_POSITION_INDEPENDENT_CODE",
|
this->PopulateInterfaceProperty("INTERFACE_POSITION_INDEPENDENT_CODE",
|
||||||
te, properties);
|
te, properties);
|
||||||
this->PopulateCompatibleInterfaceProperties(te, properties);
|
this->PopulateCompatibleInterfaceProperties(te, properties);
|
||||||
|
@ -162,7 +162,6 @@ set_property(TARGET testLibRequired APPEND PROPERTY
|
|||||||
$<BUILD_INTERFACE:BuildOnly_DEFINE>
|
$<BUILD_INTERFACE:BuildOnly_DEFINE>
|
||||||
$<INSTALL_INTERFACE:InstallOnly_DEFINE>
|
$<INSTALL_INTERFACE:InstallOnly_DEFINE>
|
||||||
)
|
)
|
||||||
|
|
||||||
include(GenerateExportHeader)
|
include(GenerateExportHeader)
|
||||||
|
|
||||||
add_subdirectory(renamed)
|
add_subdirectory(renamed)
|
||||||
@ -201,6 +200,11 @@ set_property(TARGET testSharedLibRequired
|
|||||||
PROPERTY
|
PROPERTY
|
||||||
INTERFACE_CUSTOM_STRING testcontent
|
INTERFACE_CUSTOM_STRING testcontent
|
||||||
)
|
)
|
||||||
|
set_property(TARGET testSharedLibRequired APPEND PROPERTY
|
||||||
|
INTERFACE_COMPILE_OPTIONS
|
||||||
|
$<$<CXX_COMPILER_ID:GNU>:-DCUSTOM_COMPILE_OPTION>
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
add_library(testSharedLibDepends SHARED testSharedLibDepends.cpp)
|
add_library(testSharedLibDepends SHARED testSharedLibDepends.cpp)
|
||||||
set_property(TARGET testSharedLibDepends APPEND PROPERTY
|
set_property(TARGET testSharedLibDepends APPEND PROPERTY
|
||||||
|
@ -169,6 +169,13 @@ target_compile_definitions(deps_shared_iface
|
|||||||
$<$<STREQUAL:$<TARGET_PROPERTY:CUSTOM_STRING>,testcontent>:CUSTOM_STRING_IS_MATCH>
|
$<$<STREQUAL:$<TARGET_PROPERTY:CUSTOM_STRING>,testcontent>:CUSTOM_STRING_IS_MATCH>
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
||||||
|
target_compile_definitions(deps_shared_iface
|
||||||
|
PRIVATE
|
||||||
|
"DO_GNU_TESTS"
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
if (APPLE OR CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
if (APPLE OR CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
||||||
include(CheckCXXCompilerFlag)
|
include(CheckCXXCompilerFlag)
|
||||||
check_cxx_compiler_flag(-fPIE run_pic_test)
|
check_cxx_compiler_flag(-fPIE run_pic_test)
|
||||||
@ -199,6 +206,12 @@ endif()
|
|||||||
|
|
||||||
add_executable(deps_shared_iface2 deps_shared_iface.cpp)
|
add_executable(deps_shared_iface2 deps_shared_iface.cpp)
|
||||||
target_link_libraries(deps_shared_iface2 bld_testSharedLibDepends bld_subdirlib)
|
target_link_libraries(deps_shared_iface2 bld_testSharedLibDepends bld_subdirlib)
|
||||||
|
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
||||||
|
target_compile_definitions(deps_shared_iface2
|
||||||
|
PRIVATE
|
||||||
|
"DO_GNU_TESTS"
|
||||||
|
)
|
||||||
|
endif()
|
||||||
target_compile_definitions(deps_shared_iface2
|
target_compile_definitions(deps_shared_iface2
|
||||||
PRIVATE TEST_SUBDIR_LIB
|
PRIVATE TEST_SUBDIR_LIB
|
||||||
$<$<BOOL:$<TARGET_PROPERTY:POSITION_INDEPENDENT_CODE>>:PIC_PROPERTY_IS_ON>
|
$<$<BOOL:$<TARGET_PROPERTY:POSITION_INDEPENDENT_CODE>>:PIC_PROPERTY_IS_ON>
|
||||||
|
@ -25,6 +25,12 @@
|
|||||||
#include "renamed.h"
|
#include "renamed.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef DO_GNU_TESTS
|
||||||
|
#ifndef CUSTOM_COMPILE_OPTION
|
||||||
|
#error Expected CUSTOM_COMPILE_OPTION
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
int main(int,char **)
|
int main(int,char **)
|
||||||
{
|
{
|
||||||
TestSharedLibDepends dep;
|
TestSharedLibDepends dep;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user