Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Toolchain file descriptions #462

Merged
merged 1 commit into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,16 +153,28 @@ The **AREG SDK** is written in **C++17**, supports multiple platforms, processor
| Compiler | Platforms | Tools | API | CPU Architecture |
|-----------|---------------|---------------|---------------|---------------------------|
| GNU | Linux, macOS | CMake | POSIX | x86, x86_64, ARM, AARCH64 |
| Clang | Linux, Windows| CMake, MSVS | POSIX, Win32 | x86, x86_64 |
| Clang | Linux, Windows| CMake, MSVS | POSIX, Win32 | x86, x86_64, ARM, AARCH64 |
| MSVC | Windows | CMake, MSVS | Win32 | x86, x86_64 |
| Cygwin GNU| Windows | CMake | POSIX | x86, x86_64 |

For detailed build instructions, check the **[Building AREG SDK with CMake](./docs/wiki/01b-cmake-build.md)** or **[Building the AREG SDK with Microsoft Visual Studio and MSBuild](./docs/wiki/01c-msvc-build.md)** pages.


> [!NOTE]
> Other POSIX-compliant operating systems and compilers have not been tested yet.

**General Requirements**: Ensure your system includes the following:
- **CMake** (version 3.20+)
- **Git** for repository cloning
- **Compatible Compilers**: *GNU*, *LLVM*, or *MSVC* (Windows only) supporting **C++17** or newer
- **Java** (version 17+ for code generation tools)

