summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2020-03-17 14:00:40 -0400
committerGitHub <noreply@github.com>2020-03-17 14:00:40 -0400
commit21bbd3cf1b809a52611dcbdfec57c029454a5cc4 (patch)
tree0cb2f193724f5d815088f8e0682f8d120bab3ef0
parent315888efd24ad9463b2ddeb80bef00070cdf9a00 (diff)
Added --cuda-sdk-path option to premake5.lua. (#1278)
-rw-r--r--premake5.lua13
1 files changed, 9 insertions, 4 deletions
diff --git a/premake5.lua b/premake5.lua
index ec17bd267..bad578ef5 100644
--- a/premake5.lua
+++ b/premake5.lua
@@ -48,7 +48,6 @@
-- From in the build directory you can use
-- % premake5 --file=../premake5.lua --os=linux gmake
-
newoption {
trigger = "override-module",
description = "(Optional) Specify a lua file that can override functions",
@@ -93,6 +92,12 @@ newoption {
}
newoption {
+ trigger = "cuda-sdk-path",
+ description = "(Optional) Path to the root of CUDA SDK. If set will enable CUDA in build (ie in effect sets enable-cuda=true too)",
+ value = "path"
+}
+
+newoption {
trigger = "enable-profile",
description = "(Optional) If true will enable slang-profile tool - suitable for gprof usage on linux",
value = "bool",
@@ -104,14 +109,14 @@ buildLocation = _OPTIONS["build-location"]
executeBinary = (_OPTIONS["execute-binary"] == "true")
targetDetail = _OPTIONS["target-detail"]
buildGlslang = (_OPTIONS["build-glslang"] == "true")
-enableCuda = (_OPTIONS["enable-cuda"] == "true")
+enableCuda = not not (_OPTIONS["enable-cuda"] == "true" or _OPTIONS["cuda-sdk-path"])
enableProfile = (_OPTIONS["enable-profile"] == "true")
-- cudaPath is only set if cuda is enabled, and CUDA_PATH enviromental variable is set
cudaPath = nil
if enableCuda then
- -- Get the CUDA path from the environment variable. If set, CUDA will be assumed installed
- cudaPath = os.getenv("CUDA_PATH")
+ -- Get the CUDA path. Use the value set on cuda-sdk-path by default, if not set use the environment variable.
+ cudaPath = (_OPTIONS["cuda-sdk-path"] or os.getenv("CUDA_PATH"))
end
-- Is true when the target is really windows (ie not something on top of windows like cygwin)