1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-09 01:18:00 +00:00
putty-source/charset/CMakeLists.txt
Simon Tatham fa353e9f4a Add missing dependencies on generated source files.
The utils library shouldn't be built until cmake_commit.c exists, and
similarly with the charset library and sbcsdat.c.
2021-04-18 17:01:50 +01:00

31 lines
873 B
CMake

include(FindPerl)
if(NOT PERL_EXECUTABLE)
message(FATAL_ERROR "Perl is required to autogenerate sbcsdat.c")
endif()
set(GENERATED_SBCSDAT_C ${GENERATED_SOURCES_DIR}/sbcsdat.c)
add_custom_command(OUTPUT ${GENERATED_SBCSDAT_C}.tmp
COMMAND ${PERL_EXECUTABLE} ${CMAKE_SOURCE_DIR}/charset/sbcsgen.pl
-o ${GENERATED_SBCSDAT_C}.tmp
DEPENDS ${CMAKE_SOURCE_DIR}/charset/sbcsgen.pl
${CMAKE_SOURCE_DIR}/charset/sbcs.dat)
add_custom_target(generated_sbcsdat_c
BYPRODUCTS ${GENERATED_SBCSDAT_C}
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${GENERATED_SBCSDAT_C}.tmp ${GENERATED_SBCSDAT_C}
DEPENDS ${GENERATED_SBCSDAT_C}.tmp
COMMENT "Updating sbcsdat.c")
add_library(charset STATIC
fromucs.c
localenc.c
macenc.c
mimeenc.c
sbcs.c
${GENERATED_SBCSDAT_C}
slookup.c
toucs.c
utf8.c
xenc.c)
add_dependencies(charset generated_sbcsdat_c)