Skip to content

Commit d610800

Browse files
committed
Only build omrgc_full when in mixedrefs static mode
Signed-off-by: Sharon Wang <[email protected]>
1 parent 9767d68 commit d610800

File tree

2 files changed

+97
-90
lines changed

2 files changed

+97
-90
lines changed

gc/CMakeLists.txt

+96-89
Original file line numberDiff line numberDiff line change
@@ -205,11 +205,6 @@ set(omrgc_sources
205205
omr_add_library(omrgc STATIC
206206
${omrgc_sources}
207207
)
208-
if(OMR_GC_COMPRESSED_POINTERS AND OMR_GC_FULL_POINTERS)
209-
omr_add_library(omrgc_full STATIC
210-
${omrgc_sources}
211-
)
212-
endif()
213208

214209
target_enable_ddr(omrgc EARLY_SOURCE_EVAL)
215210
ddr_set_add_targets(omrddr omrgc)
@@ -228,12 +223,6 @@ if(OMR_GC_OBJECT_MAP)
228223
PRIVATE
229224
${objmap_sources}
230225
)
231-
if(OMR_GC_COMPRESSED_POINTERS AND OMR_GC_FULL_POINTERS)
232-
target_sources(omrgc_full
233-
PRIVATE
234-
${objmap_sources}
235-
)
236-
endif()
237226
endif()
238227

239228
if(OMR_GC_MODRON_STANDARD)
@@ -258,14 +247,8 @@ if(OMR_GC_MODRON_STANDARD)
258247
PRIVATE
259248
${modronstandard_sources}
260249
)
261-
if(OMR_GC_COMPRESSED_POINTERS AND OMR_GC_FULL_POINTERS)
262-
target_sources(omrgc_full
263-
PRIVATE
264-
${modronstandard_sources}
265-
)
266-
endif()
267250

268-
if (OMR_GC_MODRON_COMPACTION)
251+
if(OMR_GC_MODRON_COMPACTION)
269252
set(modroncompaction_sources
270253
base/standard/CompactFixHeapForWalkTask.cpp
271254
base/standard/CompactScheme.cpp
@@ -278,13 +261,8 @@ if(OMR_GC_MODRON_STANDARD)
278261
PRIVATE
279262
${modroncompaction_sources}
280263
)
281-
if(OMR_GC_COMPRESSED_POINTERS AND OMR_GC_FULL_POINTERS)
282-
target_sources(omrgc_full
283-
PRIVATE
284-
${modroncompaction_sources}
285-
)
286-
endif()
287264
endif()
265+
288266
if(OMR_GC_MODRON_CONCURRENT_MARK)
289267
set(modronconcurrentmark_sources
290268
base/standard/ConcurrentCardTable.cpp
@@ -309,12 +287,6 @@ if(OMR_GC_MODRON_STANDARD)
309287
PRIVATE
310288
${modronconcurrentmark_sources}
311289
)
312-
if(OMR_GC_COMPRESSED_POINTERS AND OMR_GC_FULL_POINTERS)
313-
target_sources(omrgc_full
314-
PRIVATE
315-
${modronconcurrentmark_sources}
316-
)
317-
endif()
318290

319291
if(OMR_GC_MODRON_SCAVENGER)
320292
set(mcm_modronscavenger_sources
@@ -325,14 +297,9 @@ if(OMR_GC_MODRON_STANDARD)
325297
PRIVATE
326298
${mcm_modronscavenger_sources}
327299
)
328-
if(OMR_GC_COMPRESSED_POINTERS AND OMR_GC_FULL_POINTERS)
329-
target_sources(omrgc_full
330-
PRIVATE
331-
${mcm_modronscavenger_sources}
332-
)
333-
endif()
334300
endif()
335301
endif()
302+
336303
if(OMR_GC_CONCURRENT_SWEEP)
337304
set(concurrentsweep_sources
338305
base/standard/ConcurrentSweepScheme.cpp
@@ -342,13 +309,8 @@ if(OMR_GC_MODRON_STANDARD)
342309
PRIVATE
343310
${concurrentsweep_sources}
344311
)
345-
if(OMR_GC_COMPRESSED_POINTERS AND OMR_GC_FULL_POINTERS)
346-
target_sources(omrgc_full
347-
PRIVATE
348-
${concurrentsweep_sources}
349-
)
350-
endif()
351312
endif()
313+
352314
if(OMR_GC_MODRON_SCAVENGER)
353315
set(modronscavenger_sources
354316
base/HeapSplit.cpp # TODO delete as this should not be used anymore!
@@ -369,12 +331,6 @@ if(OMR_GC_MODRON_STANDARD)
369331
PRIVATE
370332
${modronscavenger_sources}
371333
)
372-
if(OMR_GC_COMPRESSED_POINTERS AND OMR_GC_FULL_POINTERS)
373-
target_sources(omrgc_full
374-
PRIVATE
375-
${modronscavenger_sources}
376-
)
377-
endif()
378334

