Skip to content

Commit

Permalink
add flag to surpress apple's -bundle flag
Browse files Browse the repository at this point in the history
  • Loading branch information
ZuseZ4 committed Aug 1, 2024
1 parent 9d6a86b commit d04e0ee
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
1 change: 1 addition & 0 deletions enzyme/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ option(ENZYME_MLIR "Build enzyme mlir plugin" OFF)
option(ENZYME_IFX "Enable enzyme support for the Intel Fortran compiler IFX" OFF)
option(ENZYME_EXTERNAL_SHARED_LIB "Build external shared library" OFF)
option(ENZYME_STATIC_LIB "Build static library" OFF)
option(ENZYME_APPLE_RUST "Build for Apple Rust" OFF)
set(ENZYME_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
set(ENZYME_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
list(APPEND CMAKE_MODULE_PATH "${ENZYME_SOURCE_DIR}/cmake/modules")
Expand Down
18 changes: 12 additions & 6 deletions enzyme/Enzyme/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,18 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
list(APPEND ENZYME_SRC SCEV/ScalarEvolutionExpander.cpp)
list(APPEND ENZYME_SRC TypeAnalysis/TypeTree.cpp TypeAnalysis/TypeAnalysis.cpp TypeAnalysis/TypeAnalysisPrinter.cpp TypeAnalysis/RustDebugInfo.cpp)

if (ENZYME_RUST_APPLE)
set(BUILD_TYPE "SHARED")
else()
set(BUILD_TYPE "MODULE")
endif()

# on windows `PLUGIN_TOOL` doesn't link against LLVM.dll
if ((WIN32 OR CYGWIN) AND LLVM_LINK_LLVM_DYLIB)
add_llvm_library( LLVMEnzyme-${LLVM_VERSION_MAJOR}
${ENZYME_SRC}
PARTIAL_SOURCES_INTENDED
MODULE
${BUILD_TYPE}
DEPENDS
intrinsics_gen
LINK_COMPONENTS
Expand All @@ -67,7 +73,7 @@ if (${Clang_FOUND})
${ENZYME_SRC} Clang/EnzymeClang.cpp
Clang/EnzymePassLoader.cpp
PARTIAL_SOURCES_INTENDED
MODULE
${BUILD_TYPE}
DEPENDS
intrinsics_gen
LINK_COMPONENTS
Expand All @@ -78,7 +84,7 @@ endif()
add_llvm_library( LLDEnzyme-${LLVM_VERSION_MAJOR}
${ENZYME_SRC} Clang/EnzymePassLoader.cpp
PARTIAL_SOURCES_INTENDED
MODULE
${BUILD_TYPE}
DEPENDS
intrinsics_gen
LINK_COMPONENTS
Expand All @@ -89,7 +95,7 @@ else()
add_llvm_library( LLVMEnzyme-${LLVM_VERSION_MAJOR}
${ENZYME_SRC}
PARTIAL_SOURCES_INTENDED
MODULE
${BUILD_TYPE}
DEPENDS
intrinsics_gen
PLUGIN_TOOL
Expand All @@ -100,7 +106,7 @@ if (${Clang_FOUND})
${ENZYME_SRC} Clang/EnzymeClang.cpp
Clang/EnzymePassLoader.cpp
PARTIAL_SOURCES_INTENDED
MODULE
${BUILD_TYPE}
DEPENDS
intrinsics_gen
PLUGIN_TOOL
Expand All @@ -111,7 +117,7 @@ endif()
add_llvm_library( LLDEnzyme-${LLVM_VERSION_MAJOR}
${ENZYME_SRC} Clang/EnzymePassLoader.cpp
PARTIAL_SOURCES_INTENDED
MODULE
${BUILD_TYPE}
DEPENDS
intrinsics_gen
PLUGIN_TOOL
Expand Down

0 comments on commit d04e0ee

Please sign in to comment.