Giter VIP home page Giter VIP logo

Comments (7)

waruqi avatar waruqi commented on June 12, 2024

路径问题,你可以来个 pr 改进下,改成反斜杠

from xrepo-cmake.

heheda123123 avatar heheda123123 commented on June 12, 2024

路径问题,你可以来个 pr 改进下,改成反斜杠

看了下脚本,应该是这里的问题

execute_process(COMMAND ${XREPO_CMD} fetch ${_deps} --json ${_xrepo_cmdargs}

通过 xrepo fetch xx --json 获取路径信息,后面加下判断如果是windows,就把反斜杠做下处理
但是改了下还是不对,试了几种都不行,报的错都是 target_include_directories called with invalid arguments

1 把 \\ 替换为 / 
2 把 \\ 替换为 \\\\ 
3 把 \\\\ 替换为 //
    execute_process(COMMAND ${XREPO_CMD} fetch ${_deps} --json ${_xrepo_cmdargs}
                    OUTPUT_VARIABLE json_output
                    ERROR_VARIABLE json_error_output
                    RESULT_VARIABLE exit_code)
    if(NOT "${exit_code}" STREQUAL "0")
        message(STATUS "xrepo fetch --json:")
        message(STATUS "STDOUT:\n${json_output}")
        message(STATUS "STDERR:\n${json_error_output}")
        message(FATAL_ERROR "xrepo fetch --json failed, exit code: ${exit_code}")
    endif()
	
	if (WIN32)
		string(REPLACE "\\" "/" json_output ${json_output})
	endif()
Rebuild CMake cache
1 > @DELETE "D:/temp/testedx/testxx/.edx/cmake/gcc-mgw64-13.1/Debug"
>>>>
2 > D:\tools\mingw64-gcc-13.1-full\bin\cmake.exe -B "D:/temp/testedx/testxx/.edx/cmake/gcc-mgw64-13.1/Debug" -S "D:/temp/testedx/testxx" -G "CodeBlocks - Ninja" -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DCMAKE_BUILD_TYPE="Debug" -DCMAKE_CXX_COMPILER="D:/tools/mingw64-gcc-13.1-full/bin/x86_64-w64-mingw32-g++.exe;-ftabstop=1" -DCMAKE_C_COMPILER="D:/tools/mingw64-gcc-13.1-full/bin/x86_64-w64-mingw32-gcc.exe;-ftabstop=1" -DCMAKE_RC_COMPILER="D:/tools/mingw64-gcc-13.1-full/bin/windres.exe" -DCMAKE_CXX_COMPILER_LAUNCHER="D:/tools/mingw64-gcc-13.1-full/bin/ccache.exe" -DCMAKE_CXX_COMPILER_LAUNCHER="D:/tools/mingw64-gcc-13.1-full/bin/ccache.exe"
-- The C compiler identification is GNU 13.1.0
-- The CXX compiler identification is GNU 13.1.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: D:/tools/mingw64-gcc-13.1-full/bin/x86_64-w64-mingw32-gcc.exe - 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: D:/tools/mingw64-gcc-13.1-full/bin/x86_64-w64-mingw32-g++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- xmake command: C:/Users/Administrator/xmake/xmake.exe
-- xrepo: fetch --json: ON
-- xrepo: CMAKE_C_COMPILER=D:/tools/mingw64-gcc-13.1-full/bin/x86_64-w64-mingw32-gcc.exe CMAKE_CXX_COMPILER=D:/tools/mingw64-gcc-13.1-full/bin/x86_64-w64-mingw32-g++.exe using system default toolchain.
-- xrepo: C:/Users/Administrator/xmake/xmake.exe lua private.xrepo install zlib
-- xrepo: zlib_INCLUDE_DIRS C://Users//Administrator//AppData//Local//.xmake//packages//z//zlib//v1.2.13//04bf9d8a64824100b68e5c59e579eda6//include
-- xrepo: zlib_LIBRARY_DIRS C://Users//Administrator//AppData//Local//.xmake//packages//z//zlib//v1.2.13//04bf9d8a64824100b68e5c59e579eda6//lib
-- xrepo: zlib_LIBRARIES zlib
-- xrepo: zlib prepend to CMAKE_PREFIX_PATH: C:/Users/Administrator/AppData/Local/.xmake/packages/z/zlib/v1.2.13/04bf9d8a64824100b68e5c59e579eda6
-- xrepo: target_include_directories(testxx  C://Users//Administrator//AppData//Local//.xmake//packages//z//zlib//v1.2.13//04bf9d8a64824100b68e5c59e579eda6//include)
CMake Error at .edx/cmake/xrepo.cmake:395 (target_include_directories):
  target_include_directories called with invalid arguments
Call Stack (most recent call first):
  CMakeLists.txt:23 (xrepo_target_packages)


-- xrepo: target_link_directories(testxx  C://Users//Administrator//AppData//Local//.xmake//packages//z//zlib//v1.2.13//04bf9d8a64824100b68e5c59e579eda6//lib)
CMake Error at .edx/cmake/xrepo.cmake:399 (target_link_directories):
  target_link_directories called with invalid arguments
Call Stack (most recent call first):
  CMakeLists.txt:23 (xrepo_target_packages)


-- xrepo: target_link_libraries(testxx  zlib)
-- Configuring incomplete, errors occurred!
>>>>
task failed 4.355 s, 0 error(s), 0 warning(s)
>

from xrepo-cmake.

waruqi avatar waruqi commented on June 12, 2024

json 里面也有转义字符,不在 json 里面替换,后面实际路径替换呢

from xrepo-cmake.

heheda123123 avatar heheda123123 commented on June 12, 2024

在加头文件路径之前替换
image
路径看起来是正常的了,但是还是报错
image

替换成两个反斜杠也还是报错
image

image

from xrepo-cmake.

heheda123123 avatar heheda123123 commented on June 12, 2024

咦,奇怪,我直接加这个路径也报错是为啥呢
image
image

from xrepo-cmake.

heheda123123 avatar heheda123123 commented on June 12, 2024

oo ,貌似不是转义的问题,是需要加个 PRIVATE,_visibility 这个变量为空了

from xrepo-cmake.

heheda123123 avatar heheda123123 commented on June 12, 2024

可以了,提了pr

from xrepo-cmake.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.