diff --git a/CMakeLists.txt b/CMakeLists.txt index b02d42746..4d384fa03 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,6 +25,11 @@ if(BUILD_MQT_QMAP_BINDINGS) ON CACHE BOOL "Prevent multiple searches for Python and instead cache the results.") + if(DISABLE_GIL) + message(STATUS "Disabling Python GIL") + add_compile_definitions(Py_GIL_DISABLED) + endif() + # top-level call to find Python find_package( Python 3.8 REQUIRED diff --git a/pyproject.toml b/pyproject.toml index b5d558f25..9f35fcb07 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -128,6 +128,13 @@ sdist.exclude = [ BUILD_MQT_QMAP_TESTS = "OFF" BUILD_MQT_QMAP_BINDINGS = "ON" +[[tool.scikit-build.overrides]] +if.python-version = ">=3.13" +if.abi-flags = "t" +if.platform-system = "win32" +inherit.cmake.define = "append" +cmake.define.DISABLE_GIL = "1" + [tool.check-sdist] sdist-only = ["src/mqt/qmap/_version.py"]