cmake_modules/utils.cmake
changeset 9220 5e7db24f3489
parent 8688 88a6114a318c
child 9224 bce8cf41d666
--- a/cmake_modules/utils.cmake	Thu Jun 13 14:44:28 2013 +0200
+++ b/cmake_modules/utils.cmake	Thu Jun 13 15:37:52 2013 +0200
@@ -25,6 +25,13 @@
     endif(NOT ${_VAR_NAME})
 endmacro(find_package_or_disable_msg _PKG_NAME _VAR_NAME _MSG)
 
+macro(append_linker_flag _FLAG)
+    list(APPEND pascal_flags "-k${_FLAG}")
+    list(APPEND haskell_flags "-optl" "${_FLAG}")
+    set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,${_FLAG}")
+    set(CMAKE_SHARED_LIBRARY_C_FLAGS "${CMAKE_SHARED_LIBRARY_C_FLAGS} -Wl,${_FLAG}")
+    set(CMAKE_SHARED_LIBRARY_CXX_FLAGS "${CMAKE_SHARED_LIBRARY_CXX_FLAGS} -Wl,${_FLAG}")
+endmacro(append_linker_flag _FLAG)
 
 #TODO: find_package_or_bundle