Skip to content

Commit

Permalink
Set CMAKE_CXX_VISIBILITY_PRESET to hidden
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
stanhu authored and mudge committed Jul 25, 2023
1 parent 7e944de commit 443214e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ext/re2/extconf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -340,15 +340,15 @@ 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|
recipe.files = [{
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'))
Expand Down

0 comments on commit 443214e

Please sign in to comment.