[CMake] How to set own linker?
Martin Kupke
martin.kupke at novero.com
Fri Sep 23 07:46:22 EDT 2011
In my cross compiling environment I have an own Platform folder which
contains a Generic-dcc file, in this file I added the statement:
set(CMAKE_C_LINK_EXECUTABLE "${COMPILER_PATH}/dld.exe") and now it seems
that the dld.exe is used as linker.
My next problem is, that my linker flags are not used.
I tried to set CMAKE_EXE_LINKER_FLAGS, but this doesn't work.
On 23.09.11 11:08, Martin Kupke wrote:
> If I am using a cross linker, mine is the dld.exe..
> How do I incorporate it into the CMake process?
> As I could figure out CMake assumes that the compiler itself will do the linking.
>
>
> On 22.09.11 18:09, Martin Kupke wrote:
>> Hi,
>>
>> I created a toolchain file for cross compiling in my Windows XP
>> environment.
>> To provide cross compiling functionality I set the CMAKE_SYSTEM_NAME to
>> Generic.
>> The toolchain file contains the variables:
>> CMAKE_C_COMPILER set to my own wanted compiler, which is dcc.exe
>> CMAKE_ASM_OCU_COMPILER set to my own wanted assembler, which is das.exe
>> For both, assembler and compiler I created configuration files in the
>> Platform folder.
>> Up to this point everything goes fine and as wanted, the assembler
>> source files with the .s extension are compiled with das.exe and the C
>> source files with the extension .c are compiled with the dcc.exe.
>>
>> In the root top level CMakeLists.txt the instruction
>> project( EmbeddedProject C ASM_OCU)
>> ensures that only C compiler and ASM_OCU assembler are called (no CXX).
>>
>> Even in the root top level CMakeLists.txt I set
>> add_executable( ${PROJECT_NAME} ${SourceFiles} )
>> where SourceFiles is a string containing all source files (assembler and C).
>>
>> I even tried to set the CMAKE_LINKER variable to my own linker, but it
>> isn't used.
>> Where is my fault?
>>
>> Thanks,
>> Martin...
>>
>>
>> --
>>
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.cmake.org/mailman/listinfo/cmake
More information about the CMake
mailing list