# Apply toolchain after SystemSpecific

**URL:** <https://discourse.cmake.org/t/apply-toolchain-after-systemspecific/9064>\
**Category:** Code\
**Created:** [September 23, 2023, 6:16pm UTC](https://discourse.cmake.org/t/apply-toolchain-after-systemspecific/9064 "2023-09-23T18:16:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kossnikita](https://discourse.cmake.org/user_avatar/discourse.cmake.org/kossnikita/32/3862_2.png) [@kossnikita](https://discourse.cmake.org/u/kossnikita)\
**Post date:** [September 23, 2023, 6:16pm UTC](https://discourse.cmake.org/t/apply-toolchain-after-systemspecific/9064/1 "2023-09-23T18:16:03Z")

</div>

I use toolchain for cc65 compiler:

```cmake
set(CMAKE_SYSTEM_NAME Generic)
set(CMAKE_SYSTEM_PROCESSOR 6502)
...
...
set(CMAKE_LINK_LIBRARY_FLAG "")

```

And use this like `cmake -DCMAKE_TOOLCHAIN_FILE=cc65.cmake -Bbuild`

In this case my CMAKE\_LINK\_LIBRARY\_FLAG is “-l” because is was set in “Modules/CMakeGenericSystem.cmake” after my toolchain.

Is there some way to apply the toolchain AFTER the system one?

---

<div class="post-metadata">

**Author:** ![fdk17](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/f/ea666f/32.png) [@fdk17](https://discourse.cmake.org/u/fdk17)\
**Post date:** [September 27, 2023, 12:06am UTC](https://discourse.cmake.org/t/apply-toolchain-after-systemspecific/9064/2 "2023-09-27T00:06:07Z")

</div>

There have been similar questions about toolchain files. The developers have said that kind of setting doesn’t belong in the toolchain file. You can override the compiler and platform settings using `CMAKE_USER_MAKE_RULES_OVERRIDE`.

Refer to:  
[https://gitlab.kitware.com/cmake/cmake/merge\_requests/1941#note\_398139](https://gitlab.kitware.com/cmake/cmake/merge_requests/1941#note_398139)  
[https://gitlab.kitware.com/cmake/cmake/issues/17880#note\_397841](https://gitlab.kitware.com/cmake/cmake/issues/17880#note_397841)
