Commit 8b77a541 authored by Daniel Agar's avatar Daniel Agar

cmake enable ccache for runtime inlined code

parent 6ddb4240
......@@ -43,6 +43,13 @@ include_directories(${CMAKE_SOURCE_DIR}/src)
file(GLOB_RECURSE PYSTON_HEADERS ${CMAKE_SOURCE_DIR}/src/*.h)
file(GLOB_RECURSE FROM_CPYTHON_HEADERS ${CMAKE_SOURCE_DIR}/from_cpython/*.h)
# set compiler
if(CCACHE)
set(BC_CXX ${CCACHE} ${LLVM_TOOLS_BINARY_DIR}/clang++)
else()
set(BC_CXX ${LLVM_TOOLS_BINARY_DIR}/clang++)
endif()
# set CXX flags
set(BC_CXX_FLAGS "")
if(${CMAKE_BUILD_TYPE} STREQUAL "Debug")
......@@ -75,7 +82,7 @@ foreach(BC_SRC ${BC_INLINE_SRCS})
# generate the bitcode for this file
add_custom_command(OUTPUT ${BC_SRC_BASENAME}.bc
COMMAND ${LLVM_TOOLS_BINARY_DIR}/clang++ ${BC_DEFINES} ${BC_CXX_FLAGS} ${BC_INCLUDES} -c ${BC_SRC_FULLPATH} -o ${BC_SRC_BASENAME}.bc -emit-llvm
COMMAND ${BC_CXX} ${BC_DEFINES} ${BC_CXX_FLAGS} ${BC_INCLUDES} -c ${BC_SRC_FULLPATH} -o ${BC_SRC_BASENAME}.bc -emit-llvm
DEPENDS ${BC_SRC_FULLPATH} clang ${PYSTON_HEADERS} ${FROM_CPYTHON_HEADERS}
COMMENT "Building LLVM bitcode ${BC_SRC_BASENAME}.bc"
VERBATIM)
......@@ -92,7 +99,7 @@ foreach(BC_SRC ${BC_INLINE_SRCS})
# compile into a regular object file
add_custom_command(OUTPUT ${BC_SRC_BASENAME}.o
COMMAND ${LLVM_TOOLS_BINARY_DIR}/clang++ ${BC_DEFINES} ${BC_CXX_FLAGS} ${BC_INCLUDES} -c ${BC_SRC_BASENAME}.pub.bc -o ${BC_SRC_BASENAME}.o
COMMAND ${BC_CXX} ${BC_DEFINES} ${BC_CXX_FLAGS} ${BC_INCLUDES} -c ${BC_SRC_BASENAME}.pub.bc -o ${BC_SRC_BASENAME}.o
DEPENDS ${BC_SRC_BASENAME}.pub.bc clang
COMMENT "Compiling ${BC_SRC_BASENAME}.pub.bc -> ${BC_SRC_BASENAME}.o"
VERBATIM)
......
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