You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Move src/native libraries that are shared between runtime builds to be targets-driven (#103184)
Today, the src/native/containers and src/native/eventpipe libraries are defined in terms of source and header file lists.
This provides flexibility into how they're defined in CMake, but it makes it difficult to flow include directories or dependencies. It also makes it difficult to encapsulate logic, as these lists are defined in `.cmake` files that are included into a `CMakeLists.txt` file.
This PR converts these libraries to be defined in terms of CMake targets.
src/native/containers is transformed into an object library, so we can build it once and then link it into static libs, shared libs, or executables. An `extern "C"` block was added around all declarations that are currently used in eventpipe/diagnosticserver (so not `dn-simdhash`) to enable the build to build the containers library as a C library. Also, a default implementation of the `dn_simdhash_assert_fail` method was added to enable the containers lib to link into runtimes that don't currently provide an implementation.
src/native/eventpipe is transformed into [interface libraries](https://cmake.org/cmake/help/latest/command/add_library.html#interface-libraries). Due to how eventpipe and diagnosticserver both require runtime-specific headers and need to be built with different flags for each target, defining them as interface libraries is the cleanest manner to handle this scenario (until we can refactor the `ep-rt-*.h` and `ds-rt-*.h` headers into a cleaner design).
This PR also updates the eventpipe and diagnosticserver codebases to use CMake's UNITY_BUILD support in each runtime's implementation instead of manually implementing a unity build.
0 commit comments