@@ -41,21 +41,22 @@ option(GENERATE_PYTHON_BINDING "Generate the python bindings code" OFF)
4141option (VPUNN_BUILD_HTTP_CLIENT "Build support for cost provider http service" OFF )
4242option (VPUNN_OPT_LEGACY_ZTILING "Use legacy ZTiling mechanism" ON )
4343option (VPUNN_OPT_LEGACY_DMA_TH_4 "Use legacy Theoretical DMA for Gen4" OFF )
44- option (ENABLE_FLATBUFFERS_INSTALLATION "Install flatbuffers and its dependency ProjectConfig" ON )
4544
4645# Detect JavaScript build env
4746if (DEFINED ENV{EMSDK} AND DEFINED ENV{EMSCRIPTEN})
48- set (JS_BUILD ON )
49- else ()
50- set (JS_BUILD OFF )
47+ message (STATUS "VPUNN -- JavaScript support was removed from Cost Model interface" )
5148endif ()
49+ set (JS_BUILD OFF ) # Explicitly set to OFF since JS build is no longer supported
5250
5351# Global settings
5452set (CMAKE_POSITION_INDEPENDENT_CODE ON )
5553set (COST_MODEL_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR} )
5654set (COST_MODEL_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR} )
5755set (EXTERNAL_INSTALL_LOCATION ${CMAKE_CURRENT_BINARY_DIR} /external)
5856
57+ # Add cmake directory to module path for consistent cmake/<cmake_module> includes
58+ list (APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR} )
59+
5960# Output directory setup
6061set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR} /lib)
6162set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR} /lib)
@@ -64,7 +65,7 @@ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
6465# Flatbuffers is included in the root because subdirectories
6566# and directories of subdirectories needs this target and
6667# certain flatbuffers variables.
67- include (cmake/FlatbuffersSetup.cmake )
68+ include (cmake/FlatbuffersSetup )
6869
6970# Common settings library
7071# Consumer libs should always link this as PRIVATE to avoid transitive propagation.
@@ -75,7 +76,6 @@ target_sources(vpunn_common_settings PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src/com
7576# Apply C++ standard requirement to this target and (optionally) to dependents
7677target_compile_features (vpunn_common_settings PUBLIC cxx_std_17 )
7778
78-
7979if (VPUNN_OPT_LEGACY_DMA_TH_4)
8080 target_compile_definitions (vpunn_common_settings PUBLIC VPUNN_OPT_LEGACY_DMA_TH_4 )
8181 message (STATUS "-- Enable Legacy Gen4 DMA Theoretical" )
@@ -116,45 +116,43 @@ if(CMAKE_BUILD_TYPE STREQUAL "Coverage")
116116 endif ()
117117endif ()
118118
119- # Non JS builds
120- if (NOT JS_BUILD)
121- if (CMAKE_CXX_COMPILER_ID MATCHES "Clang|GNU" )
122- # lots of warnings and all warnings as errors
123- message (STATUS "Setting GCC/Clang specific flags for common settings" )
124- target_compile_options (vpunn_common_settings PUBLIC
125- -Wall -Wextra -Werror -pedantic -Wdouble-promotion -Wfloat-conversion
126- $<$<CONFIG :Debug >:-g >
127- $<$<CONFIG :Release >:-O3 >
128- )
129- elseif (CMAKE_CXX_COMPILER_ID MATCHES "MSVC" )
130- message (STATUS "Setting Visual Studio specific flags for common settings" )
131- target_compile_options (vpunn_common_settings PUBLIC
132- # Enable /bigobj for debug build type with MSVC - remove after vpunn headers are cleaned up
133- $<$<CONFIG :Debug >:/bigobj >
134- /W4 /WX
135- )
136- # TODO figure out why it propagates to VPUx even though it is linked as PRIVATE in other libs
137- # and re-enable
138- # target_link_options(vpunn_common_settings PUBLIC
139- # /WX
140- # )
141-
142- # Disable dll build
143- set (VPUNN_BUILD_SHARED_LIB OFF )
144- else ()
145- message (WARNING "-- Building with unrecognised compiler, not setting any specific flags" )
146- endif ()
119+ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang|GNU" )
120+ # lots of warnings and all warnings as errors
121+ message (STATUS "Setting GCC/Clang specific flags for common settings" )
122+ target_compile_options (vpunn_common_settings PUBLIC
123+ -Wall -Wextra -Werror -pedantic -Wdouble-promotion -Wfloat-conversion
124+ $<$<CONFIG :Debug >:-g >
125+ $<$<CONFIG :Release >:-O3 >
126+ )
127+ elseif (CMAKE_CXX_COMPILER_ID MATCHES "MSVC" )
128+ message (STATUS "Setting Visual Studio specific flags for common settings" )
129+ target_compile_options (vpunn_common_settings PUBLIC
130+ # Enable /bigobj for debug build type with MSVC - remove after vpunn headers are cleaned up
131+ $<$<CONFIG :Debug >:/bigobj >
132+ /W4 /WX
133+ )
134+ # TODO figure out why it propagates to VPUx even though it is linked as PRIVATE in other libs
135+ # and re-enable
136+ # target_link_options(vpunn_common_settings PUBLIC
137+ # /WX
138+ # )
139+
140+ # Disable dll build
141+ set (VPUNN_BUILD_SHARED_LIB OFF )
142+ else ()
143+ message (WARNING "-- Building with unrecognised compiler, not setting any specific flags" )
147144endif ()
148145
146+
149147# Add subdirectories
150148add_subdirectory (src )
151- add_subdirectory (js )
152149
153150# Optional subdirectories based on build options
154151if (VPUNN_BUILD_EXAMPLES)
155152 add_subdirectory (example )
156153endif ()
157154
155+
158156if (VPUNN_BUILD_APPS)
159157 add_subdirectory (apps/cache_app )
160158endif ()
0 commit comments