Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure different Windows flavors build their own abseil library #81

Merged
merged 2 commits into from
Aug 2, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion ext/re2/extconf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@
--with-re2-dir=DIRECTORY
Look for re2 headers and library in DIRECTORY.


Flags only used when building and using the packaged libraries:

--enable-cross-build
Enable cross-build mode. (You probably do not want to set this manually.)


Environment variables used:

CC
Expand All @@ -54,6 +61,10 @@ def config_system_libraries?
enable_config("system-libraries", ENV.key?('RE2_USE_SYSTEM_LIBRARIES'))
end

def config_cross_build?
enable_config("cross-build")
end

def concat_flags(*args)
args.compact.join(" ")
end
Expand Down Expand Up @@ -82,6 +93,10 @@ def target_host
host.gsub(/i386/, "i686")
end

def target_arch
RbConfig::CONFIG['arch']
end

def with_temp_dir
Dir.mktmpdir do |temp_dir|
Dir.chdir(temp_dir) do
Expand Down Expand Up @@ -203,9 +218,16 @@ def process_recipe(name, version)
require "mini_portile2"
message("Using mini_portile version #{MiniPortile::VERSION}\n")

cross_build_p = config_cross_build?
message "Cross build is #{cross_build_p ? "enabled" : "disabled"}.\n"

MiniPortileCMake.new(name, version).tap do |recipe|
recipe.host = target_host
recipe.target = File.join(PACKAGE_ROOT_DIR, "ports")
target_dir = File.join(PACKAGE_ROOT_DIR, "ports")
# Ensure x64-mingw-ucrt and x64-mingw32 use different library paths since the host
# is the same (x86_64-w64-mingw32).
target_dir = File.join(target_dir, target_arch) if cross_build_p
recipe.target = target_dir

recipe.configure_options += [
# abseil needs a C++14 compiler
Expand Down