mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-04 04:40:56 -06:00
Some tests fail because Xcode runs `POST_BUILD` commands before signing the binaries they run. Tell the linker to perform ad-hoc codesign even though Xcode normally tells it not to. Other tests fail because `install_name_tool` does not revise ad-hoc signatures without the codesign `linker-signed` flag. Add that flag ourselves where needed by our tests. For now these changes help our test suite pass so we can use it to cover everything else. Both of these cases may need further investigation to update CMake to help projects in general. Issue: #21845, #21854
25 lines
734 B
CMake
25 lines
734 B
CMake
enable_language(CXX)
|
|
include(GoogleTest)
|
|
|
|
enable_testing()
|
|
|
|
include(xcode_sign_adhoc.cmake)
|
|
|
|
# This creates the folder structure for the paramterized tests
|
|
# to avoid handling missing folders in C++
|
|
#
|
|
# This must match the match the name defined in xml_output.cpp
|
|
# for every instance of tests with GetParam.
|
|
#
|
|
# The folder name is created fom the test name (output of the line
|
|
# without leading spaces: "GoogleTestXMLSpecial/cases.") and
|
|
# the parts until the last slash ("case/"). These parts are concatenated.
|
|
file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/GoogleTestXMLSpecial/cases.case")
|
|
|
|
add_executable(xml_output xml_output.cpp)
|
|
xcode_sign_adhoc(xml_output)
|
|
gtest_discover_tests(
|
|
xml_output
|
|
XML_OUTPUT_DIR ${CMAKE_BINARY_DIR}
|
|
)
|