how can i set the optimization level for a file?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

how can i set the optimization level for a file?

ソリューションへジャンプ
2,908件の閲覧回数
matherinewang
Contributor III

Hi all,

In the KDS, i can set the project optimization level as -O0  -O1 -O2 or - O3.

But i want to modify the optimization level for one file in this project, i right click the file, select properties->c/c++ build->setting, but no optimization level here.

How an i set the optimization for a file, is it already support in KDS?

ラベル(1)
0 件の賞賛
1 解決策
1,405件の閲覧回数
BlackNight
NXP Employee
NXP Employee

Hi Matherine,

use the 'other compiler flags':

pastedImage_0.png

Erich

元の投稿で解決策を見る

0 件の賞賛
3 返答(返信)
1,405件の閲覧回数
tharonhall
Contributor IV

I have used the following #pragma using GCC ARM in Atmel Studio and I am hoping to re-use the technique with my KDS development:

//------------------------------------------------------------------------

//------  Set optimization level for this module  ------------------------

//------  Overrides global settings  -------------------------------------

//------------------------------------------------------------------------

//Values are 0 for no optimization, to 3 for most. "s" is for size

#pragma GCC optimize ("Os")

There is more than one way to express this to GCC, but this is the form I have been using successfully for some time now.

BTW - I am looking for feedback as to the difference between the "Cross ARM Compiler" in KDS and the "GNU ARM Compiler" - Difference between the "Cross ARM C++ Compiler" and the "GNU ARM C++ Compiler"?

0 件の賞賛
1,406件の閲覧回数
BlackNight
NXP Employee
NXP Employee

Hi Matherine,

use the 'other compiler flags':

pastedImage_0.png

Erich

0 件の賞賛
1,405件の閲覧回数
matherinewang
Contributor III

Thanks Erich, It works for me.

0 件の賞賛