Successfully building SDL3 is a pain
This commit is contained in:
parent
61f3235277
commit
0fb4821b37
6 changed files with 11 additions and 4 deletions
1
.gitmodules
vendored
1
.gitmodules
vendored
|
@ -4,4 +4,3 @@
|
|||
[submodule "submodules/SDL"]
|
||||
path = submodules/SDL
|
||||
url = https://github.com/libsdl-org/SDL.git
|
||||
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
cmake_minimum_required(VERSION 3.30)
|
||||
|
||||
# This assumes the SDL source is available in vendored/SDL
|
||||
add_subdirectory(submodules/SDL EXCLUDE_FROM_ALL)
|
||||
|
||||
# This assumes the SDL_ttf source is available in vendored/SDL_ttf
|
||||
add_subdirectory(submodules/SDL_ttf EXCLUDE_FROM_ALL)
|
||||
|
||||
project(SDL_FPSCounter C)
|
||||
|
||||
add_subdirectory(src/)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
add_library(SDL_FPSCounter STATIC SDL_FPSCounter.c)
|
||||
|
||||
add_executable(fps-counter WIN32 main.c)
|
||||
target_link_libraries(fps-counter SDL_FPSCounter SDL3 SDL3_ttf)
|
||||
target_link_libraries(fps-counter PRIVATE SDL_FPSCounter SDL3_ttf::SDL3_ttf SDL3::SDL3)
|
||||
|
|
|
@ -44,8 +44,8 @@ int main(int argc, char* argv[])
|
|||
(void) argv;
|
||||
|
||||
SDL_Init( SDL_INIT_VIDEO | SDL_INIT_EVENTS);
|
||||
if (TTF_Init()) {
|
||||
fprintf(stderr, "Initializing SDL2_ttf failed: %s\n", SDL_GetError());
|
||||
if (!TTF_Init()) {
|
||||
fprintf(stderr, "Initializing SDL3_ttf failed: %s\n", SDL_GetError());
|
||||
}
|
||||
|
||||
SDL_Window* window = SDL_CreateWindow(
|
||||
|
|
1
submodules/SDL
Submodule
1
submodules/SDL
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit 7ab1412e208e8fca12f99caae665de61e9fcf5a6
|
1
submodules/SDL_ttf
Submodule
1
submodules/SDL_ttf
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit aaab1b9e98e8bbca572064ceb23f0fd916b2add5
|
Loading…
Reference in a new issue