**Platform-Specific Requirements**:
- **Linux**: Install optional **ncurses** required by `aregextend` library when build with extended objects (option `AREG_EXTEMDED=ON`).
- **Windows**: Requires Microsoft Visual C++, including packages **CMake** and **CLang compiler for Windows**, and **MFC** for GUI examples.
- **Optional Libraries**:
- **Google Test (GTest)** for unit tests (or build from sources).
- **SQLite3** (optional, or use the version in AREG SDK's `thirdparty` directory).

#### Build with CMake

To compile the **AREG SDK** using **CMake**, follow these steps:
Expand Down
85 changes: 45 additions & 40 deletions conf/cmake/user.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,50 +10,50 @@
# Available Options:
# 1. AREG_COMPILER_FAMILY -- A quick way to set the C++ and C compilers (CMAKE_CXX_COMPILER and CMAKE_C_COMPILER).
# 2. AREG_COMPILER -- Sets a specific compiler for both C++ and C projects.
# 3. AREG_TARGET -- Sets a specific compiler and the library architecture target. Default is compiler and system defined.
# 3. AREG_PROCESSOR -- The processor architect. Ignore if need to use system default.
# 4. AREG_BINARY -- Specifies the library type for the AREG Framework ('shared' or 'static'). Defaults to 'shared'.
# 5. AREG_LOGGER_BINARY -- Specifies the type of the Log Observer API library ('shared' or 'static'). Defaults to 'shared'.
# 6. AREG_BUILD_TYPE -- Specifies the build configuration ('Debug' or 'Release').
# 7. AREG_BUILD_TESTS -- Enables or disables building unit tests for the AREG Framework.
# 8. AREG_BUILD_EXAMPLES -- Enables or disables building examples for the AREG Framework.
# 9. AREG_EXTENDED -- Enables or disables extended AREG Framework features. May require additional dependencies.
# 10. AREG_LOGS -- Enables or disables logging during compilation. Defaults to 'enabled'.
# 11. AREG_USE_PACKAGES -- Enables or disables using installed packages. Controls other package options like SQLite and GTest.
# 12. AREG_SQLITE_PACKAGE -- Determines if the system's SQLite3 package should be used or compiled from source.
# 13. AREG_GTEST_PACKAGE -- Determines if the system's GTest package should be used or compiled from source.
# 14. AREG_ENABLE_OUTPUTS -- If disabled, output directories will match the CMake binary directory.
# 15. AREG_BUILD_ROOT -- Specifies the root directory for build files. Defaults to './product' within the AREG SDK root.
# 16. AREG_OUTPUT_DIR -- Directory where build outputs are placed.
# 17. AREG_OUTPUT_BIN -- Directory for output binaries (executables and shared libraries).
# 18. AREG_OUTPUT_LIB -- Directory for output static libraries.
# 19. AREG_PACKAGES -- Location for fetching third-party packages such as GTest.
# 20. AREG_INSTALL -- Enables or disables installation of AREG SDK binaries, headers and dependencies like 'sqlite3' and 'ncurses'.
# 21. AREG_INSTALL_PATH -- Location where AREG SDK binaries, headers, and tools are installed. Defaults to the user's home directory.
# 3. AREG_TARGET -- Specifies the compiler and library architecture target. Defaults to the system-defined compiler and architecture.
# 4. AREG_PROCESSOR -- The processor architect. Ignore if need to use system default.
# 5. AREG_BINARY -- Specifies the library type for the AREG Framework ('shared' or 'static'). Defaults to 'shared'.
# 6. AREG_LOGGER_BINARY -- Specifies the type of the Log Observer API library ('shared' or 'static'). Defaults to 'shared'.
# 7. AREG_BUILD_TYPE -- Specifies the build configuration ('Debug' or 'Release').
# 8. AREG_BUILD_TESTS -- Enables or disables building unit tests for the AREG Framework.
# 9. AREG_BUILD_EXAMPLES -- Enables or disables building examples for the AREG Framework.
# 10. AREG_EXTENDED -- Enables or disables extended AREG Framework features. May require additional dependencies.
# 11. AREG_LOGS -- Enables or disables logging during compilation. Defaults to 'enabled'.
# 12. AREG_USE_PACKAGES -- Enables or disables using installed packages. Controls other package options like SQLite and GTest.
# 13. AREG_SQLITE_PACKAGE -- Determines if the system's SQLite3 package should be used or compiled from source.
# 14. AREG_GTEST_PACKAGE -- Determines if the system's GTest package should be used or compiled from source.
# 15. AREG_ENABLE_OUTPUTS -- If disabled, output directories will match the CMake binary directory.
# 16. AREG_BUILD_ROOT -- Specifies the root directory for build files. Defaults to './product' within the AREG SDK root.
# 17. AREG_OUTPUT_DIR -- Directory where build outputs are placed.
# 18. AREG_OUTPUT_BIN -- Directory for output binaries (executables and shared libraries).
# 19. AREG_OUTPUT_LIB -- Directory for output static libraries.
# 20. AREG_PACKAGES -- Location for fetching third-party packages such as GTest.
# 21. AREG_INSTALL -- Enables or disables installation of AREG SDK binaries, headers and dependencies like 'sqlite3' and 'ncurses'.
# 22. AREG_INSTALL_PATH -- Location where AREG SDK binaries, headers, and tools are installed. Defaults to the user's home directory.
#
# Default Values:
# 1. AREG_COMPILER_FAMILY = <default> (possible values: gnu, cygwin, llvm, msvc)
# 2. AREG_COMPILER = <default> (possible values: g++, gcc, c++, cc, clang++, clang, clang-cl, cl)
# 3. AREG_TARGET = <default> (possible values: 'i386-linux-gnu', 'x86_64-linux-gnu', 'arm-linux-gnueabihf', 'aarch64-linux-gnu')
# 3. AREG_PROCESSOR = System (possible values: x86 (i386, i486), x64 (x86_64, x86-64, amd64, ia64), arm (arm32, armv7), aarch64 (arm64))
# 4. AREG_BINARY = shared (possible values: shared, static)
# 5. AREG_LOGGER_BINARY = shared (possible values: shared, static)
# 6. AREG_BUILD_TYPE = Release (possible values: Release, Debug)
# 7. AREG_BUILD_TESTS = ON (possible values: ON, OFF)
# 8. AREG_BUILD_EXAMPLES = ON (possible values: ON, OFF)
# 9. AREG_EXTENDED = OFF (possible values: ON, OFF)
# 10. AREG_LOGS = ON (possible values: ON, OFF)
# 11. AREG_USE_PACKAGES = ON (possible values: ON, OFF)
# 12. AREG_SQLITE_PACKAGE = ON (possible values: ON, OFF)
# 13. AREG_GTEST_PACKAGE = ON (possible values: ON, OFF)
# 14. AREG_ENABLE_OUTPUTS = ON (possible values: ON, OFF)
# 15. AREG_BUILD_ROOT = '<areg-sdk>/product' (path for output and generated files)
# 16. AREG_OUTPUT_DIR = '<areg-sdk>/product/build/<default-compiler family-name>/<os>-<bitness>-<cpu>-release-<areg-lib>'
# 17. AREG_OUTPUT_BIN = '<areg-sdk>/product/build/<default-compiler family-name>/<os>-<bitness>-<cpu>-release-<areg-lib>/bin'
# 18. AREG_OUTPUT_LIB = '<areg-sdk>/product/build/<default-compiler family-name>/<os>-<bitness>-<cpu>-release-<areg-lib>/lib'
# 19. AREG_PACKAGES = '${CMAKE_BINARY_DIR}/packages'
# 20. AREG_INSTALL = ON (possible values: ON, OFF)
# 21. AREG_INSTALL_PATH = '${HOME}/areg-sdk' (or '${USERPROFILE}' on Windows, defaults to current directory if unset)
# 4. AREG_PROCESSOR = System (possible values: x86 (i386, i486), x64 (x86_64, x86-64, amd64, ia64), arm (arm32, armv7), aarch64 (arm64))
# 5. AREG_BINARY = shared (possible values: shared, static)
# 6. AREG_LOGGER_BINARY = shared (possible values: shared, static)
# 7. AREG_BUILD_TYPE = Release (possible values: Release, Debug)
# 8. AREG_BUILD_TESTS = ON (possible values: ON, OFF)
# 9. AREG_BUILD_EXAMPLES = ON (possible values: ON, OFF)
# 10. AREG_EXTENDED = OFF (possible values: ON, OFF)
# 11. AREG_LOGS = ON (possible values: ON, OFF)
# 12. AREG_USE_PACKAGES = ON (possible values: ON, OFF)
# 13. AREG_SQLITE_PACKAGE = ON (possible values: ON, OFF)
# 14. AREG_GTEST_PACKAGE = ON (possible values: ON, OFF)
# 15. AREG_ENABLE_OUTPUTS = ON (possible values: ON, OFF)
# 16. AREG_BUILD_ROOT = '<areg-sdk>/product' (path for output and generated files)
# 17. AREG_OUTPUT_DIR = '<areg-sdk>/product/build/<default-compiler family-name>/<os>-<bitness>-<cpu>-release-<areg-lib>'
# 18. AREG_OUTPUT_BIN = '<areg-sdk>/product/build/<default-compiler family-name>/<os>-<bitness>-<cpu>-release-<areg-lib>/bin'
# 19. AREG_OUTPUT_LIB = '<areg-sdk>/product/build/<default-compiler family-name>/<os>-<bitness>-<cpu>-release-<areg-lib>/lib'
# 20. AREG_PACKAGES = '${CMAKE_BINARY_DIR}/packages'
# 21. AREG_INSTALL = ON (possible values: ON, OFF)
# 22. AREG_INSTALL_PATH = '${HOME}/areg-sdk' (or '${USERPROFILE}' on Windows, defaults to current directory if unset)
#
# Hints:
# - AREG_COMPILER_FAMILY is an easy way to set compilers:
Expand All @@ -72,7 +72,8 @@
# $ cmake -B ./build -DAREG_BUILD_ROOT="/home/developer/projects/my_project/product"
#
# Hint:
# To use AREG SDK cmake options in other project, the 'user.cmake' file should be included before first call of "project()". Otherwise, AREG SDK settings uses cmake options CMAKE_CXX_COMPILER and CMAKE_BUILD_TYPE options.
# To use AREG SDK cmake options in other project, the 'user.cmake' file should be included before first call of "project()".
# Otherwise, AREG SDK settings uses cmake options CMAKE_CXX_COMPILER and CMAKE_BUILD_TYPE options.
#
# Integration:
# - Visit https://github.com/aregtech/areg-sdk-demo repository to see various ways of AREG Framework integration.
Expand All @@ -89,6 +90,10 @@ if (DEFINED AREG_PROCESSOR AND NOT "${AREG_PROCESSOR}" STREQUAL "")
set(CMAKE_SYSTEM_PROCESSOR ${AREG_PROCESSOR})
endif()

if (DEFINED CMAKE_CXX_COMPILER_TARGET AND NOT "${CMAKE_CXX_COMPILER_TARGET}" STREQUAL "")
set(AREG_TARGET ${CMAKE_CXX_COMPILER_TARGET})
endif()

# If CMake compilers are specified, use them
if ((DEFINED CMAKE_CXX_COMPILER OR DEFINED CMAKE_C_COMPILER) AND (NOT "${CMAKE_CXX_COMPILER}" STREQUAL "" OR NOT "${CMAKE_C_COMPILER}" STREQUAL ""))

Expand Down
25 changes: 16 additions & 9 deletions conf/exports/config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ include(CMakeFindDependencyMacro)
# Set AREG SDK essentials
# ##################################################

# Set C and CXX compiler targets
if (NOT DEFINED CMAKE_CXX_COMPILER_TARGET OR "${CMAKE_CXX_COMPILER_TARGET}" STREQUAL "")
set(CMAKE_CXX_COMPILER_TARGET @CMAKE_CXX_COMPILER_TARGET@)
endif()
if (NOT DEFINED CMAKE_C_COMPILER_TARGET OR "${CMAKE_C_COMPILER_TARGET}" STREQUAL "")
set(CMAKE_C_COMPILER_TARGET @CMAKE_C_COMPILER_TARGET@)
endif()

# Root folder of the SDK
set(AREG_SDK_ROOT "@CMAKE_INSTALL_PREFIX@")
# Location of 'areg', 'aregextend' and 'areglogger' header files
Expand All @@ -20,7 +28,7 @@ set(AREG_SDK_TOOLS "@CMAKE_INSTALL_PREFIX@/tools/@AREG_PACKAGE_NAME@")
# Location of the AREG SDK code generator
set(AREG_TOOL_CODEGEN "${AREG_SDK_TOOLS}/codegen.jar")
# Full path to 'areg.cmake' to include in projects
set(AREG_CMAKE_EXPORTS "${AREG_CMAKE_CONFIG_DIR}/areg.cmake")
set(AREG_CMAKE_EXPORTS "${AREG_SDK_ROOT}/areg.cmake")

# The build type of AREG libraries.
set(AREG_BUILD_TYPE @AREG_BUILD_TYPE@)
Expand Down Expand Up @@ -64,10 +72,10 @@ option(AREG_BUILD_EXAMPLES "No AREG Examples" OFF)
# set to 'CMAKE_CURRENT_BINARY_DIR' if it should be in the compiled binaries directory
set(AREG_BUILD_ROOT "${CMAKE_SOURCE_DIR}/product")

# Add '${AREG_FRAMEWORK}' path in the includes
include_directories(${AREG_FRAMEWORK})
# Pass the path to the shared 'areg.init' file to the source codes.

# initialize SQLite3 library reference and type
set(AREG_SQLITE_LIB_REF @AREG_SQLITE_LIB_REF@)
set(AREG_SQLITE_LIB @AREG_SQLITE_LIB@)
add_definitions(-DUSE_SQLITE_PACKAGE=@USE_SQLITE_PACKAGE@)
# Pass path to the 'areg.init' file as a preprocessor definition
add_definitions(-DAREG_SHARE_INIT="${AREG_SHARE_INIT}")

Expand Down Expand Up @@ -99,10 +107,6 @@ else()
add_definitions(-DAREG_LOGS=0)
endif()

set(AREG_SQLITE_LIB_REF @AREG_SQLITE_LIB_REF@)
set(AREG_SQLITE_LIB @AREG_SQLITE_LIB@)
add_definitions(-DUSE_SQLITE_PACKAGE=@USE_SQLITE_PACKAGE@)

# Set the Platform API and the platform bitness.
if (AREG_DEVELOP_ENV STREQUAL "Win32")
add_definitions(-DWINDOWS -DWIN32)
Expand All @@ -118,3 +122,6 @@ if (AREG_BITNESS EQUAL 32)
else()
add_definitions(-DBIT64)
endif()

# Add '${AREG_FRAMEWORK}' path in the includes
include_directories(${AREG_FRAMEWORK})
20 changes: 20 additions & 0 deletions conf/exports/example/toolchains/clang-linux-arm32.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# This toolchain builds 32-bit binaries with Clang compiler for Linux on 32-bit ARM processor
# Run example:
# cmake -B ./product/cache/clang-linux-arm32 -DCMAKE_TOOLCHAIN_FILE=/path/to/areg-sdk/toolchains/clang-linux-arm32.cmake
# cmake --build ./product/cache/clang-linux-arm32 -j20

set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR ARM)

