Merge pull request 'remove test project' (#404) from wowario/wownero:gitian into master

Reviewed-on: https://git.wownero.com/wownero/wownero/pulls/404
This commit is contained in:
wowario 2021-07-14 18:53:21 +00:00
commit ab30fb2ebe
1 changed files with 6 additions and 13 deletions

View File

@ -42,19 +42,12 @@
find_program(CCACHE_FOUND ccache) find_program(CCACHE_FOUND ccache)
if (CCACHE_FOUND) if (CCACHE_FOUND)
# Try to compile a test program with ccache, in order to verify if it really works. (needed on exotic setups) # Try to compile a test program with ccache, in order to verify if it really works. (needed on exotic setups)
set(TEST_PROJECT "${CMAKE_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/CMakeTmp") # Create a temporary file with a simple program.
file(WRITE "${TEST_PROJECT}/CMakeLists.txt" [=[ set(TEMP_CPP_FILE "${CMAKE_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/CMakeTmp/test-program.cpp")
cmake_minimum_required(VERSION 3.5) file(WRITE "${TEMP_CPP_FILE}" "int main() { return 0; }")
project(test) # And run the found ccache on it.
option (CCACHE "") execute_process(COMMAND "${CCACHE_FOUND}" "${CMAKE_CXX_COMPILER}" "${TEMP_CPP_FILE}" RESULT_VARIABLE RET)
file(WRITE "${CMAKE_SOURCE_DIR}/test.cpp" "int main() { return 0; }") if (${RET} EQUAL 0)
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE}")
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK "${CCACHE}")
add_executable(test test.cpp)
]=])
try_compile(RET "${TEST_PROJECT}/build" "${TEST_PROJECT}" "test" CMAKE_FLAGS -DCCACHE="${CCACHE_FOUND}")
unset(TEST_PROJECT)
if (${RET})
# Success # Success
message(STATUS "Found usable ccache: ${CCACHE_FOUND}") message(STATUS "Found usable ccache: ${CCACHE_FOUND}")
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_FOUND}") set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_FOUND}")