Microsoft MVP성태의 닷넷 이야기
cmake 크로스 컴파일 관련하여 질문이 있습니다 [링크 복사], [링크+제목 복사],
조회: 3112
글쓴 사람
월급쟁이
홈페이지
첨부 파일
 

https://github.com/libjpeg-turbo/libjpeg-turbo

위 링크에 있는 오픈소스 라이브러리를 크로스플랫폼용 c++ 라이브러리 프로젝트에서 써드파티로 이용하고 있어 빌드가 필요합니다
윈도우의 경우에는 이미 빌드가 끝났고, 안드로이드아 iOS용으로 크로스 컴파일 해야 하는 상황입니다
iOS는 맥북에서 시행할 예정이라 윈도우 환경에서 cmake로 안드로이드용으로 빌드하려고 하는데 문제가 발생하고 있습니다

해당 오픈소스 라이브러리 개발자가 제공한 안드로이드용 빌드 옵션 가이드라인을 적용하여 해보았으나 정상적으로 동작하지 않고 있습니다

아래는 제공된 가이드라인입니다
Armv7 (32-bit)
NDK r19 or later with Clang recommended

The following is a general recipe script that can be modified for your specific needs.

# Set these variables to suit your needs
NDK_PATH={full path to the NDK directory-- for example,
  /opt/android/android-ndk-r16b}
TOOLCHAIN={"gcc" or "clang"-- "gcc" must be used with NDK r16b and earlier,
  and "clang" must be used with NDK r17c and later}
ANDROID_VERSION={the minimum version of Android to support-- for example,
  "16", "19", etc.}

cd {build_directory}
cmake -G"Unix Makefiles" \
  -DANDROID_ABI=armeabi-v7a \
  -DANDROID_ARM_MODE=arm \
  -DANDROID_PLATFORM=android-${ANDROID_VERSION} \
  -DANDROID_TOOLCHAIN=${TOOLCHAIN} \
  -DCMAKE_ASM_FLAGS="--target=arm-linux-androideabi${ANDROID_VERSION}" \
  -DCMAKE_TOOLCHAIN_FILE=${NDK_PATH}/build/cmake/android.toolchain.cmake \
  [additional CMake flags] {source_directory}
make
Armv8 (64-bit)
Clang recommended

The following is a general recipe script that can be modified for your specific needs.

# Set these variables to suit your needs
NDK_PATH={full path to the NDK directory-- for example,
  /opt/android/android-ndk-r16b}
TOOLCHAIN={"gcc" or "clang"-- "gcc" must be used with NDK r14b and earlier,
  and "clang" must be used with NDK r17c and later}
ANDROID_VERSION={the minimum version of Android to support. "21" or later
  is required for a 64-bit build.}

cd {build_directory}
cmake -G"Unix Makefiles" \
  -DANDROID_ABI=arm64-v8a \
  -DANDROID_ARM_MODE=arm \
  -DANDROID_PLATFORM=android-${ANDROID_VERSION} \
  -DANDROID_TOOLCHAIN=${TOOLCHAIN} \
  -DCMAKE_ASM_FLAGS="--target=aarch64-linux-android${ANDROID_VERSION}" \
  -DCMAKE_TOOLCHAIN_FILE=${NDK_PATH}/build/cmake/android.toolchain.cmake \
  [additional CMake flags] {source_directory}
make

시도해보았으나 되지 않아서 따로 시도하였으나 C 컴파일러가 없다고 하여 GCC 설치 후 환경 변수를 등록하여
아래 커맨드로 재시도 하였고

cmake -G "Visual Studio 17 2022" -DCMAKE_SYSTEM_NAME=Android ^
More? -DCMAKE_ANDROID_ARCH_ABI=armeabi-v7a ^
More? -DCMAKE_ANDROID_NDK=D:\android-ndk-r25c ^
More? -DCMAKE_ANDROID_API=21 ^
More? -DCMAKE_INSTALL_PREFIX= ^
More?

PREFIX와 소스코드 경로는 지웠습니다

