Skip to content

Commit

Permalink
Set version using CMake
Browse files Browse the repository at this point in the history
  • Loading branch information
evanlin96069 committed May 4, 2024
1 parent ecbfd8b commit 1923a7a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
7 changes: 5 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.22.0)

project(nino VERSION 0.0.1 LANGUAGES C)
project(nino VERSION 0.0.6 LANGUAGES C)

include(GNUInstallDirs)

Expand Down Expand Up @@ -64,7 +64,6 @@ set (CORE_SOURCES
src/unicode.h
src/utils.c
src/utils.h
src/version.h
)

if (WIN32)
Expand All @@ -81,6 +80,10 @@ endif()

add_executable(${PROJECT_NAME} ${CORE_SOURCES} ${BUNDLED_FILE})

target_compile_definitions(${PROJECT_NAME} PRIVATE
EDITOR_VERSION="${CMAKE_PROJECT_VERSION}"
)

if (MSVC)
target_compile_options(${PROJECT_NAME} PRIVATE /W4 /wd4244 /wd4267 /wd4996)
else()
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ This project uses CMake for building. Follow these steps to build the project:

### Prerequisites

- CMake (minimum required version, e.g., 3.15)
- CMake (minimum required version, e.g., 3.22.0)
- A suitable C compiler (GCC, Clang, MSVC, etc.)

### Cloning the Repository
Expand Down
1 change: 0 additions & 1 deletion src/output.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#include "prompt.h"
#include "select.h"
#include "unicode.h"
#include "version.h"

static void editorDrawTopStatusBar(abuf* ab) {
const char* right_buf = " nino v" EDITOR_VERSION " ";
Expand Down
1 change: 0 additions & 1 deletion src/version.h

This file was deleted.

0 comments on commit 1923a7a

Please sign in to comment.