diff options
author | Brad King <brad.king@kitware.com> | 2009-06-19 21:09:36 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2009-06-19 21:09:36 (GMT) |
commit | b4b52451aeb5f63d47eff4d3812dfef68ada3a20 (patch) | |
tree | fa72bcc2a42ebb4cd54f6a321f076dad1d1bb698 /Modules/Platform/HP-UX.cmake | |
parent | 1beb41a89877f569161009bf71e8d5242bddea7c (diff) | |
download | CMake-b4b52451aeb5f63d47eff4d3812dfef68ada3a20.zip CMake-b4b52451aeb5f63d47eff4d3812dfef68ada3a20.tar.gz CMake-b4b52451aeb5f63d47eff4d3812dfef68ada3a20.tar.bz2 |
BUG: Look in arch-specific HPUX implicit link dirs
On HP-UX machines some system libraries appear in architecture-specific
implicit linker search paths. We need to add these paths to our system
library search path. However, at the time we construct the search path
we do not know the target architecture.
A full solution requires re-organizing platform configuration files so
that the target architecture can be known when needed. Until that
happens we can avoid the problem by searching in both 32-bit and 64-bit
implicit link directories. By telling CMake that they are implicit
directories the generated link lines will never pass the paths, leaving
the linker free to find the library of the proper architecture even if
the find_library call finds the wrong one.
Diffstat (limited to 'Modules/Platform/HP-UX.cmake')
-rw-r--r-- | Modules/Platform/HP-UX.cmake | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/Modules/Platform/HP-UX.cmake b/Modules/Platform/HP-UX.cmake index 8089674..9584cbd 100644 --- a/Modules/Platform/HP-UX.cmake +++ b/Modules/Platform/HP-UX.cmake @@ -88,13 +88,19 @@ ELSE(CMAKE_COMPILER_IS_GNUCXX) SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-g") ENDIF(CMAKE_COMPILER_IS_GNUCXX) # set flags for gcc support -IF(CMAKE_SIZEOF_VOID_P EQUAL 4) - LIST(APPEND CMAKE_SYSTEM_LIBRARY_PATH /usr/lib/hpux32) -ELSE(CMAKE_SIZEOF_VOID_P EQUAL 4) - LIST(APPEND CMAKE_SYSTEM_LIBRARY_PATH /usr/lib/hpux64) -ENDIF(CMAKE_SIZEOF_VOID_P EQUAL 4) INCLUDE(Platform/UnixPaths) +# Look in both 32-bit and 64-bit implict link directories, but tell +# CMake not to pass the paths to the linker. The linker will find the +# library for the proper architecture. In the future we should detect +# which path will be used by the linker. Since the pointer type size +# CMAKE_SIZEOF_VOID_P is not set until after this file executes, we +# would need to append to CMAKE_SYSTEM_LIBRARY_PATH at a later point +# (after CMakeTest(LANG)Compiler.cmake runs for at least one language). +LIST(APPEND CMAKE_SYSTEM_LIBRARY_PATH /usr/lib/hpux32) +LIST(APPEND CMAKE_SYSTEM_LIBRARY_PATH /usr/lib/hpux64) +LIST(APPEND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES + /usr/lib/hpux32 /usr/lib/hpux64) IF(NOT CMAKE_COMPILER_IS_GNUCC) SET (CMAKE_C_CREATE_PREPROCESSED_SOURCE "<CMAKE_C_COMPILER> <DEFINES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>") |