-
Notifications
You must be signed in to change notification settings - Fork 0
/
win.diff
67 lines (62 loc) · 2.16 KB
/
win.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 68f045fbb..59410594b 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -340,13 +340,6 @@ if (SOUFFLE_USE_SQLITE)
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${SQLite3_LIBRARY}
$<TARGET_FILE_DIR:souffle>)
- if (WIN32)
- cmake_path(GET SQLite3_LIBRARY PARENT_PATH SQLite3_LIBRARY_DIR)
- add_custom_command(TARGET souffle POST_BUILD
- COMMAND ${CMAKE_COMMAND} -E copy_if_different
- ${SQLite3_LIBRARY_DIR}/../bin/sqlite3.dll
- $<TARGET_FILE_DIR:souffle>)
- endif ()
endif ()
if (SOUFFLE_USE_ZLIB)
diff --git a/src/MainDriver.cpp b/src/MainDriver.cpp
index 60c7c996f..5ead8adea 100644
--- a/src/MainDriver.cpp
+++ b/src/MainDriver.cpp
@@ -214,7 +214,7 @@ void compileToBinary(
argv.push_back(binary.string());
#if defined(_MSC_VER)
- const char* interpreter = "python";
+ const char* interpreter = "python.exe";
#else
const char* interpreter = "python3";
#endif
diff --git a/src/include/souffle/utility/FileUtil.h b/src/include/souffle/utility/FileUtil.h
index 24b40b9ee..20e5ae6f8 100644
--- a/src/include/souffle/utility/FileUtil.h
+++ b/src/include/souffle/utility/FileUtil.h
@@ -161,6 +161,12 @@ inline std::string which(const std::string& name) {
if ((::realpath(path.c_str(), buf) != nullptr) && isExecutable(path) && !existDir(path)) {
return buf;
}
+#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)
+ path += ".exe";
+ if ((::realpath(path.c_str(), buf) != nullptr) && isExecutable(path) && !existDir(path)) {
+ return buf;
+ }
+#endif
}
return "";
}
diff --git a/src/souffle.cpp b/src/souffle.cpp
index a95bddc90..cdac282f7 100644
--- a/src/souffle.cpp
+++ b/src/souffle.cpp
@@ -40,9 +40,14 @@ bool processArgs(souffle::Global& glb, int argc, char** argv) {
} // namespace
int main(int argc, char** argv) {
+try {
souffle::Global glb;
processArgs(glb, argc, argv);
return souffle::main(glb, argv[0]);
+} catch(const std::exception& e) {
+ std::cerr << "Uncaught exception: " << e.what() << std::endl;
+ std::exit(EXIT_FAILURE);
+}
}