-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Why: because I want to create my own package manager to easily download applications from this repository and I also want learn C++ (or not?)
- Loading branch information
0 parents
commit ce687b7
Showing
12 changed files
with
236 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Build Release Win32 | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- development | ||
pull_request: | ||
branches: | ||
- main | ||
- development | ||
|
||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{matrix.os}} | ||
strategy: | ||
matrix: | ||
os: [ windows-2019 ] | ||
arch: | ||
- x86 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Building | ||
shell: bash | ||
env: | ||
CXX: cl.exe | ||
run: | | ||
mkdir build | ||
cd build | ||
cmake -G "Visual Studio 16 2019" -A Win32 .. | ||
cmake --build . --config Debug | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: "Debug" | ||
path: '${{github.workspace}}/build/Debug' |
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 @@ | ||
name: Build Debug | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- development | ||
pull_request: | ||
branches: | ||
- main | ||
- development | ||
|
||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: windows-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Building | ||
shell: bash | ||
env: | ||
CXX: cl.exe | ||
run: | | ||
mkdir build | ||
cd build | ||
cmake .. | ||
cmake --build . --config Debug | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: "Debug" | ||
path: '${{github.workspace}}/build/Debug' |
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,41 @@ | ||
name: Build Release Win32 | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- development | ||
pull_request: | ||
branches: | ||
- main | ||
- development | ||
|
||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{matrix.os}} | ||
strategy: | ||
matrix: | ||
os: [ windows-2019 ] | ||
arch: | ||
- x86 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Building | ||
shell: bash | ||
env: | ||
CXX: cl.exe | ||
run: | | ||
mkdir build | ||
cd build | ||
cmake -G "Visual Studio 16 2019" -A Win32 .. | ||
cmake --build . --config Release | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: "Debug" | ||
path: '${{github.workspace}}/build/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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Build Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- development | ||
pull_request: | ||
branches: | ||
- main | ||
- development | ||
|
||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: windows-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Building | ||
shell: bash | ||
env: | ||
CXX: cl.exe | ||
run: | | ||
mkdir build | ||
cd build | ||
cmake .. | ||
cmake --build . --config Release | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: "Release" | ||
path: '${{github.workspace}}/build/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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
build/ | ||
.idea/ |
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,18 @@ | ||
{ | ||
"configurations": [ | ||
{ | ||
"name": "Linux", | ||
"includePath": [ | ||
"${workspaceFolder}/**", | ||
"/usr/i686-w64-mingw32/include" | ||
], | ||
"defines": [], | ||
"compilerPath": "/usr/bin/gcc", | ||
"cStandard": "c17", | ||
"cppStandard": "gnu++17", | ||
"intelliSenseMode": "linux-gcc-x64", | ||
"configurationProvider": "ms-vscode.cmake-tools" | ||
} | ||
], | ||
"version": 4 | ||
} |
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,5 @@ | ||
{ | ||
"files.associations": { | ||
"string": "cpp" | ||
} | ||
} |
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,15 @@ | ||
cmake_minimum_required(VERSION 3.6) | ||
|
||
set(CMAKE_CXX_STANDARD 17) | ||
|
||
project(xp-apps VERSION 0.1.0) | ||
|
||
add_library(source source/functions.h source/functions.cpp) | ||
|
||
add_link_options(-static -static-libgcc -static-libstdc++) | ||
add_executable(xp-apps main.cpp) | ||
target_link_libraries(xp-apps source) | ||
|
||
set(CPACK_PROJECT_NAME ${PROJECT_NAME}) | ||
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION}) | ||
include(CPack) |
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,12 @@ | ||
#include <iostream> | ||
#include "source/functions.h" | ||
|
||
int main(int, char **) | ||
{ | ||
if (!isWindowsXP()) { | ||
std::cout << "This program works only on Windows XP" << std::endl; | ||
return 0; | ||
} | ||
|
||
// std::cout << isWindowsXP() << std::endl; | ||
} |
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,3 @@ | ||
cmake_minimum_required(VERSION 3.6) | ||
project(Source) | ||
add_executable(Source functions.h functions.cpp) |
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,18 @@ | ||
// functions.cpp | ||
#include "functions.h" | ||
|
||
bool isWindowsXP() { | ||
OSVERSIONINFO osVersion = {0}; | ||
osVersion.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); | ||
|
||
/* | ||
5 . 1 | ||
↓ ↓ | ||
MajorVersion MinorVersion | ||
*/ | ||
|
||
auto majorVersion = osVersion.dwMajorVersion; | ||
auto minorVersion = osVersion.dwMinorVersion; | ||
|
||
return (majorVersion == 5 && minorVersion == 1) || (majorVersion == 5 && minorVersion == 2); | ||
} |
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,11 @@ | ||
// functions.h | ||
#ifndef FUNCTIONS_H | ||
#define FUNCTIONS_H | ||
|
||
#include <iostream> | ||
#include <string> | ||
#include <windows.h> | ||
|
||
bool isWindowsXP(); | ||
|
||
#endif // FUNCTIONS_H |