diff --git a/CMakeLists.txt b/CMakeLists.txt index af33460..10d4643 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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() +endif() # install vcpkg dependencies: - should be called before defining project() run_vcpkg() diff --git a/Features.cmake b/Features.cmake index 53e461c..2e81967 100644 --- a/Features.cmake +++ b/Features.cmake @@ -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) \ No newline at end of file diff --git a/Taskfile.yml b/Taskfile.yml index 7712fd5..66c1aad 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -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"}}