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

add cross-compiling support from project_options #15

Merged
merged 5 commits into from
Apr 1, 2023
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
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ include(${_project_options_SOURCE_DIR}/Index.cmake)
# Define the features of the project
include("./Features.cmake")

# enable cross-compiling: - should be called before run_vcpkg()
if(ENABLE_CROSS_COMPILING)
enable_cross_compiler()
aminya marked this conversation as resolved.
Show resolved Hide resolved
endif()
# install vcpkg dependencies: - should be called before defining project()
run_vcpkg()

Expand Down
2 changes: 2 additions & 0 deletions Features.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ option(FEATURE_DOCS "Enable the docs" OFF)

# fuzz tests
option(FEATURE_FUZZ_TESTS "Enable the fuzz tests" OFF)

option(ENABLE_CROSS_COMPILING "Detect cross compiler and setup toolchain" OFF)
7 changes: 7 additions & 0 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ tasks:
FEATURE_TESTS: OFF
CMAKE_BUILD_TYPE: Debug

build_cross_mingw:
- task: build_template
vars:
FEATURE_TESTS: OFF
CMAKE_BUILD_TYPE: Release
CONFIGURE_FLAGS: -DENABLE_CROSS_COMPILING:BOOL=ON -DDEFAULT_TRIPLET=x64-mingw-dynamic

install:
- task: build
- cmake --install ./build --prefix {{.INSTALL_PREFIX | default "./install"}}
Expand Down