Introduce SJ4_BUILD_ONLY_LIB
This commit is contained in:
parent
a160b81246
commit
19ddec8f77
1 changed files with 15 additions and 12 deletions
|
|
@ -6,6 +6,7 @@ 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)
|
||||
|
||||
file(GLOB_RECURSE SJ4COMMON_SRCS lib/sj4common/**.c)
|
||||
add_library(sj4common STATIC ${SJ4COMMON_SRCS})
|
||||
|
|
@ -43,17 +44,19 @@ if(NOT SJ4_GLOBAL)
|
|||
endif()
|
||||
endif()
|
||||
|
||||
file(GLOB_RECURSE SJ4MKDIC_SRCS src/sj4mkdic/**.c)
|
||||
add_executable(sj4mkdic ${SJ4MKDIC_SRCS})
|
||||
target_include_directories(sj4mkdic PRIVATE include/sj4common include/sj4core)
|
||||
target_compile_definitions(sj4mkdic PRIVATE ENGLISH)
|
||||
target_link_libraries(sj4mkdic PRIVATE sj4common)
|
||||
if(NOT SJ4_NO_UNICODE)
|
||||
target_compile_definitions(sj4mkdic PRIVATE UTF8)
|
||||
endif()
|
||||
if(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)
|
||||
target_compile_definitions(sj4mkdic PRIVATE ENGLISH)
|
||||
target_link_libraries(sj4mkdic PRIVATE sj4common)
|
||||
if(NOT SJ4_NO_UNICODE)
|
||||
target_compile_definitions(sj4mkdic PRIVATE UTF8)
|
||||
endif()
|
||||
|
||||
if(NOT SJ4_GLOBAL)
|
||||
file(GLOB_RECURSE SJ4TEST_SRCS src/sj4test/**.c)
|
||||
add_executable(sj4test ${SJ4TEST_SRCS})
|
||||
target_link_libraries(sj4test PRIVATE sj4lib)
|
||||
if(NOT SJ4_GLOBAL)
|
||||
file(GLOB_RECURSE SJ4TEST_SRCS src/sj4test/**.c)
|
||||
add_executable(sj4test ${SJ4TEST_SRCS})
|
||||
target_link_libraries(sj4test PRIVATE sj4lib)
|
||||
endif()
|
||||
endif()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue