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
dgl
Commits
7467da9a
Unverified
Commit
7467da9a
authored
Aug 16, 2023
by
Rhett Ying
Committed by
GitHub
Aug 16, 2023
Browse files
[dev] configure optimize options explicitly for different build types (#6161)
parent
34641092
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
6 deletions
+20
-6
CMakeLists.txt
CMakeLists.txt
+20
-6
No files found.
CMakeLists.txt
View file @
7467da9a
...
...
@@ -108,10 +108,24 @@ dgl_feature_option(
"dev"
)
# Set debug compile option for gdb, only happens when -DCMAKE_BUILD_TYPE=DEBUG
if
(
NOT MSVC
)
set
(
CMAKE_CXX_FLAGS_DEBUG
"
${
CMAKE_CXX_FLAGS_DEBUG
}
-DDEBUG -O0 -g3 -ggdb"
)
endif
(
NOT MSVC
)
# Set optimization options for different build types.
if
(
${
BUILD_TYPE
}
STREQUAL
"dev"
)
if
(
MSVC
)
set
(
CMAKE_C_FLAGS
"
${
CMAKE_C_FLAGS
}
/Od"
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
/Od"
)
else
()
set
(
CMAKE_C_FLAGS
"
${
CMAKE_C_FLAGS
}
-O0 -g3 -ggdb"
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-O0 -g3 -ggdb"
)
endif
()
else
()
if
(
MSVC
)
set
(
CMAKE_C_FLAGS
"
${
CMAKE_C_FLAGS
}
/O2"
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
/O2"
)
else
()
set
(
CMAKE_C_FLAGS
"
${
CMAKE_C_FLAGS
}
-O2"
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-O2"
)
endif
()
endif
()
if
(
USE_CUDA
)
message
(
STATUS
"Build with CUDA support"
)
...
...
@@ -157,8 +171,8 @@ if(MSVC)
endif
()
else
(
MSVC
)
include
(
CheckCXXCompilerFlag
)
set
(
CMAKE_C_FLAGS
"
-O2
-Wall -fPIC
${
CMAKE_C_FLAGS
}
"
)
set
(
CMAKE_CXX_FLAGS
"
-O2
-Wall -fPIC
${
CMAKE_CXX_FLAGS
}
"
)
set
(
CMAKE_C_FLAGS
"-Wall -fPIC
${
CMAKE_C_FLAGS
}
"
)
set
(
CMAKE_CXX_FLAGS
"-Wall -fPIC
${
CMAKE_CXX_FLAGS
}
"
)
if
(
NOT APPLE
)
set
(
CMAKE_SHARED_LINKER_FLAGS
"-Wl,--warn-common
${
CMAKE_SHARED_LINKER_FLAGS
}
"
)
endif
(
NOT APPLE
)
...
...
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