alliedmodders / ambuild

AlliedModders C++ Build System
BSD 3-Clause "New" or "Revised" License
60 stars 31 forks source link

Make naming of name attribute consistent between vs gen and ambuild gen #167

Closed psychonic closed 2 months ago

psychonic commented 2 months ago

Fixes the below issue when using vs gen with current SourceMod code

Traceback (most recent call last):
  File "C:\Python312\Lib\site-packages\ambuild2\frontend\v2_2\prep.py", line 156, in Configure
    if not cm.generate(options.generator):
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python312\Lib\site-packages\ambuild2\frontend\context_manager.py", line 93, in generate
    self.parseBuildScripts()
  File "C:\Python312\Lib\site-packages\ambuild2\frontend\v2_2\context_manager.py", line 50, in parseBuildScripts
    self.execContext(cx)
  File "C:\Python312\Lib\site-packages\ambuild2\frontend\v2_2\context_manager.py", line 148, in execContext
    exec(code, scriptGlobals)
  File "G:\sm\sourcemod\AMBuildScript", line 590, in <module>
    builder.Build('public/safetyhook/AMBuilder', {'SafetyHook': SafetyHook })
  File "C:\Python312\Lib\site-packages\ambuild2\frontend\v2_2\context.py", line 160, in Build
    return self.cm.runBuildScript(self, path, vars or {})
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python312\Lib\site-packages\ambuild2\frontend\v2_2\context_manager.py", line 68, in runBuildScript
    return self.runBuildScriptImpl(context, path, vars or {})
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python312\Lib\site-packages\ambuild2\frontend\v2_2\context_manager.py", line 119, in runBuildScriptImpl
    scriptGlobals = self.execContext(cx)
                    ^^^^^^^^^^^^^^^^^^^^
  File "C:\Python312\Lib\site-packages\ambuild2\frontend\v2_2\context_manager.py", line 148, in execContext
    exec(code, scriptGlobals)
  File "G:\sm\sourcemod\public/safetyhook\AMBuilder", line 25, in <module>
    binary = libsafetyhook.Configure(compiler, libsafetyhook.name, 'Release - {0}'.format(compiler.target.arch))
                                               ^^^^^^^^^^^^^^^^^^
AttributeError: 'Project' object has no attribute 'name'. Did you mean: 'name_'?
Configure failed: 'Project' object has no attribute 'name'