|
23 | 23 | Options: |
24 | 24 | VERSION Version number eg. 50.0 |
25 | 25 | --no-run-examples Do not run examples after build, only unit tests |
26 | | - --rebuild-cpp Force rebuild of .vcproj C++ projects (DISABLED) |
27 | 26 | --fast Fast mode |
28 | 27 | --clean Clean C++ projects build files on Linux/Mac |
29 | 28 | --kivy Run only Kivy example |
30 | 29 | """ |
31 | 30 |
|
| 31 | +# --rebuild-cpp Force rebuild of .vcproj C++ projects (DISABLED) |
| 32 | + |
32 | 33 | # How to debug on Linux: |
33 | 34 | # 1. Install "python-dbg" package |
34 | 35 | # 2. Install "python-wxgtk2.8-dbg" package |
@@ -236,7 +237,7 @@ def setup_environ(): |
236 | 237 | pass |
237 | 238 |
|
238 | 239 | # Mac env variables for makefiles |
239 | | - if MAC: |
| 240 | + if MAC or LINUX: |
240 | 241 | os.environ["CEF_BIN"] = os.path.join(CEF_BINARIES_LIBRARIES, "bin") |
241 | 242 | os.environ["CEF_LIB"] = os.path.join(CEF_BINARIES_LIBRARIES, "lib") |
242 | 243 |
|
@@ -306,29 +307,33 @@ def fix_cefpython_api_header_file(): |
306 | 307 | print("[build.py] cefpython API header file was not yet generated") |
307 | 308 | return |
308 | 309 |
|
| 310 | + # Original contents |
309 | 311 | with open(CEFPYTHON_API_HFILE, "rb") as fo: |
310 | 312 | contents = fo.read().decode("utf-8") |
311 | 313 |
|
312 | | - already_fixed = False |
313 | | - pragma = "#pragma warning(disable:4190)" |
314 | | - if pragma in contents: |
315 | | - already_fixed = True |
316 | | - print("[build.py] cefpython API header file is already fixed") |
317 | | - else: |
318 | | - if not MAC: |
| 314 | + # Pragma fix on Windows |
| 315 | + if WINDOWS: |
| 316 | + already_fixed = False |
| 317 | + pragma = "#pragma warning(disable:4190)" |
| 318 | + if pragma in contents: |
| 319 | + already_fixed = True |
| 320 | + print("[build.py] cefpython API header file is already fixed") |
| 321 | + else: |
319 | 322 | contents = ("%s\n\n" % pragma) + contents |
| 323 | + with open(CEFPYTHON_API_HFILE, "wb") as fo: |
| 324 | + fo.write(contents.encode("utf-8")) |
| 325 | + print("[build.py] Save {filename}" |
| 326 | + .format(filename=CEFPYTHON_API_HFILE)) |
320 | 327 |
|
321 | | - if not already_fixed: |
322 | | - with open(CEFPYTHON_API_HFILE, "wb") as fo: |
323 | | - fo.write(contents.encode("utf-8")) |
324 | | - print("[build.py] Save {filename}" |
325 | | - .format(filename=CEFPYTHON_API_HFILE)) |
326 | | - |
| 328 | + # Make a copy with a "_fixed" postfix |
327 | 329 | if os.path.exists(CEFPYTHON_API_HFILE_FIXED): |
328 | 330 | with open(CEFPYTHON_API_HFILE_FIXED, "rb") as fo: |
329 | 331 | contents_fixed = fo.read().decode("utf-8") |
330 | 332 | else: |
331 | 333 | contents_fixed = "" |
| 334 | + |
| 335 | + # Resave fixed copy only if contents changed. Other scripts |
| 336 | + # depend on "modified time" of the "_fixed" file. |
332 | 337 | if contents != contents_fixed: |
333 | 338 | print("[build.py] Save cefpython_fixed.h") |
334 | 339 | with open(CEFPYTHON_API_HFILE_FIXED, "wb") as fo: |
|
0 commit comments