Skip to content

Commit

Permalink
Dockerfile:
Browse files Browse the repository at this point in the history
- removed res/sample_subfolder folder.
- restored res/sample_subfolder symlink (pointing to ../sample_subfolder).
- restored execution permission to build output binaries.
CMakeLists.txt:
- changed project version to 1.2.
README.md:
- added 'Compiler caching' to improvements over the original code.
- moved 'ccache' installation to the list of requirements.
- updated Docker/Run section.
  • Loading branch information
rturrado committed Oct 20, 2022
1 parent 0e3b787 commit ab47378
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ set(CMAKE_TOOLCHAIN_FILE "${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/scripts/buildsystems


project("the_modern_c++_challenge"
VERSION 1.1
VERSION 1.2
DESCRIPTION "My solutions to the 100 problems of The Modern C++ Challenge, a book by Marius Bancila's (published by Packt)."
HOMEPAGE_URL https://github.com/rturrado/the_modern_cpp_challenge.git
LANGUAGES C CXX
Expand Down
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,12 @@ COPY ./artifact/out/build/unixlike-gcc-release-docker/src/Release/the_modern_c++
COPY ./artifact/out/build/unixlike-gcc-release-docker/test/Release/the_modern_c++_challenge_test .
COPY ./artifact/out/build/unixlike-gcc-release-docker/_deps/freeimage-build/Release/libFreeImage.so .
ADD ./artifact/res /tmcppc/res

# upload-artifact action:
# - turns the sample_subfolder symbolic link into a folder, and
# - removes execution permission from binary files
RUN chmod 755 the_modern_c++_challenge* libFreeImage.so \
&& cd res/sample_folder \
&& rm -fr sample_subfolder \
&& ln -s ../sample_subfolder sample_subfolder \
&& cd /tmcppc \
15 changes: 7 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ These exercises were initially implemented as a project within a bigger Visual S
The goal behind The Modern C++ Challenge project is twofold. On one hand, let users download, build, and execute the code with a minimal effort (ideally without needing to install any library). On the personal side, get some hands-on experience with _CMake_ and other tools of the C++ ecosystem. I've also taken the chance to improve the original code with:
- _Tests_ (google tests).
- _Benchmarks_ (google benchmarks).
- _Static analysis_ (CLion's Inspect Code)
- _Static analysis_ (CLion's Inspect Code).
- _Continuous integration_ (GitHub actions).
- _Code coverage_ (gcov).
- _Compiler caching_ (ccache).

And I plan to better it further by using _sanitizers_.

Expand All @@ -38,6 +39,7 @@ The instructions below refer to Unix-like/gcc.
- **Boost libraries**: this project has been tested with version 1.78.0.
- **CMake**: required minimum version is 3.22.
- **ninja**.
- **ccache**.
- **gcc**: this project has been tested with version 12.
- **git**.
- **pkg-config**.
Expand All @@ -52,6 +54,7 @@ From a `terminal`, as administrator:
$> sudo apt-get -qq update
$> sudo apt-get -qq upgrade
$> sudo apt-get -qq -y install \
ccache \
cmake \
curl \
g++-12 \
Expand Down Expand Up @@ -83,11 +86,6 @@ $> rm -fr boost_1_78_0.tar.gz
$> export BOOST_ROOT=/libraries/boost_1_78_0
```

Should you want to make use of **ccache**, you could install it from a `terminal` as administrator:
```bash
$> sudo apt-get -qq -y install ccache
```

### Clone

From a `terminal`:
Expand Down Expand Up @@ -216,9 +214,10 @@ From a `terminal`:
$> docker login
# Enter username and password
$> docker pull rturrado/tmcppc-binaries
# To download the latest image version
# Otherwise, indicate a version. For example: rturrado/tmcppc-binaries:unixlike-builds-v1.1.15
# To download the latest version of the docker
# Otherwise, indicate a version. For example: docker pull rturrado/tmcppc-binaries:unixlike-builds-v1.2.0
$> docker run -it rturrado/tmcppc-binaries
# To create a container and run it
docker $ /tmcppc> ./the_modern_c++_challenge res
# To run the main executable
```
Expand Down

0 comments on commit ab47378

Please sign in to comment.