codec 增加lib库的参考

var Build = xdc.useModule('xdc.bld.BuildEnvironment');
var Pkg = xdc.useModule('xdc.bld.PackageContents');
var Executable = xdc.useModule('xdc.bld.Executable');

var TEST_NAMES = ["CalcTest"];

Pkg.otherFiles = [java.lang.System.getenv("TIDSP_REPO_ROOT") + "/ti_libs/IQmath/lib/IQmath_c64x+.lib"];

for each (var targ in Build.targets) {
    for each (var testName in TEST_NAMES)
    {
       Pkg.addRepository(java.lang.System.getenv("TIDSP_REPO_ROOT") + "/MyCompanyLibs/packages/");
       Pkg.addExecutable(testName, targ, targ.platform).addObjects([testName + ".c"]);
    }
}
I think you wanted to add this library to the link line of the 
executable. This can be done as follows:
/* define IQ lib location */
var IQLIB = java.lang.System.getenv("TIDSP_REPO_ROOT")
+ "/ti_libs/IQmath/lib/IQmath_c64x+.lib";

/* define linker options necessary to use IQ lib */
var attrs = {lopts: '-l "' + IQLIB + '"'};

/* use these linker options when creating the following test */
var exe = Pkg.addExecutable(testName, targ, targ.platform, attrs);
exe.addObjects([testName + ".c"]);

If all executables in your package need to use IQLIB you can simplify 
this (like the -I above) by simply setting Pkg.attrs.lopts:
Pkg.attrs.lopts = '-l "' + IQLIB + '"';

> for each (var targ in Build.targets) {
> for each (var testName in TEST_NAMES)
> {
> Pkg.addRepository(java.lang.System.getenv("TIDSP_REPO_ROOT") +
> "/MyCompanyLibs/packages/");
Pkg.addRepository() is used to add a repository into the current 
package. Again, I don't think this is what you wanted to do and the 
line above should be removed.

> Pkg.addExecutable(testName, targ, targ.platform).addObjects([testName +
> ".c"]);
> }
> }
>
>
> Thanks for your time.

In summary, I think you want something like the following:

var Build = xdc.useModule('xdc.bld.BuildEnvironment');
var Pkg = xdc.useModule('xdc.bld.PackageContents');

var ROOT = java.lang.System.getenv("TIDSP_REPO_ROOT");
var IQLIB = ROOT + "/ti_libs/IQmath/lib/IQmath_c64x+.lib";
var IQINC = ROOT + "/ti_libs/IQmath/include";

Pkg.attrs.incs = '-I "' + IQINC + '"';
Pkg.attrs.lopts = '-l "' + IQLIB + '"';

var TEST_NAMES = ["CalcTest"];

for each (var targ in Build.targets) {
for each (var testName in TEST_NAMES)
{
Pkg.addExecutable(testName,
targ, targ.platform).addObjects([testName + ".c"]);
}
}





  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值