AcademySoftwareFoundation / AcademySoftwareFoundation/openvdb
MSVC_RUNTIME_LIBRARY target property should not be set explicitly
- Dominant language
- C++
- Stars
- 3.4k
- Forks
- 774
- Avg merge
- 3d 9h
- Merged PRs (30d)
- 34
Description
Hi there. I'm running into problems with the following statement:
https://github.com/AcademySoftwareFoundation/openvdb/blob/73de06e50852f6bf70d1523558bb1f9c929fedf5/openvdb/openvdb/CMakeLists.txt#L516
Choosing to link against static or dynamic MSVC runtime has nothing to do with whether to link against a static or dynamic version of OpenVDB. The statement above is problematic in situations where other third-party libraries have been defined beforehand, and initialized to compile with `/MD`, but then we pull OpenVDB, which imposes `/MT`, and final linking fails. CMake configuration should still work when one leaves a default, unspecified value for `CMAKE_MSVC_RUNTIME_LIBRARY`, so I would suggest to remove this line, or make it a controllable CMake option.
Contributor guide
Research direction
Start at openvdb/openvdb/CMakeLists.txt around line 516 and review how MSVC_RUNTIME_LIBRARY is set relative to CMAKE_MSVC_RUNTIME_LIBRARY. Check the CMake configuration with an unspecified default and with third-party libraries using /MD; done means OpenVDB no longer overrides that choice or causes the conflicting runtime flags described in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cmake, cpp
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100