@@ -5,7 +5,7 @@ cmake_minimum_required(VERSION 3.16)
5
5
set (CMAKE_CXX_STANDARD 17 )
6
6
set (CMAKE_CXX_STANDARD_REQUIRED true )
7
7
if (APPLE )
8
- set (CMAKE_OSX_DEPLOYMENT_TARGET 10.13 CACHE STRING "" )
8
+ set (CMAKE_OSX_DEPLOYMENT_TARGET 11 CACHE STRING "" )
9
9
endif ()
10
10
11
11
set (src ${CMAKE_SOURCE_DIR} )
@@ -15,53 +15,53 @@ include(FetchContent)
15
15
set (FETCHCONTENT_QUIET OFF )
16
16
set (diff_match_patch_zip 7f95b37e554453262e2bcda830724fc362614103.zip )
17
17
FetchContent_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} )
19
19
FetchContent_MakeAvailable (diff_match_patch )
20
20
set (lua_tgz lua-5.4.4.tar.gz )
21
21
set (lua_url file ://${CMAKE_BINARY_DIR}/_deps/${lua_tgz} )
22
22
if (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} )
24
24
endif ()
25
25
FetchContent_Declare (lua URL ${lua_url} )
26
26
FetchContent_MakeAvailable (lua )
27
27
28
28
# Build.
29
29
project (diff LANGUAGES CXX C )
30
30
if (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
36
36
endif ()
37
37
add_library (diff SHARED diff.cxx ${lua_src} )
38
38
target_include_directories (diff PRIVATE ${diff_match_patch_SOURCE_DIR} ${lua_SOURCE_DIR} /src )
39
39
if (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 )
41
41
elseif (APPLE )
42
- target_link_options (diff PRIVATE -undefined dynamic_lookup )
42
+ target_link_options (diff PRIVATE -undefined dynamic_lookup )
43
43
endif ()
44
44
45
45
# Install.
46
46
install (TARGETS diff DESTINATION ${src} )
47
47
if (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)" )
49
49
elseif (APPLE )
50
- install (CODE "file(RENAME ${src} /libdiff.dylib ${src} /diffosx.so)" )
50
+ install (CODE "file(RENAME ${src} /libdiff.dylib ${src} /diffosx.so)" )
51
51
endif ()
52
52
if (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} )
57
57
endif ()
58
58
59
59
# Documentation.
60
60
get_filename_component (ta_dir ${src} /../../ ABSOLUTE )
61
61
add_custom_target (docs DEPENDS README.md )
62
62
add_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