Commit 9c3659f7 authored by Kevin Modzelewski's avatar Kevin Modzelewski

In CMake, copy the stdlib over if they get changed

My first stab at writing CMake rules
parent b9e2852f
......@@ -749,10 +749,10 @@ $(call link,_release,$(OPT_OBJS),$(LDFLAGS_RELEASE),$(LLVM_RELEASE_DEPS))
else
.PHONY: pyston_dbg pyston_release
pyston_dbg:
$(NINJA) -C $(HOME)/pyston-build-dbg pyston $(NINJAFLAGS)
$(NINJA) -C $(HOME)/pyston-build-dbg pyston copy_stdlib $(NINJAFLAGS)
ln -sf $(HOME)/pyston-build-dbg/pyston pyston_dbg
pyston_release:
$(NINJA) -C $(HOME)/pyston-build-release pyston $(NINJAFLAGS)
$(NINJA) -C $(HOME)/pyston-build-release pyston copy_stdlib $(NINJAFLAGS)
ln -sf $(HOME)/pyston-build-release/pyston pyston_release
endif
......
# Copy any changed stdlib files to the destination:
file(GLOB_RECURSE STDLIB_SRCS 2.7/ "*.py")
SET(STDLIB_TARGETS "")
foreach(STDLIB_FILE ${STDLIB_SRCS})
file(RELATIVE_PATH FN_REL ${CMAKE_SOURCE_DIR} ${STDLIB_FILE})
set(TARGET ${CMAKE_BINARY_DIR}/${FN_REL})
add_custom_command(OUTPUT ${TARGET} COMMAND
${CMAKE_COMMAND} -E copy_if_different ${STDLIB_FILE} ${TARGET}
DEPENDS ${STDLIB_FILE}
COMMENT "Copying ${FN_REL}"
)
set(STDLIB_TARGETS ${STDLIB_TARGETS} ${TARGET})
endforeach(STDLIB_FILE)
add_custom_target(copy_stdlib ALL DEPENDS ${STDLIB_TARGETS})
# compile specified files in lib_python/2.7_Modules
file(GLOB_RECURSE STDMODULE_SRCS 2.7_Modules errnomodule.c shamodule.c sha256module.c sha512module.c _math.c mathmodule.c md5.c md5module.c _randommodule.c _sre.c operator.c binascii.c pwdmodule.c posixmodule.c)
......
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