VuiLib icon indicating copy to clipboard operation
VuiLib copied to clipboard

Can VuiLib build on Linux/Unix/Darwin?

Open ChenPi11 opened this issue 2 years ago • 4 comments

Suggestions

I tried to build VuiLib on Debian GNU/Linux, but it used WinAPI. So may you add Unix(or U*ix) support?

  • And you should rename 'makelist.txt' to 'CMakeLists.txt' for CMake build.
  • You can also set CMake minimal version to '3.1' instead of '3.23' because it is too version is too new.

CMake build log

mkdir build && cd build && cmake ..
-- The C compiler identification is GNU 10.2.1
-- The CXX compiler identification is GNU 10.2.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/user/VuiLib/build
make
Scanning dependencies of target vuilib
[  2%] Building CXX object CMakeFiles/vuilib.dir/src/core/object/vapplication.cc.o
In file included from /home/user/VuiLib/src/core/object/../../../include/core/object/../uibasic/../signal/../vbasiccore.h:36,
                 from /home/user/VuiLib/src/core/object/../../../include/core/object/../uibasic/../signal/vsignal.h:10,
                 from /home/user/VuiLib/src/core/object/../../../include/core/object/../uibasic/vtimer.h:3,
                 from /home/user/VuiLib/src/core/object/../../../include/core/object/vapplication.h:10,
                 from /home/user/VuiLib/src/core/object/vapplication.cc:1:
/home/user/VuiLib/src/core/object/../../../include/core/object/../uibasic/../signal/../../debug/vdebug.h:3:10: fatal error: windows.h: 没有那个文件或目录
    3 | #include <windows.h>
      |          ^~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/vuilib.dir/build.make:82:CMakeFiles/vuilib.dir/src/core/object/vapplication.cc.o] 错误 1
make[1]: *** [CMakeFiles/Makefile2:124:CMakeFiles/vuilib.dir/all] 错误 2

Uname infomation

Linux LAPTOP-GP6VBLDH 5.10.43-2-windows-subsystem-for-android #1 SMP PREEMPT Tue Sep 14 09:09:25 UTC 2021 x86_64 GNU/Linux

Fix patch

~~I'm too lazy to submit a pr (doge)~~

  • Move makelist.txt to CMakeLists.txt.

CMakeLists.txt:

--- vl/makelist.txt     2023-05-04 20:30:27.375390580 +0800
+++ VuiLib/CMakeLists.txt       2023-05-04 20:13:38.515373370 +0800
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.23)
+cmake_minimum_required(VERSION 3.1)
 project(vuilib_cmake)

 set(CMAKE_CXX_STANDARD 11)
@@ -26,4 +26,3 @@ add_library(vuilib STATIC ${DIR_SRCS})

 add_executable(vuilib_cmake main.cpp)
 target_link_libraries(vuilib_cmake vuilib)
-

ChenPi11 avatar May 04 '23 12:05 ChenPi11

Thanks for your suggestions, since I am now busy with other works, so I don't have any time to focus on the platform crossing. I will try to build vuilib on the other operation system and change the render API (maybe in next month) like SDL or Vulkan.

FSMargoo avatar May 14 '23 01:05 FSMargoo

我希望在以后为 VuiLib 的跨平台提供技术支持,您是否希望 VuiLib 能够在 Linux 上运行?

ChenPi11 avatar Jun 05 '23 14:06 ChenPi11

我希望在以后为 VuiLib 的跨平台提供技术支持,您是否希望 VuiLib 能够在 Linux 上运行?

暂时这个项目是完全依赖于DirectX作为渲染后端。你可以尝试移植VRender实现跨平台

ScSofts avatar Jun 09 '23 05:06 ScSofts

我希望在以后为 VuiLib 的跨平台提供技术支持,您是否希望 VuiLib 能够在 Linux 上运行?

显然我是希望的嘛 xD 如果您愿意的话,我当然非常感谢您能完成跨平台工作

FSMargoo avatar Jun 09 '23 10:06 FSMargoo

VUILib 3.x now support build on Unix/Linux/Darwin, passing unit test under my PC on manjaro and PC on Windows 11. In fact, supporting cross platform is quite a hard job which different platform actually has different rules like rendering method or window operation (e.g. Creation/Destory), so I took a long progress to finish it. However sadly, VUILib 3.x is still under development that is not valiable for using now.

In addition, I am quite eager for a partner to maintain this project. If you still have interest in it, please sent email to my private email on ($margoo$ $at$ $margoo$ $dot$ $icu$)

FSMargoo avatar Aug 12 '24 09:08 FSMargoo