Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMartin Hořeňovský2020-05-06 21:23:10 +0200
committerMartin Hořeňovský2020-05-06 21:23:13 +0200
commite78b4f6be78912bdc812dba0fbf2166841ffb7be (patch)
treed1a82d80ac44d342c625ed3f5f1538bfa4590068
parent9766a7b200f5ca1fd2046178cc4e136712fdc6d7 (diff)
downloadcatch3-e78b4f6be78912bdc812dba0fbf2166841ffb7be.tar.gz
Remove file list checking from CMake
I do not think we need a safeguard against not including files in CMake anymore, and as it is, it caused annoying false positive about the default main implementation.
-rw-r--r--CMake/MiscFunctions.cmake27
-rw-r--r--src/CMakeLists.txt2
-rw-r--r--tests/CMakeLists.txt1
3 files changed, 0 insertions, 30 deletions
diff --git a/CMake/MiscFunctions.cmake b/CMake/MiscFunctions.cmake
index 0e95517a..0f6a9c2a 100644
--- a/CMake/MiscFunctions.cmake
+++ b/CMake/MiscFunctions.cmake
@@ -1,30 +1,3 @@
-#checks that the given hard-coded list contains all headers + sources in the given folder
-function(CheckFileList LIST_VAR FOLDER)
- set(MESSAGE " should be added to the variable ${LIST_VAR}")
- set(MESSAGE "${MESSAGE} in ${CMAKE_CURRENT_LIST_FILE}\n")
- file(GLOB GLOBBED_LIST "${FOLDER}/*.cpp"
- "${FOLDER}/*.hpp"
- "${FOLDER}/*.h")
- list(REMOVE_ITEM GLOBBED_LIST ${${LIST_VAR}})
- foreach(EXTRA_ITEM ${GLOBBED_LIST})
- string(REPLACE "${CATCH_DIR}/" "" RELATIVE_FILE_NAME "${EXTRA_ITEM}")
- message(AUTHOR_WARNING "The file \"${RELATIVE_FILE_NAME}\"${MESSAGE}")
- endforeach()
-endfunction()
-
-function(CheckFileListRec LIST_VAR FOLDER)
- set(MESSAGE " should be added to the variable ${LIST_VAR}")
- set(MESSAGE "${MESSAGE} in ${CMAKE_CURRENT_LIST_FILE}\n")
- file(GLOB_RECURSE GLOBBED_LIST "${FOLDER}/*.cpp"
- "${FOLDER}/*.hpp"
- "${FOLDER}/*.h")
- list(REMOVE_ITEM GLOBBED_LIST ${${LIST_VAR}})
- foreach(EXTRA_ITEM ${GLOBBED_LIST})
- string(REPLACE "${CATCH_DIR}/" "" RELATIVE_FILE_NAME "${EXTRA_ITEM}")
- message(AUTHOR_WARNING "The file \"${RELATIVE_FILE_NAME}\"${MESSAGE}")
- endforeach()
-endfunction()
-
include(CheckCXXCompilerFlag)
function(add_cxx_flag_if_supported_to_targets flagname targets)
check_cxx_compiler_flag("${flagname}" HAVE_FLAG_${flagname})
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 443f62b5..c5ac14d1 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -199,7 +199,6 @@ set(IMPL_SOURCES
${SOURCES_DIR}/internal/catch_xmlwriter.cpp
)
set(INTERNAL_FILES ${IMPL_SOURCES} ${INTERNAL_HEADERS})
-CheckFileList(INTERNAL_FILES ${SOURCES_DIR}/internal)
# Please keep these ordered alphabetically
set(REPORTER_HEADERS
@@ -228,7 +227,6 @@ set(REPORTER_SOURCES
${SOURCES_DIR}/reporters/catch_reporter_xml.cpp
)
set(REPORTER_FILES ${REPORTER_HEADERS} ${REPORTER_SOURCES})
-CheckFileList(REPORTER_FILES ${SOURCES_DIR}/reporters)
# Fixme: STATIC because for dynamic, we would need to handle visibility
# and I don't want to do the annotations right now
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 3af01c62..f38ca4b9 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -53,7 +53,6 @@ set(TEST_SOURCES
${SELF_TEST_DIR}/UsageTests/MatchersRanges.tests.cpp
${SELF_TEST_DIR}/UsageTests/Matchers.tests.cpp
)
-CheckFileList(TEST_SOURCES ${SELF_TEST_DIR})
# Specify the headers, too, so CLion recognises them as project files