Skip to content

Abiity to build a project with two different architectures #151

@realoriginal

Description

@realoriginal

Bit of an odd request, unless it already exists - I've been unable to achieve it. I attempted to essentially have singular cmkr.toml file that builds an x86, and x64 variation of the same code base using the following TOML:

[cmake]
version = "3.19"
cmkr-include = "cmake/cmkr.cmake"

[project]
name = "reaper"

[target.reaper-x64]
type = "executable"
sources = [ "src/*.c" ]
include-before = [ "cmake/toolchain-x64.cmake" ]

[target.reaper-x86]
type = "executable"
sources = [ "src/*.c" ]
include-before = [ "cmake/toolchain-x86.cmake" ]

With the toolchain files containing the respective overwrites for the CMAKE_C_COMPILER and CMAKE_CXX_COMPILER variables. However, understandably, the include-before of the last target ( x86 ) overwrites the CMAKE_C_COMPILER for the x64 build. Would it be plausible to achieve this - Or is it generally recommended to instead build each part separately by overwriting it during the build time -DCMAKE_C_COMPILER={CROSS_PREFIX}-clang etc

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions