Skip to content

Commit 6090e21

Browse files
authored
Set CMake policies for cmake 3.27 (#2162)
* Use NEW version for any policy introduced up until 3.27. (Closes #2158) * Error on CMake dev warnings on GHA
1 parent fa69dd3 commit 6090e21

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# Build AMICI library
33
#
44
cmake_minimum_required(VERSION 3.15)
5+
cmake_policy(VERSION 3.15...3.27)
56

67
project(amici)
78

python/sdist/setup.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,9 @@ def get_extensions():
130130
source_dir="amici",
131131
cmake_configure_options=[
132132
*global_cmake_configure_options,
133+
"-Werror=dev"
134+
if "GITHUB_ACTIONS" in os.environ
135+
else "-Wno-error=dev",
133136
"-DAMICI_PYTHON_BUILD_EXT_ONLY=ON",
134137
f"-DPython3_EXECUTABLE={Path(sys.executable).as_posix()}",
135138
],
@@ -142,7 +145,9 @@ def main():
142145
# Readme as long package description to go on PyPi
143146
# (https://pypi.org/project/amici/)
144147
with open(
145-
os.path.join(os.path.dirname(__file__), "README.md"), "r", encoding="utf-8"
148+
os.path.join(os.path.dirname(__file__), "README.md"),
149+
"r",
150+
encoding="utf-8",
146151
) as fh:
147152
long_description = fh.read()
148153

src/CMakeLists.template.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Build AMICI model
22
cmake_minimum_required(VERSION 3.15)
3+
cmake_policy(VERSION 3.15...3.27)
34

45
project(TPL_MODELNAME)
56

0 commit comments

Comments
 (0)