mirror of
https://github.com/crioux/turbo-linecount.git
synced 2024-10-27 17:24:01 +00:00
build updates
This commit is contained in:
parent
d1a4df9528
commit
6749faea62
@ -1,20 +1,27 @@
|
||||
cmake_minimum_required(VERSION 3.3.0)
|
||||
project (linecount)
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0)
|
||||
PROJECT (LINECOUNT)
|
||||
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
|
||||
set(CMAKE_C_FLAGS_RELEASE "-O3")
|
||||
IF(MSVC)
|
||||
SET(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "limited configs" FORCE)
|
||||
SET(CMAKE_CXX_FLAGS_RELEASE "/Ox /Ob2")
|
||||
SET(CMAKE_C_FLAGS_RELEASE "/Ox /Ob2")
|
||||
ELSE()
|
||||
SET(CMAKE_CXX_FLAGS_RELEASE "/O3")
|
||||
SET(CMAKE_C_FLAGS_RELEASE "-O3")
|
||||
SET(CMAKE_EXE_LINKER_FLAGS "-s")
|
||||
ENDIF()
|
||||
|
||||
add_library (linecount SHARED linecount.cpp linecount.h)
|
||||
add_library (linecount_static STATIC linecount.cpp linecount.h)
|
||||
add_executable (lc main.cpp)
|
||||
target_link_libraries (lc linecount_static)
|
||||
ADD_LIBRARY (linecount SHARED linecount.cpp linecount.h)
|
||||
ADD_LIBRARY (linecount_static STATIC linecount.cpp linecount.h)
|
||||
ADD_EXECUTABLE (lc main.cpp)
|
||||
TARGET_LINK_LIBRARIES (lc linecount_static)
|
||||
|
||||
install(TARGETS lc
|
||||
INSTALL(TARGETS lc
|
||||
DESTINATION "bin"
|
||||
)
|
||||
install(TARGETS linecount linecount_static
|
||||
INSTALL(TARGETS linecount linecount_static
|
||||
DESTINATION "lib"
|
||||
)
|
||||
install(FILES linecount.h
|
||||
INSTALL(FILES linecount.h
|
||||
DESTINATION "include"
|
||||
)
|
||||
|
@ -1,4 +1,8 @@
|
||||
#include"linecount.h"
|
||||
#include<algorithm>
|
||||
#ifdef min
|
||||
#undef min
|
||||
#endif
|
||||
|
||||
///////////////////////////// Platform specific
|
||||
#ifdef _WIN32
|
||||
@ -8,7 +12,7 @@
|
||||
#define LCCLOSEFILE(handle) CloseHandle(handle)
|
||||
#define LCINVALIDHANDLE INVALID_HANDLE_VALUE
|
||||
#define LCSETREALLASTERROR(err, errstr) { setLastError((err), (errstr)); }
|
||||
#define MAP_FAILED NULL;
|
||||
#define MAP_FAILED NULL
|
||||
typedef long long LCFILEOFFSET;
|
||||
|
||||
#elif defined (__unix__) || (defined (__APPLE__) && defined (__MACH__))
|
||||
|
Loading…
Reference in New Issue
Block a user