Skip to content

Commit 6dc7f9b

Browse files
committed
Fix CMakeLists.txt to build under Bash on Ubuntu on Windows
(Windows Subsystem for Windows 10)
1 parent 35aaf73 commit 6dc7f9b

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

CMakeLists.txt

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ include_directories("${PROJECT_SOURCE_DIR}/include")
177177
# add sources of the wrapper as a "SQLiteCpp" static library
178178
add_library(SQLiteCpp ${SQLITECPP_SRC} ${SQLITECPP_INC} ${SQLITECPP_DOC} ${SQLITECPP_SCRIPT})
179179
# make the sqlite3 library part of the interface of the SQLiteCpp wrapper itself (the client app does not need to link to sqlite3)
180-
# PR https://github.com/SRombauts/SQLiteCpp/pull/111 "linked SQLiteCpp to sqlite3" commented out since it breacks install step from PR #118
180+
# PR https://github.com/SRombauts/SQLiteCpp/pull/111 "linked SQLiteCpp to sqlite3" commented out since it breaks install step from PR #118
181181
#target_link_libraries(SQLiteCpp PUBLIC sqlite3)
182182

183183
if (UNIX AND (CMAKE_COMPILER_IS_GNUCXX OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang"))
@@ -295,12 +295,14 @@ if (SQLITECPP_BUILD_TESTS)
295295
include_directories("${PROJECT_SOURCE_DIR}/googletest/googletest/include")
296296

297297
# Add definitions to keep googletest from making the compilation fail
298-
if (MSVC_VERSION GREATER_EQUAL 1910 AND MSVC_VERSION LESS_EQUAL 1919) # OR MSVC_TOOLSET_VERSION EQUAL 141)
299-
target_compile_definitions(gtest PUBLIC _SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING)
300-
target_compile_definitions(gtest_main PUBLIC _SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING)
301-
target_compile_definitions(gmock PUBLIC _SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING)
302-
target_compile_definitions(gmock_main PUBLIC _SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING)
303-
endif (MSVC_VERSION GREATER_EQUAL 1910 AND MSVC_VERSION LESS_EQUAL 1919)
298+
if (MSVC)
299+
if (MSVC AND MSVC_VERSION GREATER_EQUAL 1910 AND MSVC_VERSION LESS_EQUAL 1919) # OR MSVC_TOOLSET_VERSION EQUAL 141)
300+
target_compile_definitions(gtest PUBLIC _SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING)
301+
target_compile_definitions(gtest_main PUBLIC _SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING)
302+
target_compile_definitions(gmock PUBLIC _SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING)
303+
target_compile_definitions(gmock_main PUBLIC _SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING)
304+
endif (MSVC_VERSION GREATER_EQUAL 1910 AND MSVC_VERSION LESS_EQUAL 1919)
305+
endif (MSVC)
304306

305307
# add the unit test executable
306308
add_executable(SQLiteCpp_tests ${SQLITECPP_TESTS})

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ And the following IDEs/Compilers
7474
- Clang 3.5 and 3.8
7575
- Xcode 8
7676
- Visual Studio Community 2017, and VS 2013 & 2015 (AppVeyor)
77-
- Eclipse CDT under Linux
7877

7978
### Dependencies
8079

0 commit comments

Comments
 (0)