diff --git a/.gitmodules b/.gitmodules index 072c58ceb..c0d692d6f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -18,4 +18,4 @@ url = https://github.com/Rythe-Interactive/Rythe-Standard-Library.git [submodule "libraries/third_party/catch2"] path = libraries/third_party/catch2 - url = https://github.com/catchorg/Catch2.git + url = https://github.com/Rythe-Interactive/Catch2.git diff --git a/libraries/third_party/catch2 b/libraries/third_party/catch2 index 3acb8b30f..723324f7e 160000 --- a/libraries/third_party/catch2 +++ b/libraries/third_party/catch2 @@ -1 +1 @@ -Subproject commit 3acb8b30f1ce0c801de0e3880ea1f6467dd0105c +Subproject commit 723324f7ea103718c88e76b79033c82c59fe5e81 diff --git a/premake/rythe/filesystem.lua b/premake/rythe/filesystem.lua index 9e623be0d..e4f8c05e2 100644 --- a/premake/rythe/filesystem.lua +++ b/premake/rythe/filesystem.lua @@ -2,14 +2,14 @@ local fs = {} function fs.exists(file) local ok, err, code = os.rename(file, file) - if not ok then - if code == 13 then - -- Permission denied, but it exists - return true - end - return false + if not ok then + if code == 13 or code == 32 or code == 5 then + -- Permission denied, but it exists + return true, nil, nil + end + return false, err, code end - return true + return true, nil, nil end function fs.readLines(file) diff --git a/premake/rythe/projects.lua b/premake/rythe/projects.lua index e9140e0b5..96dcb6168 100644 --- a/premake/rythe/projects.lua +++ b/premake/rythe/projects.lua @@ -327,13 +327,21 @@ local function getDepsRecursive(project, projectType) if fs.exists(path .. "/") then thirdPartyProject.files = {} - - if fs.exists(path .. "/src/" .. thirdPartyProject.name .. "/") then - thirdPartyProject.files[#thirdPartyProject.files + 1] = path .. "/src/" .. thirdPartyProject.name .. "/**" + thirdPartyProject.additional_include_dirs = {} + thirdPartyProject.additional_external_include_dirs = {} + + local srcDir = path .. "/src/" .. thirdPartyProject.name .. "/" + if fs.exists(srcDir) then + thirdPartyProject.files[#thirdPartyProject.files + 1] = srcDir .. "**" + thirdPartyProject.additional_include_dirs[#thirdPartyProject.additional_include_dirs + 1] = srcDir + thirdPartyProject.additional_external_include_dirs[#thirdPartyProject.additional_external_include_dirs + 1] = srcDir end - - if fs.exists(path .. "/include/" .. thirdPartyProject.name .. "/") then - thirdPartyProject.files[#thirdPartyProject.files + 1] = path .. "/include/" .. thirdPartyProject.name .. "/**" + + local includeDir = path .. "/include/" .. thirdPartyProject.name .. "/" + if fs.exists(includeDir) then + thirdPartyProject.files[#thirdPartyProject.files + 1] = includeDir .. "**" + thirdPartyProject.additional_include_dirs[#thirdPartyProject.additional_include_dirs + 1] = includeDir + thirdPartyProject.additional_external_include_dirs[#thirdPartyProject.additional_external_include_dirs + 1] = includeDir end if utils.tableIsEmpty(thirdPartyProject.files) then @@ -341,6 +349,16 @@ local function getDepsRecursive(project, projectType) path .. "/src/**", path .. "/include/**" } + + thirdPartyProject.additional_include_dirs = { + path .. "/src", + path .. "/include" + } + + thirdPartyProject.additional_external_include_dirs = { + path .. "/src", + path .. "/include" + } end depProject = loadProject(depId, thirdPartyProject, project.src, path, thirdPartyProject.name, "library") @@ -418,8 +436,12 @@ function projects.submit(proj) local depProject, depId, depType = findAssembly(assemblyId) if depProject ~= nil then - externalIncludeDirs[#externalIncludeDirs + 1] = depProject.location .. "/" .. projectTypeFilesDir(depType, "") + externalIncludeDirs[#externalIncludeDirs + 1] = depProject.location .. projectTypeFilesDir(depType, "") + if isThirdPartyProject(depId) then + externalIncludeDirs[#externalIncludeDirs + 1] = depProject.location .. "/include/" + end + depNames[#depNames + 1] = depProject.alias .. projectNameSuffix(depType) allDefines[#allDefines + 1] = depProject.group == "" and string.upper(depProject.alias) .. "=1" or string.upper(string.gsub(depProject.group, "[/\\]", "_")) .. "_" .. string.upper(depProject.alias) .. "=1" @@ -433,6 +455,14 @@ function projects.submit(proj) libdirs(libDirs) end + if not utils.tableIsEmpty(proj.additional_include_dirs) then + includedirs(proj.additional_include_dirs) + end + + if not utils.tableIsEmpty(proj.additional_external_include_dirs) then + externalincludedirs(proj.additional_external_include_dirs) + end + architecture(buildSettings.platform) if projectType ~= "util" then diff --git a/utils/test utils/main.cpp b/utils/test utils/main.cpp index e69de29bb..5429d98f8 100644 --- a/utils/test utils/main.cpp +++ b/utils/test utils/main.cpp @@ -0,0 +1,6 @@ +#include + +int main(int argc, char* argv[]) +{ + return Catch::Session().run(argc, argv); +} \ No newline at end of file