diff options
author | Miodrag Milanovic <mmicko@gmail.com> | 2015-11-15 15:14:55 +0100 |
---|---|---|
committer | Miodrag Milanovic <mmicko@gmail.com> | 2015-11-15 15:14:55 +0100 |
commit | 225a99c0f6cfc60bb8f61fbc00dce92bdfb7b79a (patch) | |
tree | d9f2375942e9d8e55e9a3510ab782905ff157d59 /3rdparty | |
parent | 1fe2587c86ff2c8e77ae457a8bdd02e1e385d93f (diff) |
Add definitions to cmake target (nw)
Diffstat (limited to '3rdparty')
-rw-r--r-- | 3rdparty/genie/src/actions/cmake/cmake_project.lua | 5 | ||||
-rw-r--r-- | 3rdparty/genie/src/host/scripts.c | 4 |
2 files changed, 7 insertions, 2 deletions
diff --git a/3rdparty/genie/src/actions/cmake/cmake_project.lua b/3rdparty/genie/src/actions/cmake/cmake_project.lua index dc305930cd8..b98a20c65a8 100644 --- a/3rdparty/genie/src/actions/cmake/cmake_project.lua +++ b/3rdparty/genie/src/actions/cmake/cmake_project.lua @@ -42,7 +42,12 @@ function premake.cmake.project(prj) for _,v in ipairs(cfg.includedirs) do _p('include_directories(../%s)', premake.esc(v)) end + for _,v in ipairs(cfg.defines) do + _p('add_definitions(-D%s)', premake.esc(v)) + end + break end + break end if (prj.kind=='StaticLib') then diff --git a/3rdparty/genie/src/host/scripts.c b/3rdparty/genie/src/host/scripts.c index 9f74e7911e5..e00252112fa 100644 --- a/3rdparty/genie/src/host/scripts.c +++ b/3rdparty/genie/src/host/scripts.c @@ -176,8 +176,8 @@ const char* builtin_scripts[] = { "function premake.cmake.workspace(sln)\n_p('cmake_minimum_required(VERSION 2.8.4)')\n_p('')\nfor i,prj in ipairs(sln.projects) do\nlocal name = premake.esc(prj.name)\n_p('add_subdirectory(%s)', name)\nend\nend\n", /* actions/cmake/cmake_project.lua */ - "local cmake = premake.cmake\nlocal tree = premake.tree\nfunction cmake.files(prj)\nlocal tr = premake.project.buildsourcetree(prj)\ntree.traverse(tr, {\nonbranchenter = function(node, depth)\nend,\nonbranchexit = function(node, depth)\nend,\nonleaf = function(node, depth)\n_p(1, '../%s', node.cfg.name)\nend,\n}, true, 1)\nend\nfunction premake.cmake.project(prj)\nio.indent = \" \"\n_p('cmake_minimum_required(VERSION 2.8.4)')\n_p('')\n_p('project(%s)', premake.esc(prj.name))\n_p('set(')\n_p('source_list')\ncmake.files(prj)\n_p(')')\nlocal platforms = premake.filterplatforms(prj.solution, premake[_OPTIONS.cc].platforms, \"Native\")\nfor i = #platforms, 1, -1 do\nif premake.platforms[platforms[i]].iscrosscompiler then\ntable.remove(platforms, i)\nend\nend \nfor _, platform in ipairs(platforms) do\nfor cfg in premake.eachconfig(prj, platform) do\nfor _,v in ipairs(cfg.includedirs) do\n_p('include_directories(../%s)', premake.esc(v))\nend\nend\nend\nif (prj.kind=='StaticLib') then\n_p('add_library(%s STATIC ${sour" - "ce_list})',premake.esc(prj.name))\nend\nif (prj.kind=='SharedLib') then\n_p('add_library(%s SHARED ${source_list})',premake.esc(prj.name))\nend\nif (prj.kind=='ConsoleApp') then\n_p('add_executable(%s ${source_list})',premake.esc(prj.name))\nend\nif (prj.kind=='WindowedApp') then\n_p('add_executable(%s ${source_list})',premake.esc(prj.name))\nend\nend\n", + "local cmake = premake.cmake\nlocal tree = premake.tree\nfunction cmake.files(prj)\nlocal tr = premake.project.buildsourcetree(prj)\ntree.traverse(tr, {\nonbranchenter = function(node, depth)\nend,\nonbranchexit = function(node, depth)\nend,\nonleaf = function(node, depth)\n_p(1, '../%s', node.cfg.name)\nend,\n}, true, 1)\nend\nfunction premake.cmake.project(prj)\nio.indent = \" \"\n_p('cmake_minimum_required(VERSION 2.8.4)')\n_p('')\n_p('project(%s)', premake.esc(prj.name))\n_p('set(')\n_p('source_list')\ncmake.files(prj)\n_p(')')\nlocal platforms = premake.filterplatforms(prj.solution, premake[_OPTIONS.cc].platforms, \"Native\")\nfor i = #platforms, 1, -1 do\nif premake.platforms[platforms[i]].iscrosscompiler then\ntable.remove(platforms, i)\nend\nend \nfor _, platform in ipairs(platforms) do\nfor cfg in premake.eachconfig(prj, platform) do\nfor _,v in ipairs(cfg.includedirs) do\n_p('include_directories(../%s)', premake.esc(v))\nend\nfor _,v in ipairs(cfg.defines) do\n_p('add_definitions(-D%s)', premake.esc(" + "v))\nend\nbreak\nend\nbreak\nend\nif (prj.kind=='StaticLib') then\n_p('add_library(%s STATIC ${source_list})',premake.esc(prj.name))\nend\nif (prj.kind=='SharedLib') then\n_p('add_library(%s SHARED ${source_list})',premake.esc(prj.name))\nend\nif (prj.kind=='ConsoleApp') then\n_p('add_executable(%s ${source_list})',premake.esc(prj.name))\nend\nif (prj.kind=='WindowedApp') then\n_p('add_executable(%s ${source_list})',premake.esc(prj.name))\nend\nend\n", /* actions/make/_make.lua */ "_MAKE = { }\npremake.make = { }\nlocal make = premake.make\nfunction _MAKE.esc(value)\nlocal result\nif (type(value) == \"table\") then\nresult = { }\nfor _,v in ipairs(value) do\ntable.insert(result, _MAKE.esc(v))\nend\nreturn result\nelse\nresult = value:gsub(\"\\\\\", \"\\\\\\\\\")\nresult = result:gsub(\" \", \"\\\\ \")\nresult = result:gsub(\"%%(\", \"\\\\%(\")\nresult = result:gsub(\"%%)\", \"\\\\%)\")\nresult = result:gsub(\"$\\\\%((.-)\\\\%)\", \"$%(%1%)\")\nreturn result\nend\nend\nfunction premake.make_copyrule(source, target)\n_p('%s: %s', target, source)\n_p('\\t@echo Copying $(notdir %s)', target)\n_p('\\t-$(call COPY,%s,%s)', source, target)\nend\nfunction premake.make_mkdirrule(var)\n_p('\\t@echo Creating %s', var)\n_p('\\t-$(call MKDIR,%s)', var)\n_p('')\nend\nfunction make.list(value)\nif #value > 0 then\nreturn \" \" .. table.concat(value, \" \")\nelse\nreturn \"\"\nend\nend\nfunction _MAKE.getmakefilename(this, searchprjs)\nlocal count = 0\nfor sln in premake.solution.each() do\nif (sln.loca" |