Bladeren bron

Add cpp.hint file to improve IntelliSense

Matthias Hoelzl 7 jaren geleden
bovenliggende
commit
589976321c
3 gewijzigde bestanden met toevoegingen van 15 en 0 verwijderingen
  1. 3 0
      .gitignore
  2. 1 0
      SConstruct
  3. 11 0
      methods.py

+ 3 - 0
.gitignore

@@ -88,6 +88,9 @@ bld/
 [Tt]est[Rr]esult*/
 [Bb]uild[Ll]og.*
 
+# Hints for improving IntelliSense, created together with VS project
+cpp.hint
+
 #NUNIT
 *.VisualState.xml
 TestResult.xml

+ 1 - 0
SConstruct

@@ -452,6 +452,7 @@ if selected_platform in platform_list:
     if env['vsproj']:
         env['CPPPATH'] = [Dir(path) for path in env['CPPPATH']]
         methods.generate_vs_project(env, GetOption("num_jobs"))
+        methods.generate_cpp_hint_file("cpp.hint")
 
     # Check for the existence of headers
     conf = Configure(env)

+ 11 - 0
methods.py

@@ -1686,6 +1686,17 @@ def find_visual_c_batch_file(env):
     (host_platform, target_platform,req_target_platform) = get_host_target(env)
     return find_batch_file(env, version, host_platform, target_platform)[0]
 
+def generate_cpp_hint_file(filename):
+    import os.path
+    if os.path.isfile(filename):
+        # Don't overwrite an existing hint file since the user may have customized it.
+        pass
+    else:
+        try:
+            fd = open(filename, "w")
+            fd.write("#define GDCLASS(m_class, m_inherits)\n")
+        except IOError:
+            print("Could not write cpp.hint file.")
 
 def generate_vs_project(env, num_jobs):
     batch_file = find_visual_c_batch_file(env)