@@ -5,7 +5,7 @@ cmake_minimum_required(VERSION 3.16)
55set (CMAKE_CXX_STANDARD 17)
66set (CMAKE_CXX_STANDARD_REQUIRED true )
77if (APPLE )
8- set (CMAKE_OSX_DEPLOYMENT_TARGET 10.13 CACHE STRING "" )
8+ set (CMAKE_OSX_DEPLOYMENT_TARGET 11 CACHE STRING "" )
99endif ()
1010
1111set (src ${CMAKE_SOURCE_DIR} )
@@ -15,53 +15,53 @@ include(FetchContent)
1515set (FETCHCONTENT_QUIET OFF )
1616set (diff_match_patch_zip 7f95b37e554453262e2bcda830724fc362614103.zip)
1717FetchContent_Declare(diff_match_patch
18- URL https://github.com/leutloff/diff-match-patch-cpp-stl/archive/${diff_match_patch_zip} )
18+ URL https://github.com/leutloff/diff-match-patch-cpp-stl/archive/${diff_match_patch_zip} )
1919FetchContent_MakeAvailable(diff_match_patch)
2020set (lua_tgz lua-5.4.4.tar.gz)
2121set (lua_url file://${CMAKE_BINARY_DIR} /_deps/${lua_tgz} )
2222if (NOT EXISTS ${CMAKE_BINARY_DIR} /_deps/${lua_tgz} )
23- set (lua_url https://www.lua.org/ftp/${lua_tgz} )
23+ set (lua_url https://www.lua.org/ftp/${lua_tgz} )
2424endif ()
2525FetchContent_Declare(lua URL ${lua_url} )
2626FetchContent_MakeAvailable(lua)
2727
2828# Build.
2929project (diff LANGUAGES CXX C)
3030if (WIN32 )
31- # On Windows, DLLs cannot do dynamic lookup. They need symbols to link to at build time.
32- # Rather than fetching a Textadept build and creating separate DLLs linked to textadept.lib and
33- # textadept-curses.lib, just embed a minimal copy of Lua in a single DLL.
34- file (GLOB lua_src ${lua_SOURCE_DIR} /src/*.c)
35- list (FILTER lua_src EXCLUDE REGEX "(lua|luac|[^x]lib|linit)\. c$" ) # of *lib.c, keep only lauxlib.c
31+ # On Windows, DLLs cannot do dynamic lookup. They need symbols to link to at build time.
32+ # Rather than fetching a Textadept build and creating separate DLLs linked to textadept.lib and
33+ # textadept-curses.lib, just embed a minimal copy of Lua in a single DLL.
34+ file (GLOB lua_src ${lua_SOURCE_DIR} /src/*.c)
35+ list (FILTER lua_src EXCLUDE REGEX "(lua|luac|[^x]lib|linit)\. c$" ) # of *lib.c, keep only lauxlib.c
3636endif ()
3737add_library (diff SHARED diff.cxx ${lua_src} )
3838target_include_directories (diff PRIVATE ${diff_match_patch_SOURCE_DIR} ${lua_SOURCE_DIR} /src)
3939if (WIN32 )
40- target_compile_definitions (diff PRIVATE LUA_BUILD_AS_DLL LUA_LIB)
40+ target_compile_definitions (diff PRIVATE LUA_BUILD_AS_DLL LUA_LIB)
4141elseif (APPLE )
42- target_link_options (diff PRIVATE -undefined dynamic_lookup)
42+ target_link_options (diff PRIVATE -undefined dynamic_lookup)
4343endif ()
4444
4545# Install.
4646install (TARGETS diff DESTINATION ${src} )
4747if (NOT (WIN32 OR APPLE ))
48- install (CODE "file(RENAME ${src} /libdiff.so ${src} /diff.so)" )
48+ install (CODE "file(RENAME ${src} /libdiff.so ${src} /diff.so)" )
4949elseif (APPLE )
50- install (CODE "file(RENAME ${src} /libdiff.dylib ${src} /diffosx.so)" )
50+ install (CODE "file(RENAME ${src} /libdiff.dylib ${src} /diffosx.so)" )
5151endif ()
5252if (NOT (WIN32 OR APPLE ))
53- include (GNUInstallDirs)
54- set (module_dir ${CMAKE_INSTALL_FULL_DATADIR} /textadept/modules/file_diff)
55- install (CODE "file(MAKE_DIRECTORY ${module_dir} )" )
56- install (FILES init.lua diff.so DESTINATION ${module_dir} )
53+ include (GNUInstallDirs)
54+ set (module_dir ${CMAKE_INSTALL_FULL_DATADIR} /textadept/modules/file_diff)
55+ install (CODE "file(MAKE_DIRECTORY ${module_dir} )" )
56+ install (FILES init.lua diff.so DESTINATION ${module_dir} )
5757endif ()
5858
5959# Documentation.
6060get_filename_component (ta_dir ${src} /../../ ABSOLUTE )
6161add_custom_target (docs DEPENDS README.md )
6262add_custom_command (OUTPUT ${src} /README.md
63- COMMAND ldoc --filter markdowndoc.ldoc ${src} /init.lua > ${src} /README.md
64- COMMAND sed -i -e "1,+4d" -e "6c# File Diff" -e "7d" -e "s/^##/#/;" ${src} /README.md
65- DEPENDS init.lua
66- WORKING_DIRECTORY ${ta_dir} /scripts
67- VERBATIM )
63+ COMMAND ldoc --filter markdowndoc.ldoc ${src} /init.lua > ${src} /README.md
64+ COMMAND sed -i -e "1,+4d" -e "6c# File Diff" -e "7d" -e "s/^##/#/;" ${src} /README.md
65+ DEPENDS init.lua
66+ WORKING_DIRECTORY ${ta_dir} /scripts
67+ VERBATIM )
0 commit comments