forked from xLightsSequencer/xLights
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.windows
133 lines (106 loc) · 7.03 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
=========================================================
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.0. 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
================================================
Here are the steps to compile xLights for Windows using the MinGW compiler.
a) Install Code::Blocks for Windows (currently using version 16.01)
Download and install the codeblocks-16.01-setup.exe file from here:
http://www.codeblocks.org/downloads/binaries
b) Install MinGW for Windows (currently using version 5.3)
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.0)
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=C:\Windows\system32;C:\Windows;C:\Program Files (x86)\mingw-w64\i686-5.3.0-posix-dwarf-rt_v4-rev0\mingw32\bin
Note: If your MinGW installation was placed in a different directory adjust the command above accordingly.
4) Edit the wxWidgets-3.1.0\include\wx\msw\setup.h to enable GDI+
- search for the line "# define wxUSE_GRAPHICS_CONTEXT 0"
- change it to "# define wxUSE_GRAPHICS_CONTEXT 1"
- save the file
4b) Edit the wxWidgets-3.1.0\include\wx\rtti.h
- search for the line "bool IsKindOf(const wxClassInfo *info) const"
- change to "bool __attribute__((optimize("O0"))) IsKindOf(const wxClassInfo *info) const"
5) 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-3.1.0\lib\gcc_dll\mswu\wx\setup.h and wxWidgets-3.1.0\lib\gcc_dll\mswud\wx\setup.h.
6) Also if you have built wxWidgets before you should delete the following 2 folders to force the setup.h change to be included
- wxWidgets-3.1.0\build\msw\gcc_mswuddll
- wxWidgets-3.1.0\build\msw\gcc_mswudll
7) run: mingw32-make -f makefile.gcc --debug MONOLITHIC=1 SHARED=1 UNICODE=1 CXXFLAGS="-std=gnu++14" BUILD=debug -j 10
8) run: mingw32-make -f makefile.gcc --debug MONOLITHIC=1 SHARED=1 UNICODE=1 CXXFLAGS="-std=gnu++14" BUILD=release -j 10
9) 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-3.1.0\lib\gcc_dll
(assuming C:\wxWidgets-3.1.0 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
4) Under Linker sub-tab should be:
$(#wx)\lib\gcc_dll
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-5.3.0-posix-dwarf-rt_v4-rev0\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-3.1.0",
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 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.0)
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 <basedir>\wxWidgets-3.1.0\include\wx\msw\setup.h to enable GDI+
- search for the line "# define wxUSE_GRAPHICS_CONTEXT 0"
- change it to "# define wxUSE_GRAPHICS_CONTEXT 1"
- save the file
2) 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-3.1.0\lib\vc_dll\mswu\wx\setup.h and <basedir>\wxWidgets-3.1.0\lib\vc_dll\mswud\wx\setup.h.
3) 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-3.1.0\build\msw\vc_mswuddll
- <basedir>\wxWidgets-3.1.0\build\msw\vc_mswudll
4) Open the project <basedir>\wxWidgets-3.1.0\build\msw\wx_vc14.sln
5) 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