Skip to content

Instantly share code, notes, and snippets.

@tsafin

tsafin/luajit-add-dirs.patch Secret

Created Feb 8, 2021
Embed
What would you like to do?
diff --git a/test/tarantool-tests/CMakeLists.txt b/test/tarantool-tests/CMakeLists.txt
index 0be4b34..9d1b643 100644
--- a/test/tarantool-tests/CMakeLists.txt
+++ b/test/tarantool-tests/CMakeLists.txt
@@ -38,27 +38,27 @@ macro(BuildTestLib lib sources)
)
endif()
# XXX: Append the lib to be built to the dependecy list.
- # Unfortunately, CMake is a crap and there is no other way to
- # extend the list in parent scope but join two strings with
- # semicolon. If one finds the normal way to make it work, feel
- # free to reach me.
set(TESTLIBS "${lib};${TESTLIBS}" PARENT_SCOPE)
- # Add the directory where the lib is built to the LUA_CPATH
+ # Add the directory where the lib is built in to the LUA_CPATH
# environment variable, so interpreter can find and load it.
- # XXX: Here we see the other side of the coin. If one joins two
- # strings with semicolon, the value automatically becomes the
- # list. I have no idea what is wrong with this tool, but I found
- # a single working solution to make LUA_CPATH be a string via
- # "escaping" the semicolon right in string interpolation.
+ # To avoid interpretation of such string as cmake list we
+ # escape semicolons inside of LUA_CPATH
set(LUA_CPATH "${CMAKE_CURRENT_BINARY_DIR}/?${CMAKE_SHARED_LIBRARY_SUFFIX}\;${LUA_CPATH}" PARENT_SCOPE)
# Also add this directory to LD_LIBRARY_PATH environment
# variable, so FFI machinery can find and load it.
set(LD_LIBRARY_PATH "${CMAKE_CURRENT_BINARY_DIR}:${LD_LIBRARY_PATH}" PARENT_SCOPE)
endmacro()
-add_subdirectory(gh-4427-ffi-sandwich)
-add_subdirectory(lj-flush-on-trace)
-add_subdirectory(misclib-getmetrics-capi)
+macro(add_all_subdirectories)
+ file(GLOB entries RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*")
+ foreach(entry ${entries})
+ if (IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${entry})
+ add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/${entry})
+ endif()
+ endforeach()
+endmacro()
+
+add_all_subdirectories()
# The part of memory profiler toolchain is located in tools
# directory and auxiliary tests-related modules are located in the
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment