mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-04-20 07:51:34 +02:00

Set /WX flas that is warnings as errors on MSVC build. Updated linux, osx, msvc build to refer to appropriate boost libraries.
33 lines
1003 B
CMake
33 lines
1003 B
CMake
INCLUDE_DIRECTORIES (
|
|
../include
|
|
)
|
|
|
|
LIST (APPEND exec_PROGRAMS
|
|
lib_buffer_unpack.c
|
|
simple_c.c
|
|
speed_test_uint32_array.c
|
|
speed_test_uint64_array.c
|
|
user_buffer_unpack.c
|
|
)
|
|
|
|
FOREACH (source_file ${exec_PROGRAMS})
|
|
GET_FILENAME_COMPONENT (source_file_we ${source_file} NAME_WE)
|
|
ADD_EXECUTABLE (
|
|
${source_file_we}
|
|
${source_file}
|
|
)
|
|
TARGET_LINK_LIBRARIES (${source_file_we}
|
|
msgpack
|
|
)
|
|
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
|
SET_PROPERTY (TARGET ${source_file_we} APPEND_STRING PROPERTY COMPILE_FLAGS "-Wall -Wextra -Werror -Wno-mismatched-tags -g -O3")
|
|
ENDIF ()
|
|
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
|
|
IF (CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
|
|
STRING(REGEX REPLACE "/W[0-4]" "/W3 /WX" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
|
ELSE ()
|
|
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W3 /WX")
|
|
ENDIF ()
|
|
ENDIF ()
|
|
ENDFOREACH ()
|