Skip to content

Commit

Permalink
Style fix in csibe.py
Browse files Browse the repository at this point in the history
  • Loading branch information
loki04 committed Apr 20, 2016
1 parent c4d0ae9 commit 0b1ae9f
Showing 1 changed file with 27 additions and 27 deletions.
54 changes: 27 additions & 27 deletions csibe.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,19 @@ def __init__(self, csibe_path, build_path, toolchain_name, projects, flags):
self.cxxflags = []
self.rustcflags = []

if flags['cflags']:
self.cflags.extend(flags['cflags'])
if flags["cflags"]:
self.cflags.extend(flags["cflags"])

if flags['cxxflags']:
self.cxxflags.extend(flags['cxxflags'])
if flags["cxxflags"]:
self.cxxflags.extend(flags["cxxflags"])

if flags['rustcflags']:
self.rustcflags.extend(flags['rustcflags'])
if flags["rustcflags"]:
self.rustcflags.extend(flags["rustcflags"])

if flags['globalflags']:
self.cflags.extend(flags['globalflags'])
self.cxxflags.extend(flags['globalflags'])
self.rustcflags.extend(flags['globalflags'])
if flags["globalflags"]:
self.cflags.extend(flags["globalflags"])
self.cxxflags.extend(flags["globalflags"])
self.rustcflags.extend(flags["globalflags"])

self.toolchain_build_dir = os.path.join(
self.build_dir,
Expand All @@ -53,16 +53,16 @@ def __init__(self, csibe_path, build_path, toolchain_name, projects, flags):
self.cmake_toolchain_options = "-DCMAKE_TOOLCHAIN_FILE={}".format(self.toolchain_file_path)

if self.projects:
os.environ['CSiBE_SUBPROJECTS'] = " ".join(self.projects);
os.environ["CSiBE_SUBPROJECTS"] = " ".join(self.projects);

if self.cflags:
os.environ['CSiBE_CFLAGS'] = " ".join(self.cflags);
os.environ["CSiBE_CFLAGS"] = " ".join(self.cflags);

if self.cxxflags:
os.environ['CSiBE_CXXFLAGS'] = " ".join(self.cxxflags);
os.environ["CSiBE_CXXFLAGS"] = " ".join(self.cxxflags);

if self.rustcflags:
os.environ['CSiBE_RUSTCFLAGS'] = " ".join(self.rustcflags);
os.environ["CSiBE_RUSTCFLAGS"] = " ".join(self.rustcflags);

def run_cmake(self):
return subprocess.call(
Expand Down Expand Up @@ -110,14 +110,14 @@ def submodule_init_and_update(repository_path):

if __name__ == "__main__":

toolchains = ['native']
for item in os.listdir('toolchain-files'):
if item.endswith('.cmake'):
toolchains = ["native"]
for item in os.listdir("toolchain-files"):
if item.endswith(".cmake"):
toolchains.append(item[:-6])

projects = []
for item in os.listdir('src'):
if os.path.isdir(os.path.join('gen', item)):
for item in os.listdir("src"):
if os.path.isdir(os.path.join("gen", item)):
projects.append(item)

helpProjects = "\navailable project names:\n\t" + "\n\t".join(projects)
Expand Down Expand Up @@ -158,22 +158,22 @@ def submodule_init_and_update(repository_path):

parser.add_argument(
"--cflags",
action='append',
action="append",
help="compiler flags for C files")

parser.add_argument(
"--cxxflags",
action='append',
action="append",
help="compiler flags for CXX files")

parser.add_argument(
"--rustcflags",
action='append',
action="append",
help="compiler flags for Rust files")

parser.add_argument(
"--globalflags",
action='append',
action="append",
help="compiler flags for CXX files")

parser.add_argument(
Expand Down Expand Up @@ -210,10 +210,10 @@ def submodule_init_and_update(repository_path):

for target in targets_to_build:
builder = CSiBEBuilder(csibe_path, args.build_dir, target, projects_to_build,
{'cflags' : args.cflags,
'cxxflags' : args.cxxflags,
'rustcflags' : args.rustcflags,
'globalflags' : global_flags})
{"cflags" : args.cflags,
"cxxflags" : args.cxxflags,
"rustcflags" : args.rustcflags,
"globalflags" : global_flags})

cmake_return_value = builder.run_cmake()
if cmake_return_value:
Expand Down

0 comments on commit 0b1ae9f

Please sign in to comment.