Skip to content

Commit e20d034

Browse files
committed
add NBL_TARGET_FORCE_ASSEMBLER_EXECUTABLE, enable CMAKE_EXPORT_COMPILE_COMMANDS for ninja generators, fix ninja + MSVC + VS generators builds, update git-version-tracking submodule with custom target byproduct fixes
1 parent a3827d6 commit e20d034

File tree

5 files changed

+49
-16
lines changed

5 files changed

+49
-16
lines changed

3rdparty/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,8 @@ option(WITH_JAVA "libjpeg-turbo" OFF)
180180
set(CMAKE_INSTALL_DOCDIR "${CMAKE_CURRENT_BINARY_DIR}/libjpeg-turbo/install/docdir")
181181
set(CMAKE_INSTALL_MANDIR "${CMAKE_CURRENT_BINARY_DIR}/libjpeg-turbo/install/mandir")
182182
add_subdirectory(libjpeg-turbo libjpeg-turbo EXCLUDE_FROM_ALL)
183+
NBL_TARGET_FORCE_ASSEMBLER_EXECUTABLE(simd ASM_NASM libjpeg-turbo/simd/)
184+
183185
unset(CMAKE_INSTALL_DOCDIR)
184186
unset(CMAKE_INSTALL_MANDIR)
185187

CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@ include(ExternalProject)
1313
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/toolchains/android/build.cmake)
1414

1515
project(Nabla LANGUAGES CXX C)
16-
enable_language(C CXX ASM)
16+
enable_language(C CXX ASM ASM_NASM)
17+
18+
if(MSVC)
19+
enable_language(ASM_MASM)
20+
endif()
1721

1822
option(NBL_STATIC_BUILD "" OFF) # ON for static builds, OFF for shared
1923
option(NBL_DYNAMIC_MSVC_RUNTIME "" ON)

