Skip to content

Commit

Permalink
[build] CMakeLists.txt fixes for sqlite on Windows (#2274)
Browse files Browse the repository at this point in the history
Fixes: #2271
Context: 673757d
Context: https://cmake.org/cmake/help/v3.3/command/file.html

`cmake` mandates a uniform way of presenting filesystem paths across
all the operating systems it supports - it requires that path segments
are separated with the `/` character.

In 673757d, we faced a similar problem, but used a string replace as
a fix:

    string(REPLACE "\\" "/" MY_PATH ${MY_PATH})

There is a proper, more "portable" way to do this, such as:

    file(TO_CMAKE_PATH "${MY_PATH}" MY_PATH)

Using this for `SQLITE_XAMARIN_SOURCES` fixes the sqlite build on
Windows.
  • Loading branch information
jonathanpeppers authored Oct 8, 2018
1 parent 960f32c commit ca8493a
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/sqlite-xamarin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,7 @@ endforeach(arg)

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${LOCAL_C_FLAGS}")

set(SQLITE_XAMARIN_SOURCES
${SQLITE_SOURCE_DIR}/dist/sqlite3.c
)
file(TO_CMAKE_PATH "${SQLITE_SOURCE_DIR}/dist/sqlite3.c" SQLITE_XAMARIN_SOURCES)

set(SOURCES_FRAGMENT_FILE "sources.projitems")
file(WRITE ${SOURCES_FRAGMENT_FILE} "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\
Expand Down

0 comments on commit ca8493a

Please sign in to comment.