From 0cb9ee4e0c3dc8b8e6c83aab7a2389375ec91cbc Mon Sep 17 00:00:00 2001 From: Darby Johnston Date: Thu, 10 Sep 2026 18:39:30 -0700 Subject: [PATCH] Make the Windows debug postfix a cache variable The "_d" postfix on Windows debug builds is what a debug Python interpreter looks for, but a debug build of OTIO is also loaded by a release interpreter: pybind11 undefines _DEBUG around Python.h unless Py_DEBUG is defined, so the modules are compiled against the release ABI. That interpreter looks only for the name without the postfix, and cannot import them: ModuleNotFoundError: No module named 'opentimelineio._opentime' The postfix was set with a plain set(), which nothing on the command line can override. As a cache variable it keeps "_d" by default, so a debug interpreter works as before, and can be set empty with -DOTIO_DEBUG_POSTFIX= for a release one. Signed-off-by: Darby Johnston --- CMakeLists.txt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ea11696ee..bff0c53b1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -192,10 +192,9 @@ else() endif() if(WIN32) - # Windows debug builds for Python require a d in order for the module to - # load. This also helps ensure that debug builds in general are matched - # to the Microsoft debug CRT. - set(OTIO_DEBUG_POSTFIX "_d") + # Windows builds for Python can use a postfix to find Debug versions. + set(OTIO_DEBUG_POSTFIX "_d" CACHE STRING + "Postfix for the names of debug libraries and Python modules") endif() set_property(GLOBAL PROPERTY USE_FOLDERS ON)