Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
opendht
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
opendht
Commits
550721e2
Commit
550721e2
authored
1 month ago
by
Adrien Béraud
Browse files
Options
Downloads
Patches
Plain Diff
build/cmake: use global MSVC_RUNTIME_LIBRARY
parent
fa11d606
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
CMakeLists.txt
+4
-8
4 additions, 8 deletions
CMakeLists.txt
tools/CMakeLists.txt
+0
-6
0 additions, 6 deletions
tools/CMakeLists.txt
with
4 additions
and
14 deletions
CMakeLists.txt
+
4
−
8
View file @
550721e2
...
@@ -53,6 +53,9 @@ option (OPENDHT_DOCUMENTATION "Create and install the HTML based API documentati
...
@@ -53,6 +53,9 @@ option (OPENDHT_DOCUMENTATION "Create and install the HTML based API documentati
# Build flags
# Build flags
set
(
CMAKE_CXX_STANDARD 17
)
set
(
CMAKE_CXX_STANDARD 17
)
set
(
CMAKE_CXX_STANDARD_REQUIRED on
)
set
(
CMAKE_CXX_STANDARD_REQUIRED on
)
if
(
MSVC AND NOT BUILD_SHARED_LIBS AND NOT CMAKE_MSVC_RUNTIME_LIBRARY
)
set
(
CMAKE_MSVC_RUNTIME_LIBRARY
"MultiThreaded$<$<CONFIG:Debug>:Debug>"
)
endif
()
if
(
OPENDHT_C
)
if
(
OPENDHT_C
)
set
(
CMAKE_C_STANDARD 11
)
set
(
CMAKE_C_STANDARD 11
)
...
@@ -63,7 +66,6 @@ if (OPENDHT_C)
...
@@ -63,7 +66,6 @@ if (OPENDHT_C)
endif
()
endif
()
endif
()
endif
()
# Dependencies
if
(
NOT HAVE_CXX_ATOMICS_WITHOUT_LIB
if
(
NOT HAVE_CXX_ATOMICS_WITHOUT_LIB
# For ARM EABI (armel), little-endian MIPS (mipsel), etc.
# For ARM EABI (armel), little-endian MIPS (mipsel), etc.
OR NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB
)
OR NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB
)
...
@@ -79,6 +81,7 @@ if (WIN32)
...
@@ -79,6 +81,7 @@ if (WIN32)
add_definitions
(
-DWINVER=
${
WINVER
}
-D_WIN32_WINNT=
${
WINVER
}
)
add_definitions
(
-DWINVER=
${
WINVER
}
-D_WIN32_WINNT=
${
WINVER
}
)
endif
()
endif
()
# Dependencies
list
(
APPEND CMAKE_MODULE_PATH
"
${
PROJECT_SOURCE_DIR
}
/cmake"
)
list
(
APPEND CMAKE_MODULE_PATH
"
${
PROJECT_SOURCE_DIR
}
/cmake"
)
if
(
NOT MSVC
)
if
(
NOT MSVC
)
set
(
THREADS_PREFER_PTHREAD_FLAG TRUE
)
set
(
THREADS_PREFER_PTHREAD_FLAG TRUE
)
...
@@ -522,10 +525,6 @@ if (MSVC)
...
@@ -522,10 +525,6 @@ if (MSVC)
endif
()
endif
()
if
(
OPENDHT_STATIC
)
if
(
OPENDHT_STATIC
)
target_link_libraries
(
opendht PUBLIC
${
Win32_STATIC_LIBRARIES
}
${
Win32_IMPORT_LIBRARIES
}
)
target_link_libraries
(
opendht PUBLIC
${
Win32_STATIC_LIBRARIES
}
${
Win32_IMPORT_LIBRARIES
}
)
set_target_properties
(
opendht PROPERTIES
OUTPUT_NAME
"libopendht"
MSVC_RUNTIME_LIBRARY
"MultiThreaded$<$<CONFIG:Debug>:Debug>"
)
endif
()
endif
()
else
()
else
()
target_link_libraries
(
opendht
target_link_libraries
(
opendht
...
@@ -607,9 +606,6 @@ if (OPENDHT_C)
...
@@ -607,9 +606,6 @@ if (OPENDHT_C)
target_compile_definitions
(
opendht-c PRIVATE OPENDHT_C_BUILD
)
target_compile_definitions
(
opendht-c PRIVATE OPENDHT_C_BUILD
)
target_link_libraries
(
opendht-c PRIVATE opendht
)
target_link_libraries
(
opendht-c PRIVATE opendht
)
set_target_properties
(
opendht-c PROPERTIES SOVERSION
${
opendht_VERSION_MAJOR
}
VERSION
${
opendht_VERSION
}
)
set_target_properties
(
opendht-c PROPERTIES SOVERSION
${
opendht_VERSION_MAJOR
}
VERSION
${
opendht_VERSION
}
)
if
(
NOT BUILD_SHARED_LIBS
)
set_target_properties
(
opendht-c PROPERTIES MSVC_RUNTIME_LIBRARY
"MultiThreaded$<$<CONFIG:Debug>:Debug>"
)
endif
()
install
(
TARGETS opendht-c DESTINATION
${
CMAKE_INSTALL_LIBDIR
}
EXPORT opendht-c
)
install
(
TARGETS opendht-c DESTINATION
${
CMAKE_INSTALL_LIBDIR
}
EXPORT opendht-c
)
# PkgConfig module
# PkgConfig module
...
...
This diff is collapsed.
Click to expand it.
tools/CMakeLists.txt
+
0
−
6
View file @
550721e2
...
@@ -10,9 +10,6 @@ function (configure_tool name extra_files)
...
@@ -10,9 +10,6 @@ function (configure_tool name extra_files)
if
(
MSVC
)
if
(
MSVC
)
target_sources
(
${
name
}
PRIVATE
${
MSC_COMPAT_SOURCES
}
)
target_sources
(
${
name
}
PRIVATE
${
MSC_COMPAT_SOURCES
}
)
target_link_libraries
(
${
name
}
PUBLIC opendht wsock32 ws2_32
)
target_link_libraries
(
${
name
}
PUBLIC opendht wsock32 ws2_32
)
if
(
NOT BUILD_SHARED_LIBS
)
set_target_properties
(
${
name
}
PROPERTIES MSVC_RUNTIME_LIBRARY
"MultiThreaded$<$<CONFIG:Debug>:Debug>"
)
endif
()
target_link_libraries
(
${
name
}
PUBLIC opendht
)
target_link_libraries
(
${
name
}
PUBLIC opendht
)
target_include_directories
(
${
name
}
PRIVATE SYSTEM
${
MSC_COMPAT_DIR
}
${
MSVC_COMPAT_DIR
}
)
target_include_directories
(
${
name
}
PRIVATE SYSTEM
${
MSC_COMPAT_DIR
}
${
MSVC_COMPAT_DIR
}
)
else
()
else
()
...
@@ -42,9 +39,6 @@ if (OPENDHT_C)
...
@@ -42,9 +39,6 @@ if (OPENDHT_C)
if
(
MSVC
)
if
(
MSVC
)
target_sources
(
dhtcnode PRIVATE
${
MSC_COMPAT_SOURCES
}
)
target_sources
(
dhtcnode PRIVATE
${
MSC_COMPAT_SOURCES
}
)
target_include_directories
(
dhtcnode SYSTEM PRIVATE
${
MSC_COMPAT_DIR
}
${
MSVC_COMPAT_DIR
}
)
target_include_directories
(
dhtcnode SYSTEM PRIVATE
${
MSC_COMPAT_DIR
}
${
MSVC_COMPAT_DIR
}
)
if
(
NOT BUILD_SHARED_LIBS
)
set_target_properties
(
dhtcnode PROPERTIES MSVC_RUNTIME_LIBRARY
"MultiThreaded$<$<CONFIG:Debug>:Debug>"
)
endif
()
endif
()
endif
()
endif
()
endif
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment