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

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

... 61  62  [63]  64  65  66  67  68  69  70  71  72  73  74  75  ...
NoWriterDateCnt.TitleFile(s)
1053폭풍코딩4/19/201216651스마트클라이언트 ctrl-c 복사가 작동하지 않습니다. [1]
1052에슈리온4/17/201233086ClickOnce 배포시 클라이언트의 설치경로를 지정할 수 없나요? [1]
1051최정수4/10/201219946WCF 클라이언트 비정상 종료 관련 [1]
1050에슈리온4/6/201222135관리자 권한과 ClickOnce, 그리고 Bootstrapper문제 [6]
1049김성혁4/4/201216725스마트클라이언트 stand-alone 방식의 배포 문제.. [1]
1048C#조으다3/27/201220268어셈블리 로드 / 언로드와 관련해서.. [6]
1047김우형3/23/201217827WCF 서비스를 이용한 데이터 전송 중 Exception 문의 [1]
1044임동찬2/29/201217728웹에서 COM Exception.. [2]
1043박성준2/24/201216266Lazy<T> 의 지연객체 생성 전에 실 객체의 Attribute분석 [2]파일 다운로드1
1042이성환2/20/201216695BlockingMethod에 빠진 스레드를 즉시 죽이고 싶습니다...;ㅅ; [2]파일 다운로드1
1039김재영2/15/201216012어셈블리에 사용자마다 다른 값을 적용하여 자동 빌드 방법이 있을까요? [2]
1037윈드로니2/12/201217479WPF 관련 질문 드립니다. [2]
1035임동찬2/9/201215828XML, XSD, XMLCodeGenerator 관련 [2]
1033곽성현2/7/201216365훔..윈도우 디바이스 드라이버 관련 [1]
1030궁빈2/2/201218801msbuild를 이용한 웹게시 및 자동 Dist 방법론에 대해 질문 드립니다!! [6]
1028신정환1/30/201215998기존 legacy Windows application이 WoA 환경에서 동작되지 않는 이유가 무얼까요? [2]
1026노현철1/19/201217959WPF가 XP에서 느리게 로딩되는 현상에 대해 질문드립니다. [4]
1025궁그미1/18/201218921네이버 소켓 로그인 이해가 안되는점이 있는데요 [2]
1022선무당1/11/201216919TFS 에서 공통 Assembly 공유 방법에 대해서 해결책이 없을까요? [2]
1021김재영1/8/201216072대리자를 메소드 파라메터로 넘겨도 됩니까? [2]파일 다운로드1
1019남산골11/13/201918690안녕하세요!! 성태님~~ [3]
1018강한구12/29/201121979WPF ClickOnce 배포시 콤포넌트 dll 다운로드 문제에 대하여 질문 있습니다. [1]
1017임동찬12/28/201118910smart client와 xbop, silverlight [6]
1015개똥이12/22/201116327RMCLOCK 설정 관련 질문이요ㅜ [2]
1011사길수12/16/201116380hyper-v 이더넷 카드 관련 문의 좀 드립니다. [1]
1006루로니12/13/201118485윈도우7과 XP의 DLL후킹 처리에 관해서 질문입니다. [3]
... 61  62  [63]  64  65  66  67  68  69  70  71  72  73  74  75  ...