From 384338c637c4277d1fec6ac2cc6e85b36384f2f1 Mon Sep 17 00:00:00 2001 From: Sergiu Deitsch Date: Sun, 8 Oct 2023 16:51:00 +0200 Subject: [PATCH] empty source --- CMakeLists.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 854d61fc5..b80d5c903 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -490,8 +490,18 @@ add_library (glog_internal OBJECT target_compile_features (glog_internal PUBLIC $) set_target_properties (glog_internal PROPERTIES DEFINE_SYMBOL GOOGLE_GLOG_IS_A_DLL) +# Some generators (such as Xcode) do not generate any output if the target does +# not reference at least one source file. +set (_glog_EMPTY_SOURCE ${glog_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/glog.cc) + +add_custom_command ( + OUTPUT ${_glog_EMPTY_SOURCE} + COMMAND ${CMAKE_COMMAND} -E touch ${_glog_EMPTY_SOURCE} +) + add_library (glog $ + ${_glog_EMPTY_SOURCE} ) target_compile_features (glog PUBLIC cxx_std_14)