mirror of
https://github.com/mesonbuild/meson.git
synced 2026-11-06 05:16:42 +00:00
Updates to CPP support and update review changes
This commit is contained in:
1 parent
831d1e4c2e
commit
e62b8109eb
10 files changed
+155
-403
No files matched your search
+10
-1
@@ -1,11 +1,20 @@
|
||||
# This file assumes that path to the arm compiler toolchain is added
|
||||
# to the environment(PATH) variable, so that Meson can find
|
||||
# the armcc, armlink and armar while building.
|
||||
[binaries]
|
||||
c = 'armcc'
|
||||
cpp = 'armcc'
|
||||
ar = 'armar'
|
||||
strip = 'armar'
|
||||
|
||||
[properties]
|
||||
# The '--cpu' option with the appropriate target type should be mentioned
|
||||
# to cross compile c/c++ code with armcc,.
|
||||
c_args = ['--cpu=Cortex-M0plus']
|
||||
cpp_args = ['--cpu=Cortex-M0plus']
|
||||
|
||||
[host_machine]
|
||||
system = 'WINDOWS'
|
||||
system = 'bare metal' # Update with your system name - bare metal/OS.
|
||||
cpu_family = 'arm'
|
||||
cpu = 'Cortex-M0+'
|
||||
endian = 'little'
|
||||
@@ -1,259 +0,0 @@
|
||||
|
||||
Running common tests.
|
||||
|
||||
Succeeded test: test cases/common\1 trivial
|
||||
Failed test during configure: 'test cases/common\\2 cpp'
|
||||
Reason: Generating the build system failed.
|
||||
Succeeded test: test cases/common\3 static
|
||||
Succeeded test: test cases/common\4 shared
|
||||
Succeeded test: test cases/common\5 linkstatic
|
||||
Failed test during configure: 'test cases/common\\6 linkshared'
|
||||
Reason: Generating the build system failed.
|
||||
Failed test during configure: 'test cases/common\\7 mixed'
|
||||
Reason: Generating the build system failed.
|
||||
Failed test during validate: 'test cases/common\\8 install'
|
||||
Reason: Expected file usr/bin/prog.exe missing.
|
||||
|
||||
Succeeded test: test cases/common\9 header install
|
||||
Succeeded test: test cases/common\10 man install
|
||||
Succeeded test: test cases/common\11 subdir
|
||||
Succeeded test: test cases/common\12 data
|
||||
Failed test during build: 'test cases/common\\13 pch'
|
||||
Reason: Compiling source code failed.
|
||||
Failed test during configure: 'test cases/common\\14 cpp pch'
|
||||
Reason: Generating the build system failed.
|
||||
Failed test during configure: 'test cases/common\\15 mixed pch'
|
||||
Reason: Generating the build system failed.
|
||||
Succeeded test: test cases/common\16 configure file
|
||||
Succeeded test: test cases/common\17 if
|
||||
Succeeded test: test cases/common\18 else
|
||||
Succeeded test: test cases/common\19 comparison
|
||||
Succeeded test: test cases/common\20 array
|
||||
Succeeded test: test cases/common\21 includedir
|
||||
Succeeded test: test cases/common\22 header in file list
|
||||
Failed test during configure: 'test cases/common\\23 global arg'
|
||||
Reason: Generating the build system failed.
|
||||
Failed test during configure: 'test cases/common\\24 target arg'
|
||||
Reason: Generating the build system failed.
|
||||
Succeeded test: test cases/common\25 object extraction
|
||||
Succeeded test: test cases/common\26 endian
|
||||
Succeeded test: test cases/common\27 library versions
|
||||
Succeeded test: test cases/common\28 config subdir
|
||||
Succeeded test: test cases/common\29 pipeline
|
||||
Succeeded test: test cases/common\30 pipeline
|
||||
Succeeded test: test cases/common\31 find program
|
||||
Succeeded test: test cases/common\32 multiline string
|
||||
Failed test during configure: 'test cases/common\\33 try compile'
|
||||
Reason: Generating the build system failed.
|
||||
Succeeded test: test cases/common\34 compiler id
|
||||
Failed test during configure: 'test cases/common\\35 sizeof'
|
||||
Reason: Generating the build system failed.
|
||||
Succeeded test: test cases/common\36 define10
|
||||
Failed test during configure: 'test cases/common\\37 has header'
|
||||
Reason: Generating the build system failed.
|
||||
Succeeded test: test cases/common\38 run program
|
||||
Failed test during configure: 'test cases/common\\39 tryrun'
|
||||
Reason: Generating the build system failed.
|
||||
Succeeded test: test cases/common\40 logic ops
|
||||
Succeeded test: test cases/common\41 elif
|
||||
Succeeded test: test cases/common\42 string operations
|
||||
Failed test during configure: 'test cases/common\\43 has function'
|
||||
Reason: Generating the build system failed.
|
||||
Failed test during configure: 'test cases/common\\44 has member'
|
||||
Reason: Generating the build system failed.
|
||||
Failed test during configure: 'test cases/common\\45 alignment'
|
||||
Reason: Generating the build system failed.
|
||||
Failed test during build: 'test cases/common\\46 library chain'
|
||||
Reason: Compiling source code failed.
|
||||
Succeeded test: test cases/common\47 options
|
||||
Failed test during build: 'test cases/common\\48 test args'
|
||||
Reason: Compiling source code failed.
|
||||
Failed test during build: 'test cases/common\\49 subproject'
|
||||
Reason: Compiling source code failed.
|
||||
Succeeded test: test cases/common\50 subproject options
|
||||
Skipping: test cases/common\51 pkgconfig-gen
|
||||
Failed test during validate: 'test cases/common\\52 custom install dirs'
|
||||
Reason: Expected file usr/dib/dab/dub/prog.exe missing.
|
||||
Expected file usr/dib/dab/dub2/prog2.exe missing.
|
||||
|
||||
Failed test during build: 'test cases/common\\53 subproject subproject'
|
||||
Reason: Compiling source code failed.
|
||||
Succeeded test: test cases/common\54 same file name
|
||||
Succeeded test: test cases/common\55 file grabber
|
||||
Succeeded test: test cases/common\56 custom target
|
||||
Succeeded test: test cases/common\57 custom target chain
|
||||
Succeeded test: test cases/common\58 run target
|
||||
Succeeded test: test cases/common\59 object generator
|
||||
Failed test during validate: 'test cases/common\\60 install script'
|
||||
Reason: Expected file usr/bin/prog.exe missing.
|
||||
|
||||
Succeeded test: test cases/common\61 custom target source output
|
||||
Failed test during build: 'test cases/common\\62 exe static shared'
|
||||
Reason: Compiling source code failed.
|
||||
Succeeded test: test cases/common\63 array methods
|
||||
Succeeded test: test cases/common\64 custom header generator
|
||||
Failed test during configure: 'test cases/common\\65 multiple generators'
|
||||
Reason: Generating the build system failed.
|
||||
Succeeded test: test cases/common\66 install subdir
|
||||
Failed test during validate: 'test cases/common\\67 foreach'
|
||||
Reason: Expected file usr/bin/prog1.exe missing.
|
||||
Expected file usr/bin/prog2.exe missing.
|
||||
Expected file usr/bin/prog3.exe missing.
|
||||
|
||||
Succeeded test: test cases/common\68 number arithmetic
|
||||
Succeeded test: test cases/common\69 string arithmetic
|
||||
Succeeded test: test cases/common\70 array arithmetic
|
||||
Succeeded test: test cases/common\71 arithmetic bidmas
|
||||
Failed test during build: 'test cases/common\\72 build always'
|
||||
Reason: Compiling source code failed.
|
||||
Failed test during build: 'test cases/common\\73 vcstag'
|
||||
Reason: Compiling source code failed.
|
||||
Succeeded test: test cases/common\74 modules
|
||||
Succeeded test: test cases/common\75 should fail
|
||||
Succeeded test: test cases/common\76 configure file in custom target
|
||||
Succeeded test: test cases/common\77 external test program
|
||||
Succeeded test: test cases/common\78 ctarget dependency
|
||||
Failed test during build: 'test cases/common\\79 shared subproject'
|
||||
Reason: Compiling source code failed.
|
||||
Failed test during build: 'test cases/common\\80 shared subproject 2'
|
||||
Reason: Compiling source code failed.
|
||||
Succeeded test: test cases/common\81 file object
|
||||
Failed test during build: 'test cases/common\\82 custom subproject dir'
|
||||
Reason: Compiling source code failed.
|
||||
Failed test during configure: 'test cases/common\\83 has type'
|
||||
Reason: Generating the build system failed.
|
||||
Succeeded test: test cases/common\84 extract from nested subdir
|
||||
Succeeded test: test cases/common\85 internal dependency
|
||||
Failed test during build: 'test cases/common\\86 same basename'
|
||||
Reason: Compiling source code failed.
|
||||
Succeeded test: test cases/common\87 declare dep
|
||||
Succeeded test: test cases/common\88 extract all
|
||||
Failed test during configure: 'test cases/common\\89 add language'
|
||||
Reason: Generating the build system failed.
|
||||
Succeeded test: test cases/common\90 identical target name in subproject
|
||||
Succeeded test: test cases/common\91 plusassign
|
||||
Succeeded test: test cases/common\92 skip subdir
|
||||
Succeeded test: test cases/common\93 private include
|
||||
Failed test during configure: 'test cases/common\\94 default options'
|
||||
Reason: Generating the build system failed.
|
||||
Failed test during build: 'test cases/common\\95 dep fallback'
|
||||
Reason: Compiling source code failed.
|
||||
Failed test during configure: 'test cases/common\\96 default library'
|
||||
Reason: Generating the build system failed.
|
||||
Failed test during configure: 'test cases/common\\97 selfbuilt custom'
|
||||
Reason: Generating the build system failed.
|
||||
Succeeded test: test cases/common\98 gen extra
|
||||
Failed test during build: 'test cases/common\\99 benchmark'
|
||||
Reason: Compiling source code failed.
|
||||
Succeeded test: test cases/common\100 test workdir
|
||||
Succeeded test: test cases/common\101 suites
|
||||
Failed test during configure: 'test cases/common\\102 threads'
|
||||
Reason: Generating the build system failed.
|
||||
Succeeded test: test cases/common\103 manygen
|
||||
Succeeded test: test cases/common\104 stringdef
|
||||
Succeeded test: test cases/common\105 find program path
|
||||
Succeeded test: test cases/common\106 subproject subdir
|
||||
Succeeded test: test cases/common\107 postconf
|
||||
Succeeded test: test cases/common\108 postconf with args
|
||||
Succeeded test: test cases/common\109 testframework options
|
||||
Succeeded test: test cases/common\110 extract same name
|
||||
Failed test during configure: 'test cases/common\\111 has header symbol'
|
||||
Reason: Generating the build system failed.
|
||||
Failed test during configure: 'test cases/common\\112 has arg'
|
||||
Reason: Generating the build system failed.
|
||||
Succeeded test: test cases/common\113 generatorcustom
|
||||
Succeeded test: test cases/common\114 multiple dir configure file
|
||||
Succeeded test: test cases/common\115 spaces backslash
|
||||
Succeeded test: test cases/common\116 ternary
|
||||
Succeeded test: test cases/common\117 custom target capture
|
||||
Failed test during configure: 'test cases/common\\118 allgenerate'
|
||||
Reason: Generating the build system failed.
|
||||
Succeeded test: test cases/common\119 pathjoin
|
||||
Succeeded test: test cases/common\120 subdir subproject
|
||||
Succeeded test: test cases/common\121 interpreter copy mutable var on assignment
|
||||
Skipping: test cases/common\122 skip
|
||||
Failed test during configure: 'test cases/common\\123 subproject project arguments'
|
||||
Reason: Generating the build system failed.
|
||||
Succeeded test: test cases/common\124 test skip
|
||||
Failed test during build: 'test cases/common\\125 shared module'
|
||||
Reason: Compiling source code failed.
|
||||
Failed test during configure: 'test cases/common\\126 llvm ir and assembly'
|
||||
Reason: Generating the build system failed.
|
||||
Failed test during configure: 'test cases/common\\127 cpp and asm'
|
||||
Reason: Generating the build system failed.
|
||||
Failed test during configure: 'test cases/common\\128 extract all shared library'
|
||||
Reason: Generating the build system failed.
|
||||
Failed test during build: 'test cases/common\\129 object only target'
|
||||
Reason: Compiling source code failed.
|
||||
Skipping: test cases/common\130 no buildincdir
|
||||
Succeeded test: test cases/common\131 custom target directory install
|
||||
Succeeded test: test cases/common\132 dependency file generation
|
||||
Succeeded test: test cases/common\133 configure file in generator
|
||||
Skipping: test cases/common\134 generated llvm ir
|
||||
Failed test during build: 'test cases/common\\135 generated assembly'
|
||||
Reason: Compiling source code failed.
|
||||
Succeeded test: test cases/common\136 build by default targets in tests
|
||||
Succeeded test: test cases/common\137 build by default
|
||||
Failed test during build: 'test cases/common\\138 include order'
|
||||
Reason: Compiling source code failed.
|
||||
Succeeded test: test cases/common\139 override options
|
||||
Failed test during configure: 'test cases/common\\140 get define'
|
||||
Reason: Generating the build system failed.
|
||||
Failed test during configure: 'test cases/common\\141 c cpp and asm'
|
||||
Reason: Generating the build system failed.
|
||||
Failed test during configure: 'test cases/common\\142 compute int'
|
||||
Reason: Generating the build system failed.
|
||||
Succeeded test: test cases/common\143 custom target object output
|
||||
Succeeded test: test cases/common\144 empty build file
|
||||
Failed test during configure: 'test cases/common\\145 whole archive'
|
||||
Reason: Generating the build system failed.
|
||||
Failed test during configure: 'test cases/common\\146 C and CPP link'
|
||||
Reason: Generating the build system failed.
|
||||
Succeeded test: test cases/common\147 mesonintrospect from scripts
|
||||
Succeeded test: test cases/common\148 custom target multiple outputs
|
||||
Succeeded test: test cases/common\149 special characters
|
||||
Succeeded test: test cases/common\150 nested links
|
||||
Succeeded test: test cases/common\151 list of file sources
|
||||
Succeeded test: test cases/common\152 link depends custom target
|
||||
Failed test during build: 'test cases/common\\153 recursive linking'
|
||||
Reason: Compiling source code failed.
|
||||
Failed test during build: 'test cases/common\\154 library at root'
|
||||
Reason: Compiling source code failed.
|
||||
Succeeded test: test cases/common\155 simd
|
||||
Failed test during build: 'test cases/common\\156 shared module resolving symbol in executable'
|
||||
Reason: Compiling source code failed.
|
||||
Succeeded test: test cases/common\157 configure file in test
|
||||
Succeeded test: test cases/common\158 dotinclude
|
||||
Succeeded test: test cases/common\159 reserved targets
|
||||
Succeeded test: test cases/common\160 duplicate source names
|
||||
Succeeded test: test cases/common\161 index customtarget
|
||||
Succeeded test: test cases/common\162 wrap file should not failed
|
||||
Succeeded test: test cases/common\163 includedir subproj
|
||||
Failed test during build: 'test cases/common\\164 subproject dir name collision'
|
||||
Reason: Compiling source code failed.
|
||||
Failed test during configure: 'test cases/common\\165 config tool variable'
|
||||
Reason: Generating the build system failed.
|
||||
Succeeded test: test cases/common\166 custom target subdir depend files
|
||||
Succeeded test: test cases/common\167 external program shebang parsing
|
||||
Succeeded test: test cases/common\168 disabler
|
||||
Succeeded test: test cases/common\169 array option
|
||||
Succeeded test: test cases/common\170 custom target template substitution
|
||||
Succeeded test: test cases/common\171 not-found dependency
|
||||
Succeeded test: test cases/common\172 subdir if_found
|
||||
Succeeded test: test cases/common\173 default options prefix dependent defaults
|
||||
Succeeded test: test cases/common\174 dependency factory
|
||||
Succeeded test: test cases/common\175 get project license
|
||||
Succeeded test: test cases/common\176 yield
|
||||
Failed test during build: 'test cases/common\\177 subproject nested subproject dirs'
|
||||
Reason: Compiling source code failed.
|
||||
Succeeded test: test cases/common\178 preserve gendir
|
||||
Failed test during configure: 'test cases/common\\179 source in dep'
|
||||
Reason: Generating the build system failed.
|
||||
|
||||
Total configuration time: 455.11s
|
||||
Total build time: 253.61s
|
||||
Total test time: 1.27s
|
||||
|
||||
Total passed cross tests: 113
|
||||
Total failed cross tests: 62
|
||||
Total skipped cross tests: 4
|
||||
@@ -21,6 +21,7 @@ These are return values of the `get_id` method in a compiler object.
|
||||
| g95 | The G95 Fortran compiler |
|
||||
| open64 | The Open64 Fortran Compiler |
|
||||
| nagfor | The NAG Fortran compiler |
|
||||
| arm | ARM compiler |
|
||||
|
||||
## Script environment variables
|
||||
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
## ARM compiler for C and CPP
|
||||
|
||||
Cross-compilation is now supported for ARM targets using ARM compiler - ARMCC.
|
||||
The current implementation does not support shareable libraries.
|
||||
The default extension of the output is .axf.
|
||||
The environment path should be set properly for the ARM compiler executables.
|
||||
The '--cpu' option with the appropriate target type should be mentioned
|
||||
in the cross file as shown in the snippet below.
|
||||
|
||||
```
|
||||
[properties]
|
||||
c_args = ['--cpu=Cortex-M0plus']
|
||||
cpp_args = ['--cpu=Cortex-M0plus']
|
||||
|
||||
```
|
||||
+2
-1
@@ -1178,7 +1178,8 @@ class Executable(BuildTarget):
|
||||
for_cygwin(is_cross, environment) or 'cs' in self.compilers):
|
||||
self.suffix = 'exe'
|
||||
else:
|
||||
if 'c' in self.compilers and self.compilers['c'].get_id().startswith('arm'):
|
||||
if ('c' in self.compilers and self.compilers['c'].get_id().startswith('arm') or
|
||||
'cpp' in self.compilers and self.compilers['cpp'].get_id().startswith('arm')):
|
||||
self.suffix = 'axf'
|
||||
else:
|
||||
self.suffix = ''
|
||||
|
||||
@@ -41,9 +41,6 @@ __all__ = [
|
||||
'sanitizer_compile_args',
|
||||
'sort_clike',
|
||||
|
||||
'ARMCompiler',
|
||||
'ARMCCompiler',
|
||||
'ARMCPPCompiler',
|
||||
'CCompiler',
|
||||
'ClangCCompiler',
|
||||
'ClangCompiler',
|
||||
@@ -118,7 +115,7 @@ from .compilers import (
|
||||
IntelCompiler,
|
||||
)
|
||||
from .c import (
|
||||
ARMCCompiler,
|
||||
ArmCCompiler,
|
||||
CCompiler,
|
||||
ClangCCompiler,
|
||||
GnuCCompiler,
|
||||
@@ -126,7 +123,7 @@ from .c import (
|
||||
VisualStudioCCompiler,
|
||||
)
|
||||
from .cpp import (
|
||||
ARMCPPCompiler,
|
||||
ArmCPPCompiler,
|
||||
CPPCompiler,
|
||||
ClangCPPCompiler,
|
||||
GnuCPPCompiler,
|
||||
|
||||
+20
-40
@@ -31,7 +31,7 @@ from .compilers import (
|
||||
msvc_winlibs,
|
||||
vs32_instruction_set_args,
|
||||
vs64_instruction_set_args,
|
||||
ARMCompiler,
|
||||
ArmCompiler,
|
||||
ClangCompiler,
|
||||
Compiler,
|
||||
CompilerArgs,
|
||||
@@ -889,45 +889,6 @@ class GnuCCompiler(GnuCompiler, CCompiler):
|
||||
return ['-fpch-preprocess', '-include', os.path.basename(header)]
|
||||
|
||||
|
||||
class ARMCCompiler(ARMCompiler, CCompiler):
|
||||
def __init__(self, exelist, version, is_cross, exe_wrapper=None, defines=None, **kwargs):
|
||||
# ARMCC is only a cross compiler
|
||||
if not is_cross:
|
||||
raise EnvironmentException('armcc supports only cross-compilation.')
|
||||
CCompiler.__init__(self, exelist, version, is_cross, exe_wrapper, **kwargs)
|
||||
ARMCompiler.__init__(self, defines)
|
||||
|
||||
def sanity_check_impl(self, work_dir, environment, sname, code):
|
||||
mlog.debug('Sanity testing disabled for armcc compiler')
|
||||
return
|
||||
|
||||
def get_options(self):
|
||||
opts = {'c_std': coredata.UserComboOption('c_std', 'C language standard to use',
|
||||
['none', 'c89', 'c99', 'c11'],
|
||||
'none')}
|
||||
return opts
|
||||
|
||||
def get_warn_args(self, level):
|
||||
# ARMCC doesn't have warning levels
|
||||
return []
|
||||
|
||||
def get_coverage_args(self):
|
||||
return []
|
||||
|
||||
def get_coverage_link_args(self):
|
||||
return []
|
||||
|
||||
def get_option_compile_args(self, options):
|
||||
return []
|
||||
|
||||
def get_linker_exelist(self):
|
||||
args = ['armlink']
|
||||
return args
|
||||
|
||||
def get_compile_only_args(self):
|
||||
return ['-c']
|
||||
|
||||
|
||||
class IntelCCompiler(IntelCompiler, CCompiler):
|
||||
def __init__(self, exelist, version, icc_type, is_cross, exe_wrapper=None, **kwargs):
|
||||
CCompiler.__init__(self, exelist, version, is_cross, exe_wrapper, **kwargs)
|
||||
@@ -1206,3 +1167,22 @@ class VisualStudioCCompiler(CCompiler):
|
||||
if 'INCLUDE' not in os.environ:
|
||||
return []
|
||||
return os.environ['INCLUDE'].split(os.pathsep)
|
||||
|
||||
|
||||
class ArmCCompiler(ArmCompiler, CCompiler):
|
||||
def __init__(self, exelist, version, is_cross, exe_wrapper=None, **kwargs):
|
||||
CCompiler.__init__(self, exelist, version, is_cross, exe_wrapper, **kwargs)
|
||||
ArmCompiler.__init__(self)
|
||||
|
||||
def get_options(self):
|
||||
opts = {'c_std': coredata.UserComboOption('c_std', 'C language standard to use',
|
||||
['none', 'c90', 'c99'],
|
||||
'none')}
|
||||
return opts
|
||||
|
||||
def get_option_compile_args(self, options):
|
||||
args = []
|
||||
std = options['c_std']
|
||||
if std.value != 'none':
|
||||
args.append('--' + std.value)
|
||||
return args
|
||||
@@ -1095,65 +1095,6 @@ class GnuCompiler:
|
||||
def get_default_include_dirs(self):
|
||||
return gnulike_default_include_dirs(self.exelist, self.language)
|
||||
|
||||
class ARMCompiler:
|
||||
# Functionality that is common to all ARM family compilers.
|
||||
def __init__(self, defines):
|
||||
self.id = 'arm'
|
||||
self.defines = defines or {}
|
||||
self.base_options = ['b_pch', 'b_lto', 'b_pgo', 'b_sanitize', 'b_coverage',
|
||||
'b_colorout', 'b_ndebug', 'b_staticpic']
|
||||
# Assembly
|
||||
self.can_compile_suffixes.add('s')
|
||||
|
||||
def can_linker_accept_rsp(self):
|
||||
return False
|
||||
|
||||
def get_pic_args(self):
|
||||
# FIXME: Add /ropi, /rwpi, /fpic etc. qualifiers to --apcs
|
||||
return []
|
||||
|
||||
def get_buildtype_args(self, buildtype):
|
||||
return arm_buildtype_args[buildtype]
|
||||
|
||||
def get_buildtype_linker_args(self, buildtype):
|
||||
return arm_buildtype_linker_args[buildtype]
|
||||
|
||||
# Override CCompiler.get_always_args
|
||||
def get_always_args(self):
|
||||
return []
|
||||
|
||||
# Override CCompiler.get_dependency_gen_args
|
||||
def get_dependency_gen_args(self, outtarget, outfile):
|
||||
return []
|
||||
|
||||
# Override CCompiler.get_std_shared_lib_link_args
|
||||
def get_std_shared_lib_link_args(self):
|
||||
return []
|
||||
|
||||
def get_pch_use_args(self, pch_dir, header):
|
||||
# FIXME: Add required arguments
|
||||
# NOTE from armcc user guide:
|
||||
# "Support for Precompiled Header (PCH) files is deprecated from ARM Compiler 5.05
|
||||
# onwards on all platforms. Note that ARM Compiler on Windows 8 never supported
|
||||
# PCH files."
|
||||
return []
|
||||
|
||||
def get_pch_suffix(self):
|
||||
# NOTE from armcc user guide:
|
||||
# "Support for Precompiled Header (PCH) files is deprecated from ARM Compiler 5.05
|
||||
# onwards on all platforms. Note that ARM Compiler on Windows 8 never supported
|
||||
# PCH files."
|
||||
return 'pch'
|
||||
|
||||
def split_shlib_to_parts(self, fname):
|
||||
return os.path.split(fname)[0], fname
|
||||
|
||||
def thread_flags(self, env):
|
||||
return []
|
||||
|
||||
def thread_link_flags(self, env):
|
||||
return []
|
||||
|
||||
|
||||
class ClangCompiler:
|
||||
def __init__(self, clang_type):
|
||||
@@ -1294,3 +1235,73 @@ class IntelCompiler:
|
||||
|
||||
def get_default_include_dirs(self):
|
||||
return gnulike_default_include_dirs(self.exelist, self.language)
|
||||
|
||||
|
||||
class ArmCompiler:
|
||||
# Functionality that is common to all ARM family compilers.
|
||||
def __init__(self):
|
||||
if not self.is_cross:
|
||||
raise EnvironmentException('armcc supports only cross-compilation.')
|
||||
self.id = 'arm'
|
||||
default_warn_args = []
|
||||
self.warn_args = {'1': default_warn_args,
|
||||
'2': default_warn_args + [],
|
||||
'3': default_warn_args + []}
|
||||
# Assembly
|
||||
self.can_compile_suffixes.add('s')
|
||||
|
||||
def can_linker_accept_rsp(self):
|
||||
return False
|
||||
|
||||
def get_pic_args(self):
|
||||
# FIXME: Add /ropi, /rwpi, /fpic etc. qualifiers to --apcs
|
||||
return []
|
||||
|
||||
def get_buildtype_args(self, buildtype):
|
||||
return arm_buildtype_args[buildtype]
|
||||
|
||||
def get_buildtype_linker_args(self, buildtype):
|
||||
return arm_buildtype_linker_args[buildtype]
|
||||
|
||||
# Override CCompiler.get_always_args
|
||||
def get_always_args(self):
|
||||
return []
|
||||
|
||||
# Override CCompiler.get_dependency_gen_args
|
||||
def get_dependency_gen_args(self, outtarget, outfile):
|
||||
return []
|
||||
|
||||
# Override CCompiler.get_std_shared_lib_link_args
|
||||
def get_std_shared_lib_link_args(self):
|
||||
return []
|
||||
|
||||
def get_pch_use_args(self, pch_dir, header):
|
||||
# FIXME: Add required arguments
|
||||
# NOTE from armcc user guide:
|
||||
# "Support for Precompiled Header (PCH) files is deprecated from ARM Compiler 5.05
|
||||
# onwards on all platforms. Note that ARM Compiler on Windows 8 never supported
|
||||
# PCH files."
|
||||
return []
|
||||
|
||||
def get_pch_suffix(self):
|
||||
# NOTE from armcc user guide:
|
||||
# "Support for Precompiled Header (PCH) files is deprecated from ARM Compiler 5.05
|
||||
# onwards on all platforms. Note that ARM Compiler on Windows 8 never supported
|
||||
# PCH files."
|
||||
return 'pch'
|
||||
|
||||
def thread_flags(self, env):
|
||||
return []
|
||||
|
||||
def thread_link_flags(self, env):
|
||||
return []
|
||||
|
||||
def get_linker_exelist(self):
|
||||
args = ['armlink']
|
||||
return args
|
||||
|
||||
def get_coverage_args(self):
|
||||
return []
|
||||
|
||||
def get_coverage_link_args(self):
|
||||
return []
|
||||
+28
-30
@@ -26,7 +26,7 @@ from .compilers import (
|
||||
ClangCompiler,
|
||||
GnuCompiler,
|
||||
IntelCompiler,
|
||||
ARMCompiler,
|
||||
ArmCompiler,
|
||||
)
|
||||
|
||||
class CPPCompiler(CCompiler):
|
||||
@@ -134,35 +134,6 @@ class GnuCPPCompiler(GnuCompiler, CPPCompiler):
|
||||
return ['-fpch-preprocess', '-include', os.path.basename(header)]
|
||||
|
||||
|
||||
class ARMCPPCompiler(ARMCompiler, CPPCompiler):
|
||||
def __init__(self, exelist, version, is_cross, exe_wrap=None, defines=None, **kwargs):
|
||||
CPPCompiler.__init__(self, exelist, version, is_cross, exe_wrap, **kwargs)
|
||||
ARMCompiler.__init__(self, defines)
|
||||
default_warn_args = []
|
||||
self.warn_args = {'1': default_warn_args,
|
||||
'2': default_warn_args + [],
|
||||
'3': default_warn_args + []}
|
||||
|
||||
def get_options(self):
|
||||
opts = {'cpp_std': coredata.UserComboOption('cpp_std', 'C++ language standard to use',
|
||||
['none', 'c++11'],
|
||||
'none')}
|
||||
return opts
|
||||
|
||||
def get_option_compile_args(self, options):
|
||||
args = []
|
||||
std = options['cpp_std']
|
||||
if std.value == 'c++11':
|
||||
args.append('--cpp11')
|
||||
return args
|
||||
|
||||
def get_option_link_args(self, options):
|
||||
return []
|
||||
|
||||
def get_compiler_check_args(self):
|
||||
return []
|
||||
|
||||
|
||||
class IntelCPPCompiler(IntelCompiler, CPPCompiler):
|
||||
def __init__(self, exelist, version, icc_type, is_cross, exe_wrap, **kwargs):
|
||||
CPPCompiler.__init__(self, exelist, version, is_cross, exe_wrap, **kwargs)
|
||||
@@ -245,3 +216,30 @@ class VisualStudioCPPCompiler(VisualStudioCCompiler, CPPCompiler):
|
||||
# Visual Studio C++ compiler doesn't support -fpermissive,
|
||||
# so just use the plain C args.
|
||||
return super(VisualStudioCCompiler, self).get_compiler_check_args()
|
||||
|
||||
|
||||
class ArmCPPCompiler(ArmCompiler, CPPCompiler):
|
||||
def __init__(self, exelist, version, is_cross, exe_wrap=None, defines=None, **kwargs):
|
||||
CPPCompiler.__init__(self, exelist, version, is_cross, exe_wrap, **kwargs)
|
||||
ArmCompiler.__init__(self, defines)
|
||||
|
||||
def get_options(self):
|
||||
opts = {'cpp_std': coredata.UserComboOption('cpp_std', 'C++ language standard to use',
|
||||
['none', 'c++03', 'c++11'],
|
||||
'none')}
|
||||
return opts
|
||||
|
||||
def get_option_compile_args(self, options):
|
||||
args = []
|
||||
std = options['cpp_std']
|
||||
if std.value == 'c++11':
|
||||
args.append('--cpp11')
|
||||
elif std.value == 'c++03':
|
||||
args.append('--cpp')
|
||||
return args
|
||||
|
||||
def get_option_link_args(self, options):
|
||||
return []
|
||||
|
||||
def get_compiler_check_args(self):
|
||||
return []
|
||||
@@ -38,8 +38,8 @@ from .compilers import (
|
||||
is_source,
|
||||
)
|
||||
from .compilers import (
|
||||
ARMCCompiler,
|
||||
ARMCPPCompiler,
|
||||
ArmCCompiler,
|
||||
ArmCPPCompiler,
|
||||
ClangCCompiler,
|
||||
ClangCPPCompiler,
|
||||
ClangObjCCompiler,
|
||||
@@ -493,11 +493,10 @@ class Environment:
|
||||
if found_cl in watcom_cls:
|
||||
continue
|
||||
arg = '/?'
|
||||
elif 'armcc' in compiler[0]:
|
||||
arg = '--vsn'
|
||||
else:
|
||||
if compiler[0] == 'armcc':
|
||||
arg = '--vsn'
|
||||
else:
|
||||
arg = '--version'
|
||||
arg = '--version'
|
||||
try:
|
||||
p, out, err = Popen_safe(compiler + [arg])
|
||||
except OSError as e:
|
||||
@@ -543,7 +542,7 @@ class Environment:
|
||||
cls = IntelCCompiler if lang == 'c' else IntelCPPCompiler
|
||||
return cls(ccache + compiler, version, inteltype, is_cross, exe_wrap, full_version=full_version)
|
||||
if 'ARM' in out:
|
||||
cls = ARMCCompiler if lang == 'c' else ARMCPPCompiler
|
||||
cls = ArmCCompiler if lang == 'c' else ArmCPPCompiler
|
||||
return cls(ccache + compiler, version, is_cross, exe_wrap, full_version=full_version)
|
||||
self._handle_exceptions(popen_exceptions, compilers)
|
||||
|
||||
@@ -799,7 +798,7 @@ class Environment:
|
||||
if 'lib' in linker or 'lib.exe' in linker:
|
||||
arg = '/?'
|
||||
else:
|
||||
arg = '--version'
|
||||
arg = '--version'
|
||||
try:
|
||||
p, out, err = Popen_safe(linker + [arg])
|
||||
except OSError as e:
|
||||
|
||||
Reference in new issue
Block a user