소스 검색

VS: Fix regressed mapping for the cl `/Os` compiler flag

In commit v3.6.0-rc1~279^2~10 (VS: in Clang/C2 toolset, setup correct
compiler settings, 2016-02-18) a flag mapping was added for the clang
`-Os` flag.  However, this collides with a mapping we already had for
the MSVC flag of the same name.  This is a symptom of a larger problem
in that the VS generators need a per-toolset flag map (issue #16153).

For now, simply drop the new mapping and drop `-Os` from clang compiler
flags in the MinSizeRel configuration.

Reported-by: Felix Bruns <[email protected]>
Brad King 9 년 전
부모
커밋
78249be29d
2개의 변경된 파일1개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 1
      Modules/Platform/Windows-MSVC.cmake
  2. 0 1
      Source/cmVS14CLFlagTable.h

+ 1 - 1
Modules/Platform/Windows-MSVC.cmake

@@ -305,7 +305,7 @@ macro(__windows_compiler_msvc lang)
     set(CMAKE_${lang}_FLAGS_DEBUG_INIT "-D_DEBUG /MDd -gline-tables-only -fno-inline -O0 ${_RTC1}")
     set(CMAKE_${lang}_FLAGS_RELEASE_INIT "/MD -O2 -DNDEBUG")
     set(CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT "/MD -gline-tables-only -O2 -fno-inline -DNDEBUG")
-    set(CMAKE_${lang}_FLAGS_MINSIZEREL_INIT "/MD -Os -DNDEBUG")
+    set(CMAKE_${lang}_FLAGS_MINSIZEREL_INIT "/MD -DNDEBUG") # TODO: Add '-Os' once VS generator maps it properly for Clang
   else()
     set(CMAKE_${lang}_FLAGS_INIT "${_PLATFORM_DEFINES}${_PLATFORM_DEFINES_${lang}} /D_WINDOWS /W3${_FLAGS_${lang}}")
     set(CMAKE_${lang}_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi /Ob0 /Od ${_RTC1}")

+ 0 - 1
Source/cmVS14CLFlagTable.h

@@ -16,7 +16,6 @@ static cmVS7FlagTable cmVS14CLFlagTable[] = {
 
   { "Optimization", "", "Custom", "Custom", 0 },
   { "Optimization", "Od", "Disabled", "Disabled", 0 },
-  { "Optimization", "Os", "Minimize Size", "MinSize", 0 },
   { "Optimization", "O1", "Minimize Size", "MinSpace", 0 },
   { "Optimization", "O2", "Maximize Speed", "MaxSpeed", 0 },
   { "Optimization", "Ox", "Full Optimization", "Full", 0 },