44# This source code is licensed under the BSD-style license found in the
55# LICENSE file in the root directory of this source tree.
66
7+
78SET (INTERPRETER_DIR "${DEPLOY_DIR} /interpreter" )
89SET (INTERPRETER_DIR "${DEPLOY_DIR} /interpreter" PARENT_SCOPE)
910
@@ -48,15 +49,18 @@ include(GoogleTest)
4849# We find the built python modules, this is confusing because python build already outputs
4950# the modules in a strange nested path, and then that path is relative to the
5051# Cmake ExternalProject root in the cmake build dir.
52+ ## From test devsrvr
5153ExternalProject_Get_property(cpython SOURCE_DIR)
5254SET (PYTHON_MODULE_DIR "${SOURCE_DIR} /build/temp.linux-x86_64-${CPYTHON_VERSION} /${SOURCE_DIR} /Modules" )
5355SET (PYTHON_STDLIB_DIR "${SOURCE_DIR} /Lib" )
5456SET (PYTHON_STDLIB "${PYTHON_INSTALL_DIR} /lib/libpython_stdlib${CPYTHON_VERSION} .a" )
5557
56- if (${CPYTHON_VERSION} MATCHES "3\. [8-9] " )
58+ if (${CPYTHON_VERSION} MATCHES "3\. (7|8) " )
5759 SET (PYTHON_MEM_MODULE "${PYTHON_MODULE_DIR} /_decimal/libmpdec/memory.o" )
58- elseif (${CPYTHON_VERSION} MATCHES "3\. 1[0-1]" )
60+ SET (LEGACY_PARSER_MODULE "${PYTHON_MODULE_DIR} /parsermodule.o" )
61+ elseif (${CPYTHON_VERSION} MATCHES "3\. (9|1[0-9]*)" )
5962 SET (PYTHON_MEM_MODULE "${PYTHON_MODULE_DIR} /_decimal/libmpdec/mpalloc.o" )
63+ SET (LEGACY_PARSER_MODULE "" )
6064endif ()
6165
6266# Then we use a hardcoded list of expected module names and include them in our lib
@@ -66,9 +70,10 @@ ExternalProject_Add_Step(
6670 archive_stdlib
6771 DEPENDEES install
6872 BYPRODUCTS ${PYTHON_STDLIB}
69- COMMAND ar -rc ${PYTHON_STDLIB} ${PYTHON_MODULES} ${PYTHON_MEM_MODULE}
73+ COMMAND ar -rc ${PYTHON_STDLIB} ${PYTHON_MODULES} ${PYTHON_MEM_MODULE} ${LEGACY_PARSER_MODULE}
7074 VERBATIM
7175)
76+
7277# Get python typing extension, needed by torch
7378SET (TYPING_PKG "${INTERPRETER_DIR} /third_party/typing_extensions.py" )
7479ExternalProject_Add(
0 commit comments