diff --git a/.gitmodules b/.gitmodules index 56c6607..236c238 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,6 @@ [submodule "SDL"] - path = SDL + path = vendor/SDL url = https://github.com/libsdl-org/SDL.git [submodule "SDL_image"] - path = SDL_image + path = vendor/SDL_image url = https://github.com/libsdl-org/SDL_image.git diff --git a/build_sdl_and_friends.sh b/build_sdl_and_friends.sh index 11ab780..e49f006 100755 --- a/build_sdl_and_friends.sh +++ b/build_sdl_and_friends.sh @@ -1,4 +1,4 @@ -cd SDL +cd vendor/SDL cmake -S . -B build cmake --build build cd ../SDL_image diff --git a/lakefile.lean b/lakefile.lean index e3accb4..0b54dba 100644 --- a/lakefile.lean +++ b/lakefile.lean @@ -11,8 +11,8 @@ target sdl.o pkg : FilePath := do let srcJob ← sdl.c.fetch let oFile := pkg.buildDir / "c" / "sdl.o" let leanInclude := (<- getLeanIncludeDir).toString - let sdlInclude := "SDL/include/" - let sdlImageInclude := "SDL_image/include/" + let sdlInclude := "vendor/SDL/include/" + let sdlImageInclude := "vendor/SDL_image/include/" buildO oFile srcJob #[] #["-fPIC", s!"-I{sdlInclude}", s!"-I{sdlImageInclude}", "-D_REENTRANT", s!"-I{leanInclude}", s!"-I{sdlInclude}", s!"-I{sdlImageInclude}"] "cc" target libleansdl pkg : FilePath := do @@ -29,4 +29,5 @@ lean_lib Engine @[default_target] lean_exe LeanDoomed where root := `Main - moreLinkArgs := #["SDL/build/libSDL3.so", "SDL_image/build/libSDL3_image.so", "-Wl,--allow-shlib-undefined", "-Wl,-rpath=SDL/build/", "-Wl,-rpath=SDL_image/build/"] + -- we have to add the rpath to tell the compiler where all of the libraries are + moreLinkArgs := #["vendor/SDL/build/libSDL3.so", "vendor/SDL_image/build/libSDL3_image.so", "-Wl,--allow-shlib-undefined", "-Wl,-rpath=vendor/SDL/build/", "-Wl,-rpath=vendor/SDL_image/build/"] diff --git a/SDL b/vendor/SDL similarity index 100% rename from SDL rename to vendor/SDL diff --git a/SDL_image b/vendor/SDL_image similarity index 100% rename from SDL_image rename to vendor/SDL_image