Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
Actor Framework
Commits
7eed4a1c
Commit
7eed4a1c
authored
Jan 03, 2020
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Always add "empty" dummy file to library targets
parent
b5a2c397
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
21 additions
and
49 deletions
+21
-49
CMakeLists.txt
CMakeLists.txt
+2
-2
cmake/XcodeSpecifics.cmake
cmake/XcodeSpecifics.cmake
+0
-38
cmake/dummy.cpp
cmake/dummy.cpp
+10
-0
libcaf_core/CMakeLists.txt
libcaf_core/CMakeLists.txt
+3
-3
libcaf_io/CMakeLists.txt
libcaf_io/CMakeLists.txt
+3
-3
libcaf_openssl/CMakeLists.txt
libcaf_openssl/CMakeLists.txt
+3
-3
No files found.
CMakeLists.txt
View file @
7eed4a1c
...
...
@@ -13,9 +13,9 @@ include(CheckCSourceRuns) # Check whether compiler produces binaries
include
(
GNUInstallDirs
)
# Sets default install paths
include
(
GenerateExportHeader
)
# Auto-generates dllexport macros
# -- project-specific includes ------------------------------------------------------------------
# -- project-specific CMake settings -------------------------------------------
set
(
CMAKE_MODULE_PATH
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/cmake"
)
include
(
XcodeSpecifics
)
# -- check whether we are running as CMake subdirectory ------------------------
...
...
cmake/XcodeSpecifics.cmake
deleted
100644 → 0
View file @
b5a2c397
# -*- mode: cmake; coding: utf-8; indent-tabs-mode: nil; -*-
#
# Specifics of the Xcode generator
#
#########################################################################
#
# FUNCTION: xcode_assert_target_not_empty(target)
#
# If `target` was defined in conjunction with an object library
# (`TARGET_OBJECTS`), then the Xcode build system may delete the
# generated `target` artefact during the build. This occurs, when
# there are no regular sources in the `target`.
#
# Calling this function will generate a dummy source file, to make
# sure that the SOURCES property of `target` contains at least one
# regular source file.
#
# Applies only under the Xcode generator. For all other generators,
# the function does nothing.
#
# If `target` is not a valid target, does nothing.
#
function
(
xcode_assert_target_not_empty target
)
if
(
XCODE
)
if
(
TARGET
${
target
}
)
set
(
dummy_content
"namespace { [[maybe_unused]] auto dummy = 0; }
\n
"
)
set
(
dummy_location
"
${
CMAKE_CURRENT_BINARY_DIR
}
/src/
${
target
}
_dummy.cpp"
)
file
(
GENERATE OUTPUT
"
${
dummy_location
}
"
CONTENT
"
${
dummy_content
}
"
)
if
(
CMAKE_VERSION VERSION_GREATER_EQUAL 3.1
)
target_sources
(
${
target
}
PRIVATE
"
${
dummy_location
}
"
)
else
()
set_property
(
TARGET
${
target
}
APPEND PROPERTY SOURCES
"
${
dummy_location
}
"
)
endif
()
else
(
TARGET
${
target
}
)
message
(
WARNING
"xcode_assert_target_not_empty(): Not a target:
${
target
}
"
)
endif
(
TARGET
${
target
}
)
endif
(
XCODE
)
endfunction
(
xcode_assert_target_not_empty
)
cmake/dummy.cpp
0 → 100644
View file @
7eed4a1c
// Some CMake generators (in particular XCode) choke on library targets that
// only consist of a TARGET_OBJECTS generator expression. Adding this otherwise
// useless file to the library target makes sure the generated project files
// have at least one regular source file.
namespace
{
[[
maybe_unused
]]
int
dummy
;
}
// namespace
libcaf_core/CMakeLists.txt
View file @
7eed4a1c
...
...
@@ -282,9 +282,9 @@ set(CAF_CORE_TEST_SOURCES
add_library
(
libcaf_core_obj OBJECT
${
CAF_CORE_SOURCES
}
${
CAF_CORE_HEADERS
}
)
add_library
(
libcaf_core
$<TARGET_OBJECTS:libcaf_core_obj>
)
xcode_assert_target_not_empty
(
libcaf_core
)
add_library
(
libcaf_core
"
${
PROJECT_SOURCE_DIR
}
/cmake/dummy.cpp"
$<TARGET_OBJECTS:libcaf_core_obj>
)
add_library
(
caf::core ALIAS libcaf_core
)
...
...
libcaf_io/CMakeLists.txt
View file @
7eed4a1c
...
...
@@ -71,9 +71,9 @@ set(CAF_IO_TEST_SOURCES
add_library
(
libcaf_io_obj OBJECT
${
CAF_IO_SOURCES
}
${
CAF_IO_HEADERS
}
)
add_library
(
libcaf_io
$<TARGET_OBJECTS:libcaf_io_obj>
)
xcode_assert_target_not_empty
(
libcaf_io
)
add_library
(
libcaf_io
"
${
PROJECT_SOURCE_DIR
}
/cmake/dummy.cpp"
$<TARGET_OBJECTS:libcaf_io_obj>
)
add_library
(
caf::io ALIAS libcaf_io
)
...
...
libcaf_openssl/CMakeLists.txt
View file @
7eed4a1c
...
...
@@ -21,9 +21,9 @@ set(CAF_OPENSSL_TEST_SOURCES
add_library
(
libcaf_openssl_obj OBJECT
${
CAF_OPENSSL_SOURCES
}
${
CAF_OPENSSL_HEADERS
}
)
add_library
(
libcaf_openssl
$<TARGET_OBJECTS:libcaf_openssl_obj>
)
xcode_assert_target_not_empty
(
libcaf_openssl
)
add_library
(
libcaf_openssl
"
${
PROJECT_SOURCE_DIR
}
/cmake/dummy.cpp"
$<TARGET_OBJECTS:libcaf_openssl_obj>
)
add_library
(
caf::openssl ALIAS libcaf_openssl
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment