File tree 2 files changed +21
-10
lines changed
2 files changed +21
-10
lines changed Original file line number Diff line number Diff line change @@ -78,7 +78,16 @@ else()
78
78
endif ()
79
79
add_definitions (-DLOADER_VERSION_SHA="${VERSION_SHA} " )
80
80
81
- include_directories ("${CMAKE_CURRENT_SOURCE_DIR} /third_party/spdlog_headers" )
81
+ if (SYSTEM_SPDLOG)
82
+ find_package (spdlog CONFIG)
83
+ if (spdlog_FOUND)
84
+ message (STATUS "System spdlog found." )
85
+ else ()
86
+ message (FATAL_ERROR "SYSTEM_SPDLOG specified but spdlog wasn't found." )
87
+ endif ()
88
+ else ()
89
+ include_directories ("${CMAKE_CURRENT_SOURCE_DIR} /third_party/spdlog_headers" )
90
+ endif ()
82
91
83
92
# Update other relevant variables to include the patch
84
93
set (PROJECT_VERSION "${PROJECT_VERSION_MAJOR} .${PROJECT_VERSION_MINOR} .${PROJECT_VERSION_PATCH} " )
@@ -151,17 +160,17 @@ if(MSVC)
151
160
152
161
# enable exceptions handling
153
162
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc" )
154
-
163
+
155
164
# enable creation of PDB files for Release Builds
156
165
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Zi" )
157
166
set (CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /DEBUG /OPT:REF /OPT:ICF" )
158
-
167
+
159
168
# enable CET shadow stack
160
169
set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /CETCOMPAT" )
161
170
162
171
#Use of sccache with MSVC requires workaround of replacing /Zi with /Z7
163
172
#https://github.com/mozilla/sccache
164
- if (USE_Z7) #sccache
173
+ if (USE_Z7) #sccache
165
174
string (REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} " )
166
175
string (REPLACE "/Zi" "/Z7" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} " )
167
176
string (REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} " )
Original file line number Diff line number Diff line change 1
1
# Copyright (C) 2024 Intel Corporation
2
2
# SPDX-License-Identifier: MIT
3
3
4
- add_library (utils
5
- STATIC
6
- "logging.h"
7
- "logging.cpp"
8
- )
4
+ set (logging_files logging.h logging.cpp)
5
+ add_library (utils STATIC ${logging_files} )
9
6
10
- target_include_directories (utils PRIVATE ${CMAKE_SOURCE_DIR} /third_party/spdlog_headers/)
7
+ if (SYSTEM_SPDLOG)
8
+ target_link_libraries (utils PUBLIC spdlog::spdlog)
9
+ else ()
10
+ target_include_directories (utils PUBLIC ${PROJECT_SOURCE_DIR} /third_party/spdlog_headers/)
11
+ endif ()
12
+ set_property (TARGET utils PROPERTY POSITION_INDEPENDENT_CODE ON )
You can’t perform that action at this time.
0 commit comments