Skip to content

Commit

Permalink
Fix #91 order of cmake files processing.
Browse files Browse the repository at this point in the history
Comms has to be processed first to set defines for board support enabling.
Otherwise first cmake iteration won't have variables defined and won't include sources into build. Second iteration finds cached defines and only then includes sources.
  • Loading branch information
rjonaitis committed Aug 7, 2024
1 parent 770847c commit 750b5d4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -112,17 +112,17 @@ install(
RUNTIME DESTINATION bin # .dll file
)

configure_file(${CMAKE_CURRENT_SOURCE_DIR}/boards/BoardSupportLoader.in.cpp ${CMAKE_CURRENT_BINARY_DIR}/BoardSupportLoader.cpp)
target_sources(limesuiteng PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/BoardSupportLoader.cpp)

add_subdirectory(boards)
add_subdirectory(comms)
add_subdirectory(boards)
add_subdirectory(chips)
add_subdirectory(DSP)
add_subdirectory(examples)
add_subdirectory(utilities)
add_subdirectory(vectorization)

configure_file(${CMAKE_CURRENT_SOURCE_DIR}/boards/BoardSupportLoader.in.cpp ${CMAKE_CURRENT_BINARY_DIR}/BoardSupportLoader.cpp)
target_sources(limesuiteng PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/BoardSupportLoader.cpp)

########################################################################
# Build pkg config file
########################################################################
Expand Down
6 changes: 6 additions & 0 deletions src/boards/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
target_sources(limesuiteng PRIVATE DeviceRegistry.cpp DeviceHandle.cpp LMS7002M_SDRDevice.cpp)

if(NOT DEFINED ENABLE_LIMEPCIE
OR NOT DEFINED ENABLE_USB_FX3
OR NOT DEFINED ENABLE_USB_FTDI)
message(FATAL_ERROR "Comms cmake has to be processed before boards")
endif()

if(ENABLE_LIMEPCIE)
target_sources(limesuiteng PRIVATE DeviceFactoryPCIe.cpp)
add_subdirectory(LimeSDR_X3)
Expand Down

0 comments on commit 750b5d4

Please sign in to comment.