initial commit

This commit is contained in:
L-Nafaryus 2023-11-17 21:06:11 +05:00
parent 6037094698
commit 10e0f86f3d
7 changed files with 112 additions and 0 deletions

13
.gitignore vendored
View File

@ -0,0 +1,13 @@
# Xmake cache
.xmake/
build/
# MacOS Cache
.DS_Store/
# CMake
CMakeLists.txt
cmake-build-*/
# Idea
.idea/

2
source/hpr/container.cpp Normal file
View File

@ -0,0 +1,2 @@
#include <hpr/container.hpp>

4
source/hpr/container.hpp Normal file
View File

@ -0,0 +1,4 @@
#pragma once
#include <iterator>

9
source/hpr/main.cpp Normal file
View File

@ -0,0 +1,9 @@
#include <iostream>
using namespace std;
int main(int argc, char** argv)
{
cout << "hello xmake!" << endl;
return 0;
}

33
source/hpr/xmake.lua Normal file
View File

@ -0,0 +1,33 @@
target("hpr")
set_kind("shared")
set_languages("c++20")
set_policy("build.c++.modules", false)
add_includedirs("..", { public = true })
add_headerfiles("../(hpr/*.hpp)")
add_files("container.cpp")
-- export all symbols for windows/dll
if is_plat("windows") and is_kind("shared") then
if is_mode("release") then
set_optimize("fastest")
end
add_rules("utils.symbols.export_all")
end
-- install importfiles for pkg-config/cmake
add_rules("utils.install.cmake_importfiles")
add_rules("utils.install.pkgconfig_importfiles")
-- add packages
for _, name in ipairs({"imgui", "implot", "glfw", "opencascade"}) do
add_packages(name)
if has_package(name) then
set_configvar("HPR_HAVE_PACKAGE_" .. name:upper(), 1)
end
end
target_end()

34
source/xmake.lua Normal file
View File

@ -0,0 +1,34 @@
-- options: general
option("creator")
set_category("option")
set_default(false)
set_showmenu(true)
set_description("Enable creator application")
option_end()
-- options: modules
for _, name in ipairs({"csg", "mesh"}) do
option(name)
set_category("module")
set_default(true)
set_showmenu(true)
set_description(format("Module %s", name))
set_configvar("HPR_HAVE_MODULE_" .. name:upper(), 1)
option_end()
end
-- packages
add_requires("imgui v1.90-docking")
add_requires("implot v0.15")
add_requires("glfw 3.3.8")
if has_config("csg") then
add_requires("conan::opencascade/7.6.2")
end
-- includes project dirs
includes("hpr")
if has_config("creator") then
includes("creator")
end

17
xmake.lua Normal file
View File

@ -0,0 +1,17 @@
set_project("hpr")
set_version("0.0.1")
add_rules("mode.debug", "mode.release")
if is_mode("debug") then
add_defines("HPR_DEBUG")
end
if is_plat("linux") and is_mode("debug") then
add_ldflags("-rdynamic")
end
set_optimize("fastest")
includes("source")