Skip to content

Commit

Permalink
Fixed Windows Environment Path Issue and Relocated all msvc files fro…
Browse files Browse the repository at this point in the history
…m modules to common directory and Fixed __attribute__ issue in glocale.h(MSVC)
  • Loading branch information
Mahesh1998 committed Sep 12, 2024
1 parent 6d29c6e commit 0c69d7e
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 7 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -215,14 +215,14 @@ set(HTML2MAN VERSION_NUMBER=${GRASS_VERSION_NUMBER} ${PYTHON_EXECUTABLE}

if(WIN32)
set(sep "\;")
set(env_path "")
else()
set(sep ":")
set(env_path ":$ENV{PATH}")
endif()

set(env_path "$ENV{PATH}")

set(grass_env_command
${CMAKE_COMMAND} -E env "PATH=${BIN_DIR}${sep}${SCRIPTS_DIR}${env_path}"
${CMAKE_COMMAND} -E env "PATH=${BIN_DIR}${sep}${SCRIPTS_DIR}${sep}${env_path}"
"PYTHONPATH=${ETC_PYTHON_DIR}${sep}${GUI_WXPYTHON_DIR}${sep}$ENV{PYTHONPATH}"
"LD_LIBRARY_PATH=${LIB_DIR}${sep}$ENV{LD_LIBRARY_PATH}"
"GISBASE=${RUN_GISBASE_NATIVE}" "GISRC=${GISRC}" "LC_ALL=C" "LANG=C"
Expand Down
5 changes: 5 additions & 0 deletions include/grass/defs/glocale.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
#ifndef GRASS_GLOCALEDEFS_H
#define GRASS_GLOCALEDEFS_H

#if !defined __GNUC__ || __GNUC__ < 2
#undef __attribute__
#define __attribute__(x)
#endif

extern void G_init_locale(void);
extern char *G_gettext(const char *, const char *)
__attribute__((format_arg(2)));
Expand Down
4 changes: 2 additions & 2 deletions lib/db/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
file(GLOB dbmibase_SRCS "./dbmi_base/*.c")
if(MSVC)
set(dbmibase_INCLUDES "./dbmi_base" "./dbmi_base/msvc")
list(APPEND dbmibase_SRCS "./dbmi_base/msvc/dirent.c")
set(dbmibase_INCLUDES "./dbmi_base" "../../msvc")
list(APPEND dbmibase_SRCS "../../msvc/dirent.c")
endif()

build_library_in_subdir(
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion python/grass/script/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def __init__(self, args, **kwargs):
):
cmd = shutil.which(args[0])
if cmd is None:
raise OSError(_("Cannot find the executable {0}").format(args[0]))
raise OSError(_("Cannot find the executable {0}, {1}, {2}").format(args[0], shutil.which(args[0]), os.getenv('PATH')))

Check failure on line 59 in python/grass/script/core.py

View workflow job for this annotation

GitHub Actions / Python Code Quality Checks (ubuntu-22.04)

Ruff (Q000)

python/grass/script/core.py:59:126: Q000 Single quotes found but double quotes preferred
args = [cmd] + args[1:]
name, ext = os.path.splitext(cmd)
if ext.lower() not in self._builtin_exts:
Expand Down
2 changes: 1 addition & 1 deletion utils/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/generate_last_commit_file.py

set(current_time_s_ms_SRCS "timer/main.c")
if(MSVC)
list(APPEND current_time_s_ms_SRCS "timer/msvc/gettimeofday.c")
list(APPEND current_time_s_ms_SRCS "../msvc/gettimeofday.c")
endif()
build_program_in_subdir(
timer
Expand Down

0 comments on commit 0c69d7e

Please sign in to comment.