Skip to content

Commit e049819

Browse files
committed
split
1 parent 69c18a6 commit e049819

File tree

3 files changed

+40
-35
lines changed

3 files changed

+40
-35
lines changed

.github/workflows/ci_cmake.yml

+12-35
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
fail-fast: false
1313
matrix:
1414
build_type : [ Release, Debug ]
15-
os : [ macos-latest, ubuntu-20.04]
15+
os : [ macos-latest, ubuntu-20.04 ]
1616
include:
1717
- os: ubuntu-20.04
1818
cxx: g++-10
@@ -52,7 +52,7 @@ jobs:
5252
- uses: actions/checkout@v4
5353
with:
5454
fetch-depth: 0
55-
# fetch-depth: 0 gets git history to compute version
55+
# fetch-depth: 0 for git history to compute version
5656

5757
- id: skip_check
5858
name: Check if can skip
@@ -84,35 +84,6 @@ jobs:
8484
echo "FC=/usr/bin/gfortran-10" >> $GITHUB_ENV
8585
echo "EIGEN3_INCLUDE_DIR=/usr/include/eigen3" >> $GITHUB_ENV
8686
87-
- name: Install Windows prerequisites, part 1, Create Conda Environment
88-
if: ${{ steps.skip_check.outputs.should_skip != 'true' && matrix.os == 'windows-latest' }}
89-
uses: conda-incubator/setup-miniconda@v3
90-
with:
91-
activate-environment: ""
92-
auto-activate-base: true
93-
show-channel-urls: true
94-
miniforge-variant: Mambaforge
95-
use-mamba: true
96-
channels: conda-forge
97-
add-pip-as-python-dependency: true
98-
99-
# Note: `shell: bash -l {0}` makes Miniconda created above for Windows available to
100-
# subsequent steps. see https://github.com/conda-incubator/setup-miniconda#usage-examples
101-
102-
- name: Install Windows prerequisites, part 2, Environment Information
103-
if: ${{ steps.skip_check.outputs.should_skip != 'true' && matrix.os == 'windows-latest' }}
104-
shell: bash -l {0}
105-
run: |
106-
mamba info
107-
mamba install ninja cmake=3.21 python mpir boost eigen ccache -c conda-forge --yes
108-
mamba list
109-
110-
- name: Prepare compiler environment for Windows
111-
if: ${{ steps.skip_check.outputs.should_skip != 'true' && matrix.os == 'windows-latest' }}
112-
uses: ilammy/msvc-dev-cmd@v1
113-
with:
114-
arch: x64
115-
11687
- name: Prepare ccache timestamp
11788
if: ${{ steps.skip_check.outputs.should_skip != 'true' }}
11889
id: ccache_cache_timestamp
@@ -130,15 +101,21 @@ jobs:
130101
restore-keys: |
131102
${{ matrix.config.name }}-ccache-
132103
133-
- name: Generate Libint library
104+
- name: Generate Libint generator
134105
if: ${{ steps.skip_check.outputs.should_skip != 'true' }}
135106
# Use a bash shell so we can use the same syntax for environment variable
136107
# access regardless of the host operating system
137-
shell: bash -l {0}
108+
shell: bash
138109
working-directory: ${{github.workspace}}/build/compiler
139110
run: |
140-
ls ${{github.workspace}}
141111
git describe --tags
142112
cmake -S ../.. -B build $BUILD_CONFIG --log-level=DEBUG
143-
cmake --build build --target check-libint2compiler libint-library-generate
113+
cmake --build build --target check-libint2compiler
114+
115+
- name: Generate Libint library
116+
if: ${{ steps.skip_check.outputs.should_skip != 'true' }}
117+
shell: bash
118+
working-directory: ${{github.workspace}}/build/compiler
119+
run: |
120+
cmake --build build --target libint-library-generate
144121

CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,7 @@ message(STATUS "Showing option BUILD_TESTING: ${BUILD_TESTING}")
271271
# <<< Path >>>
272272

273273
######################## Process & Validate Options ###########################
274+
include(autocmake_safeguards)
274275
include(CheckFunctionExists)
275276
include(CheckIncludeFileCXX)
276277
include(FeatureSummary)
+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Downloaded from
2+
# https://github.com/coderefinery/autocmake/blob/master/modules/safeguards.cmake
3+
# * changed text of in-source message
4+
5+
#.rst:
6+
#
7+
# Provides safeguards against in-source builds and bad build types.
8+
#
9+
# Variables used::
10+
#
11+
# PROJECT_SOURCE_DIR
12+
# PROJECT_BINARY_DIR
13+
# CMAKE_BUILD_TYPE
14+
15+
if(${PROJECT_SOURCE_DIR} STREQUAL ${PROJECT_BINARY_DIR})
16+
message(FATAL_ERROR "In-source builds not allowed. Please run CMake from top directory and specify a build directory (e.g., cmake -S. -Bbuild).")
17+
endif()
18+
19+
string(TOLOWER "${CMAKE_BUILD_TYPE}" cmake_build_type_tolower)
20+
string(TOUPPER "${CMAKE_BUILD_TYPE}" cmake_build_type_toupper)
21+
22+
if(NOT cmake_build_type_tolower STREQUAL "debug" AND
23+
NOT cmake_build_type_tolower STREQUAL "release" AND
24+
NOT cmake_build_type_tolower STREQUAL "minsizerel" AND
25+
NOT cmake_build_type_tolower STREQUAL "relwithdebinfo")
26+
message(FATAL_ERROR "Unknown build type \"${CMAKE_BUILD_TYPE}\". Allowed values are Debug, Release, MinSizeRel, RelWithDebInfo (case-insensitive).")
27+
endif()

0 commit comments

Comments
 (0)