Author: compnerd Date: Thu Jul 4 12:26:49 2019 New Revision: 365155 URL: http://llvm.org/viewvc/llvm-project?rev=365155&view=rev Log: Plugins: permit building on Windows ARM64
Rather than relying on `sizeof(void *)` to determine the architecture, use the `CMAKE_SYSTEM_PROCESSOR` variable. This should allow us to build for Windows and cross-compile. Without this, we would attempt to build the x64 plugin on ARM64 which would fail due to the `CONTEXT` type being defined for ARM64 rather than `x64`. Modified: lldb/trunk/source/Plugins/Process/Windows/Common/CMakeLists.txt Modified: lldb/trunk/source/Plugins/Process/Windows/Common/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Windows/Common/CMakeLists.txt?rev=365155&r1=365154&r2=365155&view=diff ============================================================================== --- lldb/trunk/source/Plugins/Process/Windows/Common/CMakeLists.txt (original) +++ lldb/trunk/source/Plugins/Process/Windows/Common/CMakeLists.txt Thu Jul 4 12:26:49 2019 @@ -1,4 +1,5 @@ -set(PROC_WINDOWS_COMMON_SOURCES + +add_lldb_library(lldbPluginProcessWindowsCommon PLUGIN DebuggerThread.cpp LocalDebugDelegate.cpp ProcessDebugger.cpp @@ -6,20 +7,6 @@ set(PROC_WINDOWS_COMMON_SOURCES ProcessWindowsLog.cpp RegisterContextWindows.cpp TargetThreadWindows.cpp - ) - -if (CMAKE_SIZEOF_VOID_P EQUAL 4) - set(PROC_WINDOWS_COMMON_SOURCES ${PROC_WINDOWS_COMMON_SOURCES} - x86/RegisterContextWindows_x86.cpp - ) -elseif (CMAKE_SIZEOF_VOID_P EQUAL 8) - set(PROC_WINDOWS_COMMON_SOURCES ${PROC_WINDOWS_COMMON_SOURCES} - x64/RegisterContextWindows_x64.cpp - ) -endif() - -add_lldb_library(lldbPluginProcessWindowsCommon PLUGIN - ${PROC_WINDOWS_COMMON_SOURCES} LINK_LIBS lldbCore @@ -33,3 +20,13 @@ add_lldb_library(lldbPluginProcessWindow LINK_COMPONENTS Support ) + +# TODO add support for ARM (NT) and ARM64 +# TODO build these unconditionally as we cannot do cross-debugging or WoW +if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|AMD64") + target_sources(lldbPluginProcessWindowsCommon PRIVATE + x64/RegisterContextWindows_x64.cpp) +elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "i?86|X86") + target_sources(lldbPluginProcessWindowsCommon PRIVATE + x86/RegisterContextWindows_x86.cpp) +endif() _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits