Skip to content

Commit 8e5c037

Browse files
committed
Update CXXFLAGS to have target argument before build
1 parent ec1ea08 commit 8e5c037

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

omnibus/config/software/crystal.rb

+4-1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@
4848
build do
4949
command "git checkout #{CRYSTAL_SHA1}", cwd: project_dir
5050

51+
original_CXXFLAGS_env = env["CXXFLAGS"].dup
52+
env["CXXFLAGS"] = original_CXXFLAGS_env + " -target x86_64-apple-darwin"
53+
5154
mkdir "#{project_dir}/deps"
5255
make "deps", env: env
5356
mkdir ".build"
@@ -71,7 +74,7 @@
7174

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

7780
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

0 commit comments

Comments
 (0)