Edit

kc3-lang/libevent/cmake/AddCompilerFlags.cmake

Branch :

  • Show log

    Commit

  • Author : Azat Khuzhin
    Date : 2016-03-10 00:33:04
    Hash : 36588e16
    Message : cmake: fix adding of compiler flags, and now it will - add_compiler_flags() must accept array IOW just ARGN will be enoough - add_compiler_flags() called with variable name instead of it's value P.S. and fix some alignments issues P.P.S. more cmake issues expected since now CFLAGS actually works P.P.P.S. some issues with cmake cache is possible, so just reset it

  • cmake/AddCompilerFlags.cmake
  • include(CheckCCompilerFlag)
    
    macro(add_compiler_flags)
    	foreach(flag ${ARGN})
    		string(REGEX REPLACE "[-.+/:= ]" "_" _flag_esc "${flag}")
    
    		check_c_compiler_flag("${flag}" check_c_compiler_flag_${_flag_esc})
    
    		if (check_c_compiler_flag_${_flag_esc})
    			set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${flag}")
    		endif()
    	endforeach()
    endmacro()