summaryrefslogtreecommitdiff
path: root/cmake/modules/AddOCaml.cmake
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2016-07-23 20:41:05 +0000
committerDimitry Andric <dim@FreeBSD.org>2016-07-23 20:41:05 +0000
commit01095a5d43bbfde13731688ddcf6048ebb8b7721 (patch)
tree4def12e759965de927d963ac65840d663ef9d1ea /cmake/modules/AddOCaml.cmake
parentf0f4822ed4b66e3579e92a89f368f8fb860e218e (diff)
Diffstat (limited to 'cmake/modules/AddOCaml.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 8b33332d07bcd..e3dd1d840772c 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}")