Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use CMake string(TIMESTAMP) for portable compile timestamp #190

Merged
merged 1 commit into from
Mar 31, 2024

Conversation

xixiha5230
Copy link

The previous usage of the date command is not portable across different platforms. date is not guaranteed to be available and the format varies.

Replace it with CMake's built-in string(TIMESTAMP) command which generates a string with the given timestamp format independent of the platform. This commit changes it to use "%y%m%d" format for a YYMMDD timestamp commonly used for compilation.

The previous usage of the date command is not portable across different platforms. date is not guaranteed to be available and the format varies.

Replace it with CMake's built-in string(TIMESTAMP) command which generates a string with the given timestamp format independent of the platform. This commit changes it to use "%y%m%d" format for a YYMMDD timestamp commonly used for compilation.
@cliuff
Copy link

cliuff commented Mar 6, 2024

I encountered build failure on Windows today because the COMPILE_TIME variable was not set successfully.
I confirm that using cmake's timestamp solved the issue, and I managed to build the project without error.

build error build info

@cikezlf
Copy link

cikezlf commented Mar 22, 2024

The hidden: true grouping hiding rule is not supported. We hope to add support for this rule;
不支持hidden: true分组隐藏规则,希望增加这个规则支持

@Larvan2 Larvan2 merged commit 53bc1da into MetaCubeX:main Mar 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants