Skip to content

Commit

Permalink
support cmake executable suffix option
Browse files Browse the repository at this point in the history
  • Loading branch information
abdullahoday710 committed Jul 21, 2021
1 parent c4fec3e commit 21c6f86
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
8 changes: 8 additions & 0 deletions _preload.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,20 @@
-- Andrew Gough
-- Manu Evans
-- Yehonatan Ballas
-- UndefinedVertex
-- Created: 2013/05/06
-- Copyright: (c) 2008-2020 Jason Perkins and the Premake project
--

local p = premake

-- support cmake executable_suffix
p.api.register {
name = "executable_suffix",
scope = "config",
kind = "string",
}

newaction
{
-- Metadata for the command line and help system
Expand Down
4 changes: 4 additions & 0 deletions cmake_project.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
-- Tom van Dijck
-- Yehonatan Ballas
-- Joel Linn
-- UndefinedVertex
-- Created: 2013/05/06
-- Copyright: (c) 2008-2020 Jason Perkins and the Premake project
--
Expand Down Expand Up @@ -54,6 +55,9 @@ function m.generate(prj)
elseif prj.kind == 'SharedLib' then
_p('add_library("%s" SHARED', prj.name)
else
if prj.executable_suffix then
_p('set(CMAKE_EXECUTABLE_SUFFIX "%s")', prj.executable_suffix)
end
_p('add_executable("%s"', prj.name)
end
m.files(prj)
Expand Down

0 comments on commit 21c6f86

Please sign in to comment.