From e9b1da7f529abe784c7d92c561f3e3ebd46263b8 Mon Sep 17 00:00:00 2001 From: harshfeudal <87577447+harshfeudal@users.noreply.github.com> Date: Wed, 13 Sep 2023 22:29:14 +0700 Subject: [PATCH] [Update}: Minor change --- .github/workflows/{cmake.yaml => ci.yaml} | 2 +- CMakeLists.txt | 17 ++++++++++++++++ src/main.cpp | 5 +++++ start-linux.sh | 2 -- start-premake.bat | 24 ++++++++++++++++++++++- 5 files changed, 46 insertions(+), 4 deletions(-) rename .github/workflows/{cmake.yaml => ci.yaml} (98%) diff --git a/.github/workflows/cmake.yaml b/.github/workflows/ci.yaml similarity index 98% rename from .github/workflows/cmake.yaml rename to .github/workflows/ci.yaml index b2115e8..178e3c2 100644 --- a/.github/workflows/cmake.yaml +++ b/.github/workflows/ci.yaml @@ -1,4 +1,4 @@ -name: Harshie CMake Build +name: Harshie CI Build Test on: [ push, pull_request ] diff --git a/CMakeLists.txt b/CMakeLists.txt index fe40698..e9b294b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,3 +1,20 @@ +# +# 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/. +# + cmake_minimum_required(VERSION 3.15) set(PROJECT_NAME "Harshie") diff --git a/src/main.cpp b/src/main.cpp index c7a4d69..8829e64 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -15,6 +15,11 @@ * along with this program. If not, see https://www.gnu.org/licenses/. */ +#pragma warning(disable: 4251) +#pragma warning(disable: 6385) +#pragma warning(disable: 6285) +#pragma warning(disable: 4700) + #include #include diff --git a/start-linux.sh b/start-linux.sh index d47f358..fbf3d41 100644 --- a/start-linux.sh +++ b/start-linux.sh @@ -10,8 +10,6 @@ cd build # Run CMake to generate build files cmake .. - -# Compile with 8 parallel jobs make -j8 # Check if the compilation was successful, then run diff --git a/start-premake.bat b/start-premake.bat index 34ef382..dc6564f 100644 --- a/start-premake.bat +++ b/start-premake.bat @@ -1,6 +1,15 @@ @echo off setlocal +set "open_sln=false" + +rem Check for command-line arguments: `--open:true` to open Visual Studio directly +for %%i in (%*) do ( + if /I "%%i"=="--open:true" ( + set "open_sln=true" + ) +) + 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. @@ -10,4 +19,17 @@ if not exist premake5.exe ( rem Run Premake to generate Visual Studio 2022 project files premake5 vs2022 -endlocal \ No newline at end of file +rem Check if the .sln file was generated successfully +if exist "Harshie.sln" ( + echo Visual Studio solution file generated successfully. + + rem If the "--open:true" argument was provided, open the generated solution file + if %open_sln%==true ( + start "Visual Studio Solution" "Harshie.sln" + ) +) else ( + echo Error: Visual Studio solution file not generated. + exit /b 1 +) + +endlocal