Skip to content

Commit

Permalink
extend maintainer mode
Browse files Browse the repository at this point in the history
  • Loading branch information
hsattler committed Jul 4, 2009
1 parent 3ddc217 commit 95ef438
Showing 1 changed file with 21 additions and 11 deletions.
32 changes: 21 additions & 11 deletions CMakeModules/MaintainerMode.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,37 @@ if ( USE_MAINTAINER_MODE )
cast-align
error
)
set ( MAINTAINER_MODE_FLAGS
# pedantic
# std=c99
)
foreach ( flag ${MAINTAINER_MODE_WARN_FLAGS} )
set ( cflag "-W${flag}" )
list ( APPEND MAINTAINER_MODE_FLAGS "W${flag}" )
endforeach ( flag )

foreach ( flag ${MAINTAINER_MODE_FLAGS} )
set ( cflag "-${flag}" )
set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${cflag}" )
set ( CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS} ${cflag}" )
set ( CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS} ${cflag}" )
set ( CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS} ${cflag}" )
set ( CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS} ${cflag}" )
foreach ( type DEBUG RELEASE MINSIZEREL RELWITHDEBINFO )
set ( CMAKE_C_FLAGS_${type} "${CMAKE_C_FLAGS_${type}} ${cflag}" )
endforeach ( type )
endforeach ( flag )

elseif ( MSVC )
set ( MAINTAINER_MODE_WARN_FLAGS
set ( MAINTAINER_MODE_FLAGS
W3
WX
)
foreach ( flag ${MAINTAINER_MODE_WARN_FLAGS} )
foreach ( flag ${MAINTAINER_MODE_FLAGS} )
set ( cflag "/${flag}" )
set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${cflag}" )
set ( CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS} ${cflag}" )
set ( CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS} ${cflag}" )
set ( CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS} ${cflag}" )
set ( CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS} ${cflag}" )
foreach ( type DEBUG RELEASE MINSIZEREL RELWITHDEBINFO )
set ( CMAKE_C_FLAGS_${type} "${CMAKE_C_FLAGS_${type}} ${cflag}" )
endforeach ( type )
endforeach ( flag )
endif ( CMAKE_COMPILER_IS_GNUCC )

# foreach ( type DEBUG RELEASE MINSIZEREL RELWITHDEBINFO )
# message ( "CMAKE_C_FLAGS_${type} set to \"${CMAKE_C_FLAGS_${type}}\"" )
# endforeach ( type )
endif ( USE_MAINTAINER_MODE )

0 comments on commit 95ef438

Please sign in to comment.