File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change 1
1
cmake_minimum_required (VERSION 3.10 )
2
2
3
+ include (CheckCXXSourceCompiles )
4
+
3
5
if (POLICY CMP0068 )
4
6
cmake_policy (SET CMP0068 NEW )
5
7
set (CMAKE_BUILD_WITH_INSTALL_NAME_DIR ON )
@@ -55,6 +57,21 @@ else ()
55
57
include_directories (${POLYGEIST_TABLEGEN_OUTPUT_DIR} )
56
58
endif ()
57
59
60
+ function (append value )
61
+ foreach (variable ${ARGN} )
62
+ set (${variable} "${${variable} } ${value} " PARENT_SCOPE )
63
+ endforeach (variable )
64
+ endfunction ()
65
+
66
+ if ( POLYGEIST_USE_LINKER )
67
+ append ("-fuse-ld=${POLYGEIST_USE_LINKER} "
68
+ CMAKE_EXE_LINKER_FLAGS CMAKE_MODULE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS )
69
+ check_cxx_source_compiles ("int main() { return 0; }" CXX_SUPPORTS_CUSTOM_LINKER )
70
+ if ( NOT CXX_SUPPORTS_CUSTOM_LINKER )
71
+ message (FATAL_ERROR "Host compiler does not support '-fuse-ld=${LLVM_USE_LINKER} '" )
72
+ endif ()
73
+ endif ()
74
+
58
75
list (APPEND CMAKE_MODULE_PATH "${MLIR_CMAKE_DIR} " )
59
76
list (APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_DIR} " )
60
77
list (APPEND CMAKE_MODULE_PATH "${CLANG_CMAKE_DIR} " )
You can’t perform that action at this time.
0 commit comments