How to change static .lib file according to Preprocessor Flag with C code before compiling code

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

How to change static .lib file according to Preprocessor Flag with C code before compiling code

453 次查看
burhanhagi
Contributor V

Hi,

I am working on a LCD Display Project with Embedded Wizard.  I may use Display setting as one of the the rotations 0, 90, 180 or 270 degree.

Embedded wizard gives us 4 different libewgfx-m7-RotationDegree-gcc.a files in folder as in below SS.

burhanhagi_0-1746542369633.png

 

According to my needs, I am using one of the above libewgfx-m7-gcc.a files only. To use it; I decide and later include which lib file I am using within MCUXPresso IDE as follows;

burhanhagi_1-1746542682942.png

So, if I want to useDisplay as 90 degree Screen Orientation, I open above window under Properties by manually and  I just move libewgfx-m7-r90-gcc.a lib to the uppermost of the list. After applying this change and closing the window, I am building the the project.

Now I want to link any of these 4 files to a Preprocessor Defined Symbol within code. According to the Preprocessor Symbol status, I will include one of out of 4 libs to my C code like conditional #if #else #endif statement. Later than I will compile the whole project. So I do not want to manually move lib up or down from "Properties Window" each time.

I do not know it may be easier but I could not find it how I will do that in MCUXPresso. Thanks a lot in advance.

 

0 项奖励
回复
1 回复

382 次查看
diego_charles
NXP TechSupport
NXP TechSupport

Hi @burhanhagi 

I am sorry for the delayed response.  I do not have examples or guidelines to help you.

With our eclipse based IDEs you where already doing the typical process  . In this ARM community post there are some guidelines, for what I think is to invoke using arm-none-eabi-gcc commands to create and convert .a files and then linking them. As the user who replied the complicated thing is to create the LD files to link the .a files . So with the IDE if you want to use macros to select which .a you want to use, I believe you will have to manually edit the ld files, and disable MCUxpresso's managed linker script option. 

Diego

0 项奖励
回复