Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
373 views
in Technique[技术] by (71.8m points)

how to update scons .98 syntax for deprecated Options class to current 4.0

I'm trying to build from an old scons file that uses an old Options class:

opts = Options()
opts.Add(BoolOption('RELEASE', 'do a release build.', 'no'))
opts.Add(BoolOption('XMINGW', 'Cross compile to win32', 'no'))
opts.Add(BoolOption('PROFILE', 'build profiling binary', 'no'))
opts.Add('DEFINES', 'things to define',0)
opts.Update(env)

From what I could find, it looks like this existed awhile ago per https://scons.org/doc/0.98.1/HTML/scons-user/x1640.html.

I believe the following is now the API for adding options: https://scons.org/doc/4.0.1/HTML/scons-user/ch10.html#sect-command-line-options

that said, I was wondering how to update the snippet above to be used for scons 4.0.1. Thanks!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Option was renamed Variable some time back.

See: https://scons.org/doc/4.0.1/HTML/scons-user/ch10s02.html

This change started in 0.98.1 and after (far too long as deprecated) was removed in SCons 3.0.1

See https://github.com/SCons/scons/blob/master/CHANGES.txt#L2637 for the initial introduction of Variables


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...