gen-zam: Establish the usual environment for cmake-driven builds

This commit is contained in:
Christian Kreibich 2022-03-15 21:39:34 -07:00 committed by Tim Wojtulewicz
parent c1f240295f
commit 5ea34f20b8
2 changed files with 42 additions and 0 deletions

View file

@ -0,0 +1,36 @@
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
project(Gen-ZAM C CXX)
include(cmake/CommonCMakeConfig.cmake)
include(FindRequiredPackage)
include(RequireCXX17)
set(GEN_ZAM_SRCS src/Gen-ZAM.cc)
set(GEN_ZAM_HEADERS src/Gen-ZAM.h)
add_executable(gen-zam ${GEN_ZAM_SRCS} ${GEN_ZAM_HEADERS})
install(TARGETS gen-zam DESTINATION bin)
if (CMAKE_BUILD_TYPE)
string(TOUPPER ${CMAKE_BUILD_TYPE} BuildType)
endif ()
message(
"\n===================| Gen-ZAM Build Summary |==================\n"
"\n"
"\nBuild type: ${CMAKE_BUILD_TYPE}"
"\nBuild dir: ${PROJECT_BINARY_DIR}"
"\nInstall prefix: ${CMAKE_INSTALL_PREFIX}"
"\nDebug mode: ${ENABLE_DEBUG}"
"\n"
"\nCC: ${CMAKE_C_COMPILER}"
"\nCFLAGS: ${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${BuildType}}"
"\nCXX: ${CMAKE_CXX_COMPILER}"
"\nCXXFLAGS: ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${BuildType}}"
"\nCPP: ${CMAKE_CXX_COMPILER}"
"\n"
"\n================================================================\n"
)
include(UserChangedWarning)

6
tools/gen-zam/README.md Normal file
View file

@ -0,0 +1,6 @@
# Gen-ZAM, a templator for the Zeek Abstract Machine
Zeek uses the `gen-zam` tool during its build, to synthesize operations in ZAM,
the Zeek Abstract Machine. The main reason for why you might want to use this
repository on its own is cross-compilation, for which you'll need `gen-zam` on
the build host, much like `bifcl` and `binpac`.