set(CMAKE_C_COMPILER clang)
set(CMAKE_C_COMPILER_TARGET arm-linux-gnueabihf)
set(CMAKE_CXX_COMPILER clang++)
set(CMAKE_CXX_COMPILER_TARGET arm-linux-gnueabihf)

set(CMAKE_FIND_ROOT_PATH "/usr")
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)

set(CMAKE_LIBRARY_ARCHITECTURE arm-linux-gnueabihf)
20 changes: 20 additions & 0 deletions conf/exports/example/toolchains/clang-linux-arm64.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# This toolchain builds 64-bit binaries with Clang compiler for Linux on 64-bit ARM (AARCH64) processor.
# Run example:
# cmake -B ./product/cache/clang-linux-arm64 -DCMAKE_TOOLCHAIN_FILE=/path/to/areg-sdk/toolchains/clang-linux-arm64.cmake
# cmake --build ./product/cache/clang-linux-arm64 -j20

set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR AARCH64)

set(CMAKE_C_COMPILER clang)
set(CMAKE_C_COMPILER_TARGET aarch64-linux-gnu)
set(CMAKE_CXX_COMPILER clang++)
set(CMAKE_CXX_COMPILER_TARGET aarch64-linux-gnu)

set(CMAKE_FIND_ROOT_PATH "/usr")
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)

