Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
120 commits
Select commit Hold shift + click to select a range
b76f83b
multi config build - update build instructions
jakeheke75 Oct 9, 2023
69f0e86
CCache build support
jakeheke75 Oct 9, 2023
83251d4
update readme
jakeheke75 Oct 9, 2023
2dda5dc
Move to function and enable option
Twon Oct 11, 2023
f62ff16
conanfile.py options in alphabetic order
jakeheke75 Oct 11, 2023
8c84341
ccache.make looping all supported languages
jakeheke75 Oct 11, 2023
85010f2
attempt support different generators
jakeheke75 Oct 12, 2023
8c696e4
Merge branch 'main' into ccache_build_support
jakeheke75 Oct 12, 2023
4dd9472
Merge branch 'Twon:main' into ccache_build_support
jakeheke75 Oct 14, 2023
93bc43e
ccache support adjustments
jakeheke75 Oct 16, 2023
67a57b3
Merge branch 'Twon:main' into ccache_build_support
jakeheke75 Oct 16, 2023
9accc3c
Merge branch 'main' into ccache_build_support
Twon Oct 25, 2023
11fb4f0
Merge branch 'Twon:main' into ccache_build_support
jakeheke75 Oct 25, 2023
c1e1922
Windows Visual Studio with MSVC and open folder functionality
jakeheke75 Oct 26, 2023
7dae544
reorganize code and logfile activation
jakeheke75 Oct 29, 2023
2f69610
recache switch enable
jakeheke75 Oct 29, 2023
019d710
update logic for Ninja* and Makefiles generators
jakeheke75 Oct 29, 2023
72d0ede
Code cleaning and options switches update
jakeheke75 Oct 29, 2023
5c82a1f
CMake workflow update CCache
jakeheke75 Oct 29, 2023
5bd3a5a
CMake workflow: CCache add env for executable
jakeheke75 Oct 29, 2023
dce4fd3
CMake workflow update CCache: exclude macos-12
jakeheke75 Oct 29, 2023
77d3712
CMake workflow update CCache: update CCache cache path
jakeheke75 Oct 29, 2023
637846b
CMake workflow update CCache path
jakeheke75 Oct 29, 2023
81ed0b2
CMake workflow update CCache path logic
jakeheke75 Oct 31, 2023
bb52bf7
CMake workflow update CCache fix step id error
jakeheke75 Oct 31, 2023
334a6a9
CMake workflow update CCache fix shell command
jakeheke75 Oct 31, 2023
4b59905
CMake workflow update CCache windows cmd update
jakeheke75 Oct 31, 2023
b57012b
CCache update CMake workflow
jakeheke75 Nov 1, 2023
0dea958
Adding apple-clang compiler support
jakeheke75 Nov 1, 2023
2974b69
update workflow files
jakeheke75 Nov 1, 2023
b2977da
CCache CMake workflow
jakeheke75 Nov 1, 2023
7a3585a
CCache update workflow
jakeheke75 Nov 1, 2023
1fbd4c0
CCache update workflow
jakeheke75 Nov 1, 2023
1a11d3e
CCache workflow update
jakeheke75 Nov 1, 2023
905ec00
CCache workflow update
jakeheke75 Nov 1, 2023
6b506c6
CCache trigger workflow
jakeheke75 Nov 1, 2023
a6d0f18
CCache workflow update
jakeheke75 Nov 1, 2023
55f42d1
CCache workflow trigger
jakeheke75 Nov 1, 2023
4761e74
CCache update sloppiness
jakeheke75 Nov 1, 2023
3d8a60e
CCache update sloppiness
jakeheke75 Nov 2, 2023
842c288
CCache update workflow windows
jakeheke75 Nov 2, 2023
c38c636
CCache windows workflow update
jakeheke75 Nov 2, 2023
76c0481
CCache update CMake workflow actions and restore keys
jakeheke75 Nov 2, 2023
e4f655f
CCache update workflow files
jakeheke75 Nov 2, 2023
aaf5516
CCache actions checkout fix
jakeheke75 Nov 2, 2023
ccb1f1c
Update build instructions for Windows
jakeheke75 Nov 2, 2023
d52391b
CCache fine tuning: increase the cache hit rate with CCACHE_NOHASHDIR…
jakeheke75 Nov 2, 2023
f07199a
CCache NOHASHDIR switch update
jakeheke75 Nov 2, 2023
5ee8287
Trigger workflow recache
jakeheke75 Nov 2, 2023
951645c
CCache workflow restore
jakeheke75 Nov 2, 2023
d53e37f
Ccache activate logfile to investigate cache miss
jakeheke75 Nov 3, 2023
f6edb3e
Ccache activate logfile
jakeheke75 Nov 3, 2023
3e5b0fb
Ccache logfile update
jakeheke75 Nov 3, 2023
22fdcd5
Ccache logfile
jakeheke75 Nov 3, 2023
38a892e
Ccache logfile
jakeheke75 Nov 4, 2023
98fefc5
Ccache logfile
jakeheke75 Nov 4, 2023
d399324
code simplification
jakeheke75 Nov 19, 2023
c4d2bad
replicate ccache env variables in CI build step
jakeheke75 Nov 23, 2023
84325ba
Merge branch 'Twon:main' into ccache_build_support
jakeheke75 Nov 23, 2023
da773f4
retrigger CI
jakeheke75 Nov 23, 2023
0328d2e
cmake workflow update
jakeheke75 Nov 25, 2023
dadaea3
Merge branch 'main' into ccache_build_support
jakeheke75 Nov 25, 2023
4c87ca1
fix missing Linux ccache directory
jakeheke75 Nov 25, 2023
460b9c2
Cmake workflow update
jakeheke75 Nov 25, 2023
70e3cd7
code_coverage workflow update
jakeheke75 Nov 25, 2023
1f3a8bf
code_coverage workflow update
jakeheke75 Nov 25, 2023
37da3b2
triggering recache for windows
jakeheke75 Nov 25, 2023
6a5ff56
restore CCACHE_RECACHE
jakeheke75 Nov 25, 2023
69211cc
adding more sloppines options
jakeheke75 Nov 25, 2023
e851feb
enable CCACHE_DEBUG
jakeheke75 Nov 26, 2023
0bf8980
Merge branch 'main' into ccache_build_support
jakeheke75 Nov 26, 2023
73a5361
Merge branch 'main' into ccache_build_support
Twon Nov 26, 2023
1f4b032
Merge branch 'ccache_build_support' of github.com:jakeheke75/Morpheus…
Twon Nov 26, 2023
6fe8210
Merge branch 'main' into ccache_build_support
Twon Nov 26, 2023
13e1298
search for debug files and show
jakeheke75 Nov 26, 2023
cb1677e
windows batch commands fix
jakeheke75 Nov 26, 2023
7741607
update windows batch command
jakeheke75 Nov 26, 2023
8293456
Merge branch 'main' into ccache_build_support
Twon Nov 27, 2023
1eb1a8f
Merge branch 'ccache_build_support' of github.com:jakeheke75/Morpheus…
Twon Nov 27, 2023
c8c345b
Fix typo
jakeheke75 Nov 27, 2023
330f323
update workflow debug files
jakeheke75 Nov 27, 2023
e0d487d
test removing CCACHE_NOHASHDIR
jakeheke75 Nov 27, 2023
0574ecf
change ccache caching strategy for code coverage workflow
jakeheke75 Nov 28, 2023
877635b
triggering code coverage workflow
jakeheke75 Nov 28, 2023
24c448d
code coverage base dir setting and recache
jakeheke75 Nov 28, 2023
f52efe9
code coverage workflow removing recache
jakeheke75 Nov 28, 2023
fc9581f
code coverage test umask and noinodecache options
jakeheke75 Nov 29, 2023
8941b51
trigger code coverage workflow
jakeheke75 Nov 29, 2023
b7a45d8
code coverage conan cache test
jakeheke75 Nov 30, 2023
243ec37
trigger code coverage workflow
jakeheke75 Nov 30, 2023
94e6ba6
trigger code coverage
jakeheke75 Nov 30, 2023
c5b9dd6
cmake workflow build flags for clang and msvc
jakeheke75 Nov 30, 2023
af569f3
cmake workflow fix compiler type
jakeheke75 Nov 30, 2023
16daad6
triggering cmake workflow
jakeheke75 Nov 30, 2023
4a96aff
trigger cmake workflow
jakeheke75 Nov 30, 2023
a631038
cmake workflow triggering
jakeheke75 Dec 1, 2023
51363a7
triggering first build with --build catch2/3.4.0 for Conan cache
jakeheke75 Dec 1, 2023
c86262e
rebuild all caches for Conan and ccache
jakeheke75 Dec 1, 2023
44b969c
retrigger all workflows without rebuild catch
jakeheke75 Dec 1, 2023
d014753
retrigger windows workflow
jakeheke75 Dec 1, 2023
1af0eee
retrigger windows debug
jakeheke75 Dec 1, 2023
43ba806
retrigger windows workflow
jakeheke75 Dec 1, 2023
7db080e
retrigger windows workflow
jakeheke75 Dec 1, 2023
e706ea4
trigger windows workflow
jakeheke75 Dec 1, 2023
b6e1492
trigger cache rebuild
jakeheke75 Dec 1, 2023
a67eafe
retrigger workflow
jakeheke75 Dec 1, 2023
a382ca0
trigger code coverage
jakeheke75 Dec 1, 2023
3b5a284
trigger code coverage
jakeheke75 Dec 1, 2023
827606f
trigger cmake workflow
jakeheke75 Dec 1, 2023
1901823
trigger cmake workflow
jakeheke75 Dec 1, 2023
f82d160
trigger cmake workflow
jakeheke75 Dec 1, 2023
107a485
trigger windows workflow
jakeheke75 Dec 1, 2023
f992822
retrigger workflow
jakeheke75 Dec 1, 2023
28e4742
trigger workflow
jakeheke75 Dec 2, 2023
8e69544
Merge branch 'Twon:main' into ccache_build_support
jakeheke75 Dec 20, 2023
d3d5e7f
Merge branch 'Twon:main' into ccache_build_support
jakeheke75 Dec 22, 2023
7a0e39e
Merge branch 'Twon:main' into ccache_build_support
jakeheke75 Dec 22, 2023
c9df0e6
Merge branch 'main' into ccache_build_support
Twon Apr 26, 2024
d6623e4
Merge branch 'ccache_build_support' of github.com:jakeheke75/Morpheus…
Twon Apr 27, 2024
6c25479
Merge branch 'main' into ccache_build_support
Twon May 6, 2024
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
138 changes: 128 additions & 10 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,15 @@ jobs:
- {
name: "Ubuntu GCC-12",
os: ubuntu-latest,
compiler: { type: GCC, version: 12, conan: "gcc", cc: "gcc-12", cxx: "g++-12", std: 20 },
compiler:
{
type: GCC,
version: 12,
conan: "gcc",
cc: "gcc-12",
cxx: "g++-12",
std: 20
},
lib: "libstdc++11"
}
- {
Expand Down Expand Up @@ -88,7 +96,15 @@ jobs:
- {
name: "Visual Studio 2019",
os: windows-latest,
compiler: { type: VISUAL, version: 16, conan: "mscv", cc: "cl", cxx: "cl", std: 20 },
compiler:
{
type: VISUAL,
version: 16,
conan: "mscv",
cc: "cl",
cxx: "cl",
std: 20
},
}
- {
name: "MacOS Apple Clang 14",
Expand Down Expand Up @@ -130,9 +146,9 @@ jobs:
key: ${{ hashFiles('**/conanfile.py') }}-build-${{ matrix.settings.os }}-${{ matrix.configuration }}-${{ matrix.settings.compiler.conan }}-${{ matrix.settings.compiler.version }}-${{ matrix.settings.lib }}
restore-keys: |
${{ hashFiles('**/conanfile.py') }}-build-${{ matrix.settings.os }}-${{ matrix.configuration }}-${{ matrix.settings.compiler.conan }}-${{ matrix.settings.compiler.version }}-
${{ hashFiles('**/conanfile.py') }}-build-${{ matrix.settings.os }}-${{ matrix.configuration }}-${{ matrix.settings.compiler.conan }}-
${{ hashFiles('**/conanfile.py') }}-build-${{ matrix.settings.os }}-${{ matrix.configuration }}-
${{ hashFiles('**/conanfile.py') }}-build-${{ matrix.settings.os }}-
#${{ hashFiles('**/conanfile.py') }}-build-${{ matrix.settings.os }}-${{ matrix.configuration }}-${{ matrix.settings.compiler.conan }}-
#${{ hashFiles('**/conanfile.py') }}-build-${{ matrix.settings.os }}-${{ matrix.configuration }}-
#${{ hashFiles('**/conanfile.py') }}-build-${{ matrix.settings.os }}-

# - uses: lhotari/action-upterm@v1
# with:
Expand Down Expand Up @@ -214,10 +230,18 @@ jobs:
conan profile show -pr default

- name: Configure Install
if: matrix.settings.os != 'windows-latest'
working-directory: ${{github.workspace}}
shell: bash
run: |
conan install "${{github.workspace}}" --build missing -pr:b default -c tools.cmake.cmaketoolchain:generator="Ninja Multi-Config" -o boost/*:without_cobalt=True

- name: Configure Install
if: matrix.settings.os == 'windows-latest'
working-directory: ${{github.workspace}}
shell: bash
run: |
conan install "${{github.workspace}}" --build missing -pr:b default -o boost/*:without_cobalt=True
conan install "${{github.workspace}}" --build missing -pr:b default -o boost/*:without_cobalt=True -c tools.cmake.cmaketoolchain:generator="Ninja Multi-Config"

- name: Configure Conan Build
if: matrix.settings.os == 'windows-latest'
Expand All @@ -241,38 +265,132 @@ jobs:
# detached: true

- name: Configure CMake
if: matrix.settings.os == 'windows-latest'
if: matrix.settings.os == 'windows-latest' && matrix.configuration == 'Release'
shell: cmd
run: |
cmake --version
call build\generators\conanbuild.bat
cmake --preset conan-default -DENABLE_ADDRESS_SANITIZER=ON -DENABLE_UNDEFINED_BEHAVIOUR_SANITIZER=ON
cmake --preset conan-default -DENABLE_ADDRESS_SANITIZER=ON -DENABLE_UNDEFINED_BEHAVIOUR_SANITIZER=ON -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_VS_GLOBALS="UseMultiToolTask=true;EnforceProcessCountAcrossBuilds=true"

- name: Configure CMake
if: matrix.settings.os != 'windows-latest'
if: matrix.settings.os == 'windows-latest' && matrix.configuration == 'Debug'
shell: cmd
run: |
cmake --version
call build\generators\conanbuild.bat
cmake --preset conan-default -DENABLE_ADDRESS_SANITIZER=ON -DENABLE_UNDEFINED_BEHAVIOUR_SANITIZER=ON -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_FLAGS_DEBUG="/YI;/Z7" -DCMAKE_VS_GLOBALS="UseMultiToolTask=true;EnforceProcessCountAcrossBuilds=true;TrackFileAccess=false;DebugInformationFormat=OldStyle"

- name: Configure CMake
if: matrix.settings.os != 'windows-latest' && matrix.settings.compiler.type == 'GCC'
shell: bash
run: |
source build/generators/conanbuild.sh
cmake --preset conan-default -DENABLE_ADDRESS_SANITIZER=ON -DENABLE_UNDEFINED_BEHAVIOUR_SANITIZER=ON
cmake --preset conan-default -DENABLE_ADDRESS_SANITIZER=ON -DENABLE_UNDEFINED_BEHAVIOUR_SANITIZER=ON -DCMAKE_CXX_COMPILER_LAUNCHER=ccache

- name: Configure CMake
if: matrix.settings.os != 'windows-latest' && matrix.settings.compiler.type != 'GCC'
shell: bash
run: |
source build/generators/conanbuild.sh
cmake --preset conan-default -DENABLE_ADDRESS_SANITIZER=ON -DENABLE_UNDEFINED_BEHAVIOUR_SANITIZER=ON -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_FLAGS_DEBUG="-Xclang -fno-pch-timestamp" -DCMAKE_CXX_FLAGS_RELEASE="-Xclang -fno-pch-timestamp"

- name: Conan Preset
shell: bash
run: echo "CONAN_PRESET=conan-$(echo ${{matrix.configuration}} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV

- name: CCache Configure
if: matrix.settings.os != 'windows-latest'
id: ccache-config-linux
shell: bash
run: |
mkdir $HOME/.ccache
echo "CCACHE_HOME=$HOME/.ccache" >> $GITHUB_ENV

- name: Cache CCache data
if: matrix.settings.os == 'windows-latest'
uses: actions/cache@v3.3.2
with:
path: C:\Users\runneradmin\AppData\Local\ccache\
key: ccache-${{ matrix.settings.os }}-${{ matrix.configuration }}-${{ matrix.settings.compiler.conan }}-${{ matrix.settings.compiler.version }}-${{ matrix.settings.lib }}-${{ github.run_number }}
restore-keys: |
ccache-${{ matrix.settings.os }}-${{ matrix.configuration }}-${{ matrix.settings.compiler.conan }}-${{ matrix.settings.compiler.version }}-${{ matrix.settings.lib }}-

- name: Cache CCache data
if: matrix.settings.os != 'windows-latest'
uses: actions/cache@v3.3.2
with:
path: ${{ env.CCACHE_HOME }}
key: ccache-${{ matrix.settings.os }}-${{ matrix.configuration }}-${{ matrix.settings.compiler.conan }}-${{ matrix.settings.compiler.version }}-${{ matrix.settings.lib }}-${{ github.run_number }}
restore-keys: |
ccache-${{ matrix.settings.os }}-${{ matrix.configuration }}-${{ matrix.settings.compiler.conan }}-${{ matrix.settings.compiler.version }}-${{ matrix.settings.lib }}-

- name: Build
if: matrix.settings.os == 'windows-latest'
shell: cmd
run: |
call build\generators\conanbuild.bat
set CCACHE_BASEDIR=${{ github.workspace }}
set CCACHE_LOGFILE=D:\\a\\Morpheus\\Morpheus\\build\\CcacheLogFile.log
set CCACHE_NOHASHDIR=1
set CCACHE_SLOPPINESS=pch_defines,time_macros,include_file_mtime,include_file_ctime
REM set CCACHE_DEBUG=1
REM set CCACHE_DEBUGDIR=D:\\a\\Morpheus\\Morpheus\\build\\
REM set CCACHE_RECACHE=1
echo Morpheus ccache show configuration
ccache -p
cmake --build --preset ${{ env.CONAN_PRESET }}

- name: Build
if: matrix.settings.os != 'windows-latest'
shell: bash
run: |
source build/generators/conanbuild.sh
export CCACHE_BASEDIR=${{ github.workspace }}
export CCACHE_DIR=$HOME/.ccache
export CCACHE_LOGFILE=$HOME/.ccache/CcacheLogFile.log
export CCACHE_NOHASHDIR=1
export CCACHE_SLOPPINESS=pch_defines,time_macros,include_file_mtime,include_file_ctime
#export CCACHE_DEBUG=1
#export CCACHE_DEBUGDIR=$HOME/.ccache/
#export CCACHE_RECACHE=1
echo "Morpheus ccache show configuration"
ccache -p
cmake --build --preset ${{ env.CONAN_PRESET }}

- name: CCache Stats
if: matrix.settings.os == 'windows-latest'
shell: cmd
run: |
call build\generators\conanbuild.bat
echo Morpheus ccache show stats
ccache -d C:\Users\runneradmin\AppData\Local\ccache\ -svvz
echo Morpheus showing ccache log files
type D:\a\Morpheus\Morpheus\build\CcacheLogFile.log
REM echo Morpheus showing ccache debug input files
REM forfiles /M *.ccache-input-text /S /C "cmd /c type @file"
REM echo Morpheus showing ccache debug log files
REM forfiles /M *.ccache-log /S /C "cmd /c type @file"
REM dir D:\a\Morpheus\Morpheus\build
REM rm D:\a\Morpheus\Morpheus\build\CcacheLogFile.log
REM dir D:\a\Morpheus\Morpheus\build

- name: CCache Stats
if: matrix.settings.os != 'windows-latest'
shell: bash
run: |
source build/generators/conanbuild.sh
echo "Morpheus ccache show stats"
ccache -d $HOME/.ccache -svvz
echo "Morpheus show ccache log files"
cat $HOME/.ccache/CcacheLogFile.log
#echo "Morpheus showing ccache debug input files"
#find . -name "*.ccache-input-text" -exec cat {} +
#echo "Morpheus showing ccache debug log files"
#find . -name "*.ccache-log" -exec cat {} +
#ls -la $HOME/.ccache
#rm $HOME/.ccache/CcacheLogFile.log
#ls -la $HOME/.ccache

- name: Test
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
Expand Down
62 changes: 55 additions & 7 deletions .github/workflows/code_coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,9 @@ jobs:
cache-name: cache-conan-data
with:
path: ${{github.workspace}}/.conan2/p
key: ${{ hashFiles('**/conanfile.py') }}-build-${{ matrix.settings.os }}-${{ matrix.configuration }}-${{ matrix.settings.compiler.conan }}-${{ matrix.settings.compiler.version }}-${{ matrix.settings.lib }}
key: ${{ hashFiles('**/conanfile.py') }}-code-coverage
restore-keys: |
${{ hashFiles('**/conanfile.py') }}-build-${{ matrix.settings.os }}-${{ matrix.configuration }}-${{ matrix.settings.compiler.conan }}-${{ matrix.settings.compiler.version }}-
${{ hashFiles('**/conanfile.py') }}-build-${{ matrix.settings.os }}-${{ matrix.configuration }}-${{ matrix.settings.compiler.conan }}-
${{ hashFiles('**/conanfile.py') }}-build-${{ matrix.settings.os }}-${{ matrix.configuration }}-
${{ hashFiles('**/conanfile.py') }}-build-${{ matrix.settings.os }}-
${{ hashFiles('**/conanfile.py') }}-code-coverage

# Previously GCC was installed via egor-tensin/setup-gcc@v1 but this does not install gcov with the compiler.
# By default Ubuntu has Gcov 11 installed. This worked so long as the compiler was gcc 11, but if a later gcc was
Expand Down Expand Up @@ -127,7 +124,14 @@ jobs:
working-directory: ${{github.workspace}}
shell: bash
run: |
conan install "${{github.workspace}}" --build missing -o boost/*:without_cobalt=True
# In order to have ccache working correctly we can't build the catch library every time, otherwise the hash of the built files will
# change at every workflow run and then we will get cache misses. Therefore the --build catch2/3.4.0 option must be enabled only the
# first time in order to correctly build the cache for Conan packages. After the first build of the Conan cache the option must
# be removed for all the subsequent executions.
# The same procedure must be followed every time that it changes something in the conanfile.py.
# it's a bit tricky but it is what it is, this is what must be done in order to get 100% ccache hit rate.
#conan install "${{github.workspace}}" --build missing -c tools.cmake.cmaketoolchain:generator=Ninja --build catch2/3.4.0 --build gtest/1.14.0
conan install "${{github.workspace}}" --build missing -c tools.cmake.cmaketoolchain:generator=Ninja -o boost/*:without_cobalt=True

- name: Conan Preset
shell: bash
Expand All @@ -138,14 +142,58 @@ jobs:
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: |
source build/${{env.BUILD_TYPE}}/generators/conanbuild.sh
cmake --preset ${{ env.CONAN_PRESET }} -DENABLE_CODE_COVERAGE=1
cmake --preset ${{ env.CONAN_PRESET }} -DENABLE_CODE_COVERAGE=1 -DCMAKE_CXX_COMPILER_LAUNCHER=ccache

- name: CCache Configure
shell: bash
run: |
source build/${{env.BUILD_TYPE}}/generators/conanbuild.sh
mkdir $HOME/.ccache
echo "CCACHE_HOME=$HOME/.ccache" >> $GITHUB_ENV

- name: Cache CCache data
uses: actions/cache@v3.3.2
with:
path: ${{ env.CCACHE_HOME }}
key: ccache-code-coverage-${{ github.run_number }}
restore-keys: |
ccache-code-coverage-

- name: Build
# Build your program with the given configuration
shell: bash
run: |
source build/${{env.BUILD_TYPE}}/generators/conanbuild.sh
export CCACHE_DIR=$HOME/.ccache
export CCACHE_SLOPPINESS=pch_defines,time_macros,include_file_mtime,include_file_ctime
export CCACHE_NOHASHDIR=1
export CCACHE_BASEDIR=${{ github.workspace }}
export CCACHE_LOGFILE=$HOME/.ccache/CcacheLogFile.log
#export CCACHE_DEBUG=1
#export CCACHE_UMASK=002
#export CCACHE_NOINODECACHE=1
#export CCACHE_RECACHE=1
#export CCACHE_DEBUGDIR=$HOME/.ccache/
echo "Morpheus ccache show configuration"
ccache -p
cmake --build --preset ${{ env.CONAN_PRESET }}

- name: CCache Stats
shell: bash
run: |
source build/${{env.BUILD_TYPE}}/generators/conanbuild.sh
echo "Morpheus ccache show stats"
ccache -d $HOME/.ccache -svvz
echo "Morpheus showing ccache log file"
cat $HOME/.ccache/CcacheLogFile.log
#echo "Morpheus showing ccache debug log files"
#find . -name "*.ccache-log" -exec cat {} +
#echo "Morpheus showing ccache debug input files"
#find . -name "*.ccache-input-text" -exec cat {} +
#ls -la $HOME/.ccache
#rm $HOME/.ccache/CcacheLogFile.log
#ls -la $HOME/.ccache

- name: Test
working-directory: ${{github.workspace}}
# Execute tests defined by the CMake configuration.
Expand Down
21 changes: 20 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ include(GNUInstallDirs)
include(CMakeDependentOption)
include(CMakePackageConfigHelpers)

option(MORPHEUS_BUILD_WITH_CCACHE "Enable the CCache compiler caching" ON)
option(MORPHEUS_RENDER_SYSTEM_DIRECT_X12 "Build with support for the Dirext X 12 render system" ON)
option(MORPHEUS_RENDER_SYSTEM_METAL "Build with support for the Metal render system" ON)
option(MORPHEUS_RENDER_SYSTEM_OPENGL "Build with support for the Open GL render system" ON)
Expand All @@ -46,6 +47,7 @@ list(APPEND CMAKE_PREFIX_PATH "${CMAKE_BINARY_DIR}" "${CMAKE_BINARY_DIR}/generat

#------------------------------------------------------------------------------------------------------------------------------------------
# Custom CMake Includes
include(ccache)
include(coverage)
include(compiler)
include(conformance)
Expand Down Expand Up @@ -82,7 +84,7 @@ set(CMAKE_BUILD_WITH_INSTALL_RPATH ON)
set(CMAKE_SKIP_BUILD_RPATH FALSE)

get_property(IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
if(IS_MULTI_CONFIG)
if (IS_MULTI_CONFIG)
set(RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/$<CONFIG>)
set(LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib/$<CONFIG>)
file(RELATIVE_PATH MORPHEUS_RELATIVE_BUILD_RPATH ${RUNTIME_OUTPUT_DIRECTORY} ${LIBRARY_OUTPUT_DIRECTORY})
Expand All @@ -100,6 +102,23 @@ endif()
add_subdirectory(libraries)
add_subdirectory(examples)

#[[
Ccache / Icecream options management
In order to add/remove configuration options for ccache call the function enable_ccache with the following parameters:
DEBUG to enable debugging
ICECC to enable Icecream build support
LOGFILE to enable ccache logging to file
NOHASHDIR to exclude the current working directory from the cache hash
QUIET Searches for the ccache executable, and if found enables it for supported language with specified options
RECACHE ccache will not use any previously stored result. New results will overwrite any pre-existing results
SLOPPINESS ccache to relax some checks in order to increase the hit rate of cache hits
reference documentation: https://ccache.dev/documentation.html
]]
if (MORPHEUS_BUILD_WITH_CCACHE)
set(LANGUAGES CXX)
enable_ccache(QUIET LANGUAGES ICECC NOHASHDIR SLOPPINESS)
endif()

if (ENABLE_CODE_COVERAGE)
enable_code_coverage()
endif()
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,14 @@ To enable Mold linker usage for gcc and clang with Linux:
conan install ./ -pr:h .conan2/profiles/gcc/12/x64-libstdc++11-debug -pr:b .conan2/profiles/gcc/12/x64-libstdc++11-debug --build missing
source build/Debug/generators/conanbuild.sh # Access the environment variables needed to use the Mold linker with gcc and clang
```
To disable Mold linker usage for gcc and clang with Linux:
To disable Mold linker usage for compilers gcc and clang with Linux:
```bash
conan install ./ -pr:h .conan2/profiles/gcc/12/x64-libstdc++11-debug -pr:b .conan2/profiles/gcc/12/x64-libstdc++11-debug --build missing -o link_with_mold=False
```
To disable CCache usage for compilers gcc and clang with Linux and macOS:
```bash
conan install ./ -pr:h .conan2/profiles/gcc/12/x64-libstdc++11-debug -pr:b .conan2/profiles/gcc/12/x64-libstdc++11-debug --build missing -o build_with_ccache=False
```
Use the preset generated by Conan
```bash
cmake --preset conan-debug
Expand All @@ -75,6 +79,7 @@ cmake --build --preset conan-debug
### Multi-Config Build

Multi-config builds allow you to create a build folder containing sub-folders for different build configurations and build them side-by-side. Once again starting with the repository clone and Conan configured run the install stage, but this time we specity the Conan cmake tools use Ninja multi-config to generate `Release, Debug, RelWithDebInfo` configurations. To generate all 3 configuration we run the `conan-default` preset which configures CMake for these configurations.
Instructions about how to build the library with Visual Studio and Ninja Multi-Config can be found [here](./WINDOWS.md)
```bash
conan install ./ -pr:h .conan2/profiles/msvc/193/x64-release -pr:b .conan2/profiles/msvc/193/x64-release --build missing -c tools.cmake.cmaketoolchain:generator="Ninja Multi-Config"
source build/generators/conanbuild.sh # Access the environment variables needed to use the Mold linker with gcc and clang
Expand Down
Binary file added VisualStudioInstall.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading