libsdl-org/SDL_ttf

SDL3::SDL3-static (for Static SDL 3 compilation)

cnlohr opened this issue · 2 comments

cnlohr commented

I am compiling against a static SDL3, and struggling to find the correct configuration to enable static SDL3 compilation with SDL_ttf.

Neither of these work:

cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DSDL3TTF_VENDORED=ON -DSDL3TTF_HARFBUZZ=ON -DCMAKE_PREFIX_PATH={redacted} -DSDL3TTF_SAMPLES=OFF -DBUILD_SHARED_LIBS=OFF ..
cmake -DCMAKE_PREFIX_PATH={redacted} -DSDL3IMAGE_SAMPLES=OFF -DBUILD_SHARED_LIBS=OFF ..

I get the following error:

-- Configuring SDL3_ttf 3.0.0
-- SDL3_ttf: Using vendored harfbuzz library
WARNHarfBuzz has a Meson port and tries to migrate all the other build systems to it, please consider using it as we might remove our cmake port soon.
-- SDL3_ttf: Using vendored freetype library
-- Configuring done
CMake Error at CMakeLists.txt:123 (target_link_libraries):
  Target "SDL3_ttf" links to:

    SDL3::SDL3-static

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.



-- Generating done
CMake Generate step failed.  Build files cannot be regenerated correctly.

SDL3 was configured with the default CMake flags.

We have overriding issues that prevent us from dynamically linking on this system.

Any ideas how how to configure SDL_image to use a static SDL3?

madebr commented

SDL3 was configured with the default CMake flags.

By default, SDL3 will only build a shared SDL3 library.
You need to configure SDL3 with -DSDL_STATIC=ON for having a static library too.

cnlohr commented

Bingo! Thank you! That worked!