Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
JiauZhang committed Jan 2, 2025
1 parent 4def6ed commit cd3ccaa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
12 changes: 6 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ include_directories(
add_definitions(-DYYDEBUG=1)

add_library(
conf-objs
menuconfig-objs
SHARED
confdata.c expr.c api.c mnconf-common.c
menu.c preprocess.c symbol.c util.c
Expand All @@ -41,14 +41,14 @@ add_library(
${FLEX_LEXER_OUTPUTS}
)
target_link_libraries(
conf-objs
menuconfig-objs
${FLEX_LIBRARIES} ${BISON_LIBRARIES} ${CURSES_LIBRARY}
)

add_executable(menuconfig main.cpp)
target_link_libraries(menuconfig conf-objs)
target_link_libraries(menuconfig menuconfig-objs)

add_executable(menuconfig-conf conf.c)
target_link_libraries(menuconfig-conf conf-objs)
add_executable(menuconfig-tool conf.c)
target_link_libraries(menuconfig-tool menuconfig-objs)

install(TARGETS menuconfig menuconfig-conf conf-objs)
install(TARGETS menuconfig menuconfig-tool menuconfig-objs)
8 changes: 3 additions & 5 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,9 @@ int main(int argc, char **argv)
fprintf(stderr, "***\n");
return -1;
}
bool need_sync = fs::exists(getenv(KCONFIG_AUTOCONFIG));
if (need_sync)
need_sync = need_sync &&
fs::last_write_time(getenv(KCONFIG_CONFIG)) > fs::last_write_time(getenv(KCONFIG_AUTOCONFIG));
if (need_sync)
bool need_sync = !fs::exists(getenv(KCONFIG_AUTOCONFIG));
if (need_sync ||
(fs::last_write_time(getenv(KCONFIG_CONFIG)) > fs::last_write_time(getenv(KCONFIG_AUTOCONFIG))))
res = conf_write_autoconf(1);
}

Expand Down

0 comments on commit cd3ccaa

Please sign in to comment.