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

Create release binary with cmake explicitly #136

Merged
merged 2 commits into from
Oct 13, 2023

Conversation

Watson1978
Copy link
Contributor

When I built library with the default setting, its compilation has no optimized in my environment.
I want it has release binary by default.

Ref. https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html

@flavorjones
Copy link
Owner

@Watson1978 Thank you for submitting this pull request and updating the tests!

I'm not a CMake user, so I want to check with one other person who's contributed improvements to CMake: @stanhu what do you think of default to Release? Should we provide the ability to configure that setting?

@stanhu
Copy link
Contributor

stanhu commented Oct 10, 2023

Default to Release sounds reasonable. It appears that this shrinks the re2 gem .so from 2766744 bytes to 1506992 bytes.

It would be nice to configure this in order to see backtraces, but I suppose that could also be done by adding CMAKE_BUILD_TYPE since I think the last value specified wins.

@flavorjones
Copy link
Owner

@stanhu Thanks for the fast feedback. I'm going to add a config param / env var override like mini_portile already provides for the cmake command.

- default to "Release"
- allow :cmake_build_type kwarg to the constructor
- override everything with CMAKE_BUILD_TYPE env var
@flavorjones
Copy link
Owner

@stanhu @Watson1978 would love feedback on the commit I appended

@stanhu
Copy link
Contributor

stanhu commented Oct 10, 2023

Looks good to me, thanks!

@Watson1978
Copy link
Contributor Author

@flavorjones Thank you for your improvement. Looks good to me!

@flavorjones flavorjones merged commit 579704b into flavorjones:main Oct 13, 2023
31 checks passed
@flavorjones
Copy link
Owner

I'll make time to cut a release in the next day or two.

@Watson1978
Copy link
Contributor Author

thanks!!

@Watson1978 Watson1978 deleted the release-build branch October 13, 2023 13:34
@stanhu
Copy link
Contributor

stanhu commented Oct 17, 2023

@flavorjones Thanks for this! Could you cut a release?

@flavorjones
Copy link
Owner

@stanhu Thanks for the poke. I'm traveling this week and it's been challenging to find time. I delayed because I was nervous about the not-fully baked pkgconfig feature on main, but will just pull the trigger. Expect a release tomorrow.

@stanhu
Copy link
Contributor

stanhu commented Oct 17, 2023

I delayed because I was nervous about the not-fully baked pkgconfig feature on main, but will just pull the trigger.

I'll take a look in the context of mudge/re2#109.

@flavorjones
Copy link
Owner

stanhu added a commit to stanhu/re2 that referenced this pull request Oct 23, 2023
This update builds abseil-cpp in Release mode
(flavorjones/mini_portile#136). For the x86_64
shared object, it appears that this shrinks `re2.so`from 2766744 bytes
to 1506992 bytes, a 45% reduction.
mudge pushed a commit to mudge/re2 that referenced this pull request Oct 23, 2023
This update builds abseil-cpp in Release mode
(flavorjones/mini_portile#136). For the x86_64
shared object, it appears that this shrinks `re2.so`from 2766744 bytes
to 1506992 bytes, a 45% reduction.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants