diff --git a/llvm/projects/hpvm-tensor-rt/code_autogenerators/cmakelists_generator.py b/llvm/projects/hpvm-tensor-rt/code_autogenerators/cmakelists_generator.py index 1da7cb5697d1ed5c0dae301264342b35e4d3379a..04f6c5eec378276cd0c89fcc7013cb6996a90f2f 100644 --- a/llvm/projects/hpvm-tensor-rt/code_autogenerators/cmakelists_generator.py +++ b/llvm/projects/hpvm-tensor-rt/code_autogenerators/cmakelists_generator.py @@ -41,7 +41,8 @@ def generate_cmakelists_setup(cmakelists_file): elif line.startswith("#"): continue - elif line.find("/") != -1: #line.find("../") != -1 or line.find("./") != -1: + # Special case: ignore / if -I flag exists + elif line.find("/") != -1 and line.find("-I") == -1: dot_dot_slash_ind = line.find("../") dot_slash_ind = line.find("./") if dot_dot_slash_ind != -1: @@ -66,30 +67,9 @@ def generate_cmakelists_setup(cmakelists_file): new_path = os.path.join(BASE_CMAKELISTS_PATH, old_rel_path) cmakelists_file.write(line.replace(old_rel_path, new_path)) continue - ''' - elif line.startswith("include_directories"): - old_rel_path = line[line.find("(") + 1: line.find(")")] - - # Not actually a rel path - if old_rel_path.find(".") == -1 and old_rel_path.find("..") == -1: - cmakelists_file.write(line) - else: - new_path = os.path.join(BASE_CMAKELISTS_PATH, old_rel_path) - cmakelists_file.write(line.replace(old_rel_path, new_path)) - continue - - elif line.startswith("find_library"): - find_lib_line += line - if line.endswith(")"): - - find_lib_line = "" - else: - continue - ''' cmakelists_file.write(line) base_cmakelists_file.close() - # include_directoryes - # find_library + def generate_cmakelists_file(cmakelists_file, source_file_dirs): generate_cmakelists_setup(cmakelists_file)