Comments (5)
I'm not sure. Is it possible to use the commit hash as a version number? Because that's the only one the project has at the moment.
from lexy.
This will fetch the current commit hash, which you can then pass to the project
command.
execute_process(
COMMAND "git" "rev-parse" "--short" "HEAD"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
RESULT_VARIABLE LEXY_VERSION
OUTPUT_QUIET
)
from lexy.
I don't think that works, the version has to be integers separated by dots: https://cmake.org/cmake/help/latest/command/project.html?highlight=project#options
from lexy.
You could convert the result into a decimal.
execute_process(
COMMAND "git" "rev-parse" "--short" "HEAD"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
OUTPUT_VARIABLE LEXY_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE
)
math(EXPR LEXY_VERSION "0x${LEXY_VERSION}" OUTPUT_FORMAT DECIMAL)
from lexy.
Yeah, that seems like too much magic. I'm closing this for now and will revisit it once I'm closer to an actual stable release.
from lexy.
Related Issues (20)
- Including lexy in CMake project forces use of C++20 HOT 2
- Implement Top level Language Parser
- example-or-fix-request: delimited-dsl where closing delimiter is also an escape leader HOT 1
- Pruduction is not a branch rule HOT 1
- Unicode-aware identifier in calculator example does not work HOT 3
- Example for Callback lexy::new_ in documentation appears to be incorrect. HOT 1
- Support case folding in `lexy::as_string` callback
- Add bounded integer parsing HOT 3
- Turn `dsl::terminator(branch)` into a branch
- Documention is unreadable if TOC takes too much space HOT 1
- Any plan to support grammar-file writing dsl rule? HOT 1
- benchmar compile errors HOT 1
- Infinite compilation caused by dsl::times with separator and automatic whitespace HOT 1
- dsl for real numbers HOT 9
- [Question] dsl::integer and negative numbers HOT 1
- lexy_ext::report_error on Windows 10 (MSVC) HOT 1
- `utf8_char_encoding::eof()` produces warning C4310 on MSVC HOT 1
- Runtime error (assert failed) on print tree HOT 1
- Custom allocator causes fold_inplace cannot be compiled on MSVC HOT 1
- missing lexyConfig.cmake.in in release file HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lexy.