-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
89 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
## project-externalproject | ||
|
||
Test [`externalproject`](https://premake.github.io/docs/externalproject) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
local Root = path.getabsolute(".") | ||
|
||
if (_ACTION == nil) then | ||
return | ||
end | ||
|
||
local LocationDir = path.join(Root, "external_solution", _ACTION) | ||
|
||
workspace "Project" | ||
location(LocationDir) | ||
configurations {"Debug", "Release"} | ||
|
||
objdir(path.join(LocationDir, "obj")) -- premake adds $(configName)/$(AppName) | ||
startproject "externalStaticLib" | ||
|
||
project "externalStaticLib" | ||
filename "StaticLib" | ||
kind "StaticLib" | ||
language "C++" | ||
targetdir(path.join(LocationDir, "bin/%{cfg.buildcfg}")) | ||
targetname("externalStaticLib") | ||
|
||
files { path.join(Root, "src/staticLib/**") } | ||
|
||
project "externalSharedLib" | ||
filename "SharedLib" | ||
kind "SharedLib" | ||
language "C++" | ||
targetdir(path.join("solution", _ACTION, "bin/%{cfg.buildcfg}")) | ||
targetname("externalSharedLib") | ||
|
||
files { "src/sharedLib/**" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
local Root = path.getabsolute(".") | ||
|
||
if (_ACTION == nil) then | ||
return | ||
end | ||
|
||
local LocationDir = path.join(Root, "solution", _ACTION) | ||
|
||
workspace "Project" | ||
location(LocationDir) | ||
configurations {"Debug", "Release"} | ||
|
||
objdir(path.join(LocationDir, "obj")) -- premake adds $(configName)/$(AppName) | ||
targetdir(path.join(LocationDir, "bin/%{cfg.buildcfg}")) | ||
startproject "app" | ||
|
||
project "app" | ||
kind "ConsoleApp" | ||
targetname "app" | ||
|
||
files { "src/app/main.cpp" } | ||
|
||
libdirs{path.join("external_solution", _ACTION, "bin", "%{cfg.buildcfg}")} | ||
libdirs{path.join(LocationDir, "bin", "%{cfg.buildcfg}")} | ||
links {"externalStaticLib", "externalSharedLib"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#ifdef _MSC_VER | ||
# define DLL_IMPORT __declspec(dllimport) // used when called internally | ||
#else | ||
# define DLL_IMPORT | ||
#endif | ||
|
||
void staticLibFunction(); | ||
DLL_IMPORT void sharedLibFunction(); | ||
|
||
int main() | ||
{ | ||
staticLibFunction(); | ||
sharedLibFunction(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#ifdef _MSC_VER | ||
#define DLL_EXPORT __declspec(dllexport) // used when called from DLL | ||
#else | ||
#define DLL_EXPORT | ||
#endif | ||
|
||
DLL_EXPORT void sharedLibFunction() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
void staticLibFunction() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters