AdeptLanguage / Adept

The Adept Programming Language
GNU General Public License v3.0
120 stars 8 forks source link

Support for `pkg-config` and friends #325

Closed ghost closed 6 months ago

ghost commented 6 months ago

On C/C++, people will do this on the command line. Adept prefers to do all of this in source code. So, I suggest this:

foreign 'pkg-config --libs libfoo'

foreign 'foo-config --libs libfoo'

For example, this is the output of icu-config --ldflags:

-L/clang64/lib -licuin -licuuc -licudt

Adept compiler will have to parse this string to know the location of the libraries and which libraries to link.

IsaacShelton commented 6 months ago

True,

I'm not sure if it's a good idea to allow source code to execute arbitrary commands by default, but something like this with a little security would be nice.

Maybe having someway of opting-in or partially opting-in to arbitrary commands would be good to have,

I am occupied with Adept 3.x right now and other obligations, but feel free to make a PR

ghost commented 6 months ago

This is the tradition on Windows, which is unsuitable for Linux. This thread is only to show how bad this idea is. It's not for no reason that GCC and Clang have no such thing as #pragma comment(lib, "lib") like MSVC.