[cmake-developers] Cross-compiling with clang

Brad King brad.king at kitware.com
Thu Jun 13 08:57:03 EDT 2013


On 06/11/2013 07:35 AM, Stephen Kelly wrote:
>  # CMake workarounds
>  set(CMAKE_EXE_LINKER_FLAGS ${CMAKE_TOOLCHAIN_LINK_FLAGS} CACHE INTERNAL "exe link flags")
>  set(CMAKE_MODULE_LINKER_FLAGS ${CMAKE_TOOLCHAIN_LINK_FLAGS} CACHE INTERNAL "module link flags")
>  set(CMAKE_SHARED_LINKER_FLAGS ${CMAKE_TOOLCHAIN_LINK_FLAGS} CACHE INTERNAL "shared link flags")
[snip]
> The CMake workarounds are needed because I don't think there's a convenient 
> alternative way to specify the -L and -B flags that clang needs.

The LDFLAGS environment variable should put link flags everywhere.

Shouldn't you create a platform file that sets
CMAKE_*_LINKER_FLAGS_INIT appropriately?

-Brad



More information about the cmake-developers mailing list