Skip to content

Commit c017fe5

Browse files
committed
use UNICODE and update the version number
1 parent 9283818 commit c017fe5

File tree

8 files changed

+20
-20
lines changed

8 files changed

+20
-20
lines changed

.gitlab-ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ build_win32_ue4:
114114
- 'if exist output rmdir /s /q output'
115115
- 'mkdir build'
116116
- 'cd build'
117-
- 'cmake -DLIBGLTF_BUILD_FOR_UE4=True -G "Visual Studio 14 2015" ../'
117+
- 'cmake -G "Visual Studio 14 2015" ../'
118118
- 'msbuild ./source/libgltf/libgltf.vcxproj /t:Rebuild /p:Configuration="Release" /p:Platform="Win32"'
119119
- 'cd ../'
120120
artifacts:
@@ -138,7 +138,7 @@ build_win64_ue4:
138138
- 'if exist output rmdir /s /q output'
139139
- 'mkdir build'
140140
- 'cd build'
141-
- 'cmake -DLIBGLTF_BUILD_FOR_UE4=True -G "Visual Studio 14 2015 Win64" ../'
141+
- 'cmake -G "Visual Studio 14 2015 Win64" ../'
142142
- 'msbuild ./source/libgltf/libgltf.vcxproj /t:Rebuild /p:Configuration="Release" /p:Platform="x64"'
143143
- 'cd ../'
144144
artifacts:
@@ -159,7 +159,7 @@ build_linux_ue4:
159159
script:
160160
- 'mkdir build'
161161
- 'cd build'
162-
- 'cmake -DLIBGLTF_BUILD_FOR_UE4=True -G "Unix Makefiles" ../'
162+
- 'cmake -G "Unix Makefiles" ../'
163163
- 'make libgltf'
164164
- 'cd ../'
165165
artifacts:
@@ -180,7 +180,7 @@ build_macos_ue4:
180180
script:
181181
- 'mkdir build'
182182
- 'cd build'
183-
- 'cmake -DLIBGLTF_BUILD_FOR_UE4=True -G "Unix Makefiles" ../'
183+
- 'cmake -G "Unix Makefiles" ../'
184184
- 'make libgltf'
185185
- 'cd ../'
186186
artifacts:

CMakeLists.txt

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,12 @@ set(LIBGLTF_PLATFORM_LINUX FALSE)
1414
set(LIBGLTF_PLATFORM_MACOS FALSE)
1515

1616
option(LIBGLTF_COVERAGE_GCOV "Coverage gcov (debug, Linux builds only)" OFF)
17-
option(LIBGLTF_BUILD_FOR_UE4 "Build for UE4" OFF)
18-
19-
if(LIBGLTF_BUILD_FOR_UE4)
20-
add_definitions(-DLIBGLTF_USE_WCHAR)
21-
endif()
2217

2318
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
2419
set(LIBGLTF_PLATFORM_WINDOWS TRUE)
2520
add_definitions(-DLIBGLTF_PLATFORM_WINDOWS)
2621
set(DYNAMIC_LIBRARY_EXTENSION ".dll")
2722
set(STATIC_LIBRARY_EXTENSION ".lib")
28-
if(LIBGLTF_BUILD_FOR_UE4)
29-
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MD")
30-
endif()
3123
if((CMAKE_EXE_LINKER_FLAGS STREQUAL "/machine:X86") OR (CMAKE_EXE_LINKER_FLAGS STREQUAL " /machine:X86"))
3224
set(TARGET_ARCHITECTURES_X86 TRUE)
3325
set(PLATFORM_NAME "win32")

docs/usage.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,12 @@ Generate the `makefile` or `vs project` by [CMake].
44

55
For now, just build to a static library - `libgltf.(lib/a/dylib)`.
66

7+
## Advance
8+
9+
> You can update the c++11 source code by `jsonschematoc11`.
10+
11+
Generate the c++11 code:
12+
13+
1. Run `tools/batch/update_parser_by_scheme.bat` or `tools/batch/update_parser_by_scheme.sh`
14+
715
[CMake]: https://cmake.org

include/libgltf/libgltf.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88

99
#define LIBGLTF_MAJOR_VERSION 0
1010
#define LIBGLTF_MINOR_VERSION 1
11-
#define LIBGLTF_PATCH_VERSION 0
11+
#define LIBGLTF_PATCH_VERSION 1
1212

13-
#if defined(LIBGLTF_USE_WCHAR)
13+
#if defined(UNICODE)
1414
typedef std::wstring GLTFString;
1515
#else
1616
typedef std::string GLTFString;

source/libgltf/libgltfpch.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
#include <rapidjson/stringbuffer.h>
55
#include <rapidjson/writer.h>
66

7-
#if defined(LIBGLTF_USE_WCHAR)
7+
#if defined(UNICODE)
88
# define GLTFTEXT(t) L##t
99
#else
1010
# define GLTFTEXT(t) t
1111
#endif
1212

1313
namespace libgltf
1414
{
15-
#if defined(LIBGLTF_USE_WCHAR)
15+
#if defined(UNICODE)
1616
typedef rapidjson::UTF16<> GLTFCharType;
1717
#else
1818
typedef rapidjson::UTF8<> GLTFCharType;

source/runtest/runtest.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ int main(int _iArgc, char* _pcArgv[])
3838
return error_code;
3939
}
4040

41-
#if defined(LIBGLTF_USE_WCHAR)
41+
#if defined(UNICODE)
4242
std::wstringstream input_content;
4343
{
4444
std::wifstream input_file(input_file_path.c_str(), std::ios::in | std::ios::binary);
@@ -69,7 +69,7 @@ int main(int _iArgc, char* _pcArgv[])
6969
return error_code;
7070
}
7171

72-
#if defined(LIBGLTF_USE_WCHAR)
72+
#if defined(UNICODE)
7373
std::wstring output_content;
7474
#else
7575
std::string output_content;

tools/batch/glTF_2.0_schema.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ extensions_schema_directories=
66
%(CD)s/../../external/glTF/extensions/2.0/Khronos/KHR_materials_pbrSpecularGlossiness/schema
77
major_version=0
88
minor_version=1
9-
patch_version=0
9+
patch_version=1
1010

1111
[code.headers]
1212
extension.schema.json=%(CD)s/codes/extension.schema.json.h

tools/jsonschematoc11/jsonschematoc11.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ def generate(self, codeFileName, outputHeaderPath=None, outputSourcePath=None, n
148148
if code_version_parser_line:
149149
header_file.write(u'\n')
150150

151-
header_file.write(u'#if defined(LIBGLTF_USE_WCHAR)\n')
151+
header_file.write(u'#if defined(UNICODE)\n')
152152
header_file.write(u'%s%s\n' % (begin_space, u'typedef std::wstring GLTFString;'))
153153
header_file.write(u'#else\n')
154154
header_file.write(u'%s%s\n' % (begin_space, u'typedef std::string GLTFString;'))

0 commit comments

Comments
 (0)