diff --git a/CMakeLists.txt b/CMakeLists.txt index f59e8223f..a9b46b3c8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,10 +5,11 @@ execute_process( COMMAND tr -d "\n" OUTPUT_VARIABLE CURRENT_VERSION) -project(meevax DESCRIPTION "A programmable programming language" - HOMEPAGE_URL "https://github.com/yamacir-kit/meevax" - LANGUAGES CXX - VERSION ${CURRENT_VERSION}) +project(meevax + DESCRIPTION "A programmable programming language" + HOMEPAGE_URL "https://github.com/yamacir-kit/meevax" + LANGUAGES CXX + VERSION ${CURRENT_VERSION}) include(GNUInstallDirs) @@ -20,9 +21,9 @@ string(JOIN " " AGGRESSIVE_OPTIMIZATION_OPTIONS ) set(CMAKE_CXX_EXTENSIONS OFF) -set(CMAKE_CXX_FLAGS_DEBUG "-Og -gdwarf-4") # NOTE: The `-gdwarf-4` option is set due to the following issues with Clang 14 and Valgrind versions below 3.20: https://bugzilla.mozilla.org/show_bug.cgi?id=1758782 -set(CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG") -set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG ${AGGRESSIVE_OPTIMIZATION_OPTIONS}") +set(CMAKE_CXX_FLAGS_DEBUG "-Og -gdwarf-4") # NOTE: The `-gdwarf-4` option is set due to the following issues with Clang 14 and Valgrind versions below 3.20: https://bugzilla.mozilla.org/show_bug.cgi?id=1758782 +set(CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG") +set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG ${AGGRESSIVE_OPTIMIZATION_OPTIONS}") set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -gdwarf-4 -DNDEBUG") set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wpedantic -pipe") set(CMAKE_CXX_STANDARD 17) @@ -73,30 +74,23 @@ file(GLOB_RECURSE ${PROJECT_NAME}_KERNEL_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src target_sources(kernel PRIVATE ${${PROJECT_NAME}_KERNEL_SOURCES}) -target_include_directories(kernel PUBLIC - $ - $) +target_include_directories(kernel + PUBLIC $ + PUBLIC $) -target_link_libraries(kernel PRIVATE ${CMAKE_DL_LIBS} - PUBLIC gmp) +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) - -# ---- Target format ----------------------------------------------------------- - -add_executable(format) - -target_sources(format PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src/format.cpp) - -target_link_libraries(format PRIVATE kernel) +set_target_properties(kernel PROPERTIES + OUTPUT_NAME ${PROJECT_NAME} # Rename libkernel => libmeevax + VERSION ${PROJECT_VERSION} + SOVERSION ${PROJECT_VERSION_MAJOR} + LINK_FLAGS_RELEASE -s) # ---- Target basis ------------------------------------------------------------ add_custom_target(basis - DEPENDS format COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/configure/basis.cmake) # ---- Target shell ------------------------------------------------------------ @@ -109,8 +103,9 @@ 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 ----------------------------------------------------------- @@ -122,29 +117,30 @@ write_basic_package_version_file( # ---- Target install ---------------------------------------------------------- -# /usr/lib/libmeevax -install(TARGETS kernel - EXPORT ${PROJECT_NAME}-config - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) +install( # /usr/lib/libmeevax + TARGETS kernel + EXPORT ${PROJECT_NAME}-config + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) -# /usr/bin/meevax -install(TARGETS shell - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) +install( # /usr/bin/meevax + TARGETS shell + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -# /usr/include/meevax -install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) +install( # /usr/include/meevax + DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) -# /usr/share/meevax/meevax-config.cmake -install(EXPORT ${PROJECT_NAME}-config - EXPORT_LINK_INTERFACE_LIBRARIES - DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME} - NAMESPACE Meevax::) +install( # /usr/share/meevax/meevax-config.cmake + EXPORT ${PROJECT_NAME}-config + EXPORT_LINK_INTERFACE_LIBRARIES + DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME} + NAMESPACE Meevax::) # /usr/share/meevax/meevax-config-version.cmake -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake - DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}) +install( + FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake + DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}) # ---- Target package ---------------------------------------------------------- @@ -164,20 +160,22 @@ enable_testing() find_program(${PROJECT_NAME}_MEMORY_CHECK_COMMAND valgrind) -set(${PROJECT_NAME}_MEMORY_CHECK_COMMAND_OPTIONS --error-exitcode=1 # = EXIT_FAILURE) - --leak-check=full - --quiet - --show-leak-kinds=all) +set(${PROJECT_NAME}_MEMORY_CHECK_OPTIONS + --error-exitcode=1 # = EXIT_FAILURE) + --leak-check=full + --quiet + --show-leak-kinds=all) file(GLOB ${PROJECT_NAME}_TEST_SS ${CMAKE_CURRENT_SOURCE_DIR}/test/*.ss) foreach(EACH IN LISTS ${PROJECT_NAME}_TEST_SS) get_filename_component(FILENAME ${EACH} NAME_WE) - add_test(NAME ${FILENAME} - COMMAND ${${PROJECT_NAME}_MEMORY_CHECK_COMMAND} - ${${PROJECT_NAME}_MEMORY_CHECK_COMMAND_OPTIONS} - ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/meevax - ${EACH}) + add_test( + NAME ${FILENAME} + COMMAND ${${PROJECT_NAME}_MEMORY_CHECK_COMMAND} + ${${PROJECT_NAME}_MEMORY_CHECK_OPTIONS} + ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/meevax + ${EACH}) endforeach() file(GLOB ${PROJECT_NAME}_TEST_CPP ${CMAKE_CURRENT_SOURCE_DIR}/test/*.cpp) @@ -187,10 +185,11 @@ foreach(EACH IN LISTS ${PROJECT_NAME}_TEST_CPP) add_executable(assert-${FILENAME} ${EACH}) add_dependencies(assert-${FILENAME} basis) target_link_libraries(assert-${FILENAME} PRIVATE kernel) - add_test(NAME assert-${FILENAME} - COMMAND ${${PROJECT_NAME}_MEMORY_CHECK_COMMAND} - ${${PROJECT_NAME}_MEMORY_CHECK_COMMAND_OPTIONS} - ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/assert-${FILENAME}) + add_test( + NAME assert-${FILENAME} + COMMAND ${${PROJECT_NAME}_MEMORY_CHECK_COMMAND} + ${${PROJECT_NAME}_MEMORY_CHECK_OPTIONS} + ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/assert-${FILENAME}) endforeach() # ---- Additional Targets ------------------------------------------------------ diff --git a/README.md b/README.md index 03b8cfa01..adf253ff1 100644 --- a/README.md +++ b/README.md @@ -91,7 +91,7 @@ Procedures for each standard are provided by the following R7RS-style libraries: cmake -B build -DCMAKE_BUILD_TYPE=Release cd build make package -sudo apt install build/meevax_0.5.59_amd64.deb +sudo apt install build/meevax_0.5.60_amd64.deb ``` or @@ -123,9 +123,9 @@ sudo rm -rf /usr/local/share/meevax | Target Name | Description |-------------|------------- -| `all` | Build shared-library `libmeevax.0.5.59.so` and executable `meevax` +| `all` | Build shared-library `libmeevax.0.5.60.so` and executable `meevax` | `test` | Test executable `meevax` -| `package` | Generate debian package `meevax_0.5.59_amd64.deb` +| `package` | Generate debian package `meevax_0.5.60_amd64.deb` | `install` | Copy files into `/usr/local` directly ## Usage diff --git a/VERSION b/VERSION index 9904b4381..dd78e5f59 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.5.59 +0.5.60 diff --git a/basis/] b/basis/] deleted file mode 100644 index e69de29bb..000000000 diff --git a/configure/basis.cmake b/configure/basis.cmake index e22306c1d..32884bc9c 100644 --- a/configure/basis.cmake +++ b/configure/basis.cmake @@ -7,9 +7,7 @@ file(GLOB ${PROJECT_NAME}_BASIS_SOURCES ${TOPLEVEL}/basis/*.ss) foreach(EACH IN LISTS ${PROJECT_NAME}_BASIS_SOURCES) get_filename_component(FILENAME ${EACH} NAME) - execute_process( - COMMAND ${TOPLEVEL}/build/bin/format ${EACH} - OUTPUT_VARIABLE CONFIGURED_${FILENAME}) + file(READ ${EACH} ${FILENAME}) endforeach() configure_file( diff --git a/configure/basis.hpp b/configure/basis.hpp index 423db2e71..eac3bb9ee 100644 --- a/configure/basis.hpp +++ b/configure/basis.hpp @@ -32,28 +32,28 @@ inline namespace kernel constexpr auto basis() { return make_array( - R"##(${CONFIGURED_meevax.ss})##", - R"##(${CONFIGURED_r4rs.ss})##", - R"##(${CONFIGURED_r5rs.ss})##", - R"##(${CONFIGURED_r7rs.ss})##", - R"##(${CONFIGURED_srfi-0.ss})##", - R"##(${CONFIGURED_srfi-1.ss})##", - R"##(${CONFIGURED_srfi-4.ss})##", - R"##(${CONFIGURED_srfi-6.ss})##", - R"##(${CONFIGURED_srfi-8.ss})##", - R"##(${CONFIGURED_srfi-9.ss})##", - R"##(${CONFIGURED_srfi-11.ss})##", - R"##(${CONFIGURED_srfi-16.ss})##", - R"##(${CONFIGURED_srfi-23.ss})##", - R"##(${CONFIGURED_srfi-31.ss})##", - R"##(${CONFIGURED_srfi-34.ss})##", - R"##(${CONFIGURED_srfi-38.ss})##", - R"##(${CONFIGURED_srfi-39.ss})##", - R"##(${CONFIGURED_srfi-45.ss})##", - R"##(${CONFIGURED_srfi-78.ss})##", - R"##(${CONFIGURED_srfi-98.ss})##", - R"##(${CONFIGURED_srfi-111.ss})##", - R"##(${CONFIGURED_srfi-149.ss})##"); + R"##(${meevax.ss})##", + R"##(${r4rs.ss})##", + R"##(${r5rs.ss})##", + R"##(${r7rs.ss})##", + R"##(${srfi-0.ss})##", + R"##(${srfi-1.ss})##", + R"##(${srfi-4.ss})##", + R"##(${srfi-6.ss})##", + R"##(${srfi-8.ss})##", + R"##(${srfi-9.ss})##", + R"##(${srfi-11.ss})##", + R"##(${srfi-16.ss})##", + R"##(${srfi-23.ss})##", + R"##(${srfi-31.ss})##", + R"##(${srfi-34.ss})##", + R"##(${srfi-38.ss})##", + R"##(${srfi-39.ss})##", + R"##(${srfi-45.ss})##", + R"##(${srfi-78.ss})##", + R"##(${srfi-98.ss})##", + R"##(${srfi-111.ss})##", + R"##(${srfi-149.ss})##"); } } // namespace kernel } // namespace meevax