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

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)
5257C#초보11/9/20197770파일 저장 방법에 대해 조언 부탁드립니다. [3]
5256세퉁11/8/20197095안녕하세요~ 질문은 아닙니다만.. [1]
5255C#초보11/6/20197616중첩 딕셔너리를 어떻게 만들 수 있을까요? [2]
5252김동수11/4/20197244Windows 10 로그인 ( Credential Provider ) 문의드립니다. [1]
5251kss11/1/20197325c#문법질문입니다. [1]
5250이대희10/31/20197418시작하세요 C# 7.3 프로그래밍 책이 절판이네요. [1]
5249황태관10/24/20197901c# 폼안에 특정 프로그램 불러오기.. [1]파일 다운로드1
5248황태관10/23/20198720C언어로 만든 dll 를 참조해서 c#으로 만들려면.. [3]
5245민성10/21/20197827안녕하세요 Ui 스레드 접근에 대해서 질문드리도록 하겠습니다. [1]
5244hbli...10/20/20197268두개의 쓰레드에서 하나의 Queue 리스트 사용시 질문드립니다. [2]
5243최선호 donator10/18/20196869Screen Capture 와.. Overlay 질문 좀 드릴게요 ㅠ.ㅠ ( 장문 주의..... ) [2]
5241C#초보10/16/20198898C# USB 통신 구현 관련 질문 드립니다! [1]
5240김동규10/15/20198775런타임 시 Encoding.Default를 UTF-8로 설정할 수 있을까요? [3]
5239밤톨이10/13/20197071시놀리지 DSM에 asp.net core 2 웹서버 구축이 가능한가요? [1]
5238권석헌10/2/20197646C# - C++ 간의 Memorymapped file 관련 Data 질문좀 드립니다 선생님 [1]
5237유호성10/1/20197394사용자 정의 컨트롤 VS IDE에서만 Exception 발생 [2]
5234koko9/25/20199631안녕하세요. 64bit WPF -> 32bit C++ DLL Import사용 문의 드립니다. [3]
5232fox3...9/24/20197473C# Memorymappedfile 재 업로드 드립니다.(실행순서 및 질문내용 정리) [7]파일 다운로드1
5231fox3...9/24/20197821C# 메모리맵드파일 관련 질문드립니다. 최소한의 재현가능코드 첨부후 재질문 드립니다. [2]파일 다운로드1
5230질문9/23/20197553C++ 로 만든 dll 을 C#에서 사용할 때 질문 [2]
5229fox3...9/23/20199895C# 메모리맵드파일 관련 질문드립니다. [2]
5227세퉁9/23/20198620WPF Textblock 폰트 크기에 따라 글자 색이 깨지는 현상이 있습니다. [3]파일 다운로드1
5226김대훈9/23/20198133정말 황당한 경우입니다.. [2]
5223김태균9/19/20197947책 소개 링크가 7.1버전판으로 이어집니다. [1]
5222냥냥이9/14/20198505프로그래밍 논리력이 많이 부족합니다 [3]
5219티지레몬9/9/201910007c# PCB 자동화 프로그램(윈도우 폼 위주로 작업) 제작 준비 [3]
... 16  17  18  19  20  21  22  23  24  25  [26]  27  28  29  30  ...