ARudik / gamekit

Automatically exported from code.google.com/p/gamekit
0 stars 0 forks source link

Wrong dependency paths for iOS build #252

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. check out latest (r1119) gamekit code. 
2. follow build instructions on gamekit wiki to generate xcode project.
3. open xcode project to build target (iPhoneDemo).

What is the expected output? What do you see instead?
iPhoneDemo should run after build but instead, xcode reports a linker error 
near the end due to wrong dependency paths for two libraries: fbtFile and 
bfBlend. I've also seen this issue in older commits for the last a few months.

What version of the product are you using? On what operating system?
OS X 10.6.8
xcode 4.2

Please provide any additional information below.

Here are steps to fix the paths in xcode but this should ideally be fixed in 
cmake scripts somewhere:

1. select Target: IPhoneDemo
goto Build Settings => Linking => Other Linker Flags
Open the Debug line and insert the string in square bracket (similarly for 
other build configurations MinSizeRel RelWithDebInfo and Release):
/your/path/to/project/gamekit-read-only-r1119/FileTools/File/[bin$(EFFECTIVE_PLA
TFORM_NAME)]/Debug/libfbtFile.a
/your/path/to/project/gamekit-read-only-r1119/FileTools/FileFormats/Blend/[bin$(
EFFECTIVE_PLATFORM_NAME)]/Debug/libbfBlend.a

2. select Target: fbtFile
goto Build Settings => Build Locations => Per-configuration Build Products Path
change
    $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
to
    $(BUILD_DIR)/bin$(EFFECTIVE_PLATFORM_NAME)/$(CONFIGURATION)

3. repeat Step 2 for the target bfBlend.

Original issue reported on code.google.com by afterb...@gmail.com on 25 Jul 2012 at 8:24

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Hmm,..what cmake-version do you use? Seems that this platform-stuff was 
introduced in 2.8.6. The problem wiht iOS at the moment is that noone of the 
active commiters do have an iOS-system, so it is really hard to maintain this. 
Nevertheless I found this:

http://cmake.3232098.n2.nabble.com/Specifying-library-build-path-for-simulator-a
nd-device-for-an-iOS-target-in-Xcode-td6985862.html

Can you try to add:
set(CMAKE_XCODE_EFFECTIVE_PLATFORMS "-iphoneos;-iphonesimulator")
in following files:
[gamekit]/CMake/ConfigOgreKit.cmake Line 158
[gamekit]/CMake/ConfigIPhone.cmake Line 7

And:
config_target_if_iphone_build(fbtFile  TRUE)
in:
[gamekit]/Tools/FileTools/File/CMakeLists.txt last line

And:
config_target_if_iphone_build(bfBlend  TRUE)
In:
[gamekit]/Tools/FileTools/FileFormats/Blend/CMakeLists.txt last line

I couldn't test this, so I keep my fingers crossed. Would be great if you could 
test this and report back.

Thx for reporting

Original comment by thomas.t...@googlemail.com on 25 Jul 2012 at 10:21

GoogleCodeExporter commented 9 years ago

Original comment by thomas.t...@googlemail.com on 25 Jul 2012 at 10:21

GoogleCodeExporter commented 9 years ago
Ok, i commited a patch that should fix the issue. Plz, get the latest trunk 
version and try again. 

http://code.google.com/p/gamekit/source/detail?r=1120

ps: just saw that in the commit-description I have a typo in your username. 
Argh, sry about that.

Original comment by thomas.t...@googlemail.com on 25 Jul 2012 at 6:03

GoogleCodeExporter commented 9 years ago
Sorry I haven't got a chance to try anything until now. The new commit works! 
Thank Thomas for the prompt fix. 

I use cmake 2.8.8. 

All the iOS/OSX users reading this: we really should donate some money (maybe 
$20 each) to buy a mac for our main committers. Otherwise, this platform won't 
be so well supported. It's a little surprising not to see a lot active iOS 
developers to use gamekit (as opposed to android developers), who can also 
contribute to gamekit, given the iPad/iPhone's popularity. I got this 
impression after browsing gamekit.org. Maybe I'm wrong. I just got started to 
learn gamekit. 

Original comment by afterb...@gmail.com on 26 Jul 2012 at 5:36

GoogleCodeExporter commented 9 years ago
The new build worked for iphone simulator, but when I build for an actual 
iphone, there is another error:

#error The C preprocessor macro ARM_NEON_GCC_COMPATIBILITY must be defined. 
Pass -DARM_NEON_GCC_COMPATIBILITY=1 to the compiler.

I don't know if this can also be fixed in cmake files. In fact, I don't even 
know how to fix this inside the xcode project myself. At least I'm running out 
of time today for this. Any clues are very much appreciated.

Original comment by afterb...@gmail.com on 26 Jul 2012 at 7:54

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Hmm... again without testing:

go to gamekit/CMake/ConfigIPhone.cmake line4:
add_definitions(-DARM_NEON_GCC_COMPATIBILITY=1)

this should add the compile-flag to any lib that gets compiled in the iPhone 
project. Or lets say it different, any lib that calls 
"config_target_if_iphone_build(..)" in its CMakeLists.txt (you know the one 
call that missed for bfBlend and file)

Hopefully it works...

Original comment by thomas.t...@googlemail.com on 26 Jul 2012 at 9:25

GoogleCodeExporter commented 9 years ago
Hmm,..ok that is something bullet-related. Maybe erwin can help here out. The 
problem happens in btScalar.h line 177. Actually I'm not sure when to set 
ARM_NEON_GCC_COMPATIBILITY to 0 and when to 1.

Original comment by thomas.t...@googlemail.com on 26 Jul 2012 at 11:53

GoogleCodeExporter commented 9 years ago
I was able to kind of overcome this ARM_NEON_GCC_COMPATIBILITY issue. But not 
in a sufficent way. But I managed to compile it, by manually adding the 
-DARM_NEON_GCC_COMPATIBILITY=1 to the other c++ flags. This works, but only 
when the architecture is set to only support armv7. Apparently armv7 has NEON 
enabled by default and thus it works. armv6 does not and I did not yet find out 
how to enable it. 

Original comment by underd...@gmail.com on 26 Jul 2012 at 3:20

GoogleCodeExporter commented 9 years ago
Ok, since bullet is an external library with its own CMake-Files it won't be 
accessed by ConfigIPhone.cmake. So add_definitions(...) would have to be set in 
LinearMath's CMakelists.txt. But actually I'm not sure if that flag is meant to 
be set externaly.  I haven't that much time to dig deeper into that for now

Original comment by thomas.t...@googlemail.com on 26 Jul 2012 at 3:41