]> granicus.if.org Git - onig/commitdiff
fix Static build extern
authorswordow <swordow89@gmail.com>
Tue, 4 Jun 2019 01:55:03 +0000 (09:55 +0800)
committerswordow <swordow89@gmail.com>
Tue, 4 Jun 2019 01:55:03 +0000 (09:55 +0800)
CMakeLists.txt
src/oniguruma.h

index ac36cf19cf4b37b83e28c5c975b4d487a6ad1a92..ae26e288e138f2c8fd8e2c3966fcea09f772d824 100644 (file)
@@ -75,7 +75,7 @@ if(MSVC)
          $<$<CONFIG:MinSizeRel>:/MT>
          $<$<CONFIG:RelWithDebgInfo>:/MTd>
          )
-       target_compile_definitions(onig PUBLIC -DONIG_EXTERN=)
+       target_compile_definitions(onig PUBLIC -DONIG_STATIC)
   endif()
 elseif(CMAKE_COMPILER_IS_GNUCC)
   target_compile_options(onig PRIVATE
index f6aa5ba1e1eb4c3fd9724b3f50bedbf8fd5f872a..04627759946641183c005f88b2f62124b4cd5ce6 100644 (file)
@@ -52,6 +52,7 @@ extern "C" {
 # define PV_(args) args
 #endif
 
+#ifndef ONIG_STATIC
 #ifndef ONIG_EXTERN
 #if defined(_WIN32) && !defined(__GNUC__)
 #if defined(ONIGURUMA_EXPORT)
@@ -65,6 +66,9 @@ extern "C" {
 #ifndef ONIG_EXTERN
 #define ONIG_EXTERN   extern
 #endif
+#else
+#define ONIG_EXTERN   extern
+#endif
 
 /* PART: character encoding */