Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
blender-embree3
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
blender
blender-embree3
Commits
a18f4d2b
Commit
a18f4d2b
authored
9 years ago
by
Campbell Barton
Browse files
Options
Downloads
Patches
Plain Diff
CMake: optional date/time overrides for reproducible builds
parent
c1e4aaa2
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CMakeLists.txt
+4
-0
4 additions, 0 deletions
CMakeLists.txt
build_files/cmake/buildinfo.cmake
+19
-7
19 additions, 7 deletions
build_files/cmake/buildinfo.cmake
source/creator/CMakeLists.txt
+3
-0
3 additions, 0 deletions
source/creator/CMakeLists.txt
with
26 additions
and
7 deletions
CMakeLists.txt
+
4
−
0
View file @
a18f4d2b
...
...
@@ -218,6 +218,10 @@ if(${CMAKE_VERSION} VERSION_LESS 2.8.8)
# add_library OBJECT arg unsupported
set
(
WITH_BUILDINFO OFF
)
endif
()
set
(
BUILDINFO_OVERRIDE_DATE
""
CACHE STRING
"Use instead of the current date for reproducable builds (empty string disables this option)"
)
set
(
BUILDINFO_OVERRIDE_TIME
""
CACHE STRING
"Use instead of the current time for reproducable builds (empty string disables this option)"
)
mark_as_advanced
(
BUILDINFO_OVERRIDE_DATE
)
mark_as_advanced
(
BUILDINFO_OVERRIDE_TIME
)
option
(
WITH_IK_ITASC
"Enable ITASC IK solver (only disable for development & for incompatible C++ compilers)"
ON
)
option
(
WITH_IK_SOLVER
"Enable Legacy IK solver (only disable for development)"
ON
)
...
...
This diff is collapsed.
Click to expand it.
build_files/cmake/buildinfo.cmake
+
19
−
7
View file @
a18f4d2b
# This is called by cmake as an exter
m
al process from
# This is called by cmake as an exter
n
al process from
# ./source/creator/CMakeLists.txt to write ./source/creator/buildinfo.h
# Caller must define:
# SOURCE_DIR
# Optional overrides:
# BUILD_DATE
# BUILD_TIME
# Extract working copy information for SOURCE_DIR into MY_XXX variables
# with a default in case anything fails, for example when using git-svn
...
...
@@ -128,12 +133,19 @@ endif()
# BUILD_PLATFORM and BUILD_PLATFORM are taken from CMake
# but BUILD_DATE and BUILD_TIME are platform dependent
if
(
UNIX
)
execute_process
(
COMMAND date
"+%Y-%m-%d"
OUTPUT_VARIABLE BUILD_DATE OUTPUT_STRIP_TRAILING_WHITESPACE
)
execute_process
(
COMMAND date
"+%H:%M:%S"
OUTPUT_VARIABLE BUILD_TIME OUTPUT_STRIP_TRAILING_WHITESPACE
)
endif
()
if
(
WIN32
)
execute_process
(
COMMAND cmd /c date /t OUTPUT_VARIABLE BUILD_DATE OUTPUT_STRIP_TRAILING_WHITESPACE
)
execute_process
(
COMMAND cmd /c time /t OUTPUT_VARIABLE BUILD_TIME OUTPUT_STRIP_TRAILING_WHITESPACE
)
if
(
NOT BUILD_DATE
)
execute_process
(
COMMAND date
"+%Y-%m-%d"
OUTPUT_VARIABLE BUILD_DATE OUTPUT_STRIP_TRAILING_WHITESPACE
)
endif
()
if
(
NOT BUILD_TIME
)
execute_process
(
COMMAND date
"+%H:%M:%S"
OUTPUT_VARIABLE BUILD_TIME OUTPUT_STRIP_TRAILING_WHITESPACE
)
endif
()
elseif
(
WIN32
)
if
(
NOT BUILD_DATE
)
execute_process
(
COMMAND cmd /c date /t OUTPUT_VARIABLE BUILD_DATE OUTPUT_STRIP_TRAILING_WHITESPACE
)
endif
()
if
(
NOT BUILD_TIME
)
execute_process
(
COMMAND cmd /c time /t OUTPUT_VARIABLE BUILD_TIME OUTPUT_STRIP_TRAILING_WHITESPACE
)
endif
()
endif
()
# Write a file with the BUILD_HASH define
...
...
This diff is collapsed.
Click to expand it.
source/creator/CMakeLists.txt
+
3
−
0
View file @
a18f4d2b
...
...
@@ -186,6 +186,9 @@ if(WITH_BUILDINFO)
add_custom_command
(
OUTPUT
${
CMAKE_CURRENT_BINARY_DIR
}
/_buildinfo.h
COMMAND
${
CMAKE_COMMAND
}
-DSOURCE_DIR=
${
CMAKE_SOURCE_DIR
}
# overrides only used when non-empty strings
-DBUILD_DATE=
${
BUILDINFO_OVERRIDE_DATE
}
-DBUILD_TIME=
${
BUILDINFO_OVERRIDE_TIME
}
-P
${
CMAKE_SOURCE_DIR
}
/build_files/cmake/buildinfo.cmake
)
# buildinfo.h is a generated file
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment