• Home
  • Raw
  • Download

Lines Matching +full:default +full:- +full:build

6 build applications that use GLFW, see @ref build_guide.
16 compile_deps and @ref compile_options sections for GLFW-specific information.
25 If you are on a Unix-like system such as Linux, FreeBSD or Cygwin or have
31 [CMake user guide][cmake-guide] that includes everything in this guide not
34 [cmake-guide]: https://cmake.org/cmake/help/latest/guide/user-interaction/
40 all necessary dependencies for compiling GLFW, but on Unix-like systems like
46 By default, both the Wayland and X11 backends are enabled on Linux and other Unix-like
48 or @ref GLFW_BUILD_X11 CMake options in the next step when generating build files.
52 None of the development packages above are needed to build or run programs that use an
55 On Debian and derivatives like Ubuntu and Linux Mint you will need the `libwayland-dev`
56 and `libxkbcommon-dev` packages to compile for Wayland and the `xorg-dev` meta-package to
60 sudo apt install libwayland-dev libxkbcommon-dev xorg-dev
63 On Fedora and derivatives like Red Hat you will need the `wayland-devel` and
64 `libxkbcommon-devel` packages to compile for Wayland and the `libXcursor-devel`,
65 `libXi-devel`, `libXinerama-devel` and `libXrandr-devel` packages to compile for X11.
69 sudo dnf install wayland-devel libxkbcommon-devel libXcursor-devel libXi-devel libXinerama-devel li…
72 On FreeBSD you will need the `wayland`, `libxkbcommon` and `evdev-proto` packages to
73 compile for Wayland. The X11 headers are installed along the end-user X11 packages, so if
78 pkg install wayland libxkbcommon evdev-proto xorgproto
81 On Cygwin Wayland is not supported but you will need the `libXcursor-devel`,
82 `libXi-devel`, `libXinerama-devel`, `libXrandr-devel` and `libXrender-devel` packages to
89 ### Generating build files with CMake {#compile_generate}
95 - the path to the root directory of the GLFW source tree (not its `src`
97 - the path to the directory where the generated build files and compiled
100 If these are the same, it is called an in-tree build, otherwise it is called an
101 out-of-tree build.
103 Out-of-tree builds are recommended as they avoid cluttering up the source tree.
104 They also allow you to have several build directories for different
107 A common pattern when building a single configuration is to have a build
108 directory named `build` in the root of the source tree.
113 Start the CMake GUI and set the paths to the source and build directories
120 By default, GLFW will use Wayland and X11 on Linux and other Unix-like systems other than
129 #### Generating with command-line CMake {#compile_generate_cli}
131 To make a build directory, pass the source and build directories to the `cmake`
132 command. These can be relative or absolute paths. The build directory is
136 cmake -S path/to/glfw -B path/to/build
139 It is common to name the build directory `build` and place it in the root of the
140 source tree when only planning to build a single configuration.
144 cmake -S . -B build
148 and makefiles on other platforms. You can choose other targets using the `-G`
152 cmake -S path/to/glfw -B path/to/build -G Xcode
155 By default, GLFW will use Wayland and X11 on Linux and other Unix-like systems other than
160 cmake -S path/to/glfw -B path/to/build -D GLFW_BUILD_X11=0
173 With Visual Studio open `GLFW.sln` and use the Build menu. With Xcode open
179 cd path/to/build
183 With MinGW, it is `mingw32-make`.
186 cd path/to/build
187 mingw32-make
190 Any CMake build directory can also be built with the `cmake` command and the
191 `--build` flag.
194 cmake --build path/to/build
197 This will run the platform specific build tool the directory was generated for.
199 Once the GLFW library is compiled you are ready to build your application,
210 from there. If you are using the command-line version of CMake you can use the
213 `cmake-curses-gui` package.
216 command-line with the `-D` flag.
219 cmake -S path/to/glfw -B path/to/build -D BUILD_SHARED_LIBS=ON
227 a DLL / shared library / dynamic library. This is disabled by default,
236 build GLFW as a static library, `SHARED` to build it as a shared library
241 along with the library. This is enabled by default unless GLFW is being built
246 built along with the library. This is enabled by default unless GLFW is being
251 with the library. This is enabled by default if
260 default.
265 DLL version of the Visual C++ library is used. This is enabled by default.
268 variable instead of this GLFW-specific option.
275 high-performance GPU on Nvidia Optimus and AMD PowerXpress systems. These symbols
277 will not work if GLFW is built as a DLL. This is disabled by default, letting
286 default.
289 ### Unix-like system specific CMake options {#compile_options_unix}
293 the library. This option is only available when compiling for Linux and other Unix-like
294 systems other than macOS. This is enabled by default.
298 library. This option is only available when compiling for Linux and other Unix-like
299 systems other than macOS. This is enabled by default.
302 ## Cross-compilation with CMake and MinGW {#compile_mingw_cross}
304 Both Cygwin and many Linux distributions have MinGW or MinGW-w64 packages. For
305 example, Cygwin has the `mingw64-i686-gcc` and `mingw64-x86_64-gcc` packages
306 for 32- and 64-bit version of MinGW-w64, while Debian GNU/Linux and derivatives
307 like Ubuntu have the `mingw-w64` package for both.
310 cross-compilation of Windows binaries. To use these files you set the
311 `CMAKE_TOOLCHAIN_FILE` CMake variable with the `-D` flag add an option when
312 configuring and generating the build files.
315 cmake -S path/to/glfw -B path/to/build -D CMAKE_TOOLCHAIN_FILE=path/to/file
319 MinGW-w64 binaries on your system. You can usually see this in the /usr
320 directory. For example, both the Ubuntu and Cygwin MinGW-w64 packages have
321 `/usr/x86_64-w64-mingw32` for the 64-bit compilers, so the correct invocation
325 cmake -S path/to/glfw -B path/to/build -D CMAKE_TOOLCHAIN_FILE=CMake/x86_64-w64-mingw32.cmake
329 passed to the `-S` flag, not to the current directory.
331 For more details see the [CMake toolchain guide][cmake-toolchains].
333 [cmake-toolchains]: https://cmake.org/cmake/help/latest/manual/cmake-toolchains.7.html
338 If you wish to compile GLFW without its CMake build environment then you will have to do
339 at least some platform-detection yourself. There are preprocessor macros for
341 platform-specific macros for various features.
344 on the command-line. The GLFW CMake files set these as private compile
351 - @b _GLFW_COCOA to use the Cocoa frameworks
352 - @b _GLFW_WIN32 to use the Win32 API
353 - @b _GLFW_WAYLAND to use the Wayland protocol
354 - @b _GLFW_X11 to use the X Window System
363 or GLESv2 library, you can override the default names by defining those you need
366 _GLFW_GLESV2_LIBRARY. Otherwise, GLFW will use the built-in default names.
369 GLFW. If you define any of these in your build files, make sure they are not