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: rework platform handling in port library #5268

Merged
merged 1 commit into from
Apr 3, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
101 changes: 77 additions & 24 deletions runtime/port/CMakeLists.txt
Expand Up @@ -31,33 +31,57 @@


set(OBJECTS "")
list(APPEND OBJECTS
list(APPEND OBJECTS
j9gp.c
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can these lists be kept in alphabetical order?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I just reordered so that it would match the module.xml. I'm assuming I should reorder that as well?

j9gs.c
j9hypervisor.c
j9hypervisor_common.c
j9ipcmutex.c
j9SysvIPCWrappers.c
j9mem_basic.c
j9port.c
j9portcontrol.c
j9process.c
j9gs.c
j9gp.c
j9sharedhelper.c
j9shmem.c
j9shsem.c
j9shsem_deprecated.c
j9sock.c
j9sockptb.c
j9sysinfo.c
j9sysinfo_helpers.c
j9mem_basic.c
j9portcontrol.c
)
if(OMR_ARCH_X86)
list(APPEND OBJECTS
j9hypervisor_i386.c
j9sysinfo_helpers.c
)
list(APPEND OBJECTS j9hypervisor_i386.c)
elseif(OMR_ARCH_POWER)
list(APPEND OBJECTS j9hypervisor_systemp.c)
elseif(OMR_ARCH_S390)
list(APPEND OBJECTS
j9gs_s390.c
j9hypervisor_systemz.c
)
endif()

if(OMR_ARCH_X86 OR OMR_ARCH_S390)
DanHeidinga marked this conversation as resolved.
Show resolved Hide resolved
list(APPEND OBJECTS j9sysinfo_helpers.c)
endif()

if(OMR_OS_ZOS)
list(APPEND OBJECTS
j9csrsi.c
j9csrsi_wrp.s
j9gs_get_supported.s
j9gs_load_gscb.s
j9gs_store_gscb.s
j9guardedstorage.mc
j9mprotect.s
j9munprotect.s
protect_helpers.c
)
endif()

if(NOT OMR_OS_WINDOWS)
list(APPEND OBJECTS
j9sharedhelper.c
j9SysvIPCWrappers.c
)
endif()

if(J9VM_PORT_RUNTIME_INSTRUMENTATION)
Expand All @@ -67,18 +91,31 @@ endif()
set(resolvedPaths "")
set(VPATH "")

if(OMR_ARCH_X86) #TODO and linux
list(APPEND VPATH linuxamd64)
elseif(OMR_ARCH_POWER) #TODO and linux
list(APPEND VPATH linuxppc)
if(OMR_OS_LINUX)
if(OMR_ARCH_X86 AND OMR_ENV_DATA64)
list(APPEND VPATH linuxamd64)
elseif(OMR_ARCH_POWER)
list(APPEND VPATH linuxppc)
elseif(OMR_ARCH_S390)
list(APPEND VPATH linuxs390)
endif()
list(APPEND VPATH linux)
elseif(OMR_OS_WINDOWS)
list(APPEND VPATH win32)
elseif(OMR_OS_AIX)
list(APPEND VPATH aix)
elseif(OMR_OS_ZOS)
list(APPEND VPATH zos390)
endif()

list(APPEND VPATH
linux
sysvipc
unix
common
)
if(NOT OMR_OS_WINDOWS)
list(APPEND VPATH
sysvipc
unix
)
endif()

list(APPEND VPATH common)

omr_find_files(resolvedPaths
PATHS
Expand Down Expand Up @@ -109,6 +146,16 @@ target_link_libraries(j9prt
j9thr
${CMAKE_DL_LIBS}
)
if(OMR_OS_WINDOWS)
target_link_libraries(j9prt
PRIVATE
Ws2_32.lib
shell32.lib
Iphlpapi.lib
psapi.lib
pdh.lib
DanHeidinga marked this conversation as resolved.
Show resolved Hide resolved
)
endif()

if(OMR_NEED_LIBRT)
target_link_libraries(j9prt PRIVATE rt)
Expand All @@ -119,10 +166,16 @@ target_compile_definitions(j9prt
-DJ9PORT_LIBRARY_DEFINE
)

target_include_directories(j9prt
PRIVATE
if(OMR_OS_WINDOWS)
target_include_directories(j9prt PRIVATE win32_include)
else()
target_include_directories(j9prt PRIVATE
unix
unix_include
)
endif()

target_include_directories(j9prt
PUBLIC
include
common
Expand Down
68 changes: 30 additions & 38 deletions runtime/port/module.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>

<!--
Copyright (c) 2006, 2018 IBM Corp. and others
Copyright (c) 2006, 2019 IBM Corp. and others

This program and the accompanying materials are made available under
the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -49,8 +49,31 @@
</xi:include>

<objects group="all">
<object name="j9csrsi">
<include-if condition="spec.zos_390.*"/>
</object>
<object name="j9csrsi_wrp">
<include-if condition="spec.zos_390.*"/>
</object>
<object name="j9gp" />

<object name="j9gs"/>
<object name="j9gs_get_supported">
<include-if condition="spec.zos_390.*"/>
</object>
<object name="j9gs_load_gscb">
<include-if condition="spec.zos_390.*"/>
</object>
<object name="j9gs_s390">
<include-if condition="spec.linux_390.*"/>
<include-if condition="spec.zos_390.*"/>
<include-if condition="spec.linux_ztpf.*"/>
</object>
<object name="j9gs_store_gscb">
<include-if condition="spec.zos_390.*"/>
</object>
<object name="j9guardedstorage">
<include-if condition="spec.zos_390.*"/>
</object>
<object name="j9hypervisor"/>
<object name="j9hypervisor_common"/>
<object name="j9hypervisor_i386" >
Expand All @@ -71,8 +94,8 @@
<include-if condition="spec.linux_390.*"/>
<include-if condition="spec.linux_390-64.*"/>
</object>

<object name="j9ipcmutex" />
<object name="j9mem_basic" />
<object name="j9mprotect">
<include-if condition="spec.zos_390.*"/>
<exclude-if condition="spec.zos_390-64.*"/>
Expand All @@ -81,52 +104,20 @@
<include-if condition="spec.zos_390.*"/>
<exclude-if condition="spec.zos_390-64.*"/>
</object>
<object name="j9SysvIPCWrappers">
<exclude-if condition="spec.win_x86.*"/>
</object>

<object name="j9port" />
<object name="j9portcontrol" />
<object name="j9process" />
<object name="j9gs"/>
<object name="j9guardedstorage">
<include-if condition="spec.zos_390.*"/>
</object>
<object name="j9gs_get_supported">
<include-if condition="spec.zos_390.*"/>
</object>
<object name="j9gs_load_gscb">
<include-if condition="spec.zos_390.*"/>
</object>
<object name="j9gs_store_gscb">
<include-if condition="spec.zos_390.*"/>
</object>
<object name="j9csrsi">
<include-if condition="spec.zos_390.*"/>
</object>
<object name="j9csrsi_wrp">
<include-if condition="spec.zos_390.*"/>
</object>
<object name="j9gs_s390">
<include-if condition="spec.linux_390.*"/>
<include-if condition="spec.zos_390.*"/>
<include-if condition="spec.linux_ztpf.*"/>
<exclude-if condition="spec.linux_x86.*"/>
<exclude-if condition="spec.win_x86.*"/>
</object>
<object name="j9ri">
<include-if condition="spec.flags.port_runtimeInstrumentation"/>
</object>

<object name="j9sharedhelper">
<exclude-if condition="spec.win_x86.*"/>
</object>
<object name="j9shmem" />
<object name="j9shsem" />
<object name="j9shsem_deprecated" />

<object name="j9sock" />
<object name="j9sockptb" />

<object name="j9sysinfo" />
<object name="j9sysinfo_helpers">
<include-if condition="spec.linux_x86.*"/>
Expand All @@ -135,8 +126,9 @@
<include-if condition="spec.zos_390.*"/>
<include-if condition="spec.osx_x86.*"/>
</object>
<object name="j9mem_basic" />
<object name="j9portcontrol" />
<object name="j9SysvIPCWrappers">
<exclude-if condition="spec.win_x86.*"/>
</object>
<object name="protect_helpers">
<include-if condition="spec.zos_390.*"/>
<exclude-if condition="spec.zos_390-64.*"/>
Expand Down