Build ReWire device (.bundle) for MacOS X in XCode


we are developing a cross platform application (Mac/Windows) with the juce framework and want to support ReWire. Our application shall be the audio generating part, the ‘device’ and ‘panel’ in ReWire terminology.
Under Windows the device must be compiled as a dynamic library (.dll). This works perfectly fine with the Projucer project type ‘Dynamic library’.
Our DLL is successfully loaded by the ReWire sample mixer application.
Under MacOS X the device must be compiled as a loadable bundle (.bundle). That’s the point where I’m stuck at the moment.
I was not able to compile and export a bundle from a XCode project generated by Projucer yet. I found this in the Juce forum:
This seems to be exactly what I need but the proposed solution did not work for me. I was able to compile the project but I wasn’t able to export/archive anything. The build does not show up in the organizer.

Did anybody build a ReWire device with a xcode project generated by the Projucer? Can anybody give me a hint how to configure the XCode project to build a bundle?

Thank you very much in advance!


Have you found any solution for this? or did you end up making the Xcode project manually?

I can’t remember exactly what I did since it is already some time ago. I think I followed the advice in the post from Anthony_Nicholls I linked above. Additionally I found those notes:

manual changes in bundle project:


XCode settings:
Strip Debug Symbols During Copy : No (Otherwise archive does not work)
Strip style : Non-global Symbols (not sure if this is necessary)
Dead code stripping : Release : Yes (may be already default)

Skip Install : No (Otherwise archived bundle does not show up in organizer)

Symbol visibility:
To keep generated binary small ‘Symbols hidden by Default’ in xcode settings must be set to ‘Yes’ for release builds.

Especially the “Strip Debug Symbols During Copy” setting worries me a bit but since I am not shipping the application at the moment I didn’t look for a better solution.
If you find a better solution I would be interested how you set up your project since mine is still work in progress.

If you’re still looking for a solution, I can recommend not doing it via XCode, but using CMake instead - you can create a CMake build script that creates both the bundle on macOS and the DLL on Windows, and it’s not overly complicated.

If you’re interested, please ask and I’ll gladly share my solution :slight_smile:

1 Like

Yes, I’m definitely interested!

I’ll send you a DM, since I’m not sure how much I can share publicly given the ReWire SDK’s proprietary license.

Yes, CMake is probably the way to go on this. I’d be interested to see your solution as well :wink:
Too bad the Projucer doesn’t support OSX bundles though…

You know what, screw it - I’ll share my solution here.
Note that this ReWire Device doesn’t use the JUCE library, so I don’t link it.

Here’s the CMake script I use to build the ReWire Device on Windows and Mac (may contain errors, I edited my script to remove some application-specific code):

cmake_minimum_required(VERSION 3.15)

project(MyReWireDevice VERSION 0.0.1)

# set preprocessor OS definitions required by ReWire
if (APPLE)
elseif (WIN32)
endif ()

# build the ReWireDevice bundle
# CHANGE THIS to list all the .cpp files that make up your ReWire Device
add_library(${PROJECT_NAME} MODULE

# CHANGE THIS to your location of the ReWireSDK
target_sources(${PROJECT_NAME} PRIVATE

# CHANGE THIS to the location of the ReWireSDK header fles in your project
target_include_directories(${PROJECT_NAME} PRIVATE external)

if (APPLE)
    # on OSX, the ReWire Device needs the Carbon framework
    find_library(CARBON Carbon)
    target_link_libraries(${PROJECT_NAME} ${CARBON})

    # CHANGE THIS to the location of the file
    configure_file(MyReWireDevice/ ${CMAKE_CURRENT_BINARY_DIR}/MyReWireDevice/Info.plist)

    # CHANGE the location of the generated Info.plist file to that you specified in the line above
    # CHANGE the location of the ExportList.exp to the one where your file lives
    set_target_properties(${PROJECT_NAME} PROPERTIES
            BUNDLE 1
            LINK_FLAGS "-Wl,-exported_symbols_list,\"${CMAKE_CURRENT_SOURCE_DIR}/MyReWireDevice/ExportList.exp\"")

elseif (WIN32)
    # on Windows, version.lib is needed
    target_link_libraries(${PROJECT_NAME} version.lib)
endif ()

This is the file I use:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">
  <string>${PLUGIN_NAME} ${FBSTRING_PLUGIN_VERSION}, ${FBSTRING_LegalCopyright}</string>

This is the ExportList.exp file I use:


On macOS, I build this using make, on Windows, I use the Visual Studio compiler from CMake directly.

Let me know if you need any help :slight_smile:

1 Like