aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/cmake
AgeCommit message (Collapse)AuthorFilesLines
2021-03-19split program related classes and functions out of dependenciesDylan Baker2-6/+5
Dependencies is already a large and complicated package without adding programs to the list. This also allows us to untangle a bit of spaghetti that we have.
2021-03-04mass rewrite of string formatting to use f-strings everywhereEli Schwartz7-64/+64
performed by running "pyupgrade --py36-plus" and committing the results
2021-01-23split mesonlib into a packageDylan Baker1-1/+1
Currently mesonlib does some import tricks to figure out whether it needs to use windows or posix specific functions. This is a little hacky, but works fine. However, the way the typing stubs are implemented for the msvcrt and fnctl modules will cause mypy to fail on the other platform, since the functions are not implemented. To aleviate this (and for slightly cleaner design), I've split mesonlib into a pacakge with three modules. A universal module contains all of the platform agnositc code, a win32 module contains window specific code, a posix module contains the posix specific code, and a platform module contains no-op implementations. Then the package's __init__ file imports all of the universal functions and all of the functions from the approriate platform module, or the no-op versions as fallbacks. This makes mypy happy, and avoids `if`ing all over the code to switch between the platform specific code.
2021-01-13Fix misspellsAntonin Décimo3-4/+4
Signed-off-by: Antonin Décimo <antonin.decimo@gmail.com>
2021-01-11move CMAKE_PREFIX_PATH env var handling to environmentDylan Baker1-18/+0
This causes the variable to be read up front and stored, rather than be re-read on each invocation of meson. This does have two slight behavioral changes. First is the obvious one that changing the variable between `meson --reconfigure` invocations has no effect. This is the way PKG_CONFIG_PATH already works. The second change is that CMAKE_PREFIX_PATH the env var is no longer appended to the values set in the machine file or on the command line, and is instead replaced by them. CMAKE_PREFIX_PATH is the only env var in meson that works this way, every other one is replaced not appended, so while this is a behavioral change, I also think its a bug fix.
2021-01-04Merge pull request #8080 from dcbaker/submit/option-key-typeJussi Pakkanen2-7/+7
Use an object for option keys
2021-01-04Use a single coredata dictionary for optionsDylan Baker2-3/+3
This patches takes the options work to it's logical conclusion: A single flat dictionary of OptionKey: UserOptions. This allows us to simplify a large number of cases, as we don't need to check if an option is in this dict or that one (or any of 5 or 6, actually).
2021-01-04use OptionKey for builtin and base optionsDylan Baker2-3/+3
I would have prefered to do these seperatately, but they are combined in some cases, so it was much easier to convert them together. this eliminates the builtins_per_machine dict, as it's duplicated with the OptionKey's machine parameter.
2021-01-04move OptionKey to mesonlibDylan Baker1-2/+1
There's starting to be a lot of things including coredata that coredata needs to itself include. putting it in mesonlib makes more sense
2021-01-04use OptionKey for compiler_optionsDylan Baker1-3/+4
2021-01-04cmake: fix missing languages from CMake (fixes #8132)Daniel Mensinger1-8/+29
2020-12-29cmake: fix -framework dependencies (fixes #8045)Daniel Mensinger1-0/+14
2020-12-16cmake: Revert to using self.for_machine instead of MachineChoice.BUILD ↵Daniel Mensinger1-0/+1
(fixes #8028)
2020-11-20use real pathlib moduleDylan Baker7-7/+7
We added the _pathlib module to work around defeciencies in python 3.5's implementation, since we now rely on 3.6 lets drop this
2020-10-24cmake: set CMP0054 to new in preload.cmakeDaniel Mensinger1-0/+5
https://cmake.org/cmake/help/latest/policy/CMP0054.html
2020-10-24cmake: Disable the new (CMake 3.16) PCH supportDaniel Mensinger2-0/+18
Subprojects that use the CMake PCH feature will cause compilation/linker errors. The CMake PCH support should thus be disabled until this can be properly translated to meson.
2020-10-24cmake: Always create missing includes in build dirDaniel Mensinger1-4/+1
There really isn't any reason to not always create missing include directories inside the build dir. Just restricting this to generate generated sources should work in an ideal world, however, there exists lots of suboptimal CMake code where this assumption is not always true.
2020-10-16cmake: Ignore additional internal CMake variablesDaniel Mensinger1-0/+9
2020-10-16cmake: ignore CMAKE_TOOLCHAIN_FILE and CMAKE_PROJECT_INCLUDE to avoid ↵Daniel Mensinger3-2/+30
conflicts with the meson CMake logic
2020-10-13cmake: Add cross compilation supportDaniel Mensinger6-243/+292
2020-10-04pathlib: Fix resolve() by overriding it in Python 3.5Daniel Mensinger6-6/+7
2020-10-04cmake: switch to pathlib (fixes #7322)Daniel Mensinger6-247/+246
2020-09-28typing: fully annotate cmake.interpreterDaniel Mensinger1-171/+198
2020-09-28typing: fully annotate cmake.traceparserDaniel Mensinger1-32/+45
2020-09-28typing: fully annotate cmake.generatorDaniel Mensinger1-1/+2
2020-09-28typing: fully annotate cmake.fileapiDaniel Mensinger1-10/+14
2020-09-28typing: fully annotate cmake.executorDaniel Mensinger1-31/+35
2020-09-27typing: fully annotate cmake.commonDaniel Mensinger2-42/+50
2020-09-27typing: fully annotate cmake.clientDaniel Mensinger1-35/+43
2020-09-10cmake: fix shared_module dependency (fixes #7715)Daniel Mensinger1-0/+4
2020-08-30CMake module: fix cmake 3.10 compatibility in path generationSebastian Würl1-4/+4
2020-08-30CMake module: fix python 3.6 compatibility in path generationSebastian Würl1-2/+2
2020-08-30CMake module: Allow paths of generated CMake sources for include directoriesSebastian Würl1-3/+11
2020-08-22cmake: Fix detection of AppleClangDylan Baker1-6/+19
It's not enough to detect that the linker is ld64: gcc, icc, and vanilla clang all use ld64 on macoOS. Instead we have to detect the class of the compiler, and determine if it's an Apple Compiler or a vanilla one.
2020-08-12cmake: Use a mapping when writing compiler IDNirbheek Chauhan1-1/+26
Meson and CMake compiler ids are different. This commit adds a mapping from the meson list: https://mesonbuild.com/Reference-tables.html#compiler-ids to the CMake list: https://cmake.org/cmake/help/latest/variable/CMAKE_LANG_COMPILER_ID.html The mapping is not 1-1, and not all entries are mapped, so this is a best-effort attempt. Fallback to GNU as before to try to limp along and hope that the build files don't rely on an accurate compiler ID.
2020-08-12cmake: Fix hard-coded values in fake CMakeLists for MSVCNirbheek Chauhan1-16/+28
Without this, MSVC and MSVC_VERSION won't be set by CMake during platform detection, and the compiler will be an undefined mixture of GNU and MSVC. In particular, find_package(opencv) will fail on Windows when building with MSVC.
2020-08-09cmake: Detect custom command targets in compiler argsDaniel Mensinger1-1/+8
This is required to make `-include /path/to/custom/target.hpp` work. This setup is used by wxWidgets and this PR is required to use wxWidgets as a CMake subproject.
2020-08-07cmake: make the traceparser permissive by default (fixes #7501)Daniel Mensinger1-1/+1
2020-08-05Merge pull request #7527 from mensinda/cnFixExeJussi Pakkanen2-4/+16
cmake: resolve IMPORTED executables in custom commands (fixes #7509)
2020-08-05cmake: Do not split CMAKE_PREFIX_PATH with ':' on WindowsNirbheek Chauhan1-1/+6
This is obviously wrong, since on Windows ':' is in the drive letter. Causes us to call cmake with `-DCMAKE_PREFIX_PATH=c;\foo\bar`.
2020-08-03cmake: resolve IMPORTED executables in custom commands (fixes #7509)Daniel Mensinger2-4/+16
2020-07-16mdata: remove setuptools and use mesondata insteadDaniel Mensinger1-3/+2
2020-07-01Merge pull request #7231 from mensinda/cmOverrideJussi Pakkanen3-9/+112
cmake: Add more advanced subproject configuration options
2020-06-30Move mesonbuild/cmake/data/run_ctgt.py to ↵georgev932-101/+3
mesonbuild/scripts/cmake_run_ctgt.py, as well as enclose everything in a run() function so it can be called by `meson --internal cmake_run_ctgt ...`. Also, include mesonbuild/cmake/data/ in the msi package.
2020-06-13cmake: fix definitions with interface libraries (fixes #7299)Daniel Mensinger1-7/+6
2020-06-13cmake: Fix handling of path seperators (fixes #7294)Daniel Mensinger1-1/+1
2020-06-12dependencies: Don't allow using the default binary for host on cross compilesDylan Baker1-1/+1
Otherwise we can end up finding dependencies from the build machine for the host machine, which is incorrect. This alters cmake, pkg-config, and all config-tool based dependencies. Fixes: #7276
2020-06-12cmake: Use shared find_external_program instead of open codingDylan Baker1-22/+5
2020-06-12cmake: Subprojects support CMAKE_PREFIX_PATH (fixes #7249)Daniel Mensinger1-0/+22
2020-06-09cmake_traceparser: ignore parse errorMichael Hirsch1-1/+1