From: Igor Munkin via Tarantool-patches <tarantool-patches@dev.tarantool.org> To: Sergey Kaplun <skaplun@tarantool.org>, Timur Safin <tsafin@tarantool.org> Cc: tarantool-patches@dev.tarantool.org Subject: [Tarantool-patches] [PATCH 1/3] build: fix lua.c file generation Date: Thu, 4 Feb 2021 02:22:15 +0300 [thread overview] Message-ID: <d743d6386bda87ce58adffab7172ba3fffcad26c.1612390822.git.imun@tarantool.org> (raw) In-Reply-To: <cover.1612390822.git.imun@tarantool.org> If Lua source path given to <lua_source> function is relative, the output file is generated in the binary directory. At the same time if the given path to be compiled to *.lua.c is absolute, the output file is generated in source directory instead of the binary one. This patch fixes the latter case providing the valid behaviour for out of source build type. Needed for #4862 Signed-off-by: Igor Munkin <imun@tarantool.org> --- cmake/utils.cmake | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cmake/utils.cmake b/cmake/utils.cmake index eaec821b3..6d6960468 100644 --- a/cmake/utils.cmake +++ b/cmake/utils.cmake @@ -40,9 +40,11 @@ endmacro(set_source_files_compile_flags) # A helper function to compile *.lua source into *.lua.c sources function(lua_source varname filename) if (IS_ABSOLUTE "${filename}") + string (REPLACE "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" + genname "${filename}") set (srcfile "${filename}") - set (tmpfile "${filename}.new.c") - set (dstfile "${filename}.c") + set (tmpfile "${genname}.new.c") + set (dstfile "${genname}.c") else(IS_ABSOLUTE "${filename}") set (srcfile "${CMAKE_CURRENT_SOURCE_DIR}/${filename}") set (tmpfile "${CMAKE_CURRENT_BINARY_DIR}/${filename}.new.c") -- 2.25.0
next prev parent reply other threads:[~2021-02-03 23:22 UTC|newest] Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-02-03 23:22 [Tarantool-patches] [PATCH 0/3] Adjust LuaJIT build system Igor Munkin via Tarantool-patches 2021-02-03 23:22 ` Igor Munkin via Tarantool-patches [this message] 2021-02-15 13:12 ` [Tarantool-patches] [PATCH 1/3] build: fix lua.c file generation Sergey Kaplun via Tarantool-patches 2021-02-19 21:17 ` Igor Munkin via Tarantool-patches 2021-02-03 23:22 ` [Tarantool-patches] [PATCH 2/3] build: adjust LuaJIT build system Igor Munkin via Tarantool-patches 2021-02-15 16:13 ` Sergey Kaplun via Tarantool-patches 2021-02-19 23:10 ` Igor Munkin via Tarantool-patches 2021-02-20 7:42 ` Timur Safin via Tarantool-patches 2021-02-03 23:22 ` [Tarantool-patches] [PATCH 3/3] ci: enable LuaJIT tests in CI Igor Munkin via Tarantool-patches 2021-02-15 16:29 ` Sergey Kaplun via Tarantool-patches 2021-02-19 21:29 ` Igor Munkin via Tarantool-patches [not found] ` <0b6601d7075c$64329060$2c97b120$@tarantool.org> 2021-02-20 10:18 ` Igor Munkin via Tarantool-patches 2021-02-24 7:16 ` Timur Safin via Tarantool-patches 2021-02-25 22:08 ` Igor Munkin via Tarantool-patches 2021-02-26 19:04 ` Timur Safin via Tarantool-patches 2021-02-26 19:09 ` [Tarantool-patches] [PATCH 0/3] Adjust LuaJIT build system Timur Safin via Tarantool-patches 2021-02-26 21:06 ` Igor Munkin via Tarantool-patches 2021-02-27 13:56 ` Sergey Kaplun via Tarantool-patches 2021-02-28 22:05 ` Igor Munkin via Tarantool-patches
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=d743d6386bda87ce58adffab7172ba3fffcad26c.1612390822.git.imun@tarantool.org \ --to=tarantool-patches@dev.tarantool.org \ --cc=imun@tarantool.org \ --cc=skaplun@tarantool.org \ --cc=tsafin@tarantool.org \ --subject='Re: [Tarantool-patches] [PATCH 1/3] build: fix lua.c file generation' \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox