Skip to content

Commit

Permalink
Don't add xbmc.a to DIRECTORY_ARCHIVES
Browse files Browse the repository at this point in the history
It gets added to MAINOBJS anyways, and adding it to DIRECTORY_ARCHIVES
would mean that it also gets added to the tests, which would result
in a double-definition of main () (one from xbmc and one from gtest).

Instead, add it to xbmc.bin directly, as Darwin based platforms require
such static linking.
  • Loading branch information
smspillaz committed Jun 17, 2013
1 parent 3c85e97 commit 7e8e1c9
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,6 @@ DIRECTORY_ARCHIVES=$(DVDPLAYER_ARCHIVES) \
xbmc/windows/windows.a \
xbmc/xbmc.a \

ifneq (@USE_LIBXBMC@,1)
DIRECTORY_ARCHIVES +=xbmc/main/main.a
endif

NWAOBJSXBMC= xbmc/threads/threads.a \
xbmc/commons/commons.a

Expand Down Expand Up @@ -462,7 +458,7 @@ else
$(SILENT_LD) $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared -o $@ $(MAINOBJS) -Wl,--start-group $(DYNOBJSXBMC) $(OBJSXBMC) -Wl,--end-group -Wl,--no-undefined $(NWAOBJSXBMC) $(LIBS)
endif

xbmc.bin: $(OBJSXBMC) $(DYNOBJSXBMC) $(NWAOBJSXBMC) $(MAINOBJS)
xbmc.bin: $(OBJSXBMC) $(DYNOBJSXBMC) $(NWAOBJSXBMC) $(MAINOBJS) xbmc/main/main.a

ifeq ($(findstring osx,@ARCH@), osx)
$(SILENT_LD) $(CXX) $(LDFLAGS) -o xbmc.bin -Wl,-all_load,-ObjC $(DYNOBJSXBMC) $(NWAOBJSXBMC) $(OBJSXBMC) $(LIBS) -rdynamic
Expand Down

3 comments on commit 7e8e1c9

@Memphiz
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This broke xbmc.bin linkage on osx. MAINOBJS isn't used there and if it was used it would be incomplete (missing xbmc/main/osx/SDLMain.o) ... unsure how to do it right atm...

@t-nelson
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cmake :)

@Memphiz
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if done in cmake that way it would be the same mess ...

Please sign in to comment.