-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7cc5db7
commit 24df3bb
Showing
8 changed files
with
208 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
# Auto detect text files and perform LF normalization | ||
*.h linguist-language=C++ | ||
*.cpp linguist-language=C++ | ||
*.cpp linguist-language=C++ | ||
*.lua linguist-language=lua |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,4 +52,24 @@ jobs: | |
mkdir build | ||
cd build | ||
cmake -G "Visual Studio 17 2022" -A x64 .. | ||
cmake --build . --config Release | ||
cmake --build . --config Release | ||
premake-windows-build: | ||
runs-on: windows-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup MSVC | ||
uses: microsoft/[email protected] | ||
|
||
- name: Premake setup | ||
uses: abel0b/[email protected] | ||
with: | ||
version: "5.0.0-beta2" | ||
|
||
- name: Harshie Build Test | ||
run: | | ||
premake5 vs2022 | ||
msbuild /m "Harshie.sln" /p:configuration="release" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,19 @@ | ||
# Visual Studio | ||
.vs/ | ||
x64/ | ||
|
||
# Solution file | ||
*.aps | ||
*.sln | ||
*.vcxproj | ||
*.vcxproj.filters | ||
*.vcxproj.user | ||
|
||
# Visual Studio Code and CMake build | ||
build/ | ||
.env | ||
|
||
# Configuration and others | ||
*.exe | ||
*.db | ||
.env | ||
*.rc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
-- | ||
-- Copyright (C) 2023 harshfeudal | ||
-- | ||
-- This program is free software: you can redistribute it and/or modify | ||
-- it under the terms of the GNU General Public License as published by | ||
-- the Free Software Foundation, either version 3 of the License, or | ||
-- (at your option) any later version. | ||
-- | ||
-- This program is distributed in the hope that it will be useful, | ||
-- but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
-- GNU General Public License for more details. | ||
-- | ||
-- You should have received a copy of the GNU General Public License | ||
-- along with this program. If not, see https://www.gnu.org/licenses/. | ||
-- | ||
|
||
include "resources.lua" | ||
include "setup.lua" | ||
|
||
workspace "Harshie" | ||
architecture "x64" | ||
configurations { "Release" } | ||
|
||
project "Harshie" | ||
kind "ConsoleApp" | ||
language "C++" | ||
cppdialect "C++17" | ||
staticruntime "off" | ||
|
||
outputdir = "%{cfg.buildcfg}" | ||
|
||
targetdir ("%{wks.location}/x64/%{cfg.buildcfg}") | ||
objdir ("%{wks.location}/x64/%{cfg.buildcfg}") | ||
|
||
includedirs{ "include" } | ||
libdirs { "lib" } | ||
links { "dpp.lib" } | ||
files { | ||
"src/**.cpp", | ||
"src/commands/slash/**.h", | ||
"src/commands/slash/cmd_common/**.cpp", | ||
"src/cores/**.h", | ||
"src/cores/**.cpp", | ||
"resources/*.h", | ||
"resources/*.rc", | ||
} | ||
|
||
filter { "system:windows", "toolset:msc" } | ||
systemversion "latest" | ||
|
||
filter "configurations:Release" | ||
runtime "Release" | ||
optimize "on" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
-- | ||
-- Copyright (C) 2023 harshfeudal | ||
-- | ||
-- This program is free software: you can redistribute it and/or modify | ||
-- it under the terms of the GNU General Public License as published by | ||
-- the Free Software Foundation, either version 3 of the License, or | ||
-- (at your option) any later version. | ||
-- | ||
-- This program is distributed in the hope that it will be useful, | ||
-- but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
-- GNU General Public License for more details. | ||
-- | ||
-- You should have received a copy of the GNU General Public License | ||
-- along with this program. If not, see https://www.gnu.org/licenses/. | ||
-- | ||
|
||
local HARSHIE_VERSION_MAJOR = 1 | ||
local HARSHIE_VERSION_MINOR = 0 | ||
local HARSHIE_VERSION_PATCH = 0 | ||
local HARSHIE_VERSION_BUILD = 0 | ||
local HARSHIE_VERSION = HARSHIE_VERSION_MAJOR .. "." .. HARSHIE_VERSION_MINOR .. "." .. HARSHIE_VERSION_PATCH .. "." .. HARSHIE_VERSION_BUILD | ||
|
||
local inputFilePath = "resources/harshie.rc.in" | ||
local outputFilePath = "resources/harshie.rc" | ||
|
||
local inputFile = io.open(inputFilePath, "r") | ||
if inputFile then | ||
local fileContents = inputFile:read("*a") | ||
inputFile:close() | ||
|
||
fileContents = string.gsub(fileContents, "@HARSHIE_VERSION_MAJOR@", tostring(HARSHIE_VERSION_MAJOR)) | ||
fileContents = string.gsub(fileContents, "@HARSHIE_VERSION_MINOR@", tostring(HARSHIE_VERSION_MINOR)) | ||
fileContents = string.gsub(fileContents, "@HARSHIE_VERSION_PATCH@", tostring(HARSHIE_VERSION_PATCH)) | ||
fileContents = string.gsub(fileContents, "@HARSHIE_VERSION_BUILD@", tostring(HARSHIE_VERSION_BUILD)) | ||
fileContents = string.gsub(fileContents, "@HARSHIE_VERSION@", HARSHIE_VERSION) | ||
|
||
local outputFile = io.open(outputFilePath, "w") | ||
if outputFile then | ||
outputFile:write(fileContents) | ||
outputFile:close() | ||
print("Resource file generated successfully.") | ||
else | ||
print("Error: Failed to open the output file for writing.") | ||
end | ||
else | ||
print("Error: Failed to open the input file.") | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
-- | ||
-- Copyright (C) 2023 harshfeudal | ||
-- | ||
-- This program is free software: you can redistribute it and/or modify | ||
-- it under the terms of the GNU General Public License as published by | ||
-- the Free Software Foundation, either version 3 of the License, or | ||
-- (at your option) any later version. | ||
-- | ||
-- This program is distributed in the hope that it will be useful, | ||
-- but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
-- GNU General Public License for more details. | ||
-- | ||
-- You should have received a copy of the GNU General Public License | ||
-- along with this program. If not, see https://www.gnu.org/licenses/. | ||
-- | ||
|
||
local sourceDir = "bin" | ||
local destinationDir = "x64/Release" | ||
|
||
function copyFiles(source, destination) | ||
for _, filename in ipairs(os.matchfiles(source .. "/*")) do | ||
local destFile = path.join(destination, path.getname(filename)) | ||
os.mkdir(path.getdirectory(destFile)) | ||
os.copyfile(filename, destFile) | ||
end | ||
end | ||
|
||
if not os.isdir(destinationDir) then | ||
os.mkdir(destinationDir) | ||
end | ||
|
||
copyFiles(sourceDir, destinationDir) | ||
|
||
print("Copying DLLs to x64/Release completed.") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
@echo off | ||
setlocal | ||
|
||
rem Check if premake5.exe exists in the current directory | ||
if not exist premake5.exe ( | ||
echo Error: premake5.exe not found in the current directory. | ||
exit /b 1 | ||
) | ||
|
||
rem Run Premake to generate Visual Studio 2022 project files | ||
premake5 vs2022 | ||
|
||
endlocal |