Fix the source_lists not being found when using the -Y/--srcdir option.

This commit is contained in:
Pentarctagon 2020-08-01 03:50:52 -05:00
parent 0db9d4c1c1
commit f662cad825
2 changed files with 7 additions and 7 deletions

View file

@ -429,7 +429,7 @@ if env["prereqs"]:
for sql_config in ["mariadb_config", "mysql_config"]:
try:
mysql_config = check_output([sql_config, "--libs", "--cflags"]).decode("utf-8").replace("\n", " ").replace("-DNDEBUG", "")
mysql_flags = env.ParseFlags(mysql_config+"-Imodules/mariadbpp/include/")
mysql_flags = env.ParseFlags(mysql_config+"-I"+Dir("#/src/modules/mariadbpp/include/").rdir().abspath)
env.Append(CPPDEFINES = ["HAVE_MYSQLPP"])
env.MergeFlags(mysql_flags)
found_connector = True

View file

@ -11,16 +11,16 @@ Import("*")
#
def GetSources(src_location):
sources = []
source_list = File("#/source_lists/" + src_location)
module_dir = Dir("#/src/modules/"+src_location+"/src/")
source_list = File("#/source_lists/" + src_location).rfile()
module_dir = Dir("#/src/modules/"+src_location+"/src/").rdir()
if source_list.exists():
with open(source_list.rfile().abspath) as file:
if source_list.rexists():
with open(source_list.abspath) as file:
for line in file.readlines():
sources.append(line.strip())
elif module_dir.exists():
elif module_dir.rexists():
for cpp in module_dir.glob("*.cpp", strings=True):
sources.append("modules/"+src_location+"/src/"+cpp)
sources.append(module_dir.abspath+"/"+cpp)
else:
print("Unable to find source files for: "+src_location)
return sources