Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
106 changes: 73 additions & 33 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
cmake_minimum_required(VERSION 3.10)

cmake_policy(SET CMP0091 NEW)
project(SpineSkeletonDataConverter)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

if (CMAKE_CXX_COMPILER_ID MATCHES "Clang|GNU")
add_compile_options(-fvisibility=hidden -fvisibility-inlines-hidden)
endif()

# Add spine-c/spine-cpp for syntax prompting. These won't be linked to the final executable.
# Comment out if you don't need syntax prompting.

Expand Down Expand Up @@ -32,40 +38,43 @@ add_spine_cpp(40)
add_spine_cpp(41)
add_spine_cpp(42)

set(CONVERTER_SRCS
"include/json.hpp"
"src/main.cpp"
"src/common.cpp"
"src/CurveConverter.cpp"
"src/OrderConverter.cpp"
"src/SkeletonData35BinaryReader.cpp"
"src/SkeletonData35BinaryWriter.cpp"
"src/SkeletonData35JsonReader.cpp"
"src/SkeletonData35JsonWriter.cpp"
"src/SkeletonData36BinaryReader.cpp"
"src/SkeletonData36BinaryWriter.cpp"
"src/SkeletonData36JsonReader.cpp"
"src/SkeletonData36JsonWriter.cpp"
"src/SkeletonData37BinaryReader.cpp"
"src/SkeletonData37BinaryWriter.cpp"
"src/SkeletonData37JsonReader.cpp"
"src/SkeletonData37JsonWriter.cpp"
"src/SkeletonData38BinaryReader.cpp"
"src/SkeletonData38BinaryWriter.cpp"
"src/SkeletonData38JsonReader.cpp"
"src/SkeletonData38JsonWriter.cpp"
"src/SkeletonData40BinaryReader.cpp"
"src/SkeletonData40BinaryWriter.cpp"
"src/SkeletonData40JsonReader.cpp"
"src/SkeletonData40JsonWriter.cpp"
"src/SkeletonData41BinaryReader.cpp"
"src/SkeletonData41BinaryWriter.cpp"
"src/SkeletonData41JsonReader.cpp"
"src/SkeletonData41JsonWriter.cpp"
"src/SkeletonData42BinaryReader.cpp"
"src/SkeletonData42BinaryWriter.cpp"
"src/SkeletonData42JsonReader.cpp"
"src/SkeletonData42JsonWriter.cpp")

add_executable(SpineSkeletonDataConverter
"include/json.hpp"
"src/main.cpp"
"src/common.cpp"
"src/CurveConverter.cpp"
"src/OrderConverter.cpp"
"src/SkeletonData35BinaryReader.cpp"
"src/SkeletonData35BinaryWriter.cpp"
"src/SkeletonData35JsonReader.cpp"
"src/SkeletonData35JsonWriter.cpp"
"src/SkeletonData36BinaryReader.cpp"
"src/SkeletonData36BinaryWriter.cpp"
"src/SkeletonData36JsonReader.cpp"
"src/SkeletonData36JsonWriter.cpp"
"src/SkeletonData37BinaryReader.cpp"
"src/SkeletonData37BinaryWriter.cpp"
"src/SkeletonData37JsonReader.cpp"
"src/SkeletonData37JsonWriter.cpp"
"src/SkeletonData38BinaryReader.cpp"
"src/SkeletonData38BinaryWriter.cpp"
"src/SkeletonData38JsonReader.cpp"
"src/SkeletonData38JsonWriter.cpp"
"src/SkeletonData40BinaryReader.cpp"
"src/SkeletonData40BinaryWriter.cpp"
"src/SkeletonData40JsonReader.cpp"
"src/SkeletonData40JsonWriter.cpp"
"src/SkeletonData41BinaryReader.cpp"
"src/SkeletonData41BinaryWriter.cpp"
"src/SkeletonData41JsonReader.cpp"
"src/SkeletonData41JsonWriter.cpp"
"src/SkeletonData42BinaryReader.cpp"
"src/SkeletonData42BinaryWriter.cpp"
"src/SkeletonData42JsonReader.cpp"
"src/SkeletonData42JsonWriter.cpp"
${CONVERTER_SRCS}
)

target_include_directories(SpineSkeletonDataConverter PRIVATE "include")
Expand All @@ -75,3 +84,34 @@ add_executable(SpineAtlasDowngrade
)

target_include_directories(SpineAtlasDowngrade PRIVATE "include")

add_library(SpineSkeletonDataConverterLib SHARED
${CONVERTER_SRCS}
)

target_include_directories(SpineSkeletonDataConverterLib PRIVATE "include")


target_include_directories(SpineSkeletonDataConverterLib PRIVATE "include")

if (MSVC)
# 切到静态运行库(/MT|/MTd)
set_property(TARGET SpineSkeletonDataConverterLib PROPERTY
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>"
)

# 可选:确保编译/链接特性
#target_compile_definitions(SpineSkeletonDataConverterLib
# PRIVATE $<$<CONFIG:Debug>:DEBUG> $<$<CONFIG:Release>:NDEBUG>)
endif ()

if (MINGW)
# target_link_options(SpineSkeletonDataConverterLib PRIVATE
# -Wl,-Bstatic -lwinpthread
# )

# target_link_options(SpineSkeletonDataConverterLib PRIVATE
# -static-libstdc++
# -static-libgcc
# )
endif ()
2 changes: 1 addition & 1 deletion include/json.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2405,7 +2405,7 @@ JSON_HEDLEY_DIAGNOSTIC_POP
#define JSON_HAS_CPP_17
#define JSON_HAS_CPP_14
#elif (defined(__cplusplus) && __cplusplus > 201703L) || (defined(_MSVC_LANG) && _MSVC_LANG > 201703L)
#define JSON_HAS_CPP_20
//#define JSON_HAS_CPP_20
#define JSON_HAS_CPP_17
#define JSON_HAS_CPP_14
#elif (defined(__cplusplus) && __cplusplus > 201402L) || (defined(_HAS_CXX17) && _HAS_CXX17 == 1) // fix for issue #464
Expand Down
1 change: 1 addition & 0 deletions src/common.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "SkeletonData.h"
#include <sstream>

// json reader

Expand Down
Loading