Skip to content

Commit

Permalink
fix/improve linux - use wsl - improve externals
Browse files Browse the repository at this point in the history
  • Loading branch information
IreNox committed Oct 20, 2024
1 parent f098b44 commit f912d22
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 168 deletions.
Binary file added premake5
Binary file not shown.
3 changes: 3 additions & 0 deletions samples/basics/generate_vs2022_linux.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@echo off
..\..\premake5.exe --systemscript=../../tiki_build.lua --to=build/vs2022_linux --os=linux vs2022
EXIT /B %ERRORLEVEL%
8 changes: 7 additions & 1 deletion samples/basics/src/function.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@

#include <iostream>

void __cdecl printHelloWorld()
#if _MSC_VER
# define CCALL __cdecl
#else
# define CCALL //__attribute__((cdecl))
#endif

CCALL void printHelloWorld()
{
std::cout << "Hello World!" << std::endl;
}
7 changes: 7 additions & 0 deletions samples/externals/generate_gmake_linux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#/bin/bash

../../premake5 --systemscript=../../tiki_build.lua --to=build/gmake_linux --os=linux --cc=gcc gmake
if [ $? -ne 0 ]; then
echo "Press any key to continue..."
read -n 1
fi
2 changes: 2 additions & 0 deletions samples/externals/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ project:add_external( "https://github.com/leethomason/tinyxml2.git" )
project:add_external( "https://github.com/nothings/stb.git" )
project:add_external( "https://github.com/ocornut/imgui.git" )
project:add_external( "https://github.com/erincatto/box2d.git" )

project:add_external( "https://www.sqlite.org/" )
project:add_external( "https://github.com/richgel999/miniz" )

finalize_default_solution( project )
1 change: 1 addition & 0 deletions src/base/globals.lua
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ function tiki.get_platform_for_premake_string( platform )
return Platforms.MacOS
end

print( "Unknown platform: ".. platform );
return Platforms.Unknown
end

Expand Down
5 changes: 5 additions & 0 deletions src/base/project.lua
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,11 @@ function Project:finalize( solution )
buildoptions( self.buildoptions )
end

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

self:finalize_create_directories()

local config_project = Configuration:new()
Expand Down
3 changes: 2 additions & 1 deletion src/externals/https/github.com/erincatto/box2d.git/tiki.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ local box2d_project = Project:new( "box2d", ProjectTypes.StaticLibrary )
box2d_project.module.module_type = ModuleTypes.FilesModule

box2d_project:add_files( "include/box2d/*.h" )
box2d_project:add_files( "src/**/*.cpp" )
box2d_project:add_files( "src/*.h" )
box2d_project:add_files( "src/*.c" )

box2d_project:add_include_dir( "include" )
box2d_project:add_include_dir( "src" )
Expand Down
165 changes: 0 additions & 165 deletions src/externals/https/github.com/libsdl-org/SDL/tiki.lua

This file was deleted.

2 changes: 1 addition & 1 deletion src/externals/https/github.com/richgel999/miniz/tiki.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
local repo_name = "richgel999/miniz"
if tiki.external.version == "latest" then
local response, result_code = http.get( "https://api.github.com/repos/" .. repo_name .. "/releases/latest" )
local response_json = json.decode( response )
local response_json = json.decode( response )

tiki.external.version = response_json.tag_name
end
Expand Down

0 comments on commit f912d22

Please sign in to comment.