summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorliang yongxiang <[email protected]>2018-04-07 00:43:28 +0800
committerliang yongxiang <[email protected]>2018-04-07 00:47:30 +0800
commit570627b72f75cb39fbb602143f8edc9146e0507c (patch)
tree43e89517c43221921f3714ae5fe75c6eb7931f15
parent2545c3854ea82b6d93dc8be7c1fffb4863b87498 (diff)
[Libc][dlib] Auto remove macro _DLIB_THREAD_SUPPORT when IAR version higher than 8.20.1
-rw-r--r--components/libc/compilers/dlib/SConscript8
1 files changed, 7 insertions, 1 deletions
diff --git a/components/libc/compilers/dlib/SConscript b/components/libc/compilers/dlib/SConscript
index 8ae7484894..47fa8de83d 100644
--- a/components/libc/compilers/dlib/SConscript
+++ b/components/libc/compilers/dlib/SConscript
@@ -1,4 +1,7 @@
from building import *
+from distutils.version import LooseVersion
+from iar import IARVersion
+
Import('rtconfig')
src = Glob('*.c')
@@ -11,7 +14,10 @@ CPPDEFINES = ['RT_USING_DLIBC']
if rtconfig.PLATFORM == 'iar':
if GetDepend('RT_USING_DFS'):
- CPPDEFINES = CPPDEFINES + ['_DLIB_FILE_DESCRIPTOR', '_DLIB_THREAD_SUPPORT']
+ CPPDEFINES = CPPDEFINES + ['_DLIB_FILE_DESCRIPTOR']
+
+ if LooseVersion(IARVersion()) < LooseVersion("8.20.1"):
+ CPPDEFINES = CPPDEFINES + ['_DLIB_THREAD_SUPPORT']
group = DefineGroup('dlib', src, depend = ['RT_USING_LIBC'],
CPPPATH = CPPPATH, CPPDEFINES = CPPDEFINES)