|
| 1 | +# v3.21 implemented semantic changes regarding $<TARGET_OBJECTS:...> |
| 2 | +# See https://cmake.org/cmake/help/v3.21/command/target_link_libraries.html#linking-object-libraries-via-target-objects |
| 3 | +cmake_minimum_required(VERSION 3.21) |
| 4 | + |
| 5 | +add_library(USBDeviceINTERFACE) |
| 6 | +add_library(USBDevice_usageINTERFACE) |
| 7 | + |
| 8 | +target_include_directories(USBDevice_usageINTERFACE |
| 9 | + src |
| 10 | +) |
| 11 | + |
| 12 | + |
| 13 | +target_link_libraries(USBDevice_usageINTERFACE |
| 14 | + base_config |
| 15 | +) |
| 16 | + |
| 17 | +target_link_libraries(USBDeviceINTERFACE USBDevice_usage) |
| 18 | + |
| 19 | + |
| 20 | + |
| 21 | +add_library(USBDevice_bin OBJECTEXCLUDE_FROM_ALL |
| 22 | + src/cdc/cdc_queue.c |
| 23 | + src/cdc/usbd_cdc.c |
| 24 | + src/cdc/usbd_cdc_if.c |
| 25 | + src/hid/usbd_hid_composite.c |
| 26 | + src/hid/usbd_hid_composite_if.c |
| 27 | + src/usb_device_core.c |
| 28 | + src/usb_device_ctlreq.c |
| 29 | + src/usb_device_ioreq.c |
| 30 | + src/usbd_conf.c |
| 31 | + src/usbd_desc.c |
| 32 | + src/usbd_ep_conf.c |
| 33 | + src/usbd_if.c |
| 34 | + src/USBSerial.cpp |
| 35 | +) |
| 36 | +target_link_libraries(USBDevice_binPUBLIC USBDevice_usage) |
| 37 | + |
| 38 | +target_link_libraries(USBDeviceINTERFACE |
| 39 | + USBDevice_bin |
| 40 | + $<TARGET_OBJECTS:USBDevice_bin> |
| 41 | +) |
| 42 | + |