chore(cmake): cmake license header, update a bit
Instead of using set_target_properties on all tool binaries, instead we can use target_compile_features([xxx] PUBLIC cxx_std_20). This properly alienates projects which depend on libeuropa, allowing the src/tools CMakeLists to be trimmed down quite a bit. Also fixes a build break I accidentally introduced.
This commit is contained in:
parent
6228bf77e8
commit
8d607675d0
|
@ -1,3 +1,11 @@
|
||||||
|
#
|
||||||
|
# EuropaTools
|
||||||
|
#
|
||||||
|
# (C) 2021-2022 modeco80 <lily.modeco80@protonmail.ch>
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
#
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 3.10)
|
cmake_minimum_required(VERSION 3.10)
|
||||||
|
|
||||||
# Prohibit in-source tree builds.
|
# Prohibit in-source tree builds.
|
||||||
|
@ -7,7 +15,11 @@ endif()
|
||||||
|
|
||||||
include(cmake/Policies.cmake)
|
include(cmake/Policies.cmake)
|
||||||
|
|
||||||
project(EuropaTools)
|
project(EuropaTools
|
||||||
|
VERSION 0.0.1 # Placeholder for sem-ver usage. Replace with real value later.
|
||||||
|
LANGUAGES C CXX
|
||||||
|
DESCRIPTION "Tools for working with LEC Europa based games (Star Wars: Starfighter & Star Wars: Jedi Starfighter)"
|
||||||
|
)
|
||||||
|
|
||||||
add_subdirectory(third_party/libpixel)
|
add_subdirectory(third_party/libpixel)
|
||||||
add_subdirectory(third_party/indicators)
|
add_subdirectory(third_party/indicators)
|
||||||
|
|
|
@ -1,3 +1,11 @@
|
||||||
|
#
|
||||||
|
# EuropaTools
|
||||||
|
#
|
||||||
|
# (C) 2021-2022 modeco80 <lily.modeco80@protonmail.ch>
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
#
|
||||||
|
|
||||||
# CMake policy configuration
|
# CMake policy configuration
|
||||||
|
|
||||||
# Macro to enable new CMake policy.
|
# Macro to enable new CMake policy.
|
||||||
|
|
|
@ -21,7 +21,7 @@ namespace europa::io {
|
||||||
* Writer for package files.
|
* Writer for package files.
|
||||||
*/
|
*/
|
||||||
struct PakWriter {
|
struct PakWriter {
|
||||||
void Init(structs::PakVersion version);
|
void Init(structs::PakHeader::Version version);
|
||||||
|
|
||||||
std::unordered_map<std::string, PakFile>& GetFiles();
|
std::unordered_map<std::string, PakFile>& GetFiles();
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,10 @@
|
||||||
|
#
|
||||||
|
# EuropaTools
|
||||||
|
#
|
||||||
|
# (C) 2021-2022 modeco80 <lily.modeco80@protonmail.ch>
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
#
|
||||||
|
|
||||||
add_library(libeuropa
|
add_library(libeuropa
|
||||||
# Implementation details
|
# Implementation details
|
||||||
|
@ -15,10 +21,7 @@ add_library(libeuropa
|
||||||
|
|
||||||
target_include_directories(libeuropa PUBLIC ${PROJECT_SOURCE_DIR}/include)
|
target_include_directories(libeuropa PUBLIC ${PROJECT_SOURCE_DIR}/include)
|
||||||
|
|
||||||
set_target_properties(libeuropa PROPERTIES
|
target_compile_features(libeuropa PUBLIC cxx_std_20)
|
||||||
CXX_STANDARD 20
|
|
||||||
CXX_STANDARD_REQUIRED ON
|
|
||||||
)
|
|
||||||
|
|
||||||
# Projects which libeuropa depends on
|
# Projects which libeuropa depends on
|
||||||
target_link_libraries(libeuropa PUBLIC
|
target_link_libraries(libeuropa PUBLIC
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
namespace europa::io {
|
namespace europa::io {
|
||||||
|
|
||||||
void PakWriter::Init(structs::PakVersion version) {
|
void PakWriter::Init(structs::PakHeader::Version version) {
|
||||||
// for now.
|
// for now.
|
||||||
pakHeader.Init(version);
|
pakHeader.Init(version);
|
||||||
}
|
}
|
||||||
|
@ -87,7 +87,7 @@ namespace europa::io {
|
||||||
|
|
||||||
// Version 5 paks seem to have an additional bit of reserved data
|
// Version 5 paks seem to have an additional bit of reserved data
|
||||||
// (which is all zeros.)
|
// (which is all zeros.)
|
||||||
if(pakHeader.version == structs::PakVersion::Ver2) {
|
if(pakHeader.version == structs::PakHeader::Version::Ver5) {
|
||||||
os.seekp(6, std::ostream::cur);
|
os.seekp(6, std::ostream::cur);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,11 @@
|
||||||
|
#
|
||||||
|
# EuropaTools
|
||||||
|
#
|
||||||
|
# (C) 2021-2022 modeco80 <lily.modeco80@protonmail.ch>
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
#
|
||||||
|
|
||||||
add_executable(europa_pack_extractor europa_pack_extractor.cpp)
|
add_executable(europa_pack_extractor europa_pack_extractor.cpp)
|
||||||
|
|
||||||
target_link_libraries(europa_pack_extractor PUBLIC
|
target_link_libraries(europa_pack_extractor PUBLIC
|
||||||
|
@ -5,11 +13,6 @@ target_link_libraries(europa_pack_extractor PUBLIC
|
||||||
indicators::indicators
|
indicators::indicators
|
||||||
)
|
)
|
||||||
|
|
||||||
set_target_properties(europa_pack_extractor PROPERTIES
|
|
||||||
CXX_STANDARD 20
|
|
||||||
CXX_STANDARD_REQUIRED ON
|
|
||||||
)
|
|
||||||
|
|
||||||
add_executable(pakcreate pakcreate.cpp)
|
add_executable(pakcreate pakcreate.cpp)
|
||||||
|
|
||||||
target_link_libraries(pakcreate PUBLIC
|
target_link_libraries(pakcreate PUBLIC
|
||||||
|
@ -17,30 +20,14 @@ target_link_libraries(pakcreate PUBLIC
|
||||||
indicators::indicators
|
indicators::indicators
|
||||||
)
|
)
|
||||||
|
|
||||||
set_target_properties(pakcreate PROPERTIES
|
|
||||||
CXX_STANDARD 20
|
|
||||||
CXX_STANDARD_REQUIRED ON
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
add_executable(texdump texdump.cpp)
|
add_executable(texdump texdump.cpp)
|
||||||
|
|
||||||
target_link_libraries(texdump PUBLIC
|
target_link_libraries(texdump PUBLIC
|
||||||
libeuropa
|
libeuropa
|
||||||
)
|
)
|
||||||
|
|
||||||
set_target_properties(texdump PROPERTIES
|
|
||||||
CXX_STANDARD 20
|
|
||||||
CXX_STANDARD_REQUIRED ON
|
|
||||||
)
|
|
||||||
|
|
||||||
add_executable(paktest paktest.cpp)
|
add_executable(paktest paktest.cpp)
|
||||||
|
|
||||||
target_link_libraries(paktest PUBLIC
|
target_link_libraries(paktest PUBLIC
|
||||||
libeuropa
|
libeuropa
|
||||||
)
|
)
|
||||||
|
|
||||||
set_target_properties(paktest PROPERTIES
|
|
||||||
CXX_STANDARD 20
|
|
||||||
CXX_STANDARD_REQUIRED ON
|
|
||||||
)
|
|
||||||
|
|
|
@ -32,11 +32,11 @@ int main(int argc, char** argv) {
|
||||||
if(argv[3] != nullptr) {
|
if(argv[3] != nullptr) {
|
||||||
if(!strcmp(argv[3], "--jedi")) {
|
if(!strcmp(argv[3], "--jedi")) {
|
||||||
std::cout << "Writing Jedi Starfighter archive\n";
|
std::cout << "Writing Jedi Starfighter archive\n";
|
||||||
writer.Init(structs::PakVersion::Ver2);
|
writer.Init(structs::PakHeader::Version::Ver5);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
std::cout << "Writing Starfighter archive\n";
|
std::cout << "Writing Starfighter archive\n";
|
||||||
writer.Init(structs::PakVersion::Starfighter);
|
writer.Init(structs::PakHeader::Version::Ver4);
|
||||||
}
|
}
|
||||||
|
|
||||||
for(auto& ent : fs::recursive_directory_iterator(argv[1])) {
|
for(auto& ent : fs::recursive_directory_iterator(argv[1])) {
|
||||||
|
|
Loading…
Reference in New Issue