Skip to content

Commit

Permalink
don't arbitrarily link example binaries to pigpio
Browse files Browse the repository at this point in the history
  • Loading branch information
2bndy5 committed Mar 29, 2024
1 parent e31811b commit b4edfbd
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions examples_linux/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,14 @@ elseif("${RF24_DRIVER}" STREQUAL "wiringPi")
else()
message(FATAL "Lib ${RF24_DRIVER} not found.")
endif()
elseif(NOT "${LibPIGPIO}" STREQUAL "LibPIGPIO-NOTFOUND")
message(STATUS "linking to ${LibPIGPIO}")
# linking to pigpio requires pthread to be listed as last linked lib
list(APPEND linked_libs ${LibPIGPIO} pthread)
elseif("${RF24_DRIVER}" STREQUAL "pigpio")
if(NOT "${LibPIGPIO}" STREQUAL "LibPIGPIO-NOTFOUND")
message(STATUS "linking to ${LibPIGPIO}")
# linking to pigpio requires pthread to be listed as last linked lib
list(APPEND linked_libs ${LibPIGPIO} pthread)
else()
message(FATAL "Lib ${RF24_DRIVER} not found")
endif()
endif()

foreach(example ${EXAMPLES_LIST})
Expand Down

0 comments on commit b4edfbd

Please sign in to comment.