Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to create debug builds #6

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

peace-maker
Copy link
Member

This allows to link sourcemod with --enable-debug on Windows.

This allows to link sourcemod with `--enable-debug` on Windows.
@@ -22,7 +22,8 @@ libsafetyhook.sources += AddSourceFilesFromDir(os.path.join(builder.currentSourc
])

for compiler in SafetyHook.all_targets:
binary = libsafetyhook.Configure(compiler, libsafetyhook.name, 'Release - {0}'.format(compiler.target.arch))
tag = 'Debug' if builder.options.debug == '1' else 'Release'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we decide whether or not we're in debug through a function call on SafetyHook structure ?
I'm mainly thinking of subprojects that need to include safetyhook for CDetour and might want some control over this. Granted, we're already nuking any preset compiler flags, so why should we care for debug but still.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, this would require them to have a debug option in their configure.py which is a common way to enable debug builds though. How would that EnableDebug function be used?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally I'm thinking something like
https://github.com/alliedmodders/sourcemod/blob/master/AMBuildScript#L589

  @property
  def debug(self):
    return builder.options.debug == '1'

Or perhaps even reuse the tag property ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants