Skip to content

Commit

Permalink
Remove the inja submodule and replace it with a CMake fetchcontent in…
Browse files Browse the repository at this point in the history
…strumentation. (#3959)
  • Loading branch information
fruffy authored Apr 3, 2023
1 parent c708261 commit 787e718
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,3 @@
[submodule "backends/p4tools/submodules/gsl-lite"]
path = backends/p4tools/submodules/gsl-lite
url = https://github.com/gsl-lite/gsl-lite.git
[submodule "backends/p4tools/submodules/inja"]
path = backends/p4tools/submodules/inja
url = https://github.com/pantor/inja.git
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,12 @@ else()
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})
set (P4C_VERSION "${P4C_SEM_VERSION_STRING} (SHA: ${P4C_GIT_SHA} BUILD: ${CMAKE_BUILD_TYPE})")
endif()
# P4 General Utilities
include(P4CUtils)
# TODO: Remove this deprecated include.
# CMake Utilities to fetch dependencies.
include(FetchContent)
set(CMAKE_POLICY_DEFAULT_CMP0077 NEW)
# TODO: Remove this deprecated include eventually.
include(UnifiedBuild)

# # search in /usr/local first
Expand Down
11 changes: 10 additions & 1 deletion backends/p4tools/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,18 @@ endif()
# GSL-lite is needed for testgen.
add_subdirectory(submodules/gsl-lite EXCLUDE_FROM_ALL)

# Inja is needed to produce test templates.
set(INJA_BUILD_TESTS OFF CACHE BOOL "Build unit tests when BUILD_TESTING is enabled.")
set(BUILD_BENCHMARK OFF CACHE BOOL "Build benchmark.")
add_subdirectory(submodules/inja)
FetchContent_Declare(
inja
GIT_REPOSITORY https://github.com/pantor/inja.git
GIT_TAG 3741c73ba78babd2ed88f2acf2fcd6dafdb878e8
GIT_PROGRESS TRUE
)
FetchContent_MakeAvailable(inja)
include_directories(SYSTEM ${inja_SOURCE_DIR}/include)


# Import common definitions.
include(common)
Expand Down
1 change: 0 additions & 1 deletion backends/p4tools/submodules/inja
Submodule inja deleted from d462b9

0 comments on commit 787e718

Please sign in to comment.