From a8d3cd67ad60784de3c65cc225971f93778e07c3 Mon Sep 17 00:00:00 2001 From: David Miller Date: Thu, 23 Apr 2020 11:12:45 -0400 Subject: [PATCH 1/3] Added include of to LLVMCore.cpp --- External/FEXCore/Source/Interface/Core/LLVMJIT/LLVMCore.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/External/FEXCore/Source/Interface/Core/LLVMJIT/LLVMCore.cpp b/External/FEXCore/Source/Interface/Core/LLVMJIT/LLVMCore.cpp index cb192fa59a..433b374a1b 100644 --- a/External/FEXCore/Source/Interface/Core/LLVMJIT/LLVMCore.cpp +++ b/External/FEXCore/Source/Interface/Core/LLVMJIT/LLVMCore.cpp @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include From 5999e7477f254e5f6e07d328d906350ad00368e9 Mon Sep 17 00:00:00 2001 From: David Miller Date: Thu, 23 Apr 2020 16:12:28 -0400 Subject: [PATCH 2/3] Added guard around llvm/IR/IntrinsicsX86.h inclusion, seems to only be needed for version 10?\nMore Investigation needed here.\nChanged Debugger/IMGui.{h,cpp} to IMGui_I so it will build in filesystems that aren't case sensitive.\nAdded CMakeSettings.json that has profiles to build from VisualStudio, using env variables to control system specific options. \n Currently only the WSL is tested (and working). \nRemote should work as well, if correct string for preconfigured remote is in env variable fexremote.\nCross compile (to linux) untested, using sysroot in env variable fexsysroot --- CMakeSettings.json | 132 ++++++++++++++++++ .../Interface/Core/LLVMJIT/LLVMCore.cpp | 7 +- Source/Tools/Debugger/CMakeLists.txt | 2 +- .../Tools/Debugger/{IMGui.cpp => IMGui_I.cpp} | 2 +- Source/Tools/Debugger/{IMGui.h => IMGui_I.h} | 0 Source/Tools/Debugger/Main.cpp | 2 +- 6 files changed, 141 insertions(+), 4 deletions(-) create mode 100644 CMakeSettings.json rename Source/Tools/Debugger/{IMGui.cpp => IMGui_I.cpp} (99%) rename Source/Tools/Debugger/{IMGui.h => IMGui_I.h} (100%) diff --git a/CMakeSettings.json b/CMakeSettings.json new file mode 100644 index 0000000000..d6c50eef1b --- /dev/null +++ b/CMakeSettings.json @@ -0,0 +1,132 @@ +{ + "environments": [ + { + "BuildPath": "${projectDir}\\out\\build\\${name}", + "InstallPath": "${projectDir}\\out\\install\\${name}", + "clangcl": "clang-cl.exe", + "cc": "clang", + "cxx": "clang++" + } + ], + "configurations": [ + { + "name": "WSL-Clang-Debug", + "generator": "Ninja", + "configurationType": "Debug", + "buildRoot": "${env.BuildPath}", + "installRoot": "${env.InstallPath}", + "cmakeExecutable": "/usr/bin/cmake", + "cmakeCommandArgs": "", + "buildCommandArgs": "-v", + "ctestCommandArgs": "", + "wslPath": "${defaultWSLPath}", + "inheritEnvironments": [ "linux_clang_x64" ], + "addressSanitizerRuntimeFlags": "detect_leaks=0", + "variables": [ + { + "name": "WSL", + "type": "BOOL", + "value": "TRUE" + } + ] + }, + { + "name": "WSL-Clang-Release", + "generator": "Ninja", + "configurationType": "RelWithDebInfo", + "buildRoot": "${env.BuildPath}", + "installRoot": "${env.InstallPath}", + "cmakeExecutable": "/usr/bin/cmake", + "cmakeCommandArgs": "", + "buildCommandArgs": "-v", + "ctestCommandArgs": "", + "wslPath": "${defaultWSLPath}", + "inheritEnvironments": [ "linux_clang_x64" ], + "addressSanitizerRuntimeFlags": "detect_leaks=0", + "variables": [ + { + "name": "WSL", + "type": "BOOL", + "value": "TRUE" + } + ] + }, + { + "name": "x86-Clang-Cross-Debug", + "generator": "Ninja", + "configurationType": "Debug", + "buildRoot": "${env.BuildPath}", + "installRoot": "${env.InstallPath}", + "cmakeCommandArgs": "", + "buildCommandArgs": "-v", + "ctestCommandArgs": "", + "inheritEnvironments": [ "clang_cl_x86" ], + "variables": [ + { + "name": "CMAKE_C_COMPILER", + "type": "STRING", + "value": "${env.cc}" + }, + { + "name": "CMAKE_CXX_COMPILER", + "type": "STRING", + "value": "${env.cxx}" + }, + { + "name": "CMAKE_SYSROOT", + "type": "STRING", + "value": "${env.fexsysroot}" + } + ] + }, + { + "name": "x64-Clang-Cross-Release", + "generator": "Ninja", + "configurationType": "RelWithDebInfo", + "buildRoot": "${env.BuildPath}", + "installRoot": "${env.InstallPath}", + "cmakeCommandArgs": "", + "buildCommandArgs": "-v", + "ctestCommandArgs": "", + "inheritEnvironments": [ "clang_cl_x86" ], + "variables": [ + { + "name": "CMAKE_C_COMPILER", + "type": "STRING", + "value": "${env.cc}" + }, + { + "name": "CMAKE_CXX_COMPILER", + "type": "STRING", + "value": "${env.cxx}" + }, + { + "name": "CMAKE_SYSROOT", + "type": "STRING", + "value": "${env.fexsysroot}" + } + ] + }, + { + "name": "Linux-Clang-Remote-Debug", + "generator": "Ninja", + "configurationType": "Debug", + "cmakeExecutable": "/usr/bin/cmake", + "remoteCopySourcesExclusionList": [ ".vs", ".vscode", ".git", ".github", "build", "out", "bin" ], + "cmakeCommandArgs": "", + "buildCommandArgs": "-v", + "ctestCommandArgs": "", + "inheritEnvironments": [ "linux_clang_x64" ], + "remoteMachineName": "${env.fexremote}", // string "-662331587;z.port0.org (username=ubuntu, port=22, authentication=PrivateKey)", + "remoteCMakeListsRoot": "$HOME/projects/.vs/${projectDirName}/src", + "remoteBuildRoot": "$HOME/projects/.vs/${projectDirName}/build/${name}", + "remoteInstallRoot": "$HOME/projects/.vs/${projectDirName}/install/${name}", + "remoteCopySources": true, + "rsyncCommandArgs": "-t --delete --delete-excluded", + "remoteCopyBuildOutput": false, + "remoteCopySourcesMethod": "rsync", + "addressSanitizerRuntimeFlags": "detect_leaks=0", + "variables": [] + } + ] +} \ No newline at end of file diff --git a/External/FEXCore/Source/Interface/Core/LLVMJIT/LLVMCore.cpp b/External/FEXCore/Source/Interface/Core/LLVMJIT/LLVMCore.cpp index 433b374a1b..4b02e9c468 100644 --- a/External/FEXCore/Source/Interface/Core/LLVMJIT/LLVMCore.cpp +++ b/External/FEXCore/Source/Interface/Core/LLVMJIT/LLVMCore.cpp @@ -13,7 +13,12 @@ #include #include #include -#include + +// This seems to be needed for LLVM-10, and isn't needed/built from IntrinsicsX86.td in LLVM-9? +#if __has_include () + #include +#endif + #include #include #include diff --git a/Source/Tools/Debugger/CMakeLists.txt b/Source/Tools/Debugger/CMakeLists.txt index 9b095e22a3..3408ecc4a8 100644 --- a/Source/Tools/Debugger/CMakeLists.txt +++ b/Source/Tools/Debugger/CMakeLists.txt @@ -3,7 +3,7 @@ set(SRCS Main.cpp DebuggerState.cpp Context.cpp FEXImGui.cpp - IMGui.cpp + IMGui_I.cpp IRLexer.cpp GLUtils.cpp MainWindow.cpp diff --git a/Source/Tools/Debugger/IMGui.cpp b/Source/Tools/Debugger/IMGui_I.cpp similarity index 99% rename from Source/Tools/Debugger/IMGui.cpp rename to Source/Tools/Debugger/IMGui_I.cpp index 12a5794cf9..74b620b731 100644 --- a/Source/Tools/Debugger/IMGui.cpp +++ b/Source/Tools/Debugger/IMGui_I.cpp @@ -1,7 +1,7 @@ #include "DebuggerState.h" #include "Disassembler.h" #include "FEXImGui.h" -#include "IMGui.h" +#include "IMGui_I.h" #include "LogManager.h" #include "IRLexer.h" #include "Common/Config.h" diff --git a/Source/Tools/Debugger/IMGui.h b/Source/Tools/Debugger/IMGui_I.h similarity index 100% rename from Source/Tools/Debugger/IMGui.h rename to Source/Tools/Debugger/IMGui_I.h diff --git a/Source/Tools/Debugger/Main.cpp b/Source/Tools/Debugger/Main.cpp index 179baccb95..47275f2a29 100644 --- a/Source/Tools/Debugger/Main.cpp +++ b/Source/Tools/Debugger/Main.cpp @@ -5,7 +5,7 @@ #include "MainWindow.h" #include "Context.h" #include "GLUtils.h" -#include "IMGui.h" +#include "IMGui_I.h" #include "DebuggerState.h" #include "LogManager.h" From 1daec14a48ccbde9f5c4fcd0507f72e897ce0d6b Mon Sep 17 00:00:00 2001 From: David Miller Date: Thu, 23 Apr 2020 20:10:35 -0400 Subject: [PATCH 3/3] added guard on IntrinsicsX86.h inclusion --- .gitignore | 6 ++++++ External/FEXCore/Source/Interface/Core/LLVMJIT/LLVMCore.cpp | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 37df0a9b58..9845bd52c5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,12 @@ +# Existing + compile_commands.json vim_rc Config.json [Bb]uild*/ +[Bb]in/ +out/ .vscode/ +.vs/ + diff --git a/External/FEXCore/Source/Interface/Core/LLVMJIT/LLVMCore.cpp b/External/FEXCore/Source/Interface/Core/LLVMJIT/LLVMCore.cpp index 4b02e9c468..3d6d5c9f39 100644 --- a/External/FEXCore/Source/Interface/Core/LLVMJIT/LLVMCore.cpp +++ b/External/FEXCore/Source/Interface/Core/LLVMJIT/LLVMCore.cpp @@ -15,7 +15,7 @@ #include // This seems to be needed for LLVM-10, and isn't needed/built from IntrinsicsX86.td in LLVM-9? -#if __has_include () +#if defined(_M_X86_64) && __has_include () #include #endif