forked from xLightsSequencer/xLights
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.windows
257 lines (218 loc) · 13.5 KB
/
README.windows
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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
=========================================================
xLights Windows build instructions
=========================================================
xLights can be built and run on Linux, Mac OS/X, or Windows. This
document describes how **developers** should set up their tool chain to build
xLights on Windows.
If you are a Windows user, installation packages are available at
http://www.nutcracker123.com/nutcracker/releases/
xLights is written in C++ and uses the wxWidgets library as a
compatibility layer across operating systems. The minimum required version
of wxWidgets for xLights is 3.1.1. Do not use the pre-compiled
Windows binaries of wxWidgets, as these are for the Visual Studio IDE.
We support both the CodeBlocks/MinGW compiler and the VisualStudio/MS Visual C++ compiler for Windows builds.
Instructions for MinGW 32 Bit
================================================
Here are the steps to compile xLights for Windows using the MinGW compiler.
a) Install Code::Blocks for Windows (currently using version 17.12)
Download and install the codeblocks-17.12-setup.exe file from here:
http://www.codeblocks.org/downloads/binaries
b) Install MinGW for Windows (currently using version 7.2.0)
Download and install the ming-w64-install.exe file from here:
Navigate to: http://mingw-w64.org/doku.php/download
Click the Mingw-builds option then click on the SourceForge link.
Download should begin after 5 seconds.
Run the install file and select "i686" architecture, Posix threads, and Dwarf exceptions.
b) wxWidgets for Windows (currently using version 3.1.1)
Download the version with the Windows installer from here:
http://www.wxwidgets.org/downloads/
The installer only puts the wxWidgets source code on your system, you will need
to compile it yourself to create the dll. To compile it yourself:
1) Open a command prompt
2) cd to the build\msw directory under your wxWidgets base directory
3) Execute the command: SET Path=%PATH%;C:\Program Files (x86)\mingw-w64\i686-7.2.0-posix-dwarf-rt_v5-rev1\mingw32\bin
Note: If your MinGW installation was placed in a different directory adjust the command above accordingly.
4) Edit the wxWidgets\include\wx\msw\setup.h and change the following lines
#define wxUSE_STD_STRING_CONV_IN_WXSTRING wxUSE_STL
to
#define wxUSE_STD_STRING_CONV_IN_WXSTRING 1
#define wxUSE_STD_CONTAINERS 0
to
#define wxUSE_STD_CONTAINERS 1
- save the file
5) Edit the file wxWidgets\src\msw\anybutton.cpp to comment out lines 1138 through 1146 as follows:
/*if ( wxGetWinVersion() >= wxWinVersion_10 )
{
// buttons have flat appearance so we can fully color them
// even outside the "safe" rectangle
SelectInHDC brush(hdc, hbrushBackground);
COLORREF colTheme = GetPixel(hdc, rectClient.left, rectClient.top);
ExtFloodFill(hdc, rectClient.left, rectClient.top, colTheme, FLOODFILLSURFACE);
}
else*/
6) If you have previously built wxWidgets before and are using the same directory you will need to make the same change as above to the setup.h file in two
more locations: wxWidgets\lib\gcc_dll\mswu\wx\setup.h and wxWidgets\lib\gcc_dll\mswud\wx\setup.h.
7) Also if you have built wxWidgets before you should delete the following 2 folders to force the setup.h change to be included
- wxWidgets\build\msw\gcc_mswuddll
- wxWidgets\build\msw\gcc_mswudll
8) run: mingw32-make -f makefile.gcc --debug MONOLITHIC=1 SHARED=1 UNICODE=1 CXXFLAGS="-std=gnu++14" BUILD=debug -j 10
NOTE: If it fails the first time try it again ... and sometimes again
9) run: mingw32-make -f makefile.gcc --debug MONOLITHIC=1 SHARED=1 UNICODE=1 CXXFLAGS="-std=gnu++14" BUILD=release -j 10
NOTE: If it fails the first time try it again ... and sometimes again
10) If you downloaded the zip or 7z version of wxWidgets instead of the Windows installer version,
then you need to update your path environment variable to include C:\wxWidgets\lib\gcc_dll
(assuming C:\wxWidgets is your wxWidgets base directory).
c) In Code::Blocks:
1) select Settings > Compiler
2) click Search Directories tab
3) Under Compiler, Search sub-tab should be:
$(#wx)\include
$(#wx)\contrib\include
ffmpeg\include
..\include
4) Under Linker sub-tab should be:
$(#wx)\lib\gcc_dll
ffmpeg\lib
5) click Toolchain Executables tab
6) Fill in the compiler's installation directory to your path to MinGW:
example: C:\Program Files (x86)\mingw-w64\i686-7.2.0-posix-dwarf-rt_v5-rev1\mingw32
7) Set C Compiler to gcc.exe, C++ compiler to g++.exe, Linker for dynamic libs to g++.exe,
Linker for static libs to ar.exe, Debugger set to GDB..., resource compiler set to windres.exe,
and Make program set to mingw32-make.exe.
8) select Settings > Debugger
9) click 'Default' under GDB/CDB debugger
10) uncheck the box for 'Disable startup scripts...'
11) Update the path to gdb.exe similar to step 7 above
12) select Settings > Global Variables
13) Make sure "wx" is defined as described in the Code::Blocks documentation.
wx should be set to your wxWidgets base directory. Just the "Base" field
needs to be filled in - to something like "C:\wxWidgets",
assuming that is where your copy of wxWidgets is located.
d) Now you are ready to use Code::Blocks to build xLights
by double-clicking on the cbp file in the xLights directory.
Make sure you set the build target to MinGW_Debug or MinGW_Release!
Instructions for MinGW 64-bit
================================================
Here are the steps to compile xLights for Windows using the MinGW 64-bit compiler.
a) Install Code::Blocks for Windows (currently using version 17.12)
Download and install the codeblocks-17.12-setup.exe file from here:
http://www.codeblocks.org/downloads/binaries
b) Install MinGW for Windows (currently using version 7.2)
Download and install the ming-w64-install.exe file from here:
Navigate to: http://mingw-w64.org/doku.php/download
Click the Mingw-builds option then click on the SourceForge link.
Download should begin after 5 seconds.
Run the install file and select "x86_64" architecture, Posix threads, and seh exceptions.
c) wxWidgets for Windows (currently using version 3.1.1)
Download the version with the Windows installer from here:
http://www.wxwidgets.org/downloads/
The installer only puts the wxWidgets source code on your system, you will need
to compile it yourself to create the dll. If you followed the MinGW instructions,
make a separate directory for the 64-bit version:
C:\wxWidgets
To compile it yourself:
1) Open a command prompt
2) cd to the build\msw directory under your wxWidgets64 base directory
3) Execute the command: SET Path=%PATH%;C:\Program Files\mingw-w64\x86_64-7.2.0-posix-seh-rt_v5-rev1\mingw64\bin
Note: If your MinGW installation was placed in a different directory adjust the command above accordingly.
4) Edit the wxWidgets\include\wx\msw\setup.h and change the following lines
#define wxUSE_STD_STRING_CONV_IN_WXSTRING wxUSE_STL
to
#define wxUSE_STD_STRING_CONV_IN_WXSTRING 1
#define wxUSE_STD_CONTAINERS 0
to
#define wxUSE_STD_CONTAINERS 1
- save the file
5) Edit the file wxWidgets\src\msw\anybutton.cpp to comment out lines 1138 through 1146 as follows:
/*if ( wxGetWinVersion() >= wxWinVersion_10 )
{
// buttons have flat appearance so we can fully color them
// even outside the "safe" rectangle
SelectInHDC brush(hdc, hbrushBackground);
COLORREF colTheme = GetPixel(hdc, rectClient.left, rectClient.top);
ExtFloodFill(hdc, rectClient.left, rectClient.top, colTheme, FLOODFILLSURFACE);
}
else*/
6) If you have previously built wxWidgets64 before and are using the same directory you will need to make the same change as above to the setup.h file in two
more locations: wxWidgets\lib\gcc_dll\mswu\wx\setup.h and wxWidgets\lib\gcc_dll\mswud\wx\setup.h.
7) Also if you have built wxWidgets64 before you should delete the following 2 folders to force the setup.h change to be included
- wxWidgets\build\msw\gcc_mswuddll
- wxWidgets\build\msw\gcc_mswudll
8) run: mingw32-make -f makefile.gcc --debug TARGET_CPU=X64 MONOLITHIC=1 SHARED=1 UNICODE=1 CXXFLAGS="-std=gnu++14" BUILD=debug -j 10
NOTE: If it fails the first time try it again ... and sometimes again
9) run: mingw32-make -f makefile.gcc --debug TARGET_CPU=X64 MONOLITHIC=1 SHARED=1 UNICODE=1 CXXFLAGS="-std=gnu++14" BUILD=release -j 10
NOTE: If it fails the first time try it again ... and sometimes again
10) If you downloaded the zip or 7z version of wxWidgets instead of the Windows installer version,
then you need to update your path environment variable to include C:\wxWidgets\lib\gcc_dll
(assuming C:\wxWidgets is your wxWidgets base directory).
c) In Code::Blocks:
1) select Settings > Compiler then with selected compiler as "GNU GCC Compiler"
press the Copy button naming the new configuration gnu_gcc_64bit_compiler
2) click Search Directories tab
3) Under Compiler, Search sub-tab should be:
$(#wx64)\include
$(#wx64)\contrib\include
4) Under Linker sub-tab should be:
$(#wx64)\lib\gcc_dll
5) select Settings > Debugger
6) click "GDB/CDB debugger" in the hiearchy which contains "Default" then press the Create Config button and name it GDB64
7) uncheck the box for 'Disable startup scripts...'
8) Fill in the Executable Path to your path to MinGW debugger executable then click OK:
example: C:\Program Files\mingw-w64\x86_64-7.2.0-posix-seh-rt_v5-rev1\mingw64\bin\gdb.exe
9) Go back to Settings > Compiler > select gnu_gcc_64bit_compiler > select tab Toolchain executables
10) Fill in the compiler's installation directory to your path to MinGW:
example: C:\Program Files\mingw-w64\x86_64-7.2.0-posix-seh-rt_v5-rev1\mingw64
11) Set C Compiler to gcc.exe, C++ compiler to g++.exe, Linker for dynamic libs to g++.exe,
Linker for static libs to ar.exe, Debugger set to GDB64 you created in step 6..., resource compiler set to windres.exe,
and Make program set to mingw32-make.exe.
12) select Settings > Global Variables
13) Make sure "wx64" is defined as described in the Code::Blocks documentation.
wx64 should be set to your wxWidgets64 base directory. Just the "Base" field
needs to be filled in - to something like "C:\wxWidgets",
assuming that is where your copy of wxWidgets is located.
d) Now you are ready to use Code::Blocks to build xLights
by double-clicking on the cbp file in the xLights directory.
Make sure you set the build target to "64bit MinGW_Debug" or "64bit MinGW_Release"!
Instructions for MS Visual Studio C++
=====================================
Here are the steps to compile xLights for Windows using the Visual Studio compiler.
a) Install Visual Studio 2017 ... the community edition is fine
b) Select a base directory to place all your souce code in. From now on this is represented as <basedir>
c) Download and build wxWidgets for Windows (currently using version 3.1.1)
Download the version with the Windows installer from here:
http://www.wxwidgets.org/downloads/
The installer only puts the wxWidgets source code on your system, you will need
to compile it yourself to create the lib files. The process is described here:
http://wiki.wxwidgets.org/Compiling_Using_MSVC_On_The_Commandline
To compile it yourself:
1) Edit the wxWidgets\include\wx\msw\setup.h and change the following lines
#define wxUSE_STD_STRING_CONV_IN_WXSTRING wxUSE_STL
to
#define wxUSE_STD_STRING_CONV_IN_WXSTRING 1
#define wxUSE_STD_CONTAINERS 0
to
#define wxUSE_STD_CONTAINERS 1
- save the file
2) Edit the file wxWidgets\src\msw\anybutton.cpp to comment out lines 1138 through 1146 as follows:
/*if ( wxGetWinVersion() >= wxWinVersion_10 )
{
// buttons have flat appearance so we can fully color them
// even outside the "safe" rectangle
SelectInHDC brush(hdc, hbrushBackground);
COLORREF colTheme = GetPixel(hdc, rectClient.left, rectClient.top);
ExtFloodFill(hdc, rectClient.left, rectClient.top, colTheme, FLOODFILLSURFACE);
}
else*/
3) If you have previously built wxWidgets before and are using the same directory you will need to make the same change as above to the setup.h file in two
more locations: <basedir>\wxWidgets\lib\vc_dll\mswu\wx\setup.h and <basedir>\wxWidgets\lib\vc_dll\mswud\wx\setup.h.
4) Also if you have built wxWidgets before you should delete the following 2 folders to force the setup.h change to be included
- <basedir>\wxWidgets\build\msw\vc_mswuddll
- <basedir>\wxWidgets\build\msw\vc_mswudll
5) Open the project <basedir>\wxWidgets\build\msw\wx_vc14.sln
6) Compile both a release and a debug version
d) Now open the xlights project <basedir>\xLights\xLights\xLights.sln and build the project
Windows Installer
=================
We use Inno Setup to create the setup.exe for xLights
http://www.jrsoftware.org/isinfo.php
You will find a xLights.iss file that is used to create the release setup.exe