Skip to content

Commit

Permalink
win32: Compile working
Browse files Browse the repository at this point in the history
Closes #208

Signed-off-by: Ben Collins <[email protected]>
  • Loading branch information
benmcollins committed Feb 13, 2025
1 parent db9f17c commit 4ea993a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@ function(jwt_add_tool)
# target_link_libraries(${Tool_NAME} PRIVATE jwt)
set_target_properties(${Tool_NAME} PROPERTIES
RUNTIME_OUTPUT_DIRECTORY
"${CMAKE_BINARY_DIR}/tools")
"${CMAKE_BINARY_DIR}/tools"
COMPILE_FLAGS -DJWT_STATIC_DEFINE)
install(TARGETS ${Tool_NAME}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
endfunction()
Expand Down
5 changes: 3 additions & 2 deletions tools/jwt-util.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@
file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#include <unistd.h>
#include <sys/wait.h>

static char *pipe_cmd;

static FILE *json_fp;

#ifdef _WIN32
#include <windows.h>
#else
#include <sys/wait.h>
#endif

static inline int write_json(const char *title, const char *str)
Expand Down Expand Up @@ -127,7 +128,7 @@ static inline int __jwt_wcb(jwt_t *jwt, jwt_config_t *config)
}

#ifdef _WIN32
extern char **__argv;
__declspec(dllimport) extern char **__argv;
static inline const char *get_progname(void)
{
return __argv[0];
Expand Down

0 comments on commit 4ea993a

Please sign in to comment.