Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
tilelang
Commits
2f7dc52e
Unverified
Commit
2f7dc52e
authored
Sep 17, 2025
by
Lei Wang
Committed by
GitHub
Sep 17, 2025
Browse files
[CMake] Added support for statically linked system libc library (#825)
parent
8554cb01
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
+14
-0
CMakeLists.txt
CMakeLists.txt
+14
-0
No files found.
CMakeLists.txt
View file @
2f7dc52e
...
@@ -4,6 +4,8 @@
...
@@ -4,6 +4,8 @@
cmake_minimum_required
(
VERSION 3.18
)
cmake_minimum_required
(
VERSION 3.18
)
project
(
TILE_LANG C CXX
)
project
(
TILE_LANG C CXX
)
option
(
TILE_LANG_STATIC_STDCPP
"Statically link libstdc++ for TileLang libraries"
ON
)
# Set default build type to Release if not provided
# Set default build type to Release if not provided
if
(
NOT CMAKE_BUILD_TYPE
)
if
(
NOT CMAKE_BUILD_TYPE
)
set
(
CMAKE_BUILD_TYPE Release CACHE STRING
"Build type"
)
set
(
CMAKE_BUILD_TYPE Release CACHE STRING
"Build type"
)
...
@@ -61,6 +63,18 @@ if(TILE_LANG_INSTALL_STATIC_LIB)
...
@@ -61,6 +63,18 @@ if(TILE_LANG_INSTALL_STATIC_LIB)
set
(
BUILD_STATIC_RUNTIME ON
)
set
(
BUILD_STATIC_RUNTIME ON
)
endif
()
endif
()
if
(
TILE_LANG_STATIC_STDCPP
)
message
(
STATUS
"Enabling static linking of C++ standard library"
)
# Set compile flags for static linking of the C++ standard library
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-static-libstdc++"
)
# For some compilers, additional flags may be required
if
(
CMAKE_CXX_COMPILER_ID MATCHES
"GNU"
)
set
(
CMAKE_EXE_LINKER_FLAGS
"
${
CMAKE_EXE_LINKER_FLAGS
}
-static-libstdc++"
)
set
(
CMAKE_SHARED_LINKER_FLAGS
"
${
CMAKE_SHARED_LINKER_FLAGS
}
-static-libstdc++"
)
set
(
CMAKE_MODULE_LINKER_FLAGS
"
${
CMAKE_MODULE_LINKER_FLAGS
}
-static-libstdc++"
)
endif
()
endif
()
# Enforce CUDA standard
# Enforce CUDA standard
if
(
USE_CUDA
)
if
(
USE_CUDA
)
set
(
CMAKE_CUDA_STANDARD 17
)
set
(
CMAKE_CUDA_STANDARD 17
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment