diff options
author | Brad King <brad.king@kitware.com> | 2021-02-03 00:27:09 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2021-02-03 17:26:58 (GMT) |
commit | e017ba046ccab62fcc67e7cf8fc858e991c1d3e7 (patch) | |
tree | 134567db3c1b3b4fab193a75a06413bdf003fe8f /Tests | |
parent | 56fc4a325f08465b725b08b3975cd51bdd2305c8 (diff) | |
download | CMake-e017ba046ccab62fcc67e7cf8fc858e991c1d3e7.zip CMake-e017ba046ccab62fcc67e7cf8fc858e991c1d3e7.tar.gz CMake-e017ba046ccab62fcc67e7cf8fc858e991c1d3e7.tar.bz2 |
AIX: Enable XCOFF editing to replace RPATH on installation
Avoid relinking before installation.
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/RunCMake/CMakeLists.txt | 4 | ||||
-rw-r--r-- | Tests/RunCMake/file-RPATH/RunCMakeTest.cmake | 4 | ||||
-rw-r--r-- | Tests/RunCMake/file-RPATH/XCOFF.cmake | 7 | ||||
-rw-r--r-- | Tests/RunCMake/install/RunCMakeTest.cmake | 10 | ||||
-rw-r--r-- | Tests/RunCMake/install/TARGETS-FILE_RPATH_CHANGE-check-common.cmake | 2 |
5 files changed, 21 insertions, 6 deletions
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index e0804d7..549d8eb 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -358,8 +358,8 @@ add_RunCMake_test(ctest_upload) add_RunCMake_test(ctest_fixtures) add_RunCMake_test(file) add_RunCMake_test(file-CHMOD) -if(HAVE_ELF_H) - add_RunCMake_test(file-RPATH -DHAVE_ELF_H=${HAVE_ELF_H}) +if(HAVE_ELF_H OR CMAKE_SYSTEM_NAME STREQUAL "AIX") + add_RunCMake_test(file-RPATH -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME} -DHAVE_ELF_H=${HAVE_ELF_H}) endif() add_RunCMake_test(find_file) add_RunCMake_test(find_library -DCYGWIN=${CYGWIN}) diff --git a/Tests/RunCMake/file-RPATH/RunCMakeTest.cmake b/Tests/RunCMake/file-RPATH/RunCMakeTest.cmake index 11e90bb..eb7b497 100644 --- a/Tests/RunCMake/file-RPATH/RunCMakeTest.cmake +++ b/Tests/RunCMake/file-RPATH/RunCMakeTest.cmake @@ -3,3 +3,7 @@ include(RunCMake) if(HAVE_ELF_H) run_cmake_command(ELF ${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR}/ELF.cmake) endif() + +if(CMAKE_SYSTEM_NAME STREQUAL "AIX") + run_cmake_command(XCOFF ${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR}/XCOFF.cmake) +endif() diff --git a/Tests/RunCMake/file-RPATH/XCOFF.cmake b/Tests/RunCMake/file-RPATH/XCOFF.cmake new file mode 100644 index 0000000..b570920 --- /dev/null +++ b/Tests/RunCMake/file-RPATH/XCOFF.cmake @@ -0,0 +1,7 @@ +set(names + xcoff32.bin + xcoff64.bin + ) +set(format XCOFF) + +include(${CMAKE_CURRENT_LIST_DIR}/Common.cmake) diff --git a/Tests/RunCMake/install/RunCMakeTest.cmake b/Tests/RunCMake/install/RunCMakeTest.cmake index b067b3a..efd03df 100644 --- a/Tests/RunCMake/install/RunCMakeTest.cmake +++ b/Tests/RunCMake/install/RunCMakeTest.cmake @@ -48,14 +48,16 @@ in directory: endif() endfunction() -# Wrapper for run_cmake() that skips platforms that are non-ELF or have no RPATH support -function(run_cmake_ELFRPATH_only case) - if(UNIX AND CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG AND CMAKE_EXECUTABLE_FORMAT STREQUAL "ELF") +# Wrapper for run_cmake() that skips platforms on which we do not support editing the RPATH. +function(run_cmake_EDIT_RPATH_only case) + if(UNIX AND CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG AND CMAKE_EXECUTABLE_FORMAT MATCHES "^(ELF|XCOFF)$") run_cmake(${case}) else() # Sanity check against a platform known to be ELF-based if(CMAKE_SYSTEM_NAME STREQUAL "Linux") message(FATAL_ERROR "Expected platform Linux to advertize itself as ELF-based, but it did not.") + elseif(CMAKE_SYSTEM_NAME STREQUAL "AIX") + message(FATAL_ERROR "Expected platform AIX to advertize itself as XCOFF-based, but it did not.") else() message(STATUS "${case} - SKIPPED (No ELF-based platform found)") endif() @@ -63,7 +65,7 @@ function(run_cmake_ELFRPATH_only case) endfunction() run_cmake(TARGETS-FILE_RPATH_CHANGE-old_rpath) -run_cmake_ELFRPATH_only(TARGETS-FILE_RPATH_CHANGE-new_rpath) +run_cmake_EDIT_RPATH_only(TARGETS-FILE_RPATH_CHANGE-new_rpath) run_cmake(DIRECTORY-MESSAGE_NEVER) run_cmake(DIRECTORY-PATTERN-MESSAGE_NEVER) run_cmake(DIRECTORY-message) diff --git a/Tests/RunCMake/install/TARGETS-FILE_RPATH_CHANGE-check-common.cmake b/Tests/RunCMake/install/TARGETS-FILE_RPATH_CHANGE-check-common.cmake index 673fdde..6b2faa3 100644 --- a/Tests/RunCMake/install/TARGETS-FILE_RPATH_CHANGE-check-common.cmake +++ b/Tests/RunCMake/install/TARGETS-FILE_RPATH_CHANGE-check-common.cmake @@ -22,6 +22,8 @@ macro(skip_without_rpath_change_rule) # Sanity check against a platform known to generate a file(RPATH_CHANGE) rule if(CMAKE_SYSTEM_NAME STREQUAL "Linux") message(FATAL_ERROR "Expected generated file(RPATH_CHANGE) rule on platform Linux.") + elseif(CMAKE_SYSTEM_NAME STREQUAL "AIX") + message(FATAL_ERROR "Expected generated file(RPATH_CHANGE) rule on platform AIX.") else() message(STATUS "${test} - All checks skipped. No file(RPATH_CHANGE) rule found on this platform.") return() |