Skip to content

Commit

Permalink
Update CXXFLAGS to have target argument before build
Browse files Browse the repository at this point in the history
  • Loading branch information
miry committed Nov 11, 2023
1 parent ec1ea08 commit 8e5c037
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion omnibus/config/software/crystal.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@
build do
command "git checkout #{CRYSTAL_SHA1}", cwd: project_dir

original_CXXFLAGS_env = env["CXXFLAGS"].dup
env["CXXFLAGS"] = original_CXXFLAGS_env + " -target x86_64-apple-darwin"

mkdir "#{project_dir}/deps"
make "deps", env: env
mkdir ".build"
Expand All @@ -71,7 +74,7 @@

# Compile for ARM64. Apple's clang only understands arm64, LLVM uses aarch64,
# so we need to sub out aarch64 in our calls to Apple tools
env["CXXFLAGS"] << " -target arm64-apple-darwin"
env["CXXFLAGS"] = original_CXXFLAGS_env + " -target arm64-apple-darwin"
make "deps", env: env

make "crystal stats=true release=true target=aarch64-apple-darwin FLAGS=\"#{crflags}\" CRYSTAL_CONFIG_TARGET=aarch64-apple-darwin CRYSTAL_CONFIG_LIBRARY_PATH= O=#{output_path}", env: env
Expand Down

0 comments on commit 8e5c037

Please sign in to comment.