A minimalistic programming language written in C89.
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

37 行
1.0 KiB

6 个月前
6 个月前
  1. cmake_minimum_required(VERSION 3.0)
  2. project(ink C)
  3. set(CMAKE_C_STANDARD 90)
  4. add_library(ink lib.c include/ink.h)
  5. # Uncomment to disable the redundant arithmetic
  6. # add_definitions(-DNOEXTRAARITHMETIC)
  7. # Uncomment to disable array types
  8. # add_definitions(-DNOARRAYLIB)
  9. # Uncomment to disable string literal
  10. # add_definitions(-DNOSTRINGLITERALS)
  11. # Ensures the interpreter doesn't use the standard C library functions
  12. # add_definitions(-DNOSTDLIB)
  13. # Removes several checks to improve performance in cases where ink is used as a bytecode
  14. # add_definitions(-DNOEXTRACHECKS)
  15. add_definitions(-DINK_STEP_BATCH_COUNT=20)
  16. add_executable(ink_exe main.c)
  17. target_link_libraries(ink_exe PUBLIC ink)
  18. target_include_directories(ink PUBLIC include)
  19. if(MSVC)
  20. target_compile_options(ink PRIVATE /W4 /WX)
  21. else()
  22. target_compile_options(ink PRIVATE -Wall -Wextra -Wpedantic -Werror)
  23. endif()
  24. # Benchmark is broken since the addition to coroutines
  25. # add_executable(ink_bench bench.c)
  26. # target_link_libraries(ink_bench PUBLIC ink)