Commit 6678d9f4 authored by Daniel Agar's avatar Daniel Agar

add libpypa as cmake subproject

parent ee038aff
......@@ -74,15 +74,7 @@ ExternalProject_Add(libunwind
LOG_INSTALL ON)
# libpypa
ExternalProject_Add(libpypa
PREFIX libpypa
SOURCE_DIR ${CMAKE_SOURCE_DIR}/libpypa
UPDATE_COMMAND autoreconf -ivf
CONFIGURE_COMMAND ${CMAKE_SOURCE_DIR}/libpypa/configure --prefix=${CMAKE_BINARY_DIR}/libpypa
LOG_UPDATE ON
LOG_CONFIGURE ON
LOG_BUILD ON
LOG_INSTALL ON)
add_subdirectory(libpypa)
# valgrind
if(ENABLE_VALGRIND)
......@@ -119,7 +111,6 @@ include_directories(${LLVM_INCLUDE_DIRS})
include_directories(include)
find_package(LibLZMA REQUIRED)
link_directories(${CMAKE_BINARY_DIR}/libpypa/lib)
link_directories(${CMAKE_BINARY_DIR}/libunwind/lib)
link_directories(${LLVM_LIBRARY_DIRS})
......@@ -130,7 +121,7 @@ add_subdirectory(test/unittests)
add_subdirectory(tools)
add_executable(pyston $<TARGET_OBJECTS:PYSTON_MAIN_OBJECT> $<TARGET_OBJECTS:PYSTON_OBJECTS> $<TARGET_OBJECTS:FROM_CPYTHON_OBJECTS>)
target_link_libraries(pyston stdlib pthread m readline gmp unwind pypa ${LLVM_LIBS} ${LIBLZMA_LIBRARIES})
target_link_libraries(pyston stdlib pthread m readline gmp unwind pypa double-conversion ${LLVM_LIBS} ${LIBLZMA_LIBRARIES})
# copy the python standard library (lib_python/2.7) and src/codegen/parse_ast.py to the build directory
add_custom_command(TARGET pyston POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/lib_python/2.7 ${CMAKE_BINARY_DIR}/lib_python/2.7)
......
......@@ -6,7 +6,6 @@ execute_process(COMMAND git rev-parse HEAD WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
set_source_files_properties(jit.cpp PROPERTIES COMPILE_DEFINITIONS "GITREV=${GITREV}")
include_directories(${CMAKE_BINARY_DIR})
include_directories(${CMAKE_BINARY_DIR}/libpypa/include)
include_directories(${CMAKE_BINARY_DIR}/libunwind/include)
file(GLOB ANALYSIS_SRCS analysis/*.cpp)
......@@ -21,7 +20,7 @@ file(GLOB RUNTIME_BUILTIN_MODULES_SRCS runtime/builtin_modules/*.cpp)
file(GLOB RUNTIME_SRCS runtime/*.cpp)
add_library(PYSTON_OBJECTS OBJECT codegen/profiling/profiling.cpp ${ANALYSIS_SRCS} ${ASM_WRITING_SRCS} ${CAPI_SRCS} ${CODEGEN_SRCS} ${CODEGEN_IRGEN_SRCS} ${CODEGEN_OPT_SRCS} ${CORE_SRCS} ${GC_SRCS} ${RUNTIME_BUILTIN_MODULES_SRCS} ${RUNTIME_SRCS})
add_dependencies(PYSTON_OBJECTS libunwind libpypa ${LLVM_LIBS})
add_dependencies(PYSTON_OBJECTS libunwind pypa ${LLVM_LIBS})
add_library(PYSTON_MAIN_OBJECT OBJECT jit.cpp)
add_dependencies(PYSTON_MAIN_OBJECT ${LLVM_LIBS})
......
......@@ -9,7 +9,7 @@ add_custom_target(unittests)
macro(add_unittest unittest)
add_executable(${unittest}_unittest EXCLUDE_FROM_ALL ${unittest}.cpp $<TARGET_OBJECTS:PYSTON_OBJECTS> $<TARGET_OBJECTS:FROM_CPYTHON_OBJECTS>)
target_link_libraries(${unittest}_unittest stdlib gmp readline pypa unwind gtest gtest_main ${LLVM_LIBS} ${LIBLZMA_LIBRARIES})
target_link_libraries(${unittest}_unittest stdlib gmp readline pypa double-conversion unwind gtest gtest_main ${LLVM_LIBS} ${LIBLZMA_LIBRARIES})
add_dependencies(${unittest}_unittest gtest gtest_main)
add_dependencies(unittests ${unittest}_unittest)
endmacro()
......
......@@ -9,5 +9,5 @@ add_dependencies(publicize ${LLVM_LIBS_EXTRA})
include_directories(${CMAKE_SOURCE_DIR}/src)
add_executable(astprint EXCLUDE_FROM_ALL astprint.cpp $<TARGET_OBJECTS:PYSTON_OBJECTS> $<TARGET_OBJECTS:FROM_CPYTHON_OBJECTS>)
target_link_libraries(astprint stdlib gmp readline pypa unwind ${LLVM_LIBS} ${LIBLZMA_LIBRARIES})
target_link_libraries(astprint stdlib gmp readline pypa double-conversion unwind ${LLVM_LIBS} ${LIBLZMA_LIBRARIES})
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment