Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
371 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 Answer

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share

2.1m questions

2.1m answers

63 comments

56.5k users

...