Skip to content
Snippets Groups Projects
Commit fbfb939b authored by Henke Adolfsson's avatar Henke Adolfsson
Browse files

Remove old cpp files and return path relative to cwd

parent 8ac62e7e
No related branches found
No related tags found
No related merge requests found
...@@ -94,15 +94,19 @@ def CompileCpp(bus, problemname): ...@@ -94,15 +94,19 @@ def CompileCpp(bus, problemname):
os.chdir(old_cwd) os.chdir(old_cwd)
return return
if os.path.exists(output_binary): if os.path.exists(output_binary):
os.chdir(old_cwd) os.chdir(old_cwd)
# Remove unused files
for path in paths:
os.remove(path)
bus.call('kattcmd:compile:cpp-compiled', output_binary) bus.call('kattcmd:compile:cpp-compiled', output_binary)
return output_binary relative_path = os.path.join('build', problemname, output_binary)
return relative_path
else: else:
os.chdir(old_cwd) os.chdir(old_cwd)
bus.call('kattcmd:compile:cpp-compile-failed', compile_command) bus.call('kattcmd:compile:cpp-compile-failed', compile_command)
def FindCppCompileCommand(bus): def FindCppCompileCommand(bus):
'''Returns either the user-set compile command or the default one.''' '''Returns either the user-set compile command or the default one.'''
default_compile = 'g++ -std=c++14 -O2 -pedantic -Wall FILES -o BINARY' default_compile = 'g++ -std=c++14 -O2 -pedantic -Wall FILES -o BINARY'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment