CodingHanYa / workspace

workspace是基于C++11的轻量级异步执行框架,支持:通用任务异步并发执行、优先级任务调度、自适应动态线程池、高效静态线程池、异常处理机制等。
Apache License 2.0
916 stars 136 forks source link

CMakeLists.txt有点问题 #25

Closed heheda123123 closed 1 year ago

heheda123123 commented 1 year ago

把workspace提交到xmake-repo了 https://github.com/xmake-io/xmake-repo/pull/2104

但是现在的CMakeLists.txt写得有点问题,会导致ubuntu的测试通不过,需要patch image

CodingHanYa commented 1 year ago

在我的机器上没测出问题,能把报错信息发一下吗

heheda123123 commented 1 year ago

https://github.com/xmake-io/xmake-repo/actions/runs/5042876900/jobs/9043986761?pr=2104

heheda123123 commented 1 year ago
=> clone https://github.com/CodingHanYa/workspace.git @default .. ok
checking for flags (-fPIC) ... ok
> clang "-fPIC" "-Qunused-arguments" "-m64"
checking for flags (-fPIC) ... ok
> clang "-fPIC" "-Qunused-arguments" "-m64"
checking for flags (-fPIC) ... ok
> clang "-fPIC" "-Qunused-arguments" "-m[64](https://github.com/xmake-io/xmake-repo/actions/runs/5042876900/jobs/9043986761?pr=2104#step:5:65)"
checking for flags (-fPIC) ... ok
> clang++ "-fPIC" "-m64" "-m64"
checking for flags (-fPIC) ... ok
> clang++ "-fPIC" "-shared" "-m64" "-m64"
error: @programdir/core/sandbox/modules/os.lua:2[73](https://github.com/xmake-io/xmake-repo/actions/runs/5042876900/jobs/9043986761?pr=2104#step:5:74): Install the project...
-- Install configuration: ""
-- Installing: /usr/local/include/workspace
CMake Error at cmake_install.cmake:54 (file):
  file INSTALL cannot make directory "/usr/local/include/workspace":
  Permission denied.

make: *** [Makefile:100: install] Error 1
CodingHanYa commented 1 year ago

需要权限,采用sudo make install 即可

heheda123123 commented 1 year ago

有两个问题
1 现在的CMakeLists.txt是直接指定的绝对路径,这导致用户没法自定义安装路径,需要像我最上面发的截图那样删掉前缀 2 CMAKE_INSTALL_PREFIX 有默认值,在linux是/usr/local,在win是 C:/Program Files。所以不需要现在这样判断,install的时候指定相对路径即可

https://cmake.org/cmake/help/latest/variable/CMAKE_INSTALL_PREFIX.html

CodingHanYa commented 1 year ago

很酷!我已经改好了。