Skip to content

Commit

Permalink
fix exclude and add linkoptions
Browse files Browse the repository at this point in the history
  • Loading branch information
IreNox committed Oct 22, 2024
1 parent 92544d6 commit 06d7209
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 6 deletions.
Empty file modified premake5
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion samples/basics/generate_makefile.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/sh
../../premake5 --systemscript=../../tiki_build.lua --to=build/makefile makefile
../../premake5 --systemscript=../../tiki_build.lua --to=build/gmake gmake2
1 change: 1 addition & 0 deletions samples/basics/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ local project = Project:new( "basics_test", ProjectTypes.ConsoleApplication )
project:add_files( 'src/*.h' )
project:add_files( 'src/*.c' )
project:add_files( 'src/*.cpp' )
project:add_files( 'src/exclude.c', { exclude = true } )

project:add_define( "TIKI_TEST", "1" )

Expand Down
2 changes: 2 additions & 0 deletions samples/basics/src/exclude.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

#error "This file will be excluded"
5 changes: 3 additions & 2 deletions src/base/module.lua
Original file line number Diff line number Diff line change
Expand Up @@ -313,8 +313,9 @@ function Module:finalize_files( project )
end

for _,pattern in ipairs( self.exclude_files ) do
local matches = os.matchfiles( pattern )

local absolut_pattern = path.join( self.config.base_path, pattern )
local matches = os.matchfiles( absolut_pattern )

for j,file_name in pairs( matches ) do
local index = table.indexof( all_files, file_name )

Expand Down
11 changes: 8 additions & 3 deletions src/base/project.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ Project = class{
name = nil,
type = nil,
module = nil,
buildoptions = nil,
buildoptions = {},
linkoptions = {},
dependencies = {},
generated_files_dir = ''
}
Expand Down Expand Up @@ -262,10 +263,14 @@ function Project:finalize( solution )
kind( self.type )
language( "C++" )

if self.buildoptions then
if #self.buildoptions > 0 then
buildoptions( self.buildoptions )
end


if #self.linkoptions > 0 then
linkoptions( self.linkoptions )
end

if tiki.host_platform == Platforms.Windows and tiki.target_platform == Platforms.Linux then
-- TODO: wait for PR: debugger( "LinuxWSLDebugger" )
toolchainversion( "wsl2" )
Expand Down

0 comments on commit 06d7209

Please sign in to comment.