Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated project to use C++17 #42

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
23 changes: 20 additions & 3 deletions docker/Dockerfile.rosdiscover
Original file line number Diff line number Diff line change
@@ -1,15 +1,32 @@
FROM rosdiscover/cxx-extract:builder
COPY --from=christimperley/llvm11 /opt/llvm11/ /opt/llvm11/
COPY --from=christimperley/llvm11 /opt/llvm/ /opt/llvm11/
WORKDIR /tmp/rosdiscover
COPY . .
RUN wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null \
| gpg --dearmor - \
| tee /etc/apt/trusted.gpg.d/kitware.gpg > /dev/null \
&& apt-add-repository 'deb https://apt.kitware.com/ubuntu/ xenial main' \
&& add-apt-repository -y ppa:ubuntu-toolchain-r/test \
&& apt-get update -qq \
&& apt-get install -y \
gcc-9 \
g++-9 \
cmake \
musl-dev \
zlib1g-dev \
&& update-alternatives \
--install /usr/bin/gcc gcc /usr/bin/gcc-9 60 \
--slave /usr/bin/g++ g++ /usr/bin/g++-9 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN mkdir build \
&& cd build \
&& cmake \
-DCMAKE_PREFIX_PATH=/opt/llvm11 \
-DCMAKE_CXX_COMPILER=/opt/llvm11/bin/clang++ \
-DCMAKE_CXX_COMPILER=g++ \
-DCMAKE_LINKER=/opt/llvm11/bin/lld \
-DCMAKE_INSTALL_PREFIX=/opt/rosdiscover \
-DCMAKE_CXX_FLAGS="-I/opt/llvm11/include -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS" \
-DCMAKE_CXX_FLAGS="-I/opt/llvm11/include -w -Wno-error -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS" \
.. \
&& make install \
&& rm -rf /tmp/*
Expand Down
2 changes: 1 addition & 1 deletion src/rosdiscover/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ llvm_map_components_to_libnames(ROSDISCOVER_LLVM_LIBS

set_target_properties(rosdiscover-cxx-extract
PROPERTIES
CXX_STANDARD 14
CXX_STANDARD 17
CMAKE_CXX_STANDARD_REQUIRED ON
LINK_SEARCH_START_STATIC ON
LINK_SEARCH_END_STATIC ON
Expand Down