Skip to content

Commit 3f69282

Browse files
committed
embed toolset
1 parent f681d34 commit 3f69282

File tree

16 files changed

+79
-59
lines changed

16 files changed

+79
-59
lines changed

.github/workflows/build.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
shell: bash
3535

3636
steps:
37-
- uses: actions/checkout@v2
37+
- uses: actions/checkout@v3
3838
with:
3939
submodules: recursive
4040
fetch-depth: 0
@@ -63,7 +63,7 @@ jobs:
6363
6464
- name: Upload Artifacts
6565
if: ${{matrix.artifacts == true}}
66-
uses: actions/upload-artifact@v2
66+
uses: actions/upload-artifact@v3
6767
with:
6868
name: XenobladeToolset-linux-amd64
6969
path: ${{github.workspace}}/XenobladeToolset-v${{env.SK_VERSION}}-linux-amd64.tar.xz
@@ -72,7 +72,7 @@ jobs:
7272
build-widle:
7373
runs-on: windows-2022
7474
steps:
75-
- uses: actions/checkout@v2
75+
- uses: actions/checkout@v3
7676
with:
7777
submodules: recursive
7878
fetch-depth: 0
@@ -98,7 +98,7 @@ jobs:
9898
copy toolset/README.md bin/README.md
9999
100100
- name: Upload Artifacts
101-
uses: actions/upload-artifact@v2
101+
uses: actions/upload-artifact@v3
102102
with:
103103
name: XenobladeToolset-v${{env.SK_VERSION}}-win64
104104
path: ${{github.workspace}}/bin

CMakeLists.txt

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,18 @@ option(ODR_TEST "Enable ODR testing." OFF)
1919
option(OBJECTS_PID "Imply PID for all objects." OFF)
2020
option(XN_STATIC_LIB "Builds xeno-static target." OFF)
2121

22-
option(NO_OBJECTS "" OFF)
2322
option(CLI "" ${TOOLSET})
2423
option(GLTF "" ${TOOLSET})
25-
option(BUILD_SHARED_LIBS "" ${TOOLSET})
24+
if(TOOLSET)
25+
set(EXPOSE_SYMBOLS spike;gltf;xeno)
26+
endif()
27+
28+
set(TPD_PATH ${CMAKE_CURRENT_SOURCE_DIR}/3rd_party)
29+
add_subdirectory(${TPD_PATH}/spike)
2630

2731
set(CMAKE_CXX_STANDARD 20)
2832
add_compile_options(-Wall -Wextra)
2933

30-
set(TPD_PATH ${CMAKE_CURRENT_SOURCE_DIR}/3rd_party)
31-
add_subdirectory(${TPD_PATH}/spike)
32-
include(targetex)
3334
add_subdirectory(source)
3435

3536
if(TOOLSET)

source/CMakeLists.txt

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ set(CORE_SOURCE_FILES
1212
${TPD_PATH}/zstd/lib/decompress/huf_decompress_amd64.S
1313
)
1414

15+
add_library(xeno-interface INTERFACE)
16+
target_include_directories(xeno-interface INTERFACE ../include)
17+
target_link_libraries(xeno-interface INTERFACE spike-interface)
18+
19+
include(targetex)
20+
1521
if((NOT NO_OBJECTS) OR XN_STATIC_LIB)
1622
build_target(
1723
NAME
@@ -20,19 +26,28 @@ if((NOT NO_OBJECTS) OR XN_STATIC_LIB)
2026
OBJECT
2127
SOURCES
2228
${CORE_SOURCE_FILES}
29+
INCLUDES
30+
.
31+
${TPD_PATH}/zlib
32+
${TPD_PATH}/zstd/lib/common
33+
${TPD_PATH}/zstd/lib
2334
LINKS
24-
spike-objects
35+
spike-interface
36+
xeno-interface
2537
NO_VERINFO
2638
NO_PROJECT_H)
2739

