cmake update

This commit is contained in:
Markus F.X.J. Oberhumer 2024-05-24 09:17:37 +02:00
parent 6ee45dcdcd
commit 43f9b90c92
3 changed files with 24 additions and 18 deletions

33
.gitignore vendored
View File

@ -1,5 +1,9 @@
/.cache*
/.hg* /.hg*
/.vscode* /.vscode*
/CMakeCache*
/CMakeFiles*
/CTest*
/Makevars[.-]global* /Makevars[.-]global*
/Testing* /Testing*
/build* /build*
@ -9,6 +13,7 @@
GNUmakefile* GNUmakefile*
MMakefile* MMakefile*
Makevars[.-]local* Makevars[.-]local*
compile_commands*.json
compile_flags*.txt compile_flags*.txt
Tmp* Tmp*
tmp* tmp*
@ -37,19 +42,19 @@ tmp*
*.zip *.zip
*.zst *.zst
doc/*.man /doc/*.man
doc/*.ps /doc/*.ps
doc/*.tex /doc/*.tex
src/stub/**/.*-stamp /src/stub/**/.*-stamp
src/stub/tmp*/*.bin /src/stub/src/**/tmp*/*
src/stub/tmp*/*.bin.bindump /src/stub/tmp*/*.bin
src/stub/tmp*/*.bin.disasm /src/stub/tmp*/*.bin.bindump
src/stub/tmp*/*.o.disasm /src/stub/tmp*/*.bin.disasm
src/stub/tmp*/mips.r3000-*.[is] /src/stub/tmp*/*.o.disasm
src/stub/tmp*/mipsel.r3000-*.[is] /src/stub/tmp*/mips.r3000-*.[is]
src/stub/src/**/tmp*/* /src/stub/tmp*/mipsel.r3000-*.[is]
src/stub/tools/sstrip/amd64-linux-sstrip /src/stub/tools/sstrip/amd64-linux-sstrip
src/stub/tools/sstrip/i386-linux-sstrip /src/stub/tools/sstrip/i386-linux-sstrip
src/stub/tools/sstrip/sstrip /src/stub/tools/sstrip/sstrip

View File

@ -65,9 +65,7 @@ upx_cmake_include_hook(2_init)
# Disallow in-source build. Note that you will still have to manually # Disallow in-source build. Note that you will still have to manually
# clean up a few files if you accidentally try an in-source build. # clean up a few files if you accidentally try an in-source build.
if(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/.git") upx_disallow_in_source_build()
upx_disallow_in_source_build()
endif()
# global settings # global settings
if(${CMAKE_VERSION} VERSION_GREATER "3.14.99" AND NOT DEFINED CMAKE_MSVC_RUNTIME_LIBRARY) if(${CMAKE_VERSION} VERSION_GREATER "3.14.99" AND NOT DEFINED CMAKE_MSVC_RUNTIME_LIBRARY)
@ -433,6 +431,8 @@ upx_cmake_include_hook(6_test)
if(NOT UPX_CONFIG_CMAKE_DISABLE_TEST) if(NOT UPX_CONFIG_CMAKE_DISABLE_TEST)
add_custom_command(TARGET upx POST_BUILD COMMAND "${CMAKE_COMMAND}" -E make_directory "${CMAKE_CURRENT_BINARY_DIR}/XTesting/$<CONFIG>")
include(CTest) include(CTest)
if(NOT CMAKE_CROSSCOMPILING OR CMAKE_CROSSCOMPILING_EMULATOR) if(NOT CMAKE_CROSSCOMPILING OR CMAKE_CROSSCOMPILING_EMULATOR)
upx_add_test(upx-version upx --version) upx_add_test(upx-version upx --version)

View File

@ -365,7 +365,8 @@ endfunction()
function(upx_add_test) # ARGV function(upx_add_test) # ARGV
set(name "${ARGV0}") set(name "${ARGV0}")
list(REMOVE_AT ARGV 0) list(REMOVE_AT ARGV 0)
add_test(NAME "${name}" COMMAND ${ARGV}) set(wd "${CMAKE_CURRENT_BINARY_DIR}/XTesting/$<CONFIG>")
add_test(NAME "${name}" WORKING_DIRECTORY "${wd}" COMMAND ${ARGV})
endfunction() endfunction()
function(upx_test_depends) # ARGV function(upx_test_depends) # ARGV