diff --git a/CMakeLists.txt b/CMakeLists.txt index d6010bf..af73f96 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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() diff --git a/tools/jwt-util.h b/tools/jwt-util.h index 2be9f15..6ef2567 100644 --- a/tools/jwt-util.h +++ b/tools/jwt-util.h @@ -6,7 +6,6 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include -#include static char *pipe_cmd; @@ -14,6 +13,8 @@ static FILE *json_fp; #ifdef _WIN32 #include +#else +#include #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];