mirror of
https://github.com/boostorg/beast.git
synced 2025-08-03 14:54:32 +02:00
committed by
Mohammad Nejati
parent
a21250d12d
commit
75e45287fb
5
cmake/toolchains/clang.cmake
Normal file
5
cmake/toolchains/clang.cmake
Normal file
@@ -0,0 +1,5 @@
|
||||
# Include gcc options.
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/gcc.cmake)
|
||||
|
||||
# Compiler options.
|
||||
add_compile_options(-Wrange-loop-analysis)
|
18
cmake/toolchains/common.cmake
Normal file
18
cmake/toolchains/common.cmake
Normal file
@@ -0,0 +1,18 @@
|
||||
# C++ standard.
|
||||
set(CMAKE_CXX_EXTENSIONS OFF CACHE STRING "")
|
||||
|
||||
# Static library linkage.
|
||||
set(BUILD_SHARED_LIBS OFF CACHE STRING "")
|
||||
add_definitions(-DBOOST_ALL_STATIC_LINK=1)
|
||||
|
||||
# Interprocedural optimization.
|
||||
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE ON CACHE STRING "")
|
||||
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_MINSIZEREL ON CACHE STRING "")
|
||||
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELWITHDEBINFO ON CACHE STRING "")
|
||||
|
||||
# Compiler definitions.
|
||||
if(WIN32)
|
||||
add_definitions(-D_WIN32_WINNT=0x0601 -D_CRT_SECURE_NO_WARNINGS)
|
||||
endif()
|
||||
|
||||
# Project options.
|
5
cmake/toolchains/gcc.cmake
Normal file
5
cmake/toolchains/gcc.cmake
Normal file
@@ -0,0 +1,5 @@
|
||||
# Include common options.
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/common.cmake)
|
||||
|
||||
# Compiler options.
|
||||
add_compile_options(-Wall -Wextra -Wpedantic -Wno-unused-parameter)
|
35
cmake/toolchains/msvc.cmake
Normal file
35
cmake/toolchains/msvc.cmake
Normal file
@@ -0,0 +1,35 @@
|
||||
# Include common options.
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/common.cmake)
|
||||
|
||||
# Static runtime linkage.
|
||||
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>" CACHE STRING "")
|
||||
|
||||
# Compiler options.
|
||||
# Specific to C and CXX, to prevent passing them to MASM
|
||||
add_compile_options(
|
||||
$<$<COMPILE_LANGUAGE:CXX>:/bigobj>
|
||||
$<$<COMPILE_LANGUAGE:CXX>:/permissive->
|
||||
$<$<COMPILE_LANGUAGE:C,CXX>:/W4>
|
||||
$<$<COMPILE_LANGUAGE:C,CXX>:/MP>
|
||||
)
|
||||
if("${CMAKE_GENERATOR_PLATFORM}" STREQUAL "Win32") # 32-bit
|
||||
add_compile_options(
|
||||
/arch:SSE2
|
||||
)
|
||||
endif()
|
||||
|
||||
# Linker options.
|
||||
add_link_options(
|
||||
)
|
||||
|
||||
# Disable logos.
|
||||
foreach(lang C CXX ASM_MASM RC)
|
||||
set(CMAKE_${lang}_FLAGS_INIT "/nologo")
|
||||
endforeach()
|
||||
foreach(type EXE SHARED MODULE)
|
||||
set(CMAKE_${type}_LINKER_FLAGS_INIT "/nologo")
|
||||
endforeach()
|
||||
|
||||
# Silence Visual Studio CMake integration warnings.
|
||||
set(SILENCE_VS_DEFINITIONS ${CMAKE_TOOLCHAIN_FILE} ${CMAKE_C_COMPILER})
|
||||
set(SILENCE_VS_DEFINITIONS)
|
Reference in New Issue
Block a user