aboutsummaryrefslogtreecommitdiffstats
path: root/cmake/fat_object.cmake
blob: ae81534e81b5eca4574f78131c34f85e60fdb9cb (plain) (blame)
1
2
3
4
5
6
7
8
function(add_fat_object Target)
  add_executable(${Target} EXCLUDE_FROM_ALL)
  set_property(TARGET ${Target} PROPERTY EchoString "Partial linking ${FAT_OBJECT_PREFIX}${Target}${FAT_OBJECT_SUFFIX}")
  set_property(TARGET ${Target} PROPERTY SUFFIX ${FAT_OBJECT_SUFFIX})
  set_property(TARGET ${Target} PROPERTY PREFIX ${FAT_OBJECT_PREFIX})
  set_property(TARGET ${Target} PROPERTY POSITION_INDEPENDENT_CODE Off)
  target_link_options(${Target} PRIVATE -Wl,-r -nodefaultlibs -nostartfiles)
endfunction()