[cmake-developers] rpath on OS X and clang

Brad King brad.king at kitware.com
Fri Jan 18 14:20:12 EST 2013


Ben,

On 01/18/2013 01:32 PM, Ben Boeckel wrote:
> http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=877f30541da9075dec97cbe76aab13e1ca4a51f0
> diff --git a/Modules/Compiler/Clang.cmake b/Modules/Compiler/Clang.cmake
> index 75a971d..91be8bf 100644
> --- a/Modules/Compiler/Clang.cmake
> +++ b/Modules/Compiler/Clang.cmake
> @@ -23,4 +23,6 @@ include(Compiler/GNU)
>  macro(__compiler_clang lang)
>    __compiler_gnu(${lang})
>    set(CMAKE_${lang}_COMPILE_OPTIONS_PIE "-fPIE")
> +  set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG "-Xlinker -rpath -Xlinker ")
> +  set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG_SEP "")
>  endmacro()

The "-rpath" flag is platform-specific since it goes to the linker so
it does not belong in a Compiler/*.cmake module.  It needs to go in a
Platform/*.cmake module.  It is already present in Linux.cmake for
example.

There is a thread here discussing rpath on OS X:

 http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/2246

For now please revert this commit from next.

Thanks,
-Brad



More information about the cmake-developers mailing list