Conversation
99f62e5 to
f023c23
Compare
|
@Growl1234 You may want to look at #6220 as I believe the new function there can cover most of what you're doing here without needing to have special exceptions for any particular CMake target such as |
Thanks for your dedication, and it's great to see the specified |
|
|
@Growl1234 With #6220 merged you'll want to rebase on/merge in develop now. |
|
@Growl1234 Due to the check I needed to put at https://github.com/HDFGroup/hdf5/blob/develop/config/HDF5Pkgconfig.cmake#L94, SUMMARY OF THE HDF5 CONFIGURATION
=================================
General Information:
-------------------
HDF5 Version: 2.2.0
Configured on: 2026-02-24
Configured by: Visual Studio 17 2022
Host system: Windows-10.0.22621
Uname information: Windows
Byte sex: little-endian
Installation point: C:/Program Files/HDF_Group/HDF5/2.2.0
Compiling Options:
------------------
Build Mode: $<CONFIG>
Debugging Symbols: OFF
Asserts: OFF
Profiling: OFF
Optimization Level: OFF
Linking Options:
----------------
Libraries:
Statically Linked Executables: OFF
LDFLAGS: /machine:x64
H5_LDFLAGS:
AM_LDFLAGS:
Extra libraries:
Archiver: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.44.35207/bin/Hostx64/x64/lib.exe
AR_FLAGS:
Ranlib: :
Languages:
----------
C: YES
C Compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.44.35207/bin/Hostx64/x64/cl.exe 19.44.35215.0
CPPFLAGS:
H5_CPPFLAGS:
AM_CPPFLAGS:
CFLAGS: -std:c11 /DWIN32 /D_WINDOWS -wd5105
H5_CFLAGS: /W3;/wd4100;/wd4706;/wd4127
AM_CFLAGS:
Shared C Library: YES
Static C Library: YES
Fortran: OFF
Fortran Compiler:
Fortran Flags:
H5 Fortran Flags:
AM Fortran Flags:
Shared Fortran Library: YES
Static Fortran Library: YES
Module Directory: C:/Users/_user_/hdf5/build/mod
C++: OFF
C++ Compiler:
C++ Flags:
H5 C++ Flags:
AM C++ Flags:
Shared C++ Library: YES
Static C++ Library: YES
JAVA: OFF
JAVA Compiler:
Features:
---------
Parallel HDF5: OFF
Parallel Filtered Dataset Writes:
Large Parallel I/O:
High-level library: ON
Dimension scales w/ new references:
Build HDF5 Tests: ON
Build HDF5 Tools: ON
Threads: ON
Threadsafety: OFF
Concurrency: OFF
Default API mapping: v200
With deprecated public symbols: ON
I/O filters (external):
_Float16 support: OFF
Map (H5M) API: OFF
Direct VFD: OFF
Mirror VFD: OFF
Subfiling VFD: OFF
(Read-Only) S3 VFD: OFF
(Read-Only) HDFS VFD: OFF
Packages w/ extra debug output:
API Tracing: OFF
Using memory checker: OFF
Use file locking: best-effort
Strict File Format Checks: OFF
Optimization Instrumentation:
Editing the function a bit to only give warning, the libraries line comes out as
which is probably a little odd for Windows. I think it makes sense to just remove But we also still have to deal with the issue that with multi-config generators the build type isn't known until build time, so we can't guarantee that we're returning the correct libraries/flags on Windows since we don't know which build configuration library to use yet. You can also see above that |
2aa524b to
2a3946f
Compare
|
With this commit the while Further tests maybe needed. Moreover, |
4be9e18 to
68a976e
Compare
|
Thanks for your work @Growl1234. I'll do a bit more testing but I think the changes generally look good.
From what I can tell, these libraries only get added to |
|
I’m wondering whether it would be possible to move the generation of Or alternatively, we could generate the corresponding files for each build type during the configuration or build stage, and then let the generator select the appropriate one at installation time. |
… `LINK_LIBS_SETTINGS` rather than `LINK_LIBS`
I see this as being the only way to go in the future since we also have to deal with CMake generator expressions, but I also agree that that's far outside the scope of this PR. It's something I'd like to do though. |
|
I wonder if you might be interested in taking a look at this, which shows a possible approach to handling multi-configuration generators in a better way. It involves relatively substantial modifications to |
It will likely be a while before I can get around to looking at your changes, but it looks like it's moving in the right direction at least. We will probably want to make use of https://cmake.org/cmake/help/latest/command/file.html#generate in order to process generator expressions in the file, which would include the MSVC build configuration. |
I really like the idea of using the |
* Generate "Extra libraries" in `libhdf5.settings` using a new variable `LINK_LIBS_SETTINGS` rather than `LINK_LIBS` * Follow up to HDFGroup#6220 * Try to deal with Windows MSVC
* Generate "Extra libraries" in `libhdf5.settings` using a new variable `LINK_LIBS_SETTINGS` rather than `LINK_LIBS` * Follow up to HDFGroup#6220 * Try to deal with Windows MSVC



Generate "Extra libraries" in
libhdf5.settingsusing a new variableLINK_LIBS_SETTINGSrather thanLINK_LIBS.Fixes #6171.
Important
Generate "Extra libraries" in
libhdf5.settingsusingLINK_LIBS_SETTINGSwith formatted linker flags inCMakeLists.txt.libhdf5.settingsusingLINK_LIBS_SETTINGSinstead ofLINK_LIBS._hdf5_resolve_lib_to_flagfunction inCMakeLists.txtto format linker flags.LINK_LIBS_SETTINGSvariable inCMakeLists.txtto store formatted linker flags.LINK_LIBS_SETTINGS.src/libhdf5.settings.into use@LINK_LIBS_SETTINGS@for "Extra libraries".This description was created by
for 2c69ea3. You can customize this summary. It will automatically update as commits are pushed.