T.vs2010_flags = { } local vs10_flags = T.vs2010_flags local sln, prj --[[ function vs10_flags.setup()end function vs10_flags.nothing() end --]] function vs10_flags.setup() _ACTION = "vs2010" sln = solution "MySolution" configurations { "Debug" } platforms {} prj = project "MyProject" language "C++" kind "ConsoleApp" uuid "AE61726D-187C-E440-BD07-2556188A6565" includedirs{"foo/bar"} end local function get_buffer() io.capture() premake.buildconfigs() sln.vstudio_configs = premake.vstudio_buildconfigs(sln) premake.vs2010_vcxproj(prj) buffer = io.endcapture() return buffer end function vs10_flags.sseSet() flags {"EnableSSE"} buffer = get_buffer() test.string_contains(buffer,'StreamingSIMDExtensions') end function vs10_flags.sse2Set() flags {"EnableSSE2"} buffer = get_buffer() test.string_contains(buffer,'StreamingSIMDExtensions2') end function vs10_flags.extraWarningNotSet_warningLevelIsThree() buffer = get_buffer() test.string_contains(buffer,'Level3') end function vs10_flags.extraWarning_warningLevelIsFour() flags {"ExtraWarnings"} buffer = get_buffer() test.string_contains(buffer,'Level4') end function vs10_flags.extraWarning_treatWarningsAsError_setToTrue() flags {"FatalWarnings"} buffer = get_buffer() test.string_contains(buffer,'true') end function vs10_flags.floatFast_floatingPointModel_setToFast() flags {"FloatFast"} buffer = get_buffer() test.string_contains(buffer,'Fast') end function vs10_flags.floatStrict_floatingPointModel_setToStrict() flags {"FloatStrict"} buffer = get_buffer() test.string_contains(buffer,'Strict') end function vs10_flags.nativeWideChar_TreatWChar_tAsBuiltInType_setToTrue() flags {"NativeWChar"} buffer = get_buffer() test.string_contains(buffer,'true') end function vs10_flags.nativeWideChar_TreatWChar_tAsBuiltInType_setToFalse() flags {"NoNativeWChar"} buffer = get_buffer() test.string_contains(buffer,'false') end function vs10_flags.noExceptions_exceptionHandling_setToFalse() flags {"NoExceptions"} buffer = get_buffer() test.string_contains(buffer,'false') end function vs10_flags.structuredExceptions_exceptionHandling_setToAsync() flags {"SEH"} buffer = get_buffer() test.string_contains(buffer,'Async') end function vs10_flags.noFramePointer_omitFramePointers_setToTrue() flags {"NoFramePointer"} buffer = get_buffer() test.string_contains(buffer,'true') end function vs10_flags.noRTTI_runtimeTypeInfo_setToFalse() flags {"NoRTTI"} buffer = get_buffer() test.string_contains(buffer,'false') end function vs10_flags.optimizeSize_optimization_setToMinSpace() flags {"OptimizeSize"} buffer = get_buffer() test.string_contains(buffer,'MinSpace') end function vs10_flags.optimizeSpeed_optimization_setToMaxSpeed() flags {"OptimizeSpeed"} buffer = get_buffer() test.string_contains(buffer,'MaxSpeed') end function vs10_flags.optimizeSpeed_optimization_setToMaxSpeed() flags {"Optimize"} buffer = get_buffer() test.string_contains(buffer,'Full') end function vs10_flags.noStaticRuntime_runtimeLibrary_setToMultiThreadedDLL() buffer = get_buffer() test.string_contains(buffer,'MultiThreadedDLL') end --[[ function vs10_flags.symbols_runtimeLibrary_setToMultiThreadedDebugDLL() flags {"Symbols"} buffer = get_buffer() test.string_contains(buffer,'MultiThreadedDebugDLL') end --]] function vs10_flags.noStaticRuntimeYetSymbols_runtimeLibrary_setToMultiThreadedDebugDLL() flags {"Symbols"} buffer = get_buffer() test.string_contains(buffer,'MultiThreadedDebugDLL') end function vs10_flags.staticRuntime_runtimeLibrary_setToMultiThreaded() flags {"StaticRuntime"} buffer = get_buffer() test.string_contains(buffer,'MultiThreaded') end function vs10_flags.staticRuntimeAndSymbols_runtimeLibrary_setToMultiThreadedDebug() flags {"StaticRuntime","Symbols"} buffer = get_buffer() test.string_contains(buffer,'MultiThreadedDebug') end function vs10_flags.noCharacterSetDefine_characterSet_setToMultiByte() buffer = get_buffer() test.string_contains(buffer,'MultiByte') end function vs10_flags.unicode_characterSet_setToUnicode() flags {"Unicode"} buffer = get_buffer() test.string_contains(buffer,'Unicode') end function vs10_flags.noMinimalRebuildYetNotSymbols_minimalRebuild_isNotFound() flags {"NoMinimalRebuild"} buffer = get_buffer() test.string_does_not_contain(buffer,'MinimalRebuild') end function vs10_flags.noMinimalRebuildAndSymbols_minimalRebuild_setToFalse() flags {"NoMinimalRebuild","Symbols"} buffer = get_buffer() test.string_contains(buffer,'false') end function vs10_flags.symbolsSetYetNotMinimalRebuild_minimalRebuild_setToTrue() flags {"Symbols"} buffer = get_buffer() test.string_contains(buffer,'true') end --this generates an error: invalid value 'MFC' ---[[ function vs10_flags.mfc_useOfMfc_setToStatic() flags{"MFC"} buffer = get_buffer() test.string_contains(buffer,'Dynamic') end ---]] function vs10_flags.Symbols_DebugInformationFormat_setToEditAndContinue() flags{"Symbols"} buffer = get_buffer() test.string_contains(buffer,'EditAndContinue') end function vs10_flags.symbolsAndNoEditAndContinue_DebugInformationFormat_isAnEmptyBlock() flags{"Symbols","NoEditAndContinue"} buffer = get_buffer() test.string_contains(buffer,'') end function vs10_flags.noManifest_GenerateManifest_setToFalse() flags{"NoManifest"} buffer = get_buffer() test.string_contains(buffer,'false') end function vs10_flags.programDataBaseFile() buffer = get_buffer() test.string_contains(buffer,'.*%$%(OutDir%)MyProject%.pdb.*') end