File tree Expand file tree Collapse file tree 3 files changed +35
-4
lines changed
samples/modules/thrift/hello Expand file tree Collapse file tree 3 files changed +35
-4
lines changed Original file line number Diff line number Diff line change @@ -57,12 +57,23 @@ Requirements
5757 west update
5858
5959 - QEMU Networking (described in :ref: `networking_with_qemu `)
60- - Thrift dependencies installed for your host OS e.g. in Ubuntu
60+ - Thrift dependencies installed for your host OS
6161
62- .. code-block :: console
63- :caption: Install additional dependencies in Ubuntu
62+ .. tabs ::
63+
64+ .. group-tab :: Ubuntu
65+
66+ .. code-block :: bash
67+ :caption: Install thrift dependencies in Ubuntu
68+
69+ sudo apt install -y libboost-all-dev thrift-compiler libthrift-dev
70+
71+ .. group-tab :: macOS
72+
73+ .. code-block :: bash
74+ :caption: Install thrift dependencies in macOS
6475
65- sudo apt install -y libboost-all-dev thrift-compiler libthrift-dev
76+ brew install boost openssl thrift
6677
6778 Building and Running
6879********************
Original file line number Diff line number Diff line change 33
44.PHONY : all clean
55
6+ OS = $(shell uname -s)
7+
68CXXFLAGS :=
79CXXFLAGS += -std=c++17
810
@@ -14,6 +16,14 @@ GENOBJ = $(filter-out %.h, $(GENSRC:.cpp=.o))
1416THRIFT_FLAGS :=
1517THRIFT_FLAGS += $(shell pkg-config --cflags thrift)
1618THRIFT_FLAGS += -I$(GEN_DIR )
19+ ifeq ($(OS ) ,Darwin)
20+ # get Homebrew prefix
21+ HOMEBREW_PREFIX := $(shell brew --prefix)
22+ # get boost include path (no pkgconfig file)
23+ BOOST_INCLUDE := $(shell find $(HOMEBREW_PREFIX ) -path '* /Cellar/boost/* /include' -type d | head -n 1)
24+ THRIFT_FLAGS += -I$(BOOST_INCLUDE )
25+ THRIFT_FLAGS += $(shell pkg-config --cflags openssl)
26+ endif
1727THRIFT_LIBS = $(shell pkg-config --libs thrift)
1828
1929all : hello_client hello_client_compact hello_client_ssl hello_client_py.stamp
Original file line number Diff line number Diff line change 33
44.PHONY : all clean
55
6+ OS = $(shell uname -s)
7+
68CXXFLAGS :=
79CXXFLAGS += -std=c++17
810
@@ -14,6 +16,14 @@ GENOBJ = $(filter-out %.h, $(GENSRC:.cpp=.o))
1416THRIFT_FLAGS :=
1517THRIFT_FLAGS += $(shell pkg-config --cflags thrift)
1618THRIFT_FLAGS += -I$(GEN_DIR )
19+ ifeq ($(OS ) ,Darwin)
20+ # get Homebrew prefix
21+ HOMEBREW_PREFIX := $(shell brew --prefix)
22+ # get boost include path (no pkgconfig file)
23+ BOOST_INCLUDE := $(shell find $(HOMEBREW_PREFIX ) -path '* /Cellar/boost/* /include' -type d | head -n 1)
24+ THRIFT_FLAGS += -I$(BOOST_INCLUDE )
25+ THRIFT_FLAGS += $(shell pkg-config --cflags openssl)
26+ endif
1727THRIFT_LIBS :=
1828THRIFT_LIBS = $(shell pkg-config --libs thrift)
1929
You can’t perform that action at this time.
0 commit comments