379335
if(OMR_GC_CONCURRENT_SCAVENGER)
380336
set(ms_concurrentscavenger_sources
@@ -385,12 +341,6 @@ if(OMR_GC_MODRON_STANDARD)
385341
PRIVATE
386342
${ms_concurrentscavenger_sources}
387343
)
388-
if(OMR_GC_COMPRESSED_POINTERS AND OMR_GC_FULL_POINTERS)
389-
target_sources(omrgc_full
390-
PRIVATE
391-
${ms_concurrentscavenger_sources}
392-
)
393-
endif()
394344
endif()
395345
endif()
396346
endif()
@@ -425,13 +375,6 @@ if(OMR_GC_SEGREGATED_HEAP)
425375
${segregatedheap_sources}
426376
)
427377
ddr_add_headers(omrgc base/segregated/RegionPoolSegregated.hpp)
428-
429-
if(OMR_GC_COMPRESSED_POINTERS AND OMR_GC_FULL_POINTERS)
430-
target_sources(omrgc_full
431-
PRIVATE
432-
${segregatedheap_sources}
433-
)
434-
endif()
435378
endif()
436379

437380
if(OMR_GC_VLHGC)
@@ -443,12 +386,6 @@ if(OMR_GC_VLHGC)
443386
PRIVATE
444387
${vlhgc_sources}
445388
)
446-
if(OMR_GC_COMPRESSED_POINTERS AND OMR_GC_FULL_POINTERS)
447-
target_sources(omrgc_full
448-
PRIVATE
449-
${vlhgc_sources}
450-
)
451-
endif()
452389

453390
set(vlhgc_include
454391
base/vlhgc
@@ -458,18 +395,9 @@ if(OMR_GC_VLHGC)
458395
PUBLIC
459396
${vlhgc_include}
460397
)
461-
if(OMR_GC_COMPRESSED_POINTERS AND OMR_GC_FULL_POINTERS)
462-
target_include_directories(omrgc_full
463-
PUBLIC
464-
${vlhgc_include}
465-
)
466-
endif()
467398
endif()
468399

469400
add_dependencies(omrgc omrgc_hookgen)
470-
if(OMR_GC_COMPRESSED_POINTERS AND OMR_GC_FULL_POINTERS)
471-
add_dependencies(omrgc_full omrgc_hookgen)
472-
endif()
473401

