aboutsummaryrefslogtreecommitdiff
path: root/cmake/modules
diff options
context:
space:
mode:
authorMichal Gorny <mgorny@gentoo.org>2017-07-27 21:13:19 +0000
committerMichal Gorny <mgorny@gentoo.org>2017-07-27 21:13:19 +0000
commitd62ee98c2730e0f5fc00711c7225c8ab9ba83423 (patch)
treeb7650727cb6692430e83510e7af5eddff7824029 /cmake/modules
parentb8776242df510ab3662a9719c66d79b01f63a3af (diff)
downloadllvm-d62ee98c2730e0f5fc00711c7225c8ab9ba83423.tar.gz
[OCaml] Respect CMAKE_C_FLAGS for OCaml C files
Pass the values of CMAKE_C_FLAGS and CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE} as -ccopt to ocamlc. This enforces the specific flags used for the LLVM build to be used for OCaml bindings as well, notably -O and -march flags. This also solves the issue of the user being unable to force specific flags for OCaml bindings builds. Gentoo needs this to enforce -DNDEBUG consistently between the LLVM build and the split OCaml bindings build. Differential Revision: https://reviews.llvm.org/D35898 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309320 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake/modules')
-rw-r--r--cmake/modules/AddOCaml.cmake2
1 files changed, 1 insertions, 1 deletions
diff --git a/cmake/modules/AddOCaml.cmake b/cmake/modules/AddOCaml.cmake
index 1b805c0710a..c691550d51c 100644
--- a/cmake/modules/AddOCaml.cmake
+++ b/cmake/modules/AddOCaml.cmake
@@ -83,7 +83,7 @@ function(add_ocaml_library name)
endforeach()
string(REPLACE ";" " " ARG_CFLAGS "${ARG_CFLAGS}")
- set(c_flags "${ARG_CFLAGS} ${LLVM_DEFINITIONS}")
+ set(c_flags "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${ARG_CFLAGS} ${LLVM_DEFINITIONS}")
foreach( include_dir ${LLVM_INCLUDE_DIR} ${LLVM_MAIN_INCLUDE_DIR} )
set(c_flags "${c_flags} -I${include_dir}")
endforeach()