[cmake-developers] [CMake 0011755]: CMake 2.8.3 with msvc can not process CFLAGS and LDFLAGS correctly
Mantis Bug Tracker
mantis at public.kitware.com
Tue Jan 25 21:04:08 EST 2011
The following issue has been SUBMITTED.
======================================================================
http://public.kitware.com/Bug/view.php?id=11755
======================================================================
Reported By: Dongsheng Song
Assigned To:
======================================================================
Project: CMake
Issue ID: 11755
Category: CMake
Reproducibility: always
Severity: major
Priority: normal
Status: new
======================================================================
Date Submitted: 2011-01-25 21:04 EST
Last Modified: 2011-01-25 21:04 EST
======================================================================
Summary: CMake 2.8.3 with msvc can not process CFLAGS and
LDFLAGS correctly
Description:
!)CFLAGS
When I set CFLAGS with double quotation marks:
SET CFLAGS=/nologo /W3 /EHsc /O2 /Oy- /Zi /D"_WIN32_WINNT=0x0502"
/D"WIN32_LEAN_AND_MEAN=1"
Then cmake can issued invalid command lines like this:
CL.EXE /nologo /nologo /W3 /EHsc /O2 /Oy- /Zi /D;_WIN32_WINNT=0x0502"
/D"WIN32_LEAN_AND_MEAN=1" /DWIN32 /D_WINDOWS /W3 /Zm1000
-DCHECK_FUNCTION_EXISTS=exp" /D_DEBUG /MDd /Zi /Ob0 /Od /GZ
/FoCMakeFiles\cmTryCompileExec.dir\CheckFunctionExists.c.obj
/FdC:\var\tmp\CMakeFiles\CMakeTmp\cmTryCompileExec.pdb -c
C:\opt\CMake-2.8\share\cmake-2.8\Modules\CheckFunctionExists.c
This first double quotation mark was replaced by semicolon (" => ;) !!!
But after I changed to with the following line, no errors:
SET CFLAGS=/nologo /W3 /EHsc /O2 /Oy- /Zi /D_WIN32_WINNT=0x0502
/DWIN32_LEAN_AND_MEAN=1
2)LDFLAGS
SET LDFLAGS=/OPT:ICF,REF /MACHINE:X86 /SUBSYSTEM:CONSOLE /RELEASE
Cmake still issued invalid command lines like this:
CL.EXE /nologo @CMakeFiles\cmTryCompileExec.dir\objects1.rsp /DWIN32
/D_WINDOWS /W3 /Zm1000 /GX /GR /D_DEBUG /MDd /Zi /Ob0 /Od /GZ
/FecmTryCompileExec.exe /FdC:\var\tmp\CMakeFiles\CMakeTmp\cmTryCompileExec.pdb
-link /implib:cmTryCompileExec.lib /version:0.0 /STACK:10000000
/machine:X86;/OPT:ICF,REF /MACHINE:X86 /SUBSYSTEM:CONSOLE /RELEASE /debug
/pdbtype:sept /INCREMENTAL:YES /subsystem:console kernel32.lib user32.lib
gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib
oleaut32.lib uuid.lib odbc32.lib odbccp32.lib
/machine:X86;/OPT:ICF,REF should be /machine:X86 /OPT:ICF,REF !!!
Steps to Reproduce:
See description.
======================================================================
Issue History
Date Modified Username Field Change
======================================================================
2011-01-25 21:04 Dongsheng Song New Issue
======================================================================
More information about the cmake-developers
mailing list