Skip to content
This repository was archived by the owner on Feb 5, 2019. It is now read-only.

Commit e44c13d

Browse files
committed
Merging r309483:
------------------------------------------------------------------------ r309483 | mgorny | 2017-07-29 01:10:24 -0700 (Sat, 29 Jul 2017) | 7 lines [OCaml] Pass -D/-UNDEBUG through to ocamlc Detect [/-][DU]NDEBUG in CMAKE_C_FLAGS* and pass them through to ocamlc. This is necessary because their value might affect visibility of dump functions in LLVM and ocamlc uses its own compiler and flags by default. Differential Revision: https://reviews.llvm.org/D35898 ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_50@309591 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 9399b84 commit e44c13d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

cmake/modules/AddOCaml.cmake

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,11 @@ function(add_ocaml_library name)
8787
foreach( include_dir ${LLVM_INCLUDE_DIR} ${LLVM_MAIN_INCLUDE_DIR} )
8888
set(c_flags "${c_flags} -I${include_dir}")
8989
endforeach()
90+
# include -D/-UNDEBUG to match dump function visibility
91+
# regex from HandleLLVMOptions.cmake
92+
string(REGEX MATCH "(^| )[/-][UD] *NDEBUG($| )" flag_matches
93+
"${CMAKE_C_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${CMAKE_C_FLAGS}")
94+
set(c_flags "${c_flags} ${flag_matches}")
9095

9196
foreach( ocaml_file ${ARG_OCAML} )
9297
list(APPEND sources "${ocaml_file}.mli" "${ocaml_file}.ml")

0 commit comments

Comments
 (0)