Update project files to build with libuv and the timer module
This commit is contained in:
+21
-4
@@ -22,6 +22,25 @@ def ensure_dir(dir):
|
||||
|
||||
os.makedirs(dir)
|
||||
|
||||
def rmtree_onerror(func, path, exc_info):
|
||||
"""
|
||||
Error handler for ``shutil.rmtree``.
|
||||
|
||||
If the error is due to an access error (read only file)
|
||||
it attempts to add write permission and then retries.
|
||||
|
||||
If the error is for another reason it re-raises the error.
|
||||
|
||||
Usage : ``shutil.rmtree(path, onerror=rmtree_onerror)``
|
||||
"""
|
||||
import stat
|
||||
if not os.access(path, os.W_OK):
|
||||
# Is the error an access error?
|
||||
os.chmod(path, stat.S_IWUSR)
|
||||
func(path)
|
||||
else:
|
||||
raise
|
||||
|
||||
|
||||
def download_libuv():
|
||||
"""Clones libuv into build/libuv and checks out the right version."""
|
||||
@@ -30,7 +49,7 @@ def download_libuv():
|
||||
# version number in this script changes.
|
||||
if os.path.isdir(LIB_UV_DIR):
|
||||
print("Cleaning output directory...")
|
||||
shutil.rmtree(LIB_UV_DIR)
|
||||
shutil.rmtree(LIB_UV_DIR, onerror=rmtree_onerror)
|
||||
|
||||
ensure_dir("build")
|
||||
|
||||
@@ -84,9 +103,7 @@ def build_libuv_linux():
|
||||
|
||||
|
||||
def build_libuv_windows():
|
||||
# TODO: Implement me!
|
||||
print("Building for Windows not implemented yet.")
|
||||
sys.exit(1)
|
||||
run(["cmd", "/c", "vcbuild.bat", "release"], cwd=LIB_UV_DIR)
|
||||
|
||||
|
||||
def build_libuv():
|
||||
|
||||
Reference in New Issue
Block a user