[cmake] Only build for targets newer than TARGET

Build only for targets newer than TARGET when DYNAMIC_ARCH is enabled and a TARGET is selected.
I don't know how to implement this for Makefiles
This commit is contained in:
Mehdi Chinoune 2021-10-18 16:43:05 +01:00
parent 22bf5c27ba
commit 85f3f64b49
1 changed files with 4 additions and 0 deletions

View File

@ -82,6 +82,10 @@ if (DYNAMIC_ARCH)
set(DYNAMIC_CORE ${DYNAMIC_CORE} SKYLAKEX COOPERLAKE)
string(REGEX REPLACE "-march=native" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
endif ()
if(TARGET)
list(FIND DYNAMIC_CORE ${TARGET} TARGET_INDEX)
list(SUBLIST DYNAMIC_CORE ${TARGET_INDEX} -1 DYNAMIC_CORE)
endif()
if (DYNAMIC_LIST)
set(DYNAMIC_CORE PRESCOTT ${DYNAMIC_LIST})
endif ()