diff options
-rw-r--r-- | CMakeLists.txt | 2 | ||||
-rw-r--r-- | README.md | 35 |
2 files changed, 31 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 9e105f02..b71be6ab 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
@@ -10,7 +10,7 @@ | |||
10 | # Windows for compiling everything, but the_Foundation still lacks | 10 | # Windows for compiling everything, but the_Foundation still lacks |
11 | # native Win32 implementations for the Socket and Process classes. | 11 | # native Win32 implementations for the Socket and Process classes. |
12 | # - Windows builds should use the SDL 2 library precompiled for native | 12 | # - Windows builds should use the SDL 2 library precompiled for native |
13 | # Windows (MSVC variant) instead the version from MSYS2 (get it from | 13 | # Windows (MSVC variant) instead of the version from MSYS2 (get it from |
14 | # https://libsdl.org/). To make configuration easier, consider writing | 14 | # https://libsdl.org/). To make configuration easier, consider writing |
15 | # for your personal use a pkg-config sdl2.pc file that uses the Windows | 15 | # for your personal use a pkg-config sdl2.pc file that uses the Windows |
16 | # version of the library. | 16 | # version of the library. |
@@ -42,19 +42,44 @@ To install to "/dest/path": | |||
42 | 42 | ||
43 | This will also install an XDG .desktop file for launching the app. | 43 | This will also install an XDG .desktop file for launching the app. |
44 | 44 | ||
45 | ### macOS-specific notes | 45 | ### Compiling on macOS |
46 | 46 | ||
47 | When using OpenSSL 1.1.1 from Homebrew, you must add its pkgconfig path to your `PKG_CONFIG_PATH` environment variable, for example: | 47 | When using OpenSSL 1.1.1 from Homebrew, you must add its pkgconfig path to your `PKG_CONFIG_PATH` environment variable, for example: |
48 | 48 | ||
49 | export PKG_CONFIG_PATH=/usr/local/Cellar/openssl@1.1/1.1.1g/lib/pkgconfig | 49 | export PKG_CONFIG_PATH=/usr/local/Cellar/openssl@1.1/1.1.1h/lib/pkgconfig |
50 | 50 | ||
51 | Also, SDL's trackpad scrolling behavior on macOS is not optimal for regular GUI apps because it emulates a physical mouse wheel. This may change in a future release of SDL, but at least in 2.0.12 a [small patch](https://git.skyjake.fi/skyjake/lagrange/raw/branch/dev/sdl2-macos-mouse-scrolling-patch.diff) is required to allow momentum scrolling to come through as single-pixel mouse wheel events. | 51 | Also, SDL's trackpad scrolling behavior on macOS is not optimal for regular GUI apps because it emulates a physical mouse wheel. This may change in a future release of SDL, but at least in 2.0.12 a [small patch](https://git.skyjake.fi/skyjake/lagrange/raw/branch/dev/sdl2-macos-mouse-scrolling-patch.diff) is required to allow momentum scrolling to come through as single-pixel mouse wheel events. Note that SDL comes with an Xcode project; use the "Shared Library" target and check that you are doing a Release build. |
52 | 52 | ||
53 | ### Raspberry Pi notes | 53 | ### Compiling on Windows |
54 | |||
55 | Windows builds require [MSYS2](https://www.msys2.org). In theory, [Clang](https://clang.llvm.org/docs/MSVCCompatibility.html) or GCC (on [MinGW](http://mingw.org)) could be set up natively on Windows for compiling everything, but the_Foundation still lacks native Win32 implementations for the Socket and Process classes and these are required by Lagrange. | ||
56 | |||
57 | You should use the SDL 2 library precompiled for native Windows (the MSVC variant) instead of the version from MSYS2 or MinGW. You can download a copy of the SDL binaries from https://libsdl.org/. To make configuration easier in your MSYS2 environment, consider writing a custom sdl2.pc file so `pkg-config` can automatically find the correct version of SDL. Below is an example of what your sdl2.pc might look like: | ||
58 | |||
59 | ``` | ||
60 | prefix=/c/SDK/SDL2-2.0.12/ | ||
61 | arch=x64 | ||
62 | libdir=${prefix}/lib/${arch}/ | ||
63 | incdir=${prefix}/include/ | ||
64 | |||
65 | Name: sdl2 | ||
66 | Description: Simple DirectMedia Layer | ||
67 | Version: 2.0.12-msvc | ||
68 | Libs: ${libdir}/SDL2.dll -mwindows | ||
69 | Cflags: -I${incdir} | ||
70 | ``` | ||
71 | |||
72 | The *-mwindows* option is particularly important as that specifies the target is a GUI application. Also note that you are linking directly against the Windows DLL — do not use any prebuilt .lib files if available, as those as specific to MSVC. | ||
73 | |||
74 | `pkg-config` will find your .pc file if it is on `PKG_CONFIG_PATH` or you place it in a system-wide pkgconfig directory. | ||
75 | |||
76 | Once you have compiled a working binary under MSYS2, there is still an additional step required to allow running it directly from the Windows shell: the shared libraries from MSYS2 must be found either via `PATH` or by copying them to the same directory where `lagrange.exe` is located. | ||
77 | |||
78 | ### Compiling on Raspberry Pi | ||
54 | 79 | ||
55 | You should use a version of SDL that is compiled to take advantage of the Broadcom VideoCore OpenGL ES hardware. This provides the best performance when running Lagrange in a console. | 80 | You should use a version of SDL that is compiled to take advantage of the Broadcom VideoCore OpenGL ES hardware. This provides the best performance when running Lagrange in a console. |
56 | 81 | ||
57 | When running under X11, software rendering is the best choice and in that case the SDL from Raspbian etc. is sufficient. | 82 | At present time, OpenGL under X11 on Raspberry Pi is still quite slow/experimental. When running under X11, software rendering is the best choice and the SDL from Raspbian etc. is sufficient. |
58 | 83 | ||
59 | The following build options are recommended on Raspberry Pi: | 84 | The following build options are recommended on Raspberry Pi: |
60 | 85 | ||