Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake: Add export info #3705

Merged
merged 1 commit into from
Apr 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 26 additions & 13 deletions port/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -340,16 +340,12 @@ omr_find_files(resolvedPaths
FILES ${OBJECTS}
)


if(OMR_HOST_OS STREQUAL "win")
list(APPEND resolvedPaths win32/omrsyslogmessages.rc)
endif()

target_sources(omrport_obj PRIVATE ${resolvedPaths})

add_library(omrport STATIC
$<TARGET_OBJECTS:omrport_obj>
)

if(OMR_WARNINGS_AS_ERRORS)
target_compile_options(omrport_obj PRIVATE ${OMR_WARNING_AS_ERROR_FLAG})
Expand All @@ -359,6 +355,32 @@ if(OMR_ENHANCED_WARNINGS)
target_compile_options(omrport_obj PRIVATE ${OMR_ENHANCED_WARNING_FLAG})
endif()

target_include_directories(omrport_obj PRIVATE
../nls
)

# This flag indicates that we are compiling the port library
target_compile_definitions(omrport_obj PRIVATE -DOMRPORT_LIBRARY_DEFINE)

omr_add_exports(omrport_obj
omrport_allocate_library
omrport_create_library
omrport_getSize
omrport_getVersion
omrport_init_library
omrport_isCompatible
omrport_startup_library

)

add_library(omrport STATIC
$<TARGET_OBJECTS:omrport_obj>
)

###
### omrport static lib
###

