-
Notifications
You must be signed in to change notification settings - Fork 209
-
Notifications
You must be signed in to change notification settings - Fork 209
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to inject build option (e.g. -fPIC) on Linux #2
Comments
Scons doesn't permit environment variables to override its internal environment by default. However, I can see why that would be useful as a vendor providing a library to a third party. I have a fix which I'm in the process of testing on my array of build servers now. I am exposing the following: 'CC', 'CXX', 'CFLAGS', 'CXXFLAGS', 'ARFLAGS' |
that sounds pretty good! |
Okay, I pushed the improvement after testing in 5 build environments. I think having the ability to set these values from the command line is useful, but I don't think it gets you all the way to a shared lib. We've been talking on Twitter, but for the sake of others who come across this, there are a couple of challenges related to getting NFD compiling as a shared library. As far as Scons is concerened, turning the nfd_env.StaticLibrary() call into nfd_env.SharedLibrary() should do the trick. As you mentioned, the free() call would fail on Windows, as DLLs do not share heap space. If someone wants to take the plunge and do a full .so patch, I would take a good look at merging that! |
Thanks :) |
I need to build NFD as part of a shared object on Linux, which makes it necessary to build libnfd.a with the -fPIC option; For Makefile-, CMake- or Premake-based projects, I usually just set CFLAGS/CXXFLAGS in the environment, and that propagates to the Makefile. However, SCons seems to ignore environment variables.
Is there a possibility to build the library with -fPIC or other manual build options without patching SConstruct?
The text was updated successfully, but these errors were encountered: