fat_object.cmake 500 B

12345678
  1. function(add_fat_object Target)
  2. add_executable(${Target} EXCLUDE_FROM_ALL)
  3. set_property(TARGET ${Target} PROPERTY EchoString "Partial linking ${FAT_OBJECT_PREFIX}${Target}${FAT_OBJECT_SUFFIX}")
  4. set_property(TARGET ${Target} PROPERTY SUFFIX ${FAT_OBJECT_SUFFIX})
  5. set_property(TARGET ${Target} PROPERTY PREFIX ${FAT_OBJECT_PREFIX})
  6. set_property(TARGET ${Target} PROPERTY POSITION_INDEPENDENT_CODE Off)
  7. target_link_options(${Target} PRIVATE -Wl,-r -nodefaultlibs -nostartfiles)
  8. endfunction()