Skip to content

Commit 6dad6c1

Browse files
committed
Put O2 in build workflow
1 parent 3b2161b commit 6dad6c1

File tree

2 files changed

+3
-12
lines changed

2 files changed

+3
-12
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,23 +41,23 @@ jobs:
4141
name: "Windows/2019/Static/X64/Release",
4242
os: windows-2019,
4343
config: Release,
44-
cmake_extra_args: -G "Visual Studio 16 2019" -A x64,
44+
cmake_extra_args: -G "Visual Studio 16 2019" -A x64 -DCMAKE_CXX_FLAGS="/O2",
4545
sudocmd: "",
4646
artifact_name: "Windows x64",
4747
}
4848
- {
4949
name: "Ubuntu/18.04/Static/X64/Release",
5050
os: ubuntu-18.04,
5151
config: Release,
52-
cmake_extra_args: "-DCMAKE_C_COMPILER=/usr/bin/gcc-8 -DCMAKE_CXX_COMPILER=/usr/bin/g++-8",
52+
cmake_extra_args: "-DCMAKE_C_COMPILER=/usr/bin/gcc-8 -DCMAKE_CXX_COMPILER=/usr/bin/g++-8 -DCMAKE_CXX_FLAGS=\"-O2\"",
5353
sudocmd: "sudo",
5454
artifact_name: "Linux",
5555
}
5656
- {
5757
name: "MacOSX/10.15/Static/X64/Release",
5858
os: macos-10.15,
5959
config: Release,
60-
cmake_extra_args: "",
60+
cmake_extra_args: "-DCMAKE_CXX_FLAGS=\"-O2\"",
6161
sudocmd: "sudo",
6262
artifact_name: "MacOSX",
6363
}

CMakeLists.txt

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,9 @@ option(BUILD_SHARED_LIBS "Build shared libraries" OFF)
3838
option(BUILD_HIGH_RESOLUTION_WORLD_MAP "Compile the high resolution maps for geoplots" ON)
3939
option(BUILD_FOR_DOCUMENTATION_IMAGES "Bypass wait() commands and save figures as .svg at destruction" OFF)
4040
option(BUILD_EXPERIMENTAL_OPENGL_BACKEND "Compile target with the experimental OpenGL backend" OFF)
41-
option(OPTIMIZE_RELEASE_CODE_BY_DEFAULT "Turn on optimization flags by default in Release" OFF)
4241
option(BUILD_WITH_PEDANTIC_WARNINGS "Use pedantic warnings. This is useful for developers because many of these warnings will be in continuous integration anyway." OFF)
4342
option(BUILD_WITH_UTF8 "Accept utf-8 in MSVC by default." ON)
4443

45-
if (OPTIMIZE_RELEASE_CODE_BY_DEFAULT)
46-
if (MSVC)
47-
set(CMAKE_CXX_FLAGS_RELEASE "/O2")
48-
else ()
49-
set(CMAKE_CXX_FLAGS_RELEASE "-O2")
50-
endif ()
51-
endif ()
52-
5344
# Where to find dependencies
5445
option(WITH_SYSTEM_CIMG "Use system-provided CImg.h instead of bundled" OFF)
5546
option(WITH_SYSTEM_NODESOUP "Use system-provided nodesoup instead of bundled" OFF)

0 commit comments

Comments
 (0)