7272 )
7373endif
7474
75- # Cython allows the creation of a "shared" file for some of their datastructures
76- # See https://cython.readthedocs.io/en/latest/src/userguide/source_files_and_compilation.html#shared-module
77- py.extension_module(
78- ' _cyutility' ,
79- custom_target (
80- output : ' _cyutility.c' ,
81- command : [meson .get_compiler(' cython' ).cmd_array()[0 ], ' --generate-shared' , ' @OUTPUT0@' ],
82- ),
83- install : true ,
84- install_rpath : ' $ORIGIN' ,
85- subdir : ' dwave/optimization/' ,
86- )
87-
8875py.extension_module(
8976 ' _model' ,
9077 ' dwave/optimization/_model.pyx' ,
@@ -93,7 +80,7 @@ py.extension_module(
9380 install : true ,
9481 install_rpath : ' $ORIGIN' ,
9582 override_options : [' cython_language=cpp' ],
96- cython_args : [' --shared=dwave.optimization._cyutility ' ],
83+ cython_args : [' -Xfreethreading_compatible=True ' ],
9784 subdir : ' dwave/optimization/' ,
9885)
9986
@@ -105,7 +92,7 @@ py.extension_module(
10592 install : true ,
10693 install_rpath : ' $ORIGIN' ,
10794 override_options : [' cython_language=cpp' ],
108- cython_args : [' --shared=dwave.optimization._cyutility ' ],
95+ cython_args : [' -Xfreethreading_compatible=True ' ],
10996 subdir : ' dwave/optimization/' ,
11097)
11198
@@ -117,7 +104,7 @@ py.extension_module(
117104 install : true ,
118105 install_rpath : ' $ORIGIN' ,
119106 override_options : [' cython_language=cpp' ],
120- cython_args : [' --shared=dwave.optimization._cyutility ' ],
107+ cython_args : [' -Xfreethreading_compatible=True ' ],
121108 subdir : ' dwave/optimization/' ,
122109)
123110
@@ -128,7 +115,7 @@ py.extension_module(
128115 install : true ,
129116 install_rpath : ' $ORIGIN' ,
130117 override_options : [' cython_language=cpp' ],
131- # cython_args : ['--shared=dwave.optimization._cyutility '], # throws compiler warnings as of May 2025
118+ cython_args : [' -Xfreethreading_compatible=True ' ],
132119 subdir : ' dwave/optimization/' ,
133120)
134121
0 commit comments