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

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)
5857guest3/17/20233055귀도 반 로썸을 보고 [4]
5856guest3/17/20233250Form1_FormClosing에 closing time을 Sqlite 저장하는 법? [6]파일 다운로드1
5855욜로3/17/20232820C# 메타데이터에서 불러오는 참조 정의가 안됨 [1]
5854민성3/16/20232989안녕하세요 asp.net mvc using문 관련하여 [1]
5853pa3/16/20233269오피스 2016 업데이트 후 파일 출력 불가 [1]
5852guest3/16/20232951입력 foreach 검색/출력 foreach [3]
5851guest3/15/20233278foreach내 list변경 [10]
5850독서가3/14/20232946C#에서 동적dll 사용시 문의입니다. [4]파일 다운로드1
5849guest3/9/20232928C# wpf로 Web에서 구동되는 hts가능한가요? (노트북없고 스마트폰 없음) [4]
5848민성3/9/20232834도움 요청드립니다. [2]파일 다운로드1
5847guest3/7/20233011SQlike Like 구문 - 1시간째 인데 안되네요 [13]
5846Huuu...3/7/20232676웹 다운로드에 대한 고찰 [5]파일 다운로드1
5845guest3/7/20232701C# Split함수의 불친절함 [1]
5844까망이3/7/20232821c# 무료 디컴파일러는 어떤게 좋습니까? [1]
5843guest3/7/20232801판매 후 dll 등 에러 [5]
5842kr13/6/20232830publish 할 때 분석기 관련 dll 제외 [5]
5841guest3/3/20233009프로그램 판매 시 - Upgrade 버전 판매 [2]
5840joe3/2/20233114C# 클래스 라이브러리 수정 -> C++에서 참조시 함수 목록 갱신되지 않음. [4]파일 다운로드1
5839guest3/2/20233750윈도우 서비스 프로그램 - FORM 애플리케이션 감시서비스 [8]
5838랄랄라3/1/20232944event 사용 시 두 표현의 차이점이 있을까요? [1]
5837감사합니...2/28/20233111오라클 DB서버 접속관련 문의 드립니다.(Load Balancing, HA Events) [2]
5836박지범2/27/20232889static instance의 initialize 순서가 보장되나요? [6]
5835주민호2/25/20235768Windows Software Development Kit - 최신버전 1개 남기고 다 삭제하면 안되는지요? [10]파일 다운로드1
5834guest2/24/20232993Python IDE - 비주얼스튜디오 [3]
5833무지남2/23/20232643Async 메서드 그리고 나서 Bool 메서드 [5]
5832김지우2/21/20232952event와 delegate의 차이 , event를 써야하는 이유 [1]
1  2  3  [4]  5  6  7  8  9  10  11  12  13  14  15  ...