Skip to content

Commit

Permalink
Test project/workspace location at different directory level (so getr…
Browse files Browse the repository at this point in the history
…elative differ between them).
  • Loading branch information
Jarod42 committed Sep 6, 2024
1 parent 8bd0e51 commit 85823af
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
5 changes: 3 additions & 2 deletions projects/project-location/premake4.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ if (_ACTION == nil) then
end

local LocationDir = path.join(Root, "solution/" .. _ACTION) -- premake4 doesn't support variadic join
local ProjectLocationDir = path.join(Root, "project-solution/" .. _ACTION) -- premake4 doesn't support variadic join
local ProjectLocationDir = path.join(Root, "project-solution/subdir/" .. _ACTION) -- premake4 doesn't support variadic join

solution "Project"
language "c++"
Expand All @@ -22,7 +22,8 @@ project "app"
targetdir(path.join(LocationDir, "bin/Release"))
targetname "app"

files { path.join(Root, "src/app/main.cpp") }
files { path.join(Root, "src/app/main.cpp")
includedirs { 'src/staticlib' }
links {"staticLib"}

project "staticLib"
Expand Down
3 changes: 2 additions & 1 deletion projects/project-location/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ if (_ACTION == nil) then
end

local LocationDir = "solution/%{_ACTION}"
local ProjectLocationDir = "project-solution/%{_ACTION}"
local ProjectLocationDir = "project-solution/subdir/%{_ACTION}"

workspace "Project"
language "c++"
Expand All @@ -21,6 +21,7 @@ project "app"
targetname "app"

files { "src/app/main.cpp" }
includedirs { 'src/staticlib' }
links {"staticLib"}

project "staticLib"
Expand Down
2 changes: 1 addition & 1 deletion projects/project-location/src/app/main.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
void staticLibFunction();
#include "lib.h"

int main()
{
Expand Down
6 changes: 6 additions & 0 deletions projects/project-location/src/staticlib/lib.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#ifndef LIB_H
#define LIB_H

void staticLibFunction();

#endif // LIB_H

0 comments on commit 85823af

Please sign in to comment.