3 # PlatformIO Configuration File
6 #################################
8 # Native / Simulation #
10 #################################
13 # No supported Arduino libraries, base Marlin only
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
23 build_src_filter = ${common.default_src_filter} +<src/HAL/LINUX>
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
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
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
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
58 [env:simulator_linux_release]
59 extends = simulator_linux
61 build_flags = ${simulator_linux.build_flags} ${simulator_linux.release_flags}
64 # Simulator for macOS (MacPorts)
69 # sudo port install gcc11 glm libsdl2 libsdl2_net
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
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 #==================================================================================
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
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.
97 build_unflags = -lGL -fstack-protector-strong
100 -I
/opt
/local
/include
/freetype2
101 -I
/opt
/local
/include
/SDL2
/
103 -Wl
,-framework
,OpenGl
104 -Wl
,-framework
,CoreFoundation
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}
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}
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