From 94d55b5056a231dcf932dda258a0c382703c3a02 Mon Sep 17 00:00:00 2001 From: Ben Vanik Date: Wed, 30 Jan 2013 02:19:38 -0800 Subject: [PATCH] GYP updates for Windows. This will break OSX for a moment. --- common.gypi | 136 +++++++++++++++++++++++++++++++----- src/cpu/codegen/emit_alu.cc | 5 +- third_party/gflags.gypi | 2 + xenia.gyp | 14 ++-- 4 files changed, 132 insertions(+), 25 deletions(-) diff --git a/common.gypi b/common.gypi index f763641b4..0b60f4282 100644 --- a/common.gypi +++ b/common.gypi @@ -14,6 +14,54 @@ # TODO(benvanik): switch based on configuration. 'llvm_path': 'build/llvm/release/', 'llvm_config': '<(llvm_path)bin/llvm-config', + 'llvm_includedir': '<(llvm_path)/include', + 'llvm_cxxflags': [ + # ? + ], + 'llvm_libdir': '<(llvm_path)/lib', + 'llvm_libs': [ + #'pthread', + 'LLVMCppBackendCodeGen', + 'LLVMCppBackendInfo', + 'LLVMAsmParser', + 'LLVMTableGen', + 'LLVMDebugInfo', + 'LLVMX86Disassembler', + 'LLVMX86AsmParser', + 'LLVMX86CodeGen', + 'LLVMSelectionDAG', + 'LLVMAsmPrinter', + 'LLVMX86Desc', + 'LLVMX86Info', + 'LLVMX86AsmPrinter', + 'LLVMX86Utils', + 'LLVMMCDisassembler', + 'LLVMMCParser', + 'LLVMInstrumentation', + 'LLVMOption', + 'LLVMArchive', + 'LLVMBitReader', + 'LLVMInterpreter', + 'LLVMipo', + 'LLVMVectorize', + 'LLVMLinker', + 'LLVMBitWriter', + 'LLVMMCJIT', + 'LLVMJIT', + 'LLVMCodeGen', + 'LLVMScalarOpts', + 'LLVMInstCombine', + 'LLVMTransformUtils', + 'LLVMipa', + 'LLVMAnalysis', + 'LLVMRuntimeDyld', + 'LLVMExecutionEngine', + 'LLVMTarget', + 'LLVMMC', + 'LLVMObject', + 'LLVMCore', + 'LLVMSupport', + ], }, @@ -32,7 +80,71 @@ ], 'configurations': { + 'common_base': { + 'abstract': 1, + + 'msvs_configuration_platform': 'x64', + 'msvs_configuration_attributes': { + 'OutputDirectory': '$(SolutionDir)$(ConfigurationName)', + 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)', + 'CharacterSet': '1', + }, + 'msvs_disabled_warnings': [], + 'msvs_configuration_platform': 'x64', + 'msvs_cygwin_shell': '0', + 'msvs_settings': { + 'VCCLCompilerTool': { + #'MinimalRebuild': 'false', + 'BufferSecurityCheck': 'true', + 'EnableFunctionLevelLinking': 'true', + 'RuntimeTypeInfo': 'false', + 'WarningLevel': '3', + #'WarnAsError': 'true', + 'DebugInformationFormat': '3', + 'ExceptionHandling': '1', # /EHsc + 'AdditionalOptions': ['/MP'], + }, + #'VCLibrarianTool': { + # 'AdditionalLibraryDirectories!': + # ['<(DEPTH)/third_party/platformsdk_win7/files/Lib'], + # 'AdditionalLibraryDirectories': + # ['<(DEPTH)/third_party/platformsdk_win7/files/Lib/x64'], + #}, + 'VCLinkerTool': { + 'GenerateDebugInformation': 'true', + #'LinkIncremental': '1', # 1 = NO, 2 = YES + 'TargetMachine': '17', # x86 - 64 + 'AdditionalLibraryDirectories': [ + '../../<(llvm_libdir)', + ], + #'AdditionalLibraryDirectories!': + # ['<(DEPTH)/third_party/platformsdk_win7/files/Lib'], + #'AdditionalLibraryDirectories': + # ['<(DEPTH)/third_party/platformsdk_win7/files/Lib/x64'], + }, + }, + + 'scons_settings': { + 'sconsbuild_dir': '<(DEPTH)/build/xenia/', + }, + + 'xcode_settings': { + 'SYMROOT': '<(DEPTH)/build/xenia/', + 'ALWAYS_SEARCH_USER_PATHS': 'NO', + 'ARCHS': ['x86_64'], + 'GCC_C_LANGUAGE_STANDARD': 'c99', + 'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES', + 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES', + 'WARNING_CFLAGS': ['-Wall', '-Wendif-labels'], + 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', + }, + + 'defines': [ + ], + }, + 'debug': { + 'inherit_from': ['common_base',], 'defines': [ 'DEBUG', ], @@ -58,7 +170,12 @@ 'GCC_OPTIMIZATION_LEVEL': '0', }, }, + 'debug_x64': { + 'inherit_from': ['debug',], + }, + 'release': { + 'inherit_from': ['common_base',], 'defines': [ 'RELEASE', 'NDEBUG', @@ -86,22 +203,9 @@ }, }, }, - }, - - 'msvs_configuration_platform': 'x64', - 'msvs_cygwin_shell': '0', - 'scons_settings': { - 'sconsbuild_dir': '<(DEPTH)/build/xenia/', - }, - 'xcode_settings': { - 'SYMROOT': '<(DEPTH)/build/xenia/', - 'ALWAYS_SEARCH_USER_PATHS': 'NO', - 'ARCHS': ['x86_64'], - 'GCC_C_LANGUAGE_STANDARD': 'c99', - 'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES', - 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES', - 'WARNING_CFLAGS': ['-Wall', '-Wendif-labels'], - 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', + 'release_x64': { + 'inherit_from': ['release',], + }, }, }, } diff --git a/src/cpu/codegen/emit_alu.cc b/src/cpu/codegen/emit_alu.cc index 44a122674..1ac23884a 100644 --- a/src/cpu/codegen/emit_alu.cc +++ b/src/cpu/codegen/emit_alu.cc @@ -1272,8 +1272,9 @@ XEEMITTER(rlwinmx, 0x54000000, M )(FunctionGenerator& g, IRBuilder<>& b, I // Which seems to just select some bits and set cr0 for use with a branch. // We can detect this and do less work. if (!i.M.SH) { - Value* v = b.CreateAnd(b.CreateTrunc(g.gpr_value(i.M.RT), b.getInt32Ty()), - b.getInt32(XEMASK(i.M.MB + 32, i.M.ME + 32))); + Value* v = b.CreateAnd( + b.CreateTrunc(g.gpr_value(i.M.RT), b.getInt32Ty()), + b.getInt32((uint32_t)XEMASK(i.M.MB + 32, i.M.ME + 32))); v = b.CreateZExt(v, b.getInt64Ty()); g.update_gpr_value(i.M.RA, v); if (i.M.Rc) { diff --git a/third_party/gflags.gypi b/third_party/gflags.gypi index a1865a14e..477b78b7c 100644 --- a/third_party/gflags.gypi +++ b/third_party/gflags.gypi @@ -19,6 +19,7 @@ 'defines': [ 'GFLAGS_DLL_DECL=', 'GFLAGS_DLL_DEFINE_FLAG=', + 'GFLAGS_DLL_DECLARE_FLAG=', ], }], ], @@ -48,6 +49,7 @@ 'defines': [ 'GFLAGS_DLL_DECL=', 'GFLAGS_DLL_DEFINE_FLAG=', + 'GFLAGS_DLL_DECLARE_FLAG=', ], }], ], diff --git a/xenia.gyp b/xenia.gyp index 3a65a8e03..78bd33366 100644 --- a/xenia.gyp +++ b/xenia.gyp @@ -74,18 +74,18 @@ 'direct_dependent_settings': { 'include_dirs': [ - '