Merge pull request #311431 from pluiedev/zhf-24.05/toml.lua

This commit is contained in:
Franz Pletz 2024-05-13 23:27:52 +02:00 committed by GitHub
commit 9476056806
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 28 additions and 17 deletions

View File

@ -709,9 +709,11 @@ in
propagatedBuildInputs = oa.propagatedBuildInputs ++ [ sol2 ]; propagatedBuildInputs = oa.propagatedBuildInputs ++ [ sol2 ];
postPatch = '' postPatch = ''
substituteInPlace CMakeLists.txt --replace-fail \ substituteInPlace CMakeLists.txt \
"TOML_PLUS_PLUS_SRC" \ --replace-fail "TOML_PLUS_PLUS_SRC" "${tomlplusplus.src}/include/toml++" \
"${tomlplusplus.src}" --replace-fail "MAGIC_ENUM_SRC" "${magic-enum.src}/include/magic_enum"
cat CMakeLists.txt
''; '';
}); });

View File

@ -1,16 +1,16 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt
index faae37a..6990d4a 100644 index ab3884c..c0fd356 100644
--- a/CMakeLists.txt --- a/CMakeLists.txt
+++ b/CMakeLists.txt +++ b/CMakeLists.txt
@@ -38,26 +38,17 @@ include(FetchContent) @@ -38,32 +38,23 @@ include(FetchContent)
FetchContent_Declare( FetchContent_Declare(
${TOML++} ${TOML++}
- GIT_REPOSITORY "https://github.com/marzer/tomlplusplus.git" - GIT_REPOSITORY "https://github.com/marzer/tomlplusplus.git"
- GIT_SHALLOW ON - GIT_SHALLOW ON
- GIT_SUBMODULES "" - GIT_SUBMODULES ""
- GIT_TAG "v3.4.0" - GIT_TAG "v3.3.0"
+ DOWNLOAD_COMMAND true + DOWNLOAD_COMMAND true
) )
FetchContent_Declare( FetchContent_Declare(
@ -19,7 +19,7 @@ index faae37a..6990d4a 100644
- GIT_SHALLOW ON - GIT_SHALLOW ON
- GIT_SUBMODULES "" - GIT_SUBMODULES ""
- GIT_TAG "v3.3.0" - GIT_TAG "v3.3.0"
+ DOWNLOAD_COMMAND true + DOWNLOAD_COMMAND true
) )
FetchContent_Declare( FetchContent_Declare(
@ -27,26 +27,35 @@ index faae37a..6990d4a 100644
- GIT_REPOSITORY "https://github.com/Neargye/magic_enum.git" - GIT_REPOSITORY "https://github.com/Neargye/magic_enum.git"
- GIT_SHALLOW ON - GIT_SHALLOW ON
- GIT_SUBMODULES "" - GIT_SUBMODULES ""
- GIT_TAG "v0.9.5" - GIT_TAG "v0.8.2"
+ DOWNLOAD_COMMAND true + DOWNLOAD_COMMAND true
) )
FetchContent_GetProperties(${TOML++}) FetchContent_GetProperties(${TOML++})
@@ -112,7 +103,7 @@ if(NOT LUA_INCLUDE_DIR OR (WIN32 AND NOT LUA_LIBRARIES)) if(NOT ${TOML++}_POPULATED)
message(STATUS "Cloning ${TOML++}")
- FetchContent_Populate(${TOML++})
+ FetchContent_Populate(${TOML++})
FetchContent_MakeAvailable(${TOML++})
endif()
@@ -113,7 +104,7 @@ if(NOT LUA_INCLUDE_DIR OR (WIN32 AND NOT LUA_LIBRARIES))
find_package(Lua) find_package(Lua)
endif() endif()
-include_directories(${LUA_INCLUDE_DIR} src src/include ${${TOML++}_SOURCE_DIR} ${${SOL2}_SOURCE_DIR}/include ${${MAGIC_ENUM}_SOURCE_DIR}/include) -include_directories(${LUA_INCLUDE_DIR} src src/include ${${TOML++}_SOURCE_DIR} ${${SOL2}_SOURCE_DIR}/include ${${MAGIC_ENUM}_SOURCE_DIR}/include)
+include_directories(${LUA_INCLUDE_DIR} src src/include TOML_PLUS_PLUS_SRC ${${SOL2}_SOURCE_DIR}/include MAGIC_ENUM_SRC/include) +include_directories(${LUA_INCLUDE_DIR} src src/include TOML_PLUS_PLUS_SRC ${${SOL2}_SOURCE_DIR}/include MAGIC_ENUM_SRC)
set(SOURCES set(SOURCES
src/toml.cpp src/toml.cpp
@@ -129,7 +120,7 @@ source_group(src FILES ${SOURCES}) @@ -129,8 +120,8 @@ source_group(src FILES ${SOURCES})
if(WIN32 AND "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" OR MSVC)
if(WIN32 AND "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
target_link_options(toml.lua PUBLIC ${PROJECT_SOURCE_DIR}\\libs\\lua51.lib) target_link_options(toml.lua PUBLIC ${PROJECT_SOURCE_DIR}\\libs\\lua51.lib)
else() -else()
- target_link_libraries(toml.lua ${LUA_LIBRARIES} tomlplusplus::tomlplusplus) - target_link_libraries(toml.lua ${LUA_LIBRARIES})
+ target_link_libraries(toml.lua ${LUA_LIBRARIES} tomlplusplus) +else()
+ target_link_libraries(toml.lua ${LUA_LIBRARIES})
endif() endif()
if (LINK_FLAGS) if (LINK_FLAGS)