include(HandleLLVMOptions)
# Verify that we can find a Python 2 interpreter. Python 3 is unsupported.
- set(Python_ADDITIONAL_VERSIONS 2.7 2.6 2.5)
- include(FindPythonInterp)
- if( NOT PYTHONINTERP_FOUND )
- message(FATAL_ERROR
- "Unable to find Python interpreter, required for builds and testing.
-
- Please install Python or specify the PYTHON_EXECUTABLE CMake variable.")
+ if (PYTHON_EXECUTABLE STREQUAL "")
+ set(Python_ADDITIONAL_VERSIONS 2.7 2.6 2.5)
+ include(FindPythonInterp)
+ if( NOT PYTHONINTERP_FOUND )
+ message(FATAL_ERROR
+ "Unable to find Python interpreter, required for builds and testing.
+ Please install Python or specify the PYTHON_EXECUTABLE CMake variable.")
+ endif()
+ else()
+ message("-- Found PythonInterp: ${PYTHON_EXECUTABLE}")
endif()
-
# Import CMake library targets from LLVM and Clang.
include("${LLDB_PATH_TO_LLVM_BUILD}/share/llvm/cmake/LLVMConfig.cmake")
include("${LLDB_PATH_TO_CLANG_BUILD}/share/clang/cmake/ClangConfig.cmake")
set(CMAKE_LIBRARY_ARCHITECTURE "x86_64-linux-gnu")
endif()
endif()
- find_package(PythonLibs REQUIRED)
- include_directories(${PYTHON_INCLUDE_DIRS})
+ if (MSVC)
+ if (PYTHON_INCLUDE_DIR STREQUAL "" OR PYTHON_LIBRARY STREQUAL "")
+ message(FATAL_ERROR "Building on MSVC requires manual specification of "
+ "PYTHON_INCLUDE_DIR and PYTHON_LIBRARY")
+ else()
+ message("-- Found PythonLibs: ${PYTHON_LIBRARY}")
+ include_directories(${PYTHON_INCLUDE_DIR})
+ endif()
+ else()
+ find_package(PythonLibs REQUIRED)
+ include_directories(${PYTHON_INCLUDE_DIRS})
+ endif()
endif()
include_directories(../clang/include)
${LLDB_VERS_GENERATED_FILE}
)
+
if ( CMAKE_SYSTEM_NAME MATCHES "Windows" )
-target_link_libraries(liblldb PRIVATE lldbAPI)
+ target_link_libraries(liblldb PRIVATE lldbAPI)
+ # Only MSVC has the ABI compatibility and avoids using FindPythonLibs,
+ # so only it needs to explicitly link against ${PYTHON_LIBRARY}
+ if (MSVC)
+ target_link_libraries(liblldb PRIVATE ${PYTHON_LIBRARY})
+ endif()
-set_target_properties(liblldb
- PROPERTIES
- OUTPUT_NAME liblldb
- VERSION ${LLDB_VERSION}
- )
+ set_target_properties(liblldb
+ PROPERTIES
+ OUTPUT_NAME liblldb
+ VERSION ${LLDB_VERSION}
+ )
else()
-set_target_properties(liblldb
- PROPERTIES
- OUTPUT_NAME lldb
- VERSION ${LLDB_VERSION}
- )
+ set_target_properties(liblldb
+ PROPERTIES
+ OUTPUT_NAME lldb
+ VERSION ${LLDB_VERSION}
+ )
endif()
if (LLDB_WRAP_PYTHON OR LLDB_VERS_GENERATED_FILE)