Author: tkreuzer Date: Thu Jan 5 17:19:15 2012 New Revision: 54841
URL: http://svn.reactos.org/svn/reactos?rev=54841&view=rev Log: [CMAKE] Add an option to compile with PREFAST enabled, when using MSVC
Modified: trunk/reactos/cmake/config.cmake trunk/reactos/cmake/msvc.cmake
Modified: trunk/reactos/cmake/config.cmake URL: http://svn.reactos.org/svn/reactos/trunk/reactos/cmake/config.cmake?rev=5484... ============================================================================== --- trunk/reactos/cmake/config.cmake [iso-8859-1] (original) +++ trunk/reactos/cmake/config.cmake [iso-8859-1] Thu Jan 5 17:19:15 2012 @@ -55,3 +55,8 @@
set(GENERATE_DEPENDENCY_GRAPH FALSE CACHE BOOL "Whether to create a graphml dependency of dlls.") + +if(MSVC) +set(_PREFAST_ FALSE CACHE BOOL +"Whether to enable PREFAST while compiling.") +endif()
Modified: trunk/reactos/cmake/msvc.cmake URL: http://svn.reactos.org/svn/reactos/trunk/reactos/cmake/msvc.cmake?rev=54841&... ============================================================================== --- trunk/reactos/cmake/msvc.cmake [iso-8859-1] (original) +++ trunk/reactos/cmake/msvc.cmake [iso-8859-1] Thu Jan 5 17:19:15 2012 @@ -43,13 +43,19 @@ # We may temporarily use just the global defines, but this is not a solution as some modules (minihal for example) apply additional definitions to source files, so we get an incorrect build of such targets. get_directory_property(definitions DEFINITIONS) set(CMAKE_ASM_COMPILE_OBJECT - "<CMAKE_C_COMPILER> /nologo /X /I${REACTOS_SOURCE_DIR}/include/asm /I${REACTOS_BINARY_DIR}/include/asm <FLAGS> ${definitions} /D__ASM__ /D_USE_ML /EP /c <SOURCE> > <OBJECT>.tmp" + "cl /nologo /X /I${REACTOS_SOURCE_DIR}/include/asm /I${REACTOS_BINARY_DIR}/include/asm <FLAGS> ${definitions} /D__ASM__ /D_USE_ML /EP /c <SOURCE> > <OBJECT>.tmp" "<CMAKE_ASM_COMPILER> /nologo /Cp /Fo<OBJECT> /c /Ta <OBJECT>.tmp") else() # NMake Makefiles set(CMAKE_ASM_COMPILE_OBJECT - "<CMAKE_C_COMPILER> /nologo /X /I${REACTOS_SOURCE_DIR}/include/asm /I${REACTOS_BINARY_DIR}/include/asm <FLAGS> <DEFINES> /D__ASM__ /D_USE_ML /EP /c <SOURCE> > <OBJECT>.tmp" + "cl /nologo /X /I${REACTOS_SOURCE_DIR}/include/asm /I${REACTOS_BINARY_DIR}/include/asm <FLAGS> <DEFINES> /D__ASM__ /D_USE_ML /EP /c <SOURCE> > <OBJECT>.tmp" "<CMAKE_ASM_COMPILER> /nologo /Cp /Fo<OBJECT> /c /Ta <OBJECT>.tmp") +endif() + +if(_PREFAST_) +message("PREFAST enabled!") +set(CMAKE_C_COMPILER "prefast cl") +set(CMAKE_CXX_COMPILER "prefast cl") endif()
set(CMAKE_RC_CREATE_SHARED_LIBRARY ${CMAKE_C_CREATE_SHARED_LIBRARY})