ios-cmake icon indicating copy to clipboard operation
ios-cmake copied to clipboard

Copy-if-different error while trying to build brainflow libraries using OS64COMBINED

Open ScottThomasMiller opened this issue 2 years ago • 1 comments

Hi! I am trying to build the brainflow libs using ios-cmake for OS64COMBINED, but I am getting the following error:

/bin/sh -c /Users/scottmiller/git/brainflow/build/brainflow.build/Release-iphoneos/MuseLib.build/Script-538A60576ABA9B7FDB978F8C.sh Error copying file (if different) from "/Users/scottmiller/git/brainflow/compiled/libMuseLib.dylib" to "/Users/scottmiller/git/brainflow/nodejs_package/brainflow/lib/libMuseLib.dylib". Command PhaseScriptExecution failed with a nonzero exit code

The dylib is being written to /Users/scottmiller/git/brainflow/compiled/Release/, not /Users/scottmiller/git/brainflow/compiled/.

Steps to reproduce:

mkdir -p ~/git
cd ~/git
rm -rf brainflow ios-cmake
git clone https://github.com/brainflow-dev/brainflow.git
git clone https://github.com/leetal/ios-cmake.git
cd brainflow
mkdir build
cd build
cmake .. -G Xcode -DCMAKE_TOOLCHAIN_FILE=~/git/ios-cmake/ios.toolchain.cmake -DPLATFORM="OS64COMBINED"
#to silence warnings about deployment targets:
sed -e "s|IPHONEOS_DEPLOYMENT_TARGET = 11.0|IPHONEOS_DEPLOYMENT_TARGET = 16.0|g" brainflow.xcodeproj/project.pbxproj > temp.txt
cp temp.txt brainflow.xcodeproj/project.pbxproj
cmake --build . --config Release -- CODE_SIGNING_ALLOWED=NO

Thanks!

ScottThomasMiller avatar Oct 15 '23 22:10 ScottThomasMiller

After some experimentation I found that if I open the generated project file in Xcode, and check the boxes next to "For install builds only" and "Based on dependency analysis" under Build Phases->CMake PostBuild Rules, then the errors go away.

Is that a good approach? If so, then is there any way to generate the project file with those options already checked?

ScottThomasMiller avatar Oct 16 '23 23:10 ScottThomasMiller