This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Conditional require in package.xdc

In package.xdc, depending on XDC args, I want to specify a dependency component.

 

If I use this syntax, I get an error.

 

if(cfg_enable_ctc_pp_prof){

  requires testwell.ctc;

}

 

cfg_enable_ctc_pp_prof is defined in config.bld [based on XDC args]. Any suggestions on how else it can be done

 

Regards,

Sujatha

  • Sujatha,
    how does the package you are working on depend on testwell.ctc? Is testwell.ctc referenced in C code, or in .xs files, or in both? What's the condition that determines if testwell.ctc is needed in C files or in .xs files?

    You can accomplish a conditional 'require' statements by loading or not loading testwell.ctc in the function init() in package.xs, but the condition used there depends on how you are using testwell.ctc.