Skip to content

Commit

Permalink
Revert "conditionally build examples with pigpio"
Browse files Browse the repository at this point in the history
This reverts commit 20c8621.
  • Loading branch information
2bndy5 committed Jan 23, 2022
1 parent 20c8621 commit 5e5af7e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 18 deletions.
10 changes: 2 additions & 8 deletions examples_RPi/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,10 @@ message(STATUS "using RF24 library: ${RF24}")
find_library(RF24Network rf24network REQUIRED)
message(STATUS "using RF24Network library: ${RF24Network}")

find_library(LibPIGPIO pigpio)

foreach(example ${EXAMPLES_LIST})
# make a target
add_executable(${example} ${example}.cpp)

# link the RF24 lib to the target. Notice we specify pthread as a linked lib here
if ("${LibPIGPIO}" STREQUAL "LibPIGPIO-NOTFOUND")
target_link_libraries(${example} PUBLIC ${RF24} pthread ${RF24Network})
else()
message(STATUS "linking to ${LibPIGPIO} for interrupt support")
target_link_libraries(${example} PUBLIC ${RF24} pthread ${RF24Network} ${LibPIGPIO})
endif()
target_link_libraries(${example} PUBLIC ${RF24} pthread ${RF24Network})
endforeach()
11 changes: 1 addition & 10 deletions examples_RPi/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,12 @@ ifneq "${RPI}" "1"
RPI=$(shell cat /proc/cpuinfo | grep Hardware | grep -c BCM2709)
endif

pigpio_detected=0
ifeq ($(wildcard "/usr/lib/libpigpio.so"))
pigpio_detected=1
endif

ifeq "$(RPI)" "1"
# The recommended compiler flags for the Raspberry Pi
CCFLAGS=-Ofast -mfpu=vfp -mfloat-abi=hard -march=$(ARCH) -mtune=arm1176jzf-s -std=c++0x
ifeq "$(pigpio_detected)" "1"
CCFLAGS=$(CCFLAGS) -lpigpio
endif
else
CCFLAGS=$(CCFLAGS) -DRF24_NO_INTERRUPT
endif


# define all programs
PROGRAMS = rx-test helloworld_rx helloworld_tx
SOURCES = ${PROGRAMS:=.cpp}
Expand Down

0 comments on commit 5e5af7e

Please sign in to comment.