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

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

... 46  47  48  49  50  51  52  [53]  54  55  56  57  58  59  60  ...
NoWriterDateCnt.TitleFile(s)
1528김개똥2/14/201516748좀 관련없는 질문이지만, 정말 답답하고 찾는데 명확한 해답 찾지못해 질문 올립니다. <Windows 사용자 인증> [1]
1527방문자1/27/201518131System Timer의 Tick에서 Backgroundworker를 호출하면 스레드 문제가 있을까요? [1]
1526황상대1/26/201520280C# 마샬링 관련 질문이 있습니다. [1]
1525Ji-y...1/19/201518874시작하세요 C# 프로그래밍 도서에 관한 질문입니다. [1]
1523임종복12/31/201426815windows 2008 r2에서 ms-sql 2008 서버사용시 tls문제점 [3]
1524임종복1/4/201521322    답변글 [답변]: windows 2008 r2에서 ms-sql 2008 서버사용시 tls문제점 [2]
1521윤대욱12/19/201418031C++ 에서 서버와 클라이언트를 나누어서 구조체 전달에 대해서 궁금합니다. [1]파일 다운로드1
152012/10/201418652datetime관련해서요 [1]
1516aTo12/1/201417729wpf 배포관련. [3]
1514얄미운제리11/17/201418595[C# Mono]Mono Chart 개발 문의드립니다. [1]
1355미나리나물11/13/201416029RDP 접속 방식 질문드리고 싶습니다. [1]
1353송용국11/10/201415222TeamFoundationServer 에 소스를 Target서버로 옮기는(내려주는) 방법 있나요? [1]
1351blue...11/7/201420578c# webbrowser 모바일환경 접속 [1]
1350에메11/7/201420415WCF namedpipe 퍼블리싱 충돌 문제 [3]파일 다운로드1
1349Chun...11/6/201424545Microsoft. Net Framework 액세스 거부 오류...... [2]
1348김준석11/6/201420716 Mini dump 기록 안되는 현상 [2]파일 다운로드1
1346개미11/5/201435191https페이지에서 http서버에 있는 이미지 파일 호출시 보안 오류 [8]
1345장구니11/4/201418946AWS 인스턴스를 만들었는데 [1]
1343h11/2/201418580안녕하세요 [1]
1342왕초보11/1/201423430C#에서의 함수포인터 [13]
1347왕초보11/5/201418150    답변글 [답변]: C#에서의 함수포인터 [1]
1341영택10/29/201419326MFC Amazon S3 사용관련하여 질문드립니다. [2]
1344영택11/4/201415908    답변글 [답변]: MFC Amazon S3 사용관련하여 질문드립니다. [2]
1340감사합니다10/28/201420500c# wpf shdocvw internet explorer를 윈도우프레임으로 집어 넣을 수 있는지 궁금합니다. [3]파일 다운로드1
1338헬프미10/28/201421218tcp 소켓의 SYN_RECV 상태에 대하여 질문있습니다. [3]
1336이소정10/27/201416585filestream seek에 대해 질문있습니다. [1]
... 46  47  48  49  50  51  52  [53]  54  55  56  57  58  59  60  ...