OSX - Folder structure for static libraries in module


#1

Hi there,
I can’t figure out where to put debug and release versions of my static library inside a module in OSX. In Windows I used the proposed folder structure VisualStudio{year}/{arch}/{run-time} and everything works fine (for example: libs/VisualStudio2017/x64/MT/ and …/MTd/ respectively).
In OSX I’ve tried:

  • libs/MacOSX/x86_64/Debug/ and …/Release/
  • libs/MacOSX/x86_64/MT/ and …/MTd/
  • naming the libraries differently, e.g. libmylibrary.a and libmylibrary-d.a - then in the header I added both using OSXLibs: mylibrary, mylibrary-d

Do I need to configure this manually in Projucer?
Thanks!


#2

From JUCE Module Format.txt:

OS X:
libs/MacOSX/{arch}, where {arch} is the architecture you are targeting in Xcode (“x86_64” or
“i386”, for example).

There is no Debug/Release subfolder.


#3

I’ve read the documentation of course…
My question remains: How does XCode know which library to use for debug and release configuration when using a module?


#4

Sorry, I wasn’t clear enough. There is no official way to distinguish between Debug and Release in the precompiled libraries included in a module.

However, you might be able to hack something for Xcode using the $(CONFIGURATION) setting. Basically name your binaries libmylibrary-Debug.a and libmylibrary-Release.a and then in the module header write OSXLibs: libmylibrary-$(CONFIGURATION). It might work.


#5

thanks! I’ll give that a try!


#6

Unless things have changed recently I’m fairly sure that using environment variables in the module description doesn’t work however it’s a reasonable request as is the ability to specify debug and release libs. In the previous place I worked we had made a change to the Projucer that included supporting environment variables, from what I remember it wasn’t a particularly difficult change - although there might have been edge cases we hadn’t considered.


#7

yepp, as you already thought that didn’t work…
Will move this to requests, I don’t really get why this is not bothering anyone else?