Skip to content

Commit

Permalink
remove {toolchain} prefix from gcc tools
Browse files Browse the repository at this point in the history
  • Loading branch information
aappleby committed Mar 8, 2024
1 parent ae1fb33 commit 6006a6b
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 10 deletions.
1 change: 0 additions & 1 deletion build.hancho
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
print("Building Matcheroni with Hancho")

if config.build_type is None: config.build_type = "debug"
if config.toolchain is None: config.toolchain = "x86_64-linux-gnu"

config.build_dir = "build/{build_type}"

Expand Down
2 changes: 0 additions & 2 deletions build.ninja
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
target=RELEASE
#target=SIZE

toolchain=x86_64-linux-gnu

include config/config.ninja
include config/config_${target}.ninja
include config/rules.ninja
Expand Down
2 changes: 0 additions & 2 deletions config/build_docs.ninja
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ target=DEBUG
#target=RELEASE
#target=SIZE

toolchain=x86_64-linux-gnu

include config.ninja
include config_${target}.ninja
include rules.ninja
Expand Down
4 changes: 2 additions & 2 deletions config/rules.hancho
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

compile_cpp = Rule(
desc = "Compiling {files_in} -> {files_out} ({build_type})",
command = "{toolchain}-g++ {cpp_std} {gcc_opt} {warnings} {includes} {defines} -c {files_in} -o {files_out}",
command = "g++ {cpp_std} {gcc_opt} {warnings} {includes} {defines} -c {files_in} -o {files_out}",
cpp_std = "-std=c++20",
gcc_opt = "{'-O3' if build_type == 'release' else '-g -O0'} -MMD",
warnings = "-Wall -Werror -Wno-unused-variable -Wno-unused-local-typedefs -Wno-unused-but-set-variable",
Expand All @@ -20,7 +20,7 @@ link_c_lib = Rule(

link_c_bin = Rule(
desc = "Linking {files_out}",
command = "{toolchain}-g++ {ld_opt} {warnings} {files_in} {deps} {sys_libs} -o {files_out}",
command = "g++ {ld_opt} {warnings} {files_in} {deps} {sys_libs} -o {files_out}",
ld_opt = "{'-O3' if build_type == 'release' else '-g -O0'}",
warnings = "-Wall",
)
Expand Down
6 changes: 3 additions & 3 deletions config/rules.ninja
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
################################################################################

rule compile_cpp
command = ${toolchain}-g++ ${opts_cpp} ${includes} ${defines} -MMD -MF ${out}.d -c ${in} -o ${out}
command = g++ ${opts_cpp} ${includes} ${defines} -MMD -MF ${out}.d -c ${in} -o ${out}
depfile = ${out}.d
deps = gcc

rule compile_c
command = ${toolchain}-gcc ${opts_c} ${includes} ${defines} -MMD -MF ${out}.d -c ${in} -o ${out}
command = gcc ${opts_c} ${includes} ${defines} -MMD -MF ${out}.d -c ${in} -o ${out}
depfile = ${out}.d
deps = gcc

rule c_library
command = ar rcs ${out} ${in} > /dev/null

rule c_binary
command = ${toolchain}-g++ ${opts_cpp} ${in} ${libraries} -o ${out}
command = g++ ${opts_cpp} ${in} ${libraries} -o ${out}

################################################################################

Expand Down

0 comments on commit 6006a6b

Please sign in to comment.