Skip to content

Commit

Permalink
Use ccache in windows CI (#1736)
Browse files Browse the repository at this point in the history
- Followed guidelines from ccache wiki, using the "masquerading"
  technique, by copying ccache.exe to cl.exe
- Removed hard coded /Zi flag, which is not supported by ccache,
  and which should anyway be left to handle by cmake according
  to the build type

Signed-off-by: Sylvain Leclerc <[email protected]>
  • Loading branch information
sylvlecl authored Nov 7, 2023
1 parent 191996e commit f57c31b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
21 changes: 20 additions & 1 deletion .github/workflows/windows-vcpkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,24 @@ jobs:
run: |
choco install wget unzip zip --no-progress
# Downloads ccache, and copies it to "cl.exe" in order to trick cmake into using it,
# see ccache wiki for background on using it with MSVC:
# https://github.com/ccache/ccache/wiki/MS-Visual-Studio
- name: Install ccache
shell: bash
run: |
wget https://github.com/ccache/ccache/releases/download/v4.8.3/ccache-4.8.3-windows-x86_64.zip -O ccache.zip
unzip ccache.zip
rm ccache.zip
mv ccache-4.8.3-windows-x86_64 ccache
cp ccache/ccache.exe ccache/cl.exe
echo "${GITHUB_WORKSPACE}/ccache" >> $GITHUB_PATH
- name: ccache
uses: hendrikmuhs/[email protected]
with:
key: windows

- name : Init VCPKG submodule
run: |
git submodule update --init vcpkg
Expand Down Expand Up @@ -115,7 +133,8 @@ jobs:
-DBUILD_TESTING=ON \
-DBUILD_TOOLS=ON \
-DBUILD_not_system=OFF \
-DPython3_EXECUTABLE='${{ steps.setup-python.outputs.python-path }}'
-DPython3_EXECUTABLE='${{ steps.setup-python.outputs.python-path }}' \
-DCMAKE_VS_GLOBALS="CLToolExe=cl.exe;CLToolPath=${GITHUB_WORKSPACE}/ccache;TrackFileAccess=false;UseMultiToolTask=true;DebugInformationFormat=OldStyle"
- name: Build
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion src/cmake/common-settings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ if (NOT WIN32)
set(COMMON_GCC_FLAGS "${COMMON_GCC_FLAGS} -pipe -msse -msse2 -Wunused-but-set-variable -Wunused-but-set-parameter")
set(COMMON_GCC_FLAGS "${COMMON_GCC_FLAGS} -Werror=return-type")
endif()
set(COMMON_MSVC_FLAGS "/W3 /MP4 /Zi ")
set(COMMON_MSVC_FLAGS "/W3 /MP4")
set(COMMON_MSVC_FLAGS "${COMMON_MSVC_FLAGS} /we4715 /we4716") #adding no return or no return for all code paths as errors
set(ADDITIONAL_C_FLAGS " -Wconversion -Wmissing-prototypes -Wstrict-prototypes")
set(ADDITIONAL_C_FLAGS "${ADDITIONAL_C_FLAGS} -Wmissing-noreturn -Wpacked -Wredundant-decls -Wbad-function-cast -W -Wcast-align -Wcast-qual -Wsign-compare -fno-exceptions -Wdeclaration-after-statement")
Expand Down

0 comments on commit f57c31b

Please sign in to comment.