bifcl: Reformat CMakeLists via pre-commit

This commit is contained in:
Tim Wojtulewicz 2025-03-06 12:47:29 -07:00
parent 2f97833acd
commit 234726dac7

View file

@ -6,28 +6,20 @@ include(cmake/CommonCMakeConfig.cmake)
find_package(BISON REQUIRED) find_package(BISON REQUIRED)
find_package(FLEX REQUIRED) find_package(FLEX REQUIRED)
if(MSVC) if (MSVC)
add_compile_options(/J) # Similar to -funsigned-char on other platforms add_compile_options(/J) # Similar to -funsigned-char on other platforms
set_property( set_property(SOURCE bif_lex.cc APPEND_STRING PROPERTY COMPILE_FLAGS "/wd4018")
SOURCE bif_lex.cc else ()
APPEND_STRING set_property(SOURCE bif_lex.cc APPEND_STRING PROPERTY COMPILE_FLAGS "-Wno-sign-compare")
PROPERTY COMPILE_FLAGS "/wd4018") endif ()
else()
set_property(
SOURCE bif_lex.cc
APPEND_STRING
PROPERTY COMPILE_FLAGS "-Wno-sign-compare")
endif()
include_directories(BEFORE ${BifCl_SOURCE_DIR}/include ${BifCl_BINARY_DIR}) include_directories(BEFORE ${BifCl_SOURCE_DIR}/include ${BifCl_BINARY_DIR})
set(BISON_FLAGS "--debug") set(BISON_FLAGS "--debug")
# BIF parser/scanner # BIF parser/scanner
bison_target( bison_target(BIFParser builtin-func.y ${BifCl_BINARY_DIR}/bif_parse.cc
BIFParser builtin-func.y ${BifCl_BINARY_DIR}/bif_parse.cc DEFINES_FILE ${BifCl_BINARY_DIR}/bif_parse.h COMPILE_FLAGS "${BISON_FLAGS}")
DEFINES_FILE ${BifCl_BINARY_DIR}/bif_parse.h
COMPILE_FLAGS "${BISON_FLAGS}")
flex_target(BIFScanner builtin-func.l ${BifCl_BINARY_DIR}/bif_lex.cc) flex_target(BIFScanner builtin-func.l ${BifCl_BINARY_DIR}/bif_lex.cc)
add_flex_bison_dependency(BIFScanner BIFParser) add_flex_bison_dependency(BIFScanner BIFParser)
@ -45,35 +37,35 @@ add_executable(bifcl ${bifcl_SRCS})
target_compile_features(bifcl PRIVATE cxx_std_17) target_compile_features(bifcl PRIVATE cxx_std_17)
set_target_properties(bifcl PROPERTIES CXX_EXTENSIONS OFF) set_target_properties(bifcl PROPERTIES CXX_EXTENSIONS OFF)
if(MSVC) if (MSVC)
# If building separately from zeek, we need to add the libunistd subdirectory # If building separately from zeek, we need to add the libunistd subdirectory
# so that linking doesn't fail. # so that linking doesn't fail.
if("${CMAKE_PROJECT_NAME}" STREQUAL "BifCl") if ("${CMAKE_PROJECT_NAME}" STREQUAL "BifCl")
add_subdirectory(auxil/libunistd EXCLUDE_FROM_ALL) add_subdirectory(auxil/libunistd EXCLUDE_FROM_ALL)
endif() endif ()
target_link_libraries(bifcl PRIVATE libunistd) target_link_libraries(bifcl PRIVATE libunistd)
endif() endif ()
install(TARGETS bifcl DESTINATION bin) install(TARGETS bifcl DESTINATION bin)
if(CMAKE_BUILD_TYPE) if (CMAKE_BUILD_TYPE)
string(TOUPPER ${CMAKE_BUILD_TYPE} BuildType) string(TOUPPER ${CMAKE_BUILD_TYPE} BuildType)
endif() endif ()
message( message(
"\n====================| Bifcl Build Summary |=====================" "\n====================| Bifcl Build Summary |====================="
"\n" "\n"
"\nBuild type: ${CMAKE_BUILD_TYPE}" "\nBuild type: ${CMAKE_BUILD_TYPE}"
"\nBuild dir: ${PROJECT_BINARY_DIR}" "\nBuild dir: ${PROJECT_BINARY_DIR}"
"\nInstall prefix: ${CMAKE_INSTALL_PREFIX}" "\nInstall prefix: ${CMAKE_INSTALL_PREFIX}"
"\nDebug mode: ${ENABLE_DEBUG}" "\nDebug mode: ${ENABLE_DEBUG}"
"\n" "\n"
"\nCC: ${CMAKE_C_COMPILER}" "\nCC: ${CMAKE_C_COMPILER}"
"\nCFLAGS: ${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${BuildType}}" "\nCFLAGS: ${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${BuildType}}"
"\nCXX: ${CMAKE_CXX_COMPILER}" "\nCXX: ${CMAKE_CXX_COMPILER}"
"\nCXXFLAGS: ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${BuildType}}" "\nCXXFLAGS: ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${BuildType}}"
"\nCPP: ${CMAKE_CXX_COMPILER}" "\nCPP: ${CMAKE_CXX_COMPILER}"
"\n" "\n"
"\n================================================================\n") "\n================================================================\n")
include(UserChangedWarning) include(UserChangedWarning)