summaryrefslogtreecommitdiffstats
path: root/Modules/Platform/Windows-MSVC.cmake
Commit message (Collapse)AuthorAgeFilesLines
* Ninja: Refactor selection of 'deps = ' value for MS-compatible toolchainsBrad King2015-10-201-0/+2
| | | | | | Set variables in the platform information modules to tell the Ninja generator what deps type to use instead of hard-coding conditions in the generator itself.
* MSVC: Add system libs for WindowsStore on VS 2015Gilles Khouzam2015-10-021-1/+3
| | | | Use WindowsApp.lib for a Universal Application Platform project.
* Add support for *.manifest source files with MSVC toolsBrad King2015-09-171-2/+2
| | | | | | | | Classify .manifest sources separately, add dependencies on them, and pass them to the MS manifest tool to merge with linker-generated manifest files. Inspired-by: Gilles Khouzam <gillesk@microsoft.com>
* MSVC: Rewrite manifest file handling with Makefile and NinjaBrad King2015-09-171-2/+2
| | | | | | | | | Add a helper class private to "cmcmd.cxx" to contain the implementation. Update the link logic to use the intermediate files directory for each target to hold manifest and resource files before embedding into the binary. Preserve the old behavior of placing the .manifest file next to the binary when not linking incrementally even though it will be embedded.
* Factor an <INCLUDES> placeholder out of <FLAGS> in rule variablesBrad King2015-07-131-3/+3
| | | | | | | | | | | Teach the Makefile and Ninja generators to substitute for an <INCLUDES> placeholder instead of putting -I in <FLAGS>. Update our values for CMAKE_<LANG>_COMPILE_OBJECT, CMAKE_<LANG>_CREATE_ASSEMBLY_SOURCE, and CMAKE_<LANG>_CREATE_PREPROCESSED_SOURCE to place <INCLUDES> just before <FLAGS>.
* Place <DEFINES> before <FLAGS> consistently across compilersBrad King2015-07-131-3/+3
| | | | | | | | | | | | Update our values for CMAKE_<LANG>_COMPILE_OBJECT, CMAKE_<LANG>_CREATE_ASSEMBLY_SOURCE, and CMAKE_<LANG>_CREATE_PREPROCESSED_SOURCE to place <DEFINES> before <FLAGS> consistently across supported compilers. We already do this for most compilers, so update the rest for consistency.
* Merge topic 'auto_export_dll_symbols'Brad King2015-07-081-0/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | 8f86407c Windows: Optionally generate DLL module definition files automatically 069aa93b bindexplib: Add support for "/bigobj" format objects 61bbbdcf bindexplib: Fix treatment of some symbols de70c922 bindexplib: Teach DumpFile to return errors 8ea69dfe bindexplib: Build source as part of CMakeLib 2963cb2a bindexplib: Wrap long lines 4ff09893 bindexplib: Drop code that CMake does not need 7de8276c bindexplib: Add copyright/license notice block 65086ad7 bindexplib: Import original implementation from CERN
| * Windows: Optionally generate DLL module definition files automaticallyBill Hoffman2015-07-061-0/+2
| | | | | | | | | | | | | | Create target property WINDOWS_EXPORT_ALL_SYMBOLS to automatically generate a module definition file from MS-compatible .obj files and give it to the linker in order to export all symbols from the .dll part of a SHARED library.
* | VS: Add /machine: flag to Librarian tool (#11240)Brad King2015-06-261-0/+1
|/ | | | | | | | If a Windows resource (.rc) source file is included in a STATIC library, the VS "link" tool will process the compiled ".res" file and needs to know the target architecture. Without it, we may get a LNK4068 warning and possibly a LNK1112 error. Add /machine: to the default static library flags to give the link tool the information it needs.
* RC: Simplify selection of resource compiler based on C/C++ toolchainBrad King2015-05-071-0/+3
| | | | | | | | | | Revert the refactoring by commit v2.8.11~105^2~1 (Ninja: use MinGW generator code in EnableLanguage, 2013-03-09) and move the MinGW- specific logic back to the "MinGW Makefiles" generator. Instead teach the platform information modules for GNU and MSVC on Windows to set the preferred RC compiler just before enabling the RC language. This way we choose the RC compiler based on the C/C++ toolchain that is actually enabled.
* Merge topic 'windows-rc-enable-later'Brad King2015-02-261-4/+6
|\ | | | | | | | | | | | | 772eae44 RC: Add platform-specific preprocessor definitions (#15404) 4300de3e RC: Enable language after C, CXX, or Fortran is enabled (#15404) 1de4a0fb RC: Drop unused CMAKE_COMPILE_RESOURCE variable setting
| * RC: Add platform-specific preprocessor definitions (#15404)Brad King2015-02-251-0/+4
| | | | | | | | | | | | | | | | | | | | In Platform/Windows-MSVC the C and CXX flags are initialized to contain preprocessor definitions describing the platform. On WinCE platforms this may not be just -DWIN32. This information may be important to RC sources too, so add such preprocessor definitions to the default RC flags. Suggested-by: Gunnar Roth <gunnar.roth@gmx.de>
| * RC: Enable language after C, CXX, or Fortran is enabled (#15404)Brad King2015-02-251-3/+2
| | | | | | | | | | | | | | | | The RC language is special in that it is automatically enabled on Windows-based platforms when another primary language is enabled. Move enablement of RC from early in the enablement of the other language to late. This will allow it to use information detected as part of enabling C, CXX, or Fortran.
| * RC: Drop unused CMAKE_COMPILE_RESOURCE variable settingBrad King2015-02-251-1/+0
| | | | | | | | | | This variable has long been replaced by CMAKE_RC_COMPILE_OBJECT. Stop setting it in platform modules.
* | MSVC: Compile with arch-specific flags on ARM platforms (#14552)Gunnar Roth2015-02-241-0/+11
| | | | | | | | | | Define the exact ARM architecture name as a preprocessor symbol. Compile with /QRarch4T or /QRarch5T on ARMV4I or ARMV5I.
* | MSVC: Distinguish among ARM architectures more precisely (#14552)Gunnar Roth2015-02-241-10/+26
| | | | | | | | | | Detect the exact ARM architecture instead of just "ARM". Treat "ARM" as an architecture family that includes THUMB (ARMV4I and ARMV5I).
* | MSVC: Define /DWINCE when building for WinCE platforms (#14552)Gunnar Roth2015-02-241-1/+1
|/
* MSVC: Fix initialization of RelWithDebInfo shared library link flags (#15385)Brad King2015-02-031-1/+1
| | | | | | | | | | Initialize CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO_INIT from the value of CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT rather than the one for the DEBUG configuration. This typo has been present since the logic was first added in commit 36db45082e (ENH: fix up several problems with new stuff, 2002-11-11). Reported-by: Gunnar Roth <gunnar.roth@gmx.de>
* MSVC: Define 'WIN32' for Windows Store and Windows PhoneGilles Khouzam2014-09-021-0/+1
| | | | | This was accidentally left out of commit c72f0887 (MSVC: Add default WindowsPhone and WindowsStore compile flags, 2014-07-28).
* MSVC: Select default standard libraries for ARM platformBrad King2014-08-121-1/+5
| | | | For Windows ARM targets, only kernel32.lib and user32.lib are standard.
* MSVC: Add system libs for WindowsPhone and WindowsStoreBrad King2014-07-311-1/+5
| | | | | Use the libraries that are added by default by the VS 2013 IDE for Windows Phone and Windows Store projects.
* MSVC: Add default WindowsPhone and WindowsStore compile flagsPaul Annetts2014-07-311-0/+4
| | | | Also set the list of standard libraries to empty.
* MSVC: Disable incremental linking for WindowsPhone and WindowsStoreGilles Khouzam2014-07-311-4/+6
| | | | | Do not add a "/INCREMENTAL" flag when using the toolchains for these systems.
* Merge topic 'pdb-genex'Brad King2014-07-311-0/+1
|\ | | | | | | | | | | f86850ef Genex: Implement generator expressions for target PDB files. 028ad318 Genex: Simplify filesytem artifact code
| * Genex: Implement generator expressions for target PDB files.Nils Gladitz2014-07-311-0/+1
| |
* | WindowsCE: Refactor setting of "WINCE"Brad King2014-07-281-3/+0
| | | | | | | | | | | | Move it to the Platform/Windows module since it is independent of the compiler used. While at it, remove redundant "WIN32" setting from Platform/Windows-MSVC since Plaform/Windows already sets its.
* | MSVC: Use STREQUAL to check for WindowsCEBrad King2014-07-281-1/+1
|/ | | | | In the Platform/Windows-MSVC module it is not necessary to use MATCHES because we are comparing against an exact string.
* Merge topic 'wince-fix-dll-linking'Brad King2014-07-141-4/+6
|\ | | | | | | | | 7e1283e4 MSVC: Fix linking of DLLs on WinCE (#15013)
| * MSVC: Fix linking of DLLs on WinCE (#15013)Brad King2014-07-101-4/+6
| | | | | | | | | | | | | | | | On WinCE we must link both shared libraries and executables with the /subsystem:windowsce flag. Teach Platform/Windows-MSVC to pass it to the linker in both cases. Suggested-by: Gunnar Roth <gunnar.roth@gmx.de>
* | VS14: Add Visual Studio 14 generator (#14982)Brad King2014-06-251-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Call the generator "Visual Studio 14" without any year because this version of VS does not provide a year in the product name. Copy cmGlobalVisualStudio12Generator to cmGlobalVisualStudio14Generator and update version numbers accordingly. Add the VS14 enumeration value. Teach the platform module Windows-MSVC to set MSVC14 and document the variable. Teach module InstallRequiredSystemLibraries to look for the VS 14 runtime libraries. Teach tests CheckCompilerRelatedVariables, VSExternalInclude, and RunCMake.GeneratorToolset to treat VS 14 as they do VS 10, 11, and 12. Co-Author: Pawel Stopinski <diokhan@go2.pl>
* | MSVC: Add properties to configure compiler PDB files (#14762)Brad King2014-02-261-1/+1
|/ | | | | | | | | | Since commit v2.8.12~437^2~2 (VS: Separate compiler and linker PDB files 2013-04-05) we no longer set /Fd with the PDB_NAME or PDB_OUTPUT_DIRECTORY properties. Those properties now exclusively handle linker PDB files. Since STATIC libraries do not link their compiler PDB file becomes more important. Add new target properties "COMPILE_PDB_NAME[_<CONFIG>]" and "COMPILE_PDB_OUTPUT_DIRECTORY[_<CONFIG>]" to specify the compiler PDB file location and pass the value to the MSVC /Fd option.
* Merge topic 'vs12-parallel-cl-FS'Brad King2013-10-211-1/+1
|\ | | | | | | | | 216afc8 MSVC: Add /FS flag for cl >= 18 to allow parallel compilation (#14492)
| * MSVC: Add /FS flag for cl >= 18 to allow parallel compilation (#14492)Brad King2013-10-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In generators such as Ninja that can run multiple "cl" processes that refer to the same compiler .pdb file (/Fd) at the same time, MSVC from Visual Studio 2013 complains: fatal error C1041: cannot open program database '.../vc120.pdb'; if multiple CL.EXE write to the same .PDB file, please use /FS According to "cl /?": /FS force to use MSPDBSRV.EXE Add the flag to compilation lines for this compiler version just after the /Fd option.
* | Intel: When simulating MSVC, re-use Windows-MSVC (#14476)Brad King2013-10-181-5/+10
| | | | | | | | | | | | | | | | | | Teach CMake(C|CXX|Fortran)CompilerId* to report the MSVC version simulated by the Intel compiler, if any. Refactor the Windows-Intel platform information helper module to load Windows-MSVC instead of duplicating the information. Teach Windows-MSVC to understand when it is loaded as the simulated Fortran compiler (its preprocessor is simulated).
* | Clang: Support Windows variants for GNU and MSVC (#13035, #14458)Brad King2013-10-041-2/+6
|/ | | | | | | | | | | | | | | | Teach the compiler identification preprocessor tests to report when Clang simulates MSVC, and what version. If not MSVC, assume GNU. Teach compiler information modules Clang-(C|CXX) to recognize when Clang simulates MSVC and skip loading the GNU information. Teach the Windows-MSVC platform information to recognize when it is loaded as the simulated compiler and use that version information instead of the real compiler's (different) version scheme. Add platform modules Windows-Clang-(C|CXX) and support module Windows-Clang to load either Windows-MSVC or Windows-GNU and wrap the corresponding information macros.
* MSVC: Fix WinCE arch family preprocessor symbol (#14436)Patrick Gansterer2013-09-251-4/+11
| | | | | | | | | In commit bd827f98 (Use COFF file header header for architecture detection, 2013-08-05) the MSVC_<lang>_ARCHITECTURE_ID value computed by CMakeDetermineCompilerId.cmake changed for WinCE architectures to be the exact architecture read from the PE header. Fix platform preprocessor definitions in Modules/Platform/Windows-MSVC.cmake to correspond to the architecture family (ARM or SHx) instead of the specific architecture.
* MSVC: Fix version test for linking corelibc on Windows CE (#14420)Patrick Gansterer2013-09-231-1/+1
| | | | | | In commit 8fcf0ab0 (Add support for new Windows CE compiler, 2013-08-04) we made corelibc conditional on the MSVC version, but the version value was incorrect. Update it to use corelibc for VS 2008 and below.
* MSVC: Drop /link from executable link lines with NinjaBrad King2013-09-111-1/+0
| | | | | | | In commit fb9f73de (MSVC: Invoke 'link' directly for executables, 2013-04-08) we forgot to remove the /link option handling added by commit e31df039 (Ninja: move <OBJECTS> in front of the first linker option, 2012-09-27) to the Platform/Windows-MSVC module. Drop it now.
* Add support for new Windows CE compilerPatrick Gansterer2013-08-071-1/+5
| | | | | The new compiler versions do not need corelibc.lib as a default link library and a architecture detection workaround.
* WIN: Use COFF file header header for architecture detection (#14083)Patrick Gansterer2013-08-051-7/+0
| | | | | Read the machine field from the COFF file header to get the exact target architecture for ARM and SHx on the Windows platform.
* Merge branch 'master' into vs12-generatorBrad King2013-06-281-6/+3
|\ | | | | | | | | Resolve conflicts in Tests/Preprocess/CMakeLists.txt by keeping the side from 'master'.
| * Merge topic 'vs-configurations'Brad King2013-05-161-3/+0
| |\ | | | | | | | | | | | | 42bb42d VS: Always initialize CMAKE_CONFIGURATION_TYPES in IDE generators
| | * VS: Always initialize CMAKE_CONFIGURATION_TYPES in IDE generatorsBrad King2013-05-131-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Initialize the CMAKE_CONFIGURATION_TYPES cache entry early during EnableLanguage like the Xcode generator does. Avoid depending on the MSVC compiler information module to do it. Otherwise code like project(MyProj NONE) sets CMAKE_CONFIGURATION_TYPES late (in GenerateConfigurations), and to only "Debug" and "Release" instead of the standard set of 4. Reported-by: Paul Smith <paul@mad-scientist.net>
| * | Merge topic 'doc-improvements'Brad King2013-05-161-1/+1
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 7cc2805 Docs: Clarify wording "flag used" => "flag (to|will) be used" 2378a69 Docs: Clarify that CMAKE_*_(PREFIX|SUFFIX) affect filenames 56ca34d Docs: Update description of CMAKE_(BUILD_TYPE|CONFIGURATION_TYPES) 2bab472 VS10: add detailed comment about MIDL processing e619111 Explain distribution of Win9x binary on all Windows versions. 5ca4336 FindwxWidgets: add DOC strings with usual style f57800d Fix spelling and typos (product names) bf019d7 Fix spelling and typos (non-binary) ddac8d3 Fix spelling and typos (affecting binary data / module messages) 86832ce Fix spelling and typos (affecting users)
| | * | Fix spelling and typos (non-binary)Andreas Mohr2013-05-071-1/+1
| | |/
| * | MSVC: Invoke 'link' directly for executablesBrad King2013-04-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update the CMAKE_<LANG>_LINK_EXECUTABLE rule variable to invoke the linker directly instead of through the compiler. We already do this for DLL linking with CMAKE_<LANG>_CREATE_SHARED_LIBRARY. This also works around a VS 6 cl bug. While invoking the link tool internally it fails to correctly quote flags like /pdb:... with spaces in the value.
| * | VS: Separate compiler and linker PDB files (#11899, #14062)Brad King2013-04-051-2/+2
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The MS tools create two types of PDB files as explained here: http://msdn.microsoft.com/en-us/library/yd4f8bd1%28v=vs.71%29.aspx http://msdn.microsoft.com/en-us/library/yd4f8bd1%28v=vs.80%29.aspx http://msdn.microsoft.com/en-us/library/yd4f8bd1%28v=vs.90%29.aspx http://msdn.microsoft.com/en-us/library/yd4f8bd1%28v=vs.100%29.aspx One is created by the compiler (/Fd) and the other by the linker (/pdb). The two options should not specify the same file. Split them up. In the VS IDE generators, simply drop ProgramDataBaseFileName to take the VS default "/Fd$(IntDir)vc$(PlatformToolsetVersion).pdb". In the Makefile generators, set "/Fd" on the compile line to be the directory containing object files (with a trailing slash the compiler will add the "vc$(PlatformToolsetVersion).pdb" filename automatically). Drop the /Fd option from the exe link command line and add "/pdb" instead (already done for dll linking). Update these rules for both MSVC and Intel tools. Drop support for PDB_OUTPUT_DIRECTORY and PDB_NAME in STATIC libraries because the generated .pdb files are only from /Fd and not real linker-generated .pdb files. Update documentation to clarify that the PDB_* properties are only for linker .pdb files. This regresses the PDBDirectoryAndName test for STATIC libraries. Since it is not clear at this time what should be done for STATIC library .pdb files, comment out the relevant portion of the test and leave a TODO comment.
* | VS12: Add Visual Studio 12 generator (#14251)Brad King2013-06-281-1/+4
|/ | | | | | | | | | | | | | Copy cmGlobalVisualStudio11Generator to cmGlobalVisualStudio12Generator and update version numbers accordingly. Add the VS12 enumeration value. Add module CMakeVS12FindMake to find MSBuild. Look for MSBuild in its now-dedicated Windows Registry entry. Teach the platform module Windows-MSVC to set MSVC12 and document the variable. Teach module InstallRequiredSystemLibraries to look for the VS 12 runtime libraries. Teach tests CheckCompilerRelatedVariables, Preprocess, VSExternalInclude, and RunCMake.GeneratorToolset to treat VS 12 as they do VS 10 and 11. Inspired-by: Minmin Gong <minmin.gong@gmail.com>
* MSVC: Fix CMAKE_CL_64 in CXX-only projects (#13896)Brad King2013-02-071-1/+1
| | | | | When CXX is enabled without C then MSVC_CXX_ARCHITECTURE_ID is set instead but not MSVC_C_ARCHITECTURE_ID. Test both.
* Set WINCE to 1 when building for WindowsCEPatrick Gansterer2013-02-011-2/+3
| | | | | Introduce a new variable WINCE to make the WindowsCE system more easy to use in if statements.