lovyan03 / LovyanGFX

SPI LCD graphics library for ESP32 (ESP-IDF/ArduinoESP32) / ESP8266 (ArduinoESP8266) / SAMD51(Seeed ArduinoSAMD51)
Other
1.02k stars 187 forks source link

Flag to disable SDL #501

Closed jp-bennett closed 3 months ago

jp-bennett commented 4 months ago

This is related to my previous work, #484 . I've discovered that when building our binary, if the SDL-devel packages are found, this library tries to include SDL support as well as arduino_default. Edit: Which breaks compilation, complaining about multiple definitions. It would be great to be able to define a build flag like LG_DISABLE_SDL so none of that code fires off.

lovyan03 commented 4 months ago

あなたの環境を知らないので何が問題なのか私にはわからない。 パッケージを含めなければ良いだけではないのですか?

jp-bennett commented 4 months ago

@lovyan03 It looks like this library is actively looking for the SDL package. The only way I could get working compilation is to uninstall the SDL2-devel package. Admittedly our environment is a bit odd.

I'll try to produce a working patch in the coming days to demonstrate what I mean.

lovyan03 commented 4 months ago

もう一度言いますが、私はあなたの環境がわからない OSは ? Windows ? macOS ? 開発環境は ? ArduinoIDE ? VSCode ?

基本的にマイコン用にビルドすることを想定しているので、 VSCode+PlatformIOやArduinoIDEなら何も問題は起きないはずです。 SDLがあることでなぜ困るのか状況がわかりません。

jp-bennett commented 4 months ago

Compiling on Linux, PlatformIO+VScode, using the Portduino framework to take PlatformIO code and produce a native binary.

Simple to replicate. Make sure the libsdl2-dev package is installed. (and libyaml-cpp-dev libgpiod-dev libbluetooth-dev) Grab the native-unity branch at https://github.com/meshtastic/firmware/tree/native-unity. In platformIO, select the native target, and build.

lovyan03 commented 4 months ago

あぁ、あなたは SDLではなくPortduino と組み合わせて使いたいのですね? つまり Nativeビルドを使用するが、 SDLは使わずに Portduinoで動かしたいんですね?

私はその情報をいま初めて聞いた。それが最も重要な前提情報です。

jp-bennett commented 4 months ago

Sorry to leave out that important detail. Yes, we are doing native builds, and talking to real SPI and I2C hardware. It wouldn't be a problem to also have SDL support, but that currently breaks compilation.

lovyan03 commented 4 months ago

I just found out about Portduino and thought it would be useful.

In that case, if you use the Native build, it would be convenient if you could run LovyanGFX on both Portduino and SDL. In my opinion, it is necessary to be able to use both at the same time depending on how the user code is written, rather than relying on compile switches.

For now, I'll look into Portduino.

lovyan03 commented 4 months ago

Portduinoを動かす方法が良くわからない。 前提条件がいろいろあるように思うが環境を整えるのが非常に面倒に思います

jp-bennett commented 4 months ago

It's a bit of a pain to use. https://github.com/meshtastic/platform-native is the intended way to do it. Though the easiest starting point for testing is Meshtastic.

lovyan03 commented 4 months ago

私はWindowsとmacOSを使っていますが、そもそもPortduinoがLinuxにしか対応していないように見えます。

lovyan03 commented 4 months ago

I updated the develop branch. This will exclude SDL from being built if the define constant ARDUINO exists.