summaryrefslogtreecommitdiffstats
path: root/Source/bindexplib.cxx
diff options
context:
space:
mode:
authorMalcolm Bechard <malcolm@derivative.ca>2023-02-13 18:15:00 (GMT)
committerBrad King <brad.king@kitware.com>2023-02-14 14:11:45 (GMT)
commitf513781bc51e99ceb003ac11c93639bb09e05cf4 (patch)
treed12e5b38cdc43816bdb7ac931343570decd89c1e /Source/bindexplib.cxx
parent8a73af36b04723f1967c88d95f692c93f267b485 (diff)
downloadCMake-f513781bc51e99ceb003ac11c93639bb09e05cf4.zip
CMake-f513781bc51e99ceb003ac11c93639bb09e05cf4.tar.gz
CMake-f513781bc51e99ceb003ac11c93639bb09e05cf4.tar.bz2
WINDOWS_EXPORT_ALL_SYMBOLS: Export vftable symbol
`pybind11` requires access to this symbol to link in some cases. Include this symbol when generating automatic exports via `CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS`. Fixes: #24406
Diffstat (limited to 'Source/bindexplib.cxx')
-rw-r--r--Source/bindexplib.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/Source/bindexplib.cxx b/Source/bindexplib.cxx
index 52e200c..7b74264 100644
--- a/Source/bindexplib.cxx
+++ b/Source/bindexplib.cxx
@@ -281,6 +281,7 @@ public:
// the symbol
const char* scalarPrefix = "??_G";
const char* vectorPrefix = "??_E";
+ const char* vftablePrefix = "??_7";
// The original code had a check for
// symbol.find("real@") == std::string::npos)
// but this disallows member functions with the name "real".
@@ -302,7 +303,8 @@ public:
this->DataSymbols.insert(symbol);
} else {
if (pSymbolTable->Type || !(SectChar & IMAGE_SCN_MEM_READ) ||
- (SectChar & IMAGE_SCN_MEM_EXECUTE)) {
+ (SectChar & IMAGE_SCN_MEM_EXECUTE) ||
+ (symbol.compare(0, 4, vftablePrefix) == 0)) {
this->Symbols.insert(symbol);
}
}