set(CMAKE_LIBRARY_ARCHITECTURE aarch64-linux-gnu)
20 changes: 20 additions & 0 deletions conf/exports/example/toolchains/clang-linux-x64.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# This toolchain builds 64-bit binaries with Clang compiler for Linux on x86-64 processor
# Run example:
# cmake -B ./product/cache/clang-linux-x64 -DCMAKE_TOOLCHAIN_FILE=/path/to/areg-sdk/toolchains/clang-linux-x64.cmake
# cmake --build ./product/cache/clang-linux-x64 -j20

set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR x86_64)

set(CMAKE_C_COMPILER clang)
set(CMAKE_C_COMPILER_TARGET x86_64-linux-gnu)
set(CMAKE_CXX_COMPILER clang++)
set(CMAKE_CXX_COMPILER_TARGET x86_64-linux-gnu)

set(CMAKE_FIND_ROOT_PATH "/usr")
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)

set(CMAKE_LIBRARY_ARCHITECTURE x86_64-linux-gnu)
20 changes: 20 additions & 0 deletions conf/exports/example/toolchains/clang-linux-x86.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# This toolchain builds 32-bit binaries with Clang compiler for Linux on x86 processor
# Run example:
# cmake -B ./product/cache/clang-linux-x86 -DCMAKE_TOOLCHAIN_FILE=/path/to/areg-sdk/toolchains/clang-linux-x86.cmake
# cmake --build ./product/cache/clang-linux-x86 -j20

