Merge remote-tracking branch 'origin/topic/christian/gh-3061-fix-cmake-build-type-lower'

* origin/topic/christian/gh-3061-fix-cmake-build-type-lower:
  Fix CMAKE_BUILD_TYPE_LOWER definition-vs-use ordering problem
This commit is contained in:
Arne Welzel 2023-05-22 10:14:27 +02:00
commit 3b28f59c3b
3 changed files with 14 additions and 8 deletions

View file

@ -1,3 +1,12 @@
6.0.0-dev.617 | 2023-05-22 10:14:27 +0200
* Fix CMAKE_BUILD_TYPE_LOWER definition-vs-use ordering problem (Christian Kreibich, Corelight)
It needs to be defined by the time we create zeek-config, which happens before
its current definition. To avoid a redundant TOLOWER when we check for presence
of --enable-debug at the beginning, this also switches this to a case-unadjusted
comparison to "Debug", which we use elsewhere in the file too.
6.0.0-dev.614 | 2023-05-19 10:51:35 -0700 6.0.0-dev.614 | 2023-05-19 10:51:35 -0700
* Allow plugins to call find_package(Zeek) (Dominik Charousset) * Allow plugins to call find_package(Zeek) (Dominik Charousset)

View file

@ -11,12 +11,8 @@ project(Zeek C CXX)
# We want to set ENABLE_DEBUG to ON by default if the build type is Debug. # We want to set ENABLE_DEBUG to ON by default if the build type is Debug.
set(ENABLE_DEBUG_DEFAULT OFF) set(ENABLE_DEBUG_DEFAULT OFF)
if (NOT GENERATOR_IS_MULTI_CONFIG) if (NOT GENERATOR_IS_MULTI_CONFIG AND CMAKE_BUILD_TYPE STREQUAL "Debug")
string(TOLOWER "${CMAKE_BUILD_TYPE}" build_type_lower) set(ENABLE_DEBUG_DEFAULT ON)
if (build_type_lower STREQUAL "debug")
set(ENABLE_DEBUG_DEFAULT ON)
endif ()
unset(build_type_lower)
endif () endif ()
# On UNIX, install additional Zeek tools by default and build shared objects. # On UNIX, install additional Zeek tools by default and build shared objects.
@ -169,6 +165,8 @@ include(cmake/CommonCMakeConfig.cmake)
include(cmake/FindClangTidy.cmake) include(cmake/FindClangTidy.cmake)
include(cmake/CheckCompilerArch.cmake) include(cmake/CheckCompilerArch.cmake)
string(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_LOWER)
# ############################################################################## # ##############################################################################
# Main targets and utilities. # Main targets and utilities.
@ -1262,7 +1260,6 @@ configure_file(${CMAKE_SOURCE_DIR}/spicy-path.in ${CMAKE_BINARY_DIR}/spicy-path
configure_file(${CMAKE_SOURCE_DIR}/hilti-cxx-include-dirs.in configure_file(${CMAKE_SOURCE_DIR}/hilti-cxx-include-dirs.in
${CMAKE_BINARY_DIR}/hilti-cxx-include-dirs @ONLY) ${CMAKE_BINARY_DIR}/hilti-cxx-include-dirs @ONLY)
string(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_LOWER)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/zeek-version.h.in configure_file(${CMAKE_CURRENT_SOURCE_DIR}/zeek-version.h.in
${CMAKE_CURRENT_BINARY_DIR}/zeek-version.h) ${CMAKE_CURRENT_BINARY_DIR}/zeek-version.h)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/zeek-version.h DESTINATION include/zeek) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/zeek-version.h DESTINATION include/zeek)

View file

@ -1 +1 @@
6.0.0-dev.614 6.0.0-dev.617