add_compile_options for older cmake versions

This commit is contained in:
Roman Chistokhodov 2018-01-15 02:43:57 +03:00
parent 31c1e121b5
commit c135463774
2 changed files with 13 additions and 2 deletions

View File

@ -54,6 +54,16 @@ if(CMAKE_SIZEOF_VOID_P EQUAL 8)
endif()
endif()
# add_compile_options for older cmake versions
if(${CMAKE_VERSION} VERSION_LESS "3.0.2")
macro(add_compile_options)
set(list_var "${ARGV}")
foreach(arg IN LISTS list_var)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${arg}")
endforeach()
endmacro()
endif()
if(BUILD_CLIENT)
add_subdirectory(cl_dll)
endif()

View File

@ -1,4 +1,4 @@
#
#
# Copyright (c) 2015 Pavlo Lavrenenko
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
@ -28,7 +28,8 @@ set (SVDLL_LIBRARY server)
add_definitions(-DCLIENT_WEAPONS)
if(NOT MSVC)
add_compile_options(-fno-exceptions -Wno-invalid-offsetof) # GCC/Clang flag
add_compile_options(-fno-exceptions) # GCC/Clang flag
add_compile_options(-Wno-invalid-offsetof) # GCC/Clang flag
add_definitions(-D_LINUX) # It seems enough for all non-Win32 systems
add_definitions(-Dstricmp=strcasecmp -Dstrnicmp=strncasecmp -D_snprintf=snprintf -D_vsnprintf=vsnprintf )
else()