Skip to content

Commit

Permalink
Use LEAN_CC=clang lake for builds on linux.
Browse files Browse the repository at this point in the history
The LEAN_CC variable was introduced recently to use override the bundled
clang (leanc) from the lean toolchain.

leanprover/lean4#4477 (comment)

We must use LEAN_CC on linux because the example executable will fail to
link if raylib is built with a glibc that's incompatible with the version
that's bundled with leanc. This currently happens with the arch distro.

Thanks to @keeganperry7 for figuring this out.

Co-authored-by: keeganperry7 <[email protected]>
  • Loading branch information
paulcadman and keeganperry7 committed Aug 18, 2024
1 parent a903f79 commit dd06cda
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ raylib_custom_cflags := raylib_config_flags + " " + raylib_os_custom_cflags
# Raylib CC make paramter
raylib_cc_parameter := if os() == "macos" { "/usr/bin/clang" } else { "gcc" }

# The command used to invoke lake
#
# LEAN_CC is used for linux because the example executable will fail to link if
# raylib is built with a glibc that's incompatible with the one that's bundled
# with leanc.
lake_command := if os() == "linux" { "LEAN_CC=clang lake" } else { "lake" }

static_lib_path := join(justfile_directory(), "lib")
raylib_src_path := join(justfile_directory(), "raylib-5.0", "src")
resource_dir := join(justfile_directory(), "resources")
Expand Down Expand Up @@ -76,11 +83,11 @@ build_raylib:
# build both the raylib library and the Lake project
build: build_resvg build_raylib bundler
lake -R {{lake_config_opts}} build
{{lake_command}} -R {{lake_config_opts}} build

# clean only the Lake project
clean:
lake clean
{{lake_command}} clean

clean_static_lib:
rm -rf {{static_lib_path}}
Expand Down

0 comments on commit dd06cda

Please sign in to comment.