CMakePresets.json

Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
"minor": 29,
66
"patch": 2
77
},
8-
98
"configurePresets": [
109
{
1110
"name": "ci-configure-base",
@@ -109,21 +108,27 @@
109108
"inherits": "ci-configure-static-windows-base",
110109
"displayName": "[CI]: Static library target, Ninja multi-config generator",
111110
"description": "Configure as static library with Ninja multi-config generator",
112-
"generator": "Ninja Multi-Config"
111+
"generator": "Ninja Multi-Config",
112+
"cacheVariables": {
113+
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
114+
}
113115
},
114116
{
115117
"name": "ci-configure-dynamic-ninja-multi",
116118
"inherits": "ci-configure-dynamic-windows-base",
117119
"displayName": "[CI]: Dynamic library target, Ninja multi-config generator",
118120
"description": "Configure as dynamic library with Ninja multi-config generator",
119-
"generator": "Ninja Multi-Config"
121+
"generator": "Ninja Multi-Config",
122+
"cacheVariables": {
123+
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
124+
}
120125
},
121126
{
122127
"name": "user-configure-base",
123128
"hidden": true,
124129
"cacheVariables": {
125130
"NBL_CI_MODE": "OFF",
126-
"NBL_UPDATE_GIT_SUBMODULE": "ON",
131+
"NBL_UPDATE_GIT_SUBMODULE": "OFF",
127132
"NBL_RUN_TESTS": "OFF",
128133
"NBL_CPACK_CI": "OFF"
129134
}
@@ -193,14 +198,20 @@
193198
"inherits": "user-configure-static-windows-base",
194199
"displayName": "[USER]: Static library target, Ninja multi-config generator",
195200
"description": "Configure as static library with Ninja multi-config generator",
196-
"generator": "Ninja Multi-Config"
201+
"generator": "Ninja Multi-Config",
202+
"cacheVariables": {
203+
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
204+
}
197205
},
198206
{
199207
"name": "user-configure-dynamic-ninja-multi",
200208
"inherits": "user-configure-dynamic-windows-base",
201209
"displayName": "[USER]: Dynamic library target, Ninja multi-config generator",
202210
"description": "Configure as dynamic library with Ninja multi-config generator",
203-
"generator": "Ninja Multi-Config"
211+
"generator": "Ninja Multi-Config",
212+
"cacheVariables": {
213+
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
214+
}
204215
},
205216
{
206217
"name": "user-configure-static-ninja-release",
@@ -209,7 +220,8 @@
209220
"description": "Configure as static Release library with Ninja single-config generator",
210221
"generator": "Ninja",
211222
"cacheVariables": {
212-
"CMAKE_BUILD_TYPE": "Release"
223+
"CMAKE_BUILD_TYPE": "Release",
224+
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
213225
}
214226
},
215227
{
@@ -219,7 +231,8 @@
219231
"description": "Configure as dynamic Release library with Ninja single-config generator",
220232
"generator": "Ninja",
221233
"cacheVariables": {
222-
"CMAKE_BUILD_TYPE": "Release"
234+
"CMAKE_BUILD_TYPE": "Release",
235+
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
223236
}
224237
},
225238
{
@@ -229,7 +242,8 @@
229242
"description": "Configure as static RelWithDebInfo library with Ninja single-config generator",
230243
"generator": "Ninja",
231244
"cacheVariables": {
232-
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
245+
"CMAKE_BUILD_TYPE": "RelWithDebInfo",
246+
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
233247
}
234248
},
235249
{
@@ -239,7 +253,8 @@
239253
"description": "Configure as dynamic RelWithDebInfo library with Ninja single-config generator",
240254
"generator": "Ninja",
241255
"cacheVariables": {
242-
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
256+
"CMAKE_BUILD_TYPE": "RelWithDebInfo",
257+
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
243258
}
244259
},
245260
{
@@ -249,7 +264,8 @@
249264
"description": "Configure as static Debug library with Ninja single-config generator",
250265
"generator": "Ninja",
251266
"cacheVariables": {
252-
"CMAKE_BUILD_TYPE": "Debug"
267+
"CMAKE_BUILD_TYPE": "Debug",
268+
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
253269
}
254270
},
255271
{
@@ -259,7 +275,8 @@
259275
"description": "Configure as dynamic Debug library with Ninja single-config generator",
260276
"generator": "Ninja",
261277
"cacheVariables": {
262-
"CMAKE_BUILD_TYPE": "Debug"
278+
"CMAKE_BUILD_TYPE": "Debug",
279+
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
263280
}
264281
}
265282
],
@@ -413,7 +430,6 @@
413430
"displayName": "[USER]: Dynamic Debug library target, Ninja single-config generator",
414431
"description": "Build Nabla as dynamic Debug library with Ninja single-config generator"
415432
}
416-
417433
],
418434
"packagePresets": [
419435
{

cmake/common.cmake

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1321,4 +1321,15 @@ function(NBL_IMPORT_VS_CONFIG)
13211321
message(FATAL_ERORR "Cannot request importing VS config, doesn't meet requirements!")
13221322
endif()
13231323

1324-
endfunction()
1324+
endfunction()
1325+
1326+
macro(NBL_TARGET_FORCE_ASSEMBLER_EXECUTABLE _NBL_TARGET_ _NBL_ASM_DIALECT_ _NBL_PREPEND_PATH_TRANSFORM_)
1327+
get_target_property(_NBL_TARGET_SOURCES_ "${_NBL_TARGET_}" SOURCES)
1328+
list(FILTER _NBL_TARGET_SOURCES_ INCLUDE REGEX "\\.asm$")
1329+
list(TRANSFORM _NBL_TARGET_SOURCES_ PREPEND "${_NBL_PREPEND_PATH_TRANSFORM_}")
1330+
1331+
set_source_files_properties(${_NBL_TARGET_SOURCES_}
1332+
TARGET_DIRECTORY "${_NBL_TARGET_}"
1333+
PROPERTIES LANGUAGE "${_NBL_ASM_DIALECT_}"
1334+
)
1335+
endmacro()

0 commit comments

Comments
 (0)