임베디드 ARM 프로세서 용 libwebsockets (LWS)을 사용하여 웹 서버를 구현하고 있습니다. 나는 LWS에 대해 배울 때 우분투의 gcc에서 서버를 테스트하고있다. gcc 빌드로 작동하는 서버를 가지고 있지만 이제는 ARM 보드 용으로 크로스 컴파일 된 버전을 빌드하려고합니다. 내 GCC 빌드 디렉토리와 동일한 레벨에서 빌드 디렉토리를 생성GCC 파일 외에도 libwebsockets 용 교차 컴파일 된 ARM 파일 빌드
// Set the path to ARM directories to just above the bin directory
set(CROSS_PATH usr/local/opt/crosstool/arm-linux/gcc-3.3.4-glibc-2.3.2)
// Target operating system name
set(CMAKE_SYSTEM_NAME Linux)
// Name of C compiler
set(CMAKE_C_COMPILER "${CROSS_PATH}/bin/arm-linux-gcc")
set(CMAKE_CXX_COMPILER "${CROSS_PATH}/bin/arm-linux-g++")
// Where to look for the target environment. (More paths can be added here)
set(CMAKE_FIND_ROOT_PATH "${CROSS_PATH}")
// Adjust the default behavior of the FIND_XXX() commands:
// search programs in the host environment only.
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
// Search headers and libraries in the target environment only.
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
:
은 내가 툴체인 파일을 만들었습니다.GCC: libwebsockets > build
ARM: libwebsockets > buildx
cmake, CMakeList.txt에 필요한 파일, cmake이 (GCC 용)를 호출 할 때 참조하는 "libwebsockets"에 있습니다
cmake ..
또는 팔 - 리눅스 GCC에 대한
:하지만이 마지막 줄을 실행하면 몇 파일 (예 : cmake 캐시)을 업데이트하고 빌드 파일을 만들지 않습니다.
어떻게 ARM 파일을 빌드 할 수 있습니까? 새 빌드를 만들기 전에 기존 gcc 빌드를 삭제해야합니까?
도움 주셔서 감사합니다.
'buildx'에서 모든 것을 제거하고'cmake .. -DCMAKE_TOOLCHAIN_FILE = ../arm-linuc-gcc.cmake'를 다시 호출하면 어떻게됩니까? – yegorich
@yegorich 그게 바로 그것입니다. 빌드되지 않기 때문에 buildx에는 아무 것도 없습니다. 아래 답변을 참조하십시오. – Gordon