0

I have a mixed language project like this: -- asm/file1.asm -- include/file2.h -- src/file3.c, file4.c -- linkscripts/file5.lds -- build/ -- bin/
I want to build demo.elf format file and convert it to demo.bin using objcopy. Also, I want to get file1.o, file3.o and file4.o files and use the file5.lds script file to link.

The assembler is NASM and the compiler is GCC, how to write the CMakeLists.txt file? please help me.

  • You want to create a CMake project. But what is a **problem**? Just a request to help you to write a `CMakeLists.txt` doesn't make you question post valid. Do you able to compile an `.asm` file? If not, have you tried to **search** for that topic? Have you checked [that question](https://stackoverflow.com/questions/15132185/mixing-c-and-assembly-sources-and-build-with-cmake)? Do you able to use your custom linker script with CMake? If not, have tried to search? E.g. [that question](https://stackoverflow.com/questions/42978674/how-to-use-specific-link-script-lds-with-cmake). And so on. – Tsyvarev Jun 26 '21 at 12:36

0 Answers0