# What cmake method is used to configure the Randomized Base Address option in Linker for VS2015 Project ?

**URL:** <https://discourse.cmake.org/t/what-cmake-method-is-used-to-configure-the-randomized-base-address-option-in-linker-for-vs2015-project/2016>\
**Category:** Code\
**Created:** [October 17, 2020, 2:41am UTC](https://discourse.cmake.org/t/what-cmake-method-is-used-to-configure-the-randomized-base-address-option-in-linker-for-vs2015-project/2016 "2020-10-17T02:41:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mirro187](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/m/ad7895/32.png) [@mirro187](https://discourse.cmake.org/u/mirro187)\
**Post date:** [October 17, 2020, 2:41am UTC](https://discourse.cmake.org/t/what-cmake-method-is-used-to-configure-the-randomized-base-address-option-in-linker-for-vs2015-project/2016/1 "2020-10-17T02:41:27Z")

</div>

![QQ图片20201017102607](https://discourse.cmake.org/uploads/default/original/1X/cb748b10724db939d3ba573cbe4fb6ddc20668cd.png)

---

<div class="post-metadata">

**Author:** ![anon45792294](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/a/a587f6/32.png) [@anon45792294](https://discourse.cmake.org/u/anon45792294)\
**Post date:** [October 18, 2020, 3:07am UTC](https://discourse.cmake.org/t/what-cmake-method-is-used-to-configure-the-randomized-base-address-option-in-linker-for-vs2015-project/2016/2 "2020-10-18T03:07:45Z")

</div>

If you want to turn it on/off this should work:

```cmake
target_link_options(foo PRIVATE /DYNAMICBASE:NO)

# or

target_link_options(foo PRIVATE /DYNAMICBASE)

```

If you want to do this for all projects in your cmake project. Then do this before any target is defined, probably in your top level cmake files.

```cmake
add_link_options(/DYNAMICBASE:NO)

```

I think that answers your question. Out of curiosity why do you want to disable DYNAMICBASE?
