Build Tweak

This commit is contained in:
TheBrokenRail 2022-06-12 16:23:32 -04:00
parent 13ac816baa
commit f1ec29ec86
2 changed files with 10 additions and 3 deletions

View File

@ -3,9 +3,13 @@ macro(setup_toolchain target)
# Use ARM Cross-Compiler # Use ARM Cross-Compiler
set(CMAKE_C_COMPILER "${target}-gcc") set(CMAKE_C_COMPILER "${target}-gcc")
set(CMAKE_CXX_COMPILER "${target}-g++") set(CMAKE_CXX_COMPILER "${target}-g++")
set(CMAKE_FIND_ROOT_PATH "/usr/${target}" "/usr/lib/${target}")
# Extra # Extra
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# pkg-config # Custom Search Paths
set(ENV{PKG_CONFIG_LIBDIR} "/usr/lib/${target}/pkgconfig:/usr/${target}/lib/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig") if(NOT DEFINED ENV{MCPI_TOOLCHAIN_USE_DEFAULT_SEARCH_PATHS})
# Find Root
set(CMAKE_FIND_ROOT_PATH "/usr/${target}" "/usr/lib/${target}")
# pkg-config
set(ENV{PKG_CONFIG_LIBDIR} "/usr/lib/${target}/pkgconfig:/usr/${target}/lib/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig")
endif()
endmacro() endmacro()

View File

@ -32,3 +32,6 @@
./scripts/setup.sh <client|server> <armhf|arm64|i686|amd64> <Custom CMake Arguments> ./scripts/setup.sh <client|server> <armhf|arm64|i686|amd64> <Custom CMake Arguments>
./scripts/build.sh <client|server> <armhf|arm64|i686|amd64> ./scripts/build.sh <client|server> <armhf|arm64|i686|amd64>
``` ```
### Environment Variables
- ``MCPI_TOOLCHAIN_USE_DEFAULT_SEARCH_PATHS``: Use Default CMake Search Paths Rather Than Guessing