summaryrefslogtreecommitdiffstats
path: root/Modules/Platform/HP-UX-HP.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2011-12-12 21:37:12 (GMT)
committerBrad King <brad.king@kitware.com>2011-12-14 14:32:27 (GMT)
commit5720e1f634b0253013b1887a924492f3dd29f012 (patch)
tree6393e0c9ce4600ded5bb55468f487c2e96bf14ab /Modules/Platform/HP-UX-HP.cmake
parent6fb2a38b0a672959a7ecc8fe4d07350371486310 (diff)
downloadCMake-5720e1f634b0253013b1887a924492f3dd29f012.zip
CMake-5720e1f634b0253013b1887a924492f3dd29f012.tar.gz
CMake-5720e1f634b0253013b1887a924492f3dd29f012.tar.bz2
HP: Drive shared library linking with compiler front end
Previously we linked C, Fortran, and ASM shared libraries compiled with the HP compiler using a direct invocation of the linker (ld). This behavior was left historically from support for an ancient HP C compiler that did not know how to create shared libraries. Fortran shared libraries need to be linked with the compiler to get the language runtime library dependencies as is already done for C++. Update the HP-UX-HP* platform information to use the compiler front end when linking shared libraries. This works on modern HP tools and produces correct behavior. If there is a need to support older tools again we can add a special case for them.
Diffstat (limited to 'Modules/Platform/HP-UX-HP.cmake')
-rw-r--r--Modules/Platform/HP-UX-HP.cmake10
1 files changed, 3 insertions, 7 deletions
diff --git a/Modules/Platform/HP-UX-HP.cmake b/Modules/Platform/HP-UX-HP.cmake
index 5e70d31..bce0a8b 100644
--- a/Modules/Platform/HP-UX-HP.cmake
+++ b/Modules/Platform/HP-UX-HP.cmake
@@ -17,18 +17,14 @@ if(__HPUX_COMPILER_HP)
return()
endif()
set(__HPUX_COMPILER_HP 1)
-set(_Wl_C "")
-set(_Wl_CXX "-Wl,")
-set(_Wl_Fortran "")
-set(_Wl_ASM "")
macro(__hpux_compiler_hp lang)
set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "+Z")
+ set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-Wl,-E,+nodefaultrpath -b -L/usr/lib")
set(CMAKE_SHARED_LIBRARY_LINK_${lang}_FLAGS "-Wl,+s,-E,+nodefaultrpath")
- set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG "${_Wl_${lang}}+b")
+ set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG "-Wl,+b")
set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG_SEP ":")
- set(CMAKE_SHARED_LIBRARY_SONAME_${lang}_FLAG "${_Wl_${lang}}+h")
- set(CMAKE_EXECUTABLE_RUNTIME_${lang}_FLAG "-Wl,+b")
+ set(CMAKE_SHARED_LIBRARY_SONAME_${lang}_FLAG "-Wl,+h")
set(CMAKE_${lang}_FLAGS_INIT "")
endmacro()