forked from msys2/MINGW-packages
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path0010-Teach-gyp-generated-Makefile-to-build-crash_generati.patch
165 lines (152 loc) · 5.46 KB
/
0010-Teach-gyp-generated-Makefile-to-build-crash_generati.patch
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
From d96319f23d7ba65a5f09f57a9a80af67a327e0e4 Mon Sep 17 00:00:00 2001
From: Jon TURNEY <[email protected]>
Date: Mon, 10 Feb 2014 18:12:14 +0000
Subject: [PATCH 10/24] Teach gyp generated Makefile to build
crash_generation_app correctly
- Use linker flag for Windows subsystem
- Use linker flag for unicode
- Add rule for compiling windows resources, using $RC to name the resource compiler
- Rename crash_generation_app.rc to avoid a clash in corresponding .o names
Also
- Fix linking of unit test when built using gyp generated Makefile by providing
needed library
XXX: We need to arrange for the gyp Makefile generator to set
CXXFLAGS="-DUNICODE -D_UNICODE" somewhere when generating for Windows. This is
already done in generated MSVS projects.
Signed-off-by: Jon TURNEY <[email protected]>
---
.../crash_generation_app/crash_generation_app.gyp | 29 +++++++++++++++++++---
.../{crash_generation_app.rc => resource.rc} | 13 +++++-----
src/client/windows/unittests/client_tests.gyp | 12 +++++++--
3 files changed, 41 insertions(+), 13 deletions(-)
rename src/client/windows/tests/crash_generation_app/{crash_generation_app.rc => resource.rc} (96%)
diff --git a/src/client/windows/tests/crash_generation_app/crash_generation_app.gyp b/src/client/windows/tests/crash_generation_app/crash_generation_app.gyp
index 3ce307d..774f600 100644
--- a/src/client/windows/tests/crash_generation_app/crash_generation_app.gyp
+++ b/src/client/windows/tests/crash_generation_app/crash_generation_app.gyp
@@ -40,19 +40,40 @@
'crash_generation_app.cc',
'crash_generation_app.h',
'crash_generation_app.ico',
- 'crash_generation_app.rc',
+ 'resource.rc',
'resource.h',
'small.ico',
],
- 'libraries': [
- 'user32.lib',
- ],
'dependencies': [
'../../breakpad_client.gyp:common',
'../../crash_generation/crash_generation.gyp:crash_generation_server',
'../../crash_generation/crash_generation.gyp:crash_generation_client',
'../../handler/exception_handler.gyp:exception_handler',
],
+ 'conditions': [
+ [ '"<(GENERATOR)" == "make"', {
+ 'ldflags': [
+ '-Wl,--subsystem=2', '-municode'
+ ],
+ 'rules': [
+ { 'rule_name': 'windres',
+ 'extension': 'rc',
+ 'inputs' : [ ],
+ 'outputs' : [ '$(builddir)/<(RULE_INPUT_ROOT).o' ],
+ 'action' : [ '$(RC)', '--input=<(RULE_INPUT_PATH)', '--output=$(builddir)/<(RULE_INPUT_ROOT).o', '--input-format=rc', '--output-format=coff', '-v', '--use-temp-file' ],
+ 'message' : 'Compiling Windows resources',
+ 'process_outputs_as_sources' : 1,
+ },
+ ],
+ }
+ ],
+ [ '"<(GENERATOR)" == "msvs"', {
+ 'libraries': [
+ 'user32.lib',
+ ],
+ }
+ ]
+ ],
'msvs_settings': {
'VCLinkerTool': {
'SubSystem': '2', # Windows Subsystem as opposed to a console app
diff --git a/src/client/windows/tests/crash_generation_app/crash_generation_app.rc b/src/client/windows/tests/crash_generation_app/resource.rc
similarity index 96%
rename from src/client/windows/tests/crash_generation_app/crash_generation_app.rc
rename to src/client/windows/tests/crash_generation_app/resource.rc
index a362562..6c7e8b6 100644
--- a/src/client/windows/tests/crash_generation_app/crash_generation_app.rc
+++ b/src/client/windows/tests/crash_generation_app/resource.rc
@@ -38,7 +38,7 @@ IDI_SMALL ICON "small.ico"
// Menu
//
-IDC_CRASHGENERATIONAPP MENU
+IDC_CRASHGENERATIONAPP MENU
BEGIN
POPUP "&File"
BEGIN
@@ -64,7 +64,7 @@ END
// Accelerator
//
-IDC_CRASHGENERATIONAPP ACCELERATORS
+IDC_CRASHGENERATIONAPP ACCELERATORS
BEGIN
"?", IDM_ABOUT, ASCII, ALT
"/", IDM_ABOUT, ASCII, ALT
@@ -94,12 +94,12 @@ END
// TEXTINCLUDE
//
-1 TEXTINCLUDE
+1 TEXTINCLUDE
BEGIN
"resource.h\0"
END
-2 TEXTINCLUDE
+2 TEXTINCLUDE
BEGIN
"#define APSTUDIO_HIDDEN_SYMBOLS\r\n"
"#include ""windows.h""\r\n"
@@ -107,7 +107,7 @@ BEGIN
"\0"
END
-3 TEXTINCLUDE
+3 TEXTINCLUDE
BEGIN
"\r\n"
"\0"
@@ -121,7 +121,7 @@ END
// String Table
//
-STRINGTABLE
+STRINGTABLE
BEGIN
IDS_APP_TITLE "CrashGenerationApp"
IDC_CRASHGENERATIONAPP "CRASHGENERATIONAPP"
@@ -141,4 +141,3 @@ END
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED
-
diff --git a/src/client/windows/unittests/client_tests.gyp b/src/client/windows/unittests/client_tests.gyp
index 7f9c7a0..238cf5d 100644
--- a/src/client/windows/unittests/client_tests.gyp
+++ b/src/client/windows/unittests/client_tests.gyp
@@ -51,8 +51,16 @@
'../crash_generation/crash_generation.gyp:crash_generation_server',
'../crash_generation/crash_generation.gyp:crash_generation_client',
'../handler/exception_handler.gyp:exception_handler',
- 'processor_bits',
- ]
+ 'processor_bits',
+ ],
+ 'conditions': [
+ [ '"<(GENERATOR)" == "make"', {
+ 'libraries': [
+ '-ldbghelp', '-lversion', '-lpthread',
+ ],
+ },
+ ],
+ ],
},
{
'target_name': 'processor_bits',
--
2.1.1