474402
set(gc_include_public
475403
.
@@ -494,14 +422,6 @@ target_include_directories(omrgc
494422
INTERFACE
495423
${gc_include_interface}
496424
)
497-
if(OMR_GC_COMPRESSED_POINTERS AND OMR_GC_FULL_POINTERS)
498-
target_include_directories(omrgc_full
499-
PUBLIC
500-
${gc_include_public}
501-
INTERFACE
502-
${gc_include_interface}
503-
)
504-
endif()
505425

506426
set(gc_link_libraries_public
507427
omr_base
@@ -523,7 +443,97 @@ target_link_libraries(omrgc
523443
)
524444
set_target_properties(omrgc omrgc_hookgen omrgc_tracegen PROPERTIES FOLDER gc)
525445

526-
if(OMR_GC_COMPRESSED_POINTERS AND OMR_GC_FULL_POINTERS)
446+
if(OMR_MIXED_REFERENCES_MODE STREQUAL "static")
447+
target_compile_definitions(omrgc PUBLIC -DOMR_OVERRIDE_COMPRESS_OBJECT_REFERENCES=1)
448+
449+
omr_add_library(omrgc_full STATIC
450+
${omrgc_sources}
451+
)
452+
453+
if(OMR_GC_OBJECT_MAP)
454+
target_sources(omrgc_full
455+
PRIVATE
456+
${objmap_sources}
457+
)
458+
endif()
459+
460+
if(OMR_GC_MODRON_STANDARD)
461+
target_sources(omrgc_full
462+
PRIVATE
463+
${modronstandard_sources}
464+
)
465+
466+
if(OMR_GC_MODRON_COMPACTION)
467+
target_sources(omrgc_full
468+
PRIVATE
469+
${modroncompaction_sources}
470+
)
471+
endif()
472+
473+
if(OMR_GC_MODRON_CONCURRENT_MARK)
474+
target_sources(omrgc_full
475+
PRIVATE
476+
${modronconcurrentmark_sources}
477+
)
478+
479+
if(OMR_GC_MODRON_SCAVENGER)
480+
target_sources(omrgc_full
481+
PRIVATE
482+
${mcm_modronscavenger_sources}
483+
)
484+
endif()
485+
endif()
486+
487+
if(OMR_GC_CONCURRENT_SWEEP)
488+
target_sources(omrgc_full
489+
PRIVATE
490+
${concurrentsweep_sources}
491+
)
492+
endif()
493+
494+
if(OMR_GC_MODRON_SCAVENGER)
495+
target_sources(omrgc_full
496+
PRIVATE
497+
${modronscavenger_sources}
498+
)
499+
500+
if(OMR_GC_CONCURRENT_SCAVENGER)
501+
target_sources(omrgc_full
502+
PRIVATE
503+
${ms_concurrentscavenger_sources}
504+
)
505+
endif()
506+
endif()
507+
endif()
508+
509+
if(OMR_GC_SEGREGATED_HEAP)
510+
target_sources(omrgc_full
511+
PRIVATE
512+
${segregatedheap_sources}
513+
)
514+
endif()
515+
516+
if(OMR_GC_VLHGC)
517+
target_sources(omrgc_full
518+
PRIVATE
519+
${vlhgc_sources}
520+
)
521+
522+
target_include_directories(omrgc_full
523+
PUBLIC
524+
${vlhgc_include}
525+
)
526+
endif()
527+
528+
add_dependencies(omrgc_full omrgc_hookgen)
529+
530+
target_include_directories(omrgc_full
531+
PUBLIC
532+
${gc_include_public}
533+
INTERFACE
534+
${gc_include_interface}
535+
)
536+
527537
target_link_libraries(omrgc_full
528538
PUBLIC
529539
${gc_link_libraries_public}
@@ -532,10 +542,7 @@ if(OMR_GC_COMPRESSED_POINTERS AND OMR_GC_FULL_POINTERS)
532542
)
533543
set_target_properties(omrgc_full omrgc_hookgen omrgc_tracegen PROPERTIES FOLDER gc)
534544

535-
if(OMR_MIXED_REFERENCES_MODE STREQUAL "static")
536-
target_compile_definitions(omrgc PUBLIC -DOMR_OVERRIDE_COMPRESS_OBJECT_REFERENCES=1)
537-
target_compile_definitions(omrgc_full PUBLIC -DOMR_OVERRIDE_COMPRESS_OBJECT_REFERENCES=0)
538-
endif()
545+
target_compile_definitions(omrgc_full PUBLIC -DOMR_OVERRIDE_COMPRESS_OBJECT_REFERENCES=0)
539546
endif()
540547

541548
if(OMR_GC_API)

gc/api/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ target_compile_features(omrgc
5454
${gc_compile_features}
5555
)
5656

57-
if(OMR_GC_COMPRESSED_POINTERS AND OMR_GC_FULL_POINTERS)
57+
if(OMR_MIXED_REFERENCES_MODE STREQUAL "static")
5858
target_include_directories(omrgc_full
5959
PUBLIC
6060
${gc_include_directories}

0 commit comments

Comments
 (0)