Can't build OCMockLib target in 4.1 or 4.2 on Lion

Discussion of the OCMock framework. If you have patches we would prefer you to send them to the mailing list, but attaching them to a topic is possible, too.

Can't build OCMockLib target in 4.1 or 4.2 on Lion

Postby chrispix » 08 Sep 2011, 01:36

I recently updated to the new github repo and tried to build the latest OCMock. It fails with the following error:

Code: Select all
lipo: can't open input file: /Users/cpickslay/projects/ocmock/Source/build/-iphoneos/libOCMock.a (No such file or directory)
cp: /Users/cpickslay/projects/ocmock/Source/build/-iphoneos/Headers: No such file or directory


The problem seems to be that the $BUILD_STYLE environment variable is not set. Sure enough, the build output includes:

Code: Select all
    setenv BUILD_ROOT /Users/cpickslay/projects/ocmock/Source/build
    setenv BUILD_STYLE
    setenv BUILD_VARIANTS normal


Anyone else seeing this?
It should be set to the type of build you're doing (e.g., Release or Debug). It's not clear to me why Xcode doesn't set it, but I see the same thing in both 4.1 and 4.2 on Lion. I was able to fix it by just hard-coding "Debug" into the script:

Code: Select all
# make a new output folder
mkdir -p "${BUILD_DIR}/Debug/Library"
 
# combine lib files for device and simulator platforms into one
lipo -create "${BUILD_DIR}/Debug-iphoneos/libOCMock.a" "${BUILD_DIR}/Debug-iphonesimulator/libOCMock.a" -output "${TARGET_BUILD_DIR}/Library/libOCMock.a"

# copy the headers (we could have used a copy files build phase, too)
cp -R "${BUILD_DIR}/Debug-iphoneos/Headers" "${TARGET_BUILD_DIR}/Library"
chrispix
 
Posts: 7
Joined: 07 May 2010, 19:32

Re: Can't build OCMockLib target in 4.1 or 4.2 on Lion

Postby mattdipasquale » 22 Sep 2011, 16:07

I made a fork that works with Xcode 4.2. https://github.com/acani/ocmock

I also sent Erik a pull request. https://github.com/erikdoe/ocmock/pull/1 He said he'd check it out soon.
mattdipasquale
 


Return to OCMock



cron