Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions samples/modules/thrift/hello/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,23 @@ Requirements
west update

- QEMU Networking (described in :ref:`networking_with_qemu`)
- Thrift dependencies installed for your host OS e.g. in Ubuntu
- Thrift dependencies installed for your host OS

.. code-block:: console
:caption: Install additional dependencies in Ubuntu
.. tabs::

.. group-tab:: Ubuntu

.. code-block:: bash
:caption: Install thrift dependencies in Ubuntu

sudo apt install -y libboost-all-dev thrift-compiler libthrift-dev

.. group-tab:: macOS

.. code-block:: bash
:caption: Install thrift dependencies in macOS
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
:caption: Install thrift dependencies in macOS
:caption: Install thrift dependencies on macOS

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm.. do people normally say a package is installed "on" an OS? I usually say "in".

It's possibly "on" in German or French, but I've been saying "in" for the last 20 years or so and I'm a native English speaker.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh. Could well be that you're right then. I say "on" but I'm not a native English speaker.


sudo apt install -y libboost-all-dev thrift-compiler libthrift-dev
brew install boost openssl thrift

Building and Running
********************
Expand Down
10 changes: 10 additions & 0 deletions samples/modules/thrift/hello/client/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

.PHONY: all clean

OS = $(shell uname -s)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
OS = $(shell uname -s)
OS := $(shell uname -s)


CXXFLAGS :=
CXXFLAGS += -std=c++17

Expand All @@ -14,6 +16,14 @@ GENOBJ = $(filter-out %.h, $(GENSRC:.cpp=.o))
THRIFT_FLAGS :=
THRIFT_FLAGS += $(shell pkg-config --cflags thrift)
THRIFT_FLAGS += -I$(GEN_DIR)
ifeq ($(OS),Darwin)
# get Homebrew prefix
HOMEBREW_PREFIX := $(shell brew --prefix)
Comment on lines +19 to +21
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I use brew on linux 🫢

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😂 Well, that's one solution, I guess

# get boost include path (no pkgconfig file)
BOOST_INCLUDE := $(shell find $(HOMEBREW_PREFIX) -path '*/Cellar/boost/*/include' -type d | head -n 1)
THRIFT_FLAGS += -I$(BOOST_INCLUDE)
THRIFT_FLAGS += $(shell pkg-config --cflags openssl)
endif
THRIFT_LIBS = $(shell pkg-config --libs thrift)

all: hello_client hello_client_compact hello_client_ssl hello_client_py.stamp
Expand Down
10 changes: 10 additions & 0 deletions samples/modules/thrift/hello/server/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

.PHONY: all clean

OS = $(shell uname -s)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
OS = $(shell uname -s)
OS := $(shell uname -s)


CXXFLAGS :=
CXXFLAGS += -std=c++17

Expand All @@ -14,6 +16,14 @@ GENOBJ = $(filter-out %.h, $(GENSRC:.cpp=.o))
THRIFT_FLAGS :=
THRIFT_FLAGS += $(shell pkg-config --cflags thrift)
THRIFT_FLAGS += -I$(GEN_DIR)
ifeq ($(OS),Darwin)
# get Homebrew prefix
HOMEBREW_PREFIX := $(shell brew --prefix)
# get boost include path (no pkgconfig file)
BOOST_INCLUDE := $(shell find $(HOMEBREW_PREFIX) -path '*/Cellar/boost/*/include' -type d | head -n 1)
THRIFT_FLAGS += -I$(BOOST_INCLUDE)
THRIFT_FLAGS += $(shell pkg-config --cflags openssl)
endif
THRIFT_LIBS :=
THRIFT_LIBS = $(shell pkg-config --libs thrift)

Expand Down