How to force Scons output (exe, obj, lib & dll) to specific build directory?

后端 未结 4 1274
滥情空心
滥情空心 2020-12-18 23:07

I\'ve been trying to get scons to output exe, obj, lib and dll files to a specific build directory.

My file structure looks like this:

/projectdir
          


        
4条回答
  •  眼角桃花
    2020-12-18 23:41

    The easiest way I've found is to use 2 files, a SConstruct file and a separate SConscript.

    In the SConstruct you simply call the other file and specify the directory for the build output:

    # content SConstruct
    SConscript('main.scons', variant_dir='build', duplicate=0)
    

    Then in 'main.scons' you do the meat of your build. You can forget about variant directories in this file.

    # content of main.scons
    env = Environment()
    env.Program('Hierarchy',
                source = ['source/sconstest.cpp', 'source/utils/IntUtil.cpp'])
    

提交回复
热议问题