Introduce SJ4_BUILD_TOOLS

This commit is contained in:
Nishi 2026-06-22 07:48:17 +09:00
commit c066168831

View file

@ -6,7 +6,8 @@ option(SJ4_GLOBAL "Use global variables or not" OFF)
option(SJ4_EMBED "Embed main dictionary or not" OFF)
option(SJ4_EMBED_PLUS "Embed pubdic+ as main dictionary or not" OFF)
option(SJ4_NO_UNICODE "Remove Unicode code completely" OFF)
option(SJ4_BUILD_ONLY_LIB "Build only library" OFF)
option(SJ4_BUILD_ONLY_LIB "Always build only library" OFF)
option(SJ4_BUILD_TOOLS "Always build tools" OFF)
file(GLOB_RECURSE SJ4COMMON_SRCS lib/sj4common/**.c)
add_library(sj4common STATIC ${SJ4COMMON_SRCS})
@ -44,7 +45,7 @@ if(NOT SJ4_GLOBAL)
endif()
endif()
if(NOT CMAKE_BINARY_DIR MATCHES CMAKE_CURRENT_SOURCE_DIR AND NOT SJ4_BUILD_ONLY_LIB)
if(SJ4_BUILD_TOOLS OR (NOT CMAKE_BINARY_DIR MATCHES CMAKE_CURRENT_SOURCE_DIR AND NOT SJ4_BUILD_ONLY_LIB))
file(GLOB_RECURSE SJ4MKDIC_SRCS src/sj4mkdic/**.c)
add_executable(sj4mkdic ${SJ4MKDIC_SRCS})
target_include_directories(sj4mkdic PRIVATE include/sj4common include/sj4core)