Skip to content

Commit

Permalink
Fix static-lib AOT Mono builds (#103988)
Browse files Browse the repository at this point in the history
  • Loading branch information
jkoritzinsky authored Jul 1, 2024
1 parent 241bbe1 commit f4b981c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/mono/mono/component/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -228,10 +228,16 @@ if (ENABLE_PERFTRACING AND "${MONO_DIAGNOSTICS_TRACING_COMPONENT_NAME}" IN_LIST
# Link the diagnostics_tracing component to the EventPipe and DiagnosticServer libraries.
if (TARGET ${MONO_DIAGNOSTICS_TRACING_COMPONENT_NAME}-objects)
target_sources(${MONO_DIAGNOSTICS_TRACING_COMPONENT_NAME}-objects PRIVATE $<TARGET_OBJECTS:eventpipe-mono-objects> $<TARGET_OBJECTS:dn-containers>)
list(APPEND mono-components-objects $<TARGET_OBJECTS:eventpipe-mono-objects> $<TARGET_OBJECTS:dn-containers>)
# If we are going to link the diagnostics component via mono-components-objects, link in the supporting object libraries as well.
string(REPLACE
"$<TARGET_OBJECTS:${MONO_DIAGNOSTICS_TRACING_COMPONENT_NAME}-objects>"
"$<TARGET_OBJECTS:${MONO_DIAGNOSTICS_TRACING_COMPONENT_NAME}-objects>;$<TARGET_OBJECTS:eventpipe-mono-objects>;$<TARGET_OBJECTS:dn-containers>"
mono-components-objects "${mono-components-objects}")
endif()
if (TARGET mono-component-${MONO_DIAGNOSTICS_TRACING_COMPONENT_NAME}-static)
target_sources(mono-component-${MONO_DIAGNOSTICS_TRACING_COMPONENT_NAME}-static PRIVATE $<TARGET_OBJECTS:eventpipe-mono-objects> $<TARGET_OBJECTS:dn-containers>)
# We don't add dn-containers here as any scenario that uses this target will also use the monosgen-static target,
# which will also have dn-containers linked into it.
target_sources(mono-component-${MONO_DIAGNOSTICS_TRACING_COMPONENT_NAME}-static PRIVATE $<TARGET_OBJECTS:eventpipe-mono-objects>)
endif()
if (TARGET mono-component-${MONO_DIAGNOSTICS_TRACING_COMPONENT_NAME})
target_sources(mono-component-${MONO_DIAGNOSTICS_TRACING_COMPONENT_NAME} PRIVATE $<TARGET_OBJECTS:eventpipe-mono-objects> $<TARGET_OBJECTS:dn-containers>)
Expand Down

0 comments on commit f4b981c

Please sign in to comment.