-
Notifications
You must be signed in to change notification settings - Fork 1.3k
mbgl-test-runner fails to link in mapbox-gl-native-ios workspace #16259
Comments
UnitTestAppTests also fails to link unless I unset To reproduce, change this line to also pass in The tests don’t run on a device, probably due to this warning:
|
I think it is not an issue related to gl-native. If I run from mapbox-gl-native-ios project with the following script:
Then try to build the TestAPP with Xcode, there were no linking errors. As by default the linker flag is configured to linking to
and the actual build products will be inside However, if I run
I am not sure which one causes it, but I assume with above configuration, It reconfigured the build product path, which will cause the build lib relocating to |
When Mapbox GL Native.xcodeproj is run inside another workspace, these paths need to be modified to point to the same build products directory that other workspace products are put into. It normally works, but I’m not sure what’s causing the test/ to persist in the paths for test targets. |
This seems to be a limitation of CMake’s mapbox-gl-native/CMakeLists.txt Lines 1040 to 1042 in 1798bda
The mbgl build system currently relies on Of all the antipatterns in how CMake configures Xcode, its reliance on an inaccurate |
Might be related to this build-time warning:
|
@1ec5 I think setting |
Making a PR here for you to test |
Can you give this a try? |
/cc @ChrisLoer |
The mapbox/mapbox-gl-native-ios repository’s
make xproj
command generates a macos.xcworkspace that includes various gl-native targets, including mbgl-test-runner. mbgl-test-runner fails to build with the following linker errors:This is the Debug configuration, but the same errors occur in the other configurations.
To work around this issue, I modified the mbgl-test-runner target’s
OTHER_LDFLAGS
build setting to removetest/
from the paths of libmbgl-test.a and libmbgl-vendor-googletest.a. The other paths are already correct. This is a trivial change inside Xcode, but it doesn’t persist because mbgl relies on CMake to generate Xcode projects on the fly. I’m not sure what CMake magic is required to fix these paths.I think this issue would also affect any future iOS test runner that becomes buildable within Xcode. It’s very useful to be able to run these test runners as part of the overall map SDK workspace, so that we can more confidently make changes across repositories such as mapbox/mapbox-gl-native-ios#189 / #16253.
/ref #16253 (comment)
/cc @mapbox/gl-native @mapbox/maps-ios
The text was updated successfully, but these errors were encountered: