Code Monkey home page Code Monkey logo

Comments (5)

SNKWiz avatar SNKWiz commented on June 20, 2024

In OSX makefile the SDL Framewwork standard path must be added to rpath in PLATFORM_LDFLAGS.

PLATFORM_LDFLAGS = $(SDL_LIBS) -lz -lm -lstdc++ -F/Library/Frameworks/ -Wl,-rpath,@executable_path/../Frameworks -Wl,-rpath,~/Library/Frameworks -Wl,-rpath,/Library/Frameworks

from supermodel.

trzy avatar trzy commented on June 20, 2024

The UNIX Makefile has this:

SDL2_CFLAGS = `sdl2-config --cflags`
SDL2_LIBS = `sdl2-config --libs`

Have you tried this solution for macOS? Would it possibly resolve this issue? Here's what happens when I run it on my system:

(base) Barts-MBP:argpt-for-ios bart$ sdl2-config --libs
-L/opt/homebrew/lib -lSDL2
(base) Barts-MBP:argpt-for-ios bart$ sdl2-config --cflags
-I/opt/homebrew/include/SDL2 -D_THREAD_SAFE
(base) Barts-MBP:argpt-for-ios bart$ 

from supermodel.

trzy avatar trzy commented on June 20, 2024

SDL2 and zlib are really our only external dependencies. I would strongly prefer to make this work with a clever Makefile before going nuclear (cmake, ninja, etc.). One advantage of macOS and Linux is that you have a guarantee of a more functional shell to work with than on Windows, where I typically build using Command Prompt (but use bash on Windows for the build bot that uploads builds to supermodel3.com).

I feel like it should be quite possible to work with this. If I understand correctly, the issue is that the SDL2 path differs depending on whether it was installed with brew or manually. The sdl2-config script is provided by SDL2 to help here. If that doesn't work, don't we essentially have two possibilities, making it potentially possible to write a shell or even a native Makefile command to test for one or the other?

from supermodel.

SNKWiz avatar SNKWiz commented on June 20, 2024

No nuclear things needed.. This has nothing to do with homebrew. On a Mac SDL/SDL2 can be either installed manually or with brew. Independent of this, it's about where frameworks/libraries are stored on a Mac. The correct place is either "~/Library/Frameworks" or "/Library/Frameworks". So simply add these two path to the rpath variable in PLATFORM_LDFLAGS in the OSX makefile.

Once compiled with this change, supermodel will work for every Mac user.

from supermodel.

h0tw1r3 avatar h0tw1r3 commented on June 20, 2024

No nuclear things needed.. This has nothing to do with homebrew. On a Mac SDL/SDL2 can be either installed manually or with brew. Independent of this, it's about where frameworks/libraries are stored on a Mac. The correct place is either "~/Library/Frameworks" or "/Library/Frameworks". So simply add these two path to the rpath variable in PLATFORM_LDFLAGS in the OSX makefile.

Once compiled with this change, supermodel will work for every Mac user.

Doesn't it have a little bit to do with homebrew? Frameworks are linked differently than standard shared libraries.

PLATFORM_LDFLAGS = $(SDL_LIBS) -lz -lm -lstdc++ -F/Library/Frameworks/ -Wl,-rpath,@executable_path/../Frameworks -Wl,-rpath,~/Library/Frameworks -Wl,-rpath,/Library/Frameworks

One word of caution for anyone seeing this, the home directory (tilde) in ~/Library/Frameworks is expanded by the shell before it is added to the rpath list in the binary. Also, typically you'll need to add the requisite -F flag for each path.

from supermodel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.