win32: Compile working

Closes #208

Signed-off-by: Ben Collins <bcollins@libjwt.io>
This commit is contained in:
Ben Collins 2025-02-13 08:06:42 -05:00
parent db9f17c42e
commit 4ea993a23f
No known key found for this signature in database
GPG key ID: 5D5A57C7242B22CF
2 changed files with 5 additions and 3 deletions

View file

@ -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()

View file

@ -6,7 +6,6 @@
file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include <unistd.h>
#include <sys/wait.h>
static char *pipe_cmd;
@ -14,6 +13,8 @@ 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)
@ -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];