Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
MIGraphX
Commits
bc7adab1
Commit
bc7adab1
authored
Oct 13, 2023
by
Artur Wojcik
Browse files
sqlite3: add support for Windows
parent
1a1c1b42
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
59 additions
and
2 deletions
+59
-2
cmake/SQLite3.cmake
cmake/SQLite3.cmake
+58
-0
src/CMakeLists.txt
src/CMakeLists.txt
+1
-2
No files found.
cmake/SQLite3.cmake
0 → 100644
View file @
bc7adab1
#####################################################################################
# The MIT License (MIT)
#
# Copyright (c) 2015-2023 Advanced Micro Devices, Inc. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#####################################################################################
if
(
NOT WIN32
)
find_package
(
PkgConfig REQUIRED
)
pkg_check_modules
(
SQLITE3 REQUIRED IMPORTED_TARGET sqlite3
)
else
()
# https://cmake.org/cmake/help/latest/policy/CMP0135.html
cmake_policy
(
SET CMP0135 NEW
)
if
(
NOT NMAKE_DIR
)
set
(
NMAKE_DIR
"$ENV{NMAKE_DIR}"
)
endif
()
find_program
(
NMAKE_EXECUTABLE NAMES nmake.exe REQUIRED HINTS
"
${
NMAKE_DIR
}
"
)
include
(
ExternalProject
)
ExternalProject_Add
(
sqlite3
GIT_REPOSITORY https://github.com/sqlite/sqlite.git
GIT_TAG version-3.40.0
GIT_SHALLOW true
UPDATE_DISCONNECTED true
CONFIGURE_COMMAND
""
BUILD_COMMAND
${
NMAKE_EXECUTABLE
}
/f ..\\sqlite3\\Makefile.msc USE_AMALGAMATION=1 NO_TCL=1 TOP=..\\sqlite3 libsqlite3.lib
INSTALL_COMMAND
""
)
ExternalProject_Get_Property
(
sqlite3 BINARY_DIR
)
# For compatibility with PkgConfig
add_library
(
PkgConfig::SQLITE3 INTERFACE IMPORTED GLOBAL
)
add_dependencies
(
PkgConfig::SQLITE3 sqlite3
)
target_link_directories
(
PkgConfig::SQLITE3 INTERFACE
${
BINARY_DIR
}
)
target_link_libraries
(
PkgConfig::SQLITE3 INTERFACE libsqlite3.lib
)
target_include_directories
(
PkgConfig::SQLITE3 INTERFACE
${
BINARY_DIR
}
)
endif
()
src/CMakeLists.txt
View file @
bc7adab1
...
@@ -261,8 +261,7 @@ find_package(nlohmann_json 3.8.0 REQUIRED)
...
@@ -261,8 +261,7 @@ find_package(nlohmann_json 3.8.0 REQUIRED)
target_link_libraries
(
migraphx PRIVATE nlohmann_json::nlohmann_json
)
target_link_libraries
(
migraphx PRIVATE nlohmann_json::nlohmann_json
)
migraphx_generate_export_header
(
migraphx
)
migraphx_generate_export_header
(
migraphx
)
find_package
(
PkgConfig
)
include
(
SQLite3
)
pkg_check_modules
(
SQLITE3 REQUIRED IMPORTED_TARGET sqlite3
)
target_link_libraries
(
migraphx PRIVATE PkgConfig::SQLITE3
)
target_link_libraries
(
migraphx PRIVATE PkgConfig::SQLITE3
)
find_package
(
msgpackc-cxx QUIET
)
find_package
(
msgpackc-cxx QUIET
)
...
...
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