Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion bin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ if(ENABLE_SPIRV)
# Avoid POCL_EXPORT here
target_compile_definitions(spirv_fix_atomic_compare_exchange PRIVATE SPIRV_PARSER_LIB)
else()
add_executable(spirv_fix_atomic_compare_exchange spirv_fix_atomic_compare_exchange.cc)
add_executable(spirv_fix_atomic_compare_exchange spirv_fix_atomic_compare_exchange.cc "${SPVSRC}/spirv_parser.hh" "${SPVSRC}/spirv_parser.cc")
target_compile_definitions(spirv_fix_atomic_compare_exchange PRIVATE SPIRV_PARSER_LIB)
endif()
harden(spirv_fix_atomic_compare_exchange)
target_link_libraries(spirv_fix_atomic_compare_exchange poclu ${OPENCL_LIBS})
Expand Down
2 changes: 1 addition & 1 deletion include/pocl.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
0 marks an invalid/undefined object. */
typedef uint64_t pocl_obj_id_t;

#if defined(EXPORT_POCL_LIB) && defined(_MSC_VER)
#if defined(EXPORT_POCL_LIB) && defined(_WIN32)
/* To successfully export OpenCL API, the dllexport must be placed on
* both the declaration and the definition as MSVC requires that both
* of them have the same attributes.
Expand Down
10 changes: 5 additions & 5 deletions lib/CL/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ else()
endif()

add_library("pocl_cache" OBJECT "pocl_cache.c")
if(BUILD_SHARED_LIBS AND MSVC)
if(BUILD_SHARED_LIBS AND WIN32)
# Inject __declspec(dllexport).
target_compile_definitions("pocl_cache" PRIVATE EXPORT_POCL_LIB)
target_compile_definitions("pocl_cache" INTERFACE IMPORT_POCL_LIB)
Expand Down Expand Up @@ -326,7 +326,7 @@ if (ENABLE_LLVM)
endif()
endif()

if(BUILD_SHARED_LIBS AND MSVC)
if(BUILD_SHARED_LIBS AND WIN32)
# Inject __declspec(dllexport).
target_compile_definitions(lib_cl_llvm PRIVATE EXPORT_POCL_LIB)
target_compile_definitions(lib_cl_llvm INTERFACE IMPORT_POCL_LIB)
Expand Down Expand Up @@ -366,7 +366,7 @@ add_library("libpocl_unlinked_objs" OBJECT ${POCL_LIB_SOURCES})
target_include_directories(libpocl_unlinked_objs
PRIVATE ${CMAKE_SOURCE_DIR}/thirdparty/STC/include)

if(BUILD_SHARED_LIBS AND MSVC)
if(BUILD_SHARED_LIBS AND WIN32)
# Inject __declspec(dllexport).
target_compile_definitions(libpocl_unlinked_objs PRIVATE EXPORT_POCL_LIB)
target_compile_definitions(libpocl_unlinked_objs INTERFACE IMPORT_POCL_LIB)
Expand Down Expand Up @@ -441,7 +441,7 @@ set(POCL_TRANSITIVE_LIBS ${POCL_PRIVATE_LINK_LIST} PARENT_SCOPE)
#################################################################

add_library("${POCL_LIBRARY_NAME}" ${LIBPOCL_OBJS})
if(BUILD_SHARED_LIBS AND MSVC)
if(BUILD_SHARED_LIBS AND WIN32)
# Inject __declspec(dllexport).
target_compile_definitions("${POCL_LIBRARY_NAME}" PRIVATE EXPORT_POCL_LIB)
target_compile_definitions("${POCL_LIBRARY_NAME}" INTERFACE IMPORT_POCL_LIB)
Expand All @@ -460,7 +460,7 @@ if((UNIX AND NOT APPLE) OR (MINGW AND HAVE_LINKER_EXCLUDE_LIBS))
target_link_options("${POCL_LIBRARY_NAME}" PRIVATE "LINKER:--exclude-libs,ALL")
endif()
if(MINGW)
target_link_options("${POCL_LIBRARY_NAME}" PRIVATE "LINKER:--enable-auto-import,--enable-runtime-pseudo-reloc")
target_link_options("${POCL_LIBRARY_NAME}" PRIVATE "LINKER:--exclude-all-symbols,--enable-auto-import,--enable-runtime-pseudo-reloc")
endif()

set_target_properties("${POCL_LIBRARY_NAME}" PROPERTIES SOVERSION "${LIB_API_VERSION}"
Expand Down
Loading