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,17 +1,14 @@
# Pick GCC Version
macro(pick_gcc_version gcc_root gcc_version)
if(NOT DEFINED "${gcc_version}")
file(GLOB children RELATIVE "${gcc_root}" "${gcc_root}/*")
set("${gcc_version}" "" CACHE STRING "" FORCE)
foreach(child IN LISTS children)
if(IS_DIRECTORY "${gcc_root}/${child}" AND ("${${gcc_version}}" STREQUAL "" OR "${child}" GREATER_EQUAL "${${gcc_version}}"))
set("${gcc_version}" "${child}" "" CACHE STRING "" FORCE)
endif()
endforeach()
if("${${gcc_version}}" STREQUAL "")
message(FATAL_ERROR "Unable To Pick GCC Version")
file(GLOB children RELATIVE "${gcc_root}" "${gcc_root}/*")
set("${gcc_version}" "")
foreach(child IN LISTS children)
if(IS_DIRECTORY "${gcc_root}/${child}" AND ("${${gcc_version}}" STREQUAL "" OR "${child}" GREATER_EQUAL "${${gcc_version}}"))
set("${gcc_version}" "${child}")
endif()
message(STATUS "Using GCC Version: ${${gcc_version}}")
endforeach()
if("${${gcc_version}}" STREQUAL "")
message(FATAL_ERROR "Unable To Pick GCC Version")
endif()
endmacro()

View File

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