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

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분
관련해서는 안드로이드 쪽 커뮤니티에 질문하시는 것이 좋겠습니다.
정성태

1  2  [3]  4  5  6  7  8  9  10  11  12  13  14  15  ...
NoWriterDateCnt.TitleFile(s)
5917한예지 donator9/14/202312733동기화 도구 질문 있습니다. [4]
5916한예지 donator9/3/202313066Thread.Sleep(500), await Task.Delay(500), Task.Delay(500) 차이점이 궁금합니다. [2]
5915한예지 donator8/30/202314273비동기 코드를 for 문 안에 작성한 경우 제어 변수가 올바르게 동작하지 않는 이유가 궁금합니다. [3]
5914한상욱8/11/202313923.net wpf에서 skiasharp 의 skelement 를 canvas로 사용 하고 있습니다. [1]
5913김태우8/10/202313519지역변수로 이해하는 메서드매개변수 게시글 댓글 [3]
5912guest4/25/202318920[참고 - 초보용] Sqlite 디비는 double이 없고 Real이 대신합니다 [3]
5911guest4/24/202312855Form1.cs와 외부 class.cs와 통신 (static async method포함) [4]파일 다운로드1
5910guest4/24/202312226Async 메서드와 try~catch [1]
5909guest4/22/202313661Visual Studio 구매 시(1인 개발자) [4]
5908guest4/22/202313041텅빈 원그리기 [5]
5907민성4/21/202312956안녕하세요 서버 백업 문제에 대해서 [2]
5906guest4/21/202313281Dispatcher 서비스 구현 질문 [1]
5905guest4/20/202314204tabControl의 tabPage가 여러 개일 때 순서를 바꾸기가 까다롭네요 [5]
5904guest4/18/202314462[신규자료첨부] DLL 'SQLite.Interop.dll'을 찾을 수 없습니다 [4]파일 다운로드1
5903guest4/18/202313133fileSystemWatcher 이벤트 관련 질문입니다 [2]
5902guest4/17/202314266c#으로 USB 관련 질문 [2]
5901guest4/17/202311801내솔루션 판매 시 1.0.0.0 폴더와 Sqlite 배포 [5]
5900guest4/17/202314723DLL 'SQLite.Interop.dll'을 찾을 수 없습니다 [2]파일 다운로드1
5899guest4/17/202312820Dictionary와 Linq [4]
5898차가워4/17/202312506CNTK 교육 문의 [1]
5897guest4/17/202312208Socket스레드와 UI thread [4]
5896HAN4/16/202312158c언어 return 에 대해 궁금한게 있어요. [1]파일 다운로드1
5895guest4/15/202312451Drag and Drop - 모든 컨트롤 [2]
5894송부장4/14/202314235[질문] Visual Studio 2022에서 '도구 상자 항목 선택'의 'COM 구성 요소' 탭에서 ActiveX 목록이 보이지 않습니다. [3]파일 다운로드2
5893감사합니...4/14/202312059오라클 OLEDB방식 접속 후 SELECT 'TEST' TEST_VALUE FROM DUAL의 값이 이상합니다. [1]
5892한무4/14/202311972C# 으로 백그라운드에서 워드를 실행하여 매크로 실행이 가능 할까요? [2]
1  2  [3]  4  5  6  7  8  9  10  11  12  13  14  15  ...