Skip to content

Commit

Permalink
First open version
Browse files Browse the repository at this point in the history
  • Loading branch information
nxyd committed Jun 9, 2020
1 parent 7699699 commit 251697a
Show file tree
Hide file tree
Showing 17 changed files with 2,203 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"configurations": [
{
"name": "Win32",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"compilerPath": "C:\\Toolchains\\mingw32\bin\\gcc.exe",
"cStandard": "c11",
"cppStandard": "c++17",
"intelliSenseMode": "gcc-x64"
}
],
"version": 4
}
49 changes: 49 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
cmake_minimum_required(VERSION 3.13.0)
project(udslin)

# Specify build paths
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)

set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
set(CMAKE_INCLUDE_CURRENT_DIR ON)

option(COLOR_OUTPUT "Use color ouput in terminal" ON)

if(COLOR_OUTPUT)
add_definitions(-DCOLOR_OUTPUT=1)
endif(COLOR_OUTPUT)

# Add a _d to debug binaries
set(CMAKE_DEBUG_POSTFIX "_d")

set(SRC_FILES
src/LinDrv.cpp
src/LinTp.cpp
src/LUDS.cpp
)

set(HEADER_FILES
src/RingBuffer.h
src/LinDrv.h
src/LinTp.h
src/LUDS.h
)

if(MSVC)
set(SRC_FILES ${SRC_FILES} UDSLIN.def)
endif()

if(MINGW)
set(CMAKE_CXX_FLAGS "-std=c++11")
add_definitions(-DUSE_UDSLIN_EXPORTS)
endif()

add_library(${PROJECT_NAME} SHARED
${SRC_FILES}
${HEADER_FILES}
resources/winres.rc
)

target_link_libraries(${PROJECT_NAME} Winmm)
9 changes: 9 additions & 0 deletions build/01.VS2017/cmake_vs2017.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
@echo off
cd %~dp0

set OUT_DIR="./VS2017_Prj"
if not exist %OUT_DIR% (
md %OUT_DIR%
)
cd %OUT_DIR%
cmake ..\..\.. -G"Visual Studio 15 2017"
7 changes: 7 additions & 0 deletions build/02.MinGW/build_debug.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@echo off
cd %~dp0

::set PATH=C:\MinGW\i686-8.1.0-release-posix-dwarf-rt_v6-rev0\mingw32\bin

cd .\Debug
mingw32-make
7 changes: 7 additions & 0 deletions build/02.MinGW/build_release.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@echo off
cd %~dp0

::set PATH=C:\MinGW\i686-8.1.0-release-posix-dwarf-rt_v6-rev0\mingw32\bin

cd .\Release
mingw32-make
11 changes: 11 additions & 0 deletions build/02.MinGW/cmake_debug.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
@echo off
cd %~dp0

::set PATH=C:\Program Files\CMake\bin;C:\MinGW\i686-8.1.0-release-posix-dwarf-rt_v6-rev0\mingw32\bin

set OUT_DIR=".\Debug"
if not exist %OUT_DIR% (
md %OUT_DIR%
)
cd %OUT_DIR%
cmake ..\..\.. -G"MinGW Makefiles" -DCMAKE_BUILD_TYPE=Debug
11 changes: 11 additions & 0 deletions build/02.MinGW/cmake_release.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
@echo off
cd %~dp0

::set PATH=C:\Program Files\CMake\bin;C:\MinGW\i686-8.1.0-release-posix-dwarf-rt_v6-rev0\mingw32\bin

set OUT_DIR=.\Release
if not exist %OUT_DIR% (
md %OUT_DIR%
)
cd %OUT_DIR%
cmake ..\..\.. -G"MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release
44 changes: 44 additions & 0 deletions resources/winres.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#include <windows.h>

#define VER_FILEVERSION 0,3,1,0
#define VER_FILEVERSION_STR "0.3.1.0\0"

#define VER_PRODUCTVERSION 0,3,1,0
#define VER_PRODUCTVERSION_STR "0.3.1.0\0"

#define VER_COMPANYNAME_STR "Shawn Xiao\0"
#define VER_FILEDESCRIPTION_STR "UDS protocol stack on LIN\0"
#define VER_INTERNALNAME_STR "libudslin\0"
#define VER_LEGALCOPYRIGHT_STR "Copyright (C) 2020 Shawn Xiao, [email protected].\0"
#define VER_ORIGINALFILENAME_STR "libudslin\0"
#define VER_PRODUCTNAME_STR "libudslin\0"

VS_VERSION_INFO VERSIONINFO
FILEVERSION VER_FILEVERSION
PRODUCTVERSION VER_PRODUCTVERSION
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
FILEFLAGS 0
FILEOS VOS__WINDOWS32
FILETYPE VFT_DLL
FILESUBTYPE VFT2_UNKNOWN
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904B0"
BEGIN
VALUE "CompanyName", VER_COMPANYNAME_STR
VALUE "FileDescription", VER_FILEDESCRIPTION_STR
VALUE "FileVersion", VER_FILEVERSION_STR
VALUE "InternalName", VER_INTERNALNAME_STR
VALUE "LegalCopyright", VER_LEGALCOPYRIGHT_STR
VALUE "OriginalFilename", VER_ORIGINALFILENAME_STR
VALUE "ProductName", VER_PRODUCTNAME_STR
VALUE "ProductVersion", VER_PRODUCTVERSION_STR
END
END

BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x0409, 1200
END
END
Loading

0 comments on commit 251697a

Please sign in to comment.