forked from platformio/platformio-core
Add "__GNUC__" macro by default for VSCode
https://github.com/platformio/platformio-vscode-ide/issues/54
This commit is contained in:
@ -91,7 +91,9 @@ def DumpIDEData(env):
|
|||||||
"gdb_path":
|
"gdb_path":
|
||||||
util.where_is_program(env.subst("$GDB"), env.subst("${ENV['PATH']}")),
|
util.where_is_program(env.subst("$GDB"), env.subst("${ENV['PATH']}")),
|
||||||
"prog_path":
|
"prog_path":
|
||||||
env.subst("$PROG_PATH")
|
env.subst("$PROG_PATH"),
|
||||||
|
"compiler_type":
|
||||||
|
env.GetCompilerType()
|
||||||
}
|
}
|
||||||
|
|
||||||
env_ = env.Clone()
|
env_ = env.Clone()
|
||||||
|
@ -199,7 +199,8 @@ def _delete_file(path):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
def GetCompilerType(env):
|
@util.memoized
|
||||||
|
def _get_compiler_type(env):
|
||||||
try:
|
try:
|
||||||
sysenv = environ.copy()
|
sysenv = environ.copy()
|
||||||
sysenv['PATH'] = str(env['ENV']['PATH'])
|
sysenv['PATH'] = str(env['ENV']['PATH'])
|
||||||
@ -216,6 +217,10 @@ def GetCompilerType(env):
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def GetCompilerType(env):
|
||||||
|
return _get_compiler_type(env)
|
||||||
|
|
||||||
|
|
||||||
def GetActualLDScript(env):
|
def GetActualLDScript(env):
|
||||||
|
|
||||||
def _lookup_in_ldpath(script):
|
def _lookup_in_ldpath(script):
|
||||||
|
@ -30,7 +30,11 @@
|
|||||||
% for define in defines:
|
% for define in defines:
|
||||||
"{{!define.replace('"', '\\"')}}",
|
"{{!define.replace('"', '\\"')}}",
|
||||||
% end
|
% end
|
||||||
|
% if compiler_type == "gcc":
|
||||||
|
"__GNUC__"
|
||||||
|
% else:
|
||||||
""
|
""
|
||||||
|
% end
|
||||||
],
|
],
|
||||||
"intelliSenseMode": "clang-x64"
|
"intelliSenseMode": "clang-x64"
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user