Skip to content

Commit

Permalink
Fix FTBFS with --as-needed linker option
Browse files Browse the repository at this point in the history
Libraries must be placed after object files in command line.
More information: https://bugs.gentoo.org/show_bug.cgi?id=445814
  • Loading branch information
randomaction authored and dacap committed Jan 2, 2013
1 parent f113dd2 commit 8fb637c
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/CMakeLists.txt
Expand Up @@ -135,6 +135,10 @@ endif()
# All libraries for .exe files
set(all_libs ${aseprite_libraries} ${libs3rdparty} ${sys_libs})

if(LIBALLEGRO4_LINK_FLAGS)
set(all_libs ${all_libs} ${LIBALLEGRO4_LINK_FLAGS})
endif()

######################################################################
# ASEPRITE libraries

Expand Down Expand Up @@ -405,10 +409,6 @@ endif(UNIX)

add_executable(aseprite WIN32 main.cpp ${win32_resources} ${x11_resources})
target_link_libraries(aseprite ${all_libs})
if(LIBALLEGRO4_LINK_FLAGS)
set_target_properties(aseprite
PROPERTIES LINK_FLAGS ${LIBALLEGRO4_LINK_FLAGS})
endif()

install(TARGETS aseprite
RUNTIME DESTINATION bin)
Expand Down Expand Up @@ -445,8 +445,7 @@ function(find_unittests dir dependencies)
add_executable(${testname} ${testsourcefile})
target_link_libraries(${testname} gtest ${ARGV})
if(LIBALLEGRO4_LINK_FLAGS)
set_target_properties(${testname}
PROPERTIES LINK_FLAGS ${LIBALLEGRO4_LINK_FLAGS})
target_link_libraries(${testname} ${LIBALLEGRO4_LINK_FLAGS})
endif()

if(extra_definitions)
Expand Down

0 comments on commit 8fb637c

Please sign in to comment.