On 26/08/11 10:25, Alexis Moinet wrote : > I think it would be useful to have cmake add this option only if supported or > if gcc > 4.3
here is a little patch that should fix the problem (should work with cmake 2.6.4 and later): diff --git a/CMakeLists.txt b/CMakeLists.txt index 23068d8..03a331b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,6 +24,7 @@ set(CMAKE_COLOR_MAKEFILE ON) # Include cmake modules include(CheckIncludeFiles) include(CheckLibraryExists) +include(CheckCCompilerFlag) include(FindPkgConfig) include(TestBigEndian) @@ -53,7 +54,12 @@ endif() # Compiler-specific flags if(CMAKE_COMPILER_IS_GNUCC) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wno-unused-but-set-variable") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall") + CHECK_C_COMPILER_FLAG("-Wno-unused-but-set-variable" COMPILER_SUPPORTS_WNO_UNUSED_BUT_SET_VARIABLE) + if(COMPILER_SUPPORTS_WNO_UNUSED_BUT_SET_VARIABLE) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-but-set-variable") + endif() + if(CMAKE_BUILD_TYPE STREQUAL "Release") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2") endif() ------------------------------------------------------------------------------ EMC VNX: the world's simplest storage, starting under $10K The only unified storage solution that offers unified management Up to 160% more powerful than alternatives and 25% more efficient. Guaranteed. http://p.sf.net/sfu/emc-vnx-dev2dev _______________________________________________ Freerdp-devel mailing list Freerdp-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/freerdp-devel