Browse Source

Use static link objects for safer builds

This requires the lastest cakelisp version.

I did this specifically to fix DataBundle files getting stale easily.
task-system-completables
Macoy Madson 2 years ago
parent
commit
eb9651e3d2
  1. 2
      src/Aubio.cake
  2. 2
      src/DataBundle.cake
  3. 2
      src/ImGui.cake
  4. 2
      src/OpenGL.cake
  5. 4
      src/SDL.cake
  6. 3
      test/src/Config_Linux.cake
  7. 4
      test/src/GameLibTests.cake

2
src/Aubio.cake

@ -116,4 +116,4 @@
(add-c-search-directory-module "Dependencies/aubio/src")
(add-linker-options "Dependencies/aubio/build/src/libaubio.a")
(add-static-link-objects "Dependencies/aubio/build/src/libaubio.a")

2
src/DataBundle.cake

@ -105,7 +105,7 @@
cache-filename (sizeof cache-filename))
(return false))
(call-on push_back (path module > compilerLinkOptions) cache-filename)
(call-on push_back (field manager environment additionalStaticLinkObjects) cache-filename)
;; Don't re-package the resource if unchanged
(unless (fileIsMoreRecentlyModified (call-on c_str filename) cache-filename)

2
src/ImGui.cake

@ -254,7 +254,7 @@
('Unix
(add-library-dependency "GL" "dl"))
('Windows
(add-linker-options "opengl32.lib"))))
(add-static-link-objects "opengl32.lib"))))
(add-cpp-build-dependency "imgui.cpp"
"imgui_demo.cpp"

2
src/OpenGL.cake

@ -163,7 +163,7 @@ void main()\n
('Unix
(add-library-dependency "GL" "dl"))
('Windows
(add-linker-options "opengl32.lib")))
(add-static-link-objects "opengl32.lib")))
;; Most OpenGL loading libraries were not to my tastes. I decided on galogen
;; (http://galogen.gpfault.net/) because it's only two C++ files (not python or something else) and

4
src/SDL.cake

@ -330,7 +330,7 @@ Note that you can also build SDL manually. This can be useful if you are porting
(comptime-cond
('Windows
(add-library-search-directory "Dependencies/SDL/VisualC/x64/Debug")
(add-linker-options "SDL2main.lib" "SDL2.lib"))
(add-static-link-objects "SDL2main.lib" "SDL2.lib"))
;; (add-library-runtime-search-directory "Dependencies/SDL/VisualC/x64/Debug" "."))
;; ('Unix ;; Dynamic link
;; (add-library-search-directory "Dependencies/SDL/buildSDLBuild/lib")
@ -339,7 +339,7 @@ Note that you can also build SDL manually. This can be useful if you are porting
;; (add-library-runtime-search-directory "Dependencies/SDL/buildSDLBuild/lib" "."))
('Unix ;; Static link
(add-compiler-link-options "-pthread")
(add-linker-options "Dependencies/SDL/buildSDLBuild/lib/libSDL2.a")))
(add-static-link-objects "Dependencies/SDL/buildSDLBuild/lib/libSDL2.a")))
(comptime-cond
('Windows ;; DLLs need to be in the same directory as the executable

3
test/src/Config_Linux.cake

@ -1,3 +1,6 @@
(set-cakelisp-option cakelisp-src-dir "Dependencies/cakelisp/src")
(add-cakelisp-search-directory "Dependencies/cakelisp/runtime")
(comptime-define-symbol 'Unix)
;; Building from test/, need to go up one into gamelib (a bit unusual)
(add-cakelisp-search-directory "../src")

4
test/src/GameLibTests.cake

@ -37,8 +37,8 @@
(true
"src/Config_Linux.cake")))
(var test-minimal bool true)
;; (var test-minimal bool false)
;; (var test-minimal bool true)
(var test-minimal bool false)
;; (var test-opengl-only bool true)
(var test-opengl-only bool false)

Loading…
Cancel
Save