mirror of
https://github.com/crioux/turbo-linecount.git
synced 2026-03-02 03:40:07 +00:00
add optimization flags, make install, and switch test to lc in path
This commit is contained in:
@@ -1,7 +1,20 @@
|
|||||||
cmake_minimum_required(VERSION 3.3.0)
|
cmake_minimum_required(VERSION 3.3.0)
|
||||||
project (linecount)
|
project (linecount)
|
||||||
|
|
||||||
|
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
|
||||||
|
set(CMAKE_C_FLAGS_RELEASE "-O3")
|
||||||
|
|
||||||
add_library (linecount SHARED linecount.cpp linecount.h)
|
add_library (linecount SHARED linecount.cpp linecount.h)
|
||||||
add_library (linecount_static STATIC linecount.cpp linecount.h)
|
add_library (linecount_static STATIC linecount.cpp linecount.h)
|
||||||
add_executable (lc main.cpp)
|
add_executable (lc main.cpp)
|
||||||
target_link_libraries (lc linecount_static)
|
target_link_libraries (lc linecount_static)
|
||||||
|
|
||||||
|
install(TARGETS lc
|
||||||
|
DESTINATION "bin"
|
||||||
|
)
|
||||||
|
install(TARGETS linecount linecount_static
|
||||||
|
DESTINATION "lib"
|
||||||
|
)
|
||||||
|
install(FILES linecount.h
|
||||||
|
DESTINATION "include"
|
||||||
|
)
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
lctest()
|
lctest()
|
||||||
{
|
{
|
||||||
OUT=`(time ./lc $1) 2>&1 | grep real | cut -f 2 | cut -c 3-`
|
OUT=`(time lc $1) 2>&1 | grep real | cut -f 2 | cut -c 3-`
|
||||||
echo "lc: $1 $OUT"
|
echo "lc: $1 $OUT"
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user