Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6085127
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:36:14+00:00 2026-05-23T11:36:14+00:00

I use a wrapper method to combine static libraries as shown below. def MergeLibs(env,

  • 0

I use a wrapper method to combine static libraries as shown below.

def MergeLibs(env, tgt, src_list)
....
    return lib

and used as,

lib = env.MergeLibs(tgt, src_lists)
env.Depends(lib, <path_to_lib1>)
...
env.Depends(lib, <path_to_libn>)

But MergeLibs() method is being executed in scons parse phase itself.

How can I use dependencies here.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T11:36:15+00:00Added an answer on May 23, 2026 at 11:36 am

    Well I’m not too sure on the details of the MergeLib step but it seems like you would want something else to depend on your merge lib step.. like your final program?

    import SCons
    
    env = Environment()
    
    def merge_libs(self, target, source, env):
        print "hi"
        return env.StaticLibrary(target, source)
    
    env.Append(BUILDERS = {'MergeLibs' : merge_libs})
    
    lib = env.MergeLibs('mrglibs', ['some_file.cpp', 'some_file2.cpp'], env)
    
    prog = env.Program('test.cpp')
    
    env.Depends(prog, lib)
    

    This gives me the output:

    scons: Reading SConscript files ...
    hi
    scons: done reading SConscript files.
    scons: Building targets ...
    g++ -o some_file.o -c some_file.cpp
    g++ -o some_file2.o -c some_file2.cpp
    ar rc libmrglibs.a some_file.o some_file2.o
    ranlib libmrglibs.a
    g++ -o test.o -c test.cpp
    g++ -o test test.o
    scons: done building targets.
    

    So its definitely still read during the parse phase (I think it has to be) but it should get you what you want.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a C++/CLI wrapper around native .lib and .h files. I use the
I have a COM-Callable Wrapper on a .NET assembly. Some of the methods use
I need an up to date and easy to use .net wrapper for google
Is it possible to use something like this wrapper with fluent configuration? http://jeffreypalermo.com/blog/use-this-nhibernate-wrapper-to-keep-your-repository-classes-simple/ If
im trying to come up with a design for a wrapper for use when
I use XFire to create a webservice wrapper around my application. XFire provides the
Mixing the use of primitive data types and their respective wrapper classes, in Java,
I've been trying to use SQLite with the PDO wrapper in PHP with mixed
I'm writing a wrapper around a fairly large unmanaged API. Almost every imported method
I use Launch4j as a wrapper for my Java application under Windows 7, which,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.