Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 5b7aa17d55
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 68 lines (56 sloc) 1.423 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
cmake_minimum_required(VERSION 2.6)

project(FastPy)
set(FastPy_VERSION_MAJOR 0)
set(FastPy_VERSION_MINOR 1)

set(SRCS
  src/Constant.cc
  src/Type.cc
  src/constants.cc
  src/variables.cc
  src/Code.cc
  src/Marshal.cc
  src/Function.cc
  src/BasicBlock.cc
  src/OperandStack.cc
  src/Instruction.cc
  src/instructions.cc
  src/Module.cc
  src/LJ_Codegen.cc
  src/LLVM_Codegen.cc
  src/LLVM_Support.cc
  src/PyRuntime.cc
  src/Object.cc
  src/Exception.cc
  src/Traceback.cc
  src/db.cc
  src/demangle.cc
)

find_library(LIBJIT jit)
find_path(LIBJIT_INC jit/jit.h)

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake)

find_package(Python)
find_package(Readline)
find_package(LLVM)

include_directories(${LIBJIT_INC})
include_directories(include)
if(READLINE_FOUND)
  include_directories(${READLINE_INCLUDE_DIR})
endif()
if(PYTHONLIBS_FOUND)
  include_directories(${PYTHON_INCLUDE_DIR})
endif()

if(LLVM_FOUND)
  add_definitions(-DWITH_LLVM=1 ${LLVM_CFLAGS})
endif()
if(READLINE_FOUND AND PYTHONLIBS_FOUND)
  add_definitions(-DREPL=1)
  set(SRCS ${SRCS} src/repl.cc src/repl_readline.cc)
endif()


add_executable(fastpy src/main.cc ${SRCS})
target_link_libraries(fastpy ${LIBJIT} ${LLVM_JIT_LIBS} pthread dl util)


if(LLVM_FOUND)
  target_link_libraries(fastpy ${LLVM_LFLAGS})
endif()
if(READLINE_FOUND AND PYTHONLIBS_FOUND)
  target_link_libraries(fastpy ${PYTHON_LIBRARY} ${READLINE_LIBRARY})
endif()
Something went wrong with that request. Please try again.