Skip to content

Commit 9437877

Browse files
alexmalyshevfacebook-github-bot
authored andcommitted
Only build borrowed generators code for relevant Python version in CMake
Summary: Currently CMake tries to build all of them. Reviewed By: yoney Differential Revision: D78677223 fbshipit-source-id: bbfd3f9b43eedd75ff43307e86d30f6a03db5ee4
1 parent f36416b commit 9437877

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,11 @@ target_link_libraries(static-python PRIVATE fmt::fmt common borrowed)
259259
# Jit/
260260

261261
file(GLOB_RECURSE JIT_SOURCES ${PROJECT_SOURCE_DIR}/Jit/*.cpp ${PROJECT_SOURCE_DIR}/Jit/*.c)
262+
list(FILTER JIT_SOURCES EXCLUDE REGEX ".*\.gen_cached\.c")
263+
if (${PY_VERSION} EQUAL 3.12 OR ${PY_VERSION} EQUAL 3.14)
264+
list(APPEND JIT_SOURCES "${PROJECT_SOURCE_DIR}/Jit/generators_borrowed_${PY_VERSION}.gen_cached.c")
265+
endif()
266+
262267
add_library(jit ${JIT_SOURCES})
263268
target_link_libraries(jit PRIVATE asmjit::asmjit interpreter fmt::fmt nlohmann_json::nlohmann_json)
264269

0 commit comments

Comments
 (0)