Skip to content

Commit

Permalink
Set CMake policies for cmake 3.27 (#2162)
Browse files Browse the repository at this point in the history
* Use NEW version for any policy introduced up until 3.27. (Closes #2158)
* Error on CMake dev warnings on GHA
  • Loading branch information
dweindl authored Aug 20, 2023
1 parent fa69dd3 commit 6090e21
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# Build AMICI library
#
cmake_minimum_required(VERSION 3.15)
cmake_policy(VERSION 3.15...3.27)

project(amici)

Expand Down
7 changes: 6 additions & 1 deletion python/sdist/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@ def get_extensions():
source_dir="amici",
cmake_configure_options=[
*global_cmake_configure_options,
"-Werror=dev"
if "GITHUB_ACTIONS" in os.environ
else "-Wno-error=dev",
"-DAMICI_PYTHON_BUILD_EXT_ONLY=ON",
f"-DPython3_EXECUTABLE={Path(sys.executable).as_posix()}",
],
Expand All @@ -142,7 +145,9 @@ def main():
# Readme as long package description to go on PyPi
# (https://pypi.org/project/amici/)
with open(
os.path.join(os.path.dirname(__file__), "README.md"), "r", encoding="utf-8"
os.path.join(os.path.dirname(__file__), "README.md"),
"r",
encoding="utf-8",
) as fh:
long_description = fh.read()

Expand Down
1 change: 1 addition & 0 deletions src/CMakeLists.template.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Build AMICI model
cmake_minimum_required(VERSION 3.15)
cmake_policy(VERSION 3.15...3.27)

project(TPL_MODELNAME)

Expand Down

0 comments on commit 6090e21

Please sign in to comment.