Forum
    • Categories
    • Register
    • Login

    Linking a pre-compiled static library with ThirdParty C++ nodes

    Scheduled Pinned Locked Moved Unsolved C++ Development
    4 Posts 2 Posters 65 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • HISEnbergH
      HISEnberg
      last edited by

      Mainly a question for @Christoph-Hart .

      I'm working on integrating a thirdparty DSP library (PointToPoint by Hack Audio) with the ThirdParty C++ nodes. The library is pretty simple - it's header only for the circuit definitions, but the core DSP is a precompiled static library (libCircuitModel.a on macOS, libCircuitModel.lib on Windows).

      I've gotten the nodes compiled and working, but my main issue is the linking workflow with the HISE compiler. Since it wipes the binaries folder, the AutogeneratedProject.jucer get's regnerated and my linker settings (a few modifications to the library search path and flag pointing to the libCircuitModel.a) get removed. So I either have to manually add them back or, edit the .jucer. What I am doing now using this edited batchCompileOSX.sh (attached below) and building out of XCode.

      I am just wondering if you have suggestions for a more persistent extra linker flag for the library paths across the different DLL recompiles? I'm thinking something like a config file the HISE can read before generating the .jucer? My system works but it's just a bit clunky right now. I want to open this up for other users so it would be nice to make it compatible with the HISE compiler.

      #!/bin/bash
      PATH="/usr/local/bin:$PATH"
      chmod +x "/Users/ernest/HISE/JUCE/Projucer/Projucer.app/Contents/MacOS/Projucer"
      cd "`dirname "$0"`"
      "/Users/ernest/HISE/JUCE/Projucer/Projucer.app/Contents/MacOS/Projucer" --resave AutogeneratedProject.jucer
      
      // Patch link to the PointToPoint Library
      XCPROJ="Builds/MacOSX/Hise-PointToPoint.xcodeproj/project.pbxproj"
      PTP_LIB="../../ThirdParty/src/PointToPoint/lib/Release/libCircuitModel.a"
      PTP_HDR="../../ThirdParty/src/PointToPoint"
      
      if [ -f "$XCPROJ" ]; then
          if ! grep -q "PointToPoint" "$XCPROJ"; then
              # Add header search paths
              sed -i '' "s|HEADER_SEARCH_PATHS = (|HEADER_SEARCH_PATHS = (\"$PTP_HDR\",|g" "$XCPROJ"
              
              # Add library search paths
              sed -i '' "s|LIBRARY_SEARCH_PATHS = (|LIBRARY_SEARCH_PATHS = (\"../../ThirdParty/src/PointToPoint/lib/Release\",|g" "$XCPROJ"
              
              # Add CircuitModel.a library
              sed -i '' "s|OTHER_LDFLAGS = (|OTHER_LDFLAGS = (\"-lCircuitModel\",|g" "$XCPROJ"
          fi
      fi
      # ============================================================
      
      set -o pipefail
      echo Compiling  Hise-PointToPoint ...
      xcodebuild -project "Builds/MacOSX/Hise-PointToPoint.xcodeproj" -configuration "Release" -jobs "8" | "/Users/ernest/HISE/tools/Projucer/xcbeautify"
      
      

      Sonic Architect && Software Mercenary

      HISEnbergH 1 Reply Last reply Reply Quote 0
      • HISEnbergH
        HISEnberg @HISEnberg
        last edited by

        Just a bump to see if anyone has a suggestion!

        Sonic Architect && Software Mercenary

        Christoph HartC 1 Reply Last reply Reply Quote 0
        • Christoph HartC
          Christoph Hart @HISEnberg
          last edited by

          @HISEnberg There are fields in the project settings that you can pass in static libraries - then you just need to place them in the AdditionalSourceCode folder and compile HISE - it should link both the network DLL and the plugin against the 3rd party static lib. Check the help text in the project settings. These are the fields:

          • Windows Static Lib Folder
          • OSXStaticLibs
          HISEnbergH 1 Reply Last reply Reply Quote 1
          • HISEnbergH
            HISEnberg @Christoph Hart
            last edited by

            @Christoph-Hart You are the best. I'll give this a try later on! Thank you as always.

            Sonic Architect && Software Mercenary

            1 Reply Last reply Reply Quote 0
            • First post
              Last post

            41

            Online

            2.2k

            Users

            13.5k

            Topics

            117.2k

            Posts