MCPcopy Create free account
hub / github.com/cztomczak/cefpython / fix_cmake_variables_permanently_windows

Function fix_cmake_variables_permanently_windows

tools/automate.py:551–577  ·  view source on GitHub ↗

Changes to cef_variables.cmake are made permanently, there is no undo.

()

Source from the content-addressed store, hash-verified

549
550
551def fix_cmake_variables_permanently_windows():
552 """Changes to cef_variables.cmake are made permanently, there is no undo.
553 """
554 # To get rid of these warnings:
555 # > cl : Command line warning D9025 : overriding '/GR' with '/GR-'
556 # > cl : Command line warning D9025 : overriding '/W3' with '/W4'
557 # > cl : Command line warning D9025 : overriding '/MD' with '/MT'
558 cmake_variables = os.path.join(Options.cef_binary, "cmake",
559 "cef_variables.cmake")
560 with open(cmake_variables, "rb") as fp:
561 contents = fp.read().decode("utf-8")
562 set1 = 'set(CMAKE_CXX_FLAGS_RELEASE "")'
563 set2 = 'set(CMAKE_CXX_FLAGS "")'
564 if "if(OS_WINDOWS)" not in contents:
565 print("[automate.py] WARNING: failed to fix cmake variables"
566 " permanently on Windows")
567 return
568 if set1 not in contents or set2 not in contents:
569 contents = contents.replace("if(OS_WINDOWS)",
570 "if(OS_WINDOWS)\n {set1}\n {set2}"
571 .format(set1=set1, set2=set2))
572 else:
573 return
574 with open(cmake_variables, "wb") as fp:
575 print("[automate.py] Fix permanently: {filename}"
576 .format(filename=os.path.basename(cmake_variables)))
577 fp.write(contents.encode("utf-8"))
578
579
580def fix_cmake_variables_for_MD_library(undo=False, try_undo=False):

Callers 1

build_cef_projectsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected