From 9e8598fb1ca359143600d6bb2e8b317126a86bcc Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Sat, 16 May 2020 20:59:10 +0100 Subject: Upgrade to C++17 [CMake] (#4717) * Make our CMake slightly less insane --- src/Bindings/CheckBindingsDependencies.lua | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'src/Bindings/CheckBindingsDependencies.lua') diff --git a/src/Bindings/CheckBindingsDependencies.lua b/src/Bindings/CheckBindingsDependencies.lua index c0565ead8..50e915311 100644 --- a/src/Bindings/CheckBindingsDependencies.lua +++ b/src/Bindings/CheckBindingsDependencies.lua @@ -19,8 +19,8 @@ local g_ShouldIgnorePkg = local g_ShouldIgnoreCMake = { ["tolua"] = true, - ["../Bindings/AllToLua.pkg"] = true, - ["../Bindings/BindingsProcessor.lua"] = true, + ["Bindings/AllToLua.pkg"] = true, + ["Bindings/BindingsProcessor.lua"] = true, } @@ -37,7 +37,17 @@ local function getAllToLuaPkgFiles() if (g_ShouldIgnorePkg[a_FileName]) then return end - a_FileName = a_FileName:gsub("../Bindings/", "") -- Normalize the path + + -- Normalize the path: AllToLua is relative to src\Bindings + -- but the CMake dependencies list is relative to src\ + a_FileName, cnt = a_FileName:gsub("%.%./", "") + + -- If no replacements were done, this entry must point to a file + -- inside the Bindings folder; normalize it + if cnt == 0 then + a_FileName = "Bindings/" .. a_FileName + end + table.insert(res, a_FileName) res[a_FileName] = true end @@ -54,7 +64,7 @@ end --- Returns a sorted list of all files listed as dependencies in CMakeLists.txt -- The returned table has both an array part (list of files) and a dictionary part ("filename" -> true) local function getCMakeListsFiles() - local f = assert(io.open("CMakeLists.txt", "r")) + local f = assert(io.open("../../CMake/GenerateBindings.cmake", "r")) local contents = f:read("*all") f:close() local res = {} @@ -69,7 +79,6 @@ local function getCMakeListsFiles() if (g_ShouldIgnoreCMake[a_FileName]) then return end - a_FileName = a_FileName:gsub("../Bindings/", "") -- Normalize the path table.insert(res, a_FileName) res[a_FileName] = true end -- cgit v1.2.3