set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR i386)

set(CMAKE_C_COMPILER clang)
set(CMAKE_C_COMPILER_TARGET i386-linux-gnu)
set(CMAKE_CXX_COMPILER clang++)
set(CMAKE_CXX_COMPILER_TARGET i386-linux-gnu)

set(CMAKE_FIND_ROOT_PATH "/usr")
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)

set(CMAKE_LIBRARY_ARCHITECTURE i386-linux-gnu)
21 changes: 21 additions & 0 deletions conf/exports/example/toolchains/clang-win-x64.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# This toolchain builds 64-bit binaries with Clang compiler for Windows on x86-64 processor
# Run example:
# cmake -B ./product/cache/clang-win-x64 -DCMAKE_TOOLCHAIN_FILE=C:/path/to/areg-sdk/toolchains/clang-win-x64.cmake
# cmake --build ./product/cache/clang-win-x64 -j20 --config=Release

set(CMAKE_SYSTEM_NAME Windows)
set(CMAKE_SYSTEM_PROCESSOR AMD64)

set(CMAKE_C_COMPILER clang-cl)
set(CMAKE_CXX_COMPILER clang-cl)

set(CMAKE_FIND_ROOT_PATH "/")
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)

set(CMAKE_LIBRARY_ARCHITECTURE x64)

