Skip to content

Commit

Permalink
Revert "Add new cmake file UnicodeData.cmake"
Browse files Browse the repository at this point in the history
This reverts commit bfaa1cc.
  • Loading branch information
yamacir-kit committed Sep 27, 2023
1 parent bfaa1cc commit 2f14010
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 35 deletions.
36 changes: 19 additions & 17 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
cmake_minimum_required(VERSION 3.16.3) # Ubuntu 20.04 LTS default

execute_process(
COMMAND head -c -1 ${CMAKE_CURRENT_SOURCE_DIR}/VERSION
COMMAND cat ${CMAKE_CURRENT_SOURCE_DIR}/VERSION
COMMAND tr -d "\n"
OUTPUT_VARIABLE CURRENT_VERSION)

project(meevax DESCRIPTION "A programmable programming language"
Expand Down Expand Up @@ -43,28 +44,31 @@ else()
set(${PROJECT_NAME}_BYTE_ORDER "little-endian")
endif()

execute_process(COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/script/unicode.sh --digit-value OUTPUT_VARIABLE ${PROJECT_NAME}_UNICODE_DIGIT_VALUE)
execute_process(COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/script/unicode.sh --downcase OUTPUT_VARIABLE ${PROJECT_NAME}_UNICODE_DOWNCASE)
execute_process(COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/script/unicode.sh --property OUTPUT_VARIABLE ${PROJECT_NAME}_UNICODE_PROPERTY)
execute_process(COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/script/unicode.sh --upcase OUTPUT_VARIABLE ${PROJECT_NAME}_UNICODE_UPCASE)

execute_process(
COMMAND head -c -1 ${CMAKE_CURRENT_SOURCE_DIR}/configure/help.txt
OUTPUT_VARIABLE ${PROJECT_NAME}_HELP)

file(WRITE ${CMAKE_CURRENT_SOURCE_DIR}/include/${PROJECT_NAME}/unicode/digit_value.hpp "${${PROJECT_NAME}_UNICODE_DIGIT_VALUE}")
file(WRITE ${CMAKE_CURRENT_SOURCE_DIR}/include/${PROJECT_NAME}/unicode/downcase.hpp "${${PROJECT_NAME}_UNICODE_DOWNCASE}")
file(WRITE ${CMAKE_CURRENT_SOURCE_DIR}/include/${PROJECT_NAME}/unicode/property.hpp "${${PROJECT_NAME}_UNICODE_PROPERTY}")
file(WRITE ${CMAKE_CURRENT_SOURCE_DIR}/include/${PROJECT_NAME}/unicode/upcase.hpp "${${PROJECT_NAME}_UNICODE_UPCASE}")

string(TOLOWER ${CMAKE_SYSTEM_NAME} ${PROJECT_NAME}_SYSTEM_NAME)

configure_file(${CMAKE_CURRENT_SOURCE_DIR}/configure/README.md ${CMAKE_CURRENT_SOURCE_DIR}/README.md)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/configure/version.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/kernel/version.cpp)

# ---- Target unicode ----------------------------------------------------------

add_custom_target(unicode
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/configure/UnicodeData.cmake)

# ---- Target kernel -----------------------------------------------------------

add_library(kernel SHARED)

add_library(${PROJECT_NAME}::kernel ALIAS kernel)

add_dependencies(kernel unicode)

file(GLOB_RECURSE ${PROJECT_NAME}_KERNEL_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/*/*.cpp)

target_sources(kernel PRIVATE ${${PROJECT_NAME}_KERNEL_SOURCES})
Expand All @@ -76,11 +80,10 @@ target_include_directories(kernel PUBLIC
target_link_libraries(kernel PRIVATE ${CMAKE_DL_LIBS}
PUBLIC gmp)

set_target_properties(kernel PROPERTIES
OUTPUT_NAME ${PROJECT_NAME} # Rename libkernel => libmeevax
VERSION ${PROJECT_VERSION}
SOVERSION ${PROJECT_VERSION_MAJOR}
LINK_FLAGS_RELEASE -s)
set_target_properties(kernel PROPERTIES OUTPUT_NAME ${PROJECT_NAME} # Rename libkernel => libmeevax
VERSION ${PROJECT_VERSION}
SOVERSION ${PROJECT_VERSION_MAJOR}
LINK_FLAGS_RELEASE -s)

# ---- Target format -----------------------------------------------------------

Expand All @@ -94,7 +97,7 @@ target_link_libraries(format PRIVATE kernel)

add_custom_target(basis
DEPENDS format
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/configure/basis.cmake)
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/basis/configure.cmake)

# ---- Target shell ------------------------------------------------------------

Expand All @@ -106,9 +109,8 @@ target_sources(shell PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src/main.cpp)

target_link_libraries(shell PRIVATE kernel)

set_target_properties(shell PROPERTIES
OUTPUT_NAME ${PROJECT_NAME} # Rename shell => meevax
LINK_FLAGS_RELEASE -s)
set_target_properties(shell PROPERTIES OUTPUT_NAME ${PROJECT_NAME} # Rename shell => meevax
LINK_FLAGS_RELEASE -s)

# ---- CMake Package -----------------------------------------------------------

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ Subset of R7RS-small.
cmake -B build -DCMAKE_BUILD_TYPE=Release
cd build
make package
sudo apt install build/meevax_0.4.819_amd64.deb
sudo apt install build/meevax_0.4.818_amd64.deb
```

or
Expand Down Expand Up @@ -106,9 +106,9 @@ sudo rm -rf /usr/local/share/meevax

| Target Name | Description
|-------------|-------------
| `all` | Build shared-library `libmeevax.0.4.819.so` and executable `meevax`
| `all` | Build shared-library `libmeevax.0.4.818.so` and executable `meevax`
| `test` | Test executable `meevax`
| `package` | Generate debian package `meevax_0.4.819_amd64.deb`
| `package` | Generate debian package `meevax_0.4.818_amd64.deb`
| `install` | Copy files into `/usr/local` directly

## Usage
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.4.819
0.4.818
File renamed without changes.
14 changes: 0 additions & 14 deletions configure/UnicodeData.cmake

This file was deleted.

0 comments on commit 2f14010

Please sign in to comment.