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 26, 2024
1 parent 6948890 commit 0fc9c28
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 @@ -46,10 +46,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 0fc9c28

Please sign in to comment.