Skip to content

Commit cec32ca

Browse files
committed
Document swiftmodule namespace process in Makefile
1 parent 952a563 commit cec32ca

File tree

2 files changed

+19
-7
lines changed

2 files changed

+19
-7
lines changed

Makefile

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,20 @@ BASE_OPTS=-Xcc -I$(PYTHON_INCLUDE) \
2727
-Xlinker -undefined -Xlinker dynamic_lookup \
2828
-Xlinker -all_load
2929

30+
31+
# Build namespaced versions of Vim and VimAsync libs.
32+
# The modules have a prefix of the plugin name, to avoid conflicts
33+
# when the code is linked into the Vim process.
34+
# The module is imported as "import $(PLUGIN_NAME)Vim"
35+
# FIXME: Consider other ways to do this that work transitively and
36+
# doesn't trigger rebuilds
37+
38+
3039
.PHONY: vim_lib, renamed_vim_lib
3140
vim_lib: SWIFT_OPTS=--product Vim \
3241
-Xswiftc -module-name=$(PLUGIN_NAME)Vim \
3342
-Xswiftc -module-link-name=$(PLUGIN_NAME)Vim \
3443
$(BASE_OPTS)
35-
36-
# FIXME: this triggers rebuilds.
3744
renamed_vim_lib: vim_lib
3845
@ditto $(BUILD_DIR)/Vim.swiftmodule \
3946
$(BUILD_DIR)/$(PLUGIN_NAME)Vim.swiftmodule
@@ -42,7 +49,6 @@ renamed_vim_lib: vim_lib
4249
@ditto $(BUILD_DIR)/libVim.a \
4350
$(BUILD_DIR)/lib$(PLUGIN_NAME)Vim.a
4451

45-
# FIXME: this triggers rebuilds.
4652
.PHONY: vim_async_lib, renamed_vim_lib_async
4753
vim_async_lib: SWIFT_OPTS=--product VimAsync \
4854
-Xswiftc -module-name=$(PLUGIN_NAME)VimAsync \

PluginGenerator/Makefile.tpl

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,20 @@ BASE_OPTS=-Xcc -I$(PYTHON_INCLUDE) \
2222
-Xlinker -undefined -Xlinker dynamic_lookup \
2323
-Xlinker -all_load
2424

25+
26+
27+
# Build namespaced versions of Vim and VimAsync libs.
28+
# The modules have a prefix of the plugin name, to avoid conflicts
29+
# when the code is linked into the Vim process.
30+
# The module is imported as "import $(PLUGIN_NAME)Vim"
31+
# FIXME: Consider other ways to do this that work transitively and
32+
# doesn't trigger rebuilds
33+
2534
.PHONY: vim_lib, renamed_vim_lib
2635
vim_lib: SWIFT_OPTS=--product Vim \
2736
-Xswiftc -module-name=$(PLUGIN_NAME)Vim \
2837
-Xswiftc -module-link-name=$(PLUGIN_NAME)Vim \
2938
$(BASE_OPTS)
30-
31-
# FIXME: this triggers rebuilds.
3239
renamed_vim_lib: vim_lib
3340
@ditto $(BUILD_DIR)/Vim.swiftmodule \
3441
$(BUILD_DIR)/$(PLUGIN_NAME)Vim.swiftmodule
@@ -37,7 +44,6 @@ renamed_vim_lib: vim_lib
3744
@ditto $(BUILD_DIR)/libVim.a \
3845
$(BUILD_DIR)/lib$(PLUGIN_NAME)Vim.a
3946

40-
# FIXME: this triggers rebuilds.
4147
.PHONY: vim_async_lib, renamed_vim_lib_async
4248
vim_async_lib: SWIFT_OPTS=--product VimAsync \
4349
-Xswiftc -module-name=$(PLUGIN_NAME)VimAsync \
@@ -49,7 +55,7 @@ renamed_vim_async_lib: vim_async_lib
4955
ditto $(BUILD_DIR)/VimAsync.swiftdoc \
5056
$(BUILD_DIR)/$(PLUGIN_NAME)VimAsync.swiftdoc
5157
@ditto $(BUILD_DIR)/libVimAsync.a \
52-
$(BUILD_DIR)/lib$(PLUGIN_NAME)libVimAsync.a
58+
$(BUILD_DIR)/lib$(PLUGIN_NAME)VimAsync.a
5359

5460
# Main plugin lib
5561
.PHONY: plugin_lib

0 commit comments

Comments
 (0)