Skip to content

Commit 3306073

Browse files
authored
Making the project tag in simdjson more explicit and disabling LTO (simdjson#452)
* Making the project tag in simdjson more explicit * Let us disable deliberately LTO.
1 parent ab6d487 commit 3306073

2 files changed

Lines changed: 26 additions & 9 deletions

File tree

CMakeLists.txt

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,23 @@
11
cmake_minimum_required(VERSION 3.9) # CMP0069 NEW
2-
include(CheckIPOSupported)
3-
check_ipo_supported(RESULT ltoresult)
4-
if(ltoresult)
5-
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
2+
3+
if (NOT CMAKE_BUILD_TYPE)
4+
message(STATUS "No build type selected, default to Release")
5+
set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE)
66
endif()
77

8+
project(simdjson
9+
DESCRIPTION "Parsing gigabytes of JSON per second"
10+
LANGUAGES CXX
11+
)
12+
13+
# LTO seems to create all sorts of fun problems. Let us
14+
# disable temporarily.
15+
#include(CheckIPOSupported)
16+
#check_ipo_supported(RESULT ltoresult)
17+
#if(ltoresult)
18+
#set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
19+
#endif()
20+
821
# usage: cmake -DSIMDJSON_DISABLE_AVX=on ..
922
option(SIMDJSON_DISABLE_AVX "Forcefully disable AVX even if hardware supports it" OFF)
1023

@@ -14,12 +27,8 @@ set(CMAKE_MACOSX_RPATH OFF)
1427
set(CMAKE_THREAD_PREFER_PTHREAD ON)
1528
set(THREADS_PREFER_PTHREAD_FLAG ON)
1629

17-
if (NOT CMAKE_BUILD_TYPE)
18-
message(STATUS "No build type selected, default to Release")
19-
set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE)
20-
endif()
2130

22-
project(simdjson)
31+
2332
set(SIMDJSON_LIB_NAME simdjson)
2433
set(PROJECT_VERSION_MAJOR 0)
2534
set(PROJECT_VERSION_MINOR 2)

tests/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ if(MSVC)
55
endif()
66

77
add_cpp_test(basictests)
8+
9+
## Next bit should not be needed!
10+
#if(CMAKE_INTERPROCEDURAL_OPTIMIZATION)
11+
# next line is a workaround for an odr-violation in basictests regarding the globals 0x432a40 and 0x52045c under clang
12+
#set_tests_properties(basictests PROPERTIES
13+
# ENVIRONMENT ASAN_OPTIONS="detect_odr_violation=0")
14+
#endif()
15+
816
add_cpp_test(jsoncheck)
917
add_cpp_test(jsonstream_test)
1018
add_cpp_test(pointercheck)

0 commit comments

Comments
 (0)