🔨 [2.0.9.7] Use older chitu_crypt.py
[Marlin.git] / ini / native.ini
blob1905559fd06052f7d60195fd1939e138f6e91bac
2 # Marlin Firmware
3 # PlatformIO Configuration File
6 #################################
7 # #
8 # Native / Simulation #
9 # #
10 #################################
13 # No supported Arduino libraries, base Marlin only
15 [env:linux_native]
16 platform = native
17 framework =
18 build_flags = -D__PLAT_LINUX__ -std=gnu++17 -ggdb -g -lrt -lpthread -D__MARLIN_FIRMWARE__ -Wno-expansion-to-defined
19 build_src_flags = -Wall -IMarlin/src/HAL/LINUX/include
20 build_unflags = -Wall
21 lib_ldf_mode = off
22 lib_deps =
23 build_src_filter = ${common.default_src_filter} +<src/HAL/LINUX>
26 # Native Simulation
27 # Builds with a small subset of available features
28 # Required system libraries: SDL2, SDL2-net, OpenGL, GLM
30 # Tested with Linux (Mint 20) : gcc [9.3.0, 10.2.0]: libsdl2-dev[2.0.10], libsdl2-net-dev[2.0.1], libglm-dev[0.9.9.7, 0.9.9.8]
32 # For VSCode debugging see buildroot/share/PlatformIO/debugging/launch.json
34 [simulator_common]
35 platform = native
36 framework =
37 build_flags = ${common.build_flags} -std=gnu++17 -D__PLAT_NATIVE_SIM__ -DU8G_HAL_LINKS -I/usr/include/SDL2 -IMarlin -IMarlin/src/HAL/NATIVE_SIM/u8g
38 build_src_flags = -Wall -Wno-expansion-to-defined -Wcast-align
39 release_flags = -g0 -O3 -flto
40 debug_build_flags = -fstack-protector-strong -g -g3 -ggdb
41 lib_compat_mode = off
42 build_src_filter = ${common.default_src_filter} +<src/HAL/NATIVE_SIM>
43 lib_deps = ${common.lib_deps}
44 MarlinSimUI=https://github.com/p3p/MarlinSimUI/archive/refs/heads/bugfix-2.0.x.zip
45 Adafruit NeoPixel=https://github.com/p3p/Adafruit_NeoPixel/archive/marlin_sim_native.zip
46 LiquidCrystal=https://github.com/p3p/LiquidCrystal/archive/master.zip
47 extra_scripts = ${common.extra_scripts}
48 pre:buildroot/share/PlatformIO/scripts/simulator.py
50 [simulator_linux]
51 extends = simulator_common
52 build_flags = ${simulator_common.build_flags} -ldl -lpthread -lSDL2 -lSDL2_net -lGL
54 [env:simulator_linux_debug]
55 extends = simulator_linux
56 build_type = debug
58 [env:simulator_linux_release]
59 extends = simulator_linux
60 build_type = release
61 build_flags = ${simulator_linux.build_flags} ${simulator_linux.release_flags}
64 # Simulator for macOS (MacPorts)
68 # MacPorts:
69 # sudo port install gcc11 glm libsdl2 libsdl2_net
71 # cd /opt/local/bin
72 # sudo rm -f gcc g++ cc
73 # sudo ln -s gcc-mp-11 gcc ; sudo ln -s g++-mp-11 g++ ; sudo ln -s g++ cc
74 # cd -
75 # rehash
77 # Use 'sudo port install mesa' to get a <GL/gl.h> if no Xcode is installed.
78 # If Xcode is installed be sure to run `xcode-select --install` first.
80 #==================================================================================
82 # Homebrew:
83 # /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
85 # brew install gcc@12 glm sdl2 sdl2_net
87 # cd /opt/homebrew/bin
88 # sudo rm -f gcc g++ cc
89 # sudo ln -s gcc-12 gcc ; sudo ln -s g++-12 g++ ; sudo ln -s g++ cc
90 # cd -
92 # Use 'brew install mesa' to get a <GL/gl.h> if no Xcode is installed.
93 # If Xcode is installed be sure to run `xcode-select --install` first.
96 [simulator_macos]
97 build_unflags = -lGL -fstack-protector-strong
98 build_flags =
99 -I/opt/local/include
100 -I/opt/local/include/freetype2
101 -I/opt/local/include/SDL2/
102 -L/opt/local/lib
103 -Wl,-framework,OpenGl
104 -Wl,-framework,CoreFoundation
105 -lSDL2
106 -fno-stack-protector
108 [env:simulator_macos_debug]
109 extends = env:simulator_linux_debug
110 build_flags = ${env:simulator_linux_debug.build_flags} ${simulator_macos.build_flags} -ggdb -Og -D_THREAD_SAFE
111 build_unflags = ${simulator_macos.build_unflags}
112 custom_verbose = 0
113 custom_gcc = g++
115 [env:simulator_macos_release]
116 extends = env:simulator_linux_release
117 build_flags = ${env:simulator_linux_release.build_flags} ${simulator_macos.build_flags}
118 build_unflags = ${simulator_macos.build_unflags}
119 custom_verbose = 0
120 custom_gcc = g++
123 # Simulator for Windows 10
125 # MSYS2 mingw-w64-x86_64 with these packages:
126 # pacman -S --needed base-devel mingw-w64-x86_64-toolchain mingw64/mingw-w64-x86_64-glm mingw64/mingw-w64-x86_64-SDL2 mingw64/mingw-w64-x86_64-SDL2_net mingw-w64-x86_64-dlfcn
128 [env:simulator_windows]
129 extends = simulator_common
130 build_src_flags = ${simulator_common.build_src_flags} -fpermissive
131 build_flags = ${simulator_common.build_flags} ${simulator_common.debug_build_flags} -IC:\\msys64\\mingw64\\include\\SDL2 -fno-stack-protector -Wl,-subsystem,windows -ldl -lmingw32 -lSDL2main -lSDL2 -lSDL2_net -lopengl32 -lssp
132 build_type = debug