this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Stop CMake from rebuilding SDL_gpu even though there were no changes to the code.

+9 -3
+9 -3
CMakeLists.txt
··· 25 25 26 26 set(SDL_GPU_VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_BUGFIX}") 27 27 28 - message("Writing version header for v${SDL_GPU_VERSION}") 29 - string(CONCAT VERSION_HEADER_CONTENTS "#ifndef _SDL_GPU_VERSION_H__ 28 + if(${CMAKE_CURRENT_SOURCE_DIR}/version.txt IS_NEWER_THAN ${CMAKE_CURRENT_SOURCE_DIR}/include/SDL_gpu_version.h) 29 + # This is to prevent CMake from rebuilding SDL_gpu, which is important when it is an external project in another project. 30 + # This works since whenever version.txt is changed, it will be newer than SDL_gpu_version.h. The only time SDL_gpu_version.h 31 + # will be newer than version.txt is when it is created or modified after the latter file. 32 + message("Writing version header for v${SDL_GPU_VERSION}") 33 + string(CONCAT VERSION_HEADER_CONTENTS "#ifndef _SDL_GPU_VERSION_H__ 30 34 #define _SDL_GPU_VERSION_H__ 31 35 32 36 #define SDL_GPU_VERSION_MAJOR ${VERSION_MAJOR} ··· 34 38 #define SDL_GPU_VERSION_PATCH ${VERSION_BUGFIX} 35 39 36 40 #endif") 37 - file(WRITE ${CMAKE_CURRENT_SOURCE_DIR}/include/SDL_gpu_version.h ${VERSION_HEADER_CONTENTS}) 41 + 42 + file(WRITE ${CMAKE_CURRENT_SOURCE_DIR}/include/SDL_gpu_version.h ${VERSION_HEADER_CONTENTS}) 43 + endif() 38 44 39 45 set(DEFAULT_INSTALL_LIBRARY ON) 40 46 set(DEFAULT_BUILD_SHARED ON)