Closed wlya closed 4 years ago
I have faced the exactly problem... I've created a script to scan al *.h files in the directory (including subdirectories) "/skia/include" and change in all files every entry #include "reference" to #include "../../reference". In your example, this will change #include "include/codec/SkCodec.h" to #include "../../include/codec/SkCodec.h"
I also changed those references in SkCodecFuzzer/source/loader.cc to this:
Thank you so much. Your advice is very helpful.
Here's my python script. It's not elegant, but works:
import os
dir_to_traverse = os.getcwd()
user_input = input(
f"current working directory -- {dir_to_traverse}, continue? [y/n]")
if user_input != "y" and user_input != 'Y':
exit()
for path, dirs, files in os.walk(dir_to_traverse):
level = 1 + path.removeprefix(f"{dir_to_traverse}").count("/")
match_text = "#include \"include"
replace_text = "#include \"" + level * "../" + "include"
for filename in files:
if filename.endswith(".h"):
with open(f"{path}/{filename}", "r") as f:
text = f.read()
text = text.replace(match_text, replace_text)
with open(f"{path}/{filename}", "w") as f:
f.write(text)
Ubuntu16.04 LTS
all deps
modified Makefile