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

GLM_ENABLE_EXPERIMENTAL option / install cleanup #741

Closed
wants to merge 2 commits into from
Closed

GLM_ENABLE_EXPERIMENTAL option / install cleanup #741

wants to merge 2 commits into from

Conversation

schnitzeltony
Copy link

No description provided.

@schnitzeltony
Copy link
Author

Hmm auto-builds failed and I can't find links to results anymore...

It seems that erroring out if GLM_ENABLE_EXPERIMENTAL is not set turns into
packagers nightmare: There are packages around expecting glx headers. E.g
libgltf [1] fails during configure checking for usable headers AND during
compile. Paticularly fixing configure for those packages is time-consuming:
The only way (correct me if I am wrong) is creating a patch adding

AC_DEFINE([GLM_ENABLE_EXPERIMENTAL], [1], [glm needs this for gtx headers])

By adding a configure option 'GLM_ENABLE_EXPERIMENTAL', the decision to use
glm/glx is done at one (and the right) place.

Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>

[1] https://gerrit.libreoffice.org/gitweb?p=libgltf.git
Plausibility check in root source path

$ find glm -type f ! -name '*.hpp' ! -name '*.h' ! -name '*.inl'
glm/detail/glm.cpp
glm/detail/dummy.cpp
glm/experimental.hpp.in
glm/CMakeLists.txt

Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
@@ -82,6 +82,11 @@ option(GLM_TEST_ENABLE_SIMD_AVX "Enable AVX optimizations" OFF)
option(GLM_TEST_ENABLE_SIMD_AVX2 "Enable AVX2 optimizations" OFF)
option(GLM_TEST_FORCE_PURE "Force 'pure' instructions" OFF)

option(GLM_ENABLE_EXPERIMENTAL "Enable experimental GLM_GTX" OFF)
configure_file(glm/experimental.hpp.in experimental.hpp @ONLY)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not simply:
if GLM_ENABLE_EXPERIMENTAL
add_definitions(-DGLM_ENABLE_EXPERIMENTAL)
?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does that make depending libs happy?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not defining GLM_ENABLE_EXPERIMENTAL in the dependent library that includes GLM then?

@Groovounet
Copy link
Member

Experimental code is hidden behind a define to discourage its use or at list to make it clear that the code is experimental so there are risk to use it. Typically, it's not well tested for example.

As a consequence, I am not really kine to add a mechanism making it easier to use.

Thanks,
Christophe

@Groovounet Groovounet closed this Mar 25, 2018
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.

None yet

2 participants