parent
7bb999a805
commit
1cb5cdbfe9
@ -0,0 +1,56 @@
|
|||||||
|
CMAKE_LANG=C
|
||||||
|
CMAKE_LINKER=/opt/llvm-13/bin/ld.lld
|
||||||
|
CMAKE_C_COMPILER_ABI=ELF
|
||||||
|
CMAKE_C_COMPILER_AR=/opt/llvm-13/bin/llvm-ar
|
||||||
|
CMAKE_C_COMPILER_ARCHITECTURE_ID=
|
||||||
|
CMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN=
|
||||||
|
CMAKE_C_COMPILER_ID=Clang
|
||||||
|
CMAKE_C_COMPILER_LAUNCHER=
|
||||||
|
CMAKE_C_COMPILER_LOADED=1
|
||||||
|
CMAKE_C_COMPILER_RANLIB=/opt/llvm-13/bin/llvm-ranlib
|
||||||
|
CMAKE_C_COMPILER_TARGET=
|
||||||
|
CMAKE_C_COMPILER_VERSION=13.0.0
|
||||||
|
CMAKE_C_COMPILER_VERSION_INTERAL=
|
||||||
|
Change Dir: /tmp/cmake/Tests/RunCMake/ParseImplicitData/build/CMakeFiles/CMakeTmp
|
||||||
|
|
||||||
|
Run Build Command(s):/usr/bin/make -f Makefile cmTC_91833/fast && /usr/bin/make -f CMakeFiles/cmTC_91833.dir/build.make CMakeFiles/cmTC_91833.dir/build
|
||||||
|
make[1]: Entering directory '/tmp/cmake/Tests/RunCMake/ParseImplicitData/build/CMakeFiles/CMakeTmp'
|
||||||
|
Building C object CMakeFiles/cmTC_91833.dir/CMakeCCompilerABI.c.o
|
||||||
|
/opt/llvm-13/bin/clang -v -MD -MT CMakeFiles/cmTC_91833.dir/CMakeCCompilerABI.c.o -MF CMakeFiles/cmTC_91833.dir/CMakeCCompilerABI.c.o.d -o CMakeFiles/cmTC_91833.dir/CMakeCCompilerABI.c.o -c /opt/cmake-3.21.3/share/cmake-3.21/Modules/CMakeCCompilerABI.c
|
||||||
|
clang version 13.0.0
|
||||||
|
Target: x86_64-pc-linux-gnu
|
||||||
|
Thread model: posix
|
||||||
|
InstalledDir: /opt/llvm-13/bin
|
||||||
|
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/9
|
||||||
|
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/9
|
||||||
|
Candidate multilib: .@m64
|
||||||
|
Candidate multilib: 32@m32
|
||||||
|
Candidate multilib: x32@mx32
|
||||||
|
Selected multilib: .@m64
|
||||||
|
(in-process)
|
||||||
|
"/opt/llvm-13/bin/clang-13" -cc1 -triple x86_64-pc-linux-gnu -emit-obj -mrelax-all --mrelax-relocations -disable-free -main-file-name CMakeCCompilerABI.c -mrelocation-model static -mframe-pointer=all -fmath-errno -fno-rounding-math -mconstructor-aliases -munwind-tables -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -v -fcoverage-compilation-dir=/tmp/cmake/Tests/RunCMake/ParseImplicitData/build/CMakeFiles/CMakeTmp -resource-dir /opt/llvm-13/lib/clang/13.0.0 -dependency-file CMakeFiles/cmTC_91833.dir/CMakeCCompilerABI.c.o.d -MT CMakeFiles/cmTC_91833.dir/CMakeCCompilerABI.c.o -sys-header-deps -internal-isystem /opt/llvm-13/lib/clang/13.0.0/include -internal-isystem /usr/local/include -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/9/../../../../x86_64-linux-gnu/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -fdebug-compilation-dir=/tmp/cmake/Tests/RunCMake/ParseImplicitData/build/CMakeFiles/CMakeTmp -ferror-limit 19 -fgnuc-version=4.2.1 -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o CMakeFiles/cmTC_91833.dir/CMakeCCompilerABI.c.o -x c /opt/cmake-3.21.3/share/cmake-3.21/Modules/CMakeCCompilerABI.c
|
||||||
|
clang -cc1 version 13.0.0 based upon LLVM 13.0.0 default target x86_64-pc-linux-gnu
|
||||||
|
ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/9/../../../../x86_64-linux-gnu/include"
|
||||||
|
ignoring nonexistent directory "/include"
|
||||||
|
#include "..." search starts here:
|
||||||
|
#include <...> search starts here:
|
||||||
|
/opt/llvm-13/lib/clang/13.0.0/include
|
||||||
|
/usr/local/include
|
||||||
|
/usr/include/x86_64-linux-gnu
|
||||||
|
/usr/include
|
||||||
|
End of search list.
|
||||||
|
Linking C executable cmTC_91833
|
||||||
|
/opt/cmake-3.21.3/bin/cmake -E cmake_link_script CMakeFiles/cmTC_91833.dir/link.txt --verbose=1
|
||||||
|
/opt/llvm-13/bin/clang -v -rdynamic CMakeFiles/cmTC_91833.dir/CMakeCCompilerABI.c.o -o cmTC_91833
|
||||||
|
clang version 13.0.0
|
||||||
|
Target: x86_64-pc-linux-gnu
|
||||||
|
Thread model: posix
|
||||||
|
InstalledDir: /opt/llvm-13/bin
|
||||||
|
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/9
|
||||||
|
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/9
|
||||||
|
Candidate multilib: .@m64
|
||||||
|
Candidate multilib: 32@m32
|
||||||
|
Candidate multilib: x32@mx32
|
||||||
|
Selected multilib: .@m64
|
||||||
|
"/opt/llvm-13/bin/ld.lld" -export-dynamic -z relro --hash-style=gnu --build-id --eh-frame-hdr -m elf_x86_64 -export-dynamic -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o cmTC_91833 /lib/x86_64-linux-gnu/crt1.o /lib/x86_64-linux-gnu/crti.o /opt/llvm-13/lib/clang/13.0.0/lib/x86_64-pc-linux-gnu/clang_rt.crtbegin.o -L/opt/llvm-13/bin/../lib/x86_64-pc-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/9 -L/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib64 -L/lib/x86_64-linux-gnu -L/lib/../lib64 -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib64 -L/opt/llvm-13/bin/../lib -L/lib -L/usr/lib CMakeFiles/cmTC_91833.dir/CMakeCCompilerABI.c.o /opt/llvm-13/lib/clang/13.0.0/lib/x86_64-pc-linux-gnu/libclang_rt.builtins.a --as-needed -l:libunwind.so --no-as-needed -lc /opt/llvm-13/lib/clang/13.0.0/lib/x86_64-pc-linux-gnu/libclang_rt.builtins.a --as-needed -l:libunwind.so --no-as-needed /opt/llvm-13/lib/clang/13.0.0/lib/x86_64-pc-linux-gnu/clang_rt.crtend.o /lib/x86_64-linux-gnu/crtn.o
|
||||||
|
make[1]: Leaving directory '/tmp/cmake/Tests/RunCMake/ParseImplicitData/build/CMakeFiles/CMakeTmp'
|
@ -0,0 +1,58 @@
|
|||||||
|
CMAKE_LANG=CXX
|
||||||
|
CMAKE_LINKER=/opt/llvm-13/bin/ld.lld
|
||||||
|
CMAKE_CXX_COMPILER_ABI=ELF
|
||||||
|
CMAKE_CXX_COMPILER_AR=/opt/llvm-13/bin/llvm-ar
|
||||||
|
CMAKE_CXX_COMPILER_ARCHITECTURE_ID=
|
||||||
|
CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN=
|
||||||
|
CMAKE_CXX_COMPILER_ID=Clang
|
||||||
|
CMAKE_CXX_COMPILER_LAUNCHER=
|
||||||
|
CMAKE_CXX_COMPILER_LOADED=1
|
||||||
|
CMAKE_CXX_COMPILER_RANLIB=/opt/llvm-13/bin/llvm-ranlib
|
||||||
|
CMAKE_CXX_COMPILER_TARGET=
|
||||||
|
CMAKE_CXX_COMPILER_VERSION=13.0.0
|
||||||
|
CMAKE_CXX_COMPILER_VERSION_INTERAL=
|
||||||
|
Change Dir: /tmp/cmake/Tests/RunCMake/ParseImplicitData/build/CMakeFiles/CMakeTmp
|
||||||
|
|
||||||
|
Run Build Command(s):/usr/bin/make -f Makefile cmTC_5372b/fast && /usr/bin/make -f CMakeFiles/cmTC_5372b.dir/build.make CMakeFiles/cmTC_5372b.dir/build
|
||||||
|
make[1]: Entering directory '/tmp/cmake/Tests/RunCMake/ParseImplicitData/build/CMakeFiles/CMakeTmp'
|
||||||
|
Building CXX object CMakeFiles/cmTC_5372b.dir/CMakeCXXCompilerABI.cpp.o
|
||||||
|
/opt/llvm-13/bin/clang++ -v -MD -MT CMakeFiles/cmTC_5372b.dir/CMakeCXXCompilerABI.cpp.o -MF CMakeFiles/cmTC_5372b.dir/CMakeCXXCompilerABI.cpp.o.d -o CMakeFiles/cmTC_5372b.dir/CMakeCXXCompilerABI.cpp.o -c /opt/cmake-3.21.3/share/cmake-3.21/Modules/CMakeCXXCompilerABI.cpp
|
||||||
|
clang version 13.0.0
|
||||||
|
Target: x86_64-pc-linux-gnu
|
||||||
|
Thread model: posix
|
||||||
|
InstalledDir: /opt/llvm-13/bin
|
||||||
|
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/9
|
||||||
|
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/9
|
||||||
|
Candidate multilib: .@m64
|
||||||
|
Candidate multilib: 32@m32
|
||||||
|
Candidate multilib: x32@mx32
|
||||||
|
Selected multilib: .@m64
|
||||||
|
(in-process)
|
||||||
|
"/opt/llvm-13/bin/clang-13" -cc1 -triple x86_64-pc-linux-gnu -emit-obj -mrelax-all --mrelax-relocations -disable-free -main-file-name CMakeCXXCompilerABI.cpp -mrelocation-model static -mframe-pointer=all -fmath-errno -fno-rounding-math -mconstructor-aliases -munwind-tables -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -v -fcoverage-compilation-dir=/tmp/cmake/Tests/RunCMake/ParseImplicitData/build/CMakeFiles/CMakeTmp -resource-dir /opt/llvm-13/lib/clang/13.0.0 -dependency-file CMakeFiles/cmTC_5372b.dir/CMakeCXXCompilerABI.cpp.o.d -MT CMakeFiles/cmTC_5372b.dir/CMakeCXXCompilerABI.cpp.o -sys-header-deps -internal-isystem /opt/llvm-13/bin/../include/x86_64-pc-linux-gnu/c++/v1 -internal-isystem /opt/llvm-13/bin/../include/c++/v1 -internal-isystem /opt/llvm-13/lib/clang/13.0.0/include -internal-isystem /usr/local/include -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/9/../../../../x86_64-linux-gnu/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -fdeprecated-macro -fdebug-compilation-dir=/tmp/cmake/Tests/RunCMake/ParseImplicitData/build/CMakeFiles/CMakeTmp -ferror-limit 19 -fgnuc-version=4.2.1 -fcxx-exceptions -fexceptions -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o CMakeFiles/cmTC_5372b.dir/CMakeCXXCompilerABI.cpp.o -x c++ /opt/cmake-3.21.3/share/cmake-3.21/Modules/CMakeCXXCompilerABI.cpp
|
||||||
|
clang -cc1 version 13.0.0 based upon LLVM 13.0.0 default target x86_64-pc-linux-gnu
|
||||||
|
ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/9/../../../../x86_64-linux-gnu/include"
|
||||||
|
ignoring nonexistent directory "/include"
|
||||||
|
#include "..." search starts here:
|
||||||
|
#include <...> search starts here:
|
||||||
|
/opt/llvm-13/bin/../include/x86_64-pc-linux-gnu/c++/v1
|
||||||
|
/opt/llvm-13/bin/../include/c++/v1
|
||||||
|
/opt/llvm-13/lib/clang/13.0.0/include
|
||||||
|
/usr/local/include
|
||||||
|
/usr/include/x86_64-linux-gnu
|
||||||
|
/usr/include
|
||||||
|
End of search list.
|
||||||
|
Linking CXX executable cmTC_5372b
|
||||||
|
/opt/cmake-3.21.3/bin/cmake -E cmake_link_script CMakeFiles/cmTC_5372b.dir/link.txt --verbose=1
|
||||||
|
/opt/llvm-13/bin/clang++ -v -rdynamic CMakeFiles/cmTC_5372b.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_5372b
|
||||||
|
clang version 13.0.0
|
||||||
|
Target: x86_64-pc-linux-gnu
|
||||||
|
Thread model: posix
|
||||||
|
InstalledDir: /opt/llvm-13/bin
|
||||||
|
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/9
|
||||||
|
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/9
|
||||||
|
Candidate multilib: .@m64
|
||||||
|
Candidate multilib: 32@m32
|
||||||
|
Candidate multilib: x32@mx32
|
||||||
|
Selected multilib: .@m64
|
||||||
|
"/opt/llvm-13/bin/ld.lld" -export-dynamic -z relro --hash-style=gnu --build-id --eh-frame-hdr -m elf_x86_64 -export-dynamic -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o cmTC_5372b /lib/x86_64-linux-gnu/crt1.o /lib/x86_64-linux-gnu/crti.o /opt/llvm-13/lib/clang/13.0.0/lib/x86_64-pc-linux-gnu/clang_rt.crtbegin.o -L/opt/llvm-13/bin/../lib/x86_64-pc-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/9 -L/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib64 -L/lib/x86_64-linux-gnu -L/lib/../lib64 -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib64 -L/opt/llvm-13/bin/../lib -L/lib -L/usr/lib CMakeFiles/cmTC_5372b.dir/CMakeCXXCompilerABI.cpp.o -lc++ -lm /opt/llvm-13/lib/clang/13.0.0/lib/x86_64-pc-linux-gnu/libclang_rt.builtins.a -l:libunwind.so -lc /opt/llvm-13/lib/clang/13.0.0/lib/x86_64-pc-linux-gnu/libclang_rt.builtins.a -l:libunwind.so /opt/llvm-13/lib/clang/13.0.0/lib/x86_64-pc-linux-gnu/clang_rt.crtend.o /lib/x86_64-linux-gnu/crtn.o
|
||||||
|
make[1]: Leaving directory '/tmp/cmake/Tests/RunCMake/ParseImplicitData/build/CMakeFiles/CMakeTmp'
|
@ -0,0 +1 @@
|
|||||||
|
/opt/llvm-13/lib/clang/13.0.0/include;/usr/local/include;/usr/include/x86_64-linux-gnu;/usr/include
|
@ -0,0 +1 @@
|
|||||||
|
/opt/llvm-13/include/x86_64-pc-linux-gnu/c\+\+/v1;/opt/llvm-13/include/c\+\+/v1;/opt/llvm-13/lib/clang/13.0.0/include;/usr/local/include;/usr/include/x86_64-linux-gnu;/usr/include
|
@ -0,0 +1,3 @@
|
|||||||
|
libs=-l:libunwind.so;c;-l:libunwind.so
|
||||||
|
dirs=/opt/llvm-13/lib/x86_64-pc-linux-gnu;/usr/lib/gcc/x86_64-linux-gnu/9;/usr/lib64;/lib/x86_64-linux-gnu;/lib64;/usr/lib/x86_64-linux-gnu;/opt/llvm-13/lib;/lib;/usr/lib
|
||||||
|
library_arch=x86_64-linux-gnu
|
@ -0,0 +1,3 @@
|
|||||||
|
libs=c\+\+;m;-l:libunwind.so;c;-l:libunwind.so
|
||||||
|
dirs=/opt/llvm-13/lib/x86_64-pc-linux-gnu;/usr/lib/gcc/x86_64-linux-gnu/9;/usr/lib64;/lib/x86_64-linux-gnu;/lib64;/usr/lib/x86_64-linux-gnu;/opt/llvm-13/lib;/lib;/usr/lib
|
||||||
|
library_arch=x86_64-linux-gnu
|
@ -0,0 +1 @@
|
|||||||
|
1
|
@ -0,0 +1,12 @@
|
|||||||
|
^CMake Error at [^
|
||||||
|
]*/Tests/RunCMake/file-RPATH/TextChange.cmake:[0-9]+ \(file\):
|
||||||
|
file RPATH_CHANGE could not write new RPATH:
|
||||||
|
|
||||||
|
/new/rpath
|
||||||
|
|
||||||
|
to the file:
|
||||||
|
|
||||||
|
[^
|
||||||
|
]*/Tests/RunCMake/file-RPATH/TextChange-build/not_a_binary.txt
|
||||||
|
|
||||||
|
The file format is not recognized\.$
|
@ -0,0 +1,3 @@
|
|||||||
|
set(f "${CMAKE_CURRENT_BINARY_DIR}/not_a_binary.txt")
|
||||||
|
file(WRITE "${f}" "Not a binary.\n")
|
||||||
|
file(RPATH_CHANGE FILE "${f}" OLD_RPATH "/old/rpath" NEW_RPATH "/new/rpath")
|
@ -0,0 +1,3 @@
|
|||||||
|
set(f "${CMAKE_CURRENT_BINARY_DIR}/not_a_binary.txt")
|
||||||
|
file(WRITE "${f}" "Not a binary.\n")
|
||||||
|
file(RPATH_CHANGE FILE "${f}" OLD_RPATH "/old/rpath" NEW_RPATH "")
|
@ -0,0 +1,6 @@
|
|||||||
|
set(f "${CMAKE_CURRENT_BINARY_DIR}/not_a_binary.txt")
|
||||||
|
file(WRITE "${f}" "Not a binary.\n")
|
||||||
|
file(RPATH_CHECK FILE "${f}" RPATH "/some/rpath")
|
||||||
|
if(EXISTS "${f}")
|
||||||
|
message(FATAL_ERROR "RPATH_CHECK did not remove\n ${f}\nfor non-empty RPATH")
|
||||||
|
endif()
|
@ -0,0 +1,6 @@
|
|||||||
|
set(f "${CMAKE_CURRENT_BINARY_DIR}/not_a_binary.txt")
|
||||||
|
file(WRITE "${f}" "Not a binary.\n")
|
||||||
|
file(RPATH_CHECK FILE "${f}" RPATH "")
|
||||||
|
if(NOT EXISTS "${f}")
|
||||||
|
message(FATAL_ERROR "RPATH_CHECK removed\n ${f}\nfor empty RPATH")
|
||||||
|
endif()
|
@ -0,0 +1,3 @@
|
|||||||
|
set(f "${CMAKE_CURRENT_BINARY_DIR}/not_a_binary.txt")
|
||||||
|
file(WRITE "${f}" "Not a binary.\n")
|
||||||
|
file(RPATH_REMOVE FILE "${f}")
|
@ -0,0 +1 @@
|
|||||||
|
1
|
@ -0,0 +1,12 @@
|
|||||||
|
^CMake Error at [^
|
||||||
|
]*/Tests/RunCMake/file-RPATH/TextSet.cmake:[0-9]+ \(file\):
|
||||||
|
file RPATH_SET could not write new RPATH:
|
||||||
|
|
||||||
|
/new/rpath
|
||||||
|
|
||||||
|
to the file:
|
||||||
|
|
||||||
|
[^
|
||||||
|
]*/Tests/RunCMake/file-RPATH/TextSet-build/not_a_binary.txt
|
||||||
|
|
||||||
|
The file format is not recognized\.$
|
@ -0,0 +1,3 @@
|
|||||||
|
set(f "${CMAKE_CURRENT_BINARY_DIR}/not_a_binary.txt")
|
||||||
|
file(WRITE "${f}" "Not a binary.\n")
|
||||||
|
file(RPATH_SET FILE "${f}" NEW_RPATH "/new/rpath")
|
@ -0,0 +1,3 @@
|
|||||||
|
set(f "${CMAKE_CURRENT_BINARY_DIR}/not_a_binary.txt")
|
||||||
|
file(WRITE "${f}" "Not a binary.\n")
|
||||||
|
file(RPATH_SET FILE "${f}" NEW_RPATH "")
|
@ -0,0 +1,7 @@
|
|||||||
|
#ifdef TC_CONFIG_BAD
|
||||||
|
# error "Built in 'Bad' config"
|
||||||
|
#endif
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
@ -0,0 +1,18 @@
|
|||||||
|
enable_language(C)
|
||||||
|
|
||||||
|
set(ENV{CMAKE_BUILD_TYPE} "Bad")
|
||||||
|
set(ENV{CMAKE_CONFIGURATION_TYPES} "Bad;Debug")
|
||||||
|
|
||||||
|
add_library(tc_defs INTERFACE IMPORTED)
|
||||||
|
target_compile_definitions(tc_defs INTERFACE "TC_CONFIG_$<UPPER_CASE:$<CONFIG>>")
|
||||||
|
|
||||||
|
try_compile(ENV_CONFIG_RESULT "${CMAKE_BINARY_DIR}"
|
||||||
|
SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/EnvConfig.c"
|
||||||
|
COPY_FILE "${CMAKE_CURRENT_BINARY_DIR}/EnvConfig.bin"
|
||||||
|
OUTPUT_VARIABLE tc_output
|
||||||
|
LINK_LIBRARIES tc_defs
|
||||||
|
)
|
||||||
|
if(NOT ENV_CONFIG_RESULT)
|
||||||
|
string(REPLACE "\n" "\n " tc_output " ${tc_output}")
|
||||||
|
message(FATAL_ERROR "try_compile failed:\n${tc_output}")
|
||||||
|
endif()
|
@ -0,0 +1,15 @@
|
|||||||
|
cmake_minimum_required(VERSION 3.20)
|
||||||
|
project(VSManagedCustomCommand CXX)
|
||||||
|
|
||||||
|
add_custom_command(OUTPUT middle.txt
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/example.txt ${CMAKE_CURRENT_BINARY_DIR}/middle.txt
|
||||||
|
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/example.txt
|
||||||
|
)
|
||||||
|
|
||||||
|
add_custom_command(OUTPUT example.cxx
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/middle.txt ${CMAKE_CURRENT_BINARY_DIR}/example.cxx
|
||||||
|
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/middle.txt
|
||||||
|
)
|
||||||
|
|
||||||
|
add_library(example SHARED example.cxx)
|
||||||
|
set_property(TARGET example PROPERTY COMMON_LANGUAGE_RUNTIME "")
|
@ -0,0 +1,4 @@
|
|||||||
|
__declspec(dllexport) int example()
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
@ -0,0 +1,118 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -e
|
||||||
|
readonly usage='usage: sign-notarize.bash -i <id> -d <dev-acct> -k <key-item> [-p <provider>] [--] <package>.dmg
|
||||||
|
|
||||||
|
Sign and notarize the "CMake.app" bundle inside the given "<package>.dmg" disk image.
|
||||||
|
Also produce a "<package>.tar.gz" tarball containing the same "CMake.app".
|
||||||
|
|
||||||
|
Options:
|
||||||
|
|
||||||
|
-i <id> Signing Identity
|
||||||
|
-d <dev-acct> Developer account name
|
||||||
|
-k <key-item> Keychain item containing account credentials
|
||||||
|
-p <provider> Provider short name
|
||||||
|
'
|
||||||
|
|
||||||
|
cleanup() {
|
||||||
|
if test -d "$tmpdir"; then
|
||||||
|
rm -rf "$tmpdir"
|
||||||
|
fi
|
||||||
|
if test -d "$vol_path"; then
|
||||||
|
hdiutil detach "$vol_path"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
trap "cleanup" EXIT
|
||||||
|
|
||||||
|
die() {
|
||||||
|
echo "$@" 1>&2; exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
id=''
|
||||||
|
dev_acct=''
|
||||||
|
key_item=''
|
||||||
|
provider=''
|
||||||
|
while test "$#" != 0; do
|
||||||
|
case "$1" in
|
||||||
|
-i) shift; id="$1" ;;
|
||||||
|
-d) shift; dev_acct="$1" ;;
|
||||||
|
-k) shift; key_item="$1" ;;
|
||||||
|
-p) shift; provider="$1" ;;
|
||||||
|
--) shift ; break ;;
|
||||||
|
-*) die "$usage" ;;
|
||||||
|
*) break ;;
|
||||||
|
esac
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
case "$1" in
|
||||||
|
*.dmg) readonly dmg="$1"; shift ;;
|
||||||
|
*) die "$usage" ;;
|
||||||
|
esac
|
||||||
|
test "$#" = 0 || die "$usage"
|
||||||
|
|
||||||
|
# Verify arguments.
|
||||||
|
if test -z "$id" -o -z "$dev_acct" -o -z "$key_item"; then
|
||||||
|
die "$usage"
|
||||||
|
fi
|
||||||
|
if test -n "$provider"; then
|
||||||
|
provider="--provider $provider"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Verify environment.
|
||||||
|
if ! xcnotary="$(type -p xcnotary)"; then
|
||||||
|
die "'xcnotary' not found in PATH"
|
||||||
|
fi
|
||||||
|
readonly xcnotary
|
||||||
|
|
||||||
|
readonly tmpdir="$(mktemp -d)"
|
||||||
|
|
||||||
|
# Prepare entitlements.
|
||||||
|
readonly entitlements_xml="$tmpdir/entitlements.xml"
|
||||||
|
echo '<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>com.apple.security.cs.allow-dyld-environment-variables</key>
|
||||||
|
<true/>
|
||||||
|
</dict>
|
||||||
|
</plist>' > "$entitlements_xml"
|
||||||
|
|
||||||
|
# Extract SLA
|
||||||
|
readonly sla_xml="$tmpdir/sla.xml"
|
||||||
|
hdiutil udifderez -xml "$dmg" > "$sla_xml"
|
||||||
|
plutil -remove 'blkx' "$sla_xml"
|
||||||
|
plutil -remove 'plst' "$sla_xml"
|
||||||
|
|
||||||
|
# Convert from read-only original image to read-write.
|
||||||
|
readonly udrw_dmg="$tmpdir/udrw.dmg"
|
||||||
|
hdiutil convert "$dmg" -format UDRW -o "${udrw_dmg}"
|
||||||
|
|
||||||
|
# Mount the temporary udrw image.
|
||||||
|
readonly vol_name="$(basename "${dmg%.dmg}")"
|
||||||
|
readonly vol_path="/Volumes/$vol_name"
|
||||||
|
hdiutil attach "${udrw_dmg}"
|
||||||
|
|
||||||
|
codesign --verify --timestamp --options=runtime --verbose --deep \
|
||||||
|
-s "$id" \
|
||||||
|
--entitlements "$entitlements_xml" \
|
||||||
|
"$vol_path/CMake.app/Contents/bin/cmake" \
|
||||||
|
"$vol_path/CMake.app/Contents/bin/ccmake" \
|
||||||
|
"$vol_path/CMake.app/Contents/bin/ctest" \
|
||||||
|
"$vol_path/CMake.app/Contents/bin/cpack" \
|
||||||
|
"$vol_path/CMake.app/Contents/share/cmake"*"/Modules/Internal/CPack/CPack.OSXScriptLauncher.in" \
|
||||||
|
"$vol_path/CMake.app"
|
||||||
|
|
||||||
|
xcnotary notarize "$vol_path/CMake.app" -d "$dev_acct" -k "$key_item" $provider
|
||||||
|
|
||||||
|
# Create a tarball of the volume next to the original disk image.
|
||||||
|
readonly tar_gz="${dmg/%.dmg/.tar.gz}"
|
||||||
|
tar cvzf "$tar_gz" -C /Volumes "$vol_name/CMake.app"
|
||||||
|
|
||||||
|
# Unmount the modified udrw image.
|
||||||
|
hdiutil detach "$vol_path"
|
||||||
|
|
||||||
|
# Convert back to read-only, compressed image.
|
||||||
|
hdiutil convert "${udrw_dmg}" -format UDZO -imagekey zlib-level=9 -ov -o "$dmg"
|
||||||
|
|
||||||
|
# Re-insert SLA.
|
||||||
|
hdiutil udifrez -xml "${sla_xml}" 'FIXME_WHY_IS_THIS_ARGUMENT_NEEDED' "$dmg"
|
Loading…
Reference in new issue