Skip to content

Commit 6582704

Browse files
committed
Use inih as git submodule
ExternalProject use is discouraged. - Most package build systems do not allow any fetching on configure/build stage - It's insecure the way it's used now, as it does not specify commit hash, so it may fetch whatever malicous code and it'll come unoticed
1 parent b7ac33c commit 6582704

File tree

3 files changed

+7
-14
lines changed

3 files changed

+7
-14
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "external/inih"]
2+
path = external/inih
3+
url = https://github.com/benhoyt/inih.git

cmake/external/inih.cmake

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,11 @@
11
###### External Project: inih
22
include(ExternalProject)
33

4-
SET(INIH_REPOSITORY https://github.com/benhoyt/inih.git)
5-
SET(INIH_PREFIX_DIR ${EXTERNAL_PREFIX}/inih)
6-
7-
ExternalProject_Add(inih-repository
8-
PREFIX ${INIH_PREFIX_DIR}
9-
# Do nothing, we just need the files.
10-
CONFIGURE_COMMAND ""
11-
BUILD_COMMAND ""
12-
INSTALL_COMMAND ""
13-
GIT_REPOSITORY ${INIH_REPOSITORY})
4+
SET(INIH_PREFIX_DIR ${PROJECT_SOURCE_DIR}/external/inih)
145

156
SET(INIH_SOURCES
16-
${INIH_PREFIX_DIR}/src/inih-repository/ini.c)
17-
set_source_files_properties(${INIH_SOURCES} PROPERTIES GENERATED TRUE)
7+
${INIH_PREFIX_DIR}/ini.c)
188
add_library(inih
199
${INIH_SOURCES})
2010

21-
add_dependencies(inih inih-repository)
22-
target_include_directories(inih INTERFACE SYSTEM ${INIH_PREFIX_DIR}/src/inih-repository/)
11+
target_include_directories(inih INTERFACE SYSTEM ${INIH_PREFIX_DIR})

external/inih

Submodule inih added at 0c3f8ea

0 commit comments

Comments
 (0)