Commit 6ddb4240 authored by Daniel Agar's avatar Daniel Agar

cmake add all headers as dependencies for inlined code

-fixes #339
parent 39859d79
...@@ -37,8 +37,12 @@ ...@@ -37,8 +37,12 @@
# adapted from https://github.com/shadow/shadow/blob/master/cmake/LLVMTools.cmake # adapted from https://github.com/shadow/shadow/blob/master/cmake/LLVMTools.cmake
set(BC_INLINE_SRCS boxing.cpp dict.cpp link_forcer.cpp list.cpp tuple.cpp xrange.cpp) set(BC_INLINE_SRCS boxing.cpp dict.cpp link_forcer.cpp list.cpp tuple.cpp xrange.cpp)
include_directories(${CMAKE_SOURCE_DIR}/src) 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 CXX flags # set CXX flags
set(BC_CXX_FLAGS "") set(BC_CXX_FLAGS "")
if(${CMAKE_BUILD_TYPE} STREQUAL "Debug") if(${CMAKE_BUILD_TYPE} STREQUAL "Debug")
...@@ -72,7 +76,7 @@ foreach(BC_SRC ${BC_INLINE_SRCS}) ...@@ -72,7 +76,7 @@ foreach(BC_SRC ${BC_INLINE_SRCS})
# generate the bitcode for this file # generate the bitcode for this file
add_custom_command(OUTPUT ${BC_SRC_BASENAME}.bc 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 ${LLVM_TOOLS_BINARY_DIR}/clang++ ${BC_DEFINES} ${BC_CXX_FLAGS} ${BC_INCLUDES} -c ${BC_SRC_FULLPATH} -o ${BC_SRC_BASENAME}.bc -emit-llvm
DEPENDS ${BC_SRC_FULLPATH} clang DEPENDS ${BC_SRC_FULLPATH} clang ${PYSTON_HEADERS} ${FROM_CPYTHON_HEADERS}
COMMENT "Building LLVM bitcode ${BC_SRC_BASENAME}.bc" COMMENT "Building LLVM bitcode ${BC_SRC_BASENAME}.bc"
VERBATIM) VERBATIM)
set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES ${BC_SRC_BASENAME}.bc) set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES ${BC_SRC_BASENAME}.bc)
......
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