cdbext: remove cdbdetection completely

All required header and libs are inside the Windows 10 SDK, which is
required to build with Visual Studio 2017.

Change-Id: I68ee7457041653d89e5f5c9e258f9780a417dbe4
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
David Schulz
2020-09-15 09:54:41 +02:00
parent 26fc085658
commit bc4187727c
5 changed files with 7 additions and 140 deletions

View File

@@ -65,21 +65,8 @@ isEmpty(KSYNTAXHIGHLIGHTING_LIB_DIR) {
win32:SUBDIRS += utils/process_ctrlc_stub.pro
# Windows: Compile Qt Creator CDB extension if Debugging tools can be detected.
win32: isEmpty(QTC_SKIP_CDBEXT) {
CDB_NO_AUTODETECT = $$(CDB_NO_AUTODETECT) #use the debugger header and lib defined in INCLUDE and LIB env var
!isEmpty(CDB_NO_AUTODETECT) {
SUBDIRS += qtcreatorcdbext
} else {
include(qtcreatorcdbext/cdb_detect.pri)
!isEmpty(CDB_PATH): exists($$CDB_PATH) {
SUBDIRS += qtcreatorcdbext
} else {
message("Compiling Qt Creator without a CDB extension.")
message("If CDB is installed in a none default path define a CDB_PATH")
message("environment variable pointing to your CDB installation.")
}
}
SUBDIRS += qtcreatorcdbext
}
QMAKE_EXTRA_TARGETS += deployqt # dummy

View File

@@ -2,30 +2,7 @@ if (NOT WIN32 OR NOT MSVC)
return()
endif()
find_path(WDbgExtsPath wdbgexts.h
HINTS
"$ENV{CDB_PATH}"
"$ENV{ProgramFiles}/Debugging Tools For Windows/sdk"
"$ENV{ProgramFiles}/Debugging Tools For Windows (x86)/sdk"
"$ENV{ProgramFiles}/Debugging Tools For Windows (x64)/sdk"
"$ENV{ProgramFiles}/Debugging Tools For Windows 64-bit/sdk"
"$ENV{ProgramW6432}/Debugging Tools For Windows (x86)/sdk"
"$ENV{ProgramW6432}/Debugging Tools For Windows (x64)/sdk"
"$ENV{ProgramW6432}/Debugging Tools For Windows 64-bit/sdk"
"$ENV{ProgramFiles}/Windows Kits/8.0/Debuggers"
"$ENV{ProgramFiles}/Windows Kits/8.1/Debuggers"
"$ENV{ProgramFiles}/Windows Kits/10/Debuggers"
"$ENV{ProgramFiles\(x86\)}/Windows Kits/8.0/Debuggers/inc"
"$ENV{ProgramFiles\(x86\)}/Windows Kits/8.1/Debuggers/inc"
"$ENV{ProgramFiles\(x86\)}/Windows Kits/10/Debuggers/inc"
)
if (NOT WDbgExtsPath)
message(WARNING "wdbgexts.h not found. Removing qtcreatorcdbext from build.")
return()
endif()
find_library(DbgEngLib dbgeng HINTS ${WDbgExtsPath})
find_library(DbgEngLib dbgeng)
set(ArchSuffix 32)
if (CMAKE_SIZEOF_VOID_P EQUAL 8)

View File

@@ -1,26 +0,0 @@
# Detect presence of "Debugging Tools For Windows"
# in case MS VS compilers are used.
CDB_PATH=""
CDB_NO_AUTODETECT = $$(CDB_NO_AUTODETECT) #use the debugger header and lib defined in INCLUDE and LIB env var
isEmpty(CDB_NO_AUTODETECT): msvc {
CDB_PATH="$$(CDB_PATH)"
isEmpty(CDB_PATH):CDB_PATH="$$(ProgramFiles)/Debugging Tools For Windows/sdk"
!exists($$CDB_PATH):CDB_PATH="$$(ProgramFiles)/Debugging Tools For Windows (x86)/sdk"
!exists($$CDB_PATH):CDB_PATH="$$(ProgramFiles)/Debugging Tools For Windows (x64)/sdk"
!exists($$CDB_PATH):CDB_PATH="$$(ProgramFiles)/Debugging Tools For Windows 64-bit/sdk"
!exists($$CDB_PATH):CDB_PATH="$$(ProgramW6432)/Debugging Tools For Windows (x86)/sdk"
!exists($$CDB_PATH):CDB_PATH="$$(ProgramW6432)/Debugging Tools For Windows (x64)/sdk"
!exists($$CDB_PATH):CDB_PATH="$$(ProgramW6432)/Debugging Tools For Windows 64-bit/sdk"
# Starting from Windows SDK 8, the headers and libs are under 'ProgramFiles (x86)'.
# The libraries are under 'ProgramFiles'as well, so, check for existence of 'inc'.
# 32bit qmake:
!exists($$CDB_PATH/inc):CDB_PATH="$$(ProgramFiles)/Windows Kits/8.0/Debuggers"
!exists($$CDB_PATH/inc):CDB_PATH="$$(ProgramFiles)/Windows Kits/8.1/Debuggers"
!exists($$CDB_PATH/inc):CDB_PATH="$$(ProgramFiles)/Windows Kits/10/Debuggers"
# 64bit qmake:
!exists($$CDB_PATH/inc):CDB_PATH="$$(ProgramFiles) (x86)/Windows Kits/8.0/Debuggers"
!exists($$CDB_PATH/inc):CDB_PATH="$$(ProgramFiles) (x86)/Windows Kits/8.1/Debuggers"
!exists($$CDB_PATH/inc):CDB_PATH="$$(ProgramFiles) (x86)/Windows Kits/10/Debuggers"
!exists($$CDB_PATH/inc):CDB_PATH=""
}

View File

@@ -2,7 +2,6 @@
TEMPLATE = lib
include(../../../qtcreator.pri)
include(cdb_detect.pri)
isEmpty(QTC_KEEP_CDBEXT_DEFAULT_CONFIG): CONFIG += release
@@ -30,42 +29,13 @@ DEF_FILE=$$PWD/qtcreatorcdbext.def
ENV_TARGET_ARCH=$$(VSCMD_ARG_TGT_ARCH)
isEmpty(ENV_TARGET_ARCH):ENV_TARGET_ARCH = $$(Platform)
ENV_LIBPATH=$$(LIBPATH)
contains(ENV_TARGET_ARCH, .*64$) {
DIRNAME=$${BASENAME}64
CDB_PLATFORM=amd64
!isEmpty(CDB_PATH) {
exists($$CDB_PATH/lib/amd64) {
LIBS+= -L$$CDB_PATH/lib/amd64
} else {
LIBS+= -L$$CDB_PATH/lib/x64
}
}
} else:isEmpty(ENV_TARGET_ARCH):contains(ENV_LIBPATH, ^.*amd64.*$) {
DIRNAME=$${BASENAME}64
CDB_PLATFORM=amd64
!isEmpty(CDB_PATH) {
exists($$CDB_PATH/lib/amd64) {
LIBS+= -L$$CDB_PATH/lib/amd64
} else {
LIBS+= -L$$CDB_PATH/lib/x64
}
}
} else {
DIRNAME=$${BASENAME}32
CDB_PLATFORM=i386
!isEmpty(CDB_PATH) {
exists($$CDB_PATH/lib/i386}) {
LIBS+= -L$$CDB_PATH/lib/i386
} else {
LIBS+= -L$$CDB_PATH/lib/x86
}
}
}
LIBS+=-ldbgeng -luser32
@@ -73,9 +43,7 @@ LIBS+=-ldbgeng -luser32
DESTDIR=$$IDE_BUILD_TREE/lib/$${DIRNAME}
TARGET = $$BASENAME
message("Compiling Qt Creator CDB extension $$TARGET $$DESTDIR for $$CDB_PLATFORM using $$CDB_PATH")
!isEmpty(CDB_PATH): INCLUDEPATH += $$CDB_PATH/inc
message("Compiling Qt Creator CDB extension $$TARGET $$DESTDIR for $$CDB_PLATFORM")
CONFIG -= qt
QT -= gui

