Skip to content
Snippets Groups Projects
Commit 3bacde16 authored by Vladimir Davydov's avatar Vladimir Davydov Committed by Vladimir Davydov
Browse files

cmake: fix lua_source for files stored in superproject

If Tarantool is built as a subproject, and there's a Lua source file
stored in the superproject directory, its path won't start with
PROJECT_SOURCE_DIR and hence won't be replaced with PROJECT_BINARY_DIR
by the lua_source() function. As a result, the lua.c file generated by
lua_source() will be put in the source directory instead of the binary
directory. Fix this by using CMAKE dirs instead of PROJECT dirs.

Ironically, CMAKE dirs were replaced with PROJECT dirs everywhere in
the first place to allow building Tarantool as a subproject, see commit
d8097325 ("cmake: align folders dependencies"). This patch basically
reverts that change.

NO_DOC=cmake
NO_TEST=cmake
NO_CHANGELOG=cmake
parent cab6822f
No related branches found
No related tags found
No related merge requests found
......@@ -40,7 +40,7 @@ endmacro(set_source_files_compile_flags)
# A helper function to compile *.lua source into *.lua.c sources
function(lua_source varname filename symbolname)
if (IS_ABSOLUTE "${filename}")
string (REPLACE "${PROJECT_SOURCE_DIR}" "${PROJECT_BINARY_DIR}"
string (REPLACE "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}"
genname "${filename}")
set (srcfile "${filename}")
set (tmpfile "${genname}.new.c")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment