4
4
# This source code is licensed under the BSD-style license found in the
5
5
# LICENSE file in the root directory of this source tree.
6
6
7
+
7
8
SET (INTERPRETER_DIR "${DEPLOY_DIR} /interpreter" )
8
9
SET (INTERPRETER_DIR "${DEPLOY_DIR} /interpreter" PARENT_SCOPE)
9
10
@@ -48,15 +49,18 @@ include(GoogleTest)
48
49
# We find the built python modules, this is confusing because python build already outputs
49
50
# the modules in a strange nested path, and then that path is relative to the
50
51
# Cmake ExternalProject root in the cmake build dir.
52
+ ## From test devsrvr
51
53
ExternalProject_Get_property(cpython SOURCE_DIR)
52
54
SET (PYTHON_MODULE_DIR "${SOURCE_DIR} /build/temp.linux-x86_64-${CPYTHON_VERSION} /${SOURCE_DIR} /Modules" )
53
55
SET (PYTHON_STDLIB_DIR "${SOURCE_DIR} /Lib" )
54
56
SET (PYTHON_STDLIB "${PYTHON_INSTALL_DIR} /lib/libpython_stdlib${CPYTHON_VERSION} .a" )
55
57
56
- if (${CPYTHON_VERSION} MATCHES "3\. [8-9] " )
58
+ if (${CPYTHON_VERSION} MATCHES "3\. (7|8) " )
57
59
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]*)" )
59
62
SET (PYTHON_MEM_MODULE "${PYTHON_MODULE_DIR} /_decimal/libmpdec/mpalloc.o" )
63
+ SET (LEGACY_PARSER_MODULE "" )
60
64
endif ()
61
65
62
66
# Then we use a hardcoded list of expected module names and include them in our lib
@@ -66,9 +70,10 @@ ExternalProject_Add_Step(
66
70
archive_stdlib
67
71
DEPENDEES install
68
72
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}
70
74
VERBATIM
71
75
)
76
+
72
77
# Get python typing extension, needed by torch
73
78
SET (TYPING_PKG "${INTERPRETER_DIR} /third_party/typing_extensions.py" )
74
79
ExternalProject_Add(
0 commit comments