View File

@@ -6,47 +6,9 @@ import qbs.Process
import qbs.Utilities
QtcLibrary {
condition: qbs.toolchain.contains("msvc") && cdbPath
condition: qbs.toolchain.contains("msvc")
name: "qtcreatorcdbext"
targetName: name
property string cdbPath: {
var paths = [
Environment.getEnv("CDB_PATH"),
Environment.getEnv("ProgramFiles") + "/Debugging Tools For Windows/sdk",
Environment.getEnv("ProgramFiles") + "/Debugging Tools For Windows (x86)/sdk",
Environment.getEnv("ProgramFiles") + "/Debugging Tools For Windows (x64)/sdk",
Environment.getEnv("ProgramFiles") + "/Debugging Tools For Windows 64-bit/sdk",
Environment.getEnv("ProgramW6432") + "/Debugging Tools For Windows (x86)/sdk",
Environment.getEnv("ProgramW6432") + "/Debugging Tools For Windows (x64)/sdk",
Environment.getEnv("ProgramW6432") + "/Debugging Tools For Windows 64-bit/sdk",
Environment.getEnv("ProgramFiles") + "/Windows Kits/8.0/Debuggers",
Environment.getEnv("ProgramFiles") + "/Windows Kits/8.1/Debuggers",
Environment.getEnv("ProgramFiles") + "/Windows Kits/10/Debuggers",
Environment.getEnv("ProgramFiles(x86)") + "/Windows Kits/8.0/Debuggers/inc",
Environment.getEnv("ProgramFiles(x86)") + "/Windows Kits/8.1/Debuggers/inc",
Environment.getEnv("ProgramFiles(x86)") + "/Windows Kits/10/Debuggers/inc"
];
var c = paths.length;
for (var i = 0; i < c; ++i) {
if (File.exists(paths[i])) {
// The inc subdir is just used for detection. See qtcreatorcdbext.pro.
return paths[i].endsWith("/inc") ? paths[i].substr(0, paths[i].length - 4)
: paths[i];
}
}
return undefined;
}
property string cdbLibPath: {
var paths = qbs.architecture.contains("x86_64") ? ["x64", "amd64"] : ["x86", "i386"];
var c = paths.length;
for (var i = 0; i < c; ++i) {
var libPath = FileInfo.joinPaths(cdbPath, "lib", paths[i]);
if (File.exists(libPath)) {
return libPath;
}
}
return undefined;
}
property string pythonInstallDir: Environment.getEnv("PYTHON_INSTALL_DIR")
@@ -127,13 +89,12 @@ QtcLibrary {
cpp.defines: ["WITH_PYTHON=1"]
}
cpp.includePaths: {
var paths = [FileInfo.joinPaths(cdbPath, "inc")];
if (pythonDllProbe.found)
paths.push(FileInfo.joinPaths(pythonInstallDir, "include"));
return paths;
return [ FileInfo.joinPaths(pythonInstallDir, "include") ];
return [ ];
}
cpp.dynamicLibraries: {
var libs = [ "user32.lib", FileInfo.joinPaths(cdbLibPath, "dbgeng.lib") ];
var libs = [ "user32.lib", "dbgeng.lib" ];
if (pythonDllProbe.found)
libs.push(FileInfo.joinPaths(pythonInstallDir, "libs",
pythonDllProbe.fileNamePrefix + ".lib"));