mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-04-19 23:50:40 +02:00
25 lines
884 B
CMake
25 lines
884 B
CMake
IF (MSGPACK_BOOST)
|
|
LIST (APPEND exec_PROGRAMS
|
|
msgpack_variant_capitalize.cpp
|
|
msgpack_variant_mapbased.cpp
|
|
)
|
|
ENDIF ()
|
|
|
|
FOREACH (source_file ${exec_PROGRAMS})
|
|
GET_FILENAME_COMPONENT (source_file_we ${source_file} NAME_WE)
|
|
ADD_EXECUTABLE (
|
|
${source_file_we}
|
|
${source_file}
|
|
)
|
|
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 ()
|