# HG changeset patch # User koda # Date 1370993416 -7200 # Node ID 4788b24fee05ff838b94c2b85b026adae9bd1be1 # Parent abce6011f86c474bcb529bf6b64e63059077bd37 since shared libs are now our friends, let's optimise them diff -r abce6011f86c -r 4788b24fee05 cmake_modules/compilerchecks.cmake --- a/cmake_modules/compilerchecks.cmake Wed Jun 12 01:26:42 2013 +0200 +++ b/cmake_modules/compilerchecks.cmake Wed Jun 12 01:30:16 2013 +0200 @@ -72,6 +72,14 @@ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_REQUIRED_FLAGS}") endif() +#this is actually an optimisation +set(CMAKE_REQUIRED_FLAGS "-Wl,--as-needed") +check_c_compiler_flag("" HAVE_ASNEEDED) +if(HAVE_ASNEEDED) + list(APPEND pascal_flags "-k--as-needed") + list(APPEND haskell_flags "-optl" "--as-needed") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_REQUIRED_FLAGS}") +endif() #always unset or these flags will be spread everywhere unset(CMAKE_REQUIRED_FLAGS)