Thanks, Mark.
On Tue, May 7, 2013 at 12:44 PM, Mark Mentovai <
ma...@chromium.org> wrote:
> 1. It’s totally weird for gyp/tests.gyp to include pathops_unittest.gypi in
> the context it includes it, within a target.
>
What's the preferred method? Defining the source list as a variable
in the gypi, including it at the top of the file and expanding the
variable in the source list?
> 2. Although you’re making skia_base_libs.gyp:skia_base_libs into a
> shared_library, your tests.gyp:tests target still depends on
> flags.gyp:flags, a static_library, which in turn depends on core.gyp:core,
> also a static_library, and one that’s included in the
> skia_base_libs.gyp:skia_base_libs shared_library. Now you have a path from
> tests to core both as a static library and as part of a shared library.
> There are probably other relationships like this one, I stopped hunting as
> soon as I found the first one. In order for this project to work, you need
> to prevent executables from reaching around your new shared library into the
> static libraries that it’s made up of.
>
Indeed, I didn't realize that those dependency chains still existed.
I removed them all, including dependencies of the skia_base_libs on
each other, which was probably overkill. Patch set 7 of
https://codereview.chromium.org/14582008/. Now the skia_base_libs
static libs aren't included in the linker input, but I'm still getting
lots of undefined symbols, all coming from the shared library. I must
be missing some flag to LD?
Ld ../xcodebuild/Debug/tests normal i386
cd /usr/local/google/skia/trunk/gyp
setenv MACOSX_DEPLOYMENT_TARGET 10.7
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++
-arch i386 -isysroot
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk
-L/usr/local/google/skia/trunk/gyp/../xcodebuild/Debug
-F/usr/local/google/skia/trunk/gyp/../xcodebuild/Debug -filelist
/usr/local/google/skia/trunk/gyp/../xcodebuild/tests.build/Debug/tests.build/Objects-normal/i386/tests.LinkFileList
-mmacosx-version-min=10.7
/usr/local/google/skia/trunk/xcodebuild/Debug/libskia.dylib
/usr/local/google/skia/trunk/xcodebuild/Debug/libflags.a
/usr/local/google/skia/trunk/xcodebuild/Debug/libexperimental.a
/usr/local/google/skia/trunk/xcodebuild/Debug/libskia_pdf.a
/usr/local/google/skia/trunk/xcodebuild/Debug/libpicture_utils.a
/usr/local/google/skia/trunk/xcodebuild/Debug/libzlib.a -lz -o
/usr/local/google/skia/trunk/gyp/../xcodebuild/Debug/tests
Undefined symbols for architecture i386:
"_SetCurveBounds", referenced from:
PathOpsBoundsTest(skiatest::Reporter*) in PathOpsBoundsTest.o
"SkFixedMod(int, int)", referenced from:
TestMath(skiatest::Reporter*) in MathTest.o
......
$ nm xcodebuild/Debug/libskia.dylib | grep _SetCurveBounds
004badf0 d _SetCurveBounds
$ nm xcodebuild/Debug/libskia.dylib | grep SkFixedMod
000aebf0 t __Z10SkFixedModii