From f42a93d9b52cc4f83f3d4ad85fa1cc0b5280ded6 Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Sat, 22 Jul 2023 21:49:51 -0700 Subject: [PATCH] Set CMAKE_CXX_VISIBILITY_PRESET to hidden This avoids the visibility setting warnings in the linker (https://github.com/mudge/re2/actions/runs/5631492710/job/15258506852) and reduces the size of the binaries. --- ext/re2/extconf.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/re2/extconf.rb b/ext/re2/extconf.rb index 5df0989..d3b53a4 100644 --- a/ext/re2/extconf.rb +++ b/ext/re2/extconf.rb @@ -340,7 +340,7 @@ def build_with_vendored_libraries url: "https://github.com/abseil/abseil-cpp/archive/refs/tags/#{recipe.version}.tar.gz", sha256: dependencies['abseil']['sha256'] }] - recipe.configure_options += ['-DABSL_PROPAGATE_CXX_STD=ON'] + recipe.configure_options += ['-DABSL_PROPAGATE_CXX_STD=ON', '-DCMAKE_CXX_VISIBILITY_PRESET=hidden'] end re2_recipe = process_recipe('libre2', dependencies['libre2']['version']) do |recipe| @@ -348,7 +348,7 @@ def build_with_vendored_libraries url: "https://github.com/google/re2/releases/download/#{recipe.version}/re2-#{recipe.version}.tar.gz", sha256: dependencies['libre2']['sha256'] }] - recipe.configure_options += ["-DCMAKE_PREFIX_PATH=#{abseil_recipe.path}", '-DCMAKE_CXX_FLAGS=-DNDEBUG'] + recipe.configure_options += ["-DCMAKE_PREFIX_PATH=#{abseil_recipe.path}", '-DCMAKE_CXX_FLAGS=-DNDEBUG', '-DCMAKE_CXX_VISIBILITY_PRESET=hidden'] end dir_config("re2", File.join(re2_recipe.path, 'include'), File.join(re2_recipe.path, 'lib'))