Skip to content

Commit

Permalink
CMake: adjust zos export handling
Browse files Browse the repository at this point in the history
We want to apply the DLL and EXPORTALL options to all targets, not just
shared libraries

Signed-off-by: Devin Nakamura <devinn@ca.ibm.com>
  • Loading branch information
dnakamura committed Sep 12, 2019
1 parent cf57e78 commit dcd5406
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions cmake/modules/platform/toolcfg/xlc.cmake
Expand Up @@ -175,17 +175,18 @@ set(SPP_FLAGS -E -P)

if(OMR_OS_ZOS)
function(_omr_toolchain_process_exports TARGET_NAME)
# We only need to do something if we are dealing with a shared library
get_target_property(target_type ${TARGET_NAME} TYPE)
if(NOT target_type STREQUAL "SHARED_LIBRARY")
return()
endif()

# Any type of target which says it has exports should get the DLL, and EXPORTALL
# compile flags
target_compile_options(${TARGET_NAME}
PRIVATE
-Wc,DLL,EXPORTALL
)

# only shared libraries will generate an export side deck
get_target_property(target_type ${TARGET_NAME} TYPE)
if(NOT target_type STREQUAL "SHARED_LIBRARY")
return()
endif()
# 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)
Expand Down

0 comments on commit dcd5406

Please sign in to comment.