summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorArtem Belevich <tra@google.com>2016-06-21 23:10:37 +0000
committerArtem Belevich <tra@google.com>2016-06-21 23:10:37 +0000
commit38ae857b162884ccd7b16933967bdf7a634e6006 (patch)
tree5e0a09a2a60d3c570d9f839ef8b180700612e067 /cmake
parentb24e29e8a8ca0ce246634ddc1b7978ddb53cba17 (diff)
[build] Fixed build break for OCaml bindings.
After r273302 LLVM_SYSTEM_LIBS may have entries that already have -l prefix and we need to deal with that. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273333 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake')
-rw-r--r--cmake/modules/AddOCaml.cmake8
1 files changed, 7 insertions, 1 deletions
diff --git a/cmake/modules/AddOCaml.cmake b/cmake/modules/AddOCaml.cmake
index 8b33332d07b..e3dd1d84077 100644
--- a/cmake/modules/AddOCaml.cmake
+++ b/cmake/modules/AddOCaml.cmake
@@ -73,7 +73,13 @@ function(add_ocaml_library name)
get_property(system_libs TARGET LLVMSupport PROPERTY LLVM_SYSTEM_LIBS)
foreach(system_lib ${system_libs})
- list(APPEND ocaml_flags "-l${system_lib}" )
+ if (system_lib MATCHES "^-")
+ # If it's an option, pass it without changes.
+ list(APPEND ocaml_flags "${system_lib}" )
+ else()
+ # Otherwise assume it's a library name we need to link with.
+ list(APPEND ocaml_flags "-l${system_lib}" )
+ endif()
endforeach()
string(REPLACE ";" " " ARG_CFLAGS "${ARG_CFLAGS}")