Skip to content

Commit

Permalink
fixed output directory
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobias Gysi committed Dec 18, 2019
1 parent 97a8574 commit d3e8aa7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
9 changes: 8 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ set(MLIR_MAIN_SRC_DIR ${LLVM_INCLUDE_DIR}) # --src-root
set(MLIR_INCLUDE_DIR ${LLVM_INCLUDE_DIR}) # --includedir
set(MLIR_TABLEGEN_EXE mlir-tblgen)

# set the output directories
set( LLVM_RUNTIME_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/bin )
set( LLVM_LIBRARY_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/lib )

# import llvm functionality
list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_DIR}")
include(AddLLVM)
Expand All @@ -28,14 +32,17 @@ function(mlir_tablegen ofn)
endfunction()

function(whole_archive_link target)
set(link_flags "-L${LLVM_LIBRARY_DIR} -Wl,--whole-archive,")
set(link_flags "-L${LLVM_LIBRARY_DIR} -L${CMAKE_BINARY_DIR}/lib -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")
set_target_properties(${target} PROPERTIES LINK_FLAGS ${link_flags})
endfunction(whole_archive_link)

message("llvm library dir")
message(${LLVM_LIBRARY_DIR})

add_subdirectory(include/)
add_subdirectory(lib/)
#add_subdirectory(test/)
Expand Down
2 changes: 1 addition & 1 deletion lib/Conversion/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
add_subdirectory(StencilToStandard)
#add_subdirectory(StencilToStandard)
4 changes: 1 addition & 3 deletions oec-opt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,4 @@ add_llvm_executable(oec-opt
)
llvm_update_compile_flags(oec-opt)
whole_archive_link(oec-opt ${LIBS})
target_link_libraries(oec-opt PRIVATE MLIRIR MLIRMlirOptLib ${LIBS} LLVMSupport)
target_link_directories(oec-opt PRIVATE ${PROJECT_BINARY_DIR}/lib/Dialect/Stencil)
target_link_directories(oec-opt PRIVATE ${PROJECT_BINARY_DIR}/lib/Conversion/StencilToStandard)
target_link_libraries(oec-opt PRIVATE MLIRIR MLIRMlirOptLib ${LIBS} LLVMSupport)

0 comments on commit d3e8aa7

Please sign in to comment.