summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/ObjectLibrary/LinkObjRHSShared.cmake
blob: b9030b31846bc48d0d9dcf6b1b0ce24935de5491 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
enable_language(C)

add_definitions(-DCOMPILE_FOR_SHARED_LIB)

add_library(AnObjLib OBJECT a.c)
target_compile_definitions(AnObjLib INTERFACE REQUIRED)
set_target_properties(AnObjLib PROPERTIES POSITION_INDEPENDENT_CODE ON)

add_library(A SHARED b.c $<TARGET_OBJECTS:AnObjLib>)
target_link_libraries(A PUBLIC AnObjLib)

add_executable(exe exe.c)
target_link_libraries(exe A)