BUILD

git clone <https://bitbucket.org/multicoreware/x265_git.git> x265
cd x265

vim toolchain.cmake # 내용은 아래 code 참조하여 생성

mkdir build-arm
cd build-arm

cmake -DCMAKE_TOOLCHAIN_FILE=../toolchain.cmake -DENABLE_ASSEMBLY=OFF -DENABLE_SHARED=ON -DCMAKE_BUILD_TYPE=Release ../source

make

make install DESTDIR=/opt/fsl-imx-fb/6.6-scarthgap/sysroots/cortexa9t2hf-neon-poky-linux-gnueabi
# toolchain.cmake
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR arm)

set(CMAKE_C_COMPILER arm-poky-linux-gnueabi-gcc)
set(CMAKE_CXX_COMPILER arm-poky-linux-gnueabi-g++)

set(CMAKE_C_FLAGS "-mthumb -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a9 -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64 --sysroot=/opt/fsl-imx-fb/6.6-scarthgap/sysroots/cortexa9t2hf-neon-poky-linux-gnueabi" CACHE STRING "C flags")
set(CMAKE_CXX_FLAGS "-mthumb -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a9 -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64 --sysroot=/opt/fsl-imx-fb/6.6-scarthgap/sysroots/cortexa9t2hf-neon-poky-linux-gnueabi" CACHE STRING "CXX flags")
set(CMAKE_EXE_LINKER_FLAGS "-mthumb -mfpu=neon -mfloat-abi=hard --sysroot=/opt/fsl-imx-fb/6.6-scarthgap/sysroots/cortexa9t2hf-neon-poky-linux-gnueabi" CACHE STRING "Linker flags")

set(CMAKE_SYSROOT /opt/fsl-imx-fb/6.6-scarthgap/sysroots/cortexa9t2hf-neon-poky-linux-gnueabi)

set(CMAKE_FIND_ROOT_PATH ${CMAKE_SYSROOT})
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

# CMake 테스트에서 사용할 플래그 강제 적용
set(CMAKE_C_FLAGS_INIT "-mthumb -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a9 --sysroot=/opt/fsl-imx-fb/6.6-scarthgap/sysroots/cortexa9t2hf-neon-poky-linux-gnueabi")
set(CMAKE_CXX_FLAGS_INIT "-mthumb -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a9 --sysroot=/opt/fsl-imx-fb/6.6-scarthgap/sysroots/cortexa9t2hf-neon-poky-linux-gnueabi")