diff --git a/ext/re2/extconf.rb b/ext/re2/extconf.rb index 854095a..64763c9 100644 --- a/ext/re2/extconf.rb +++ b/ext/re2/extconf.rb @@ -82,6 +82,14 @@ def target_host host.gsub(/i386/, "i686") end +def with_temp_dir + Dir.mktmpdir do |temp_dir| + Dir.chdir(temp_dir) do + yield + end + end +end + # # main # @@ -229,7 +237,9 @@ def process_recipe(name, version) end end - recipe.cook + # Use a temporary base directory to reduce filename lengths since + # Windows can hit a limit of 250 characters (CMAKE_OBJECT_PATH_MAX). + with_temp_dir { recipe.cook } FileUtils.touch(checkpoint) end