summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/PositionIndependentCode/Genex2.cmake
blob: fb0a5dbdae797f689e314a3782d663f6a87be9f9 (plain)
1
2
3
4
5
6
7
8
9

add_library(genex_pic UNKNOWN IMPORTED)
# PIC is ON if sibling target is a library, OFF if it is an executable
set_property(TARGET genex_pic PROPERTY INTERFACE_POSITION_INDEPENDENT_CODE $<NOT:$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>>)


add_executable(conflict2 main.cpp)
set_property(TARGET conflict2 PROPERTY POSITION_INDEPENDENT_CODE ON)
target_link_libraries(conflict2 PRIVATE genex_pic)