Skip to content

Passing additional CMake arguments to Native build #24764

@alpencolt

Description

@alpencolt

build-native.sh has options cmakeargs for passing additional arguments to CMake. But if I want add -D_FORTIFY_SOURCE=2 option to CXXFLAGS it will be applied to corefx/src/Native/Unix/configure.cmake (which cause errors on test programs compilation).
If I add this option to corefx/src/Native/Unix/CMakeLists.txt it will applied to source code only (as expected).

Is there other way to pass this and others options to build without patching source code? If not is it possible to change cmakeargs behavior or add some other logic?

This behavior is the same for CoreCLR too.

cc @BruceForstall @jkotas
cc @chunseoklee

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-Infrastructure-librariesos-linuxLinux OS (any supported distro)questionAnswer questions and provide assistance, not an issue with source code or documentation.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions