Skip to content

Commit

Permalink
perf: optimize CMAKE_PROJECT_GIT_COMMIT_DIRTY check (#117)
Browse files Browse the repository at this point in the history
When CMAKE_PROJECT_GIT_COMMIT_DIRTY is not defined, it means there's nothing changed by default

Signed-off-by: msclock <msclock@qq.com>
  • Loading branch information
msclock committed Jul 30, 2024
1 parent a157241 commit 2d2d5e1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cmake/configure/GitTools.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,14 @@ function(generate_git_header)
endif()

if(NOT arg_CONFIGURE_HEADER_FILE)

# Define default template variables
if(NOT CMAKE_PROJECT_GIT_COMMIT_DIRTY)
set(CMAKE_PROJECT_GIT_COMMIT_DIRTY
0
CACHE INTERNAL "")
endif()

set(_configure_git_header_content
"#pragma once
// git.h
Expand Down

0 comments on commit 2d2d5e1

Please sign in to comment.