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

Make ctrlLib constants constexpr #736

Merged
merged 1 commit into from
Mar 28, 2021
Merged

Make ctrlLib constants constexpr #736

merged 1 commit into from
Mar 28, 2021

Conversation

pattacini
Copy link
Member

@pattacini pattacini commented Mar 28, 2021

This PR addresses #717.

Instead of resorting to the CMake infrastructure to export the constants, I've verified that declaring those identifiers as constexpr made the trick, both in shared and static building.

@traversaro I believe this way is simpler to be maintained.

What's your opinion?

@pattacini pattacini self-assigned this Mar 28, 2021
@pattacini pattacini linked an issue Mar 28, 2021 that may be closed by this pull request
@traversaro
Copy link
Member

@traversaro I believe this way is simpler to be maintained.

What's your opinion?

I agree! The only downsides is that the ABI is changed and that non-CMake Windows consumer of the library will need to manually add _USE_MATH_DEFINES to their own when linking with ctrlLib, but given that this aspects are not relevant for icub-main, the maintenance gain wins!

@pattacini pattacini merged commit aebfc4b into master Mar 28, 2021
@pattacini pattacini deleted the fix/717 branch March 28, 2021 09:52
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.

Shared library compilation on Windows is broken
2 participants