@@ -323,7 +323,6 @@ if(WIN32)
323323endif ()
324324simple_native_module ("_testmultiphase" )
325325simple_native_module ("_testsinglephase" )
326- simple_native_module ("_ctypes_test" )
327326
328327if (NOT WIN32 )
329328 ###################### BZIP2 ########################
@@ -358,6 +357,33 @@ target_compile_definitions(${TARGET_PYEXPAT} PRIVATE
358357 XML_DTD=1
359358)
360359
360+ ###################### CTYPES ######################
361+ native_module ("_ctypes_test" TRUE "${SRC_DIR} /modules/_ctypes/_ctypes_test.c" )
362+ set (CTYPES_SRC
363+ "${SRC_DIR} /modules/_ctypes/_ctypes.c"
364+ "${SRC_DIR} /modules/_ctypes/callbacks.c"
365+ "${SRC_DIR} /modules/_ctypes/callproc.c"
366+ "${SRC_DIR} /modules/_ctypes/cfield.c"
367+ "${SRC_DIR} /modules/_ctypes/ctypes.h"
368+ "${SRC_DIR} /modules/_ctypes/malloc_closure.c"
369+ "${SRC_DIR} /modules/_ctypes/stgdict.c"
370+ )
371+ native_module ("_ctypes" TRUE "${CTYPES_SRC} " )
372+ target_include_directories ("_ctypes" PUBLIC "${SRC_DIR} /modules/_ctypes" )
373+ if (WIN32 )
374+ target_compile_definitions ("_ctypes" PRIVATE
375+ MS_WIN32
376+ MS_WIN64
377+ _WIN64
378+ )
379+ else ()
380+ target_compile_definitions ("_ctypes" PRIVATE
381+ HAVE_DECL_RTLD_LOCAL
382+ HAVE_DECL_RTLD_GLOBAL
383+ )
384+ endif ()
385+
386+ ###################### LIBPYTHON ######################
361387target_sources (${TARGET_LIBPYTHON} PRIVATE ${SRC_FILES} )
362388target_include_directories (${TARGET_LIBPYTHON} PRIVATE
363389 "${SRC_DIR} /include/internal"
0 commit comments