summaryrefslogtreecommitdiff
path: root/mesonbuild/compilers/cpp.py
Commit message (Collapse)AuthorAgeFilesLines
* compilers: Use keyword only arguments for compiler interfacesDylan Baker2018-11-131-5/+10
| | | | | | | | | | | | | | | | | | | | | | | | Because we need to inherit them in some cases, and python's keyword-or-positional arguments make this really painful, especially with inheritance. They do this in two ways: 1) If you want to intercept the arguments you need to check for both a keyword and a positional argument, because you could get either. Then you need to make sure that you only pass one of those down to the next layer. 2) After you do that, if the layer below you decides to do the same thing, but uses the other form (you used keyword by the lower level uses positional or vice versa), then you'll get a TypeError since two layers down got the argument as both a positional and a keyword. All of this is bad. Fortunately python 3.x provides a mechanism to solve this, keyword only arguments. These arguments cannot be based positionally, the interpreter will give us an error in that case. I have made a best effort to do this correctly, and I've verified it with GCC, Clang, ICC, and MSVC, but there are other compilers like Arm and Elbrus that I don't have access to.
* Add support for Renesas CC-RX toolchainPhillip Cao2018-11-081-0/+29
|
* Qualify checks of self.version by self.id in VisualStudioC/CPPCompilerJon Turney2018-11-041-7/+10
|
* Detect clang-cl as msvc-like, not clang-likeJon Turney2018-11-041-1/+5
| | | | | | | | | | | | | | | | | Handle clang's cl or clang-cl being in PATH, or set in CC/CXX Future work: checking the name of the executable here seems like a bad idea. These compilers will fail to be detected if they are renamed. v2: Update compiler.get_argument_type() test Fix comparisons of id inside CCompiler, backends and elsewhere v3: ClangClCPPCompiler should be a subclass of ClangClCCompier, as well Future work: mocking in test_find_library_patterns() is effected, as we now test for a subclass, rather than self.id in CCompiler.get_library_naming()
* Generalize gnulike-targeting-windows checks.Josh Gao2018-10-301-2/+2
| | | | | | | | | Replace several checks against GCC_MINGW or (GCC_MINGW, GCC_CYGWIN) with is_windows_compiler instead, so that clang and other gcc-like compilers using MinGW work appropriately with vs_module_defs, c_winlibs, and cpp_winlibs. Fixes #4434.
* add support for `/permissive-`Nicole Mazzuca2018-10-271-8/+21
| | | | | We do this with `std_ver=vc++NM` - `vc++` does not add `/permissive-`, while `std_ver=c++NM` adds `/permissive-`.
* add cpp_std support for MSVCNicole Mazzuca2018-10-221-3/+34
|
* Adding "compiler_type" flag to ARM compilers.Mohammed Amer Khalidi2018-10-071-4/+4
|
* Abstract shared GCC/Clang/ICC methods in GnuLikeCompilerDavid Seifert2018-09-171-4/+0
|
* Fix ICC on macOSDavid Seifert2018-09-161-4/+15
|
* Use enum instead of `int` for compiler variantsDavid Seifert2018-09-161-12/+12
| | | | | | | | * Enums are strongly typed and make the whole `gcc_type`/`clang_type`/`icc_type` distinction redundant. * Enums also allow extending via member functions, which makes the code more generalisable.
* Add method to check for C/C++ function attributesDylan Baker2018-09-071-0/+6
| | | | | | | | | | | | | | | It's fairly common on Linux and *BSD platforms to check for these attributes existence, so it makes sense to me to have this checking build into meson itself. Autotools also has a builtin for handling these, and by building them in we can short circuit cases that we know that these don't exist (MSVC). Additionally this adds support for two common MSVC __declspec attributes, dllimport and dllexport. This implements the declspec version (even though GCC has an __attribute__ version that both it and clang support), since GCC and Clang support the MSVC version as well. Thus it seems reasonable to assume that most projects will use the __declspec version over teh __attribute__ version.
* Make `-std=` fallback remapping more robustDavid Seifert2018-08-291-11/+54
| | | | | | | | | | * The current version matching logic is brittle with respect to Clang. LLVM and Apple Clang use slightly different but nowadays overlapping version ranges. Instead, we now just check whether the compiler supports the given `-std=` variant and try its respective fallback instead of testing version ranges.
* Remap -std=c++14 dialect names for older compilersDavid Seifert2018-08-201-2/+10
| | | | | | | * GCC 4.8 and Clang 3.2, 3.3, 3.4 only understand `-std={c,gnu}++1y` for enabling C++14 dialects. GCC 4.8 is especially important as it is the basis of RHEL/CentOS 7.
* Convert buildtype to optimization and debug options (#3489)Jussi Pakkanen2018-08-181-1/+1
|
* Add support for c++2a and gnu++2aZachary Michaels2018-08-091-4/+4
|
* Avoid concatenating two options in listThomas Hindoe Paaboel Andersen2018-07-131-1/+1
| | | | 'c++17' and 'gnu++98' were concatenated due to a missing comma
* Added ARMCLANG compiler support for C/C++ (#3717)Vasu Penugonda2018-06-211-0/+29
|
* Fix issues found by flake8Xavier Claessens2018-06-061-1/+0
|
* Compilers: Chain-up to parent class in get_options()Xavier Claessens2018-06-061-29/+35
| | | | | Parent class could have common options for all compilers, and we'll soon add some.
* Can combine D and C++ in a single target. Closes #3125.Jussi Pakkanen2018-05-021-0/+6
|
* Add has_link_argument() and friendsXavier Claessens2018-04-161-10/+0
| | | | Closes: #3335.
* VisualStudioCPPCompiler: Fix -fpermissive still being addedXavier Claessens2018-04-161-2/+2
| | | | | super(VisualStudioCCompiler, self) calls CPPCompiler and that's what we want to avoid.
* Merged Arm CC support.Jussi Pakkanen2018-04-161-0/+28
|\
| * Fix for issue in cpp.pySomasekhar Penugonda2018-03-311-2/+2
| | | | | | | | Change-Id: Iad9623d20eb5086528dacefce5d2f4f9bb9d0312
| * Updates to CPP support and update review changesSomasekhar Penugonda2018-03-271-30/+28
| |
| * - Updating cpp_std options similar to other compiler classesBedarkar, Malhar2018-03-141-0/+30
| | | | | | | | | | | | | | - Updating environment.py for selecting '--vsn' option for armcc only. - Updating build type arguments from GitHub pull request - 3157 Change-Id: Id3151e7715ec1016afdbd65391bb0d414ec7de13
* | Merge pull request #3115 from makise-homura/e2k-lcc-supportJussi Pakkanen2018-04-151-0/+24
|\ \ | |/ |/| Support lcc compiler for e2k (Elbrus) architecture
| * Fixed lchmod detection for lcc C/C++ compilersmakise-homura2018-03-211-0/+8
| |
| * Fixed indentation and space issues found by SideCImakise-homura2018-03-191-1/+1
| |
| * Added Elbrus lcc compilers support as inheritance from gcc onesmakise-homura2018-03-191-0/+16
| |
* | Fix various flake8 indentation reportsJon Turney2018-03-031-1/+1
|/ | | | | | | | | | | | $ flake8 | grep -E '(E123|E127|E128)' ./run_unittests.py:1358:37: E127 continuation line over-indented for visual indent ./run_unittests.py:1360:37: E127 continuation line over-indented for visual indent ./mesonbuild/minit.py:311:66: E128 continuation line under-indented for visual indent ./mesonbuild/minit.py:312:66: E128 continuation line under-indented for visual indent ./mesonbuild/minit.py:313:66: E128 continuation line under-indented for visual indent ./mesonbuild/compilers/cpp.py:115:63: E127 continuation line over-indented for visual indent ./msi/createmsi.py:156:13: E123 closing bracket does not match indentation of opening bracket's line ./msi/createmsi.py:188:13: E123 closing bracket does not match indentation of opening bracket's line
* Use os.path: basename() and dirname() instead of split()Aleksey Filippov2018-01-301-1/+1
| | | | | | | | | | | | According to Python documentation[1] dirname and basename are defined as follows: os.path.dirname() = os.path.split()[0] os.path.basename() = os.path.split()[1] For the purpose of better readability split() is replaced by appropriate function if only one part of returned tuple is used. [1]: https://docs.python.org/3/library/os.path.html#os.path.split
* Print warning when linker arguments are passed to has_argumentTing-Wei Lan2018-01-301-0/+8
| | | | | | has_argument and other similar methods of compiler objects only support checking compiler flags. If they are used to check linker flags, the results are very likely to be wrong and developers should be warned.
* More version information for compilers.Christoph Behle2017-12-161-8/+8
| | | | | | | | See issue #2762 Adds full_version to class Compiler. If set full_version will be printed additionally. Added support for CCompiler and CPPCompiler Added support for gcc/g++, clang/clang++, icc.
* Renamed UserStringArrayOption to UserArrayOption for short.Jussi Pakkanen2017-12-071-4/+4
|
* Add C++17 flags to GCC and Clang.Jussi Pakkanen2017-12-061-4/+4
|
* adding C++98 to versions that meson can supportSolomon Choina2017-11-291-2/+2
|
* Pass -fpch-preprocess to GCC when precompiled headers are usedGabrĂ­el ArthĂșr PĂ©tursson2017-08-131-0/+5
| | | | | | | | | | | | CCache requires this flag when building with precompiled headers. Without it, the preprocessor fails and CCache fallbacks to running the real compiler. Users still need to set 'sloppiness' to 'pch_defines,time_macros' in their ccache.conf file for CCache to cache builds that use precompiled headers. See the CCache manual for more info: https://ccache.samba.org/manual.html#_precompiled_headers
* A few more lgtm fixes.Jussi Pakkanen2017-08-041-1/+0
|
* Added VS support to simd detector.Jussi Pakkanen2017-07-171-2/+2
|
* Add 'Compiler.get_display_language'Guillaume Poirier-Morency2017-06-261-0/+3
| | | | | Use this when we print language-related information to the console and via the Ninja backend.
* Split out languages from compilers.pyAlistair Thomas2017-06-231-0/+202