Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes to pass my integration tests #15

Open
wants to merge 27 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
84ad0f5
- Handle `sysincludedirs` and `forceincludes`.
Jarod42 Aug 8, 2021
45d7b4b
Clean output: don't show empty "property".
Jarod42 Aug 8, 2021
c0bb61a
Use project name instead of linktarget in `target_link_libraries`, so…
Jarod42 Aug 12, 2021
334b507
Add support for pre/post buildcommands.
Jarod42 Aug 12, 2021
4ce5a8a
Add support for custom commands.
Jarod42 Aug 15, 2021
2803220
Add support for rules.
Jarod42 Nov 7, 2021
c1c8ba5
Replace some absolute paths by relative paths.
Jarod42 Nov 7, 2021
2d6f038
Handle project without source files.
Jarod42 Apr 14, 2022
b6347d5
Fix case (might be problematic for override of premake module such as…
Jarod42 Jul 14, 2022
be33000
Fix single/double quote in *`buildmessage`.
Jarod42 Jul 17, 2022
df8ca36
Handle "missing" directories for custom command.
Jarod42 Sep 25, 2022
00afba5
Use `externalincludedirs` instead of deprecated `sysincludedirs`.
Jarod42 Oct 2, 2022
c781e84
Handle linkoptions for `sanitize { "Address", "Fuzzer" }`.
Jarod42 Jan 30, 2023
69aecd3
cflags/cppflags handles both msvc and gcc toolset.
Jarod42 Feb 20, 2023
f9c0cef
Fix single quote in messages (as premake-qt adds).
Jarod42 Feb 22, 2023
6166747
- Fix some multi-configuration issues.
Jarod42 Mar 8, 2023
8594556
Add generated files only when `filecfg.compilebuildoutputs` is true.
Jarod42 Apr 5, 2023
cdefe42
Add generated file as dependencies of app.
Jarod42 Apr 6, 2023
f0ef960
Add support of `frameworkdirs` and `includedirsafter`
Jarod42 Apr 16, 2023
0ba0437
Add prelink support.
Jarod42 Apr 27, 2023
9f8d1b8
Handle `flags {"ExcludeFromBuild"}`.
Jarod42 May 19, 2023
f6e249b
Fix generated files in different directory depending of config.
Jarod42 May 19, 2023
65d232f
Add support to `undefines`.
Jarod42 May 29, 2023
d713209
Default toolset depends on target OS and fix toolset with version
Jarod42 Jun 25, 2024
1cbc9e2
Handle multi-config generators
Jarod42 Jul 17, 2024
1871a3c
Handle invalid char in configuration/platform name (as hyphen) (`$<CO…
Jarod42 Oct 21, 2024
8e02bb9
Fix pre/post build commands by config.
Jarod42 Oct 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion _preload.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,22 @@ p.api.register {
kind = "string",
}

local default_toolset_map = {
["windows"] = "msc-v142", -- Visual Studio 2019
["macosx"] = "clang",
["linux"] = "gcc",
["_"] = "gcc", -- default
}
local default_toolset = default_toolset_map[os.target()] or default_toolset_map["_"]

newaction
{
-- Metadata for the command line and help system

trigger = "cmake",
shortname = "CMake",
description = "Generate CMake file",
toolset = "clang",
toolset = default_toolset,

-- The capabilities of this action

Expand Down
15 changes: 11 additions & 4 deletions cmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,20 @@ function cmake.generateProject(prj)
end
end

local function normalize_identifier(name)
local res = string.gsub(name, "[^a-zA-Z0-9_]", "_")
if res ~= name then
premake.warnOnce("cmake_identifier_" .. name, 'configuration "' .. name .. '" contains unsuported characters, replaced by "' .. res .. '"')
end
return res
end

function cmake.cfgname(cfg)
local cfgname = cfg.buildcfg
if cmake.workspace.multiplePlatforms then
-- CMake breaks if "|" is used here
cfgname = string.format("%s-%s", cfg.platform, cfg.buildcfg)
return string.format("%s_%s", normalize_identifier(cfg.platform), normalize_identifier(cfg.buildcfg))
else
return normalize_identifier(cfg.buildcfg)
end
return cfgname
end

function cmake.cleanWorkspace(wks)
Expand Down
Loading