Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions compiler/one-cmds/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
# NOTE find_package try to use at least python3.8 as follows depending on platform version
# Ubuntu18.04; explictly installed python3.8 (default is python3.6)
# Ubuntu20.04; default python3.8
# NOTE find_package will try to use at least python3.10 as follows depending on platform version
# Ubuntu20.04; explictly installed python3.10 (default is python3.8)
# Ubuntu22.04; default python3.10
# Ubuntu24.04; explicitly installed python3.8 (default is python3.12)
# refer https://github.com/Samsung/ONE/issues/9962
find_package(Python 3.8 EXACT COMPONENTS Interpreter QUIET)
# refer https://github.com/Samsung/ONE/issues/15226
find_package(Python 3.10 EXACT COMPONENTS Interpreter QUIET)
if(NOT Python_FOUND)
find_package(Python 3.8 COMPONENTS Interpreter QUIET)
find_package(Python 3.10 COMPONENTS Interpreter QUIET)
endif()

if(NOT Python_Interpreter_FOUND)
message(STATUS "Build one-cmds: FAILED (Python3 is missing)")
return()
endif()

# NOTE assume only use 3.8.x or 3.10.x or 3.12.x
# NOTE assume only use 3.10.x or 3.12.x
# NOTE PYTHON_VERSION_MINOR is not used but added for consistancy with common-artifacts and dalgona
if((Python_VERSION VERSION_GREATER_EQUAL 3.8) AND (Python_VERSION VERSION_LESS 3.9))
set(PYTHON_VERSION_MINOR 8)
elseif((Python_VERSION VERSION_GREATER_EQUAL 3.10) AND (Python_VERSION VERSION_LESS 3.11))
if((Python_VERSION VERSION_GREATER_EQUAL 3.10) AND (Python_VERSION VERSION_LESS 3.11))
set(PYTHON_VERSION_MINOR 10)
elseif((Python_VERSION VERSION_GREATER_EQUAL 3.12) AND (Python_VERSION VERSION_LESS 3.13))
set(PYTHON_VERSION_MINOR 12)
Expand Down