target_link_libraries(omrport
PUBLIC
omr_base
Expand All @@ -369,15 +391,6 @@ target_link_libraries(omrport
${OMR_THREAD_LIB}
)

target_include_directories(omrport_obj PRIVATE
../nls
)

# This flag indicates that we are compiling the port library
target_compile_definitions(omrport_obj PRIVATE -DOMRPORT_LIBRARY_DEFINE)



#TODO hack to get to compile. Need platform checks
if(NOT OMR_HOST_OS STREQUAL "win")
if(NOT OMR_HOST_OS STREQUAL "zos")
Expand Down
181 changes: 2 additions & 179 deletions thread/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -102,185 +102,6 @@ list(APPEND VPATHS common)
#endif


#TODO need to port following symbol export stuff from Makefile:
#ifeq (zos,$(OMR_HOST_OS))
#define WRITE_ZOS_THREAD_EXPORTS
#@echo omrthread_get_os_errno2 >>$@
#endef
#endif

#ifeq (1,$(OMR_THR_JLM))
#define WRITE_JLM_THREAD_EXPORTS
#@echo omrthread_jlm_init >>$@
#@echo omrthread_jlm_get_gc_lock_tracing >>$@
#endef
#endif

#ifeq (1,$(OMR_THR_ADAPTIVE_SPIN))
#define WRITE_ADAPTIVE_SPIN_THREAD_EXPORTS
#@echo jlm_adaptive_spin_init >>$@
#endef
#endif

#ifeq (1,$(OMR_THR_TRACING))
#define WRITE_TRACING_THREAD_EXPORTS
#@echo omrthread_monitor_dump_trace >>$@
#@echo omrthread_monitor_dump_all >>$@
#@echo omrthread_dump_trace >>$@
#@echo omrthread_reset_tracing >>$@
#endef
#endif

#define WRITE_COMMON_THREAD_EXPORTS
#@echo j9sem_init >>$@
#@echo j9sem_post >>$@
#@echo j9sem_wait >>$@
#@echo j9sem_destroy >>$@
#@echo omrthread_init_library >>$@
#@echo omrthread_shutdown_library >>$@
#@echo omrthread_get_os_errno >>$@
#@echo omrthread_get_errordesc >>$@
#@echo omrthread_current_stack_free >>$@
#@echo omrthread_abort >>$@
#@echo omrthread_attach >>$@
#@echo omrthread_attach_ex >>$@
#@echo omrthread_create >>$@
#@echo omrthread_create_ex >>$@
#@echo omrthread_cancel >>$@
#@echo omrthread_join >>$@
#@echo omrthread_interrupt >>$@
#@echo omrthread_clear_interrupted >>$@
#@echo omrthread_interrupted >>$@
#@echo omrthread_priority_interrupt >>$@
#@echo omrthread_clear_priority_interrupted >>$@
#@echo omrthread_priority_interrupted >>$@
#@echo omrthread_monitor_destroy >>$@
#@echo omrthread_monitor_destroy_nolock >>$@
#@echo omrthread_monitor_flush_destroyed_monitor_list >>$@
#@echo omrthread_monitor_enter >>$@
#@echo omrthread_monitor_get_name >>$@
#@echo omrthread_monitor_enter_abortable_using_threadId >>$@
#@echo omrthread_monitor_enter_using_threadId >>$@
#@echo omrthread_monitor_try_enter >>$@
#@echo omrthread_monitor_try_enter_using_threadId >>$@
#@echo omrthread_monitor_exit >>$@
#@echo omrthread_monitor_exit_using_threadId >>$@
#@echo omrthread_monitor_owned_by_self >>$@
#@echo omrthread_monitor_init_with_name >>$@
#@echo omrthread_monitor_notify >>$@
#@echo omrthread_monitor_notify_all >>$@
#@echo omrthread_monitor_wait >>$@
#@echo omrthread_monitor_wait_timed >>$@
#@echo omrthread_monitor_wait_abortable >>$@
#@echo omrthread_monitor_wait_interruptable >>$@
#@echo omrthread_monitor_num_waiting >>$@
#@echo omrthread_resume >>$@
#@echo omrthread_self >>$@
#@echo omrthread_set_priority >>$@
#@echo omrthread_get_priority >>$@
#@echo omrthread_sleep >>$@
#@echo omrthread_sleep_interruptable >>$@
#@echo omrthread_suspend >>$@
#@echo omrthread_tls_alloc >>$@
#@echo omrthread_tls_alloc_with_finalizer >>$@
#@echo omrthread_tls_free >>$@
#@echo omrthread_tls_get >>$@
#@echo omrthread_tls_set >>$@
#@echo omrthread_yield >>$@
#@echo omrthread_yield_new >>$@
#@echo omrthread_exit >>$@
#@echo omrthread_detach >>$@
#@echo omrthread_global >>$@
#@echo omrthread_global_monitor >>$@
#@echo omrthread_get_flags >>$@
#@echo omrthread_get_state >>$@
#@echo omrthread_get_osId >>$@
#@echo omrthread_get_ras_tid >>$@
#@echo omrthread_get_stack_range >>$@
#@echo omrthread_monitor_init_walk >>$@
#@echo omrthread_monitor_walk >>$@
#@echo omrthread_monitor_walk_no_locking >>$@
#@echo omrthread_rwmutex_init >>$@
#@echo omrthread_rwmutex_destroy >>$@
#@echo omrthread_rwmutex_enter_read >>$@
#@echo omrthread_rwmutex_exit_read >>$@
#@echo omrthread_rwmutex_enter_write >>$@
#@echo omrthread_rwmutex_try_enter_write >>$@
#@echo omrthread_rwmutex_exit_write >>$@
#@echo omrthread_rwmutex_is_writelocked >>$@
#@echo omrthread_park >>$@
#@echo omrthread_unpark >>$@
#@echo omrthread_numa_get_max_node >>$@
#@echo omrthread_numa_set_enabled >>$@
#@echo omrthread_numa_set_node_affinity >>$@
#@echo omrthread_numa_get_node_affinity >>$@
#@echo omrthread_map_native_priority >>$@
#@echo omrthread_set_priority_spread >>$@
#@echo omrthread_set_name >>$@

#@echo omrthread_lib_enable_cpu_monitor >>$@
#@echo omrthread_lib_lock >>$@
#@echo omrthread_lib_try_lock >>$@
#@echo omrthread_lib_unlock >>$@
#@echo omrthread_lib_get_flags >>$@
#@echo omrthread_lib_set_flags >>$@
#@echo omrthread_lib_clear_flags >>$@
#@echo omrthread_lib_control >>$@
#@echo omrthread_lib_use_realtime_scheduling >>$@

#@echo omrthread_attr_init >>$@
#@echo omrthread_attr_destroy >>$@
#@echo omrthread_attr_set_name >>$@
#@echo omrthread_attr_set_schedpolicy >>$@
#@echo omrthread_attr_set_priority >>$@
#@echo omrthread_attr_set_stacksize >>$@
#@echo omrthread_attr_set_category >>$@

#@# for builder use only
#@echo omrthread_monitor_lock >>$@
#@echo omrthread_monitor_unlock >>$@

#@echo omrthread_monitor_pin >>$@
#@echo omrthread_monitor_unpin >>$@

#@echo omrthread_nanosleep >>$@
#@echo omrthread_nanosleep_supported >>$@
#@echo omrthread_nanosleep_to >>$@

#@echo omrthread_get_user_time >>$@
#@echo omrthread_get_self_user_time >>$@
#@echo omrthread_get_cpu_time >>$@
#@echo omrthread_get_cpu_time_ex >>$@
#@echo omrthread_get_self_cpu_time >>$@
#@echo omrthread_get_process_times >>$@

#@echo omrthread_get_handle >>$@
#@echo omrthread_get_stack_size >>$@
#@echo omrthread_get_os_priority >>$@

#@echo omrthread_get_stack_usage >>$@
#@echo omrthread_enable_stack_usage >>$@

#@# process-wide statistics
#@echo omrthread_get_process_cpu_time >>$@
#@echo omrthread_get_jvm_cpu_usage_info >>$@
#@echo omrthread_get_jvm_cpu_usage_info_error_recovery >>$@
#@echo omrthread_get_category >>$@
#@echo omrthread_set_category >>$@

#@# temp for the JIT
#@echo j9thread_self >>$@
#@echo j9thread_tls_get >>$@
#endef

#define WRITE_THREAD_EXPORTS
#$(WRITE_COMMON_THREAD_EXPORTS)
#$(WRITE_ZOS_THREAD_EXPORTS)
#$(WRITE_JLM_THREAD_EXPORTS)
#$(WRITE_ADAPTIVE_SPIN_THREAD_EXPORTS)
#$(WRITE_TRACING_THREAD_EXPORTS)
#endef

omr_find_files(resolvedPaths
PATHS ${VPATHS}
FILES ${OBJECTS}
Expand Down Expand Up @@ -313,6 +134,8 @@ if(OMR_ENHANCED_WARNINGS)
target_compile_options(j9thr_obj PRIVATE ${OMR_ENHANCED_WARNING_FLAG})
endif()

include(exports.cmake)

add_library(j9thrstatic STATIC
$<TARGET_OBJECTS:j9thr_obj>
)
Expand Down
Loading