diff --git a/csibe.py b/csibe.py index f291a5f..b138d8b 100755 --- a/csibe.py +++ b/csibe.py @@ -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, @@ -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( @@ -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) @@ -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( @@ -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: