From: Lucas Nussbaum Date: Tue, 13 Sep 2011 21:20:21 +0000 (+0200) Subject: Move library after the source due to changes in ld X-Git-Tag: v3_6_2~97 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/772b9175568d56fc6aa873c5215274cf3ae39b15 Move library after the source due to changes in ld Due to changes in ld introduced in Ubuntu oneiric (ld --as-needed by default), it is now required to order libraries on the ld command line so that they are only listed *after* the other files that require them. --- diff --git a/buildtools/Cmake/CompleteInFiles.cmake b/buildtools/Cmake/CompleteInFiles.cmake index d251d515ab..4179edfbc5 100644 --- a/buildtools/Cmake/CompleteInFiles.cmake +++ b/buildtools/Cmake/CompleteInFiles.cmake @@ -211,7 +211,7 @@ if(pthread) ### Test that we have a way to create semaphores if(HAVE_SEM_OPEN_LIB) - exec_program("${CMAKE_C_COMPILER} -lpthread ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/test_prog/prog_sem_open.c -o testprog" + exec_program("${CMAKE_C_COMPILER} ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/test_prog/prog_sem_open.c -lpthread -o testprog" OUTPUT_VARIABLE HAVE_SEM_OPEN_run) if(HAVE_SEM_OPEN_run) set(HAVE_SEM_OPEN 0) @@ -230,7 +230,7 @@ if(pthread) endif(HAVE_SEM_OPEN_LIB) if(HAVE_SEM_INIT_LIB) - exec_program("${CMAKE_C_COMPILER} -lpthread ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/test_prog/prog_sem_init.c -o testprog" + exec_program("${CMAKE_C_COMPILER} ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/test_prog/prog_sem_init.c -lpthread -o testprog" OUTPUT_VARIABLE HAVE_SEM_INIT_run) if(HAVE_SEM_INIT_run) set(HAVE_SEM_INIT 0)