jamoma / JamomaCore

Jamoma Frameworks for Audio and Control Structure
Other
36 stars 14 forks source link

Makefile difference prevents implementation of test.cpp in DSP #173

Closed nwolek closed 11 years ago

nwolek commented 11 years ago

I was trying to add a "test.cpp" file to the DSP subproject so that tests run within Xcode, similar to what has been done in Foundation on the branch "feature/dictionary-rewrite".

I found that the addition made the build fail because of what seems like an invalid path in the makefile. Here is the relevant line in the Foundation makefile:

if [ -f test.cpp ];   then rm -f build/test32; $(CC_32) test.cpp -std=c++11 -stdlib=libc++ -DTT_PLATFORM_MAC ${INCLUDES} build/lib$(NAME).a   -o build/test32 ; fi 

And the equivalent line in the DSP makefile:

if [ -f test.cpp ];   then rm -f build/test32; $(CC_32) test.cpp -std=c++11 -stdlib=libc++ -DTT_PLATFORM_MAC ${INCLUDES} build/lib$(NAME).a  ../../../DSP/library/build/libJamomaDSP.a -o build/test32 ; fi 

Note the extra variable that begins "../../../DSP/". It seems there is a error in the makefile generation system, but I don't know this well enough to fix it myself.

Perhaps @tap or others can help?

tap commented 11 years ago

That stuff gets written into the Makefile @ https://github.com/jamoma/JamomaCore/blob/feature/dictionary-rewrite/Shared/jamomalib.rb#L1754

tap commented 11 years ago

immediately above that the path is set with this:

    test_dependency_dsp = ""
    test_dependency_dsp = "../../../DSP/library/build/libJamomaDSP.a" if layer_name == "DSP"

It looks like the assumption is that this will be called for a project building an extension? So, if that's the case then we need an additional bit of "if" logic such that it produces a correct path here for the library.

nwolek commented 11 years ago

I suspect that #172 is related.

nwolek commented 11 years ago

Working on this today and have a question for @tap:

The test.cpp usage is intended only for the makefiles in Core right? Right now it looks like it is being written into the makefiles for the Max Implementations too. I see how to fix it in the Ruby script, but just want to confirm this assumption is right. Thanks.

nwolek commented 11 years ago

It's working now, so I am closing the issue. If @tap needs to correct my assumption above about not applying to Implementations, we can reopen.