2840
set_target_properties(xeno-objects PROPERTIES POSITION_INDEPENDENT_CODE
2941
${OBJECTS_PID})
3042
target_compile_options(xeno-objects PRIVATE -fvisibility=hidden)
43+
target_compile_definitions(
44+
xeno-objects PRIVATE
45+
ZSTDLIB_VISIBLE=__attribute__\(\(visibility\(\"hidden\"\)\)\)
46+
ZSTDLIB_HIDDEN=__attribute__\(\(visibility\(\"hidden\"\)\)\)
47+
ZSTDERRORLIB_VISIBILITY=__attribute__\(\(visibility\(\"hidden\"\)\)\)
48+
)
3149

32-
target_include_directories(
33-
xeno-objects
34-
PUBLIC ../include
35-
PRIVATE . ${TPD_PATH}/zlib ${TPD_PATH}/zstd/lib/common ${TPD_PATH}/zstd/lib)
50+
target_expose_defs(xeno XN_EXPORT XN_IMPORT)
3651
endif()
3752

3853
if(XN_STATIC_LIB)
@@ -58,22 +73,23 @@ if(BUILD_SHARED_LIBS)
5873
SHARED
5974
SOURCES
6075
${CORE_SOURCE_FILES}
76+
INCLUDES
77+
.
78+
${TPD_PATH}/zlib
79+
${TPD_PATH}/zstd/lib/common
80+
${TPD_PATH}/zstd/lib
6181
LINKS
6282
spike
83+
xeno-interface
6384
START_YEAR
6485
2017
6586
AUTHOR
6687
"Lukas Cone"
6788
NO_PROJECT_H)
6889

69-
target_include_directories(
70-
xeno
71-
PUBLIC ../include
72-
PRIVATE . ${TPD_PATH}/zlib ${TPD_PATH}/zstd/lib/common ${TPD_PATH}/zstd/lib)
73-
7490
target_compile_definitions(
7591
xeno
76-
PRIVATE XN_EXPORT REF_EXPORT
92+
PRIVATE XN_EXPORT
7793
INTERFACE XN_IMPORT)
7894

7995
if(WIN32 OR MINGW)

toolset/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
cmake_minimum_required(VERSION 3.13)
12
project(XenobladeToolset)
23
set_target_properties(spike_cli PROPERTIES OUTPUT_NAME xenoblade_toolset)
4+
target_link_libraries(spike_cli xeno-objects)
35

46
include(version)
57
toolset_version()
@@ -15,6 +17,6 @@ add_spike_subdir(asm)
1517
add_spike_subdir(map)
1618
add_spike_subdir(font)
1719

18-
if(NOT RELEASEVER)
20+
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
1921
add_spike_subdir(dev)
2022
endif()

toolset/arh/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ build_target(
1010
SOURCES
1111
extract_arh.cpp
1212
LINKS
13-
xeno
13+
xeno-interface
1414
AUTHOR
1515
"Lukas Cone"
1616
DESCR

toolset/asm/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ build_target(
1212
INCLUDES
1313
${TPD_PATH}/spike/3rd_party/json
1414
LINKS
15-
xeno
15+
xeno-interface
1616
AUTHOR
1717
"Lukas Cone"
1818
DESCR

toolset/bdat/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ build_target(
1212
INCLUDES
1313
${TPD_PATH}/spike/3rd_party/json
1414
LINKS
15-
xeno
15+
xeno-interface
1616
AUTHOR
1717
"Lukas Cone"
1818
DESCR

toolset/dev/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ build_target(
1010
SOURCES
1111
decrypt_bdat.cpp
1212
LINKS
13-
xeno
13+
xeno-interface
1414
AUTHOR
1515
"Lukas Cone"
1616
DESCR
@@ -30,7 +30,7 @@ build_target(
3030
SOURCES
3131
decrypt_arh.cpp
3232
LINKS
33-
xeno
33+
xeno-interface
3434
AUTHOR
3535
"Lukas Cone"
3636
DESCR

toolset/font/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ build_target(
1313
../common
1414
${TPD_PATH}/spike/3rd_party/json
1515
LINKS
16-
xeno
16+
xeno-interface
1717
AUTHOR
1818
"Lukas Cone"
1919
DESCR

toolset/map/CMakeLists.txt

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ build_target(
1212
INCLUDES
1313
../common
1414
LINKS
15-
xeno
15+
xeno-interface
1616
AUTHOR
1717
"Lukas Cone"
1818
DESCR
@@ -34,34 +34,34 @@ build_target(
3434
INCLUDES
3535
../common
3636
LINKS
37-
xeno
38-
gltf
37+
xeno-interface
38+
gltf-interface
3939
AUTHOR
4040
"Lukas Cone"
4141
DESCR
4242
"Xenoblade Instanced Model to GLTF"
4343
START_YEAR
4444
2022)
4545

46-
project(TM2GLTF)
46+
project(TM2GLTF)
4747

48-
build_target(
49-
NAME
50-
tm_to_gltf
51-
TYPE
52-
ESMODULE
53-
VERSION
54-
1
55-
SOURCES
56-
tm_to_gltf.cpp
57-
INCLUDES
58-
../common
59-
LINKS
60-
xeno
61-
gltf
62-
AUTHOR
63-
"Lukas Cone"
64-
DESCR
65-
"Xenoblade Terrain Model to GLTF"
66-
START_YEAR
67-
2022)
48+
build_target(
49+
NAME
50+
tm_to_gltf
51+
TYPE
52+
ESMODULE
53+
VERSION
54+
1
55+
SOURCES
56+
tm_to_gltf.cpp
57+
INCLUDES
58+
../common
59+
LINKS
60+
xeno-interface
61+
gltf-interface
62+
AUTHOR
63+
"Lukas Cone"
64+
DESCR
65+
"Xenoblade Terrain Model to GLTF"
66+
START_YEAR
67+
2022)

toolset/mdo/CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@ build_target(
1111
mdo_to_gltf.cpp
1212
INCLUDES
1313
../common
14+
${TPD_PATH}/3rd_party/json
1415
LINKS
15-
xeno
16-
gltf
16+
xeno-interface
17+
gltf-interface
1718
AUTHOR
1819
"Lukas Cone"
1920
DESCR

toolset/sar/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ build_target(
1010
SOURCES
1111
sar_extract.cpp
1212
LINKS
13-
xeno
13+
xeno-interface
1414
AUTHOR
1515
"Lukas Cone"
1616
DESCR
@@ -30,7 +30,7 @@ build_target(
3030
SOURCES
3131
make_sar.cpp
3232
LINKS
33-
xeno
33+
xeno-interface
3434
AUTHOR
3535
"Lukas Cone"
3636
DESCR

toolset/shader/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ build_target(
1212
SOURCES
1313
extract_shaders.cpp
1414
LINKS
15-
xeno
15+
xeno-interface
1616
decaf
1717
AUTHOR
1818
"Lukas Cone"

toolset/smt/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ build_target(
1212
INCLUDES
1313
../common
1414
LINKS
15-
xeno
15+
xeno-interface
1616
AUTHOR
1717
"Lukas Cone"
1818
DESCR

toolset/tex/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ build_target(
1212
INCLUDES
1313
../common
1414
LINKS
15-
xeno
15+
xeno-interface
1616
AUTHOR
1717
"Lukas Cone"
1818
DESCR

0 commit comments

Comments
 (0)