MantisBT - CMake | |||||
| View Issue Details | |||||
| ID | Project | Category | View Status | Date Submitted | Last Update |
| 0008817 | CMake | CMake | public | 2009-03-30 11:30 | 2016-06-10 14:30 |
| Reporter | Derek Bruening | ||||
| Assigned To | Bill Hoffman | ||||
| Priority | normal | Severity | feature | Reproducibility | always |
| Status | closed | Resolution | moved | ||
| Platform | OS | OS Version | |||
| Product Version | CMake-2-6 | ||||
| Target Version | Fixed in Version | ||||
| Summary | 0008817: support MSYS shell with MSVC: use - instead of / for cl params | ||||
| Description | It's not possible to use any of "NMake Makefiles", "Unix Makefiles", or "MSYS Makefiles" from the MSYS shell with the Microsoft compiler (cl.exe). This is due to the MSYS "automagic path conversion" where any command-line string beginning with "/" has the MSYS drive prefix prepended. While ideally MSYS would provide an option to disable the conversion, that's not the case today, and if CMake provided an option to use "-" instead of "/" as a parameter delimiter then everything would work just fine. The "/" leads to errors like the following in an MSYS shell: cl : Command line warning D9027 : source file 'C:/msys/1.0/nologo' ignored It causes errors in configuration which are fatal for nmake (due to /nologo being passed to nmake, I believe) but only show up in ABI testing for Unix or MSYS Makefiles (shown below). The ABI errors are not fatal and running cmake again results in a "successful" configuration. However in order to build I have to replace all the / param delimiters with -: perl -pi.bak -e 's| /| -|g' `find . -name \*.make` perl -pi.bak -e 's| -bin| /bin|g' `find . -name \*.make` Furthermore, cmake has hardcoded strings that expect / instead of -. cmake::ParseVisualStudioLinkCommand hardcodes "/out:". Also in cmake.cxx: /INCREMENTAL:YES, etc. So I eliminated the vs_link_dll command in order for linking to actually occur (is a nop with "-out" instead of "/out"): perl -pi.bak -e 's|"C:/Program Files \(x86\)/CMake 2.6/bin/cmake.exe" -E vs_link_dll||' `find . -name \*.make` With these changes I can build using "Unix Makefiles". I have to make further changes to use "MSYS Makefiles" because of another issue: MSYS Makefiles use unix paths even when using MSVC. The (one-sentence) documentation for "MSYS Makefiles" implies that its only difference from "Unix Makefiles" is in using the MSYS shell but clearly that's not the case. The errors in configuration with Unix or MSYS Makefiles: -- The C compiler identification is MSVC -- The CXX compiler identification is MSVC -- Check for CL compiler version -- Check for CL compiler version - 1400 -- Check if this is a free VC compiler -- Check if this is a free VC compiler - yes -- Check CL platform -- Check CL platform - 64 bit -- Check for working C compiler: c:/PROGRA~2/MICROS~2/VC/Bin/cl.exe -- Check for working C compiler: c:/PROGRA~2/MICROS~2/VC/Bin/cl.exe -- works -- Detecting C compiler ABI info CMake Error: Could not COPY_FILE. OutputFile: '' copyFile: 'C:/derek/opensource/build_msys/CMakeFiles/CMakeDetermineCompilerABI_C.bin' -- Detecting C compiler ABI info - done CMake Error at C:/Program Files (x86)/CMake 2.6/share/cmake-2.6/Modules/CMakeDetermineCompilerABI.cmake:23 (FILE): file STRINGS file "C:/derek/opensource/build_msys/CMakeFiles/CMakeDetermineCompilerABI_C.bin" cannot be read. Call Stack (most recent call first): C:/Program Files (x86)/CMake 2.6/share/cmake-2.6/Modules/CMakeTestCCompiler.cmake:51 (CMAKE_DETERMINE_COMPILER_ABI) CMakeLists.txt:69 (project) -- Check for working CXX compiler: c:/PROGRA~2/MICROS~2/VC/Bin/cl.exe -- Check for working CXX compiler: c:/PROGRA~2/MICROS~2/VC/Bin/cl.exe -- works -- Detecting CXX compiler ABI info CMake Error: Could not COPY_FILE. OutputFile: '' copyFile: 'C:/derek/opensource/build_msys/CMakeFiles/CMakeDetermineCompilerABI_CXX.bin' -- Detecting CXX compiler ABI info - done CMake Error at C:/Program Files (x86)/CMake 2.6/share/cmake-2.6/Modules/CMakeDetermineCompilerABI.cmake:23 (FILE): file STRINGS file "C:/derek/opensource/build_msys/CMakeFiles/CMakeDetermineCompilerABI_CXX.bin" cannot be read. Call Stack (most recent call first): C:/Program Files (x86)/CMake 2.6/share/cmake-2.6/Modules/CMakeTestCXXCompiler.cmake:44 (CMAKE_DETERMINE_COMPILER_ABI) CMakeLists.txt:69 (project) | ||||
| Steps To Reproduce | |||||
| Additional Information | |||||
| Tags | No tags attached. | ||||
| Relationships | |||||
| Attached Files | |||||
| Issue History | |||||
| Date Modified | Username | Field | Change | ||
| 2009-03-30 11:30 | Derek Bruening | New Issue | |||
| 2009-03-31 14:00 | Bill Hoffman | Note Added: 0015865 | |||
| 2009-03-31 14:00 | Bill Hoffman | Status | new => assigned | ||
| 2009-03-31 14:00 | Bill Hoffman | Assigned To | => Bill Hoffman | ||
| 2009-03-31 14:24 | Derek Bruening | Note Added: 0015869 | |||
| 2009-03-31 14:36 | Bill Hoffman | Note Added: 0015871 | |||
| 2016-06-10 14:27 | Kitware Robot | Note Added: 0041533 | |||
| 2016-06-10 14:27 | Kitware Robot | Status | assigned => resolved | ||
| 2016-06-10 14:27 | Kitware Robot | Resolution | open => moved | ||
| 2016-06-10 14:30 | Kitware Robot | Status | resolved => closed | ||
| Notes | |||||
|
|
|||||
|
|
||||
|
|
|||||
|
|
||||
|
|
|||||
|
|
||||
|
|
|||||
|
|
||||