@@ -6,12 +6,9 @@ set(MONO_EVENTPIPE_GEN_INCLUDE_PATH "${CMAKE_CURRENT_BINARY_DIR}/eventpipe")
66set (MONO_HOT_RELOAD_COMPONENT_NAME "hot_reload" )
77set (MONO_DIAGNOSTICS_TRACING_COMPONENT_NAME "diagnostics_tracing" )
88set (MONO_DEBUGGER_COMPONENT_NAME "debugger" )
9- set (MONO_MARSHAL_ILGEN_COMPONENT_NAME "marshal-ilgen" )
109
1110# a list of every component.
1211set (components "" )
13- # a list of components needed by the AOT compiler
14- set (components_for_aot "" )
1512
1613# the sources for each individiable component define a new
1714# component_name-sources list for each component, and a
@@ -82,53 +79,17 @@ set(${MONO_DIAGNOSTICS_TRACING_COMPONENT_NAME}-dependencies
8279 ${MONO_DIAGNOSTICS_TRACING_COMPONENT_NAME} -gen-sources
8380)
8481
85- # marshal-ilgen
86- list (APPEND components
87- ${MONO_MARSHAL_ILGEN_COMPONENT_NAME}
88- )
89- list (APPEND components_for_aot
90- ${MONO_MARSHAL_ILGEN_COMPONENT_NAME}
91- )
92-
93- set (${MONO_MARSHAL_ILGEN_COMPONENT_NAME} -sources
94- ${MONO_COMPONENT_PATH} /marshal-ilgen.c
95- ${MONO_COMPONENT_PATH} /marshal-ilgen.h
96- ${MONO_COMPONENT_PATH} /marshal-ilgen-noilgen.c
97- ${MONO_COMPONENT_PATH} /marshal-ilgen-noilgen.h
98- )
99-
100- # For every component not build into the AOT compiler, build the stub instead
101- set (stubs_for_aot "" )
102- foreach (component IN LISTS components)
103- if (NOT (component IN_LIST components_for_aot))
104- list (APPEND stubs_for_aot "${component} " )
105- endif ()
106- endforeach ()
107-
108-
109- set (${MONO_MARSHAL_ILGEN_COMPONENT_NAME} -stub-sources
110- ${MONO_COMPONENT_PATH} /marshal-ilgen-stub.c
111- )
112-
113- if (AOT_COMPONENTS)
114- set (components_to_build ${components_for_aot} )
115- set (stubs_to_build ${stubs_for_aot} )
116- else ()
117- set (components_to_build ${components} )
118- set (stubs_to_build ${components} )
119- endif ()
120-
12182# from here down, all the components are treated in the same way
12283
12384#define a library for each component and component stub
12485function (define_component_libs)
12586 # NOTE: keep library naming pattern in sync with RuntimeComponentManifest.targets
126- if (AOT_COMPONENTS OR NOT DISABLE_LIBS )
127- foreach (component IN LISTS components_to_build )
87+ if (NOT DISABLE_LIBS)
88+ foreach (component IN LISTS components )
12889 add_library ("mono-component-${component} -static" STATIC $<TARGET_OBJECTS:${component} -objects>)
12990 install (TARGETS "mono-component-${component} -static" LIBRARY)
13091 endforeach ()
131- foreach (component IN LISTS stubs_to_build )
92+ foreach (component IN LISTS components )
13293 add_library ("mono-component-${component} -stub-static" STATIC $<TARGET_OBJECTS:${component} -stub-objects>)
13394 install (TARGETS "mono-component-${component} -stub-static" LIBRARY)
13495 endforeach ()
@@ -142,7 +103,7 @@ target_sources(component_base INTERFACE
142103)
143104target_link_libraries (component_base INTERFACE monoapi)
144105
145- if (NOT AOT_COMPONENTS AND ( DISABLE_COMPONENTS OR DISABLE_LIBS) )
106+ if (DISABLE_COMPONENTS OR DISABLE_LIBS)
146107 set (DISABLE_COMPONENT_OBJECTS 1)
147108endif ()
148109
@@ -162,7 +123,7 @@ endforeach()
162123
163124if (NOT DISABLE_COMPONENTS AND NOT STATIC_COMPONENTS)
164125 # define a shared library for each component
165- foreach (component IN LISTS components_to_build )
126+ foreach (component IN LISTS components )
166127 # NOTE: keep library naming pattern in sync with RuntimeComponentManifest.targets
167128 if (HOST_WIN32 )
168129 add_library ("mono-component-${component} " SHARED "${${component} -sources}" )
@@ -194,14 +155,14 @@ if(NOT DISABLE_COMPONENTS AND NOT STATIC_COMPONENTS)
194155 #define a library for each component and component stub
195156 define_component_libs()
196157
197- elseif (AOT_COMPONENTS OR ( NOT DISABLE_COMPONENTS AND STATIC_COMPONENTS) )
158+ elseif (NOT DISABLE_COMPONENTS AND STATIC_COMPONENTS)
198159
199160 #define a library for each component and component stub
200161 define_component_libs()
201162
202163 # define a list of mono-components objects for mini if building a shared libmono with static-linked components
203164 set (mono-components-objects "" )
204- foreach (component IN LISTS components_to_build )
165+ foreach (component IN LISTS components )
205166 list (APPEND mono-components-objects $<TARGET_OBJECTS:${component} -objects>)
206167 endforeach ()
207168
0 commit comments