]> git.ipfire.org Git - thirdparty/vectorscan.git/commitdiff
cmake: combine hs_exec src lists correctly
authorMatthew Barr <matthew.barr@intel.com>
Mon, 12 Dec 2016 05:37:38 +0000 (16:37 +1100)
committerMatthew Barr <matthew.barr@intel.com>
Wed, 14 Dec 2016 04:35:28 +0000 (15:35 +1100)
CMakeLists.txt

index a6ef3fe864a75dc47bcd4fa477232b71a7bb0db7..8a4864f4453ca16808d76b5e80bef5104653807e 100644 (file)
@@ -441,10 +441,12 @@ SET(hs_HEADERS
 install(FILES ${hs_HEADERS} DESTINATION include/hs)
 
 set (hs_exec_common_SRCS
-        src/alloc.c
-        src/scratch.c
-        src/util/multibit.c
-        )
+    src/alloc.c
+    src/scratch.c
+    src/util/cpuid_flags.c
+    src/util/cpuid_flags.h
+    src/util/multibit.c
+    )
 
 set (hs_exec_SRCS
     ${hs_HEADERS}
@@ -944,8 +946,6 @@ SET (hs_SRCS
     src/util/compile_error.cpp
     src/util/compile_error.h
     src/util/container.h
-    src/util/cpuid_flags.c
-    src/util/cpuid_flags.h
     src/util/depth.cpp
     src/util/depth.h
     src/util/determinise.h
@@ -1041,13 +1041,14 @@ set (LIB_SOVERSION ${HS_MAJOR_VERSION})
 
 if (NOT FAT_RUNTIME)
 
+    set(hs_exec_SRCS ${hs_exec_SRCS} ${hs_exec_common_SRCS})
+
     if (HAVE_AVX2)
-        add_library(hs_exec OBJECT ${hs_exec_common_SRCS} ${hs_exec_SRCS}
-            ${hs_exec_avx2_SRCS})
-    else()
-        add_library(hs_exec OBJECT ${hs_exec_common_SRCS} ${hs_exec_SRCS})
+        set(hs_exec_SRCS ${hs_exec_SRCS} ${hs_exec_avx2_SRCS})
     endif()
 
+    add_library(hs_exec OBJECT ${hs_exec_SRCS})
+
     add_library(hs_runtime STATIC src/hs_version.c src/hs_valid_platform.c $<TARGET_OBJECTS:hs_exec>)
     set_target_properties(hs_runtime PROPERTIES LINKER_LANGUAGE C)
 
@@ -1175,6 +1176,7 @@ if (BUILD_STATIC_AND_SHARED OR BUILD_SHARED_LIBS)
             $<TARGET_OBJECTS:hs_exec_shared_core2>
             $<TARGET_OBJECTS:hs_exec_shared_corei7>
             $<TARGET_OBJECTS:hs_exec_shared_avx2>)
+
     endif()
     add_dependencies(hs_shared ragel_Parser)
     set_target_properties(hs_shared PROPERTIES