c_cpp_project_framework icon indicating copy to clipboard operation
c_cpp_project_framework copied to clipboard

Is it posiible to integrate the framework with armcc?

Open EdXian opened this issue 1 year ago • 5 comments

Hi @Neutree ,

I'm glad to find this project on github. I wonder to know does this project supports armcc compiler (also named as arm compiler 5). Arm compiler dosent support conventional gcc name. For example the c compiler is named as armcc while the linker is armlink. I think it is not just a simple way to create the project by typing: python project.py --toolchain /opt/toolchain/bin --toolchain-prefix arm config

Can i specify a specific compiler name when config the project?

Thanks a lot!

Best Regards, Edxian

EdXian avatar Feb 03 '25 08:02 EdXian

https://github.com/Neutree/c_cpp_project_framework/blob/435427099998a90fa61e27af48a6565da82a29fe/tools/cmake/compile.cmake#L348-L384

so,you can write your own toolchain config cmake file, and set --toolchain arg with your .cmake config file, or just edit this cmake file.

Neutree avatar Feb 05 '25 02:02 Neutree

Let me try it!

EdXian avatar Feb 06 '25 01:02 EdXian

Hi @Neutree , Thank you for your help. I finally built the project with armcc successfully by the following modification:

  1. cd example/demo
  2. create an armcc.cmake in example/demo
set(CMAKE_SYSTEM_NAME Generic)
set(CMAKE_SYSTEM_PROCESSOR arm)
set(CMAKE_C_COMPILER  armcc) 
set(CMAKE_ASM_COMPILER  armasm)
set(CMAKE_LINKER armlink)
set(CMAKE_OBJCOPY fromelf)
set(CMAKE_C_COMPILER_WORKS 1)
  1. try to type the script python project.py config --toolchain armcc.cmake -G "Ninja" --verbose
  2. python project.py menuconfig
  3. python project.py build

But I still want to ask a question. Why the framework tries to pass ADD_DEFINITIONS to both compile option and link option instead of seperating the definition into different flags? For example ADD_COMPILE_DEFINITION is for target_compile_options while ADD_LINK_DEFINITION is for target_link_options

Best Regards, edxian

EdXian avatar Feb 06 '25 10:02 EdXian

ADD_DEFINITIONS add for both compile and link, I think it will reduce some bug like forget to add link flag, but it may not totally correct way, you can add ADD_COMPILE_DEFINITION and ADD_LINK_DEFINITION by yourself

Neutree avatar Feb 08 '25 03:02 Neutree

Got it! Thanks you for your advice.

EdXian avatar Feb 08 '25 06:02 EdXian