Skip to content

Commit

Permalink
static?
Browse files Browse the repository at this point in the history
  • Loading branch information
Strilanc committed Dec 14, 2023
1 parent ec541c6 commit 322c5fd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ set_target_properties(libchromobius PROPERTIES PREFIX "")
target_include_directories(libchromobius PUBLIC src)
target_link_libraries(libchromobius PRIVATE libstim libpymatching)
if(NOT(MSVC))
target_compile_options(libchromobius PRIVATE -O3 -Wall -Wpedantic -fPIC -fno-strict-aliasing ${MACHINE_FLAG})
target_compile_options(libchromobius PRIVATE -O3 -Wall -Wpedantic -fPIC -fno-strict-aliasing)
target_link_options(libchromobius PRIVATE -O3)
else()
target_compile_options(libchromobius PRIVATE ${MACHINE_FLAG})
target_compile_options(libchromobius PRIVATE)
endif()
install(TARGETS libchromobius LIBRARY DESTINATION)
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/src/" DESTINATION "include" FILES_MATCHING PATTERN "*.h" PATTERN "*.inl")
Expand All @@ -87,12 +87,12 @@ find_package(GTest QUIET)
if(${GTest_FOUND})
add_executable(chromobius_test ${SOURCE_FILES_NO_MAIN} ${PYMATCHING_SOURCE_FILES_NO_MAIN} ${TEST_FILES})
target_link_libraries(chromobius_test GTest::gtest GTest::gtest_main libstim libpymatching)
target_compile_options(chromobius_test PRIVATE -Wall -Wpedantic -g -fno-omit-frame-pointer -fno-strict-aliasing -fsanitize=undefined -fsanitize=address ${MACHINE_FLAG})
target_compile_options(chromobius_test PRIVATE -Wall -Wpedantic -g -fno-omit-frame-pointer -fno-strict-aliasing -fsanitize=undefined -fsanitize=address)
target_link_options(chromobius_test PRIVATE -g -fno-omit-frame-pointer -fsanitize=undefined -fsanitize=address)

add_executable(chromobius_test_o3 ${SOURCE_FILES_NO_MAIN} ${PYMATCHING_SOURCE_FILES_NO_MAIN} ${TEST_FILES})
target_link_libraries(chromobius_test_o3 GTest::gtest GTest::gtest_main libstim libpymatching)
target_compile_options(chromobius_test_o3 PRIVATE -O3 -Wall -Wpedantic -fno-strict-aliasing ${MACHINE_FLAG})
target_compile_options(chromobius_test_o3 PRIVATE -O3 -Wall -Wpedantic -fno-strict-aliasing)
target_link_options(chromobius_test_o3 PRIVATE)
else()
message("WARNING: Skipped chromobius_test target. `GTest` not found. To fix, follow Standalone CMake Project install instructions at https://github.com/google/googletest/blob/master/googletest/README.md")
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def build_extension(self, ext):
ext.sourcedir,
f"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY={pathlib.Path(self.get_ext_fullpath(ext.name)).parent.absolute()}",
f"-DPYTHON_EXECUTABLE={sys.executable}",
"-DBUILD_SHARED_LIBS=OFF",
*osx_cmake_flags,
*[
env_arg_item
Expand Down

0 comments on commit 322c5fd

Please sign in to comment.