diff --git a/docker/bash.sh b/docker/bash.sh index a5dec23f91ad..a3d57bfd42c0 100755 --- a/docker/bash.sh +++ b/docker/bash.sh @@ -94,6 +94,10 @@ Usage: docker/bash.sh [-i|--interactive] [--net=host] [-t|--tty] Print the docker command to be run, but do not execute it. +--build-dir BUILD_DIR + + The build directory of TVM. This is appended to LD_LIBRARY_PATH + --env Pass an environment variable through to the container. @@ -267,6 +271,11 @@ while (( $# )); do shift ;; + --build-dir) + DOCKER_ENV+=( --env LD_LIBRARY_PATH=${REPO_MOUNT_POINT}/${2}) + shift 2 + ;; + --) shift COMMAND=( "$@" ) diff --git a/tests/scripts/task_build.py b/tests/scripts/task_build.py index 21560b4b1416..5fbc22aa297d 100755 --- a/tests/scripts/task_build.py +++ b/tests/scripts/task_build.py @@ -37,6 +37,7 @@ parser.add_argument("--sccache-region", required=False, help="sccache region") parser.add_argument("--build-dir", default="build", help="build folder") parser.add_argument("--cmake-target", help="optional build target") + parser.add_argument("--debug", required=False, action="store_true", help="build in debug mode") args = parser.parse_args() env = {"VTA_HW_PATH": str(Path(os.getcwd()) / "3rdparty" / "vta-hw")} @@ -82,7 +83,10 @@ if build_platform == "i386": sh.run("cmake ..", cwd=build_dir) else: - sh.run("cmake -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo ..", cwd=build_dir) + if args.debug: + sh.run("cmake -GNinja -DCMAKE_BUILD_TYPE=Debug ..", cwd=build_dir) + else: + sh.run("cmake -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo ..", cwd=build_dir) target = "" if args.cmake_target: