File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 1
1
"""The build script for mlc4j (MLC LLM and tvm4j)"""
2
2
3
3
import argparse
4
+ import json
4
5
import os
5
6
import subprocess
6
7
import sys
@@ -93,7 +94,9 @@ def main(mlc_llm_source_dir: Path):
93
94
if "TVM_SOURCE_DIR" in os .environ :
94
95
logger .info ('Set TVM_SOURCE_DIR to "%s"' , os .environ ["TVM_SOURCE_DIR" ])
95
96
with open ("config.cmake" , "w" , encoding = "utf-8" ) as file :
96
- print ("set(TVM_SOURCE_DIR %s)" % os .environ ["TVM_SOURCE_DIR" ], file = file )
97
+ # We use "json.dumps" to escape backslashes and quotation marks
98
+ tvm_source_dir_str_with_escape = json .dumps (os .environ ["TVM_SOURCE_DIR" ])
99
+ print ("set(TVM_SOURCE_DIR %s)" % tvm_source_dir_str_with_escape , file = file )
97
100
98
101
# - Run cmake, build and install
99
102
run_cmake (mlc_llm_source_dir / "android" / "mlc4j" )
You can’t perform that action at this time.
0 commit comments