summaryrefslogtreecommitdiff
path: root/mesonbuild/backend/vs2010backend.py
Commit message (Collapse)AuthorAgeFilesLines
...
* vs: support Generator outputs as CustomTarget inputsNicolas Schneider2017-03-201-17/+9
| | | | | | | | | | This changes how generated files are added to the VS project. Previously, they were all added as a single CustomBuildStep with all generator commands, inputs and outputs merged together. Now, each input file is added separately to the project and is given a CustomBuild command. This adds all generator input files to the files list in the VS gui and allows to run only some of the generator commands if only some of the input files have changed.
* find_program: Fix implementation of .path()Nirbheek Chauhan2017-02-191-1/+1
| | | | | | | | And actually test that prog.path() works. The earlier test was just running the command without checking if it succeeded. Also make everything use prog.get_command() or get_path() instead of accessing the internal member prog.fullpath directly.
* Merge pull request #1335 from tp-m/test-custom-target-used-in-test-cmdJussi Pakkanen2017-01-281-32/+56
|\ | | | | tests: check custom target output is created before being used in a t…
| * vs: Fix running of tests to use mesontest.pyNirbheek Chauhan2017-01-281-6/+13
| | | | | | | | | | | | | | | | Back in November when this broke, we didn't notice because our tests are run in-process, so we don't check that `msbuild RUN_TESTS.vcxproj` and `ninja test` actually work. Now we do.
| * backends: Add support for build_by_default to vs2010 backendNirbheek Chauhan2017-01-281-26/+43
| | | | | | | | | | | | Always generate the vcxproj file, but only add it to the build configuration if it's either supposed to be built by default, or is a dependency of another target that is built by default.
* | vs: Add support for the 'werror' builtin optionNirbheek Chauhan2017-01-281-4/+5
| |
* | vs: Use CompilerArgs() for compile and link argsNirbheek Chauhan2017-01-281-61/+117
| | | | | | | | | | At the same time also fix the order in which they are added. They now match the order used in the Ninja backend.
* | compilers: New class CompilerArgs derived from list()Nirbheek Chauhan2017-01-271-3/+3
|/ | | | | | | | | | | | | | | | | The purpose of this class is to make it possible to sanely generate compiler command-lines by ensuring that new arguments appended or added to a list of arguments properly override previous arguments. For instance: >>> a = CompilerArgs(['-Lfoo', '-DBAR']) >>> a += ['-Lgah', '-DTAZ'] >>> print(a) ['-Lgah', '-Lfoo', '-DBAR', '-DTAZ'] Arguments will be de-duped if it is safe to do so. Currently, this is only done for -I and -L arguments (previous occurances are removed when a new one is added) and arguments that once added cannot be overriden such as -pipe are removed completely.
* cleanup: Unbound local variableMike Sinkovsky2017-01-181-1/+0
|
* cleanup: Remove redundant parenthesesMike Sinkovsky2017-01-181-3/+3
|
* cleanup: Unused local variablesMike Sinkovsky2017-01-181-1/+1
|
* Add support for Files passed to generators.Elliott Sales de Andrade2017-01-121-1/+1
| | | | | I need this for windows.compile_resources to be able to use configure_file results, but it may have other benefits.
* style: [E502] the backslash is redundant between bracketsMike Sinkovsky2017-01-111-1/+1
|
* style: fix E128 violationsIgor Gnatenko2017-01-011-6/+6
| | | | | | E128: continuation line under-indented for visual indent Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
* style: fix E265 violationsIgor Gnatenko2017-01-011-2/+2
| | | | | | E265: block comment should start with '# ' Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
* style: fix E231 violationsIgor Gnatenko2017-01-011-1/+1
| | | | | | E231: missing whitespace after ',' Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
* style: fix E226 violationsIgor Gnatenko2017-01-011-3/+3
| | | | | | E226: missing whitespace around arithmetic operator Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
* style: fix E225 violationsIgor Gnatenko2017-01-011-11/+11
| | | | | | E225: missing whitespace around operator Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
* Fix space before :.Jussi Pakkanen2016-12-311-19/+19
|
* tree-wide: remove trailing whitespacesIgor Gnatenko2016-12-191-2/+2
| | | | Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
* tree-wide: remove unused variablesIgor Gnatenko2016-12-191-1/+0
| | | | | | | | | | | | | | | | | | | | ./mesonbuild/scripts/regen_checker.py:35:5: F841 local variable 'scriptdir' is assigned to but never used scriptdir = os.path.split(__file__)[0] ^ ./mesonbuild/scripts/yelphelper.py:84:13: F841 local variable 'symfile' is assigned to but never used symfile = os.path.join(install_dir, m) ^ ./mesonbuild/backend/backends.py:164:13: F841 local variable 'lang' is assigned to but never used lang = comp.get_language() ^ ./mesonbuild/backend/ninjabackend.py:1286:9: F841 local variable 'scriptdir' is assigned to but never used scriptdir = self.environment.get_script_dir() ^ ./mesonbuild/backend/vs2010backend.py:736:9: F841 local variable 'additional_options_set' is assigned to but never used additional_options_set = True ^ Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
* tree-wide: remove unused importsIgor Gnatenko2016-12-191-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ./setup.py:17:1: F401 'os' imported but unused import os ^ ./setup.py:37:1: F401 'stat.ST_MODE' imported but unused from stat import ST_MODE ^ ./run_tests.py:17:1: F401 'os' imported but unused import subprocess, sys, os ^ ./run_tests.py:18:1: F401 'shutil' imported but unused import shutil ^ ./run_unittests.py:23:1: F401 'mesonbuild.dependencies.Qt5Dependency' imported but unused from mesonbuild.dependencies import PkgConfigDependency, Qt5Dependency ^ ./mesonbuild/build.py:15:1: F401 '.coredata' imported but unused from . import coredata ^ ./mesonbuild/interpreter.py:32:1: F401 'subprocess' imported but unused import os, sys, subprocess, shutil, uuid, re ^ ./mesonbuild/interpreter.py:32:1: F401 're' imported but unused import os, sys, subprocess, shutil, uuid, re ^ ./mesonbuild/dependencies.py:23:1: F401 'subprocess' imported but unused import os, stat, glob, subprocess, shutil ^ ./mesonbuild/mesonlib.py:17:1: F401 'sys' imported but unused import platform, subprocess, operator, os, shutil, re, sys ^ ./mesonbuild/modules/qt5.py:15:1: F401 'subprocess' imported but unused import os, subprocess ^ ./mesonbuild/modules/pkgconfig.py:15:1: F401 '..coredata' imported but unused from .. import coredata, build ^ ./mesonbuild/scripts/scanbuild.py:15:1: F401 'sys' imported but unused import sys, os ^ ./mesonbuild/scripts/meson_exe.py:20:1: F401 'subprocess' imported but unused import subprocess ^ ./mesonbuild/scripts/meson_exe.py:22:1: F401 '..mesonlib.MesonException' imported but unused from ..mesonlib import MesonException, Popen_safe ^ ./mesonbuild/scripts/symbolextractor.py:23:1: F401 'subprocess' imported but unused import os, sys, subprocess ^ ./mesonbuild/scripts/symbolextractor.py:25:1: F401 '..mesonlib.MesonException' imported but unused from ..mesonlib import MesonException, Popen_safe ^ ./mesonbuild/scripts/meson_install.py:19:1: F401 '..mesonlib.MesonException' imported but unused from ..mesonlib import MesonException, Popen_safe ^ ./mesonbuild/scripts/yelphelper.py:15:1: F401 'sys' imported but unused import sys, os ^ ./mesonbuild/scripts/yelphelper.py:20:1: F401 '..mesonlib.MesonException' imported but unused from ..mesonlib import MesonException ^ ./mesonbuild/backend/vs2010backend.py:17:1: F401 're' imported but unused import re ^ ./test cases/vala/8 generated sources/src/copy_file.py:3:1: F401 'os' imported but unused import os ^ ./test cases/common/107 postconf/postconf.py:3:1: F401 'sys' imported but unused import sys, os ^ ./test cases/common/129 object only target/obj_generator.py:5:1: F401 'shutil' imported but unused import sys, shutil, subprocess ^ ./test cases/common/57 custom target chain/usetarget/subcomp.py:3:1: F401 'os' imported but unused import sys, os ^ ./test cases/common/95 dep fallback/subprojects/boblib/genbob.py:3:1: F401 'os' imported but unused import os ^ ./test cases/common/98 gen extra/srcgen.py:4:1: F401 'os' imported but unused import os ^ ./test cases/common/113 generatorcustom/gen.py:3:1: F401 'os' imported but unused import sys, os ^ ./test cases/common/113 generatorcustom/catter.py:3:1: F401 'os' imported but unused import sys, os ^ ./test cases/common/59 object generator/obj_generator.py:5:1: F401 'shutil' imported but unused import sys, shutil, subprocess ^ Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
* gnome.mkenums: Use absolute paths for all commandline argsNirbheek Chauhan2016-12-151-0/+3
| | | | | | Closes #973 test cases/vala/8 generated sources/ tests this.
* Merge pull request #1126 from mesonbuild/sharedmoduleJussi Pakkanen2016-12-071-0/+3
|\ | | | | Support for shared modules
| * Skip shared module test on VS because it fails for some reason nobody ↵Jussi Pakkanen2016-12-071-0/+1
| | | | | | | | understands.
| * Add unresolved symbol arg to link line in VS backends. For someJussi Pakkanen2016-12-061-0/+2
| | | | | | | | | | reason VS does not pick it up even though it is visible in the linker option box.
* | misc: Use relative imports everywhereNirbheek Chauhan2016-12-071-6/+5
|/ | | | | | Using 'mesonbuild' as the module can cause it to use the system-installed module and can also break if we rename the directory, so avoid that by always using relative imports.
* Add new add_project_[link]_args functionsThibault Saunier2016-11-121-0/+3
| | | | Fixes 979
* vs: Properly split per-compiler args into per-file optionsNirbheek Chauhan2016-11-101-64/+96
| | | | | | | Previously we were just dumping all defines and include directories into the target-wide list of defines and include directories. Now we have separate per-target and per-file (actually per-language) arguments, defines, and include directories.
* CustomTarget: Use get_outputs() instead of get_filename()Nirbheek Chauhan2016-10-191-3/+3
| | | | | | | | get_filename() made no sense for CustomTarget since it can have multiple outputs. Also use get_outputs() for GeneratedList since it has the same meaning and remove unused set_generated(). As a side-effect, we now install all the outputs of a CustomTarget.
* Use context manager for file I/O.Elliott Sales de Andrade2016-08-271-52/+68
| | | | | There are a few cases where a context manager cannot be used, such as the logger.
* vs: Fix quoting and escaping of compiler optionsNirbheek Chauhan2016-07-291-6/+43
| | | | | | | | | | Target-specific compiler options should be split into pre-processor defines, include directories, and additional options, then escaped/quoted and added to the appropriate portions of the project file. The "115 spaces backslash" test now checks that backslashes and spaces now work properly in all three places.
* vs: Fix visual studio version in solution file (#648)Nirbheek Chauhan2016-07-181-1/+2
|
* vs: Target platform is not always Win32Nirbheek Chauhan2016-07-111-2/+20
| | | | | It depends on the target machine. Without this building for 64-bit fails when using external dependencies.
* vs: Don't re-add pre-existing include dirsNirbheek Chauhan2016-07-011-1/+4
| | | | Reduces noise in the vcxproj files
* vs: Fix usage of mesonlib.File.rel_to_builddir with generated filesNirbheek Chauhan2016-07-011-4/+4
| | | | | | It should always be passed build_to_src otherwise the path for generated files will always be wrong. Passing the vcxproj path as the build_to_src only works for files in the source tree.
* vs: Explain path-conversion variablesNirbheek Chauhan2016-07-011-0/+3
| | | | | It's not easy to understand what these variables mean and what they're used for without some comments
* vs: Add support for the 'vs_module_defs' shared_library kwargNirbheek Chauhan2016-07-011-0/+4
|
* vs: Fix the path of customtarget generated sourcesNirbheek Chauhan2016-07-011-2/+6
| | | | The path is relative to the vcxproj file, not relative to the build root
* vs: Set all compiler/linker options correctlyNirbheek Chauhan2016-07-011-19/+89
| | | | | | | | | | | | | | | | | These need to be set via XML tags and not passed directly as AdditionalOptions. Otherwise the project will end up with inconsistent compiler options and the build will fail. Since Meson internals assume that these will be set via a command-line invocation, we need to detect the presence of various flags in buildtype_args and buildtype_link_args and set the correct options in the vcxproj file. Note that this means different configurations (debug/release/etc) cannot be enumerated in the vcxproj/sln files and chosen by the user at build time because arbitrary build characteristics can depend on that. The only way to support that is by doing a full parse and conversion of Meson build files (for all build options) to vcxproj files.
* vs: Fix paths of internal library dependenciesNirbheek Chauhan2016-07-011-2/+1
| | | | They are relative to the path of the vcxproj file, not relative to build root
* vs: Add libraries, library paths, and link args needed by dependenciesNirbheek Chauhan2016-07-011-5/+47
| | | | | | The link arguments for each dependency are split into these three and added to the vcxproj file. Without this targets cannot find the external dependencies.
* vs: Add include dirs required by dependenciesNirbheek Chauhan2016-07-011-4/+8
| | | | Also ensure that they're translated from UNIX to native as required
* vs: Set TargetName/TargetExt correctlyNirbheek Chauhan2016-07-011-2/+4
| | | | Without this the filename set by the user and Meson is completely ignored
* Overhaul versioning and naming of librariesNirbheek Chauhan2016-07-011-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit contains several changes to the naming and versioning of shared and static libraries. The details are documented at: https://github.com/mesonbuild/meson/pull/417 Here's a brief summary: * The results of binary and compiler detection via environment functions are now cached so that they can be called repeatedly without performance penalty. This is necessary because every build.SharedLibrary object has to know whether the compiler is MSVC or not (output filenames depend on that), and so the compiler detection has to be called for each object instantiation. * Linux shared libraries don't always have a library version. Sometimes only soversions are specified (and vice-versa), so support both. * Don't use versioned filenames when generating DLLs, DLLs are never versioned using the suffix in the way that .so libraries are. Hence, they don't use "aliases". Only Linux shared libraries use those. * OS X dylibs do not use filename aliases at all. They only use the soversion in the dylib name (libfoo.X.dylib), and that's it. If there's no soversion specified, the dylib is called libfoo.dylib. Further versioning in dylibs is supposed to be done with the -current_version argument to clang, but this is TBD. https://developer.apple.com/library/mac/documentation/DeveloperTools/Conceptual/DynamicLibraries/100-Articles/DynamicLibraryDesignGuidelines.html#//apple_ref/doc/uid/TP40002013-SW23 * Install DLLs into bindir and import libraries into libdir * Static libraries are now always called libfoo.a, even with MSVC * .lib import libraries are always generated when building with MSVC * .dll.a import libraries are always generated when building with MinGW/GCC or MinGW/clang * TODO: Use dlltool if available to generate .dll.a when .lib is generated and vice-versa. * Library and executable suffix/prefixes are now always correctly overriden by the values of the 'name_prefix' and 'name_suffix' keyword arguments.
* vs backends: Translate unix link and compile flags (#603)Nirbheek Chauhan2016-06-171-6/+3
|
* extract vs2015backend into own fileNicolas Schneider2016-05-301-18/+0
|
* vs2015: fix object generatorsNicolas Schneider2016-05-301-3/+27
|
* add vs2015 backendNicolas Schneider2016-05-301-0/+15
|
* vs: fix generators that use indexed output replacements (like @OUTPUT0@)Nicolas Schneider2016-05-261-2/+3
|