# This profile ensures that pycanha-core and its dependencies are built in Release mode (for MSVC, GCC, CLANG or others)
[settings]
{% set detected_arch = "armv8" if platform.machine().lower() in ("arm64", "aarch64") else "x86_64" %}
arch = {{ detected_arch }}
build_type = Release

{% if platform.system()=="Windows" %}
compiler = msvc
compiler.runtime_type = Release
compiler.cppstd = 23
compiler.runtime = dynamic
# GitHub Actions windows-latest currently ships MSVC 19.4x (toolset 14.4x).
compiler.version = 194
os = Windows

{% elif platform.system()=="Darwin" %}
# macOS with Apple Clang
compiler = apple-clang
compiler.cppstd = 23
compiler.libcxx = libc++
compiler.version = 17.0
os = Macos

[buildenv]
CC = clang
CXX = clang++

{% else %}
# Linux gcc
compiler = gcc
compiler.cppstd = 23
compiler.libcxx = libstdc++11
compiler.version = 14
os = Linux

[buildenv]
# gcc-13 was working fine until an update to the github ubuntu runner (I think). Now it
# compiles the wheel with a too recent version of glibc, which is not compatible with
# manylinux wheels. So I'm using gcc-14 for now. To check the compatibility of the wheel
# with manylinux, you can use the auditwheel tool.
CC = gcc-14
CXX = g++-14

{% endif %}
