Skip to content

Commit

Permalink
Incorporated feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
kraenhansen committed Dec 27, 2023
1 parent 9b7c407 commit 3cc7550
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions packages/react-native/scripts/cocoapods/utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,14 @@ def self.set_ccache_compiler_and_linker_build_settings(installer, react_native_p
ccache_path = `command -v ccache`.strip
ccache_available = !ccache_path.empty?

message_prefix = ccache_available ? "⚡️".yellow + "Ccache detected (found at %s): " % [ccache_path.italic] : "Unable to locate ccache: "
message_prefix = "[Ccache]"

if ccache_available
Pod::UI.puts("#{message_prefix}: Ccache found at #{ccache_path}")
end

if ccache_available and ccache_enabled
Pod::UI.puts(message_prefix + "Setting CC, LD, CXX & LDPLUSPLUS build settings")
Pod::UI.puts("#{message_prefix}: Setting CC, LD, CXX & LDPLUSPLUS build settings")
# Using scripts wrapping the ccache executable, to allow injection of configurations
ccache_clang_sh = File.join("$(REACT_NATIVE_PATH)", 'scripts', 'xcode', 'ccache-clang.sh')
ccache_clangpp_sh = File.join("$(REACT_NATIVE_PATH)", 'scripts', 'xcode', 'ccache-clang++.sh')
Expand All @@ -112,9 +116,9 @@ def self.set_ccache_compiler_and_linker_build_settings(installer, react_native_p
project.save()
end
elsif ccache_available and !ccache_enabled
Pod::UI.puts(message_prefix + "Pass %s to %s in your Podfile or set environment variable %s to increase the speed of subsequent builds" % [":ccache_enabled => true".italic, "react_native_post_install".italic, "USE_CCACHE=1".italic])
Pod::UI.puts("#{message_prefix}: Pass #{":ccache_enabled => true".italic} to #{"react_native_post_install".italic} in your Podfile or set environment variable #{"USE_CCACHE=1".italic} to increase the speed of subsequent builds")
elsif !ccache_available and ccache_enabled
Pod::UI.warn(message_prefix + "Install ccache or ensure your neither passing %s nor setting environment variable %s" % [":ccache_enabled => true", "USE_CCACHE=1"])
Pod::UI.warn("#{message_prefix}: Install ccache or ensure your neither passing ':ccache_enabled => true' nor setting environment variable 'USE_CCACHE=1'")
end
end

Expand Down

0 comments on commit 3cc7550

Please sign in to comment.