Skip to content
This repository was archived by the owner on Apr 6, 2019. It is now read-only.
This repository was archived by the owner on Apr 6, 2019. It is now read-only.

CMake compilation options for VC++ #13

@MikesAracade

Description

@MikesAracade

I tried using CMake to build the Visual Studio 2015 project files for cpp_redis.

I ran into an issue when trying to compile using the generated project.

This line:
## set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -W -Wall -Wextra -O3")

is not valid for Visual Studio 2015.
I don't know a thing about gcc compiler so I'll I tried to find documentation to convert these flags for VC++.

It complains about the -W flag.
I believe these options are what you want for VC++
/W3 - Warning Level 3 (any lower produces errors)
/O2 - Creates fast code (Don't want this for Debug build)

There is no option for c++11 (it's on by default)
Which would give you the following CMake line for a Release build.

## set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -W3 -O2 -D "_UNICODE" -D "UNICODE" -D "WIN32_LEAN_AND_MEAN")

I have no clue how to use CMake or to put in conditional statements for the environment.
Can you merge this fix in?
For reference here's a web link to VC++ compiler flags: https://msdn.microsoft.com/en-us/library/fwkeyyhe.aspx

Also could you make the default project a Static Library as opposed to a DLL (or maybe support both)?
Lastly the 'tests" project is not automatically built by CMake.

FYI I'll create a branch for the Windows port of cpp_redis. This library is exactly what I've been looking for!
Mike M.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions