Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/assembly/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
windows上的Premake获取不正确的realpath_Premake - Fatal编程技术网

windows上的Premake获取不正确的realpath

windows上的Premake获取不正确的realpath,premake,Premake,我需要在premake中创建define,它为我提供项目的绝对路径(Windows和Linux)。 我曾经 但这对我不起作用。定义返回值,例如c:/aaa/bbb/ccc和windows需要 c:\\aaa\\bbb\\ccc 我也试过了 defines {'ABSOLUTE_PATH="' ..os.realpath('.').. '"'} 但它给了我c:\aaa\bbb\ccc,这会导致错误“格式错误的通用字符名”。有没有简单的方法可以获得正确生成的值?您可能正在寻找类似的方法: def

我需要在premake中创建define,它为我提供项目的绝对路径(Windows和Linux)。 我曾经

但这对我不起作用。定义返回值,例如c:/aaa/bbb/ccc和windows需要 c:\\aaa\\bbb\\ccc 我也试过了

defines {'ABSOLUTE_PATH="' ..os.realpath('.').. '"'} 

但它给了我c:\aaa\bbb\ccc,这会导致错误“格式错误的通用字符名”。有没有简单的方法可以获得正确生成的值?

您可能正在寻找类似的方法:

defines { 'ABSOLUTE_PATH="%{prj.abspath}"' }
使用此令牌可确保获得生成项目的实际路径,该路径可能与当前工作目录相同,也可能不同,具体取决于您的项目

但你也可以尝试:

defines { 'ABSOLUTE_PATH="' .. path.translate(os.getcwd()) .. '"' }
defines { 'ABSOLUTE_PATH="' .. path.translate(os.getcwd()) .. '"' }