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

[netcdf-c] correctly fix hdf5 linkage #7578

Merged
merged 1 commit into from
Aug 7, 2019

Conversation

Neumann-A
Copy link
Contributor

closes #7577


# Remember to package this file for CMake builds.
ADD_EXTRA_DIST(${libnchdf5_SOURCES} CMakeLists.txt)
+
+if(BUILD_SHARED_LIBS)
+target_link_libraries(netcdfhdf5 PRIVATE hdf5::hdf5-shared hdf5::hdf5-static hdf5::hdf5_hl-shared hdf5::hdf5_hl-static)
+if(HDF5_BUILD_SHARED_LIBS)
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the context for not using BUILD_SHARED_LIBS?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

users of vcpkg are free to mix and match dynamic/static libraries as they see fit in a custom triplet. So users are free to mix a static/dynamic build of hdf5 with a dynamic/static build of netcdf. As such the conditional must check wether or not hdf5 has been build as a static or dynamic library. The variable BUILD_SHARED_LIBS just means that the currently build package is build as a dynamic library and not how its dependent libraries have been build.

@cbezault cbezault self-assigned this Aug 7, 2019
@cbezault cbezault merged commit c89dcc1 into microsoft:master Aug 7, 2019
@Neumann-A Neumann-A deleted the fix_netcdf_c_hdf5 branch September 14, 2019 20:35
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.

[netcdf-c] wrong HDF5 linkage
2 participants