안드로이드 min 21, target 31로 32, 64bit 모두 빌드가 필요한 상황에서 32비트로 우선 시도를 했습니다
에러는 아래와 같습니다

F:\visual studio 2022_pro\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(820,5): error :
The BaseOutputPath/OutputPath property is not set for project 'VCTargetsPath.vcxproj'.
Please check to make sure that you have specified a valid combination of Configuration and Platform for this project.
 Configuration='Debug' Platform='x64'.
You may be seeing this message because you are trying to build a project without a solution file, and have specified a non-default Configuration or Platform that doesn't exist for this project.

추가적으로 제공해야 할 것이 있으면 댓글 부탁드립니다
며칠째 씨름 중인데 감이 안잡히네요 ㅠ








[최초 등록일: ]
[최종 수정일: 3/28/2023]


비밀번호

댓글 작성자
 



2023-03-28 01시46분
관련해서는 안드로이드 쪽 커뮤니티에 질문하시는 것이 좋겠습니다.
정성태

... [16]  17  18  19  20  21  22  23  24  25  26  27  28  29  30  ...
NoWriterDateCnt.TitleFile(s)
5540산들마을...8/11/20216371C# 많은 Control(Label 300개) Update 관련 문의 [2]파일 다운로드1
5539초초초촙8/9/20214879c# textbox 입력값이 다름 [1]파일 다운로드1
5538VS8/7/20215162vsmacros 확장자 파일을 사용하는 방법을 알 수 있을까요? [2]
5537민성8/6/20215392안녕하세요 WPF에서 이미 있는창이 있다면 안띠우게 하는 방법 [1]
55358/5/20216901안녕하세요. 초보 웹 개발자입니다. [10]파일 다운로드2
5534하영7/28/20215441clrprofiler 를 사용하여 세션정보 접근 [6]파일 다운로드1
5533함준혁7/20/20214977.net fpspread 관련 질문입니다.. [1]
5532조윤상7/15/20216273바인딩은 성공 했습니다. 그런데 브라우저에서 인증서가 없다고 나옵니다. [2]
5530ocm7/14/20215885pthread_create [7]파일 다운로드1
5529ksc7/13/20215059Source Generator 관련 질문이 있습니다. [1]
5528초심으로7/9/20216241MDI 에서 USB 연결해제 알림이 안되는 문제 질문 드려봅니다. [7]파일 다운로드1
5527wuny7/7/20215145제어관련 고민을하다가 소캣방식 선택 [2]
5526이성열 donator7/7/20216727wpf x64로 만든 메인 프로그램에서 dll로 된 UserControl 속성이 디자인타임에 잘 안보이는 문제 [10]파일 다운로드2
5525Wuny7/7/20217288제가 만든 배포파일은 window에서 막는걸까요? [2]파일 다운로드1
5524하이스컬7/2/20216605특정 이벤트에서 다른 이벤트 호출 관련 문의 [3]
5523민우7/1/202112353도커 사용시 윈도우 이미지 생성도 가능한가요? [2]
5522질문6/28/20217022WPF에서 splash screen이 나타나는 위치를 변경할 수 있나요? [3]
5521김민혁6/24/20217100.exe 파일 에러에 관한 질문 입니다. [3]
5520한예지 donator6/21/20216878랜덤함수 질문있습니다!! [2]
5519리얼킴6/19/20215843.net framwork 4.0 에서 4.8로 꼭 가야할까요?? [1]
5518한예지 donator6/18/20216550ArrayList, IList에 대해 질문 있습니다. [3]
5517wunsy6/18/20216966winform에서 Button 활성화, 비활성화 [4]
5516ocm6/15/20215970mips 어셈블리 연산 다시 질문드려요 (첨부파일 갱신됨) [2]파일 다운로드1
5515ocm6/14/20216862mips 어셈블리 연산 [6]파일 다운로드1
5514jongs6/11/20217585GethashCode와 String대한 질문 [2]
5513labe...6/11/20217313C# Winform 에서 Label에 동일한 Color를 넣었을 때 처리방법이 궁금합니다. [2]
... [16]  17  18  19  20  21  22  23  24  25  26  27  28  29  30  ...