Skip to content

Commit

Permalink
Update CMakeLists.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
makslevental committed Jan 31, 2025
1 parent 271c166 commit 328c177
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 7 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/build_test_release_eudsl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -406,9 +406,8 @@ jobs:
- name: "Install eudsl-llvmpy"
run: |
pip install mlir-python-bindings -f https://makslevental.github.io/wheels
python -m pip install pytest
python -m pip install eudsl-llvmpy -f wheelhouse
python -m pip install eudsl-llvmpy eudsl-tblgen -f wheelhouse
- name: "Test eudsl-llvmpy"
run: |
Expand Down
7 changes: 5 additions & 2 deletions projects/eudsl-llvmpy/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,14 @@ elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "arm64|aarch64")
endif()

if(APPLE)
target_link_directories(eudslllvm_ext_libs PRIVATE "${LLVM_LIBRARY_DIR}")
list(APPEND eudslllvm_ext_libs ${LLVM_AVAILABLE_LIBS})
list(REMOVE_ITEM eudslllvm_ext_libs Remarks LTO LLVM LLVMTableGen)
list(REMOVE_DUPLICATES eudslllvm_ext_libs)
target_link_directories(eudslllvm_ext PRIVATE "${LLVM_LIBRARY_DIR}")
list(TRANSFORM eudslllvm_ext_libs PREPEND "-Wl,-hidden-l")
endif()

target_link_libraries(eudslllvm_ext PRIVATE ${eudslllvm_ext_libs})

set_target_properties(eudslllvm_ext
PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${EUDSLLLVM_SRC_DIR}/llvm"
Expand Down
7 changes: 6 additions & 1 deletion projects/eudsl-llvmpy/tests/test_bindings.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@
from llvm.function import function
from llvm.instructions import add, ret
import llvm.amdgcn
from mlir import ir


def test_symbol_collision():
# noinspection PyUnresolvedReferences
import eudsl_tblgen


def test_smoke():
Expand Down Expand Up @@ -79,3 +83,4 @@ def sum(a: T.int32, b: T.int32, c: T.float) -> T.int32:
if __name__ == "__main__":
test_smoke()
test_builder()
test_symbol_collision()
12 changes: 10 additions & 2 deletions projects/eudsl-tblgen/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,16 @@ nanobind_add_module(eudsl_tblgen_ext NB_STATIC STABLE_ABI
src/TGParser.cpp
src/TGLexer.cpp
)
target_link_libraries(eudsl_tblgen_ext
PRIVATE LLVMTableGenCommon LLVMTableGen LLVMCore)
set(eudsl_tblgen_ext_libs LLVMTableGenCommon LLVMTableGen LLVMCore)
if(APPLE)
list(APPEND eudsl_tblgen_ext_libs ${LLVM_AVAILABLE_LIBS})
list(REMOVE_ITEM eudsl_tblgen_ext_libs Remarks LTO LLVM)
list(REMOVE_DUPLICATES eudsl_tblgen_ext_libs)
target_link_directories(eudsl_tblgen_ext PRIVATE "${LLVM_LIBRARY_DIR}")
list(TRANSFORM eudsl_tblgen_ext_libs PREPEND "-Wl,-hidden-l")
endif()
target_link_libraries(eudsl_tblgen_ext PRIVATE ${eudsl_tblgen_ext_libs})

set(nanobind_options
-Wno-cast-qual
-Wno-deprecated-literal-operator
Expand Down

0 comments on commit 328c177

Please sign in to comment.