Author Topic: How to set up compiler/linker settings from a file or command  (Read 3413 times)

Offline ppanish

  • Single posting newcomer
  • *
  • Posts: 4
What's the best way to include a large list of command line options (say from a file) in a project build?

For example, in a command line where I would normally use `pkg-config --cflags --libs lib_name`as part of the compiler command line options. Is there a way to use the command directly, or alternatively to include a file with the include and library paths that's been generated with such a command?

I've added these line by line in the Project Build Options linker settings and search directories, but this is fairly painful and I suspect there's a better way to do it.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: How to set up compiler/linker settings from a file or command
« Reply #1 on: July 13, 2012, 11:58:51 pm »
Backtick expanding is supported by C::B on all platforms, so it should work out of the box.

You have to split the command in the compiler and the linker part and put it in the appropriate section of the projects build options: "Compiler options -> Other options" and "Linker settings -> Other linker options", because C::B does compiling and linking always in two steps.

Offline ppanish

  • Single posting newcomer
  • *
  • Posts: 4
Re: How to set up compiler/linker settings from a file or command
« Reply #2 on: July 14, 2012, 02:35:24 pm »
Thanks for the hint, it worked perfectly.