Skip to content

Instantly share code, notes, and snippets.

View aggresss's full-sized avatar
♾️
kata

Jagger Yu aggresss

♾️
kata
View GitHub Profile
@aggresss
aggresss / CMakeLists.txt
Last active February 11, 2019 10:35
返回工具链的前缀
# reference: https://cmake.org/cmake/help/latest/command/string.html
cmake_minimum_required (VERSION 2.8)
# Returns the compiler prefix
function(compiler_prefix input_string output_string)
string(REGEX MATCH "[^/]+$" compiler_basename ${input_string})
string(REGEX MATCH "[^-]+$" compiler_id ${compiler_basename})
if(NOT ${compiler_basename} STREQUAL ${compiler_id})
string(REPLACE "-${compiler_id}" "" compiler_host ${compiler_basename})
endif()
package main
import (
"fmt"
"time"
)
func main() {
c := make(chan int)
go send(c)