Skip to content

Commit 8d5ade8

Browse files
authored
[mlir] enable APFloatWrappers on MacOS (#172070)
1 parent 8f26458 commit 8d5ade8

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

mlir/lib/ExecutionEngine/CMakeLists.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,8 @@ if(LLVM_ENABLE_PIC)
168168
set_property(TARGET mlir_float16_utils PROPERTY CXX_STANDARD 17)
169169
target_compile_definitions(mlir_float16_utils PRIVATE mlir_float16_utils_EXPORTS)
170170

171-
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
172-
# TODO: This support library is only used on Linux builds until we figure
171+
if(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "Darwin")
172+
# TODO: This support library is only used on Linux and Mac builds until we figure
173173
# out how to hide LLVM symbols in a way that works for all platforms.
174174
add_mlir_library(mlir_apfloat_wrappers
175175
SHARED
@@ -185,7 +185,7 @@ if(LLVM_ENABLE_PIC)
185185
)
186186
target_compile_definitions(mlir_apfloat_wrappers PRIVATE mlir_apfloat_wrappers_EXPORTS)
187187
# Hide LLVM symbols to avoid ODR violations.
188-
target_link_options(mlir_apfloat_wrappers PRIVATE "-Wl,--exclude-libs,ALL")
188+
target_link_options(mlir_apfloat_wrappers PRIVATE $<$<PLATFORM_ID:Linux>:LINKER:--exclude-libs,ALL>)
189189
endif()
190190

191191
add_subdirectory(SparseTensor)
@@ -205,8 +205,8 @@ if(LLVM_ENABLE_PIC)
205205
set_property(TARGET mlir_c_runner_utils PROPERTY CXX_STANDARD 17)
206206
target_compile_definitions(mlir_c_runner_utils PRIVATE mlir_c_runner_utils_EXPORTS)
207207

208-
# Conditionally link apfloat wrappers only on Linux.
209-
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
208+
# Conditionally link apfloat wrappers only on Linux and Mac.
209+
if(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "Darwin")
210210
target_link_libraries(mlir_c_runner_utils PUBLIC mlir_apfloat_wrappers)
211211
endif()
212212

mlir/test/Integration/Dialect/Arith/CPU/test-apfloat-emulation-vector.mlir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// REQUIRES: system-linux
1+
// REQUIRES: system-linux || system-darwin
22
// TODO: Run only on Linux until we figure out how to build
33
// mlir_apfloat_wrappers in a platform-independent way.
44

mlir/test/Integration/Dialect/Arith/CPU/test-apfloat-emulation.mlir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// REQUIRES: system-linux
1+
// REQUIRES: system-linux || system-darwin
22
// TODO: Run only on Linux until we figure out how to build
33
// mlir_apfloat_wrappers in a platform-independent way.
44

mlir/test/lit.cfg.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,8 @@ def find_real_python_interpreter():
214214
"not",
215215
]
216216

217-
if "Linux" in config.host_os:
218-
# TODO: Run only on Linux until we figure out how to build
217+
if "Linux" in config.host_os or "Darwin" in config.host_os:
218+
# TODO: Run only on Linux and Mac until we figure out how to build
219219
# mlir_apfloat_wrappers in a platform-independent way.
220220
tools.extend([add_runtime("mlir_apfloat_wrappers")])
221221

0 commit comments

Comments
 (0)