build: make is_mas_build a generated header instead of config (#43737)

This commit is contained in:
Samuel Attard 2024-09-17 01:38:56 -07:00 committed by GitHub
parent b83810982e
commit c1c8fbfd9a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
28 changed files with 601 additions and 306 deletions

View file

@ -0,0 +1,17 @@
import sys
def main(is_mas_build, out_file):
is_mas_num = 0
if is_mas_build:
is_mas_num = 1
with open(out_file, 'w', encoding="utf-8") as f:
content = ''
content += '#ifndef ELECTRON_GEN_MAS_BUILD_H_\n'
content += '#define ELECTRON_GEN_MAS_BUILD_H_\n'
content += '#define IS_MAS_BUILD() ' + str(is_mas_num) + '\n'
content += '#endif\n'
f.write(content)
if __name__ == '__main__':
sys.exit(main(sys.argv[1] == "true", sys.argv[2]))