Prevent full rebuild each time CMake detects any changes

master
Ansariel 2025-10-20 11:27:00 +02:00
parent 31b81b2c05
commit 77746a648f
1 changed files with 6 additions and 3 deletions

View File

@ -34,6 +34,9 @@ target_include_directories(ll::apr SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include
# <FS:Ansariel> Hotfix incorrect check in APR header
file(READ ${LIBS_PREBUILT_DIR}/include/apr-1/apr.h APR_HEADER_CONTENTS)
string(REPLACE "#if !(defined(__attribute__) || defined(__has_attribute))" "#if !defined(__attribute__)" APR_HEADER_CONTENTS "${APR_HEADER_CONTENTS}")
file(WRITE ${LIBS_PREBUILT_DIR}/include/apr-1/apr.h "${APR_HEADER_CONTENTS}")
# </FS:Ansariel>
string(FIND "${APR_HEADER_CONTENTS}" "#if !(defined(__attribute__) || defined(__has_attribute))" ATTRIBUTE_TYPEDEF_POS)
if (${ATTRIBUTE_TYPEDEF_POS} GREATER -1)
string(REPLACE "#if !(defined(__attribute__) || defined(__has_attribute))" "#if !defined(__attribute__)" APR_HEADER_CONTENTS "${APR_HEADER_CONTENTS}")
file(WRITE ${LIBS_PREBUILT_DIR}/include/apr-1/apr.h "${APR_HEADER_CONTENTS}")
endif()
# </FS:Ansariel>