idk what I'm doing pls help
This commit is contained in:
commit
2ff199ad72
7 changed files with 211 additions and 0 deletions
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
CMakeFiles
|
||||||
|
CMakeCache.txt
|
||||||
|
build/Release
|
14
CMakeLists.txt
Normal file
14
CMakeLists.txt
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
cmake_minimum_required(VERSION 3.15)
|
||||||
|
project(glsl-basic CXX)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
add_executable(glsl-basic src/glsl-basic.cpp src/main.cpp)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
install(TARGETS glsl-basic DESTINATION "."
|
||||||
|
RUNTIME DESTINATION bin
|
||||||
|
ARCHIVE DESTINATION lib
|
||||||
|
LIBRARY DESTINATION lib
|
||||||
|
)
|
5
build.sh
Normal file
5
build.sh
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
conan install . --build missing
|
||||||
|
cmake .
|
||||||
|
cmake --build .
|
43
conanfile.py
Normal file
43
conanfile.py
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
from conan import ConanFile
|
||||||
|
from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout, CMakeDeps
|
||||||
|
|
||||||
|
|
||||||
|
class glsl_basicRecipe(ConanFile):
|
||||||
|
name = "glsl-basic"
|
||||||
|
version = "0.1.0"
|
||||||
|
package_type = "application"
|
||||||
|
|
||||||
|
# Optional metadata
|
||||||
|
license = "<Put the package license here>"
|
||||||
|
author = "<Put your name here> <And your email here>"
|
||||||
|
url = "<Package recipe repository url here, for issues about the package>"
|
||||||
|
description = "<Description of glsl-basic package here>"
|
||||||
|
topics = ("<Put some tag here>", "<here>", "<and here>")
|
||||||
|
|
||||||
|
# Binary configuration
|
||||||
|
settings = "os", "compiler", "build_type", "arch"
|
||||||
|
|
||||||
|
# Sources are located in the same place as this recipe, copy them to the recipe
|
||||||
|
exports_sources = "CMakeLists.txt", "src/*"
|
||||||
|
|
||||||
|
def layout(self):
|
||||||
|
cmake_layout(self)
|
||||||
|
|
||||||
|
def generate(self):
|
||||||
|
deps = CMakeDeps(self)
|
||||||
|
deps.generate()
|
||||||
|
tc = CMakeToolchain(self)
|
||||||
|
tc.generate()
|
||||||
|
|
||||||
|
def build(self):
|
||||||
|
cmake = CMake(self)
|
||||||
|
cmake.configure()
|
||||||
|
cmake.build()
|
||||||
|
|
||||||
|
def package(self):
|
||||||
|
cmake = CMake(self)
|
||||||
|
cmake.install()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
120
src/glsl-basic.cpp
Normal file
120
src/glsl-basic.cpp
Normal file
|
@ -0,0 +1,120 @@
|
||||||
|
#include <iostream>
|
||||||
|
#include "glsl-basic.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void glsl_basic(){
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef NDEBUG
|
||||||
|
std::cout << "glsl-basic/0.1.0: Hello World Release!\n";
|
||||||
|
#else
|
||||||
|
std::cout << "glsl-basic/0.1.0: Hello World Debug!\n";
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ARCHITECTURES
|
||||||
|
#ifdef _M_X64
|
||||||
|
std::cout << " glsl-basic/0.1.0: _M_X64 defined\n";
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef _M_IX86
|
||||||
|
std::cout << " glsl-basic/0.1.0: _M_IX86 defined\n";
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef _M_ARM64
|
||||||
|
std::cout << " glsl-basic/0.1.0: _M_ARM64 defined\n";
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if __i386__
|
||||||
|
std::cout << " glsl-basic/0.1.0: __i386__ defined\n";
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if __x86_64__
|
||||||
|
std::cout << " glsl-basic/0.1.0: __x86_64__ defined\n";
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if __aarch64__
|
||||||
|
std::cout << " glsl-basic/0.1.0: __aarch64__ defined\n";
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Libstdc++
|
||||||
|
#if defined _GLIBCXX_USE_CXX11_ABI
|
||||||
|
std::cout << " glsl-basic/0.1.0: _GLIBCXX_USE_CXX11_ABI "<< _GLIBCXX_USE_CXX11_ABI << "\n";
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// MSVC runtime
|
||||||
|
#if defined(_DEBUG)
|
||||||
|
#if defined(_MT) && defined(_DLL)
|
||||||
|
std::cout << " glsl-basic/0.1.0: MSVC runtime: MultiThreadedDebugDLL\n";
|
||||||
|
#elif defined(_MT)
|
||||||
|
std::cout << " glsl-basic/0.1.0: MSVC runtime: MultiThreadedDebug\n";
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
#if defined(_MT) && defined(_DLL)
|
||||||
|
std::cout << " glsl-basic/0.1.0: MSVC runtime: MultiThreadedDLL\n";
|
||||||
|
#elif defined(_MT)
|
||||||
|
std::cout << " glsl-basic/0.1.0: MSVC runtime: MultiThreaded\n";
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// COMPILER VERSIONS
|
||||||
|
#if _MSC_VER
|
||||||
|
std::cout << " glsl-basic/0.1.0: _MSC_VER" << _MSC_VER<< "\n";
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if _MSVC_LANG
|
||||||
|
std::cout << " glsl-basic/0.1.0: _MSVC_LANG" << _MSVC_LANG<< "\n";
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if __cplusplus
|
||||||
|
std::cout << " glsl-basic/0.1.0: __cplusplus" << __cplusplus<< "\n";
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if __INTEL_COMPILER
|
||||||
|
std::cout << " glsl-basic/0.1.0: __INTEL_COMPILER" << __INTEL_COMPILER<< "\n";
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if __GNUC__
|
||||||
|
std::cout << " glsl-basic/0.1.0: __GNUC__" << __GNUC__<< "\n";
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if __GNUC_MINOR__
|
||||||
|
std::cout << " glsl-basic/0.1.0: __GNUC_MINOR__" << __GNUC_MINOR__<< "\n";
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if __clang_major__
|
||||||
|
std::cout << " glsl-basic/0.1.0: __clang_major__" << __clang_major__<< "\n";
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if __clang_minor__
|
||||||
|
std::cout << " glsl-basic/0.1.0: __clang_minor__" << __clang_minor__<< "\n";
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if __apple_build_version__
|
||||||
|
std::cout << " glsl-basic/0.1.0: __apple_build_version__" << __apple_build_version__<< "\n";
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// SUBSYSTEMS
|
||||||
|
|
||||||
|
#if __MSYS__
|
||||||
|
std::cout << " glsl-basic/0.1.0: __MSYS__" << __MSYS__<< "\n";
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if __MINGW32__
|
||||||
|
std::cout << " glsl-basic/0.1.0: __MINGW32__" << __MINGW32__<< "\n";
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if __MINGW64__
|
||||||
|
std::cout << " glsl-basic/0.1.0: __MINGW64__" << __MINGW64__<< "\n";
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if __CYGWIN__
|
||||||
|
std::cout << " glsl-basic/0.1.0: __CYGWIN__" << __CYGWIN__<< "\n";
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void glsl_basic_print_vector(const std::vector<std::string> &strings) {
|
||||||
|
for(std::vector<std::string>::const_iterator it = strings.begin(); it != strings.end(); ++it) {
|
||||||
|
std::cout << "glsl_basic/0.1.0 " << *it << std::endl;
|
||||||
|
}
|
||||||
|
}
|
14
src/glsl-basic.h
Normal file
14
src/glsl-basic.h
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <vector>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
#define GLSL_BASIC_EXPORT __declspec(dllexport)
|
||||||
|
#else
|
||||||
|
#define GLSL_BASIC_EXPORT
|
||||||
|
#endif
|
||||||
|
|
||||||
|
GLSL_BASIC_EXPORT void glsl_basic();
|
||||||
|
GLSL_BASIC_EXPORT void glsl_basic_print_vector(const std::vector<std::string> &strings);
|
12
src/main.cpp
Normal file
12
src/main.cpp
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
#include "glsl-basic.h"
|
||||||
|
#include <vector>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
glsl_basic();
|
||||||
|
|
||||||
|
std::vector<std::string> vec;
|
||||||
|
vec.push_back("test_package");
|
||||||
|
|
||||||
|
glsl_basic_print_vector(vec);
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue