Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 0 additions & 31 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -110,25 +110,6 @@ if(METACG_BUILD_CGCOLLECTOR)
add_subdirectory(cgcollector)
endif()

# Build CGPatch: cgpatch-pass, cgpatch-runtime, wrappers, tests
option(
METACG_BUILD_CGPATCH
"On or off"
OFF
)
if(METACG_BUILD_CGPATCH)
if(NOT METACG_BUILD_GRAPH_TOOLS)
message(FATAL_ERROR "CGPatch requires to build with METACG_BUILD_GRAPH_TOOLS=ON")
endif()
if(${LLVM_PACKAGE_VERSION}
GREATER
14
)
add_subdirectory(tools/cgpatch/)
else()
message(STATUS "Skipping CGPatch: requires LLVM version 15 or higher")
endif()
endif()
# PIRA analyzer Should PGIS be built
option(
METACG_BUILD_PGIS
Expand All @@ -155,18 +136,6 @@ option(
OFF
)

# Enable MPI for CGPatch
option(
CGPATCH_USE_MPI
"On or Off"
ON
)

if(METACG_BUILD_CGPATCH AND CGPATCH_USE_MPI)
find_package(MPI REQUIRED)
message(STATUS "MPI VERSION: ${MPI_C_VERSION}")
endif()

# Build MetaCG's Python interface
option(
METACG_BUILD_PYMETACG
Expand Down
17 changes: 17 additions & 0 deletions tools/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
# Build CGPatch: cgpatch-pass, cgpatch-runtime, wrappers, tests
option(
METACG_BUILD_CGPATCH
"On or off"
OFF
)
if(METACG_BUILD_CGPATCH)
if(${LLVM_PACKAGE_VERSION}
GREATER
14
)
add_subdirectory(cgpatch)
else()
message(WARNING "Skipping CGPatch: requires LLVM version 15 or higher")
endif()
endif()

add_subdirectory(cgmerge2)
add_subdirectory(cgconvert)
add_subdirectory(cgformat)
15 changes: 13 additions & 2 deletions tools/cgpatch/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
project(CGPatch)

include(GNUInstallDirs)

# Enable MPI for CGPatch
option(
CGPATCH_USE_MPI
"On or Off"
ON
)

if(CGPATCH_USE_MPI)
find_package(MPI REQUIRED)
message(STATUS "MPI VERSION: ${MPI_C_VERSION}")
endif()

# LLVM
option(
USE_FNO_RTTI
Expand Down Expand Up @@ -33,6 +43,7 @@ foreach(tgt cgpatch-call-analysis cgpatch-inst-pass)
endforeach()

if(CGPATCH_USE_MPI)
target_include_directories(cgpatch-runtime PRIVATE ${MPI_C_INCLUDE_DIRS})
target_compile_definitions(cgpatch-runtime PRIVATE USE_MPI=1)
endif()

Expand Down