开发者

scons LIBPATH on windows with msys

开发者 https://www.devze.com 2022-12-22 09:04 出处:网络
I\'m working on a C++ project using LLVM and I\'d like to replace the LLVM build system (which uses autoconf and make) with scons. Unfortunately I\'ve now run into a major problem. I want my开发者_如何

I'm working on a C++ project using LLVM and I'd like to replace the LLVM build system (which uses autoconf and make) with scons. Unfortunately I've now run into a major problem. I want my开发者_如何转开发 project to compile on Linux as well as Windows. To compile on Windows I use mingw/msys which works perfectly with the autoconf/make system in place.

However scons modifies my library path and prefixes it with the drive letter, i.e. when I specify /usr/local/lib the actual parameter passed to the linker is -LD:\usr\local\lib which obviously doesn't contain my required libraries. I'm setting the library path in the following way:

env = Environment(LIBPATH = ['/usr/local/lib', 'build/lib/sample'])

Also env['LIBPATH'] still contains the correct path.

Is there any way to prevent scons from messing with that path?

thanks


I figured it out:

env = Environment(LIBPATH = ['/usr/local/lib'], platform = 'posix')

forces scons to initialize the environment for the posix platform which doesn't mess with the paths. Unfortunately it then fails to to find gcc. But this can be easily fixed by explicitly propagating the external environment

env = Environment(LIBPATH = ['/usr/local/lib'], platform = 'posix', ENV = os.environ)
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号