Skip to content
Prev Previous commit
Next Next commit
Fix aliasing for chapter names
  • Loading branch information
PeanutbutterWarrior committed Dec 1, 2021
commit 7ac66c72e73dfcf20e7fc74191f01d328f014eab
3 changes: 2 additions & 1 deletion sconscripts/asm-x64_SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ Import('files_to_compile env')

for file_info in files_to_compile:
build_target = f'#/build/{file_info.language}/{file_info.chapter}/{file_info.path.stem}'
env.X64(build_target, str(file_info.path), LINKFLAGS='-no-pie')
build_result = env.X64(build_target, str(file_info.path), LINKFLAGS='-no-pie')
env.Alias(str(file_info.chapter), build_result)
7 changes: 2 additions & 5 deletions sconscripts/c_SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,5 @@ Import('files_to_compile env')

for file_info in files_to_compile:
build_target = f'#/build/{file_info.language}/{file_info.chapter}/{file_info.path.stem}'

env.C(build_target, str(file_info.path))
# Gives error e.g. when running 'scons flood_fill'
# scons: *** [flood_fill] Source `build\c\flood_fill\flood_fill' not found, needed by target `flood_fill'
env.Alias(str(file_info.chapter), build_target)
build_result = env.C(build_target, str(file_info.path))
env.Alias(str(file_info.chapter), build_result)
3 changes: 2 additions & 1 deletion sconscripts/cpp_SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ Import('files_to_compile env')

for file_info in files_to_compile:
build_target = f'#/build/{file_info.language}/{file_info.chapter}/{file_info.path.stem}'
env.CPlusPlus(build_target, str(file_info.path))
build_result = env.CPlusPlus(build_target, str(file_info.path))
env.Alias(str(file_info.chapter), build_result)
3 changes: 2 additions & 1 deletion sconscripts/fortran_SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ Import('files_to_compile env')

for file_info in files_to_compile:
build_target = f'#/build/{file_info.language}/{file_info.chapter}/{file_info.path.stem}'
env.Fortran(build_target, str(file_info.path))
build_result = env.Fortran(build_target, str(file_info.path))
env.Alias(str(file_info.chapter), build_result)
3 changes: 2 additions & 1 deletion sconscripts/go_SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ Import('files_to_compile env')

for file_info in files_to_compile:
build_target = f'#/build/{file_info.language}/{file_info.chapter}/{file_info.path.stem}'
env.Go(build_target, str(file_info.path))
build_result = env.Go(build_target, str(file_info.path))
env.Alias(str(file_info.chapter), build_result)
12 changes: 7 additions & 5 deletions sconscripts/rust_SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ Import('files_to_compile env')
for file_info in files_to_compile:
build_target = f'#/build/{file_info.language}/{file_info.chapter}/{file_info.path.stem}'
if (file_info.path.parent / 'Cargo.toml').exists():
env.cargo(target=build_target,
source=str(file_info.path),
MANIFEST=str(file_info.path.parent / 'Cargo.toml'),
SOURCE_DIR=str(file_info.path.parent))
build_result = env.cargo(target=build_target,
source=str(file_info.path),
MANIFEST=str(file_info.path.parent / 'Cargo.toml'),
SOURCE_DIR=str(file_info.path.parent))
env.Clean('rust', str(file_info.path.parent / 'target'))
else:
env.rustc(build_target, str(file_info.path))
build_result = env.rustc(build_target, str(file_info.path))
env.Clean('rust', f'{build_target}.pdb')

env.Alias(str(file_info.chapter), build_result)