aboutsummaryrefslogtreecommitdiffstats
path: root/share/qbs/modules/cpp/msvc.js
Commit message (Collapse)AuthorAgeFilesLines
* C++: Add support for clang on WindowsChristian Kandeler2019-08-141-0/+43
| | | | | | | | | | | | | This is about clang in "mingw mode", not clang-cl. When targeting Windows, clang is a lot like mingw, so factor out the common parts into a new base module. Testing uncovered a number of invalid assumptions in our autotests, which are also fixed in this patch. In addition, minor adjustments had to be made to the Qt.core module and to the qbscore lib. Change-Id: I73085dc62a65e2a9d0397cf234c8641989246f22 Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* C/C++: Prevent adjacent duplicate libsChristian Kandeler2019-05-271-1/+6
| | | | | | | | It is never necessary to have the same library on the linker command line twice in a row, so we can safely remove such duplicates. Change-Id: Ie6ebe489862702828996fb78533eb4ac400df1cd Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Add support for the clang-cl compilerIvan Komissarov2019-04-101-7/+21
| | | | | | Task-number: QBS-1316 Change-Id: Ibf9da364610c260ead088a8990a70c7739d53c39 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* MSVC: Fix handling of intermediate objectsChristian Kandeler2018-12-031-1/+2
| | | | | | | Amends 2e830e5e4f. Change-Id: Ifecc822412c481d45121fa7d792e1fb2aa4e2064 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* MSVC: Give hint about possible reason for missing import libChristian Kandeler2018-09-041-4/+23
| | | | | | | | | | If an import lib is unexpectedly not present, the reason is usually that no symbols are exported from the DLL. This is not obvious at all, so catch this condition and explain what is happening. Task-number: QBS-1291 Change-Id: Ia2df8e1a27e0231e855413245703ffc05221722e Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* MSVC: Suppress "performing full link" also for executablesOrgad Shaneh2018-08-291-1/+2
| | | | | Change-Id: Ibf544198b23021361d90b3d3c1cdbbbb0651453b Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Add support for job poolsChristian Kandeler2018-08-081-0/+2
| | | | | | | | | | | | | | | | | | | | | | Commands can now be assigned to an arbitrary job pool and a limit for the number of concurrently running jobs in such pools can be provided in a number of ways: - via the build command line: qbs --job-limits linker:1 - via the settings: qbs config preferences.jobLimit.linker 1 - in a project file: JobLimit { jobPool: "linker"; jobCount: 1 } We provide two job pools ourselves with the cpp module: "compiler" and "linker". [ChangeLog] Added the concept of job pools for limiting concurrent execution of commands by type Task-number: QBS-743 Change-Id: Ib3f361dbc73093e342bf0eba0daf2079a2b3a8ce Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* MSVC: Suppress "performing full link" messageOrgad Shaneh2018-07-101-1/+1
| | | | | | | | | | | | Building a DLL in debug mode for the first time shows the following error message, which also causes the entire command to be printed out: LINK : F:\Projects\...\Library.dll not found or not built by the last incremental link; performing full link Change-Id: I17d530e184074796b17178ae9efce66bc877ffa2 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* MSVC: Relax version check for /WHOLEARCHIVEChristian Kandeler2018-06-181-1/+1
| | | | | | | | The flag is supported in earlier compiler versions than our code assumed. Change-Id: I5bc32c29c61885ca38e60bb8a000250a11d32b0c Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Make cpp.cxxLanguageVersion a listChristian Kandeler2018-05-141-1/+3
| | | | | | | | | | | ... and choose the highest entry. This enables different modules to specify their requirements without introducing conflicts. Same for cpp.cLanguageVersion. Task-number: QBS-1225 Change-Id: I96ed6c370eb190023fdb69274dcb080d967f512d Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Expose cl-generated PDBs as debuginfo_cl artifacts for static libsJoerg Bornemann2018-04-181-0/+3
| | | | | | | | | [ChangeLog] For MSVC static libraries, compiler-generated PDB files are now tagged as debuginfo_cl to make them installable. Change-Id: I8431dbffbbc31c48f1bc7aea96332e0b2408c743 Task-number: QBS-1106 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Officially provide "c++17" as possible value for cpp.cxxLanguageVersionChristian Kandeler2018-02-071-0/+9
| | | | | | | | The standard is out now. Task-number: QBS-1020 Change-Id: Ie8249e1c860d5ebc2f9dadf02551544ddaaf2868 Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* Enable modules to declare target artifactsChristian Kandeler2017-11-071-0/+2
| | | | | | | | | | | | | Such artifacts appear to rules just like target artifacts of products. This functionality will be useful for auto-generating qbs modules from products. [ChangeLog] Modules can now declare target artifacts using the new filesAreTargets property of the Group item. Task-number: QBS-882 Change-Id: I3bba000be9a1057d9fef01e5576363719ff1f244 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Check return values of sanitizedListProperty()Joerg Bornemann2017-10-191-2/+8
| | | | | | | | | | | | | This function can return other things than Array objects. Check the return value before passing it to concat. This fixes evaluation errors in the following situation: Product A depends on product B, and - B provides staticlibrary or dynamiclibrary artifacts, and - B does not have a cpp dependency. Change-Id: Id59988ed8846564e0590be6dacdda154a59d0b61 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Get rid of the ".obj" subdir in our build directoriesJoerg Bornemann2017-10-061-1/+1
| | | | | | | | | | | We claim that build directories are opaque, yet there's a ".obj" subdir where object files are placed. This needlessly adds a level in the build dir structure. Remove the creation and usage of this directory, which is clearly qmake legacy. Change-Id: I3afa6bd61b76941ecebbc2cd8f4109621694e371 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* Merge 1.9 into masterChristian Kandeler2017-08-281-2/+23
|\ | | | | | | Change-Id: I5320b7c62d6a80089df75c2caca79c15602c01e5
| * Support MSVC's /std optionChristian Kandeler2017-08-231-2/+23
| | | | | | | | | | | | | | | | | | | | We failed to notice that it was introduced with update 3 of VS 2013. [ChangeLog] The cpp.cxxLanguageVersion property now gets mapped to MSVC's /std option, if applicable. Change-Id: I00d45aecefb2ad27f2b5891d62d591179f2dbeec Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* | Introduce the cpufeatures moduleChristian Kandeler2017-08-281-0/+25
| | | | | | | | | | | | | | | | | | Provides an abstraction for the respective compiler flags. The initial set of properties is the superset of what Qt can configure and what MSVC supports. Change-Id: I1be90361f2f104a55d2a784a69625396680b0713 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* | Introduce property cpp.discardUnusedDataChristian Kandeler2017-08-251-0/+9
| | | | | | | | | | | | | | | | | | Maps to linker options that strip unneeded symbols or sections. [ChangeLog] Added new property cpp.discardUnusedData. Change-Id: I2f2c7f449e9ac426af859fac4d1e3b941be2a2ab Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* | Automatically determine built-in compiler definesJake Petroules2017-08-111-9/+0
| | | | | | | | | | | | | | | | This provides users with access to the full list of macros defined by the MSVC, GCC, Clang, or MinGW compiler in use. Change-Id: I6e7f6841bbc18aed13958724b268283d97b17320 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Add initial support for Universal Windows PlatformJake Petroules2017-08-011-0/+4
|/ | | | | | | | | | | [ChangeLog] Added initial support for the Universal Windows Platform (properties for which API families/partitions are available to code being compiled, and whether compiled binaries require an app container context to load/execute). Change-Id: Idd3e117bbb40bd547ae06c16318b2d2e38f07bb4 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Do not use hardcoded file locations when accessing pch filesChristian Kandeler2017-07-041-28/+23
| | | | | | | | Instead, retrieve the file path via the artifact data that is now available in a prepare script's "explicitlyDependsOn" parameter. Change-Id: I11d3f338059ec7e9a2db479ba4f721452ecb3438 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Do not create copies of precompiled header source files on MSVCJoerg Bornemann2017-06-201-13/+12
| | | | | | | | | | | | We used to create copies of cpp_pch_src and c_pch_src files in the MSVC compiler rule to create an unambiguous file name that can be used in later calls to the compiler rule. This hack is not necessary anymore. We can inspect the artifacts of the product in the compiler rule. Change-Id: I40ff119e2507cae3210c52c82fd38cfd83cf261c Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Re-run process commands if a relevant environment variable has changedChristian Kandeler2017-06-081-0/+2
| | | | | | | | | | | | Process commands can now declare that they are sensitive to certain environment variables. If such a variable changes its value, we invalidate the respective transformer. [ChangeLog] Added new property "relevantEnvironmentVariables" to the Command class Change-Id: Id866dc676b3b483a5d843e6125c91829f5094eba Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* Introduce dependency parameter cpp.linkWholeArchiveChristian Kandeler2017-05-221-6/+27
| | | | | | | | | | | | | Maps to --whole-archive, -force_load and /WHOLEARCHIVE on the toolchain level. [ChangeLog][Parameters] When pulling in static library products, the new Depends parameter cpp.linkWholeArchive can now be specified to force all the library's objects into the target binary. Task-number: QBS-701 Change-Id: Ic6482092f39f9ecb1ffb8e37d3031a94dc830be8 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Make it possible to parametrize dependenciesJoerg Bornemann2017-05-221-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Modules can declare dependency parameters, e.g. Module { name: "cpp" Parameter { property bool link } } Those parameters can be set in Depends items: CppApplication { Depends { name: "otherProduct" cpp.link: false } } Export items can provide default values for dependency parameters: DynamicLibrary { ... Export { Parameters { cpp.link: false } } } Rules can react on dependency parameters by accessing dep.parameters where dep is an object from the product.dependencies hierarchy. Showcase and test the feature by adding the cpp.link parameter, which can be set to false for library dependencies that should not be linked. [ChangeLog] Added a way to parametrize dependencies. [ChangeLog][Parameters] Added the cpp.link parameter to enable library dependencies to be excluded from linking. Task-number: QBS-585 Change-Id: I3b445ed65d5949a94426879e07a533a1c2af24d8 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Add support for 64-bit ARM targets with Microsoft Visual C++Jake Petroules2017-05-081-0/+3
| | | | | | | | | | | | | | | | | | | Although the compiler has not yet been publicly released, we can find references for the names of things in order to future-proof qbs for when it is. The name of the 64-bit ARM assembler can be found in two locations: - https://github.com/Microsoft/ChakraCore/blob/master/Build/armasm.props - https://msdn.microsoft.com/en-us/magazine/mt795185.aspx The name of the 64-bit linker option: - https://github.com/dotnet/coreclr/blob/master/CMakeLists.txt The name of the ARM64 compiler macro: - https://msdn.microsoft.com/en-us/library/b0084kay.aspx Change-Id: I7ec9c112f149845e2a84a5907bb5b2eb87235a11 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Merge 1.8 into masterChristian Kandeler2017-05-051-1/+1
|\ | | | | | | Change-Id: Ie4ec88083aa4c85bbe872d8dc175960292f75d5c
| * Support command files in cpp.{static,dynamic}LibrariesChristian Kandeler2017-04-281-1/+1
| | | | | | | | | | | | | | We will make use of that in a follow-up patch. Change-Id: I1fb6ca0938bbcc6f53bd0046761023a1b8563949 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* | Fix cpp module for MSVCJoerg Bornemann2017-04-141-3/+4
| | | | | | | | | | | | | | Handle the case of products without native.pe.manifest artifacts. Change-Id: Ic6ae8684fd9298f3089b36339138bce6d0390738 Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* | Improve support for Windows SxS assembly manifestsJake Petroules2017-04-131-7/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There's no reason to limit manifest embedding solely to the manifest generated by link.exe. Additionally, this makes it easier to add content to the manifest by adding files with manifest fragments rather than having to manually compose them and create Windows Resource files to apply them. On MSVC, this allows the manifest tool to merge multiple manifests into the final assembly without having to manually create a .rc file or perform the merging. On MinGW, this allows a manifest to be merged into the final assembly without having to manually create a .rc file. Unlike MSVC, manifest merging is not yet supported because the toolchain does not provide this capability. Qbs may begin to emulate this capability at some point, but for now specifying multiple manifest files in a product with MinGW will result in an error. Change-Id: I12e2db809c8b638168567f4342288eac568a57ca Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* | MSVC: let the linker embed manifestsJoerg Bornemann2017-04-071-10/+13
|/ | | | | | | | | | | | | Since VS 2012 the /MANIFEST:embed linker option is supported that automatically embeds the linker-generated manifest. A separate call to mt.exe is not needed. This speeds up linking with VS >= 2012 a bit. Change-Id: I4b573b6ce36df025e98ab7cd6982d5f0f5f8a9e6 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* Remove some usage of product.modulePropertyJoerg Bornemann2017-03-161-30/+29
| | | | | | | | | | | Keep moduleProperty calls for cpp.{flags|platformFlags|usePrecompiledHeader}, because ModUtils.moduleProperty maps those to their language-specific properties (e.g. cxxflags). Change-Id: Id2280a42b26318b3a320d9df22801626336c72e6 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* Re-work linking library dependenciesJoerg Bornemann2017-03-091-23/+50
| | | | | | | | | | | | | Traverse the dependency graph and collect library dependencies top-down. Do not "push" library information "upwards" when building a library. For gcc, differentiate between "public" and "private" library dependencies. Public library dependencies are added to the command line with -l. Private library dependencies are transitive shared object dependencies of shared objects. Those are added with -rpath-link. Change-Id: I4c0015910b746fb2d996fc9cf3074050512f02d5 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Fix cpp.optimization: "none" for MSVCJoerg Bornemann2017-02-211-4/+9
| | | | | | | Turning off MSVC compiler optimization never worked. Change-Id: If4e339e28ed66863797f97f741054e520a3af460 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Deprecate loadFile and loadExtension in favor of requireJake Petroules2017-02-151-4/+4
| | | | | | | | | | | | This is more in line with mainstream JavaScript (especially node.js) which uses the CommonJS/RequireJS scheme for loading external modules. [ChangeLog] The loadFile and loadExtension functions are deprecated in favor of the new require function, which accepts arguments of either form accepted by the deprecated functions. Change-Id: Icc00aa3eb7c136a5be787f28ef38435e4ce261bb Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* cpp module: fixed output path for pch_copy file in JavaScriptCommandSergey Petrov2017-01-051-1/+1
| | | | | Change-Id: Icec903bef4cfccf3a1d1075b46bda57e1cfa5fad Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Use different tags for debug info created by different rulesChristian Kandeler2017-01-021-2/+3
| | | | | | | | | Otherwise, rule conflicts occur when users try to process the "debuginfo" artifacts further. Task-number: QBS-1089 Change-Id: I70141cfbf2a966ab0414cbabab5e4785fd4a96c6 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Merge 1.6 into masterChristian Kandeler2016-10-171-1/+8
|\ | | | | | | Change-Id: Ie98233d955f3695da0b20069fb2317931e353e4e
| * Introduce property cpp.linkerWrapperThomas Epting2016-10-101-1/+8
| | | | | | | | | | | | | | | | | | | | This allows integration with tools like Bullseye Coverage. Task-number: QBS-1000 Change-Id: I318599a9df0f082a096fb72db7a8878b15e571cc Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Jake Petroules <jake.petroules@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* | Merge 1.6 into masterChristian Kandeler2016-08-291-1/+1
|\| | | | | | | Change-Id: If4ec894bc327311eeb41609a5d340a884161fda7
| * MSVC: Escape the percent sign in definesChristian Kandeler2016-08-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | The percent sign is special to cl.exe in mysterious ways. It has to be escaped with another one. This is indepent of whether the defined value is a string or not. Change-Id: I7bf4a46cea33c29007894566cf38b41d526fd94a Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* | Deprecate the "moduleProperties" functionChristian Kandeler2016-08-041-11/+11
|/ | | | | | | | Ever since we introduced module merging, there has been no difference between moduleProperty() and moduleProperties(). Change-Id: I3f9a9df3f24bf971828e774a5f687356509df2ca Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* Merge remote-tracking branch 'origin/1.5'Joerg Bornemann2016-06-081-5/+1
|\ | | | | | | | | | | | | | | Conflicts: doc/reference/items/transformer.qdoc share/qbs/modules/cpp/GenericGCC.qbs Change-Id: I45560834560019b18274c373c45651eb8aadd206
| * Replace 'the Qt build suite' with 'Qbs' in copyright notices.Jake Petroules2016-06-061-1/+1
| | | | | | | | | | | | Change-Id: I885d94bb14b325dc36767a840ebdb0be1fb59dd2 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
| * Print more descriptive "unknown Windows version" warning messages.Jake Petroules2016-05-301-4/+0
| | | | | | | | | | | | | | | | | | Incidentally, this also fixes a bug causing Windows 10 to be treated as Windows 1.0 in the subsystem version. Task-number: QBS-978 Change-Id: I5aa1763ce9d0a9b12aa50e864086cc2ae4ceb3c1 Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
* | Merge remote-tracking branch 'origin/1.5'Joerg Bornemann2016-05-181-0/+9
|\| | | | | | | | | | | | | | | Conflicts: qbs-resources/imports/QbsFunctions/functions.js qbs_version.pri Change-Id: I24c4c941d825e61ddd2e704c8cea29eaa9943997
| * Add missing _MSC_VER=XXXX define to compilerDefinesJoerg Bornemann2016-05-171-0/+9
| | | | | | | | | | | | | | The _MSC_VER define must be passed to moc and friends. Change-Id: I77d1a030e802a24b6980d67434e05ae0be96a20d Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
* | Remove items scheduled for removal in 1.6.Jake Petroules2016-04-221-21/+0
|/ | | | | Change-Id: I4098b281ab9c1f5bc29fe23164dd3a3303759ce0 Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
* Move enableRtti property from Android.ndk to cpp module.Jake Petroules2016-04-141-0/+5
| | | | | | | This is in no way Android-specific. Change-Id: I636cc44827b1c64815c0197fc724ede8abe949f8 Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>