Don't Cache GCC Version

This commit is contained in:
TheBrokenRail 2021-09-14 19:29:48 -04:00
parent 1f3036c7e1
commit 866ebfe159
2 changed files with 9 additions and 12 deletions

View File

@ -1,18 +1,15 @@
# Pick GCC Version # Pick GCC Version
macro(pick_gcc_version gcc_root gcc_version) macro(pick_gcc_version gcc_root gcc_version)
if(NOT DEFINED "${gcc_version}")
file(GLOB children RELATIVE "${gcc_root}" "${gcc_root}/*") file(GLOB children RELATIVE "${gcc_root}" "${gcc_root}/*")
set("${gcc_version}" "" CACHE STRING "" FORCE) set("${gcc_version}" "")
foreach(child IN LISTS children) foreach(child IN LISTS children)
if(IS_DIRECTORY "${gcc_root}/${child}" AND ("${${gcc_version}}" STREQUAL "" OR "${child}" GREATER_EQUAL "${${gcc_version}}")) if(IS_DIRECTORY "${gcc_root}/${child}" AND ("${${gcc_version}}" STREQUAL "" OR "${child}" GREATER_EQUAL "${${gcc_version}}"))
set("${gcc_version}" "${child}" "" CACHE STRING "" FORCE) set("${gcc_version}" "${child}")
endif() endif()
endforeach() endforeach()
if("${${gcc_version}}" STREQUAL "") if("${${gcc_version}}" STREQUAL "")
message(FATAL_ERROR "Unable To Pick GCC Version") message(FATAL_ERROR "Unable To Pick GCC Version")
endif() endif()
message(STATUS "Using GCC Version: ${${gcc_version}}")
endif()
endmacro() endmacro()
# Setup Toolchain # Setup Toolchain

View File

@ -11,7 +11,7 @@ add_compile_options(-w)
set(SKIP_INSTALL_ALL TRUE) # Skip Default LibPNG Installation set(SKIP_INSTALL_ALL TRUE) # Skip Default LibPNG Installation
FetchContent_Declare( FetchContent_Declare(
libpng libpng
GIT_REPOSITORY "https://git.code.sf.net/p/libpng/code" GIT_REPOSITORY "https://github.com/glennrp/libpng.git"
GIT_TAG "v1.2.59" GIT_TAG "v1.2.59"
) )
FetchContent_Populate(libpng) FetchContent_Populate(libpng)