Skip to content

Commit

Permalink
Another try
Browse files Browse the repository at this point in the history
Signed-off-by: Geoff Hutchison <[email protected]>
  • Loading branch information
ghutchis committed Nov 23, 2024
1 parent a327ec2 commit af0fdc4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 27 deletions.
10 changes: 3 additions & 7 deletions .github/workflows/build_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ on: [push, pull_request, workflow_dispatch]
env:
QT_VERSION: 5.15.2
FEATURES: -DBUILD_GPL_PLUGINS=ON -DWITH_COORDGEN=OFF -DUSE_VTK=ON -DUSE_3DCONNEXION=ON
CACHE: -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -40,7 +39,7 @@ jobs:

- name: Install Dependencies (Windows)
if: runner.os == 'Windows'
run: choco install ninja ccache
run: choco install ninja

- name: Checkout openchemistry
uses: actions/checkout@v4
Expand Down Expand Up @@ -96,9 +95,6 @@ jobs:
with:
arch: x64

- name: Install ccache
uses: hendrikmuhs/[email protected]

- name: Grab cache files
uses: actions/cache@v4
if: runner.os != 'Windows'
Expand All @@ -111,12 +107,12 @@ jobs:
run: |
if [ ! -d "${{ runner.workspace }}/build" ]; then mkdir "${{ runner.workspace }}/build"; fi
cd "${{ runner.workspace }}/build"
CC=${{matrix.config.cc}} CXX=${{matrix.config.cxx}} cmake $GITHUB_WORKSPACE ${{env.FEATURES}} ${{env.CACHE}} -DCMAKE_BUILD_TYPE=${{matrix.config.build_type}} ${{matrix.config.cmake_flags}}
CC=${{matrix.config.cc}} CXX=${{matrix.config.cxx}} cmake $GITHUB_WORKSPACE ${{env.FEATURES}} -DCMAKE_BUILD_TYPE=${{matrix.config.build_type}} ${{matrix.config.cmake_flags}}
shell: bash

- name: Build
run: |
CC=${{matrix.config.cc}} CXX=${{matrix.config.cxx}} CMAKE_C_COMPILER_LAUNCHER=ccache CMAKE_CXX_COMPILER_LAUNCHER=ccache cmake --build . --config ${{matrix.config.build_type}} ${{matrix.config.build_flags}}
CC=${{matrix.config.cc}} CXX=${{matrix.config.cxx}} cmake --build . --config ${{matrix.config.build_type}} ${{matrix.config.build_flags}}
shell: bash
working-directory: ${{ runner.workspace }}/build

Expand Down
27 changes: 7 additions & 20 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,26 +41,13 @@ if(MSVC)
# https://docs.microsoft.com/en-us/cpp/build/reference/zc-cplusplus?view=msvc-160
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zc:__cplusplus")

# Use ccache if available
# tips from https://github.com/ccache/ccache/wiki/MS-Visual-Studio#usage-with-cmake
find_program(ccache_exe ccache)
if(ccache_exe)
file(COPY_FILE
${ccache_exe} ${CMAKE_BINARY_DIR}/cl.exe
ONLY_IF_DIFFERENT)

# By default Visual Studio generators will use /Zi which is not compatible
# with ccache, so tell Visual Studio to use /Z7 instead.
message(STATUS "Setting MSVC debug information format to 'Embedded'")
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$<$<CONFIG:Debug,RelWithDebInfo>:Embedded>")

set(CMAKE_VS_GLOBALS
"CLToolExe=cl.exe"
"CLToolPath=${CMAKE_BINARY_DIR}"
"UseMultiToolTask=true"
"DebugInformationFormat=OldStyle"
)
endif()
message(STATUS "Setting MSVC debug information format to 'Embedded'")
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$<$<CONFIG:Debug,RelWithDebInfo>:Embedded>")

set(CMAKE_VS_GLOBALS
"UseMultiToolTask=true"
"DebugInformationFormat=OldStyle"
)
endif()

option(ENABLE_TESTING "Enable testing and building the tests." OFF)
Expand Down

0 comments on commit af0fdc4

Please sign in to comment.