set(CMAKE_GENERATOR_PLATFORM x64 CACHE INTERNAL "Force 64-bit compilation")
set(CMAKE_GENERATOR_TOOLSET ClangCL CACHE INTERNAL "Force ClangCL tool-set")
21 changes: 21 additions & 0 deletions conf/exports/example/toolchains/clang-win-x86.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# This toolchain builds 32-bit binaries with Clang compiler for Windows on x86 processor
# Run example:
# cmake -B ./product/cache/clang-win-x86 -DCMAKE_TOOLCHAIN_FILE=C:/path/to/areg-sdk/toolchains/clang-win-x86.cmake
# cmake --build ./product/cache/clang-win-x86 -j20 --config=Release

set(CMAKE_SYSTEM_NAME Windows)
set(CMAKE_SYSTEM_PROCESSOR x86)

set(CMAKE_C_COMPILER clang-cl)
set(CMAKE_CXX_COMPILER clang-cl)

set(CMAKE_FIND_ROOT_PATH "/")
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)

set(CMAKE_LIBRARY_ARCHITECTURE x86)

set(CMAKE_GENERATOR_PLATFORM Win32 CACHE INTERNAL "Force 32-bit compilation")
set(CMAKE_GENERATOR_TOOLSET ClangCL CACHE INTERNAL "Force ClangCL tool-set")
20 changes: 20 additions & 0 deletions conf/exports/example/toolchains/gnu-linux-arm32.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# This toolchain builds 32-bit binaries with GNU g++/gcc compiler for Linux on 32-bit ARM processor
# Run example:
# cmake -B ./product/cache/gnu-linux-arm32 -DCMAKE_TOOLCHAIN_FILE=/path/to/areg-sdk/toolchains/gnu-linux-arm32.cmake
# cmake --build ./product/cache/gnu-linux-arm32 -j20

set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR ARM)

set(CMAKE_C_COMPILER arm-linux-gnueabihf-gcc)
set(CMAKE_C_COMPILER_TARGET arm-linux-gnueabihf)
set(CMAKE_CXX_COMPILER arm-linux-gnueabihf-g++)
set(CMAKE_CXX_COMPILER_TARGET arm-linux-gnueabihf)

set(CMAKE_FIND_ROOT_PATH "/usr")
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)

set(CMAKE_LIBRARY_ARCHITECTURE arm-linux-gnueabihf)
Loading
Loading