From 866ebfe159e662260116547bbc63a8297ae23a03 Mon Sep 17 00:00:00 2001 From: TheBrokenRail Date: Tue, 14 Sep 2021 19:29:48 -0400 Subject: [PATCH] Don't Cache GCC Version --- cmake/base-toolchain.cmake | 19 ++++++++----------- dependencies/libpng/CMakeLists.txt | 2 +- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/cmake/base-toolchain.cmake b/cmake/base-toolchain.cmake index 29f520adb..4a949d05b 100644 --- a/cmake/base-toolchain.cmake +++ b/cmake/base-toolchain.cmake @@ -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() diff --git a/dependencies/libpng/CMakeLists.txt b/dependencies/libpng/CMakeLists.txt index 39238e38c..b6560a0dd 100644 --- a/dependencies/libpng/CMakeLists.txt +++ b/dependencies/libpng/CMakeLists.txt @@ -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)