Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install sqlite3.exe as part of sqlite3 port #2525

Merged
merged 2 commits into from
Feb 27, 2018
Merged

Install sqlite3.exe as part of sqlite3 port #2525

merged 2 commits into from
Feb 27, 2018

Conversation

nerdile
Copy link
Contributor

@nerdile nerdile commented Jan 7, 2018

The sqlite3.exe command line shell is very helpful when learning or using sqlite3. The shell source comes with the amalgamated source drop, so let's build and install it as part of the vcpkg port.

  • Modeled after the bzip2 port: If SQLITE3_SKIP_TOOLS is not
    set, build and install sqlite3.exe as part of the sqlite3
    package. sqlite3.dll must also be copied to the tools folder
    for sqlite3.exe to be able to launch.
  • Tested on Windows 10.0.16299.125 with VS 2017 15.5.2 using: .\vcpkg install sqlite3:x86-windows sqlite3:x64-windows

- Modeled after the bzip2 port: If SQLITE3_SKIP_TOOLS is not
  set, build and install sqlite3.exe as part of the sqlite3
  package.  sqlite3.dll must also be copied to the tools folder
  for sqlite3.exe to be able to launch.
- Tested on Windows RS3 with VS 2017 15.5.2.
@@ -22,10 +22,20 @@ if(VCPKG_CMAKE_SYSTEM_NAME MATCHES "WindowsStore")
target_compile_definitions(sqlite3 PRIVATE -DSQLITE_OS_WINRT=1)
endif()

install(TARGETS sqlite3 EXPORT sqlite3Config

if(NOT SQLITE3_SKIP_TOOLS)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The portfile should be updated to include OPTIONS_DEBUG SQLITE3_SKIP_TOOLS=ON since we don't really need it to be built in debug mode :)

add_executable(sqlite3-bin ${SOURCE}/shell.c)
set_target_properties(sqlite3-bin PROPERTIES OUTPUT_NAME sqlite3)
target_link_libraries(sqlite3-bin PRIVATE sqlite3)
install(TARGETS sqlite3-bin sqlite3 RUNTIME DESTINATION tools)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of installing to tools, we should install to tools/sqlite3.

@@ -22,10 +22,20 @@ if(VCPKG_CMAKE_SYSTEM_NAME MATCHES "WindowsStore")
target_compile_definitions(sqlite3 PRIVATE -DSQLITE_OS_WINRT=1)
endif()

install(TARGETS sqlite3 EXPORT sqlite3Config

if(NOT SQLITE3_SKIP_TOOLS)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably be skipped when building for WindowsStore.

@ras0219-msft
Copy link
Contributor

Thanks for the PR!

This seems pretty solid, but there are a few minor changes that we should add to improve other cases.

In addition to the comments I made:

  • We should add vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/sqlite3) to the portfile to make sure the executable will have all the needed DLLs.
  • Make sure to bump the version in the CONTROL file since this is changing the contents of the package. Simply 3.21.0-1 would be great.

@ras0219-msft ras0219-msft merged commit ba3f552 into microsoft:master Feb 27, 2018
@pravic
Copy link
Contributor

pravic commented Apr 3, 2018

The tool feature does not work with static builds:

vcpkg install sqlite3[tool]:x64-windows-static
-- Configuring x64-windows-static
CMake Error at scripts/cmake/vcpkg_execute_required_process.cmake:56 (message):
Command failed: ninja;-v
Working Directory: VCPKG_ROOT/buildtrees/sqlite3/x64-windows-static-rel/vcpkg-parallel-configure
See logs for more information:
VCPKG_ROOT\buildtrees\sqlite3\config-x64-windows-static-out.log
Call Stack (most recent call first):
scripts/cmake/vcpkg_configure_cmake.cmake:236 (vcpkg_execute_required_process)
ports/sqlite3/portfile.cmake:20 (vcpkg_configure_cmake)
scripts/ports.cmake:72 (include)

Log:

CMake Error at CMakeLists.txt:28 (install):
install TARGETS given no ARCHIVE DESTINATION for static library target
"sqlite3".

pravic added a commit to pravic/vcpkg that referenced this pull request Apr 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants