# TODO: This is to handle the current static registration, but should be
# factored out a bit.
function(whole_archive_link target)
- set(link_flags "-Llib -Wl,--whole-archive,")
- FOREACH(LIB ${ARGN})
- string(CONCAT link_flags ${link_flags} "-l${LIB},")
- ENDFOREACH(LIB)
- string(CONCAT link_flags ${link_flags} "--no-whole-archive")
+ if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
+ set(link_flags "-Llib -Wl,-all_load ")
+ FOREACH(LIB ${ARGN})
+ string(CONCAT link_flags ${link_flags} "-l${LIB} ")
+ ENDFOREACH(LIB)
+ else()
+ set(link_flags "-Llib -Wl,--whole-archive,")
+ FOREACH(LIB ${ARGN})
+ string(CONCAT link_flags ${link_flags} "-l${LIB},")
+ ENDFOREACH(LIB)
+ string(CONCAT link_flags ${link_flags} "--no-whole-archive")
+ endif()
set_target_properties(${target} PROPERTIES LINK_FLAGS ${link_flags})
endfunction(whole_archive_link)
(*tileSizes)[i] = tSize;
else
// Set last tile size to cover the balance.
- (*tileSizes)[i] = std::max(1UL, excessFactor / cumulProductOfTileSizes);
+ (*tileSizes)[i] = std::max(
+ 1U, static_cast<unsigned>(excessFactor / cumulProductOfTileSizes));
cumulProductOfTileSizes *= (*tileSizes)[i];
}
if (avoidMaxMinBounds)
add_executable(mlir-cpu-runner
mlir-cpu-runner.cpp
)
-
+llvm_update_compile_flags(mlir-cpu-runner)
whole_archive_link(mlir-cpu-runner MLIRLLVMIR MLIRStandardOps MLIRTargetLLVMIR MLIRTransforms MLIRTranslation)
target_link_libraries(mlir-cpu-runner MLIRIR ${LIBS})
add_executable(mlir-translate
mlir-translate.cpp
)
-
+llvm_update_compile_flags(mlir-translate)
whole_archive_link(mlir-translate ${LIBS})
target_link_libraries(mlir-translate MLIRIR ${LIBS} LLVMSupport)