Skip to content

Commit

Permalink
Merge pull request #4245 from dnakamura/zos_exports
Browse files Browse the repository at this point in the history
CMake: Automatically copy export side deck on z/OS
  • Loading branch information
fjeremic authored Sep 3, 2019
2 parents dfcd4b8 + edade7a commit 00f3ecf
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
13 changes: 13 additions & 0 deletions cmake/modules/platform/toolcfg/xlc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,19 @@ if(OMR_OS_ZOS)
PRIVATE
-Wc,DLL,EXPORTALL
)

# Copy the export side deck
string(FIND "${CMAKE_SHARED_LIBRARY_SUFFIX}" "." dot_pos REVERSE)
string(SUBSTRING "${CMAKE_SHARED_LIBRARY_SUFFIX}" 0 "${dot_pos}" lib_suffix)

# The name of the export side deck, as generated by the compiler
set(compiler_export_name "${CMAKE_SHARED_LIBRARY_PREFIX}${TARGET_NAME}${lib_suffix}.x")
# The name of the export side deck, as desired by cmake
set(cmake_export_name "${CMAKE_IMPORT_LIBRARY_PREFIX}${TARGET_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX}")

add_custom_command(TARGET ${TARGET_NAME} POST_BUILD
COMMAND "${CMAKE_COMMAND}" -E copy "${compiler_export_name}" "$<TARGET_FILE_DIR:${TARGET_NAME}>/${cmake_export_name}"
)
endfunction()
else()
function(_omr_toolchain_process_exports TARGET_NAME)
Expand Down
6 changes: 0 additions & 6 deletions omrsigcompat/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,6 @@ if(OMR_HOST_OS MATCHES "linux|osx")
endif()
if(OMR_HOST_OS STREQUAL "zos")
target_link_libraries(omrsig PRIVATE j9a2e)

add_custom_command(TARGET omrsig
POST_BUILD
COMMAND cp -f libomrsig.x ${CMAKE_BINARY_DIR}/libomrsig.x
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
endif()
#TODO ensure we are linking in the same way as source makefile:
#MODULE_STATIC_LIBS += omrutil
Expand Down
7 changes: 2 additions & 5 deletions util/a2e/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,7 @@ target_include_directories(j9a2e
.
)

add_custom_command(TARGET j9a2e
POST_BUILD
COMMAND cp -f libj9a2e.x ${CMAKE_BINARY_DIR}/libj9a2e.x
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
omr_process_exports(j9a2e)

install(
TARGETS j9a2e
Expand All @@ -68,5 +64,6 @@ install(

set_property(TARGET j9a2e PROPERTY FOLDER util)


target_enable_ddr(j9a2e)
ddr_set_add_targets(omrddr j9a2e)

0 comments on commit 00f3ecf

Please sign in to comment.