diff options
| -rw-r--r-- | tests/projects/swift/bidirectional_cxx_interop_lib/xmake.lua | 2 | ||||
| -rw-r--r-- | xmake/languages/swift/load.lua | 6 | ||||
| -rw-r--r-- | xmake/modules/core/tools/swift_frontend.lua | 10 | ||||
| -rw-r--r-- | xmake/modules/core/tools/swiftc.lua | 10 |
4 files changed, 26 insertions, 2 deletions
diff --git a/tests/projects/swift/bidirectional_cxx_interop_lib/xmake.lua b/tests/projects/swift/bidirectional_cxx_interop_lib/xmake.lua index aca6d4235..b2840f1fd 100644 --- a/tests/projects/swift/bidirectional_cxx_interop_lib/xmake.lua +++ b/tests/projects/swift/bidirectional_cxx_interop_lib/xmake.lua @@ -6,7 +6,7 @@ target("fibonacci") set_values("swift.modulename", "SwiftFibonacci") set_values("swift.interop", "cxx") -- for automatic clang modulemap - add_scflags("-Iinclude/fibonacci", {public = true}) + add_includedirs("include/fibonacci", {public = true}) add_includedirs("include") add_headerfiles("include/**.h") diff --git a/xmake/languages/swift/load.lua b/xmake/languages/swift/load.lua index 90277ed90..08e7efde8 100644 --- a/xmake/languages/swift/load.lua +++ b/xmake/languages/swift/load.lua @@ -51,9 +51,13 @@ function _get_apis() } apis.paths = { -- target.add_xxx - "target.add_linkdirs" + "target.add_includedirs" + , "target.add_sysincludedirs" + , "target.add_linkdirs" , "target.add_frameworkdirs" -- option.add_xxx + , "option.add_includedirs" + , "option.add_sysincludedirs" , "option.add_linkdirs" , "option.add_frameworkdirs" } diff --git a/xmake/modules/core/tools/swift_frontend.lua b/xmake/modules/core/tools/swift_frontend.lua index 002e323d7..66a0c488b 100644 --- a/xmake/modules/core/tools/swift_frontend.lua +++ b/xmake/modules/core/tools/swift_frontend.lua @@ -110,6 +110,16 @@ function nf_vectorext(self, extension) return maps[extension] end +-- make the includedir flag +function nf_includedir(self, includedir) + return "-I" .. includedir +end + +-- make the sysincludedir flag +function nf_sysincludedir(self, dir) + return nf_includedir(self, dir) +end + -- make the define flag function nf_define(self, macro) return {"-Xcc", "-D" .. macro} diff --git a/xmake/modules/core/tools/swiftc.lua b/xmake/modules/core/tools/swiftc.lua index c19072fd7..109d461d2 100644 --- a/xmake/modules/core/tools/swiftc.lua +++ b/xmake/modules/core/tools/swiftc.lua @@ -120,6 +120,16 @@ function nf_vectorext(self, extension) return maps[extension] end +-- make the includedir flag +function nf_includedir(self, includedir) + return "-I" .. includedir +end + +-- make the sysincludedir flag +function nf_sysincludedir(self, dir) + return nf_includedir(self, dir) +end + -- make the define flag function nf_define(self, macro) return {"-Xcc", "-D" .. macro} |
