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 672937
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T00:32:24+00:00 2026-05-14T00:32:24+00:00

We’re using SCons + swtoolkit for our build system on Mac, Linux, and Windows.

  • 0

We’re using SCons + swtoolkit for our build system on Mac, Linux, and Windows. We have a svn repository that contains all of our external library dependencies, the path to which is located in the environment variable EXTERNAL_SDKS.

In each of our target SConscripts, I’d like to find a method that will look up what libraries located under the EXTERNAL_SDKS path the target is linked to and copy it into the build output folder when the target itself is built and placed there.

I have found one method of doing so using some added on components in swtoolkit, but it slows down the parsing of the sconscripts a ton (15+ seconds on mac, 1 minute+ on windows!!).

Does anyone know of an efficient way of doing this?

  • 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-14T00:32:24+00:00Added an answer on May 14, 2026 at 12:32 am

    I found an answer via Randall Spangler, the dev at Google that created swtoolkit. Thus this answer is specific to using swtoolkit with SCons.

    Previously we were scanning our targets for dependencies, then determining what external libraries to copy from that dependency scan. This is what was causing the severe slowdown.

    swtoolkit has an env.Publish() method that registers targets so that they can be used as dependencies for other targets. Once the external libraries have been published, they’ll automatically be copied into the build output folder via the ReplicatePublished() call that is used within swtoolkit when a target is built.

    He gave the following sample code:

    thirdparty_libs = []
    for dir in env.SubstList2('$THIRDPARTY_LIB_DIRS'):
      thirdparty_libs += env.Glob(dir + '/lib*.dylib')
      thirdparty_libs += env.Glob(dir + '/lib*.a')
    
    import os
    for lib in thirdparty_libs:
      name_parts = os.path.splitext(lib.name)
      if name_parts[1] == '.dylib':
        # TODO: Need to publish 'libfoo.dylib' or 'libfoo.a' as both
        # 'libfoo' and 'foo'.  Need to clean up sconscripts to remove 'lib' prefix
        # from all libs for mac, linux.
        lib_basename = name_parts[0]
        env.Publish(lib_basename, 'run', lib)
        env.Publish(lib_basename[3:], 'run', lib)
    

    We modified this to suit our needs and placed it in the scripts that configure use of our external libraries. For example, in our BoostSettings module, this finds and publishes all of the boost libraries. If one of them is needed by a target, it is automatically copied into the build output folder.

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

Sidebar

Ask A Question

Stats

  • Questions 372k
  • Answers 372k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer It should be inside the :html options, not on the… May 14, 2026 at 7:16 pm
  • Editorial Team
    Editorial Team added an answer In C function def cannot be nested and that is… May 14, 2026 at 7:16 pm
  • Editorial Team
    Editorial Team added an answer It's not possible to combine queries within one OleDbCommand. If… May 14, 2026 at 7:16 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.