IACore v1.2
This commit is contained in:
37
Docs/BUILDING.md
Normal file
37
Docs/BUILDING.md
Normal file
@ -0,0 +1,37 @@
|
||||
## 🛠️ Building IACore
|
||||
|
||||
IACore uses **CMake Presets** to manage toolchains and cross-compilation. This ensures that the correct compilers (Clang) and flags (AVX2/SIMD) are used automatically.
|
||||
|
||||
### Prerequisites
|
||||
* CMake 3.28+
|
||||
* Ninja Build System
|
||||
* Vcpkg (Environment variable `VCPKG_ROOT` must be set)
|
||||
* Clang / Clang-CL
|
||||
|
||||
### Build Instructions
|
||||
|
||||
**1. Configure**
|
||||
Select the preset for your target platform.
|
||||
```bash
|
||||
# List available presets
|
||||
cmake --list-presets
|
||||
|
||||
# Configure for your platform (e.g., windows-x64, linux-arm64, wasm)
|
||||
cmake --preset windows-x64
|
||||
```
|
||||
|
||||
**2. Build**
|
||||
|
||||
```bash
|
||||
cmake --build --preset windows-x64
|
||||
```
|
||||
|
||||
### Available Presets
|
||||
|
||||
|Preset |Description |Toolchain |
|
||||
|-------------|------------------------------|------------------------------------|
|
||||
|windows-x64 |Windows (Clang-CL) |CMake/Toolchains/windows-x64.cmake |
|
||||
|linux-x64 |Linux (Clang) |CMake/Toolchains/linux-x64.cmake |
|
||||
|wasm |WebAssembly (Emscripten) |CMake/Toolchains/wasm.cmake |
|
||||
|windows-arm64|Windows on ARM (Cross-compile)|CMake/Toolchains/windows-arm64.cmake|
|
||||
|linux-arm64 |Linux on ARM (Cross-compile) |CMake/Toolchains/linux-arm64.cmake |
|
||||
27
Docs/USING.md
Normal file
27
Docs/USING.md
Normal file
@ -0,0 +1,27 @@
|
||||
## 🚀 Using IACore in a New Project
|
||||
|
||||
IACore provides a CMake macro `iacore_setup_project()`, which standardizes your build environment. This macro automatically:
|
||||
|
||||
* Enforces C++20 standard.
|
||||
* Sets warning levels (-Wall -Wextra -Wpedantic for Clang/GCC, /W4 for MSVC/Clang-CL).
|
||||
* Detects the target architecture (x64, ARM64, WASM) and sets internal cache variables.
|
||||
* Suppresses C++98 compatibility warnings when using Clang on Windows.
|
||||
|
||||
Example CMakeLists.txt
|
||||
```cmake
|
||||
cmake_minimum_required(VERSION 3.28)
|
||||
project(MyGame)
|
||||
|
||||
# Or you can use FetchContent
|
||||
add_subdirectory(external/IACore)
|
||||
|
||||
## Apply IACore's standard project configuration
|
||||
# This applies C++20 and strict warning flags globally to your targets.
|
||||
iacore_setup_project()
|
||||
|
||||
# Define your target(s)
|
||||
add_executable(MyGame src/main.cpp)
|
||||
|
||||
# Link IACore
|
||||
target_link_libraries(MyGame PRIVATE IACore)
|
||||
```
|
||||
Reference in New Issue
Block a user