Update README and add CMake options

This commit is contained in:
Nishi 2026-06-20 02:23:55 +09:00
commit 3003d03560
2 changed files with 14 additions and 3 deletions

View file

@ -2,6 +2,8 @@ cmake_minimum_required(VERSION 3.11)
project(sj4)
option(SJ4_GLOBAL "Use global variables or not" OFF)
file(GLOB_RECURSE SJ4CORE_SRCS lib/sj4core/**.c)
add_library(sj4core STATIC ${SJ4CORE_SRCS})
target_include_directories(sj4core PUBLIC include/sj4common include/sj4core)
@ -20,6 +22,8 @@ file(GLOB_RECURSE SJ4TEST_SRCS src/sj4test/**.c)
add_executable(sj4test ${SJ4TEST_SRCS})
target_link_libraries(sj4test PRIVATE sj4core)
#target_compile_definitions(sj4core PUBLIC SJ4_GLOBAL)
if(SJ4_GLOBAL)
target_compile_definitions(sj4core PUBLIC SJ4_GLOBAL)
endif()
target_compile_definitions(sj4mkdic PRIVATE UTF8 ENGLISH)