Skip to content

Commit

Permalink
SNOW-1789728: Upgrade cmake version (#772)
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-jszczerbinski authored Nov 8, 2024
1 parent 6f163ce commit 831fcdb
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 17 deletions.
13 changes: 1 addition & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# CMakeList for Snowflake Client
#
cmake_minimum_required(VERSION 2.8)
cmake_minimum_required(VERSION 3.17)
project(snowflakeclient)

if (CLIENT_CODE_COVERAGE) # Only when code coverage is enabled
Expand Down Expand Up @@ -520,17 +520,6 @@ if (APPLE)
# OSX. no librt is required.
target_link_libraries(snowflakeclient dl z)
endif ()
if (WIN32)
# Windows
target_link_libraries(snowflakeclient)
if (DYNAMIC_RUNTIME)
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MD")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MDd")
else()
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
endif()
endif ()

add_subdirectory(examples)

Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Build and Tests
Build
----------------------------------------------------------------------

Ensure you have cmake 2.8 or later version.
Ensure you have cmake 3.17 or later version.

Linux and OSX
^^^^^^^^^^^^^
Expand Down
16 changes: 12 additions & 4 deletions scripts/build_libsnowflakeclient.bat
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,18 @@ set vs_version=%3
set dynamic_runtime=%4
set build_tests=%5

if not "%dynamic_runtime%"=="ON" (
set dynamic_runtime=OFF
set msvc_runtime_library=MultiThreaded

if "%build_type%"=="Debug" (
set msvc_runtime_library=%msvc_runtime_library%Debug
)

if "%dynamic_runtime%"=="ON" (
echo %dynamic_runtime%
set msvc_runtime_library=%msvc_runtime_library%DLL
)
echo === dynamic_runtime: %dynamic_runtime%

echo === msvc_runtime_library: %msvc_runtime_library%

if not "%build_tests%"=="ON" (
set build_tests=OFF
Expand All @@ -50,7 +58,7 @@ cd %cmake_dir%
if %ERRORLEVEL% NEQ 0 goto :error

cmake -G "%cmake_generator%" -A %cmake_architecture% ^
-DDYNAMIC_RUNTIME=%dynamic_runtime% ^
-DCMAKE_MSVC_RUNTIME_LIBRARY=%msvc_runtime_library% ^
-DBUILD_TESTS=%build_tests% ^
-DCMAKE_BUILD_TYPE=%build_type% ^
-DVSDIR:STRING=%vsdir% ..
Expand Down

0 comments on commit 831fcdb

Please sign in to comment.