Skip to content

Commit c0af7bf

Browse files
rrsettgastbmhan12
andauthored
Feature/han12/combine static (#230)
* replace blt_register_library with blt_import_library * reorder include of src to the first include. Added ability to build LvArray as cmake object library if a submodule of geosx * make LvArrayBuildAsObj an option * rename object libraries flag to LVARRAY_BUILD_OBJ_LIBS Co-authored-by: Brian Han <[email protected]>
1 parent dbc92d2 commit c0af7bf

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ if( ENABLE_CALIPER )
6060
set( lvarray_dependencies ${lvarray_dependencies} caliper )
6161
endif()
6262

63+
add_subdirectory( src )
6364

6465
if( ENABLE_TESTS AND NOT DISABLE_UNIT_TESTS )
6566
add_subdirectory( unitTests )
@@ -85,5 +86,4 @@ if( ENABLE_DOCS )
8586
add_subdirectory( docs )
8687
endif()
8788

88-
add_subdirectory( src )
8989

cmake/CMakeBasics.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ endif()
99

1010
option( ENABLE_TOTALVIEW_OUTPUT "" OFF )
1111

12+
set( LVARRAY_BUILD_OBJ_LIBS TRUE CACHE BOOL "" )
13+
1214

1315
if( NOT BLT_CXX_STD STREQUAL c++14 )
1416
MESSAGE(FATAL_ERROR "c++14 is NOT enabled. LvArray requires c++14")

src/CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,10 @@ set( lvarray_sources
4141
blt_add_library( NAME lvarray
4242
SOURCES ${lvarray_sources}
4343
HEADERS ${lvarray_headers}
44-
DEPENDS_ON ${lvarray_dependencies} )
45-
44+
DEPENDS_ON ${lvarray_dependencies}
45+
OBJECT ${LVARRAY_BUILD_OBJ_LIBS}
46+
)
47+
4648
target_include_directories( lvarray
4749
PUBLIC
4850
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>

unitTests/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ foreach(test ${testSources})
7676
blt_add_executable( NAME ${test_name}
7777
SOURCES ${test}
7878
OUTPUT_DIR ${TEST_OUTPUT_DIRECTORY}
79-
DEPENDS_ON gtest lvarray ${lvarray_dependencies} )
79+
DEPENDS_ON gtest lvarray ${lvarray_dependencies})
8080

8181
target_include_directories( ${test_name} PUBLIC ${CMAKE_CURRENT_LIST_DIR}/../src )
8282

0 commit comments

Comments
 (0)