]> code.bitgloo.com Git - clyne/entityx.git/commitdiff
Fixed shared library compilation.
authorDaniel Guzman <daniel.guzman85@gmail.com>
Wed, 6 Apr 2016 20:07:07 +0000 (22:07 +0200)
committerDaniel Guzman <daniel.guzman85@gmail.com>
Sun, 10 Apr 2016 20:09:12 +0000 (22:09 +0200)
- Fixed that when ENTITYX_BUILD_SHARED=1 was compiling the static
library and the shared_library. Now it only compiles one of them, shared
or static, but not both. Using visual studio compiler, now, the shared
library doesn't create a .lib file (because it doesn't export anything
which is OK). This will be the next step.

CMakeLists.txt

index 993badb69543059621c0041f3bcca4c1f222cc27..876016598d345539a91a2a981e5ad31cff6fc707 100644 (file)
@@ -129,11 +129,9 @@ message("-- Checking misc features")
 require(HAVE_STDINT_H "stdint.h")
 
 # Things to install
-set(install_libs entityx)
+
 
 set(sources entityx/System.cc entityx/Event.cc entityx/Entity.cc entityx/help/Timer.cc entityx/help/Pool.cc)
-add_library(entityx STATIC ${sources})
-set_target_properties(entityx PROPERTIES DEBUG_POSTFIX -d FOLDER entityx)
 
 if (ENTITYX_BUILD_SHARED)
     message("-- Building shared libraries (-DENTITYX_BUILD_SHARED=0 to only build static librarires)")
@@ -147,7 +145,11 @@ if (ENTITYX_BUILD_SHARED)
         VERSION ${ENTITYX_VERSION}
         SOVERSION ${ENTITYX_MAJOR_VERSION}
         FOLDER entityx)
-    list(APPEND install_libs entityx_shared)
+       set(install_libs entityx_shared)
+else()
+       add_library(entityx STATIC ${sources})
+       set_target_properties(entityx PROPERTIES DEBUG_POSTFIX -d FOLDER entityx)
+       set(install_libs entityx)
 endif (ENTITYX_BUILD_SHARED)
 
 if (ENTITYX_BUILD_TESTING)
@@ -197,4 +199,5 @@ install(
     TARGETS ${install_libs}
     LIBRARY DESTINATION "${libdir}"
     ARCHIVE DESTINATION "${libdir}"
+       RUNTIME DESTINATION "bin"
     )