[Bf-committers] [Bf-blender-cvs] SVN commit: /data/svn/bf-blender [41309] trunk/blender: tweak remove_strict_flags so it can be used with gcc's -Wall

Campbell Barton ideasman42 at gmail.com
Mon Oct 31 10:34:35 CET 2011


Is this still a problem? - its checking if the flag is supported
before using so if THAT fails, then the bug is in the flag checking
macro or cmake.

On Mon, Oct 31, 2011 at 6:02 AM, Luke Swanson <lswan58 at yahoo.com> wrote:
> Hi all, I have the same problem on OSX 10.6
>
> Building from trunk fails with:
> cc1: error: unrecognized command line option "-Wno-unused-but-set-variable"
>
> -LswaN
>
>
> ________________________________
>>From: Dalai Felinto <dfelinto at gmail.com>
>>Sent: Saturday, October 29, 2011 11:13 PM
>>
>>Hi,
>>
>>on OSX 10.7 I had to remove the final line to get it compiling
>>(-add_cc_flag("-Wno-unused-but-set-variable").
>>
>>--
>>Dalai
>>
>>2011/10/27 Campbell Barton <ideasman42 at gmail.com>:
>>> Revision: 41309
>>>          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=41309
>>> Author:   campbellbarton
>>> Date:     2011-10-27 07:26:41 +0000 (Thu, 27 Oct 2011)
>>> Log Message:
>>> -----------
>>> tweak remove_strict_flags so it can be used with gcc's -Wall
>>>
>>> Modified Paths:
>>> --------------
>>>    trunk/blender/build_files/cmake/macros.cmake
>>>    trunk/blender/intern/opennl/CMakeLists.txt
>>>
>>> Modified: trunk/blender/build_files/cmake/macros.cmake
>>> ===================================================================
>>> --- trunk/blender/build_files/cmake/macros.cmake        2011-10-27 06:05:55 UTC (rev 41308)
>>> +++ trunk/blender/build_files/cmake/macros.cmake        2011-10-27 07:26:41 UTC (rev 41309)
>>> @@ -377,7 +377,7 @@
>>>  # needs to be removed for some external libs which we dont maintain.
>>>
>>>  # utility macro
>>> -macro(remove_flag
>>> +macro(remove_cc_flag
>>>        flag)
>>>
>>>        string(REGEX REPLACE ${flag} "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
>>> @@ -394,16 +394,27 @@
>>>
>>>  endmacro()
>>>
>>> +macro(add_cc_flag
>>> +       flag)
>>> +
>>> +       set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${flag}")
>>> +       set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}")
>>> +endmacro()
>>> +
>>>  macro(remove_strict_flags)
>>>
>>>        if(CMAKE_COMPILER_IS_GNUCC)
>>> -               remove_flag("-Wstrict-prototypes")
>>> -               remove_flag("-Wunused-parameter")
>>> -               remove_flag("-Wwrite-strings")
>>> -               remove_flag("-Wundef")
>>> -               remove_flag("-Wshadow")
>>> -               remove_flag("-Werror=[^ ]+")
>>> -               remove_flag("-Werror")
>>> +               remove_cc_flag("-Wstrict-prototypes")
>>> +               remove_cc_flag("-Wunused-parameter")
>>> +               remove_cc_flag("-Wwrite-strings")
>>> +               remove_cc_flag("-Wundef")
>>> +               remove_cc_flag("-Wshadow")
>>> +               remove_cc_flag("-Werror=[^ ]+")
>>> +               remove_cc_flag("-Werror")
>>> +
>>> +               # negate flags implied by '-Wall'
>>> +               add_cc_flag("-Wno-unused-parameter")
>>> +               add_cc_flag("-Wno-unused-but-set-variable")
>>>        endif()
>>>
>>>        if(MSVC)
>>>
>>> Modified: trunk/blender/intern/opennl/CMakeLists.txt
>>> ===================================================================
>>> --- trunk/blender/intern/opennl/CMakeLists.txt  2011-10-27 06:05:55 UTC (rev 41308)
>>> +++ trunk/blender/intern/opennl/CMakeLists.txt  2011-10-27 07:26:41 UTC (rev 41309)
>>> @@ -28,7 +28,7 @@
>>>
>>>  # remove debug flag here since this is not a blender maintained library
>>>  # and debug gives a lot of prints on UV unwrapping. developers can enable if they need to.
>>> -remove_flag("-DDEBUG")
>>> +remove_cc_flag("-DDEBUG")
>>>
>>>
>>>  # quiet compiler warnings about undefined defines
>>>
>>> _______________________________________________
>>> Bf-blender-cvs mailing list
>>> Bf-blender-cvs at blender.org
>>> http://lists.blender.org/mailman/listinfo/bf-blender-cvs
>>>
>>_______________________________________________
>>Bf-committers mailing list
>>Bf-committers at blender.org
>>http://lists.blender.org/mailman/listinfo/bf-committers
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at blender.org
> http://lists.blender.org/mailman/listinfo/bf-committers
>



-- 
- Campbell


More information about the Bf-committers mailing list