summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorizimuth <ian.smithian@gmail.com>2024-01-14 09:50:07 -0800
committerJussi Pakkanen <jpakkane@gmail.com>2024-01-15 20:22:04 +0200
commit1c852f0a985f2daa42ca209008eebcd7a42fb58e (patch)
treebe5c5ebe287207dd55364c6fc4c1ac974540c998
parentae857e841b0a6b9b595583e74f5e21676bb83f9d (diff)
downloadmeson-1c852f0a985f2daa42ca209008eebcd7a42fb58e.tar.gz
Add a note for Windows users to GuiTutorial.md
When compiling on Windows using MSVC, you also need to link the SDL2main.lib file. I've added a note to the GuiTutorial.md file to mention this.
-rw-r--r--docs/markdown/GuiTutorial.md14
1 files changed, 14 insertions, 0 deletions
diff --git a/docs/markdown/GuiTutorial.md b/docs/markdown/GuiTutorial.md
index 85930d7dc..568246060 100644
--- a/docs/markdown/GuiTutorial.md
+++ b/docs/markdown/GuiTutorial.md
@@ -170,6 +170,20 @@ executable('sdlprog', 'sdlprog.c',
dependencies: sdl2_dep)
```
+**NOTE:** If you're on Windows you need to include the sdl2main dependency as well; To do so you can modify the above build script like so:
+
+```meson
+project('sdldemo', 'c',
+ default_options: 'default_library=static')
+
+sdl2_dep = dependency('sdl2')
+sdl2_main_dep = dependency('sdl2main')
+
+executable('sdlprog', 'sdlprog.c',
+ win_subsystem: 'windows',
+ dependencies: [sdl2_dep, sdl2_main_dep])
+```
+
In addition to the dependency this has a few other changes. First we
specify that we want to build helper libraries statically. For simple
projects like these it makes things simpler. We also need to tell